@cotal-ai/runtime 0.0.1 → 0.25.0
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/engine-host.d.ts +57 -0
- package/dist/engine-host.d.ts.map +1 -0
- package/dist/engine-host.js +189 -0
- package/dist/engine-host.js.map +1 -0
- package/dist/fork.d.ts +144 -0
- package/dist/fork.d.ts.map +1 -0
- package/dist/fork.js +310 -0
- package/dist/fork.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/journal-store.d.ts +54 -0
- package/dist/journal-store.d.ts.map +1 -0
- package/dist/journal-store.js +60 -0
- package/dist/journal-store.js.map +1 -0
- package/dist/mesh-handler.d.ts +310 -0
- package/dist/mesh-handler.d.ts.map +1 -0
- package/dist/mesh-handler.js +731 -0
- package/dist/mesh-handler.js.map +1 -0
- package/dist/migrate.d.ts +147 -0
- package/dist/migrate.d.ts.map +1 -0
- package/dist/migrate.js +256 -0
- package/dist/migrate.js.map +1 -0
- package/dist/resolve-checkpoint.d.ts +75 -0
- package/dist/resolve-checkpoint.d.ts.map +1 -0
- package/dist/resolve-checkpoint.js +108 -0
- package/dist/resolve-checkpoint.js.map +1 -0
- package/dist/run-context.d.ts +42 -0
- package/dist/run-context.d.ts.map +1 -0
- package/dist/run-context.js +55 -0
- package/dist/run-context.js.map +1 -0
- package/dist/run-driver.d.ts +124 -0
- package/dist/run-driver.d.ts.map +1 -0
- package/dist/run-driver.js +335 -0
- package/dist/run-driver.js.map +1 -0
- package/package.json +31 -16
- package/README.md +0 -6
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The run driver: what actually advances a workflow run, and the only thing allowed to.
|
|
3
|
+
*
|
|
4
|
+
* A driver is not a scheduler and not a supervisor. Its whole job is to be the ONE process holding a
|
|
5
|
+
* run, to hand the interpreter a journal that is durable and complete, and to stop the moment it is
|
|
6
|
+
* no longer that process. Everything hard about the first and third parts lives in the activation
|
|
7
|
+
* barrier (`@cotal-ai/core`); everything hard about the middle lives in the language. This file is
|
|
8
|
+
* the join, and it is deliberately small — a driver with its own opinions about durability would be
|
|
9
|
+
* a second answer to a question that already has one.
|
|
10
|
+
*
|
|
11
|
+
* **Start and resume are the same act with one bit of difference**, and the bit is not cosmetic. A
|
|
12
|
+
* run's journal cannot say whether an empty subject means "never started" or "retired by purge", so
|
|
13
|
+
* the caller states which it means: `startRun` activates with `expect: "new"` and `driveRun` with
|
|
14
|
+
* `expect: "existing"`, and the barrier refuses the mismatch either way. That is why there are two
|
|
15
|
+
* entry points rather than one that guesses from what it finds.
|
|
16
|
+
*
|
|
17
|
+
* **The prefix the barrier replayed IS the journal the interpreter resumes from.** Not a copy of it,
|
|
18
|
+
* not a second read: the appender hands back exactly the records it validated as complete before it
|
|
19
|
+
* activated, so there is no window in which the driver could resume from a different prefix than the
|
|
20
|
+
* one it took the run over on.
|
|
21
|
+
*
|
|
22
|
+
* **A durability failure is not a run failure.** If the journal refuses an append — superseded,
|
|
23
|
+
* stalled, retired — the run is not "failed", it is no longer THIS process's to speak for. The
|
|
24
|
+
* distinction is the whole reason `RunJournalStore` maps those to L5010: a driver that reported them
|
|
25
|
+
* as an outcome would be writing down a conclusion about work it can no longer see.
|
|
26
|
+
*/
|
|
27
|
+
import { activateRun, readRunRecord, createRunSpec, writeRunStatus, assertJournalTailIntact, RunJournalTailTruncated, RunSuperseded, RunJournalStalled, StaleLeaseToken, ActivationNotAuthorized, RunNotResumable, RunAlreadyStarted, RunJournalPrefixTruncated, } from "@cotal-ai/core";
|
|
28
|
+
import { Journal, JournalAppendRejected, run as runProgram, resume as resumeProgram, RunReleased, resolvePins, RuntimeFault, ENGINE_LANGUAGE_VERSION, WALKER_LANGUAGE_VERSION, PIN_DEFAULTS, } from "@cotal-ai/lang";
|
|
29
|
+
import { runOnHostedEngine } from "./engine-host.js";
|
|
30
|
+
import { RunJournalStore } from "./journal-store.js";
|
|
31
|
+
/** The compiled engine consumes the same request either way: pins plus the activated entries say
|
|
32
|
+
* whether this is a fresh run or a resume, exactly as they say it to the walker underneath. */
|
|
33
|
+
const hostedEngineRun = (r) => runOnHostedEngine({
|
|
34
|
+
source: r.source,
|
|
35
|
+
runId: r.options.runId,
|
|
36
|
+
pins: r.options.pins,
|
|
37
|
+
handler: r.options.handler,
|
|
38
|
+
store: r.store,
|
|
39
|
+
entries: r.entries,
|
|
40
|
+
shouldStop: r.options.shouldStop,
|
|
41
|
+
...(r.options.file !== undefined ? { file: r.options.file } : {}),
|
|
42
|
+
...(r.options.seed !== undefined ? { seed: r.options.seed } : {}),
|
|
43
|
+
...(r.options.effectCeiling !== undefined ? { effectCeiling: r.options.effectCeiling } : {}),
|
|
44
|
+
...(r.options.stepBudget !== undefined ? { stepBudget: r.options.stepBudget } : {}),
|
|
45
|
+
});
|
|
46
|
+
/**
|
|
47
|
+
* THE LANGUAGE VERSIONS THIS BUILD'S DRIVER CAN HOST, most preferred first.
|
|
48
|
+
*
|
|
49
|
+
* This is a fact about the DRIVER, not about the language, and this build serves both: a fresh run
|
|
50
|
+
* is stamped "2" and executes on the compiled engine — the transform runs here, the program runs in
|
|
51
|
+
* a locked-down worker thread, and the effects and the durable journal stay in THIS process, bridged
|
|
52
|
+
* over a MessagePort so no socket, client or credential enters the isolate that holds the program
|
|
53
|
+
* (`engine-host.ts`) — and every version-1 record keeps routing to the walker, which is the
|
|
54
|
+
* walker's whole job. What a run is stamped with must be the version of the engine that will
|
|
55
|
+
* actually execute it: stamping "2" and calling the walker is REFUSED L5008, measured when this
|
|
56
|
+
* table held one entry.
|
|
57
|
+
*
|
|
58
|
+
* ORDER IS THE PRECEDENCE and it is declared, never derived: a fresh run takes the first entry. A
|
|
59
|
+
* sort over the keys would make "which version is preferred" a fact about string collation, which is
|
|
60
|
+
* not a thing anyone decided.
|
|
61
|
+
*/
|
|
62
|
+
const ENGINES = [
|
|
63
|
+
{ version: ENGINE_LANGUAGE_VERSION, run: hostedEngineRun, resume: hostedEngineRun },
|
|
64
|
+
{
|
|
65
|
+
version: WALKER_LANGUAGE_VERSION,
|
|
66
|
+
run: (r) => runProgram(r.source, { ...r.options, journal: r.journal }),
|
|
67
|
+
resume: (r) => resumeProgram(r.source, r.journal, r.options),
|
|
68
|
+
},
|
|
69
|
+
];
|
|
70
|
+
/**
|
|
71
|
+
* The refusal for a recorded language no engine in this build serves, naming what it does serve.
|
|
72
|
+
*
|
|
73
|
+
* L5023 rather than L5008: L5008 is the same disagreement one layer in, where a record was handed to
|
|
74
|
+
* a SPECIFIC engine whose version differs and the repair is to run it on the engine that matches.
|
|
75
|
+
* Here there is no such engine to name, so it is a different sentence. The message carries the
|
|
76
|
+
* recorded version AND the served set, because "this build cannot" is only actionable if it says
|
|
77
|
+
* what it can.
|
|
78
|
+
*/
|
|
79
|
+
/**
|
|
80
|
+
* A record whose `languageVersion` is not the string the wire contract declares (SPEC §14.3,
|
|
81
|
+
* core's run-record). Distinct from L5023 on purpose: L5023 says "a version this build does not
|
|
82
|
+
* serve", and folding a malformed field into it produced the self-contradictory sentence
|
|
83
|
+
* "recorded under language version 2 ... this build serves 2, 1" when the 2 was a number - the
|
|
84
|
+
* table compares strings, so a number misses every entry while printing like a served version.
|
|
85
|
+
* The writer that produced the record is the defect; the record is refused untouched.
|
|
86
|
+
*/
|
|
87
|
+
class RunRecordMalformed extends Error {
|
|
88
|
+
constructor(runId, got) {
|
|
89
|
+
super(`run ${runId}'s record is malformed: \`languageVersion\` must be a string and this record carries a ${typeof got}`
|
|
90
|
+
+ ` (${JSON.stringify(got) ?? String(got)}). No engine dispatch was attempted; the writer that produced this record is the defect to fix.`);
|
|
91
|
+
this.name = "RunRecordMalformed";
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function unservedLanguage(version) {
|
|
95
|
+
// A RECORD MAY NAME NO VERSION AT ALL, and it reaches this branch by the same route: written
|
|
96
|
+
// before the field existed, it matches no engine either. The two cases get different sentences
|
|
97
|
+
// because an operator acts on them differently, and because interpolating an absent value says
|
|
98
|
+
// the record claims "undefined" when what happened is that it claims nothing. MEASURED before the
|
|
99
|
+
// repair, through the driver: `recorded under language version undefined and this build serves 1`.
|
|
100
|
+
const met = version === undefined ? "names no language version at all" : `was recorded under language version ${version}`;
|
|
101
|
+
const repair = version === undefined
|
|
102
|
+
? `identify the version this record was written under, and run it on a build that serves it`
|
|
103
|
+
: `run this record on a build whose engines serve version ${version}`;
|
|
104
|
+
return new RuntimeFault("L5023", `this run ${met} and this build serves ${ENGINES.map((e) => e.version).join(", ")}. `
|
|
105
|
+
+ `A record replays only on an engine that speaks its language: version 1 is the tree-walker and version 2 is the engine, and they are `
|
|
106
|
+
+ `different languages rather than two speeds of one.\n\n`
|
|
107
|
+
+ `Options\n ${repair}\n fork(run, <step>) start a new run on this build, keeping the prefix`);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* A pause an operator can ask for while a run is being driven.
|
|
111
|
+
*
|
|
112
|
+
* The driver reads it before each effect it has not already recorded, so a pause takes effect at the
|
|
113
|
+
* next boundary and never in the middle of one. It is one-way on purpose: resuming is starting a
|
|
114
|
+
* drive again, which is the same act as any other takeover and goes through the barrier like one.
|
|
115
|
+
*/
|
|
116
|
+
export class PauseToken {
|
|
117
|
+
why;
|
|
118
|
+
pause(reason) {
|
|
119
|
+
this.why ??= reason;
|
|
120
|
+
}
|
|
121
|
+
get reason() {
|
|
122
|
+
return this.why;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
const adoptionOf = (handler) => typeof handler?.adopted === "function"
|
|
126
|
+
? handler
|
|
127
|
+
: undefined;
|
|
128
|
+
/** Start a run that has never been driven. Refused if the journal already has records. */
|
|
129
|
+
export async function startRun(js, jsm, req) {
|
|
130
|
+
return await drive(js, jsm, req, "new");
|
|
131
|
+
}
|
|
132
|
+
/** Take over a run that already exists and drive it to quiescence. Refused if its journal is empty:
|
|
133
|
+
* a run whose records were purged is retired, and re-running it would repeat what it already did. */
|
|
134
|
+
export async function driveRun(js, jsm, req) {
|
|
135
|
+
return await drive(js, jsm, req, "existing");
|
|
136
|
+
}
|
|
137
|
+
async function drive(js, jsm, req, expect) {
|
|
138
|
+
// The record FIRST, because two of the things it holds decide whether this attempt may proceed at
|
|
139
|
+
// all: the pins the run was started under, and how far its journal is known to have got.
|
|
140
|
+
const record = await readRunRecord(req.kv, req.endpoint, req.runId);
|
|
141
|
+
const recordedStatus = record?.status?.value;
|
|
142
|
+
let pins;
|
|
143
|
+
let statusRevision;
|
|
144
|
+
// WHICH ENGINE RUNS THIS. A fresh run takes the first entry this build serves; a resume takes the
|
|
145
|
+
// one its RECORD names, and is refused if this build has none. Chosen here, before the pins, so a
|
|
146
|
+
// fresh run is stamped with the version of the engine that will actually execute it.
|
|
147
|
+
let engine;
|
|
148
|
+
if (expect === "new") {
|
|
149
|
+
if (record !== undefined) {
|
|
150
|
+
// Not `RunAlreadyStarted` from the journal — this run has a SPEC, which is the stronger
|
|
151
|
+
// statement: it was started, pinned, and those pins are not this attempt's to re-decide.
|
|
152
|
+
return { status: "released", reason: new RunAlreadyStarted(req.runId, 0) };
|
|
153
|
+
}
|
|
154
|
+
engine = ENGINES[0];
|
|
155
|
+
// Resolved ONCE, here, from the host clock read exactly once — from here on the epoch is a
|
|
156
|
+
// recorded fact, and a second read could not be the same run's epoch.
|
|
157
|
+
pins = resolvePins({
|
|
158
|
+
runId: req.runId,
|
|
159
|
+
...(req.seed !== undefined ? { seed: req.seed } : {}),
|
|
160
|
+
...(req.effectCeiling !== undefined ? { effectCeiling: req.effectCeiling } : {}),
|
|
161
|
+
...(req.stepBudget !== undefined ? { stepBudget: req.stepBudget } : {}),
|
|
162
|
+
}, req.handler.now(), engine.version);
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
if (record === undefined)
|
|
166
|
+
return { status: "released", reason: new RunNotResumable(req.runId, req.runId) };
|
|
167
|
+
// READ BACK, never re-derived. A default is a property of the interpreter, and the interpreter
|
|
168
|
+
// is the thing that may have changed between attempts.
|
|
169
|
+
pins = record.spec.value.pins;
|
|
170
|
+
// THE FIELD DISPATCH READS IS CHECKED BEFORE THE TABLE IS CONSULTED. The cast above verifies
|
|
171
|
+
// nothing, and the table below compares strings: a record carrying the NUMBER 2 would miss
|
|
172
|
+
// every entry and be released as L5023 whose sentence says "recorded under language version 2"
|
|
173
|
+
// while "this build serves 2" - a self-contradiction handed to an operator. Absent stays with
|
|
174
|
+
// the table's own no-version sentence; any other non-string is a malformed record, refused by
|
|
175
|
+
// its own name. MEASURED before the repair, through this driver against a real broker.
|
|
176
|
+
const wireVersion = record.spec.value.pins["languageVersion"];
|
|
177
|
+
if (wireVersion !== undefined && typeof wireVersion !== "string") {
|
|
178
|
+
return { status: "released", reason: new RunRecordMalformed(req.runId, wireVersion) };
|
|
179
|
+
}
|
|
180
|
+
// AND THE ENGINE IS READ BACK WITH THEM. No fallback: a record whose language this build cannot
|
|
181
|
+
// speak is refused by name (L5023) rather than walked by whatever engine happens to be here,
|
|
182
|
+
// which would run a program under semantics it was never recorded under.
|
|
183
|
+
const served = ENGINES.find((e) => e.version === pins.languageVersion);
|
|
184
|
+
// RELEASED, NOT THROWN and not failed. This file's outcome contract is that a driver which is
|
|
185
|
+
// not the one to run something says so as `released`, and a run result is only ever a thing the
|
|
186
|
+
// program did: a build that does not serve this language has appended nothing, observed nothing
|
|
187
|
+
// and decided nothing about the program, so "failed" would be this layer inventing an outcome
|
|
188
|
+
// and a rejection would be an outcome shape the signature does not declare. It reads the same as
|
|
189
|
+
// the two refusals either side of it (`RunAlreadyStarted`, `RunNotResumable`) because it is the
|
|
190
|
+
// same kind of statement: not here, not this attempt.
|
|
191
|
+
if (served === undefined)
|
|
192
|
+
return { status: "released", reason: unservedLanguage(pins.languageVersion) };
|
|
193
|
+
engine = served;
|
|
194
|
+
statusRevision = record.status?.revision;
|
|
195
|
+
}
|
|
196
|
+
let appender;
|
|
197
|
+
try {
|
|
198
|
+
appender = await activateRun(js, jsm, {
|
|
199
|
+
space: req.space,
|
|
200
|
+
runId: req.runId,
|
|
201
|
+
holder: req.lease.holder,
|
|
202
|
+
fencingToken: req.lease.fencingToken,
|
|
203
|
+
epoch: req.lease.epoch,
|
|
204
|
+
takeoverId: req.lease.takeoverId,
|
|
205
|
+
at: req.handler.now(),
|
|
206
|
+
expect,
|
|
207
|
+
}, {
|
|
208
|
+
// BETWEEN the replay and the activation, which is the only place this check is worth
|
|
209
|
+
// anything: an activation appended over a rolled-back head is another record written into a
|
|
210
|
+
// journal already known to be wrong, at an ordinal the deleted records already used.
|
|
211
|
+
onReplayed: (replay) => {
|
|
212
|
+
assertJournalTailIntact(req.runId, recordedStatus, lastOrdinal(replay.records));
|
|
213
|
+
},
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
catch (e) {
|
|
217
|
+
// Every one of these means "this driver does not hold this run", and none of them is a fact
|
|
218
|
+
// about the program. A caller that treated them as a run result would be recording a conclusion
|
|
219
|
+
// about work it never saw.
|
|
220
|
+
if (isNotOurs(e))
|
|
221
|
+
return { status: "released", reason: e };
|
|
222
|
+
throw e;
|
|
223
|
+
}
|
|
224
|
+
const resumed = appender.steps();
|
|
225
|
+
// The explicit callback wins; otherwise a handler that declares `adopted` repairs its own state.
|
|
226
|
+
// The default is the point: the hook was optional AND unwired, which is indistinguishable at
|
|
227
|
+
// runtime from a driver that has nothing to repair.
|
|
228
|
+
const adopt = req.onActivated ?? adoptionOf(req.handler)?.adopted.bind(req.handler);
|
|
229
|
+
if (adopt !== undefined)
|
|
230
|
+
await adopt(resumed);
|
|
231
|
+
const store = new RunJournalStore(appender);
|
|
232
|
+
const journal = new Journal({
|
|
233
|
+
run: req.runId,
|
|
234
|
+
// The prefix the barrier validated and activated on, not a second read of the subject.
|
|
235
|
+
entries: resumed,
|
|
236
|
+
store,
|
|
237
|
+
});
|
|
238
|
+
// Asked before every effect that is not already recorded. Both reasons are the HOST's and neither
|
|
239
|
+
// is the program's, so neither may be recorded as its outcome — the run stops where its journal
|
|
240
|
+
// already says it is, and the next driver resumes from there.
|
|
241
|
+
const shouldStop = () => {
|
|
242
|
+
if (req.workExpiry !== undefined) {
|
|
243
|
+
const now = req.handler.now();
|
|
244
|
+
if (now >= req.workExpiry)
|
|
245
|
+
return `the work horizon ${req.workExpiry} passed at ${now}`;
|
|
246
|
+
}
|
|
247
|
+
return req.pause?.reason;
|
|
248
|
+
};
|
|
249
|
+
const options = {
|
|
250
|
+
runId: req.runId,
|
|
251
|
+
handler: req.handler,
|
|
252
|
+
shouldStop,
|
|
253
|
+
pins,
|
|
254
|
+
...(req.seed !== undefined ? { seed: req.seed } : {}),
|
|
255
|
+
...(req.file !== undefined ? { file: req.file } : {}),
|
|
256
|
+
...(req.effectCeiling !== undefined ? { effectCeiling: req.effectCeiling } : {}),
|
|
257
|
+
...(req.stepBudget !== undefined ? { stepBudget: req.stepBudget } : {}),
|
|
258
|
+
};
|
|
259
|
+
// The spec is created AFTER the activation, not before: until this driver holds the run it has
|
|
260
|
+
// decided nothing, and a spec written by a driver that then lost the activation race would pin a
|
|
261
|
+
// run for a winner who never agreed to those pins.
|
|
262
|
+
if (expect === "new") {
|
|
263
|
+
await createRunSpec(req.kv, req.endpoint, req.runId, {
|
|
264
|
+
pins,
|
|
265
|
+
createdAt: pins.startedAt,
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
const specRevision = expect === "new"
|
|
269
|
+
? (await readRunRecord(req.kv, req.endpoint, req.runId)).spec.revision
|
|
270
|
+
: record.spec.revision;
|
|
271
|
+
statusRevision = await note(req, "running", appender.journalHigh, specRevision, statusRevision);
|
|
272
|
+
try {
|
|
273
|
+
const engineReq = { source: req.source, journal, store, entries: resumed, options };
|
|
274
|
+
const result = expect === "new" ? await engine.run(engineReq) : await engine.resume(engineReq);
|
|
275
|
+
await note(req, "completed", appender.journalHigh, specRevision, statusRevision);
|
|
276
|
+
return { status: "completed", result };
|
|
277
|
+
}
|
|
278
|
+
catch (e) {
|
|
279
|
+
// L5010 is the journal saying it could not record — the run is not this driver's any more. It
|
|
280
|
+
// arrives here rather than at the append because the interpreter is what was holding the stack.
|
|
281
|
+
if (e instanceof JournalAppendRejected) {
|
|
282
|
+
// Recorded on a BEST-EFFORT basis and never allowed to mask the real answer: the record is a
|
|
283
|
+
// projection, and a driver that could not append to the journal may not be able to write here
|
|
284
|
+
// either. What it must not do is turn a lost run into a different-looking failure.
|
|
285
|
+
await noteQuietly(req, "released", appender.journalHigh, specRevision, statusRevision);
|
|
286
|
+
return { status: "released", reason: e };
|
|
287
|
+
}
|
|
288
|
+
// The host stopping is the same kind of answer: this driver no longer holds the run, and the
|
|
289
|
+
// program has neither failed nor finished.
|
|
290
|
+
if (e instanceof RunReleased) {
|
|
291
|
+
await note(req, "released", appender.journalHigh, specRevision, statusRevision);
|
|
292
|
+
return { status: "released", reason: e };
|
|
293
|
+
}
|
|
294
|
+
// A program that FAILED is a fact about the program, and the run record is where a reader looks
|
|
295
|
+
// for it. Recorded, then re-raised: swallowing it here would leave the caller believing the
|
|
296
|
+
// driver finished normally.
|
|
297
|
+
await note(req, "failed", appender.journalHigh, specRevision, statusRevision);
|
|
298
|
+
throw e;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
function isNotOurs(e) {
|
|
302
|
+
return (e instanceof RunSuperseded ||
|
|
303
|
+
e instanceof RunJournalStalled ||
|
|
304
|
+
e instanceof StaleLeaseToken ||
|
|
305
|
+
e instanceof ActivationNotAuthorized ||
|
|
306
|
+
e instanceof RunNotResumable ||
|
|
307
|
+
e instanceof RunAlreadyStarted ||
|
|
308
|
+
e instanceof RunJournalPrefixTruncated);
|
|
309
|
+
}
|
|
310
|
+
/** The last ordinal in a replayed prefix, or -1 for a run that has none yet. */
|
|
311
|
+
function lastOrdinal(records) {
|
|
312
|
+
return records.length === 0 ? -1 : records[records.length - 1].record.n;
|
|
313
|
+
}
|
|
314
|
+
/** Write the run's status. Returns the new revision so the next write can pin it. */
|
|
315
|
+
async function note(req, state, journalHigh, observedSpecRevision, expectedRevision) {
|
|
316
|
+
return await writeRunStatus(req.kv, req.endpoint, req.runId, {
|
|
317
|
+
observedSpecRevision,
|
|
318
|
+
state,
|
|
319
|
+
holder: req.lease.holder,
|
|
320
|
+
epoch: req.lease.epoch,
|
|
321
|
+
fencingToken: req.lease.fencingToken,
|
|
322
|
+
journalHigh,
|
|
323
|
+
at: req.handler.now(),
|
|
324
|
+
}, expectedRevision);
|
|
325
|
+
}
|
|
326
|
+
/** The same write, where failing to make it must not replace the answer the caller is owed. */
|
|
327
|
+
async function noteQuietly(req, state, journalHigh, observedSpecRevision, expectedRevision) {
|
|
328
|
+
try {
|
|
329
|
+
await note(req, state, journalHigh, observedSpecRevision, expectedRevision);
|
|
330
|
+
}
|
|
331
|
+
catch {
|
|
332
|
+
/* the record is a projection; the journal is the authority and it has already spoken */
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
//# sourceMappingURL=run-driver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-driver.js","sourceRoot":"","sources":["../src/run-driver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EACL,WAAW,EACX,aAAa,EACb,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,uBAAuB,EAEvB,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,uBAAuB,EACvB,eAAe,EACf,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,OAAO,EACP,qBAAqB,EACrB,GAAG,IAAI,UAAU,EACjB,MAAM,IAAI,aAAa,EACvB,WAAW,EACX,WAAW,EACX,YAAY,EACZ,uBAAuB,EACvB,uBAAuB,EACvB,YAAY,GAKb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,M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AK,UAAU,WAAW,CACxB,GAAiB,EACjB,KAA8B,EAC9B,WAAmB,EACnB,oBAA4B,EAC5B,gBAAoC;IAEpC,IAAI,CAAC;QACH,MAAM,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,oBAAoB,EAAE,gBAAgB,CAAC,CAAC;IAC9E,CAAC;IAAC,MAAM,CAAC;QACP,wFAAwF;IAC1F,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,25 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cotal-ai/runtime",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
3
|
+
"description": "Cotal workflow runtime: hosts cotal-lang runs on the mesh — the durable step-journal store, the effect handler, and the run driver.",
|
|
4
|
+
"version": "0.25.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
|
-
"keywords": [
|
|
7
|
-
"cotal",
|
|
8
|
-
"agents",
|
|
9
|
-
"multi-agent",
|
|
10
|
-
"workflow",
|
|
11
|
-
"durable",
|
|
12
|
-
"nats",
|
|
13
|
-
"jetstream"
|
|
14
|
-
],
|
|
15
|
-
"homepage": "https://github.com/Cotal-AI/Cotal#readme",
|
|
16
6
|
"repository": {
|
|
17
7
|
"type": "git",
|
|
18
|
-
"url": "
|
|
8
|
+
"url": "https://github.com/Cotal-AI/Cotal.git",
|
|
19
9
|
"directory": "implementations/runtime"
|
|
20
10
|
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"main": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@cotal-ai/core": "0.25.0",
|
|
22
|
+
"@cotal-ai/lang": "0.25.0"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@nats-io/jetstream": "^3.4.0",
|
|
26
|
+
"@nats-io/kv": "^3.4.0",
|
|
27
|
+
"@nats-io/transport-node": "^3.4.0"
|
|
28
|
+
},
|
|
21
29
|
"files": [
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
30
|
+
"dist"
|
|
31
|
+
],
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"typecheck": "tsc -p tsconfig.check.json",
|
|
37
|
+
"build": "tsc -p tsconfig.json",
|
|
38
|
+
"test": "tsx smoke/mesh-seam.smoke.ts"
|
|
39
|
+
}
|
|
25
40
|
}
|
package/README.md
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
# @cotal-ai/runtime
|
|
2
|
-
|
|
3
|
-
Name-reserving stub. The real package, the Cotal workflow runtime (durable step-journal
|
|
4
|
-
store, effect handler, run driver for cotal-lang runs on the mesh), ships from
|
|
5
|
-
[Cotal-AI/Cotal](https://github.com/Cotal-AI/Cotal) at version 0.24.0 and above via the
|
|
6
|
-
release pipeline. Do not depend on this version.
|