mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-18 18:32:28 +08:00
feat: add Factory Droid host type, preamble, and co-author trailer
- Add 'factory' to Host union type with .factory/skills/gstack paths - Extend preamble runtime root detection for Factory ($HOME/.factory/) - Add GSTACK_DESIGN env var to preamble (was missing for Codex too) - Add Factory Droid co-author trailer for git commits Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -13,12 +13,14 @@ import type { TemplateContext } from './types';
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
function generatePreambleBash(ctx: TemplateContext): string {
|
function generatePreambleBash(ctx: TemplateContext): string {
|
||||||
const runtimeRoot = ctx.host === 'codex'
|
const hostConfigDir: Record<string, string> = { codex: '.codex', factory: '.factory' };
|
||||||
|
const runtimeRoot = (ctx.host !== 'claude')
|
||||||
? `_ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
|
? `_ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
|
||||||
GSTACK_ROOT="$HOME/.codex/skills/gstack"
|
GSTACK_ROOT="$HOME/${hostConfigDir[ctx.host]}/skills/gstack"
|
||||||
[ -n "$_ROOT" ] && [ -d "$_ROOT/.agents/skills/gstack" ] && GSTACK_ROOT="$_ROOT/.agents/skills/gstack"
|
[ -n "$_ROOT" ] && [ -d "$_ROOT/${ctx.paths.localSkillRoot}" ] && GSTACK_ROOT="$_ROOT/${ctx.paths.localSkillRoot}"
|
||||||
GSTACK_BIN="$GSTACK_ROOT/bin"
|
GSTACK_BIN="$GSTACK_ROOT/bin"
|
||||||
GSTACK_BROWSE="$GSTACK_ROOT/browse/dist"
|
GSTACK_BROWSE="$GSTACK_ROOT/browse/dist"
|
||||||
|
GSTACK_DESIGN="$GSTACK_ROOT/design/dist"
|
||||||
`
|
`
|
||||||
: '';
|
: '';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
export type Host = 'claude' | 'codex';
|
export type Host = 'claude' | 'codex' | 'factory';
|
||||||
|
|
||||||
export interface HostPaths {
|
export interface HostPaths {
|
||||||
skillRoot: string;
|
skillRoot: string;
|
||||||
@@ -23,6 +23,13 @@ export const HOST_PATHS: Record<Host, HostPaths> = {
|
|||||||
browseDir: '$GSTACK_BROWSE',
|
browseDir: '$GSTACK_BROWSE',
|
||||||
designDir: '$GSTACK_DESIGN',
|
designDir: '$GSTACK_DESIGN',
|
||||||
},
|
},
|
||||||
|
factory: {
|
||||||
|
skillRoot: '$GSTACK_ROOT',
|
||||||
|
localSkillRoot: '.factory/skills/gstack',
|
||||||
|
binDir: '$GSTACK_BIN',
|
||||||
|
browseDir: '$GSTACK_BROWSE',
|
||||||
|
designDir: '$GSTACK_DESIGN',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface TemplateContext {
|
export interface TemplateContext {
|
||||||
|
|||||||
@@ -370,5 +370,8 @@ export function generateCoAuthorTrailer(ctx: TemplateContext): string {
|
|||||||
if (ctx.host === 'codex') {
|
if (ctx.host === 'codex') {
|
||||||
return 'Co-Authored-By: OpenAI Codex <noreply@openai.com>';
|
return 'Co-Authored-By: OpenAI Codex <noreply@openai.com>';
|
||||||
}
|
}
|
||||||
|
if (ctx.host === 'factory') {
|
||||||
|
return 'Co-Authored-By: Factory Droid <droid@users.noreply.github.com>';
|
||||||
|
}
|
||||||
return 'Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>';
|
return 'Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user