@kodax-ai/kodax 0.7.77 → 0.7.79
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 +3651 -3201
- package/README.md +317 -110
- package/README_CN.md +255 -91
- package/config-templates/config.example.jsonc +124 -32
- package/config-templates/integrations/a2a.example.jsonc +23 -7
- package/dist/builtin/skill-creator/scripts/aggregate-benchmark.js +2 -1
- package/dist/builtin/skill-creator/scripts/analyze-benchmark.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/analyze-benchmark.js +4 -3
- package/dist/builtin/skill-creator/scripts/compare-runs.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/compare-runs.js +4 -3
- package/dist/builtin/skill-creator/scripts/generate-review.js +2 -1
- package/dist/builtin/skill-creator/scripts/grade-evals.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/grade-evals.js +4 -3
- package/dist/builtin/skill-creator/scripts/improve-description.js +2 -1
- package/dist/builtin/skill-creator/scripts/init-skill.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/init-skill.js +4 -3
- package/dist/builtin/skill-creator/scripts/install-skill.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/install-skill.js +4 -3
- package/dist/builtin/skill-creator/scripts/package-skill.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/package-skill.js +4 -3
- package/dist/builtin/skill-creator/scripts/quick-validate.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/quick-validate.js +4 -3
- package/dist/builtin/skill-creator/scripts/run-eval.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/run-eval.js +4 -3
- package/dist/builtin/skill-creator/scripts/run-loop.js +2 -1
- package/dist/builtin/skill-creator/scripts/run-trigger-eval.js +2 -1
- package/dist/builtin/skill-creator/scripts/utils.d.ts +3 -0
- package/dist/builtin/skill-creator/scripts/utils.js +5 -1
- package/dist/chunks/agent-V4AC5JZD.js +2 -0
- package/dist/chunks/argument-completer-ZPC2MLES.js +2 -0
- package/dist/chunks/chunk-5BNQXXGY.js +1 -0
- package/dist/chunks/{chunk-EH7AOMJ7.js → chunk-67THZRM6.js} +1 -1
- package/dist/chunks/chunk-6GVQDQTQ.js +292 -0
- package/dist/chunks/chunk-B6UY3VHV.js +348 -0
- package/dist/chunks/{chunk-HORNWBYR.js → chunk-BBOVVDQJ.js} +1 -1
- package/dist/chunks/chunk-CR2IF7VF.js +30 -0
- package/dist/chunks/{chunk-FNW2XUL5.js → chunk-CXHEZY5G.js} +1 -1
- package/dist/chunks/chunk-EDZ4QILG.js +266 -0
- package/dist/chunks/chunk-GEECPO2H.js +218 -0
- package/dist/chunks/chunk-H5LLM7DB.js +89 -0
- package/dist/chunks/chunk-KLWP7POA.js +467 -0
- package/dist/chunks/{chunk-XSA37BVM.js → chunk-M4N2JZTZ.js} +2 -2
- package/dist/chunks/chunk-OWQT3FTE.js +5 -0
- package/dist/chunks/chunk-Q4M7DJOD.js +319 -0
- package/dist/chunks/{chunk-3DD4QEBH.js → chunk-QCZLCLFL.js} +10 -10
- package/dist/chunks/chunk-RQPMGRTR.js +810 -0
- package/dist/chunks/chunk-SG6P4SZS.js +123 -0
- package/dist/chunks/chunk-TSTVAU5E.js +386 -0
- package/dist/chunks/chunk-ZCZZUE5E.js +662 -0
- package/dist/chunks/compaction-config-AEUGVROL.js +2 -0
- package/dist/chunks/{construction-bootstrap-RPRL3L7R.js → construction-bootstrap-K3ZGEN5N.js} +1 -1
- package/dist/chunks/dist-GFJFRPAV.js +2 -0
- package/dist/chunks/{dist-FDSOIR35.js → dist-JMO47GJV.js} +1 -1
- package/dist/chunks/host-23K2Q6RZ.js +2 -0
- package/dist/chunks/run-manager-PGIR6ITA.js +2 -0
- package/dist/chunks/utils-6LEKJPQN.js +2 -0
- package/dist/index.d.ts +22 -21
- package/dist/index.js +6 -6
- package/dist/kodax_bootstrap.js +2 -1
- package/dist/kodax_cli.js +2225 -1468
- package/dist/kodax_resume.js +570 -34
- package/dist/provider-capabilities.json +85 -50
- package/dist/runtime-worker.js +2076 -1343
- package/dist/sandbox-workspace-session.js +829 -0
- package/dist/sdk-a2a.d.ts +24 -18
- package/dist/sdk-a2a.js +8 -8
- package/dist/sdk-agent.d.ts +315 -168
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +42 -205
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-experimental-memory.d.ts +3 -3
- package/dist/sdk-experimental-memory.js +1 -1
- package/dist/sdk-llm.d.ts +7 -6
- package/dist/sdk-llm.js +1 -1
- package/dist/sdk-mcp.d.ts +1 -1
- package/dist/sdk-mcp.js +1 -1
- package/dist/sdk-media.d.ts +1 -1
- package/dist/sdk-media.js +1 -1
- package/dist/sdk-repl.d.ts +77 -36
- package/dist/sdk-repl.js +2 -2
- package/dist/sdk-runtime.d.ts +406 -163
- package/dist/sdk-runtime.js +1 -1
- package/dist/sdk-sandbox.d.ts +93 -0
- package/dist/sdk-sandbox.js +2 -0
- package/dist/sdk-session.d.ts +8 -9
- package/dist/sdk-session.js +1 -1
- package/dist/sdk-skills.d.ts +2 -2
- package/dist/sdk-skills.js +1 -1
- package/dist/semantic-worker.js +283 -18
- package/dist/types-chunks/{base.d-4e74xDdy.d.ts → base.d-DxG0m09Z.d.ts} +1 -1
- package/dist/types-chunks/{bash-prefix-extractor.d-pZdu6qt7.d.ts → bash-prefix-extractor.d-CNSidpmv.d.ts} +149 -10
- package/dist/types-chunks/{capability-learning.d-CVsdHw4j.d.ts → capability-learning.d-iPSiAmc_.d.ts} +1 -1
- package/dist/types-chunks/{capsule.d-CxCm1KZz.d.ts → capsule.d-B3q98pLQ.d.ts} +9 -7
- package/dist/types-chunks/{types.d-RdWRfUEs.d.ts → controller.d-RGV7Pjv9.d.ts} +785 -8
- package/dist/types-chunks/{guardrail.d-B0PwAZVR.d.ts → guardrail.d-1NLSFTyN.d.ts} +310 -70
- package/dist/types-chunks/{history-retrieval.d-B__aEN62.d.ts → history-retrieval.d-BAegI14A.d.ts} +16 -3
- package/dist/types-chunks/{integration-config.d-ojG4swOP.d.ts → integration-config.d-BNowXE8k.d.ts} +23 -8
- package/dist/types-chunks/{oauth-login.d-Bgb4rdLN.d.ts → oauth-login.d-6i-vidxv.d.ts} +6 -2
- package/dist/types-chunks/{public-api.d--fF88JrC.d.ts → public-api.d-BpJhHoa7.d.ts} +366 -28
- package/dist/types-chunks/{commands.d-BccESAMV.d.ts → repl.d-CZ12Ow3X.d.ts} +89 -78
- package/dist/types-chunks/{side-query.d-5JvXhuOZ.d.ts → resolver.d-C9IW4fmU.d.ts} +7 -67
- package/dist/types-chunks/{run-manager.d-B47hIqnI.d.ts → run-manager.d-CX3AUocA.d.ts} +1 -1
- package/dist/types-chunks/{sdk-session-CLWf8Adb.d.ts → sdk-session-B3cfJKqF.d.ts} +3 -3
- package/dist/types-chunks/side-query.d-CP1LiRiH.d.ts +83 -0
- package/dist/types-chunks/{types-LanCEDj8.d.ts → types-Bf3Y3mW-.d.ts} +42 -3
- package/dist/types-chunks/{types.d-CODuyyqy.d.ts → types.d-BZ9oXvTV.d.ts} +2 -2
- package/dist/types-chunks/{types.d-DCQVBqVn.d.ts → types.d-BbtGlKZu.d.ts} +25 -3
- package/dist/types-chunks/{types.d-DCsKM8aT.d.ts → types.d-C0_rn--1.d.ts} +4 -4
- package/dist/types-chunks/{types.d-DIpZJKUl.d.ts → types.d-CgrXrFrq.d.ts} +16 -2
- package/dist/types-chunks/{utils.d-CDduqbFw.d.ts → utils.d-CGpHavsU.d.ts} +32 -8
- package/docs/SDK_EMBEDDER_GUIDE.md +1117 -227
- package/package.json +11 -1
- package/dist/chunks/agent-NGSWFE73.js +0 -2
- package/dist/chunks/argument-completer-WGGZPEEO.js +0 -2
- package/dist/chunks/chunk-27QLRH3D.js +0 -5
- package/dist/chunks/chunk-2MQPVY6P.js +0 -770
- package/dist/chunks/chunk-6WAPVAGQ.js +0 -74
- package/dist/chunks/chunk-AOENDSVN.js +0 -448
- package/dist/chunks/chunk-FSXI4MAV.js +0 -78
- package/dist/chunks/chunk-HV2GMZUZ.js +0 -343
- package/dist/chunks/chunk-IQT4RPCE.js +0 -46
- package/dist/chunks/chunk-JS2BHGJP.js +0 -158
- package/dist/chunks/chunk-OAMKECRG.js +0 -381
- package/dist/chunks/chunk-ON2WG2LG.js +0 -622
- package/dist/chunks/chunk-RUGAAHTF.js +0 -321
- package/dist/chunks/chunk-TGCG7U2W.js +0 -37
- package/dist/chunks/compaction-config-BE7VYWH6.js +0 -2
- package/dist/chunks/dist-ZZBNVTKU.js +0 -2
- package/dist/chunks/host-QAKQVC4A.js +0 -2
- package/dist/chunks/run-manager-N4UFWA2D.js +0 -2
- package/dist/chunks/utils-AUHCI4D5.js +0 -2
- package/dist/types-chunks/center-types.d-BBT122uJ.d.ts +0 -91
- package/dist/types-chunks/guardrail.d-CJx9RRd3.d.ts +0 -156
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k as KodaXMessage,
|
|
1
|
+
import { k as KodaXMessage, a2 as KodaXToolDefinition, G as KodaXReasoningMode, aa as KodaXWireReasoningEffort, a4 as KodaXToolResultContentItem, Z as KodaXThinkingBlock, J as KodaXRedactedThinkingBlock } from './types.d-CgrXrFrq.js';
|
|
2
2
|
|
|
3
3
|
type AgentActorState = 'running' | 'idle' | 'closed';
|
|
4
4
|
type AgentTurnState = 'accepted' | 'running' | 'completed' | 'failed' | 'interrupted';
|
|
@@ -124,6 +124,8 @@ interface AgentTreeSnapshot {
|
|
|
124
124
|
readonly activeNonRootTurns: number;
|
|
125
125
|
readonly maxConcurrentThreads: number;
|
|
126
126
|
readonly revision: number;
|
|
127
|
+
/** Turn-admission state revision; absent only on older/custom clients. */
|
|
128
|
+
readonly admissionRevision?: number;
|
|
127
129
|
}
|
|
128
130
|
interface AgentTurnSummary {
|
|
129
131
|
readonly turnId: string;
|
|
@@ -203,13 +205,16 @@ interface AgentMutationOptions {
|
|
|
203
205
|
readonly expectedRevision?: number;
|
|
204
206
|
/** Optimistic tree revision checked inside the serialized durable mutation. */
|
|
205
207
|
readonly expectedTreeRevision?: number;
|
|
208
|
+
/** Optimistic turn-admission revision, excluding progress and mailbox writes. */
|
|
209
|
+
readonly expectedAdmissionRevision?: number;
|
|
206
210
|
}
|
|
207
211
|
interface AgentTurnExecutor {
|
|
208
212
|
execute(input: AgentExecutionInput): Promise<AgentExecutionResult>;
|
|
209
213
|
}
|
|
210
|
-
interface
|
|
211
|
-
readonly schemaVersion: 1;
|
|
214
|
+
interface AgentActorSnapshotContents {
|
|
212
215
|
readonly revision: number;
|
|
216
|
+
/** Added after schema v2; legacy snapshots derive it from revision on load. */
|
|
217
|
+
readonly admissionRevision?: number;
|
|
213
218
|
readonly maxConcurrentThreads: number;
|
|
214
219
|
readonly actors: readonly AgentActor[];
|
|
215
220
|
readonly turns: readonly AgentTurn[];
|
|
@@ -220,13 +225,35 @@ interface AgentActorSnapshot {
|
|
|
220
225
|
readonly pendingRootCompletionTurnIds?: readonly string[];
|
|
221
226
|
readonly events: readonly AgentEvent[];
|
|
222
227
|
}
|
|
228
|
+
/** Runtime process/controller identity that exclusively owns one durable Actor tree. */
|
|
229
|
+
interface AgentActorOwner {
|
|
230
|
+
readonly ownerId: string;
|
|
231
|
+
readonly runtimeId: string;
|
|
232
|
+
readonly pid: number;
|
|
233
|
+
readonly startedAt: string;
|
|
234
|
+
/** Opaque host identity for proving that this exact Runtime, not only its PID, remains alive. */
|
|
235
|
+
readonly livenessId?: string;
|
|
236
|
+
/** Loopback challenge endpoint paired with livenessId. */
|
|
237
|
+
readonly livenessPort?: number;
|
|
238
|
+
}
|
|
239
|
+
interface AgentActorSnapshotV1 extends AgentActorSnapshotContents {
|
|
240
|
+
readonly schemaVersion: 1;
|
|
241
|
+
}
|
|
242
|
+
interface AgentActorSnapshotV2 extends AgentActorSnapshotContents {
|
|
243
|
+
readonly schemaVersion: 2;
|
|
244
|
+
readonly owner?: AgentActorOwner;
|
|
245
|
+
}
|
|
246
|
+
type AgentActorSnapshot = AgentActorSnapshotV1 | AgentActorSnapshotV2;
|
|
223
247
|
interface AgentActorStore {
|
|
224
248
|
load(): Promise<AgentActorSnapshot | undefined>;
|
|
249
|
+
/** CAS save. Implementations must throw actor_snapshot_conflict on a revision mismatch. */
|
|
225
250
|
save(snapshot: AgentActorSnapshot, expectedRevision: number): Promise<void>;
|
|
226
251
|
}
|
|
227
252
|
/** Runtime-bound actor control surface. The caller path is minted by Runtime. */
|
|
228
253
|
interface AgentActorClient {
|
|
229
254
|
readonly callerPath: string;
|
|
255
|
+
/** Stable in-process identity shared by clients bound to the same Actor tree. */
|
|
256
|
+
readonly admissionScope?: object;
|
|
230
257
|
spawn(input: AgentSpawnInput, options?: AgentMutationOptions): Promise<AgentTurnRef>;
|
|
231
258
|
send(targetPath: string, content: string, classification?: AgentDataClassification, forwardedMessageId?: string): Promise<AgentMailboxMessage>;
|
|
232
259
|
followup(targetPath: string, objective: string, metadata?: Readonly<Record<string, AgentMetadataValue>>, options?: AgentMutationOptions): Promise<AgentFollowupResult>;
|
|
@@ -346,26 +373,47 @@ interface KodaXSessionClientNoticeEntry extends KodaXSessionEntryBase {
|
|
|
346
373
|
interface KodaXMemoryOutcomeDigest {
|
|
347
374
|
readonly id: string;
|
|
348
375
|
readonly reviewKey: string;
|
|
376
|
+
/** Stable root-episode identity; absent on pre-F263 digests. */
|
|
377
|
+
readonly episodeId?: string;
|
|
349
378
|
readonly sessionId: string;
|
|
350
379
|
readonly branchId: string;
|
|
351
380
|
readonly sequence: number;
|
|
352
381
|
readonly objective: string;
|
|
353
382
|
readonly actionSignature?: string;
|
|
354
383
|
readonly approach: string;
|
|
355
|
-
|
|
384
|
+
/**
|
|
385
|
+
* `cancelled` is reserved for a host-bound explicit Memory intent. Ordinary
|
|
386
|
+
* cancelled episodes do not produce an outcome digest.
|
|
387
|
+
*/
|
|
388
|
+
readonly outcome: 'succeeded' | 'failed' | 'cancelled';
|
|
356
389
|
readonly summary: string;
|
|
357
390
|
readonly preconditions?: string;
|
|
358
391
|
readonly lesson?: string;
|
|
359
392
|
readonly evidenceRefs: readonly string[];
|
|
360
393
|
readonly evidence?: readonly KodaXMemoryOutcomeEvidence[];
|
|
394
|
+
/**
|
|
395
|
+
* Explicit durable intent captured from the Action LLM and bound by the
|
|
396
|
+
* host to an exact quote in the current user turn. It is evidence for the
|
|
397
|
+
* governed reviewer, never proof that Memory was queued or applied.
|
|
398
|
+
*/
|
|
399
|
+
readonly memoryIntent?: KodaXMemoryIntent;
|
|
361
400
|
readonly memoryInfluence?: readonly KodaXMemoryInfluenceRef[];
|
|
362
401
|
readonly visibility: 'prompt_safe' | 'private' | 'sensitive';
|
|
363
402
|
readonly createdAt: string;
|
|
364
403
|
}
|
|
404
|
+
interface KodaXMemoryIntent {
|
|
405
|
+
readonly operation: 'remember' | 'correct';
|
|
406
|
+
readonly evidenceRef: string;
|
|
407
|
+
/** Sanitized model-derived claim proposed for governed review. */
|
|
408
|
+
readonly candidateStatement: string;
|
|
409
|
+
/** Sanitized representation of the exact current-user quote verified by the host. */
|
|
410
|
+
readonly userQuote: string;
|
|
411
|
+
}
|
|
365
412
|
interface KodaXMemoryOutcomeEvidence {
|
|
366
413
|
readonly ref: string;
|
|
367
414
|
readonly grade: 'authoritative' | 'verified' | 'corroborated' | 'observed' | 'inferred';
|
|
368
415
|
readonly source: 'user' | 'host' | 'tool' | 'environment' | 'agent';
|
|
416
|
+
readonly verdict?: 'passed' | 'failed' | 'inconclusive';
|
|
369
417
|
readonly observedAt: string;
|
|
370
418
|
}
|
|
371
419
|
interface KodaXMemoryInfluenceRef {
|
|
@@ -375,9 +423,13 @@ interface KodaXMemoryInfluenceRef {
|
|
|
375
423
|
interface KodaXSessionMemoryOutcomeDigestEntry extends KodaXSessionEntryBase {
|
|
376
424
|
readonly type: 'memory_outcome_digest';
|
|
377
425
|
readonly digest: KodaXMemoryOutcomeDigest;
|
|
426
|
+
/** Durable F263 review job identity. Absent on pre-F263 lineage records. */
|
|
427
|
+
readonly jobId?: string;
|
|
378
428
|
}
|
|
379
429
|
interface KodaXSessionMemoryReviewReceiptEntry extends KodaXSessionEntryBase {
|
|
380
430
|
readonly type: 'memory_review_receipt';
|
|
431
|
+
/** Distinguishes repeated review keys across branch epochs. */
|
|
432
|
+
readonly jobId?: string;
|
|
381
433
|
readonly reviewKey: string;
|
|
382
434
|
readonly proposalIds: readonly string[];
|
|
383
435
|
readonly status: 'completed' | 'no_action';
|
|
@@ -617,6 +669,14 @@ interface KodaXExtensionStore {
|
|
|
617
669
|
interface KodaXSessionStorage {
|
|
618
670
|
save(id: string, data: KodaXSessionData): Promise<void>;
|
|
619
671
|
load(id: string): Promise<KodaXSessionData | null>;
|
|
672
|
+
/**
|
|
673
|
+
* Atomically mutates context-silent lineage state against the latest
|
|
674
|
+
* persisted session. Hosts that own session persistence may expose this
|
|
675
|
+
* without allowing the runner to write a stale full snapshot. Returns
|
|
676
|
+
* true when the session existed and the callback was evaluated, including
|
|
677
|
+
* an idempotent no-op; false only when the session was not found.
|
|
678
|
+
*/
|
|
679
|
+
mutateLineage?(id: string, mutation: (lineage: KodaXSessionLineage) => KodaXSessionLineage): Promise<boolean>;
|
|
620
680
|
getLineage?(id: string): Promise<KodaXSessionLineage | null>;
|
|
621
681
|
/** Exact lineage merged from the active session file and island sidecars. */
|
|
622
682
|
loadFullLineage?(id: string): Promise<KodaXSessionLineage | null>;
|
|
@@ -1927,6 +1987,172 @@ declare function buildAssistantMessageFromLlmResult(result: RunnerLlmResult): Ag
|
|
|
1927
1987
|
*/
|
|
1928
1988
|
declare function buildToolResultMessage(calls: readonly RunnerToolCall[], results: readonly RunnerToolResult[]): AgentMessage;
|
|
1929
1989
|
|
|
1990
|
+
/**
|
|
1991
|
+
* Guardrail Runtime — FEATURE_085 (v0.7.26).
|
|
1992
|
+
*
|
|
1993
|
+
* Three-tier runtime for Agent guardrails:
|
|
1994
|
+
*
|
|
1995
|
+
* - `InputGuardrail`: runs once before the first LLM turn, inspects the
|
|
1996
|
+
* full input transcript, may allow / rewrite / block / escalate.
|
|
1997
|
+
* - `OutputGuardrail`: runs once before returning, inspects the final
|
|
1998
|
+
* assistant message, may allow / rewrite / block / escalate.
|
|
1999
|
+
* - `ToolGuardrail`: runs before and/or after each tool invocation,
|
|
2000
|
+
* inspects the call / result, may allow / rewrite / block / escalate.
|
|
2001
|
+
*
|
|
2002
|
+
* The four verdict actions:
|
|
2003
|
+
*
|
|
2004
|
+
* - `allow`: continue with the current value.
|
|
2005
|
+
* - `rewrite`: replace the current value with `payload`.
|
|
2006
|
+
* - `block`: throw `GuardrailBlockedError` (for input/output) or surface
|
|
2007
|
+
* an error tool_result (for tool-before); the LLM / caller sees a
|
|
2008
|
+
* rejection and must adapt.
|
|
2009
|
+
* - `escalate`: throw `GuardrailEscalateError`; the SDK consumer catches
|
|
2010
|
+
* and decides whether to prompt the user, retry under different
|
|
2011
|
+
* constraints, etc.
|
|
2012
|
+
*
|
|
2013
|
+
* Every guardrail invocation emits a `GuardrailSpan` under the agent's
|
|
2014
|
+
* span when tracing is active.
|
|
2015
|
+
*
|
|
2016
|
+
* @experimental API shape may adjust during v0.7.x rollout.
|
|
2017
|
+
*/
|
|
2018
|
+
|
|
2019
|
+
/**
|
|
2020
|
+
* Runtime-authenticated intent metadata for permission guardrails.
|
|
2021
|
+
*
|
|
2022
|
+
* This is deliberately separate from the model-visible transcript: a child
|
|
2023
|
+
* briefing is context generated by the Runtime, not a new user authorization.
|
|
2024
|
+
*/
|
|
2025
|
+
interface GuardrailPermissionIntent {
|
|
2026
|
+
readonly rootUserIntent?: string;
|
|
2027
|
+
readonly delegatedObjective?: string;
|
|
2028
|
+
readonly bindingConstraints?: readonly string[];
|
|
2029
|
+
readonly scopeHint?: string;
|
|
2030
|
+
readonly readOnly?: boolean;
|
|
2031
|
+
}
|
|
2032
|
+
/**
|
|
2033
|
+
* Shared execution context passed to every guardrail.
|
|
2034
|
+
*
|
|
2035
|
+
* `messages` is the live conversation transcript at the moment this
|
|
2036
|
+
* guardrail fires. For tool-side guardrails this is the transcript at
|
|
2037
|
+
* call-site time — it does NOT yet include the assistant turn that
|
|
2038
|
+
* emitted the current tool_use, since that turn is appended only after
|
|
2039
|
+
* the full tool batch settles. Optional so existing guardrails that
|
|
2040
|
+
* don't read context still type-check; populated by the Runner for all
|
|
2041
|
+
* production hook points.
|
|
2042
|
+
*
|
|
2043
|
+
* Added in FEATURE_092 (v0.7.33) so the auto-mode classifier guardrail
|
|
2044
|
+
* can extract intent context (user prompt + prior tool_use / tool_result
|
|
2045
|
+
* blocks) without reaching into Runner internals.
|
|
2046
|
+
*/
|
|
2047
|
+
interface GuardrailContext {
|
|
2048
|
+
readonly agent: Agent;
|
|
2049
|
+
readonly abortSignal?: AbortSignal;
|
|
2050
|
+
readonly messages?: readonly AgentMessage[];
|
|
2051
|
+
readonly permissionIntent?: GuardrailPermissionIntent;
|
|
2052
|
+
}
|
|
2053
|
+
/**
|
|
2054
|
+
* Outcome of a single guardrail check. `payload` shape depends on the hook
|
|
2055
|
+
* point — see the specific guardrail interface for the expected type.
|
|
2056
|
+
*/
|
|
2057
|
+
type GuardrailVerdict = {
|
|
2058
|
+
readonly action: 'allow';
|
|
2059
|
+
} | {
|
|
2060
|
+
readonly action: 'rewrite';
|
|
2061
|
+
readonly payload: unknown;
|
|
2062
|
+
readonly reason?: string;
|
|
2063
|
+
} | {
|
|
2064
|
+
readonly action: 'block';
|
|
2065
|
+
readonly reason: string;
|
|
2066
|
+
} | {
|
|
2067
|
+
readonly action: 'escalate';
|
|
2068
|
+
readonly reason: string;
|
|
2069
|
+
};
|
|
2070
|
+
/**
|
|
2071
|
+
* Input-side guardrail. Expected `rewrite` payload shape:
|
|
2072
|
+
* `readonly AgentMessage[]` — the replacement transcript.
|
|
2073
|
+
*/
|
|
2074
|
+
interface InputGuardrail extends Guardrail {
|
|
2075
|
+
readonly kind: 'input';
|
|
2076
|
+
check(input: readonly AgentMessage[], ctx: GuardrailContext): Promise<GuardrailVerdict>;
|
|
2077
|
+
}
|
|
2078
|
+
/**
|
|
2079
|
+
* Output-side guardrail. Expected `rewrite` payload shape:
|
|
2080
|
+
* `AgentMessage` — the replacement final assistant message.
|
|
2081
|
+
*/
|
|
2082
|
+
interface OutputGuardrail extends Guardrail {
|
|
2083
|
+
readonly kind: 'output';
|
|
2084
|
+
check(output: AgentMessage, ctx: GuardrailContext): Promise<GuardrailVerdict>;
|
|
2085
|
+
}
|
|
2086
|
+
/**
|
|
2087
|
+
* Tool-side guardrail. `beforeTool` rewrite payload shape: `RunnerToolCall`
|
|
2088
|
+
* (replacement call). `afterTool` rewrite payload shape: `RunnerToolResult`
|
|
2089
|
+
* (replacement result). Either hook is optional.
|
|
2090
|
+
*/
|
|
2091
|
+
interface ToolGuardrail extends Guardrail {
|
|
2092
|
+
readonly kind: 'tool';
|
|
2093
|
+
beforeTool?(call: RunnerToolCall, ctx: GuardrailContext): Promise<GuardrailVerdict>;
|
|
2094
|
+
afterTool?(call: RunnerToolCall, result: RunnerToolResult, ctx: GuardrailContext): Promise<GuardrailVerdict>;
|
|
2095
|
+
}
|
|
2096
|
+
/**
|
|
2097
|
+
* Thrown when any guardrail returns `{ action: 'block' }`. The Runner
|
|
2098
|
+
* propagates this up to the caller — the run is aborted at that point.
|
|
2099
|
+
*/
|
|
2100
|
+
declare class GuardrailBlockedError extends Error {
|
|
2101
|
+
readonly guardrailName: string;
|
|
2102
|
+
readonly hookPoint: 'input' | 'output' | 'tool';
|
|
2103
|
+
constructor(guardrailName: string, hookPoint: 'input' | 'output' | 'tool', reason: string);
|
|
2104
|
+
}
|
|
2105
|
+
/**
|
|
2106
|
+
* Thrown when any guardrail returns `{ action: 'escalate' }`. Callers can
|
|
2107
|
+
* catch and prompt the user or apply a stricter policy before retrying.
|
|
2108
|
+
*/
|
|
2109
|
+
declare class GuardrailEscalateError extends Error {
|
|
2110
|
+
readonly guardrailName: string;
|
|
2111
|
+
readonly hookPoint: 'input' | 'output' | 'tool';
|
|
2112
|
+
constructor(guardrailName: string, hookPoint: 'input' | 'output' | 'tool', reason: string);
|
|
2113
|
+
}
|
|
2114
|
+
/** Filter a guardrail list by hook-point. */
|
|
2115
|
+
declare function collectGuardrails(guardrails: readonly Guardrail[] | undefined): {
|
|
2116
|
+
input: readonly InputGuardrail[];
|
|
2117
|
+
output: readonly OutputGuardrail[];
|
|
2118
|
+
tool: readonly ToolGuardrail[];
|
|
2119
|
+
};
|
|
2120
|
+
/**
|
|
2121
|
+
* Run all input guardrails in declaration order. Returns the (possibly
|
|
2122
|
+
* rewritten) transcript. Throws on block / escalate.
|
|
2123
|
+
*/
|
|
2124
|
+
declare function runInputGuardrails(transcript: readonly AgentMessage[], guardrails: readonly InputGuardrail[], ctx: GuardrailContext, agentSpan: Span | null): Promise<readonly AgentMessage[]>;
|
|
2125
|
+
/**
|
|
2126
|
+
* Run all output guardrails in declaration order. Returns the (possibly
|
|
2127
|
+
* rewritten) final assistant message. Throws on block / escalate.
|
|
2128
|
+
*/
|
|
2129
|
+
declare function runOutputGuardrails(output: AgentMessage, guardrails: readonly OutputGuardrail[], ctx: GuardrailContext, agentSpan: Span | null): Promise<AgentMessage>;
|
|
2130
|
+
/**
|
|
2131
|
+
* Outcome of the before-tool guardrail stage.
|
|
2132
|
+
* - `{ kind: 'allow', call }`: continue to executeRunnerToolCall with `call`
|
|
2133
|
+
* - `{ kind: 'block', result }`: skip execution; return `result` as the
|
|
2134
|
+
* tool_result to the LLM (so it sees the rejection and can adapt)
|
|
2135
|
+
*/
|
|
2136
|
+
type ToolBeforeOutcome = {
|
|
2137
|
+
readonly kind: 'allow';
|
|
2138
|
+
readonly call: RunnerToolCall;
|
|
2139
|
+
} | {
|
|
2140
|
+
readonly kind: 'block';
|
|
2141
|
+
readonly call: RunnerToolCall;
|
|
2142
|
+
readonly result: RunnerToolResult;
|
|
2143
|
+
};
|
|
2144
|
+
/**
|
|
2145
|
+
* Run before-tool guardrails in declaration order. Rewrite replaces the
|
|
2146
|
+
* tool call. Block surfaces an error tool_result to the LLM instead of
|
|
2147
|
+
* throwing — the LLM sees the rejection and adapts. Escalate still throws.
|
|
2148
|
+
*/
|
|
2149
|
+
declare function runToolBeforeGuardrails(call: RunnerToolCall, guardrails: readonly ToolGuardrail[], ctx: GuardrailContext, agentSpan: Span | null): Promise<ToolBeforeOutcome>;
|
|
2150
|
+
/**
|
|
2151
|
+
* Run after-tool guardrails in declaration order. Rewrite replaces the
|
|
2152
|
+
* result content. Block replaces with an error result. Escalate throws.
|
|
2153
|
+
*/
|
|
2154
|
+
declare function runToolAfterGuardrails(call: RunnerToolCall, result: RunnerToolResult, guardrails: readonly ToolGuardrail[], ctx: GuardrailContext, agentSpan: Span | null): Promise<RunnerToolResult>;
|
|
2155
|
+
|
|
1930
2156
|
/**
|
|
1931
2157
|
* Layer A Primitive: Runner
|
|
1932
2158
|
*
|
|
@@ -2003,6 +2229,8 @@ interface RunOptions {
|
|
|
2003
2229
|
* this union. See `@kodax-ai/agent/primitives/guardrail.ts` for shape.
|
|
2004
2230
|
*/
|
|
2005
2231
|
readonly guardrails?: readonly Guardrail[];
|
|
2232
|
+
/** Trusted authority context kept separate from the conversation transcript. */
|
|
2233
|
+
readonly permissionIntent?: GuardrailPermissionIntent;
|
|
2006
2234
|
/**
|
|
2007
2235
|
* Per-run override for the tool-loop iteration cap. When omitted, the
|
|
2008
2236
|
* loop uses `MAX_TOOL_LOOP_ITERATIONS` (20) — a safe ceiling for
|
|
@@ -2794,6 +3022,8 @@ interface DiscoveryOptions {
|
|
|
2794
3022
|
declare function discoverInstances(options?: DiscoveryOptions): DiscoveredInstance[];
|
|
2795
3023
|
|
|
2796
3024
|
interface MemoryContextIdentity {
|
|
3025
|
+
/** Explicit owner home for durable runtime state; never persisted in review envelopes. */
|
|
3026
|
+
readonly configHome?: string;
|
|
2797
3027
|
readonly tenantId: string;
|
|
2798
3028
|
readonly workspaceId?: string;
|
|
2799
3029
|
readonly userId?: string;
|
|
@@ -2892,6 +3122,7 @@ interface MemoryApproval {
|
|
|
2892
3122
|
readonly expectedFingerprints: Readonly<Record<string, string>>;
|
|
2893
3123
|
readonly policyId?: string;
|
|
2894
3124
|
readonly policyReason?: string;
|
|
3125
|
+
readonly revalidateAuthority?: () => Promise<void>;
|
|
2895
3126
|
}
|
|
2896
3127
|
interface MemoryApplyResult {
|
|
2897
3128
|
readonly proposalId: string;
|
|
@@ -3068,7 +3299,15 @@ interface MemoryController {
|
|
|
3068
3299
|
maybeRunAutoCurator(input?: MemoryAutoCuratorInput): Promise<MemoryAutoCuratorResult>;
|
|
3069
3300
|
buildMemoryPack(input: MemoryPackInput): Promise<MemoryPack>;
|
|
3070
3301
|
reviewMemoryFeedback(input: MemoryReviewInput): Promise<MemoryReviewPlan>;
|
|
3302
|
+
prepareEpisodeReview?(digest: KodaXMemoryOutcomeDigest): Promise<MemoryReviewModelInput>;
|
|
3303
|
+
applyReviewedEpisode?(plan: MemoryReviewPlan, digest: KodaXMemoryOutcomeDigest, signal?: AbortSignal, revalidateAuthority?: () => Promise<void>): Promise<MemoryEpisodeReviewResult>;
|
|
3071
3304
|
persistReviewPlan(plan: MemoryReviewPlan): Promise<readonly string[]>;
|
|
3305
|
+
/**
|
|
3306
|
+
* Resolves which episode-review proposals were actually auto-applied by the
|
|
3307
|
+
* governed host policy. Used to keep durable receipts complete while user
|
|
3308
|
+
* notices remain truthful.
|
|
3309
|
+
*/
|
|
3310
|
+
listHostAppliedEpisodeProposalIds?(proposalIds: readonly string[]): Promise<readonly string[]>;
|
|
3072
3311
|
reviewEpisode(digest: KodaXMemoryOutcomeDigest, signal?: AbortSignal): Promise<MemoryEpisodeReviewResult>;
|
|
3073
3312
|
archiveRef(id: string): Promise<MemoryLifecycleOperationResult>;
|
|
3074
3313
|
forgetRef(id: string): Promise<MemoryLifecycleOperationResult>;
|
|
@@ -3095,6 +3334,395 @@ type MemoryEvent = {
|
|
|
3095
3334
|
readonly actionCount: number;
|
|
3096
3335
|
};
|
|
3097
3336
|
|
|
3337
|
+
type LearnedCapabilityCarrier = 'skill' | 'extension' | 'workflow_handoff';
|
|
3338
|
+
type LearnedCapabilityLifecycle = 'opportunity' | 'drafting' | 'ready' | 'testing' | 'active_learned' | 'promoted_user' | 'quarantined' | 'archived' | 'rejected';
|
|
3339
|
+
type LearningEventKind = 'opportunity' | 'drafting' | 'ready' | 'testing' | 'activated' | 'promoted' | 'attention' | 'archived' | 'rejected';
|
|
3340
|
+
type LearningAction = 'review' | 'trust' | 'reject' | 'disable' | 'rollback' | 'archive' | 'restore' | 'promote';
|
|
3341
|
+
interface LearnedCapabilitySource {
|
|
3342
|
+
readonly kind: 'learning_controller' | 'f224_proposal' | 'skill_learning_loop' | 'legacy_manual';
|
|
3343
|
+
readonly proposalId?: string;
|
|
3344
|
+
}
|
|
3345
|
+
interface LearnedCapabilityRecordBase {
|
|
3346
|
+
readonly capabilityId: string;
|
|
3347
|
+
readonly displayName: string;
|
|
3348
|
+
readonly slug: string;
|
|
3349
|
+
readonly carrier: LearnedCapabilityCarrier;
|
|
3350
|
+
readonly lifecycle: LearnedCapabilityLifecycle;
|
|
3351
|
+
readonly revision: number;
|
|
3352
|
+
readonly createdAt: string;
|
|
3353
|
+
readonly updatedAt: string;
|
|
3354
|
+
readonly source: LearnedCapabilitySource;
|
|
3355
|
+
/** The control action that produced this revision, when it is not implied by lifecycle. */
|
|
3356
|
+
readonly lastAction?: LearningAction;
|
|
3357
|
+
readonly artifactPath?: string;
|
|
3358
|
+
readonly previousGoodRevision?: number;
|
|
3359
|
+
readonly previousLifecycle?: LearnedCapabilityLifecycle;
|
|
3360
|
+
readonly diagnostics?: readonly string[];
|
|
3361
|
+
}
|
|
3362
|
+
interface LearnedCapabilityRecordV1 extends LearnedCapabilityRecordBase {
|
|
3363
|
+
readonly schemaVersion: 1;
|
|
3364
|
+
}
|
|
3365
|
+
interface LearnedCapabilityScope {
|
|
3366
|
+
readonly configHomeHash: string;
|
|
3367
|
+
readonly tenantHash: string;
|
|
3368
|
+
readonly projectHash: string;
|
|
3369
|
+
}
|
|
3370
|
+
interface LearnedCapabilityArtifact {
|
|
3371
|
+
readonly kind: 'skill_markdown';
|
|
3372
|
+
readonly relativePath: string;
|
|
3373
|
+
readonly fingerprint: string;
|
|
3374
|
+
readonly contentRevision: number;
|
|
3375
|
+
}
|
|
3376
|
+
interface LearnedCapabilityProvenance {
|
|
3377
|
+
readonly jobId: string;
|
|
3378
|
+
readonly inputHash: string;
|
|
3379
|
+
readonly decisionId: string;
|
|
3380
|
+
readonly actionId: string;
|
|
3381
|
+
}
|
|
3382
|
+
interface LearnedCapabilityCanaryBinding {
|
|
3383
|
+
readonly bindingId: string;
|
|
3384
|
+
readonly ownerSessionRef: string;
|
|
3385
|
+
readonly expiresAt: string;
|
|
3386
|
+
}
|
|
3387
|
+
interface LearnedCapabilityCanaryInvocation {
|
|
3388
|
+
readonly invocationId: string;
|
|
3389
|
+
readonly bindingId: string;
|
|
3390
|
+
/** Durable usage-ledger identity for recovery after the binding expires. */
|
|
3391
|
+
readonly usageSessionHash?: string;
|
|
3392
|
+
readonly artifactRevision?: number;
|
|
3393
|
+
readonly artifactFingerprint?: string;
|
|
3394
|
+
readonly status: 'pending' | 'verified_success' | 'credible_negative' | 'inconclusive';
|
|
3395
|
+
readonly evidenceRefs: readonly string[];
|
|
3396
|
+
readonly invokedAt: string;
|
|
3397
|
+
readonly completedAt?: string;
|
|
3398
|
+
}
|
|
3399
|
+
interface LearnedCapabilityCanary {
|
|
3400
|
+
readonly maxInvocations: 3;
|
|
3401
|
+
readonly invocationCount: number;
|
|
3402
|
+
readonly verifiedSuccesses: number;
|
|
3403
|
+
readonly credibleNegatives: number;
|
|
3404
|
+
readonly binding?: LearnedCapabilityCanaryBinding;
|
|
3405
|
+
readonly invocations: readonly LearnedCapabilityCanaryInvocation[];
|
|
3406
|
+
}
|
|
3407
|
+
interface LearnedCapabilityRecordV2 extends LearnedCapabilityRecordBase {
|
|
3408
|
+
readonly schemaVersion: 2;
|
|
3409
|
+
readonly carrier: 'skill';
|
|
3410
|
+
readonly scope: LearnedCapabilityScope;
|
|
3411
|
+
readonly artifact: LearnedCapabilityArtifact;
|
|
3412
|
+
readonly previousGoodArtifact?: LearnedCapabilityArtifact;
|
|
3413
|
+
readonly provenance: LearnedCapabilityProvenance;
|
|
3414
|
+
readonly canary: LearnedCapabilityCanary;
|
|
3415
|
+
}
|
|
3416
|
+
type LearnedCapabilityRecord = LearnedCapabilityRecordV1 | LearnedCapabilityRecordV2;
|
|
3417
|
+
interface LearningEvent {
|
|
3418
|
+
readonly schemaVersion: 1;
|
|
3419
|
+
readonly sequence: number;
|
|
3420
|
+
readonly eventId: string;
|
|
3421
|
+
readonly capabilityId: string;
|
|
3422
|
+
readonly capabilityRevision: number;
|
|
3423
|
+
readonly kind: LearningEventKind;
|
|
3424
|
+
readonly lifecycle: LearnedCapabilityLifecycle;
|
|
3425
|
+
readonly displayName: string;
|
|
3426
|
+
readonly slug: string;
|
|
3427
|
+
readonly carrier: LearnedCapabilityCarrier;
|
|
3428
|
+
readonly createdAt: string;
|
|
3429
|
+
}
|
|
3430
|
+
type LearningNotificationState = 'unread' | 'seen' | 'acknowledged' | 'snoozed';
|
|
3431
|
+
interface LearningClientEventState {
|
|
3432
|
+
readonly state: LearningNotificationState;
|
|
3433
|
+
readonly capabilityRevision: number;
|
|
3434
|
+
readonly updatedAt: string;
|
|
3435
|
+
readonly snoozedUntil?: string;
|
|
3436
|
+
}
|
|
3437
|
+
interface LearningClientRecord {
|
|
3438
|
+
readonly schemaVersion: 1;
|
|
3439
|
+
readonly clientIdentity: string;
|
|
3440
|
+
readonly events: Readonly<Record<string, LearningClientEventState>>;
|
|
3441
|
+
}
|
|
3442
|
+
interface LearningSurfaceSnapshot {
|
|
3443
|
+
readonly ready: number;
|
|
3444
|
+
readonly newlyActive: number;
|
|
3445
|
+
readonly attention: number;
|
|
3446
|
+
readonly active: number;
|
|
3447
|
+
readonly revision: number;
|
|
3448
|
+
}
|
|
3449
|
+
interface LearningQuery {
|
|
3450
|
+
readonly search?: string;
|
|
3451
|
+
readonly carrier?: LearnedCapabilityCarrier;
|
|
3452
|
+
readonly lifecycle?: LearnedCapabilityLifecycle;
|
|
3453
|
+
readonly limit?: number;
|
|
3454
|
+
readonly cursor?: string;
|
|
3455
|
+
}
|
|
3456
|
+
interface LearningPage {
|
|
3457
|
+
readonly items: readonly LearnedCapabilityRecord[];
|
|
3458
|
+
readonly nextCursor?: string;
|
|
3459
|
+
readonly revision: number;
|
|
3460
|
+
}
|
|
3461
|
+
interface LearningSubscribeOptions {
|
|
3462
|
+
readonly afterRevision?: number;
|
|
3463
|
+
}
|
|
3464
|
+
interface LearningExplicitUserAuthority {
|
|
3465
|
+
readonly authority: 'explicit_user';
|
|
3466
|
+
readonly expectedRevision: number;
|
|
3467
|
+
readonly expectedFingerprint?: string;
|
|
3468
|
+
}
|
|
3469
|
+
interface LearningActionDriver {
|
|
3470
|
+
readonly carrier: LearnedCapabilityCarrier;
|
|
3471
|
+
readonly actions: readonly LearningAction[];
|
|
3472
|
+
execute(action: LearningAction, capability: LearnedCapabilityRecord): Promise<LearnedCapabilityRecord>;
|
|
3473
|
+
}
|
|
3474
|
+
type LearningCapabilityErrorCode = 'ambiguous_name' | 'action_failed' | 'capability_not_found' | 'invalid_record' | 'invalid_transition' | 'store_integrity_error' | 'unsupported_action';
|
|
3475
|
+
declare class LearningCapabilityError extends Error {
|
|
3476
|
+
readonly code: LearningCapabilityErrorCode;
|
|
3477
|
+
constructor(code: LearningCapabilityErrorCode, message: string);
|
|
3478
|
+
}
|
|
3479
|
+
declare function canTransitionLearnedCapability(from: LearnedCapabilityLifecycle, to: LearnedCapabilityLifecycle): boolean;
|
|
3480
|
+
declare function assertLearnedCapabilityTransition(from: LearnedCapabilityLifecycle, to: LearnedCapabilityLifecycle): void;
|
|
3481
|
+
declare function slugifyLearnedCapabilityName(displayName: string): string;
|
|
3482
|
+
declare function learningEventKindForLifecycle(lifecycle: LearnedCapabilityLifecycle): LearningEventKind;
|
|
3483
|
+
declare function learningEventIdFor(record: LearnedCapabilityRecord): string;
|
|
3484
|
+
|
|
3485
|
+
interface LearnedAreaPaths {
|
|
3486
|
+
readonly root: string;
|
|
3487
|
+
readonly skills: string;
|
|
3488
|
+
readonly extensions: string;
|
|
3489
|
+
readonly capabilities: string;
|
|
3490
|
+
readonly events: string;
|
|
3491
|
+
readonly clients: string;
|
|
3492
|
+
}
|
|
3493
|
+
declare function resolveLearnedAreaPaths(rootDir: string): LearnedAreaPaths;
|
|
3494
|
+
declare class LearnedAreaStore {
|
|
3495
|
+
#private;
|
|
3496
|
+
readonly paths: LearnedAreaPaths;
|
|
3497
|
+
constructor(rootDir: string);
|
|
3498
|
+
initialize(): Promise<void>;
|
|
3499
|
+
readCapability(capabilityId: string): Promise<LearnedCapabilityRecord | undefined>;
|
|
3500
|
+
listCapabilities(): Promise<readonly LearnedCapabilityRecord[]>;
|
|
3501
|
+
writeCapability(record: LearnedCapabilityRecord): Promise<void>;
|
|
3502
|
+
writeEvent(event: LearningEvent): Promise<void>;
|
|
3503
|
+
listEvents(): Promise<readonly LearningEvent[]>;
|
|
3504
|
+
readClient(identity: string): Promise<LearningClientRecord>;
|
|
3505
|
+
writeClient(record: LearningClientRecord): Promise<void>;
|
|
3506
|
+
withOwnerMutation<T>(operation: () => Promise<T>): Promise<T>;
|
|
3507
|
+
withClientMutation<T>(identity: string, operation: () => Promise<T>): Promise<T>;
|
|
3508
|
+
ensureCurrentEvent(record: LearnedCapabilityRecord): Promise<LearningEvent>;
|
|
3509
|
+
}
|
|
3510
|
+
declare function eventFromCapability(record: LearnedCapabilityRecord, sequence: number): LearningEvent;
|
|
3511
|
+
|
|
3512
|
+
interface DeclarativeSkillSpec {
|
|
3513
|
+
readonly name: string;
|
|
3514
|
+
readonly description: string;
|
|
3515
|
+
readonly purpose: string;
|
|
3516
|
+
readonly triggers: readonly string[];
|
|
3517
|
+
readonly steps: readonly string[];
|
|
3518
|
+
readonly verification: readonly string[];
|
|
3519
|
+
readonly pitfalls: readonly string[];
|
|
3520
|
+
}
|
|
3521
|
+
interface StagedLearnedSkillArtifact extends LearnedCapabilityArtifact {
|
|
3522
|
+
readonly absolutePath: string;
|
|
3523
|
+
}
|
|
3524
|
+
interface CreateLearnedSkillRecordInput {
|
|
3525
|
+
readonly capabilityId: string;
|
|
3526
|
+
readonly displayName: string;
|
|
3527
|
+
readonly scope: LearnedCapabilityScope;
|
|
3528
|
+
readonly artifact: LearnedCapabilityArtifact;
|
|
3529
|
+
readonly provenance: LearnedCapabilityProvenance;
|
|
3530
|
+
readonly now?: string;
|
|
3531
|
+
readonly previous?: LearnedCapabilityRecordV2;
|
|
3532
|
+
}
|
|
3533
|
+
interface LearnedSkillBindingAdmission {
|
|
3534
|
+
readonly bindingId: string;
|
|
3535
|
+
readonly ownerSessionRef: string;
|
|
3536
|
+
readonly expiresAt: string;
|
|
3537
|
+
}
|
|
3538
|
+
interface LearnedSkillInvocationAdmission {
|
|
3539
|
+
readonly invocationId: string;
|
|
3540
|
+
readonly invocationCount: number;
|
|
3541
|
+
readonly maxInvocations: 3;
|
|
3542
|
+
}
|
|
3543
|
+
interface CommitLearnedSkillRevisionInput {
|
|
3544
|
+
readonly scope: LearnedCapabilityScope;
|
|
3545
|
+
readonly spec: DeclarativeSkillSpec;
|
|
3546
|
+
readonly disposition: 'ready' | 'project_canary';
|
|
3547
|
+
readonly operation: 'create' | 'patch';
|
|
3548
|
+
readonly provenance: LearnedCapabilityProvenance;
|
|
3549
|
+
readonly targetCapabilityId?: string;
|
|
3550
|
+
readonly expectedRevision?: number;
|
|
3551
|
+
readonly expectedFingerprint?: string;
|
|
3552
|
+
readonly protectedSkillNames?: readonly string[];
|
|
3553
|
+
readonly now?: string;
|
|
3554
|
+
readonly authority?: {
|
|
3555
|
+
readonly commit: (operation: (revalidateAuthority: () => Promise<void>) => Promise<LearnedCapabilityRecordV2>) => Promise<LearnedCapabilityRecordV2>;
|
|
3556
|
+
};
|
|
3557
|
+
}
|
|
3558
|
+
type LearnedSkillCanaryOutcome = 'verified_success' | 'credible_negative' | 'inconclusive';
|
|
3559
|
+
declare function resolveProjectLearnedAreaRoot(configHome: string, scope: {
|
|
3560
|
+
readonly tenantId: string;
|
|
3561
|
+
readonly projectId: string;
|
|
3562
|
+
}): string;
|
|
3563
|
+
declare function createLearnedCapabilityScope(configHome: string, scope: {
|
|
3564
|
+
readonly tenantId: string;
|
|
3565
|
+
readonly projectId: string;
|
|
3566
|
+
}): LearnedCapabilityScope;
|
|
3567
|
+
declare function validateDeclarativeSkillSpec(spec: DeclarativeSkillSpec): void;
|
|
3568
|
+
declare function renderDeclarativeSkill(spec: DeclarativeSkillSpec): string;
|
|
3569
|
+
declare function stageLearnedSkillRevision(rootDir: string, capabilityId: string, spec: DeclarativeSkillSpec): Promise<StagedLearnedSkillArtifact>;
|
|
3570
|
+
declare function createLearnedSkillRecord(input: CreateLearnedSkillRecordInput): LearnedCapabilityRecordV2;
|
|
3571
|
+
declare function commitLearnedSkillRevision(store: LearnedAreaStore, input: CommitLearnedSkillRevisionInput): Promise<LearnedCapabilityRecordV2>;
|
|
3572
|
+
declare function admitLearnedSkillBinding(store: LearnedAreaStore, capabilityId: string, input: {
|
|
3573
|
+
readonly bindingId: string;
|
|
3574
|
+
readonly ownerSessionRef: string;
|
|
3575
|
+
readonly now?: Date;
|
|
3576
|
+
readonly ttlMs?: number;
|
|
3577
|
+
}): Promise<LearnedSkillBindingAdmission | undefined>;
|
|
3578
|
+
declare function releaseLearnedSkillBinding(store: LearnedAreaStore, capabilityId: string, bindingId: string, now?: string): Promise<boolean>;
|
|
3579
|
+
declare function invokeLearnedSkillCanary(store: LearnedAreaStore, capabilityId: string, input: {
|
|
3580
|
+
readonly bindingId: string;
|
|
3581
|
+
readonly invocationId?: string;
|
|
3582
|
+
readonly usageSessionHash?: string;
|
|
3583
|
+
readonly artifactRevision?: number;
|
|
3584
|
+
readonly artifactFingerprint?: string;
|
|
3585
|
+
readonly now?: Date;
|
|
3586
|
+
}): Promise<LearnedSkillInvocationAdmission>;
|
|
3587
|
+
declare function completeLearnedSkillOutcome(store: LearnedAreaStore, capabilityId: string, input: {
|
|
3588
|
+
readonly invocationId: string;
|
|
3589
|
+
readonly outcome: LearnedSkillCanaryOutcome;
|
|
3590
|
+
readonly evidenceRefs: readonly string[];
|
|
3591
|
+
readonly now?: string;
|
|
3592
|
+
}): Promise<LearnedCapabilityRecordV2>;
|
|
3593
|
+
declare function quarantineLearnedSkillRevision(store: LearnedAreaStore, capabilityId: string, input: {
|
|
3594
|
+
readonly expectedRevision: number;
|
|
3595
|
+
readonly expectedFingerprint: string;
|
|
3596
|
+
readonly reason: string;
|
|
3597
|
+
readonly now?: string;
|
|
3598
|
+
readonly revalidateAuthority?: () => Promise<void>;
|
|
3599
|
+
}): Promise<LearnedCapabilityRecordV2>;
|
|
3600
|
+
declare function isLearnedCapabilityRecordV2(record: LearnedCapabilityRecord): record is LearnedCapabilityRecordV2;
|
|
3601
|
+
|
|
3602
|
+
interface LearnedSkillOfferedReceipt {
|
|
3603
|
+
readonly version: 1;
|
|
3604
|
+
readonly kind: 'offered';
|
|
3605
|
+
readonly receiptId: string;
|
|
3606
|
+
readonly sessionHash: string;
|
|
3607
|
+
readonly bindingId: string;
|
|
3608
|
+
readonly capabilityId: string;
|
|
3609
|
+
readonly revision: number;
|
|
3610
|
+
readonly fingerprint: string;
|
|
3611
|
+
readonly createdAt: string;
|
|
3612
|
+
}
|
|
3613
|
+
interface LearnedSkillInvokedReceipt {
|
|
3614
|
+
readonly version: 1;
|
|
3615
|
+
readonly kind: 'invoked';
|
|
3616
|
+
readonly receiptId: string;
|
|
3617
|
+
readonly sessionHash: string;
|
|
3618
|
+
readonly bindingId: string;
|
|
3619
|
+
readonly invocationId: string;
|
|
3620
|
+
readonly capabilityId: string;
|
|
3621
|
+
readonly revision: number;
|
|
3622
|
+
readonly fingerprint: string;
|
|
3623
|
+
readonly createdAt: string;
|
|
3624
|
+
}
|
|
3625
|
+
interface LearnedSkillOutcomeReceipt {
|
|
3626
|
+
readonly version: 1;
|
|
3627
|
+
readonly kind: 'outcome';
|
|
3628
|
+
readonly receiptId: string;
|
|
3629
|
+
readonly sessionHash: string;
|
|
3630
|
+
readonly invocationId: string;
|
|
3631
|
+
readonly capabilityId: string;
|
|
3632
|
+
readonly outcome: LearnedSkillCanaryOutcome;
|
|
3633
|
+
readonly evidenceRefs: readonly string[];
|
|
3634
|
+
readonly createdAt: string;
|
|
3635
|
+
}
|
|
3636
|
+
type LearnedSkillUsageReceipt = LearnedSkillOfferedReceipt | LearnedSkillInvokedReceipt | LearnedSkillOutcomeReceipt;
|
|
3637
|
+
interface ExactInvokedSkillSnapshot {
|
|
3638
|
+
readonly capabilityId: string;
|
|
3639
|
+
readonly name: string;
|
|
3640
|
+
readonly fingerprint: string;
|
|
3641
|
+
readonly revision: number;
|
|
3642
|
+
readonly invocationId: string;
|
|
3643
|
+
readonly content: string;
|
|
3644
|
+
}
|
|
3645
|
+
declare function recordLearnedSkillOffered(store: LearnedAreaStore, input: {
|
|
3646
|
+
readonly sessionId: string;
|
|
3647
|
+
readonly bindingId: string;
|
|
3648
|
+
readonly capabilityId: string;
|
|
3649
|
+
readonly revision: number;
|
|
3650
|
+
readonly fingerprint: string;
|
|
3651
|
+
readonly now?: string;
|
|
3652
|
+
}): Promise<LearnedSkillOfferedReceipt>;
|
|
3653
|
+
declare function admitAndRecordLearnedSkillInvocation(store: LearnedAreaStore, input: {
|
|
3654
|
+
readonly sessionId: string;
|
|
3655
|
+
readonly bindingId: string;
|
|
3656
|
+
readonly ownerSessionRef: string;
|
|
3657
|
+
readonly capabilityId: string;
|
|
3658
|
+
readonly expectedRevision: number;
|
|
3659
|
+
readonly expectedFingerprint: string;
|
|
3660
|
+
readonly invocationId?: string;
|
|
3661
|
+
readonly now?: Date;
|
|
3662
|
+
}): Promise<LearnedSkillInvokedReceipt>;
|
|
3663
|
+
declare function completeLearnedSkillSessionOutcomes(store: LearnedAreaStore, input: {
|
|
3664
|
+
readonly sessionId: string;
|
|
3665
|
+
/** Restricts completion to invocations from one root-run binding. */
|
|
3666
|
+
readonly bindingId?: string;
|
|
3667
|
+
readonly outcome: LearnedSkillCanaryOutcome;
|
|
3668
|
+
readonly evidenceRefs: readonly string[];
|
|
3669
|
+
readonly now?: string;
|
|
3670
|
+
}): Promise<readonly LearnedSkillOutcomeReceipt[]>;
|
|
3671
|
+
/** Repairs current-binding and stale-canary outcome delivery fail closed. */
|
|
3672
|
+
declare function reconcileLearnedSkillBindingOutcomes(store: LearnedAreaStore, input: {
|
|
3673
|
+
readonly sessionId: string;
|
|
3674
|
+
readonly bindingId: string;
|
|
3675
|
+
readonly now?: string;
|
|
3676
|
+
}): Promise<readonly LearnedSkillOutcomeReceipt[]>;
|
|
3677
|
+
declare function listLearnedSkillUsageReceipts(store: LearnedAreaStore, sessionId: string): Promise<readonly LearnedSkillUsageReceipt[]>;
|
|
3678
|
+
declare function exactInvokedSkillSnapshotForSession(store: LearnedAreaStore, sessionId: string, options?: {
|
|
3679
|
+
readonly bindingId?: string;
|
|
3680
|
+
}): Promise<ExactInvokedSkillSnapshot | null>;
|
|
3681
|
+
|
|
3682
|
+
interface LearningReviewVerifierFact {
|
|
3683
|
+
readonly ref: string;
|
|
3684
|
+
readonly verdict: 'passed' | 'failed' | 'inconclusive';
|
|
3685
|
+
}
|
|
3686
|
+
|
|
3687
|
+
interface LearningReviewQualification {
|
|
3688
|
+
readonly reusableMethodEvidence: boolean;
|
|
3689
|
+
readonly explicitSkillPreservation: boolean;
|
|
3690
|
+
readonly independentEpisodeCount: number;
|
|
3691
|
+
readonly verifiedOutcome: boolean;
|
|
3692
|
+
readonly exactSkillInvoked: boolean;
|
|
3693
|
+
}
|
|
3694
|
+
interface LearningReviewEvidencePacket {
|
|
3695
|
+
readonly outcomeDigest: KodaXMemoryOutcomeDigest;
|
|
3696
|
+
readonly exactInvokedSkill: ExactInvokedSkillSnapshot | null;
|
|
3697
|
+
readonly verifierFacts: readonly LearningReviewVerifierFact[];
|
|
3698
|
+
readonly priorDigests: readonly KodaXMemoryOutcomeDigest[];
|
|
3699
|
+
readonly qualification: LearningReviewQualification;
|
|
3700
|
+
}
|
|
3701
|
+
interface UnifiedLearningReviewModelInput {
|
|
3702
|
+
readonly cacheDomain: 'learning-review';
|
|
3703
|
+
readonly memory: MemoryReviewModelInput;
|
|
3704
|
+
readonly evidence: LearningReviewEvidencePacket;
|
|
3705
|
+
}
|
|
3706
|
+
type LearnedSkillDecisionDisposition = 'discard' | 'ready' | 'project_canary';
|
|
3707
|
+
interface NormalizedLearnedSkillDecision {
|
|
3708
|
+
readonly disposition: LearnedSkillDecisionDisposition;
|
|
3709
|
+
readonly reasonCodes: readonly string[];
|
|
3710
|
+
readonly operation?: 'create' | 'patch';
|
|
3711
|
+
readonly spec?: DeclarativeSkillSpec;
|
|
3712
|
+
readonly targetCapabilityId?: string;
|
|
3713
|
+
readonly expectedFingerprint?: string;
|
|
3714
|
+
readonly expectedRevision?: number;
|
|
3715
|
+
readonly quarantineExactInvokedRevision?: true;
|
|
3716
|
+
}
|
|
3717
|
+
interface UnifiedLearningReviewResult {
|
|
3718
|
+
readonly memoryPlan: MemoryReviewPlan;
|
|
3719
|
+
readonly capabilityDecision?: NormalizedLearnedSkillDecision;
|
|
3720
|
+
}
|
|
3721
|
+
type UnifiedLearningReviewRunner = (input: UnifiedLearningReviewModelInput, signal?: AbortSignal) => Promise<unknown>;
|
|
3722
|
+
declare function sanitizeUnifiedLearningReviewInput(input: UnifiedLearningReviewModelInput): UnifiedLearningReviewModelInput;
|
|
3723
|
+
declare function isUnifiedLearningReviewModelInput(value: unknown): value is UnifiedLearningReviewModelInput;
|
|
3724
|
+
declare function normalizeUnifiedLearningReview(input: UnifiedLearningReviewModelInput, raw: unknown): UnifiedLearningReviewResult;
|
|
3725
|
+
|
|
3098
3726
|
/**
|
|
3099
3727
|
* ../../index.js Compaction Types
|
|
3100
3728
|
*/
|
|
@@ -4007,7 +4635,7 @@ interface AgentExecutorPreflightResult {
|
|
|
4007
4635
|
}
|
|
4008
4636
|
interface AgentExecutor {
|
|
4009
4637
|
preflight?(input: AgentTaskStartInput): Promise<AgentExecutorPreflightResult>;
|
|
4010
|
-
start(input: AgentTaskStartInput): Promise<AgentExecutorTaskReference>;
|
|
4638
|
+
start(input: AgentTaskStartInput, signal?: AbortSignal): Promise<AgentExecutorTaskReference>;
|
|
4011
4639
|
events(reference: AgentExecutorTaskReference): AsyncIterable<AgentExecutorEvent>;
|
|
4012
4640
|
get(reference: AgentExecutorTaskReference): Promise<AgentExecutorTaskSnapshot>;
|
|
4013
4641
|
sendInput(reference: AgentExecutorTaskReference, input: AgentContinuationInput): Promise<void>;
|
|
@@ -4095,7 +4723,7 @@ interface AgentRegistrationService {
|
|
|
4095
4723
|
remove(agentId: string, options?: AgentRegistrationMutationOptions): Promise<boolean>;
|
|
4096
4724
|
}
|
|
4097
4725
|
interface AgentTaskService {
|
|
4098
|
-
start(input: AgentTaskStartInput): Promise<AgentTaskSnapshot>;
|
|
4726
|
+
start(input: AgentTaskStartInput, signal?: AbortSignal): Promise<AgentTaskSnapshot>;
|
|
4099
4727
|
list(filter?: AgentTaskFilter): Promise<readonly AgentTaskSnapshot[]>;
|
|
4100
4728
|
get(taskId: string): Promise<AgentTaskSnapshot>;
|
|
4101
4729
|
events(taskId: string, cursor?: number): Promise<readonly AgentTaskEvent[]>;
|
|
@@ -4140,5 +4768,154 @@ interface CreateAgentExecutorPlaneOptions {
|
|
|
4140
4768
|
readonly closeTimeoutMs?: number;
|
|
4141
4769
|
}
|
|
4142
4770
|
|
|
4143
|
-
|
|
4144
|
-
|
|
4771
|
+
interface AgentControllerOptions {
|
|
4772
|
+
readonly maxConcurrentThreadsPerSession?: number;
|
|
4773
|
+
readonly rootCapabilities?: AgentCapabilities;
|
|
4774
|
+
readonly executor?: AgentTurnExecutor;
|
|
4775
|
+
readonly executorFor?: (kind: AgentExecutionKind) => AgentTurnExecutor;
|
|
4776
|
+
readonly budget?: AgentBudgetPort;
|
|
4777
|
+
readonly store?: AgentActorStore;
|
|
4778
|
+
/** Unique Runtime/controller claim for one durable Session Actor tree. */
|
|
4779
|
+
readonly owner?: AgentActorOwner;
|
|
4780
|
+
/** Conservative liveness probe for a persisted foreign owner. Omitted means alive. */
|
|
4781
|
+
readonly isOwnerAlive?: (owner: AgentActorOwner) => boolean | Promise<boolean>;
|
|
4782
|
+
readonly now?: () => string;
|
|
4783
|
+
readonly warn?: (message: string) => void;
|
|
4784
|
+
readonly onBackgroundError?: (error: unknown) => void;
|
|
4785
|
+
readonly onHealthChanged?: (health: AgentControllerHealth) => void;
|
|
4786
|
+
/** Post-durability event sink. Callback failures never roll back committed actor state. */
|
|
4787
|
+
readonly onEventCommitted?: (event: AgentEvent) => void | Promise<void>;
|
|
4788
|
+
/** Post-durability mailbox sink. Callback failures never roll back committed actor state. */
|
|
4789
|
+
readonly onMessageCommitted?: (message: AgentMailboxMessage) => void | Promise<void>;
|
|
4790
|
+
}
|
|
4791
|
+
interface AgentControllerHealth {
|
|
4792
|
+
readonly state: 'healthy' | 'recovering' | 'unknown';
|
|
4793
|
+
readonly code?: 'actor_settlement_not_persisted';
|
|
4794
|
+
readonly turnId?: string;
|
|
4795
|
+
readonly message?: string;
|
|
4796
|
+
}
|
|
4797
|
+
declare class AgentActorController {
|
|
4798
|
+
private readonly options;
|
|
4799
|
+
private readonly actors;
|
|
4800
|
+
private readonly turns;
|
|
4801
|
+
private readonly mailboxes;
|
|
4802
|
+
private readonly acknowledgedCompletionTurnIds;
|
|
4803
|
+
private readonly pendingRootCompletionTurnIds;
|
|
4804
|
+
private readonly eventsLog;
|
|
4805
|
+
private readonly abortControllers;
|
|
4806
|
+
private readonly waiters;
|
|
4807
|
+
private readonly pendingSettlements;
|
|
4808
|
+
private readonly settlementRecoveryMessages;
|
|
4809
|
+
private readonly scheduler;
|
|
4810
|
+
private readonly budget;
|
|
4811
|
+
private readonly now;
|
|
4812
|
+
private readonly admissionScope;
|
|
4813
|
+
private mutationTail;
|
|
4814
|
+
private revision;
|
|
4815
|
+
private admissionRevision;
|
|
4816
|
+
private snapshotSchemaVersion;
|
|
4817
|
+
private durableOwner?;
|
|
4818
|
+
private initialized;
|
|
4819
|
+
private ownershipLost;
|
|
4820
|
+
private ownershipReleased;
|
|
4821
|
+
private closing;
|
|
4822
|
+
private settlementGeneration;
|
|
4823
|
+
private settlementValidityGeneration;
|
|
4824
|
+
private shutdownFailure?;
|
|
4825
|
+
private indeterminateFailure?;
|
|
4826
|
+
private shutdownPromise?;
|
|
4827
|
+
private committedSnapshot;
|
|
4828
|
+
private health;
|
|
4829
|
+
constructor(options?: AgentControllerOptions);
|
|
4830
|
+
healthSnapshot(): AgentControllerHealth;
|
|
4831
|
+
initialize(): Promise<void>;
|
|
4832
|
+
ownsDurableFence(): boolean;
|
|
4833
|
+
bind(callerPath: string): AgentActorClient;
|
|
4834
|
+
/** Trusted host API: register a zero-slot Workflow protocol owner in this tree. */
|
|
4835
|
+
createProtocolOwner(callerPath: string, ownerId: string): Promise<AgentActorClient>;
|
|
4836
|
+
/** Trusted host API: settle a zero-slot Workflow protocol owner. */
|
|
4837
|
+
settleProtocolOwner(ownerPath: string, state: 'completed' | 'failed' | 'interrupted', result: AgentExecutionResult & {
|
|
4838
|
+
readonly error?: string;
|
|
4839
|
+
}): Promise<void>;
|
|
4840
|
+
/** Trusted host API: cancellation signal for a zero-slot Workflow protocol owner. */
|
|
4841
|
+
protocolOwnerSignal(ownerPath: string): AbortSignal;
|
|
4842
|
+
spawn(callerPath: string, input: AgentSpawnInput, options?: AgentMutationOptions): Promise<AgentTurnRef>;
|
|
4843
|
+
send(callerPath: string, targetPath: string, content: string, classification?: AgentDataClassification, forwardedMessageId?: string): Promise<AgentMailboxMessage>;
|
|
4844
|
+
acknowledgeCompletions(callerPath: string, turnIds: readonly string[]): Promise<number>;
|
|
4845
|
+
followup(callerPath: string, targetPath: string, objective: string, metadata?: Readonly<Record<string, AgentMetadataValue>>, options?: AgentMutationOptions): Promise<AgentFollowupResult>;
|
|
4846
|
+
interrupt(callerPath: string, targetPath: string, reason?: string, scope?: AgentInterruptScope): Promise<void>;
|
|
4847
|
+
close(callerPath: string, targetPath: string, reason?: string): Promise<void>;
|
|
4848
|
+
/**
|
|
4849
|
+
* Final local teardown after the host has durably removed the backing store.
|
|
4850
|
+
* No mutation is allowed here because there is no longer a snapshot to save.
|
|
4851
|
+
*/
|
|
4852
|
+
disposeAfterStoreRemoval(reason?: string): void;
|
|
4853
|
+
/** Interrupts every local execution while retaining the durable owner fence. */
|
|
4854
|
+
quiesce(reason?: string): Promise<void>;
|
|
4855
|
+
/** Stops in-flight work for process shutdown while preserving reusable Actor identities. */
|
|
4856
|
+
shutdown(reason?: string): Promise<void>;
|
|
4857
|
+
private performShutdown;
|
|
4858
|
+
list(callerPath: string): AgentTreeSnapshot;
|
|
4859
|
+
get(callerPath: string, targetPath: string): AgentDetail;
|
|
4860
|
+
output(callerPath: string, targetPath: string, turnId?: string): AgentOutput;
|
|
4861
|
+
eventSnapshot(callerPath: string, afterSequence?: number): readonly AgentEvent[];
|
|
4862
|
+
private isAcknowledgedDirectChildTerminal;
|
|
4863
|
+
wait(callerPath: string, afterSequence?: number, timeoutMs?: number, signal?: AbortSignal): Promise<AgentEvent | undefined>;
|
|
4864
|
+
private prepareSpawn;
|
|
4865
|
+
private prepareExistingTurn;
|
|
4866
|
+
private admitTurn;
|
|
4867
|
+
private commitStart;
|
|
4868
|
+
private launch;
|
|
4869
|
+
private trackSettlement;
|
|
4870
|
+
private flushPendingSettlements;
|
|
4871
|
+
private completeExecution;
|
|
4872
|
+
private failExecution;
|
|
4873
|
+
private commitExecutionSettlement;
|
|
4874
|
+
private setHealth;
|
|
4875
|
+
private publishSettlementHealth;
|
|
4876
|
+
private finishTurn;
|
|
4877
|
+
private appendCompletion;
|
|
4878
|
+
private drainMailbox;
|
|
4879
|
+
private unreadMailbox;
|
|
4880
|
+
private recordProgress;
|
|
4881
|
+
private resolveForwarding;
|
|
4882
|
+
private appendMessage;
|
|
4883
|
+
private appendEvent;
|
|
4884
|
+
private requireControl;
|
|
4885
|
+
private assertMessagePermission;
|
|
4886
|
+
private isVisible;
|
|
4887
|
+
private visibleActors;
|
|
4888
|
+
private latestTurnSummary;
|
|
4889
|
+
private descendantsInclusive;
|
|
4890
|
+
private createActor;
|
|
4891
|
+
private createTurn;
|
|
4892
|
+
private requireActor;
|
|
4893
|
+
private requireTurn;
|
|
4894
|
+
private requireCommittedActor;
|
|
4895
|
+
private requireCommittedTurn;
|
|
4896
|
+
private requireCommittedControl;
|
|
4897
|
+
private installRoot;
|
|
4898
|
+
private mutate;
|
|
4899
|
+
private snapshot;
|
|
4900
|
+
private restore;
|
|
4901
|
+
private republishUnacknowledgedRootCompletions;
|
|
4902
|
+
private recoverUnmatchedTurns;
|
|
4903
|
+
private claimOwnership;
|
|
4904
|
+
private releaseOwnershipAfterInitializationFailure;
|
|
4905
|
+
private assertWritableOwner;
|
|
4906
|
+
private fenceUnknownSettlement;
|
|
4907
|
+
private stopLocalWork;
|
|
4908
|
+
private fenceAfterSnapshotConflict;
|
|
4909
|
+
private isInterruptionDurable;
|
|
4910
|
+
private notify;
|
|
4911
|
+
private publishCommittedEvent;
|
|
4912
|
+
private publishCommittedMessage;
|
|
4913
|
+
private reportBackgroundError;
|
|
4914
|
+
private reportBackgroundCallbackFailure;
|
|
4915
|
+
private assertExpectedTreeRevision;
|
|
4916
|
+
private assertExpectedAdmissionRevision;
|
|
4917
|
+
}
|
|
4918
|
+
declare function createAgentActorController(options?: AgentControllerOptions): Promise<AgentActorController>;
|
|
4919
|
+
|
|
4920
|
+
export { ASK_USER_BACK_SIGNAL as A, ASK_USER_CUSTOM_INPUT_SIGNAL as a, DEFAULT_SYSTEM_CAP as b2, GuardrailBlockedError as bm, GuardrailEscalateError as bo, InvariantSession as bz, MAX_TOOL_LOOP_ITERATIONS as c$, LearningCapabilityError as cK, LearnedAreaStore as cn, Runner as dY, Tracer as eC, WorkflowEventRecorder as eQ, SpanImpl as ei, exactInvokedSkillSnapshotForSession as f$, admitAndRecordLearnedSkillInvocation as fA, admitLearnedSkillBinding as fB, asSingleSelection as fC, assertLearnedCapabilityTransition as fD, attachRunnerRecoveryTranscript as fE, buildAssistantMessageFromLlmResult as fF, buildSystemPrompt as fG, buildToolResultMessage as fH, canTransitionLearnedCapability as fI, collectGuardrails as fJ, commitLearnedSkillRevision as fK, completeLearnedSkillOutcome as fL, completeLearnedSkillSessionOutcomes as fM, createAgent as fN, createAgentActorController as fO, createHandoff as fP, createInMemorySession as fQ, createInvariantSessionForAgent as fR, createLearnedCapabilityScope as fS, createLearnedSkillRecord as fT, createStateWriter as fU, createTrace as fV, createWorkflowProcessTracker as fW, defaultTracer as fX, detectInstructionsInjection as fY, discoverInstances as fZ, eventFromCapability as f_, _resetAdmittedAgentBindings as fy, _resetPresetDispatchers as fz, executeRunnerToolCall as g0, extractAssistantTextFromMessage as g1, getActiveUserInteraction as g2, getAdmittedAgentBindings as g3, hashMemoryIdentityComponent as g4, invokeLearnedSkillCanary as g5, isAskUserCustomInputAnswer as g6, isFinalWorkflowProcessStatus as g7, isLearnedCapabilityRecordV2 as g8, isRunnableTool as g9, slugifyLearnedCapabilityName as gA, stageLearnedSkillRevision as gB, validateDeclarativeSkillSpec as gC, isRunnerLlmResult as ga, isUnifiedLearningReviewModelInput as gb, learningEventIdFor as gc, learningEventKindForLifecycle as gd, listLearnedSkillUsageReceipts as ge, matchesMemoryApplicability as gf, memoryApplicabilityFingerprint as gg, normalizeHostMetadata as gh, normalizeUnifiedLearningReview as gi, quarantineLearnedSkillRevision as gj, readRunnerRecoveryTranscript as gk, reconcileLearnedSkillBindingOutcomes as gl, recordLearnedSkillOffered as gm, registerPresetDispatcher as gn, releaseLearnedSkillBinding as go, renderDeclarativeSkill as gp, resolveLearnedAreaPaths as gq, resolveProjectLearnedAreaRoot as gr, runAdmissionAudit as gs, runInputGuardrails as gt, runOutputGuardrails as gu, runToolAfterGuardrails as gv, runToolBeforeGuardrails as gw, sanitizeUnifiedLearningReviewInput as gx, setActiveUserInteraction as gy, setAdmittedAgentBindings as gz, AgentActorController as i };
|
|
4921
|
+
export type { AgentExecutorPlaneBinding as $, AgentCapabilityRequirements as B, AgentContinuationInput as C, AgentControllerHealth as D, AgentControllerOptions as E, AgentCredentialBroker as F, AgentDataClassification as G, AgentDetail as H, AgentDispatchContext as I, AgentDispatchPolicy as J, AgentDispatchPolicyDecision as K, AgentDispatchPolicyInput as L, AgentDispatchabilitySnapshot as M, AgentDispatchabilityStatus as N, AgentEffectDeclaration as O, AgentEvent as P, AgentEventKind as Q, AgentExecutionInput as R, AgentExecutionKind as S, AgentExecutionResult as T, AgentExecutor as U, AgentExecutorEvent as V, AgentExecutorFactory as W, AgentExecutorFactoryContext as X, AgentExecutorPlane as Y, AgentExecutorPlaneBackgroundErrorContext as Z, AgentExecutorPlaneBackgroundErrorHandler as _, CreateAgentExecutorPlaneOptions as a$, AgentExecutorPlaneStore as a0, AgentExecutorPreflightResult as a1, AgentExecutorProtocol as a2, AgentExecutorTaskReference as a3, AgentExecutorTaskSnapshot as a4, AgentFollowupResult as a5, AgentForkTurns as a6, AgentInterruptScope as a7, AgentJsonObject as a8, AgentJsonValue as a9, AgentTaskService as aA, AgentTaskSnapshot as aB, AgentTaskStartInput as aC, AgentTaskState as aD, AgentTaskUsage as aE, AgentTool as aF, AgentTreeSnapshot as aG, AgentTurn as aH, AgentTurnExecutor as aI, AgentTurnRef as aJ, AgentTurnState as aK, AgentTurnSummary as aL, AskUserAnswer as aM, AskUserCustomInputAnswer as aN, AskUserMultiOptions as aO, AskUserQuestionItem as aP, AskUserQuestionOptions as aQ, AskUserSelectionAnswer as aR, CapabilitySupport as aS, CommitLearnedSkillRevisionInput as aT, CompactionAnchor as aU, CompactionConfig as aV, CompactionDetails as aW, CompactionReport as aX, CompactionResult as aY, CompactionSpanData as aZ, CompactionUpdate as a_, AgentLimitReached as aa, AgentListEntry as ab, AgentMailboxMessage as ac, AgentManifest as ad, AgentMessage as ae, AgentMetadataValue as af, AgentMiddlewareDeclaration as ag, AgentMutationOptions as ah, AgentOutput as ai, AgentPreflightInput as aj, AgentPreflightResult as ak, AgentProgressItem as al, AgentProgressKind as am, AgentProgressUpdate as an, AgentReasoningProfile as ao, AgentRegistrationEnabledMutationOptions as ap, AgentRegistrationMutationOptions as aq, AgentRegistrationService as ar, AgentSpanData as as, AgentSpawnInput as at, AgentTaskCancellation as au, AgentTaskCorrelation as av, AgentTaskEvent as aw, AgentTaskFilter as ax, AgentTaskProgress as ay, AgentTaskRegistrationSnapshot as az, AdmissionAuditOptions as b, KodaXSessionGoalEntry as b$, CreateLearnedSkillRecordInput as b0, CurrentTodoSummary as b1, DeclarativeSkillSpec as b3, Deliverable as b4, DiscoveredInstance as b5, DiscoveryOptions as b6, DispatchableAgentDescriptor as b7, DispatchableAgentListing as b8, DispatchableAgentOrigin as b9, KodaXCompactMemoryProgress as bA, KodaXCompactMemorySeed as bB, KodaXExtensionSessionRecord as bC, KodaXExtensionSessionState as bD, KodaXExtensionStore as bE, KodaXExtensionStoreEntry as bF, KodaXFileInputArtifact as bG, KodaXGoalEventType as bH, KodaXGoalState as bI, KodaXGoalStatus as bJ, KodaXImageInputArtifact as bK, KodaXImageMediaType as bL, KodaXInputArtifact as bM, KodaXInputArtifactSource as bN, KodaXJsonValue as bO, KodaXMemoryInfluenceRef as bP, KodaXMemoryIntent as bQ, KodaXMemoryOutcomeDigest as bR, KodaXMemoryOutcomeEvidence as bS, KodaXSessionArchiveMarkerEntry as bT, KodaXSessionArtifactLedgerEntry as bU, KodaXSessionBranchSummaryEntry as bV, KodaXSessionClientNoticeEntry as bW, KodaXSessionCompactionEntry as bX, KodaXSessionData as bY, KodaXSessionEntry as bZ, KodaXSessionEntryBase as b_, DispatchableAgentQuery as ba, EvidenceSpanData as bb, ExactInvokedSkillSnapshot as bc, ExternalAgentEffectDeclaration as bd, ExternalAgentHealth as be, ExternalAgentProtocol as bf, ExternalAgentRegistration as bg, ExternalAgentRegistrationSummary as bh, FanoutSpanData as bi, FileOperations as bj, GenerationSpanData as bk, Guardrail as bl, GuardrailContext as bn, GuardrailPermissionIntent as bp, GuardrailSpanData as bq, GuardrailVerdict as br, Handoff as bs, HandoffSpanData as bt, InMemorySessionOptions as bu, InputGuardrail as bv, InstanceDiscoveryFs as bw, InvariantId as bx, InvariantResult as by, AdmissionCtx as c, KodaXSessionLabelEntry as c0, KodaXSessionLineage as c1, KodaXSessionMemoryOutcomeDigestEntry as c2, KodaXSessionMemoryReviewReceiptEntry as c3, KodaXSessionMessageEntry as c4, KodaXSessionMeta as c5, KodaXSessionNavigationOptions as c6, KodaXSessionRewindMarkerEntry as c7, KodaXSessionRuntimeInfo as c8, KodaXSessionScope as c9, LearnedSkillBindingAdmission as cA, LearnedSkillCanaryOutcome as cB, LearnedSkillDecisionDisposition as cC, LearnedSkillInvocationAdmission as cD, LearnedSkillInvokedReceipt as cE, LearnedSkillOfferedReceipt as cF, LearnedSkillOutcomeReceipt as cG, LearnedSkillUsageReceipt as cH, LearningAction as cI, LearningActionDriver as cJ, LearningCapabilityErrorCode as cL, LearningClientEventState as cM, LearningClientRecord as cN, LearningEvent as cO, LearningEventKind as cP, LearningExplicitUserAuthority as cQ, LearningNotificationState as cR, LearningPage as cS, LearningQuery as cT, LearningReviewEvidencePacket as cU, LearningReviewQualification as cV, LearningReviewVerifierFact as cW, LearningSubscribeOptions as cX, LearningSurfaceSnapshot as cY, LocalAgentTaskInput as cZ, LocalAgentTaskUpdate as c_, KodaXSessionStorage as ca, KodaXSessionTreeNode as cb, KodaXSessionUiHistoryItem as cc, KodaXSessionUiHistoryItemType as cd, KodaXSessionUiTextHistoryItem as ce, KodaXSessionUiTextHistoryItemType as cf, KodaXSessionUiToolCall as cg, KodaXSessionUiToolCallStatus as ch, KodaXSessionUiToolGroupHistoryItem as ci, KodaXSessionWorkspaceKind as cj, KodaXVideoInputArtifact as ck, KodaXVideoMediaType as cl, LearnedAreaPaths as cm, LearnedCapabilityArtifact as co, LearnedCapabilityCanary as cp, LearnedCapabilityCanaryBinding as cq, LearnedCapabilityCanaryInvocation as cr, LearnedCapabilityCarrier as cs, LearnedCapabilityLifecycle as ct, LearnedCapabilityProvenance as cu, LearnedCapabilityRecord as cv, LearnedCapabilityRecordV1 as cw, LearnedCapabilityRecordV2 as cx, LearnedCapabilityScope as cy, LearnedCapabilitySource as cz, AdmissionVerdict as d, RunnerLlmReturn as d$, ManifestPatch as d0, MemoryActionProposal as d1, MemoryApplicability as d2, MemoryApplyPreview as d3, MemoryApplyResult as d4, MemoryApproval as d5, MemoryAuthority as d6, MemoryAutoCuratorInput as d7, MemoryAutoCuratorResult as d8, MemoryBodySnapshot as d9, MemoryReviewPersistenceDecision as dA, MemoryReviewPersistenceKind as dB, MemoryReviewPlan as dC, MemoryReviewRunner as dD, MemoryReviewTrigger as dE, MemoryScope as dF, MemorySourceAdapter as dG, MemoryVisibility as dH, MessageEntry as dI, NormalizedLearnedSkillDecision as dJ, ObserveCtx as dK, OutputGuardrail as dL, PersistedSessionState as dM, PresetDispatcher as dN, PresetTracingContext as dO, QualityInvariant as dP, ReadonlyMutationTracker as dQ, ReadonlyRecorder as dR, ReasoningDepth as dS, RecentlyModifiedFile as dT, RunEvent as dU, RunOptions as dV, RunResult as dW, RunnableTool as dX, RunnerEvent as dZ, RunnerLlmResult as d_, MemoryClaimKind as da, MemoryContextIdentity as db, MemoryController as dc, MemoryCuratorInput as dd, MemoryDecisionTraceReceipt as de, MemoryEpisodeReviewResult as df, MemoryEvent as dg, MemoryGovernanceFinding as dh, MemoryGovernanceFindingKind as di, MemoryGovernanceReport as dj, MemoryItemRef as dk, MemoryLifecycle as dl, MemoryLifecycleOperationResult as dm, MemoryPack as dn, MemoryPackHint as dp, MemoryPackInput as dq, MemoryPackTraceMetadata as dr, MemoryProposalAction as ds, MemoryRefFilter as dt, MemoryRefKind as du, MemoryRejectResult as dv, MemoryReviewCandidateRef as dw, MemoryReviewDraftAction as dx, MemoryReviewInput as dy, MemoryReviewModelInput as dz, AdmittedHandle as e, WorkflowOutcomeStatus as e$, RunnerRecoveryTranscriptCarrier as e0, RunnerToolCall as e1, RunnerToolContext as e2, RunnerToolObserver as e3, RunnerToolResult as e4, RunnerToolResultBatch as e5, RunnerToolResultBatchTransform as e6, Session as e7, SessionDispatchResult as e8, SessionEntry as e9, Trace as eA, TraceOptions as eB, TracerOptions as eD, UnifiedLearningReviewModelInput as eE, UnifiedLearningReviewResult as eF, UnifiedLearningReviewRunner as eG, UserInteraction as eH, WorkflowAgentBackend as eI, WorkflowApi as eJ, WorkflowApproval as eK, WorkflowApprovalSummary as eL, WorkflowArtifactRef as eM, WorkflowBudget as eN, WorkflowEvent as eO, WorkflowEventCorrelation as eP, WorkflowEventType as eR, WorkflowIsolation as eS, WorkflowLimits as eT, WorkflowLogEvent as eU, WorkflowMeta as eV, WorkflowModelHint as eW, WorkflowModule as eX, WorkflowOutcome as eY, WorkflowOutcomeError as eZ, WorkflowOutcomeResult as e_, SessionErrorMetadata as ea, SessionExtension as eb, SessionForkOptions as ec, SessionMeta as ed, SessionStateSnapshot as ee, Span as ef, SpanData as eg, SpanError as eh, SpanImplOptions as ej, StagedLearnedSkillArtifact as ek, StartTraceOptions as el, StateWriter as em, StateWriterFs as en, StateWriterOptions as eo, StopHookContext as ep, StopHookFn as eq, StopHookResult as er, StopHookSpanData as es, SystemCap as et, TerminalCtx as eu, ToolBeforeOutcome as ev, ToolCallSpanData as ew, ToolCapability as ex, ToolGuardrail as ey, ToolPermission as ez, Agent as f, WorkflowOutcomeUsage as f0, WorkflowParallelOptions as f1, WorkflowProcessArtifact as f2, WorkflowProcessCounts as f3, WorkflowProcessEvent as f4, WorkflowProcessItem as f5, WorkflowProcessItemKind as f6, WorkflowProcessItemOrigin as f7, WorkflowProcessItemStatus as f8, WorkflowProcessProgress as f9, WorkflowProcessSnapshot as fa, WorkflowProcessSource as fb, WorkflowProcessStatus as fc, WorkflowProcessSummaryStatus as fd, WorkflowProcessTokenUsage as fe, WorkflowProcessTracker as ff, WorkflowProcessTrackerOptions as fg, WorkflowRun as fh, WorkflowRunState as fi, WorkflowRunStatus as fj, WorkflowSpawnAgentInput as fk, WorkflowSynthesis as fl, WorkflowSynthesizeInput as fm, WorkflowTaskHandle as fn, WorkflowTaskResult as fo, WorkflowTaskSnapshot as fp, WorkflowTaskStatus as fq, WorkflowTaskSummaryEventUpdate as fr, WorkflowTaskSummaryKind as fs, WorkflowTaskSummaryUpdate as ft, WorkflowTaskUsage as fu, WorkflowTaskVerification as fv, WorkflowTaskVerificationResult as fw, WorkflowWaitOptions as fx, AgentActor as g, AgentActorClient as h, AgentActorOwner as j, AgentActorSnapshot as k, AgentActorSnapshotV1 as l, AgentActorSnapshotV2 as m, AgentActorState as n, AgentActorStore as o, AgentArtifactDescriptor as p, AgentArtifactPolicy as q, AgentArtifactPolicyDecision as r, AgentArtifactPolicyInput as s, AgentArtifactReference as t, AgentBudgetAdmission as u, AgentBudgetAdmissionInput as v, AgentBudgetExhausted as w, AgentBudgetPort as x, AgentCapabilities as y, AgentCapabilityDeclaration as z };
|