@gajae-code/coding-agent 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/types/cli/skills-cli.d.ts +9 -0
- package/dist/types/commands/skills.d.ts +26 -0
- package/dist/types/config/model-registry.d.ts +31 -2
- package/dist/types/config/models-config-schema.d.ts +39 -0
- package/dist/types/modes/components/model-selector.d.ts +21 -1
- package/dist/types/slash-commands/builtin-registry.d.ts +1 -0
- package/package.json +7 -7
- package/src/cli/args.ts +14 -0
- package/src/cli/skills-cli.ts +88 -0
- package/src/cli.ts +1 -0
- package/src/commands/skills.ts +48 -0
- package/src/commit/agentic/index.ts +1 -0
- package/src/commit/pipeline.ts +1 -0
- package/src/config/model-registry.ts +259 -8
- package/src/config/models-config-schema.ts +18 -0
- package/src/internal-urls/docs-index.generated.ts +1 -1
- package/src/main.ts +10 -1
- package/src/modes/components/model-selector.ts +109 -28
- package/src/modes/controllers/selector-controller.ts +42 -2
- package/src/sdk.ts +1 -0
- package/src/setup/provider-onboarding.ts +2 -0
- package/src/slash-commands/acp-builtins.ts +11 -2
- package/src/slash-commands/builtin-registry.ts +16 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.2.1] - 2026-05-30
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Added a `gjc skills` inspection command so installed binaries can list and read embedded workflow skills from any project without relying on source-tree `.gjc` files.
|
|
10
|
+
- Fixed first-run API provider onboarding so `models.yml` parent directories are created before writing, and malformed `/provicer` startup invocations now report the intended `/provider add` spelling instead of falling through to model bootstrap.
|
|
11
|
+
|
|
5
12
|
## [0.2.0] - 2026-05-28
|
|
6
13
|
|
|
7
14
|
### Added
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inspect bundled workflow skills.
|
|
3
|
+
*/
|
|
4
|
+
import { Command } from "@gajae-code/utils/cli";
|
|
5
|
+
import { type SkillsAction } from "../cli/skills-cli";
|
|
6
|
+
export default class Skills extends Command {
|
|
7
|
+
static description: string;
|
|
8
|
+
static args: {
|
|
9
|
+
action: import("@gajae-code/utils/cli").ArgDescriptor & {
|
|
10
|
+
description: string;
|
|
11
|
+
required: false;
|
|
12
|
+
options: SkillsAction[];
|
|
13
|
+
};
|
|
14
|
+
name: import("@gajae-code/utils/cli").ArgDescriptor & {
|
|
15
|
+
description: string;
|
|
16
|
+
required: false;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
static flags: {
|
|
20
|
+
json: import("@gajae-code/utils/cli").FlagDescriptor<"boolean"> & {
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
static examples: string[];
|
|
25
|
+
run(): Promise<void>;
|
|
26
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Api, type AssistantMessageEventStream, type Context, type Model, type ModelRefreshStrategy, type SimpleStreamOptions, type ThinkingConfig } from "@gajae-code/ai";
|
|
1
|
+
import { type Api, type AssistantMessageEventStream, type Context, type Model, type ModelRefreshStrategy, type ModelRequestTransform, type SimpleStreamOptions, type ThinkingConfig } from "@gajae-code/ai";
|
|
2
2
|
import type { OAuthCredentials, OAuthLoginCallbacks } from "@gajae-code/ai/utils/oauth/types";
|
|
3
3
|
import { type ThemeColor } from "../modes/theme/theme";
|
|
4
4
|
import type { AuthStorage } from "../session/auth-storage";
|
|
@@ -88,6 +88,12 @@ export declare const ModelsConfigFile: ConfigFile<{
|
|
|
88
88
|
discovery?: {
|
|
89
89
|
type: "llama.cpp" | "lm-studio" | "ollama" | "openai-models-list";
|
|
90
90
|
} | undefined;
|
|
91
|
+
requestTransform?: {
|
|
92
|
+
profile?: "openai-proxy" | undefined;
|
|
93
|
+
stripHeaders?: string[] | undefined;
|
|
94
|
+
setHeaders?: Record<string, string | null> | undefined;
|
|
95
|
+
extraBody?: Record<string, unknown> | undefined;
|
|
96
|
+
} | undefined;
|
|
91
97
|
models?: {
|
|
92
98
|
id: string;
|
|
93
99
|
name?: string | undefined;
|
|
@@ -151,6 +157,13 @@ export declare const ModelsConfigFile: ConfigFile<{
|
|
|
151
157
|
toolStrictMode?: "all_strict" | "none" | undefined;
|
|
152
158
|
} | undefined;
|
|
153
159
|
contextPromotionTarget?: string | undefined;
|
|
160
|
+
wireModelId?: string | undefined;
|
|
161
|
+
requestTransform?: {
|
|
162
|
+
profile?: "openai-proxy" | undefined;
|
|
163
|
+
stripHeaders?: string[] | undefined;
|
|
164
|
+
setHeaders?: Record<string, string | null> | undefined;
|
|
165
|
+
extraBody?: Record<string, unknown> | undefined;
|
|
166
|
+
} | undefined;
|
|
154
167
|
}[] | undefined;
|
|
155
168
|
modelOverrides?: Record<string, {
|
|
156
169
|
name?: string | undefined;
|
|
@@ -212,10 +225,21 @@ export declare const ModelsConfigFile: ConfigFile<{
|
|
|
212
225
|
toolStrictMode?: "all_strict" | "none" | undefined;
|
|
213
226
|
} | undefined;
|
|
214
227
|
contextPromotionTarget?: string | undefined;
|
|
228
|
+
wireModelId?: string | undefined;
|
|
229
|
+
requestTransform?: {
|
|
230
|
+
profile?: "openai-proxy" | undefined;
|
|
231
|
+
stripHeaders?: string[] | undefined;
|
|
232
|
+
setHeaders?: Record<string, string | null> | undefined;
|
|
233
|
+
extraBody?: Record<string, unknown> | undefined;
|
|
234
|
+
} | undefined;
|
|
215
235
|
}> | undefined;
|
|
216
236
|
disableStrictTools?: boolean | undefined;
|
|
217
237
|
transport?: "pi-native" | undefined;
|
|
218
238
|
}> | undefined;
|
|
239
|
+
modelBindings?: {
|
|
240
|
+
modelRoles?: Record<string, string> | undefined;
|
|
241
|
+
agentModelOverrides?: Record<string, string> | undefined;
|
|
242
|
+
} | undefined;
|
|
219
243
|
equivalence?: {
|
|
220
244
|
overrides?: Record<string, string> | undefined;
|
|
221
245
|
exclude?: string[] | undefined;
|
|
@@ -229,6 +253,7 @@ interface ProviderOverride {
|
|
|
229
253
|
authHeader?: boolean;
|
|
230
254
|
compat?: Model<Api>["compat"];
|
|
231
255
|
transport?: Model<Api>["transport"];
|
|
256
|
+
requestTransform?: ModelRequestTransform;
|
|
232
257
|
}
|
|
233
258
|
/**
|
|
234
259
|
* Merge a freshly discovered model with the matching bundled/configured entry
|
|
@@ -246,7 +271,7 @@ interface ProviderOverride {
|
|
|
246
271
|
* See `xiaomi-tp-discovery-merge.test.ts` and the `refresh()` baseUrl-override
|
|
247
272
|
* regression in `model-registry.test.ts`.
|
|
248
273
|
*/
|
|
249
|
-
export declare function mergeDiscoveredModel<TApi extends Api>(model: Model<TApi>, existing: Model<Api> | undefined, providerOverride?: Pick<ProviderOverride, "baseUrl" | "headers" | "transport">): Model<TApi>;
|
|
274
|
+
export declare function mergeDiscoveredModel<TApi extends Api>(model: Model<TApi>, existing: Model<Api> | undefined, providerOverride?: Pick<ProviderOverride, "baseUrl" | "headers" | "transport" | "requestTransform">): Model<TApi>;
|
|
250
275
|
export type ProviderDiscoveryStatus = "idle" | "ok" | "empty" | "cached" | "unavailable" | "unauthenticated";
|
|
251
276
|
export interface ProviderDiscoveryState {
|
|
252
277
|
provider: string;
|
|
@@ -281,6 +306,7 @@ export declare class ModelRegistry {
|
|
|
281
306
|
* Get any error from loading models.json (undefined if no error).
|
|
282
307
|
*/
|
|
283
308
|
getError(): ConfigError | undefined;
|
|
309
|
+
applyConfiguredModelBindings(targetSettings: Settings): void;
|
|
284
310
|
/**
|
|
285
311
|
* Get all models (built-in + custom).
|
|
286
312
|
* If models.json had errors, returns only built-in models.
|
|
@@ -364,6 +390,7 @@ export interface ProviderConfigInput {
|
|
|
364
390
|
streamSimple?: (model: Model<Api>, context: Context, options?: SimpleStreamOptions) => AssistantMessageEventStream;
|
|
365
391
|
headers?: Record<string, string>;
|
|
366
392
|
compat?: Model<Api>["compat"];
|
|
393
|
+
requestTransform?: ModelRequestTransform;
|
|
367
394
|
authHeader?: boolean;
|
|
368
395
|
/** Streaming transport override — see {@link Model.transport}. */
|
|
369
396
|
transport?: Model<Api>["transport"];
|
|
@@ -392,6 +419,8 @@ export interface ProviderConfigInput {
|
|
|
392
419
|
maxTokens: number;
|
|
393
420
|
headers?: Record<string, string>;
|
|
394
421
|
compat?: Model<Api>["compat"];
|
|
422
|
+
requestTransform?: ModelRequestTransform;
|
|
423
|
+
wireModelId?: string;
|
|
395
424
|
contextPromotionTarget?: string;
|
|
396
425
|
premiumMultiplier?: number;
|
|
397
426
|
}>;
|
|
@@ -162,6 +162,15 @@ export declare const ModelOverrideSchema: z.ZodObject<{
|
|
|
162
162
|
}>>;
|
|
163
163
|
}, z.core.$strip>>;
|
|
164
164
|
contextPromotionTarget: z.ZodOptional<z.ZodString>;
|
|
165
|
+
wireModelId: z.ZodOptional<z.ZodString>;
|
|
166
|
+
requestTransform: z.ZodOptional<z.ZodObject<{
|
|
167
|
+
profile: z.ZodOptional<z.ZodEnum<{
|
|
168
|
+
"openai-proxy": "openai-proxy";
|
|
169
|
+
}>>;
|
|
170
|
+
stripHeaders: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
171
|
+
setHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>>;
|
|
172
|
+
extraBody: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
173
|
+
}, z.core.$strip>>;
|
|
165
174
|
}, z.core.$strip>;
|
|
166
175
|
export type ModelOverride = z.infer<typeof ModelOverrideSchema>;
|
|
167
176
|
export declare const ProviderDiscoverySchema: z.ZodObject<{
|
|
@@ -262,6 +271,14 @@ export declare const ModelsConfigSchema: z.ZodObject<{
|
|
|
262
271
|
"openai-models-list": "openai-models-list";
|
|
263
272
|
}>;
|
|
264
273
|
}, z.core.$strip>>;
|
|
274
|
+
requestTransform: z.ZodOptional<z.ZodObject<{
|
|
275
|
+
profile: z.ZodOptional<z.ZodEnum<{
|
|
276
|
+
"openai-proxy": "openai-proxy";
|
|
277
|
+
}>>;
|
|
278
|
+
stripHeaders: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
279
|
+
setHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>>;
|
|
280
|
+
extraBody: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
281
|
+
}, z.core.$strip>>;
|
|
265
282
|
models: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
266
283
|
id: z.ZodString;
|
|
267
284
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -382,6 +399,15 @@ export declare const ModelsConfigSchema: z.ZodObject<{
|
|
|
382
399
|
}>>;
|
|
383
400
|
}, z.core.$strip>>;
|
|
384
401
|
contextPromotionTarget: z.ZodOptional<z.ZodString>;
|
|
402
|
+
wireModelId: z.ZodOptional<z.ZodString>;
|
|
403
|
+
requestTransform: z.ZodOptional<z.ZodObject<{
|
|
404
|
+
profile: z.ZodOptional<z.ZodEnum<{
|
|
405
|
+
"openai-proxy": "openai-proxy";
|
|
406
|
+
}>>;
|
|
407
|
+
stripHeaders: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
408
|
+
setHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>>;
|
|
409
|
+
extraBody: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
410
|
+
}, z.core.$strip>>;
|
|
385
411
|
}, z.core.$strip>>>;
|
|
386
412
|
modelOverrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
387
413
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -492,10 +518,23 @@ export declare const ModelsConfigSchema: z.ZodObject<{
|
|
|
492
518
|
}>>;
|
|
493
519
|
}, z.core.$strip>>;
|
|
494
520
|
contextPromotionTarget: z.ZodOptional<z.ZodString>;
|
|
521
|
+
wireModelId: z.ZodOptional<z.ZodString>;
|
|
522
|
+
requestTransform: z.ZodOptional<z.ZodObject<{
|
|
523
|
+
profile: z.ZodOptional<z.ZodEnum<{
|
|
524
|
+
"openai-proxy": "openai-proxy";
|
|
525
|
+
}>>;
|
|
526
|
+
stripHeaders: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
527
|
+
setHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>>;
|
|
528
|
+
extraBody: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
529
|
+
}, z.core.$strip>>;
|
|
495
530
|
}, z.core.$strip>>>;
|
|
496
531
|
disableStrictTools: z.ZodOptional<z.ZodBoolean>;
|
|
497
532
|
transport: z.ZodOptional<z.ZodLiteral<"pi-native">>;
|
|
498
533
|
}, z.core.$strip>>>;
|
|
534
|
+
modelBindings: z.ZodOptional<z.ZodObject<{
|
|
535
|
+
modelRoles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
536
|
+
agentModelOverrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
537
|
+
}, z.core.$strip>>;
|
|
499
538
|
equivalence: z.ZodOptional<z.ZodObject<{
|
|
500
539
|
overrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
501
540
|
exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -5,6 +5,26 @@ import type { GjcModelAssignmentTargetId, ModelRegistry } from "../../config/mod
|
|
|
5
5
|
import { type ScopedModelSelection } from "../../config/model-resolver";
|
|
6
6
|
import type { Settings } from "../../config/settings";
|
|
7
7
|
type ScopedModelItem = ScopedModelSelection;
|
|
8
|
+
export interface ModelAssignmentPreset {
|
|
9
|
+
id: "openai-codex";
|
|
10
|
+
label: string;
|
|
11
|
+
description: string;
|
|
12
|
+
assignments: Partial<Record<GjcModelAssignmentTargetId, ThinkingLevel>>;
|
|
13
|
+
}
|
|
14
|
+
export type ModelSelectorSelection = {
|
|
15
|
+
kind: "assignment";
|
|
16
|
+
model: Model;
|
|
17
|
+
role: GjcModelAssignmentTargetId | null;
|
|
18
|
+
thinkingLevel?: ThinkingLevel;
|
|
19
|
+
selector?: string;
|
|
20
|
+
} | {
|
|
21
|
+
kind: "preset";
|
|
22
|
+
model: Model;
|
|
23
|
+
selector: string;
|
|
24
|
+
preset: ModelAssignmentPreset;
|
|
25
|
+
assignments: Record<GjcModelAssignmentTargetId, ThinkingLevel>;
|
|
26
|
+
};
|
|
27
|
+
type RoleSelectCallback = (selection: ModelSelectorSelection) => void;
|
|
8
28
|
/**
|
|
9
29
|
* Component that renders a canonical model selector with provider tabs.
|
|
10
30
|
* - Tab/Arrow Left/Right: Switch between provider tabs
|
|
@@ -14,7 +34,7 @@ type ScopedModelItem = ScopedModelSelection;
|
|
|
14
34
|
*/
|
|
15
35
|
export declare class ModelSelectorComponent extends Container {
|
|
16
36
|
#private;
|
|
17
|
-
constructor(tui: TUI, _currentModel: Model | undefined, settings: Settings, modelRegistry: ModelRegistry, scopedModels: ReadonlyArray<ScopedModelItem>, onSelect:
|
|
37
|
+
constructor(tui: TUI, _currentModel: Model | undefined, settings: Settings, modelRegistry: ModelRegistry, scopedModels: ReadonlyArray<ScopedModelItem>, onSelect: RoleSelectCallback, onCancel: () => void, options?: {
|
|
18
38
|
temporaryOnly?: boolean;
|
|
19
39
|
initialSearchInput?: string;
|
|
20
40
|
});
|
|
@@ -2,6 +2,7 @@ import type { BuiltinSlashCommand, ParsedSlashCommand, SlashCommandResult, Slash
|
|
|
2
2
|
export type { BuiltinSlashCommand, SubcommandDef } from "./types";
|
|
3
3
|
/** TUI-specific runtime accepted by `executeBuiltinSlashCommand`. */
|
|
4
4
|
export type BuiltinSlashCommandRuntime = TuiSlashCommandRuntime;
|
|
5
|
+
export declare function formatUnknownBuiltinSlashCommandDiagnostic(commandName: string): string | undefined;
|
|
5
6
|
/** Builtin command metadata used for slash-command autocomplete and help text. */
|
|
6
7
|
export declare const BUILTIN_SLASH_COMMAND_DEFS: ReadonlyArray<BuiltinSlashCommand>;
|
|
7
8
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@gajae-code/coding-agent",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.1",
|
|
5
5
|
"description": "Gajae Code CLI with read, bash, edit, write tools and session management",
|
|
6
6
|
"homepage": "https://gaebal-gajae.dev",
|
|
7
7
|
"author": "Yeachan-Heo",
|
|
@@ -48,12 +48,12 @@
|
|
|
48
48
|
"@agentclientprotocol/sdk": "0.21.0",
|
|
49
49
|
"@babel/parser": "^7.29.3",
|
|
50
50
|
"@mozilla/readability": "^0.6.0",
|
|
51
|
-
"@gajae-code/stats": "0.2.
|
|
52
|
-
"@gajae-code/agent-core": "0.2.
|
|
53
|
-
"@gajae-code/ai": "0.2.
|
|
54
|
-
"@gajae-code/natives": "0.2.
|
|
55
|
-
"@gajae-code/tui": "0.2.
|
|
56
|
-
"@gajae-code/utils": "0.2.
|
|
51
|
+
"@gajae-code/stats": "0.2.1",
|
|
52
|
+
"@gajae-code/agent-core": "0.2.1",
|
|
53
|
+
"@gajae-code/ai": "0.2.1",
|
|
54
|
+
"@gajae-code/natives": "0.2.1",
|
|
55
|
+
"@gajae-code/tui": "0.2.1",
|
|
56
|
+
"@gajae-code/utils": "0.2.1",
|
|
57
57
|
"@puppeteer/browsers": "^2.13.0",
|
|
58
58
|
"@types/turndown": "5.0.6",
|
|
59
59
|
"@xterm/headless": "^6.0.0",
|
package/src/cli/args.ts
CHANGED
|
@@ -55,6 +55,15 @@ export interface Args {
|
|
|
55
55
|
unknownFlags: Map<string, boolean | string>;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
function isStartupSlashCommandArg(arg: string | undefined): boolean {
|
|
59
|
+
return (
|
|
60
|
+
arg === "/provider" ||
|
|
61
|
+
arg?.startsWith("/provider:") === true ||
|
|
62
|
+
arg === "/provicer" ||
|
|
63
|
+
arg?.startsWith("/provicer:") === true
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
58
67
|
export function parseArgs(args: string[]): Args {
|
|
59
68
|
const result: Args = {
|
|
60
69
|
messages: [],
|
|
@@ -65,6 +74,11 @@ export function parseArgs(args: string[]): Args {
|
|
|
65
74
|
for (let i = 0; i < args.length; i++) {
|
|
66
75
|
let arg = args[i];
|
|
67
76
|
|
|
77
|
+
if (isStartupSlashCommandArg(arg)) {
|
|
78
|
+
result.messages.push(args.slice(i).join(" "));
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
|
|
68
82
|
// Support --flag=value syntax (e.g. --tools=ask,read)
|
|
69
83
|
if (arg.startsWith("--") && arg.includes("=")) {
|
|
70
84
|
const eqIdx = arg.indexOf("=");
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handles `gjc skills` for inspecting bundled workflow skill definitions.
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
DEFAULT_GJC_DEFINITION_NAMES,
|
|
6
|
+
type EmbeddedDefaultGjcSkill,
|
|
7
|
+
getEmbeddedDefaultGjcSkills,
|
|
8
|
+
} from "../defaults/gjc-defaults";
|
|
9
|
+
|
|
10
|
+
export type SkillsAction = "list" | "read";
|
|
11
|
+
|
|
12
|
+
export interface SkillsCommandArgs {
|
|
13
|
+
action: SkillsAction;
|
|
14
|
+
name?: string;
|
|
15
|
+
flags?: {
|
|
16
|
+
json?: boolean;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface SkillsListEntry {
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
path: string;
|
|
24
|
+
source: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface SkillsReadEntry extends SkillsListEntry {
|
|
28
|
+
content: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function getEmbeddedSkill(name: string): EmbeddedDefaultGjcSkill | undefined {
|
|
32
|
+
return getEmbeddedDefaultGjcSkills().find(skill => skill.name === name);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function listEmbeddedSkills(): SkillsListEntry[] {
|
|
36
|
+
return getEmbeddedDefaultGjcSkills().map(skill => ({
|
|
37
|
+
name: skill.name,
|
|
38
|
+
description: skill.description,
|
|
39
|
+
path: skill.filePath,
|
|
40
|
+
source: skill.source,
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function writeJson(value: unknown): void {
|
|
45
|
+
process.stdout.write(`${JSON.stringify(value, null, 2)}\n`);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export async function runSkillsCommand(cmd: SkillsCommandArgs): Promise<void> {
|
|
49
|
+
if (cmd.action === "list") {
|
|
50
|
+
const skills = listEmbeddedSkills();
|
|
51
|
+
if (cmd.flags?.json) {
|
|
52
|
+
writeJson({ skills });
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
for (const skill of skills) {
|
|
56
|
+
process.stdout.write(`${skill.name}\t${skill.description}\t${skill.path}\n`);
|
|
57
|
+
}
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const name = cmd.name?.trim();
|
|
62
|
+
if (!name) {
|
|
63
|
+
process.stderr.write(`error: skill name is required for read (${DEFAULT_GJC_DEFINITION_NAMES.join(", ")})\n`);
|
|
64
|
+
process.exitCode = 1;
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const skill = getEmbeddedSkill(name);
|
|
69
|
+
if (!skill) {
|
|
70
|
+
process.stderr.write(`error: unknown embedded skill "${name}" (${DEFAULT_GJC_DEFINITION_NAMES.join(", ")})\n`);
|
|
71
|
+
process.exitCode = 1;
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const entry: SkillsReadEntry = {
|
|
76
|
+
name: skill.name,
|
|
77
|
+
description: skill.description,
|
|
78
|
+
path: skill.filePath,
|
|
79
|
+
source: skill.source,
|
|
80
|
+
content: skill.content,
|
|
81
|
+
};
|
|
82
|
+
if (cmd.flags?.json) {
|
|
83
|
+
writeJson(entry);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
process.stdout.write(skill.content);
|
|
87
|
+
if (!skill.content.endsWith("\n")) process.stdout.write("\n");
|
|
88
|
+
}
|
package/src/cli.ts
CHANGED
|
@@ -34,6 +34,7 @@ const commands: CommandEntry[] = [
|
|
|
34
34
|
{ name: "question", load: () => import("./commands/question").then(m => m.default) },
|
|
35
35
|
{ name: "state", load: () => import("./commands/state").then(m => m.default) },
|
|
36
36
|
{ name: "setup", load: () => import("./commands/setup").then(m => m.default) },
|
|
37
|
+
{ name: "skills", load: () => import("./commands/skills").then(m => m.default) },
|
|
37
38
|
{ name: "team", load: () => import("./commands/team").then(m => m.default) },
|
|
38
39
|
{ name: "ultragoal", load: () => import("./commands/ultragoal").then(m => m.default) },
|
|
39
40
|
{ name: "ralplan", load: () => import("./commands/ralplan").then(m => m.default) },
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inspect bundled workflow skills.
|
|
3
|
+
*/
|
|
4
|
+
import { Args, Command, Flags, renderCommandHelp } from "@gajae-code/utils/cli";
|
|
5
|
+
import { runSkillsCommand, type SkillsAction, type SkillsCommandArgs } from "../cli/skills-cli";
|
|
6
|
+
|
|
7
|
+
const ACTIONS: SkillsAction[] = ["list", "read"];
|
|
8
|
+
|
|
9
|
+
export default class Skills extends Command {
|
|
10
|
+
static description = "Inspect bundled GJC workflow skills";
|
|
11
|
+
|
|
12
|
+
static args = {
|
|
13
|
+
action: Args.string({
|
|
14
|
+
description: "Skills action",
|
|
15
|
+
required: false,
|
|
16
|
+
options: ACTIONS,
|
|
17
|
+
}),
|
|
18
|
+
name: Args.string({
|
|
19
|
+
description: "Bundled skill name to read",
|
|
20
|
+
required: false,
|
|
21
|
+
}),
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
static flags = {
|
|
25
|
+
json: Flags.boolean({ description: "Output JSON" }),
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
static examples = [
|
|
29
|
+
"# List bundled workflow skills\n gjc skills list",
|
|
30
|
+
"# Read an embedded workflow skill without requiring .gjc files\n gjc skills read ultragoal",
|
|
31
|
+
"# Machine-readable embedded skill content\n gjc skills read ralplan --json",
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
async run(): Promise<void> {
|
|
35
|
+
const { args, flags } = await this.parse(Skills);
|
|
36
|
+
if (!args.action) {
|
|
37
|
+
renderCommandHelp("gjc", "skills", Skills);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const cmd: SkillsCommandArgs = {
|
|
42
|
+
action: args.action as SkillsAction,
|
|
43
|
+
name: args.name,
|
|
44
|
+
flags: { json: flags.json },
|
|
45
|
+
};
|
|
46
|
+
await runSkillsCommand(cmd);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -31,6 +31,7 @@ export async function runAgenticCommit(args: CommitCommandArgs): Promise<void> {
|
|
|
31
31
|
process.stdout.write("● Resolving model...\n");
|
|
32
32
|
const modelRegistry = new ModelRegistry(authStorage);
|
|
33
33
|
await modelRegistry.refresh();
|
|
34
|
+
modelRegistry.applyConfiguredModelBindings(settings);
|
|
34
35
|
const stagedFilesPromise = (async () => {
|
|
35
36
|
let stagedFiles = await git.diff.changedFiles(cwd, { cached: true });
|
|
36
37
|
if (stagedFiles.length === 0) {
|
package/src/commit/pipeline.ts
CHANGED
|
@@ -45,6 +45,7 @@ async function runLegacyCommitCommand(args: CommitCommandArgs): Promise<void> {
|
|
|
45
45
|
const authStorage = await discoverAuthStorage();
|
|
46
46
|
const modelRegistry = new ModelRegistry(authStorage);
|
|
47
47
|
await modelRegistry.refresh();
|
|
48
|
+
modelRegistry.applyConfiguredModelBindings(settings);
|
|
48
49
|
|
|
49
50
|
const {
|
|
50
51
|
model: primaryModel,
|