@kodax-ai/kodax 0.7.96 → 0.7.97-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/CHANGELOG.md +86 -0
  2. package/README.md +85 -62
  3. package/README_CN.md +57 -67
  4. package/config-templates/config.example.jsonc +0 -14
  5. package/dist/chunks/{agent-7N427EVB.js → agent-J7SHFM5N.js} +1 -1
  6. package/dist/chunks/argument-completer-ZJQOWTIS.js +2 -0
  7. package/dist/chunks/{chunk-ABZDFK2X.js → chunk-2GV6MQ4T.js} +14 -14
  8. package/dist/chunks/{chunk-6QI3GOYG.js → chunk-3PS3YEDS.js} +1 -1
  9. package/dist/chunks/chunk-4VJMQDTH.js +417 -0
  10. package/dist/chunks/{chunk-NI7PBPUR.js → chunk-5DSUVP46.js} +1 -1
  11. package/dist/chunks/chunk-5P7RTSZT.js +21 -0
  12. package/dist/chunks/{chunk-XXNR6S4Q.js → chunk-6ZAQKFIM.js} +1 -1
  13. package/dist/chunks/chunk-7V2QBZ73.js +137 -0
  14. package/dist/chunks/{chunk-C7U542KM.js → chunk-F7DHZH6T.js} +1 -1
  15. package/dist/chunks/{chunk-7IMWOR34.js → chunk-HSRYDDPF.js} +1 -1
  16. package/dist/chunks/chunk-K3DQGSQU.js +372 -0
  17. package/dist/chunks/chunk-NO23K2CB.js +2 -0
  18. package/dist/chunks/{chunk-NKT3B3DR.js → chunk-OT5WHAX4.js} +1 -1
  19. package/dist/chunks/{chunk-YEAUDI6U.js → chunk-QGWHJIO4.js} +1 -1
  20. package/dist/chunks/chunk-QOFFAY5C.js +261 -0
  21. package/dist/chunks/{chunk-4PFZ7BEE.js → chunk-QVDTORL3.js} +11 -11
  22. package/dist/chunks/chunk-QZ4B4AWG.js +473 -0
  23. package/dist/chunks/chunk-RXDS6CNA.js +355 -0
  24. package/dist/chunks/{chunk-WV3DJVW4.js → chunk-VDGPJQL7.js} +135 -135
  25. package/dist/chunks/chunk-VEZ4WHPN.js +641 -0
  26. package/dist/chunks/chunk-ZPPAT25E.js +5 -0
  27. package/dist/chunks/chunk-ZQYWDI4O.js +1 -0
  28. package/dist/chunks/chunk-ZS2GUADU.js +498 -0
  29. package/dist/chunks/{chunk-GN2IY5YE.js → chunk-ZTYZYXGV.js} +1 -1
  30. package/dist/chunks/{chunk-EM4XJBTK.js → chunk-ZZQ4GDVU.js} +1 -1
  31. package/dist/chunks/{client-6WZZTTSV.js → client-MXOJ5XUN.js} +1 -1
  32. package/dist/chunks/{compaction-config-ZMEJU4U7.js → compaction-config-5VZSGKBQ.js} +1 -1
  33. package/dist/chunks/{construction-bootstrap-RX4DMHI7.js → construction-bootstrap-U2ZU2WAT.js} +1 -1
  34. package/dist/chunks/dist-CSLNWLOE.js +2 -0
  35. package/dist/chunks/dist-XXMJMJDU.js +2 -0
  36. package/dist/chunks/host-RUXYZFYN.js +2 -0
  37. package/dist/chunks/readline-helpers-JCVULR4C.js +2 -0
  38. package/dist/chunks/run-manager-DRIM5VNE.js +2 -0
  39. package/dist/chunks/utils-MQEBGKIX.js +2 -0
  40. package/dist/index.d.ts +63 -30
  41. package/dist/index.js +10 -6
  42. package/dist/kodax_bootstrap.js +1 -1
  43. package/dist/kodax_cli.js +1745 -1734
  44. package/dist/kodax_resume.js +32 -35
  45. package/dist/native/win32-x64/kodax-windows-sandbox.exe +0 -0
  46. package/dist/native/win32-x64/kodax-windows-text-transaction.node +0 -0
  47. package/dist/native/win32-x64/manifest.json +2 -2
  48. package/dist/sandbox-network-broker.js +77 -77
  49. package/dist/sdk-a2a.d.ts +33 -18
  50. package/dist/sdk-a2a.js +8 -9
  51. package/dist/sdk-agent.d.ts +33 -26
  52. package/dist/sdk-agent.js +1 -1
  53. package/dist/sdk-client.d.ts +40 -0
  54. package/dist/sdk-client.js +2 -0
  55. package/dist/sdk-coding.d.ts +87 -499
  56. package/dist/sdk-coding.js +1 -1
  57. package/dist/sdk-experimental-memory.d.ts +3 -4
  58. package/dist/sdk-experimental-memory.js +1 -1
  59. package/dist/sdk-llm.d.ts +11 -9
  60. package/dist/sdk-llm.js +1 -1
  61. package/dist/sdk-mcp.d.ts +3 -3
  62. package/dist/sdk-mcp.js +1 -1
  63. package/dist/sdk-media.d.ts +3 -1
  64. package/dist/sdk-media.js +1 -1
  65. package/dist/sdk-repl.d.ts +317 -70
  66. package/dist/sdk-repl.js +2 -2
  67. package/dist/sdk-runtime.d.ts +580 -452
  68. package/dist/sdk-runtime.js +1 -1
  69. package/dist/sdk-sandbox.js +1 -1
  70. package/dist/sdk-session.d.ts +13 -9
  71. package/dist/sdk-session.js +1 -1
  72. package/dist/sdk-skills.js +1 -1
  73. package/dist/semantic-worker.js +57 -57
  74. package/dist/types-chunks/{base.d-Bt9lhwSV.d.ts → base.d-ZBOdjDUT.d.ts} +2 -1
  75. package/dist/types-chunks/{bash-prefix-extractor.d-DWFIMg0v.d.ts → bash-prefix-extractor.d-DvswAXKS.d.ts} +136 -66
  76. package/dist/types-chunks/{capability-learning.d-gRtO03f6.d.ts → capability-learning.d-B4pxKwP4.d.ts} +1 -1
  77. package/dist/types-chunks/{capability.d-Ch5Vos33.d.ts → capability.d-DOF3r0fJ.d.ts} +1 -1
  78. package/dist/types-chunks/{capsule.d-Dj1n6s0Y.d.ts → capsule.d-B4atvlxE.d.ts} +7 -19
  79. package/dist/types-chunks/client-contract-A1jdk6xz.d.ts +1993 -0
  80. package/dist/types-chunks/{controller.d-C0IM1Tud.d.ts → controller.d-BkUJ_3sl.d.ts} +1 -1
  81. package/dist/types-chunks/{controller.d-J2t1q8Ly.d.ts → controller.d-yyKajPTi.d.ts} +140 -1380
  82. package/dist/types-chunks/{cost-tracker.d-BWI4lFWn.d.ts → cost-tracker.d-BeaenODW.d.ts} +2 -47
  83. package/dist/types-chunks/{history-retrieval.d-CPN5PMBV.d.ts → history-retrieval.d-JdFfkeF3.d.ts} +2 -2
  84. package/dist/types-chunks/{manager.d-rtmywU9M.d.ts → manager.d-C_20XqCV.d.ts} +8 -1
  85. package/dist/types-chunks/manifest.d-Bw2i-zQi.d.ts +18 -0
  86. package/dist/types-chunks/provider-credential-context.d-BH2OaB1b.d.ts +47 -0
  87. package/dist/types-chunks/provider-request-observation.d-jL8T6wVO.d.ts +34 -0
  88. package/dist/types-chunks/{public-api.d-amBop8Nk.d.ts → public-api.d-Cq8ILMte.d.ts} +52 -13
  89. package/dist/types-chunks/{resolver.d-BrwLoWNr.d.ts → resolver.d-DLY01RHx.d.ts} +4 -2
  90. package/dist/types-chunks/{types.d-CSv0_cZC.d.ts → review-inbox.d-BeaLRNHx.d.ts} +251 -3
  91. package/dist/types-chunks/{shell-command-sets.d-oejwpP_7.d.ts → review-packet.d-D4bbTbq3.d.ts} +46 -3
  92. package/dist/types-chunks/{exec-policy.d-BPESl90L.d.ts → run-manager.d-C7Q71rin.d.ts} +385 -62
  93. package/dist/types-chunks/runtime-client-info-CxnlZlW5.d.ts +175 -0
  94. package/dist/types-chunks/{sdk-session-B6XjHNU1.d.ts → sdk-session-BDFjCpDn.d.ts} +12 -4
  95. package/dist/types-chunks/{side-query.d-DHWG1JZg.d.ts → side-query.d-DTrhVd_r.d.ts} +4 -3
  96. package/dist/types-chunks/trusted-repl-entry-vbUM8R6P.d.ts +445 -0
  97. package/dist/types-chunks/{types.d-CtO8mR1s.d.ts → types.d-BJTN-RZr.d.ts} +5 -5
  98. package/dist/types-chunks/{types.d-BrQMB-hy.d.ts → types.d-BjOq57-z.d.ts} +6 -0
  99. package/dist/types-chunks/types.d-o7t9dds4.d.ts +1484 -0
  100. package/dist/types-chunks/{utils.d-DcznBeQ3.d.ts → utils.d-CWiMhFfu.d.ts} +202 -36
  101. package/docs/CLIENT_CONTRACT.md +441 -0
  102. package/docs/SDK_MIGRATION.md +123 -0
  103. package/docs/SPACE_SDK_SEAMS.md +139 -0
  104. package/package.json +10 -5
  105. package/public_docs/README.md +12 -133
  106. package/public_docs/configuration/config-files.md +8 -14
  107. package/public_docs/sdk/embedder-guide.md +494 -420
  108. package/dist/chunks/argument-completer-FAIHW7HZ.js +0 -2
  109. package/dist/chunks/chunk-66XN5AFU.js +0 -417
  110. package/dist/chunks/chunk-7O2AIFNE.js +0 -373
  111. package/dist/chunks/chunk-DSXUXUZG.js +0 -5
  112. package/dist/chunks/chunk-GYO73UYQ.js +0 -275
  113. package/dist/chunks/chunk-HPCS3LZ5.js +0 -324
  114. package/dist/chunks/chunk-HZYRLIOC.js +0 -137
  115. package/dist/chunks/chunk-SC2ELSUS.js +0 -675
  116. package/dist/chunks/chunk-TEUD5VPJ.js +0 -471
  117. package/dist/chunks/chunk-TYZ2ZAYL.js +0 -487
  118. package/dist/chunks/dist-3UCCMCYR.js +0 -2
  119. package/dist/chunks/dist-F5IWZSAY.js +0 -2
  120. package/dist/chunks/host-W2JJ3V3Q.js +0 -2
  121. package/dist/chunks/run-manager-RBWU3EVE.js +0 -2
  122. package/dist/chunks/utils-DJ4ZFJGL.js +0 -2
  123. package/dist/runtime-worker.js +0 -5381
  124. package/dist/types-chunks/review-inbox.d-CTeUIKda.d.ts +0 -225
  125. package/dist/types-chunks/run-manager.d-hm1XgEou.d.ts +0 -94
  126. package/dist/types-chunks/trusted-repl-entry-D0w5M0UZ.d.ts +0 -323
  127. package/dist/types-chunks/types.d-B1l9pWyX.d.ts +0 -146
@@ -1,146 +0,0 @@
1
- import { b0 as KodaXInputArtifact } from './controller.d-J2t1q8Ly.js';
2
- import { U as KodaXTaskResultMetadata } from './types.d-BrQMB-hy.js';
3
-
4
- /**
5
- * @kodax-ai/agent/messaging — Message queue types
6
- *
7
- * FEATURE_115 (v0.7.36): agentId-scoped 2-tier priority queue infrastructure.
8
- *
9
- * Per ADR-021: messaging is a generic agent-platform primitive (not coding-
10
- * specific). Downstream consumers:
11
- * - @kodax-ai/coding runner-driven mid-turn drain
12
- * - @kodax-ai/repl InkREPL ESC soft-pause + text injection (FEATURE_111 absorbed)
13
- * - subagent task-notification routing (FEATURE_155 idle-yield wakeup)
14
- *
15
- * Phase 0.6 study (`c:/tmp/claude-code-actual-usage.md`): Claude Code's
16
- * `'now'` priority has zero production usage; KodaX simplifies to 2 tiers.
17
- */
18
-
19
- type MessagePriority = 'user' | 'background';
20
- /**
21
- * Delivery owner for user prompts. Ordinary messages are runtime-deliverable.
22
- * `host` is reserved for prompts that must re-enter a trusted host command
23
- * pipeline (for example an explicit user Skill invocation) before any model
24
- * can observe them.
25
- */
26
- type MessageDelivery = 'runtime' | 'host';
27
- /**
28
- * Delivery semantics, independent of priority:
29
- * - `prompt`: user-authored input; delivered as a real user turn.
30
- * - `agent-message`: Runtime-authenticated Agent communication.
31
- * - `task-notification`: structured Agent completion evidence.
32
- * - `system-reminder`: Runtime-authored synthetic guidance.
33
- */
34
- type MessageMode = 'prompt' | 'agent-message' | 'task-notification' | 'system-reminder';
35
- type QueuedInputArtifact = KodaXInputArtifact;
36
- interface QueuedMessage {
37
- /** Stable id for tracing / dedup. Format: `msg-<sequence>`. */
38
- readonly id: string;
39
- readonly priority: MessagePriority;
40
- /**
41
- * Routing key:
42
- * undefined = main thread / coordinator agent
43
- * 'agent-id-XYZ' = subagent / specific consumer
44
- *
45
- * Drain consumers MUST filter by agentId match — undefined matches only
46
- * undefined-agentId messages, not "any agent".
47
- */
48
- readonly agentId?: string;
49
- readonly mode: MessageMode;
50
- /** Omitted means `runtime`; `host` messages must not be spliced into a model turn. */
51
- readonly delivery?: MessageDelivery;
52
- readonly content: string;
53
- readonly inputArtifacts?: readonly QueuedInputArtifact[];
54
- readonly taskResult?: KodaXTaskResultMetadata;
55
- /** Wall-clock timestamp (`Date.now()`) for tracing only — not used for ordering. */
56
- readonly enqueuedAt: number;
57
- }
58
- interface DequeueFilter {
59
- /**
60
- * Only return messages with this agentId.
61
- * undefined matches messages with no agentId (main-thread messages only).
62
- */
63
- readonly agentId?: string;
64
- /**
65
- * Highest priority level included in the drain.
66
- * 'user' → only user priority drained, background stays queued
67
- * 'background' → both user + background drained (Sleep-gated case)
68
- */
69
- readonly maxPriority: MessagePriority;
70
- /**
71
- * Optional cap on number of messages drained in this call.
72
- * Defaults to unlimited (drains all matching).
73
- */
74
- readonly limit?: number;
75
- /**
76
- * FEATURE_159 (v0.7.40) — optional mode filter. Lets REPL split the
77
- * single queue into mode-typed views (e.g. `mode:'prompt'` for user
78
- * input vs `mode:'task-notification'` for child completion banners)
79
- * without separate queues. When omitted, all modes match.
80
- */
81
- readonly mode?: MessageMode;
82
- /**
83
- * FEATURE_159 (v0.7.40) — optional precise-id filter. Single-message
84
- * targeted removal — drives Esc-pop-this-uuid in REPL. When set, all
85
- * other filters still apply (agentId / priority / mode mismatches still
86
- * skip the message), so callers can't accidentally remove a message
87
- * outside their scope.
88
- */
89
- readonly id?: string;
90
- /**
91
- * FEATURE_159 (v0.7.40) — optional escape-hatch predicate, AND-ed with
92
- * the structured filters. Lets SDK consumers express conditions the
93
- * typed fields don't cover (e.g. timestamp ranges, content-match) without
94
- * forcing every new use case to extend `DequeueFilter`. KodaX-internal
95
- * code should prefer the typed fields for readability; this is the
96
- * "data-driven main path + predicate escape" pattern.
97
- *
98
- * Evaluated AFTER the typed filters succeed — so a `predicate` that
99
- * inspects `message.content` never runs on messages outside the
100
- * caller's `agentId` / `mode` / `id` scope.
101
- */
102
- readonly predicate?: (message: QueuedMessage) => boolean;
103
- }
104
- /**
105
- * FEATURE_159 (v0.7.40) — structured queue event emitted to subscribers.
106
- *
107
- * Replaces the prior `() => void` bare-notify signal. Carries the kind +
108
- * affected messages so SDK observability consumers (logging, tracing,
109
- * metrics) can react per-event without re-diffing snapshots.
110
- *
111
- * Event granularity rules:
112
- * - `enqueued` fires ONCE per `enqueue()` call (always 1 message).
113
- * - `dequeued` fires ONCE per `dequeue()` call that removed ≥1 message,
114
- * carrying ALL drained messages in priority+FIFO order. No-op drains
115
- * (filter matched nothing) fire no event — quiet by design so the
116
- * idle consumers can probe without spamming subscribers.
117
- * - `cleared` fires ONCE per `clear()` call that removed ≥1 message,
118
- * carrying the pre-clear messages. Empty-queue clear fires nothing.
119
- *
120
- * The `useSyncExternalStore` React hook ignores the event payload (it
121
- * only needs the change signal); SDK / tracer consumers read the event.
122
- */
123
- type QueueEvent = {
124
- readonly kind: 'enqueued';
125
- readonly message: QueuedMessage;
126
- } | {
127
- readonly kind: 'dequeued';
128
- readonly messages: readonly QueuedMessage[];
129
- } | {
130
- readonly kind: 'cleared';
131
- readonly messages: readonly QueuedMessage[];
132
- };
133
- /** FEATURE_159 — `MessageQueue.subscribe` listener signature. */
134
- type QueueEventListener = (event: QueueEvent) => void;
135
- interface EnqueueInput {
136
- readonly priority: MessagePriority;
137
- readonly mode: MessageMode;
138
- /** Omitted means `runtime`; use `host` for command-pipeline-owned prompts. */
139
- readonly delivery?: MessageDelivery;
140
- readonly content: string;
141
- readonly agentId?: string;
142
- readonly inputArtifacts?: readonly QueuedInputArtifact[];
143
- readonly taskResult?: KodaXTaskResultMetadata;
144
- }
145
-
146
- export type { DequeueFilter as D, EnqueueInput as E, MessageDelivery as M, QueueEventListener as Q, MessageMode as a, MessagePriority as b, QueuedInputArtifact as c, QueuedMessage as d };