@gajae-code/coding-agent 0.15.6 → 0.16.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 +59 -0
- package/dist/types/cli/args.d.ts +2 -0
- package/dist/types/cli/root-flags.d.ts +14 -0
- package/dist/types/cli/update-cli.d.ts +13 -0
- package/dist/types/cli.d.ts +7 -0
- package/dist/types/commands/launch.d.ts +10 -0
- package/dist/types/config/autorouting-tier-map.d.ts +24 -0
- package/dist/types/config/file-lock.d.ts +5 -0
- package/dist/types/config/model-registry.d.ts +6 -0
- package/dist/types/config/settings-schema.d.ts +10 -1
- package/dist/types/config/settings.d.ts +2 -0
- package/dist/types/coordinator-mcp/projection-scan.d.ts +8 -0
- package/dist/types/crash/record-loader.d.ts +15 -0
- package/dist/types/gjc-runtime/launch-worktree-reservation.d.ts +21 -0
- package/dist/types/gjc-runtime/managed-owner-supervisor.d.ts +2 -0
- package/dist/types/gjc-runtime/session-state-sidecar.d.ts +66 -1
- package/dist/types/gjc-runtime/tmux-owner-isolation.d.ts +1 -0
- package/dist/types/gjc-runtime/tmux-sessions.d.ts +27 -0
- package/dist/types/master-mode/context.d.ts +21 -0
- package/dist/types/master-mode/first-request.d.ts +34 -0
- package/dist/types/master-mode/snapshot.d.ts +32 -0
- package/dist/types/modes/components/frictionless-onboarding-selector.d.ts +10 -0
- package/dist/types/modes/components/oauth-selector.d.ts +1 -0
- package/dist/types/modes/components/status-line/model-name.d.ts +18 -0
- package/dist/types/modes/components/status-line/priority-row.d.ts +34 -0
- package/dist/types/modes/components/status-line/segments.d.ts +10 -0
- package/dist/types/modes/print-mode.d.ts +17 -0
- package/dist/types/modes/ui-language.d.ts +7 -1
- package/dist/types/sdk/broker/broker.d.ts +77 -1
- package/dist/types/sdk/broker/endpoint-authority.d.ts +24 -0
- package/dist/types/sdk/broker/index.d.ts +3 -0
- package/dist/types/sdk/broker/lifecycle.d.ts +26 -0
- package/dist/types/sdk/broker/master-capability.d.ts +10 -0
- package/dist/types/sdk/broker/session-index.d.ts +40 -11
- package/dist/types/sdk/broker/session-scope.d.ts +72 -0
- package/dist/types/sdk/broker/spawn-authority.d.ts +201 -0
- package/dist/types/sdk/broker/spawn-substrate.d.ts +30 -0
- package/dist/types/sdk/broker/state-version.d.ts +4 -1
- package/dist/types/sdk/broker/worktree-occupancy.d.ts +28 -0
- package/dist/types/sdk/bus/chat-daemon-control.d.ts +3 -0
- package/dist/types/sdk/bus/index.d.ts +6 -0
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +1 -1
- package/dist/types/sdk/cli/index.d.ts +1 -0
- package/dist/types/sdk/cli/master-cli.d.ts +63 -0
- package/dist/types/sdk/cli/rows.d.ts +4 -3
- package/dist/types/sdk/cli/session-cli.d.ts +18 -2
- package/dist/types/sdk/client/client.d.ts +3 -2
- package/dist/types/sdk/host/control/dispatch.d.ts +10 -0
- package/dist/types/sdk/host/control/index.d.ts +1 -1
- package/dist/types/sdk/host/control/operations.d.ts +2 -0
- package/dist/types/sdk/host/control/runtime-gate.d.ts +21 -7
- package/dist/types/sdk/host/host.d.ts +10 -0
- package/dist/types/sdk/host/session-runtime.d.ts +52 -0
- package/dist/types/sdk/lifecycle/broker-client.d.ts +6 -0
- package/dist/types/sdk/lifecycle/service.d.ts +15 -3
- package/dist/types/sdk/lifecycle-session.d.ts +2 -0
- package/dist/types/sdk/router/session-router.d.ts +2 -0
- package/dist/types/sdk/session.d.ts +16 -0
- package/dist/types/sdk/startup-capability.d.ts +2 -1
- package/dist/types/session/agent-session.d.ts +5 -0
- package/dist/types/session/credential-store-errors.d.ts +1 -0
- package/dist/types/session/session-manager.d.ts +65 -0
- package/dist/types/session/yield-queue.d.ts +5 -4
- package/dist/types/setup/frictionless-onboarding.d.ts +1 -0
- package/dist/types/tools/bash.d.ts +4 -0
- package/dist/types/tools/gh.d.ts +8 -0
- package/dist/types/tools/index.d.ts +4 -0
- package/package.json +7 -7
- package/scripts/generate-sdk-operation-inventory.ts +6 -0
- package/scripts/verify-gjc-sdk-canonicalization.ts +35 -1
- package/src/cli/accounts-cli.ts +9 -5
- package/src/cli/args.ts +17 -0
- package/src/cli/fast-help.ts +1 -0
- package/src/cli/root-flags.ts +5 -0
- package/src/cli/update-cli.ts +77 -11
- package/src/commands/launch.ts +86 -18
- package/src/commands/sdk.ts +113 -21
- package/src/config/autorouting-tier-map.ts +12 -0
- package/src/config/file-lock.ts +158 -83
- package/src/config/model-preset-registry.ts +1 -5
- package/src/config/model-profiles.ts +5 -5
- package/src/config/model-registry.ts +23 -0
- package/src/config/model-resolver.ts +5 -0
- package/src/config/settings-schema.ts +8 -1
- package/src/config/settings.ts +5 -0
- package/src/coordinator-mcp/projection-scan.ts +21 -0
- package/src/coordinator-mcp/question-state.ts +9 -11
- package/src/coordinator-mcp/server.ts +94 -20
- package/src/crash/index-store.ts +2 -0
- package/src/crash/record-loader.ts +10 -0
- package/src/gjc-runtime/launch-worktree-reservation.ts +242 -0
- package/src/gjc-runtime/managed-owner-supervisor.ts +63 -51
- package/src/gjc-runtime/session-state-lock.ts +79 -6
- package/src/gjc-runtime/session-state-sidecar.ts +929 -23
- package/src/gjc-runtime/tmux-owner-isolation-cli.ts +4 -7
- package/src/gjc-runtime/tmux-owner-isolation.ts +2 -2
- package/src/gjc-runtime/tmux-sessions.ts +252 -13
- package/src/hooks/skill-state.ts +6 -0
- package/src/internal-urls/docs-index.generated.ts +7 -7
- package/src/internal-urls/issue-pr-protocol.ts +4 -2
- package/src/main.ts +57 -2
- package/src/master-mode/context.ts +50 -0
- package/src/master-mode/first-request.ts +65 -0
- package/src/master-mode/snapshot.ts +205 -0
- package/src/modes/acp/acp-agent.ts +605 -156
- package/src/modes/components/footer.ts +4 -2
- package/src/modes/components/frictionless-onboarding-selector.ts +48 -2
- package/src/modes/components/oauth-selector.ts +6 -1
- package/src/modes/components/settings-selector.ts +1 -0
- package/src/modes/components/status-line/model-name.ts +53 -0
- package/src/modes/components/status-line/priority-row.ts +107 -0
- package/src/modes/components/status-line/segments.ts +23 -9
- package/src/modes/components/tool-status-header.ts +151 -15
- package/src/modes/controllers/input-controller.ts +28 -0
- package/src/modes/controllers/selector-controller.ts +191 -96
- package/src/modes/print-mode.ts +64 -0
- package/src/modes/ui-language.ts +49 -2
- package/src/prompts/system/master-mode.md +28 -0
- package/src/sdk/broker/broker.ts +1636 -26
- package/src/sdk/broker/endpoint-authority.ts +86 -0
- package/src/sdk/broker/ensure.ts +5 -0
- package/src/sdk/broker/index.ts +3 -0
- package/src/sdk/broker/lifecycle.ts +186 -41
- package/src/sdk/broker/master-capability.ts +232 -0
- package/src/sdk/broker/session-index.ts +121 -17
- package/src/sdk/broker/session-scope.ts +272 -0
- package/src/sdk/broker/spawn-authority.ts +1031 -0
- package/src/sdk/broker/spawn-substrate.ts +548 -0
- package/src/sdk/broker/state-version.ts +26 -14
- package/src/sdk/broker/transport.ts +1 -0
- package/src/sdk/broker/worktree-occupancy.ts +90 -0
- package/src/sdk/bus/chat-daemon-control.ts +5 -2
- package/src/sdk/bus/chat-daemon-runtime.ts +35 -4
- package/src/sdk/bus/index.ts +51 -4
- package/src/sdk/bus/telegram-daemon-contract.ts +1 -1
- package/src/sdk/cli/index.ts +1 -0
- package/src/sdk/cli/master-cli.ts +259 -0
- package/src/sdk/cli/rows.ts +11 -8
- package/src/sdk/cli/session-cli.ts +264 -5
- package/src/sdk/client/client.ts +14 -8
- package/src/sdk/host/control/dispatch.ts +99 -38
- package/src/sdk/host/control/index.ts +2 -0
- package/src/sdk/host/control/operations.ts +2 -0
- package/src/sdk/host/control/runtime-gate.ts +203 -11
- package/src/sdk/host/host.ts +27 -2
- package/src/sdk/host/session-runtime.test.ts +210 -6
- package/src/sdk/host/session-runtime.ts +291 -49
- package/src/sdk/lifecycle/broker-client.ts +28 -0
- package/src/sdk/lifecycle/service.ts +279 -20
- package/src/sdk/lifecycle-session.ts +10 -2
- package/src/sdk/protocol/operation-inventory.generated.json +51 -0
- package/src/sdk/protocol/operation-registry.ts +13 -3
- package/src/sdk/router/session-router.ts +67 -59
- package/src/sdk/session.ts +357 -155
- package/src/sdk/startup-capability.ts +1 -0
- package/src/session/agent-session.ts +640 -103
- package/src/session/blob-store.ts +15 -5
- package/src/session/credential-store-errors.ts +2 -0
- package/src/session/internal/managed-session-storage.ts +153 -78
- package/src/session/session-manager.ts +337 -24
- package/src/session/yield-queue.ts +24 -10
- package/src/setup/frictionless-onboarding.ts +2 -0
- package/src/telemetry/events.ts +1138 -12
- package/src/tools/bash.ts +256 -42
- package/src/tools/gh.ts +104 -48
- package/src/tools/github-cache.ts +2 -2
- package/src/tools/index.ts +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,65 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.16.0] - 2026-09-02
|
|
6
|
+
|
|
7
|
+
- Added master mode (`gjc --master [--scope repo|pwd|global]`) with authenticated, broker-authoritative child orchestration: `gjc sdk spawn` creates task-seeded children, scoped `gjc sdk search` discovers broker-visible sessions with paginated results, and locator v2 session rows carry canonical cwd, worktree-root, and state-root identity.
|
|
8
|
+
- SDK master-mode authority now selects the newest retained master epoch, binds worktree occupancy to canonical worktree roots with positive process-exit proof, keeps master capabilities out of ordinary Bash descendants, bounds authenticated nonce replay state, and preserves scoped search rows across pagination beyond the probe budget.
|
|
9
|
+
- `move_session`, TUI `/move`, and SDK/ACP `session.cwd.move` no longer strand coordinator runtime-state persistence for the rest of the session. All three surfaces now cross one `SessionManager.moveTo` lifecycle: admitted old-cwd sidecar writes drain before commit, later queued writes are generation-fenced, and a durable rescope journal records the exact old/new cwd and session-file identities before publication so restart can finish an interrupted migration. Relocation holds both canonical state paths' process, namespace, and state-file locks in deterministic order across read/authenticate/write/remove; signed predecessors and destinations require the matching key id plus a valid Ed25519 signature, unsigned rows require complete exact cwd/workdir/session-file identity, and coordinator bootstrap or partial rows are never laundered into authoritative state. No-follow descriptor reads and native identity-bound orphan retirement reject symlink/path replacement, a valid self-healed destination is preserved while its authenticated old marker is removed, and rejected/tampered evidence stays intact with the journal retained for recovery. Rollback clears the prepared journal, committed metadata failures still run relocation, and postmortem finalizer rebinding is unconditional even when repair fails, so unexpected exit targets the live cwd/session file. (#4629)
|
|
10
|
+
- `move_session` and `session.cwd.move` now report an unreadable target as `Directory identity or access unavailable` on macOS too. Darwin's `realpath(3)` fails with `EACCES` on a mode-0 directory where Linux resolves it and fails later at the access probe, so the same refusal was previously misreported as `Directory does not exist or is not a directory`.
|
|
11
|
+
- The status rail no longer collapses to a bare `…+N` overflow marker on very small terminals. Context %, the goal indicator and the model name are now the last segments evicted (in that order), and once ordinary telemetry is gone they degrade through shortened and single-glyph forms before being dropped — context % is never dropped, keeps `18.3%/200K` while it fits, falls back to an integer `18%`, and retains its usage-level color. The overflow marker is suppressed at those widths so its cells go to the priority items instead. Rails with no context window and no active goal evict exactly as before.
|
|
12
|
+
- Model names now render in their shortest recognizable id-derived form (`anthropic/claude-sonnet-4-5-20250929` → `sonnet-4.5`) in both the status rail and the footer telemetry line, replacing the raw id in the footer and the previous Anthropic-only `"Claude "` prefix strip in the rail. The rule is a pure heuristic — provider prefix, vendor family word and trailing date/build stamp removed — with no curated override table, and never yields an empty label. Model pickers and selectors keep full ids.
|
|
13
|
+
- The `claude-fable` and `fable-opus-codex` built-in presets now use `anthropic/claude-fable-5-1` instead of `anthropic/claude-fable-5`, with effort suffixes preserved (`claude-fable` default/architect `xhigh`, critic `high`, planner `low`; `fable-opus-codex` default `high`). Fable 5.1 exposes the identical effort ladder, so no role mapping changed shape, and the non-fable roles (`anthropic/claude-sonnet-5` executor, `anthropic/claude-opus-5` planner/critic, the Codex executor/architect) are untouched. The extragoal reviewer template moves to `anthropic/claude-fable-5-1:xhigh` for the same reason. `claude-fable-5` remains in the catalog for pinned selectors and for gateways that do not serve 5.1.
|
|
14
|
+
- Fresh interactive onboarding now asks for an interface language before showing guidance, supports English, Korean, Simplified Chinese, and Japanese, persists the choice through `ui.language`, and uses a documented English fallback for noninteractive, invalid, cancelled, or unwritable startup.
|
|
15
|
+
- Coordinator projection consumers now retry a bounded number of fresh authoritative scans when concurrent session churn races a candidate. Cap exhaustion, owner disappearance, unsupported authority, and parse failures remain fail-closed, while settled concurrent SDK sessions no longer permanently starve the session reaper or coordinator mutations. (#5168)
|
|
16
|
+
|
|
17
|
+
- Coordinator session-state locks now reclaim an empty, identity-qualified released transition tombstone on POSIX after a short release grace period. Live, foreign, malformed, non-empty, or identity-changed claims remain fail-closed, while persistent macOS/File Provider debris no longer burns the full transition timeout on every state write. (#5159)
|
|
18
|
+
|
|
19
|
+
- A runtime-state marker recorded against a different workspace path now reports that mismatch instead of claiming the file is unreadable, and a terminal, not-live marker that travelled into the current workspace with its session directory is adopted rather than refused. Live, non-terminal, and out-of-workspace markers are still refused untouched.
|
|
20
|
+
- An unavailable provider-qualified `modelRoles.default` selection now reports the requested model instead of silently starting on another provider's baseline. This keeps signed-registry omissions and failed catalog admission actionable rather than routing requests to an unrelated retired model. (#5144)
|
|
21
|
+
|
|
22
|
+
- Headless SDK substrate close now reports success when exact teardown observes the recorded process gone even if cleanup unlinks the durable proof first; live or identity-ambiguous substrates still report `substrate_mismatch`. (#5130)
|
|
23
|
+
|
|
24
|
+
- Windows session-state locks now drain late terminal reconciliation writes before disposal returns and safely reclaim valid dead transition claims during resume. (#5102)
|
|
25
|
+
|
|
26
|
+
- Deferred MCP startup now releases queued idle yields as soon as readiness settles without bypassing prompt admission. Barrier extensions remain gated, rejected startup drops the wake without prompting, settled sessions retain the normal idle merge window, and readiness stays session-local. (#5085)
|
|
27
|
+
- ACP deep-interview's real subprocess fixture now retires its owned lifecycle sessions before broker/root cleanup, preventing detached session hosts from recreating the fixture root after teardown. (#5086)
|
|
28
|
+
- The ACP fixture tracks broker startup through its full producer deadline and tracks session creation before awaiting responses, keeps its independent broker fallback client available when runtime shutdown fails, and retires sessions first seen in either broker inventory phase directly through that fallback across cleanup retries. Verified broker-startup rejection no longer strands the root, while an unverified child-reap failure retains cleanup authority. Reconciliation recognizes the real ACP `terminal_uncertain` after-send wire envelope as transport uncertainty while preserving semantic close diagnostics, then accepts terminal races only after strict inventory proves unambiguous and certain retirement. A stalled broker-client transport close no longer blocks authoritative lease/root cleanup, and the child environment confines Windows profile and temporary paths to the fixture root. (#5086)
|
|
29
|
+
- Telemetry install IDs are now staged in private temporary files and published atomically, so concurrent startup readers cannot observe a partial UUID payload; stale temporary files are never adopted and malformed persisted IDs still fail closed. Publication also falls back through native no-replace links and an exclusive claim protocol when rename-no-replace is unavailable, Windows reads and claim mutations use identity-bracketed opens, transient claimed payloads are retried, and every winner is tightened to mode 0600. (#5048)
|
|
30
|
+
|
|
31
|
+
- An install with no configured model no longer starts on a model its provider has already withdrawn. The startup fallback now applies the configured provider-priority policy, skips bundled defaults disproved by fresh provider discovery, and only then preserves catalog order for remaining candidates. Explicit model and profile selections, enabled-model allowlists, credential selectors, disabled providers, and provider/id collision-safe candidate membership remain unchanged.
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
|
|
35
|
+
- File locks now use a descriptor-relative exclusive directory-publication fallback
|
|
36
|
+
when a filesystem returns `EINVAL` for `renameat2(RENAME_NOREPLACE)` (for example
|
|
37
|
+
WSL2 DrvFs), so `edit` and terminal persistence no longer surface `Failed to publish
|
|
38
|
+
file lock: invalid_request` on valid paths. The native fallback preserves no-follow
|
|
39
|
+
path containment, owner identity, no-replace contention, and fail-closed stale-owner
|
|
40
|
+
checks. (#5164)
|
|
41
|
+
|
|
42
|
+
- The first Esc on a streaming turn with a queued steering message again consumes that steer and auto-continues instead of aborting the turn and dumping the queue back into the composer. The busy-indicator recovery branch counted the same drainable queue as cancellable work and, because a streaming turn always has that indicator mounted, it short-circuited before the steer-on-interrupt branch could run. Stale busy-indicator recovery, pending-submission cancellation, and the loud second-Esc abort are unchanged.
|
|
43
|
+
|
|
44
|
+
- Print and JSON turns now fail closed when the provider/agent produces no readable assistant text: JSON emits a bounded `agent_failed` disposition and failures exit nonzero, while tool-only terminal output can no longer masquerade as success. (#5153)
|
|
45
|
+
- Interactive `/login`, `/logout`, and account inventory commands now keep the TUI alive when the credential database reports `SQLITE_CORRUPT` or `SQLITE_NOTADB`. They show a bounded, payload-free recovery message and never auto-repair or delete the database. (#5070)
|
|
46
|
+
- `session.last_assistant` now reads the public transcript projection, skips trailing tool-only, thinking-only, empty, and whitespace-only assistant rows, and returns the most recent readable assistant text or an empty string when none exists. (#5078)
|
|
47
|
+
- Chat-daemon same-generation successor attachments now wait for predecessor provider retirement before admitting frames. Retired attachment frames remain fenced, successor frames resume after retirement, queue waiters settle during takeover and shutdown, and cross-generation replacement remains isolated. (#5120)
|
|
48
|
+
|
|
49
|
+
- SDK lifecycle readiness now uses the same descriptor-bound endpoint identity tolerance as broker endpoint reads and selects owners by scoped state root, process incarnation, and lifecycle marker instead of bare session ID. This restores default source-host startup, shipped SDK lifecycle topology, shared-agent saved-source isolation, cold resume/fork cleanup, local SDK-only broker recovery, and generated operation-matrix closure after the master-mode merge. (#5114)
|
|
50
|
+
|
|
51
|
+
- Coordinator event watchers now advertise the exact supported event-kind enum, while outbox entity validation and durable WAL/active-turn cleanup reuse their existing authority helpers instead of leaving those checks disconnected. (#5115)
|
|
52
|
+
- Post-install update verification now preserves a bounded, secret-redacted stderr/stdout cause when the newly installed `gjc --version` exits unsuccessfully, so runtime guards such as Bun version incompatibilities remain actionable instead of collapsing to a generic verification failure. (#5108)
|
|
53
|
+
- Concurrent coordinator mutations sharing one idempotency key now join the same in-process flight before taking the durable key lock, so a slow accepted prompt cannot make its retry time out as unavailable. Conflicting in-flight requests still fail closed, completed responses remain durably replayable, and different keys remain isolated. (#5110)
|
|
54
|
+
- Custom providers declaring `transport: pi-native` in `models.yml` now actually dispatch through the auth-gateway native endpoint. The provider-level transport was silently dropped for models.yml-declared models, so requests went to `<baseUrl>/chat/completions` and the gateway answered 404; and the pi-native client now serializes only wire-safe tool fields, so runtime tool state carrying fs-stat BigInts no longer aborts request serialization with `JSON.stringify cannot serialize BigInt`.
|
|
55
|
+
- ACP prompts now settle immediately on correlated explicit failure outcomes without waiting for a later `agent_end`; generic error-only `agent_failed` events remain additive diagnostics until an authoritative terminal, while late duplicates and unrelated correlations stay isolated. (#5107)
|
|
56
|
+
|
|
57
|
+
- Managed-session file identities now use one canonical unsigned 64-bit representation across stat/native boundaries and replacement cleanup receipts. Native Windows file IDs surfaced as signed negative bigints no longer create double-hyphen receipt names that block persistence or reopen; already-written signed receipt names and interrupted pending receipts are recovered only through the existing identity-bound, fail-closed reconciliation paths. (#5095)
|
|
58
|
+
|
|
59
|
+
- `gh` PR diffs decode git's C-style quoted paths as UTF-8 bytes instead of Latin-1 code points, so non-ASCII file names (`docs/\355\225\234\352\270\200.md`) no longer surface as mojibake in the file list, and quoted `rename from`/`rename to` lines are unquoted the same way instead of keeping their literal quotes and escapes.
|
|
60
|
+
- Confirmed operator `turn.abort` requests now travel through a dedicated local Broker route instead of trusting caller-supplied `operator:true` and `confirm:true` on ordinary SDK frames. The Broker revalidates the exact live endpoint identity, injects a process-bound private capability, preserves post-send uncertainty, and the host uses one capability-free canonical identity for dispatch idempotency, durable admission, and delivery receipts, so forged, stale, dropped, and replayed requests fail closed consistently across restart boundaries.
|
|
61
|
+
|
|
62
|
+
- Blob references and filesystem-backed blob reads now accept only exact lowercase SHA-256 names before resolving a disk path; canonical references and valid missing-blob behavior are unchanged.
|
|
63
|
+
|
|
5
64
|
## [0.15.6] - 2026-08-30
|
|
6
65
|
|
|
7
66
|
- Auth metadata remains session-only when a compatibility registry has auth storage but no owner accessor, preventing an unscoped OAuth account lookup from attributing a registry-scoped API-key request to the wrong account.
|
package/dist/types/cli/args.d.ts
CHANGED
|
@@ -50,6 +50,8 @@ export interface Args {
|
|
|
50
50
|
noRules?: boolean;
|
|
51
51
|
listModels?: string | true;
|
|
52
52
|
noTitle?: boolean;
|
|
53
|
+
master?: true;
|
|
54
|
+
masterScope?: "repo" | "pwd" | "global";
|
|
53
55
|
messages: string[];
|
|
54
56
|
fileArgs: string[];
|
|
55
57
|
/** Flags unknown to every launch parser; their consumer supplies the diagnostic. */
|
|
@@ -119,6 +119,13 @@ export declare const ROOT_LAUNCH_FLAGS: {
|
|
|
119
119
|
"no-title": FlagDescriptor<"boolean"> & {
|
|
120
120
|
description: string;
|
|
121
121
|
};
|
|
122
|
+
master: FlagDescriptor<"boolean"> & {
|
|
123
|
+
description: string;
|
|
124
|
+
};
|
|
125
|
+
scope: FlagDescriptor<"string"> & {
|
|
126
|
+
description: string;
|
|
127
|
+
options: string[];
|
|
128
|
+
};
|
|
122
129
|
};
|
|
123
130
|
export type ConsumerLaunchFlagName = "hook" | "extension" | "no-extensions" | "no-skills" | "skills";
|
|
124
131
|
export type LaunchFlagConsumer = "acp" | "local";
|
|
@@ -247,6 +254,13 @@ export declare const LAUNCH_PARSE_FLAGS: {
|
|
|
247
254
|
"no-title": FlagDescriptor<"boolean"> & {
|
|
248
255
|
description: string;
|
|
249
256
|
};
|
|
257
|
+
master: FlagDescriptor<"boolean"> & {
|
|
258
|
+
description: string;
|
|
259
|
+
};
|
|
260
|
+
scope: FlagDescriptor<"string"> & {
|
|
261
|
+
description: string;
|
|
262
|
+
options: string[];
|
|
263
|
+
};
|
|
250
264
|
extension: FlagDescriptor<"boolean" | "integer" | "string">;
|
|
251
265
|
hook: FlagDescriptor<"boolean" | "integer" | "string">;
|
|
252
266
|
"no-extensions": FlagDescriptor<"boolean" | "integer" | "string">;
|
|
@@ -21,6 +21,7 @@ export interface InstalledVersionVerification {
|
|
|
21
21
|
ok: boolean;
|
|
22
22
|
actual?: string;
|
|
23
23
|
path?: string;
|
|
24
|
+
versionOutput?: string;
|
|
24
25
|
smokeTestFailed?: boolean;
|
|
25
26
|
smokeTestOutput?: string;
|
|
26
27
|
cleanupWarning?: string;
|
|
@@ -87,6 +88,18 @@ export declare function resolveGjcPathForTest(options: {
|
|
|
87
88
|
whichPath: string | undefined;
|
|
88
89
|
}): string | undefined;
|
|
89
90
|
export declare function parseReportedVersionForTest(output: string): string | undefined;
|
|
91
|
+
export declare function sanitizeVerificationOutputForTest(stderr: string | undefined, stdout: string | undefined): string | undefined;
|
|
92
|
+
interface InstalledVersionCommandResult {
|
|
93
|
+
exitCode: number | null;
|
|
94
|
+
stdout: string;
|
|
95
|
+
stderr: string;
|
|
96
|
+
}
|
|
97
|
+
type InstalledVersionCommandRunner = (runtimePath: string) => Promise<InstalledVersionCommandResult>;
|
|
98
|
+
export declare function verifyInstalledVersionForTest(options: {
|
|
99
|
+
expectedVersion: string;
|
|
100
|
+
runtimePath: string | undefined;
|
|
101
|
+
runVersion: InstalledVersionCommandRunner;
|
|
102
|
+
}): Promise<InstalledVersionVerification>;
|
|
90
103
|
interface MigrationTargetVerificationOptions {
|
|
91
104
|
runtimePath: string;
|
|
92
105
|
verifyChecksum: () => Promise<void>;
|
package/dist/types/cli.d.ts
CHANGED
|
@@ -142,6 +142,13 @@ export declare class RootHelpCommand extends Command {
|
|
|
142
142
|
"no-title": import("@gajae-code/utils/cli").FlagDescriptor<"boolean"> & {
|
|
143
143
|
description: string;
|
|
144
144
|
};
|
|
145
|
+
master: import("@gajae-code/utils/cli").FlagDescriptor<"boolean"> & {
|
|
146
|
+
description: string;
|
|
147
|
+
};
|
|
148
|
+
scope: import("@gajae-code/utils/cli").FlagDescriptor<"string"> & {
|
|
149
|
+
description: string;
|
|
150
|
+
options: string[];
|
|
151
|
+
};
|
|
145
152
|
};
|
|
146
153
|
static examples: string[];
|
|
147
154
|
static strict: boolean;
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
* Root command for the coding agent CLI.
|
|
3
3
|
*/
|
|
4
4
|
import { Command } from "@gajae-code/utils/cli";
|
|
5
|
+
import { type LaunchWorktreeReservation } from "../gjc-runtime/launch-worktree-reservation";
|
|
5
6
|
export declare function persistCoordinatorLaunchFailure(error: unknown, cwd: string, env?: NodeJS.ProcessEnv): Promise<void>;
|
|
7
|
+
/** Test seam for the path-keyed atomic reservation. */
|
|
8
|
+
export declare function reserveLaunchWorktreeForTest(agentDir: string, worktreePath: string): Promise<LaunchWorktreeReservation>;
|
|
6
9
|
export default class Index extends Command {
|
|
7
10
|
static description: string;
|
|
8
11
|
static hidden: boolean;
|
|
@@ -132,6 +135,13 @@ export default class Index extends Command {
|
|
|
132
135
|
"no-title": import("@gajae-code/utils/cli").FlagDescriptor<"boolean"> & {
|
|
133
136
|
description: string;
|
|
134
137
|
};
|
|
138
|
+
master: import("@gajae-code/utils/cli").FlagDescriptor<"boolean"> & {
|
|
139
|
+
description: string;
|
|
140
|
+
};
|
|
141
|
+
scope: import("@gajae-code/utils/cli").FlagDescriptor<"string"> & {
|
|
142
|
+
description: string;
|
|
143
|
+
options: string[];
|
|
144
|
+
};
|
|
135
145
|
};
|
|
136
146
|
static examples: string[];
|
|
137
147
|
static strict: boolean;
|
|
@@ -784,12 +784,33 @@ export declare const TIER_MAP_SKIP_LIST: {
|
|
|
784
784
|
readonly "openai-codex/gpt-daybreak-blue-latest": {
|
|
785
785
|
readonly rationale: "post-rebase catalog addition from dev; not yet curated";
|
|
786
786
|
};
|
|
787
|
+
readonly "opencode-go/deepseek-v4-flash-vision-exp": {
|
|
788
|
+
readonly rationale: "post-rebase catalog addition from dev; not yet curated";
|
|
789
|
+
};
|
|
790
|
+
readonly "opencode-go/glm-5.3-flash": {
|
|
791
|
+
readonly rationale: "post-rebase catalog addition from dev; not yet curated";
|
|
792
|
+
};
|
|
787
793
|
readonly "opencode-go/gpt-5.6-luna": {
|
|
788
794
|
readonly rationale: "post-rebase catalog addition from dev; not yet curated";
|
|
789
795
|
};
|
|
796
|
+
readonly "opencode-go/grok-4.6": {
|
|
797
|
+
readonly rationale: "post-rebase catalog addition from dev; not yet curated";
|
|
798
|
+
};
|
|
790
799
|
readonly "opencode-go/hy3": {
|
|
791
800
|
readonly rationale: "post-rebase catalog addition from dev; not yet curated";
|
|
792
801
|
};
|
|
802
|
+
readonly "opencode-go/hy4-preview": {
|
|
803
|
+
readonly rationale: "post-rebase catalog addition from dev; not yet curated";
|
|
804
|
+
};
|
|
805
|
+
readonly "opencode-go/longcat-2.0": {
|
|
806
|
+
readonly rationale: "post-rebase catalog addition from dev; not yet curated";
|
|
807
|
+
};
|
|
808
|
+
readonly "opencode-go/muse-spark-1.2-contributor": {
|
|
809
|
+
readonly rationale: "post-rebase catalog addition from dev; not yet curated";
|
|
810
|
+
};
|
|
811
|
+
readonly "opencode-go/qwen3.8-flash": {
|
|
812
|
+
readonly rationale: "post-rebase catalog addition from dev; not yet curated";
|
|
813
|
+
};
|
|
793
814
|
readonly "opencode-go/qwen3.8-max": {
|
|
794
815
|
readonly rationale: "post-rebase catalog addition from dev; not yet curated";
|
|
795
816
|
};
|
|
@@ -1686,6 +1707,9 @@ export declare const TIER_MAP_SKIP_LIST: {
|
|
|
1686
1707
|
readonly baseline: true;
|
|
1687
1708
|
readonly rationale: "pre-feature baseline; not yet curated";
|
|
1688
1709
|
};
|
|
1710
|
+
readonly "anthropic/claude-fable-5-1": {
|
|
1711
|
+
readonly rationale: "post-feature catalog addition; not yet curated";
|
|
1712
|
+
};
|
|
1689
1713
|
readonly "anthropic/claude-haiku-4-5-20251001": {
|
|
1690
1714
|
readonly baseline: true;
|
|
1691
1715
|
readonly rationale: "pre-feature baseline; not yet curated";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { NativeDirectoryTreeResult, NativeExactUnlinkResult } from "@gajae-code/natives";
|
|
2
|
+
import { renameDirectoryNoReplacePathAsync, renameNoReplacePathAsync } from "@gajae-code/natives";
|
|
2
3
|
export interface FileLockOptions {
|
|
3
4
|
staleMs?: number;
|
|
4
5
|
retries?: number;
|
|
@@ -15,6 +16,10 @@ export declare const FILE_LOCK_RELEASE_RETRY_ATTEMPTS = 5;
|
|
|
15
16
|
export declare const FILE_LOCK_RELEASE_RETRY_DELAY_MS = 10;
|
|
16
17
|
export declare const FileLockTestHooks: {
|
|
17
18
|
afterParentMkdir?: (lockPath: string) => void | Promise<void>;
|
|
19
|
+
nativePublicationBindings?: () => {
|
|
20
|
+
renameNoReplacePathAsync: typeof renameNoReplacePathAsync;
|
|
21
|
+
renameDirectoryNoReplacePathAsync: typeof renameDirectoryNoReplacePathAsync;
|
|
22
|
+
};
|
|
18
23
|
nativeQuarantineBindings?: () => NativeFileLockBindings;
|
|
19
24
|
};
|
|
20
25
|
/**
|
|
@@ -409,6 +409,12 @@ export declare class ModelRegistry {
|
|
|
409
409
|
* with case-sensitive exact strings.
|
|
410
410
|
*/
|
|
411
411
|
autoroutingProviderOrder(): readonly string[];
|
|
412
|
+
/**
|
|
413
|
+
* Provider priority for automatic model selection. Explicit provider order
|
|
414
|
+
* wins first, followed by omitted OAuth providers, then other providers;
|
|
415
|
+
* catalog order breaks ties within each policy band.
|
|
416
|
+
*/
|
|
417
|
+
automaticProviderOrder(sessionId?: string): readonly string[];
|
|
412
418
|
getCanonicalModels(options?: CanonicalModelQueryOptions): CanonicalModelRecord[];
|
|
413
419
|
/**
|
|
414
420
|
* Batch form of {@link resolveCanonicalModel} over every canonical record:
|
|
@@ -219,6 +219,12 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
219
219
|
readonly description: "Hard maximum runtime for an SDK prompt from acceptance, bounding progress-aware renewals.";
|
|
220
220
|
readonly validate: (value: number) => boolean;
|
|
221
221
|
};
|
|
222
|
+
readonly "sdk.masterOrphanGraceMs": {
|
|
223
|
+
readonly type: "number";
|
|
224
|
+
readonly default: 120000;
|
|
225
|
+
readonly description: "Grace period before a master-spawned child orphaned by confirmed master loss is closed.";
|
|
226
|
+
readonly validate: (value: number) => boolean;
|
|
227
|
+
};
|
|
222
228
|
readonly "notifications.enabled": {
|
|
223
229
|
readonly type: "boolean";
|
|
224
230
|
readonly default: false;
|
|
@@ -604,7 +610,7 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
604
610
|
};
|
|
605
611
|
readonly "ui.language": {
|
|
606
612
|
readonly type: "enum";
|
|
607
|
-
readonly values: readonly ["en", "ko", "ja"];
|
|
613
|
+
readonly values: readonly ["en", "ko", "zh", "ja"];
|
|
608
614
|
readonly default: "en";
|
|
609
615
|
readonly ui: {
|
|
610
616
|
readonly tab: "appearance";
|
|
@@ -616,6 +622,9 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
616
622
|
}, {
|
|
617
623
|
readonly value: "ko";
|
|
618
624
|
readonly label: "Korean (한국어)";
|
|
625
|
+
}, {
|
|
626
|
+
readonly value: "zh";
|
|
627
|
+
readonly label: "Chinese (简体中文)";
|
|
619
628
|
}, {
|
|
620
629
|
readonly value: "ja";
|
|
621
630
|
readonly label: "Japanese (日本語)";
|
|
@@ -145,6 +145,8 @@ export declare class Settings implements NotificationSettingsReader {
|
|
|
145
145
|
onChanged(listener: (path: SettingPath) => void): () => void;
|
|
146
146
|
/** Whether durable settings mutations are permitted for the loaded configuration. */
|
|
147
147
|
canWriteDurableConfig(): boolean;
|
|
148
|
+
/** Whether this instance can publish a mutation to a durable config file. */
|
|
149
|
+
canPersistDurableConfig(): boolean;
|
|
148
150
|
/**
|
|
149
151
|
* Set a setting value (sync).
|
|
150
152
|
* Updates global settings and reserves its background persistence slot before
|
|
@@ -4,6 +4,8 @@ export declare const ProjectionScanTestHooks: {
|
|
|
4
4
|
};
|
|
5
5
|
/** Post-filter parse-candidate cap. Exhaustion returns an explicit incomplete result. */
|
|
6
6
|
export declare const COORDINATOR_JSON_SCAN_CAP = 10000;
|
|
7
|
+
/** Number of fresh authoritative attempts allowed for a scan that observed churn. */
|
|
8
|
+
export declare const COORDINATOR_JSON_SCAN_RETRY_ATTEMPTS = 3;
|
|
7
9
|
export interface ProjectionScanStat {
|
|
8
10
|
size: number | bigint;
|
|
9
11
|
dev?: number | bigint;
|
|
@@ -44,3 +46,9 @@ export interface ProjectionScanResult {
|
|
|
44
46
|
}
|
|
45
47
|
export declare function isCoordinatorScanDebrisName(name: string): boolean;
|
|
46
48
|
export declare function listCoordinatorJsonFiles(dir: string, io?: ProjectionScanFs, cap?: number): Promise<ProjectionScanResult>;
|
|
49
|
+
/**
|
|
50
|
+
* Retry only scans invalidated by observed directory/file churn. A candidate cap,
|
|
51
|
+
* unsupported authority, parse error, or any other failure remains fail-closed.
|
|
52
|
+
* Each attempt acquires a new authority, so no partial result crosses attempts.
|
|
53
|
+
*/
|
|
54
|
+
export declare function listCoordinatorJsonFilesWithRetry(dir: string, io?: ProjectionScanFs, cap?: number, maxAttempts?: number): Promise<ProjectionScanResult>;
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Crash-log record recovery.
|
|
3
|
+
*
|
|
4
|
+
* The crash log is an append-only text file written by concurrent processes; it
|
|
5
|
+
* is explicitly **not** a parseable database. The field corpus contains at least
|
|
6
|
+
* one interleaved record (two headers merged onto one line), and throwable text
|
|
7
|
+
* is arbitrary multiline content. Recovery therefore trusts only a complete
|
|
8
|
+
* v1 record whose terminal identity line matches a fingerprint recomputed from
|
|
9
|
+
* that record's own header and stack.
|
|
10
|
+
*
|
|
11
|
+
* Records written before that line existed are `unmatchable` and are never
|
|
12
|
+
* offered for reporting — no retroactive mining is attempted or claimed.
|
|
13
|
+
*/
|
|
14
|
+
import { type CrashProvenance } from "@gajae-code/utils";
|
|
1
15
|
export interface LoadedCrashRecord {
|
|
2
16
|
readonly fingerprint: string;
|
|
3
17
|
readonly fpv: number;
|
|
@@ -9,6 +23,7 @@ export interface LoadedCrashRecord {
|
|
|
9
23
|
readonly body: string;
|
|
10
24
|
/** The `Name: message` part of the header line. */
|
|
11
25
|
readonly headline: string;
|
|
26
|
+
readonly provenance?: CrashProvenance;
|
|
12
27
|
}
|
|
13
28
|
export declare function parseCrashRecords(contents: string): LoadedCrashRecord[];
|
|
14
29
|
/** Complete v1 records whose marker fingerprint is recomputed from their diagnostic text. */
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-process reservation for a deterministic launch-worktree path.
|
|
3
|
+
*
|
|
4
|
+
* The durable session index is the long-lived ownership record, but a newly
|
|
5
|
+
* planned worktree has no index row yet. This reservation closes that interval:
|
|
6
|
+
* it is acquired before preparation and removed after `host_registered` is
|
|
7
|
+
* durably appended to the index.
|
|
8
|
+
*/
|
|
9
|
+
export interface LaunchWorktreeReservation {
|
|
10
|
+
release(): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
/** Test seam for seeding a dead-owner reservation at the exact production path. */
|
|
13
|
+
export declare function launchWorktreeReservationDirectoryForTest(agentDir: string, worktreePath: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Atomically claim `worktreePath`, returning `null` only when another live or
|
|
16
|
+
* unverified launch already owns the same deterministic target. A dead or
|
|
17
|
+
* PID-reused owner is reclaimed before retrying the exclusive directory create.
|
|
18
|
+
*/
|
|
19
|
+
export declare function reserveLaunchWorktree(agentDir: string, worktreePath: string): Promise<LaunchWorktreeReservation | null>;
|
|
20
|
+
/** Remove the transient reservation only after the matching worktree is indexed. */
|
|
21
|
+
export declare function releaseLaunchWorktreeReservationAfterRegistration(agentDir: string, worktreePath: string): Promise<void>;
|
|
@@ -6,6 +6,8 @@ export declare const MANAGED_OWNER_GENERATION_ENV = "GJC_TMUX_OWNER_GENERATION";
|
|
|
6
6
|
export declare const MANAGED_OWNER_STATE_DIR_ENV = "GJC_TMUX_OWNER_STATE_DIR";
|
|
7
7
|
export declare const MANAGED_OWNER_RUN_ID_ENV = "GJC_MANAGED_OWNER_RUN_ID";
|
|
8
8
|
export declare const MANAGED_OWNER_INCARNATION_ENV = "GJC_MANAGED_OWNER_INCARNATION";
|
|
9
|
+
/** Suppresses command-derived durable artifacts for Broker-owned opaque spawn children. */
|
|
10
|
+
export declare const MANAGED_OWNER_REDACT_COMMAND_ENV = "GJC_MANAGED_OWNER_REDACT_COMMAND";
|
|
9
11
|
export interface ManagedOwnerBinding {
|
|
10
12
|
schema_version: 2;
|
|
11
13
|
generation: string;
|
|
@@ -33,6 +33,13 @@ export declare const __sessionStateSidecarPerfCounters: {
|
|
|
33
33
|
persistFromEventCalls: number;
|
|
34
34
|
reset(): void;
|
|
35
35
|
};
|
|
36
|
+
/** Test-only barriers for deterministic rescope transaction race coverage. */
|
|
37
|
+
export declare const __sessionStateSidecarTestHooks: {
|
|
38
|
+
afterRescopeLocksAcquired?: () => void | Promise<void>;
|
|
39
|
+
beforeRescopeJournalWrite?: (cwd: string) => void | Promise<void>;
|
|
40
|
+
beforePersistFromEvent?: (eventType: string, cwd: string) => void | Promise<void>;
|
|
41
|
+
beforeRescopePublish?: () => void | Promise<void>;
|
|
42
|
+
};
|
|
36
43
|
interface RuntimeStateEvent {
|
|
37
44
|
type: string;
|
|
38
45
|
messages?: unknown[];
|
|
@@ -168,6 +175,12 @@ export interface RuntimeStateContext {
|
|
|
168
175
|
ownerTerminal?: OwnerTerminalContext | null;
|
|
169
176
|
/** Internal fail-closed marker set only when managed owner metadata is malformed or missing. */
|
|
170
177
|
ownerTerminalMetadataInvalid?: boolean;
|
|
178
|
+
/**
|
|
179
|
+
* The session file as it was BEFORE a committed rescope, used only by
|
|
180
|
+
* {@link relocateCoordinatorRuntimeStateForRescope} to authenticate the predecessor
|
|
181
|
+
* payload against its old identity. Absent outside a move.
|
|
182
|
+
*/
|
|
183
|
+
previousSessionFile?: string | null;
|
|
171
184
|
}
|
|
172
185
|
export type TerminalRuntimeStateStatus = {
|
|
173
186
|
terminal: true;
|
|
@@ -201,7 +214,59 @@ export declare function persistCoordinatorWorkerIntegrationOutcome(context: Runt
|
|
|
201
214
|
correlationId?: string;
|
|
202
215
|
error?: string;
|
|
203
216
|
}): Promise<void>;
|
|
217
|
+
export declare function prepareCoordinatorRuntimeStateRescope(input: {
|
|
218
|
+
moveId?: string;
|
|
219
|
+
sessionId: string;
|
|
220
|
+
previousCwd: string;
|
|
221
|
+
newCwd: string;
|
|
222
|
+
previousCwdIdentity?: {
|
|
223
|
+
dev: bigint;
|
|
224
|
+
ino: bigint;
|
|
225
|
+
};
|
|
226
|
+
newCwdIdentity?: {
|
|
227
|
+
dev: bigint;
|
|
228
|
+
ino: bigint;
|
|
229
|
+
};
|
|
230
|
+
previousSessionFile?: string | null;
|
|
231
|
+
newSessionFile?: string | null;
|
|
232
|
+
}): Promise<string>;
|
|
233
|
+
export declare function markCoordinatorRuntimeStateRescopePublishing(context: RuntimeStateContext, previousCwd: string, moveId: string): Promise<void>;
|
|
234
|
+
export declare function clearCoordinatorRuntimeStateRescope(context: RuntimeStateContext, expectedMoveId?: string, previousCwd?: string): Promise<void>;
|
|
235
|
+
/**
|
|
236
|
+
* Cheap synchronous probe for a pending rescope-recovery journal at this cwd. Sessions
|
|
237
|
+
* that never moved (the overwhelming majority) have none, so callers use this to avoid
|
|
238
|
+
* arming a startup-turn barrier for a no-op recovery \u2014 an armed barrier is not free even
|
|
239
|
+
* when it resolves immediately: it flips the session's startup gate from absent to present
|
|
240
|
+
* and reorders barrier-gated post-turn work.
|
|
241
|
+
*/
|
|
242
|
+
export declare function hasCoordinatorRuntimeStateRescopeJournal(context: RuntimeStateContext): boolean;
|
|
243
|
+
export declare function recoverCoordinatorRuntimeStateRescope(context: RuntimeStateContext): Promise<void>;
|
|
244
|
+
/**
|
|
245
|
+
* Repairs the coordinator-shared runtime state after a committed cwd rescope, for every
|
|
246
|
+
* move surface (`move_session`, TUI `/move`, SDK/ACP `session.cwd.move`) through the one
|
|
247
|
+
* shared {@link SessionManager.moveTo} seam.
|
|
248
|
+
*
|
|
249
|
+
* The identity fence in {@link assertPreviousRuntimeStateIdentity} rejects any write whose
|
|
250
|
+
* predecessor payload records a different cwd/workdir than the live session. A rescope
|
|
251
|
+
* changes the session cwd but leaves the predecessor payload pointing at the launch root,
|
|
252
|
+
* so every later persist for the session would be refused as a foreign marker.
|
|
253
|
+
*
|
|
254
|
+
* The predecessor is fully authenticated against its OLD identity before it is trusted:
|
|
255
|
+
* signed mode verifies the predecessor's key id and Ed25519 signature; unsigned mode
|
|
256
|
+
* requires an exact old cwd/workdir/session-file match (the same checks the fence applies).
|
|
257
|
+
* Only a predecessor that passes is rewritten to the new identity and re-signed. When the
|
|
258
|
+
* state file is cwd-derived rather than pinned by
|
|
259
|
+
* {@link GJC_COORDINATOR_SESSION_STATE_FILE_ENV}, the payload is migrated to the new path
|
|
260
|
+
* and the orphaned launch-root file is removed. A payload already self-healed at the new
|
|
261
|
+
* cwd is left untouched.
|
|
262
|
+
*
|
|
263
|
+
* Both the old and new cwd-derived paths are locked (new first, then old) so a concurrent
|
|
264
|
+
* writer at either path serializes behind this repair. Best-effort by contract: the move
|
|
265
|
+
* is already durable, so a failure here is logged by the caller and never resurfaced as a
|
|
266
|
+
* rescope rejection.
|
|
267
|
+
*/
|
|
268
|
+
export declare function relocateCoordinatorRuntimeStateForRescope(context: RuntimeStateContext, previousCwd: string): Promise<boolean>;
|
|
204
269
|
export declare function ownerTerminalContextFromEnvironment(): OwnerTerminalContext | "invalid" | null;
|
|
205
270
|
export declare function persistCoordinatorRuntimeStateFromPostmortem(reason: postmortem.Reason, context: RuntimeStateContext): Promise<void>;
|
|
206
|
-
export declare function registerCoordinatorRuntimeStateFinalizer(context: RuntimeStateContext): () => void;
|
|
271
|
+
export declare function registerCoordinatorRuntimeStateFinalizer(context: RuntimeStateContext, resolveContext?: () => RuntimeStateContext): () => void;
|
|
207
272
|
export {};
|
|
@@ -149,6 +149,7 @@ export interface TmuxOwnerIsolationExecutionDependencies {
|
|
|
149
149
|
spawn(argv: string[], stdinLine?: string): {
|
|
150
150
|
exitCode: number | null;
|
|
151
151
|
stdout?: string;
|
|
152
|
+
stderr?: string;
|
|
152
153
|
};
|
|
153
154
|
probeServer(socketKey: string): TmuxServerProof;
|
|
154
155
|
/** Reads the published owner generation immediately around direct execution. */
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import { type ProviderAuthority } from "./tmux-common";
|
|
2
2
|
import { type OwnerIsolationProbeSync, type OwnerVerdict, type PlanResponse, type TmuxOwnerIsolationExecutionDependencies, type TmuxOwnerIsolationExecutionResult } from "./tmux-owner-isolation";
|
|
3
|
+
export interface ManagedTmuxLaunchSpec {
|
|
4
|
+
childSessionId: string;
|
|
5
|
+
cwd: string;
|
|
6
|
+
argv: readonly string[];
|
|
7
|
+
env?: Readonly<Record<string, string>>;
|
|
8
|
+
}
|
|
9
|
+
export interface ManagedTmuxLaunchProof {
|
|
10
|
+
name: string;
|
|
11
|
+
nativeSessionId: string;
|
|
12
|
+
serverPid: number;
|
|
13
|
+
serverStartTime: string;
|
|
14
|
+
ownerGeneration: string;
|
|
15
|
+
sessionId: string;
|
|
16
|
+
sessionStateFile: string;
|
|
17
|
+
pid: number;
|
|
18
|
+
providerIdentity: string;
|
|
19
|
+
psmuxIncarnation?: string;
|
|
20
|
+
}
|
|
3
21
|
export interface GjcTmuxSessionStatus {
|
|
4
22
|
name: string;
|
|
5
23
|
attached: boolean;
|
|
@@ -73,9 +91,12 @@ export interface ForceCloseOwnerDependencies {
|
|
|
73
91
|
listPanePids(sessionName: string, env: NodeJS.ProcessEnv): number[];
|
|
74
92
|
/** Test/runtime seam for an exact owner-exit observer; durable validation remains authoritative. */
|
|
75
93
|
waitForOwnerExitVerdict?(): Promise<OwnerVerdict>;
|
|
94
|
+
/** Broker close pin; production callers use this to reject reused session identity. */
|
|
95
|
+
expectedManagedProof?: ManagedTmuxLaunchProof;
|
|
76
96
|
}
|
|
77
97
|
export interface CreateGjcTmuxSessionOptions {
|
|
78
98
|
platform?: NodeJS.Platform;
|
|
99
|
+
launch?: ManagedTmuxLaunchSpec;
|
|
79
100
|
}
|
|
80
101
|
export type CreateOwnerIsolationTestDependencies = {
|
|
81
102
|
probe?: Partial<OwnerIsolationProbeSync>;
|
|
@@ -93,6 +114,12 @@ export declare function findGjcTmuxSessionByName(sessionName: string, env?: Node
|
|
|
93
114
|
export declare function findGjcTmuxSessionByScope(project: string, branch: string | null | undefined, env?: NodeJS.ProcessEnv): GjcTmuxSessionStatus | undefined;
|
|
94
115
|
export declare function statusGjcTmuxSession(sessionName: string, env?: NodeJS.ProcessEnv): GjcTmuxSessionStatus;
|
|
95
116
|
export declare function createGjcTmuxSession(env?: NodeJS.ProcessEnv, options?: CreateGjcTmuxSessionOptions): GjcTmuxSessionStatus;
|
|
117
|
+
/** Launches one Broker-owned child through the managed owner path and returns only re-proof inputs. */
|
|
118
|
+
export declare function createManagedGjcTmuxSession(spec: ManagedTmuxLaunchSpec, env?: NodeJS.ProcessEnv, options?: Omit<CreateGjcTmuxSessionOptions, "launch">): ManagedTmuxLaunchProof;
|
|
119
|
+
/** Re-proves every mutable multiplexer identity field before a Broker effect. */
|
|
120
|
+
export declare function verifyManagedGjcTmuxSession(expected: ManagedTmuxLaunchProof, env?: NodeJS.ProcessEnv): "verified" | "mismatch" | "gone";
|
|
121
|
+
/** Closes only an identity that passes the same exhaustive verification used for replay and reaping. */
|
|
122
|
+
export declare function forceCloseManagedGjcTmuxSession(expected: ManagedTmuxLaunchProof, env?: NodeJS.ProcessEnv): Promise<GjcTmuxSessionStatus>;
|
|
96
123
|
/** Proves a managed reusable name still resolves to one immutable session on one server. */
|
|
97
124
|
export declare function proveGjcTmuxSessionMutationTarget(sessionName: string, env?: NodeJS.ProcessEnv, provisionalAuthority?: ProviderAuthority): ProvenTmuxSessionIdentity;
|
|
98
125
|
/** @internal */
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Args } from "../cli/args";
|
|
2
|
+
export type MasterScope = "repo" | "pwd" | "global";
|
|
3
|
+
/**
|
|
4
|
+
* Process-local master authority. Its capability accessor is deliberately the
|
|
5
|
+
* only way to reach the raw capability; this context is never serializable.
|
|
6
|
+
*/
|
|
7
|
+
export interface MasterModeContext {
|
|
8
|
+
readonly scope: MasterScope;
|
|
9
|
+
readonly ownerSessionId: string;
|
|
10
|
+
readonly attestationEpoch: string;
|
|
11
|
+
getCapability(): string;
|
|
12
|
+
}
|
|
13
|
+
export declare function createMasterModeContext(scope: MasterScope, ownerSessionId: string, attestationEpoch: string): MasterModeContext;
|
|
14
|
+
/** Reject routes that cannot establish an interactive, durable master session. */
|
|
15
|
+
export declare function assertMasterLaunchArgs(parsed: Args): void;
|
|
16
|
+
export declare function assertMasterLaunchDisposition(input: {
|
|
17
|
+
master: boolean | undefined;
|
|
18
|
+
isInteractive: boolean;
|
|
19
|
+
autoPrint: boolean;
|
|
20
|
+
nonInteractiveError?: string;
|
|
21
|
+
}): void;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { MasterScope } from "./context";
|
|
2
|
+
import { type MasterPeerSnapshotLifecycle } from "./snapshot";
|
|
3
|
+
export declare const MASTER_PEER_SNAPSHOT_CUSTOM_TYPE = "master-peer-snapshot";
|
|
4
|
+
/** The injected message shape consumed by the agent-session contributor seam. */
|
|
5
|
+
export interface MasterPeerSnapshotMessage {
|
|
6
|
+
customType: string;
|
|
7
|
+
content: string;
|
|
8
|
+
display: false;
|
|
9
|
+
attribution: "agent";
|
|
10
|
+
}
|
|
11
|
+
export interface MasterPeerSnapshotContributorInput {
|
|
12
|
+
readonly lifecycle: MasterPeerSnapshotLifecycle;
|
|
13
|
+
readonly ownerSessionId: string;
|
|
14
|
+
/** Current transcript/session identity; differs from ownerSessionId after a branch or switch. */
|
|
15
|
+
readonly getSessionId?: () => string;
|
|
16
|
+
readonly scope: MasterScope;
|
|
17
|
+
/** Live cwd accessor; resolved at injection time, not at registration. */
|
|
18
|
+
readonly getCwd: () => string;
|
|
19
|
+
/**
|
|
20
|
+
* Whether a prior injection was persisted to the session branch. A persisted
|
|
21
|
+
* block proves a first request was accepted, so later turns never duplicate
|
|
22
|
+
* it; a pre-accept cancellation persists nothing and the next attempt
|
|
23
|
+
* re-collects a fresh snapshot.
|
|
24
|
+
*/
|
|
25
|
+
readonly hasPersistedInjection: () => boolean;
|
|
26
|
+
readonly onError?: (error: unknown) => void;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Builds the one-shot before-agent-start contributor that injects the scoped,
|
|
30
|
+
* no-probe master peer snapshot immediately before the first accepted provider
|
|
31
|
+
* request. Idle masters never collect: the snapshot is gathered only when a
|
|
32
|
+
* prompt actually starts.
|
|
33
|
+
*/
|
|
34
|
+
export declare function createMasterPeerSnapshotContributor(input: MasterPeerSnapshotContributorInput): () => Promise<MasterPeerSnapshotMessage | undefined>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type ResolvedScopeV1, type ScopeNameV1, type ScopeRequestV1, type SdkSearchResultV1, type SdkSearchRowV1 } from "../sdk/broker/session-scope";
|
|
2
|
+
import type { SessionLifecycleActor, SessionListOutcome, SessionListRequest } from "../sdk/lifecycle/service";
|
|
3
|
+
export type MasterPeerSnapshot = {
|
|
4
|
+
readonly status: SdkSearchResultV1["status"];
|
|
5
|
+
readonly scope: ResolvedScopeV1;
|
|
6
|
+
readonly observedAt: string;
|
|
7
|
+
readonly indexSeq?: number;
|
|
8
|
+
readonly rows: readonly SdkSearchRowV1[];
|
|
9
|
+
readonly truncated?: boolean;
|
|
10
|
+
};
|
|
11
|
+
/** The scoped Broker surface needed for the one-time master peer snapshot. */
|
|
12
|
+
export interface MasterPeerSnapshotLifecycle {
|
|
13
|
+
list(request: Omit<SessionListRequest, "operation">): Promise<SessionListOutcome>;
|
|
14
|
+
}
|
|
15
|
+
export interface CollectMasterPeerSnapshotInput {
|
|
16
|
+
readonly lifecycle: MasterPeerSnapshotLifecycle;
|
|
17
|
+
readonly actor: SessionLifecycleActor;
|
|
18
|
+
readonly ownerSessionId: string;
|
|
19
|
+
readonly currentSessionId?: string;
|
|
20
|
+
readonly scope: ScopeNameV1;
|
|
21
|
+
readonly requestAnchor: ScopeRequestV1["requestAnchor"];
|
|
22
|
+
readonly timeoutMs?: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Collects the first-request peer snapshot through scoped Broker session.list.
|
|
26
|
+
* It deliberately has no Router or endpoint-probe dependency.
|
|
27
|
+
*/
|
|
28
|
+
export declare function collectMasterPeerSnapshot(input: CollectMasterPeerSnapshotInput): Promise<MasterPeerSnapshot>;
|
|
29
|
+
/** Escapes untrusted metadata before it is placed in fixed prompt framing. */
|
|
30
|
+
export declare function escapeMasterPeerSnapshotText(input: string): string;
|
|
31
|
+
/** Renders the fixed, escaped prompt block for one master peer observation. */
|
|
32
|
+
export declare function renderMasterPeerSnapshot(snapshot: MasterPeerSnapshot): string;
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { Container } from "@gajae-code/tui";
|
|
2
2
|
import type { OnboardingProfile } from "../../setup/frictionless-onboarding";
|
|
3
|
+
import { type UiLanguage } from "../ui-language";
|
|
4
|
+
export declare const UI_LANGUAGE_CHOICES: readonly {
|
|
5
|
+
value: UiLanguage;
|
|
6
|
+
label: string;
|
|
7
|
+
}[];
|
|
8
|
+
export declare class InterfaceLanguageSelectorComponent extends Container {
|
|
9
|
+
#private;
|
|
10
|
+
constructor(onSelect: (language: UiLanguage) => void, onCancel: () => void);
|
|
11
|
+
handleInput(keyData: string): void;
|
|
12
|
+
}
|
|
3
13
|
export type FrictionlessOnboardingAction = "analyze" | "apply" | "skip" | "later" | "manual" | "manual-migration" | "manual-learn";
|
|
4
14
|
export type FrictionlessOnboardingStage = "disclosure" | "manual" | "preview";
|
|
5
15
|
export interface FrictionlessOnboardingCopy {
|