@gajae-code/coding-agent 0.14.2 → 0.15.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 +120 -1
- package/dist/types/async/job-manager.d.ts +4 -1
- package/dist/types/autoresearch/dashboard.d.ts +29 -4
- package/dist/types/autoresearch/data-context.d.ts +25 -0
- package/dist/types/autoresearch/git.d.ts +65 -7
- package/dist/types/autoresearch/harness.d.ts +58 -0
- package/dist/types/autoresearch/prompts.d.ts +51 -0
- package/dist/types/autoresearch/runs.d.ts +173 -0
- package/dist/types/autoresearch/types.d.ts +9 -139
- package/dist/types/capability/types.d.ts +20 -0
- package/dist/types/cli/accounts-cli.d.ts +1 -0
- package/dist/types/commands/{rlm.d.ts → autoresearch.d.ts} +2 -4
- package/dist/types/config/autorouting-contract.d.ts +146 -0
- package/dist/types/config/autorouting-generator.d.ts +40 -0
- package/dist/types/config/autorouting-tier-map.d.ts +16844 -0
- package/dist/types/config/autorouting.d.ts +35 -0
- package/dist/types/config/model-discovery-manager.d.ts +8 -1
- package/dist/types/config/model-registry.d.ts +30 -1
- package/dist/types/config/provider-selection-policy.d.ts +23 -0
- package/dist/types/config/settings-schema.d.ts +61 -3
- package/dist/types/config/settings.d.ts +3 -0
- package/dist/types/coordinator/contract.d.ts +1 -1
- package/dist/types/coordinator-mcp/durability.d.ts +29 -0
- package/dist/types/coordinator-mcp/event-webhook.d.ts +50 -0
- package/dist/types/coordinator-mcp/question-state.d.ts +1 -1
- package/dist/types/coordinator-mcp/server.d.ts +14 -0
- package/dist/types/crash/index-store.d.ts +3 -0
- package/dist/types/crash/record-loader.d.ts +2 -0
- package/dist/types/crash/upstream/relay.d.ts +5 -3
- package/dist/types/cursor.d.ts +12 -0
- package/dist/types/defaults/gjc-defaults.d.ts +35 -1
- package/dist/types/defaults/gjc-skills.generated.d.ts +1 -1
- package/dist/types/discovery/helpers.d.ts +1 -1
- package/dist/types/edit/index.d.ts +2 -1
- package/dist/types/eval/py/executor.d.ts +2 -0
- package/dist/types/extensibility/extensions/loader.d.ts +32 -0
- package/dist/types/extensibility/gjc-plugins/types.d.ts +1 -1
- package/dist/types/extensibility/skills.d.ts +2 -0
- package/dist/types/gjc-runtime/autoresearch-runtime.d.ts +194 -0
- package/dist/types/gjc-runtime/gc-runtime.d.ts +1 -1
- package/dist/types/gjc-runtime/psmux-detect.d.ts +1 -1
- package/dist/types/gjc-runtime/python-transcript.d.ts +19 -0
- package/dist/types/gjc-runtime/ralplan-runtime.d.ts +2 -8
- package/dist/types/gjc-runtime/session-layout.d.ts +6 -3
- package/dist/types/gjc-runtime/state-renderer.d.ts +0 -22
- package/dist/types/gjc-runtime/state-schema.d.ts +7 -7
- package/dist/types/gjc-runtime/tmux-common.d.ts +2 -2
- package/dist/types/gjc-runtime/ultragoal-change-set.d.ts +38 -1
- package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +2 -24
- package/dist/types/gjc-runtime/ultragoal-validation-policy.d.ts +73 -0
- package/dist/types/gjc-runtime/workflow-recovery-projection.d.ts +100 -0
- package/dist/types/hooks/skill-keywords.d.ts +1 -1
- package/dist/types/main.d.ts +0 -10
- package/dist/types/modes/acp/acp-agent.d.ts +13 -6
- package/dist/types/modes/components/model-selector.d.ts +14 -0
- package/dist/types/modes/components/skill-hud/render.d.ts +6 -1
- package/dist/types/modes/components/smart-routing-panel.d.ts +82 -0
- package/dist/types/modes/controllers/selector-controller.d.ts +14 -0
- package/dist/types/modes/interactive-mode.d.ts +3 -0
- package/dist/types/modes/types.d.ts +9 -0
- package/dist/types/rlm/artifacts.d.ts +4 -4
- package/dist/types/runtime/optional-runtime-services.d.ts +2 -1
- package/dist/types/runtime/workspace-tree-service.d.ts +5 -1
- package/dist/types/runtime-mcp/config.d.ts +6 -0
- package/dist/types/runtime-mcp/manager.d.ts +10 -0
- package/dist/types/sdk/acp/adapter.d.ts +0 -4
- package/dist/types/sdk/broker/broker.d.ts +1 -1
- package/dist/types/sdk/broker/lifecycle.d.ts +57 -2
- package/dist/types/sdk/broker/session-index.d.ts +15 -0
- package/dist/types/sdk/bus/chat-daemon-control.d.ts +6 -0
- package/dist/types/sdk/bus/chat-daemon-runtime.d.ts +4 -0
- package/dist/types/sdk/bus/index.d.ts +8 -0
- package/dist/types/sdk/bus/kind-aware-reconciliation.d.ts +2 -0
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +12 -2
- package/dist/types/sdk/client/client.d.ts +39 -4
- package/dist/types/sdk/host/host.d.ts +1 -0
- package/dist/types/sdk/host/internal-autorouting-state.d.ts +3 -0
- package/dist/types/sdk/host/model-pin.d.ts +29 -0
- package/dist/types/sdk/host/session-runtime.d.ts +2 -1
- package/dist/types/sdk/lifecycle-session.d.ts +13 -0
- package/dist/types/sdk/router/session-router.d.ts +27 -1
- package/dist/types/sdk/session.d.ts +11 -1
- package/dist/types/session/agent-session.d.ts +36 -6
- package/dist/types/session/artifacts.d.ts +16 -1
- package/dist/types/session/internal/managed-session-storage.d.ts +7 -0
- package/dist/types/session/session-manager.d.ts +84 -2
- package/dist/types/session/session-staging-paths.d.ts +3 -0
- package/dist/types/skill-state/canonical-skills.d.ts +1 -1
- package/dist/types/skill-state/workflow-hud.d.ts +12 -21
- package/dist/types/skill-state/workflow-mutation-guard.d.ts +1 -0
- package/dist/types/slash-commands/helpers/autorouting-status.d.ts +8 -0
- package/dist/types/system-prompt.d.ts +23 -0
- package/dist/types/task/executor.d.ts +35 -4
- package/dist/types/task/index.d.ts +17 -3
- package/dist/types/task/receipt.d.ts +3 -1
- package/dist/types/task/types.d.ts +144 -0
- package/dist/types/tools/atomic-file-write.d.ts +72 -0
- package/dist/types/tools/descriptors.d.ts +1 -0
- package/dist/types/tools/index.d.ts +36 -1
- package/dist/types/tools/move-session.d.ts +40 -0
- package/dist/types/tools/python.d.ts +12 -0
- package/dist/types/tools/resource-gc.d.ts +0 -3
- package/dist/types/tools/search.d.ts +8 -1
- package/dist/types/tools/skill.d.ts +9 -4
- package/dist/types/tools/subagent.d.ts +33 -3
- package/dist/types/utils/xml-escape.d.ts +2 -0
- package/dist/types/workflow/workflow-intent-diff.d.ts +2 -2
- package/dist/types/workflow/workflow-intent-report-consumer.d.ts +1 -1
- package/package.json +11 -12
- package/scripts/build-sdk-package-smoke.ts +7 -5
- package/scripts/check-autorouting-tier-map.ts +183 -0
- package/scripts/generate-sdk-operation-inventory.ts +12 -0
- package/scripts/generate-tool-catalog.ts +40 -5
- package/src/async/job-manager.ts +5 -2
- package/src/autoresearch/dashboard.ts +134 -314
- package/src/autoresearch/data-context.ts +35 -0
- package/src/autoresearch/git.ts +186 -26
- package/src/autoresearch/{helpers.ts → harness.ts} +65 -40
- package/src/autoresearch/{prompt-setup.md → prompts/prompt-setup.md} +7 -7
- package/src/autoresearch/prompts/prompt.md +103 -0
- package/src/autoresearch/prompts.ts +126 -0
- package/src/autoresearch/runs.ts +708 -0
- package/src/autoresearch/types.ts +9 -150
- package/src/capability/index.ts +4 -4
- package/src/capability/types.ts +20 -0
- package/src/cli/accounts-cli.ts +21 -5
- package/src/cli/config-cli.ts +25 -1
- package/src/cli/fast-help.ts +1 -2
- package/src/cli/list-models.ts +5 -8
- package/src/cli/setup-cli.ts +8 -0
- package/src/cli.ts +2 -21
- package/src/commands/autoresearch.ts +33 -0
- package/src/commands/coordinator.ts +15 -0
- package/src/commands/launch.ts +2 -4
- package/src/commands/quick-lane.ts +1 -1
- package/src/commands/sdk.ts +24 -0
- package/src/commands/state.ts +1 -1
- package/src/config/autorouting-contract.ts +474 -0
- package/src/config/autorouting-generator.ts +238 -0
- package/src/config/autorouting-tier-map.ts +6108 -0
- package/src/config/autorouting.ts +120 -0
- package/src/config/model-discovery-manager.ts +42 -11
- package/src/config/model-registry.ts +348 -68
- package/src/config/provider-selection-policy.ts +60 -9
- package/src/config/settings-schema.ts +195 -6
- package/src/config/settings.ts +62 -1
- package/src/config.ts +2 -3
- package/src/coordinator/contract.ts +0 -1
- package/src/coordinator-mcp/codex-handoff.ts +68 -42
- package/src/coordinator-mcp/durability.ts +200 -0
- package/src/coordinator-mcp/event-webhook.ts +278 -0
- package/src/coordinator-mcp/question-state.ts +109 -46
- package/src/coordinator-mcp/server.ts +932 -504
- package/src/crash/index-store.ts +126 -22
- package/src/crash/record-loader.ts +7 -0
- package/src/crash/upstream/relay.ts +82 -34
- package/src/cursor.ts +84 -1
- package/src/debug/index.ts +26 -0
- package/src/defaults/gjc/skills/autoresearch/SKILL.md +116 -0
- package/src/defaults/gjc/skills/autoresearch/auto-critic.md +46 -0
- package/src/defaults/gjc/skills/autoresearch/auto-iterate.md +42 -0
- package/src/defaults/gjc/skills/deep-interview/SKILL.md +17 -37
- package/src/defaults/gjc/skills/ralplan/SKILL.md +21 -18
- package/src/defaults/gjc/skills/ultragoal/SKILL.md +6 -17
- package/src/defaults/gjc/skills/ultragoal/ai-slop-cleaner.md +2 -2
- package/src/defaults/gjc-defaults.ts +89 -2
- package/src/defaults/gjc-skills.generated.ts +24 -17
- package/src/discovery/builtin.ts +18 -5
- package/src/discovery/helpers.ts +6 -6
- package/src/edit/index.ts +5 -2
- package/src/eval/py/executor.ts +8 -0
- package/src/extensibility/extensions/loader.ts +135 -13
- package/src/extensibility/extensions/wrapper.ts +1 -2
- package/src/extensibility/gjc-plugins/schema.ts +1 -1
- package/src/extensibility/runtime-skill-discovery.ts +2 -2
- package/src/extensibility/skill-management.ts +2 -3
- package/src/extensibility/skills.ts +16 -8
- package/src/gjc-runtime/autoresearch-runtime.ts +1509 -0
- package/src/gjc-runtime/gc-render.ts +0 -1
- package/src/gjc-runtime/gc-runtime.ts +1 -11
- package/src/gjc-runtime/launch-tmux.ts +3 -3
- package/src/gjc-runtime/psmux-detect.ts +2 -2
- package/src/gjc-runtime/python-transcript.ts +58 -0
- package/src/gjc-runtime/ralplan-runtime.ts +6 -18
- package/src/gjc-runtime/session-layout.ts +18 -7
- package/src/gjc-runtime/session-state-sidecar.ts +58 -9
- package/src/gjc-runtime/state-renderer.ts +0 -38
- package/src/gjc-runtime/state-runtime.ts +43 -22
- package/src/gjc-runtime/state-schema.ts +1 -1
- package/src/gjc-runtime/tmux-common.ts +7 -7
- package/src/gjc-runtime/ultragoal-change-set.ts +232 -11
- package/src/gjc-runtime/ultragoal-runtime.ts +309 -114
- package/src/gjc-runtime/ultragoal-validation-policy.ts +247 -0
- package/src/gjc-runtime/workflow-command-ref.ts +15 -11
- package/src/gjc-runtime/workflow-manifest.generated.json +413 -532
- package/src/gjc-runtime/workflow-manifest.ts +43 -83
- package/src/gjc-runtime/workflow-recovery-projection.ts +616 -0
- package/src/hooks/skill-keywords.ts +3 -3
- package/src/hooks/skill-state.ts +2 -2
- package/src/internal-urls/docs-index.generated.ts +26 -24
- package/src/lsp/index.ts +25 -5
- package/src/main.ts +2 -27
- package/src/modes/acp/acp-agent.ts +200 -75
- package/src/modes/components/model-selector.ts +216 -13
- package/src/modes/components/oauth-selector.ts +5 -5
- package/src/modes/components/skill-hud/render.ts +173 -35
- package/src/modes/components/smart-routing-panel.ts +531 -0
- package/src/modes/components/tool-status-header.ts +6 -3
- package/src/modes/controllers/command-controller.ts +17 -7
- package/src/modes/controllers/input-controller.ts +44 -9
- package/src/modes/controllers/runtime-mcp-command-controller.ts +4 -0
- package/src/modes/controllers/selector-controller.ts +298 -65
- package/src/modes/interactive-mode.ts +8 -1
- package/src/modes/shared/agent-wire/workflow-gate-types.ts +1 -1
- package/src/modes/types.ts +9 -1
- package/src/prompts/agents/planner.md +1 -1
- package/src/prompts/system/system-prompt.md +1 -1
- package/src/prompts/system/volatile-project-context.md +2 -1
- package/src/prompts/tools/move-session.md +15 -0
- package/src/prompts/tools/python.md +12 -0
- package/src/prompts/tools/skill-discovery.md +1 -1
- package/src/prompts/tools/skill.md +2 -2
- package/src/prompts/tools/task-summary.md +1 -0
- package/src/prompts/tools/task.md +6 -0
- package/src/rlm/artifacts.ts +12 -10
- package/src/runtime/optional-runtime-services.ts +3 -2
- package/src/runtime/workspace-tree-service.ts +11 -3
- package/src/runtime-mcp/config.ts +8 -1
- package/src/runtime-mcp/manager.ts +33 -0
- package/src/sdk/acp/adapter.ts +48 -1
- package/src/sdk/broker/broker.ts +30 -2
- package/src/sdk/broker/discovery.ts +217 -2
- package/src/sdk/broker/lifecycle.ts +385 -59
- package/src/sdk/broker/session-index.ts +243 -48
- package/src/sdk/broker/transport.ts +1 -0
- package/src/sdk/bus/chat-daemon-control.ts +8 -2
- package/src/sdk/bus/chat-daemon-runtime.ts +5 -0
- package/src/sdk/bus/index.ts +208 -11
- package/src/sdk/bus/kind-aware-reconciliation.ts +16 -0
- package/src/sdk/bus/reconciliation-store.ts +27 -5
- package/src/sdk/bus/telegram-daemon-contract.ts +12 -2
- package/src/sdk/client/client.ts +204 -22
- package/src/sdk/host/host.ts +16 -0
- package/src/sdk/host/internal-autorouting-state.ts +13 -0
- package/src/sdk/host/model-pin.ts +101 -0
- package/src/sdk/host/reverse-leases.ts +2 -1
- package/src/sdk/host/session-runtime.test.ts +224 -1
- package/src/sdk/host/session-runtime.ts +125 -37
- package/src/sdk/lifecycle/service.ts +3 -1
- package/src/sdk/lifecycle-session.ts +42 -1
- package/src/sdk/protocol/operation-inventory.generated.json +66 -0
- package/src/sdk/router/session-router.ts +375 -36
- package/src/sdk/session.ts +547 -47
- package/src/session/account-inventory.ts +1 -1
- package/src/session/agent-session.ts +765 -189
- package/src/session/artifacts.ts +234 -4
- package/src/session/internal/managed-session-storage.ts +91 -4
- package/src/session/provider-safety-stop-hint.ts +3 -2
- package/src/session/session-manager.ts +775 -16
- package/src/session/session-staging-paths.ts +8 -0
- package/src/setup/hermes/templates/operator-instructions.v1.md +0 -1
- package/src/setup/host-plugin-setup.ts +2 -2
- package/src/skill-state/active-state.ts +2 -2
- package/src/skill-state/canonical-skills.ts +1 -1
- package/src/skill-state/initial-phase.ts +1 -1
- package/src/skill-state/workflow-hud.ts +41 -41
- package/src/skill-state/workflow-mutation-guard.ts +26 -7
- package/src/slash-commands/builtin-registry.ts +77 -0
- package/src/slash-commands/helpers/autorouting-status.ts +55 -0
- package/src/system-prompt.ts +102 -5
- package/src/task/discovery.ts +2 -3
- package/src/task/executor.ts +617 -43
- package/src/task/index.ts +262 -15
- package/src/task/receipt.ts +30 -0
- package/src/task/render.ts +11 -1
- package/src/task/types.ts +316 -0
- package/src/tools/atomic-file-write.ts +594 -0
- package/src/tools/bisect.ts +3 -2
- package/src/tools/descriptors.test.ts +3 -0
- package/src/tools/descriptors.ts +24 -0
- package/src/tools/image-gen.ts +5 -1
- package/src/tools/index.ts +62 -5
- package/src/tools/move-session.ts +107 -0
- package/src/tools/python.ts +205 -0
- package/src/tools/read.ts +88 -15
- package/src/tools/renderers.ts +2 -0
- package/src/tools/resource-gc.ts +8 -177
- package/src/tools/search.ts +30 -6
- package/src/tools/skill-discovery.ts +1 -0
- package/src/tools/skill.ts +37 -7
- package/src/tools/subagent-render.ts +119 -13
- package/src/tools/subagent.ts +91 -74
- package/src/tools/tool-catalog.generated.ts +64 -2
- package/src/tools/write.ts +16 -12
- package/src/utils/xml-escape.ts +14 -0
- package/src/web/search/providers/codex.ts +2 -2
- package/src/workflow/workflow-intent-diff.ts +13 -12
- package/src/workflow/workflow-intent-report-consumer.ts +6 -6
- package/dist/types/autoresearch/helpers.d.ts +0 -24
- package/dist/types/autoresearch/index.d.ts +0 -2
- package/dist/types/autoresearch/state.d.ts +0 -17
- package/dist/types/autoresearch/storage.d.ts +0 -142
- package/dist/types/autoresearch/tools/init-experiment.d.ts +0 -31
- package/dist/types/autoresearch/tools/log-experiment.d.ts +0 -23
- package/dist/types/autoresearch/tools/run-experiment.d.ts +0 -8
- package/dist/types/autoresearch/tools/update-notes.d.ts +0 -12
- package/dist/types/commands/team.d.ts +0 -24
- package/dist/types/gjc-runtime/team-gc.d.ts +0 -7
- package/dist/types/gjc-runtime/team-launch.d.ts +0 -61
- package/dist/types/gjc-runtime/team-notify.d.ts +0 -45
- package/dist/types/gjc-runtime/team-runtime.d.ts +0 -336
- package/dist/types/gjc-runtime/team-store.d.ts +0 -168
- package/dist/types/gjc-runtime/team-worker-heartbeat.d.ts +0 -43
- package/dist/types/gjc-runtime/team-worker-memory-guard.d.ts +0 -92
- package/dist/types/gjc-runtime/team-workers.d.ts +0 -83
- package/dist/types/rlm/index.d.ts +0 -47
- package/dist/types/rlm/preset.d.ts +0 -23
- package/dist/types/rlm/python-tool.d.ts +0 -16
- package/src/autoresearch/command-resume.md +0 -14
- package/src/autoresearch/index.ts +0 -536
- package/src/autoresearch/prompt.md +0 -103
- package/src/autoresearch/resume-message.md +0 -10
- package/src/autoresearch/state.ts +0 -273
- package/src/autoresearch/storage.ts +0 -699
- package/src/autoresearch/tools/init-experiment.ts +0 -272
- package/src/autoresearch/tools/log-experiment.ts +0 -524
- package/src/autoresearch/tools/run-experiment.ts +0 -475
- package/src/autoresearch/tools/update-notes.ts +0 -109
- package/src/commands/rlm.ts +0 -19
- package/src/commands/team.ts +0 -238
- package/src/defaults/gjc/skills/deep-interview/auto-research-greenfield.md +0 -42
- package/src/defaults/gjc/skills/team/SKILL.md +0 -467
- package/src/gjc-runtime/team-gc.ts +0 -49
- package/src/gjc-runtime/team-launch.ts +0 -404
- package/src/gjc-runtime/team-notify.ts +0 -326
- package/src/gjc-runtime/team-runtime.ts +0 -5923
- package/src/gjc-runtime/team-store.ts +0 -878
- package/src/gjc-runtime/team-worker-heartbeat.ts +0 -149
- package/src/gjc-runtime/team-worker-memory-guard.ts +0 -363
- package/src/gjc-runtime/team-workers.ts +0 -1123
- package/src/prompts/system/rlm-report-command.md +0 -1
- package/src/prompts/system/rlm-research.md +0 -23
- package/src/rlm/index.ts +0 -365
- package/src/rlm/preset.ts +0 -76
- package/src/rlm/python-tool.ts +0 -68
|
@@ -8,7 +8,6 @@ import { GC_STORES } from "./gc-runtime";
|
|
|
8
8
|
|
|
9
9
|
const STORE_HEADINGS: Record<GcStore, string> = {
|
|
10
10
|
harness_leases: "Harness owner leases",
|
|
11
|
-
team_workers: "Team workers",
|
|
12
11
|
file_locks: "Config file-locks",
|
|
13
12
|
tmux_sessions: "Tmux sessions",
|
|
14
13
|
registry_entries: "Harness-root registry entries",
|
|
@@ -35,17 +35,10 @@ import { FileSessionStorage, probeSessionRetirement, retireSessionTranscript } f
|
|
|
35
35
|
import { buildGcReportText } from "./gc-render";
|
|
36
36
|
import { collectSessionScopeUsage, type GcSessionScopeUsage, shouldReportSessionScope } from "./gc-session-scope";
|
|
37
37
|
|
|
38
|
-
export type GcStore =
|
|
39
|
-
| "harness_leases"
|
|
40
|
-
| "team_workers"
|
|
41
|
-
| "file_locks"
|
|
42
|
-
| "tmux_sessions"
|
|
43
|
-
| "registry_entries"
|
|
44
|
-
| "local_roots";
|
|
38
|
+
export type GcStore = "harness_leases" | "file_locks" | "tmux_sessions" | "registry_entries" | "local_roots";
|
|
45
39
|
|
|
46
40
|
export const GC_STORES: readonly GcStore[] = [
|
|
47
41
|
"harness_leases",
|
|
48
|
-
"team_workers",
|
|
49
42
|
"file_locks",
|
|
50
43
|
"tmux_sessions",
|
|
51
44
|
"registry_entries",
|
|
@@ -547,19 +540,16 @@ export async function defaultGcAdapters(): Promise<GcStoreAdapter[]> {
|
|
|
547
540
|
const [
|
|
548
541
|
{ harnessLeasesGcAdapter, registryEntriesGcAdapter },
|
|
549
542
|
{ fileLocksGcAdapter },
|
|
550
|
-
{ teamWorkersGcAdapter },
|
|
551
543
|
{ tmuxSessionsGcAdapter },
|
|
552
544
|
{ localRootsGcAdapter },
|
|
553
545
|
] = await Promise.all([
|
|
554
546
|
import("../harness-control-plane/gc-adapter"),
|
|
555
547
|
import("../config/file-lock-gc"),
|
|
556
|
-
import("./team-gc"),
|
|
557
548
|
import("./tmux-gc"),
|
|
558
549
|
import("../internal-urls/local-root-gc"),
|
|
559
550
|
]);
|
|
560
551
|
return [
|
|
561
552
|
harnessLeasesGcAdapter,
|
|
562
|
-
teamWorkersGcAdapter,
|
|
563
553
|
fileLocksGcAdapter,
|
|
564
554
|
tmuxSessionsGcAdapter,
|
|
565
555
|
registryEntriesGcAdapter,
|
|
@@ -402,7 +402,7 @@ export function applyGjcTmuxProfile(context: GjcTmuxProfileContext): GjcTmuxProf
|
|
|
402
402
|
const branchSlug = context.branch ? buildGjcTmuxSessionSlug(context.branch) : (context.branchSlug ?? null);
|
|
403
403
|
// The psmux UX filter (mouse / set-clipboard / mode-style /
|
|
404
404
|
// set-window-option) now lives in buildGjcTmuxProfileCommands so every
|
|
405
|
-
// caller — gjc --tmux planning, gjc session create
|
|
405
|
+
// caller — gjc --tmux planning, gjc session create —
|
|
406
406
|
// applies the same drop set when the active multiplexer is psmux. We pass
|
|
407
407
|
// the resolved tmuxCommand through the new opts seam so the filter
|
|
408
408
|
// engages for this exact command, not whatever the resolver returns at
|
|
@@ -1027,8 +1027,8 @@ export function buildDefaultTmuxLaunchPlan(context: TmuxLaunchContext): TmuxLaun
|
|
|
1027
1027
|
extraEnv: {
|
|
1028
1028
|
[GJC_COORDINATOR_SESSION_ID_ENV]: sessionId,
|
|
1029
1029
|
[GJC_COORDINATOR_SESSION_STATE_FILE_ENV]: sessionStateFile,
|
|
1030
|
-
// Carry the GJC-managed session name into the child so
|
|
1031
|
-
// can target the correct leader session by name. Under psmux on
|
|
1030
|
+
// Carry the GJC-managed session name into the child so tmux-backed
|
|
1031
|
+
// flows can target the correct leader session by name. Under psmux on
|
|
1032
1032
|
// Windows the inherited TMUX_PANE can resolve to the wrong/default
|
|
1033
1033
|
// session, which would split/send workers into the wrong session.
|
|
1034
1034
|
[GJC_TMUX_ACTIVE_SESSION_ENV]: sessionName,
|
|
@@ -307,7 +307,7 @@ export interface ResolvedTmuxBinary {
|
|
|
307
307
|
|
|
308
308
|
/**
|
|
309
309
|
* Resolve the tmux command GJC should invoke. Honors the existing
|
|
310
|
-
* GJC_TMUX_COMMAND
|
|
310
|
+
* GJC_TMUX_COMMAND override; on Windows when no
|
|
311
311
|
* override is set, psmux (installed as psmux, pmux, or tmux) is picked
|
|
312
312
|
* automatically so the default gjc --tmux flow lands on a real multiplexer.
|
|
313
313
|
*/
|
|
@@ -315,7 +315,7 @@ export function resolveGjcTmuxBinary(options: ResolveGjcTmuxBinaryOptions = {}):
|
|
|
315
315
|
const env = options.env ?? process.env;
|
|
316
316
|
const platform = options.platform ?? process.platform;
|
|
317
317
|
const runner = options.runner ?? readSpawnRunner();
|
|
318
|
-
const explicit = env.GJC_TMUX_COMMAND?.trim()
|
|
318
|
+
const explicit = env.GJC_TMUX_COMMAND?.trim();
|
|
319
319
|
if (explicit) {
|
|
320
320
|
const isPsmux =
|
|
321
321
|
platform === "win32"
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { pythonKernelTranscriptPath } from "./session-layout";
|
|
2
|
+
import { writeLogJsonl } from "./state-writer";
|
|
3
|
+
|
|
4
|
+
export interface PythonTranscriptRecord {
|
|
5
|
+
timestamp: string;
|
|
6
|
+
code: string;
|
|
7
|
+
output: string;
|
|
8
|
+
exitCode: number | null;
|
|
9
|
+
cancelled: boolean;
|
|
10
|
+
truncated: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface PythonKernelTranscript {
|
|
14
|
+
readonly dir: string;
|
|
15
|
+
readonly kernelInstanceId: string;
|
|
16
|
+
append(record: PythonTranscriptRecord): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function transcriptDirectoryName(now: Date, kernelInstanceId: string): string {
|
|
20
|
+
const yyyy = now.getUTCFullYear().toString().padStart(4, "0");
|
|
21
|
+
const mm = (now.getUTCMonth() + 1).toString().padStart(2, "0");
|
|
22
|
+
const dd = now.getUTCDate().toString().padStart(2, "0");
|
|
23
|
+
const hh = now.getUTCHours().toString().padStart(2, "0");
|
|
24
|
+
const min = now.getUTCMinutes().toString().padStart(2, "0");
|
|
25
|
+
const ss = now.getUTCSeconds().toString().padStart(2, "0");
|
|
26
|
+
return `${yyyy}${mm}${dd}T${hh}${min}${ss}Z-${kernelInstanceId}`;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function openPythonKernelTranscript(input: {
|
|
30
|
+
cwd: string;
|
|
31
|
+
sessionId: string;
|
|
32
|
+
kernelInstanceId: string;
|
|
33
|
+
now?: Date;
|
|
34
|
+
}): PythonKernelTranscript {
|
|
35
|
+
const dir = transcriptDirectoryName(input.now ?? new Date(), input.kernelInstanceId);
|
|
36
|
+
const transcriptPath = pythonKernelTranscriptPath(input.cwd, input.sessionId, dir);
|
|
37
|
+
let queue: Promise<void> = Promise.resolve();
|
|
38
|
+
|
|
39
|
+
return {
|
|
40
|
+
dir,
|
|
41
|
+
kernelInstanceId: input.kernelInstanceId,
|
|
42
|
+
append(record: PythonTranscriptRecord): Promise<void> {
|
|
43
|
+
const write = queue.then(async () => {
|
|
44
|
+
await writeLogJsonl(transcriptPath, record, {
|
|
45
|
+
cwd: input.cwd,
|
|
46
|
+
audit: {
|
|
47
|
+
category: "log",
|
|
48
|
+
verb: "append",
|
|
49
|
+
owner: "gjc-runtime",
|
|
50
|
+
sessionId: input.sessionId,
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
queue = write.catch(() => undefined);
|
|
55
|
+
return write;
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
@@ -42,7 +42,6 @@ import {
|
|
|
42
42
|
writeArtifact,
|
|
43
43
|
writeWorkflowEnvelopeAtomic,
|
|
44
44
|
} from "./state-writer";
|
|
45
|
-
import { probeGjcTeamAvailability } from "./team-runtime";
|
|
46
45
|
import { assertSafePathComponent, CommandError, flagValue, hasFlag } from "./workflow-cli-common";
|
|
47
46
|
import { getSkillManifest } from "./workflow-manifest";
|
|
48
47
|
import {
|
|
@@ -66,7 +65,7 @@ import {
|
|
|
66
65
|
* 2. **Artifact write**: `gjc ralplan --write --stage <type> --stage_n <N>
|
|
67
66
|
* (--artifact <path-or-string> | --artifact-env GJC_RALPLAN_ARTIFACT)
|
|
68
67
|
* [--run-id <id>] [--session-id <id>] [--lane-verdict <token>] [--json]` persists Planner / Architect
|
|
69
|
-
* / Critic / disposition / revision / post-interview / ADR / final artifacts under
|
|
68
|
+
* / Critic / intent / disposition / revision / post-interview / ADR / final artifacts under
|
|
70
69
|
* `.gjc/plans/ralplan/<run-id>/`, maintains an `index.jsonl` audit log, copies `final`
|
|
71
70
|
* stages to `pending-approval.md`, and advances the HUD chip to reflect the latest
|
|
72
71
|
* persisted stage. Disposition stage artifacts are fail-closed JSON documents that
|
|
@@ -81,6 +80,7 @@ export interface RalplanCommandResult {
|
|
|
81
80
|
|
|
82
81
|
const KNOWN_STAGES = [
|
|
83
82
|
"planner",
|
|
83
|
+
"intent",
|
|
84
84
|
"architect",
|
|
85
85
|
"critic",
|
|
86
86
|
"disposition",
|
|
@@ -100,7 +100,7 @@ export const PLANNING_STUCK_MARKER = "PLANNING-STUCK";
|
|
|
100
100
|
export const RALPLAN_DEFAULT_MAX_REVIEW_PASSES_PER_LANE = 1;
|
|
101
101
|
/** Inclusive upper bound for `gjc.ralplan.maxReviewPassesPerLane` settings overrides. */
|
|
102
102
|
export const RALPLAN_MAX_REVIEW_PASSES_PER_LANE_LIMIT = 10;
|
|
103
|
-
export type RalplanAutoHandoffTarget = "off" | "ultragoal" | "
|
|
103
|
+
export type RalplanAutoHandoffTarget = "off" | "ultragoal" | "autoresearch";
|
|
104
104
|
|
|
105
105
|
export interface RalplanAutoHandoffResolution {
|
|
106
106
|
configuredTarget: RalplanAutoHandoffTarget;
|
|
@@ -109,7 +109,7 @@ export interface RalplanAutoHandoffResolution {
|
|
|
109
109
|
source: string;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
const RALPLAN_AUTO_HANDOFF_TARGETS = new Set<RalplanAutoHandoffTarget>(["off", "ultragoal", "
|
|
112
|
+
const RALPLAN_AUTO_HANDOFF_TARGETS = new Set<RalplanAutoHandoffTarget>(["off", "ultragoal", "autoresearch"]);
|
|
113
113
|
|
|
114
114
|
const RALPLAN_ITERATION_OPENER_STAGES = new Set<RalplanStage>(["planner", "revision"]);
|
|
115
115
|
|
|
@@ -466,7 +466,6 @@ function parseRalplanAutoHandoffTarget(value: unknown): RalplanAutoHandoffTarget
|
|
|
466
466
|
|
|
467
467
|
type RalplanAutoHandoffOptions = {
|
|
468
468
|
planningStuck?: boolean;
|
|
469
|
-
teamAvailabilityProbe?: () => { available: true } | { available: false; reason: string };
|
|
470
469
|
/** The session's effective agent directory (see resolveWorkflowSetting). */
|
|
471
470
|
agentDir?: string;
|
|
472
471
|
};
|
|
@@ -474,7 +473,7 @@ type RalplanAutoHandoffOptions = {
|
|
|
474
473
|
function parsePresentRalplanAutoHandoff(value: unknown): WorkflowSettingParseResult<RalplanAutoHandoffTarget> {
|
|
475
474
|
const target = parseRalplanAutoHandoffTarget(value);
|
|
476
475
|
return target === undefined
|
|
477
|
-
? { kind: "invalid", reason: "expected gjc.ralplan.autoHandoff to be one of off, ultragoal,
|
|
476
|
+
? { kind: "invalid", reason: "expected gjc.ralplan.autoHandoff to be one of off, ultragoal, autoresearch" }
|
|
478
477
|
: { kind: "valid", value: target };
|
|
479
478
|
}
|
|
480
479
|
|
|
@@ -500,18 +499,7 @@ function resolveRalplanAutoHandoffTarget(
|
|
|
500
499
|
if (options.planningStuck) {
|
|
501
500
|
return { configuredTarget, effectiveTarget: "off", degradationReason: "planning_stuck", source };
|
|
502
501
|
}
|
|
503
|
-
|
|
504
|
-
return { configuredTarget, effectiveTarget: configuredTarget, degradationReason: null, source };
|
|
505
|
-
|
|
506
|
-
const availability = (options.teamAvailabilityProbe ?? probeGjcTeamAvailability)();
|
|
507
|
-
return availability.available
|
|
508
|
-
? { configuredTarget, effectiveTarget: "team", degradationReason: null, source }
|
|
509
|
-
: {
|
|
510
|
-
configuredTarget,
|
|
511
|
-
effectiveTarget: "off",
|
|
512
|
-
degradationReason: `team_unavailable:${availability.reason}`,
|
|
513
|
-
source,
|
|
514
|
-
};
|
|
502
|
+
return { configuredTarget, effectiveTarget: configuredTarget, degradationReason: null, source };
|
|
515
503
|
}
|
|
516
504
|
|
|
517
505
|
function parseMaxReviewPassesPerLaneValue(value: unknown): number | null {
|
|
@@ -125,8 +125,22 @@ export function sessionLogsDir(cwd: string, gjcSessionId: string): string {
|
|
|
125
125
|
export function sessionRuntimeDir(cwd: string, gjcSessionId: string): string {
|
|
126
126
|
return path.join(sessionRoot(cwd, gjcSessionId), "runtime");
|
|
127
127
|
}
|
|
128
|
-
export function
|
|
129
|
-
return path.join(sessionRoot(cwd, gjcSessionId), "
|
|
128
|
+
export function sessionIpykernelsDir(cwd: string, gjcSessionId: string): string {
|
|
129
|
+
return path.join(sessionRoot(cwd, gjcSessionId), "ipykernels");
|
|
130
|
+
}
|
|
131
|
+
export function sessionIpykernelsArtifactsDir(cwd: string, gjcSessionId: string): string {
|
|
132
|
+
return path.join(sessionIpykernelsDir(cwd, gjcSessionId), "artifacts");
|
|
133
|
+
}
|
|
134
|
+
export function pythonKernelTranscriptPath(cwd: string, gjcSessionId: string, dirName: string): string {
|
|
135
|
+
const normalized = dirName.trim();
|
|
136
|
+
assertSafePathComponent(normalized, "python kernel transcript dirName");
|
|
137
|
+
return path.join(sessionIpykernelsDir(cwd, gjcSessionId), normalized, "transcript.jsonl");
|
|
138
|
+
}
|
|
139
|
+
export function sessionAutoresearchDir(cwd: string, gjcSessionId: string): string {
|
|
140
|
+
return path.join(sessionRoot(cwd, gjcSessionId), "autoresearch");
|
|
141
|
+
}
|
|
142
|
+
export function sessionAutoresearchRunsDir(cwd: string, gjcSessionId: string): string {
|
|
143
|
+
return path.join(sessionAutoresearchDir(cwd, gjcSessionId), "runs");
|
|
130
144
|
}
|
|
131
145
|
|
|
132
146
|
// ---- Nested resolvers under <sessionRoot>/state ----
|
|
@@ -153,9 +167,6 @@ export function auditPath(cwd: string, gjcSessionId: string): string {
|
|
|
153
167
|
export function transactionJournalPath(cwd: string, gjcSessionId: string, mutationId: string): string {
|
|
154
168
|
return path.join(sessionStateDir(cwd, gjcSessionId), "transactions", `${encodeSessionSegment(mutationId)}.json`);
|
|
155
169
|
}
|
|
156
|
-
export function teamStateRoot(cwd: string, gjcSessionId: string): string {
|
|
157
|
-
return path.join(sessionStateDir(cwd, gjcSessionId), "team");
|
|
158
|
-
}
|
|
159
170
|
export function workflowGatePath(cwd: string, gjcSessionId: string, gateId: string): string {
|
|
160
171
|
return path.join(sessionStateDir(cwd, gjcSessionId), "workflow-gates", `${encodeSessionSegment(gateId)}.json`);
|
|
161
172
|
}
|
|
@@ -173,8 +184,8 @@ export function tmuxRuntimeSessionPath(cwd: string, gjcSessionId: string, slug:
|
|
|
173
184
|
assertSafePathComponent(normalized, "slug");
|
|
174
185
|
return path.join(sessionRuntimeDir(cwd, gjcSessionId), "tmux-sessions", `${normalized}.json`);
|
|
175
186
|
}
|
|
176
|
-
export function
|
|
187
|
+
export function autoresearchRlmArtifactRoot(cwd: string, gjcSessionId: string, rlmSessionId: string): string {
|
|
177
188
|
const normalized = rlmSessionId.trim();
|
|
178
189
|
if (normalized === "") throw new Error("rlmSessionId is required");
|
|
179
|
-
return path.join(
|
|
190
|
+
return path.join(sessionAutoresearchRunsDir(cwd, gjcSessionId), encodeSessionSegment(normalized));
|
|
180
191
|
}
|
|
@@ -5,6 +5,12 @@ import * as path from "node:path";
|
|
|
5
5
|
import type { AssistantMessage } from "@gajae-code/ai/core";
|
|
6
6
|
import { normalizePathForComparison, postmortem } from "@gajae-code/utils";
|
|
7
7
|
import { withFileLock } from "../config/file-lock";
|
|
8
|
+
import {
|
|
9
|
+
ensureCoordinatorDirectory,
|
|
10
|
+
syncCoordinatorDirectory,
|
|
11
|
+
syncCoordinatorFile,
|
|
12
|
+
writeCoordinatorAtomic,
|
|
13
|
+
} from "../coordinator-mcp/durability";
|
|
8
14
|
import { reduceTerminalReceiptState } from "../sdk/receipt-state";
|
|
9
15
|
import { TOOL_CATALOG } from "../tools/tool-catalog.generated";
|
|
10
16
|
import { sessionRoot, sessionRuntimeDir } from "./session-layout";
|
|
@@ -648,6 +654,7 @@ export async function persistCoordinatorRuntimeInputReady(): Promise<RuntimeInpu
|
|
|
648
654
|
if (existing.session_id !== expected.sessionId || existing.launch_id !== expected.launchId) {
|
|
649
655
|
throw runtimeReadinessMarkerConflict();
|
|
650
656
|
}
|
|
657
|
+
await syncCoordinatorDirectory(path.dirname(readinessFile));
|
|
651
658
|
return existing;
|
|
652
659
|
}
|
|
653
660
|
|
|
@@ -665,21 +672,64 @@ export async function persistCoordinatorRuntimeInputReady(): Promise<RuntimeInpu
|
|
|
665
672
|
path.dirname(readinessFile),
|
|
666
673
|
`.${path.basename(readinessFile)}.${process.pid}.${randomUUID()}.tmp`,
|
|
667
674
|
);
|
|
675
|
+
let result: RuntimeInputReadyMarker | null = null;
|
|
676
|
+
let primaryError: unknown;
|
|
668
677
|
try {
|
|
669
|
-
await
|
|
670
|
-
await fs.
|
|
678
|
+
await ensureCoordinatorDirectory(path.dirname(readinessFile));
|
|
679
|
+
const handle = await fs.open(tempFile, "wx", 0o600);
|
|
680
|
+
let writeError: unknown;
|
|
681
|
+
try {
|
|
682
|
+
await handle.writeFile(`${JSON.stringify(marker)}\n`);
|
|
683
|
+
await syncCoordinatorFile(handle);
|
|
684
|
+
} catch (error) {
|
|
685
|
+
writeError = error;
|
|
686
|
+
}
|
|
687
|
+
try {
|
|
688
|
+
await handle.close();
|
|
689
|
+
} catch (closeError) {
|
|
690
|
+
if (writeError) throw new AggregateError([writeError, closeError], "readiness write and close failed");
|
|
691
|
+
throw closeError;
|
|
692
|
+
}
|
|
693
|
+
if (writeError) throw writeError;
|
|
671
694
|
try {
|
|
672
695
|
await fs.link(tempFile, readinessFile);
|
|
673
696
|
} catch (error) {
|
|
674
|
-
if ((error as { code?: unknown }).code !== "EEXIST") throw
|
|
697
|
+
if ((error as { code?: unknown }).code !== "EEXIST") throw error;
|
|
675
698
|
const raced = await readRuntimeInputReadyMarker(readinessFile);
|
|
676
|
-
if (raced && raced.session_id === expected.sessionId && raced.launch_id === expected.launchId)
|
|
677
|
-
|
|
699
|
+
if (raced && raced.session_id === expected.sessionId && raced.launch_id === expected.launchId) {
|
|
700
|
+
await syncCoordinatorDirectory(path.dirname(readinessFile));
|
|
701
|
+
result = raced;
|
|
702
|
+
} else {
|
|
703
|
+
throw runtimeReadinessMarkerConflict();
|
|
704
|
+
}
|
|
678
705
|
}
|
|
679
|
-
|
|
680
|
-
|
|
706
|
+
if (result === null) {
|
|
707
|
+
await syncCoordinatorDirectory(path.dirname(readinessFile));
|
|
708
|
+
result = marker;
|
|
709
|
+
}
|
|
710
|
+
} catch (error) {
|
|
711
|
+
primaryError = error;
|
|
712
|
+
}
|
|
713
|
+
let cleanupError: unknown;
|
|
714
|
+
try {
|
|
681
715
|
await fs.rm(tempFile, { force: true });
|
|
716
|
+
} catch (error) {
|
|
717
|
+
cleanupError = error;
|
|
682
718
|
}
|
|
719
|
+
let cleanupBarrierError: unknown;
|
|
720
|
+
if (!cleanupError) {
|
|
721
|
+
try {
|
|
722
|
+
await syncCoordinatorDirectory(path.dirname(readinessFile));
|
|
723
|
+
} catch (error) {
|
|
724
|
+
cleanupBarrierError = error;
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
const failures = [primaryError, cleanupError, cleanupBarrierError].filter(
|
|
728
|
+
(error): error is unknown => error !== undefined,
|
|
729
|
+
);
|
|
730
|
+
if (failures.length > 1) throw new AggregateError(failures, "readiness publication and cleanup failed");
|
|
731
|
+
if (failures.length === 1) throw failures[0];
|
|
732
|
+
return result;
|
|
683
733
|
}
|
|
684
734
|
|
|
685
735
|
function sameResolvedPath(left: string, right: string, platform: NodeJS.Platform = process.platform): boolean {
|
|
@@ -1268,8 +1318,7 @@ async function withCoordinatorTransactionLock<T>(stateFile: string, operation: (
|
|
|
1268
1318
|
}
|
|
1269
1319
|
|
|
1270
1320
|
async function writeStateFile(stateFile: string, payload: Record<string, unknown>): Promise<void> {
|
|
1271
|
-
await
|
|
1272
|
-
await Bun.write(stateFile, `${JSON.stringify(payload)}\n`);
|
|
1321
|
+
await writeCoordinatorAtomic(stateFile, `${JSON.stringify(payload)}\n`);
|
|
1273
1322
|
}
|
|
1274
1323
|
|
|
1275
1324
|
function contextWithManagedOwnerGeneration(context: RuntimeStateContext): RuntimeStateContext {
|
|
@@ -288,44 +288,6 @@ export function renderUltragoalStatusMarkdown(summary: {
|
|
|
288
288
|
return `${lines.join("\n")}\n`;
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
-
export function renderTeamStatusMarkdown(snapshot: {
|
|
292
|
-
team_name: string;
|
|
293
|
-
phase: string;
|
|
294
|
-
tmux_target?: string;
|
|
295
|
-
tmux_session?: string;
|
|
296
|
-
state_dir: string;
|
|
297
|
-
task_total: number;
|
|
298
|
-
task_counts: Record<string, number>;
|
|
299
|
-
workers: Array<{ id: string; status: string }>;
|
|
300
|
-
notification_summary?: { total: number; replay_eligible: number; by_state: Record<string, number> };
|
|
301
|
-
integration_by_worker?: Record<string, { status?: string; conflict_files?: string[] }>;
|
|
302
|
-
}): string {
|
|
303
|
-
const counts = Object.entries(snapshot.task_counts)
|
|
304
|
-
.map(([key, value]) => `${key}=${value}`)
|
|
305
|
-
.join(" ");
|
|
306
|
-
const lines = [
|
|
307
|
-
"# team status",
|
|
308
|
-
"",
|
|
309
|
-
`- team: ${snapshot.team_name}`,
|
|
310
|
-
`- phase: ${snapshot.phase}`,
|
|
311
|
-
`- tmux: ${snapshot.tmux_target || snapshot.tmux_session || "none"}`,
|
|
312
|
-
`- state: ${snapshot.state_dir}`,
|
|
313
|
-
`- tasks: ${snapshot.task_total} (${counts})`,
|
|
314
|
-
`- workers: ${snapshot.workers.length} (${snapshot.workers.map(worker => `${worker.id}:${worker.status}`).join(" ")})`,
|
|
315
|
-
];
|
|
316
|
-
if (snapshot.notification_summary) {
|
|
317
|
-
lines.push(
|
|
318
|
-
`- notifications: total=${snapshot.notification_summary.total} replay_eligible=${snapshot.notification_summary.replay_eligible}`,
|
|
319
|
-
);
|
|
320
|
-
}
|
|
321
|
-
const integrations = Object.entries(snapshot.integration_by_worker ?? {});
|
|
322
|
-
if (integrations.length)
|
|
323
|
-
lines.push(
|
|
324
|
-
`- integrations: ${integrations.map(([worker, state]) => `${worker}:${state.status ?? "unknown"}`).join(" ")}`,
|
|
325
|
-
);
|
|
326
|
-
return `${lines.join("\n")}\n`;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
291
|
export function renderStateMarkdown(
|
|
330
292
|
skill: CanonicalGjcWorkflowSkill,
|
|
331
293
|
stateJson: Record<string, unknown>,
|
|
@@ -15,11 +15,12 @@ import {
|
|
|
15
15
|
} from "../skill-state/active-state";
|
|
16
16
|
import { initialPhaseForSkill } from "../skill-state/initial-phase";
|
|
17
17
|
import {
|
|
18
|
+
buildAutoresearchHudSummary,
|
|
18
19
|
buildRalplanHudSummary,
|
|
19
|
-
buildTeamHudSummary,
|
|
20
20
|
buildUltragoalHudSummary,
|
|
21
21
|
deriveDeepInterviewHud,
|
|
22
22
|
} from "../skill-state/workflow-hud";
|
|
23
|
+
|
|
23
24
|
import {
|
|
24
25
|
type AuditEntry,
|
|
25
26
|
buildWorkflowStateReceipt,
|
|
@@ -923,27 +924,47 @@ function buildHudForMode(
|
|
|
923
924
|
updatedAt,
|
|
924
925
|
});
|
|
925
926
|
}
|
|
926
|
-
case "
|
|
927
|
-
const
|
|
928
|
-
const
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
927
|
+
case "autoresearch": {
|
|
928
|
+
const missionPhase = typeof payload.current_phase === "string" ? payload.current_phase : (phase ?? "intake");
|
|
929
|
+
const mode = typeof payload.mode === "string" ? payload.mode : undefined;
|
|
930
|
+
const intake = typeof payload.intake === "string" ? payload.intake : undefined;
|
|
931
|
+
const slug = typeof payload.slug === "string" ? payload.slug : undefined;
|
|
932
|
+
const specPath =
|
|
933
|
+
typeof payload.spec_path === "string"
|
|
934
|
+
? payload.spec_path
|
|
935
|
+
: typeof payload.specPath === "string"
|
|
936
|
+
? payload.specPath
|
|
937
|
+
: undefined;
|
|
938
|
+
|
|
939
|
+
const verdict =
|
|
940
|
+
payload.verdict && typeof payload.verdict === "object" && !Array.isArray(payload.verdict)
|
|
941
|
+
? (payload.verdict as Record<string, unknown>)
|
|
942
|
+
: undefined;
|
|
943
|
+
const verdictValue = verdict
|
|
944
|
+
? typeof verdict.status === "string"
|
|
945
|
+
? verdict.status
|
|
946
|
+
: verdict.status && typeof verdict.status === "object"
|
|
947
|
+
? JSON.stringify(verdict.status).slice(0, 40)
|
|
948
|
+
: undefined
|
|
949
|
+
: undefined;
|
|
950
|
+
const rawExperiments = Array.isArray(payload.experiments) ? payload.experiments : [];
|
|
951
|
+
const experimentStatuses = rawExperiments
|
|
952
|
+
.map(item =>
|
|
953
|
+
item && typeof item === "object" && typeof (item as Record<string, unknown>).status === "string"
|
|
954
|
+
? ((item as Record<string, unknown>).status as string)
|
|
955
|
+
: undefined,
|
|
956
|
+
)
|
|
957
|
+
.filter((status): status is string => Boolean(status));
|
|
958
|
+
return buildAutoresearchHudSummary({
|
|
959
|
+
phase: missionPhase,
|
|
960
|
+
mode,
|
|
961
|
+
intake,
|
|
962
|
+
slug,
|
|
963
|
+
verdict: verdictValue,
|
|
964
|
+
specPath,
|
|
965
|
+
experimentCount: experimentStatuses.length,
|
|
966
|
+
experimentStatuses,
|
|
967
|
+
updatedAt,
|
|
947
968
|
});
|
|
948
969
|
}
|
|
949
970
|
default:
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import * as fs from "node:fs/promises";
|
|
14
14
|
import { z } from "zod";
|
|
15
|
+
import { CANONICAL_GJC_WORKFLOW_SKILLS } from "../skill-state/canonical-skills";
|
|
15
16
|
import { WORKFLOW_STATE_VERSION } from "../skill-state/workflow-state-version";
|
|
16
17
|
|
|
17
|
-
const CANONICAL_GJC_WORKFLOW_SKILLS = ["deep-interview", "ralplan", "ultragoal", "team"] as const;
|
|
18
18
|
const skillEnum = z.enum([...CANONICAL_GJC_WORKFLOW_SKILLS]);
|
|
19
19
|
const ownerEnum = z.enum(["gjc-state-cli", "gjc-runtime", "gjc-hook"]);
|
|
20
20
|
const receiptStatusEnum = z.enum(["fresh", "stale"]);
|
|
@@ -56,14 +56,14 @@ export function envDisabled(value: string | undefined): boolean {
|
|
|
56
56
|
* Resolve the tmux (or tmux-compatible multiplexer) command GJC should invoke.
|
|
57
57
|
*
|
|
58
58
|
* This is the shared entry point used by every GJC code path that needs to talk
|
|
59
|
-
* to a multiplexer: `gjc --tmux` planning
|
|
59
|
+
* to a multiplexer: `gjc --tmux` planning and `gjc session ...`,
|
|
60
60
|
* the lifecycle controller, and the harness resident owner. Routing all of
|
|
61
61
|
* them through the same resolver means a single `GJC_TMUX_COMMAND` override or
|
|
62
62
|
* a single Windows psmux / pmux detection wins for the whole process — the
|
|
63
63
|
* failure mode where `gjc --tmux` creates a psmux-backed session and then
|
|
64
64
|
* `gjc session status` fails because it queries literal `tmux` is closed off.
|
|
65
65
|
*
|
|
66
|
-
* Explicit `GJC_TMUX_COMMAND`
|
|
66
|
+
* Explicit `GJC_TMUX_COMMAND` overrides are honored on
|
|
67
67
|
* every platform. On native Windows without an override the resolver walks
|
|
68
68
|
* `psmux`, then `pmux`, then `tmux` and uses the first binary present on PATH.
|
|
69
69
|
* On POSIX the resolver returns `tmux` (the historical default) and only
|
|
@@ -124,10 +124,10 @@ export const GJC_TMUX_UNTAGGED_REASON = "gjc_tmux_session_untagged";
|
|
|
124
124
|
export function buildGjcTmuxUntaggedSessionHint(tmuxCommand: string): string {
|
|
125
125
|
return (
|
|
126
126
|
`the active multiplexer "${tmuxCommand}" lists this session but did not return GJC's ${GJC_TMUX_PROFILE_OPTION} ownership tag; ` +
|
|
127
|
-
"GJC-managed sessions
|
|
127
|
+
"GJC-managed sessions require a tmux provider that round-trips tmux user options. " +
|
|
128
128
|
"On Windows psmux, GJC persists a ProviderAuthority that binds the exact executable identity and an isolated `-L <namespace>` server namespace for the owner generation. " +
|
|
129
129
|
"Recover through GJC so it reuses that persisted authority; do not retry against ambient tmux/psmux or a raw `-L` namespace. " +
|
|
130
|
-
"GJC_TMUX_COMMAND
|
|
130
|
+
"GJC_TMUX_COMMAND is a binary override, not a shell command line."
|
|
131
131
|
);
|
|
132
132
|
}
|
|
133
133
|
|
|
@@ -233,7 +233,7 @@ export function buildGjcTmuxRequiredProfileCommands(
|
|
|
233
233
|
* 3.3.0. psmux does not support the tmux `set-window-option` command at all
|
|
234
234
|
* (it reports "unknown command: set-window-option") and silently drops several
|
|
235
235
|
* `set-option` keys. The list lives here so every code path that tags a tmux
|
|
236
|
-
* session (gjc --tmux planning, gjc session create
|
|
236
|
+
* session (gjc --tmux planning, gjc session create)
|
|
237
237
|
* applies the same filter.
|
|
238
238
|
*/
|
|
239
239
|
const PSMUX_UNSUPPORTED_PROFILE_KEYS = new Set(["mouse", "set-clipboard", "mode-style"]);
|
|
@@ -270,11 +270,11 @@ export function buildGjcTmuxProfileCommands(
|
|
|
270
270
|
// psmux does not implement set-window-option and historically drops
|
|
271
271
|
// mouse / set-clipboard / mode-style. Filter the UX profile commands
|
|
272
272
|
// centrally so every code path that tags a session (gjc --tmux planning,
|
|
273
|
-
// gjc session create
|
|
273
|
+
// gjc session create) drops the same set. The
|
|
274
274
|
// GJC_PSMUX_PROFILE_FORCE override lets the operator opt back in when
|
|
275
275
|
// running on a psmux build that has caught up. The ownership-tag
|
|
276
276
|
// round-trip (set-option @gjc-*) is never filtered, since gjc session /
|
|
277
|
-
//
|
|
277
|
+
// tmux-backed sessions rely on it.
|
|
278
278
|
// The filter is opt-in: callers that explicitly pass `opts.tmuxCommand`
|
|
279
279
|
// name a psmux-class multiplexer (psmux / pmux) when they want the UX
|
|
280
280
|
// profile filtered. Auto-detect on Windows hosts where psmux happens
|