@nyte-ai/core 0.0.24 → 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.
- package/dist/chunks/{compose-nj4nj5n9.js → compose-0f9x3cjd.js} +1 -1
- package/dist/chunks/{compose-yfcb6w2h.js → compose-0zrwy7nk.js} +1 -1
- package/dist/chunks/{compose-xhtgytrh.js → compose-122g5jvb.js} +1 -1
- package/dist/chunks/{compose-nkxwrphm.js → compose-17xxey5y.js} +6 -6
- package/dist/chunks/compose-1hgkp0q6.js +154 -0
- package/dist/chunks/{compose-ad80nkkn.js → compose-1kvvrw50.js} +6 -6
- package/dist/chunks/{compose-jeemzja1.js → compose-1nqjy2z5.js} +3 -3
- package/dist/chunks/compose-2e84znn8.js +62 -0
- package/dist/chunks/{compose-sprfv38c.js → compose-34cqydxc.js} +4 -4
- package/dist/chunks/{compose-ee0h1pk1.js → compose-3qkhfwtd.js} +4 -4
- package/dist/chunks/{compose-yr19b453.js → compose-4jqwbez4.js} +7 -7
- package/dist/chunks/{compose-5rg7askh.js → compose-4krv4vzw.js} +13 -5
- package/dist/chunks/{compose-byse0eqj.js → compose-4s0c5zqv.js} +6 -6
- package/dist/chunks/{compose-gj2ypr7q.js → compose-5ygdrc65.js} +3 -3
- package/dist/chunks/{compose-csh5vv2t.js → compose-6e9ktyhr.js} +1 -1
- package/dist/chunks/{compose-dbsn3bsy.js → compose-6zgf2dtw.js} +6 -3
- package/dist/chunks/{compose-ht1tbyr3.js → compose-75pnchkk.js} +22 -10
- package/dist/chunks/{compose-vzvm76dn.js → compose-79h43be5.js} +13 -5
- package/dist/chunks/compose-7bpnxft1.js +20 -0
- package/dist/chunks/{compose-jwy1gba9.js → compose-7sjf0y70.js} +3 -3
- package/dist/chunks/{compose-1tdb9ezw.js → compose-8nysak5a.js} +33 -22
- package/dist/chunks/{compose-ay7t13m9.js → compose-8p6emvvh.js} +8 -8
- package/dist/chunks/{compose-e3635qmn.js → compose-8ranx653.js} +17 -2
- package/dist/chunks/{compose-5njywhy8.js → compose-9tntshv3.js} +6 -6
- package/dist/chunks/{compose-gvm49f4b.js → compose-b10qcn9b.js} +1 -1
- package/dist/chunks/{compose-42egt9y7.js → compose-b4zb2rpb.js} +21 -12
- package/dist/chunks/{compose-767bb340.js → compose-c7jk6qr1.js} +1 -1
- package/dist/chunks/{compose-hfsn6pnt.js → compose-chcqk093.js} +39 -17
- package/dist/chunks/{compose-nw5hdpxk.js → compose-ct1h40fd.js} +8 -8
- package/dist/chunks/{compose-smsafpqe.js → compose-d5yhtpa7.js} +2 -2
- package/dist/chunks/{compose-qxfq6dn9.js → compose-d95420jw.js} +8 -8
- package/dist/chunks/{compose-gxjc6vz9.js → compose-dw8fvn94.js} +4 -2
- package/dist/chunks/{compose-fnncnk81.js → compose-dywbt4he.js} +5 -5
- package/dist/chunks/{compose-xvbyp65f.js → compose-gnfmty38.js} +30 -10
- package/dist/chunks/{compose-mdwr0er9.js → compose-h0d0vess.js} +4 -4
- package/dist/chunks/{compose-2gsbcjgv.js → compose-hf0nrd46.js} +22 -18
- package/dist/chunks/{compose-mcz93154.js → compose-ht5fhzzw.js} +10 -10
- package/dist/chunks/{compose-8pp3vtv0.js → compose-hx8j2kef.js} +4 -4
- package/dist/chunks/{compose-c4z4kp98.js → compose-j8xmyfy6.js} +118 -42
- package/dist/chunks/{compose-9jvn2wvh.js → compose-jawbhn7q.js} +21 -5
- package/dist/chunks/{compose-2rha31fc.js → compose-jbrtw0md.js} +4 -4
- package/dist/chunks/{compose-m01wspwf.js → compose-jrxg4vqg.js} +1 -1
- package/dist/chunks/{compose-bz70g01d.js → compose-kf2k4hq5.js} +5 -5
- package/dist/chunks/{compose-w6zb11k1.js → compose-kgdmzx0n.js} +6 -6
- package/dist/chunks/{compose-qjxtbzgq.js → compose-krkyrds4.js} +11 -5
- package/dist/chunks/{compose-tppkp915.js → compose-kw3bf8mf.js} +4 -4
- package/dist/chunks/{compose-d95fwwvw.js → compose-kwbs1f34.js} +2 -2
- package/dist/chunks/{compose-j42p9wfs.js → compose-n29d5dzv.js} +1 -1
- package/dist/chunks/{compose-qwbe95qs.js → compose-n5f6w2y6.js} +1 -1
- package/dist/chunks/{compose-a7k9h27z.js → compose-nc60858y.js} +4 -4
- package/dist/chunks/{compose-6r5ymwyr.js → compose-nenmmq5w.js} +30 -10
- package/dist/chunks/{compose-enq3x3rq.js → compose-p7j0gt4t.js} +22 -7
- package/dist/chunks/compose-pb3420v8.js +74 -0
- package/dist/chunks/{compose-ts08bth2.js → compose-pcfvksb2.js} +1 -1
- package/dist/chunks/{compose-917xy085.js → compose-pjkzf9ev.js} +9 -9
- package/dist/chunks/{compose-c9wxgbjp.js → compose-prek5sd9.js} +2 -2
- package/dist/chunks/{compose-h14pmqv3.js → compose-qgz6q016.js} +1 -1
- package/dist/chunks/{compose-y6xgbg2h.js → compose-qq85vkhf.js} +1 -1
- package/dist/chunks/{compose-bd8c5n7k.js → compose-qyjchprv.js} +2 -2
- package/dist/chunks/{compose-97y00axn.js → compose-rh1d2g0s.js} +30 -16
- package/dist/chunks/compose-s23st6q6.js +4 -0
- package/dist/chunks/{compose-bbhk8vnr.js → compose-s4kyfjj6.js} +2 -2
- package/dist/chunks/{compose-t9fcqtby.js → compose-sjfbxw65.js} +93 -85
- package/dist/chunks/{compose-a40dnhy5.js → compose-vphbntyn.js} +7 -7
- package/dist/chunks/compose-vxme67gg.js +63 -0
- package/dist/chunks/compose-wgs4rgfp.js +32 -0
- package/dist/chunks/{compose-1xn3eecn.js → compose-xdq54csy.js} +39 -35
- package/dist/chunks/{compose-v46qmh60.js → compose-yd5t8qj3.js} +63 -126
- package/dist/chunks/{compose-vn7b7fdj.js → compose-ydth4n0z.js} +7 -3
- package/dist/chunks/{compose-6gt28900.js → compose-yxhvzsed.js} +4 -4
- package/dist/chunks/{compose-matk94se.js → compose-zajq79k0.js} +6 -6
- package/dist/chunks/{compose-ae5t6v5b.js → compose-zq7ar8qm.js} +4 -4
- package/dist/chunks/{compose-4ppmas7g.js → compose-zt2qtrxj.js} +4 -4
- package/dist/chunks/compose-ztyjpn84.js +59 -0
- package/dist/chunks/{compose-m91ffwss.js → compose-zv0t13e7.js} +2 -2
- package/dist/chunks/{compose-r8tz1xfj.js → compose-zx78edb2.js} +9 -5
- package/dist/src/agent/agent-loop.d.ts +4 -0
- package/dist/src/agent/agent-loop.js +3 -1
- package/dist/src/agent/compaction.js +38 -37
- package/dist/src/agent/open-parts.d.ts +34 -0
- package/dist/src/agent/open-parts.js +22 -0
- package/dist/src/agent/request.js +27 -26
- package/dist/src/agent/tool-runner.d.ts +5 -5
- package/dist/src/agent/tool-runner.js +31 -30
- package/dist/src/agent/transcript.js +34 -33
- package/dist/src/agent/turn.js +48 -43
- package/dist/src/api/connection.js +61 -56
- package/dist/src/api/head.d.ts +1 -2
- package/dist/src/api/head.js +43 -39
- package/dist/src/api/hold.d.ts +7 -0
- package/dist/src/api/hold.js +7 -0
- package/dist/src/api/part.js +20 -18
- package/dist/src/api/server.js +48 -45
- package/dist/src/api/session.js +48 -44
- package/dist/src/builtins/delegation.js +1 -1
- package/dist/src/builtins/environment.d.ts +8 -0
- package/dist/src/builtins/environment.js +3 -1
- package/dist/src/builtins/interruptions.d.ts +4 -0
- package/dist/src/builtins/interruptions.js +8 -0
- package/dist/src/compose.js +75 -68
- package/dist/src/contract/host.d.ts +6 -0
- package/dist/src/contract/kernel.d.ts +9 -6
- package/dist/src/contract/parts.d.ts +48 -46
- package/dist/src/contract/records.d.ts +429 -419
- package/dist/src/contract/records.js +1 -1
- package/dist/src/contract/server.d.ts +3 -1
- package/dist/src/contract/session.d.ts +31 -1
- package/dist/src/contract/session.js +6 -0
- package/dist/src/contract/workspace.d.ts +3 -1
- package/dist/src/drive/execution.js +44 -43
- package/dist/src/drive/interruptions.d.ts +10 -2
- package/dist/src/drive/interruptions.js +9 -5
- package/dist/src/drive/pause.d.ts +11 -0
- package/dist/src/drive/pause.js +10 -0
- package/dist/src/engine/admission-writes.d.ts +22 -0
- package/dist/src/engine/admission-writes.js +15 -0
- package/dist/src/engine/admission.d.ts +15 -1
- package/dist/src/engine/admission.js +25 -20
- package/dist/src/engine/batches.js +18 -18
- package/dist/src/engine/branch-summary.js +17 -17
- package/dist/src/engine/durable.js +17 -17
- package/dist/src/engine/fence.js +16 -16
- package/dist/src/engine/holds.d.ts +4 -0
- package/dist/src/engine/holds.js +43 -0
- package/dist/src/engine/jobs.js +24 -23
- package/dist/src/engine/lease.d.ts +5 -4
- package/dist/src/engine/lease.js +1 -1
- package/dist/src/engine/move.js +19 -19
- package/dist/src/engine/presence.js +2 -2
- package/dist/src/engine/principals.js +14 -14
- package/dist/src/engine/receipts.js +17 -17
- package/dist/src/engine/runs.js +22 -21
- package/dist/src/engine/start.js +34 -33
- package/dist/src/engine/surface.js +3 -3
- package/dist/src/engine/waits.js +15 -15
- package/dist/src/env/browser.js +25 -24
- package/dist/src/env/environment.js +27 -26
- package/dist/src/env/mcp.js +29 -28
- package/dist/src/env/session-changes.js +3 -3
- package/dist/src/env/trust.js +28 -27
- package/dist/src/env/workspaces.js +32 -31
- package/dist/src/env/worktrees.js +33 -32
- package/dist/src/extend/activation.d.ts +3 -0
- package/dist/src/extend/activation.js +35 -32
- package/dist/src/extend/hooks.js +19 -19
- package/dist/src/extend/models.js +26 -25
- package/dist/src/extend/plugin-api.js +14 -14
- package/dist/src/extend/plugin-runtime.d.ts +3 -1
- package/dist/src/extend/plugin-runtime.js +39 -38
- package/dist/src/extend/registry.js +24 -23
- package/dist/src/extend/resources.js +29 -28
- package/dist/src/extend/setting-layers.js +3 -3
- package/dist/src/extend/settings.js +36 -35
- package/dist/src/extend/workspace-commands.js +40 -39
- package/dist/src/fold/calls.js +4 -4
- package/dist/src/fold/checkpoint.js +9 -9
- package/dist/src/fold/code.d.ts +1 -1
- package/dist/src/fold/code.js +1 -1
- package/dist/src/fold/commit.js +13 -13
- package/dist/src/fold/draft.d.ts +37 -37
- package/dist/src/fold/draft.js +3 -3
- package/dist/src/fold/fold.js +6 -6
- package/dist/src/fold/paths.js +4 -4
- package/dist/src/fold/project.d.ts +2 -2
- package/dist/src/fold/project.js +6 -6
- package/dist/src/fold/reads.js +3 -3
- package/dist/src/fold/seen.d.ts +3 -5
- package/dist/src/fold/seen.js +17 -17
- package/dist/src/fold/view.d.ts +7 -1
- package/dist/src/fold/view.js +8 -23
- package/dist/src/fold/watch.js +12 -12
- package/dist/src/harness.d.ts +257 -257
- package/dist/src/harness.js +78 -71
- package/dist/src/index.d.ts +3 -1
- package/dist/src/index.js +13 -3
- package/dist/src/server.js +73 -66
- package/dist/src/store/inspect.js +3 -3
- package/dist/src/store/memory-store.js +3 -3
- package/dist/src/store/migrations.js +2 -2
- package/dist/src/store/model-state.js +2 -2
- package/dist/src/store/parts.js +3 -3
- package/dist/src/store/session-index.js +2 -2
- package/dist/src/store/session.js +2 -2
- package/dist/src/store.js +5 -5
- package/dist/src/testing.js +76 -69
- package/dist/src/util/line-diff.d.ts +5 -5
- package/package.json +4 -5
- package/dist/chunks/compose-hfrjm4a1.js +0 -88
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./compose-5z835ej2.js";
|
|
4
4
|
import {
|
|
5
5
|
decodeJobRecord2
|
|
6
|
-
} from "./compose-
|
|
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-
|
|
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-
|
|
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-
|
|
33
|
+
} from "./compose-kf2k4hq5.js";
|
|
34
34
|
import {
|
|
35
35
|
send2
|
|
36
|
-
} from "./compose-
|
|
36
|
+
} from "./compose-sjfbxw65.js";
|
|
37
37
|
import {
|
|
38
38
|
recordAcquisition2,
|
|
39
39
|
recordedAcquisition2
|
|
40
|
-
} from "./compose-
|
|
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-
|
|
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-
|
|
15
|
+
} from "./compose-ydth4n0z.js";
|
|
16
16
|
import {
|
|
17
17
|
settleAnswersFrom2
|
|
18
|
-
} from "./compose-
|
|
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-
|
|
30
|
+
} from "./compose-yxhvzsed.js";
|
|
31
31
|
import {
|
|
32
32
|
foldCheckpointing2
|
|
33
|
-
} from "./compose-
|
|
33
|
+
} from "./compose-nc60858y.js";
|
|
34
34
|
import {
|
|
35
35
|
withPair2
|
|
36
|
-
} from "./compose-
|
|
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-
|
|
9
|
+
} from "./compose-ydth4n0z.js";
|
|
10
10
|
import {
|
|
11
11
|
signalsPark2,
|
|
12
12
|
runStep2
|
|
13
|
-
} from "./compose-
|
|
13
|
+
} from "./compose-4s0c5zqv.js";
|
|
14
14
|
import {
|
|
15
15
|
stepPluginApi2
|
|
16
|
-
} from "./compose-
|
|
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-
|
|
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-
|
|
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-
|
|
31
|
+
} from "./compose-s4kyfjj6.js";
|
|
32
32
|
import {
|
|
33
33
|
modelInfo2,
|
|
34
34
|
withLimits2
|
|
35
|
-
} from "./compose-
|
|
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-
|
|
14
|
+
} from "./compose-ydth4n0z.js";
|
|
15
15
|
import {
|
|
16
16
|
commit2
|
|
17
|
-
} from "./compose-
|
|
17
|
+
} from "./compose-s4kyfjj6.js";
|
|
18
18
|
import {
|
|
19
19
|
readWorkspace2,
|
|
20
20
|
workspaceRecords2
|
|
21
|
-
} from "./compose-
|
|
21
|
+
} from "./compose-zt2qtrxj.js";
|
|
22
22
|
import {
|
|
23
23
|
sessionsOn2,
|
|
24
24
|
byIdentity2,
|
|
25
25
|
changed2
|
|
26
|
-
} from "./compose-
|
|
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-
|
|
3
|
+
} from "./compose-zt2qtrxj.js";
|
|
4
4
|
import {
|
|
5
5
|
scanWorkspaceResources2
|
|
6
|
-
} from "./compose-
|
|
6
|
+
} from "./compose-j8xmyfy6.js";
|
|
7
7
|
import {
|
|
8
8
|
newChatPlugins2
|
|
9
|
-
} from "./compose-
|
|
9
|
+
} from "./compose-75pnchkk.js";
|
|
10
10
|
import {
|
|
11
11
|
createHookDispatch2
|
|
12
|
-
} from "./compose-
|
|
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-
|
|
19
|
+
} from "./compose-zq7ar8qm.js";
|
|
20
20
|
import {
|
|
21
21
|
settingHandle2
|
|
22
|
-
} from "./compose-
|
|
22
|
+
} from "./compose-vphbntyn.js";
|
|
23
23
|
import {
|
|
24
24
|
activateApart2
|
|
25
|
-
} from "./compose-
|
|
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-
|
|
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
|
-
|
|
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
|
-
|
|
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-
|
|
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-
|
|
14
|
+
} from "./compose-ydth4n0z.js";
|
|
15
15
|
import {
|
|
16
16
|
storedAnswer2
|
|
17
|
-
} from "./compose-
|
|
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-
|
|
24
|
+
} from "./compose-s4kyfjj6.js";
|
|
25
25
|
import {
|
|
26
26
|
holdLease2
|
|
27
|
-
} from "./compose-
|
|
27
|
+
} from "./compose-79h43be5.js";
|
|
28
28
|
import {
|
|
29
29
|
runWait2,
|
|
30
30
|
readParkedWait2,
|
|
31
31
|
waitingOn2,
|
|
32
32
|
lapsed2
|
|
33
|
-
} from "./compose-
|
|
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-
|
|
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-
|
|
9
|
+
} from "./compose-zt2qtrxj.js";
|
|
10
10
|
import {
|
|
11
11
|
projectTrust2
|
|
12
|
-
} from "./compose-
|
|
12
|
+
} from "./compose-hx8j2kef.js";
|
|
13
13
|
|
|
14
14
|
// src/env/mcp.ts
|
|
15
15
|
import { SdkError } from "@nyte-ai/schema";
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
walkCommitPath2,
|
|
6
6
|
readPositionCommit2
|
|
7
|
-
} from "./compose-
|
|
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-
|
|
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
|
|
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);
|
|
@@ -1,33 +1,48 @@
|
|
|
1
1
|
import {
|
|
2
2
|
requireSession2,
|
|
3
3
|
coveredHere2
|
|
4
|
-
} from "./compose-
|
|
4
|
+
} from "./compose-ydth4n0z.js";
|
|
5
5
|
import {
|
|
6
6
|
UnavailableError2,
|
|
7
7
|
readWorkspace2
|
|
8
|
-
} from "./compose-
|
|
8
|
+
} from "./compose-zt2qtrxj.js";
|
|
9
9
|
import {
|
|
10
10
|
projectTrust2
|
|
11
|
-
} from "./compose-
|
|
11
|
+
} from "./compose-hx8j2kef.js";
|
|
12
12
|
import {
|
|
13
13
|
settle2
|
|
14
|
-
} from "./compose-
|
|
14
|
+
} from "./compose-pjkzf9ev.js";
|
|
15
15
|
|
|
16
16
|
// src/extend/activation.ts
|
|
17
|
+
import { SdkError } from "@nyte-ai/schema";
|
|
17
18
|
var ACTIVE = { kind: "active" };
|
|
18
19
|
var INACTIVE = { kind: "inactive" };
|
|
19
20
|
async function activateSession2(kernel, session, runtime) {
|
|
20
21
|
const workspace = (await requireSession2(kernel.store, session)).record.workspace;
|
|
21
22
|
const attached = await coveredHere2(kernel, session) ? kernel.environments.attach(session).then(() => ACTIVE, (error) => classifyActivationFailure(workspace, error)) : INACTIVE;
|
|
22
|
-
const
|
|
23
|
+
const assigned = runtime.assigned();
|
|
24
|
+
const project = assigned === null ? await projectPlugins(kernel, workspace) : [];
|
|
23
25
|
try {
|
|
24
|
-
await runtime.load([
|
|
26
|
+
await runtime.load([
|
|
27
|
+
...kernel.plugins.builtins,
|
|
28
|
+
...assigned === null ? kernel.plugins.host : await loadAssigned(kernel, assigned),
|
|
29
|
+
...project
|
|
30
|
+
]);
|
|
25
31
|
} catch (error) {
|
|
26
32
|
settle2(kernel, session, workspace, classifyActivationFailure(workspace, error));
|
|
27
33
|
throw error;
|
|
28
34
|
}
|
|
29
35
|
settle2(kernel, session, workspace, await attached);
|
|
30
36
|
}
|
|
37
|
+
async function loadPlugins2(kernel, plugins) {
|
|
38
|
+
const each = await Promise.all(plugins.map(async (plugin) => ("id" in plugin) ? [plugin] : kernel.plugins.load([plugin.path])));
|
|
39
|
+
return each.flat();
|
|
40
|
+
}
|
|
41
|
+
async function loadAssigned(kernel, plugins) {
|
|
42
|
+
return loadPlugins2(kernel, plugins).catch((error) => {
|
|
43
|
+
throw new SdkError("unavailable", `The plugins assigned to this session did not load: ${error instanceof Error ? error.message : String(error)}`);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
31
46
|
async function newChatPlugins2(kernel, workspace) {
|
|
32
47
|
return [
|
|
33
48
|
...kernel.plugins.builtins,
|
|
@@ -70,8 +85,5 @@ async function projectPlugins(kernel, workspace) {
|
|
|
70
85
|
function classifyActivationFailure(workspace, error) {
|
|
71
86
|
return error instanceof UnavailableError2 ? { kind: "unavailable", workspace, reason: error.reason } : { kind: "failed", message: error instanceof Error ? error.message : String(error) };
|
|
72
87
|
}
|
|
73
|
-
function sessionPlugins(kernel, runtime) {
|
|
74
|
-
return [...kernel.plugins.builtins, ...runtime.assigned() ?? kernel.plugins.host];
|
|
75
|
-
}
|
|
76
88
|
|
|
77
|
-
export { activateSession2, newChatPlugins2 };
|
|
89
|
+
export { activateSession2, loadPlugins2, newChatPlugins2 };
|