@gajae-code/coding-agent 0.12.0 → 0.12.2
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 +111 -0
- package/dist/types/async/job-manager.d.ts +17 -3
- package/dist/types/config/settings-schema.d.ts +56 -2
- package/dist/types/exa/mcp-client.d.ts +10 -1
- package/dist/types/exec/bash-executor.d.ts +45 -12
- package/dist/types/extensibility/extensions/types.d.ts +16 -2
- package/dist/types/extensibility/gjc-plugins/index.d.ts +12 -2
- package/dist/types/extensibility/gjc-plugins/installer.d.ts +63 -7
- package/dist/types/extensibility/gjc-plugins/lifecycle-reconciliation.d.ts +55 -0
- package/dist/types/extensibility/gjc-plugins/lifecycle.d.ts +64 -0
- package/dist/types/extensibility/gjc-plugins/runtime-quarantine.d.ts +67 -0
- package/dist/types/extensibility/gjc-plugins/session-validation.d.ts +3 -1
- package/dist/types/extensibility/gjc-plugins/types.d.ts +124 -0
- package/dist/types/gjc-runtime/launch-tmux.d.ts +1 -0
- package/dist/types/gjc-runtime/ralplan-review-conflicts.d.ts +114 -0
- package/dist/types/gjc-runtime/ralplan-runtime.d.ts +23 -3
- package/dist/types/gjc-runtime/team-launch.d.ts +1 -1
- package/dist/types/gjc-runtime/team-runtime.d.ts +25 -0
- package/dist/types/gjc-runtime/team-worker-heartbeat.d.ts +43 -0
- package/dist/types/gjc-runtime/tmux-owner-isolation.d.ts +10 -0
- package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +37 -80
- package/dist/types/modes/acp/acp-agent.d.ts +2 -19
- package/dist/types/modes/components/gjc-bundle-settings.d.ts +34 -0
- package/dist/types/modes/components/irc-sidebar.d.ts +16 -0
- package/dist/types/modes/components/notifications-settings-editor.d.ts +1 -0
- package/dist/types/modes/components/session-observer-overlay.d.ts +18 -0
- package/dist/types/modes/components/settings-selector.d.ts +9 -0
- package/dist/types/modes/components/status-line/gh.d.ts +5 -0
- package/dist/types/modes/components/transcript-viewer-overlay.d.ts +18 -1
- package/dist/types/modes/controllers/command-controller.d.ts +1 -1
- package/dist/types/modes/controllers/event-controller.d.ts +1 -1
- package/dist/types/modes/controllers/extension-ui-controller.d.ts +2 -1
- package/dist/types/modes/controllers/selector-controller.d.ts +1 -1
- package/dist/types/modes/interactive-mode.d.ts +9 -0
- package/dist/types/modes/theme/theme.d.ts +3 -1
- package/dist/types/modes/types.d.ts +32 -0
- package/dist/types/reminders/star-reminder.d.ts +3 -13
- package/dist/types/runtime-mcp/manager.d.ts +1 -0
- package/dist/types/sdk/acp/adapter.d.ts +3 -1
- package/dist/types/sdk/broker/transport.d.ts +2 -0
- package/dist/types/sdk/bus/attachment-registry.d.ts +1 -0
- package/dist/types/sdk/bus/chat-daemon-control.d.ts +5 -1
- package/dist/types/sdk/bus/config.d.ts +6 -2
- package/dist/types/sdk/bus/index.d.ts +29 -0
- package/dist/types/sdk/bus/kind-aware-reconciliation.d.ts +8 -1
- package/dist/types/sdk/bus/lifecycle-control-runtime.d.ts +4 -0
- package/dist/types/sdk/bus/reconciliation-store.d.ts +7 -3
- package/dist/types/sdk/bus/rich-draft.d.ts +1 -0
- package/dist/types/sdk/bus/rich-render.d.ts +2 -0
- package/dist/types/sdk/bus/telegram-adoption-intent.d.ts +165 -0
- package/dist/types/sdk/bus/telegram-cli.d.ts +12 -0
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +12 -4
- package/dist/types/sdk/bus/telegram-daemon.d.ts +25 -1
- package/dist/types/sdk/bus/telegram-reference.d.ts +11 -1
- package/dist/types/sdk/bus/threaded-render.d.ts +3 -2
- package/dist/types/sdk/bus/topic-registry.d.ts +11 -1
- package/dist/types/sdk/host/query/revision-store.d.ts +2 -0
- package/dist/types/sdk/host/reverse-leases.d.ts +1 -1
- package/dist/types/sdk/prompt-status.d.ts +23 -3
- package/dist/types/sdk/session.d.ts +6 -0
- package/dist/types/session/agent-session.d.ts +40 -2
- package/dist/types/session/artifacts.d.ts +8 -0
- package/dist/types/session/blob-store.d.ts +57 -4
- package/dist/types/session/internal/managed-session-storage.d.ts +30 -4
- package/dist/types/session/session-manager.d.ts +23 -6
- package/dist/types/session/session-storage.d.ts +4 -0
- package/dist/types/session/streaming-output.d.ts +36 -7
- package/dist/types/setup/credential-import.d.ts +12 -0
- package/dist/types/skill-state/active-state.d.ts +12 -0
- package/dist/types/skill-state/workflow-hud.d.ts +6 -0
- package/dist/types/task/executor.d.ts +3 -2
- package/dist/types/task/index.d.ts +7 -1
- package/dist/types/task/output-manager.d.ts +1 -0
- package/dist/types/task/provider-retry-status.d.ts +8 -0
- package/dist/types/task/receipt.d.ts +9 -1
- package/dist/types/task/types.d.ts +23 -0
- package/dist/types/tools/ask-answer-registry.d.ts +2 -2
- package/dist/types/tools/bash-interactive.d.ts +4 -1
- package/dist/types/tools/bash.d.ts +3 -1
- package/dist/types/tools/image-gen.d.ts +4 -0
- package/dist/types/tools/index.d.ts +6 -0
- package/dist/types/tools/output-meta.d.ts +23 -2
- package/dist/types/tools/path-utils.d.ts +1 -0
- package/dist/types/tools/read.d.ts +0 -6
- package/dist/types/tools/review.d.ts +5 -7
- package/dist/types/tools/subagent.d.ts +2 -0
- package/dist/types/utils/gh.d.ts +13 -0
- package/dist/types/utils/image-resize.d.ts +1 -0
- package/dist/types/web/search/providers/kimi.d.ts +2 -0
- package/dist/types/web/search/providers/searxng.d.ts +7 -0
- package/dist/types/web/search/providers/xai.d.ts +2 -0
- package/package.json +10 -8
- package/scripts/acp-conformance-agent.ts +218 -0
- package/scripts/capture-gjc-bundle-settings.ts +306 -0
- package/scripts/dogfood-ralplan-review-conflicts.ts +272 -0
- package/scripts/generate-sdk-operation-inventory.ts +5 -0
- package/scripts/resident-memory-bench.ts +1341 -0
- package/scripts/run-acp-conformance.ts +290 -0
- package/src/async/job-manager.ts +99 -39
- package/src/cli/fast-help.ts +1 -1
- package/src/cli/plugin-cli.ts +176 -18
- package/src/commands/team.ts +19 -1
- package/src/config/file-lock.ts +11 -2
- package/src/config/settings-schema.ts +53 -2
- package/src/coordinator-mcp/question-gate-codec.ts +1 -1
- package/src/coordinator-mcp/server.ts +5 -12
- package/src/debug/index.ts +42 -17
- package/src/defaults/gjc/skills/deep-interview/SKILL.md +1 -0
- package/src/defaults/gjc/skills/ralplan/SKILL.md +25 -20
- package/src/defaults/gjc/skills/team/SKILL.md +2 -0
- package/src/defaults/gjc/skills/ultragoal/SKILL.md +39 -26
- package/src/defaults/gjc/skills/ultragoal/validation-batch-contracts.md +12 -0
- package/src/defaults/gjc-defaults.ts +4 -4
- package/src/exa/mcp-client.ts +12 -3
- package/src/exec/bash-executor.ts +144 -27
- package/src/extensibility/extensions/runner.ts +15 -0
- package/src/extensibility/extensions/types.ts +18 -1
- package/src/extensibility/gjc-plugins/constrained-hooks.ts +8 -2
- package/src/extensibility/gjc-plugins/index.ts +19 -2
- package/src/extensibility/gjc-plugins/installer.ts +189 -50
- package/src/extensibility/gjc-plugins/lifecycle-reconciliation.ts +199 -0
- package/src/extensibility/gjc-plugins/lifecycle.ts +626 -0
- package/src/extensibility/gjc-plugins/observability.ts +3 -3
- package/src/extensibility/gjc-plugins/prompt-appendix.ts +5 -1
- package/src/extensibility/gjc-plugins/runtime-adapters.ts +12 -2
- package/src/extensibility/gjc-plugins/runtime-quarantine.ts +121 -0
- package/src/extensibility/gjc-plugins/schema.ts +84 -12
- package/src/extensibility/gjc-plugins/session-validation.ts +9 -3
- package/src/extensibility/gjc-plugins/types.ts +141 -0
- package/src/extensibility/gjc-plugins/validation.ts +9 -0
- package/src/gjc-runtime/launch-tmux.ts +25 -6
- package/src/gjc-runtime/launch-worktree.ts +103 -1
- package/src/gjc-runtime/ledger-event-renderer.ts +1 -0
- package/src/gjc-runtime/managed-owner-admission.ts +1 -1
- package/src/gjc-runtime/ralplan-review-conflicts.ts +472 -0
- package/src/gjc-runtime/ralplan-runtime.ts +491 -27
- package/src/gjc-runtime/team-launch.ts +8 -0
- package/src/gjc-runtime/team-runtime.ts +140 -32
- package/src/gjc-runtime/team-worker-heartbeat.ts +149 -0
- package/src/gjc-runtime/tmux-owner-isolation.ts +10 -0
- package/src/gjc-runtime/tmux-sessions.ts +58 -13
- package/src/gjc-runtime/ultragoal-evidence.ts +6 -74
- package/src/gjc-runtime/ultragoal-runtime.ts +635 -612
- package/src/gjc-runtime/workflow-manifest.generated.json +37 -99
- package/src/gjc-runtime/workflow-manifest.ts +21 -70
- package/src/internal-urls/docs-index.generated.ts +16 -16
- package/src/modes/DESIGN.md +104 -0
- package/src/modes/acp/acp-agent.ts +298 -186
- package/src/modes/components/gjc-bundle-settings.ts +508 -0
- package/src/modes/components/irc-sidebar.ts +30 -1
- package/src/modes/components/notifications-settings-editor.ts +12 -1
- package/src/modes/components/oauth-selector.ts +68 -30
- package/src/modes/components/session-observer-overlay.ts +305 -86
- package/src/modes/components/settings-selector.ts +56 -5
- package/src/modes/components/status-line/gh.ts +16 -0
- package/src/modes/components/tool-status-header.ts +3 -15
- package/src/modes/components/transcript-viewer-overlay.ts +99 -24
- package/src/modes/controllers/command-controller.ts +42 -34
- package/src/modes/controllers/event-controller.ts +27 -16
- package/src/modes/controllers/extension-ui-controller.ts +193 -34
- package/src/modes/controllers/selector-controller.ts +160 -22
- package/src/modes/interactive-mode.ts +189 -62
- package/src/modes/jobs-observer.ts +1 -1
- package/src/modes/runtime-init.ts +3 -0
- package/src/modes/theme/theme.ts +11 -9
- package/src/modes/types.ts +88 -0
- package/src/prompts/agent-fragments/ralplan-persistence.md +4 -3
- package/src/prompts/system/eager-todo.md +8 -4
- package/src/prompts/system/system-prompt.md +11 -4
- package/src/prompts/tools/bash.md +5 -5
- package/src/prompts/tools/search-tool-bm25.md +5 -0
- package/src/prompts/tools/task.md +1 -1
- package/src/reminders/star-reminder.ts +4 -42
- package/src/runtime-mcp/manager.ts +19 -4
- package/src/sdk/acp/adapter.ts +22 -6
- package/src/sdk/broker/lifecycle.ts +18 -13
- package/src/sdk/broker/transport.ts +35 -3
- package/src/sdk/bus/attachment-registry.ts +5 -1
- package/src/sdk/bus/chat-daemon-cli.ts +4 -39
- package/src/sdk/bus/chat-daemon-control.ts +7 -3
- package/src/sdk/bus/config.ts +18 -2
- package/src/sdk/bus/index.ts +661 -126
- package/src/sdk/bus/kind-aware-reconciliation.ts +148 -73
- package/src/sdk/bus/lifecycle-commands.ts +4 -1
- package/src/sdk/bus/lifecycle-control-runtime.ts +403 -88
- package/src/sdk/bus/reconciliation-store.ts +95 -16
- package/src/sdk/bus/rich-draft.ts +1 -1
- package/src/sdk/bus/rich-render.ts +2 -2
- package/src/sdk/bus/telegram-adoption-intent.ts +574 -0
- package/src/sdk/bus/telegram-cli.ts +33 -8
- package/src/sdk/bus/telegram-daemon-cli.ts +1 -0
- package/src/sdk/bus/telegram-daemon-contract.ts +12 -4
- package/src/sdk/bus/telegram-daemon.ts +916 -23
- package/src/sdk/bus/telegram-reference.ts +40 -3
- package/src/sdk/bus/threaded-render.ts +48 -3
- package/src/sdk/bus/topic-registry.ts +20 -0
- package/src/sdk/host/query/revision-store.ts +36 -2
- package/src/sdk/host/reverse-leases.ts +44 -7
- package/src/sdk/prompt-status.ts +16 -3
- package/src/sdk/protocol/operation-inventory.generated.json +33 -0
- package/src/sdk/session.ts +89 -9
- package/src/session/agent-session.ts +844 -173
- package/src/session/artifacts.ts +22 -0
- package/src/session/auth-broker-config.ts +10 -3
- package/src/session/blob-store.ts +915 -24
- package/src/session/internal/managed-session-scope.ts +200 -111
- package/src/session/internal/managed-session-storage.ts +492 -62
- package/src/session/session-manager.ts +1614 -435
- package/src/session/session-storage.ts +38 -45
- package/src/session/streaming-output.ts +238 -68
- package/src/setup/credential-import.ts +75 -13
- package/src/skill-state/active-state.ts +32 -0
- package/src/skill-state/workflow-hud.ts +17 -0
- package/src/skill-state/workflow-mutation-guard.ts +496 -2
- package/src/task/executor.ts +122 -39
- package/src/task/index.ts +280 -45
- package/src/task/output-manager.ts +24 -14
- package/src/task/provider-retry-status.ts +16 -0
- package/src/task/receipt.ts +34 -8
- package/src/task/render.ts +6 -2
- package/src/task/types.ts +108 -0
- package/src/tools/ask-answer-registry.ts +12 -6
- package/src/tools/ask.ts +86 -55
- package/src/tools/ast-edit.ts +1 -0
- package/src/tools/ast-grep.ts +1 -0
- package/src/tools/bash-interactive.ts +8 -3
- package/src/tools/bash.ts +503 -60
- package/src/tools/find.ts +1 -0
- package/src/tools/image-gen.ts +29 -5
- package/src/tools/index.ts +6 -0
- package/src/tools/output-meta.ts +108 -14
- package/src/tools/path-utils.ts +3 -2
- package/src/tools/read.ts +18 -0
- package/src/tools/review.ts +5 -7
- package/src/tools/search.ts +1 -0
- package/src/tools/subagent-render.ts +6 -2
- package/src/tools/subagent.ts +6 -0
- package/src/tools/telegram-send.ts +6 -3
- package/src/utils/gh.ts +39 -0
- package/src/utils/image-resize.ts +3 -0
- package/src/web/search/providers/anthropic.ts +4 -4
- package/src/web/search/providers/kimi.ts +15 -5
- package/src/web/search/providers/searxng.ts +47 -4
- package/src/web/search/providers/xai.ts +7 -2
- package/dist/types/gjc-runtime/ultragoal-pipeline.d.ts +0 -23
- package/src/defaults/gjc/skills/ultragoal/pipeline-validation-contracts.md +0 -30
- package/src/gjc-runtime/ultragoal-pipeline.ts +0 -306
|
@@ -12,6 +12,7 @@ import type { CustomCommandsLoadResult } from "../extensibility/custom-commands"
|
|
|
12
12
|
import type { CustomTool } from "../extensibility/custom-tools/types";
|
|
13
13
|
import { type ExtensionFactory, type ExtensionUIContext, type LoadExtensionsResult, type ToolDefinition } from "../extensibility/extensions";
|
|
14
14
|
import { type ConstrainedPluginHook } from "../extensibility/gjc-plugins/constrained-hooks";
|
|
15
|
+
import { type GjcRuntimeSnapshotProvider } from "../extensibility/gjc-plugins/runtime-quarantine";
|
|
15
16
|
import { type Skill, type SkillWarning } from "../extensibility/skills";
|
|
16
17
|
import type { FileSlashCommand } from "../extensibility/slash-commands";
|
|
17
18
|
import type { HindsightSessionState } from "../hindsight/state";
|
|
@@ -207,6 +208,11 @@ export interface CreateAgentSessionResult {
|
|
|
207
208
|
lspServers?: LspStartupServerInfo[];
|
|
208
209
|
/** Shared event bus for tool/extension communication */
|
|
209
210
|
eventBus: EventBus;
|
|
211
|
+
/**
|
|
212
|
+
* Read-only view of GJC bundle runtime evidence for the activation generation
|
|
213
|
+
* this session published. Undefined when no GJC bundles participated.
|
|
214
|
+
*/
|
|
215
|
+
gjcRuntimeSnapshot?: GjcRuntimeSnapshotProvider;
|
|
210
216
|
}
|
|
211
217
|
export type { PromptTemplate } from "../config/prompt-templates";
|
|
212
218
|
export { Settings, type SkillsSettings } from "../config/settings";
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* Modes use this class and add their own I/O layer on top.
|
|
14
14
|
*/
|
|
15
|
-
import { type Agent, type AgentContext, type AgentEvent, type AgentLoopConfig, type AgentMessage, type AgentState, type AgentTool, type MidRunMaintenanceOutcome, type StablePrefixSnapshot, ThinkingLevel } from "@gajae-code/agent-core";
|
|
15
|
+
import { type Agent, type AgentContext, type AgentEvent, type AgentLoopConfig, type AgentMessage, type AgentState, type AgentTool, type MidRunMaintenanceOutcome, type RunSettlementProof, type StablePrefixSnapshot, ThinkingLevel } from "@gajae-code/agent-core";
|
|
16
16
|
import { type CompactionResult, type EmergencyCompactionSample } from "@gajae-code/agent-core/compaction";
|
|
17
17
|
import type { AssistantMessage, Effort, ImageContent, Message, MessageAttribution, Model, ProviderSessionState, ServiceTier, SimpleStreamOptions, TextContent, ToolCall, ToolChoice, Usage, UsageReport } from "@gajae-code/ai";
|
|
18
18
|
import { type BtwTextExchange } from "./btw-contract";
|
|
@@ -75,16 +75,18 @@ import { type PromptTemplate } from "../config/prompt-templates";
|
|
|
75
75
|
import type { Settings, SkillsSettings } from "../config/settings";
|
|
76
76
|
import { RawSseDebugBuffer } from "../debug/raw-sse-buffer";
|
|
77
77
|
import { type PythonResult } from "../eval/py/executor";
|
|
78
|
-
import { type BashResult } from "../exec/bash-executor";
|
|
78
|
+
import { type BashArtifactSaveResult, type BashResult } from "../exec/bash-executor";
|
|
79
79
|
import type { TtsrManager } from "../export/ttsr";
|
|
80
80
|
import type { LoadedCustomCommand } from "../extensibility/custom-commands";
|
|
81
81
|
import type { CustomTool } from "../extensibility/custom-tools/types";
|
|
82
82
|
import type { ExtensionRunner } from "../extensibility/extensions";
|
|
83
83
|
import type { CompactOptions, ContextUsage, ExtensionTranscriptEntry } from "../extensibility/extensions/types";
|
|
84
|
+
import type { GjcRuntimeSnapshotProvider } from "../extensibility/gjc-plugins/runtime-quarantine";
|
|
84
85
|
import type { SessionSwitchEvent } from "../extensibility/shared-events";
|
|
85
86
|
import { type Skill, type SkillWarning } from "../extensibility/skills";
|
|
86
87
|
import { type FileSlashCommand } from "../extensibility/slash-commands";
|
|
87
88
|
import { type MemoryGuardClaimsLease } from "../gjc-runtime/memory-guard-owner-claims";
|
|
89
|
+
import { GjcTeamWorkerHeartbeatReporter } from "../gjc-runtime/team-worker-heartbeat";
|
|
88
90
|
import { GoalRuntime } from "../goals/runtime";
|
|
89
91
|
import type { Goal, GoalModeState } from "../goals/state";
|
|
90
92
|
import type { HindsightSessionState } from "../hindsight/state";
|
|
@@ -208,6 +210,11 @@ export interface AgentSessionConfig {
|
|
|
208
210
|
workerIntegrationRequest?: (signal: AbortSignal) => Promise<void>;
|
|
209
211
|
/** Bound terminal worker-integration settlement for embedded hosts and deterministic lifecycle tests. */
|
|
210
212
|
workerIntegrationTimeoutMs?: number;
|
|
213
|
+
/**
|
|
214
|
+
* Override the runtime-owned `gjc team` worker heartbeat reporter. Defaults to a
|
|
215
|
+
* reporter derived from the team worker environment, or none outside a worker pane.
|
|
216
|
+
*/
|
|
217
|
+
teamWorkerHeartbeatReporter?: GjcTeamWorkerHeartbeatReporter;
|
|
211
218
|
/** Loaded skills (already discovered by SDK) */
|
|
212
219
|
skills?: Skill[];
|
|
213
220
|
/** Skill loading warnings (already captured by SDK) */
|
|
@@ -466,6 +473,11 @@ interface EphemeralTurnResult {
|
|
|
466
473
|
replyText: string;
|
|
467
474
|
assistantMessage: AssistantMessage;
|
|
468
475
|
}
|
|
476
|
+
export interface AgentBashArtifactStore {
|
|
477
|
+
saveArtifact(content: string, toolType: string): Promise<string | undefined>;
|
|
478
|
+
getArtifactPath(id: string): Promise<string | null>;
|
|
479
|
+
}
|
|
480
|
+
export declare function saveAgentBashOriginalArtifact(store: AgentBashArtifactStore, originalText: string): Promise<BashArtifactSaveResult>;
|
|
469
481
|
type IrcRosterClaim = {
|
|
470
482
|
token: symbol;
|
|
471
483
|
signature: string;
|
|
@@ -621,6 +633,7 @@ export declare class AgentSession {
|
|
|
621
633
|
* separately inside `sendCustomMessage`. */
|
|
622
634
|
enqueueCustomMessageDisplay(text: string, mode: "steer" | "followUp"): string;
|
|
623
635
|
getAgentId(): string | undefined;
|
|
636
|
+
registerToolSessionCleanup(cleanup: () => Promise<void> | void): () => void;
|
|
624
637
|
getAsyncJobSnapshot(options?: {
|
|
625
638
|
recentLimit?: number;
|
|
626
639
|
}): AsyncJobSnapshot | null;
|
|
@@ -786,6 +799,8 @@ export declare class AgentSession {
|
|
|
786
799
|
* to avoid racing against the delivery turn.
|
|
787
800
|
*/
|
|
788
801
|
get hasPostPromptWork(): boolean;
|
|
802
|
+
/** Stable resource ownership identifier for the active prompt run. */
|
|
803
|
+
get activePromptHandle(): string | undefined;
|
|
789
804
|
/** All messages including custom types like BashExecutionMessage */
|
|
790
805
|
get messages(): AgentMessage[];
|
|
791
806
|
get transcriptPromptGeneration(): number;
|
|
@@ -980,6 +995,12 @@ export declare class AgentSession {
|
|
|
980
995
|
cause?: "user_interrupt" | "new_session" | "session_switch" | "compaction" | "handoff" | "tool_abort" | "internal";
|
|
981
996
|
silent?: boolean;
|
|
982
997
|
}): Promise<void>;
|
|
998
|
+
/**
|
|
999
|
+
* Abort a specific active prompt and prove whether its tracked resources settled.
|
|
1000
|
+
*/
|
|
1001
|
+
abortPromptAndWait(handle: string, options: {
|
|
1002
|
+
graceMs: number;
|
|
1003
|
+
}): Promise<RunSettlementProof>;
|
|
983
1004
|
/** Atomically interrupt the active run and make text the next prompt. */
|
|
984
1005
|
cancelAndSubmit(text: string, options?: {
|
|
985
1006
|
queuedEntryId?: string;
|
|
@@ -1048,6 +1069,13 @@ export declare class AgentSession {
|
|
|
1048
1069
|
* instead of promoting a transient runtime model to the resume default.
|
|
1049
1070
|
*/
|
|
1050
1071
|
getSessionDefaultModelSelector(): string | undefined;
|
|
1072
|
+
/**
|
|
1073
|
+
* Resolve the model that `modelRoles.default` currently points to, independent
|
|
1074
|
+
* of whatever model this session's log last recorded. Used by the TUI resume
|
|
1075
|
+
* flow's `session.resumeModelBehavior: "ask"` prompt to offer the currently
|
|
1076
|
+
* configured default as an alternative to the session's saved model.
|
|
1077
|
+
*/
|
|
1078
|
+
resolveConfiguredDefaultModel(): Model | undefined;
|
|
1051
1079
|
/**
|
|
1052
1080
|
* Re-assert the session resume default ("provider/id") in the session log
|
|
1053
1081
|
* WITHOUT touching the live runtime model. Appends a `model_change` with
|
|
@@ -1157,6 +1185,15 @@ export declare class AgentSession {
|
|
|
1157
1185
|
* Get available thinking levels for current model.
|
|
1158
1186
|
*/
|
|
1159
1187
|
getAvailableThinkingLevels(): ReadonlyArray<Effort>;
|
|
1188
|
+
/**
|
|
1189
|
+
* Runtime evidence published for the current GJC bundle activation
|
|
1190
|
+
* generation, set once by `createAgentSession` after every producer has run.
|
|
1191
|
+
* Undefined until that publication happens, so consumers report runtime
|
|
1192
|
+
* status as unavailable rather than falsely clear.
|
|
1193
|
+
*/
|
|
1194
|
+
gjcRuntimeSnapshot?: GjcRuntimeSnapshotProvider;
|
|
1195
|
+
/** Activation generation a published snapshot must match to be merged. */
|
|
1196
|
+
gjcActivationGeneration?: number;
|
|
1160
1197
|
/**
|
|
1161
1198
|
* Set steering mode.
|
|
1162
1199
|
* Saves to settings.
|
|
@@ -1350,6 +1387,7 @@ export declare class AgentSession {
|
|
|
1350
1387
|
*/
|
|
1351
1388
|
switchSession(sessionPath: string, options?: {
|
|
1352
1389
|
transition?: SessionSwitchEvent["transition"];
|
|
1390
|
+
onTransitionMutationStarted?: () => void;
|
|
1353
1391
|
}): Promise<boolean>;
|
|
1354
1392
|
/**
|
|
1355
1393
|
* Create a branch from a specific entry.
|
|
@@ -45,6 +45,14 @@ export declare class ArtifactManager {
|
|
|
45
45
|
replaceNamedBytes(filename: string, bytes: Uint8Array): Promise<void>;
|
|
46
46
|
publishManagedOutputGeneration(selectorFilename: string, outputFilenamePrefix: string, outputBytes: Uint8Array, metadataBytes: Uint8Array): Promise<void>;
|
|
47
47
|
publishNamedNoReplace(filename: string, bytes: Uint8Array): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Best-effort removal of a previously published named artifact. Used to roll
|
|
50
|
+
* back staged publications when a transactional operation (e.g. gated
|
|
51
|
+
* maintenance pruning) is rejected after publication succeeded. Returns false
|
|
52
|
+
* when the artifact could not be removed so callers can log the failure
|
|
53
|
+
* instead of silently treating the rollback as complete.
|
|
54
|
+
*/
|
|
55
|
+
removeNamedBestEffort(filename: string): Promise<boolean>;
|
|
48
56
|
/**
|
|
49
57
|
* Atomically allocate next artifact ID.
|
|
50
58
|
* IDs are sequential within the session.
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
declare const TAKE_BLOB_BUFFER_OWNERSHIP: unique symbol;
|
|
2
|
+
/** Limits for a single best-effort resident-cache garbage-collection pass. */
|
|
3
|
+
export interface ResidentCacheGcSweepOptions {
|
|
4
|
+
readonly maxDirectories?: number;
|
|
5
|
+
readonly maxDurationMs?: number;
|
|
6
|
+
}
|
|
1
7
|
export interface BlobPutResult {
|
|
2
8
|
hash: string;
|
|
3
9
|
path: string;
|
|
@@ -11,6 +17,28 @@ export declare class BlobCorruptError extends Error {
|
|
|
11
17
|
readonly path: string;
|
|
12
18
|
constructor(hash: string, path: string);
|
|
13
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* A resident-cache path or blob failed the owner-only verification contract.
|
|
22
|
+
* SessionManager catches this error to demote the entire resident store to
|
|
23
|
+
* memory before retrying the triggering write.
|
|
24
|
+
*/
|
|
25
|
+
export declare class ResidentCacheTrustError extends Error {
|
|
26
|
+
readonly reason: string;
|
|
27
|
+
readonly path: string;
|
|
28
|
+
constructor(reason: string, path: string, options?: ErrorOptions);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Best-effort cleanup of abandoned resident-cache instances. The root is
|
|
32
|
+
* re-verified before scanning, work is bounded, and all failures fail closed.
|
|
33
|
+
*/
|
|
34
|
+
export declare function sweepResidentCacheRoot(root: string, options?: ResidentCacheGcSweepOptions): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Create a private resident-cache instance directory beneath a trusted profile
|
|
37
|
+
* root. The cache-owned root and nonce instance are both verified owner-only
|
|
38
|
+
* directories; callers must use {@link EphemeralBlobStore.adoptVerifiedDir}
|
|
39
|
+
* rather than the destructive EphemeralBlobStore constructor.
|
|
40
|
+
*/
|
|
41
|
+
export declare function openVerifiedResidentCacheInstanceDir(root: string): string;
|
|
14
42
|
/**
|
|
15
43
|
* Content-addressed blob store for externalizing large binary data (images) from session JSONL files.
|
|
16
44
|
*
|
|
@@ -31,7 +59,13 @@ export declare class BlobStore {
|
|
|
31
59
|
* cannot afford the microtask hops of the async version (e.g. OOM-safe session writes).
|
|
32
60
|
* Returns once the bytes are in the kernel page cache.
|
|
33
61
|
*/
|
|
34
|
-
putSync(data: Buffer): BlobPutResult;
|
|
62
|
+
putSync(data: Buffer, _ownership?: typeof TAKE_BLOB_BUFFER_OWNERSHIP): BlobPutResult;
|
|
63
|
+
/**
|
|
64
|
+
* Store a buffer that the caller will not mutate after this call returns.
|
|
65
|
+
* Resident-cache implementations may retain that private buffer without an
|
|
66
|
+
* additional defensive copy.
|
|
67
|
+
*/
|
|
68
|
+
putOwnedSync(data: Buffer): BlobPutResult;
|
|
35
69
|
/**
|
|
36
70
|
* Durably install binary data as an immutable content-addressed blob.
|
|
37
71
|
*
|
|
@@ -51,19 +85,37 @@ export declare class BlobStore {
|
|
|
51
85
|
/** Check if a blob exists. */
|
|
52
86
|
has(hash: string): Promise<boolean>;
|
|
53
87
|
}
|
|
88
|
+
interface EphemeralBlobStoreOptions {
|
|
89
|
+
readonly adoptVerifiedDir?: boolean;
|
|
90
|
+
}
|
|
91
|
+
/** Resident-cache directories still tracked by this process. Test seam. */
|
|
92
|
+
export declare function trackedResidentCacheDirsForTest(): string[];
|
|
54
93
|
export declare class EphemeralBlobStore extends BlobStore {
|
|
55
94
|
#private;
|
|
56
|
-
constructor(dir: string);
|
|
57
|
-
|
|
95
|
+
constructor(dir: string, options?: EphemeralBlobStoreOptions);
|
|
96
|
+
/**
|
|
97
|
+
* Adopt a directory returned by {@link openVerifiedResidentCacheInstanceDir}
|
|
98
|
+
* without the ordinary constructor's destructive remove-and-recreate path.
|
|
99
|
+
*/
|
|
100
|
+
static adoptVerifiedDir(dir: string): EphemeralBlobStore;
|
|
101
|
+
put(data: Buffer): Promise<BlobPutResult>;
|
|
102
|
+
putSync(data: Buffer, ownership?: typeof TAKE_BLOB_BUFFER_OWNERSHIP): BlobPutResult;
|
|
58
103
|
putImmutableSync(data: Buffer): CheckedBlobPutResult;
|
|
104
|
+
get(hash: string): Promise<Buffer | null>;
|
|
59
105
|
getSync(hash: string): Buffer | null;
|
|
106
|
+
/** Return a trusted in-memory copy without reopening an invalidated cache path. */
|
|
107
|
+
getBufferedSync(hash: string): Buffer | null;
|
|
60
108
|
getCheckedSync(hash: string): Buffer | null;
|
|
61
109
|
clear(): void;
|
|
62
110
|
dispose(): void;
|
|
63
111
|
}
|
|
112
|
+
export interface MemoryBlobStoreOptions {
|
|
113
|
+
/** A canonical store owns every reference in its session's resident entries. */
|
|
114
|
+
readonly ownership?: "cache" | "canonical";
|
|
115
|
+
}
|
|
64
116
|
export declare class MemoryBlobStore extends BlobStore {
|
|
65
117
|
#private;
|
|
66
|
-
constructor();
|
|
118
|
+
constructor(options?: MemoryBlobStoreOptions);
|
|
67
119
|
put(data: Buffer): Promise<BlobPutResult>;
|
|
68
120
|
putSync(data: Buffer): BlobPutResult;
|
|
69
121
|
putImmutableSync(data: Buffer): CheckedBlobPutResult;
|
|
@@ -158,3 +210,4 @@ export declare function resolveResidentImageDataSync(blobStore: BlobStore, data:
|
|
|
158
210
|
sessionId?: string;
|
|
159
211
|
sessionFile?: string;
|
|
160
212
|
}): string;
|
|
213
|
+
export {};
|
|
@@ -7,6 +7,7 @@ export declare const MANAGED_ARTIFACT_MAX_TOTAL_BYTES: number;
|
|
|
7
7
|
export declare const MANAGED_ARTIFACT_COPY_BATCH_SIZE = 256;
|
|
8
8
|
export declare class ManagedPublishError extends Error {
|
|
9
9
|
readonly classification: "destination_conflict" | "atomic_unavailable" | "invalid_request" | "durability_not_provable" | "identity_mismatch" | "io_error" | "durability_failed";
|
|
10
|
+
readonly code: ManagedPublishError["classification"];
|
|
10
11
|
readonly diagnostic: string;
|
|
11
12
|
constructor(classification: ManagedPublishError["classification"], outcome: NativePublishOutcome);
|
|
12
13
|
}
|
|
@@ -20,6 +21,12 @@ export interface ManagedStorageLock {
|
|
|
20
21
|
assertOwned(): void;
|
|
21
22
|
release(): Promise<void>;
|
|
22
23
|
}
|
|
24
|
+
export interface ManagedStorageLockSync {
|
|
25
|
+
path: string;
|
|
26
|
+
attemptId: string;
|
|
27
|
+
assertOwned(): void;
|
|
28
|
+
release(): void;
|
|
29
|
+
}
|
|
23
30
|
export interface ManagedFileSnapshot {
|
|
24
31
|
bytes: Buffer;
|
|
25
32
|
identity: {
|
|
@@ -31,6 +38,13 @@ export interface ManagedFileSnapshot {
|
|
|
31
38
|
sha256: string;
|
|
32
39
|
};
|
|
33
40
|
}
|
|
41
|
+
export declare const MANAGED_SESSION_SECURITY_CODES: readonly ["acl_denied", "acl_io_error", "acl_present", "acl_malformed", "acl_unknown", "acl_unavailable", "acl_apply_failed", "acl_verify_failed", "not_found", "not_directory", "network_unsupported", "reparse_point", "identity_unavailable", "identity_mismatch", "owner_mismatch", "mode_mismatch", "io_error"];
|
|
42
|
+
export type ManagedSessionSecurityCode = (typeof MANAGED_SESSION_SECURITY_CODES)[number];
|
|
43
|
+
export declare class ManagedSessionSecurityError extends Error {
|
|
44
|
+
readonly code: ManagedSessionSecurityCode;
|
|
45
|
+
constructor(code: ManagedSessionSecurityCode);
|
|
46
|
+
}
|
|
47
|
+
export declare function managedSessionSecurityCode(error: unknown): ManagedSessionSecurityCode | undefined;
|
|
34
48
|
export declare function validateNativeSecurityResult(value: unknown, operation: "apply" | "verify", kind: "directory" | "file"): NativeOwnerOnlySecurityResult;
|
|
35
49
|
/** Captured configured-root authority for managed paths only. */
|
|
36
50
|
export interface ManagedDirectoryRoot {
|
|
@@ -51,19 +65,26 @@ export declare function retainManagedDirectoryAuthority(root: ManagedDirectoryRo
|
|
|
51
65
|
ino: bigint;
|
|
52
66
|
}): RecoveryFsRoot | undefined;
|
|
53
67
|
export declare function assertManagedDirectoryRoot(root: ManagedDirectoryRoot): void;
|
|
68
|
+
export declare function managedSecurityFailureClassification(error: unknown): string | undefined;
|
|
54
69
|
/** Internal retained-root capability for one managed descendant subtree. */
|
|
55
70
|
export declare class ManagedSessionDescendantStore {
|
|
56
71
|
#private;
|
|
57
72
|
constructor(root: ManagedDirectoryRoot, baseDir: string, retained?: {
|
|
58
73
|
authority: RecoveryFsRoot;
|
|
59
74
|
authorityBaseDir: string;
|
|
60
|
-
}, policy?: ManagedSessionSecurityPolicy);
|
|
75
|
+
}, policy?: ManagedSessionSecurityPolicy, profileAgentDir?: string);
|
|
61
76
|
get dir(): string;
|
|
62
77
|
get rootAuthority(): ManagedDirectoryRoot;
|
|
63
78
|
get subtreeRootAuthority(): ManagedDirectoryRoot;
|
|
64
79
|
get securityPolicy(): ManagedSessionSecurityPolicy;
|
|
80
|
+
get profileAgentDir(): string;
|
|
65
81
|
deriveSubtree(relativePath: string): ManagedSessionDescendantStore;
|
|
66
82
|
retainAuthority(): RecoveryFsRoot | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* Release an authority this store opened itself. Retained authorities are owned by
|
|
85
|
+
* the security context that supplied them and are never closed here. Idempotent.
|
|
86
|
+
*/
|
|
87
|
+
close(): void;
|
|
67
88
|
assertBound(): void;
|
|
68
89
|
verifyRootSecurity(): void;
|
|
69
90
|
ensureDirectory(relativePath?: string): ManagedDirectoryRoot;
|
|
@@ -98,13 +119,18 @@ export declare function captureManagedFileNoFollow(pathname: string): ManagedFil
|
|
|
98
119
|
/** Atomically publishes bytes without replacing an existing destination. */
|
|
99
120
|
export declare function publishManagedFileNoReplace(destination: string, bytes: Uint8Array, assertOwned?: () => void, root?: ManagedDirectoryRoot, policy?: ManagedSessionSecurityPolicy): Promise<void>;
|
|
100
121
|
export declare function publishManagedFileNoReplaceSync(destination: string, bytes: Uint8Array, root?: ManagedDirectoryRoot, policy?: ManagedSessionSecurityPolicy): void;
|
|
101
|
-
/**
|
|
102
|
-
|
|
103
|
-
|
|
122
|
+
/**
|
|
123
|
+
* Atomically replace a managed file only when the destination is still the
|
|
124
|
+
* exact captured object. Unlike `replaceManagedFileSync`, this never performs
|
|
125
|
+
* an unconditional pathname rename.
|
|
126
|
+
*/
|
|
127
|
+
export declare function replaceManagedFileExactSync(destination: string, bytes: Uint8Array, expected: Pick<ManagedFileSnapshot, "identity">, root: ManagedDirectoryRoot): void;
|
|
104
128
|
/** Copy the exact bytes captured from one no-follow source descriptor. */
|
|
105
129
|
export declare function copyManagedFileNoReplace(source: string, destination: string, snapshot?: ManagedFileSnapshot, root?: ManagedDirectoryRoot, policy?: ManagedSessionSecurityPolicy): Promise<void>;
|
|
106
130
|
/** Acquire a lease lock with bounded wait, heartbeats, conservative stale reclaim, and fencing. */
|
|
107
131
|
export declare function acquireManagedLock(locksDirectory: string, name: string, root?: ManagedDirectoryRoot, policy?: ManagedSessionSecurityPolicy): Promise<ManagedStorageLock>;
|
|
132
|
+
/** Acquire a synchronous lease lock for a short cross-process critical section. */
|
|
133
|
+
export declare function acquireManagedLockSync(locksDirectory: string, name: string, root?: ManagedDirectoryRoot, policy?: ManagedSessionSecurityPolicy): ManagedStorageLockSync;
|
|
108
134
|
export interface ManagedArtifactTreeLimits {
|
|
109
135
|
maxFiles?: number;
|
|
110
136
|
maxTotalBytes?: number;
|
|
@@ -72,11 +72,16 @@ export interface SessionManagerObservabilityStats {
|
|
|
72
72
|
coldSpillReadCount: number;
|
|
73
73
|
residentTextReadCount: number;
|
|
74
74
|
residentImageReadCount: number;
|
|
75
|
+
residentCacheAdoptFallbackCount: number;
|
|
76
|
+
residentCacheTrustRejectCount: number;
|
|
77
|
+
residentCacheWin32FallbackCount: number;
|
|
78
|
+
residentCacheDegradedReason?: string;
|
|
75
79
|
publicMaterializerCallCount: number;
|
|
76
80
|
getEntryMaterializerCallCount: number;
|
|
77
81
|
getBranchMaterializerCallCount: number;
|
|
78
82
|
getEntriesMaterializerCallCount: number;
|
|
79
83
|
materializedEntriesCachePopulateCount: number;
|
|
84
|
+
materializedCacheDemotedCount: number;
|
|
80
85
|
pathOnlyContextBuildCount: number;
|
|
81
86
|
}
|
|
82
87
|
export interface SessionMessageEntry extends SessionEntryBase {
|
|
@@ -506,12 +511,17 @@ export type SessionDestination = {
|
|
|
506
511
|
readonly directory: string;
|
|
507
512
|
};
|
|
508
513
|
export type SessionDestinationInput = string | SessionDestination | undefined;
|
|
509
|
-
|
|
514
|
+
type ForkArtifactPublication = {
|
|
515
|
+
readonly kind: "managed";
|
|
510
516
|
readonly snapshot: native.NativeDirectoryTreeSnapshot;
|
|
511
517
|
readonly store: ManagedSessionDescendantStore;
|
|
512
518
|
readonly cleanupStore: ManagedSessionDescendantStore;
|
|
513
519
|
readonly cleanupRelativePath: string;
|
|
514
|
-
}
|
|
520
|
+
} | {
|
|
521
|
+
readonly kind: "explicit";
|
|
522
|
+
readonly artifactsDir: string;
|
|
523
|
+
readonly snapshot: native.NativeDirectoryTreeSnapshot;
|
|
524
|
+
};
|
|
515
525
|
/** Exported for testing */
|
|
516
526
|
export declare function loadEntriesFromFile(filePath: string, storage?: SessionStorage): Promise<FileEntry[]>;
|
|
517
527
|
declare class RecentSessionInfo {
|
|
@@ -596,6 +606,13 @@ interface SessionManagerStateSnapshot {
|
|
|
596
606
|
fileEntries: FileEntry[];
|
|
597
607
|
materializedFileEntries: FileEntry[];
|
|
598
608
|
}
|
|
609
|
+
/** Benchmark-derived cap for strong materialized session snapshots. */
|
|
610
|
+
export declare const MATERIALIZED_CACHE_MAX_BYTES: number;
|
|
611
|
+
/** Test-only cache retention and transition seams; these are intentionally not user settings. */
|
|
612
|
+
export declare const SessionManagerTestHooks: {
|
|
613
|
+
materializedCacheMaxBytesOverride?: number;
|
|
614
|
+
beforeResidentTransitionIndexBuild?: () => void;
|
|
615
|
+
};
|
|
599
616
|
export declare class SessionManager {
|
|
600
617
|
#private;
|
|
601
618
|
private cwd;
|
|
@@ -614,7 +631,7 @@ export declare class SessionManager {
|
|
|
614
631
|
putBlob(data: Buffer): Promise<BlobPutResult>;
|
|
615
632
|
captureState(): SessionManagerStateSnapshot;
|
|
616
633
|
restoreState(snapshot: SessionManagerStateSnapshot): void;
|
|
617
|
-
/** Switch to a different session file (used for resume and branching) */
|
|
634
|
+
/** Switch to a different session file (used for resume and branching). */
|
|
618
635
|
setSessionFile(sessionFile: string): Promise<void>;
|
|
619
636
|
/** Start a new session. Closes any existing writer first. */
|
|
620
637
|
newSession(options?: NewSessionOptions): Promise<string | undefined>;
|
|
@@ -652,9 +669,9 @@ export declare class SessionManager {
|
|
|
652
669
|
* managed logical authorization. This is only for discarding an UNCOMMITTED
|
|
653
670
|
* successor that a transaction (e.g. handoff) created via `newSession()` but
|
|
654
671
|
* never durably authorized — such a session has no managed candidate listing
|
|
655
|
-
* yet, so `dropSession` would refuse it and leak its
|
|
656
|
-
*
|
|
657
|
-
*
|
|
672
|
+
* yet, so `dropSession` would refuse it and leak its artifact root. Bounded to
|
|
673
|
+
* this manager's configured session root and refuses to touch the active session;
|
|
674
|
+
* tolerates missing files.
|
|
658
675
|
*/
|
|
659
676
|
discardUncommittedSession(sessionPath: string): Promise<void>;
|
|
660
677
|
/**
|
|
@@ -61,6 +61,8 @@ export interface SessionStorageWriterOpenOptions {
|
|
|
61
61
|
export interface ManagedSessionSecurityContext {
|
|
62
62
|
readonly kind: "managed";
|
|
63
63
|
readonly agentDir: string;
|
|
64
|
+
/** Logical profile root for process-local caches; distinct from managed pathname authority. */
|
|
65
|
+
readonly profileAgentDir: string;
|
|
64
66
|
readonly sessionsRoot: string;
|
|
65
67
|
readonly sessionDir: string;
|
|
66
68
|
readonly rootAuthority: ManagedDirectoryRoot;
|
|
@@ -69,6 +71,8 @@ export interface ManagedSessionSecurityContext {
|
|
|
69
71
|
/** @internal Create the only accepted managed writer authority object. */
|
|
70
72
|
export declare function createManagedSessionSecurityContext(input: {
|
|
71
73
|
agentDir: string;
|
|
74
|
+
/** Optional for compatibility with existing authority-only callers. */
|
|
75
|
+
profileAgentDir?: string;
|
|
72
76
|
sessionsRoot: string;
|
|
73
77
|
sessionDir: string;
|
|
74
78
|
rootAuthority: ManagedDirectoryRoot;
|
|
@@ -3,6 +3,29 @@ export declare const DEFAULT_MAX_LINES = 3000;
|
|
|
3
3
|
export declare const DEFAULT_MAX_BYTES: number;
|
|
4
4
|
export declare const DEFAULT_MAX_COLUMN = 1024;
|
|
5
5
|
export declare const DEFAULT_ARTIFACT_MAX_BYTES: number;
|
|
6
|
+
/**
|
|
7
|
+
* Terminal publisher used when managed artifact storage exposes an ID but no
|
|
8
|
+
* writable pathname. The sink supplies raw content retained up to its artifact
|
|
9
|
+
* hard cap; `omittedBytes` is the source-byte count already omitted by that cap.
|
|
10
|
+
* A successful publisher may report additional omitted bytes (for example, a
|
|
11
|
+
* downstream storage cap); those counts are added to the sink summary. Failed
|
|
12
|
+
* and unavailable results are surfaced through the bounded artifact diagnostic
|
|
13
|
+
* without exposing an unresolvable artifact URL.
|
|
14
|
+
*/
|
|
15
|
+
export type TerminalArtifactPublishResult = {
|
|
16
|
+
status: "published";
|
|
17
|
+
artifactId: string;
|
|
18
|
+
omittedBytes?: number;
|
|
19
|
+
} | {
|
|
20
|
+
status: "unavailable";
|
|
21
|
+
} | {
|
|
22
|
+
status: "failed";
|
|
23
|
+
diagnostic: string;
|
|
24
|
+
};
|
|
25
|
+
export type TerminalArtifactPublisher = (content: string, info: {
|
|
26
|
+
totalBytes: number;
|
|
27
|
+
omittedBytes: number;
|
|
28
|
+
}) => Promise<TerminalArtifactPublishResult>;
|
|
6
29
|
export interface OutputSummary {
|
|
7
30
|
output: string;
|
|
8
31
|
truncated: boolean;
|
|
@@ -18,10 +41,12 @@ export interface OutputSummary {
|
|
|
18
41
|
columnDroppedBytes?: number;
|
|
19
42
|
/** Number of distinct lines that hit the per-line column cap. */
|
|
20
43
|
columnTruncatedLines?: number;
|
|
21
|
-
/** Artifact ID for internal URL access (artifact://<id>) when
|
|
44
|
+
/** Artifact ID for internal URL access (artifact://<id>) when output was persisted. */
|
|
22
45
|
artifactId?: string;
|
|
23
46
|
/** Bytes omitted from artifact storage after the artifact hard cap was reached. */
|
|
24
47
|
artifactTruncatedBytes?: number;
|
|
48
|
+
/** Bounded diagnostic when artifact writer or terminal publisher creation, write, finalization, or publication failed. */
|
|
49
|
+
artifactFailureDiagnostic?: string;
|
|
25
50
|
}
|
|
26
51
|
export interface OutputSinkOptions {
|
|
27
52
|
/**
|
|
@@ -30,6 +55,12 @@ export interface OutputSinkOptions {
|
|
|
30
55
|
*/
|
|
31
56
|
artifactPath?: string;
|
|
32
57
|
artifactId?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Optional terminal publisher for managed artifact stores that do not expose a
|
|
60
|
+
* writable path. It is invoked only when visible spill/truncation requires an
|
|
61
|
+
* artifact, and receives raw content bounded by `artifactMaxBytes`.
|
|
62
|
+
*/
|
|
63
|
+
artifactPublisher?: TerminalArtifactPublisher;
|
|
33
64
|
/** Tail buffer budget (bytes). Default DEFAULT_MAX_BYTES. */
|
|
34
65
|
spillThreshold?: number;
|
|
35
66
|
/**
|
|
@@ -241,12 +272,10 @@ export declare class OutputSink {
|
|
|
241
272
|
* minimizer rewrites the captured output after the raw bytes have already
|
|
242
273
|
* been streamed.
|
|
243
274
|
*
|
|
244
|
-
* After this call the
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
*
|
|
248
|
-
* — which would otherwise reorder content and trip the middle-elision
|
|
249
|
-
* branch in `dump()` against stale totals.
|
|
275
|
+
* After this call the replacement is authoritative: counters reflect its full
|
|
276
|
+
* size, the configured head+tail byte windows are retained with UTF-8-safe
|
|
277
|
+
* boundaries, and future head accumulation is disabled so later `push()` calls
|
|
278
|
+
* append directly to the tail without reordering the replacement.
|
|
250
279
|
*/
|
|
251
280
|
replace(text: string): void;
|
|
252
281
|
dump(notice?: string): Promise<OutputSummary>;
|
|
@@ -48,6 +48,18 @@ export interface DiscoveryOptions {
|
|
|
48
48
|
env?: Record<string, string | undefined>;
|
|
49
49
|
/** Override the platform (defaults to `process.platform`). */
|
|
50
50
|
platform?: NodeJS.Platform;
|
|
51
|
+
/**
|
|
52
|
+
* Claude Code config directory holding `.credentials.json`.
|
|
53
|
+
*
|
|
54
|
+
* Defaults to the trusted `CLAUDE_CONFIG_DIR` value, else `<homeDir>/.claude`.
|
|
55
|
+
*/
|
|
56
|
+
claudeConfigDir?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Codex CLI home directory holding `auth.json`.
|
|
59
|
+
*
|
|
60
|
+
* Defaults to the trusted `CODEX_HOME` value, else `<homeDir>/.codex`.
|
|
61
|
+
*/
|
|
62
|
+
codexHome?: string;
|
|
51
63
|
/**
|
|
52
64
|
* Reader for the macOS Keychain `Claude Code-credentials` entry. Defaults to
|
|
53
65
|
* shelling out to `security`; injected in tests. Returns the raw JSON string,
|
|
@@ -88,6 +88,16 @@ export interface SyncSkillActiveStateOptions {
|
|
|
88
88
|
}
|
|
89
89
|
export declare function normalizeWorkflowHudSummary(raw: unknown): WorkflowHudSummary | undefined;
|
|
90
90
|
export declare function isCanonicalGjcWorkflowSkill(skill: string): skill is CanonicalGjcWorkflowSkill;
|
|
91
|
+
/**
|
|
92
|
+
* Continuation inertness for compaction auto-continue, derived from each
|
|
93
|
+
* workflow's manifest contract: manifest-terminal and explicitly inert phases
|
|
94
|
+
* are inert; unknown skills or phases unknown to the skill's manifest are
|
|
95
|
+
* conservatively inert so a synthetic continuation never wakes an unrecognized
|
|
96
|
+
* workflow. Generic Ultragoal `blocked` remains continuation-active because its
|
|
97
|
+
* blocker may be autonomously resolvable; verified human pauses are represented
|
|
98
|
+
* by the inline goal's `paused` status instead.
|
|
99
|
+
*/
|
|
100
|
+
export declare function isWorkflowContinuationInert(skill: string, phase: string): boolean;
|
|
91
101
|
export declare function listActiveSkills(raw: unknown): SkillActiveEntry[];
|
|
92
102
|
export declare function normalizeSkillActiveState(raw: unknown): SkillActiveState | null;
|
|
93
103
|
export declare function getSkillActiveStatePaths(cwd: string, sessionId?: string): SkillActiveStatePaths;
|
|
@@ -95,6 +105,8 @@ export declare function collapsePlanningPipeline(entries: readonly SkillActiveEn
|
|
|
95
105
|
export type VisibleSkillActiveStateCacheTier = "security" | "hud";
|
|
96
106
|
export interface ReadVisibleSkillActiveStateOptions {
|
|
97
107
|
tier?: VisibleSkillActiveStateCacheTier;
|
|
108
|
+
/** Bypass all signature/TTL caches for authorization decisions. */
|
|
109
|
+
bypassCache?: boolean;
|
|
98
110
|
}
|
|
99
111
|
interface ActiveStateStatSignature {
|
|
100
112
|
path: string;
|
|
@@ -26,6 +26,12 @@ interface RalplanHudState extends WorkflowGateHudState {
|
|
|
26
26
|
verdict?: string;
|
|
27
27
|
latestSummary?: string;
|
|
28
28
|
pendingApproval?: boolean;
|
|
29
|
+
autoHandoff?: {
|
|
30
|
+
configuredTarget: string;
|
|
31
|
+
effectiveTarget: string;
|
|
32
|
+
degradationReason: string | null;
|
|
33
|
+
};
|
|
34
|
+
planningStuck?: boolean;
|
|
29
35
|
updatedAt?: string;
|
|
30
36
|
}
|
|
31
37
|
interface UltragoalLikeGoal {
|
|
@@ -19,7 +19,7 @@ import { SessionManager } from "../session/session-manager";
|
|
|
19
19
|
import type { ContextFileEntry } from "../tools";
|
|
20
20
|
import type { EventBus } from "../utils/event-bus";
|
|
21
21
|
import type { WorkspaceTree } from "../workspace-tree";
|
|
22
|
-
import { type AgentDefinition, type AgentProgress, type
|
|
22
|
+
import { type AgentDefinition, type AgentProgress, type SingleResult } from "./types";
|
|
23
23
|
import { type ExecutorExecutionMode } from "./ultragoal-redteam-activation";
|
|
24
24
|
export declare function trimForkContextSeedForModel(seed: ForkContextSeed, model: Model | undefined): ForkContextSeed;
|
|
25
25
|
/** Options for subagent execution */
|
|
@@ -79,6 +79,8 @@ export interface ExecutorOptions {
|
|
|
79
79
|
* subagents, and a main-model fast-mode auto-disable does not clobber it.
|
|
80
80
|
*/
|
|
81
81
|
inheritedServiceTier?: ServiceTier;
|
|
82
|
+
/** Resolve whether the effective subagent tier grants fast mode for the selected provider. */
|
|
83
|
+
isFastForSubagentProvider?: (provider?: string) => boolean;
|
|
82
84
|
/** Override local:// protocol options so subagent shares parent's local:// root */
|
|
83
85
|
localProtocolOptions?: LocalProtocolOptions;
|
|
84
86
|
/**
|
|
@@ -122,7 +124,6 @@ interface FinalizeSubprocessOutputArgs {
|
|
|
122
124
|
doneAborted: boolean;
|
|
123
125
|
signalAborted: boolean;
|
|
124
126
|
yieldItems?: YieldItem[];
|
|
125
|
-
reportFindings?: ReviewFinding[];
|
|
126
127
|
outputSchema: unknown;
|
|
127
128
|
}
|
|
128
129
|
interface FinalizeSubprocessOutputResult {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { AgentTool, AgentToolResult, AgentToolUpdateCallback } from "@gajae-code/agent-core";
|
|
2
2
|
import type { Model } from "@gajae-code/ai";
|
|
3
3
|
import type { ToolSession } from "..";
|
|
4
|
+
import { type SubagentRunOutcome } from "../async";
|
|
4
5
|
import type { Theme } from "../modes/theme/theme";
|
|
5
|
-
import { type TaskToolDetails, type TaskToolSchemaInstance } from "./types";
|
|
6
|
+
import { type SingleResult, type TaskToolDetails, type TaskToolSchemaInstance } from "./types";
|
|
6
7
|
import "../tools/review";
|
|
7
8
|
import { renderResult, renderCall as renderTaskCall } from "./render";
|
|
9
|
+
export declare function subagentRunOutcomeFromSingleResult(finalText: string, singleResult: Pick<SingleResult, "aborted" | "exitCode" | "paused" | "setupFailure"> | undefined): string | SubagentRunOutcome;
|
|
8
10
|
export { loadBundledAgents as BUNDLED_AGENTS } from "./agents";
|
|
9
11
|
export { discoverCommands, expandCommand, getCommand } from "./commands";
|
|
10
12
|
export { discoverAgents, getAgent } from "./discovery";
|
|
@@ -30,6 +32,10 @@ export declare class TaskTool implements AgentTool<TaskToolSchemaInstance, TaskT
|
|
|
30
32
|
readonly strict = true;
|
|
31
33
|
readonly loadMode = "discoverable";
|
|
32
34
|
readonly renderResult: typeof renderResult;
|
|
35
|
+
/**
|
|
36
|
+
* Session-lifetime durable artifact state is shared atomically by every
|
|
37
|
+
* TaskTool created for the same parent ToolSession.
|
|
38
|
+
*/
|
|
33
39
|
get parameters(): TaskToolSchemaInstance;
|
|
34
40
|
renderCall(args: unknown, options: Parameters<typeof renderTaskCall>[1], theme: Theme): import("@gajae-code/tui").Component;
|
|
35
41
|
/** Dynamic description that reflects current disabled-agent settings */
|
|
@@ -10,6 +10,7 @@ export declare class AgentOutputManager {
|
|
|
10
10
|
#private;
|
|
11
11
|
constructor(getArtifactsDir: () => string | null, options?: {
|
|
12
12
|
parentPrefix?: string;
|
|
13
|
+
getAuthorizedArtifactsDirs?: () => readonly string[];
|
|
13
14
|
});
|
|
14
15
|
/**
|
|
15
16
|
* Allocate a unique ID with numeric prefix.
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import type { AgentProgress, TaskToolDetails } from "./types";
|
|
2
2
|
export type ProviderRetryKind = NonNullable<AgentProgress["retryState"]>["kind"];
|
|
3
3
|
export declare function classifyProviderRetry(errorMessage: string): ProviderRetryKind;
|
|
4
|
+
/**
|
|
5
|
+
* Prefer typed transport facts when present; fall back to message regex for
|
|
6
|
+
* message-only callers that never received `transportFailure.providerCode`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function classifyProviderRetryFromTransport(facts: {
|
|
9
|
+
providerCode?: string;
|
|
10
|
+
errorMessage?: string;
|
|
11
|
+
}): ProviderRetryKind;
|
|
4
12
|
export declare function providerNameFromModel(model: string | undefined): string | undefined;
|
|
5
13
|
export declare function providerRetryPhaseLabel(kind: ProviderRetryKind): string;
|
|
6
14
|
export declare function providerProgressAgeLabel(retryState: NonNullable<AgentProgress["retryState"]>, nowMs: number): string;
|