Some checks failed
Workflow Lint / actionlint (push) Has been cancelled
Build CI Image / build (push) Has been cancelled
Skill Docs Freshness / check-freshness (push) Has been cancelled
Periodic Evals / build-image (push) Has been cancelled
Periodic Evals / evals (map[file:test/codex-e2e.test.ts name:e2e-codex]) (push) Has been cancelled
Periodic Evals / evals (map[file:test/gemini-e2e.test.ts name:e2e-gemini]) (push) Has been cancelled
Periodic Evals / evals (map[file:test/skill-e2e-design.test.ts name:e2e-design]) (push) Has been cancelled
Periodic Evals / evals (map[file:test/skill-e2e-plan.test.ts name:e2e-plan]) (push) Has been cancelled
Periodic Evals / evals (map[file:test/skill-e2e-qa-bugs.test.ts name:e2e-qa-bugs]) (push) Has been cancelled
Periodic Evals / evals (map[file:test/skill-e2e-qa-workflow.test.ts name:e2e-qa-workflow]) (push) Has been cancelled
Periodic Evals / evals (map[file:test/skill-e2e-review.test.ts name:e2e-review]) (push) Has been cancelled
Periodic Evals / evals (map[file:test/skill-e2e-workflow.test.ts name:e2e-workflow]) (push) Has been cancelled
Periodic Evals / evals (map[file:test/skill-routing-e2e.test.ts name:e2e-routing]) (push) Has been cancelled
Source: https://github.com/garrytan/gstack/commit/026751e
69 lines
2.2 KiB
TypeScript
69 lines
2.2 KiB
TypeScript
import { ALL_HOST_CONFIGS } from '../../hosts/index';
|
|
|
|
/**
|
|
* Host type — derived from host configs in hosts/*.ts.
|
|
* Adding a new host: create hosts/myhost.ts + add to hosts/index.ts.
|
|
* Do NOT hardcode host names here.
|
|
*/
|
|
export type Host = (typeof ALL_HOST_CONFIGS)[number]['name'];
|
|
|
|
export interface HostPaths {
|
|
skillRoot: string;
|
|
localSkillRoot: string;
|
|
binDir: string;
|
|
browseDir: string;
|
|
designDir: string;
|
|
makePdfDir: string;
|
|
}
|
|
|
|
/**
|
|
* HOST_PATHS — derived from host configs.
|
|
* Each config's globalRoot/localSkillRoot determines the path structure.
|
|
* Non-Claude hosts use $GSTACK_ROOT env vars (set by preamble).
|
|
*/
|
|
function buildHostPaths(): Record<string, HostPaths> {
|
|
const paths: Record<string, HostPaths> = {};
|
|
for (const config of ALL_HOST_CONFIGS) {
|
|
if (config.usesEnvVars) {
|
|
paths[config.name] = {
|
|
skillRoot: '$GSTACK_ROOT',
|
|
localSkillRoot: config.localSkillRoot,
|
|
binDir: '$GSTACK_BIN',
|
|
browseDir: '$GSTACK_BROWSE',
|
|
designDir: '$GSTACK_DESIGN',
|
|
makePdfDir: '$GSTACK_MAKE_PDF',
|
|
};
|
|
} else {
|
|
const root = `~/${config.globalRoot}`;
|
|
paths[config.name] = {
|
|
skillRoot: root,
|
|
localSkillRoot: config.localSkillRoot,
|
|
binDir: `${root}/bin`,
|
|
browseDir: `${root}/browse/dist`,
|
|
designDir: `${root}/design/dist`,
|
|
makePdfDir: `${root}/make-pdf/dist`,
|
|
};
|
|
}
|
|
}
|
|
return paths;
|
|
}
|
|
|
|
export const HOST_PATHS: Record<string, HostPaths> = buildHostPaths();
|
|
|
|
import type { Model } from '../models';
|
|
export type { Model } from '../models';
|
|
|
|
export interface TemplateContext {
|
|
skillName: string;
|
|
tmplPath: string;
|
|
benefitsFrom?: string[];
|
|
host: Host;
|
|
paths: HostPaths;
|
|
preambleTier?: number; // 1-4, controls which preamble sections are included
|
|
model?: Model; // model family for behavioral overlay. Omitted/undefined → no overlay.
|
|
interactive?: boolean; // true → emit plan-mode handshake in preamble. Generator-only, not written to SKILL.md.
|
|
}
|
|
|
|
/** Resolver function signature. args is populated for parameterized placeholders like {{INVOKE_SKILL:name}}. */
|
|
export type ResolverFn = (ctx: TemplateContext, args?: string[]) => string;
|