@gajae-code/coding-agent 0.15.6 → 0.16.1
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 +99 -0
- package/dist/types/async/job-manager.d.ts +32 -1
- package/dist/types/browser-backend.d.ts +12 -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 +14 -0
- package/dist/types/cli.d.ts +7 -0
- package/dist/types/commands/launch.d.ts +10 -0
- package/dist/types/commands/sdk.d.ts +2 -0
- package/dist/types/config/autorouting-tier-map.d.ts +24 -0
- package/dist/types/config/billing-path.d.ts +25 -0
- package/dist/types/config/config-schema-version.d.ts +13 -1
- package/dist/types/config/file-lock.d.ts +5 -0
- package/dist/types/config/model-registry.d.ts +22 -0
- package/dist/types/config/settings-schema.d.ts +27 -8
- 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/extensibility/extensions/types.d.ts +8 -3
- package/dist/types/gjc-runtime/launch-worktree-reservation.d.ts +21 -0
- package/dist/types/gjc-runtime/launch-worktree.d.ts +25 -1
- package/dist/types/gjc-runtime/managed-owner-supervisor.d.ts +2 -0
- package/dist/types/gjc-runtime/session-state-lock.d.ts +22 -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/main.d.ts +1 -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/acp/acp-agent.d.ts +21 -21
- package/dist/types/modes/components/frictionless-onboarding-selector.d.ts +10 -0
- package/dist/types/modes/components/model-selector.d.ts +4 -0
- package/dist/types/modes/components/oauth-selector.d.ts +1 -0
- package/dist/types/modes/components/session-selector.d.ts +1 -1
- package/dist/types/modes/components/sessions-dashboard.d.ts +2 -1
- 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/interactive-mode.d.ts +16 -2
- package/dist/types/modes/print-mode.d.ts +17 -0
- package/dist/types/modes/theme/theme.d.ts +2 -1
- package/dist/types/modes/types.d.ts +2 -0
- package/dist/types/modes/ui-language.d.ts +7 -1
- package/dist/types/sdk/broker/broker.d.ts +79 -2
- package/dist/types/sdk/broker/endpoint-authority.d.ts +24 -0
- package/dist/types/sdk/broker/ensure.d.ts +3 -0
- package/dist/types/sdk/broker/index.d.ts +3 -0
- package/dist/types/sdk/broker/lifecycle-ledger.d.ts +6 -0
- package/dist/types/sdk/broker/lifecycle.d.ts +40 -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/startup-budget.d.ts +52 -0
- package/dist/types/sdk/broker/state-version.d.ts +21 -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/discord-daemon.d.ts +1 -1
- package/dist/types/sdk/bus/index.d.ts +9 -1
- package/dist/types/sdk/bus/kind-aware-reconciliation.d.ts +1 -1
- package/dist/types/sdk/bus/prompt-reconciliation.d.ts +1 -1
- package/dist/types/sdk/bus/slack-conversation.d.ts +1 -1
- package/dist/types/sdk/bus/slack-daemon.d.ts +1 -1
- 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 +12 -5
- package/dist/types/sdk/cli/session-cli.d.ts +20 -3
- 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/events.d.ts +1 -0
- package/dist/types/sdk/host/host.d.ts +10 -0
- package/dist/types/sdk/host/query/cursor.d.ts +4 -2
- package/dist/types/sdk/host/query/handlers.d.ts +1 -0
- package/dist/types/sdk/host/query/revision-store.d.ts +1 -0
- package/dist/types/sdk/host/session-runtime.d.ts +70 -17
- 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 +3 -1
- package/dist/types/sdk/prompt-deadline-manager.d.ts +2 -5
- package/dist/types/sdk/receipt-state.d.ts +2 -0
- package/dist/types/sdk/router/session-router.d.ts +6 -0
- package/dist/types/sdk/session.d.ts +16 -0
- package/dist/types/sdk/startup-capability.d.ts +2 -1
- package/dist/types/sdk/turn-result.d.ts +6 -0
- package/dist/types/session/agent-session.d.ts +52 -7
- package/dist/types/session/credential-store-errors.d.ts +1 -0
- package/dist/types/session/fold-coordinator.d.ts +29 -2
- package/dist/types/session/session-manager.d.ts +79 -2
- package/dist/types/session/yield-queue.d.ts +5 -4
- package/dist/types/setup/frictionless-onboarding.d.ts +1 -0
- package/dist/types/tools/ask.d.ts +1 -0
- package/dist/types/tools/bash.d.ts +16 -0
- package/dist/types/tools/browser/launch.d.ts +10 -0
- package/dist/types/tools/browser/registry.d.ts +8 -0
- package/dist/types/tools/gh.d.ts +8 -0
- package/dist/types/tools/index.d.ts +10 -10
- package/dist/types/tools/job.d.ts +3 -1
- package/dist/types/utils/external-editor.d.ts +7 -0
- package/examples/extensions/README.md +1 -1
- package/examples/extensions/pirate.ts +7 -4
- package/package.json +7 -7
- package/scripts/generate-sdk-operation-inventory.ts +13 -1
- package/scripts/verify-gjc-sdk-canonicalization.ts +35 -1
- package/src/async/job-manager.ts +107 -9
- package/src/browser-backend.ts +29 -0
- 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/plugin-cli.ts +29 -0
- package/src/cli/root-flags.ts +5 -0
- package/src/cli/update-cli.ts +140 -23
- package/src/commands/launch.ts +86 -18
- package/src/commands/sdk.ts +135 -28
- package/src/config/autorouting-tier-map.ts +12 -0
- package/src/config/billing-path.ts +42 -0
- package/src/config/config-schema-version.ts +18 -1
- package/src/config/file-lock.ts +158 -83
- package/src/config/model-preset-registry.ts +178 -23
- package/src/config/model-profiles.ts +5 -5
- package/src/config/model-registry.ts +291 -42
- package/src/config/model-resolver.ts +5 -0
- package/src/config/settings-schema.ts +27 -8
- package/src/config/settings.ts +51 -15
- package/src/coordinator-mcp/projection-scan.ts +27 -6
- package/src/coordinator-mcp/question-state.ts +9 -11
- package/src/coordinator-mcp/server.ts +115 -21
- package/src/crash/index-store.ts +2 -0
- package/src/crash/record-loader.ts +10 -0
- package/src/defaults/gjc/skills/deep-interview/SKILL.md +1 -1
- package/src/extensibility/extensions/runner.ts +27 -0
- package/src/extensibility/extensions/types.ts +8 -3
- package/src/extensibility/gjc-plugins/installer.ts +51 -11
- package/src/extensibility/runtime-skill-discovery.ts +110 -3
- package/src/extensibility/skills.ts +22 -12
- package/src/gjc-runtime/launch-worktree-reservation.ts +242 -0
- package/src/gjc-runtime/launch-worktree.ts +285 -4
- package/src/gjc-runtime/managed-owner-supervisor.ts +63 -51
- package/src/gjc-runtime/session-state-lock.ts +213 -14
- package/src/gjc-runtime/session-state-sidecar.ts +938 -39
- package/src/gjc-runtime/tmux-owner-isolation-cli.ts +4 -7
- package/src/gjc-runtime/tmux-owner-isolation.ts +18 -3
- 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 +15 -15
- package/src/internal-urls/issue-pr-protocol.ts +4 -2
- package/src/main.ts +61 -3
- 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 +610 -161
- package/src/modes/components/footer.ts +4 -2
- package/src/modes/components/frictionless-onboarding-selector.ts +48 -2
- package/src/modes/components/model-selector.ts +76 -8
- package/src/modes/components/oauth-selector.ts +6 -1
- package/src/modes/components/session-selector.ts +23 -15
- package/src/modes/components/sessions-dashboard.ts +8 -5
- 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/command-controller.ts +1 -1
- package/src/modes/controllers/event-controller.ts +30 -4
- package/src/modes/controllers/extension-ui-controller.ts +13 -13
- package/src/modes/controllers/input-controller.ts +30 -2
- package/src/modes/controllers/selector-controller.ts +200 -98
- package/src/modes/interactive-mode.ts +36 -12
- package/src/modes/print-mode.ts +64 -0
- package/src/modes/prompt-action-autocomplete.ts +30 -4
- package/src/modes/runtime-init.ts +12 -9
- package/src/modes/theme/theme.ts +5 -0
- package/src/modes/types.ts +2 -0
- package/src/modes/ui-language.ts +49 -2
- package/src/modes/utils/ui-helpers.ts +22 -3
- package/src/prompts/agent-fragments/browser-aside.md +22 -0
- package/src/prompts/system/master-mode.md +28 -0
- package/src/prompts/tools/ask.md +1 -1
- package/src/prompts/tools/bash.md +1 -0
- package/src/prompts/tools/job.md +1 -1
- package/src/sdk/acp/adapter.ts +5 -0
- package/src/sdk/broker/broker.ts +1646 -27
- package/src/sdk/broker/endpoint-authority.ts +86 -0
- package/src/sdk/broker/ensure.ts +81 -3
- package/src/sdk/broker/index.ts +3 -0
- package/src/sdk/broker/lifecycle-ledger.ts +6 -0
- package/src/sdk/broker/lifecycle.ts +440 -75
- 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 +591 -0
- package/src/sdk/broker/startup-budget.ts +144 -2
- package/src/sdk/broker/state-version.ts +43 -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 +136 -18
- package/src/sdk/bus/discord-daemon.ts +50 -10
- package/src/sdk/bus/index.ts +84 -7
- package/src/sdk/bus/kind-aware-reconciliation.ts +296 -48
- package/src/sdk/bus/lifecycle-commands.ts +4 -0
- package/src/sdk/bus/notification-service.ts +22 -5
- package/src/sdk/bus/prompt-reconciliation.ts +7 -2
- package/src/sdk/bus/reconciliation-store.ts +55 -31
- package/src/sdk/bus/slack-conversation.ts +1 -1
- package/src/sdk/bus/slack-daemon.ts +72 -38
- 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 +41 -15
- package/src/sdk/cli/session-cli.ts +297 -26
- package/src/sdk/client/client.ts +14 -8
- package/src/sdk/host/control/dispatch.ts +101 -40
- 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/events.ts +1 -0
- package/src/sdk/host/host.ts +29 -2
- package/src/sdk/host/query/cursor.ts +52 -7
- package/src/sdk/host/query/handlers.ts +33 -12
- package/src/sdk/host/query/revision-store.ts +12 -0
- package/src/sdk/host/session-runtime.test.ts +673 -14
- package/src/sdk/host/session-runtime.ts +674 -103
- package/src/sdk/host/surface-policy.ts +3 -3
- package/src/sdk/lifecycle/broker-client.ts +28 -0
- package/src/sdk/lifecycle/service.ts +279 -20
- package/src/sdk/lifecycle-session.ts +17 -4
- package/src/sdk/prompt-deadline-manager.ts +2 -1
- package/src/sdk/protocol/operation-inventory.generated.json +105 -3
- package/src/sdk/protocol/operation-registry.ts +14 -4
- package/src/sdk/receipt-state.ts +10 -0
- package/src/sdk/router/session-router.ts +219 -118
- package/src/sdk/session.ts +416 -195
- package/src/sdk/startup-capability.ts +1 -0
- package/src/sdk/turn-result.ts +22 -0
- package/src/session/agent-session.ts +1628 -318
- package/src/session/blob-store.ts +15 -5
- package/src/session/credential-store-errors.ts +2 -0
- package/src/session/fold-coordinator.ts +40 -3
- package/src/session/internal/managed-session-storage.ts +153 -78
- package/src/session/session-manager.ts +850 -97
- package/src/session/yield-queue.ts +24 -10
- package/src/setup/frictionless-onboarding.ts +2 -0
- package/src/slash-commands/builtin-registry.ts +41 -0
- package/src/task/executor.ts +9 -4
- package/src/telemetry/events.ts +1138 -12
- package/src/tools/ask-contract.test.ts +64 -0
- package/src/tools/ask-contract.ts +36 -1
- package/src/tools/ask.ts +10 -8
- package/src/tools/bash-interactive.ts +11 -2
- package/src/tools/bash.ts +412 -75
- package/src/tools/browser/launch.ts +37 -0
- package/src/tools/browser/registry.ts +99 -9
- package/src/tools/cron.ts +6 -4
- package/src/tools/descriptors.test.ts +15 -0
- package/src/tools/descriptors.ts +5 -1
- package/src/tools/gh.ts +104 -48
- package/src/tools/github-cache.ts +2 -2
- package/src/tools/index.ts +10 -6
- package/src/tools/job.ts +4 -1
- package/src/tools/monitor.ts +12 -9
- package/src/tools/resolve.ts +30 -10
- package/src/tools/tool-catalog.generated.ts +2 -2
- package/src/utils/external-editor.ts +72 -1
|
@@ -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. */
|
|
@@ -14,6 +14,7 @@ import type { Api, AssistantMessageEvent, AssistantMessageEventStream, Context,
|
|
|
14
14
|
import type { OAuthCredentials, OAuthLoginCallbacks } from "@gajae-code/ai/utils/oauth/types";
|
|
15
15
|
import type * as piCodingAgent from "@gajae-code/coding-agent";
|
|
16
16
|
import type { AutocompleteItem, Component, EditorTheme, KeyId, TUI } from "@gajae-code/tui";
|
|
17
|
+
import type { JobFoldEvent } from "../../async/job-manager";
|
|
17
18
|
import type { KeybindingsManager } from "../../config/keybindings";
|
|
18
19
|
import type { ModelRegistry } from "../../config/model-registry";
|
|
19
20
|
import type { ModelSelectorValue } from "../../config/model-selector-value";
|
|
@@ -319,7 +320,7 @@ export interface ExtensionContext {
|
|
|
319
320
|
/** Run a control-surface mutation inside the session admission boundary. */
|
|
320
321
|
withSdkControlMutation?<T>(body: () => Promise<T>): Promise<T>;
|
|
321
322
|
cycleThinkingLevel(): ThinkingLevel | undefined;
|
|
322
|
-
setQueueMode(kind: "steering" | "follow_up" | "
|
|
323
|
+
setQueueMode(kind: "steering" | "follow_up" | "tool_interrupt", mode: unknown): boolean;
|
|
323
324
|
getSkillState(): unknown;
|
|
324
325
|
getConfigItems(): unknown;
|
|
325
326
|
getBranchCandidates(): unknown;
|
|
@@ -333,6 +334,8 @@ export interface ExtensionContext {
|
|
|
333
334
|
totalBytes: number;
|
|
334
335
|
} | undefined>;
|
|
335
336
|
getJobs(): unknown;
|
|
337
|
+
/** Subscribe to foreground-wait folds (`bash_folded`). Returns an unsubscribe function. */
|
|
338
|
+
onJobFold?(listener: (event: JobFoldEvent) => void): () => void;
|
|
336
339
|
/** Typed skill and mode controls exposed to the SDK host. */
|
|
337
340
|
invokeSkill?(name: string, args?: string, options?: {
|
|
338
341
|
onPreflightAccepted?: () => void;
|
|
@@ -722,7 +725,7 @@ export interface UserPythonEventResult {
|
|
|
722
725
|
export type { ToolResultEventResult } from "../shared-events";
|
|
723
726
|
export interface BeforeAgentStartEventResult {
|
|
724
727
|
message?: Pick<CustomMessage, "customType" | "content" | "display" | "details" | "attribution">;
|
|
725
|
-
/** Replace the system prompt for this turn.
|
|
728
|
+
/** Replace the system prompt for this turn. To append, spread event.systemPrompt into the returned array. */
|
|
726
729
|
systemPrompt?: string[];
|
|
727
730
|
}
|
|
728
731
|
export type { SessionBeforeBranchResult, SessionBeforeCompactResult, SessionBeforeSwitchResult, SessionBeforeTreeResult, SessionCompactingResult, } from "../shared-events";
|
|
@@ -1138,7 +1141,7 @@ export interface ExtensionContextActions {
|
|
|
1138
1141
|
getActiveModelProfile?: () => string | undefined;
|
|
1139
1142
|
withSdkControlMutation?: <T>(body: () => Promise<T>) => Promise<T>;
|
|
1140
1143
|
cycleThinkingLevel?: () => ThinkingLevel | undefined;
|
|
1141
|
-
setQueueMode?: (kind: "steering" | "follow_up" | "
|
|
1144
|
+
setQueueMode?: (kind: "steering" | "follow_up" | "tool_interrupt", mode: unknown) => boolean;
|
|
1142
1145
|
getSkillState?: () => unknown;
|
|
1143
1146
|
getConfigItems?: () => unknown;
|
|
1144
1147
|
getBranchCandidates?: () => unknown;
|
|
@@ -1152,6 +1155,8 @@ export interface ExtensionContextActions {
|
|
|
1152
1155
|
totalBytes: number;
|
|
1153
1156
|
} | undefined>;
|
|
1154
1157
|
getJobs?: () => unknown;
|
|
1158
|
+
/** Subscribe to foreground-wait folds so the SDK host can publish `bash_folded`. Returns an unsubscribe. */
|
|
1159
|
+
onJobFold?: (listener: (event: JobFoldEvent) => void) => () => void;
|
|
1155
1160
|
setSdkPermissionProvider?: (provider: ((toolCall: ClientBridgePermissionToolCall, options: ClientBridgePermissionOption[], signal?: AbortSignal) => Promise<ClientBridgePermissionOutcome>) | undefined) => void;
|
|
1156
1161
|
setSdkClientBridge?: (bridge: ClientBridge | undefined) => void;
|
|
1157
1162
|
sdkControl?: (operation: string, input: Record<string, unknown>) => unknown | Promise<unknown>;
|
|
@@ -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>;
|
|
@@ -28,6 +28,19 @@ export interface GjcLaunchWorktreeResult extends GjcLaunchWorktreePlan {
|
|
|
28
28
|
createdBranch: boolean;
|
|
29
29
|
dirty?: boolean;
|
|
30
30
|
}
|
|
31
|
+
export interface LaunchWorktreeAbortOptions {
|
|
32
|
+
signal?: AbortSignal;
|
|
33
|
+
deadlineAt?: number;
|
|
34
|
+
now?: () => number;
|
|
35
|
+
}
|
|
36
|
+
export declare class WorktreePreparationTimeoutError extends Error {
|
|
37
|
+
readonly code = "worktree_preparation_timeout";
|
|
38
|
+
constructor(message?: string);
|
|
39
|
+
}
|
|
40
|
+
export declare class DependencyPreparationTimeoutError extends Error {
|
|
41
|
+
readonly code = "dependency_preparation_timeout";
|
|
42
|
+
constructor(message?: string);
|
|
43
|
+
}
|
|
31
44
|
/**
|
|
32
45
|
* Pure core of {@link resolveWorktreeBucket}, exported for tests.
|
|
33
46
|
*
|
|
@@ -41,11 +54,17 @@ export declare function planLaunchWorktree(cwd: string, mode: GjcLaunchWorktreeM
|
|
|
41
54
|
};
|
|
42
55
|
export declare function ensureLaunchWorktree(plan: GjcLaunchWorktreePlan | {
|
|
43
56
|
enabled: false;
|
|
44
|
-
}): GjcLaunchWorktreeResult | {
|
|
57
|
+
}, options?: LaunchWorktreeAbortOptions): GjcLaunchWorktreeResult | {
|
|
45
58
|
enabled: false;
|
|
46
59
|
};
|
|
60
|
+
export declare function ensureLaunchWorktreeCancellable(plan: GjcLaunchWorktreePlan | {
|
|
61
|
+
enabled: false;
|
|
62
|
+
}, options?: LaunchWorktreeAbortOptions): Promise<GjcLaunchWorktreeResult | {
|
|
63
|
+
enabled: false;
|
|
64
|
+
}>;
|
|
47
65
|
/** Workspace worktrees must own their complete lockfile-resolved dependency graph (#4620). */
|
|
48
66
|
export declare function ensureReusableNodeModules(sourceRoot: string, worktreePath: string): "symlink" | "present" | "missing";
|
|
67
|
+
export declare function ensureReusableNodeModulesCancellable(sourceRoot: string, worktreePath: string, options?: LaunchWorktreeAbortOptions): Promise<"symlink" | "present" | "missing">;
|
|
49
68
|
/** Result of {@link prepareLaunchWorktree}: the effective working directory, remaining args, and resolved worktree plan. */
|
|
50
69
|
export interface PreparedLaunchWorktree {
|
|
51
70
|
cwd: string;
|
|
@@ -55,3 +74,8 @@ export interface PreparedLaunchWorktree {
|
|
|
55
74
|
};
|
|
56
75
|
}
|
|
57
76
|
export declare function prepareLaunchWorktree(cwd: string, args: string[]): PreparedLaunchWorktree;
|
|
77
|
+
export declare function removeOwnedLaunchWorktree(plan: GjcLaunchWorktreePlan, receipt: {
|
|
78
|
+
created: boolean;
|
|
79
|
+
reused: boolean;
|
|
80
|
+
createdBranch: boolean;
|
|
81
|
+
}): 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;
|
|
@@ -83,6 +83,8 @@ export declare const SessionStateLockTestHooks: {
|
|
|
83
83
|
forcedQuarantineName?: string;
|
|
84
84
|
/** @internal Observes bounded acquisition retries without changing their timing. */
|
|
85
85
|
afterAcquireContention?: (lockFile: string, attempt: number, elapsedMs: number) => void;
|
|
86
|
+
/** @internal Runs after transition mkdir contention and before stale-claim inspection. */
|
|
87
|
+
afterTransitionClaimContention?: (transitionDir: string) => void | Promise<void>;
|
|
86
88
|
};
|
|
87
89
|
/** Raised when the lock could not be acquired; callers map it to their own refusal. */
|
|
88
90
|
export type SessionStateLockUnavailableReason = "acquire_timeout" | "legacy_directory_owner_unprovenanced" | "lock_initialization_failed" | "lock_inspection_failed" | "lock_owner_live_or_unverifiable" | "lock_owner_record_fresh" | "lock_owner_record_unprovenanced" | "lock_release_failed" | "transition_claim_timeout" | "unsafe_lock_path_type";
|
|
@@ -100,6 +102,26 @@ export declare class SessionStateLockUnavailableError extends Error {
|
|
|
100
102
|
readonly elapsedMs?: number;
|
|
101
103
|
constructor(causeOrDetails?: unknown | SessionStateLockUnavailableDetails);
|
|
102
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* Log fields describing a persist failure: the error text plus, when a session state
|
|
107
|
+
* lock refusal sits anywhere in the cause chain, its typed `reason` and `lockPath`.
|
|
108
|
+
* Wrapping errors (`PreviousRuntimeStateReadError`, `AggregateError`) are searched
|
|
109
|
+
* so the actionable detail is never buried behind a generic message.
|
|
110
|
+
*/
|
|
111
|
+
export declare function sessionStateLockFailureFields(error: unknown): {
|
|
112
|
+
error: string;
|
|
113
|
+
reason?: SessionStateLockUnavailableReason;
|
|
114
|
+
lockPath?: string;
|
|
115
|
+
};
|
|
116
|
+
export declare const PERSIST_FAILURE_WARN_WINDOW_MS = 30000;
|
|
117
|
+
/**
|
|
118
|
+
* Whether a persist failure should be logged at warn level. The first failure for each
|
|
119
|
+
* document and stable failure class in a 30s window warns; repeats are the caller's cue
|
|
120
|
+
* to log at debug instead.
|
|
121
|
+
*/
|
|
122
|
+
export declare function shouldWarnPersistFailure(key: string, error: unknown, now?: number): boolean;
|
|
123
|
+
/** @internal Test seam: forget every persist-failure warn window. */
|
|
124
|
+
export declare function resetPersistFailureWarnWindows(): void;
|
|
103
125
|
/**
|
|
104
126
|
* The identity-bound deletion primitives this lock is built on.
|
|
105
127
|
*
|
|
@@ -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 */
|
package/dist/types/main.d.ts
CHANGED
|
@@ -58,6 +58,7 @@ type StartupModelProfileArgs = {
|
|
|
58
58
|
startupModel?: CreateAgentSessionOptions["model"];
|
|
59
59
|
startupThinkingLevel?: CreateAgentSessionOptions["thinkingLevel"];
|
|
60
60
|
preferCachedModels?: boolean;
|
|
61
|
+
preferCachedDefaultProfile?: boolean;
|
|
61
62
|
};
|
|
62
63
|
export declare function applyStartupModelProfiles(args: StartupModelProfileArgs): Promise<void>;
|
|
63
64
|
export declare function applyStartupModelProfilesOrExit(args: StartupModelProfileArgs): Promise<void>;
|
|
@@ -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;
|
|
@@ -123,11 +123,11 @@ export declare function acpSessionStateFromConfig(query: unknown, modelCatalogQu
|
|
|
123
123
|
readonly value: "one-at-a-time";
|
|
124
124
|
readonly name: "One at a time";
|
|
125
125
|
} | {
|
|
126
|
-
readonly value: "
|
|
127
|
-
readonly name: "
|
|
126
|
+
readonly value: "abort_tools";
|
|
127
|
+
readonly name: "Abort running tools";
|
|
128
128
|
} | {
|
|
129
|
-
readonly value: "
|
|
130
|
-
readonly name: "
|
|
129
|
+
readonly value: "finish_tools";
|
|
130
|
+
readonly name: "Finish running tools";
|
|
131
131
|
})[];
|
|
132
132
|
} | {
|
|
133
133
|
id: "thinking";
|
|
@@ -151,11 +151,11 @@ export declare function acpSessionStateFromConfig(query: unknown, modelCatalogQu
|
|
|
151
151
|
readonly value: "one-at-a-time";
|
|
152
152
|
readonly name: "One at a time";
|
|
153
153
|
} | {
|
|
154
|
-
readonly value: "
|
|
155
|
-
readonly name: "
|
|
154
|
+
readonly value: "abort_tools";
|
|
155
|
+
readonly name: "Abort running tools";
|
|
156
156
|
} | {
|
|
157
|
-
readonly value: "
|
|
158
|
-
readonly name: "
|
|
157
|
+
readonly value: "finish_tools";
|
|
158
|
+
readonly name: "Finish running tools";
|
|
159
159
|
})[];
|
|
160
160
|
} | {
|
|
161
161
|
id: "steeringMode";
|
|
@@ -178,11 +178,11 @@ export declare function acpSessionStateFromConfig(query: unknown, modelCatalogQu
|
|
|
178
178
|
readonly value: "one-at-a-time";
|
|
179
179
|
readonly name: "One at a time";
|
|
180
180
|
} | {
|
|
181
|
-
readonly value: "
|
|
182
|
-
readonly name: "
|
|
181
|
+
readonly value: "abort_tools";
|
|
182
|
+
readonly name: "Abort running tools";
|
|
183
183
|
} | {
|
|
184
|
-
readonly value: "
|
|
185
|
-
readonly name: "
|
|
184
|
+
readonly value: "finish_tools";
|
|
185
|
+
readonly name: "Finish running tools";
|
|
186
186
|
})[];
|
|
187
187
|
} | {
|
|
188
188
|
id: "followUpMode";
|
|
@@ -205,14 +205,14 @@ export declare function acpSessionStateFromConfig(query: unknown, modelCatalogQu
|
|
|
205
205
|
readonly value: "one-at-a-time";
|
|
206
206
|
readonly name: "One at a time";
|
|
207
207
|
} | {
|
|
208
|
-
readonly value: "
|
|
209
|
-
readonly name: "
|
|
208
|
+
readonly value: "abort_tools";
|
|
209
|
+
readonly name: "Abort running tools";
|
|
210
210
|
} | {
|
|
211
|
-
readonly value: "
|
|
212
|
-
readonly name: "
|
|
211
|
+
readonly value: "finish_tools";
|
|
212
|
+
readonly name: "Finish running tools";
|
|
213
213
|
})[];
|
|
214
214
|
} | {
|
|
215
|
-
id: "
|
|
215
|
+
id: "toolInterruptPolicy";
|
|
216
216
|
name: string;
|
|
217
217
|
type: "select";
|
|
218
218
|
currentValue: string;
|
|
@@ -232,11 +232,11 @@ export declare function acpSessionStateFromConfig(query: unknown, modelCatalogQu
|
|
|
232
232
|
readonly value: "one-at-a-time";
|
|
233
233
|
readonly name: "One at a time";
|
|
234
234
|
} | {
|
|
235
|
-
readonly value: "
|
|
236
|
-
readonly name: "
|
|
235
|
+
readonly value: "abort_tools";
|
|
236
|
+
readonly name: "Abort running tools";
|
|
237
237
|
} | {
|
|
238
|
-
readonly value: "
|
|
239
|
-
readonly name: "
|
|
238
|
+
readonly value: "finish_tools";
|
|
239
|
+
readonly name: "Finish running tools";
|
|
240
240
|
})[];
|
|
241
241
|
})[];
|
|
242
242
|
modes: {
|
|
@@ -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 {
|
|
@@ -58,6 +58,10 @@ export declare class ModelSelectorComponent extends Container {
|
|
|
58
58
|
smartRoutingPreview?: (draft: AutoroutingSetup) => SmartRoutingPreview;
|
|
59
59
|
/** Open the smart-routing panel directly instead of the preset landing. */
|
|
60
60
|
smartRoutingOnly?: boolean;
|
|
61
|
+
/** Test seam: synchronous persisted-dismissal check to avoid async render churn. */
|
|
62
|
+
isBillingDismissed?: (key: string) => boolean;
|
|
63
|
+
/** Test seam: record that a billing notice was shown/dismissed. */
|
|
64
|
+
markBillingDismissed?: (key: string) => void;
|
|
61
65
|
});
|
|
62
66
|
dispose(): void;
|
|
63
67
|
refreshRoleAssignments(options?: {
|
|
@@ -14,6 +14,7 @@ export declare class OAuthSelectorComponent extends Container {
|
|
|
14
14
|
#private;
|
|
15
15
|
constructor(mode: "login" | "logout", authStorage: AuthStorage, onSelect: (providerId: string) => void, onCancel: () => void, options?: {
|
|
16
16
|
validateAuth?: (providerId: string) => Promise<boolean>;
|
|
17
|
+
onValidationError?: (error: unknown) => boolean;
|
|
17
18
|
requestRender?: () => void;
|
|
18
19
|
externalCredentialCandidates?: ImportableCredential[];
|
|
19
20
|
} & Partial<OAuthSelectorAccountOptions>);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Component, Container } from "@gajae-code/tui";
|
|
2
|
-
import type
|
|
2
|
+
import { type ResumeSessionIdentity, type ResumeTailInspection, type SessionInfo } from "../../session/session-manager";
|
|
3
3
|
export interface SelectedSession {
|
|
4
4
|
kind: "selected";
|
|
5
5
|
path: string;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Container } from "@gajae-code/tui";
|
|
2
|
-
import type
|
|
2
|
+
import { type SessionInfo } from "../../session/session-manager";
|
|
3
3
|
export type SessionLiveness = "active" | "stale" | "unknown";
|
|
4
4
|
export interface DashboardSession {
|
|
5
5
|
id: string;
|
|
6
6
|
cwd: string;
|
|
7
7
|
title: string;
|
|
8
|
+
starred: boolean;
|
|
8
9
|
modified: Date;
|
|
9
10
|
messageCount: number;
|
|
10
11
|
messageCountIsEstimate?: boolean;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shortest recognizable model label, derived purely from the model id.
|
|
3
|
+
*
|
|
4
|
+
* The rail and the footer both render this form, so a narrow terminal spends
|
|
5
|
+
* its cells on the part of the id that actually identifies the model:
|
|
6
|
+
*
|
|
7
|
+
* `anthropic/claude-sonnet-4-5-20250929` -> `sonnet-4.5`
|
|
8
|
+
* `openai/gpt-4o-2024-05-13` -> `gpt-4o`
|
|
9
|
+
* `google/gemini-3-pro` -> `gemini-3-pro`
|
|
10
|
+
* `qwen2.5:7b` -> `qwen2.5:7b`
|
|
11
|
+
*
|
|
12
|
+
* Deliberately a pure heuristic with no curated override table: every provider
|
|
13
|
+
* in `models.json` must degrade sanely without per-model maintenance. The
|
|
14
|
+
* function never returns an empty string — an id that the heuristic would
|
|
15
|
+
* strip to nothing falls back to the previous, longer form.
|
|
16
|
+
*/
|
|
17
|
+
export declare const NO_MODEL_LABEL = "no-model";
|
|
18
|
+
export declare function shortenModelId(rawId: string | undefined | null): string;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Narrow-width survival row for the status rail.
|
|
3
|
+
*
|
|
4
|
+
* The rail evicts segments continuously as the terminal narrows. Without this
|
|
5
|
+
* row the last thing left at very small widths is the `…+N` overflow marker —
|
|
6
|
+
* the three things a user actually needs (how much context is left, whether a
|
|
7
|
+
* goal is running, which model is answering) are exactly what the generic
|
|
8
|
+
* eviction throws away first or last by accident.
|
|
9
|
+
*
|
|
10
|
+
* This row keeps them, in priority order, by stepping each item down its own
|
|
11
|
+
* ladder instead of dropping it:
|
|
12
|
+
*
|
|
13
|
+
* full form -> shortened form -> single glyph -> dropped
|
|
14
|
+
*
|
|
15
|
+
* Context % is never dropped and is the last survivor; the model name is
|
|
16
|
+
* dropped first of the three. The row is rendered as bare colored text with no
|
|
17
|
+
* group padding or end caps, so — like the overflow marker — it can survive at
|
|
18
|
+
* widths where a normal segment group cannot.
|
|
19
|
+
*/
|
|
20
|
+
import type { SegmentContext } from "./types";
|
|
21
|
+
/** Which priority items the active layout is supposed to be carrying. */
|
|
22
|
+
export interface PriorityItemSet {
|
|
23
|
+
context: boolean;
|
|
24
|
+
goal: boolean;
|
|
25
|
+
model: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Widest priority row that fits `width`, or null when even the minimal form
|
|
29
|
+
* cannot fit (callers then fall back to the overflow marker).
|
|
30
|
+
*
|
|
31
|
+
* Returns null when neither context nor goal is available: the model name alone
|
|
32
|
+
* is the lowest-priority item and never justifies replacing the normal rail.
|
|
33
|
+
*/
|
|
34
|
+
export declare function buildPriorityRow(ctx: SegmentContext, width: number, include: PriorityItemSet): string | null;
|