@nyte-ai/core 0.0.23 → 0.0.25-beta.1

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 (189) hide show
  1. package/THIRD-PARTY-NOTICES.md +2 -38
  2. package/dist/chunks/{compose-nj4nj5n9.js → compose-0f9x3cjd.js} +1 -1
  3. package/dist/chunks/{compose-yfcb6w2h.js → compose-0zrwy7nk.js} +1 -1
  4. package/dist/chunks/{compose-xhtgytrh.js → compose-122g5jvb.js} +1 -1
  5. package/dist/chunks/{compose-nkxwrphm.js → compose-17xxey5y.js} +6 -6
  6. package/dist/chunks/compose-1hgkp0q6.js +154 -0
  7. package/dist/chunks/{compose-ad80nkkn.js → compose-1kvvrw50.js} +6 -6
  8. package/dist/chunks/{compose-jeemzja1.js → compose-1nqjy2z5.js} +3 -3
  9. package/dist/chunks/compose-2e84znn8.js +62 -0
  10. package/dist/chunks/{compose-sprfv38c.js → compose-34cqydxc.js} +4 -4
  11. package/dist/chunks/{compose-ee0h1pk1.js → compose-3qkhfwtd.js} +4 -4
  12. package/dist/chunks/{compose-yr19b453.js → compose-4jqwbez4.js} +7 -7
  13. package/dist/chunks/{compose-5rg7askh.js → compose-4krv4vzw.js} +13 -5
  14. package/dist/chunks/{compose-byse0eqj.js → compose-4s0c5zqv.js} +6 -6
  15. package/dist/chunks/{compose-gj2ypr7q.js → compose-5ygdrc65.js} +3 -3
  16. package/dist/chunks/{compose-csh5vv2t.js → compose-6e9ktyhr.js} +1 -1
  17. package/dist/chunks/{compose-dbsn3bsy.js → compose-6zgf2dtw.js} +6 -3
  18. package/dist/chunks/{compose-ht1tbyr3.js → compose-75pnchkk.js} +22 -10
  19. package/dist/chunks/{compose-vzvm76dn.js → compose-79h43be5.js} +13 -5
  20. package/dist/chunks/compose-7bpnxft1.js +20 -0
  21. package/dist/chunks/{compose-jwy1gba9.js → compose-7sjf0y70.js} +3 -3
  22. package/dist/chunks/{compose-1tdb9ezw.js → compose-8nysak5a.js} +33 -22
  23. package/dist/chunks/{compose-ay7t13m9.js → compose-8p6emvvh.js} +8 -8
  24. package/dist/chunks/{compose-e3635qmn.js → compose-8ranx653.js} +17 -2
  25. package/dist/chunks/{compose-5njywhy8.js → compose-9tntshv3.js} +6 -6
  26. package/dist/chunks/{compose-gvm49f4b.js → compose-b10qcn9b.js} +1 -1
  27. package/dist/chunks/{compose-42egt9y7.js → compose-b4zb2rpb.js} +21 -12
  28. package/dist/chunks/{compose-767bb340.js → compose-c7jk6qr1.js} +1 -1
  29. package/dist/chunks/{compose-hfsn6pnt.js → compose-chcqk093.js} +39 -17
  30. package/dist/chunks/{compose-nw5hdpxk.js → compose-ct1h40fd.js} +8 -8
  31. package/dist/chunks/{compose-smsafpqe.js → compose-d5yhtpa7.js} +2 -2
  32. package/dist/chunks/{compose-qxfq6dn9.js → compose-d95420jw.js} +8 -8
  33. package/dist/chunks/{compose-gxjc6vz9.js → compose-dw8fvn94.js} +4 -2
  34. package/dist/chunks/{compose-fnncnk81.js → compose-dywbt4he.js} +5 -5
  35. package/dist/chunks/{compose-xvbyp65f.js → compose-gnfmty38.js} +30 -10
  36. package/dist/chunks/{compose-mdwr0er9.js → compose-h0d0vess.js} +4 -4
  37. package/dist/chunks/{compose-2gsbcjgv.js → compose-hf0nrd46.js} +22 -18
  38. package/dist/chunks/{compose-mcz93154.js → compose-ht5fhzzw.js} +10 -10
  39. package/dist/chunks/{compose-8pp3vtv0.js → compose-hx8j2kef.js} +4 -4
  40. package/dist/chunks/{compose-c4z4kp98.js → compose-j8xmyfy6.js} +118 -42
  41. package/dist/chunks/{compose-9jvn2wvh.js → compose-jawbhn7q.js} +21 -5
  42. package/dist/chunks/{compose-2rha31fc.js → compose-jbrtw0md.js} +4 -4
  43. package/dist/chunks/{compose-m01wspwf.js → compose-jrxg4vqg.js} +1 -1
  44. package/dist/chunks/{compose-bz70g01d.js → compose-kf2k4hq5.js} +5 -5
  45. package/dist/chunks/{compose-w6zb11k1.js → compose-kgdmzx0n.js} +6 -6
  46. package/dist/chunks/{compose-qjxtbzgq.js → compose-krkyrds4.js} +11 -5
  47. package/dist/chunks/{compose-tppkp915.js → compose-kw3bf8mf.js} +4 -4
  48. package/dist/chunks/{compose-d95fwwvw.js → compose-kwbs1f34.js} +2 -2
  49. package/dist/chunks/{compose-j42p9wfs.js → compose-n29d5dzv.js} +1 -1
  50. package/dist/chunks/{compose-qwbe95qs.js → compose-n5f6w2y6.js} +1 -1
  51. package/dist/chunks/{compose-a7k9h27z.js → compose-nc60858y.js} +4 -4
  52. package/dist/chunks/{compose-6r5ymwyr.js → compose-nenmmq5w.js} +30 -10
  53. package/dist/chunks/{compose-enq3x3rq.js → compose-p7j0gt4t.js} +22 -7
  54. package/dist/chunks/compose-pb3420v8.js +74 -0
  55. package/dist/chunks/{compose-ts08bth2.js → compose-pcfvksb2.js} +1 -1
  56. package/dist/chunks/{compose-917xy085.js → compose-pjkzf9ev.js} +9 -9
  57. package/dist/chunks/{compose-c9wxgbjp.js → compose-prek5sd9.js} +2 -2
  58. package/dist/chunks/{compose-h14pmqv3.js → compose-qgz6q016.js} +1 -1
  59. package/dist/chunks/{compose-y6xgbg2h.js → compose-qq85vkhf.js} +1 -1
  60. package/dist/chunks/{compose-bd8c5n7k.js → compose-qyjchprv.js} +2 -2
  61. package/dist/chunks/{compose-97y00axn.js → compose-rh1d2g0s.js} +30 -16
  62. package/dist/chunks/compose-s23st6q6.js +4 -0
  63. package/dist/chunks/{compose-bbhk8vnr.js → compose-s4kyfjj6.js} +2 -2
  64. package/dist/chunks/{compose-t9fcqtby.js → compose-sjfbxw65.js} +93 -85
  65. package/dist/chunks/{compose-a40dnhy5.js → compose-vphbntyn.js} +7 -7
  66. package/dist/chunks/compose-vxme67gg.js +63 -0
  67. package/dist/chunks/compose-wgs4rgfp.js +32 -0
  68. package/dist/chunks/{compose-1xn3eecn.js → compose-xdq54csy.js} +39 -35
  69. package/dist/chunks/{compose-v46qmh60.js → compose-yd5t8qj3.js} +63 -126
  70. package/dist/chunks/{compose-vn7b7fdj.js → compose-ydth4n0z.js} +7 -3
  71. package/dist/chunks/{compose-6gt28900.js → compose-yxhvzsed.js} +4 -4
  72. package/dist/chunks/{compose-matk94se.js → compose-zajq79k0.js} +6 -6
  73. package/dist/chunks/{compose-ae5t6v5b.js → compose-zq7ar8qm.js} +4 -4
  74. package/dist/chunks/{compose-4ppmas7g.js → compose-zt2qtrxj.js} +4 -4
  75. package/dist/chunks/compose-ztyjpn84.js +59 -0
  76. package/dist/chunks/{compose-m91ffwss.js → compose-zv0t13e7.js} +2 -2
  77. package/dist/chunks/{compose-r8tz1xfj.js → compose-zx78edb2.js} +9 -5
  78. package/dist/src/agent/agent-loop.d.ts +4 -0
  79. package/dist/src/agent/agent-loop.js +3 -1
  80. package/dist/src/agent/compaction.js +38 -37
  81. package/dist/src/agent/open-parts.d.ts +34 -0
  82. package/dist/src/agent/open-parts.js +22 -0
  83. package/dist/src/agent/request.js +27 -26
  84. package/dist/src/agent/tool-runner.d.ts +5 -5
  85. package/dist/src/agent/tool-runner.js +31 -30
  86. package/dist/src/agent/transcript.js +34 -33
  87. package/dist/src/agent/turn.js +48 -43
  88. package/dist/src/api/connection.js +61 -56
  89. package/dist/src/api/head.d.ts +1 -2
  90. package/dist/src/api/head.js +43 -39
  91. package/dist/src/api/hold.d.ts +7 -0
  92. package/dist/src/api/hold.js +7 -0
  93. package/dist/src/api/part.js +20 -18
  94. package/dist/src/api/server.js +48 -45
  95. package/dist/src/api/session.js +48 -44
  96. package/dist/src/builtins/delegation.js +1 -1
  97. package/dist/src/builtins/environment.d.ts +8 -0
  98. package/dist/src/builtins/environment.js +3 -1
  99. package/dist/src/builtins/interruptions.d.ts +4 -0
  100. package/dist/src/builtins/interruptions.js +8 -0
  101. package/dist/src/compose.js +75 -68
  102. package/dist/src/contract/host.d.ts +6 -0
  103. package/dist/src/contract/kernel.d.ts +9 -6
  104. package/dist/src/contract/parts.d.ts +48 -46
  105. package/dist/src/contract/records.d.ts +429 -419
  106. package/dist/src/contract/records.js +1 -1
  107. package/dist/src/contract/server.d.ts +3 -1
  108. package/dist/src/contract/session.d.ts +31 -1
  109. package/dist/src/contract/session.js +6 -0
  110. package/dist/src/contract/workspace.d.ts +3 -1
  111. package/dist/src/drive/execution.js +44 -43
  112. package/dist/src/drive/interruptions.d.ts +10 -2
  113. package/dist/src/drive/interruptions.js +9 -5
  114. package/dist/src/drive/pause.d.ts +11 -0
  115. package/dist/src/drive/pause.js +10 -0
  116. package/dist/src/engine/admission-writes.d.ts +22 -0
  117. package/dist/src/engine/admission-writes.js +15 -0
  118. package/dist/src/engine/admission.d.ts +15 -1
  119. package/dist/src/engine/admission.js +25 -20
  120. package/dist/src/engine/batches.js +18 -18
  121. package/dist/src/engine/branch-summary.js +17 -17
  122. package/dist/src/engine/durable.js +17 -17
  123. package/dist/src/engine/fence.js +16 -16
  124. package/dist/src/engine/holds.d.ts +4 -0
  125. package/dist/src/engine/holds.js +43 -0
  126. package/dist/src/engine/jobs.js +24 -23
  127. package/dist/src/engine/lease.d.ts +5 -4
  128. package/dist/src/engine/lease.js +1 -1
  129. package/dist/src/engine/move.js +19 -19
  130. package/dist/src/engine/presence.js +2 -2
  131. package/dist/src/engine/principals.js +14 -14
  132. package/dist/src/engine/receipts.js +17 -17
  133. package/dist/src/engine/runs.js +22 -21
  134. package/dist/src/engine/start.js +34 -33
  135. package/dist/src/engine/surface.js +3 -3
  136. package/dist/src/engine/waits.js +15 -15
  137. package/dist/src/env/browser.js +25 -24
  138. package/dist/src/env/environment.js +27 -26
  139. package/dist/src/env/mcp.js +29 -28
  140. package/dist/src/env/session-changes.js +3 -3
  141. package/dist/src/env/trust.js +28 -27
  142. package/dist/src/env/workspaces.js +32 -31
  143. package/dist/src/env/worktrees.js +33 -32
  144. package/dist/src/extend/activation.d.ts +3 -0
  145. package/dist/src/extend/activation.js +35 -32
  146. package/dist/src/extend/hooks.js +19 -19
  147. package/dist/src/extend/models.js +26 -25
  148. package/dist/src/extend/plugin-api.js +14 -14
  149. package/dist/src/extend/plugin-runtime.d.ts +3 -1
  150. package/dist/src/extend/plugin-runtime.js +39 -38
  151. package/dist/src/extend/registry.js +24 -23
  152. package/dist/src/extend/resources.js +29 -28
  153. package/dist/src/extend/setting-layers.js +3 -3
  154. package/dist/src/extend/settings.js +36 -35
  155. package/dist/src/extend/workspace-commands.js +40 -39
  156. package/dist/src/fold/calls.js +4 -4
  157. package/dist/src/fold/checkpoint.js +9 -9
  158. package/dist/src/fold/code.d.ts +1 -1
  159. package/dist/src/fold/code.js +1 -1
  160. package/dist/src/fold/commit.js +13 -13
  161. package/dist/src/fold/draft.d.ts +37 -37
  162. package/dist/src/fold/draft.js +3 -3
  163. package/dist/src/fold/fold.js +6 -6
  164. package/dist/src/fold/paths.js +4 -4
  165. package/dist/src/fold/project.d.ts +2 -2
  166. package/dist/src/fold/project.js +6 -6
  167. package/dist/src/fold/reads.js +3 -3
  168. package/dist/src/fold/seen.d.ts +3 -5
  169. package/dist/src/fold/seen.js +17 -17
  170. package/dist/src/fold/view.d.ts +7 -1
  171. package/dist/src/fold/view.js +8 -23
  172. package/dist/src/fold/watch.js +12 -12
  173. package/dist/src/harness.d.ts +257 -257
  174. package/dist/src/harness.js +78 -71
  175. package/dist/src/index.d.ts +3 -1
  176. package/dist/src/index.js +13 -3
  177. package/dist/src/server.js +73 -66
  178. package/dist/src/store/inspect.js +3 -3
  179. package/dist/src/store/memory-store.js +3 -3
  180. package/dist/src/store/migrations.js +2 -2
  181. package/dist/src/store/model-state.js +2 -2
  182. package/dist/src/store/parts.js +3 -3
  183. package/dist/src/store/session-index.js +2 -2
  184. package/dist/src/store/session.js +2 -2
  185. package/dist/src/store.js +5 -5
  186. package/dist/src/testing.js +76 -69
  187. package/dist/src/util/line-diff.d.ts +5 -5
  188. package/package.json +4 -5
  189. package/dist/chunks/compose-hfrjm4a1.js +0 -88
@@ -45,39 +45,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
45
45
  SOFTWARE.
46
46
  ```
47
47
 
48
- ## pi-claude-code (`earendil-works/pi-claude-code`)
49
-
50
- - Repository: https://github.com/earendil-works/pi-claude-code
51
- - What: the Claude Code CLI provider, single-turn relay, transcript replay,
52
- process reuse, and billing guards in `packages/plugin/examples/claude-code`
53
- are adapted from commit `70abb65186592ca788b29b3db22c3160d629c41f`.
54
-
55
- License: MIT, with the following notice:
56
-
57
- ```text
58
- MIT License
59
-
60
- Copyright (c) 2026 Armin Ronacher
61
-
62
- Permission is hereby granted, free of charge, to any person obtaining a copy
63
- of this software and associated documentation files (the "Software"), to deal
64
- in the Software without restriction, including without limitation the rights
65
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
66
- copies of the Software, and to permit persons to whom the Software is
67
- furnished to do so, subject to the following conditions:
68
-
69
- The above copyright notice and this permission notice shall be included in all
70
- copies or substantial portions of the Software.
71
-
72
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
73
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
74
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
75
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
76
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
77
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
78
- SOFTWARE.
79
- ```
80
-
81
48
  ## pi (`earendil-works/pi`)
82
49
 
83
50
  - Repository: https://github.com/earendil-works/pi
@@ -345,8 +312,8 @@ Copyright 2025 OpenAI
345
312
  front of the queue (`packages/tui/src/model/interactions.ts`) is its
346
313
  `onEmptySubmit`. The rename
347
314
  plugin's context construction, prompt, model fallback, and output cleanup
348
- (`packages/plugin/examples/rename.ts`) port OpenCode v2. The web-search
349
- plugin set (`packages/plugin/examples/web-search/`) ports its Exa, Firecrawl,
315
+ (`packages/plugin/src/rename.ts`) port OpenCode v2. The web-search
316
+ plugin set (`packages/plugin/src/web-search.ts`) ports its Exa, Firecrawl,
350
317
  Parallel, and Tavily adapters, its stateless MCP `tools/call` transport and
351
318
  response bounds, its result and error vocabulary, and its arrangement of one
352
319
  plugin per provider from OpenCode v2.
@@ -429,9 +396,6 @@ SOFTWARE.
429
396
  bypass, and connection tuning in `packages/host/src/sqlite*.ts` are adapted
430
397
  from `bf8ffe81a63c82d3de5fbaa9991fd5f30034a452`.
431
398
  - Homepage: https://t3.codes
432
- - What: the demo desktop app (`packages/demo/desktop`) follows T3 Code's
433
- control-surface shape — agents in a sidebar, a conversation workspace, a
434
- shared composer, and settings behind a dialog.
435
399
 
436
400
  License: MIT, with the following notice:
437
401
 
@@ -2,7 +2,7 @@ import {
2
2
  envelope2,
3
3
  decodeRunRecord2,
4
4
  decodeCallRecord2
5
- } from "./compose-gxjc6vz9.js";
5
+ } from "./compose-dw8fvn94.js";
6
6
  import {
7
7
  objectId2
8
8
  } from "./compose-q6c7wswc.js";
@@ -2,7 +2,7 @@ import {
2
2
  liveRuns2,
3
3
  threadStart2,
4
4
  listSessionRecords2
5
- } from "./compose-vn7b7fdj.js";
5
+ } from "./compose-ydth4n0z.js";
6
6
 
7
7
  // src/env/session-changes.ts
8
8
  import { asSeq } from "@nyte-ai/schema";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./compose-5z835ej2.js";
4
4
  import {
5
5
  readSession2
6
- } from "./compose-vn7b7fdj.js";
6
+ } from "./compose-ydth4n0z.js";
7
7
 
8
8
  // src/fold/reads.ts
9
9
  async function withFold2(kernel, session, read) {
@@ -3,7 +3,7 @@ import {
3
3
  } from "./compose-5z835ej2.js";
4
4
  import {
5
5
  decodeJobRecord2
6
- } from "./compose-gxjc6vz9.js";
6
+ } from "./compose-dw8fvn94.js";
7
7
  import {
8
8
  JOBS2,
9
9
  jobRef2
@@ -16,28 +16,28 @@ import {
16
16
  load2,
17
17
  readSession2,
18
18
  put2
19
- } from "./compose-vn7b7fdj.js";
19
+ } from "./compose-ydth4n0z.js";
20
20
  import {
21
21
  followedTrace2,
22
22
  traceparent2
23
23
  } from "./compose-sd0stm97.js";
24
24
  import {
25
25
  commit2
26
- } from "./compose-bbhk8vnr.js";
26
+ } from "./compose-s4kyfjj6.js";
27
27
  import {
28
28
  closable2
29
29
  } from "./compose-zfjxkavf.js";
30
30
  import {
31
31
  readJob2,
32
32
  waitFor2
33
- } from "./compose-bz70g01d.js";
33
+ } from "./compose-kf2k4hq5.js";
34
34
  import {
35
35
  send2
36
- } from "./compose-t9fcqtby.js";
36
+ } from "./compose-sjfbxw65.js";
37
37
  import {
38
38
  recordAcquisition2,
39
39
  recordedAcquisition2
40
- } from "./compose-byse0eqj.js";
40
+ } from "./compose-4s0c5zqv.js";
41
41
 
42
42
  // src/engine/jobs.ts
43
43
  import { asId, asSeq, foldJobChange, SdkError } from "@nyte-ai/schema";
@@ -0,0 +1,154 @@
1
+ import {
2
+ check2
3
+ } from "./compose-bj54tkph.js";
4
+ import {
5
+ text2,
6
+ thinking2
7
+ } from "./compose-fqsqjbrf.js";
8
+ import {
9
+ decodePartRecord2
10
+ } from "./compose-dw8fvn94.js";
11
+ import {
12
+ partRef2
13
+ } from "./compose-cqpjcx2t.js";
14
+ import {
15
+ load2,
16
+ readTip2,
17
+ readRefExpectation2,
18
+ put2
19
+ } from "./compose-ydth4n0z.js";
20
+ import {
21
+ settling2
22
+ } from "./compose-kwbs1f34.js";
23
+
24
+ // src/agent/open-parts.ts
25
+ var ABORTED2 = { class: "aborted", message: "The run was stopped." };
26
+ async function settledParts2(context, opened) {
27
+ const { kernel, session, head } = context;
28
+ if (opened.length === 0)
29
+ return [];
30
+ const [found, tip] = await Promise.all([
31
+ Promise.all(opened.map(async (entry) => ({ entry, found: await readPart(context, entry) }))),
32
+ readTip2(kernel.store, session, head)
33
+ ]);
34
+ const at = Date.now();
35
+ const updates = [];
36
+ let parent = tip.id;
37
+ for (const { entry, found: part } of found) {
38
+ if (part === null || part.record.status.kind === "settled")
39
+ continue;
40
+ if (part.record.status.kind !== "live") {
41
+ updates.push(...await keep(context, entry, part, ABORTED2));
42
+ continue;
43
+ }
44
+ const state = buildPartState(entry);
45
+ const version = Math.max(part.record.version, entry.version) + 1;
46
+ const landed = await settling2(kernel.store, {
47
+ session,
48
+ head,
49
+ run: part.record.run,
50
+ parent,
51
+ expect: parent === tip.id ? readRefExpectation2(tip.ref) : undefined,
52
+ record: { ...part.record, state, version },
53
+ revision: part.ref.revision,
54
+ logged: [{ head, kind: "part", part: entry.part, change: "updated", state, version }],
55
+ body: { kind: "part", part: entry.part },
56
+ at
57
+ });
58
+ updates.push(...landed.updates);
59
+ parent = landed.landed;
60
+ }
61
+ return updates;
62
+ }
63
+ function buildPartState(entry) {
64
+ if (entry.kind === "text")
65
+ return { markdown: entry.markdown, signature: entry.textSignature };
66
+ return {
67
+ markdown: entry.markdown,
68
+ merged: entry.merged,
69
+ signature: entry.thoughts.some((thought) => thought.signature !== null || thought.redacted) ? entry.thoughts.map((thought) => ({ ...thought })) : null
70
+ };
71
+ }
72
+ async function readPart(context, entry) {
73
+ const { kernel, session } = context;
74
+ return load2(kernel.store, await kernel.store.refs.get(partRef2(session, entry.part)), decodePartRecord2);
75
+ }
76
+ async function keep(context, entry, found, failure) {
77
+ const { kernel, session, head } = context;
78
+ const { record } = found;
79
+ const name = partRef2(session, entry.part);
80
+ const part = entry.part;
81
+ const state = buildPartState(entry);
82
+ const version = Math.max(record.version, entry.version) + 1;
83
+ const live = record.status.kind === "live" || record.status.kind === "waiting";
84
+ const status = live ? { kind: "failed", run: record.run, failure } : record.status;
85
+ const target = await put2(kernel.store, "part", { ...record, state, version, status });
86
+ return [
87
+ {
88
+ name,
89
+ target,
90
+ expect: found.ref.revision,
91
+ events: [{ head, kind: "part", part, change: "updated", state, version }]
92
+ },
93
+ ...live ? [
94
+ {
95
+ name,
96
+ target,
97
+ events: [{ head, kind: "part", part, change: "failed", failure }]
98
+ }
99
+ ] : []
100
+ ];
101
+ }
102
+ async function keepOpen2(context, opened, failure) {
103
+ const kept = await Promise.all(opened.map(async (entry) => {
104
+ const found = await readPart(context, entry);
105
+ return found === null || found.record.status.kind === "settled" ? [] : keep(context, entry, found, failure);
106
+ }));
107
+ return kept.flat();
108
+ }
109
+ async function savedOpen2(context, opened) {
110
+ const { kernel, session, head } = context;
111
+ const saved = await Promise.all(opened.map(async (entry) => {
112
+ const found = await readPart(context, entry);
113
+ if (found === null || found.record.status.kind !== "live")
114
+ return [];
115
+ const state = buildPartState(entry);
116
+ const version = Math.max(found.record.version, entry.version) + 1;
117
+ const part = entry.part;
118
+ return [
119
+ {
120
+ name: partRef2(session, part),
121
+ target: await put2(kernel.store, "part", { ...found.record, state, version }),
122
+ expect: found.ref.revision,
123
+ events: [{ head, kind: "part", part, change: "updated", state, version }]
124
+ }
125
+ ];
126
+ }));
127
+ return saved.flat();
128
+ }
129
+ async function adopt2(part) {
130
+ const adopted = {
131
+ part: part.id,
132
+ version: part.version,
133
+ textSignature: null,
134
+ thoughts: []
135
+ };
136
+ if (part.partKind === "text") {
137
+ const saved = await check2(text2.state, part.state);
138
+ return {
139
+ ...adopted,
140
+ kind: "text",
141
+ markdown: saved.kind === "valid" ? saved.value.markdown : "",
142
+ merged: 1
143
+ };
144
+ }
145
+ const saved = await check2(thinking2.state, part.state);
146
+ return {
147
+ ...adopted,
148
+ kind: "thinking",
149
+ markdown: saved.kind === "valid" ? saved.value.markdown : "",
150
+ merged: saved.kind === "valid" ? saved.value.merged : 1
151
+ };
152
+ }
153
+
154
+ export { ABORTED2, settledParts2, keepOpen2, savedOpen2, adopt2 };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  decodeRunRecord2
3
- } from "./compose-gxjc6vz9.js";
3
+ } from "./compose-dw8fvn94.js";
4
4
  import {
5
5
  parseHeadRef2,
6
6
  headRef2,
@@ -12,10 +12,10 @@ import {
12
12
  import {
13
13
  EMPTY_REVISION2,
14
14
  load2
15
- } from "./compose-vn7b7fdj.js";
15
+ } from "./compose-ydth4n0z.js";
16
16
  import {
17
17
  settleAnswersFrom2
18
- } from "./compose-d95fwwvw.js";
18
+ } from "./compose-kwbs1f34.js";
19
19
  import {
20
20
  collectSessionEvents2
21
21
  } from "./compose-kwkna3cg.js";
@@ -27,13 +27,13 @@ import {
27
27
  import {
28
28
  emptyFold2,
29
29
  fold2
30
- } from "./compose-6gt28900.js";
30
+ } from "./compose-yxhvzsed.js";
31
31
  import {
32
32
  foldCheckpointing2
33
- } from "./compose-a7k9h27z.js";
33
+ } from "./compose-nc60858y.js";
34
34
  import {
35
35
  withPair2
36
- } from "./compose-6r5ymwyr.js";
36
+ } from "./compose-nenmmq5w.js";
37
37
 
38
38
  // src/fold/watch.ts
39
39
  import { asId, asSeq, isJsonObject } from "@nyte-ai/schema";
@@ -6,14 +6,14 @@ import {
6
6
  } from "./compose-n116fnmp.js";
7
7
  import {
8
8
  readCall2
9
- } from "./compose-vn7b7fdj.js";
9
+ } from "./compose-ydth4n0z.js";
10
10
  import {
11
11
  signalsPark2,
12
12
  runStep2
13
- } from "./compose-byse0eqj.js";
13
+ } from "./compose-4s0c5zqv.js";
14
14
  import {
15
15
  stepPluginApi2
16
- } from "./compose-c9wxgbjp.js";
16
+ } from "./compose-prek5sd9.js";
17
17
 
18
18
  // src/extend/hooks.ts
19
19
  import { compile, JsonType, SdkError, SubmissionType, withJson } from "@nyte-ai/schema";
@@ -0,0 +1,62 @@
1
+ import {
2
+ inboxRef2,
3
+ receiptRef2
4
+ } from "./compose-cqpjcx2t.js";
5
+ import {
6
+ inboxWithout2,
7
+ readRefExpectation2,
8
+ put2
9
+ } from "./compose-ydth4n0z.js";
10
+
11
+ // src/engine/admission-writes.ts
12
+ function buildMessage2(id, submission, placed) {
13
+ return {
14
+ id,
15
+ at: Date.now(),
16
+ content: submission.content,
17
+ source: submission.source,
18
+ delivery: submission.delivery,
19
+ ...placed
20
+ };
21
+ }
22
+ async function admitted2(kernel, session, head, inbox, messages, message) {
23
+ const input = message.source.kind === "user" && message.delivery !== "attach";
24
+ const pendingInput = [
25
+ ...inbox.pendingInput.filter((id) => id !== message.id),
26
+ ...input ? [message.id] : []
27
+ ];
28
+ return {
29
+ name: inboxRef2(session, head),
30
+ target: await put2(kernel.store, "inbox", {
31
+ ...inboxWithout2(inbox, []),
32
+ messages,
33
+ pendingInput
34
+ }),
35
+ expect: readRefExpectation2(inbox.ref),
36
+ events: [
37
+ {
38
+ head,
39
+ kind: "input",
40
+ message: message.id,
41
+ change: "admitted",
42
+ content: message.content,
43
+ source: message.source,
44
+ delivery: message.delivery,
45
+ schedule: message.schedule,
46
+ covered: message.covered,
47
+ configuration: message.configuration,
48
+ replaced: message.replaced,
49
+ requires: [...kernel.presence?.member.capabilities ?? []]
50
+ }
51
+ ]
52
+ };
53
+ }
54
+ async function pendingReceipt2(store, session, id, digest, expect) {
55
+ return {
56
+ name: receiptRef2(session, id),
57
+ target: await put2(store, "receipt", { id, kind: "send", digest, outcome: null }),
58
+ expect
59
+ };
60
+ }
61
+
62
+ export { buildMessage2, admitted2, pendingReceipt2 };
@@ -3,7 +3,7 @@ import {
3
3
  } from "./compose-5z835ej2.js";
4
4
  import {
5
5
  decodeRunRecord2
6
- } from "./compose-gxjc6vz9.js";
6
+ } from "./compose-dw8fvn94.js";
7
7
  import {
8
8
  sessionRef2,
9
9
  runRef2
@@ -17,7 +17,7 @@ import {
17
17
  requireSession2,
18
18
  put2,
19
19
  attempt2
20
- } from "./compose-vn7b7fdj.js";
20
+ } from "./compose-ydth4n0z.js";
21
21
  import {
22
22
  convertJsonSchema2,
23
23
  check2
@@ -28,11 +28,11 @@ import {
28
28
  } from "./compose-84272xbk.js";
29
29
  import {
30
30
  commit2
31
- } from "./compose-bbhk8vnr.js";
31
+ } from "./compose-s4kyfjj6.js";
32
32
  import {
33
33
  modelInfo2,
34
34
  withLimits2
35
- } from "./compose-mdwr0er9.js";
35
+ } from "./compose-h0d0vess.js";
36
36
 
37
37
  // src/agent/request.ts
38
38
  import { contentText } from "@nyte-ai/schema/model";
@@ -11,19 +11,19 @@ import {
11
11
  STALE2,
12
12
  put2,
13
13
  attempt2
14
- } from "./compose-vn7b7fdj.js";
14
+ } from "./compose-ydth4n0z.js";
15
15
  import {
16
16
  commit2
17
- } from "./compose-bbhk8vnr.js";
17
+ } from "./compose-s4kyfjj6.js";
18
18
  import {
19
19
  readWorkspace2,
20
20
  workspaceRecords2
21
- } from "./compose-4ppmas7g.js";
21
+ } from "./compose-zt2qtrxj.js";
22
22
  import {
23
23
  sessionsOn2,
24
24
  byIdentity2,
25
25
  changed2
26
- } from "./compose-917xy085.js";
26
+ } from "./compose-pjkzf9ev.js";
27
27
 
28
28
  // src/env/worktrees.ts
29
29
  import { asId, SdkError } from "@nyte-ai/schema";
@@ -1,28 +1,28 @@
1
1
  import {
2
2
  readWorkspace2
3
- } from "./compose-4ppmas7g.js";
3
+ } from "./compose-zt2qtrxj.js";
4
4
  import {
5
5
  scanWorkspaceResources2
6
- } from "./compose-c4z4kp98.js";
6
+ } from "./compose-j8xmyfy6.js";
7
7
  import {
8
8
  newChatPlugins2
9
- } from "./compose-ht1tbyr3.js";
9
+ } from "./compose-75pnchkk.js";
10
10
  import {
11
11
  createHookDispatch2
12
- } from "./compose-jeemzja1.js";
12
+ } from "./compose-1nqjy2z5.js";
13
13
  import {
14
14
  createRegistrySet2,
15
15
  skillInfos2,
16
16
  commandInfos2,
17
17
  invokeCommand2,
18
18
  completeCommand2
19
- } from "./compose-ae5t6v5b.js";
19
+ } from "./compose-zq7ar8qm.js";
20
20
  import {
21
21
  settingHandle2
22
- } from "./compose-a40dnhy5.js";
22
+ } from "./compose-vphbntyn.js";
23
23
  import {
24
24
  activateApart2
25
- } from "./compose-42egt9y7.js";
25
+ } from "./compose-b4zb2rpb.js";
26
26
 
27
27
  // src/extend/workspace-commands.ts
28
28
  import { asId, SdkError } from "@nyte-ai/schema";
@@ -12,7 +12,10 @@ import {
12
12
  import {
13
13
  liveRun3,
14
14
  put2
15
- } from "./compose-vn7b7fdj.js";
15
+ } from "./compose-ydth4n0z.js";
16
+ import {
17
+ withFold2
18
+ } from "./compose-122g5jvb.js";
16
19
 
17
20
  // src/drive/interruptions.ts
18
21
  var RESTART_LIMIT2 = 5;
@@ -25,12 +28,14 @@ function parkedFailure2(record) {
25
28
  message: `Stopped after Nyte was interrupted ${String(record.interrupted?.count ?? RESTART_LIMIT2)} times while working on this, with no progress in between. Send a message to continue.`
26
29
  };
27
30
  }
28
- async function interruption2(kernel, session, head) {
31
+ async function interruption2(kernel, session, head, foreign) {
29
32
  const live = await liveRun3(kernel.store, session, head);
30
33
  if (live === null || kernel.executionState.driving.has(live.record.view.id))
31
34
  return [];
32
35
  const run = live.record.view.id;
33
- const mark = await progressMark(kernel.store, session, head, run);
36
+ if (!foreign && !await responseCut(kernel, session, run))
37
+ return [];
38
+ const mark = await progressMark2(kernel.store, session, head, run);
34
39
  const count = live.record.interrupted?.mark === mark ? live.record.interrupted.count + 1 : 1;
35
40
  dev2("execution", "interrupted", { session, head, run, count });
36
41
  return [
@@ -41,7 +46,10 @@ async function interruption2(kernel, session, head) {
41
46
  }
42
47
  ];
43
48
  }
44
- async function progressMark(store, session, head, run) {
49
+ function responseCut(kernel, session, run) {
50
+ return withFold2(kernel, session, (state) => [...state.parts.values()].some((part) => part.run === run && part.status.kind === "live" && (part.partKind === "text" || part.partKind === "thinking")));
51
+ }
52
+ async function progressMark2(store, session, head, run) {
45
53
  const [tip, calls] = await Promise.all([
46
54
  store.refs.get(headRef2(session, head)),
47
55
  store.refs.list(runCallsPrefix2(session, run))
@@ -49,4 +57,4 @@ async function progressMark(store, session, head, run) {
49
57
  return objectId2([tip?.revision ?? null, ...calls.map((ref) => `${ref.name}@${ref.revision}`)]);
50
58
  }
51
59
 
52
- export { RESTART_LIMIT2, crashLooping2, parkedFailure2, interruption2 };
60
+ export { RESTART_LIMIT2, crashLooping2, parkedFailure2, interruption2, progressMark2 };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  decodePartRecord2
3
- } from "./compose-gxjc6vz9.js";
3
+ } from "./compose-dw8fvn94.js";
4
4
  import {
5
5
  partRef2
6
6
  } from "./compose-cqpjcx2t.js";
@@ -11,26 +11,26 @@ import {
11
11
  load2,
12
12
  put2,
13
13
  readCall2
14
- } from "./compose-vn7b7fdj.js";
14
+ } from "./compose-ydth4n0z.js";
15
15
  import {
16
16
  storedAnswer2
17
- } from "./compose-d95fwwvw.js";
17
+ } from "./compose-kwbs1f34.js";
18
18
  import {
19
19
  waitIndex2,
20
20
  wokenIndex2
21
21
  } from "./compose-0wq555bd.js";
22
22
  import {
23
23
  changeCall2
24
- } from "./compose-bbhk8vnr.js";
24
+ } from "./compose-s4kyfjj6.js";
25
25
  import {
26
26
  holdLease2
27
- } from "./compose-vzvm76dn.js";
27
+ } from "./compose-79h43be5.js";
28
28
  import {
29
29
  runWait2,
30
30
  readParkedWait2,
31
31
  waitingOn2,
32
32
  lapsed2
33
- } from "./compose-bz70g01d.js";
33
+ } from "./compose-kf2k4hq5.js";
34
34
 
35
35
  // src/engine/durable.ts
36
36
  import { isJson, isJsonObject, SdkError } from "@nyte-ai/schema";
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  requireSession2
3
- } from "./compose-vn7b7fdj.js";
3
+ } from "./compose-ydth4n0z.js";
4
4
  import {
5
5
  forwarded2
6
6
  } from "./compose-zfjxkavf.js";
7
7
  import {
8
8
  readWorkspace2
9
- } from "./compose-4ppmas7g.js";
9
+ } from "./compose-zt2qtrxj.js";
10
10
  import {
11
11
  projectTrust2
12
- } from "./compose-8pp3vtv0.js";
12
+ } from "./compose-hx8j2kef.js";
13
13
 
14
14
  // src/env/mcp.ts
15
15
  import { SdkError } from "@nyte-ai/schema";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  decodeKvValue2
3
- } from "./compose-gxjc6vz9.js";
3
+ } from "./compose-dw8fvn94.js";
4
4
  import {
5
5
  kvRef2
6
6
  } from "./compose-cqpjcx2t.js";
@@ -4,14 +4,14 @@ import {
4
4
  import {
5
5
  walkCommitPath2,
6
6
  readPositionCommit2
7
- } from "./compose-vn7b7fdj.js";
7
+ } from "./compose-ydth4n0z.js";
8
8
  import {
9
9
  committed2,
10
10
  setTurn2,
11
11
  stale2,
12
12
  reuse2,
13
13
  toPartMessageId2
14
- } from "./compose-h14pmqv3.js";
14
+ } from "./compose-qgz6q016.js";
15
15
 
16
16
  // src/fold/paths.ts
17
17
  function finish2(state, draft) {
@@ -152,7 +152,10 @@ function reflowTurns(draft, path, from) {
152
152
  path.turnAt.delete(info.id);
153
153
  }
154
154
  for (let position = from;position < path.messages.length; position += 1) {
155
- const turn = draft.turns.get(path.messages[position].turn);
155
+ const message = path.messages[position];
156
+ if (message.kind === "user" && message.status.kind !== "landed")
157
+ continue;
158
+ const turn = draft.turns.get(message.turn);
156
159
  if (turn === undefined || path.turnAt.has(turn.info.id))
157
160
  continue;
158
161
  path.turnAt.set(turn.info.id, path.turns.length);