@kodax-ai/kodax 0.7.48 → 0.7.49
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 +1741 -1720
- package/README.md +80 -27
- package/README_CN.md +60 -15
- package/dist/builtin/code-review/SKILL.md +1 -1
- package/dist/chunks/argument-completer-GDG5OHN7.js +2 -0
- package/dist/chunks/{chunk-LNJNRREL.js → chunk-67SWUEEN.js} +412 -280
- package/dist/chunks/chunk-C5PKZX5Z.js +291 -0
- package/dist/chunks/chunk-ISGHUKRY.js +428 -0
- package/dist/chunks/chunk-JTHMWRXM.js +566 -0
- package/dist/chunks/chunk-TYZAH3YP.js +2 -0
- package/dist/chunks/chunk-YACQ4OST.js +31 -0
- package/dist/chunks/{chunk-DEODZG6Q.js → chunk-YW4RQV7U.js} +1 -1
- package/dist/chunks/{compaction-config-YWCHOP2U.js → compaction-config-BQBYOWX2.js} +1 -1
- package/dist/chunks/{construction-bootstrap-AIWATBWW.js → construction-bootstrap-5TFGMSWQ.js} +1 -1
- package/dist/chunks/{dist-IDNOAB4M.js → dist-BL7IBQHD.js} +1 -1
- package/dist/chunks/dist-D7HOETCE.js +2 -0
- package/dist/chunks/{utils-OG57XTPC.js → utils-XWDT3W5X.js} +1 -1
- package/dist/index.d.ts +11 -11
- package/dist/index.js +2 -2
- package/dist/kodax_cli.js +1325 -892
- package/dist/provider-capabilities.json +193 -190
- package/dist/sdk-agent.d.ts +205 -103
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +534 -33
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-llm.d.ts +5 -5
- package/dist/sdk-llm.js +1 -1
- package/dist/sdk-mcp.js +1 -1
- package/dist/sdk-repl.d.ts +11 -10
- package/dist/sdk-repl.js +1 -1
- package/dist/sdk-session.d.ts +6 -3
- package/dist/sdk-session.js +1 -1
- package/dist/sdk-skills.js +1 -1
- package/dist/types-chunks/{base.d-BdJKSPO2.d.ts → base.d-C4jYVjJh.d.ts} +2 -1
- package/dist/types-chunks/{bash-prefix-extractor.d-DNO2-ycp.d.ts → bash-prefix-extractor.d-CI_xcPhn.d.ts} +68 -7
- package/dist/types-chunks/{file-tracker.d-D7L_SbRm.d.ts → capsule.d-DaPuhyyK.d.ts} +170 -5
- package/dist/types-chunks/{resolver.d-DkgJlEzr.d.ts → resolver.d-B_wm409c.d.ts} +2 -2
- package/dist/types-chunks/{storage.d-B1Jk6ryM.d.ts → storage.d-J2GqOgaX.d.ts} +4 -1
- package/dist/types-chunks/{types.d-BCnbYG_A.d.ts → types.d-BR9oNWup.d.ts} +363 -4
- package/dist/types-chunks/{types.d-B_MIIApc.d.ts → types.d-BnjX2Gn4.d.ts} +6 -1
- package/dist/types-chunks/{types.d-Cf-GCzac.d.ts → types.d-rPRl2LSB.d.ts} +4 -0
- package/dist/types-chunks/{utils.d-Dgy5SVrq.d.ts → utils.d-BJ_-y8gC.d.ts} +42 -8
- package/package.json +1 -1
- package/dist/chunks/chunk-66B6ZOU7.js +0 -31
- package/dist/chunks/chunk-6Z75SHX3.js +0 -2
- package/dist/chunks/chunk-EP46H5P3.js +0 -415
- package/dist/chunks/chunk-UHAP234X.js +0 -567
- package/dist/chunks/dist-4WABQRJU.js +0 -2
- package/dist/types-chunks/types.d-C5mHR87z.d.ts +0 -119
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as KodaXMessage } from './types.d-
|
|
2
|
-
import { f as AgentMessage,
|
|
3
|
-
import { s as KodaXSessionLineage, i as KodaXJsonValue, a as KodaXCompactMemorySeed, o as KodaXSessionEntry, z as KodaXSessionTreeNode, r as KodaXSessionLabelEntry, q as KodaXSessionGoalEntry, v as KodaXSessionNavigationOptions, k as KodaXSessionArtifactLedgerEntry } from './types.d-
|
|
1
|
+
import { n as KodaXMessage } from './types.d-rPRl2LSB.js';
|
|
2
|
+
import { f as AgentMessage, ap as SessionEntry, an as Session, a3 as QueueEventListener, a4 as QueuedMessage, E as EnqueueInput, v as DequeueFilter, aq as SessionExtension, p as CompactionDetails, z as FileOperations, b4 as WorkflowMeta, b5 as WorkflowModelHint, b6 as WorkflowModule } from './types.d-BR9oNWup.js';
|
|
3
|
+
import { s as KodaXSessionLineage, i as KodaXJsonValue, a as KodaXCompactMemorySeed, o as KodaXSessionEntry, z as KodaXSessionTreeNode, r as KodaXSessionLabelEntry, q as KodaXSessionGoalEntry, v as KodaXSessionNavigationOptions, k as KodaXSessionArtifactLedgerEntry } from './types.d-BnjX2Gn4.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @kodax-ai/agent Constants
|
|
@@ -271,6 +271,98 @@ declare function getAgentConfigPath(...segments: string[]): string;
|
|
|
271
271
|
*/
|
|
272
272
|
declare function getAppDataDir(appId: string): string;
|
|
273
273
|
|
|
274
|
+
/**
|
|
275
|
+
* @kodax-ai/agent/messaging/queue — 2-tier agentId-scoped FIFO message queue.
|
|
276
|
+
*
|
|
277
|
+
* FEATURE_115 (v0.7.36).
|
|
278
|
+
*
|
|
279
|
+
* Invariants:
|
|
280
|
+
* - In-priority FIFO: messages of the same priority drain in enqueue order.
|
|
281
|
+
* - Cross-priority precedence: 'user' drains before 'background', regardless
|
|
282
|
+
* of enqueue order.
|
|
283
|
+
* - agentId routing: messages addressed to agentId X are only visible to
|
|
284
|
+
* consumers filtering for that exact agentId. undefined ≠ "any agent" —
|
|
285
|
+
* it specifically matches main-thread messages.
|
|
286
|
+
* - Not persistent: process restart loses queue state, by design (matches
|
|
287
|
+
* TodoStore semantics).
|
|
288
|
+
*
|
|
289
|
+
* The queue is process-global by default (`getMessageQueue()`); the class is
|
|
290
|
+
* also exported for tests / isolated downstream use.
|
|
291
|
+
*/
|
|
292
|
+
|
|
293
|
+
declare class MessageQueue {
|
|
294
|
+
private messages;
|
|
295
|
+
private nextSeq;
|
|
296
|
+
/**
|
|
297
|
+
* FEATURE_159 (v0.7.40) — observable subscription set. Same pattern as
|
|
298
|
+
* Claude Code's `messageQueueManager.ts` `createSignal()` substrate,
|
|
299
|
+
* but the listener carries a structured `QueueEvent` so SDK
|
|
300
|
+
* observability consumers (logger, tracer, metrics) can react per-
|
|
301
|
+
* event without re-diffing snapshots. `useSyncExternalStore` consumers
|
|
302
|
+
* still work — they ignore the event argument.
|
|
303
|
+
*
|
|
304
|
+
* Cached `snapshotRef` keeps reference identity stable across reads
|
|
305
|
+
* when nothing changed — required by React 18's `useSyncExternalStore`
|
|
306
|
+
* to avoid render loops.
|
|
307
|
+
*/
|
|
308
|
+
private listeners;
|
|
309
|
+
private snapshotRef;
|
|
310
|
+
private notify;
|
|
311
|
+
/**
|
|
312
|
+
* Subscribe to queue mutations. Compatible with React 18's
|
|
313
|
+
* `useSyncExternalStore(subscribe, getSnapshot)` — the hook passes a
|
|
314
|
+
* `() => void` callback, which is structurally assignable to the
|
|
315
|
+
* `QueueEventListener` parameter because TypeScript treats
|
|
316
|
+
* callback parameter discards as compatible. SDK consumers that
|
|
317
|
+
* declare a typed `(event: QueueEvent) => void` listener see the
|
|
318
|
+
* structured event.
|
|
319
|
+
*
|
|
320
|
+
* Listener is called synchronously after every mutation; returns an
|
|
321
|
+
* unsubscribe function.
|
|
322
|
+
*/
|
|
323
|
+
subscribe: (listener: QueueEventListener) => (() => void);
|
|
324
|
+
/**
|
|
325
|
+
* Returns the current frozen queue snapshot. Reference identity is
|
|
326
|
+
* stable across reads when the queue has not mutated, which is the
|
|
327
|
+
* contract React's `useSyncExternalStore` relies on.
|
|
328
|
+
*/
|
|
329
|
+
getSnapshot: () => readonly QueuedMessage[];
|
|
330
|
+
/** Returns the assigned id of the enqueued message. */
|
|
331
|
+
enqueue(input: EnqueueInput): string;
|
|
332
|
+
/**
|
|
333
|
+
* Drain matching messages, ordered by priority (user > background) then
|
|
334
|
+
* FIFO within each priority. Removes drained messages from the queue.
|
|
335
|
+
*/
|
|
336
|
+
dequeue(filter: DequeueFilter): QueuedMessage[];
|
|
337
|
+
/**
|
|
338
|
+
* Peek at matching messages without removing them. Returns messages in
|
|
339
|
+
* the same priority + FIFO order that `dequeue(filter)` would return,
|
|
340
|
+
* so callers can inspect what the next drain would yield.
|
|
341
|
+
*/
|
|
342
|
+
peek(filter: DequeueFilter): QueuedMessage[];
|
|
343
|
+
/** Total queue size across all priorities / agents. */
|
|
344
|
+
size(): number;
|
|
345
|
+
/** Count of messages matching the filter. */
|
|
346
|
+
count(filter: DequeueFilter): number;
|
|
347
|
+
/** True iff at least one message matches the filter. */
|
|
348
|
+
has(filter: DequeueFilter): boolean;
|
|
349
|
+
/** Remove all queued messages — used in tests / process abort scenarios. */
|
|
350
|
+
clear(): void;
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Returns the process-global MessageQueue singleton, creating it lazily on
|
|
354
|
+
* first call. Use this for production wiring; instantiate `MessageQueue`
|
|
355
|
+
* directly in tests / isolated subsystems where a shared instance would
|
|
356
|
+
* cause cross-test pollution.
|
|
357
|
+
*/
|
|
358
|
+
declare function getMessageQueue(): MessageQueue;
|
|
359
|
+
/**
|
|
360
|
+
* Test-only reset hook. Production code MUST NOT call this. Underscored
|
|
361
|
+
* prefix follows the same convention as `_resetInvariantRegistry` /
|
|
362
|
+
* `_resetAdmittedAgentBindings` / `_resetAdmissionMetrics`.
|
|
363
|
+
*/
|
|
364
|
+
declare function _resetMessageQueueForTests(): void;
|
|
365
|
+
|
|
274
366
|
/**
|
|
275
367
|
* History cleanup middleware — CAP-002
|
|
276
368
|
*
|
|
@@ -636,5 +728,78 @@ declare function mergeFileOps(ops1: FileOperations, ops2: FileOperations): FileO
|
|
|
636
728
|
declare function extractArtifactLedger(messages: KodaXMessage[]): KodaXSessionArtifactLedgerEntry[];
|
|
637
729
|
declare function mergeArtifactLedger(existing: KodaXSessionArtifactLedgerEntry[], next: KodaXSessionArtifactLedgerEntry[]): KodaXSessionArtifactLedgerEntry[];
|
|
638
730
|
|
|
639
|
-
|
|
640
|
-
|
|
731
|
+
declare const WORKFLOW_PATTERN_IDS: readonly ["classify-and-act", "fan-out-and-synthesize", "adversarial-verification", "generate-and-filter", "tournament", "loop-until-done"];
|
|
732
|
+
type WorkflowPatternId = (typeof WORKFLOW_PATTERN_IDS)[number];
|
|
733
|
+
interface WorkflowScriptManifest extends WorkflowMeta {
|
|
734
|
+
readonly phases: readonly string[];
|
|
735
|
+
readonly readOnly: boolean;
|
|
736
|
+
readonly plannedAgents?: number;
|
|
737
|
+
readonly maxAgents: number;
|
|
738
|
+
readonly maxConcurrency: number;
|
|
739
|
+
readonly tokenBudget?: number;
|
|
740
|
+
readonly mayUseWorktree?: boolean;
|
|
741
|
+
readonly patterns: readonly WorkflowPatternId[];
|
|
742
|
+
}
|
|
743
|
+
declare function validateWorkflowScriptManifest(value: unknown): WorkflowScriptManifest;
|
|
744
|
+
|
|
745
|
+
/**
|
|
746
|
+
* FEATURE_217 (v0.7.49) Phase M — reusable generated workflow capsule.
|
|
747
|
+
*
|
|
748
|
+
* Agent owns only the domain-neutral capsule contract. Persistence,
|
|
749
|
+
* environment preflight, skills, MCP, and REPL UX live in higher layers.
|
|
750
|
+
*/
|
|
751
|
+
|
|
752
|
+
declare const WORKFLOW_CAPSULE_FORMAT: "kodax.workflow";
|
|
753
|
+
declare const WORKFLOW_CAPSULE_VERSION: 1;
|
|
754
|
+
declare const WORKFLOW_CAPSULE_API_VERSION: 1;
|
|
755
|
+
type WorkflowCapsuleEnvironmentRequirement = 'git-repo' | 'worktree-capable';
|
|
756
|
+
interface WorkflowCapsuleIntent {
|
|
757
|
+
readonly taskClass: string;
|
|
758
|
+
readonly originalRequest?: string;
|
|
759
|
+
readonly reusableFor?: readonly string[];
|
|
760
|
+
readonly notFor?: readonly string[];
|
|
761
|
+
}
|
|
762
|
+
interface WorkflowCapsuleInputs {
|
|
763
|
+
readonly description: string;
|
|
764
|
+
readonly examples?: readonly unknown[];
|
|
765
|
+
}
|
|
766
|
+
interface WorkflowCapsuleRequirements {
|
|
767
|
+
readonly environment?: readonly WorkflowCapsuleEnvironmentRequirement[];
|
|
768
|
+
readonly tools?: readonly string[];
|
|
769
|
+
readonly mcp?: readonly string[];
|
|
770
|
+
readonly skills?: readonly string[];
|
|
771
|
+
readonly modelTiers?: readonly WorkflowModelHint[];
|
|
772
|
+
readonly userInteraction?: boolean;
|
|
773
|
+
}
|
|
774
|
+
interface WorkflowCapsuleProvenance {
|
|
775
|
+
readonly fromRunId?: string;
|
|
776
|
+
readonly createdAt: string;
|
|
777
|
+
readonly kodaxVersion: string;
|
|
778
|
+
}
|
|
779
|
+
interface WorkflowCapsule {
|
|
780
|
+
readonly format: typeof WORKFLOW_CAPSULE_FORMAT;
|
|
781
|
+
readonly version: typeof WORKFLOW_CAPSULE_VERSION;
|
|
782
|
+
readonly workflowApiVersion: typeof WORKFLOW_CAPSULE_API_VERSION;
|
|
783
|
+
readonly minKodaxVersion: string;
|
|
784
|
+
readonly manifest: WorkflowScriptManifest;
|
|
785
|
+
readonly source: string;
|
|
786
|
+
readonly intent?: WorkflowCapsuleIntent;
|
|
787
|
+
readonly inputs?: WorkflowCapsuleInputs;
|
|
788
|
+
readonly requires?: WorkflowCapsuleRequirements;
|
|
789
|
+
readonly provenance?: WorkflowCapsuleProvenance;
|
|
790
|
+
}
|
|
791
|
+
interface CreateWorkflowCapsuleInput {
|
|
792
|
+
readonly minKodaxVersion: string;
|
|
793
|
+
readonly manifest: WorkflowScriptManifest;
|
|
794
|
+
readonly source: string;
|
|
795
|
+
readonly intent?: WorkflowCapsuleIntent;
|
|
796
|
+
readonly inputs?: WorkflowCapsuleInputs;
|
|
797
|
+
readonly requires?: WorkflowCapsuleRequirements;
|
|
798
|
+
readonly provenance?: WorkflowCapsuleProvenance;
|
|
799
|
+
}
|
|
800
|
+
declare function validateWorkflowCapsule(value: unknown): WorkflowCapsule;
|
|
801
|
+
declare function createWorkflowCapsule(input: CreateWorkflowCapsuleInput): WorkflowCapsule;
|
|
802
|
+
declare function createWorkflowModuleFromCapsule(capsule: WorkflowCapsule): WorkflowModule;
|
|
803
|
+
|
|
804
|
+
export { extractFileOps as $, DefaultSummaryCompaction as D, appendSessionLineageLabel as I, applyLineageTruncation as J, KODAX_API_MIN_INTERVAL as K, LINEAGE_ENTRY_TYPES as L, MessageQueue as M, applySessionCompaction as N, archiveOldIslands as O, PROMISE_PATTERN as P, buildSessionTree as Q, cleanupIncompleteToolCalls as R, countActiveLineageMessages as S, countTokens as T, createSessionLineage as U, createWorkflowCapsule as V, WORKFLOW_CAPSULE_API_VERSION as W, createWorkflowModuleFromCapsule as X, estimateTokens as Y, extractArtifactLedger as Z, _resetMessageQueueForTests as _, extractTitleFromMessages as a0, findPreviousUserEntryId as a1, forkSessionLineage as a2, generateSessionId as a3, getAgentConfigHome as a4, getAgentConfigPath as a5, getAppDataDir as a6, getMessageQueue as a7, getSessionLineagePath as a8, getSessionMessagesFromLineage as a9, mergeArtifactLedger as aa, mergeFileOps as ab, resolveSessionLineageTarget as ac, rewindSessionLineage as ad, setAgentConfigHome as ae, setSessionLineageActiveEntry as af, validateAndFixToolHistory as ag, validateWorkflowCapsule as ah, validateWorkflowScriptManifest as ai, KODAX_DEFAULT_TIMEOUT as f, KODAX_HARD_TIMEOUT as g, KODAX_MAX_INCOMPLETE_RETRIES as h, KODAX_MAX_MAXTOKENS_RETRIES as i, KODAX_MAX_RETRIES as j, KODAX_MAX_TOKENS as k, KODAX_RETRY_BASE_DELAY as l, KODAX_STAGGER_DELAY as m, LineageCompaction as o, LineageExtension as r, WORKFLOW_CAPSULE_FORMAT as v, WORKFLOW_CAPSULE_VERSION as w, WORKFLOW_PATTERN_IDS as x };
|
|
805
|
+
export type { WorkflowCapsuleInputs as A, WorkflowCapsuleIntent as B, CompactionContext as C, WorkflowCapsuleProvenance as E, WorkflowCapsuleRequirements as F, WorkflowPatternId as G, WorkflowScriptManifest as H, CompactionEntry as a, CompactionEntryPayload as b, CompactionPolicy as c, CreateWorkflowCapsuleInput as d, DefaultSummaryCompactionOptions as e, LineageArtifactLedgerPayload as n, LineageCompactionDelegates as p, LineageEntryType as q, LineageLabelPayload as s, LineageTreeNode as t, PolicyCompactionResult as u, WorkflowCapsule as y, WorkflowCapsuleEnvironmentRequirement as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E as KodaXReasoningMode, V as KodaXThinkingBudgetMap, W as KodaXThinkingDepth, s as KodaXProviderConfig, D as KodaXReasoningCapability, G as KodaXReasoningRequest, R as KodaXTaskType, F as KodaXReasoningOverride, a2 as KodaXVerifyCredentialResult, Y as KodaXToolDefinition, n as KodaXMessage, A as KodaXProviderStreamOptions, L as KodaXStreamResult, o as KodaXModelDescriptor, r as KodaXProviderCapabilityProfile, a3 as KodaXVerifyStrategy, h as KodaXCustomProviderConfig, m as KodaXListModelsResult } from './types.d-
|
|
1
|
+
import { E as KodaXReasoningMode, V as KodaXThinkingBudgetMap, W as KodaXThinkingDepth, s as KodaXProviderConfig, D as KodaXReasoningCapability, G as KodaXReasoningRequest, R as KodaXTaskType, F as KodaXReasoningOverride, a2 as KodaXVerifyCredentialResult, Y as KodaXToolDefinition, n as KodaXMessage, A as KodaXProviderStreamOptions, L as KodaXStreamResult, o as KodaXModelDescriptor, r as KodaXProviderCapabilityProfile, a3 as KodaXVerifyStrategy, h as KodaXCustomProviderConfig, m as KodaXListModelsResult } from './types.d-rPRl2LSB.js';
|
|
2
2
|
import Anthropic from '@anthropic-ai/sdk';
|
|
3
|
-
import { K as KodaXBaseProvider } from './base.d-
|
|
3
|
+
import { K as KodaXBaseProvider } from './base.d-C4jYVjJh.js';
|
|
4
4
|
import OpenAI from 'openai';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as KodaXSessionData, s as KodaXSessionLineage, v as KodaXSessionNavigationOptions, w as KodaXSessionRuntimeInfo, y as KodaXSessionStorage } from './types.d-
|
|
1
|
+
import { n as KodaXSessionData, s as KodaXSessionLineage, v as KodaXSessionNavigationOptions, w as KodaXSessionRuntimeInfo, y as KodaXSessionStorage } from './types.d-BnjX2Gn4.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Session Storage - Session storage abstraction layer
|
|
@@ -31,6 +31,7 @@ interface SessionStorage {
|
|
|
31
31
|
id: string;
|
|
32
32
|
title: string;
|
|
33
33
|
msgCount: number;
|
|
34
|
+
tag?: string;
|
|
34
35
|
runtimeInfo?: KodaXSessionRuntimeInfo;
|
|
35
36
|
}>>;
|
|
36
37
|
delete?(id: string): Promise<void>;
|
|
@@ -58,6 +59,7 @@ declare class MemorySessionStorage implements SessionStorage {
|
|
|
58
59
|
id: string;
|
|
59
60
|
title: string;
|
|
60
61
|
msgCount: number;
|
|
62
|
+
tag?: string;
|
|
61
63
|
}>>;
|
|
62
64
|
delete(id: string): Promise<void>;
|
|
63
65
|
deleteAll(_gitRoot?: string): Promise<void>;
|
|
@@ -164,6 +166,7 @@ declare class FileSessionStorage implements KodaXSessionStorage {
|
|
|
164
166
|
id: string;
|
|
165
167
|
title: string;
|
|
166
168
|
msgCount: number;
|
|
169
|
+
tag?: string;
|
|
167
170
|
runtimeInfo?: KodaXSessionRuntimeInfo;
|
|
168
171
|
archived?: boolean;
|
|
169
172
|
createdAt?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Y as KodaXToolDefinition, n as KodaXMessage, E as KodaXReasoningMode, _ as KodaXToolResultContentItem, U as KodaXThinkingBlock, H as KodaXRedactedThinkingBlock } from './types.d-
|
|
2
|
-
import { a as KodaXCompactMemorySeed, k as KodaXSessionArtifactLedgerEntry } from './types.d-
|
|
1
|
+
import { Y as KodaXToolDefinition, n as KodaXMessage, E as KodaXReasoningMode, _ as KodaXToolResultContentItem, U as KodaXThinkingBlock, H as KodaXRedactedThinkingBlock } from './types.d-rPRl2LSB.js';
|
|
2
|
+
import { a as KodaXCompactMemorySeed, k as KodaXSessionArtifactLedgerEntry } from './types.d-BnjX2Gn4.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Layer A Primitive: Agent / Handoff / Guardrail / AgentReasoningProfile
|
|
@@ -1535,6 +1535,8 @@ interface StopHookContext {
|
|
|
1535
1535
|
/** Total reanimate budget for this run (`stopHookReanimateBudget`
|
|
1536
1536
|
* or default 2). Exposed for transparency. */
|
|
1537
1537
|
readonly reanimateBudget: number;
|
|
1538
|
+
/** Caller cancellation signal, forwarded so stop hooks can cancel I/O. */
|
|
1539
|
+
readonly abortSignal?: AbortSignal;
|
|
1538
1540
|
}
|
|
1539
1541
|
/**
|
|
1540
1542
|
* FEATURE_184 (v0.7.45) — Stop hook return surface.
|
|
@@ -1882,6 +1884,124 @@ declare function setActiveUserInteraction(interaction: UserInteraction | undefin
|
|
|
1882
1884
|
/** The live user-interaction surface, or undefined when none is active. */
|
|
1883
1885
|
declare function getActiveUserInteraction(): UserInteraction | undefined;
|
|
1884
1886
|
|
|
1887
|
+
/**
|
|
1888
|
+
* @kodax-ai/agent/messaging — Message queue types
|
|
1889
|
+
*
|
|
1890
|
+
* FEATURE_115 (v0.7.36): agentId-scoped 2-tier priority queue infrastructure.
|
|
1891
|
+
*
|
|
1892
|
+
* Per ADR-021: messaging is a generic agent-platform primitive (not coding-
|
|
1893
|
+
* specific). Downstream consumers:
|
|
1894
|
+
* - @kodax-ai/coding runner-driven mid-turn drain
|
|
1895
|
+
* - @kodax-ai/repl InkREPL ESC soft-pause + text injection (FEATURE_111 absorbed)
|
|
1896
|
+
* - subagent task-notification routing (FEATURE_155 idle-yield wakeup)
|
|
1897
|
+
*
|
|
1898
|
+
* Phase 0.6 study (`c:/tmp/claude-code-actual-usage.md`): Claude Code's
|
|
1899
|
+
* `'now'` priority has zero production usage; KodaX simplifies to 2 tiers.
|
|
1900
|
+
*/
|
|
1901
|
+
type MessagePriority = 'user' | 'background';
|
|
1902
|
+
type MessageMode = 'prompt' | 'task-notification' | 'system-reminder';
|
|
1903
|
+
interface QueuedMessage {
|
|
1904
|
+
/** Stable id for tracing / dedup. Format: `msg-<sequence>`. */
|
|
1905
|
+
readonly id: string;
|
|
1906
|
+
readonly priority: MessagePriority;
|
|
1907
|
+
/**
|
|
1908
|
+
* Routing key:
|
|
1909
|
+
* undefined = main thread / coordinator agent
|
|
1910
|
+
* 'agent-id-XYZ' = subagent / specific consumer
|
|
1911
|
+
*
|
|
1912
|
+
* Drain consumers MUST filter by agentId match — undefined matches only
|
|
1913
|
+
* undefined-agentId messages, not "any agent".
|
|
1914
|
+
*/
|
|
1915
|
+
readonly agentId?: string;
|
|
1916
|
+
readonly mode: MessageMode;
|
|
1917
|
+
readonly content: string;
|
|
1918
|
+
/** Wall-clock timestamp (`Date.now()`) for tracing only — not used for ordering. */
|
|
1919
|
+
readonly enqueuedAt: number;
|
|
1920
|
+
}
|
|
1921
|
+
interface DequeueFilter {
|
|
1922
|
+
/**
|
|
1923
|
+
* Only return messages with this agentId.
|
|
1924
|
+
* undefined matches messages with no agentId (main-thread messages only).
|
|
1925
|
+
*/
|
|
1926
|
+
readonly agentId?: string;
|
|
1927
|
+
/**
|
|
1928
|
+
* Highest priority level included in the drain.
|
|
1929
|
+
* 'user' → only user priority drained, background stays queued
|
|
1930
|
+
* 'background' → both user + background drained (Sleep-gated case)
|
|
1931
|
+
*/
|
|
1932
|
+
readonly maxPriority: MessagePriority;
|
|
1933
|
+
/**
|
|
1934
|
+
* Optional cap on number of messages drained in this call.
|
|
1935
|
+
* Defaults to unlimited (drains all matching).
|
|
1936
|
+
*/
|
|
1937
|
+
readonly limit?: number;
|
|
1938
|
+
/**
|
|
1939
|
+
* FEATURE_159 (v0.7.40) — optional mode filter. Lets REPL split the
|
|
1940
|
+
* single queue into mode-typed views (e.g. `mode:'prompt'` for user
|
|
1941
|
+
* input vs `mode:'task-notification'` for child completion banners)
|
|
1942
|
+
* without separate queues. When omitted, all modes match.
|
|
1943
|
+
*/
|
|
1944
|
+
readonly mode?: MessageMode;
|
|
1945
|
+
/**
|
|
1946
|
+
* FEATURE_159 (v0.7.40) — optional precise-id filter. Single-message
|
|
1947
|
+
* targeted removal — drives Esc-pop-this-uuid in REPL. When set, all
|
|
1948
|
+
* other filters still apply (agentId / priority / mode mismatches still
|
|
1949
|
+
* skip the message), so callers can't accidentally remove a message
|
|
1950
|
+
* outside their scope.
|
|
1951
|
+
*/
|
|
1952
|
+
readonly id?: string;
|
|
1953
|
+
/**
|
|
1954
|
+
* FEATURE_159 (v0.7.40) — optional escape-hatch predicate, AND-ed with
|
|
1955
|
+
* the structured filters. Lets SDK consumers express conditions the
|
|
1956
|
+
* typed fields don't cover (e.g. timestamp ranges, content-match) without
|
|
1957
|
+
* forcing every new use case to extend `DequeueFilter`. KodaX-internal
|
|
1958
|
+
* code should prefer the typed fields for readability; this is the
|
|
1959
|
+
* "data-driven main path + predicate escape" pattern.
|
|
1960
|
+
*
|
|
1961
|
+
* Evaluated AFTER the typed filters succeed — so a `predicate` that
|
|
1962
|
+
* inspects `message.content` never runs on messages outside the
|
|
1963
|
+
* caller's `agentId` / `mode` / `id` scope.
|
|
1964
|
+
*/
|
|
1965
|
+
readonly predicate?: (message: QueuedMessage) => boolean;
|
|
1966
|
+
}
|
|
1967
|
+
/**
|
|
1968
|
+
* FEATURE_159 (v0.7.40) — structured queue event emitted to subscribers.
|
|
1969
|
+
*
|
|
1970
|
+
* Replaces the prior `() => void` bare-notify signal. Carries the kind +
|
|
1971
|
+
* affected messages so SDK observability consumers (logging, tracing,
|
|
1972
|
+
* metrics) can react per-event without re-diffing snapshots.
|
|
1973
|
+
*
|
|
1974
|
+
* Event granularity rules:
|
|
1975
|
+
* - `enqueued` fires ONCE per `enqueue()` call (always 1 message).
|
|
1976
|
+
* - `dequeued` fires ONCE per `dequeue()` call that removed ≥1 message,
|
|
1977
|
+
* carrying ALL drained messages in priority+FIFO order. No-op drains
|
|
1978
|
+
* (filter matched nothing) fire no event — quiet by design so the
|
|
1979
|
+
* `waitForWakeEvent` 100ms poll doesn't spam idle subscribers.
|
|
1980
|
+
* - `cleared` fires ONCE per `clear()` call that removed ≥1 message,
|
|
1981
|
+
* carrying the pre-clear messages. Empty-queue clear fires nothing.
|
|
1982
|
+
*
|
|
1983
|
+
* The `useSyncExternalStore` React hook ignores the event payload (it
|
|
1984
|
+
* only needs the change signal); SDK / tracer consumers read the event.
|
|
1985
|
+
*/
|
|
1986
|
+
type QueueEvent = {
|
|
1987
|
+
readonly kind: 'enqueued';
|
|
1988
|
+
readonly message: QueuedMessage;
|
|
1989
|
+
} | {
|
|
1990
|
+
readonly kind: 'dequeued';
|
|
1991
|
+
readonly messages: readonly QueuedMessage[];
|
|
1992
|
+
} | {
|
|
1993
|
+
readonly kind: 'cleared';
|
|
1994
|
+
readonly messages: readonly QueuedMessage[];
|
|
1995
|
+
};
|
|
1996
|
+
/** FEATURE_159 — `MessageQueue.subscribe` listener signature. */
|
|
1997
|
+
type QueueEventListener = (event: QueueEvent) => void;
|
|
1998
|
+
interface EnqueueInput {
|
|
1999
|
+
readonly priority: MessagePriority;
|
|
2000
|
+
readonly mode: MessageMode;
|
|
2001
|
+
readonly content: string;
|
|
2002
|
+
readonly agentId?: string;
|
|
2003
|
+
}
|
|
2004
|
+
|
|
1885
2005
|
/**
|
|
1886
2006
|
* Child task registry primitive — generic fan-out tracking.
|
|
1887
2007
|
*
|
|
@@ -2339,5 +2459,244 @@ interface FileOperations {
|
|
|
2339
2459
|
modifiedFiles: string[];
|
|
2340
2460
|
}
|
|
2341
2461
|
|
|
2342
|
-
|
|
2343
|
-
|
|
2462
|
+
/**
|
|
2463
|
+
* FEATURE_217 (v0.7.49) — Workflow run-graph events.
|
|
2464
|
+
*
|
|
2465
|
+
* Append-only event stream for a workflow run. Each event carries a
|
|
2466
|
+
* monotonic `seq` so ordering is stable and verifiable regardless of
|
|
2467
|
+
* wall-clock (the durable writer in Phase D adds timestamps via an
|
|
2468
|
+
* injected clock). The run graph models agent relationships as a
|
|
2469
|
+
* thread/edge/event stream, not just a final summary blob.
|
|
2470
|
+
*/
|
|
2471
|
+
type WorkflowEventType = 'workflow_started' | 'phase_started' | 'phase_finished' | 'agent_spawned' | 'agent_message_sent' | 'agent_completed' | 'agent_stopped' | 'artifact_written' | 'synthesis_completed' | 'workflow_completed' | 'workflow_stopped' | 'workflow_failed';
|
|
2472
|
+
interface WorkflowEvent {
|
|
2473
|
+
/** Monotonic sequence number — stable append ordering. */
|
|
2474
|
+
readonly seq: number;
|
|
2475
|
+
readonly type: WorkflowEventType;
|
|
2476
|
+
/** Structured payload (agent name/id, phase name, error message, …). */
|
|
2477
|
+
readonly data?: Record<string, unknown>;
|
|
2478
|
+
}
|
|
2479
|
+
/**
|
|
2480
|
+
* Append-only event recorder. Assigns sequential `seq` and fans each
|
|
2481
|
+
* event out to an optional sink (the durable JSONL writer / UI consumer
|
|
2482
|
+
* subscribes here in Phase D).
|
|
2483
|
+
*/
|
|
2484
|
+
declare class WorkflowEventRecorder {
|
|
2485
|
+
private readonly sink?;
|
|
2486
|
+
private seq;
|
|
2487
|
+
private readonly events;
|
|
2488
|
+
constructor(sink?: ((event: WorkflowEvent) => void) | undefined);
|
|
2489
|
+
/** Append an event, returning the materialized record. */
|
|
2490
|
+
emit(type: WorkflowEventType, data?: Record<string, unknown>): WorkflowEvent;
|
|
2491
|
+
/** Immutable snapshot of all events emitted so far. */
|
|
2492
|
+
snapshot(): readonly WorkflowEvent[];
|
|
2493
|
+
}
|
|
2494
|
+
|
|
2495
|
+
/**
|
|
2496
|
+
* FEATURE_217 (v0.7.49) — Dynamic Workflow Harness Runtime: public types.
|
|
2497
|
+
*
|
|
2498
|
+
* Domain-neutral workflow orchestration surface. A workflow *script*
|
|
2499
|
+
* coordinates (decompose / fan-out / loop / wait / stop / verify /
|
|
2500
|
+
* synthesize); it never touches files or shell directly. The actual
|
|
2501
|
+
* agent execution is delegated to an injected `WorkflowAgentBackend`
|
|
2502
|
+
* (the coding layer provides the real one in Phase B; tests inject a
|
|
2503
|
+
* fake). This keeps `@kodax-ai/agent` free of any `@kodax-ai/coding`
|
|
2504
|
+
* dependency (ADR-021 layer independence).
|
|
2505
|
+
*/
|
|
2506
|
+
/** Lifecycle status of a single workflow-spawned agent. */
|
|
2507
|
+
type WorkflowTaskStatus = 'running' | 'completed' | 'failed' | 'stopped';
|
|
2508
|
+
/** Routing hint for which provider/model tier the child should use. */
|
|
2509
|
+
type WorkflowModelHint = 'fast' | 'balanced' | 'deep';
|
|
2510
|
+
/** Isolation policy for a spawned agent. `shared-cwd` is the default
|
|
2511
|
+
* (FEATURE_188); `worktree` is opt-in for high-risk parallel writes. */
|
|
2512
|
+
type WorkflowIsolation = 'shared-cwd' | 'worktree';
|
|
2513
|
+
interface WorkflowSpawnAgentInput {
|
|
2514
|
+
/** Human-readable label for the agent — surfaces in events / UI. */
|
|
2515
|
+
readonly name: string;
|
|
2516
|
+
/** The task prompt handed to the child agent. */
|
|
2517
|
+
readonly prompt: string;
|
|
2518
|
+
/** When true, the child runs with a read-only tool whitelist. */
|
|
2519
|
+
readonly readOnly?: boolean;
|
|
2520
|
+
/** Route to a registered specialist agent (FEATURE_191). */
|
|
2521
|
+
readonly subagentType?: string;
|
|
2522
|
+
/** Provider/model tier hint (FEATURE_120 model_hint → env tier). */
|
|
2523
|
+
readonly modelHint?: WorkflowModelHint;
|
|
2524
|
+
/** Isolation policy; defaults to `shared-cwd`. */
|
|
2525
|
+
readonly isolation?: WorkflowIsolation;
|
|
2526
|
+
/** Evidence refs (`task_id:<id>` etc.) seeded into the child context. */
|
|
2527
|
+
readonly evidenceRefs?: readonly string[];
|
|
2528
|
+
}
|
|
2529
|
+
/** Returned by `spawnAgent` — the child is in-flight, not yet complete. */
|
|
2530
|
+
interface WorkflowTaskHandle {
|
|
2531
|
+
readonly taskId: string;
|
|
2532
|
+
readonly name: string;
|
|
2533
|
+
}
|
|
2534
|
+
interface WorkflowTaskUsage {
|
|
2535
|
+
readonly inputTokens?: number;
|
|
2536
|
+
readonly outputTokens?: number;
|
|
2537
|
+
readonly totalTokens?: number;
|
|
2538
|
+
}
|
|
2539
|
+
/** Terminal result of a spawned agent (from `wait` / `runAgent`). */
|
|
2540
|
+
interface WorkflowTaskResult {
|
|
2541
|
+
readonly taskId: string;
|
|
2542
|
+
readonly name: string;
|
|
2543
|
+
readonly status: WorkflowTaskStatus;
|
|
2544
|
+
readonly finalText: string;
|
|
2545
|
+
/** Short user-facing digest, separate from the full finalText used for synthesis/audit. */
|
|
2546
|
+
readonly digest?: string;
|
|
2547
|
+
/** True when a digest was attempted but failed (error/timeout/empty); the UI then labels the excerpt fallback. */
|
|
2548
|
+
readonly digestFailed?: boolean;
|
|
2549
|
+
readonly usage?: WorkflowTaskUsage;
|
|
2550
|
+
}
|
|
2551
|
+
/** Point-in-time snapshot of a (possibly still-running) agent. */
|
|
2552
|
+
interface WorkflowTaskSnapshot {
|
|
2553
|
+
readonly taskId: string;
|
|
2554
|
+
readonly name: string;
|
|
2555
|
+
readonly status: WorkflowTaskStatus;
|
|
2556
|
+
readonly lastText?: string;
|
|
2557
|
+
}
|
|
2558
|
+
interface WorkflowWaitOptions {
|
|
2559
|
+
readonly timeoutMs?: number;
|
|
2560
|
+
}
|
|
2561
|
+
interface WorkflowParallelOptions {
|
|
2562
|
+
/** In-flight cap for this parallel block; clamped by workflow
|
|
2563
|
+
* maxConcurrency. */
|
|
2564
|
+
readonly concurrency?: number;
|
|
2565
|
+
}
|
|
2566
|
+
interface WorkflowSynthesizeInput {
|
|
2567
|
+
readonly inputs: readonly unknown[] | string | Record<string, unknown>;
|
|
2568
|
+
readonly rubric: string;
|
|
2569
|
+
}
|
|
2570
|
+
interface WorkflowSynthesis {
|
|
2571
|
+
readonly text: string;
|
|
2572
|
+
}
|
|
2573
|
+
interface WorkflowArtifactRef {
|
|
2574
|
+
readonly name: string;
|
|
2575
|
+
readonly path?: string;
|
|
2576
|
+
}
|
|
2577
|
+
interface WorkflowLogEvent {
|
|
2578
|
+
readonly message: string;
|
|
2579
|
+
readonly data?: unknown;
|
|
2580
|
+
}
|
|
2581
|
+
/**
|
|
2582
|
+
* Token budget accounting. The runtime hard-stops before launching a new
|
|
2583
|
+
* agent once completed children have exhausted the configured budget.
|
|
2584
|
+
*/
|
|
2585
|
+
interface WorkflowBudget {
|
|
2586
|
+
/** Configured token budget, or null when unbounded. */
|
|
2587
|
+
readonly total: number | null;
|
|
2588
|
+
/** Tokens accounted across completed agents so far. */
|
|
2589
|
+
spent(): number;
|
|
2590
|
+
/** `max(0, total - spent())`, or Infinity when unbounded. */
|
|
2591
|
+
remaining(): number;
|
|
2592
|
+
}
|
|
2593
|
+
interface WorkflowLimits {
|
|
2594
|
+
/** Total agents spawnable across the whole run lifetime. */
|
|
2595
|
+
readonly maxAgents?: number;
|
|
2596
|
+
/** Maximum simultaneously in-flight agents (via runAgent / parallel). */
|
|
2597
|
+
readonly maxConcurrency?: number;
|
|
2598
|
+
/** Token budget. New spawns stop once completed usage exhausts it. */
|
|
2599
|
+
readonly tokenBudget?: number;
|
|
2600
|
+
}
|
|
2601
|
+
/**
|
|
2602
|
+
* The surface a workflow script consumes. The script never gets raw
|
|
2603
|
+
* fs/shell — all effects route through agent tools behind the backend.
|
|
2604
|
+
*/
|
|
2605
|
+
interface WorkflowApi {
|
|
2606
|
+
readonly runId: string;
|
|
2607
|
+
readonly args: unknown;
|
|
2608
|
+
readonly budget: WorkflowBudget;
|
|
2609
|
+
/** Group operations under a named phase (emits phase_started/finished). */
|
|
2610
|
+
phase<T>(name: string, fn: () => Promise<T>): Promise<T>;
|
|
2611
|
+
/** Start a child agent; returns immediately with a handle. */
|
|
2612
|
+
spawnAgent(input: WorkflowSpawnAgentInput): Promise<WorkflowTaskHandle>;
|
|
2613
|
+
/** spawnAgent + wait convenience; returns the terminal result. */
|
|
2614
|
+
runAgent(input: WorkflowSpawnAgentInput): Promise<WorkflowTaskResult>;
|
|
2615
|
+
/** Await a spawned agent's terminal result. */
|
|
2616
|
+
wait(taskId: string, opts?: WorkflowWaitOptions): Promise<WorkflowTaskResult>;
|
|
2617
|
+
/** Snapshot a (possibly running) agent. */
|
|
2618
|
+
output(taskId: string): Promise<WorkflowTaskSnapshot>;
|
|
2619
|
+
/** Send a message to a running agent (via MessageQueue routing). */
|
|
2620
|
+
send(taskId: string, content: string): Promise<void>;
|
|
2621
|
+
/** Stop a running agent (graceful abort). */
|
|
2622
|
+
stop(taskId: string, reason: string): Promise<void>;
|
|
2623
|
+
/** Run lazy thunks concurrently under the concurrency gate. Thunks
|
|
2624
|
+
* MUST be `() => Promise<T>` (not already-started promises) so the
|
|
2625
|
+
* runtime can bound concurrency. */
|
|
2626
|
+
parallel<T>(items: readonly (() => Promise<T>)[], opts?: WorkflowParallelOptions): Promise<T[]>;
|
|
2627
|
+
/** Synthesize across inputs. Runs as a gated agent through the runtime
|
|
2628
|
+
* (spawn → wait), so it counts toward maxAgents / concurrency / budget
|
|
2629
|
+
* and emits run-graph events — it is NOT a backend side-channel. */
|
|
2630
|
+
synthesize(input: WorkflowSynthesizeInput): Promise<WorkflowSynthesis>;
|
|
2631
|
+
/** Persist a named artifact. */
|
|
2632
|
+
artifact(name: string, value: unknown): Promise<WorkflowArtifactRef>;
|
|
2633
|
+
/** Emit a free-text progress log event. */
|
|
2634
|
+
log(event: WorkflowLogEvent): void;
|
|
2635
|
+
}
|
|
2636
|
+
/** Metadata a workflow declares (name, description, default caps). */
|
|
2637
|
+
interface WorkflowMeta {
|
|
2638
|
+
readonly name: string;
|
|
2639
|
+
readonly description: string;
|
|
2640
|
+
/** Best-effort expected child-agent count for progress UI; not a hard cap. */
|
|
2641
|
+
readonly plannedAgents?: number;
|
|
2642
|
+
readonly maxAgents?: number;
|
|
2643
|
+
readonly maxConcurrency?: number;
|
|
2644
|
+
readonly tokenBudget?: number;
|
|
2645
|
+
/** True when the workflow only ever spawns read-only agents (no file
|
|
2646
|
+
* writes) — surfaced in the approval prompt. */
|
|
2647
|
+
readonly readOnly?: boolean;
|
|
2648
|
+
/** Declared phase names, for the approval prompt preview. */
|
|
2649
|
+
readonly phases?: readonly string[];
|
|
2650
|
+
}
|
|
2651
|
+
/** Summary shown to the user before a workflow's first run. */
|
|
2652
|
+
interface WorkflowApprovalSummary {
|
|
2653
|
+
readonly name: string;
|
|
2654
|
+
readonly description: string;
|
|
2655
|
+
readonly phases: readonly string[];
|
|
2656
|
+
readonly plannedAgents?: number;
|
|
2657
|
+
readonly maxAgents: number | null;
|
|
2658
|
+
readonly maxConcurrency: number | null;
|
|
2659
|
+
readonly tokenBudget: number | null;
|
|
2660
|
+
/** Whether the workflow may write files (false for read-only workflows). */
|
|
2661
|
+
readonly writesFiles: boolean;
|
|
2662
|
+
}
|
|
2663
|
+
/** Approval gate — returns true to proceed, false to cancel the run. */
|
|
2664
|
+
type WorkflowApproval = (summary: WorkflowApprovalSummary) => boolean | Promise<boolean>;
|
|
2665
|
+
/** A workflow's entry function: coordinates agents via the `WorkflowApi`. */
|
|
2666
|
+
type WorkflowRun<TArgs = unknown, TResult = unknown> = (wf: WorkflowApi, args: TArgs) => Promise<TResult>;
|
|
2667
|
+
/** A self-contained workflow: metadata + entry function. Built-in
|
|
2668
|
+
* workflows (Phase C) and saved `.kodax/workflows/*.ts` (Phase E) both
|
|
2669
|
+
* materialize to this shape. */
|
|
2670
|
+
interface WorkflowModule<TArgs = unknown, TResult = unknown> {
|
|
2671
|
+
readonly meta: WorkflowMeta;
|
|
2672
|
+
readonly run: WorkflowRun<TArgs, TResult>;
|
|
2673
|
+
}
|
|
2674
|
+
/**
|
|
2675
|
+
* Injected execution backend. The coding layer implements this over its
|
|
2676
|
+
* child-dispatch substrate (ChildTaskRegistry / childProgressSnapshots /
|
|
2677
|
+
* MessageQueue / executeChildAgents); tests inject a fake. The agent
|
|
2678
|
+
* runtime depends ONLY on this interface — never on coding.
|
|
2679
|
+
*/
|
|
2680
|
+
interface WorkflowAgentBackend {
|
|
2681
|
+
spawn(input: WorkflowSpawnAgentInput): Promise<WorkflowTaskHandle>;
|
|
2682
|
+
wait(taskId: string, opts?: WorkflowWaitOptions): Promise<WorkflowTaskResult>;
|
|
2683
|
+
output(taskId: string): Promise<WorkflowTaskSnapshot>;
|
|
2684
|
+
send(taskId: string, content: string): Promise<void>;
|
|
2685
|
+
stop(taskId: string, reason: string): Promise<void>;
|
|
2686
|
+
/** Optional durable artifact writer (Phase D wires the run graph).
|
|
2687
|
+
* `wf.synthesize` is NOT a backend method — it runs as a gated agent
|
|
2688
|
+
* through `spawn`/`wait` so it counts toward the runtime's caps. */
|
|
2689
|
+
writeArtifact?(name: string, value: unknown): Promise<WorkflowArtifactRef>;
|
|
2690
|
+
}
|
|
2691
|
+
type WorkflowRunStatus = 'running' | 'completed' | 'failed' | 'stopped';
|
|
2692
|
+
/** Immutable snapshot of a workflow run's accumulated state. */
|
|
2693
|
+
interface WorkflowRunState {
|
|
2694
|
+
readonly runId: string;
|
|
2695
|
+
readonly status: WorkflowRunStatus;
|
|
2696
|
+
readonly totalSpawned: number;
|
|
2697
|
+
readonly events: readonly WorkflowEvent[];
|
|
2698
|
+
readonly artifacts: readonly WorkflowArtifactRef[];
|
|
2699
|
+
}
|
|
2700
|
+
|
|
2701
|
+
export { DEFAULT_SYSTEM_CAP as D, GuardrailBlockedError as H, GuardrailEscalateError as J, InvariantSession as T, MAX_TOOL_LOOP_ITERATIONS as U, WorkflowEventRecorder as a$, Tracer as aR, Runner as af, SpanImpl as ax, extractAssistantTextFromMessage as bA, getActiveUserInteraction as bB, getAdmittedAgentBindings as bC, isRunnableTool as bD, isRunnerLlmResult as bE, registerChildTask as bF, registerPresetDispatcher as bG, requestTaskStop as bH, runAdmissionAudit as bI, runInputGuardrails as bJ, runOutputGuardrails as bK, runToolAfterGuardrails as bL, runToolBeforeGuardrails as bM, setActiveUserInteraction as bN, setAdmittedAgentBindings as bO, _resetAdmittedAgentBindings as bk, _resetPresetDispatchers as bl, buildAssistantMessageFromLlmResult as bm, buildSystemPrompt as bn, buildToolResultMessage as bo, collectGuardrails as bp, createAgent as bq, createHandoff as br, createInMemorySession as bs, createInvariantSessionForAgent as bt, createStateWriter as bu, createTrace as bv, defaultTracer as bw, detectInstructionsInjection as bx, discoverInstances as by, executeRunnerToolCall as bz };
|
|
2702
|
+
export type { PersistedSessionState as $, AdmissionAuditOptions as A, Guardrail as B, ChildTaskRegistry as C, EnqueueInput as E, FanoutSpanData as F, GenerationSpanData as G, GuardrailContext as I, GuardrailSpanData as K, GuardrailVerdict as L, Handoff as M, HandoffSpanData as N, InMemorySessionOptions as O, InputGuardrail as P, InstanceDiscoveryFs as Q, InvariantId as R, InvariantResult as S, ManifestPatch as V, MessageEntry as W, MessageMode as X, MessagePriority as Y, ObserveCtx as Z, OutputGuardrail as _, AdmissionCtx as a, PresetDispatcher as a0, PresetTracingContext as a1, QualityInvariant as a2, QueueEventListener as a3, QueuedMessage as a4, ReadonlyMutationTracker as a5, ReadonlyRecorder as a6, ReasoningDepth as a7, RecentlyModifiedFile as a8, RequestTaskStopOptions as a9, StateWriter as aA, StateWriterFs as aB, StateWriterOptions as aC, StopHookContext as aD, StopHookFn as aE, StopHookResult as aF, StopHookSpanData as aG, SystemCap as aH, TaskAbortRegistry as aI, TerminalCtx as aJ, ToolBeforeOutcome as aK, ToolCallSpanData as aL, ToolCapability as aM, ToolGuardrail as aN, ToolPermission as aO, Trace as aP, TraceOptions as aQ, TracerOptions as aS, UserInteraction as aT, WorkflowAgentBackend as aU, WorkflowApi as aV, WorkflowApproval as aW, WorkflowApprovalSummary as aX, WorkflowArtifactRef as aY, WorkflowBudget as aZ, WorkflowEvent as a_, RequestTaskStopResult as aa, RunEvent as ab, RunOptions as ac, RunResult as ad, RunnableTool as ae, RunnerEvent as ag, RunnerLlmResult as ah, RunnerLlmReturn as ai, RunnerToolCall as aj, RunnerToolContext as ak, RunnerToolObserver as al, RunnerToolResult as am, Session as an, SessionDispatchResult as ao, SessionEntry as ap, SessionExtension as aq, SessionForkOptions as ar, SessionMeta as as, SessionStateSnapshot as at, Span as au, SpanData as av, SpanError as aw, SpanImplOptions as ay, StartTraceOptions as az, AdmissionVerdict as b, WorkflowEventType as b0, WorkflowIsolation as b1, WorkflowLimits as b2, WorkflowLogEvent as b3, WorkflowMeta as b4, WorkflowModelHint as b5, WorkflowModule as b6, WorkflowParallelOptions as b7, WorkflowRun as b8, WorkflowRunState as b9, WorkflowRunStatus as ba, WorkflowSpawnAgentInput as bb, WorkflowSynthesis as bc, WorkflowSynthesizeInput as bd, WorkflowTaskHandle as be, WorkflowTaskResult as bf, WorkflowTaskSnapshot as bg, WorkflowTaskStatus as bh, WorkflowTaskUsage as bi, WorkflowWaitOptions as bj, AdmittedHandle as c, Agent as d, AgentManifest as e, AgentMessage as f, AgentMiddlewareDeclaration as g, AgentReasoningProfile as h, AgentSpanData as i, AgentTool as j, AskUserMultiOptions as k, AskUserQuestionItem as l, AskUserQuestionOptions as m, CompactionAnchor as n, CompactionConfig as o, CompactionDetails as p, CompactionResult as q, CompactionSpanData as r, CompactionUpdate as s, CurrentTodoSummary as t, Deliverable as u, DequeueFilter as v, DiscoveredInstance as w, DiscoveryOptions as x, EvidenceSpanData as y, FileOperations as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as KodaXMessage } from './types.d-
|
|
1
|
+
import { n as KodaXMessage } from './types.d-rPRl2LSB.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @kodax-ai/agent Types
|
|
@@ -182,6 +182,8 @@ interface KodaXSessionData {
|
|
|
182
182
|
messages: KodaXMessage[];
|
|
183
183
|
title: string;
|
|
184
184
|
gitRoot: string;
|
|
185
|
+
/** Consumer-owned private string persisted with the session. */
|
|
186
|
+
tag?: string;
|
|
185
187
|
runtimeInfo?: KodaXSessionRuntimeInfo;
|
|
186
188
|
scope?: KodaXSessionScope;
|
|
187
189
|
uiHistory?: KodaXSessionUiHistoryItem[];
|
|
@@ -196,6 +198,8 @@ interface KodaXSessionMeta {
|
|
|
196
198
|
title: string;
|
|
197
199
|
id: string;
|
|
198
200
|
gitRoot: string;
|
|
201
|
+
/** Consumer-owned private string persisted with the session. */
|
|
202
|
+
tag?: string;
|
|
199
203
|
runtimeInfo?: KodaXSessionRuntimeInfo;
|
|
200
204
|
createdAt: string;
|
|
201
205
|
scope?: KodaXSessionScope;
|
|
@@ -283,6 +287,7 @@ interface KodaXSessionStorage {
|
|
|
283
287
|
id: string;
|
|
284
288
|
title: string;
|
|
285
289
|
msgCount: number;
|
|
290
|
+
tag?: string;
|
|
286
291
|
runtimeInfo?: KodaXSessionRuntimeInfo;
|
|
287
292
|
}>>;
|
|
288
293
|
delete?(id: string): Promise<void>;
|