@nyte-ai/core 0.0.18 → 0.0.21

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 (186) hide show
  1. package/README.md +1 -1
  2. package/THIRD-PARTY-NOTICES.md +66 -0
  3. package/dist/chunks/{compose-yk3y0jap.js → compose-0m65m83c.js} +7 -7
  4. package/dist/chunks/{compose-r12cnkpc.js → compose-12jnd50a.js} +11 -11
  5. package/dist/chunks/{compose-q1n2dgrs.js → compose-1knxqqm1.js} +4 -4
  6. package/dist/chunks/{compose-xtkavyrw.js → compose-1r0wr5dc.js} +17 -9
  7. package/dist/chunks/{compose-9tqm6g18.js → compose-2rha31fc.js} +4 -4
  8. package/dist/chunks/{compose-0bpspysf.js → compose-4ppmas7g.js} +5 -5
  9. package/dist/chunks/compose-5rg7askh.js +52 -0
  10. package/dist/chunks/{compose-mryw0674.js → compose-5z835ej2.js} +6 -1
  11. package/dist/chunks/{compose-7k6nsmtq.js → compose-6gt28900.js} +11 -14
  12. package/dist/chunks/{compose-2eg8w67t.js → compose-6r5ymwyr.js} +15 -4
  13. package/dist/chunks/{compose-xd0kdp3t.js → compose-753gc057.js} +8 -8
  14. package/dist/chunks/{compose-q1ts0v6k.js → compose-767bb340.js} +1 -1
  15. package/dist/chunks/{compose-rpq9n0nz.js → compose-8mkfr84d.js} +89 -32
  16. package/dist/chunks/{compose-5w5bbakh.js → compose-8pp3vtv0.js} +5 -5
  17. package/dist/chunks/{compose-gaps3heh.js → compose-9hy3p236.js} +9 -9
  18. package/dist/chunks/{compose-pgeemk2b.js → compose-a7k9h27z.js} +6 -5
  19. package/dist/chunks/{compose-dc2ns6gd.js → compose-a8ddt55n.js} +10 -10
  20. package/dist/chunks/{compose-7b8ajk7a.js → compose-ad80nkkn.js} +8 -8
  21. package/dist/chunks/{compose-064y3n82.js → compose-ae5t6v5b.js} +5 -5
  22. package/dist/chunks/{compose-amr0k1m1.js → compose-b2bf1jvy.js} +122 -41
  23. package/dist/chunks/{compose-xpfr4wt3.js → compose-bbhk8vnr.js} +7 -4
  24. package/dist/chunks/compose-bd8c5n7k.js +32 -0
  25. package/dist/chunks/{compose-rehp8epe.js → compose-byse0eqj.js} +7 -7
  26. package/dist/chunks/{compose-ef936rsa.js → compose-bz70g01d.js} +27 -11
  27. package/dist/chunks/compose-c4238qkb.js +105 -0
  28. package/dist/chunks/{compose-q1b0tppc.js → compose-c9wxgbjp.js} +4 -4
  29. package/dist/chunks/{compose-h272znxk.js → compose-cdj05t7x.js} +7 -7
  30. package/dist/chunks/{compose-kb22bkpt.js → compose-cqpjcx2t.js} +12 -1
  31. package/dist/chunks/{compose-dbx6ftbm.js → compose-csh5vv2t.js} +42 -4
  32. package/dist/chunks/{compose-eqr5qwp1.js → compose-d1m94kzq.js} +62 -22
  33. package/dist/chunks/{compose-drdej9yt.js → compose-d95fwwvw.js} +4 -4
  34. package/dist/chunks/{compose-jc22rsz4.js → compose-dbsn3bsy.js} +2 -2
  35. package/dist/chunks/{compose-s2aew2c9.js → compose-e2fyz3xc.js} +5 -5
  36. package/dist/chunks/{compose-gg8b9b21.js → compose-e9f6nrwp.js} +23 -18
  37. package/dist/chunks/{compose-52afaf3v.js → compose-fnncnk81.js} +7 -7
  38. package/dist/chunks/{compose-bjx8s01m.js → compose-fqsqjbrf.js} +1 -1
  39. package/dist/chunks/{compose-1gd9vkye.js → compose-gj2ypr7q.js} +3 -3
  40. package/dist/chunks/compose-gvm49f4b.js +155 -0
  41. package/dist/chunks/{compose-1jz2j92f.js → compose-gxjc6vz9.js} +30 -2
  42. package/dist/chunks/{compose-cq1zx4gp.js → compose-h14pmqv3.js} +1 -1
  43. package/dist/chunks/{compose-d2s80zg2.js → compose-hfrjm4a1.js} +5 -5
  44. package/dist/chunks/{compose-kmzr06mw.js → compose-hfsn6pnt.js} +8 -5
  45. package/dist/chunks/{compose-jjchxce6.js → compose-j42p9wfs.js} +1 -1
  46. package/dist/chunks/{compose-4b1zf3p0.js → compose-jd4bsnqh.js} +63 -47
  47. package/dist/chunks/{compose-2g3enfv5.js → compose-jeemzja1.js} +4 -4
  48. package/dist/chunks/{compose-y478gv6x.js → compose-jmmyw9hd.js} +4 -4
  49. package/dist/chunks/{compose-5tkyrzr0.js → compose-jwy1gba9.js} +4 -4
  50. package/dist/chunks/{compose-k35b75k9.js → compose-kwkna3cg.js} +2 -4
  51. package/dist/chunks/{compose-t53j8yxv.js → compose-m01wspwf.js} +1 -1
  52. package/dist/chunks/{compose-n93897b0.js → compose-m91ffwss.js} +1 -1
  53. package/dist/chunks/{compose-madtxnp1.js → compose-matk94se.js} +7 -7
  54. package/dist/chunks/{compose-aa73dbe8.js → compose-mcz93154.js} +117 -58
  55. package/dist/chunks/{compose-r7dx7rpz.js → compose-mdwr0er9.js} +72 -15
  56. package/dist/chunks/{compose-j12n448k.js → compose-nj4nj5n9.js} +36 -3
  57. package/dist/chunks/{compose-yn2et568.js → compose-nkxwrphm.js} +141 -15
  58. package/dist/chunks/{compose-k8aghhv2.js → compose-pkprmn5b.js} +16 -16
  59. package/dist/chunks/{compose-1z7q169s.js → compose-q2zxbg41.js} +69 -41
  60. package/dist/chunks/{compose-b5xz0dj7.js → compose-qwbe95qs.js} +2 -2
  61. package/dist/chunks/{compose-vmhv4e00.js → compose-qxfq6dn9.js} +13 -12
  62. package/dist/chunks/{compose-wgphshsn.js → compose-r8tz1xfj.js} +8 -8
  63. package/dist/chunks/{compose-ffk8dnbh.js → compose-smsafpqe.js} +3 -3
  64. package/dist/chunks/{compose-djq2bt61.js → compose-sprfv38c.js} +6 -6
  65. package/dist/chunks/{compose-cdy4q5mv.js → compose-t9fcqtby.js} +17 -16
  66. package/dist/chunks/{compose-p3q14yt1.js → compose-tppkp915.js} +5 -5
  67. package/dist/chunks/{compose-dckpgtks.js → compose-ts08bth2.js} +3 -3
  68. package/dist/chunks/{compose-n10w4nkk.js → compose-vn7b7fdj.js} +12 -3
  69. package/dist/chunks/{compose-9m19b27b.js → compose-w6zb11k1.js} +7 -7
  70. package/dist/chunks/{compose-j3tkz0tb.js → compose-wvzzf8n2.js} +6 -6
  71. package/dist/chunks/{compose-6vf6dkk2.js → compose-xhtgytrh.js} +2 -2
  72. package/dist/chunks/{compose-4tb2vn84.js → compose-y6xgbg2h.js} +1 -1
  73. package/dist/chunks/compose-yfcb6w2h.js +58 -0
  74. package/dist/chunks/{compose-0rx7ygxq.js → compose-zaanjpb7.js} +1 -1
  75. package/dist/chunks/{compose-7pc3p5ex.js → compose-zjj072km.js} +8 -8
  76. package/dist/src/agent/compaction.js +41 -39
  77. package/dist/src/agent/images.d.ts +7 -0
  78. package/dist/src/agent/images.js +8 -0
  79. package/dist/src/agent/request.js +30 -30
  80. package/dist/src/agent/tool-runner.d.ts +3 -7
  81. package/dist/src/agent/tool-runner.js +34 -30
  82. package/dist/src/agent/transcript.d.ts +0 -1
  83. package/dist/src/agent/transcript.js +37 -35
  84. package/dist/src/agent/turn.js +46 -43
  85. package/dist/src/api/connection.js +60 -56
  86. package/dist/src/api/head.js +42 -41
  87. package/dist/src/api/part.js +22 -22
  88. package/dist/src/api/server.js +48 -44
  89. package/dist/src/api/session.js +48 -47
  90. package/dist/src/builtins/delegation.js +2 -2
  91. package/dist/src/builtins/environment.js +1 -2
  92. package/dist/src/compose.d.ts +6 -7
  93. package/dist/src/compose.js +72 -67
  94. package/dist/src/contract/fold.d.ts +1 -3
  95. package/dist/src/contract/host.d.ts +30 -1
  96. package/dist/src/contract/host.js +4 -2
  97. package/dist/src/contract/kernel.d.ts +6 -35
  98. package/dist/src/contract/parts.d.ts +4 -0
  99. package/dist/src/contract/parts.js +1 -1
  100. package/dist/src/contract/records.d.ts +69 -3
  101. package/dist/src/contract/records.js +5 -1
  102. package/dist/src/contract/session.d.ts +2 -1
  103. package/dist/src/contract/tools.d.ts +10 -1
  104. package/dist/src/contract/workspace.d.ts +7 -3
  105. package/dist/src/drive/execution.js +46 -42
  106. package/dist/src/drive/interruptions.d.ts +7 -0
  107. package/dist/src/drive/interruptions.js +17 -0
  108. package/dist/src/engine/admission.js +24 -24
  109. package/dist/src/engine/batches.js +22 -22
  110. package/dist/src/engine/branch-summary.js +21 -21
  111. package/dist/src/engine/durable.d.ts +0 -2
  112. package/dist/src/engine/durable.js +20 -20
  113. package/dist/src/engine/fence.js +20 -20
  114. package/dist/src/engine/jobs.d.ts +2 -0
  115. package/dist/src/engine/jobs.js +31 -27
  116. package/dist/src/engine/move.js +23 -23
  117. package/dist/src/engine/part-definitions.js +2 -2
  118. package/dist/src/engine/presence.d.ts +39 -0
  119. package/dist/src/engine/presence.js +16 -0
  120. package/dist/src/engine/principals.js +17 -17
  121. package/dist/src/engine/receipts.js +21 -21
  122. package/dist/src/engine/runs.d.ts +1 -1
  123. package/dist/src/engine/runs.js +25 -25
  124. package/dist/src/engine/start.js +36 -35
  125. package/dist/src/engine/surface.d.ts +4 -0
  126. package/dist/src/engine/surface.js +13 -0
  127. package/dist/src/engine/waits.d.ts +5 -15
  128. package/dist/src/engine/waits.js +23 -19
  129. package/dist/src/env/browser.js +27 -27
  130. package/dist/src/env/environment.js +29 -29
  131. package/dist/src/env/mcp.js +31 -31
  132. package/dist/src/env/session-changes.d.ts +10 -0
  133. package/dist/src/env/session-changes.js +15 -0
  134. package/dist/src/env/trust.js +30 -30
  135. package/dist/src/env/workspaces.js +34 -33
  136. package/dist/src/env/worktrees.js +35 -34
  137. package/dist/src/extend/activation.js +35 -34
  138. package/dist/src/extend/hooks.js +22 -22
  139. package/dist/src/extend/models.d.ts +2 -1
  140. package/dist/src/extend/models.js +32 -30
  141. package/dist/src/extend/plugin-api.js +18 -18
  142. package/dist/src/extend/plugin-runtime.js +42 -41
  143. package/dist/src/extend/registry.js +27 -27
  144. package/dist/src/extend/resources.js +31 -31
  145. package/dist/src/extend/setting-layers.js +4 -4
  146. package/dist/src/extend/settings.js +38 -37
  147. package/dist/src/extend/workspace-commands.js +43 -42
  148. package/dist/src/fold/calls.js +5 -5
  149. package/dist/src/fold/checkpoint.js +11 -11
  150. package/dist/src/fold/code.d.ts +1 -2
  151. package/dist/src/fold/code.js +1 -1
  152. package/dist/src/fold/commit.d.ts +0 -4
  153. package/dist/src/fold/commit.js +16 -16
  154. package/dist/src/fold/draft.js +4 -4
  155. package/dist/src/fold/fold.js +7 -7
  156. package/dist/src/fold/paths.js +5 -5
  157. package/dist/src/fold/project.d.ts +3 -1
  158. package/dist/src/fold/project.js +8 -6
  159. package/dist/src/fold/reads.js +5 -5
  160. package/dist/src/fold/seen.js +19 -19
  161. package/dist/src/fold/view.d.ts +1 -1
  162. package/dist/src/fold/view.js +20 -20
  163. package/dist/src/fold/watch.js +15 -15
  164. package/dist/src/harness.d.ts +3 -1
  165. package/dist/src/harness.js +75 -70
  166. package/dist/src/index.d.ts +3 -3
  167. package/dist/src/index.js +5 -3
  168. package/dist/src/server.js +70 -65
  169. package/dist/src/store/inspect.js +4 -4
  170. package/dist/src/store/log.d.ts +0 -2
  171. package/dist/src/store/log.js +2 -2
  172. package/dist/src/store/memory-store.js +5 -5
  173. package/dist/src/store/migrations.js +3 -3
  174. package/dist/src/store/model-state.d.ts +6 -1
  175. package/dist/src/store/model-state.js +14 -4
  176. package/dist/src/store/parts.js +5 -5
  177. package/dist/src/store/refs.d.ts +6 -5
  178. package/dist/src/store/refs.js +11 -1
  179. package/dist/src/store/session-index.js +2 -2
  180. package/dist/src/store/session.d.ts +3 -1
  181. package/dist/src/store/session.js +5 -3
  182. package/dist/src/store.d.ts +1 -1
  183. package/dist/src/store.js +11 -7
  184. package/dist/src/testing.d.ts +2 -0
  185. package/dist/src/testing.js +83 -70
  186. package/package.json +4 -4
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Core owns durable session state and execution. `composeHost` (`@nyte-ai/core/server`) builds a host from a `Store`, the `@nyte-ai/ai` models, core plugins and a default workspace; [host](../host/README.md)'s `openHost`, which the sdk's Node `sdk.open` is, calls it with what a machine supplies. Clients do not import core: they use `@nyte-ai/sdk`, whose types are core's and schema's.
4
4
 
5
- The package has four entries: [src/index.ts](src/index.ts) (`.`), the client and plugin contract; [src/store.ts](src/store.ts) (`./store`), the store-backend SPI host's stores implement; [src/server.ts](src/server.ts) (`./server`), composition and the `ServerHost` port a listener serves a composed host through; and [src/testing.ts](src/testing.ts) (`./testing`), the kernel under a composed host, the steps the tests of other packages drive by hand and the scripted-turn harness ([src/harness.ts](src/harness.ts)) core's own tests share, outside the SDK contract. Each export's JSDoc is its contract, and the surface it implements is the baseline in [packages/lab/sdk-shape.ts](../lab/sdk-shape.ts).
5
+ The package has four entries: [src/index.ts](src/index.ts) (`.`), the client and plugin contract; [src/store.ts](src/store.ts) (`./store`), the store-backend SPI host's stores implement; [src/server.ts](src/server.ts) (`./server`), composition and the `ServerHost` port a listener serves a composed host through; and [src/testing.ts](src/testing.ts) (`./testing`), the kernel under a composed host, the steps the tests of other packages drive by hand and the scripted-turn harness ([src/harness.ts](src/harness.ts)) core's own tests share, outside the SDK contract.
6
6
 
7
7
  A store is two primitives: immutable content-addressed objects, written before any publish, and refs, the only mutable state, published as one all-or-nothing `refs.set` batch. `memoryStore` (`./store`) is the in-process one; sqlite, postgres and Durable Object storage live in host. A head's `watch()` folds the session into one `SessionView` per change, and the sdk folds the wire's deltas with the same code, so no client derives what the view carries.
8
8
 
@@ -91,6 +91,9 @@ SOFTWARE.
91
91
  - Transcript reconciliation, checkpoint instruction snapshots, provider system
92
92
  updates, and cache warming are ported from the 1.0.0 release commit
93
93
  `a13d35a742c6ef8462812a28fbe1d8c8b7431c32`.
94
+ - Fitting images to model limits (`packages/core/src/agent/images.ts` and
95
+ `packages/host/src/images`) is ported from `@earendil-works/pi-durable`'s
96
+ images at commit `73f8de80bc87021375f8b525292ac07492253002`.
94
97
 
95
98
  License: MIT, with the following notice:
96
99
 
@@ -148,6 +151,16 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
148
151
  THE SOFTWARE.
149
152
  ```
150
153
 
154
+ ## Photon (`silvia-odwyer/photon`)
155
+
156
+ - Repository: https://github.com/silvia-odwyer/photon
157
+ - Package: `@silvia-odwyer/photon` 0.3.3
158
+ - What: the host decodes, orients, scales and re-encodes images for the model
159
+ with Photon's WebAssembly build.
160
+
161
+ License: Apache License 2.0, reproduced in the appendix below. Copyright 2023
162
+ Silvia O'Dwyer.
163
+
151
164
  ## Pierre
152
165
 
153
166
  - Repository: https://github.com/pierrecomputer/pierre
@@ -561,6 +574,59 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
561
574
  SOFTWARE.
562
575
  ```
563
576
 
577
+ ## snapcn (`snapcndev/snapcn`)
578
+
579
+ - Repository: https://github.com/snapcndev/snapcn
580
+ - What: the launch film's Logo Flicker and Check Cycle scenes
581
+ (`packages/lab/video/src/snap-cn/`) are adapted from snapcn's registry
582
+ components at commit `47ee435f17d85f74abf48b095b40d64fc9616fb0`.
583
+
584
+ License: MIT, with the following notice:
585
+
586
+ ```text
587
+ MIT License
588
+
589
+ Copyright (c) 2026 Sri Nath (snap-cn)
590
+
591
+ Permission is hereby granted, free of charge, to any person obtaining a copy
592
+ of this software and associated documentation files (the "Software"), to deal
593
+ in the Software without restriction, including without limitation the rights
594
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
595
+ copies of the Software, and to permit persons to whom the Software is
596
+ furnished to do so, subject to the following conditions:
597
+
598
+ The above copyright notice and this permission notice shall be included in all
599
+ copies or substantial portions of the Software.
600
+
601
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
602
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
603
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
604
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
605
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
606
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
607
+ SOFTWARE.
608
+ ```
609
+
610
+ ## Naybr, "Copyright Free Gameplay (No Commentary) - Minecraft Survival"
611
+
612
+ - Source: https://www.youtube.com/watch?v=GPsGyv5zTlM, by Naybr (youtube.com/@Naybr)
613
+ - What: the launch film opens on four shots from 0:30 to 2:30 of this video
614
+ (`clip` in `packages/lab/video/src/film/media.ts`). The footage is not in
615
+ the repository; `packages/lab/video/README.md` says how to fetch it.
616
+
617
+ License: Creative Commons Attribution, as published on YouTube. The author
618
+ allows use, modification, redistribution and monetisation, with this credit
619
+ wherever the gameplay is used: "Gameplay – youtube.com/@Naybr".
620
+
621
+ ## Photographs in the launch film
622
+
623
+ - Source: Wikimedia Commons; each file's author and source page are listed in
624
+ `photos` in `packages/lab/video/src/film/media.ts`.
625
+ - What: eleven photographs the launch film cuts between. They are not in the
626
+ repository.
627
+
628
+ License: every one is public domain or CC0. None requires attribution.
629
+
564
630
  ## Design references
565
631
 
566
632
  These credits record design sources. They do not grant a license to the
@@ -1,28 +1,28 @@
1
1
  import {
2
2
  readWorkspace2
3
- } from "./compose-0bpspysf.js";
3
+ } from "./compose-4ppmas7g.js";
4
4
  import {
5
5
  scanWorkspaceResources2
6
- } from "./compose-y478gv6x.js";
6
+ } from "./compose-jmmyw9hd.js";
7
7
  import {
8
8
  newChatPlugins2
9
- } from "./compose-q1n2dgrs.js";
9
+ } from "./compose-1knxqqm1.js";
10
10
  import {
11
11
  createHookDispatch2
12
- } from "./compose-2g3enfv5.js";
12
+ } from "./compose-jeemzja1.js";
13
13
  import {
14
14
  createRegistrySet2,
15
15
  skillInfos2,
16
16
  commandInfos2,
17
17
  invokeCommand2,
18
18
  completeCommand2
19
- } from "./compose-064y3n82.js";
19
+ } from "./compose-ae5t6v5b.js";
20
20
  import {
21
21
  settingHandle2
22
- } from "./compose-xd0kdp3t.js";
22
+ } from "./compose-753gc057.js";
23
23
  import {
24
24
  activateApart2
25
- } from "./compose-gaps3heh.js";
25
+ } from "./compose-9hy3p236.js";
26
26
 
27
27
  // src/extend/workspace-commands.ts
28
28
  import { asId, SdkError } from "@nyte-ai/schema";
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  LOCAL2
3
- } from "./compose-mryw0674.js";
3
+ } from "./compose-5z835ej2.js";
4
4
  import {
5
5
  check2
6
6
  } from "./compose-bj54tkph.js";
7
7
  import {
8
8
  compaction2
9
- } from "./compose-bjx8s01m.js";
9
+ } from "./compose-fqsqjbrf.js";
10
10
  import {
11
11
  decodeRunRecord2,
12
12
  decodePartRecord2
13
- } from "./compose-1jz2j92f.js";
13
+ } from "./compose-gxjc6vz9.js";
14
14
  import {
15
15
  collectContributions2
16
16
  } from "./compose-66009v9f.js";
@@ -19,7 +19,7 @@ import {
19
19
  headRef2,
20
20
  runRef2,
21
21
  partRef2
22
- } from "./compose-kb22bkpt.js";
22
+ } from "./compose-cqpjcx2t.js";
23
23
  import {
24
24
  dev2
25
25
  } from "./compose-n116fnmp.js";
@@ -35,23 +35,23 @@ import {
35
35
  walkCommitPath2,
36
36
  readPositionCommit2,
37
37
  toCommitObjectId2
38
- } from "./compose-n10w4nkk.js";
38
+ } from "./compose-vn7b7fdj.js";
39
39
  import {
40
40
  settling2,
41
41
  failedParts2
42
- } from "./compose-drdej9yt.js";
42
+ } from "./compose-d95fwwvw.js";
43
43
  import {
44
44
  ZERO_USAGE2
45
45
  } from "./compose-84272xbk.js";
46
46
  import {
47
47
  commit2
48
- } from "./compose-xpfr4wt3.js";
48
+ } from "./compose-bbhk8vnr.js";
49
49
  import {
50
50
  withFold2
51
- } from "./compose-6vf6dkk2.js";
51
+ } from "./compose-xhtgytrh.js";
52
52
  import {
53
53
  modelInfo2
54
- } from "./compose-r7dx7rpz.js";
54
+ } from "./compose-mdwr0er9.js";
55
55
  import {
56
56
  extractUserText2
57
57
  } from "./compose-rxsqmcgq.js";
@@ -60,12 +60,12 @@ import {
60
60
  requestEvent2,
61
61
  rideRef2,
62
62
  complete2
63
- } from "./compose-djq2bt61.js";
63
+ } from "./compose-sprfv38c.js";
64
64
  import {
65
65
  projectedCommit2,
66
66
  requestBody2,
67
67
  estimateTranscriptTokens2
68
- } from "./compose-4b1zf3p0.js";
68
+ } from "./compose-jd4bsnqh.js";
69
69
 
70
70
  // src/agent/compaction.ts
71
71
  import { asId, isJsonObject, SdkError } from "@nyte-ai/schema";
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  requireSession2,
3
3
  coveredHere2
4
- } from "./compose-n10w4nkk.js";
4
+ } from "./compose-vn7b7fdj.js";
5
5
  import {
6
6
  UnavailableError2,
7
7
  readWorkspace2
8
- } from "./compose-0bpspysf.js";
8
+ } from "./compose-4ppmas7g.js";
9
9
  import {
10
10
  projectTrust2
11
- } from "./compose-5w5bbakh.js";
11
+ } from "./compose-8pp3vtv0.js";
12
12
  import {
13
13
  settle2
14
- } from "./compose-eqr5qwp1.js";
14
+ } from "./compose-d1m94kzq.js";
15
15
 
16
16
  // src/extend/activation.ts
17
17
  var ACTIVE = { kind: "active" };
@@ -1,7 +1,10 @@
1
+ import {
2
+ CORE_CONTEXT2
3
+ } from "./compose-5z835ej2.js";
1
4
  import {
2
5
  sessionRef2,
3
6
  headRef2
4
- } from "./compose-kb22bkpt.js";
7
+ } from "./compose-cqpjcx2t.js";
5
8
  import {
6
9
  MAIN2,
7
10
  EMPTY_REVISION2,
@@ -20,30 +23,30 @@ import {
20
23
  toCommitObjectId2,
21
24
  readCommit2,
22
25
  sessionEvent2
23
- } from "./compose-n10w4nkk.js";
26
+ } from "./compose-vn7b7fdj.js";
24
27
  import {
25
28
  commit2
26
- } from "./compose-xpfr4wt3.js";
29
+ } from "./compose-bbhk8vnr.js";
27
30
  import {
28
31
  withFold2
29
- } from "./compose-6vf6dkk2.js";
32
+ } from "./compose-xhtgytrh.js";
30
33
  import {
31
34
  send2
32
- } from "./compose-cdy4q5mv.js";
35
+ } from "./compose-t9fcqtby.js";
33
36
  import {
34
37
  move2
35
- } from "./compose-madtxnp1.js";
38
+ } from "./compose-matk94se.js";
36
39
  import {
37
40
  watchStore2
38
41
  } from "./compose-zfjxkavf.js";
39
42
  import {
40
43
  configure2
41
- } from "./compose-xd0kdp3t.js";
44
+ } from "./compose-753gc057.js";
42
45
  import {
43
46
  watchHead2,
44
47
  viewHead2,
45
48
  historyHead2
46
- } from "./compose-kmzr06mw.js";
49
+ } from "./compose-hfsn6pnt.js";
47
50
  import {
48
51
  extractUserText2
49
52
  } from "./compose-rxsqmcgq.js";
@@ -58,7 +61,12 @@ function headHandle2(kernel, context, session, head, admit = send2) {
58
61
  sessionId: session,
59
62
  name: head,
60
63
  send: (content, options) => admit(kernel, { session, head, context, content, options }),
61
- configure: (patch) => configure2(kernel, session, head, patch),
64
+ async configure(patch) {
65
+ const outcome = await configure2(kernel, session, head, patch);
66
+ if (outcome.kind === "configured" && context !== CORE_CONTEXT2 && context.origin === null && context.authority.has("owner") && (patch.model !== undefined || patch.thinking !== undefined))
67
+ await kernel.rememberChoice(outcome.selected, patch.model === undefined ? "thinking" : "model");
68
+ return outcome;
69
+ },
62
70
  view: (options) => viewHead2(kernel, { session, head, principal, options }),
63
71
  watch,
64
72
  ...watchStore2(() => watch()),
@@ -4,17 +4,17 @@ import {
4
4
  } from "./compose-q6c7wswc.js";
5
5
  import {
6
6
  readReceipt2
7
- } from "./compose-n10w4nkk.js";
7
+ } from "./compose-vn7b7fdj.js";
8
8
  import {
9
9
  writeReceipt2
10
- } from "./compose-xpfr4wt3.js";
10
+ } from "./compose-bbhk8vnr.js";
11
11
  import {
12
12
  waitFor2
13
- } from "./compose-ef936rsa.js";
13
+ } from "./compose-bz70g01d.js";
14
14
  import {
15
15
  settleReceipt2,
16
16
  typedReceipt2
17
- } from "./compose-52afaf3v.js";
17
+ } from "./compose-fnncnk81.js";
18
18
 
19
19
  // src/engine/batches.ts
20
20
  import { asId, SdkError } from "@nyte-ai/schema";
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  decodeWorkspaceRecord2
3
- } from "./compose-1jz2j92f.js";
3
+ } from "./compose-gxjc6vz9.js";
4
4
  import {
5
5
  workspaceRef2
6
- } from "./compose-kb22bkpt.js";
6
+ } from "./compose-cqpjcx2t.js";
7
7
  import {
8
8
  load2,
9
9
  requireSession2
10
- } from "./compose-n10w4nkk.js";
10
+ } from "./compose-vn7b7fdj.js";
11
11
  import {
12
12
  applyBatch2
13
- } from "./compose-9tqm6g18.js";
13
+ } from "./compose-2rha31fc.js";
14
14
  import {
15
15
  wrapBrowser2
16
- } from "./compose-t53j8yxv.js";
16
+ } from "./compose-m01wspwf.js";
17
17
 
18
18
  // src/env/environment.ts
19
19
  import { SdkError } from "@nyte-ai/schema";
@@ -0,0 +1,52 @@
1
+ import {
2
+ objectId2
3
+ } from "./compose-q6c7wswc.js";
4
+ import {
5
+ headRef2,
6
+ runRef2,
7
+ runCallsPrefix2
8
+ } from "./compose-cqpjcx2t.js";
9
+ import {
10
+ dev2
11
+ } from "./compose-n116fnmp.js";
12
+ import {
13
+ liveRun3,
14
+ put2
15
+ } from "./compose-vn7b7fdj.js";
16
+
17
+ // src/drive/interruptions.ts
18
+ var RESTART_LIMIT2 = 5;
19
+ function crashLooping2(record) {
20
+ return (record.interrupted?.count ?? 0) >= RESTART_LIMIT2;
21
+ }
22
+ function parkedFailure2(record) {
23
+ return {
24
+ class: "runner",
25
+ 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
+ };
27
+ }
28
+ async function interruption2(kernel, session, head) {
29
+ const live = await liveRun3(kernel.store, session, head);
30
+ if (live === null || kernel.executionState.driving.has(live.record.view.id))
31
+ return [];
32
+ const run = live.record.view.id;
33
+ const mark = await progressMark(kernel.store, session, head, run);
34
+ const count = live.record.interrupted?.mark === mark ? live.record.interrupted.count + 1 : 1;
35
+ dev2("execution", "interrupted", { session, head, run, count });
36
+ return [
37
+ {
38
+ name: runRef2(session, run),
39
+ target: await put2(kernel.store, "run", { ...live.record, interrupted: { count, mark } }),
40
+ expect: live.ref.revision
41
+ }
42
+ ];
43
+ }
44
+ async function progressMark(store, session, head, run) {
45
+ const [tip, calls] = await Promise.all([
46
+ store.refs.get(headRef2(session, head)),
47
+ store.refs.list(runCallsPrefix2(session, run))
48
+ ]);
49
+ return objectId2([tip?.revision ?? null, ...calls.map((ref) => `${ref.name}@${ref.revision}`)]);
50
+ }
51
+
52
+ export { RESTART_LIMIT2, crashLooping2, parkedFailure2, interruption2 };
@@ -15,5 +15,10 @@ var CORE_CONTEXT2 = {
15
15
  origin: null
16
16
  };
17
17
  var PARTICIPANT_AUTHORITY2 = new Set(["participant"]);
18
+ var IMAGE_LIMITS2 = {
19
+ maxWidth: 2000,
20
+ maxHeight: 2000,
21
+ maxBase64Bytes: 4.5 * 1024 * 1024
22
+ };
18
23
 
19
- export { LOCAL2, TOKEN2, ALL_AUTHORITY2, TOKEN_AUTHORITY2, CORE_CONTEXT2, PARTICIPANT_AUTHORITY2 };
24
+ export { LOCAL2, TOKEN2, ALL_AUTHORITY2, TOKEN_AUTHORITY2, CORE_CONTEXT2, PARTICIPANT_AUTHORITY2, IMAGE_LIMITS2 };
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  START2,
6
6
  readPositionCommit2
7
- } from "./compose-n10w4nkk.js";
7
+ } from "./compose-vn7b7fdj.js";
8
8
  import {
9
9
  IDLE2,
10
10
  WORKING2,
@@ -22,19 +22,23 @@ import {
22
22
  partView2,
23
23
  toPartMessageId2,
24
24
  pendingTurn2
25
- } from "./compose-cq1zx4gp.js";
25
+ } from "./compose-h14pmqv3.js";
26
26
  import {
27
27
  applyCall2,
28
28
  describeLiveActivity2
29
- } from "./compose-jjchxce6.js";
29
+ } from "./compose-j42p9wfs.js";
30
30
  import {
31
31
  finish2
32
- } from "./compose-jc22rsz4.js";
32
+ } from "./compose-dbsn3bsy.js";
33
33
 
34
34
  // src/fold/fold.ts
35
35
  import { asId, asSeq, isJsonObject } from "@nyte-ai/schema";
36
36
  var INACTIVE = { kind: "inactive" };
37
- var SINGLE = { index: 0, count: 1, ids: [] };
37
+ var SINGLE = {
38
+ index: 0,
39
+ count: 1,
40
+ ids: []
41
+ };
38
42
  var EMPTY_CATALOG2 = {
39
43
  commands: [],
40
44
  settings: [],
@@ -139,7 +143,7 @@ function apply(draft, event) {
139
143
  case "request":
140
144
  return eachHead(draft, event.head, (head) => ({ ...head, context: event.context }));
141
145
  case "changes":
142
- draft.changes = mergeChanges(draft.changes, event.files);
146
+ draft.changes = event.files;
143
147
  return;
144
148
  case "session":
145
149
  return applySession(draft, event);
@@ -339,6 +343,7 @@ function admit(draft, event) {
339
343
  covered: event.covered,
340
344
  configuration: event.configuration,
341
345
  replaced: event.replaced,
346
+ requires: event.requires ?? null,
342
347
  landed: null
343
348
  });
344
349
  setMessage2(draft, {
@@ -648,13 +653,5 @@ function sameTurnState(left, right) {
648
653
  return left.on === right.on;
649
654
  return left === right;
650
655
  }
651
- function mergeChanges(kept, files) {
652
- if (kept.length === 0)
653
- return files;
654
- const merged = new Map(kept.map((file) => [file.path, file]));
655
- for (const file of files)
656
- merged.set(file.path, file);
657
- return [...merged.values()];
658
- }
659
656
 
660
657
  export { EMPTY_CATALOG2, emptyFold2, fold2 };
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  START2,
6
6
  readPositionCommit2
7
- } from "./compose-n10w4nkk.js";
7
+ } from "./compose-vn7b7fdj.js";
8
8
  import {
9
9
  ZERO_USAGE2,
10
10
  addUsage2
@@ -13,7 +13,7 @@ import {
13
13
  snapshots2,
14
14
  emptyHead2,
15
15
  reuse2
16
- } from "./compose-cq1zx4gp.js";
16
+ } from "./compose-h14pmqv3.js";
17
17
 
18
18
  // src/fold/project.ts
19
19
  var DEFAULT_TAIL = 200;
@@ -35,13 +35,15 @@ function project2(state, head, options) {
35
35
  return cached;
36
36
  const messages = readMessageTail(folded.messages, tail);
37
37
  const turns = frozen(folded.turns);
38
+ const path = state[INDEX2].paths.get(head);
38
39
  const view = {
39
40
  revision: folded.revision,
40
41
  seq: state.seq,
41
42
  activation: state.activation,
42
43
  messages,
44
+ leadingPrompt: findLeadingPrompt2(path, folded.messages.length - messages.length),
43
45
  parts: state.partViews,
44
- turns: readTurnWindow(turns, state[INDEX2].paths.get(head), messages),
46
+ turns: readTurnWindow(turns, path, messages),
45
47
  usage: sumCompletedUsage(turns),
46
48
  execution: folded.info.execution,
47
49
  background: folded.background,
@@ -98,6 +100,15 @@ function readMessageTail(messages, tail) {
98
100
  tails.set(messages, known);
99
101
  return slice;
100
102
  }
103
+ function findLeadingPrompt2(path, start) {
104
+ const first = path?.messages[start];
105
+ if (path === undefined || first === undefined)
106
+ return null;
107
+ const prompt = path.turns[path.turnAt.get(first.turn) ?? -1]?.prompt ?? null;
108
+ const at = prompt === null ? undefined : path.at.get(prompt);
109
+ const message = at === undefined || at >= start ? undefined : path.messages[at];
110
+ return message?.kind === "user" ? message : null;
111
+ }
101
112
  function readTurnWindow(turns, path, messages) {
102
113
  if (path === undefined)
103
114
  return turns;
@@ -127,4 +138,4 @@ function frozen(turns) {
127
138
  return snapshot;
128
139
  }
129
140
 
130
- export { project2, readSeenCommit2, withPair2 };
141
+ export { project2, readSeenCommit2, withPair2, findLeadingPrompt2 };
@@ -5,7 +5,7 @@ import {
5
5
  sessionRef2,
6
6
  headRef2,
7
7
  kvRef2
8
- } from "./compose-kb22bkpt.js";
8
+ } from "./compose-cqpjcx2t.js";
9
9
  import {
10
10
  MAIN2,
11
11
  EMPTY_REVISION2,
@@ -13,31 +13,31 @@ import {
13
13
  requireSession2,
14
14
  put2,
15
15
  attempt2
16
- } from "./compose-n10w4nkk.js";
16
+ } from "./compose-vn7b7fdj.js";
17
17
  import {
18
18
  check2
19
19
  } from "./compose-bj54tkph.js";
20
20
  import {
21
21
  commit2
22
- } from "./compose-xpfr4wt3.js";
22
+ } from "./compose-bbhk8vnr.js";
23
23
  import {
24
24
  WORKSPACE_TRUST2
25
- } from "./compose-5w5bbakh.js";
25
+ } from "./compose-8pp3vtv0.js";
26
26
  import {
27
27
  SKILL_PATHS2,
28
28
  dropScans2
29
- } from "./compose-y478gv6x.js";
29
+ } from "./compose-jmmyw9hd.js";
30
30
  import {
31
31
  trustChanged2
32
- } from "./compose-eqr5qwp1.js";
32
+ } from "./compose-d1m94kzq.js";
33
33
  import {
34
34
  settingInfos2,
35
35
  readSettingLayers2,
36
36
  findSettingDefinition2
37
- } from "./compose-b5xz0dj7.js";
37
+ } from "./compose-qwbe95qs.js";
38
38
  import {
39
39
  publishCatalog2
40
- } from "./compose-064y3n82.js";
40
+ } from "./compose-ae5t6v5b.js";
41
41
 
42
42
  // src/extend/settings.ts
43
43
  import { isJson, SdkError } from "@nyte-ai/schema";
@@ -1,4 +1,4 @@
1
1
  // src/fold/code.ts
2
- var FOLD_CODE2 = "802c21993c8fb275";
2
+ var FOLD_CODE2 = "f7c07362f0a1942b";
3
3
 
4
4
  export { FOLD_CODE2 };