@gajae-code/coding-agent 0.12.0 → 0.12.2
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 +111 -0
- package/dist/types/async/job-manager.d.ts +17 -3
- package/dist/types/config/settings-schema.d.ts +56 -2
- package/dist/types/exa/mcp-client.d.ts +10 -1
- package/dist/types/exec/bash-executor.d.ts +45 -12
- package/dist/types/extensibility/extensions/types.d.ts +16 -2
- package/dist/types/extensibility/gjc-plugins/index.d.ts +12 -2
- package/dist/types/extensibility/gjc-plugins/installer.d.ts +63 -7
- package/dist/types/extensibility/gjc-plugins/lifecycle-reconciliation.d.ts +55 -0
- package/dist/types/extensibility/gjc-plugins/lifecycle.d.ts +64 -0
- package/dist/types/extensibility/gjc-plugins/runtime-quarantine.d.ts +67 -0
- package/dist/types/extensibility/gjc-plugins/session-validation.d.ts +3 -1
- package/dist/types/extensibility/gjc-plugins/types.d.ts +124 -0
- package/dist/types/gjc-runtime/launch-tmux.d.ts +1 -0
- package/dist/types/gjc-runtime/ralplan-review-conflicts.d.ts +114 -0
- package/dist/types/gjc-runtime/ralplan-runtime.d.ts +23 -3
- package/dist/types/gjc-runtime/team-launch.d.ts +1 -1
- package/dist/types/gjc-runtime/team-runtime.d.ts +25 -0
- package/dist/types/gjc-runtime/team-worker-heartbeat.d.ts +43 -0
- package/dist/types/gjc-runtime/tmux-owner-isolation.d.ts +10 -0
- package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +37 -80
- package/dist/types/modes/acp/acp-agent.d.ts +2 -19
- package/dist/types/modes/components/gjc-bundle-settings.d.ts +34 -0
- package/dist/types/modes/components/irc-sidebar.d.ts +16 -0
- package/dist/types/modes/components/notifications-settings-editor.d.ts +1 -0
- package/dist/types/modes/components/session-observer-overlay.d.ts +18 -0
- package/dist/types/modes/components/settings-selector.d.ts +9 -0
- package/dist/types/modes/components/status-line/gh.d.ts +5 -0
- package/dist/types/modes/components/transcript-viewer-overlay.d.ts +18 -1
- package/dist/types/modes/controllers/command-controller.d.ts +1 -1
- package/dist/types/modes/controllers/event-controller.d.ts +1 -1
- package/dist/types/modes/controllers/extension-ui-controller.d.ts +2 -1
- package/dist/types/modes/controllers/selector-controller.d.ts +1 -1
- package/dist/types/modes/interactive-mode.d.ts +9 -0
- package/dist/types/modes/theme/theme.d.ts +3 -1
- package/dist/types/modes/types.d.ts +32 -0
- package/dist/types/reminders/star-reminder.d.ts +3 -13
- package/dist/types/runtime-mcp/manager.d.ts +1 -0
- package/dist/types/sdk/acp/adapter.d.ts +3 -1
- package/dist/types/sdk/broker/transport.d.ts +2 -0
- package/dist/types/sdk/bus/attachment-registry.d.ts +1 -0
- package/dist/types/sdk/bus/chat-daemon-control.d.ts +5 -1
- package/dist/types/sdk/bus/config.d.ts +6 -2
- package/dist/types/sdk/bus/index.d.ts +29 -0
- package/dist/types/sdk/bus/kind-aware-reconciliation.d.ts +8 -1
- package/dist/types/sdk/bus/lifecycle-control-runtime.d.ts +4 -0
- package/dist/types/sdk/bus/reconciliation-store.d.ts +7 -3
- package/dist/types/sdk/bus/rich-draft.d.ts +1 -0
- package/dist/types/sdk/bus/rich-render.d.ts +2 -0
- package/dist/types/sdk/bus/telegram-adoption-intent.d.ts +165 -0
- package/dist/types/sdk/bus/telegram-cli.d.ts +12 -0
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +12 -4
- package/dist/types/sdk/bus/telegram-daemon.d.ts +25 -1
- package/dist/types/sdk/bus/telegram-reference.d.ts +11 -1
- package/dist/types/sdk/bus/threaded-render.d.ts +3 -2
- package/dist/types/sdk/bus/topic-registry.d.ts +11 -1
- package/dist/types/sdk/host/query/revision-store.d.ts +2 -0
- package/dist/types/sdk/host/reverse-leases.d.ts +1 -1
- package/dist/types/sdk/prompt-status.d.ts +23 -3
- package/dist/types/sdk/session.d.ts +6 -0
- package/dist/types/session/agent-session.d.ts +40 -2
- package/dist/types/session/artifacts.d.ts +8 -0
- package/dist/types/session/blob-store.d.ts +57 -4
- package/dist/types/session/internal/managed-session-storage.d.ts +30 -4
- package/dist/types/session/session-manager.d.ts +23 -6
- package/dist/types/session/session-storage.d.ts +4 -0
- package/dist/types/session/streaming-output.d.ts +36 -7
- package/dist/types/setup/credential-import.d.ts +12 -0
- package/dist/types/skill-state/active-state.d.ts +12 -0
- package/dist/types/skill-state/workflow-hud.d.ts +6 -0
- package/dist/types/task/executor.d.ts +3 -2
- package/dist/types/task/index.d.ts +7 -1
- package/dist/types/task/output-manager.d.ts +1 -0
- package/dist/types/task/provider-retry-status.d.ts +8 -0
- package/dist/types/task/receipt.d.ts +9 -1
- package/dist/types/task/types.d.ts +23 -0
- package/dist/types/tools/ask-answer-registry.d.ts +2 -2
- package/dist/types/tools/bash-interactive.d.ts +4 -1
- package/dist/types/tools/bash.d.ts +3 -1
- package/dist/types/tools/image-gen.d.ts +4 -0
- package/dist/types/tools/index.d.ts +6 -0
- package/dist/types/tools/output-meta.d.ts +23 -2
- package/dist/types/tools/path-utils.d.ts +1 -0
- package/dist/types/tools/read.d.ts +0 -6
- package/dist/types/tools/review.d.ts +5 -7
- package/dist/types/tools/subagent.d.ts +2 -0
- package/dist/types/utils/gh.d.ts +13 -0
- package/dist/types/utils/image-resize.d.ts +1 -0
- package/dist/types/web/search/providers/kimi.d.ts +2 -0
- package/dist/types/web/search/providers/searxng.d.ts +7 -0
- package/dist/types/web/search/providers/xai.d.ts +2 -0
- package/package.json +10 -8
- package/scripts/acp-conformance-agent.ts +218 -0
- package/scripts/capture-gjc-bundle-settings.ts +306 -0
- package/scripts/dogfood-ralplan-review-conflicts.ts +272 -0
- package/scripts/generate-sdk-operation-inventory.ts +5 -0
- package/scripts/resident-memory-bench.ts +1341 -0
- package/scripts/run-acp-conformance.ts +290 -0
- package/src/async/job-manager.ts +99 -39
- package/src/cli/fast-help.ts +1 -1
- package/src/cli/plugin-cli.ts +176 -18
- package/src/commands/team.ts +19 -1
- package/src/config/file-lock.ts +11 -2
- package/src/config/settings-schema.ts +53 -2
- package/src/coordinator-mcp/question-gate-codec.ts +1 -1
- package/src/coordinator-mcp/server.ts +5 -12
- package/src/debug/index.ts +42 -17
- package/src/defaults/gjc/skills/deep-interview/SKILL.md +1 -0
- package/src/defaults/gjc/skills/ralplan/SKILL.md +25 -20
- package/src/defaults/gjc/skills/team/SKILL.md +2 -0
- package/src/defaults/gjc/skills/ultragoal/SKILL.md +39 -26
- package/src/defaults/gjc/skills/ultragoal/validation-batch-contracts.md +12 -0
- package/src/defaults/gjc-defaults.ts +4 -4
- package/src/exa/mcp-client.ts +12 -3
- package/src/exec/bash-executor.ts +144 -27
- package/src/extensibility/extensions/runner.ts +15 -0
- package/src/extensibility/extensions/types.ts +18 -1
- package/src/extensibility/gjc-plugins/constrained-hooks.ts +8 -2
- package/src/extensibility/gjc-plugins/index.ts +19 -2
- package/src/extensibility/gjc-plugins/installer.ts +189 -50
- package/src/extensibility/gjc-plugins/lifecycle-reconciliation.ts +199 -0
- package/src/extensibility/gjc-plugins/lifecycle.ts +626 -0
- package/src/extensibility/gjc-plugins/observability.ts +3 -3
- package/src/extensibility/gjc-plugins/prompt-appendix.ts +5 -1
- package/src/extensibility/gjc-plugins/runtime-adapters.ts +12 -2
- package/src/extensibility/gjc-plugins/runtime-quarantine.ts +121 -0
- package/src/extensibility/gjc-plugins/schema.ts +84 -12
- package/src/extensibility/gjc-plugins/session-validation.ts +9 -3
- package/src/extensibility/gjc-plugins/types.ts +141 -0
- package/src/extensibility/gjc-plugins/validation.ts +9 -0
- package/src/gjc-runtime/launch-tmux.ts +25 -6
- package/src/gjc-runtime/launch-worktree.ts +103 -1
- package/src/gjc-runtime/ledger-event-renderer.ts +1 -0
- package/src/gjc-runtime/managed-owner-admission.ts +1 -1
- package/src/gjc-runtime/ralplan-review-conflicts.ts +472 -0
- package/src/gjc-runtime/ralplan-runtime.ts +491 -27
- package/src/gjc-runtime/team-launch.ts +8 -0
- package/src/gjc-runtime/team-runtime.ts +140 -32
- package/src/gjc-runtime/team-worker-heartbeat.ts +149 -0
- package/src/gjc-runtime/tmux-owner-isolation.ts +10 -0
- package/src/gjc-runtime/tmux-sessions.ts +58 -13
- package/src/gjc-runtime/ultragoal-evidence.ts +6 -74
- package/src/gjc-runtime/ultragoal-runtime.ts +635 -612
- package/src/gjc-runtime/workflow-manifest.generated.json +37 -99
- package/src/gjc-runtime/workflow-manifest.ts +21 -70
- package/src/internal-urls/docs-index.generated.ts +16 -16
- package/src/modes/DESIGN.md +104 -0
- package/src/modes/acp/acp-agent.ts +298 -186
- package/src/modes/components/gjc-bundle-settings.ts +508 -0
- package/src/modes/components/irc-sidebar.ts +30 -1
- package/src/modes/components/notifications-settings-editor.ts +12 -1
- package/src/modes/components/oauth-selector.ts +68 -30
- package/src/modes/components/session-observer-overlay.ts +305 -86
- package/src/modes/components/settings-selector.ts +56 -5
- package/src/modes/components/status-line/gh.ts +16 -0
- package/src/modes/components/tool-status-header.ts +3 -15
- package/src/modes/components/transcript-viewer-overlay.ts +99 -24
- package/src/modes/controllers/command-controller.ts +42 -34
- package/src/modes/controllers/event-controller.ts +27 -16
- package/src/modes/controllers/extension-ui-controller.ts +193 -34
- package/src/modes/controllers/selector-controller.ts +160 -22
- package/src/modes/interactive-mode.ts +189 -62
- package/src/modes/jobs-observer.ts +1 -1
- package/src/modes/runtime-init.ts +3 -0
- package/src/modes/theme/theme.ts +11 -9
- package/src/modes/types.ts +88 -0
- package/src/prompts/agent-fragments/ralplan-persistence.md +4 -3
- package/src/prompts/system/eager-todo.md +8 -4
- package/src/prompts/system/system-prompt.md +11 -4
- package/src/prompts/tools/bash.md +5 -5
- package/src/prompts/tools/search-tool-bm25.md +5 -0
- package/src/prompts/tools/task.md +1 -1
- package/src/reminders/star-reminder.ts +4 -42
- package/src/runtime-mcp/manager.ts +19 -4
- package/src/sdk/acp/adapter.ts +22 -6
- package/src/sdk/broker/lifecycle.ts +18 -13
- package/src/sdk/broker/transport.ts +35 -3
- package/src/sdk/bus/attachment-registry.ts +5 -1
- package/src/sdk/bus/chat-daemon-cli.ts +4 -39
- package/src/sdk/bus/chat-daemon-control.ts +7 -3
- package/src/sdk/bus/config.ts +18 -2
- package/src/sdk/bus/index.ts +661 -126
- package/src/sdk/bus/kind-aware-reconciliation.ts +148 -73
- package/src/sdk/bus/lifecycle-commands.ts +4 -1
- package/src/sdk/bus/lifecycle-control-runtime.ts +403 -88
- package/src/sdk/bus/reconciliation-store.ts +95 -16
- package/src/sdk/bus/rich-draft.ts +1 -1
- package/src/sdk/bus/rich-render.ts +2 -2
- package/src/sdk/bus/telegram-adoption-intent.ts +574 -0
- package/src/sdk/bus/telegram-cli.ts +33 -8
- package/src/sdk/bus/telegram-daemon-cli.ts +1 -0
- package/src/sdk/bus/telegram-daemon-contract.ts +12 -4
- package/src/sdk/bus/telegram-daemon.ts +916 -23
- package/src/sdk/bus/telegram-reference.ts +40 -3
- package/src/sdk/bus/threaded-render.ts +48 -3
- package/src/sdk/bus/topic-registry.ts +20 -0
- package/src/sdk/host/query/revision-store.ts +36 -2
- package/src/sdk/host/reverse-leases.ts +44 -7
- package/src/sdk/prompt-status.ts +16 -3
- package/src/sdk/protocol/operation-inventory.generated.json +33 -0
- package/src/sdk/session.ts +89 -9
- package/src/session/agent-session.ts +844 -173
- package/src/session/artifacts.ts +22 -0
- package/src/session/auth-broker-config.ts +10 -3
- package/src/session/blob-store.ts +915 -24
- package/src/session/internal/managed-session-scope.ts +200 -111
- package/src/session/internal/managed-session-storage.ts +492 -62
- package/src/session/session-manager.ts +1614 -435
- package/src/session/session-storage.ts +38 -45
- package/src/session/streaming-output.ts +238 -68
- package/src/setup/credential-import.ts +75 -13
- package/src/skill-state/active-state.ts +32 -0
- package/src/skill-state/workflow-hud.ts +17 -0
- package/src/skill-state/workflow-mutation-guard.ts +496 -2
- package/src/task/executor.ts +122 -39
- package/src/task/index.ts +280 -45
- package/src/task/output-manager.ts +24 -14
- package/src/task/provider-retry-status.ts +16 -0
- package/src/task/receipt.ts +34 -8
- package/src/task/render.ts +6 -2
- package/src/task/types.ts +108 -0
- package/src/tools/ask-answer-registry.ts +12 -6
- package/src/tools/ask.ts +86 -55
- package/src/tools/ast-edit.ts +1 -0
- package/src/tools/ast-grep.ts +1 -0
- package/src/tools/bash-interactive.ts +8 -3
- package/src/tools/bash.ts +503 -60
- package/src/tools/find.ts +1 -0
- package/src/tools/image-gen.ts +29 -5
- package/src/tools/index.ts +6 -0
- package/src/tools/output-meta.ts +108 -14
- package/src/tools/path-utils.ts +3 -2
- package/src/tools/read.ts +18 -0
- package/src/tools/review.ts +5 -7
- package/src/tools/search.ts +1 -0
- package/src/tools/subagent-render.ts +6 -2
- package/src/tools/subagent.ts +6 -0
- package/src/tools/telegram-send.ts +6 -3
- package/src/utils/gh.ts +39 -0
- package/src/utils/image-resize.ts +3 -0
- package/src/web/search/providers/anthropic.ts +4 -4
- package/src/web/search/providers/kimi.ts +15 -5
- package/src/web/search/providers/searxng.ts +47 -4
- package/src/web/search/providers/xai.ts +7 -2
- package/dist/types/gjc-runtime/ultragoal-pipeline.d.ts +0 -23
- package/src/defaults/gjc/skills/ultragoal/pipeline-validation-contracts.md +0 -30
- package/src/gjc-runtime/ultragoal-pipeline.ts +0 -306
|
@@ -7,16 +7,17 @@
|
|
|
7
7
|
* {@link AuthCredential} payloads that go straight into the store.
|
|
8
8
|
*
|
|
9
9
|
* Sources:
|
|
10
|
-
* - Claude Code:
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
10
|
+
* - Claude Code: `$CLAUDE_CONFIG_DIR/.credentials.json` (defaults to
|
|
11
|
+
* `~/.claude/.credentials.json`) on Linux/WSL/Windows native, the macOS
|
|
12
|
+
* Keychain (`Claude Code-credentials`), and env vars.
|
|
13
|
+
* - Codex CLI: `$CODEX_HOME/auth.json` (defaults to `~/.codex/auth.json`;
|
|
14
|
+
* OAuth `tokens` block or stored `OPENAI_API_KEY`), and env vars.
|
|
14
15
|
*/
|
|
15
16
|
import * as fs from "node:fs/promises";
|
|
16
17
|
import * as os from "node:os";
|
|
17
18
|
import * as path from "node:path";
|
|
18
19
|
import type { AuthCredential, OAuthCredential } from "@gajae-code/ai";
|
|
19
|
-
import { isEnoent } from "@gajae-code/utils";
|
|
20
|
+
import { $credentialEnv, isEnoent } from "@gajae-code/utils";
|
|
20
21
|
import { redactSecret } from "./provider-onboarding";
|
|
21
22
|
|
|
22
23
|
/** gjc provider ids that external credentials map onto. */
|
|
@@ -79,6 +80,18 @@ export interface DiscoveryOptions {
|
|
|
79
80
|
env?: Record<string, string | undefined>;
|
|
80
81
|
/** Override the platform (defaults to `process.platform`). */
|
|
81
82
|
platform?: NodeJS.Platform;
|
|
83
|
+
/**
|
|
84
|
+
* Claude Code config directory holding `.credentials.json`.
|
|
85
|
+
*
|
|
86
|
+
* Defaults to the trusted `CLAUDE_CONFIG_DIR` value, else `<homeDir>/.claude`.
|
|
87
|
+
*/
|
|
88
|
+
claudeConfigDir?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Codex CLI home directory holding `auth.json`.
|
|
91
|
+
*
|
|
92
|
+
* Defaults to the trusted `CODEX_HOME` value, else `<homeDir>/.codex`.
|
|
93
|
+
*/
|
|
94
|
+
codexHome?: string;
|
|
82
95
|
/**
|
|
83
96
|
* Reader for the macOS Keychain `Claude Code-credentials` entry. Defaults to
|
|
84
97
|
* shelling out to `security`; injected in tests. Returns the raw JSON string,
|
|
@@ -206,12 +219,24 @@ function parseClaudeCredentials(
|
|
|
206
219
|
};
|
|
207
220
|
}
|
|
208
221
|
|
|
222
|
+
/**
|
|
223
|
+
* A discovery root plus the leak-free label used in redacted summaries.
|
|
224
|
+
*
|
|
225
|
+
* `display` never contains a resolved filesystem path: it is either the
|
|
226
|
+
* home-relative default or the env-var spelling that redirected the lookup.
|
|
227
|
+
*/
|
|
228
|
+
interface ResolvedExternalDir {
|
|
229
|
+
dir: string;
|
|
230
|
+
display: string;
|
|
231
|
+
}
|
|
232
|
+
|
|
209
233
|
async function discoverClaudeCode(
|
|
210
|
-
opts: Required<Pick<DiscoveryOptions, "
|
|
234
|
+
opts: Required<Pick<DiscoveryOptions, "platform">> &
|
|
235
|
+
Pick<DiscoveryOptions, "readClaudeKeychain"> & { configDir: ResolvedExternalDir },
|
|
211
236
|
result: CredentialDiscoveryResult,
|
|
212
237
|
): Promise<void> {
|
|
213
|
-
const filePath = path.join(opts.
|
|
214
|
-
const displayPath =
|
|
238
|
+
const filePath = path.join(opts.configDir.dir, ".credentials.json");
|
|
239
|
+
const displayPath = `${opts.configDir.display}/.credentials.json`;
|
|
215
240
|
let fileRaw: string | null = null;
|
|
216
241
|
try {
|
|
217
242
|
fileRaw = await fs.readFile(filePath, "utf-8");
|
|
@@ -324,9 +349,9 @@ function parseCodexAuth(raw: string, source: string): ImportableCredential | Ski
|
|
|
324
349
|
return { origin: "codex-file", source, reason: "no OAuth tokens or OPENAI_API_KEY present (unsupported shape)" };
|
|
325
350
|
}
|
|
326
351
|
|
|
327
|
-
async function discoverCodex(
|
|
328
|
-
const filePath = path.join(
|
|
329
|
-
const displayPath =
|
|
352
|
+
async function discoverCodex(home: ResolvedExternalDir, result: CredentialDiscoveryResult): Promise<void> {
|
|
353
|
+
const filePath = path.join(home.dir, "auth.json");
|
|
354
|
+
const displayPath = `${home.display}/auth.json`;
|
|
330
355
|
let raw: string | null = null;
|
|
331
356
|
try {
|
|
332
357
|
raw = await fs.readFile(filePath, "utf-8");
|
|
@@ -367,6 +392,34 @@ function pushOutcome(result: CredentialDiscoveryResult, outcome: ImportableCrede
|
|
|
367
392
|
else result.importable.push(outcome);
|
|
368
393
|
}
|
|
369
394
|
|
|
395
|
+
/**
|
|
396
|
+
* Resolve a discovery root that the external CLI itself relocates through the
|
|
397
|
+
* environment (`CLAUDE_CONFIG_DIR`, `CODEX_HOME`).
|
|
398
|
+
*
|
|
399
|
+
* Both variables are read through `$credentialEnv`, so the caller's project
|
|
400
|
+
* `.env` cannot redirect discovery at a credential file a repository ships —
|
|
401
|
+
* the same boundary provider authentication already uses.
|
|
402
|
+
*
|
|
403
|
+
* Relative values are rejected. Claude Code and Codex resolve them against the
|
|
404
|
+
* process cwd, which for gjc is the user's project directory; honouring that
|
|
405
|
+
* would reintroduce the project-controlled redirect the trust boundary exists
|
|
406
|
+
* to prevent. An explicit `options.env` (tests, embedders) is consulted verbatim
|
|
407
|
+
* instead of the ambient environment.
|
|
408
|
+
*/
|
|
409
|
+
function resolveExternalDir(
|
|
410
|
+
name: "CLAUDE_CONFIG_DIR" | "CODEX_HOME",
|
|
411
|
+
envOverride: Record<string, string | undefined> | undefined,
|
|
412
|
+
fallbackDir: string,
|
|
413
|
+
fallbackDisplay: string,
|
|
414
|
+
): ResolvedExternalDir {
|
|
415
|
+
const raw = envOverride ? envOverride[name] : $credentialEnv(name);
|
|
416
|
+
const trimmed = raw?.trim();
|
|
417
|
+
if (trimmed && path.isAbsolute(trimmed)) {
|
|
418
|
+
return { dir: trimmed, display: `$${name}` };
|
|
419
|
+
}
|
|
420
|
+
return { dir: fallbackDir, display: fallbackDisplay };
|
|
421
|
+
}
|
|
422
|
+
|
|
370
423
|
/**
|
|
371
424
|
* Discover Claude Code and Codex CLI credentials across files, the macOS
|
|
372
425
|
* Keychain, and environment variables. Never throws for individual unreadable or
|
|
@@ -376,9 +429,18 @@ export async function discoverExternalCredentials(options: DiscoveryOptions = {}
|
|
|
376
429
|
const homeDir = options.homeDir ?? os.homedir();
|
|
377
430
|
const env = options.env ?? process.env;
|
|
378
431
|
const platform = options.platform ?? process.platform;
|
|
432
|
+
const claudeConfigDir: ResolvedExternalDir = options.claudeConfigDir
|
|
433
|
+
? { dir: options.claudeConfigDir, display: "$CLAUDE_CONFIG_DIR" }
|
|
434
|
+
: resolveExternalDir("CLAUDE_CONFIG_DIR", options.env, path.join(homeDir, ".claude"), "~/.claude");
|
|
435
|
+
const codexHome: ResolvedExternalDir = options.codexHome
|
|
436
|
+
? { dir: options.codexHome, display: "$CODEX_HOME" }
|
|
437
|
+
: resolveExternalDir("CODEX_HOME", options.env, path.join(homeDir, ".codex"), "~/.codex");
|
|
379
438
|
const result: CredentialDiscoveryResult = { importable: [], skipped: [], environment: [] };
|
|
380
|
-
await discoverClaudeCode(
|
|
381
|
-
|
|
439
|
+
await discoverClaudeCode(
|
|
440
|
+
{ configDir: claudeConfigDir, platform, readClaudeKeychain: options.readClaudeKeychain },
|
|
441
|
+
result,
|
|
442
|
+
);
|
|
443
|
+
await discoverCodex(codexHome, result);
|
|
382
444
|
discoverEnvironment(env, result);
|
|
383
445
|
return result;
|
|
384
446
|
}
|
|
@@ -302,6 +302,32 @@ export function isCanonicalGjcWorkflowSkill(skill: string): skill is CanonicalGj
|
|
|
302
302
|
return (CANONICAL_GJC_WORKFLOW_SKILLS as readonly string[]).includes(skill);
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
+
/**
|
|
306
|
+
* Nonterminal phases that intentionally await workflow-specific integration
|
|
307
|
+
* rather than a generic synthetic compaction continuation.
|
|
308
|
+
*/
|
|
309
|
+
const CONTINUATION_INERT_WORKFLOW_PHASES: Readonly<Partial<Record<CanonicalGjcWorkflowSkill, ReadonlySet<string>>>> = {
|
|
310
|
+
team: new Set(["awaiting_integration"]),
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Continuation inertness for compaction auto-continue, derived from each
|
|
315
|
+
* workflow's manifest contract: manifest-terminal and explicitly inert phases
|
|
316
|
+
* are inert; unknown skills or phases unknown to the skill's manifest are
|
|
317
|
+
* conservatively inert so a synthetic continuation never wakes an unrecognized
|
|
318
|
+
* workflow. Generic Ultragoal `blocked` remains continuation-active because its
|
|
319
|
+
* blocker may be autonomously resolvable; verified human pauses are represented
|
|
320
|
+
* by the inline goal's `paused` status instead.
|
|
321
|
+
*/
|
|
322
|
+
export function isWorkflowContinuationInert(skill: string, phase: string): boolean {
|
|
323
|
+
const normalizedPhase = phase.trim().toLowerCase();
|
|
324
|
+
if (!isCanonicalGjcWorkflowSkill(skill)) return true;
|
|
325
|
+
const manifest = getSkillManifest(skill);
|
|
326
|
+
if (manifest.terminalStates.some(terminal => terminal.toLowerCase() === normalizedPhase)) return true;
|
|
327
|
+
if (CONTINUATION_INERT_WORKFLOW_PHASES[skill]?.has(normalizedPhase)) return true;
|
|
328
|
+
return !manifest.states.some(state => state.id.toLowerCase() === normalizedPhase);
|
|
329
|
+
}
|
|
330
|
+
|
|
305
331
|
export function listActiveSkills(raw: unknown): SkillActiveEntry[] {
|
|
306
332
|
if (!raw || typeof raw !== "object") return [];
|
|
307
333
|
const state = raw as SkillActiveState;
|
|
@@ -615,6 +641,8 @@ async function mergeVisibleEntries(
|
|
|
615
641
|
export type VisibleSkillActiveStateCacheTier = "security" | "hud";
|
|
616
642
|
export interface ReadVisibleSkillActiveStateOptions {
|
|
617
643
|
tier?: VisibleSkillActiveStateCacheTier;
|
|
644
|
+
/** Bypass all signature/TTL caches for authorization decisions. */
|
|
645
|
+
bypassCache?: boolean;
|
|
618
646
|
}
|
|
619
647
|
|
|
620
648
|
interface ActiveStateStatSignature {
|
|
@@ -747,6 +775,10 @@ export async function readVisibleSkillActiveState(
|
|
|
747
775
|
}
|
|
748
776
|
const resolvedCwd = path.resolve(cwd);
|
|
749
777
|
const cacheKey = visibleActiveStateCacheKey(resolvedCwd, resolvedSessionId);
|
|
778
|
+
if (opts?.bypassCache) {
|
|
779
|
+
visibleSkillActiveStateCache.delete(cacheKey);
|
|
780
|
+
return await readVisibleSkillActiveStateUncached(resolvedCwd, resolvedSessionId);
|
|
781
|
+
}
|
|
750
782
|
const tier = opts?.tier ?? "security";
|
|
751
783
|
const now = Date.now();
|
|
752
784
|
const cached = visibleSkillActiveStateCache.get(cacheKey);
|
|
@@ -29,6 +29,12 @@ interface RalplanHudState extends WorkflowGateHudState {
|
|
|
29
29
|
verdict?: string;
|
|
30
30
|
latestSummary?: string;
|
|
31
31
|
pendingApproval?: boolean;
|
|
32
|
+
autoHandoff?: {
|
|
33
|
+
configuredTarget: string;
|
|
34
|
+
effectiveTarget: string;
|
|
35
|
+
degradationReason: string | null;
|
|
36
|
+
};
|
|
37
|
+
planningStuck?: boolean;
|
|
32
38
|
updatedAt?: string;
|
|
33
39
|
}
|
|
34
40
|
|
|
@@ -222,6 +228,16 @@ export function buildRalplanHudSummary(state: RalplanHudState): WorkflowHudSumma
|
|
|
222
228
|
}
|
|
223
229
|
return chip(label, `${passes}/${state.reviewPassBudget}`, priority);
|
|
224
230
|
};
|
|
231
|
+
const handoffValue = state.autoHandoff
|
|
232
|
+
? `${state.autoHandoff.configuredTarget}→${state.autoHandoff.effectiveTarget}${
|
|
233
|
+
state.autoHandoff.degradationReason ? `:${state.autoHandoff.degradationReason}` : ""
|
|
234
|
+
}`
|
|
235
|
+
: undefined;
|
|
236
|
+
const handoffSeverity = state.planningStuck
|
|
237
|
+
? "blocked"
|
|
238
|
+
: state.autoHandoff?.degradationReason
|
|
239
|
+
? "warning"
|
|
240
|
+
: undefined;
|
|
225
241
|
return {
|
|
226
242
|
version: 1,
|
|
227
243
|
summary: state.latestSummary,
|
|
@@ -241,6 +257,7 @@ export function buildRalplanHudSummary(state: RalplanHudState): WorkflowHudSumma
|
|
|
241
257
|
reviewPassChip("arch", state.architectPasses, 36),
|
|
242
258
|
reviewPassChip("crit", state.criticPasses, 38),
|
|
243
259
|
chip("verdict", verdict, 40, verdictSeverity),
|
|
260
|
+
chip("handoff", handoffValue, 45, handoffSeverity),
|
|
244
261
|
]),
|
|
245
262
|
...(state.updatedAt ? { updated_at: state.updatedAt } : {}),
|
|
246
263
|
};
|