@sayknow-cli/coding-agent 0.3.7 → 0.3.8
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/dist/types/append-only-mode.d.ts +31 -0
- package/dist/types/capability/rule.d.ts +8 -0
- package/dist/types/cli/completion-cli.d.ts +41 -0
- package/dist/types/cli/config-cli.d.ts +1 -0
- package/dist/types/cli/fixture-report.d.ts +20 -0
- package/dist/types/cli/fixture-report.test.d.ts +1 -0
- package/dist/types/cli/nofile-limit.d.ts +11 -0
- package/dist/types/cli/notify-cli.d.ts +7 -0
- package/dist/types/cli/update-cli.d.ts +22 -0
- package/dist/types/cli.d.ts +124 -1
- package/dist/types/commands/completion.d.ts +29 -0
- package/dist/types/commands/config.d.ts +3 -0
- package/dist/types/commands/deep-interview.d.ts +3 -0
- package/dist/types/config/file-lock.d.ts +7 -6
- package/dist/types/config/keybindings.d.ts +2 -2
- package/dist/types/config/model-profile-activation.d.ts +6 -0
- package/dist/types/config/model-profiles.d.ts +1 -0
- package/dist/types/config/settings-schema.d.ts +105 -1
- package/dist/types/config/settings.d.ts +8 -0
- package/dist/types/discovery/index.d.ts +1 -0
- package/dist/types/export/html/template.generated.d.ts +1 -1
- package/dist/types/export/ttsr.d.ts +14 -3
- package/dist/types/extensibility/extensions/runner.d.ts +2 -1
- package/dist/types/extensibility/extensions/types.d.ts +8 -0
- package/dist/types/goals/runtime.d.ts +1 -0
- package/dist/types/hooks/native-skill-hook.d.ts +12 -0
- package/dist/types/main.d.ts +4 -1
- package/dist/types/modes/components/assistant-message.d.ts +5 -1
- package/dist/types/modes/components/model-selector.d.ts +4 -0
- package/dist/types/modes/components/queued-message-selector.d.ts +12 -0
- package/dist/types/modes/components/settings-selector.d.ts +2 -0
- package/dist/types/modes/components/status-line.d.ts +9 -0
- package/dist/types/modes/controllers/command-controller.d.ts +1 -0
- package/dist/types/modes/controllers/event-controller.d.ts +5 -0
- package/dist/types/modes/controllers/input-controller.d.ts +1 -3
- package/dist/types/modes/interactive-mode.d.ts +2 -0
- package/dist/types/modes/print-mode.d.ts +13 -1
- package/dist/types/modes/prompt-action-autocomplete.d.ts +1 -1
- package/dist/types/modes/rpc/rpc-types.d.ts +14 -0
- package/dist/types/modes/shared/agent-wire/event-contract.d.ts +19 -0
- package/dist/types/modes/shared/agent-wire/event-envelope.d.ts +23 -1
- package/dist/types/modes/types.d.ts +1 -0
- package/dist/types/modes/utils/ui-helpers.d.ts +1 -0
- package/dist/types/notifications/config.d.ts +14 -1
- package/dist/types/notifications/daemon-paths.d.ts +1 -0
- package/dist/types/notifications/index.d.ts +6 -3
- package/dist/types/notifications/lifecycle-commands.d.ts +11 -3
- package/dist/types/notifications/telegram-daemon.d.ts +23 -3
- package/dist/types/notifications/telegram-reference.d.ts +0 -5
- package/dist/types/notifications/threaded-render.d.ts +6 -0
- package/dist/types/runtime-api-key.d.ts +7 -0
- package/dist/types/sdk.d.ts +3 -0
- package/dist/types/session/agent-session.d.ts +61 -6
- package/dist/types/session/agent-storage.d.ts +1 -0
- package/dist/types/session/file-mention-pruning.d.ts +8 -0
- package/dist/types/session/messages.d.ts +4 -0
- package/dist/types/session/session-manager.d.ts +17 -1
- package/dist/types/skc-runtime/deep-interview-ambiguity.d.ts +39 -0
- package/dist/types/skc-runtime/deep-interview-recorder.d.ts +10 -1
- package/dist/types/skc-runtime/deep-interview-state.d.ts +17 -2
- package/dist/types/skc-runtime/session-state-sidecar.d.ts +7 -0
- package/dist/types/skc-runtime/state-writer.d.ts +3 -0
- package/dist/types/skc-runtime/ultragoal-receipt-freshness.d.ts +42 -0
- package/dist/types/skc-runtime/ultragoal-runtime.d.ts +120 -13
- package/dist/types/skill-state/active-state.d.ts +18 -1
- package/dist/types/system-prompt.d.ts +18 -2
- package/dist/types/task/executor.d.ts +3 -0
- package/dist/types/task/fork-context-budget.d.ts +7 -0
- package/dist/types/task/token-log.d.ts +30 -0
- package/dist/types/task/token-log.test.d.ts +1 -0
- package/dist/types/tools/bisect.d.ts +81 -0
- package/dist/types/tools/computer.d.ts +2 -2
- package/dist/types/tools/index.d.ts +1 -0
- package/dist/types/tools/search.d.ts +2 -2
- package/dist/types/tools/ultragoal-ask-guard.d.ts +9 -2
- package/dist/types/utils/file-mentions.d.ts +14 -0
- package/dist/types/utils/git.d.ts +32 -0
- package/dist/types/web/scrapers/youtube.d.ts +8 -0
- package/dist/types/workflow/workflow-intent-diff.d.ts +8 -2
- package/dist/types/workflow/workflow-intent-report-consumer.d.ts +50 -0
- package/dist/types/workflow/workflow-intent-report-schema.d.ts +2 -0
- package/dist/types/workflow/workflow-intent-report.d.ts +48 -0
- package/package.json +8 -8
- package/src/append-only-mode.ts +58 -0
- package/src/autoresearch/prompt.md +1 -1
- package/src/autoresearch/tools/log-experiment.ts +1 -1
- package/src/capability/rule.ts +9 -0
- package/src/cli/completion-cli.ts +234 -0
- package/src/cli/config-cli.ts +61 -9
- package/src/cli/fast-help.ts +1 -0
- package/src/cli/fixture-report.test.ts +230 -0
- package/src/cli/fixture-report.ts +171 -0
- package/src/cli/nofile-limit.ts +48 -0
- package/src/cli/notify-cli.ts +92 -8
- package/src/cli/telegram-cli.ts +1 -1
- package/src/cli/update-cli.ts +85 -9
- package/src/cli.ts +29 -1
- package/src/commands/completion.ts +84 -0
- package/src/commands/config.ts +2 -0
- package/src/commands/contribution-prep.ts +1 -1
- package/src/commands/deep-interview.ts +2 -1
- package/src/config/file-lock.ts +73 -34
- package/src/config/keybindings.ts +2 -2
- package/src/config/model-profile-activation.ts +65 -0
- package/src/config/model-profiles.ts +31 -2
- package/src/config/settings-schema.ts +68 -1
- package/src/config/settings.ts +22 -0
- package/src/defaults/skc/skills/team/SKILL.md +17 -14
- package/src/defaults/skc/skills/ultragoal/SKILL.md +59 -4
- package/src/defaults/skc/skills/ultragoal/pipeline-validation-contracts.md +30 -0
- package/src/defaults/skc-defaults.ts +9 -0
- package/src/discovery/helpers.ts +10 -0
- package/src/discovery/index.ts +1 -0
- package/src/export/html/template.generated.ts +1 -1
- package/src/export/html/template.js +60 -2
- package/src/export/ttsr.ts +96 -18
- package/src/extensibility/extensions/runner.ts +183 -219
- package/src/extensibility/extensions/types.ts +9 -0
- package/src/extensibility/skc-plugins/runtime-adapters.ts +156 -44
- package/src/goals/runtime.ts +10 -2
- package/src/hindsight/backend.ts +1 -3
- package/src/hooks/native-skill-hook.ts +124 -4
- package/src/internal-urls/docs-index.generated.ts +14 -5
- package/src/main.ts +95 -43
- package/src/memories/index.ts +12 -1
- package/src/modes/components/assistant-message.ts +241 -82
- package/src/modes/components/custom-editor.ts +1 -0
- package/src/modes/components/model-selector.ts +54 -11
- package/src/modes/components/queued-message-selector.ts +92 -0
- package/src/modes/components/settings-selector.ts +4 -0
- package/src/modes/components/status-line.ts +167 -54
- package/src/modes/components/tool-execution.ts +44 -19
- package/src/modes/components/welcome.ts +181 -44
- package/src/modes/controllers/command-controller.ts +40 -4
- package/src/modes/controllers/event-controller.ts +66 -47
- package/src/modes/controllers/extension-ui-controller.ts +4 -10
- package/src/modes/controllers/input-controller.ts +180 -18
- package/src/modes/controllers/selector-controller.ts +127 -24
- package/src/modes/interactive-mode.ts +51 -16
- package/src/modes/print-mode.ts +43 -4
- package/src/modes/prompt-action-autocomplete.ts +21 -20
- package/src/modes/rpc/rpc-mode.ts +29 -3
- package/src/modes/rpc/rpc-types.ts +9 -0
- package/src/modes/shared/agent-wire/command-validation.ts +4 -0
- package/src/modes/shared/agent-wire/event-contract.ts +22 -0
- package/src/modes/shared/agent-wire/event-envelope.ts +82 -0
- package/src/modes/shared/agent-wire/scopes.ts +1 -0
- package/src/modes/types.ts +1 -0
- package/src/modes/utils/hotkeys-markdown.ts +1 -0
- package/src/modes/utils/ui-helpers.ts +20 -7
- package/src/notifications/config.ts +25 -5
- package/src/notifications/daemon-paths.ts +2 -0
- package/src/notifications/index.ts +117 -14
- package/src/notifications/lifecycle-commands.ts +37 -7
- package/src/notifications/lifecycle-orchestrator.ts +19 -6
- package/src/notifications/telegram-daemon-control.ts +5 -3
- package/src/notifications/telegram-daemon.ts +302 -51
- package/src/notifications/telegram-reference.ts +0 -16
- package/src/notifications/threaded-render.ts +17 -1
- package/src/prompts/agents/architect.md +19 -10
- package/src/prompts/agents/critic.md +16 -18
- package/src/prompts/agents/executor.md +14 -11
- package/src/prompts/agents/planner.md +18 -13
- package/src/prompts/ci-green-request.md +3 -8
- package/src/prompts/goals/goal-continuation.md +0 -5
- package/src/prompts/goals/goal-mode-active.md +0 -5
- package/src/prompts/system/agent-creation-architect.md +2 -2
- package/src/prompts/system/plan-mode-active.md +1 -1
- package/src/prompts/system/plan-mode-subagent.md +3 -3
- package/src/prompts/system/project-prompt.md +0 -13
- package/src/prompts/system/subagent-system-prompt.md +3 -2
- package/src/prompts/system/system-prompt.md +29 -17
- package/src/prompts/system/volatile-project-context.md +10 -0
- package/src/prompts/system/web-search.md +4 -7
- package/src/prompts/tools/apply-patch.md +6 -0
- package/src/prompts/tools/ast-edit.md +1 -0
- package/src/prompts/tools/bash.md +1 -1
- package/src/prompts/tools/bisect.md +22 -0
- package/src/prompts/tools/browser.md +1 -1
- package/src/prompts/tools/computer.md +2 -2
- package/src/prompts/tools/cron.md +0 -2
- package/src/prompts/tools/eval.md +2 -2
- package/src/prompts/tools/find.md +1 -1
- package/src/prompts/tools/github.md +6 -6
- package/src/prompts/tools/goal.md +1 -3
- package/src/prompts/tools/image-gen.md +12 -5
- package/src/prompts/tools/irc.md +5 -4
- package/src/prompts/tools/job.md +2 -2
- package/src/prompts/tools/lsp.md +1 -1
- package/src/prompts/tools/monitor.md +2 -2
- package/src/prompts/tools/patch.md +2 -2
- package/src/prompts/tools/replace.md +2 -21
- package/src/prompts/tools/rewind.md +1 -1
- package/src/prompts/tools/search-tool-bm25.md +1 -11
- package/src/prompts/tools/search.md +1 -1
- package/src/prompts/tools/skill.md +3 -2
- package/src/prompts/tools/ssh.md +2 -1
- package/src/prompts/tools/subagent.md +2 -2
- package/src/prompts/tools/task.md +4 -5
- package/src/prompts/tools/todo-write.md +1 -1
- package/src/prompts/tools/vim.md +1 -0
- package/src/prompts/tools/web-search.md +2 -0
- package/src/prompts/tools/write.md +8 -2
- package/src/runtime-api-key.ts +16 -0
- package/src/sdk.ts +52 -28
- package/src/session/agent-session.ts +1011 -141
- package/src/session/agent-storage.ts +4 -0
- package/src/session/file-mention-pruning.ts +64 -0
- package/src/session/messages.ts +4 -0
- package/src/session/session-manager.ts +103 -4
- package/src/skc-runtime/deep-interview-ambiguity.ts +206 -0
- package/src/skc-runtime/deep-interview-recorder.ts +62 -8
- package/src/skc-runtime/deep-interview-state.ts +44 -2
- package/src/skc-runtime/session-state-sidecar.ts +263 -20
- package/src/skc-runtime/state-runtime.ts +12 -2
- package/src/skc-runtime/state-writer.ts +15 -0
- package/src/skc-runtime/ultragoal-guard.ts +55 -66
- package/src/skc-runtime/ultragoal-receipt-freshness.ts +315 -0
- package/src/skc-runtime/ultragoal-runtime.ts +1663 -159
- package/src/skc-runtime/workflow-manifest.generated.json +113 -2
- package/src/skc-runtime/workflow-manifest.ts +74 -1
- package/src/skill-state/active-state.ts +141 -5
- package/src/skill-state/deep-interview-mutation-guard.ts +67 -3
- package/src/slash-commands/builtin-registry.ts +218 -71
- package/src/system-prompt.ts +57 -16
- package/src/task/executor.ts +132 -24
- package/src/task/fork-context-advisory.ts +2 -7
- package/src/task/fork-context-budget.ts +9 -0
- package/src/task/index.ts +13 -6
- package/src/task/output-manager.ts +20 -8
- package/src/task/receipt.ts +26 -7
- package/src/task/token-log.test.ts +188 -0
- package/src/task/token-log.ts +179 -0
- package/src/tools/bisect.ts +367 -0
- package/src/tools/computer.ts +246 -43
- package/src/tools/index.ts +3 -0
- package/src/tools/output-meta.ts +116 -4
- package/src/tools/search.ts +8 -2
- package/src/tools/skill.ts +15 -0
- package/src/tools/telegram-send.ts +6 -0
- package/src/tools/ultragoal-ask-guard.ts +39 -5
- package/src/utils/file-mentions.ts +39 -7
- package/src/utils/git.ts +73 -0
- package/src/web/scrapers/youtube.ts +24 -12
- package/src/workflow/workflow-intent-diff.ts +29 -6
- package/src/workflow/workflow-intent-report-consumer.ts +221 -0
- package/src/workflow/workflow-intent-report-schema.ts +129 -0
- package/src/workflow/workflow-intent-report.ts +135 -0
package/dist/types/sdk.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type AgentTelemetryConfig, type ThinkingLevel } from "@sayknow-cli/agent-core";
|
|
2
2
|
import { type Model, type ProviderSessionState } from "@sayknow-cli/ai";
|
|
3
|
+
import { createAppendOnlyContextManager, providerSupportsAppendOnlyAuto, resolveAppendOnlyMode } from "./append-only-mode";
|
|
3
4
|
import { type Rule } from "./capability/rule";
|
|
4
5
|
import { ModelRegistry } from "./config/model-registry";
|
|
5
6
|
import { type ScopedModelSelection } from "./config/model-resolver";
|
|
@@ -241,5 +242,7 @@ export interface BuildSystemPromptOptions {
|
|
|
241
242
|
* as separate entries so providers can cache prompt prefixes without concatenating blocks.
|
|
242
243
|
*/
|
|
243
244
|
export declare function buildSystemPrompt(options?: BuildSystemPromptOptions): Promise<BuildSystemPromptResult>;
|
|
245
|
+
export { createAppendOnlyContextManager, providerSupportsAppendOnlyAuto, resolveAppendOnlyMode };
|
|
244
246
|
export declare function createPluginHooksExtension(hooks: ConstrainedPluginHook[]): ExtensionFactory;
|
|
247
|
+
export declare function resolveIntentTracingEnabled(intentTracingSetting: boolean | undefined, hasUI: boolean): boolean;
|
|
245
248
|
export declare function createAgentSession(options?: CreateAgentSessionOptions): Promise<CreateAgentSessionResult>;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import { type Agent, type AgentEvent, type AgentMessage, type AgentState, type AgentTool, type StablePrefixSnapshot, ThinkingLevel } from "@sayknow-cli/agent-core";
|
|
16
16
|
import { type CompactionResult, type EmergencyCompactionSample } from "@sayknow-cli/agent-core/compaction";
|
|
17
|
-
import type { AssistantMessage, Effort, ImageContent, Message, MessageAttribution, Model, ProviderSessionState, ServiceTier, SimpleStreamOptions, TextContent, ToolChoice, UsageReport } from "@sayknow-cli/ai";
|
|
17
|
+
import type { AssistantMessage, Effort, ImageContent, Message, MessageAttribution, Model, ProviderSessionState, ServiceTier, SimpleStreamOptions, TextContent, ToolCall, ToolChoice, UsageReport } from "@sayknow-cli/ai";
|
|
18
18
|
export interface ForkContextSeedMetadata {
|
|
19
19
|
sourceSessionId: string;
|
|
20
20
|
parentMessageCount: number;
|
|
@@ -75,6 +75,7 @@ import { type DiscoverableTool, type DiscoverableToolSearchIndex } from "../tool
|
|
|
75
75
|
import type { AskAnswerSource, ToolSession } from "../tools";
|
|
76
76
|
import type { CheckpointState } from "../tools/checkpoint";
|
|
77
77
|
import { type TodoItem, type TodoPhase } from "../tools/todo-write";
|
|
78
|
+
import { type WorkspaceTree } from "../workspace-tree";
|
|
78
79
|
import type { ClientBridge } from "./client-bridge";
|
|
79
80
|
import { type ContributionPrepOptions, type ContributionPrepResult } from "./contribution-prep";
|
|
80
81
|
import { type CustomMessage } from "./messages";
|
|
@@ -159,7 +160,7 @@ export interface AgentSessionConfig {
|
|
|
159
160
|
agent: Agent;
|
|
160
161
|
sessionManager: SessionManager;
|
|
161
162
|
settings: Settings;
|
|
162
|
-
/** Models to cycle through with
|
|
163
|
+
/** Models to cycle through with Alt+N (from --models flag) */
|
|
163
164
|
scopedModels?: ScopedModelSelection[];
|
|
164
165
|
/** Initial session thinking selector. */
|
|
165
166
|
thinkingLevel?: ThinkingLevel;
|
|
@@ -200,6 +201,8 @@ export interface AgentSessionConfig {
|
|
|
200
201
|
rebuildSystemPrompt?: (toolNames: string[], tools: Map<string, AgentTool>) => Promise<{
|
|
201
202
|
systemPrompt: string[];
|
|
202
203
|
}>;
|
|
204
|
+
/** Initial workspace tree snapshot used for the first volatile per-turn context message. */
|
|
205
|
+
workspaceTree?: WorkspaceTree;
|
|
203
206
|
/** Rebuild the SSH tool from current capability discovery results. */
|
|
204
207
|
reloadSshTool?: () => Promise<AgentTool | null>;
|
|
205
208
|
requestedToolNames?: ReadonlySet<string>;
|
|
@@ -317,6 +320,13 @@ export interface SessionStats {
|
|
|
317
320
|
premiumRequests: number;
|
|
318
321
|
cost: number;
|
|
319
322
|
}
|
|
323
|
+
export type QueuedMessageEditMode = "steer" | "followUp";
|
|
324
|
+
export interface QueuedMessageEditEntry {
|
|
325
|
+
id: string;
|
|
326
|
+
text: string;
|
|
327
|
+
mode: QueuedMessageEditMode;
|
|
328
|
+
label: string;
|
|
329
|
+
}
|
|
320
330
|
/** A custom message contributed at the before-agent-start point. */
|
|
321
331
|
export type BeforeAgentStartInternalMessage = Pick<CustomMessage, "customType" | "content" | "display" | "details" | "attribution">;
|
|
322
332
|
/**
|
|
@@ -329,6 +339,33 @@ export type BeforeAgentStartContributor = (event: {
|
|
|
329
339
|
images?: ImageContent[];
|
|
330
340
|
sessionId: string | undefined;
|
|
331
341
|
}) => Promise<BeforeAgentStartInternalMessage | undefined>;
|
|
342
|
+
export declare class WorkerIntegrationRequestScheduler {
|
|
343
|
+
#private;
|
|
344
|
+
readonly request: () => Promise<void>;
|
|
345
|
+
constructor(request: () => Promise<void>);
|
|
346
|
+
enqueue(): void;
|
|
347
|
+
flush(): Promise<void>;
|
|
348
|
+
}
|
|
349
|
+
export type StreamingEditParsedToolCall = {
|
|
350
|
+
toolCall: ToolCall;
|
|
351
|
+
path: string;
|
|
352
|
+
resolvedPath: string;
|
|
353
|
+
diff?: string;
|
|
354
|
+
op?: string;
|
|
355
|
+
rename?: string;
|
|
356
|
+
};
|
|
357
|
+
export type StreamingEditParsedCacheEntry = {
|
|
358
|
+
version: string;
|
|
359
|
+
parsed: StreamingEditParsedToolCall | undefined;
|
|
360
|
+
};
|
|
361
|
+
export declare function getStreamingEditToolCallForEvent(event: AgentEvent, cache: Map<string, StreamingEditParsedCacheEntry>, resolvePath: (filePath: string) => string | undefined): StreamingEditParsedToolCall | undefined;
|
|
362
|
+
/** Test-only counters for AgentSession event fan-out hot-path assertions. */
|
|
363
|
+
export declare const __agentSessionPerfCounters: {
|
|
364
|
+
listenerSnapshotRebuilds: number;
|
|
365
|
+
messageUpdateExtensionQueues: number;
|
|
366
|
+
reset(): void;
|
|
367
|
+
};
|
|
368
|
+
export declare function buildContextInjectionSignature(kind: string, parts: readonly string[]): string;
|
|
332
369
|
export declare class AgentSession {
|
|
333
370
|
#private;
|
|
334
371
|
readonly agent: Agent;
|
|
@@ -337,6 +374,13 @@ export declare class AgentSession {
|
|
|
337
374
|
readonly taskDepth: number;
|
|
338
375
|
readonly yieldQueue: YieldQueue;
|
|
339
376
|
readonly configWarnings: string[];
|
|
377
|
+
readonly streamingEditDebugCounters: {
|
|
378
|
+
guardRuns: number;
|
|
379
|
+
processedChars: number;
|
|
380
|
+
checkedRemovedLines: number;
|
|
381
|
+
fullChecks: number;
|
|
382
|
+
nonEditDeterminations: number;
|
|
383
|
+
};
|
|
340
384
|
readonly rawSseDebugBuffer: RawSseDebugBuffer;
|
|
341
385
|
constructor(config: AgentSessionConfig);
|
|
342
386
|
/** Model registry for API key resolution and model discovery */
|
|
@@ -670,8 +714,11 @@ export declare class AgentSession {
|
|
|
670
714
|
steering: readonly string[];
|
|
671
715
|
followUp: readonly string[];
|
|
672
716
|
};
|
|
717
|
+
getQueuedMessageEntries(): QueuedMessageEditEntry[];
|
|
718
|
+
removeQueuedMessageForEditing(id: string): string | undefined;
|
|
719
|
+
moveQueuedMessageForEditing(id: string, direction: "up" | "down"): boolean;
|
|
673
720
|
/**
|
|
674
|
-
* Pop the
|
|
721
|
+
* Pop the newest queued message across steering and follow-up queues.
|
|
675
722
|
* Used by dequeue keybinding to restore messages to editor one at a time.
|
|
676
723
|
* Returns the popped entry's `.text`; the tag (if any) dies with the
|
|
677
724
|
* record — no orphan state can outlive the queue entry.
|
|
@@ -706,6 +753,11 @@ export declare class AgentSession {
|
|
|
706
753
|
* @returns true if completed, false if cancelled by hook
|
|
707
754
|
*/
|
|
708
755
|
newSession(options?: NewSessionOptions): Promise<boolean>;
|
|
756
|
+
/**
|
|
757
|
+
* Clear active conversational/model context while preserving the current
|
|
758
|
+
* session identity and durable history trail.
|
|
759
|
+
*/
|
|
760
|
+
clearContext(): Promise<boolean>;
|
|
709
761
|
/**
|
|
710
762
|
* Set a display name for the current session.
|
|
711
763
|
*/
|
|
@@ -905,9 +957,12 @@ export declare class AgentSession {
|
|
|
905
957
|
*/
|
|
906
958
|
setAutoRetryEnabled(enabled: boolean): void;
|
|
907
959
|
/**
|
|
908
|
-
* Manually retry the last failed assistant turn
|
|
909
|
-
*
|
|
910
|
-
*
|
|
960
|
+
* Manually retry the last failed assistant turn, or resume an interrupted tail
|
|
961
|
+
* left by a non-graceful process exit after the user/custom/tool-result message
|
|
962
|
+
* was persisted but before the agent emitted a terminal assistant response.
|
|
963
|
+
* Removes failed/aborted/unresolved tool-use assistant tails before
|
|
964
|
+
* re-attempting with a fresh retry budget.
|
|
965
|
+
* @returns true if retry/resume was initiated, false if no retryable tail exists or agent is busy
|
|
911
966
|
*/
|
|
912
967
|
retry(): Promise<boolean>;
|
|
913
968
|
/**
|
|
@@ -93,6 +93,7 @@ export declare class AgentStorage {
|
|
|
93
93
|
* Sets a cached value with expiry time (unix seconds).
|
|
94
94
|
*/
|
|
95
95
|
setCache(key: string, value: string, expiresAtSec: number): void;
|
|
96
|
+
deleteCachePrefix(prefix: string): void;
|
|
96
97
|
/**
|
|
97
98
|
* Deletes expired cache entries. Call periodically for cleanup.
|
|
98
99
|
*/
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SessionEntry, SessionMessageEntry } from "./session-manager";
|
|
2
|
+
export interface FileMentionPruneResult {
|
|
3
|
+
changed: SessionMessageEntry[];
|
|
4
|
+
bytesSaved: number;
|
|
5
|
+
}
|
|
6
|
+
/** Notice injected in place of a superseded file-mention body. */
|
|
7
|
+
export declare function stalefileMentionNotice(path: string): string;
|
|
8
|
+
export declare function pruneStaleFileMentions(entries: readonly SessionEntry[], resolveAbs: (path: string) => string): FileMentionPruneResult;
|
|
@@ -129,6 +129,10 @@ export interface FileMentionMessage {
|
|
|
129
129
|
/** Why the file contents were omitted from auto-read. */
|
|
130
130
|
skippedReason?: "tooLarge";
|
|
131
131
|
image?: ImageContent;
|
|
132
|
+
/** Set when this mention duplicated a recently shown path (compact note, no full body). */
|
|
133
|
+
duplicate?: boolean;
|
|
134
|
+
/** Set when a stale entry was pruned to a digest notice (never silently deleted). */
|
|
135
|
+
pruned?: boolean;
|
|
132
136
|
}>;
|
|
133
137
|
timestamp: number;
|
|
134
138
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AgentMessage } from "@sayknow-cli/agent-core";
|
|
2
2
|
import type { ImageContent, Message, MessageAttribution, ServiceTier, TextContent } from "@sayknow-cli/ai";
|
|
3
|
+
import type { TtsrInjectionRecord } from "../export/ttsr";
|
|
3
4
|
import { ArtifactManager } from "./artifacts";
|
|
4
5
|
import { type BlobPutResult, BlobStore } from "./blob-store";
|
|
5
6
|
import { type BashExecutionMessage, type CustomMessage, type FileMentionMessage, type HookMessage, type PythonExecutionMessage } from "./messages";
|
|
@@ -141,6 +142,10 @@ export interface TtsrInjectionEntry extends SessionEntryBase {
|
|
|
141
142
|
type: "ttsr_injection";
|
|
142
143
|
/** Names of rules that were injected */
|
|
143
144
|
injectedRules: string[];
|
|
145
|
+
/** Rich rule injection records with repeat state. */
|
|
146
|
+
injectedRuleRecords?: TtsrInjectionRecord[];
|
|
147
|
+
/** TTSR manager message count when this injection was recorded. */
|
|
148
|
+
ttsrMessageCount?: number;
|
|
144
149
|
}
|
|
145
150
|
/** Persisted MCP discovery selection state for a session branch. */
|
|
146
151
|
export interface MCPToolSelectionEntry extends SessionEntryBase {
|
|
@@ -212,6 +217,10 @@ export interface SessionContext {
|
|
|
212
217
|
models: Record<string, string>;
|
|
213
218
|
/** Names of TTSR rules that have been injected this session */
|
|
214
219
|
injectedTtsrRules: string[];
|
|
220
|
+
/** Rich TTSR rule injection records for repeat resume. */
|
|
221
|
+
injectedTtsrRuleRecords?: TtsrInjectionRecord[];
|
|
222
|
+
/** TTSR manager message count for repeat resume. */
|
|
223
|
+
ttsrMessageCount?: number;
|
|
215
224
|
/** MCP tool names selected through discovery for this session branch. */
|
|
216
225
|
selectedMCPToolNames: string[];
|
|
217
226
|
/** Whether this branch contains an explicit persisted MCP selection entry. */
|
|
@@ -477,6 +486,13 @@ export declare class SessionManager {
|
|
|
477
486
|
appendCompaction<T = unknown>(summary: string, shortSummary: string | undefined, firstKeptEntryId: string, tokensBefore: number, details?: T, fromExtension?: boolean, preserveData?: Record<string, unknown>): string;
|
|
478
487
|
/** Append a custom entry (for extensions) as child of current leaf, then advance leaf. Returns entry id. */
|
|
479
488
|
appendCustomEntry(customType: string, data?: unknown): string;
|
|
489
|
+
/**
|
|
490
|
+
* Append a root marker that starts a fresh active branch without changing the
|
|
491
|
+
* session id or deleting earlier durable entries. Subsequent messages descend
|
|
492
|
+
* from this marker, so provider context is clear while history remains
|
|
493
|
+
* available for diagnostics/export.
|
|
494
|
+
*/
|
|
495
|
+
appendContextClearEntry(data?: Record<string, unknown>): string;
|
|
480
496
|
/**
|
|
481
497
|
* Write mutated message entries back into the canonical entry store by id.
|
|
482
498
|
*
|
|
@@ -511,7 +527,7 @@ export declare class SessionManager {
|
|
|
511
527
|
* @param ruleNames Names of rules that were injected
|
|
512
528
|
* @returns Entry id
|
|
513
529
|
*/
|
|
514
|
-
appendTtsrInjection(ruleNames: string[]): string;
|
|
530
|
+
appendTtsrInjection(ruleNames: string[], records?: TtsrInjectionRecord[], ttsrMessageCount?: number): string;
|
|
515
531
|
/**
|
|
516
532
|
* Get all unique TTSR rule names that have been injected in the current branch.
|
|
517
533
|
* Scans from root to current leaf for ttsr_injection entries.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type DeepInterviewStateEnvelope } from "./deep-interview-state";
|
|
2
|
+
export interface AmbiguityFloorBreakdown {
|
|
3
|
+
floor: number;
|
|
4
|
+
disputed_fact_count: number;
|
|
5
|
+
unscored_active_component_count: number;
|
|
6
|
+
auto_answer_ratio: number;
|
|
7
|
+
}
|
|
8
|
+
export interface AmbiguityClampResult {
|
|
9
|
+
effective: number;
|
|
10
|
+
clamped: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** Compute the deterministic floor from the inner deep-interview `state` object. */
|
|
13
|
+
export declare function computeAmbiguityFloor(inner: unknown): AmbiguityFloorBreakdown;
|
|
14
|
+
/** Clamp an LLM-reported ambiguity to the deterministic floor: `max(reported, floor)`. */
|
|
15
|
+
export declare function clampReportedAmbiguity(reported: number, floor: number): AmbiguityClampResult;
|
|
16
|
+
/**
|
|
17
|
+
* Mark every established fact recorded in `retractedRound` as disputed. This is the
|
|
18
|
+
* mechanical contradiction signal for answer retraction: when the user replaces an
|
|
19
|
+
* already-scored answer (A -> B pivot), the facts that answer established can no
|
|
20
|
+
* longer be trusted, so they raise the floor until re-confirmed or superseded.
|
|
21
|
+
* Returns new arrays/objects; never mutates the input.
|
|
22
|
+
*/
|
|
23
|
+
export declare function disputeFactsFromRetractedRound(facts: readonly unknown[], retractedRound: number): {
|
|
24
|
+
facts: Record<string, unknown>[];
|
|
25
|
+
disputedIds: string[];
|
|
26
|
+
};
|
|
27
|
+
export interface AppliedAmbiguityFloor {
|
|
28
|
+
envelope: DeepInterviewStateEnvelope;
|
|
29
|
+
breakdown: AmbiguityFloorBreakdown;
|
|
30
|
+
clamped: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Enforce the floor invariant on a full deep-interview envelope: recompute the floor
|
|
34
|
+
* from persisted evidence, clamp `state.current_ambiguity`, and clamp the latest
|
|
35
|
+
* scored round (preserving the original value as `reported_ambiguity` for audit).
|
|
36
|
+
* Historical rounds are never rewritten. Idempotent and non-mutating; every writer
|
|
37
|
+
* (state CLI write/reconcile, recorder) applies this immediately before persisting.
|
|
38
|
+
*/
|
|
39
|
+
export declare function applyAmbiguityFloorToEnvelope(value: unknown): AppliedAmbiguityFloor;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type DeepInterviewEstablishedFact, type DeepInterviewRoundRecord, type DeepInterviewStateEnvelope, type DeepInterviewTriggerMetadata } from "./deep-interview-state";
|
|
2
|
+
export * from "./deep-interview-ambiguity";
|
|
2
3
|
export * from "./deep-interview-state";
|
|
3
4
|
/**
|
|
4
5
|
* Runtime-owned deep-interview round recorder (conflict-aware scoring support).
|
|
@@ -86,12 +87,20 @@ export declare function projectCompactState(value: unknown, options?: {
|
|
|
86
87
|
}): DeepInterviewCompactState;
|
|
87
88
|
/** Refresh the best-effort HUD cache from persisted deep-interview state. */
|
|
88
89
|
export declare function syncDeepInterviewRecorderHud(cwd: string, statePath: string, sessionId: string | undefined): Promise<void>;
|
|
89
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* Record an `answered` shell for one round (append-or-merge by durable key).
|
|
92
|
+
*
|
|
93
|
+
* Retraction dynamics: replacing an already-`scored` answer is a mechanical
|
|
94
|
+
* contradiction signal (the user pivoted). The facts that round established are
|
|
95
|
+
* marked disputed, which raises the deterministic ambiguity floor immediately —
|
|
96
|
+
* without waiting for the LLM scorer to self-report a trigger.
|
|
97
|
+
*/
|
|
90
98
|
export declare function appendOrMergeDeepInterviewRound(cwd: string, statePath: string, input: DeepInterviewAnswerInput, options?: {
|
|
91
99
|
sessionId?: string;
|
|
92
100
|
}): Promise<{
|
|
93
101
|
action: AppendOrMergeAction;
|
|
94
102
|
record: DeepInterviewRoundRecord;
|
|
103
|
+
disputedFactIds?: string[];
|
|
95
104
|
}>;
|
|
96
105
|
/** Merge scoring output into the same round record, transitioning to `scored`. */
|
|
97
106
|
export declare function enrichDeepInterviewRoundScoring(cwd: string, statePath: string, input: DeepInterviewScoringInput, options?: {
|
|
@@ -21,6 +21,13 @@ export interface DeepInterviewEstablishedFact {
|
|
|
21
21
|
dimension?: string;
|
|
22
22
|
evidence?: string;
|
|
23
23
|
disputed: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Resolution pointer for a disputed fact: the id of the fact that replaced it
|
|
26
|
+
* after the user confirmed a pivot. A disputed fact without `superseded_by`
|
|
27
|
+
* keeps the deterministic ambiguity floor elevated; setting it releases the
|
|
28
|
+
* pressure while preserving the contradicted fact for audit.
|
|
29
|
+
*/
|
|
30
|
+
superseded_by?: string;
|
|
24
31
|
}
|
|
25
32
|
export interface DeepInterviewTriggerMetadata {
|
|
26
33
|
kind: DeepInterviewTriggerKind;
|
|
@@ -54,7 +61,12 @@ export interface DeepInterviewRoundRecord {
|
|
|
54
61
|
answered_at: string;
|
|
55
62
|
scored_at?: string;
|
|
56
63
|
scores?: Record<string, number>;
|
|
64
|
+
/** Effective ambiguity after the deterministic floor clamp (`max(reported, floor)`). */
|
|
57
65
|
ambiguity?: number;
|
|
66
|
+
/** Original LLM-reported ambiguity, preserved for audit when the floor clamped it. */
|
|
67
|
+
reported_ambiguity?: number;
|
|
68
|
+
/** Deterministic floor in effect when this round was scored, when it clamped. */
|
|
69
|
+
ambiguity_floor?: number;
|
|
58
70
|
triggers?: DeepInterviewTriggerMetadata[];
|
|
59
71
|
}
|
|
60
72
|
export interface DeepInterviewStateEnvelope {
|
|
@@ -80,8 +92,11 @@ export declare function deriveRoundKey(interviewId: string | undefined, input: {
|
|
|
80
92
|
* legacy flattened fields hoisted in losslessly, transcript duplicates removed
|
|
81
93
|
* from the top level, and `rounds`/`established_facts` guaranteed to be arrays.
|
|
82
94
|
*
|
|
83
|
-
* Idempotent: a canonical envelope is returned unchanged in shape.
|
|
84
|
-
* unknown envelope
|
|
95
|
+
* Idempotent: a canonical envelope is returned unchanged in shape. Preserves all
|
|
96
|
+
* unknown envelope and nested fields except the envelope-reserved keys that leak
|
|
97
|
+
* into `state` (see `ENVELOPE_RESERVED_STATE_KEYS`), which are stripped so a
|
|
98
|
+
* malformed envelope-in-state write cannot permanently nest state. Never mutates
|
|
99
|
+
* the input.
|
|
85
100
|
*/
|
|
86
101
|
export declare function normalizeDeepInterviewEnvelope(value: unknown): DeepInterviewStateEnvelope;
|
|
87
102
|
/**
|
|
@@ -3,6 +3,11 @@ export declare const SKC_COORDINATOR_SESSION_STATE_FILE_ENV = "SKC_COORDINATOR_S
|
|
|
3
3
|
export declare const SKC_COORDINATOR_SESSION_ID_ENV = "SKC_COORDINATOR_SESSION_ID";
|
|
4
4
|
export declare const SKC_COORDINATOR_SESSION_BRANCH_ENV = "SKC_COORDINATOR_SESSION_BRANCH";
|
|
5
5
|
export type RuntimeState = "ready_for_input" | "running" | "needs_user_input" | "completed" | "errored";
|
|
6
|
+
/** Test-only counters for runtime sidecar hot-path assertions. */
|
|
7
|
+
export declare const __sessionStateSidecarPerfCounters: {
|
|
8
|
+
persistFromEventCalls: number;
|
|
9
|
+
reset(): void;
|
|
10
|
+
};
|
|
6
11
|
interface RuntimeStateEvent {
|
|
7
12
|
type: string;
|
|
8
13
|
messages?: unknown[];
|
|
@@ -26,6 +31,8 @@ export declare function readTerminalRuntimeStateMarker(input: {
|
|
|
26
31
|
cwd?: string | null;
|
|
27
32
|
sessionFile?: string | null;
|
|
28
33
|
}): Promise<TerminalRuntimeStateStatus>;
|
|
34
|
+
export declare function stateForEvent(event: RuntimeStateEvent): RuntimeState | null;
|
|
35
|
+
export declare function eventAffectsCoordinatorRuntimeState(event: RuntimeStateEvent): boolean;
|
|
29
36
|
export declare function persistCoordinatorRuntimeStateFromEvent(event: RuntimeStateEvent, context: RuntimeStateContext): Promise<void>;
|
|
30
37
|
export declare function persistCoordinatorRuntimeStateFromPostmortem(reason: postmortem.Reason, context: RuntimeStateContext): void;
|
|
31
38
|
export declare function registerCoordinatorRuntimeStateFinalizer(context: RuntimeStateContext): () => void;
|
|
@@ -142,6 +142,8 @@ export declare function readExistingStateForMutation(filePath: string): Promise<
|
|
|
142
142
|
export declare function workflowEnvelopeContentSha256(value: unknown): string;
|
|
143
143
|
export declare function stampWorkflowEnvelopeChecksum<T>(value: T, filePath: string, computedAt?: string): T;
|
|
144
144
|
export declare function detectWorkflowEnvelopeIntegrityMismatch(filePath: string): Promise<WorkflowEnvelopeIntegrityMismatch | undefined>;
|
|
145
|
+
type ActiveStateCacheInvalidator = (cwd?: string, sessionId?: string) => void;
|
|
146
|
+
export declare function setActiveStateCacheInvalidator(invalidator: ActiveStateCacheInvalidator): void;
|
|
145
147
|
export declare function persistedStateRevision(value: unknown): number;
|
|
146
148
|
export declare function writeGuardedJsonAtomic(targetPath: string, value: unknown, options: GuardedStateWriterOptions): Promise<GuardedWriteResult>;
|
|
147
149
|
export declare function writeGuardedWorkflowEnvelopeAtomic(targetPath: string, value: unknown, options: GuardedStateWriterOptions): Promise<GuardedWriteResult>;
|
|
@@ -239,3 +241,4 @@ export declare function beginWorkflowTransactionJournal(input: {
|
|
|
239
241
|
}): Promise<string>;
|
|
240
242
|
export declare function updateWorkflowTransactionJournal(cwd: string, sessionId: string, mutationId: string, patch: Partial<WorkflowTransactionJournal>): Promise<string>;
|
|
241
243
|
export declare function completeWorkflowTransactionJournal(cwd: string, sessionId: string, mutationId: string): Promise<void>;
|
|
244
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { UltragoalCompletionVerification, UltragoalGoal, UltragoalGoalStatus, UltragoalLedgerEvent, UltragoalPlan, UltragoalReceiptKind } from "./ultragoal-runtime";
|
|
2
|
+
export type UltragoalReceiptFreshnessDiagnostic = {
|
|
3
|
+
state: "inactive" | "unrelated_goal" | "active_verified_complete" | "active_missing_receipt" | "active_stale_receipt" | "active_missing_final_receipt" | "active_dirty_quality_gate" | "active_review_blocked_unrecorded" | "active_review_blocked_recorded" | "unreadable_fail_closed";
|
|
4
|
+
message: string;
|
|
5
|
+
goalId?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function requiredUltragoalGoals(plan: UltragoalPlan): UltragoalGoal[];
|
|
8
|
+
export declare function receiptRelevantGoals(plan: UltragoalPlan, goal: UltragoalGoal, receiptKind: UltragoalReceiptKind): UltragoalGoal[];
|
|
9
|
+
export declare function computeUltragoalPlanGeneration(input: {
|
|
10
|
+
plan: UltragoalPlan;
|
|
11
|
+
ledger: readonly UltragoalLedgerEvent[];
|
|
12
|
+
goal: UltragoalGoal;
|
|
13
|
+
receiptKind: UltragoalReceiptKind;
|
|
14
|
+
beforeStatus: UltragoalGoalStatus;
|
|
15
|
+
excludeEventId?: string;
|
|
16
|
+
targetGoalUpdatedAt?: string;
|
|
17
|
+
}): {
|
|
18
|
+
planGeneration: string;
|
|
19
|
+
basis: UltragoalCompletionVerification["basis"];
|
|
20
|
+
};
|
|
21
|
+
export declare function findLedgerReceiptEvent(ledger: readonly UltragoalLedgerEvent[], receipt: UltragoalCompletionVerification): UltragoalLedgerEvent | null;
|
|
22
|
+
export declare function validateReceiptFreshBase(input: {
|
|
23
|
+
plan: UltragoalPlan;
|
|
24
|
+
ledger: readonly UltragoalLedgerEvent[];
|
|
25
|
+
goal: UltragoalGoal;
|
|
26
|
+
receipt: UltragoalCompletionVerification;
|
|
27
|
+
receiptKind: UltragoalReceiptKind;
|
|
28
|
+
}): UltragoalReceiptFreshnessDiagnostic | null;
|
|
29
|
+
export declare function findFreshBatchCloseReceipt(input: {
|
|
30
|
+
plan: UltragoalPlan;
|
|
31
|
+
ledger: readonly UltragoalLedgerEvent[];
|
|
32
|
+
deferredGoal: UltragoalGoal;
|
|
33
|
+
deferredReceipt: UltragoalCompletionVerification;
|
|
34
|
+
}): UltragoalCompletionVerification | null;
|
|
35
|
+
export declare function validateDeferredMemberReceiptFresh(input: {
|
|
36
|
+
plan: UltragoalPlan;
|
|
37
|
+
ledger: readonly UltragoalLedgerEvent[];
|
|
38
|
+
goal: UltragoalGoal;
|
|
39
|
+
receipt: UltragoalCompletionVerification;
|
|
40
|
+
receiptKind: UltragoalReceiptKind;
|
|
41
|
+
requireClose: boolean;
|
|
42
|
+
}): UltragoalReceiptFreshnessDiagnostic;
|
|
@@ -1,6 +1,77 @@
|
|
|
1
1
|
import type { WorkflowHudSummary } from "../skill-state/active-state";
|
|
2
|
+
export { computeUltragoalPlanGeneration, receiptRelevantGoals } from "./ultragoal-receipt-freshness";
|
|
2
3
|
export type UltragoalSkcGoalMode = "aggregate" | "per-story";
|
|
3
4
|
export type UltragoalGoalStatus = "pending" | "active" | "complete" | "failed" | "blocked" | "review_blocked" | "superseded";
|
|
5
|
+
export type UltragoalPipelineMetadataSource = "original_plan_graph" | "legacy_brief_only" | "steering";
|
|
6
|
+
export type UltragoalPipelineOverlapState = "none" | "open" | "joined_clean" | "blocked_disjoint_continue" | "quarantine_required" | "rebaseline_complete";
|
|
7
|
+
export interface UltragoalPipelineTargets extends JsonObject {
|
|
8
|
+
files: string[];
|
|
9
|
+
surfaces: string[];
|
|
10
|
+
}
|
|
11
|
+
export interface UltragoalPipelineMetadata extends JsonObject {
|
|
12
|
+
schemaVersion: 1;
|
|
13
|
+
goalId: string;
|
|
14
|
+
source: UltragoalPipelineMetadataSource;
|
|
15
|
+
eligible: boolean;
|
|
16
|
+
dependsOn: string[];
|
|
17
|
+
independentOf: string[];
|
|
18
|
+
targets: UltragoalPipelineTargets;
|
|
19
|
+
metadataHash: string;
|
|
20
|
+
overlap: UltragoalPipelineOverlapState;
|
|
21
|
+
overlapId?: string;
|
|
22
|
+
priorGoalId?: string;
|
|
23
|
+
nextGoalId?: string;
|
|
24
|
+
blockerFootprints?: UltragoalPipelineTargets[];
|
|
25
|
+
invalidationReason?: string;
|
|
26
|
+
invalidatedAt?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface UltragoalGoalMetadataInput {
|
|
29
|
+
schemaVersion: 1;
|
|
30
|
+
goalId: string;
|
|
31
|
+
source: UltragoalPipelineMetadataSource;
|
|
32
|
+
dependsOn?: string[];
|
|
33
|
+
independentOf?: string[];
|
|
34
|
+
targets?: Partial<UltragoalPipelineTargets>;
|
|
35
|
+
}
|
|
36
|
+
export interface UltragoalValidationBatchMetadata extends JsonObject {
|
|
37
|
+
schemaVersion: 1;
|
|
38
|
+
batchId: string;
|
|
39
|
+
memberIds: string[];
|
|
40
|
+
finalGoalId: string;
|
|
41
|
+
mode: "aggregate-only";
|
|
42
|
+
metadataHash: string;
|
|
43
|
+
}
|
|
44
|
+
export interface UltragoalValidationBatchInput {
|
|
45
|
+
schemaVersion: 1;
|
|
46
|
+
batchId: string;
|
|
47
|
+
memberIds: string[];
|
|
48
|
+
finalGoalId: string;
|
|
49
|
+
}
|
|
50
|
+
export interface UltragoalPipelineOverlapHandles extends JsonObject {
|
|
51
|
+
review: JsonObject;
|
|
52
|
+
qa: JsonObject;
|
|
53
|
+
implementation: JsonObject;
|
|
54
|
+
}
|
|
55
|
+
export interface UltragoalPipelineOverlapReceipt extends JsonObject {
|
|
56
|
+
ok: true;
|
|
57
|
+
event: string;
|
|
58
|
+
overlap_id: string;
|
|
59
|
+
prior_goal_id: string;
|
|
60
|
+
next_goal_id?: string;
|
|
61
|
+
goal_id?: string;
|
|
62
|
+
status?: UltragoalPipelineOverlapState;
|
|
63
|
+
next_goal_status?: UltragoalGoalStatus;
|
|
64
|
+
goals_path: string;
|
|
65
|
+
ledger_path: string;
|
|
66
|
+
}
|
|
67
|
+
export type UltragoalPipelineLedgerEventName = "pipeline_overlap_started" | "pipeline_overlap_joined" | "pipeline_overlap_blocked" | "pipeline_overlap_quarantined" | "pipeline_overlap_rebaselined";
|
|
68
|
+
export interface UltragoalPipelineLedgerEvent extends UltragoalLedgerEvent {
|
|
69
|
+
event: UltragoalPipelineLedgerEventName;
|
|
70
|
+
schemaVersion: 1;
|
|
71
|
+
overlapId: string;
|
|
72
|
+
priorGoalId: string;
|
|
73
|
+
nextGoalId: string;
|
|
74
|
+
}
|
|
4
75
|
export interface UltragoalGoal {
|
|
5
76
|
id: string;
|
|
6
77
|
title: string;
|
|
@@ -13,6 +84,8 @@ export interface UltragoalGoal {
|
|
|
13
84
|
evidence?: string;
|
|
14
85
|
steering?: Record<string, unknown>;
|
|
15
86
|
completionVerification?: UltragoalCompletionVerification;
|
|
87
|
+
pipelineMetadata?: UltragoalPipelineMetadata;
|
|
88
|
+
validationBatch?: UltragoalValidationBatchMetadata;
|
|
16
89
|
}
|
|
17
90
|
export interface UltragoalPlan {
|
|
18
91
|
version: 1;
|
|
@@ -45,6 +118,26 @@ export interface UltragoalCompletionVerification {
|
|
|
45
118
|
requiredGoalSetHashBeforeCheckpoint: string;
|
|
46
119
|
};
|
|
47
120
|
checkpointLedgerEventId: string;
|
|
121
|
+
validationBatch?: {
|
|
122
|
+
schemaVersion: 1;
|
|
123
|
+
role: "deferred-member";
|
|
124
|
+
batchId: string;
|
|
125
|
+
memberIds: string[];
|
|
126
|
+
finalGoalId: string;
|
|
127
|
+
metadataHash: string;
|
|
128
|
+
changeSetHash: string;
|
|
129
|
+
} | {
|
|
130
|
+
schemaVersion: 1;
|
|
131
|
+
role: "batch-close";
|
|
132
|
+
batchId: string;
|
|
133
|
+
memberIds: string[];
|
|
134
|
+
finalGoalId: string;
|
|
135
|
+
memberMetadataHashes: Record<string, string>;
|
|
136
|
+
memberReceiptIds: Record<string, string>;
|
|
137
|
+
memberCheckpointLedgerEventIds: Record<string, string>;
|
|
138
|
+
memberChangeSetHashes: Record<string, string>;
|
|
139
|
+
unionHash: string;
|
|
140
|
+
};
|
|
48
141
|
}
|
|
49
142
|
export interface UltragoalLedgerEvent extends JsonObject {
|
|
50
143
|
eventId?: string;
|
|
@@ -106,6 +199,7 @@ export interface UltragoalStatusSummary {
|
|
|
106
199
|
nudgeRemaining?: number;
|
|
107
200
|
nudgeGoalId?: string;
|
|
108
201
|
nudgeTargetKind?: UltragoalNudgeTargetKind;
|
|
202
|
+
pipelineOverlap?: JsonObject;
|
|
109
203
|
}
|
|
110
204
|
export interface UltragoalCommandResult {
|
|
111
205
|
reviewBlockerGoalIds?: string[];
|
|
@@ -161,18 +255,6 @@ export declare function recordUltragoalNudgeIfBudgetRemaining(input: {
|
|
|
161
255
|
reason: string;
|
|
162
256
|
currentGoalObjective?: string;
|
|
163
257
|
}): Promise<UltragoalNudgeOutcome>;
|
|
164
|
-
export declare function computeUltragoalPlanGeneration(input: {
|
|
165
|
-
plan: UltragoalPlan;
|
|
166
|
-
ledger: readonly UltragoalLedgerEvent[];
|
|
167
|
-
goal: UltragoalGoal;
|
|
168
|
-
receiptKind: UltragoalReceiptKind;
|
|
169
|
-
beforeStatus: UltragoalGoalStatus;
|
|
170
|
-
excludeEventId?: string;
|
|
171
|
-
targetGoalUpdatedAt?: string;
|
|
172
|
-
}): {
|
|
173
|
-
planGeneration: string;
|
|
174
|
-
basis: UltragoalCompletionVerification["basis"];
|
|
175
|
-
};
|
|
176
258
|
export declare function readUltragoalPlan(cwd: string, sessionId?: string | null): Promise<UltragoalPlan | null>;
|
|
177
259
|
export declare function getUltragoalStatus(cwd: string, sessionId?: string | null): Promise<UltragoalStatusSummary>;
|
|
178
260
|
export declare function buildUltragoalHudSummary(summary: UltragoalStatusSummary, latestLedger?: UltragoalLedgerEvent): WorkflowHudSummary;
|
|
@@ -181,6 +263,10 @@ export declare function createUltragoalPlan(input: {
|
|
|
181
263
|
brief: string;
|
|
182
264
|
skcGoalMode?: UltragoalSkcGoalMode;
|
|
183
265
|
sessionId?: string | null;
|
|
266
|
+
goalMetadata?: UltragoalGoalMetadataInput[];
|
|
267
|
+
goalMetadataJson?: string;
|
|
268
|
+
validationBatches?: UltragoalValidationBatchInput[];
|
|
269
|
+
validationBatchJson?: string;
|
|
184
270
|
}): Promise<UltragoalPlan>;
|
|
185
271
|
export interface UltragoalRunCompletionState {
|
|
186
272
|
requiredGoals: UltragoalGoal[];
|
|
@@ -190,6 +276,27 @@ export interface UltragoalRunCompletionState {
|
|
|
190
276
|
hasBlockers: boolean;
|
|
191
277
|
needsFinalAggregateReceipt: boolean;
|
|
192
278
|
}
|
|
279
|
+
export declare function startUltragoalPipelineOverlap(input: {
|
|
280
|
+
cwd: string;
|
|
281
|
+
priorGoalId: string;
|
|
282
|
+
nextGoalId: string;
|
|
283
|
+
reviewHandles: JsonObject | JsonObject[];
|
|
284
|
+
qaHandles: JsonObject | JsonObject[];
|
|
285
|
+
implementationHandle: JsonObject;
|
|
286
|
+
}): Promise<UltragoalPipelineOverlapReceipt>;
|
|
287
|
+
export declare function joinUltragoalPipelineOverlap(input: {
|
|
288
|
+
cwd: string;
|
|
289
|
+
overlapId: string;
|
|
290
|
+
reviewResult: JsonObject;
|
|
291
|
+
qaResult: JsonObject;
|
|
292
|
+
}): Promise<UltragoalPipelineOverlapReceipt>;
|
|
293
|
+
export declare function rebaselineUltragoalPipelineOverlap(input: {
|
|
294
|
+
cwd: string;
|
|
295
|
+
overlapId: string;
|
|
296
|
+
goalId: string;
|
|
297
|
+
evidence: string;
|
|
298
|
+
targetState: JsonObject;
|
|
299
|
+
}): Promise<UltragoalPipelineOverlapReceipt>;
|
|
193
300
|
export declare function getUltragoalRunCompletionState(plan: UltragoalPlan, options?: {
|
|
194
301
|
retryFailed?: boolean;
|
|
195
302
|
}): UltragoalRunCompletionState;
|
|
@@ -218,6 +325,7 @@ interface UltragoalChangeSet extends JsonObject {
|
|
|
218
325
|
mergeBase?: string;
|
|
219
326
|
paths: UltragoalChangeSetPath[];
|
|
220
327
|
rawDiffStat?: string;
|
|
328
|
+
rawDiff?: string;
|
|
221
329
|
trusted: true;
|
|
222
330
|
}
|
|
223
331
|
export declare function normalizeSurfaceToken(value: string): string;
|
|
@@ -300,4 +408,3 @@ interface UltragoalReviewResult extends JsonObject {
|
|
|
300
408
|
export declare function resolveGitBase(cwd: string, branch?: string): Promise<string>;
|
|
301
409
|
export declare function runUltragoalReview(cwd: string, args: readonly string[]): Promise<UltragoalReviewResult>;
|
|
302
410
|
export declare function runNativeUltragoalCommand(args: string[], cwd?: string): Promise<UltragoalCommandResult>;
|
|
303
|
-
export {};
|
|
@@ -92,7 +92,24 @@ export declare function listActiveSkills(raw: unknown): SkillActiveEntry[];
|
|
|
92
92
|
export declare function normalizeSkillActiveState(raw: unknown): SkillActiveState | null;
|
|
93
93
|
export declare function getSkillActiveStatePaths(cwd: string, sessionId?: string): SkillActiveStatePaths;
|
|
94
94
|
export declare function collapsePlanningPipeline(entries: readonly SkillActiveEntry[]): SkillActiveEntry[];
|
|
95
|
-
export
|
|
95
|
+
export type VisibleSkillActiveStateCacheTier = "security" | "hud";
|
|
96
|
+
export interface ReadVisibleSkillActiveStateOptions {
|
|
97
|
+
tier?: VisibleSkillActiveStateCacheTier;
|
|
98
|
+
}
|
|
99
|
+
interface ActiveStateStatSignature {
|
|
100
|
+
path: string;
|
|
101
|
+
mtimeMs: number;
|
|
102
|
+
size: number;
|
|
103
|
+
}
|
|
104
|
+
interface ActiveStateSignature {
|
|
105
|
+
sessionPath: ActiveStateStatSignature | null;
|
|
106
|
+
activeDir: ActiveStateStatSignature | null;
|
|
107
|
+
activeEntries: ActiveStateStatSignature[];
|
|
108
|
+
ralplanModeState: ActiveStateStatSignature | null;
|
|
109
|
+
}
|
|
110
|
+
export declare function computeActiveStateSignature(cwd: string, sessionId: string): Promise<ActiveStateSignature>;
|
|
111
|
+
export declare function invalidateVisibleSkillActiveStateCache(cwd?: string, sessionId?: string): void;
|
|
112
|
+
export declare function readVisibleSkillActiveState(cwd: string, sessionId?: string, opts?: ReadVisibleSkillActiveStateOptions): Promise<SkillActiveState | null>;
|
|
96
113
|
export declare function syncSkillActiveState(options: SyncSkillActiveStateOptions): Promise<void>;
|
|
97
114
|
export interface ApplyHandoffOptions {
|
|
98
115
|
cwd: string;
|