@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
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/** Skills whose durable state can produce a structured recovery projection. */
|
|
2
|
+
export type WorkflowRecoverySkill = "ralplan" | "ultragoal";
|
|
3
|
+
export interface WorkflowRecoveryScopeItem {
|
|
4
|
+
kind: "accepted" | "non_goal";
|
|
5
|
+
text: string;
|
|
6
|
+
}
|
|
7
|
+
export interface WorkflowRecoveryProjection {
|
|
8
|
+
skill: WorkflowRecoverySkill;
|
|
9
|
+
/** Canonical durable state that produced this projection. */
|
|
10
|
+
source: "ralplan-final" | "ralplan-run" | "ultragoal-plan";
|
|
11
|
+
/** Bounded accepted objective for the current work contract. */
|
|
12
|
+
objective: string;
|
|
13
|
+
/** Bounded accepted scope + explicit non-goals (scope reload, not expansion). */
|
|
14
|
+
scope: WorkflowRecoveryScopeItem[];
|
|
15
|
+
/** Bounded acceptance criteria / verification obligations. */
|
|
16
|
+
acceptanceCriteria: string[];
|
|
17
|
+
/** Unresolved decisions carried from the durable contract, bounded. */
|
|
18
|
+
unresolved: string[];
|
|
19
|
+
/** Durable identity + integrity digest of the source state. */
|
|
20
|
+
provenance: {
|
|
21
|
+
planPath?: string;
|
|
22
|
+
runId?: string;
|
|
23
|
+
stage?: string;
|
|
24
|
+
sha256?: string;
|
|
25
|
+
};
|
|
26
|
+
/** Current goal + measurable progress counters from canonical state. */
|
|
27
|
+
currentGoal?: {
|
|
28
|
+
goalId: string;
|
|
29
|
+
status: string;
|
|
30
|
+
objective: string;
|
|
31
|
+
};
|
|
32
|
+
progress: {
|
|
33
|
+
totalGoals?: number;
|
|
34
|
+
completedGoals?: number;
|
|
35
|
+
outstandingGoals?: number;
|
|
36
|
+
/** Latest boundary review generation recorded in the ledger. */
|
|
37
|
+
latestReviewGeneration?: number;
|
|
38
|
+
/** Frozen source hash of the latest joined review cohort, if any. */
|
|
39
|
+
latestCohortSourceHash?: string;
|
|
40
|
+
/** Ledger event id of the newest event backing this projection. */
|
|
41
|
+
latestLedgerEventId?: string;
|
|
42
|
+
};
|
|
43
|
+
/** Exact next bounded action class for resumption. */
|
|
44
|
+
nextAction: {
|
|
45
|
+
actionClass: "continue-current-goal" | "start-next-goal" | "resolve-review-blockers" | "run-boundary-cohort" | "run-plan-review" | "revise-plan" | "reconcile-intent" | "final-aggregate-checkpoint" | "awaiting-approval" | "unknown";
|
|
46
|
+
goalId?: string;
|
|
47
|
+
detail?: string;
|
|
48
|
+
};
|
|
49
|
+
/** #4560: measurable-progress basis for bounding zero-progress cycles. */
|
|
50
|
+
zeroProgress: {
|
|
51
|
+
fingerprint: string;
|
|
52
|
+
unchangedObservations: number;
|
|
53
|
+
stalled: boolean;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/** #4560: compaction-observation memory for zero-progress bounding. */
|
|
57
|
+
export interface WorkflowRecoveryZeroProgressMemory {
|
|
58
|
+
/** Last observed progress fingerprint per skill. */
|
|
59
|
+
lastFingerprint?: string;
|
|
60
|
+
/** Consecutive compaction observations with an unchanged fingerprint. */
|
|
61
|
+
unchangedObservations: number;
|
|
62
|
+
}
|
|
63
|
+
/** #4560: bound repeated zero-progress continuation cycles (#4560). */
|
|
64
|
+
export declare const ZERO_PROGRESS_STALL_THRESHOLD = 2;
|
|
65
|
+
export declare function trackWorkflowRecoveryZeroProgress(memory: WorkflowRecoveryZeroProgressMemory | undefined, projection: WorkflowRecoveryProjection): WorkflowRecoveryZeroProgressMemory;
|
|
66
|
+
export declare function isWorkflowRecoveryStalled(memory: WorkflowRecoveryZeroProgressMemory | undefined): boolean;
|
|
67
|
+
export interface RalplanFinalProjectionInput {
|
|
68
|
+
cwd: string;
|
|
69
|
+
sessionId: string;
|
|
70
|
+
runId: string;
|
|
71
|
+
}
|
|
72
|
+
interface RalplanProjectionInput extends RalplanFinalProjectionInput {
|
|
73
|
+
lastReviewVerdict?: string;
|
|
74
|
+
lastReviewVerdictLane?: string;
|
|
75
|
+
}
|
|
76
|
+
export declare function projectRalplanFinalRun(input: RalplanFinalProjectionInput): Promise<WorkflowRecoveryProjection | undefined>;
|
|
77
|
+
export declare function projectRalplanRun(input: RalplanProjectionInput): Promise<WorkflowRecoveryProjection | undefined>;
|
|
78
|
+
/**
|
|
79
|
+
* Project the active Ralplan run recorded in durable mode state. When legacy
|
|
80
|
+
* state has no run id, fall back to complete runs ordered by index freshness,
|
|
81
|
+
* skipping unfinished or malformed candidates instead of letting them shadow
|
|
82
|
+
* the newest usable final contract.
|
|
83
|
+
*/
|
|
84
|
+
export declare function projectLatestRalplanRun(input: {
|
|
85
|
+
cwd: string;
|
|
86
|
+
sessionId: string;
|
|
87
|
+
}): Promise<WorkflowRecoveryProjection | undefined>;
|
|
88
|
+
/**
|
|
89
|
+
* Build a recovery projection from Ultragoal canonical durable state. The
|
|
90
|
+
* accepted contract is the aggregate objective plus the goal list; progress
|
|
91
|
+
* and next action are derived from `goals.json` status plus the newest ledger
|
|
92
|
+
* receipts, never from conversation memory.
|
|
93
|
+
*/
|
|
94
|
+
export declare function projectUltragoalRun(input: {
|
|
95
|
+
cwd: string;
|
|
96
|
+
sessionId: string;
|
|
97
|
+
}): Promise<WorkflowRecoveryProjection | undefined>;
|
|
98
|
+
/** Stable digest over the projection's contract-relevant fields. */
|
|
99
|
+
export declare function hashWorkflowRecoveryProjection(projection: WorkflowRecoveryProjection): string;
|
|
100
|
+
export {};
|
|
@@ -5,7 +5,7 @@ export interface SkillKeywordDefinition {
|
|
|
5
5
|
priority: number;
|
|
6
6
|
guidance: string;
|
|
7
7
|
}
|
|
8
|
-
export declare const GJC_WORKFLOW_SKILLS: readonly ["deep-interview", "ralplan", "ultragoal", "
|
|
8
|
+
export declare const GJC_WORKFLOW_SKILLS: readonly ["deep-interview", "ralplan", "ultragoal", "autoresearch"];
|
|
9
9
|
export type GjcWorkflowSkill = CanonicalGjcWorkflowSkill;
|
|
10
10
|
export declare const GJC_SKILL_KEYWORD_DEFINITIONS: readonly SkillKeywordDefinition[];
|
|
11
11
|
export declare function isGjcWorkflowSkill(value: string): value is GjcWorkflowSkill;
|
package/dist/types/main.d.ts
CHANGED
|
@@ -102,15 +102,6 @@ export declare const BARE_RESUME_OPEN_ERROR = "Could not open the selected sessi
|
|
|
102
102
|
export declare function runInteractiveMode(session: AgentSession, version: string, changelogMarkdown: string | undefined, notifs: (InteractiveModeNotify | null)[], startupUpdate: StartupUpdateOrchestrator, initialMessages: string[], setExtensionUIContext: (uiContext: ExtensionUIContext, hasUI: boolean) => void, lspServers: LspStartupServerInfo[] | undefined, mcpManager: MCPManager | undefined, eventBus?: EventBus, initialMessage?: string, initialImages?: ImageContent[], createInteractiveMode?: CreateInteractiveMode, resumeAction?: "continue-tail" | "open-idle", startDeferredMcpConfig?: CreateAgentSessionResult["startDeferredMcpConfig"], startDeferredModelProfiles?: DeferredModelProfileStartup): Promise<void>;
|
|
103
103
|
export declare function getChangelogForDisplay(parsed: Args): Promise<string | undefined>;
|
|
104
104
|
export declare function createSessionManager(parsed: Args, cwd: string, activeSettings?: Settings): Promise<SessionManager | undefined>;
|
|
105
|
-
/**
|
|
106
|
-
* Research-mode (RLM) preset hook. Lets `gjc rlm` augment the session options
|
|
107
|
-
* (system prompt, restricted toolset, custom python tool) and assert the tool
|
|
108
|
-
* boundary once the session's tool registry is fully assembled.
|
|
109
|
-
*/
|
|
110
|
-
export interface RlmPreset {
|
|
111
|
-
applyOptions: (options: CreateAgentSessionOptions, settings: Settings) => void;
|
|
112
|
-
onSessionCreated?: (session: AgentSession) => void | Promise<void>;
|
|
113
|
-
}
|
|
114
105
|
type RunPrintMode = (session: AgentSession, options: PrintModeOptions) => Promise<void>;
|
|
115
106
|
export interface RunRootCommandDependencies {
|
|
116
107
|
createAgentSession?: typeof createAgentSession;
|
|
@@ -120,7 +111,6 @@ export interface RunRootCommandDependencies {
|
|
|
120
111
|
agentDir?: string;
|
|
121
112
|
}) => Promise<void>;
|
|
122
113
|
settings?: Settings;
|
|
123
|
-
rlmPreset?: RlmPreset;
|
|
124
114
|
suppressProcessExit?: boolean;
|
|
125
115
|
startupUpdate?: {
|
|
126
116
|
check: () => Promise<string | undefined>;
|
|
@@ -75,13 +75,20 @@ export declare function transcriptContinuations(entry: unknown): TranscriptConti
|
|
|
75
75
|
*/
|
|
76
76
|
export declare function collectActiveProviderIds(adapter: Pick<AcpSdkAdapter, "query">): Promise<ReadonlySet<string> | undefined>;
|
|
77
77
|
/**
|
|
78
|
-
* Collect
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
78
|
+
* Collect the model catalog (Q10) and the active-provider set (Q29) under one
|
|
79
|
+
* credential ordering. Assembling the first Q10 page is what finalizes host-side
|
|
80
|
+
* credential state — expired or invalid OAuth credentials are refreshed or
|
|
81
|
+
* disabled while that snapshot is built, and continuation pages replay the
|
|
82
|
+
* frozen revision without further side effects — so Q29 must not start until
|
|
83
|
+
* page 1 has resolved. Starting both together would let Q29 snapshot pre-refresh
|
|
84
|
+
* credential state and mix catalog rows and provider availability from different
|
|
85
|
+
* credential states. After page 1, the provider walk overlaps the remaining
|
|
86
|
+
* catalog pages instead of adding its latency after them.
|
|
83
87
|
*/
|
|
84
|
-
export declare function
|
|
88
|
+
export declare function collectModelCatalogAndActiveProviders(adapter: Pick<AcpSdkAdapter, "query">): Promise<{
|
|
89
|
+
modelCatalog: unknown;
|
|
90
|
+
activeProviders: ReadonlySet<string> | undefined;
|
|
91
|
+
}>;
|
|
85
92
|
/** Maps live canonical SDK config and the selected model catalog into the ACP 1.2.1 session state surface. */
|
|
86
93
|
export declare function acpSessionStateFromConfig(query: unknown, modelCatalogQuery?: unknown, modelPreset?: string, activeProviders?: ReadonlySet<string>): {
|
|
87
94
|
configOptions: ({
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { ThinkingLevel } from "@gajae-code/agent-core";
|
|
2
2
|
import { type Model } from "@gajae-code/ai/core";
|
|
3
3
|
import { Container, Input, type TUI } from "@gajae-code/tui";
|
|
4
|
+
import { type AutoroutingSetup } from "../../config/autorouting-contract";
|
|
4
5
|
import type { GjcModelAssignmentTargetId, ModelRegistry } from "../../config/model-registry";
|
|
5
6
|
import { type ScopedModelSelection } from "../../config/model-resolver";
|
|
6
7
|
import type { ModelProfileConfig } from "../../config/models-config-schema";
|
|
7
8
|
import type { Settings } from "../../config/settings";
|
|
9
|
+
import type { SmartRoutingIntent, SmartRoutingPreview } from "./smart-routing-panel";
|
|
10
|
+
import { SmartRoutingPanelComponent } from "./smart-routing-panel";
|
|
8
11
|
type ScopedModelItem = ScopedModelSelection;
|
|
9
12
|
export type ModelSelectorSelection = {
|
|
10
13
|
kind: "assignment";
|
|
@@ -26,8 +29,12 @@ export type ModelSelectorSelection = {
|
|
|
26
29
|
} | {
|
|
27
30
|
kind: "deleteProfile";
|
|
28
31
|
profileName: string;
|
|
32
|
+
} | {
|
|
33
|
+
kind: "smartRouting";
|
|
34
|
+
intent: SmartRoutingIntent;
|
|
29
35
|
};
|
|
30
36
|
type RoleSelectCallback = (selection: ModelSelectorSelection) => void | Promise<void>;
|
|
37
|
+
type ModelSelectorViewMode = "presets" | "models" | "smart-routing";
|
|
31
38
|
/**
|
|
32
39
|
* Component that renders a canonical model selector with provider tabs.
|
|
33
40
|
* - Preset landing Left/Right: Collapse/expand selected provider
|
|
@@ -48,6 +55,9 @@ export declare class ModelSelectorComponent extends Container {
|
|
|
48
55
|
currentThinkingLevel?: ThinkingLevel;
|
|
49
56
|
activeModelProfile?: string;
|
|
50
57
|
configuredDefaultChain?: readonly string[];
|
|
58
|
+
smartRoutingPreview?: (draft: AutoroutingSetup) => SmartRoutingPreview;
|
|
59
|
+
/** Open the smart-routing panel directly instead of the preset landing. */
|
|
60
|
+
smartRoutingOnly?: boolean;
|
|
51
61
|
});
|
|
52
62
|
dispose(): void;
|
|
53
63
|
refreshRoleAssignments(options?: {
|
|
@@ -55,6 +65,7 @@ export declare class ModelSelectorComponent extends Container {
|
|
|
55
65
|
currentThinkingLevel?: ThinkingLevel;
|
|
56
66
|
activeModelProfile?: string;
|
|
57
67
|
}): void;
|
|
68
|
+
refreshSmartRoutingState(): void;
|
|
58
69
|
handleInput(keyData: string): void;
|
|
59
70
|
refreshPresetProfiles(profileName?: string): void;
|
|
60
71
|
getSearchInput(): Input;
|
|
@@ -64,5 +75,8 @@ export declare class ModelSelectorComponent extends Container {
|
|
|
64
75
|
}>, "kind">): Promise<void>;
|
|
65
76
|
__testSelectPresetAction(profileName: string, action: "rename" | "delete"): Promise<void>;
|
|
66
77
|
__testSelectedPresetRowIdentity(): string | undefined;
|
|
78
|
+
__testGetSmartRoutingPanel(): SmartRoutingPanelComponent | undefined;
|
|
79
|
+
__testViewMode(): ModelSelectorViewMode;
|
|
80
|
+
__testOpenSmartRoutingPanel(): void;
|
|
67
81
|
}
|
|
68
82
|
export {};
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
import { type SkillActiveEntry } from "../../../skill-state/active-state";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Render the HUD as physical rows rather than embedding a newline in one row.
|
|
4
|
+
* The bottom-pinned TUI layout counts array elements as rows; a newline inside
|
|
5
|
+
* one element corrupts that accounting and can overwrite the editor.
|
|
6
|
+
*/
|
|
7
|
+
export declare function renderSkillHudBar(entries: readonly SkillActiveEntry[], width: number): string[] | null;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Container } from "@gajae-code/tui";
|
|
2
|
+
import type { AutoroutingProvenance, AutoroutingProviderOrderHint, AutoroutingSetup, TierMap } from "../../config/autorouting-contract";
|
|
3
|
+
import type { AutoroutingSourceIdentity } from "../../config/autorouting-generator";
|
|
4
|
+
/** Longest rendered panel line before truncation. */
|
|
5
|
+
export declare const MAX_PANEL_LINE_WIDTH = 200;
|
|
6
|
+
export type SmartRoutingPreview = {
|
|
7
|
+
readonly setup: AutoroutingSetup;
|
|
8
|
+
readonly tiers: TierMap;
|
|
9
|
+
readonly provenance: AutoroutingProvenance;
|
|
10
|
+
readonly sourceIdentity: AutoroutingSourceIdentity;
|
|
11
|
+
};
|
|
12
|
+
export type SmartRoutingIntent = {
|
|
13
|
+
kind: "apply";
|
|
14
|
+
draft: AutoroutingSetup;
|
|
15
|
+
preview: SmartRoutingPreview;
|
|
16
|
+
confirmHandEdit?: boolean;
|
|
17
|
+
} | {
|
|
18
|
+
kind: "refresh";
|
|
19
|
+
confirmHandEdit?: boolean;
|
|
20
|
+
} | {
|
|
21
|
+
kind: "clear";
|
|
22
|
+
} | {
|
|
23
|
+
kind: "toggle";
|
|
24
|
+
enabled: boolean;
|
|
25
|
+
};
|
|
26
|
+
export type SmartRoutingPanelMode = "editing" | "confirming" | "committing" | "done" | "error";
|
|
27
|
+
export type SmartRoutingConfirmation = "clear" | "hand-edit" | undefined;
|
|
28
|
+
export interface SmartRoutingPanelOptions {
|
|
29
|
+
setup: AutoroutingSetup;
|
|
30
|
+
tiers?: TierMap;
|
|
31
|
+
provenance?: AutoroutingProvenance;
|
|
32
|
+
/** Advisory drift between the recorded declaration and current provider priority. */
|
|
33
|
+
providerOrderHint?: AutoroutingProviderOrderHint;
|
|
34
|
+
enabled: boolean;
|
|
35
|
+
readOnly: boolean;
|
|
36
|
+
stale: boolean;
|
|
37
|
+
preview: SmartRoutingPreview;
|
|
38
|
+
generatePreview: (draft: AutoroutingSetup) => SmartRoutingPreview;
|
|
39
|
+
onSelect: (intent: SmartRoutingIntent) => undefined | Promise<SmartRoutingPreview | undefined>;
|
|
40
|
+
onCancel: () => void;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Presentational smart-routing setup editor. It owns only ephemeral draft and
|
|
44
|
+
* preview state; all durable changes are emitted as typed intents.
|
|
45
|
+
*/
|
|
46
|
+
export declare class SmartRoutingPanelComponent extends Container {
|
|
47
|
+
#private;
|
|
48
|
+
constructor(options: SmartRoutingPanelOptions);
|
|
49
|
+
get mode(): SmartRoutingPanelMode;
|
|
50
|
+
get confirmation(): SmartRoutingConfirmation;
|
|
51
|
+
getDraft(): AutoroutingSetup;
|
|
52
|
+
getPreviewPayload(): SmartRoutingPreview;
|
|
53
|
+
getProviderOrder(): readonly string[];
|
|
54
|
+
/**
|
|
55
|
+
* Advisory-only, non-destructive hint update.
|
|
56
|
+
*
|
|
57
|
+
* `refreshState` deliberately replaces the draft and clears editor state, so it
|
|
58
|
+
* must never be used for a background settings change: an external
|
|
59
|
+
* `modelProviderOrder` edit would then discard the user's unsaved reordering,
|
|
60
|
+
* allowlist buffer, cursor, and confirmation. This replaces the hint and nothing
|
|
61
|
+
* else.
|
|
62
|
+
*/
|
|
63
|
+
updateProviderOrderHint(hint: AutoroutingProviderOrderHint | undefined): void;
|
|
64
|
+
/** Replace the panel's persisted snapshot after a controller mutation. */
|
|
65
|
+
refreshState(options: {
|
|
66
|
+
setup: AutoroutingSetup;
|
|
67
|
+
tiers?: TierMap;
|
|
68
|
+
provenance?: AutoroutingProvenance;
|
|
69
|
+
enabled: boolean;
|
|
70
|
+
providerOrderHint?: AutoroutingProviderOrderHint;
|
|
71
|
+
stale: boolean;
|
|
72
|
+
preview: SmartRoutingPreview;
|
|
73
|
+
}): void;
|
|
74
|
+
handleInput(data: string): void;
|
|
75
|
+
__testApply(): Promise<void>;
|
|
76
|
+
/** Test hook mirroring an in-panel provider reorder/edit: mutates the draft and re-previews. */
|
|
77
|
+
__testSetProviders(providers: string[]): void;
|
|
78
|
+
__testRefresh(confirmHandEdit?: boolean): Promise<void>;
|
|
79
|
+
__testToggle(enabled?: boolean): Promise<void>;
|
|
80
|
+
__testClear(): Promise<void>;
|
|
81
|
+
__testConfirm(): Promise<void>;
|
|
82
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Component, SlashCommand } from "@gajae-code/tui";
|
|
2
|
+
import { type AutoroutingSetup } from "../../config/autorouting-contract";
|
|
2
3
|
import type { ModelProfileConfig } from "../../config/models-config-schema";
|
|
3
4
|
import { type Settings } from "../../config/settings";
|
|
4
5
|
import { type InteractiveModeContext, type OAuthSelectorOptions } from "../../modes/types";
|
|
@@ -11,6 +12,7 @@ import { type CredentialAutoImportStateStore } from "../../setup/credential-auto
|
|
|
11
12
|
import { type CommandPaletteAction } from "../components/command-palette";
|
|
12
13
|
import type { NotificationsEditorOperations } from "../components/notifications-settings-editor";
|
|
13
14
|
import { type PlanPreviewOptions, type PlanPreviewResult } from "../components/plan-preview-overlay";
|
|
15
|
+
import type { SmartRoutingPreview } from "../components/smart-routing-panel";
|
|
14
16
|
import type { StatusLineSettings } from "../components/tool-status-header";
|
|
15
17
|
import type { JobsObserver } from "../jobs-observer";
|
|
16
18
|
import type { SessionObserverRegistry } from "../session-observer-registry";
|
|
@@ -112,8 +114,20 @@ export declare class SelectorController {
|
|
|
112
114
|
* This handles side effects and session-specific settings.
|
|
113
115
|
*/
|
|
114
116
|
handleSettingChange(id: string, value: unknown): void;
|
|
117
|
+
/** Generate the immutable preview used by the smart-routing panel. */
|
|
118
|
+
previewSmartRouting(draft: AutoroutingSetup): SmartRoutingPreview;
|
|
119
|
+
applySmartRouting(draft: AutoroutingSetup, options?: {
|
|
120
|
+
preview?: SmartRoutingPreview;
|
|
121
|
+
confirmHandEdit?: boolean;
|
|
122
|
+
}): Promise<SmartRoutingPreview>;
|
|
123
|
+
refreshSmartRouting(options?: {
|
|
124
|
+
confirmHandEdit?: boolean;
|
|
125
|
+
}): Promise<SmartRoutingPreview>;
|
|
126
|
+
clearGeneratedSetup(): Promise<void>;
|
|
127
|
+
setAutoroutingEnabled(enabled: boolean): Promise<void>;
|
|
115
128
|
showModelSelector(options?: {
|
|
116
129
|
temporaryOnly?: boolean;
|
|
130
|
+
smartRoutingOnly?: boolean;
|
|
117
131
|
}): void;
|
|
118
132
|
showPluginSelector(mode?: "install" | "uninstall"): Promise<void>;
|
|
119
133
|
showUserMessageSelector(): void;
|
|
@@ -151,6 +151,7 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
151
151
|
display?: boolean;
|
|
152
152
|
}, options?: ComposerSubmissionOptions): SubmittedUserInput;
|
|
153
153
|
cancelPendingSubmission(): boolean;
|
|
154
|
+
hasPendingSubmission(): boolean;
|
|
154
155
|
markPendingSubmissionStarted(input: SubmittedUserInput): boolean;
|
|
155
156
|
finishPendingSubmission(input: SubmittedUserInput): void;
|
|
156
157
|
updateEditorChrome(): void;
|
|
@@ -265,7 +266,9 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
265
266
|
showAgentsDashboard(): void;
|
|
266
267
|
showModelSelector(options?: {
|
|
267
268
|
temporaryOnly?: boolean;
|
|
269
|
+
smartRoutingOnly?: boolean;
|
|
268
270
|
}): void;
|
|
271
|
+
setAutoroutingEnabled(enabled: boolean): Promise<void>;
|
|
269
272
|
showEffortSelector(): void;
|
|
270
273
|
showProviderOnboarding(): void;
|
|
271
274
|
showPluginSelector(mode?: "install" | "uninstall"): void;
|
|
@@ -213,6 +213,13 @@ export interface InteractiveModeContext {
|
|
|
213
213
|
display?: boolean;
|
|
214
214
|
}, options?: ComposerSubmissionOptions): SubmittedUserInput;
|
|
215
215
|
cancelPendingSubmission(): boolean;
|
|
216
|
+
/**
|
|
217
|
+
* True while a submission is pending: not yet started, or started but still
|
|
218
|
+
* awaiting prompt delivery (`session.prompt()` has not flipped streaming yet).
|
|
219
|
+
* Interrupt handling uses this to keep a started-preflight submission
|
|
220
|
+
* cancellable instead of misclassifying its loader as stale (#4741).
|
|
221
|
+
*/
|
|
222
|
+
hasPendingSubmission(): boolean;
|
|
216
223
|
markPendingSubmissionStarted(input: SubmittedUserInput): boolean;
|
|
217
224
|
finishPendingSubmission(input: SubmittedUserInput): void;
|
|
218
225
|
/**
|
|
@@ -306,7 +313,9 @@ export interface InteractiveModeContext {
|
|
|
306
313
|
showAgentsDashboard(): void;
|
|
307
314
|
showModelSelector(options?: {
|
|
308
315
|
temporaryOnly?: boolean;
|
|
316
|
+
smartRoutingOnly?: boolean;
|
|
309
317
|
}): void;
|
|
318
|
+
setAutoroutingEnabled(enabled: boolean): Promise<void>;
|
|
310
319
|
showEffortSelector(): void;
|
|
311
320
|
showProviderOnboarding(): void;
|
|
312
321
|
showPluginSelector(mode?: "install" | "uninstall"): void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { RlmArtifactPaths } from "./types";
|
|
2
|
-
export declare const RLM_DIR_SEGMENT = "
|
|
2
|
+
export declare const RLM_DIR_SEGMENT = "runs";
|
|
3
3
|
export declare function isValidRlmSessionId(sessionId: string): boolean;
|
|
4
4
|
/** Generate a filesystem-safe, sortable session id (timestamp + random suffix). */
|
|
5
5
|
export declare function generateRlmSessionId(now?: Date): string;
|
|
6
|
-
export declare function resolveRlmArtifactPaths(cwd: string, sessionId: string): RlmArtifactPaths;
|
|
6
|
+
export declare function resolveRlmArtifactPaths(cwd: string, sessionId: string, gjcSessionId?: string): RlmArtifactPaths;
|
|
7
7
|
export declare function ensureRlmSessionDir(paths: RlmArtifactPaths): Promise<void>;
|
|
8
|
-
export declare function rlmSessionExists(cwd: string, sessionId: string): Promise<boolean>;
|
|
9
|
-
export declare function readRlmNotebookIfPresent(cwd: string, sessionId: string): Promise<import("../edit/notebook").NotebookDocument | undefined>;
|
|
8
|
+
export declare function rlmSessionExists(cwd: string, sessionId: string, gjcSessionId?: string): Promise<boolean>;
|
|
9
|
+
export declare function readRlmNotebookIfPresent(cwd: string, sessionId: string, gjcSessionId?: string): Promise<import("../edit/notebook").NotebookDocument | undefined>;
|
|
@@ -13,7 +13,8 @@ export interface OptionalRuntimeServices {
|
|
|
13
13
|
export type OptionalRuntimeServicesOverrides = Partial<OptionalRuntimeServices>;
|
|
14
14
|
/** Context needed by services whose identity is scoped to the session cwd. */
|
|
15
15
|
export interface OptionalRuntimeServicesContext {
|
|
16
|
-
cwd
|
|
16
|
+
/** Session cwd. Pass a getter when the session can rescope (`move_session`). */
|
|
17
|
+
cwd?: string | (() => string);
|
|
17
18
|
}
|
|
18
19
|
/**
|
|
19
20
|
* Fill the optional runtime-service container with the defaults for this
|
|
@@ -12,5 +12,9 @@ export interface WorkspaceTreeRuntime {
|
|
|
12
12
|
* Build the workspace-tree service without importing the native scanner until
|
|
13
13
|
* the service is activated. The scan itself remains the single authority for
|
|
14
14
|
* both eager startup and the lazy first-turn barrier.
|
|
15
|
+
*
|
|
16
|
+
* `cwd` is resolved per scan rather than captured once: a session that rescopes
|
|
17
|
+
* (`move_session`, `/move`) must have its refreshes re-root at the new cwd,
|
|
18
|
+
* otherwise every later tree describes the abandoned launcher root.
|
|
15
19
|
*/
|
|
16
|
-
export declare function createWorkspaceTreeService(settings: Settings, cwd: string): LazyService<WorkspaceTreeRuntime>;
|
|
20
|
+
export declare function createWorkspaceTreeService(settings: Settings, cwd: string | (() => string)): LazyService<WorkspaceTreeRuntime>;
|
|
@@ -24,6 +24,12 @@ export interface LoadMCPConfigsOptions {
|
|
|
24
24
|
nativeOnly?: boolean;
|
|
25
25
|
/** Load only this explicit MCP config file. */
|
|
26
26
|
configPath?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Agent directory that holds the user scope (`<agentDir>/mcp.json`).
|
|
29
|
+
* Default: `getAgentDir()`. Sessions created with their own `agentDir` pass it
|
|
30
|
+
* so discovery and `gjc mcp add --scope user` read and write the same file.
|
|
31
|
+
*/
|
|
32
|
+
agentDir?: string;
|
|
27
33
|
}
|
|
28
34
|
/** Result of loading MCP configs */
|
|
29
35
|
export interface LoadMCPConfigsResult {
|
|
@@ -15,6 +15,16 @@ import type { MCPToolCache } from "./tool-cache";
|
|
|
15
15
|
import type { MCPGetPromptResult, MCPInputRequestHandler, MCPPrompt, MCPRequestOptions, MCPResource, MCPResourceReadResult, MCPResourceTemplate, MCPServerConfig, MCPServerConnection } from "./types";
|
|
16
16
|
export declare function resolveStartupTimeoutMs(configs: MCPServerConfig[], maxStartupTimeoutMs?: number): number;
|
|
17
17
|
export declare function resolveExactConfigStartupTimeoutMs(configs: MCPServerConfig[]): number;
|
|
18
|
+
/**
|
|
19
|
+
* Whether `config` declared a connection window that is still open `elapsedMs`
|
|
20
|
+
* into startup.
|
|
21
|
+
*
|
|
22
|
+
* The startup wait bounds how long session start blocks; a declared `timeout`
|
|
23
|
+
* bounds how long the server itself may take to come up (`connectToServer`
|
|
24
|
+
* enforces it). Those are different budgets: the wait elapsing says nothing
|
|
25
|
+
* about whether the operator's declared window has been spent.
|
|
26
|
+
*/
|
|
27
|
+
export declare function withinDeclaredConnectionWindow(config: MCPServerConfig, elapsedMs: number): boolean;
|
|
18
28
|
export declare class MCPManagerLifecycleError extends Error {
|
|
19
29
|
readonly code: "MCP_MANAGER_LIFECYCLE_CLOSED";
|
|
20
30
|
readonly phase: "disconnect" | "reconnect";
|
|
@@ -40,10 +40,6 @@ export declare function acpMcpLaunchFailure(error: unknown, mcpServers: SessionL
|
|
|
40
40
|
export type AcpReconnectFailedHandler = (error: SdkClientError) => void;
|
|
41
41
|
export type AcpFrameHandler = (frame: Record<string, unknown>) => void;
|
|
42
42
|
export { ACP_SESSION_RECONNECT };
|
|
43
|
-
/**
|
|
44
|
-
* Pure ACP-to-SDK adapter. It deliberately owns neither an AgentSession nor an
|
|
45
|
-
* ACP bridge: all session work is performed through authenticated v3 frames.
|
|
46
|
-
*/
|
|
47
43
|
export declare class AcpSdkAdapter {
|
|
48
44
|
#private;
|
|
49
45
|
constructor(options: AcpSdkAdapterOptions);
|
|
@@ -19,7 +19,7 @@ type ResolvedBrokerSettings = {
|
|
|
19
19
|
heartbeatTtlMs: number;
|
|
20
20
|
resolveDirectoryMigration: (_cwd: string) => Promise<DirectoryMigrationPolicy>;
|
|
21
21
|
};
|
|
22
|
-
export type BrokerErrorCode = "idempotency_conflict" | "terminal_uncertain" | "broker_restarting" | "unavailable" | "endpoint_stale" | "resource_gone" | "invalid_input" | "spawn_failed" | "startup_admission_timeout" | "startup_admission_refused" | "readiness_timeout" | "close_refused" | "not_found" | "live_session" | "cleanup_pending" | (string & {});
|
|
22
|
+
export type BrokerErrorCode = "idempotency_conflict" | "terminal_uncertain" | "broker_restarting" | "unavailable" | "endpoint_stale" | "resource_gone" | "invalid_input" | "spawn_failed" | "ready_then_exited" | "endpoint_unreadable" | "startup_admission_timeout" | "startup_admission_refused" | "readiness_timeout" | "close_refused" | "not_found" | "live_session" | "cleanup_pending" | (string & {});
|
|
23
23
|
export type BrokerCleanupIdentity = {
|
|
24
24
|
dev: string;
|
|
25
25
|
ino: string;
|
|
@@ -26,6 +26,9 @@ type LifecycleCommandResolver = () => LifecycleCommand;
|
|
|
26
26
|
export declare function setLifecycleCleanupHookForTest(broker: Broker, hook: (() => void) | undefined): void;
|
|
27
27
|
export declare function setLifecycleCommandResolverForTest(broker: Broker, resolver: LifecycleCommandResolver | undefined): void;
|
|
28
28
|
export declare function setLifecycleTimingForTest(broker: Broker, timing: LifecycleTiming | undefined): void;
|
|
29
|
+
/** Deterministic platform seam for Windows-only ready-then-exit tolerance. */
|
|
30
|
+
export declare function setLifecycleHostPlatformForTest(platform: NodeJS.Platform | undefined): void;
|
|
31
|
+
export declare function readyThenExitToleranceEnabledForTest(): boolean;
|
|
29
32
|
export declare function hasValidLifecycleDeadlines(value: LifecycleDeadlines, now?: number): boolean;
|
|
30
33
|
type Input = Record<string, unknown>;
|
|
31
34
|
export declare const isCanonicalSessionId: (value: string) => boolean;
|
|
@@ -71,6 +74,14 @@ export interface SessionLifecycleLaunchRequest {
|
|
|
71
74
|
sessionIdentity?: SessionLifecycleTranscriptIdentity;
|
|
72
75
|
/** Broker-issued effect marker which the child echoes only after host readiness. */
|
|
73
76
|
effectMarker?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Explicit `provider/model` pin with `gjc --model` grammar (#4707). The
|
|
79
|
+
* coordinator resolves it before the broker; the session host applies it
|
|
80
|
+
* exactly like a CLI `--model` selection, so it wins over `modelPreset`
|
|
81
|
+
* (mirroring CLI precedence where an explicit `--model` overrides
|
|
82
|
+
* activated profiles).
|
|
83
|
+
*/
|
|
84
|
+
modelId?: string;
|
|
74
85
|
modelPreset?: string;
|
|
75
86
|
mcpServers?: SessionLifecycleMcpServer[];
|
|
76
87
|
worktree?: SessionLifecycleWorktreeTarget;
|
|
@@ -94,6 +105,11 @@ export declare function sdkSessionCommandOverrideForTest(): {
|
|
|
94
105
|
file: string;
|
|
95
106
|
args: string[];
|
|
96
107
|
} | undefined;
|
|
108
|
+
type EffectMarker = {
|
|
109
|
+
pid: number;
|
|
110
|
+
effectMarker: string;
|
|
111
|
+
incarnation: string;
|
|
112
|
+
};
|
|
97
113
|
type BrokerIndex = Pick<Broker, "index">;
|
|
98
114
|
export declare function setProcessIncarnationForTest(broker: Broker, value: ((pid: number) => string | undefined) | undefined): void;
|
|
99
115
|
type ProcessObservation = "alive" | "exited" | "uncertain";
|
|
@@ -105,13 +121,52 @@ export interface LifecycleTranscriptEvidence {
|
|
|
105
121
|
digest: string;
|
|
106
122
|
identity: SessionLifecycleTranscriptIdentity;
|
|
107
123
|
}
|
|
108
|
-
/** The child
|
|
109
|
-
export declare function writeSessionLifecycleFailure(root: string, id: string, effectMarker: string, failure: SdkStartupFailure, rollback: SdkStartupRollbackResult, transcript?: LifecycleTranscriptEvidence, ownerIncarnation?: string): Promise<void>;
|
|
124
|
+
/** Writes bounded startup diagnostics. The child stamps its own pid; the broker may stamp a proven child identity. */
|
|
125
|
+
export declare function writeSessionLifecycleFailure(root: string, id: string, effectMarker: string, failure: SdkStartupFailure, rollback: SdkStartupRollbackResult, transcript?: LifecycleTranscriptEvidence, ownerIncarnation?: string, ownerPid?: number): Promise<void>;
|
|
110
126
|
export declare function readSessionLifecycleFailureForTest(root: string, id: string, expected: {
|
|
111
127
|
pid: number;
|
|
112
128
|
effectMarker: string;
|
|
113
129
|
incarnation: string;
|
|
114
130
|
}): Promise<SdkStartupFailure | undefined>;
|
|
131
|
+
/**
|
|
132
|
+
* Typed ready-then-exit probe for a dead child (#4712 review: the earlier
|
|
133
|
+
* boolean collapsed EACCES/EIO/malformed JSON into "absent", routing the
|
|
134
|
+
* teardown decision through the secondary authority and finally surfacing as
|
|
135
|
+
* a false `spawn_failed` claim that the child "exited before registering
|
|
136
|
+
* readiness" when the real failure was reading the endpoint).
|
|
137
|
+
*
|
|
138
|
+
* A host that died hard leaves its endpoint file on disk; a host that tore
|
|
139
|
+
* down gracefully removed it first. `matched` requires the owned marker +
|
|
140
|
+
* ready marker chain to still name exactly this child and the endpoint file
|
|
141
|
+
* to still name the same pid and session. `absent_indexed` means the endpoint
|
|
142
|
+
* file is gone (ENOENT only) and the broker's own session index recorded a
|
|
143
|
+
* host registration for exactly this incarnation — the sole permitted
|
|
144
|
+
* fallback authority. `malformed` and `io_error` are their own fail-closed
|
|
145
|
+
* outcomes: they feed no teardown decision and assert nothing about the
|
|
146
|
+
* child process.
|
|
147
|
+
*/
|
|
148
|
+
type ReadyAuthorityProbe = {
|
|
149
|
+
kind: "matched";
|
|
150
|
+
} | {
|
|
151
|
+
kind: "absent_indexed";
|
|
152
|
+
} | {
|
|
153
|
+
kind: "absent_unindexed";
|
|
154
|
+
} | {
|
|
155
|
+
kind: "not_published";
|
|
156
|
+
} | {
|
|
157
|
+
kind: "malformed";
|
|
158
|
+
} | {
|
|
159
|
+
kind: "io_error";
|
|
160
|
+
code: string;
|
|
161
|
+
};
|
|
162
|
+
/** Test seam for the typed ready-authority probe boundary (#4712 review). */
|
|
163
|
+
export declare function probePublishedReadyAuthorityForTest(root: string, id: string, expected: EffectMarker): Promise<ReadyAuthorityProbe>;
|
|
164
|
+
/**
|
|
165
|
+
* Test seam for the PID-reuse deletion boundary: a successor launch rewriting
|
|
166
|
+
* the lifecycle marker must stop the unlink of an endpoint that only matches
|
|
167
|
+
* by a reused pid (#4712 review).
|
|
168
|
+
*/
|
|
169
|
+
export declare function removeOwnedLifecycleArtifactsForTest(root: string, id: string, expected: EffectMarker): Promise<boolean>;
|
|
115
170
|
export declare function canonicalDeleteLocatorPath(pathname: string): string;
|
|
116
171
|
export interface LifecycleExecutionOutcome {
|
|
117
172
|
response: BrokerResponse;
|
|
@@ -116,6 +116,21 @@ export declare class SessionIndex {
|
|
|
116
116
|
constructor(agentDir: string, policy?: RetentionPolicy);
|
|
117
117
|
open(): Promise<this>;
|
|
118
118
|
replay(): Promise<void>;
|
|
119
|
+
/**
|
|
120
|
+
* Polling-path refresh (#4689): when both index files carry the exact change
|
|
121
|
+
* stamp of the last completed locked pass, the in-memory projection is
|
|
122
|
+
* already current and the locked rescan is skipped entirely — this is what
|
|
123
|
+
* keeps an idle SessionRouter reconcile (2s cadence) from re-parsing and
|
|
124
|
+
* re-checksumming the whole index forever. An append committed before the
|
|
125
|
+
* stat always changes the stamp, so a miss is impossible; a change landing
|
|
126
|
+
* after the stat is seen on the next poll, the same TOCTOU envelope a
|
|
127
|
+
* locked read has. A corrupt suffix never takes the fast path: re-scanning
|
|
128
|
+
* preserves the existing re-diagnosis behavior. Returns true when state was
|
|
129
|
+
* reloaded. Authority revalidation that needs the strongest available
|
|
130
|
+
* snapshot inside an already-locked write (append, unregister) keeps using
|
|
131
|
+
* the exact locked paths.
|
|
132
|
+
*/
|
|
133
|
+
refreshIfChanged(): Promise<boolean>;
|
|
119
134
|
diagnose(): Promise<SessionIndexDiagnosis>;
|
|
120
135
|
repair(): Promise<SessionIndexRepairResult>;
|
|
121
136
|
refresh(): Promise<void>;
|
|
@@ -96,6 +96,12 @@ export type ChatDaemonAction = "stop" | "reload";
|
|
|
96
96
|
* Discord generation 65 / Slack generation 68 fence the off-reconcile-tail
|
|
97
97
|
* initial attachment replay introduced by #4542 so pre-upgrade daemon owners
|
|
98
98
|
* cannot retain the earlier SessionRouter attachment contract.
|
|
99
|
+
* The Discord 67 / Slack 70 fence covers the SessionRouter idle-poll/change-stamp
|
|
100
|
+
* rollout (#4689). Both daemons construct a
|
|
101
|
+
* SessionRouter whose idle tick no longer re-acquires the machine-global
|
|
102
|
+
* session-index lock every 2s; staleness retirement moved to a 30s sweep and
|
|
103
|
+
* lease heartbeats no longer force an authority reconcile. A pre-upgrade owner
|
|
104
|
+
* would retain the old hot polling loop, so replacement is required.
|
|
99
105
|
*/
|
|
100
106
|
export declare const CHAT_DAEMON_GENERATIONS: Readonly<Record<ChatDaemonKind, number>>;
|
|
101
107
|
export declare function chatDaemonGeneration(kind: ChatDaemonKind): number;
|
|
@@ -51,6 +51,10 @@ export declare class ChatDaemonRuntime {
|
|
|
51
51
|
}, deps?: ChatDaemonRuntimeDeps);
|
|
52
52
|
start(): Promise<void>;
|
|
53
53
|
transportHealthy(): boolean;
|
|
54
|
+
/** Reconcile indexed attachments and optionally wait for their replay tails. */
|
|
55
|
+
reconcile(options?: {
|
|
56
|
+
waitForReplay?: boolean;
|
|
57
|
+
}): Promise<void>;
|
|
54
58
|
stop(): Promise<void>;
|
|
55
59
|
/** Adopt an operator-supplied Slack root through the provider's presentation store. */
|
|
56
60
|
bindExistingRoot(request: ChatDaemonCommandBindInput): Promise<ChatDaemonCommandOutcome>;
|
|
@@ -311,6 +311,14 @@ interface SessionRuntime {
|
|
|
311
311
|
/** Aborts and fences side turns while notification delivery is disabled. */
|
|
312
312
|
disableEphemeralTurns: () => void;
|
|
313
313
|
waitForGateResolutionQuiescence: () => Promise<void>;
|
|
314
|
+
/** Awaits durable quiescence of every reconciliation transaction this runtime
|
|
315
|
+
* admitted, joining their producers first. Never swallows evidence: producer
|
|
316
|
+
* and store rejections are returned in `failures`, and a bounded-deadline
|
|
317
|
+
* expiry is returned as `timedOut` (#4743). */
|
|
318
|
+
drainDurableReconciliation: () => Promise<{
|
|
319
|
+
timedOut: boolean;
|
|
320
|
+
failures: unknown[];
|
|
321
|
+
}>;
|
|
314
322
|
trackGateResolution: <T>(resolution: Promise<T>) => Promise<T>;
|
|
315
323
|
workflowGate?: WorkflowGateEmitter;
|
|
316
324
|
gatePresentations?: PresentationArbiter;
|