@gajae-code/coding-agent 0.12.21 → 0.13.0
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 +67 -2
- package/dist/types/cli/args.d.ts +5 -2
- package/dist/types/cli/root-flags.d.ts +246 -0
- package/dist/types/cli.d.ts +11 -19
- package/dist/types/commands/daemon.d.ts +0 -30
- package/dist/types/commands/launch.d.ts +11 -19
- package/dist/types/commands/quick-lane.d.ts +32 -0
- package/dist/types/commands/sdk.d.ts +21 -15
- package/dist/types/config/file-lock-gc.d.ts +2 -0
- package/dist/types/config/model-equivalence.d.ts +20 -0
- package/dist/types/config/model-profile-activation.d.ts +62 -17
- package/dist/types/config/model-profiles.d.ts +10 -0
- package/dist/types/config/model-registry.d.ts +68 -1
- package/dist/types/config/model-resolver.d.ts +15 -4
- package/dist/types/config/models-config-schema.d.ts +7 -2
- package/dist/types/config/provider-selection-policy.d.ts +62 -0
- package/dist/types/config/settings-schema.d.ts +36 -78
- package/dist/types/config/settings.d.ts +2 -0
- package/dist/types/edit/renderer.d.ts +5 -2
- package/dist/types/edit/streaming.d.ts +13 -0
- package/dist/types/extensibility/custom-tools/types.d.ts +2 -0
- package/dist/types/extensibility/extensions/compact-handler.d.ts +2 -1
- package/dist/types/extensibility/extensions/types.d.ts +3 -0
- package/dist/types/gjc-runtime/gc-runtime.d.ts +19 -5
- package/dist/types/internal-urls/local-protocol.d.ts +1 -0
- package/dist/types/modes/components/model-selector.d.ts +0 -2
- package/dist/types/modes/components/provider-order-context.d.ts +45 -0
- package/dist/types/modes/components/provider-order-editor.d.ts +24 -0
- package/dist/types/modes/components/settings-defs.d.ts +5 -1
- package/dist/types/modes/components/settings-selector.d.ts +2 -0
- package/dist/types/quick-lane/classify.d.ts +40 -0
- package/dist/types/runtime/stt-settings-setup.d.ts +18 -0
- package/dist/types/sdk/broker/broker.d.ts +56 -2
- package/dist/types/sdk/broker/operation-receipt-ledger.d.ts +25 -0
- package/dist/types/sdk/broker/session-index.d.ts +83 -2
- package/dist/types/sdk/broker/state-version.d.ts +1 -1
- package/dist/types/sdk/bus/notification-service.d.ts +6 -0
- package/dist/types/sdk/bus/prompt-reconciliation.d.ts +8 -1
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +4 -1
- package/dist/types/sdk/bus/telegram-daemon.d.ts +26 -0
- package/dist/types/sdk/cli/rows.d.ts +98 -0
- package/dist/types/sdk/cli/session-cli.d.ts +35 -3
- package/dist/types/sdk/elevation/allowlist.d.ts +20 -0
- package/dist/types/sdk/elevation/audit.d.ts +93 -0
- package/dist/types/sdk/elevation/capability.d.ts +3 -0
- package/dist/types/sdk/elevation/digest.d.ts +72 -0
- package/dist/types/sdk/elevation/dispatch-receipt.d.ts +85 -0
- package/dist/types/sdk/elevation/grant-ledger.d.ts +163 -0
- package/dist/types/sdk/elevation/owner.d.ts +48 -0
- package/dist/types/sdk/guides/cache.d.ts +98 -0
- package/dist/types/sdk/guides/catalog.d.ts +156 -0
- package/dist/types/sdk/guides/cli.d.ts +39 -0
- package/dist/types/sdk/guides/manifest.d.ts +66 -0
- package/dist/types/sdk/guides/verify.d.ts +66 -0
- package/dist/types/sdk/host/control/dispatch.d.ts +8 -0
- package/dist/types/sdk/host/control/index.d.ts +1 -1
- package/dist/types/sdk/host/control/operations.d.ts +3 -2
- package/dist/types/sdk/host/query/cursor.d.ts +10 -0
- package/dist/types/sdk/host/query/handlers.d.ts +21 -0
- package/dist/types/sdk/host/session-runtime.d.ts +9 -0
- package/dist/types/sdk/mcp/server.d.ts +2 -2
- package/dist/types/sdk/prompt-status.d.ts +11 -0
- package/dist/types/sdk/session.d.ts +4 -0
- package/dist/types/sdk/transport/index.d.ts +1 -0
- package/dist/types/sdk/transport/relay.d.ts +1 -0
- package/dist/types/sdk/transport/serve-cli.d.ts +20 -1
- package/dist/types/session/agent-session.d.ts +32 -18
- package/dist/types/session/blob-store.d.ts +13 -7
- package/dist/types/session/fallback-chain-controller.d.ts +15 -0
- package/dist/types/session/internal/managed-session-storage.d.ts +25 -1
- package/dist/types/session/internal/session-memory-sidecar.d.ts +5 -5
- package/dist/types/session/session-manager.d.ts +139 -10
- package/dist/types/session/session-storage.d.ts +48 -0
- package/dist/types/setup/provider-onboarding.d.ts +7 -1
- package/dist/types/slash-commands/builtin-registry.d.ts +14 -0
- package/dist/types/stt/setup.d.ts +2 -0
- package/dist/types/task/executor.d.ts +10 -2
- package/dist/types/tools/browser/runtime-diagnostics.d.ts +65 -0
- package/dist/types/tools/browser/tab-protocol.d.ts +4 -0
- package/dist/types/tools/browser/tab-supervisor.d.ts +2 -0
- package/dist/types/tools/browser/tab-worker.d.ts +2 -0
- package/dist/types/tools/browser.d.ts +2 -0
- package/dist/types/tools/image-gen.d.ts +14 -18
- package/dist/types/tools/index.d.ts +2 -0
- package/dist/types/tools/resource-gc.d.ts +2 -0
- package/dist/types/utils/pasted-image-path.d.ts +6 -0
- package/package.json +9 -9
- package/scripts/generate-sdk-operation-inventory.ts +8 -0
- package/scripts/run-test-manifest.ts +61 -21
- package/scripts/verify-gjc-sdk-canonicalization.ts +9 -4
- package/src/cli/args.ts +62 -9
- package/src/cli/completion-cli.ts +1 -0
- package/src/cli/fast-help.ts +1 -0
- package/src/cli/root-flags.ts +100 -0
- package/src/cli/setup-cli.ts +6 -2
- package/src/cli.ts +42 -65
- package/src/commands/acp.ts +1 -1
- package/src/commands/daemon.ts +2 -31
- package/src/commands/gc.ts +1 -1
- package/src/commands/launch.ts +8 -129
- package/src/commands/quick-lane.ts +51 -0
- package/src/commands/sdk.ts +200 -26
- package/src/commands/setup.ts +4 -2
- package/src/config/file-lock-gc.ts +4 -1
- package/src/config/model-equivalence.ts +76 -7
- package/src/config/model-profile-activation.ts +1115 -265
- package/src/config/model-profiles.ts +134 -2
- package/src/config/model-registry.ts +352 -50
- package/src/config/model-resolver.ts +289 -38
- package/src/config/models-config-schema.ts +11 -4
- package/src/config/provider-selection-policy.ts +146 -0
- package/src/config/settings-schema.ts +50 -77
- package/src/config/settings.ts +40 -0
- package/src/coordinator-mcp/server.ts +32 -2
- package/src/edit/renderer.ts +175 -223
- package/src/edit/streaming.ts +108 -1
- package/src/export/html/index.ts +57 -7
- package/src/extensibility/custom-tools/types.ts +2 -0
- package/src/extensibility/extensions/compact-handler.ts +3 -2
- package/src/extensibility/extensions/runner.ts +6 -0
- package/src/extensibility/extensions/types.ts +3 -0
- package/src/gjc-runtime/gc-runtime.ts +379 -20
- package/src/gjc-runtime/launch-worktree.ts +5 -1
- package/src/gjc-runtime/team-runtime.ts +59 -2
- package/src/gjc-runtime/tmux-owner-isolation.ts +19 -0
- package/src/gjc-runtime/ultragoal-receipt-freshness.ts +16 -1
- package/src/internal-urls/docs-index.generated.ts +17 -13
- package/src/internal-urls/local-protocol.ts +1 -0
- package/src/main.ts +40 -3
- package/src/memories/index.ts +4 -2
- package/src/modes/acp/acp-agent.ts +235 -91
- package/src/modes/components/model-selector.ts +206 -42
- package/src/modes/components/provider-order-context.ts +197 -0
- package/src/modes/components/provider-order-editor.ts +441 -0
- package/src/modes/components/settings-defs.ts +21 -1
- package/src/modes/components/settings-selector.ts +45 -2
- package/src/modes/components/tool-execution.ts +47 -15
- package/src/modes/controllers/command-controller.ts +6 -3
- package/src/modes/controllers/extension-ui-controller.ts +2 -0
- package/src/modes/controllers/input-controller.ts +73 -2
- package/src/modes/controllers/selector-controller.ts +260 -153
- package/src/modes/prompt-suggestion-controller.ts +1 -1
- package/src/modes/runtime-init.ts +1 -0
- package/src/modes/utils/ui-helpers.ts +18 -0
- package/src/prompts/tools/browser.md +1 -0
- package/src/quick-lane/classify.ts +257 -0
- package/src/rlm/index.ts +1 -1
- package/src/runtime/stt-settings-setup.ts +57 -0
- package/src/sdk/acp/adapter.ts +2 -1
- package/src/sdk/broker/broker.ts +780 -12
- package/src/sdk/broker/lifecycle.ts +70 -29
- package/src/sdk/broker/operation-receipt-ledger.ts +144 -0
- package/src/sdk/broker/session-index.ts +463 -48
- package/src/sdk/broker/state-version.ts +13 -9
- package/src/sdk/broker/transport.ts +14 -1
- package/src/sdk/bus/index.ts +34 -13
- package/src/sdk/bus/kind-aware-reconciliation.ts +21 -2
- package/src/sdk/bus/notification-service.ts +47 -1
- package/src/sdk/bus/prompt-reconciliation.ts +22 -3
- package/src/sdk/bus/telegram-daemon-contract.ts +4 -1
- package/src/sdk/bus/telegram-daemon.ts +54 -3
- package/src/sdk/cli/rows.ts +247 -0
- package/src/sdk/cli/session-cli.ts +930 -79
- package/src/sdk/elevation/allowlist.ts +54 -0
- package/src/sdk/elevation/audit.ts +208 -0
- package/src/sdk/elevation/capability.ts +41 -0
- package/src/sdk/elevation/digest.ts +129 -0
- package/src/sdk/elevation/dispatch-receipt.ts +184 -0
- package/src/sdk/elevation/grant-ledger.ts +1142 -0
- package/src/sdk/elevation/owner.ts +109 -0
- package/src/sdk/guides/cache.ts +363 -0
- package/src/sdk/guides/catalog.ts +554 -0
- package/src/sdk/guides/cli.ts +235 -0
- package/src/sdk/guides/manifest.ts +152 -0
- package/src/sdk/guides/verify.ts +178 -0
- package/src/sdk/host/control/dispatch.ts +49 -1
- package/src/sdk/host/control/index.ts +1 -0
- package/src/sdk/host/control/operations.ts +8 -1
- package/src/sdk/host/query/cursor.ts +47 -3
- package/src/sdk/host/query/handlers.ts +155 -2
- package/src/sdk/host/sdk-surface-parity.test.ts +1 -0
- package/src/sdk/host/session-runtime.test.ts +391 -1
- package/src/sdk/host/session-runtime.ts +308 -73
- package/src/sdk/host/surface-policy.ts +3 -0
- package/src/sdk/host/websocket-transport.ts +7 -1
- package/src/sdk/mcp/server.ts +88 -15
- package/src/sdk/prompt-status.ts +8 -0
- package/src/sdk/protocol/operation-inventory.generated.json +62 -0
- package/src/sdk/protocol/operation-registry.ts +3 -2
- package/src/sdk/session.ts +87 -39
- package/src/sdk/transport/index.ts +1 -0
- package/src/sdk/transport/relay.ts +3 -0
- package/src/sdk/transport/serve-cli.ts +111 -24
- package/src/secrets/obfuscator.ts +92 -12
- package/src/session/agent-session.ts +322 -93
- package/src/session/blob-store.ts +60 -8
- package/src/session/fallback-chain-controller.ts +35 -0
- package/src/session/internal/managed-session-scope.ts +25 -3
- package/src/session/internal/managed-session-storage.ts +574 -73
- package/src/session/internal/session-memory-sidecar.ts +19 -29
- package/src/session/session-manager.ts +2166 -743
- package/src/session/session-storage.ts +715 -48
- package/src/setup/provider-onboarding.ts +19 -3
- package/src/setup/provider-presets.json +3 -1
- package/src/slash-commands/builtin-registry.ts +85 -3
- package/src/stt/downloader.ts +2 -3
- package/src/stt/setup.ts +29 -4
- package/src/task/executor.ts +22 -18
- package/src/task/index.ts +24 -1
- package/src/tools/archive-reader.ts +11 -2
- package/src/tools/browser/runtime-diagnostics.ts +249 -0
- package/src/tools/browser/tab-protocol.ts +4 -0
- package/src/tools/browser/tab-supervisor.ts +5 -0
- package/src/tools/browser/tab-worker.ts +36 -1
- package/src/tools/browser.ts +7 -0
- package/src/tools/image-gen.ts +110 -166
- package/src/tools/index.ts +2 -0
- package/src/tools/read.ts +1 -1
- package/src/tools/resource-gc.ts +6 -1
- package/src/tools/tool-catalog.generated.ts +5 -1
- package/src/utils/pasted-image-path.ts +93 -0
- package/src/web/search/index.ts +3 -3
package/src/cli.ts
CHANGED
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
* lightweight CLI runner from pi-utils.
|
|
6
6
|
*/
|
|
7
7
|
import "@gajae-code/utils/postmortem";
|
|
8
|
-
import { Args, type CliConfig, Command, type CommandEntry,
|
|
8
|
+
import { Args, type CliConfig, Command, type CommandEntry, run } from "@gajae-code/utils/cli";
|
|
9
9
|
import { APP_NAME, formatBunRuntimeError, MIN_BUN_VERSION, VERSION } from "@gajae-code/utils/dirs";
|
|
10
10
|
import { runFixtureReport } from "./cli/fixture-report";
|
|
11
|
+
import { ROOT_LAUNCH_FLAGS } from "./cli/root-flags";
|
|
12
|
+
import QuickLane from "./commands/quick-lane";
|
|
11
13
|
import { smokeTestTabWorker } from "./tools/browser/tab-worker-smoke";
|
|
12
14
|
|
|
13
15
|
if (Bun.semver.order(Bun.version, MIN_BUN_VERSION) < 0) {
|
|
@@ -24,7 +26,6 @@ if (Bun.semver.order(Bun.version, MIN_BUN_VERSION) < 0) {
|
|
|
24
26
|
process.title = APP_NAME;
|
|
25
27
|
const rootHelpFlags = ["--help", "-h", "help"];
|
|
26
28
|
const versionFlags = ["--version", "-v"];
|
|
27
|
-
const THINKING_EFFORTS = ["minimal", "low", "medium", "high", "xhigh", "max"] as const;
|
|
28
29
|
const MANAGED_OWNER_SUPERVISOR_ARG = "--internal-managed-owner-supervisor";
|
|
29
30
|
const MANAGED_OWNER_CHILD_TOKEN_ENV = "GJC_MANAGED_OWNER_CHILD_TOKEN";
|
|
30
31
|
const TMUX_OWNER_ISOLATION_ARG = "--internal-tmux-owner-isolation";
|
|
@@ -66,6 +67,7 @@ export const commands: CommandEntry[] = [
|
|
|
66
67
|
{ name: "plugin", load: () => import("./commands/plugin").then(m => m.default) },
|
|
67
68
|
{ name: "completion", load: () => import("./commands/completion").then(m => m.default) },
|
|
68
69
|
{ name: "launch", load: () => import("./commands/launch").then(m => m.default) },
|
|
70
|
+
{ name: "quick-lane", load: async () => QuickLane },
|
|
69
71
|
];
|
|
70
72
|
|
|
71
73
|
async function showHelp(config: CliConfig): Promise<void> {
|
|
@@ -221,21 +223,52 @@ async function runMemoryGuardNativeSmokeFastPathFromCli(): Promise<void> {
|
|
|
221
223
|
runMemoryGuardNativeSmoke();
|
|
222
224
|
}
|
|
223
225
|
|
|
226
|
+
function isLaunchWorktreeSelector(arg: string): boolean {
|
|
227
|
+
return (
|
|
228
|
+
arg === "--worktree" ||
|
|
229
|
+
arg === "-w" ||
|
|
230
|
+
arg.startsWith("--worktree=") ||
|
|
231
|
+
arg.startsWith("-w=") ||
|
|
232
|
+
(arg.startsWith("-w") && arg.length > 2)
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function rootFlagDescriptor(arg: string) {
|
|
237
|
+
if (arg.startsWith("--") && !arg.includes("="))
|
|
238
|
+
return ROOT_LAUNCH_FLAGS[arg.slice(2) as keyof typeof ROOT_LAUNCH_FLAGS];
|
|
239
|
+
if (/^-[^-]$/.test(arg))
|
|
240
|
+
return Object.values(ROOT_LAUNCH_FLAGS).find(descriptor => descriptor.char === arg.slice(1));
|
|
241
|
+
return undefined;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
function rootFlagValueIndex(argv: readonly string[], index: number): number {
|
|
245
|
+
const descriptor = rootFlagDescriptor(argv[index] ?? "");
|
|
246
|
+
if (!descriptor || descriptor.kind === "boolean") return index;
|
|
247
|
+
const value = argv[index + 1];
|
|
248
|
+
return value && !value.startsWith("-") ? index + 1 : index;
|
|
249
|
+
}
|
|
250
|
+
|
|
224
251
|
function rootFixtureArg(argv: string[]): { present: boolean; id: string | undefined } {
|
|
225
252
|
for (let i = 0; i < argv.length; i++) {
|
|
226
|
-
const arg = argv[i];
|
|
227
|
-
|
|
228
|
-
// subcommand never hijacks the root fast-path into fixture-report mode.
|
|
229
|
-
if (isSubcommand(arg)) return { present: false, id: undefined };
|
|
253
|
+
const arg = argv[i] ?? "";
|
|
254
|
+
if (arg === "--" || isSubcommand(arg)) return { present: false, id: undefined };
|
|
230
255
|
if (arg === "--fixture") return { present: true, id: argv[i + 1] };
|
|
256
|
+
const descriptor = rootFlagDescriptor(arg);
|
|
257
|
+
if (descriptor && descriptor.kind !== "boolean") {
|
|
258
|
+
const value = argv[i + 1];
|
|
259
|
+
if (!value || value.startsWith("-")) return { present: false, id: undefined };
|
|
260
|
+
i++;
|
|
261
|
+
}
|
|
231
262
|
}
|
|
232
263
|
return { present: false, id: undefined };
|
|
233
264
|
}
|
|
234
265
|
|
|
235
266
|
function hasRootFastFlag(argv: string[], flags: readonly string[]): boolean {
|
|
236
|
-
for (
|
|
237
|
-
|
|
267
|
+
for (let i = 0; i < argv.length; i++) {
|
|
268
|
+
const arg = argv[i] ?? "";
|
|
269
|
+
if (arg === "--" || isSubcommand(arg) || isLaunchWorktreeSelector(arg)) return false;
|
|
238
270
|
if (flags.includes(arg)) return true;
|
|
271
|
+
i = rootFlagValueIndex(argv, i);
|
|
239
272
|
}
|
|
240
273
|
return false;
|
|
241
274
|
}
|
|
@@ -258,63 +291,7 @@ export class RootHelpCommand extends Command {
|
|
|
258
291
|
multiple: true,
|
|
259
292
|
}),
|
|
260
293
|
};
|
|
261
|
-
static flags =
|
|
262
|
-
model: Flags.string({ description: 'Model to use (fuzzy match: "opus", "gpt-5.2", or "openai/gpt-5.2")' }),
|
|
263
|
-
smol: Flags.string({ description: "Smol/fast model for lightweight tasks (or GJC_SMOL_MODEL env)" }),
|
|
264
|
-
slow: Flags.string({ description: "Slow/reasoning model for thorough analysis (or GJC_SLOW_MODEL env)" }),
|
|
265
|
-
plan: Flags.string({ description: "Plan model for architectural planning (or GJC_PLAN_MODEL env)" }),
|
|
266
|
-
mpreset: Flags.string({ description: "Model profile preset to activate for this session" }),
|
|
267
|
-
default: Flags.boolean({ description: "Persist --mpreset as the default model profile" }),
|
|
268
|
-
provider: Flags.string({ description: "Provider to use (legacy; prefer --model)" }),
|
|
269
|
-
"api-key": Flags.string({ description: "API key (defaults to env vars)" }),
|
|
270
|
-
credential: Flags.string({
|
|
271
|
-
description:
|
|
272
|
-
"Stored credential selector: email:<addr>, id:<n>, account:<id>, project:<id>, or provider/email:<addr>",
|
|
273
|
-
}),
|
|
274
|
-
"system-prompt": Flags.string({ description: "System prompt (default: coding assistant prompt)" }),
|
|
275
|
-
"append-system-prompt": Flags.string({ description: "Append text or file contents to the system prompt" }),
|
|
276
|
-
"mcp-config": Flags.string({ description: "Tools-only MCP config file (absolute path)" }),
|
|
277
|
-
"clipboard-transport": Flags.string({
|
|
278
|
-
description: "Clipboard transport: auto (default), native, osc52, or ssh",
|
|
279
|
-
options: ["auto", "native", "osc52", "ssh"],
|
|
280
|
-
}),
|
|
281
|
-
"clipboard-ssh-host": Flags.string({
|
|
282
|
-
description: "SSH host alias for --clipboard-transport ssh (from ~/.ssh/config)",
|
|
283
|
-
}),
|
|
284
|
-
"allow-home": Flags.boolean({ description: "Allow starting in ~ without auto-switching to a temp dir" }),
|
|
285
|
-
mode: Flags.string({
|
|
286
|
-
description: "Output mode: text (default), json, or acp",
|
|
287
|
-
options: ["text", "json", "acp"],
|
|
288
|
-
}),
|
|
289
|
-
print: Flags.boolean({ char: "p", description: "Non-interactive mode: process prompt and exit" }),
|
|
290
|
-
continue: Flags.boolean({ char: "c", description: "Continue previous session" }),
|
|
291
|
-
resume: Flags.string({ char: "r", description: "Resume a session (by ID prefix, path, or picker if omitted)" }),
|
|
292
|
-
"session-dir": Flags.string({ description: "Directory for session storage and lookup" }),
|
|
293
|
-
"no-session": Flags.boolean({ description: "Don't save session (ephemeral)" }),
|
|
294
|
-
models: Flags.string({ description: "Comma-separated model patterns for Alt+N cycling" }),
|
|
295
|
-
"no-tools": Flags.boolean({ description: "Disable all built-in tools" }),
|
|
296
|
-
"no-lsp": Flags.boolean({ description: "Disable LSP tools, formatting, and diagnostics" }),
|
|
297
|
-
"no-pty": Flags.boolean({ description: "Disable PTY-based interactive bash execution" }),
|
|
298
|
-
tmux: Flags.boolean({ description: "Launch interactive startup inside tmux" }),
|
|
299
|
-
tools: Flags.string({ description: "Comma-separated list of tools to enable (default: all)" }),
|
|
300
|
-
thinking: Flags.string({
|
|
301
|
-
description: `Set thinking level: ${THINKING_EFFORTS.join(", ")}`,
|
|
302
|
-
options: [...THINKING_EFFORTS],
|
|
303
|
-
}),
|
|
304
|
-
hook: Flags.string({ description: "Load a hook/extension file (can be used multiple times)", multiple: true }),
|
|
305
|
-
extension: Flags.string({
|
|
306
|
-
char: "e",
|
|
307
|
-
description: "Load an extension file (can be used multiple times)",
|
|
308
|
-
multiple: true,
|
|
309
|
-
}),
|
|
310
|
-
"no-extensions": Flags.boolean({ description: "Disable extension discovery (explicit -e paths still work)" }),
|
|
311
|
-
"no-skills": Flags.boolean({ description: "Disable skills discovery and loading" }),
|
|
312
|
-
skills: Flags.string({ description: "Comma-separated glob patterns to filter skills (e.g., git-*,docker)" }),
|
|
313
|
-
"no-rules": Flags.boolean({ description: "Disable rules discovery and loading" }),
|
|
314
|
-
export: Flags.string({ description: "Export session file to HTML and exit" }),
|
|
315
|
-
"list-models": Flags.string({ description: "List available models (with optional fuzzy search)" }),
|
|
316
|
-
"no-title": Flags.boolean({ description: "Disable title auto-generation" }),
|
|
317
|
-
};
|
|
294
|
+
static flags = ROOT_LAUNCH_FLAGS;
|
|
318
295
|
static examples = [
|
|
319
296
|
`# Interactive mode\n ${APP_NAME}`,
|
|
320
297
|
`# Interactive mode with initial prompt\n ${APP_NAME} "List all .ts files in src/"`,
|
package/src/commands/acp.ts
CHANGED
|
@@ -15,7 +15,7 @@ export default class Acp extends Command {
|
|
|
15
15
|
|
|
16
16
|
async run(): Promise<void> {
|
|
17
17
|
const { args, terminalAuth } = prepareAcpTerminalAuthArgs(this.argv);
|
|
18
|
-
const parsed = parseArgs(args);
|
|
18
|
+
const parsed = parseArgs(args, terminalAuth ? "local" : "acp");
|
|
19
19
|
if (parsed.unknownFlags.size > 0) {
|
|
20
20
|
throw new CliParseError(`Unknown ACP option: ${[...parsed.unknownFlags.keys()].join(", ")}`);
|
|
21
21
|
}
|
package/src/commands/daemon.ts
CHANGED
|
@@ -11,9 +11,8 @@ import {
|
|
|
11
11
|
import type { DaemonKind } from "../daemon/control-types";
|
|
12
12
|
import { DAEMON_ACTION_TOKENS, resolveDaemonAction } from "../daemon/operator-contract";
|
|
13
13
|
import { initTheme } from "../modes/theme/theme";
|
|
14
|
-
import { runSdkSessionCli } from "../sdk/cli";
|
|
15
14
|
|
|
16
|
-
const ACTIONS = [...DAEMON_ACTION_TOKENS, "discord-internal", "slack-internal"
|
|
15
|
+
const ACTIONS = [...DAEMON_ACTION_TOKENS, "discord-internal", "slack-internal"] as const;
|
|
17
16
|
|
|
18
17
|
function parsePositiveTimeout(raw: string | undefined, flagName: string): number | undefined {
|
|
19
18
|
if (raw === undefined) return undefined;
|
|
@@ -29,7 +28,7 @@ function parsePositiveTimeout(raw: string | undefined, flagName: string): number
|
|
|
29
28
|
|
|
30
29
|
export default class Daemon extends Command {
|
|
31
30
|
static description =
|
|
32
|
-
"Manage GJC background daemons
|
|
31
|
+
"Manage GJC background daemons. Routine use: `gjc daemon status` to check, `gjc daemon restart` to reload (spawns one if none is running). `stop`/`list` and the escalation flags below are advanced primitives.";
|
|
33
32
|
|
|
34
33
|
static examples = [
|
|
35
34
|
"# Check the daemon (concise per-daemon result)\n gjc daemon status",
|
|
@@ -59,16 +58,6 @@ export default class Daemon extends Command {
|
|
|
59
58
|
smoke: Flags.boolean({ description: "Internal: run worker smoke without configuration or network" }),
|
|
60
59
|
"owner-id": Flags.string({ description: "Internal: daemon owner id" }),
|
|
61
60
|
"agent-dir": Flags.string({ description: "Internal: daemon state directory" }),
|
|
62
|
-
op: Flags.string({ description: "SDK control or global operation" }),
|
|
63
|
-
"idempotency-key": Flags.string({ description: "Caller idempotency key required for SDK lifecycle globals" }),
|
|
64
|
-
"json-input": Flags.string({ description: "SDK request JSON object" }),
|
|
65
|
-
"json-input-file": Flags.string({ description: "Read SDK request JSON from a 0600 file" }),
|
|
66
|
-
"json-input-stdin": Flags.boolean({ description: "Read SDK request JSON from standard input" }),
|
|
67
|
-
confirm: Flags.boolean({ description: "Confirm a destructive SDK control operation" }),
|
|
68
|
-
query: Flags.string({ description: "SDK query name" }),
|
|
69
|
-
cursor: Flags.string({ description: "SDK query continuation cursor" }),
|
|
70
|
-
"show-endpoint-credential": Flags.boolean({ description: "Allow session.get_endpoint secret output" }),
|
|
71
|
-
yes: Flags.boolean({ description: "Confirm endpoint credential output on a TTY" }),
|
|
72
61
|
};
|
|
73
62
|
|
|
74
63
|
async run(): Promise<void> {
|
|
@@ -81,24 +70,6 @@ export default class Daemon extends Command {
|
|
|
81
70
|
"--graceful-timeout-ms",
|
|
82
71
|
);
|
|
83
72
|
const killTimeoutMs = parsePositiveTimeout(flagRec["kill-timeout-ms"] as string | undefined, "--kill-timeout-ms");
|
|
84
|
-
if (rawAction === "session") {
|
|
85
|
-
await runSdkSessionCli({
|
|
86
|
-
action: positional[0],
|
|
87
|
-
sessionId: positional[1],
|
|
88
|
-
operation: flagRec.op as string | undefined,
|
|
89
|
-
query: flagRec.query as string | undefined,
|
|
90
|
-
jsonInput: flagRec["json-input"] as string | undefined,
|
|
91
|
-
jsonInputFile: flagRec["json-input-file"] as string | undefined,
|
|
92
|
-
jsonInputStdin: Boolean(flagRec["json-input-stdin"]),
|
|
93
|
-
confirm: Boolean(flagRec.confirm),
|
|
94
|
-
idempotencyKey: flagRec["idempotency-key"] as string | undefined,
|
|
95
|
-
cursor: flagRec.cursor as string | undefined,
|
|
96
|
-
showEndpointCredential: Boolean(flagRec["show-endpoint-credential"]),
|
|
97
|
-
yes: Boolean(flagRec.yes),
|
|
98
|
-
agentDir: flagRec["agent-dir"] as string | undefined,
|
|
99
|
-
});
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
73
|
const action = (resolveDaemonAction(rawAction) ?? rawAction) as DaemonCommandAction;
|
|
103
74
|
const kinds = positional as DaemonKind[];
|
|
104
75
|
const cmd: DaemonCommandArgs = {
|
package/src/commands/gc.ts
CHANGED
|
@@ -26,7 +26,7 @@ export default class Gc extends Command {
|
|
|
26
26
|
force: Flags.boolean({ description: "Alias for --prune (eligible records only)", default: false }),
|
|
27
27
|
"dry-run": Flags.boolean({ description: "Force report-only mode", default: false }),
|
|
28
28
|
disk: Flags.boolean({
|
|
29
|
-
description: "Also report on-disk retention (sessions, blobs, natives, backups)",
|
|
29
|
+
description: "Also report on-disk retention (sessions, blobs, artifacts, natives, backups)",
|
|
30
30
|
default: false,
|
|
31
31
|
}),
|
|
32
32
|
"repair-session-index": Flags.boolean({
|
package/src/commands/launch.ts
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import * as fs from "node:fs/promises";
|
|
6
6
|
import * as path from "node:path";
|
|
7
|
-
import { THINKING_EFFORTS } from "@gajae-code/ai/core";
|
|
8
7
|
import { APP_NAME, setProjectDir } from "@gajae-code/utils";
|
|
9
|
-
import { Args, Command
|
|
10
|
-
import { parseArgs } from "../cli/args";
|
|
8
|
+
import { Args, Command } from "@gajae-code/utils/cli";
|
|
9
|
+
import { assertLocalLaunchArgs, parseArgs } from "../cli/args";
|
|
10
|
+
import { ROOT_LAUNCH_FLAGS } from "../cli/root-flags";
|
|
11
11
|
import { launchDefaultTmuxIfNeeded } from "../gjc-runtime/launch-tmux";
|
|
12
12
|
import { type PreparedLaunchWorktree, prepareLaunchWorktree } from "../gjc-runtime/launch-worktree";
|
|
13
13
|
import {
|
|
@@ -70,130 +70,7 @@ export default class Index extends Command {
|
|
|
70
70
|
}),
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
static flags =
|
|
74
|
-
model: Flags.string({
|
|
75
|
-
description: 'Model to use (fuzzy match: "opus", "gpt-5.2", or "openai/gpt-5.2")',
|
|
76
|
-
}),
|
|
77
|
-
smol: Flags.string({
|
|
78
|
-
description: "Smol/fast model for lightweight tasks (or GJC_SMOL_MODEL env)",
|
|
79
|
-
}),
|
|
80
|
-
slow: Flags.string({
|
|
81
|
-
description: "Slow/reasoning model for thorough analysis (or GJC_SLOW_MODEL env)",
|
|
82
|
-
}),
|
|
83
|
-
plan: Flags.string({
|
|
84
|
-
description: "Plan model for architectural planning (or GJC_PLAN_MODEL env)",
|
|
85
|
-
}),
|
|
86
|
-
mpreset: Flags.string({
|
|
87
|
-
description: "Model profile preset to activate for this session",
|
|
88
|
-
}),
|
|
89
|
-
default: Flags.boolean({
|
|
90
|
-
description: "Persist --mpreset as the default model profile",
|
|
91
|
-
}),
|
|
92
|
-
provider: Flags.string({
|
|
93
|
-
description: "Provider to use (legacy; prefer --model)",
|
|
94
|
-
}),
|
|
95
|
-
"api-key": Flags.string({
|
|
96
|
-
description: "API key (defaults to env vars)",
|
|
97
|
-
}),
|
|
98
|
-
credential: Flags.string({
|
|
99
|
-
description:
|
|
100
|
-
"Stored credential selector: email:<addr>, id:<n>, account:<id>, project:<id>, or provider/email:<addr>",
|
|
101
|
-
}),
|
|
102
|
-
"system-prompt": Flags.string({
|
|
103
|
-
description: "System prompt (default: coding assistant prompt)",
|
|
104
|
-
}),
|
|
105
|
-
"append-system-prompt": Flags.string({
|
|
106
|
-
description: "Append text or file contents to the system prompt",
|
|
107
|
-
}),
|
|
108
|
-
"mcp-config": Flags.string({
|
|
109
|
-
description: "Tools-only MCP config file (absolute path)",
|
|
110
|
-
}),
|
|
111
|
-
"clipboard-transport": Flags.string({
|
|
112
|
-
description: "Clipboard transport: auto (default), native, osc52, or ssh",
|
|
113
|
-
options: ["auto", "native", "osc52", "ssh"],
|
|
114
|
-
}),
|
|
115
|
-
"clipboard-ssh-host": Flags.string({
|
|
116
|
-
description: "SSH host alias for --clipboard-transport ssh (from ~/.ssh/config)",
|
|
117
|
-
}),
|
|
118
|
-
"allow-home": Flags.boolean({
|
|
119
|
-
description: "Allow starting in ~ without auto-switching to a temp dir",
|
|
120
|
-
}),
|
|
121
|
-
mode: Flags.string({
|
|
122
|
-
description: "Output mode: text (default), json, or acp",
|
|
123
|
-
options: ["text", "json", "acp"],
|
|
124
|
-
}),
|
|
125
|
-
print: Flags.boolean({
|
|
126
|
-
char: "p",
|
|
127
|
-
description: "Non-interactive mode: process prompt and exit",
|
|
128
|
-
}),
|
|
129
|
-
continue: Flags.boolean({
|
|
130
|
-
char: "c",
|
|
131
|
-
description: "Continue previous session",
|
|
132
|
-
}),
|
|
133
|
-
resume: Flags.string({
|
|
134
|
-
char: "r",
|
|
135
|
-
description: "Resume a session (by ID prefix, path, or picker if omitted)",
|
|
136
|
-
}),
|
|
137
|
-
"session-dir": Flags.string({
|
|
138
|
-
description:
|
|
139
|
-
"Explicit session storage directory and lookup override (default uses managed v2 workspace scope)",
|
|
140
|
-
}),
|
|
141
|
-
"no-session": Flags.boolean({
|
|
142
|
-
description: "Don't save session (ephemeral)",
|
|
143
|
-
}),
|
|
144
|
-
models: Flags.string({
|
|
145
|
-
description: "Comma-separated model patterns for Alt+N cycling",
|
|
146
|
-
}),
|
|
147
|
-
"no-tools": Flags.boolean({
|
|
148
|
-
description: "Disable all built-in tools",
|
|
149
|
-
}),
|
|
150
|
-
"no-lsp": Flags.boolean({
|
|
151
|
-
description: "Disable LSP tools, formatting, and diagnostics",
|
|
152
|
-
}),
|
|
153
|
-
"no-pty": Flags.boolean({
|
|
154
|
-
description: "Disable PTY-based interactive bash execution",
|
|
155
|
-
}),
|
|
156
|
-
tmux: Flags.boolean({
|
|
157
|
-
description: "Launch interactive startup inside tmux",
|
|
158
|
-
}),
|
|
159
|
-
tools: Flags.string({
|
|
160
|
-
description: "Comma-separated list of tools to enable (default: all)",
|
|
161
|
-
}),
|
|
162
|
-
thinking: Flags.string({
|
|
163
|
-
description: `Set thinking level: ${THINKING_EFFORTS.join(", ")}`,
|
|
164
|
-
options: [...THINKING_EFFORTS],
|
|
165
|
-
}),
|
|
166
|
-
hook: Flags.string({
|
|
167
|
-
description: "Load a hook/extension file (can be used multiple times)",
|
|
168
|
-
multiple: true,
|
|
169
|
-
}),
|
|
170
|
-
extension: Flags.string({
|
|
171
|
-
char: "e",
|
|
172
|
-
description: "Load an extension file (can be used multiple times)",
|
|
173
|
-
multiple: true,
|
|
174
|
-
}),
|
|
175
|
-
"no-extensions": Flags.boolean({
|
|
176
|
-
description: "Disable extension discovery (explicit -e paths still work)",
|
|
177
|
-
}),
|
|
178
|
-
"no-skills": Flags.boolean({
|
|
179
|
-
description: "Disable skills discovery and loading",
|
|
180
|
-
}),
|
|
181
|
-
skills: Flags.string({
|
|
182
|
-
description: "Comma-separated glob patterns to filter skills (e.g., git-*,docker)",
|
|
183
|
-
}),
|
|
184
|
-
"no-rules": Flags.boolean({
|
|
185
|
-
description: "Disable rules discovery and loading",
|
|
186
|
-
}),
|
|
187
|
-
export: Flags.string({
|
|
188
|
-
description: "Export session file to HTML and exit",
|
|
189
|
-
}),
|
|
190
|
-
"list-models": Flags.string({
|
|
191
|
-
description: "List available models (with optional fuzzy search)",
|
|
192
|
-
}),
|
|
193
|
-
"no-title": Flags.boolean({
|
|
194
|
-
description: "Disable title auto-generation",
|
|
195
|
-
}),
|
|
196
|
-
};
|
|
73
|
+
static flags = ROOT_LAUNCH_FLAGS;
|
|
197
74
|
|
|
198
75
|
static examples = [
|
|
199
76
|
`# Interactive mode\n ${APP_NAME}`,
|
|
@@ -215,7 +92,8 @@ export default class Index extends Command {
|
|
|
215
92
|
|
|
216
93
|
async run(): Promise<void> {
|
|
217
94
|
const { args } = prepareAcpTerminalAuthArgs(this.argv);
|
|
218
|
-
const parsed = parseArgs([...args]);
|
|
95
|
+
const parsed = parseArgs([...args], "deferred");
|
|
96
|
+
if (parsed.mode !== "acp") assertLocalLaunchArgs(parsed);
|
|
219
97
|
if (parsed.help || parsed.version) {
|
|
220
98
|
await runRootCommand(parsed, args);
|
|
221
99
|
return;
|
|
@@ -232,7 +110,8 @@ export default class Index extends Command {
|
|
|
232
110
|
process.chdir(launch.cwd);
|
|
233
111
|
setProjectDir(launch.cwd);
|
|
234
112
|
}
|
|
235
|
-
const launchParsed = parseArgs(launch.args);
|
|
113
|
+
const launchParsed = parseArgs(launch.args, "deferred");
|
|
114
|
+
if (launchParsed.mode !== "acp") assertLocalLaunchArgs(launchParsed);
|
|
236
115
|
if (
|
|
237
116
|
launchDefaultTmuxIfNeeded({
|
|
238
117
|
parsed: launchParsed,
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Quick-lane task classification (issue #3984).
|
|
3
|
+
*
|
|
4
|
+
* Read-only classification surface for the quick lane: prints whether a task
|
|
5
|
+
* request is eligible for the quick lane (bounded, direct execution) or must
|
|
6
|
+
* keep the existing deep path (planning/interview). This performs no routing
|
|
7
|
+
* and mutates nothing — it only exposes the deterministic classifier so task
|
|
8
|
+
* classification can be inspected, audited, and consumed by tooling.
|
|
9
|
+
*/
|
|
10
|
+
import { Args, Command, Flags } from "@gajae-code/utils/cli";
|
|
11
|
+
import { classifyQuickLane } from "../quick-lane/classify";
|
|
12
|
+
|
|
13
|
+
export default class QuickLane extends Command {
|
|
14
|
+
static description =
|
|
15
|
+
"Classify a task into the quick lane (bounded, direct execution) or the deep path (planning/interview)";
|
|
16
|
+
|
|
17
|
+
static args = {
|
|
18
|
+
action: Args.string({ description: "Action", required: true, options: ["classify"] }),
|
|
19
|
+
text: Args.string({ description: "Task text", required: true, multiple: true }),
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
static flags = {
|
|
23
|
+
json: Flags.boolean({ description: "Output the decision as JSON" }),
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
static examples = [
|
|
27
|
+
`$ gjc quick-lane classify "add validation to processKeywordDetector"`,
|
|
28
|
+
`$ gjc quick-lane classify --json "fix src/hooks/bridge.ts"`,
|
|
29
|
+
`$ gjc quick-lane classify "team make it better"`,
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
async run(): Promise<void> {
|
|
33
|
+
const { args, flags } = await this.parse(QuickLane);
|
|
34
|
+
const text = (Array.isArray(args.text) ? args.text.join(" ") : (args.text ?? "")).trim();
|
|
35
|
+
const decision = classifyQuickLane(text);
|
|
36
|
+
|
|
37
|
+
if (flags.json) {
|
|
38
|
+
process.stdout.write(`${JSON.stringify(decision, null, 2)}\n`);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const lines = [`lane: ${decision.lane}`];
|
|
43
|
+
if (decision.reasons.length > 0) {
|
|
44
|
+
lines.push(`reasons:\n${decision.reasons.map(reason => ` - ${reason}`).join("\n")}`);
|
|
45
|
+
}
|
|
46
|
+
if (decision.exclusions.length > 0) {
|
|
47
|
+
lines.push(`exclusions:\n${decision.exclusions.map(exclusion => ` - ${exclusion}`).join("\n")}`);
|
|
48
|
+
}
|
|
49
|
+
process.stdout.write(`${lines.join("\n")}\n`);
|
|
50
|
+
}
|
|
51
|
+
}
|