@gajae-code/coding-agent 0.4.4 → 0.5.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 +83 -0
- package/dist/types/cli/fast-help.d.ts +1 -0
- package/dist/types/cli/setup-cli.d.ts +2 -0
- package/dist/types/commands/harness.d.ts +6 -0
- package/dist/types/commands/setup.d.ts +6 -0
- package/dist/types/config/model-profile-activation.d.ts +11 -2
- package/dist/types/config/model-profiles.d.ts +7 -0
- package/dist/types/config/model-registry.d.ts +6 -0
- package/dist/types/config/model-resolver.d.ts +2 -0
- package/dist/types/config/models-config-schema.d.ts +35 -0
- package/dist/types/config/settings-schema.d.ts +4 -3
- package/dist/types/coordinator/contract.d.ts +1 -1
- package/dist/types/coordinator-mcp/server.d.ts +8 -2
- package/dist/types/gjc-runtime/team-runtime.d.ts +0 -1
- package/dist/types/gjc-runtime/tmux-common.d.ts +3 -0
- package/dist/types/harness-control-plane/finalize.d.ts +5 -0
- package/dist/types/harness-control-plane/owner.d.ts +1 -1
- package/dist/types/harness-control-plane/phase-rollup.d.ts +23 -0
- package/dist/types/harness-control-plane/receipt-ingest.d.ts +19 -0
- package/dist/types/harness-control-plane/receipt-spool.d.ts +19 -0
- package/dist/types/harness-control-plane/receipts.d.ts +46 -0
- package/dist/types/harness-control-plane/rpc-adapter.d.ts +3 -0
- package/dist/types/harness-control-plane/state-machine.d.ts +6 -1
- package/dist/types/harness-control-plane/types.d.ts +13 -1
- package/dist/types/hindsight/mental-models.d.ts +5 -5
- package/dist/types/main.d.ts +2 -2
- package/dist/types/modes/components/model-selector.d.ts +1 -12
- package/dist/types/modes/rpc/rpc-client.d.ts +2 -2
- package/dist/types/modes/rpc/rpc-types.d.ts +4 -1
- package/dist/types/modes/utils/abort-message.d.ts +4 -0
- package/dist/types/sdk.d.ts +5 -0
- package/dist/types/session/agent-session.d.ts +2 -0
- package/dist/types/session/blob-store.d.ts +20 -1
- package/dist/types/session/session-manager.d.ts +32 -6
- package/dist/types/session/streaming-output.d.ts +3 -2
- package/dist/types/session/tool-choice-queue.d.ts +6 -0
- package/dist/types/setup/hermes-setup.d.ts +7 -0
- package/dist/types/task/fork-context-advisory.d.ts +13 -0
- package/dist/types/task/receipt.d.ts +2 -0
- package/dist/types/task/roi-reconciliation.d.ts +27 -0
- package/dist/types/task/types.d.ts +17 -0
- package/dist/types/thinking-metadata.d.ts +16 -0
- package/dist/types/thinking.d.ts +3 -12
- package/dist/types/tools/index.d.ts +2 -0
- package/dist/types/tools/resolve.d.ts +0 -10
- package/dist/types/utils/tool-choice.d.ts +14 -1
- package/package.json +8 -7
- package/scripts/build-binary.ts +4 -0
- package/src/cli/fast-help.ts +80 -0
- package/src/cli/setup-cli.ts +12 -3
- package/src/cli.ts +112 -17
- package/src/commands/coordinator.ts +44 -1
- package/src/commands/harness.ts +128 -11
- package/src/commands/launch.ts +2 -2
- package/src/commands/mcp-serve.ts +3 -2
- package/src/commands/session.ts +3 -1
- package/src/commands/setup.ts +4 -0
- package/src/config/model-profile-activation.ts +15 -3
- package/src/config/model-profiles.ts +255 -56
- package/src/config/model-resolver.ts +9 -6
- package/src/config/models-config-schema.ts +2 -0
- package/src/config/settings-schema.ts +6 -3
- package/src/coordinator/contract.ts +1 -0
- package/src/coordinator-mcp/server.ts +427 -193
- package/src/cursor.ts +46 -4
- package/src/defaults/gjc/skills/team/SKILL.md +3 -2
- package/src/defaults/gjc/skills/ultragoal/SKILL.md +8 -2
- package/src/export/html/index.ts +13 -9
- package/src/gjc-runtime/launch-worktree.ts +12 -1
- package/src/gjc-runtime/session-state-sidecar.ts +38 -0
- package/src/gjc-runtime/team-runtime.ts +33 -7
- package/src/gjc-runtime/tmux-common.ts +15 -0
- package/src/gjc-runtime/tmux-sessions.ts +19 -11
- package/src/gjc-runtime/ultragoal-runtime.ts +505 -41
- package/src/gjc-runtime/workflow-manifest.generated.json +27 -1
- package/src/gjc-runtime/workflow-manifest.ts +16 -1
- package/src/harness-control-plane/finalize.ts +39 -5
- package/src/harness-control-plane/owner.ts +87 -28
- package/src/harness-control-plane/phase-rollup.ts +96 -0
- package/src/harness-control-plane/receipt-ingest.ts +127 -0
- package/src/harness-control-plane/receipt-spool.ts +128 -0
- package/src/harness-control-plane/receipts.ts +229 -1
- package/src/harness-control-plane/rpc-adapter.ts +8 -0
- package/src/harness-control-plane/state-machine.ts +27 -6
- package/src/harness-control-plane/storage.ts +23 -0
- package/src/harness-control-plane/types.ts +33 -1
- package/src/hindsight/mental-models.ts +17 -16
- package/src/internal-urls/docs-index.generated.ts +8 -7
- package/src/main.ts +7 -3
- package/src/modes/components/assistant-message.ts +26 -14
- package/src/modes/components/diff.ts +97 -0
- package/src/modes/components/model-selector.ts +353 -181
- package/src/modes/components/status-line.ts +6 -6
- package/src/modes/components/tool-execution.ts +30 -13
- package/src/modes/controllers/event-controller.ts +5 -4
- package/src/modes/controllers/selector-controller.ts +33 -42
- package/src/modes/interactive-mode.ts +4 -5
- package/src/modes/print-mode.ts +1 -1
- package/src/modes/rpc/rpc-client.ts +3 -2
- package/src/modes/rpc/rpc-mode.ts +44 -14
- package/src/modes/rpc/rpc-types.ts +5 -2
- package/src/modes/shared/agent-wire/command-dispatch.ts +10 -5
- package/src/modes/shared/agent-wire/command-validation.ts +11 -0
- package/src/modes/theme/theme.ts +2 -2
- package/src/modes/utils/abort-message.ts +41 -0
- package/src/modes/utils/context-usage.ts +15 -8
- package/src/modes/utils/ui-helpers.ts +5 -6
- package/src/sdk.ts +38 -6
- package/src/secrets/obfuscator.ts +102 -27
- package/src/session/agent-session.ts +121 -25
- package/src/session/blob-store.ts +89 -3
- package/src/session/session-manager.ts +328 -57
- package/src/session/streaming-output.ts +185 -122
- package/src/session/tool-choice-queue.ts +23 -0
- package/src/setup/hermes/templates/operator-instructions.v1.md +3 -2
- package/src/setup/hermes-setup.ts +63 -8
- package/src/task/executor.ts +69 -6
- package/src/task/fork-context-advisory.ts +99 -0
- package/src/task/index.ts +31 -2
- package/src/task/receipt.ts +7 -0
- package/src/task/render.ts +21 -1
- package/src/task/roi-reconciliation.ts +90 -0
- package/src/task/types.ts +15 -0
- package/src/thinking-metadata.ts +51 -0
- package/src/thinking.ts +26 -46
- package/src/tools/bash.ts +1 -1
- package/src/tools/index.ts +4 -2
- package/src/tools/resolve.ts +93 -18
- package/src/tools/subagent-render.ts +10 -1
- package/src/utils/edit-mode.ts +1 -1
- package/src/utils/title-generator.ts +16 -2
- package/src/utils/tool-choice.ts +45 -16
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,89 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.5.0] - 2026-06-13
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Fixed forced `tool_choice` 400s ("tool_choice forces tool use is not compatible with this model") looping after `ast_edit` previews: named queue directives (resolve protocol, eager `todo_write` enforcement, subagent `yield` reminders) now enqueue only when the model supports exact named forcing; otherwise they degrade silently to the existing steer reminder without a forced `tool_choice`, and a runtime-discovered incapability drops the in-flight directive instead of requeueing it.
|
|
10
|
+
- `models.yml` compat blocks now accept the `toolChoiceSupport` enum (`none`/`auto`/`required`/`named`) alongside the legacy `supportsToolChoice`/`supportsForcedToolChoice` booleans, mirrored in the generated JSON schema.
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Made `/model` open to a preset-first landing view: provider-grouped presets with live auth checkmarks, highlight-to-expand tiers, a full clamped role→model preview before applying, and a session/default apply scope choice; typing still jumps straight to model search, "Browse all models" opens the classic tabbed selector, and temporary-only quick-switch bypasses the landing entirely.
|
|
14
|
+
- Rebuilt the builtin model profile catalog as 25 profiles: `codex-{eco,medium,pro}` on `gpt-5.5` effort spreads, a single `opencodego` preset, `claude-opus`, `{glm,kimi-coding-plan,mimo,grok,cursor,minimax}-{eco,medium,pro}` trios with thinking levels clamped to provider support, and `opus-codex`/`codex-opencodego` combos. Legacy profile names (including the `*-standard` family and retired Fable presets) were removed clean-break and now fail with the available-profile listing.
|
|
15
|
+
- Added a post-`/login` smart preset recommendation: when login succeeds and no profile is active, prompts "Apply <preset> now?" (session-only on confirm); when a profile is active, prints a one-line hint instead. The active profile is tracked in-memory on the session with rollback-safe activation.
|
|
16
|
+
- Bundled `kimi-code/kimi-k2.7-code` and `minimax-code/minimax-v3` model entries; MiniMax presets use the canonical `minimax-code` provider id throughout.
|
|
17
|
+
- Added a harness receipt JSONL spool exporter for gajae receipt-runtime interop: configured `gjc harness --receipt-spool-dir <dir>` / `GJC_RECEIPT_SPOOL_DIR` now appends persisted native `ReceiptEnvelope` records as `{cursor,envelope}` lines to `spool.jsonl`, with restart-safe 12-digit cursors and installed-package smoke coverage (#545).
|
|
18
|
+
- Added Gajae Trinity compatibility golden fixtures and tests that pin ReceiptEnvelope hash basis, validator compatibility, and replayable RPC exchange shape for downstream receipt-runtime interop.
|
|
19
|
+
- Optimization Suite v3 Lane 1 (RSS): large resident text in persisted sessions is now backed by an ephemeral session-scoped disk cache (`EphemeralBlobStore`) instead of being pinned in JS heap for the whole session lifetime; canonical JSONL persistence, reload, and export semantics are byte-identical (resident refs never persist). Missing resident text cache blobs now surface a typed `ResidentBlobMissingError` instead of silently leaking `blob:sha256:` refs into provider payloads, UI, or exports. `getEntries()`/`buildSessionContext()` are served from revision-keyed WeakRef caches below the public ownership boundary (callers still receive caller-owned copies). Fixture retained heap −82%, RSS −55%, warm `getEntries()` p95 −80% on 10k-entry sessions; one-shot `exportFromFile()` now closes its session manager.
|
|
20
|
+
- Added process-isolated deterministic TUI render-golden capture and fixtures for interactive editor overlays, rich-text resizing, multiplexer viewport repaint, sixel image line preservation, Termux height diffs, and transcript shrink/clear regressions.
|
|
21
|
+
|
|
22
|
+
### Removed
|
|
23
|
+
|
|
24
|
+
- Removed the hardcoded OpenAI Codex role-preset action from the model selector; builtin model profiles are now the only preset concept.
|
|
25
|
+
- Removed retired Fable model profiles (`claude-fable`, `fable-codex`) after `claude-fable-5` was removed upstream.
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- Optimization Suite v3 Lane 3 (serialization): session-switch message comparison now uses per-message cached source strings + xxHash64 as an accelerator (source-string compare remains the authority; collision fallback tested) — unchanged-session compares −95% median. The secret obfuscator precomputes a longest-first combined regex (single-pass replace, −70% median/−77% p95 on 100 secrets × 1MiB) with a conservative sequential fallback whenever secrets overlap each other or any replacement/placeholder contains a secret — output bytes are identical in all cases. Intra-line diff rendering gains byte-identical fast paths for identical lines and whitespace-token-aligned prefix/suffix spans (identical −67%, single-token −60%; long lines skip the scan). Mental-model LCS keeps legacy dense-DP tie-break semantics (a Hunt-Szymanski variant was rejected for changing rendered bytes). Provider-visible fork-context seeds use JSON-semantic cloning instead of structuredClone.
|
|
30
|
+
- Tightened tool-block rendering to remove vertical padding and rely on Spacer-only separation, reducing transcript noise while preserving stable render-golden output.
|
|
31
|
+
- Improved the Bun runtime version guard diagnostic: when the Bun running `gjc` is older than the required version, the error now names the exact detected Bun runtime path and prints a platform-specific upgrade and PATH fix (Windows gets the `irm bun.sh/install.ps1|iex` reinstall plus a `%USERPROFILE%\.bun\bin` PATH hint) instead of a bare `bun upgrade` (#525).
|
|
32
|
+
- Aligned the `codex-standard` and `codex-pro` model profiles on the `openai-codex/gpt-5.5` baseline so they no longer default to stale mixed model generations (`gpt-5.4`, `gpt-5.2-codex`, `gpt-5.1-codex-max`, `gpt-5.3-codex-spark`); the profiles now differentiate purely by per-role reasoning effort (#532).
|
|
33
|
+
- Reduced the default RPC `get_state` payload by omitting static `dumpTools` and `systemPrompt` fields unless requested via `include: ["tools", "systemPrompt"]` (#539).
|
|
34
|
+
- Updated `/model` documentation and generated docs index for the rebuilt preset catalog and preset-first selector.
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
38
|
+
- Tightened the Windows/psmux tmux provider boundary: `gjc team` now honors `GJC_TMUX_COMMAND` (not just `GJC_TEAM_TMUX_COMMAND`) so the team leader resolves the same multiplexer as `gjc session`/`gjc --tmux`; and when a multiplexer lists a session that lacks GJC's `@gjc-profile` ownership tag, `gjc session status` now returns `gjc_tmux_session_untagged` with a `detail` hint and `gjc team` reports the same cause, instead of a bare `gjc_tmux_session_not_found` / `unmanaged_tmux_session`. Documented that alternative multiplexers such as psmux on Windows are not fully supported because they do not round-trip tmux user options (#531).
|
|
39
|
+
- Hardened RPC stdio lifecycle behavior: `gjc --mode rpc` now reports malformed JSONL frames as parse-error responses without killing the session, flushes durable session state before exiting on EOF/shutdown, and has red-team coverage for attached persistence, reload, malformed-frame recovery, and concurrent child-session isolation.
|
|
40
|
+
- Hardened the harness RPC submit/router contract so `submit` is no longer advertised or accepted during finalizing/non-idle lifecycle windows, non-idle RPC state reports `submitted:false` with a retryable gate, and degraded owner endpoints fall back to `owner-not-live` without false acceptance (#544).
|
|
41
|
+
- Ran estimated context maintenance before sending a new prompt, including tool-output pruning and threshold compaction, so large tool results appended after the last assistant turn cannot push the next model request over the context window.
|
|
42
|
+
- `gjc team` now self-heals a missing `@gjc-profile` ownership tag when the current leader pane was genuinely launched by `gjc --tmux` (detected via `GJC_TMUX_LAUNCHED=1`): the session is re-tagged with `set-option` and startup proceeds, instead of hard-failing with `unmanaged_tmux_session` after a mid-startup attach failure or registry race stripped the tag. Sessions without the GJC launch marker are still rejected unchanged, so foreign tmux sessions cannot be hijacked.
|
|
43
|
+
- Subagent task receipts and live render output now warn when requested role-agent models are substituted by auth fallback or provider-reported assistant model mismatch, including session model-change annotations for server-side substitutions (#559).
|
|
44
|
+
- Converted Cursor wire shell timeouts from millisecond values to bash-tool seconds so delegated Cursor-native shell calls honor the expected timeout units.
|
|
45
|
+
- Fixed pi-shell bash fixups on multibyte UTF-8 commands by converting parser source indexes to byte offsets before stripping `head`/`tail` pipelines.
|
|
46
|
+
|
|
47
|
+
## [0.4.5] - 2026-06-12
|
|
48
|
+
|
|
49
|
+
### Added
|
|
50
|
+
|
|
51
|
+
- Added a dim `(ctrl+s to observe sessions)` discoverability hint under the `subagent` await panel header while any awaited subagent is still running, pointing to the full session observer overlay; the hint shows in both collapsed and expanded states and disappears once no subagent is running.
|
|
52
|
+
- Added a `phase-rollup` receipt family (receipt-of-receipts) to the harness control plane: a hash-sealed rollup that supersedes N child task receipts at a lifecycle boundary, preserving per-child `{id, status, outputUri, outputSha256, receiptSha256, tokens, costTotal, clonedTokens, lowRoi}` pointers plus aggregate ROI totals, with a pure deterministic builder (`buildPhaseRollupReceipt`) and fail-closed semantic validation.
|
|
53
|
+
- Added a pure receipt-ingestion fast path (`ingestReceipts`): fail-closed batch validation + lifecycle transition computation via the existing state machine, plus a deterministic model-facing digest hard-capped at 280 chars — groundwork for LLM-free receipt routing.
|
|
54
|
+
- Added advisory spawn-ROI reconciliation (`reconcileSpawnRoi`) and deterministic fork-context mode advice (`adviseForkContextMode`) surfaced in task receipts without changing task success semantics.
|
|
55
|
+
- Added the Grok Build provider contract design document.
|
|
56
|
+
|
|
57
|
+
### Changed
|
|
58
|
+
|
|
59
|
+
- Reduced compiled CLI startup and native bundle pressure with default-small grammar loading, tokenizer tiering, and compiled fast-help paths.
|
|
60
|
+
- Preserved dev/main release metadata and changelog consistency for the 0.4.5 lockstep release.
|
|
61
|
+
|
|
62
|
+
- Added native `gjc ultragoal steer --kind` support for documented steering mutations beyond `add_subgoal`, including split, reorder, wording revision, ledger annotation, and blocked-goal supersession contracts with structured audit expectations.
|
|
63
|
+
### Fixed
|
|
64
|
+
|
|
65
|
+
- Kept the unified `goal` tool registered and active by default whenever `goal.enabled` is true, including explicit tool subsets and `gjc ultragoal create-goals` arming flows.
|
|
66
|
+
- Restored no-argument `gjc` interactive startup instead of launching help.
|
|
67
|
+
- Rendered and executed Cursor-native tool calls, including detached/native handler paths and empty-pattern composer grep guards.
|
|
68
|
+
- Tool-output pruning no longer rewrites already-sent provider-facing history mid prompt-cache epoch and now persists pruned message updates back into canonical session storage.
|
|
69
|
+
- Preserved provider abort root causes in the final TUI abort label, kept replay rendering idempotent, and added a `PI_STREAM_IDLE_TIMEOUT_MS` remediation hint when stream idle watchdogs fire.
|
|
70
|
+
- Hardened harness owner recovery/finalize paths and submit-prompt-file handling.
|
|
71
|
+
|
|
72
|
+
## [0.4.4] - 2026-06-10
|
|
73
|
+
|
|
74
|
+
### Added
|
|
75
|
+
|
|
76
|
+
- Made coordinator turns event-backed, adding an MCP coordinator server and the `gjc coordinator` / `gjc mcp-serve` commands backed by durable turn/session state (#479).
|
|
77
|
+
- Surfaced awaited sub-agent live streaming status in the await panel (#475).
|
|
78
|
+
|
|
79
|
+
### Changed
|
|
80
|
+
|
|
81
|
+
- Refreshed the README brand images (#477).
|
|
82
|
+
|
|
83
|
+
### Fixed
|
|
84
|
+
|
|
85
|
+
- Persisted ralplan role-agent artifacts via the CLI, returning receipt-only output to the caller (#474).
|
|
86
|
+
- Collected the `ask` tool "Other" custom input inline below the option list (#476).
|
|
87
|
+
|
|
5
88
|
## [0.4.3] - 2026-06-10
|
|
6
89
|
|
|
7
90
|
### Added
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getExtraHelpText(): string;
|
|
@@ -14,6 +14,9 @@ export default class Harness extends Command {
|
|
|
14
14
|
description: string;
|
|
15
15
|
default: string;
|
|
16
16
|
};
|
|
17
|
+
"prompt-file": import("@gajae-code/utils/cli").FlagDescriptor<"string"> & {
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
17
20
|
session: import("@gajae-code/utils/cli").FlagDescriptor<"string"> & {
|
|
18
21
|
char: string;
|
|
19
22
|
description: string;
|
|
@@ -31,6 +34,9 @@ export default class Harness extends Command {
|
|
|
31
34
|
description: string;
|
|
32
35
|
default: boolean;
|
|
33
36
|
};
|
|
37
|
+
"receipt-spool-dir": import("@gajae-code/utils/cli").FlagDescriptor<"string"> & {
|
|
38
|
+
description: string;
|
|
39
|
+
};
|
|
34
40
|
};
|
|
35
41
|
static examples: string[];
|
|
36
42
|
run(): Promise<void>;
|
|
@@ -43,6 +43,12 @@ export default class Setup extends Command {
|
|
|
43
43
|
"session-command": import("@gajae-code/utils/cli").FlagDescriptor<"string"> & {
|
|
44
44
|
description: string;
|
|
45
45
|
};
|
|
46
|
+
"no-worktree": import("@gajae-code/utils/cli").FlagDescriptor<"boolean"> & {
|
|
47
|
+
description: string;
|
|
48
|
+
};
|
|
49
|
+
"worktree-name": import("@gajae-code/utils/cli").FlagDescriptor<"string"> & {
|
|
50
|
+
description: string;
|
|
51
|
+
};
|
|
46
52
|
"state-root": import("@gajae-code/utils/cli").FlagDescriptor<"string"> & {
|
|
47
53
|
description: string;
|
|
48
54
|
};
|
|
@@ -3,15 +3,22 @@ import type { Api, Model } from "@gajae-code/ai";
|
|
|
3
3
|
import type { AgentSession } from "../session/agent-session";
|
|
4
4
|
import { type ModelRegistry } from "./model-registry";
|
|
5
5
|
import type { Settings } from "./settings";
|
|
6
|
+
type ModelProfileActivationSession = Pick<AgentSession, "model" | "thinkingLevel" | "sessionId"> & {
|
|
7
|
+
setModelTemporary?: AgentSession["setModelTemporary"];
|
|
8
|
+
setActiveModelProfile?: (name: string | undefined) => void;
|
|
9
|
+
getActiveModelProfile?: () => string | undefined;
|
|
10
|
+
};
|
|
6
11
|
export interface PrepareModelProfileActivationOptions {
|
|
7
|
-
session:
|
|
12
|
+
session: ModelProfileActivationSession;
|
|
8
13
|
modelRegistry: Pick<ModelRegistry, "getModelProfile" | "getModelProfiles" | "getAvailableModelProfileNames" | "getApiKeyForProvider" | "getAll" | "resolveCanonicalModel" | "getCanonicalVariants" | "getCanonicalId">;
|
|
9
14
|
settings: Pick<Settings, "get">;
|
|
10
15
|
profileName: string;
|
|
11
16
|
}
|
|
12
17
|
export interface PreparedModelProfileActivation {
|
|
13
18
|
profileName: string;
|
|
14
|
-
session:
|
|
19
|
+
session: ModelProfileActivationSession & {
|
|
20
|
+
setModelTemporary: AgentSession["setModelTemporary"];
|
|
21
|
+
};
|
|
15
22
|
settings: Pick<Settings, "get" | "override" | "set" | "flush">;
|
|
16
23
|
previousModel: Model<Api> | undefined;
|
|
17
24
|
previousThinkingLevel: ThinkingLevel | undefined;
|
|
@@ -19,6 +26,7 @@ export interface PreparedModelProfileActivation {
|
|
|
19
26
|
defaultModel: Model<Api> | undefined;
|
|
20
27
|
defaultThinkingLevel: ThinkingLevel | undefined;
|
|
21
28
|
agentModelOverrides: Record<string, string>;
|
|
29
|
+
previousActiveModelProfile: string | undefined;
|
|
22
30
|
}
|
|
23
31
|
export declare function formatModelProfileCredentialError(profileName: string, providers: readonly string[]): string;
|
|
24
32
|
export declare function prepareModelProfileActivation(options: PrepareModelProfileActivationOptions): Promise<PreparedModelProfileActivation>;
|
|
@@ -28,3 +36,4 @@ export declare function applyPreparedModelProfileActivation(prepared: PreparedMo
|
|
|
28
36
|
export declare function activateModelProfile(options: PrepareModelProfileActivationOptions, applyOptions?: {
|
|
29
37
|
persistDefault?: boolean;
|
|
30
38
|
}): Promise<void>;
|
|
39
|
+
export {};
|
|
@@ -14,6 +14,13 @@ export interface ResolvedProfileBinding {
|
|
|
14
14
|
export declare function deriveModelProfileMappedProviders(definition: Pick<ModelProfileDefinition, "modelMapping">): string[];
|
|
15
15
|
export declare function aggregateModelProfileRequiredProviders(requiredProviders: readonly string[], definition: Pick<ModelProfileDefinition, "modelMapping">): string[];
|
|
16
16
|
export declare const BUILTIN_MODEL_PROFILES: readonly ModelProfileDefinition[];
|
|
17
|
+
export interface ModelProfilePresentation {
|
|
18
|
+
displayName: string;
|
|
19
|
+
providerGroup: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function getModelProfilePresentation(name: string): ModelProfilePresentation;
|
|
22
|
+
export declare function groupModelProfilesForPresetLanding(profiles: ReadonlyMap<string, ModelProfileDefinition>): Map<string, ModelProfileDefinition[]>;
|
|
23
|
+
export declare function recommendModelProfileForProvider(providerId: string, profiles: ReadonlyMap<string, ModelProfileDefinition>): ModelProfileDefinition | undefined;
|
|
17
24
|
export declare function mergeModelProfiles(userProfiles?: ModelsConfig["profiles"]): Map<string, ModelProfileDefinition>;
|
|
18
25
|
export declare function resolveProfileBindings(definition: ModelProfileDefinition): ResolvedProfileBinding;
|
|
19
26
|
export declare function formatAvailableProfileNames(profiles: ReadonlyMap<string, ModelProfileDefinition>): string;
|
|
@@ -70,6 +70,8 @@ export declare const ModelsConfigFile: ConfigFile<{
|
|
|
70
70
|
allowsSyntheticReasoningContentForToolCalls?: boolean | undefined;
|
|
71
71
|
requiresAssistantContentForToolCalls?: boolean | undefined;
|
|
72
72
|
supportsToolChoice?: boolean | undefined;
|
|
73
|
+
supportsForcedToolChoice?: boolean | undefined;
|
|
74
|
+
toolChoiceSupport?: "auto" | "named" | "none" | "required" | undefined;
|
|
73
75
|
disableReasoningOnForcedToolChoice?: boolean | undefined;
|
|
74
76
|
disableReasoningOnToolChoice?: boolean | undefined;
|
|
75
77
|
thinkingFormat?: "openai" | "openrouter" | "qwen" | "qwen-chat-template" | "zai" | undefined;
|
|
@@ -145,6 +147,8 @@ export declare const ModelsConfigFile: ConfigFile<{
|
|
|
145
147
|
allowsSyntheticReasoningContentForToolCalls?: boolean | undefined;
|
|
146
148
|
requiresAssistantContentForToolCalls?: boolean | undefined;
|
|
147
149
|
supportsToolChoice?: boolean | undefined;
|
|
150
|
+
supportsForcedToolChoice?: boolean | undefined;
|
|
151
|
+
toolChoiceSupport?: "auto" | "named" | "none" | "required" | undefined;
|
|
148
152
|
disableReasoningOnForcedToolChoice?: boolean | undefined;
|
|
149
153
|
disableReasoningOnToolChoice?: boolean | undefined;
|
|
150
154
|
thinkingFormat?: "openai" | "openrouter" | "qwen" | "qwen-chat-template" | "zai" | undefined;
|
|
@@ -216,6 +220,8 @@ export declare const ModelsConfigFile: ConfigFile<{
|
|
|
216
220
|
allowsSyntheticReasoningContentForToolCalls?: boolean | undefined;
|
|
217
221
|
requiresAssistantContentForToolCalls?: boolean | undefined;
|
|
218
222
|
supportsToolChoice?: boolean | undefined;
|
|
223
|
+
supportsForcedToolChoice?: boolean | undefined;
|
|
224
|
+
toolChoiceSupport?: "auto" | "named" | "none" | "required" | undefined;
|
|
219
225
|
disableReasoningOnForcedToolChoice?: boolean | undefined;
|
|
220
226
|
disableReasoningOnToolChoice?: boolean | undefined;
|
|
221
227
|
thinkingFormat?: "openai" | "openrouter" | "qwen" | "qwen-chat-template" | "zai" | undefined;
|
|
@@ -133,6 +133,8 @@ export declare function resolveModelOverrideWithAuthFallback(modelPatterns: stri
|
|
|
133
133
|
thinkingLevel?: ThinkingLevel;
|
|
134
134
|
explicitThinkingLevel: boolean;
|
|
135
135
|
authFallbackUsed: boolean;
|
|
136
|
+
requestedModel?: Model<Api>;
|
|
137
|
+
fallbackReason?: "auth_unavailable";
|
|
136
138
|
}>;
|
|
137
139
|
/**
|
|
138
140
|
* Resolve a list of role patterns to the first matching model.
|
|
@@ -30,6 +30,13 @@ export declare const OpenAICompatSchema: z.ZodObject<{
|
|
|
30
30
|
allowsSyntheticReasoningContentForToolCalls: z.ZodOptional<z.ZodBoolean>;
|
|
31
31
|
requiresAssistantContentForToolCalls: z.ZodOptional<z.ZodBoolean>;
|
|
32
32
|
supportsToolChoice: z.ZodOptional<z.ZodBoolean>;
|
|
33
|
+
supportsForcedToolChoice: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
+
toolChoiceSupport: z.ZodOptional<z.ZodEnum<{
|
|
35
|
+
auto: "auto";
|
|
36
|
+
named: "named";
|
|
37
|
+
none: "none";
|
|
38
|
+
required: "required";
|
|
39
|
+
}>>;
|
|
33
40
|
disableReasoningOnForcedToolChoice: z.ZodOptional<z.ZodBoolean>;
|
|
34
41
|
disableReasoningOnToolChoice: z.ZodOptional<z.ZodBoolean>;
|
|
35
42
|
thinkingFormat: z.ZodOptional<z.ZodEnum<{
|
|
@@ -182,6 +189,13 @@ export declare const ModelOverrideSchema: z.ZodObject<{
|
|
|
182
189
|
allowsSyntheticReasoningContentForToolCalls: z.ZodOptional<z.ZodBoolean>;
|
|
183
190
|
requiresAssistantContentForToolCalls: z.ZodOptional<z.ZodBoolean>;
|
|
184
191
|
supportsToolChoice: z.ZodOptional<z.ZodBoolean>;
|
|
192
|
+
supportsForcedToolChoice: z.ZodOptional<z.ZodBoolean>;
|
|
193
|
+
toolChoiceSupport: z.ZodOptional<z.ZodEnum<{
|
|
194
|
+
auto: "auto";
|
|
195
|
+
named: "named";
|
|
196
|
+
none: "none";
|
|
197
|
+
required: "required";
|
|
198
|
+
}>>;
|
|
185
199
|
disableReasoningOnForcedToolChoice: z.ZodOptional<z.ZodBoolean>;
|
|
186
200
|
disableReasoningOnToolChoice: z.ZodOptional<z.ZodBoolean>;
|
|
187
201
|
thinkingFormat: z.ZodOptional<z.ZodEnum<{
|
|
@@ -288,6 +302,13 @@ export declare const ModelsConfigSchema: z.ZodObject<{
|
|
|
288
302
|
allowsSyntheticReasoningContentForToolCalls: z.ZodOptional<z.ZodBoolean>;
|
|
289
303
|
requiresAssistantContentForToolCalls: z.ZodOptional<z.ZodBoolean>;
|
|
290
304
|
supportsToolChoice: z.ZodOptional<z.ZodBoolean>;
|
|
305
|
+
supportsForcedToolChoice: z.ZodOptional<z.ZodBoolean>;
|
|
306
|
+
toolChoiceSupport: z.ZodOptional<z.ZodEnum<{
|
|
307
|
+
auto: "auto";
|
|
308
|
+
named: "named";
|
|
309
|
+
none: "none";
|
|
310
|
+
required: "required";
|
|
311
|
+
}>>;
|
|
291
312
|
disableReasoningOnForcedToolChoice: z.ZodOptional<z.ZodBoolean>;
|
|
292
313
|
disableReasoningOnToolChoice: z.ZodOptional<z.ZodBoolean>;
|
|
293
314
|
thinkingFormat: z.ZodOptional<z.ZodEnum<{
|
|
@@ -442,6 +463,13 @@ export declare const ModelsConfigSchema: z.ZodObject<{
|
|
|
442
463
|
allowsSyntheticReasoningContentForToolCalls: z.ZodOptional<z.ZodBoolean>;
|
|
443
464
|
requiresAssistantContentForToolCalls: z.ZodOptional<z.ZodBoolean>;
|
|
444
465
|
supportsToolChoice: z.ZodOptional<z.ZodBoolean>;
|
|
466
|
+
supportsForcedToolChoice: z.ZodOptional<z.ZodBoolean>;
|
|
467
|
+
toolChoiceSupport: z.ZodOptional<z.ZodEnum<{
|
|
468
|
+
auto: "auto";
|
|
469
|
+
named: "named";
|
|
470
|
+
none: "none";
|
|
471
|
+
required: "required";
|
|
472
|
+
}>>;
|
|
445
473
|
disableReasoningOnForcedToolChoice: z.ZodOptional<z.ZodBoolean>;
|
|
446
474
|
disableReasoningOnToolChoice: z.ZodOptional<z.ZodBoolean>;
|
|
447
475
|
thinkingFormat: z.ZodOptional<z.ZodEnum<{
|
|
@@ -575,6 +603,13 @@ export declare const ModelsConfigSchema: z.ZodObject<{
|
|
|
575
603
|
allowsSyntheticReasoningContentForToolCalls: z.ZodOptional<z.ZodBoolean>;
|
|
576
604
|
requiresAssistantContentForToolCalls: z.ZodOptional<z.ZodBoolean>;
|
|
577
605
|
supportsToolChoice: z.ZodOptional<z.ZodBoolean>;
|
|
606
|
+
supportsForcedToolChoice: z.ZodOptional<z.ZodBoolean>;
|
|
607
|
+
toolChoiceSupport: z.ZodOptional<z.ZodEnum<{
|
|
608
|
+
auto: "auto";
|
|
609
|
+
named: "named";
|
|
610
|
+
none: "none";
|
|
611
|
+
required: "required";
|
|
612
|
+
}>>;
|
|
578
613
|
disableReasoningOnForcedToolChoice: z.ZodOptional<z.ZodBoolean>;
|
|
579
614
|
disableReasoningOnToolChoice: z.ZodOptional<z.ZodBoolean>;
|
|
580
615
|
thinkingFormat: z.ZodOptional<z.ZodEnum<{
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Effort } from "@gajae-code/ai/model-thinking";
|
|
1
2
|
import { type SkillDiscoverySettings } from "./skill-settings-defaults";
|
|
2
3
|
/** Unified settings schema - single source of truth for all settings.
|
|
3
4
|
*
|
|
@@ -697,13 +698,13 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
697
698
|
};
|
|
698
699
|
readonly defaultThinkingLevel: {
|
|
699
700
|
readonly type: "enum";
|
|
700
|
-
readonly values: readonly
|
|
701
|
-
readonly default:
|
|
701
|
+
readonly values: readonly Effort[];
|
|
702
|
+
readonly default: Effort;
|
|
702
703
|
readonly ui: {
|
|
703
704
|
readonly tab: "model";
|
|
704
705
|
readonly label: "Thinking Level";
|
|
705
706
|
readonly description: "Reasoning depth for thinking-capable models";
|
|
706
|
-
readonly options: readonly import("../thinking").ThinkingLevelMetadata[];
|
|
707
|
+
readonly options: readonly import("../thinking-metadata").ThinkingLevelMetadata[];
|
|
707
708
|
};
|
|
708
709
|
};
|
|
709
710
|
readonly hideThinkingBlock: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const COORDINATOR_MCP_PROTOCOL_VERSION = "2024-11-05";
|
|
2
2
|
export declare const COORDINATOR_MCP_SERVER_NAME = "gjc-coordinator-mcp";
|
|
3
|
-
export declare const COORDINATOR_MCP_TOOL_NAMES: readonly ["gjc_coordinator_list_sessions", "gjc_coordinator_read_status", "gjc_coordinator_read_tail", "gjc_coordinator_list_questions", "gjc_coordinator_list_artifacts", "gjc_coordinator_read_artifact", "gjc_coordinator_read_coordination_status", "gjc_coordinator_start_session", "gjc_coordinator_send_prompt", "gjc_coordinator_submit_question_answer", "gjc_coordinator_read_turn", "gjc_coordinator_await_turn", "gjc_coordinator_report_status"];
|
|
3
|
+
export declare const COORDINATOR_MCP_TOOL_NAMES: readonly ["gjc_coordinator_list_sessions", "gjc_coordinator_read_status", "gjc_coordinator_read_tail", "gjc_coordinator_list_questions", "gjc_coordinator_list_artifacts", "gjc_coordinator_read_artifact", "gjc_coordinator_read_coordination_status", "gjc_coordinator_register_session", "gjc_coordinator_start_session", "gjc_coordinator_send_prompt", "gjc_coordinator_submit_question_answer", "gjc_coordinator_read_turn", "gjc_coordinator_await_turn", "gjc_coordinator_report_status"];
|
|
4
4
|
export type CoordinatorToolName = (typeof COORDINATOR_MCP_TOOL_NAMES)[number];
|
|
@@ -8,10 +8,11 @@ interface JsonRpcRequest {
|
|
|
8
8
|
method: string;
|
|
9
9
|
params?: unknown;
|
|
10
10
|
}
|
|
11
|
+
type JsonRpcResult = any;
|
|
11
12
|
interface JsonRpcResponse {
|
|
12
13
|
jsonrpc: "2.0";
|
|
13
14
|
id: string | number | null;
|
|
14
|
-
result?:
|
|
15
|
+
result?: JsonRpcResult;
|
|
15
16
|
error?: {
|
|
16
17
|
code: number;
|
|
17
18
|
message: string;
|
|
@@ -30,6 +31,11 @@ interface SessionStartInput {
|
|
|
30
31
|
interface CoordinatorServices {
|
|
31
32
|
listSessions?: () => unknown[] | Promise<unknown[]>;
|
|
32
33
|
startSession?: (input: SessionStartInput) => unknown | Promise<unknown>;
|
|
34
|
+
commandRunner?: (command: string[]) => Promise<{
|
|
35
|
+
exitCode: number;
|
|
36
|
+
stdout: string;
|
|
37
|
+
stderr: string;
|
|
38
|
+
}>;
|
|
33
39
|
}
|
|
34
40
|
interface CoordinatorMcpServerOptions {
|
|
35
41
|
env?: NodeJS.ProcessEnv;
|
|
@@ -48,5 +54,5 @@ export declare function createCoordinatorMcpServer(options?: CoordinatorMcpServe
|
|
|
48
54
|
handleJsonRpc: (request: JsonRpcRequest) => Promise<JsonRpcResponse>;
|
|
49
55
|
handle: (request: JsonRpcRequest) => Promise<JsonRpcResponse>;
|
|
50
56
|
};
|
|
51
|
-
export declare function handleCoordinatorMcpRequest(request: JsonRpcRequest, options?: LegacyHandlerOptions): Promise<
|
|
57
|
+
export declare function handleCoordinatorMcpRequest(request: JsonRpcRequest, options?: LegacyHandlerOptions): Promise<JsonRpcResponse>;
|
|
52
58
|
export declare function runCoordinatorMcpStdio(options?: CoordinatorMcpServerOptions): Promise<void>;
|
|
@@ -275,7 +275,6 @@ export declare function resolveGjcTeamStateRoot(cwd?: string, env?: NodeJS.Proce
|
|
|
275
275
|
export declare function persistGjcTeamModeStateSummary(snapshot: GjcTeamSnapshot, cwd?: string): Promise<void>;
|
|
276
276
|
export declare function recoverGjcTeamStaleClaims(teamName: string, cwd?: string, env?: NodeJS.ProcessEnv): Promise<GjcTeamLivenessRecoveryResult>;
|
|
277
277
|
type GjcTeamTaskMetadataInput = Partial<Pick<GjcTeamTask, "owner" | "lane" | "required_role" | "allowed_roles" | "depends_on" | "blocked_by">>;
|
|
278
|
-
export declare function resolveGjcTmuxCommand(env?: NodeJS.ProcessEnv): string;
|
|
279
278
|
export declare function resolveGjcWorkerCommand(cwd?: string, env?: NodeJS.ProcessEnv): string;
|
|
280
279
|
export type GjcWorkerCheckpointClassification = {
|
|
281
280
|
kind: "clean";
|
|
@@ -21,6 +21,9 @@ export interface TmuxCommandResult {
|
|
|
21
21
|
export type TmuxCommandRunner = (args: string[]) => TmuxCommandResult;
|
|
22
22
|
export declare function envDisabled(value: string | undefined): boolean;
|
|
23
23
|
export declare function resolveGjcTmuxCommand(env?: NodeJS.ProcessEnv): string;
|
|
24
|
+
export declare const GJC_TMUX_UNTAGGED_REASON = "gjc_tmux_session_untagged";
|
|
25
|
+
export declare function buildGjcTmuxUntaggedSessionHint(tmuxCommand: string): string;
|
|
26
|
+
export declare function buildGjcTmuxUntaggedSessionError(sessionName: string, tmuxCommand: string): string;
|
|
24
27
|
export declare function sanitizeTmuxToken(value: string): string;
|
|
25
28
|
export declare function buildGjcTmuxSessionSlug(value: string): string;
|
|
26
29
|
export declare function buildGjcTmuxSessionName(env?: NodeJS.ProcessEnv, context?: {
|
|
@@ -30,6 +30,11 @@ export interface FinalizeOptions {
|
|
|
30
30
|
reviewOnly?: boolean;
|
|
31
31
|
/** Operator/loop-supplied terminal review verdict (closed vocabulary). */
|
|
32
32
|
verdict?: string | null;
|
|
33
|
+
/**
|
|
34
|
+
* Final assistant text from the live RPC owner, used to extract a closed-vocabulary verdict
|
|
35
|
+
* for review-only sessions when no explicit {@link verdict} is supplied. Never persisted raw.
|
|
36
|
+
*/
|
|
37
|
+
assistantText?: string | null;
|
|
33
38
|
/** Bounded PR/issue reference for the review target (e.g. "PR-414"). Never resolved from the live repo. */
|
|
34
39
|
prTarget?: string | null;
|
|
35
40
|
validationCommands?: ValidationCommandSpec[];
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* Stateless `gjc harness` CLI calls reach the owner via {@link resolveOwner} + the endpoint.
|
|
12
12
|
*/
|
|
13
13
|
import { type FinalizeChecks, type ValidationCommandSpec } from "./finalize";
|
|
14
|
-
import type
|
|
14
|
+
import { type HarnessRpc } from "./rpc-adapter";
|
|
15
15
|
import { type SessionLease } from "./session-lease";
|
|
16
16
|
export interface OwnerOptions {
|
|
17
17
|
root: string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase-boundary receipt rollup builder (receipt-of-receipts).
|
|
3
|
+
*
|
|
4
|
+
* At a harness lifecycle boundary, N child task receipts can be superseded by a
|
|
5
|
+
* single `phase-rollup` receipt that preserves per-child pointers (id, status,
|
|
6
|
+
* outputRef, sha256) plus aggregate ROI totals. The rollup is hash-sealed via
|
|
7
|
+
* the standard receipt envelope and validated fail-closed like every other
|
|
8
|
+
* family (see `validatePhaseRollup` in receipts.ts). Pure builder — no runtime
|
|
9
|
+
* injection behavior is changed here.
|
|
10
|
+
*/
|
|
11
|
+
import type { TaskResultReceipt } from "../task/receipt";
|
|
12
|
+
import { type BuildReceiptInput, type PhaseRollupEvidence, type ReceiptEnvelope } from "./receipts";
|
|
13
|
+
export interface BuildPhaseRollupInput {
|
|
14
|
+
receiptId: string;
|
|
15
|
+
sessionId: string;
|
|
16
|
+
source: string;
|
|
17
|
+
subject: BuildReceiptInput<PhaseRollupEvidence>["subject"];
|
|
18
|
+
phase: string;
|
|
19
|
+
children: readonly TaskResultReceipt[];
|
|
20
|
+
/** Supply for deterministic output; defaults to now. */
|
|
21
|
+
createdAt?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function buildPhaseRollupReceipt(input: BuildPhaseRollupInput): ReceiptEnvelope<PhaseRollupEvidence>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReceiptEnvelope } from "./receipts";
|
|
2
|
+
import type { HarnessLifecycle, ReceiptFamily, SessionState } from "./types";
|
|
3
|
+
export declare const RECEIPT_DIGEST_MAX_CHARS = 280;
|
|
4
|
+
export declare const RECEIPT_FAMILY_LIFECYCLE_TARGETS: Partial<Record<ReceiptFamily, HarnessLifecycle>>;
|
|
5
|
+
export interface ReceiptIngestResult {
|
|
6
|
+
accepted: ReceiptEnvelope<unknown>[];
|
|
7
|
+
rejected: {
|
|
8
|
+
receipt: ReceiptEnvelope<unknown>;
|
|
9
|
+
reasons: string[];
|
|
10
|
+
}[];
|
|
11
|
+
transitions: {
|
|
12
|
+
from: HarnessLifecycle;
|
|
13
|
+
to: HarnessLifecycle;
|
|
14
|
+
receiptId: string;
|
|
15
|
+
}[];
|
|
16
|
+
finalLifecycle: HarnessLifecycle;
|
|
17
|
+
digest: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function ingestReceipts(state: SessionState, receipts: readonly ReceiptEnvelope<unknown>[]): ReceiptIngestResult;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReceiptEnvelope } from "./receipts";
|
|
2
|
+
export declare const RECEIPT_SPOOL_DIR_ENV = "GJC_RECEIPT_SPOOL_DIR";
|
|
3
|
+
export declare const RECEIPT_SPOOL_FILENAME = "spool.jsonl";
|
|
4
|
+
export declare const RECEIPT_SPOOL_CURSOR_WIDTH = 12;
|
|
5
|
+
export interface ReceiptSpoolRecord {
|
|
6
|
+
cursor: string;
|
|
7
|
+
envelope: ReceiptEnvelope<unknown>;
|
|
8
|
+
}
|
|
9
|
+
export interface ReceiptSpoolAppendResult {
|
|
10
|
+
cursor: string;
|
|
11
|
+
path: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function withReceiptSpoolDir<T>(spoolDir: string, fn: () => Promise<T>): Promise<T>;
|
|
14
|
+
export declare function resolveReceiptSpoolDir(env?: NodeJS.ProcessEnv): string | undefined;
|
|
15
|
+
export declare function receiptSpoolPath(spoolDir: string): string;
|
|
16
|
+
export declare function formatReceiptSpoolCursor(cursor: bigint): string;
|
|
17
|
+
export declare function readHighestReceiptSpoolCursor(spoolDir: string): Promise<bigint>;
|
|
18
|
+
export declare function appendReceiptToSpool(spoolDir: string, envelope: ReceiptEnvelope<unknown>): Promise<ReceiptSpoolAppendResult>;
|
|
19
|
+
export declare function appendReceiptToConfiguredSpool(envelope: ReceiptEnvelope<unknown>, env?: NodeJS.ProcessEnv): Promise<ReceiptSpoolAppendResult | undefined>;
|
|
@@ -20,6 +20,8 @@ export interface ReceiptEnvelope<E = Record<string, unknown>> {
|
|
|
20
20
|
sha256: string;
|
|
21
21
|
}
|
|
22
22
|
export declare const RECEIPT_SCHEMA_VERSION: 1;
|
|
23
|
+
/** Deterministic stringify with sorted keys (stable hash basis). */
|
|
24
|
+
export declare function canonicalJson(value: unknown): string;
|
|
23
25
|
export declare function sha256Hex(input: string): string;
|
|
24
26
|
export interface BuildReceiptInput<E> {
|
|
25
27
|
receiptId: string;
|
|
@@ -90,6 +92,10 @@ export interface ReviewVerdictEvidence {
|
|
|
90
92
|
finalizedAt: string;
|
|
91
93
|
/** Bounded summary code/reference for the verdict; never raw assistant text. */
|
|
92
94
|
summaryRef: string | null;
|
|
95
|
+
/** Where the verdict came from: explicit operator input or extracted from final assistant text. */
|
|
96
|
+
verdictSource?: "input" | "assistant";
|
|
97
|
+
/** sha256 of the assistant text the verdict was extracted from, when sourced from the agent. */
|
|
98
|
+
assistantDigest?: string | null;
|
|
93
99
|
}
|
|
94
100
|
export interface ReviewFailureEvidence {
|
|
95
101
|
/** Machine-actionable reason the review produced no terminal verdict. */
|
|
@@ -98,6 +104,46 @@ export interface ReviewFailureEvidence {
|
|
|
98
104
|
failedAt: string;
|
|
99
105
|
/** Routing hint for the operator/fallback path. */
|
|
100
106
|
fallback: string;
|
|
107
|
+
/** sha256 of the assistant text examined for a verdict, when one was available. */
|
|
108
|
+
assistantDigest?: string | null;
|
|
109
|
+
/** Bounded, whitespace-collapsed assistant summary (never an unbounded transcript dump). */
|
|
110
|
+
assistantSummary?: string | null;
|
|
101
111
|
}
|
|
112
|
+
/** Pointer back to one superseded child task receipt. */
|
|
113
|
+
export interface PhaseRollupChildPointer {
|
|
114
|
+
id: string;
|
|
115
|
+
status: "completed" | "failed" | "aborted" | "merge_failed" | "paused";
|
|
116
|
+
/** Artifact URI holding the child's full output, when available. */
|
|
117
|
+
outputUri: string | null;
|
|
118
|
+
/** Content hash of the child's output artifact, when available. */
|
|
119
|
+
outputSha256: string | null;
|
|
120
|
+
/** Hash of the child receipt itself (canonical JSON), for staleness checks. */
|
|
121
|
+
receiptSha256: string;
|
|
122
|
+
/**
|
|
123
|
+
* Per-child ROI accounting carried into the rollup so the aggregate totals
|
|
124
|
+
* below are recomputable/verifiable from child evidence (not self-reported).
|
|
125
|
+
* `tokens` is the child's effective token count; cost/cloned are null when
|
|
126
|
+
* the child reported no such accounting.
|
|
127
|
+
*/
|
|
128
|
+
tokens: number;
|
|
129
|
+
costTotal: number | null;
|
|
130
|
+
clonedTokens: number | null;
|
|
131
|
+
lowRoi: boolean;
|
|
132
|
+
}
|
|
133
|
+
export interface PhaseRollupEvidence {
|
|
134
|
+
/** Harness lifecycle boundary this rollup was emitted at. */
|
|
135
|
+
phase: string;
|
|
136
|
+
children: PhaseRollupChildPointer[];
|
|
137
|
+
aggregate: {
|
|
138
|
+
childCount: number;
|
|
139
|
+
completed: number;
|
|
140
|
+
failed: number;
|
|
141
|
+
totalTokens: number;
|
|
142
|
+
totalCostTotal: number | null;
|
|
143
|
+
totalClonedTokens: number | null;
|
|
144
|
+
lowRoiChildIds: string[];
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
export declare function validatePhaseRollup(e: PhaseRollupEvidence): string[];
|
|
102
148
|
/** Classifications that MUST have a valid `vanish` receipt before the action proceeds. */
|
|
103
149
|
export declare function requiresVanishBeforeAction(classification: RecoveryClassification): boolean;
|
|
@@ -24,6 +24,8 @@ export interface HarnessRpc {
|
|
|
24
24
|
isLive?(): boolean;
|
|
25
25
|
/** ISO timestamp of the last observed event frame, or null. */
|
|
26
26
|
lastFrameAt?(): string | null;
|
|
27
|
+
/** Final assistant text from the live session (for review-verdict extraction); null when unavailable. */
|
|
28
|
+
getLastAssistantText?(): Promise<string | null>;
|
|
27
29
|
}
|
|
28
30
|
export interface AcceptanceResult {
|
|
29
31
|
accepted: boolean;
|
|
@@ -54,6 +56,7 @@ export declare class GajaeCodeRpc implements HarnessRpc {
|
|
|
54
56
|
isLive(): boolean;
|
|
55
57
|
lastFrameAt(): string | null;
|
|
56
58
|
getState(): Promise<RpcStateSnapshot>;
|
|
59
|
+
getLastAssistantText(): Promise<string | null>;
|
|
57
60
|
sendPrompt(prompt: string): Promise<{
|
|
58
61
|
commandId: string;
|
|
59
62
|
ack: boolean;
|
|
@@ -9,11 +9,16 @@ import type { HarnessLifecycle, NextAllowedAction, PrimitiveResponse, SessionSta
|
|
|
9
9
|
export declare function isTerminal(lifecycle: HarnessLifecycle): boolean;
|
|
10
10
|
export declare function canTransition(from: HarnessLifecycle, to: HarnessLifecycle): boolean;
|
|
11
11
|
export declare function assertTransition(from: HarnessLifecycle, to: HarnessLifecycle): void;
|
|
12
|
+
export interface NextAllowedActionsOptions {
|
|
13
|
+
/** Additional live-owner/RPC readiness gate for submit, e.g. rpc-not-idle. */
|
|
14
|
+
submitUnavailableReason?: string | null;
|
|
15
|
+
}
|
|
16
|
+
export declare function submitUnavailableReason(lifecycle: HarnessLifecycle, ownerLive: boolean, gateReason?: string | null): string | null;
|
|
12
17
|
/**
|
|
13
18
|
* Derive the permitted next actions for a session given its lifecycle and whether
|
|
14
19
|
* a live owner currently holds the lease.
|
|
15
20
|
*/
|
|
16
|
-
export declare function nextAllowedActions(lifecycle: HarnessLifecycle, ownerLive: boolean): NextAllowedAction[];
|
|
21
|
+
export declare function nextAllowedActions(lifecycle: HarnessLifecycle, ownerLive: boolean, options?: NextAllowedActionsOptions): NextAllowedAction[];
|
|
17
22
|
export declare function buildStateView(state: SessionState, ownerLive: boolean): SessionStateView;
|
|
18
23
|
/** Build the universal contract response carried by every primitive. */
|
|
19
24
|
export declare function buildResponse<E extends Record<string, unknown>>(state: SessionState, ownerLive: boolean, evidence: E, ok?: boolean): PrimitiveResponse<E>;
|
|
@@ -16,6 +16,14 @@ export type SessionMode = "implement" | "review";
|
|
|
16
16
|
export type ReviewVerdict = "APPROVE_MERGE_READY" | "REQUEST_CHANGES" | "OWNER_CONFIRMATION_REQUIRED";
|
|
17
17
|
export declare const REVIEW_VERDICTS: readonly ReviewVerdict[];
|
|
18
18
|
export declare function isReviewVerdict(value: unknown): value is ReviewVerdict;
|
|
19
|
+
/**
|
|
20
|
+
* Extract a single closed-vocabulary review verdict from free-form assistant text.
|
|
21
|
+
*
|
|
22
|
+
* Scans for canonical verdict tokens (and accepted aliases) as whole words and returns the
|
|
23
|
+
* LAST occurrence — the agent's final stated decision wins over any earlier mention. Returns
|
|
24
|
+
* null when no allowed token is present, so the finalizer fails closed on a missing verdict.
|
|
25
|
+
*/
|
|
26
|
+
export declare function extractReviewVerdict(text: string | null | undefined): ReviewVerdict | null;
|
|
19
27
|
/** Lifecycle states of an operated session. */
|
|
20
28
|
export type HarnessLifecycle = "new" | "started" | "submitted" | "observing" | "recovering" | "validating" | "finalizing" | "completed" | "blocked" | "retired";
|
|
21
29
|
/** Event severities emitted by the owner. */
|
|
@@ -27,7 +35,7 @@ export type RiskKind = "normal" | "prompt-not-accepted" | "deleted-worktree" | "
|
|
|
27
35
|
/** Deterministic recovery classifications. */
|
|
28
36
|
export type RecoveryClassification = "continue" | "send-enter" | "reinject-prompt" | "restart-clean" | "restart-preserve-delta" | "fallback-codex-exec" | "human-check";
|
|
29
37
|
/** Receipt families persisted under the session storage dir. */
|
|
30
|
-
export type ReceiptFamily = "vanish" | "prompt-acceptance" | "validation" | "completion" | "review-verdict" | "review-failure";
|
|
38
|
+
export type ReceiptFamily = "vanish" | "prompt-acceptance" | "validation" | "completion" | "review-verdict" | "review-failure" | "phase-rollup";
|
|
31
39
|
/** The CLI verbs / primitives exposed by `gjc harness <verb>`. */
|
|
32
40
|
export type HarnessVerb = "start" | "submit" | "observe" | "classify" | "recover" | "validate" | "finalize" | "retire" | "events" | "monitor" | "operate";
|
|
33
41
|
/** Submission transports. */
|
|
@@ -130,6 +138,10 @@ export interface Observation {
|
|
|
130
138
|
rpcLive?: boolean;
|
|
131
139
|
/** ISO timestamp of the most recent RPC frame the owner observed, if any. */
|
|
132
140
|
rpcLastFrameAt?: string | null;
|
|
141
|
+
/** True only when owner/rpc/lifecycle gates indicate a prompt can be submitted now. */
|
|
142
|
+
readyForSubmit?: boolean;
|
|
143
|
+
/** Present when readyForSubmit is false; mirrors submit's nextAllowedActions reason. */
|
|
144
|
+
submitUnavailableReason?: string | null;
|
|
133
145
|
}
|
|
134
146
|
/** Input to the deterministic recovery classifier. */
|
|
135
147
|
export interface ClassifyInput {
|