@kodax-ai/kodax 0.7.77 → 0.7.78

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.
Files changed (98) hide show
  1. package/CHANGELOG.md +176 -4
  2. package/README.md +200 -64
  3. package/README_CN.md +153 -49
  4. package/config-templates/config.example.jsonc +114 -32
  5. package/dist/chunks/agent-ASP4MS3X.js +2 -0
  6. package/dist/chunks/argument-completer-JYQ7FX3W.js +2 -0
  7. package/dist/chunks/{chunk-XSA37BVM.js → chunk-2CFHBKRE.js} +1 -1
  8. package/dist/chunks/chunk-35PPHOQ2.js +292 -0
  9. package/dist/chunks/chunk-43QNNDHR.js +29 -0
  10. package/dist/chunks/chunk-5BNQXXGY.js +1 -0
  11. package/dist/chunks/chunk-5GO6FH7L.js +458 -0
  12. package/dist/chunks/{chunk-FSXI4MAV.js → chunk-5NDCSFOP.js} +14 -14
  13. package/dist/chunks/{chunk-3DD4QEBH.js → chunk-6FOJVETH.js} +10 -10
  14. package/dist/chunks/chunk-6XM4B6K2.js +48 -0
  15. package/dist/chunks/chunk-6YZUE6NC.js +240 -0
  16. package/dist/chunks/{chunk-HORNWBYR.js → chunk-7OEBJGHK.js} +1 -1
  17. package/dist/chunks/{chunk-OAMKECRG.js → chunk-KQLQYHWU.js} +205 -200
  18. package/dist/chunks/{chunk-IQT4RPCE.js → chunk-NXO6GWSY.js} +2 -2
  19. package/dist/chunks/chunk-T2XZTLYE.js +316 -0
  20. package/dist/chunks/chunk-TQDBTTIM.js +348 -0
  21. package/dist/chunks/{chunk-FNW2XUL5.js → chunk-UID7BLAB.js} +1 -1
  22. package/dist/chunks/chunk-VAT2QYXM.js +765 -0
  23. package/dist/chunks/chunk-YAZQTC2L.js +5 -0
  24. package/dist/chunks/chunk-YVRYHC4C.js +655 -0
  25. package/dist/chunks/{chunk-EH7AOMJ7.js → chunk-Z3KFRTSB.js} +1 -1
  26. package/dist/chunks/compaction-config-BQSSIWK5.js +2 -0
  27. package/dist/chunks/{construction-bootstrap-RPRL3L7R.js → construction-bootstrap-VQLQGWPY.js} +1 -1
  28. package/dist/chunks/{dist-FDSOIR35.js → dist-BFT5YIGU.js} +1 -1
  29. package/dist/chunks/dist-PCFE24YP.js +2 -0
  30. package/dist/chunks/host-UTFXCYYM.js +2 -0
  31. package/dist/chunks/run-manager-PJU3WIFJ.js +2 -0
  32. package/dist/chunks/utils-SID4HW2Q.js +2 -0
  33. package/dist/index.d.ts +18 -17
  34. package/dist/index.js +6 -6
  35. package/dist/kodax_cli.js +1751 -1352
  36. package/dist/kodax_resume.js +17 -17
  37. package/dist/runtime-worker.js +1680 -1299
  38. package/dist/sandbox-workspace-session.js +563 -0
  39. package/dist/sdk-a2a.d.ts +16 -16
  40. package/dist/sdk-a2a.js +8 -8
  41. package/dist/sdk-agent.d.ts +275 -60
  42. package/dist/sdk-agent.js +1 -1
  43. package/dist/sdk-coding.d.ts +33 -165
  44. package/dist/sdk-coding.js +1 -1
  45. package/dist/sdk-experimental-memory.d.ts +2 -2
  46. package/dist/sdk-experimental-memory.js +1 -1
  47. package/dist/sdk-llm.d.ts +2 -1
  48. package/dist/sdk-llm.js +1 -1
  49. package/dist/sdk-mcp.js +1 -1
  50. package/dist/sdk-media.js +1 -1
  51. package/dist/sdk-repl.d.ts +67 -25
  52. package/dist/sdk-repl.js +2 -2
  53. package/dist/sdk-runtime.d.ts +194 -147
  54. package/dist/sdk-runtime.js +1 -1
  55. package/dist/sdk-sandbox.d.ts +93 -0
  56. package/dist/sdk-sandbox.js +2 -0
  57. package/dist/sdk-session.d.ts +6 -7
  58. package/dist/sdk-session.js +1 -1
  59. package/dist/sdk-skills.d.ts +2 -2
  60. package/dist/sdk-skills.js +1 -1
  61. package/dist/semantic-worker.js +15 -15
  62. package/dist/types-chunks/{bash-prefix-extractor.d-pZdu6qt7.d.ts → bash-prefix-extractor.d-uAe2Oqda.d.ts} +126 -8
  63. package/dist/types-chunks/{capsule.d-CxCm1KZz.d.ts → capsule.d-BlSv9l3V.d.ts} +1 -1
  64. package/dist/types-chunks/{guardrail.d-CJx9RRd3.d.ts → guardrail.d-BRE_ErEj.d.ts} +1 -1
  65. package/dist/types-chunks/{guardrail.d-B0PwAZVR.d.ts → guardrail.d-CXDYRgZ3.d.ts} +200 -34
  66. package/dist/types-chunks/{history-retrieval.d-B__aEN62.d.ts → history-retrieval.d-DtCy7x64.d.ts} +1 -1
  67. package/dist/types-chunks/{integration-config.d-ojG4swOP.d.ts → integration-config.d-BNowXE8k.d.ts} +23 -8
  68. package/dist/types-chunks/{public-api.d--fF88JrC.d.ts → public-api.d-B3AohsxN.d.ts} +36 -7
  69. package/dist/types-chunks/{commands.d-BccESAMV.d.ts → repl.d-Ie_ZXb_U.d.ts} +89 -78
  70. package/dist/types-chunks/{side-query.d-5JvXhuOZ.d.ts → resolver.d-iAQ9ocLB.d.ts} +3 -66
  71. package/dist/types-chunks/{run-manager.d-B47hIqnI.d.ts → run-manager.d-D1twIhF9.d.ts} +1 -1
  72. package/dist/types-chunks/{sdk-session-CLWf8Adb.d.ts → sdk-session-DB9KksIx.d.ts} +2 -2
  73. package/dist/types-chunks/side-query.d-DTuLPcC5.d.ts +77 -0
  74. package/dist/types-chunks/{types-LanCEDj8.d.ts → types-D3g6XUQr.d.ts} +41 -2
  75. package/dist/types-chunks/{types.d-RdWRfUEs.d.ts → types.d-BA-Jwpfs.d.ts} +459 -7
  76. package/dist/types-chunks/{types.d-CODuyyqy.d.ts → types.d-BH0ZkTGf.d.ts} +1 -1
  77. package/dist/types-chunks/{types.d-DCQVBqVn.d.ts → types.d-BbtGlKZu.d.ts} +25 -3
  78. package/dist/types-chunks/{types.d-DCsKM8aT.d.ts → types.d-DVDTIfB_.d.ts} +2 -2
  79. package/dist/types-chunks/{utils.d-CDduqbFw.d.ts → utils.d-CVp6bFl9.d.ts} +22 -6
  80. package/docs/SDK_EMBEDDER_GUIDE.md +399 -55
  81. package/package.json +8 -1
  82. package/dist/chunks/agent-NGSWFE73.js +0 -2
  83. package/dist/chunks/argument-completer-WGGZPEEO.js +0 -2
  84. package/dist/chunks/chunk-27QLRH3D.js +0 -5
  85. package/dist/chunks/chunk-2MQPVY6P.js +0 -770
  86. package/dist/chunks/chunk-6WAPVAGQ.js +0 -74
  87. package/dist/chunks/chunk-AOENDSVN.js +0 -448
  88. package/dist/chunks/chunk-HV2GMZUZ.js +0 -343
  89. package/dist/chunks/chunk-JS2BHGJP.js +0 -158
  90. package/dist/chunks/chunk-ON2WG2LG.js +0 -622
  91. package/dist/chunks/chunk-RUGAAHTF.js +0 -321
  92. package/dist/chunks/chunk-TGCG7U2W.js +0 -37
  93. package/dist/chunks/compaction-config-BE7VYWH6.js +0 -2
  94. package/dist/chunks/dist-ZZBNVTKU.js +0 -2
  95. package/dist/chunks/host-QAKQVC4A.js +0 -2
  96. package/dist/chunks/run-manager-N4UFWA2D.js +0 -2
  97. package/dist/chunks/utils-AUHCI4D5.js +0 -2
  98. package/dist/types-chunks/center-types.d-BBT122uJ.d.ts +0 -91
@@ -86,26 +86,47 @@ interface KodaXSessionClientNoticeEntry extends KodaXSessionEntryBase {
86
86
  interface KodaXMemoryOutcomeDigest {
87
87
  readonly id: string;
88
88
  readonly reviewKey: string;
89
+ /** Stable root-episode identity; absent on pre-F263 digests. */
90
+ readonly episodeId?: string;
89
91
  readonly sessionId: string;
90
92
  readonly branchId: string;
91
93
  readonly sequence: number;
92
94
  readonly objective: string;
93
95
  readonly actionSignature?: string;
94
96
  readonly approach: string;
95
- readonly outcome: 'succeeded' | 'failed';
97
+ /**
98
+ * `cancelled` is reserved for a host-bound explicit Memory intent. Ordinary
99
+ * cancelled episodes do not produce an outcome digest.
100
+ */
101
+ readonly outcome: 'succeeded' | 'failed' | 'cancelled';
96
102
  readonly summary: string;
97
103
  readonly preconditions?: string;
98
104
  readonly lesson?: string;
99
105
  readonly evidenceRefs: readonly string[];
100
106
  readonly evidence?: readonly KodaXMemoryOutcomeEvidence[];
107
+ /**
108
+ * Explicit durable intent captured from the Action LLM and bound by the
109
+ * host to an exact quote in the current user turn. It is evidence for the
110
+ * governed reviewer, never proof that Memory was queued or applied.
111
+ */
112
+ readonly memoryIntent?: KodaXMemoryIntent;
101
113
  readonly memoryInfluence?: readonly KodaXMemoryInfluenceRef[];
102
114
  readonly visibility: 'prompt_safe' | 'private' | 'sensitive';
103
115
  readonly createdAt: string;
104
116
  }
117
+ interface KodaXMemoryIntent {
118
+ readonly operation: 'remember' | 'correct';
119
+ readonly evidenceRef: string;
120
+ /** Sanitized model-derived claim proposed for governed review. */
121
+ readonly candidateStatement: string;
122
+ /** Sanitized representation of the exact current-user quote verified by the host. */
123
+ readonly userQuote: string;
124
+ }
105
125
  interface KodaXMemoryOutcomeEvidence {
106
126
  readonly ref: string;
107
127
  readonly grade: 'authoritative' | 'verified' | 'corroborated' | 'observed' | 'inferred';
108
128
  readonly source: 'user' | 'host' | 'tool' | 'environment' | 'agent';
129
+ readonly verdict?: 'passed' | 'failed' | 'inconclusive';
109
130
  readonly observedAt: string;
110
131
  }
111
132
  interface KodaXMemoryInfluenceRef {
@@ -115,9 +136,13 @@ interface KodaXMemoryInfluenceRef {
115
136
  interface KodaXSessionMemoryOutcomeDigestEntry extends KodaXSessionEntryBase {
116
137
  readonly type: 'memory_outcome_digest';
117
138
  readonly digest: KodaXMemoryOutcomeDigest;
139
+ /** Durable F263 review job identity. Absent on pre-F263 lineage records. */
140
+ readonly jobId?: string;
118
141
  }
119
142
  interface KodaXSessionMemoryReviewReceiptEntry extends KodaXSessionEntryBase {
120
143
  readonly type: 'memory_review_receipt';
144
+ /** Distinguishes repeated review keys across branch epochs. */
145
+ readonly jobId?: string;
121
146
  readonly reviewKey: string;
122
147
  readonly proposalIds: readonly string[];
123
148
  readonly status: 'completed' | 'no_action';
@@ -196,6 +221,8 @@ interface KodaXSessionLineage {
196
221
  }
197
222
 
198
223
  interface MemoryContextIdentity {
224
+ /** Explicit owner home for durable runtime state; never persisted in review envelopes. */
225
+ readonly configHome?: string;
199
226
  readonly tenantId: string;
200
227
  readonly workspaceId?: string;
201
228
  readonly userId?: string;
@@ -452,7 +479,15 @@ interface MemoryController {
452
479
  maybeRunAutoCurator(input?: MemoryAutoCuratorInput): Promise<MemoryAutoCuratorResult>;
453
480
  buildMemoryPack(input: MemoryPackInput): Promise<MemoryPack>;
454
481
  reviewMemoryFeedback(input: MemoryReviewInput): Promise<MemoryReviewPlan>;
482
+ prepareEpisodeReview?(digest: KodaXMemoryOutcomeDigest): Promise<MemoryReviewModelInput>;
483
+ applyReviewedEpisode?(plan: MemoryReviewPlan, digest: KodaXMemoryOutcomeDigest, signal?: AbortSignal, revalidateAuthority?: () => Promise<void>): Promise<MemoryEpisodeReviewResult>;
455
484
  persistReviewPlan(plan: MemoryReviewPlan): Promise<readonly string[]>;
485
+ /**
486
+ * Resolves which episode-review proposals were actually auto-applied by the
487
+ * governed host policy. Used to keep durable receipts complete while user
488
+ * notices remain truthful.
489
+ */
490
+ listHostAppliedEpisodeProposalIds?(proposalIds: readonly string[]): Promise<readonly string[]>;
456
491
  reviewEpisode(digest: KodaXMemoryOutcomeDigest, signal?: AbortSignal): Promise<MemoryEpisodeReviewResult>;
457
492
  archiveRef(id: string): Promise<MemoryLifecycleOperationResult>;
458
493
  forgetRef(id: string): Promise<MemoryLifecycleOperationResult>;
@@ -484,6 +519,7 @@ interface MemoryEvidenceRef {
484
519
  readonly ref: string;
485
520
  readonly requestedGrade: MemoryEvidenceGrade;
486
521
  readonly source: 'user' | 'host' | 'tool' | 'environment' | 'agent';
522
+ readonly verdict?: 'passed' | 'failed' | 'inconclusive';
487
523
  readonly observedAt: string;
488
524
  }
489
525
  type MemorySourcePolicy = (evidence: MemoryEvidenceRef) => MemoryEvidenceGrade;
@@ -575,7 +611,7 @@ type MemoryAgentTraceEvent = {
575
611
  /** @deprecated Retained for source compatibility; F275 no longer emits prefetch events. */
576
612
  | 'recall.prefetch.failed'
577
613
  /** @deprecated Retained for source compatibility; F275 no longer emits prefetch events. */
578
- | 'recall.prefetch.discarded' | 'query.failed' | 'review.timed_out';
614
+ | 'recall.prefetch.discarded' | 'query.failed' | 'review.failed' | 'review.timed_out';
579
615
  readonly key: string;
580
616
  readonly detail?: string;
581
617
  } | {
@@ -585,11 +621,14 @@ type MemoryAgentTraceEvent = {
585
621
  interface MemorySessionInput {
586
622
  readonly identity: MemoryContextIdentity;
587
623
  readonly objective: string;
624
+ /** Stable caller-owned identity for this root episode. */
625
+ readonly episodeId?: string;
588
626
  }
589
627
  interface MemoryEpisodeOutcome {
590
628
  readonly status: 'succeeded' | 'failed' | 'cancelled';
591
629
  readonly summary: string;
592
630
  readonly evidence: readonly MemoryEvidenceRef[];
631
+ readonly memoryIntent?: KodaXMemoryIntent;
593
632
  }
594
633
  type PersistedOutcomeDigest = KodaXMemoryOutcomeDigest;
595
634
  interface MemorySession {