@usine/durable 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +81 -2
- package/dist/attempt/documents.d.ts +86 -0
- package/dist/attempt/documents.d.ts.map +1 -0
- package/dist/attempt/documents.js +30 -0
- package/dist/attempt/documents.js.map +1 -0
- package/dist/attempt/events.d.ts +22 -0
- package/dist/attempt/events.d.ts.map +1 -0
- package/dist/attempt/events.js +110 -0
- package/dist/attempt/events.js.map +1 -0
- package/dist/attempt/extension.d.ts +48 -0
- package/dist/attempt/extension.d.ts.map +1 -0
- package/dist/attempt/extension.js +34 -0
- package/dist/attempt/extension.js.map +1 -0
- package/dist/attempt/hubs.d.ts +117 -0
- package/dist/attempt/hubs.d.ts.map +1 -0
- package/dist/attempt/hubs.js +137 -0
- package/dist/attempt/hubs.js.map +1 -0
- package/dist/attempt/outcome.d.ts +22 -0
- package/dist/attempt/outcome.d.ts.map +1 -0
- package/dist/attempt/outcome.js +84 -0
- package/dist/attempt/outcome.js.map +1 -0
- package/dist/attempt/parent.d.ts +27 -0
- package/dist/attempt/parent.d.ts.map +1 -0
- package/dist/attempt/parent.js +109 -0
- package/dist/attempt/parent.js.map +1 -0
- package/dist/attempt/relay.d.ts +41 -0
- package/dist/attempt/relay.d.ts.map +1 -0
- package/dist/attempt/relay.js +457 -0
- package/dist/attempt/relay.js.map +1 -0
- package/dist/attempt/repair.d.ts +8 -0
- package/dist/attempt/repair.d.ts.map +1 -0
- package/dist/attempt/repair.js +130 -0
- package/dist/attempt/repair.js.map +1 -0
- package/dist/attempt/request.d.ts +18 -0
- package/dist/attempt/request.d.ts.map +1 -0
- package/dist/attempt/request.js +24 -0
- package/dist/attempt/request.js.map +1 -0
- package/dist/attempt/runtime.d.ts +10 -0
- package/dist/attempt/runtime.d.ts.map +1 -0
- package/dist/attempt/runtime.js +422 -0
- package/dist/attempt/runtime.js.map +1 -0
- package/dist/attempt/services.d.ts +15 -0
- package/dist/attempt/services.d.ts.map +1 -0
- package/dist/attempt/services.js +2 -0
- package/dist/attempt/services.js.map +1 -0
- package/dist/attempt/subagent.d.ts +17 -0
- package/dist/attempt/subagent.d.ts.map +1 -0
- package/dist/attempt/subagent.js +203 -0
- package/dist/attempt/subagent.js.map +1 -0
- package/dist/attempt/task.d.ts +61 -0
- package/dist/attempt/task.d.ts.map +1 -0
- package/dist/attempt/task.js +302 -0
- package/dist/attempt/task.js.map +1 -0
- package/dist/attempt/watch.d.ts +8 -0
- package/dist/attempt/watch.d.ts.map +1 -0
- package/dist/attempt/watch.js +25 -0
- package/dist/attempt/watch.js.map +1 -0
- package/dist/attempt-runtime.d.ts +123 -0
- package/dist/attempt-runtime.d.ts.map +1 -0
- package/dist/attempt-runtime.js +73 -0
- package/dist/attempt-runtime.js.map +1 -0
- package/dist/backup.d.ts +26 -0
- package/dist/backup.d.ts.map +1 -0
- package/dist/backup.js +100 -0
- package/dist/backup.js.map +1 -0
- package/dist/harness.d.ts +87 -0
- package/dist/harness.d.ts.map +1 -0
- package/dist/harness.js +271 -0
- package/dist/harness.js.map +1 -0
- package/dist/live.d.ts +15 -0
- package/dist/live.d.ts.map +1 -0
- package/dist/live.js +51 -0
- package/dist/live.js.map +1 -0
- package/dist/storage-path.d.ts +4 -0
- package/dist/storage-path.d.ts.map +1 -0
- package/dist/storage-path.js +2 -0
- package/dist/storage-path.js.map +1 -0
- package/dist/testing.d.ts +111 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +303 -0
- package/dist/testing.js.map +1 -0
- package/package.json +72 -3
package/dist/harness.js
ADDED
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { BACKGROUND_CONTEXT, withAbortSignal } from "@earendil-works/chord/context";
|
|
2
|
+
import { createRegistry, Harness, StorageRejected, } from "@earendil-works/pi-durable";
|
|
3
|
+
import { Context, Deferred, Effect, Layer, Option, Result, Schedule, Schema, Scope } from "effect";
|
|
4
|
+
/** A failed pi-durable call. */
|
|
5
|
+
export class DurableHarnessError extends Schema.TaggedError("@usine/durable/DurableHarnessError")("DurableHarnessError", {
|
|
6
|
+
/**
|
|
7
|
+
* A description of the failed operation, such as `open`, `resume`, or the `operation` passed to
|
|
8
|
+
* `use`.
|
|
9
|
+
*/
|
|
10
|
+
operation: Schema.NonEmptyString,
|
|
11
|
+
/** The error message, or the stop reason if the harness has stopped. */
|
|
12
|
+
message: Schema.NonEmptyString,
|
|
13
|
+
cause: Schema.Defect(),
|
|
14
|
+
}) {
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The pi-durable Harness over one storage. Reopens the storage and resumes the tasks after a
|
|
18
|
+
* poisoned Session or a stuck step, and stops if the reopened harness gets stuck within
|
|
19
|
+
* `STUCK_AGAIN_MILLIS`.
|
|
20
|
+
*/
|
|
21
|
+
export class DurableHarness extends Context.Service()("@usine/durable/DurableHarness") {
|
|
22
|
+
}
|
|
23
|
+
const POISONED_MESSAGE = "Session is poisoned";
|
|
24
|
+
/**
|
|
25
|
+
* Whether `cause` is pi-durable's poisoned-Session error, which is identified only by its message
|
|
26
|
+
* prefix.
|
|
27
|
+
*/
|
|
28
|
+
const isPoisoned = (cause) => cause instanceof Error && cause.message.startsWith(POISONED_MESSAGE);
|
|
29
|
+
/** The interval in which repeats of a reported failure are counted and then logged once. */
|
|
30
|
+
const REPORT_LOG_INTERVAL_MILLIS = 5_000;
|
|
31
|
+
/**
|
|
32
|
+
* The number of reports of one failure, with no adopted commit between them, after which a step
|
|
33
|
+
* counts as stuck.
|
|
34
|
+
*/
|
|
35
|
+
export const StuckStepReports = Context.Reference("@usine/durable/StuckStepReports", {
|
|
36
|
+
defaultValue: () => 1_000,
|
|
37
|
+
});
|
|
38
|
+
/**
|
|
39
|
+
* If a harness reopened after a stuck step gets stuck again within this time, it stops instead of
|
|
40
|
+
* reopening.
|
|
41
|
+
*/
|
|
42
|
+
const STUCK_AGAIN_MILLIS = 60_000;
|
|
43
|
+
const messageOf = (cause) => cause instanceof Error && cause.message.length > 0 ? cause.message : String(cause) || "unknown";
|
|
44
|
+
export const durableError = (operation, cause) => new DurableHarnessError({ operation, message: messageOf(cause), cause });
|
|
45
|
+
/** Returns `storage` with `onPoison` called on every commit failure except `StorageRejected`. */
|
|
46
|
+
const watchCommits = (storage, onPoison) => {
|
|
47
|
+
const commit = (writes, context) => storage.commit(writes, context).catch((cause) => {
|
|
48
|
+
if (!(cause instanceof StorageRejected))
|
|
49
|
+
onPoison(cause);
|
|
50
|
+
throw cause;
|
|
51
|
+
});
|
|
52
|
+
return new Proxy(storage, {
|
|
53
|
+
get: (target, property) => {
|
|
54
|
+
if (property === "commit")
|
|
55
|
+
return commit;
|
|
56
|
+
// SAFETY: the proxy only forwards Storage members, bound to the target because storage
|
|
57
|
+
// classes use private state.
|
|
58
|
+
const member = target[property];
|
|
59
|
+
return member instanceof Function ? member.bind(target) : member;
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
const make = Effect.fn("DurableHarness.make")(function* (options) {
|
|
64
|
+
const services = yield* Effect.context();
|
|
65
|
+
const fork = Effect.runForkWith(services);
|
|
66
|
+
const stuckStepReports = yield* StuckStepReports;
|
|
67
|
+
const scope = yield* Effect.scope;
|
|
68
|
+
const registry = createRegistry();
|
|
69
|
+
const listeners = new Set();
|
|
70
|
+
let resumed = Option.none();
|
|
71
|
+
let started = false;
|
|
72
|
+
let closed = false;
|
|
73
|
+
let reopening = Option.none();
|
|
74
|
+
let stopped = Option.none();
|
|
75
|
+
const open = Effect.fn("DurableHarness.open")(function* (generation, afterStuck) {
|
|
76
|
+
yield* Effect.annotateCurrentSpan({ generation });
|
|
77
|
+
const storage = yield* options.openStorage;
|
|
78
|
+
const reports = new Map();
|
|
79
|
+
const harness = yield* Effect.tryPromise({
|
|
80
|
+
try: () => Harness.open(watchCommits(storage, (cause) => requestReopen(generation, cause, "poisoned")), {
|
|
81
|
+
models: options.models,
|
|
82
|
+
registry,
|
|
83
|
+
onReport: (error) => report(generation, reports, error),
|
|
84
|
+
}, BACKGROUND_CONTEXT),
|
|
85
|
+
catch: (cause) => durableError("open", cause),
|
|
86
|
+
});
|
|
87
|
+
harness.subscribeCommits((publication) => {
|
|
88
|
+
for (const [message, repeats] of reports) {
|
|
89
|
+
if (repeats.unlogged === 0)
|
|
90
|
+
reports.delete(message);
|
|
91
|
+
else
|
|
92
|
+
repeats.count = 0;
|
|
93
|
+
}
|
|
94
|
+
for (const listener of listeners)
|
|
95
|
+
listener.onCommit(publication);
|
|
96
|
+
});
|
|
97
|
+
if (Option.isSome(resumed)) {
|
|
98
|
+
yield* resumed.value(harness);
|
|
99
|
+
harness.resume();
|
|
100
|
+
}
|
|
101
|
+
yield* Effect.logInfo("Opened the durable harness", {
|
|
102
|
+
generation,
|
|
103
|
+
resumed: Option.isSome(resumed),
|
|
104
|
+
});
|
|
105
|
+
return {
|
|
106
|
+
generation,
|
|
107
|
+
harness,
|
|
108
|
+
openedAt: Date.now(),
|
|
109
|
+
afterStuck,
|
|
110
|
+
reports,
|
|
111
|
+
};
|
|
112
|
+
});
|
|
113
|
+
const logRepeats = (generation, message, repeats) => {
|
|
114
|
+
fork(Effect.logWarning("pi-durable reported the same failure again", {
|
|
115
|
+
generation,
|
|
116
|
+
cause: message,
|
|
117
|
+
repeats: repeats.unlogged,
|
|
118
|
+
}));
|
|
119
|
+
repeats.unlogged = 0;
|
|
120
|
+
repeats.loggedAt = Date.now();
|
|
121
|
+
};
|
|
122
|
+
const close = Effect.fn("DurableHarness.close")(function* (opened) {
|
|
123
|
+
yield* Effect.annotateCurrentSpan({ generation: opened.generation });
|
|
124
|
+
for (const [message, repeats] of opened.reports) {
|
|
125
|
+
if (repeats.unlogged > 0)
|
|
126
|
+
logRepeats(opened.generation, message, repeats);
|
|
127
|
+
}
|
|
128
|
+
yield* Effect.tryPromise({
|
|
129
|
+
try: () => opened.harness.close(BACKGROUND_CONTEXT),
|
|
130
|
+
catch: (cause) => durableError("close", cause),
|
|
131
|
+
}).pipe(Effect.tapError((error) => Effect.logError("Could not close the durable harness", {
|
|
132
|
+
generation: opened.generation,
|
|
133
|
+
message: error.message,
|
|
134
|
+
})), Effect.ignore);
|
|
135
|
+
});
|
|
136
|
+
const reopen = Effect.fn("DurableHarness.reopen")(function* (previous, cause, ready, reason) {
|
|
137
|
+
yield* Effect.annotateCurrentSpan({ generation: previous.generation, reason });
|
|
138
|
+
yield* Effect.logError(reason === "poisoned"
|
|
139
|
+
? "A durable commit failed after storage admission and poisoned the Session; reopening the harness"
|
|
140
|
+
: "pi-durable keeps retrying a step that cannot succeed; reopening the harness", { generation: previous.generation, cause: messageOf(cause) });
|
|
141
|
+
yield* close(previous);
|
|
142
|
+
const next = yield* open(previous.generation + 1, reason === "stuck").pipe(Effect.tapError((error) => Effect.logError("Could not reopen the durable harness; retrying", {
|
|
143
|
+
generation: previous.generation + 1,
|
|
144
|
+
message: error.message,
|
|
145
|
+
})), Effect.retry(Schedule.spaced("1 second")), Effect.orDie);
|
|
146
|
+
current = next;
|
|
147
|
+
reopening = Option.none();
|
|
148
|
+
yield* Deferred.succeed(ready, next);
|
|
149
|
+
for (const listener of listeners)
|
|
150
|
+
listener.onReopen();
|
|
151
|
+
yield* Effect.logInfo("Reopened the durable harness", { generation: next.generation, reason });
|
|
152
|
+
});
|
|
153
|
+
let current = yield* open(1, false);
|
|
154
|
+
started = true;
|
|
155
|
+
// Called synchronously from inside pi-durable; the reopen runs on its own fiber.
|
|
156
|
+
function requestReopen(generation, cause, reason) {
|
|
157
|
+
if (!started || closed || Option.isSome(stopped) || Option.isSome(reopening))
|
|
158
|
+
return;
|
|
159
|
+
if (current.generation !== generation)
|
|
160
|
+
return;
|
|
161
|
+
const ready = Deferred.makeUnsafe();
|
|
162
|
+
reopening = Option.some(ready);
|
|
163
|
+
fork(reopen(current, cause, ready, reason).pipe(Effect.forkIn(scope)));
|
|
164
|
+
}
|
|
165
|
+
function stop(target, cause) {
|
|
166
|
+
stopped = Option.some(new Error(`pi-durable keeps retrying a step that fails with: ${messageOf(cause)}. Restart the orchestrator.`, { cause }));
|
|
167
|
+
fork(Effect.logError("Stopped the durable harness: pi-durable kept retrying a step that cannot succeed, also on a reopened harness; durable calls fail until the orchestrator restarts", { generation: target.generation, cause: messageOf(cause) }));
|
|
168
|
+
for (const listener of listeners)
|
|
169
|
+
listener.onStop();
|
|
170
|
+
fork(close(target).pipe(Effect.forkIn(scope)));
|
|
171
|
+
}
|
|
172
|
+
function stuck(generation, cause) {
|
|
173
|
+
if (!started || closed || Option.isSome(stopped) || Option.isSome(reopening))
|
|
174
|
+
return;
|
|
175
|
+
if (current.generation !== generation)
|
|
176
|
+
return;
|
|
177
|
+
const target = current;
|
|
178
|
+
// Close now, because no fiber runs while pi-durable retries in microtasks. The reopen or stop
|
|
179
|
+
// closes it again.
|
|
180
|
+
void target.harness.close(BACKGROUND_CONTEXT).catch(() => undefined);
|
|
181
|
+
if (target.afterStuck && Date.now() - target.openedAt < STUCK_AGAIN_MILLIS)
|
|
182
|
+
stop(target, cause);
|
|
183
|
+
else
|
|
184
|
+
requestReopen(generation, cause, "stuck");
|
|
185
|
+
}
|
|
186
|
+
// Called synchronously from inside pi-durable, possibly thousands of times a second.
|
|
187
|
+
function report(generation, reports, cause) {
|
|
188
|
+
const message = messageOf(cause);
|
|
189
|
+
const repeats = reports.get(message);
|
|
190
|
+
if (repeats === undefined) {
|
|
191
|
+
reports.set(message, { count: 1, unlogged: 0, loggedAt: Date.now() });
|
|
192
|
+
fork(Effect.logWarning("pi-durable reported a failure that did not fail its caller", {
|
|
193
|
+
generation,
|
|
194
|
+
cause: message,
|
|
195
|
+
}));
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
repeats.count += 1;
|
|
199
|
+
repeats.unlogged += 1;
|
|
200
|
+
if (Date.now() - repeats.loggedAt >= REPORT_LOG_INTERVAL_MILLIS) {
|
|
201
|
+
logRepeats(generation, message, repeats);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
if (isPoisoned(cause))
|
|
205
|
+
requestReopen(generation, cause, "poisoned");
|
|
206
|
+
else if ((repeats?.count ?? 1) >= stuckStepReports)
|
|
207
|
+
stuck(generation, cause);
|
|
208
|
+
}
|
|
209
|
+
const unlessStopped = (operation) => Option.match(stopped, {
|
|
210
|
+
onNone: () => Effect.void,
|
|
211
|
+
onSome: (reason) => Effect.fail(durableError(operation, reason)),
|
|
212
|
+
});
|
|
213
|
+
const opened = Effect.suspend(() => Option.match(reopening, {
|
|
214
|
+
onNone: () => Effect.succeed(current),
|
|
215
|
+
onSome: Deferred.await,
|
|
216
|
+
}));
|
|
217
|
+
const use = (operation, run) => Effect.gen(function* () {
|
|
218
|
+
for (let attempt = 1;; attempt += 1) {
|
|
219
|
+
yield* unlessStopped(operation);
|
|
220
|
+
const target = yield* opened;
|
|
221
|
+
const outcome = yield* Effect.tryPromise({
|
|
222
|
+
try: (signal) => run(target.harness, withAbortSignal(signal, BACKGROUND_CONTEXT)),
|
|
223
|
+
catch: (cause) => cause,
|
|
224
|
+
}).pipe(Effect.result);
|
|
225
|
+
if (Result.isSuccess(outcome))
|
|
226
|
+
return outcome.success;
|
|
227
|
+
const cause = outcome.failure;
|
|
228
|
+
yield* unlessStopped(operation);
|
|
229
|
+
if (isPoisoned(cause))
|
|
230
|
+
requestReopen(target.generation, cause, "poisoned");
|
|
231
|
+
const replaced = Option.isSome(reopening) || current.generation !== target.generation;
|
|
232
|
+
if (attempt === 1 && replaced) {
|
|
233
|
+
yield* Effect.logInfo("Repeating a durable call on the reopened harness", {
|
|
234
|
+
operation,
|
|
235
|
+
generation: target.generation,
|
|
236
|
+
});
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
239
|
+
return yield* durableError(operation, cause);
|
|
240
|
+
}
|
|
241
|
+
}).pipe(Effect.withSpan(`DurableHarness.use.${operation}`));
|
|
242
|
+
yield* Effect.addFinalizer(() => Effect.gen(function* () {
|
|
243
|
+
closed = true;
|
|
244
|
+
yield* close(current);
|
|
245
|
+
yield* Effect.logInfo("Closed the durable harness", { generation: current.generation });
|
|
246
|
+
}));
|
|
247
|
+
return DurableHarness.of({
|
|
248
|
+
models: options.models,
|
|
249
|
+
defaultModel: options.defaultModel,
|
|
250
|
+
install: (extension) => Effect.sync(() => registry.install(extension)).pipe(Effect.tap(() => Effect.logDebug("Installed a durable extension", { name: extension.name }))),
|
|
251
|
+
resume: Effect.fn("DurableHarness.resume")(function* (beforeResume) {
|
|
252
|
+
yield* unlessStopped("resume");
|
|
253
|
+
const target = yield* opened;
|
|
254
|
+
yield* beforeResume(target.harness);
|
|
255
|
+
yield* Effect.try({
|
|
256
|
+
try: () => target.harness.resume(),
|
|
257
|
+
catch: (cause) => durableError("resume", cause),
|
|
258
|
+
});
|
|
259
|
+
resumed = Option.some(beforeResume);
|
|
260
|
+
yield* Effect.logInfo("Resumed durable task scheduling", { generation: target.generation });
|
|
261
|
+
}),
|
|
262
|
+
use,
|
|
263
|
+
subscribe: (listener) => Effect.acquireRelease(Effect.sync(() => listeners.add(listener)), () => Effect.sync(() => listeners.delete(listener))).pipe(Effect.asVoid),
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
/**
|
|
267
|
+
* Opens the harness for the layer's lifetime. Closes it on release without writing any task
|
|
268
|
+
* outcome.
|
|
269
|
+
*/
|
|
270
|
+
export const layer = (options) => Layer.effect(DurableHarness, make(options));
|
|
271
|
+
//# sourceMappingURL=harness.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"harness.js","sourceRoot":"","sources":["../src/harness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEpF,OAAO,EAEL,cAAc,EAEd,OAAO,EAGP,eAAe,GAChB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,E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AAC;AACL,CAAC,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CACnB,OAA8B,EACoB,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC"}
|
package/dist/live.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { InstanceDirectory } from "@usine/core/instance";
|
|
2
|
+
import { Layer } from "effect";
|
|
3
|
+
/**
|
|
4
|
+
* Provides the durable harness on `.usine/durable.sqlite` with Pi's configured models and
|
|
5
|
+
* credentials.
|
|
6
|
+
*/
|
|
7
|
+
export declare const harnessLayer: (instanceDirectory: InstanceDirectory) => Layer.Layer<import("./harness.ts").DurableHarness, import("./harness.ts").DurableHarnessError, never>;
|
|
8
|
+
/** Provides the Claude Code, Codex, and Pi child backends, selected by the Agent's harness. */
|
|
9
|
+
export declare const childBackendLayer: Layer.Layer<import("@usine/agents/runtime").ChildBackend, never, import("effect/unstable/process/ChildProcessSpawner").ChildProcessSpawner | import("@usine/agents/runtime").ClaudeLoginLock>;
|
|
10
|
+
/**
|
|
11
|
+
* Provides the Node `AttemptRuntime` with the real child backends. Building it resumes every
|
|
12
|
+
* unfinished Attempt.
|
|
13
|
+
*/
|
|
14
|
+
export declare const layer: (instanceDirectory: InstanceDirectory) => Layer.Layer<import("./attempt-runtime.ts").AttemptRuntime | import("./harness.ts").DurableHarness, import("./harness.ts").DurableHarnessError, import("effect/unstable/process/ChildProcessSpawner").ChildProcessSpawner | import("@usine/agents/runtime").ClaudeLoginLock>;
|
|
15
|
+
//# sourceMappingURL=live.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live.d.ts","sourceRoot":"","sources":["../src/live.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAsB,KAAK,EAAgB,MAAM,QAAQ,CAAC;AA+CjE;;;GAGG;AACH,eAAO,MAAM,YAAY,sBAAuB,iBAAiB,0GACc,CAAC;AAQhF,+FAA+F;AAC/F,eAAO,MAAM,iBAAiB,+LAAiE,CAAC;AAEhG;;;GAGG;AACH,eAAO,MAAM,KAAK,sBAAuB,iBAAiB,gRAIvD,CAAC"}
|
package/dist/live.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { NodeServices } from "@effect/platform-node";
|
|
2
|
+
import { getAgentDir, ModelRuntime, SettingsManager } from "@earendil-works/pi-coding-agent";
|
|
3
|
+
import { openNodeSqliteStorage } from "@earendil-works/pi-durable/storage/sqlite/node";
|
|
4
|
+
import { childDispatcherLayer } from "@usine/agents/children";
|
|
5
|
+
import { claudeChildBackendLayer, claudeSdkLive } from "@usine/agents/claude";
|
|
6
|
+
import { codexAppServerLive, codexChildBackendLayer } from "@usine/agents/codex";
|
|
7
|
+
import { piChildBackendLayer, piSdkLive } from "@usine/agents/pi";
|
|
8
|
+
import { Effect, FileSystem, Layer, Option, Path } from "effect";
|
|
9
|
+
import { layer as attemptRuntimeLayer } from "./attempt/runtime.js";
|
|
10
|
+
import { durableError, layer as durableHarnessLayer, } from "./harness.js";
|
|
11
|
+
import { durableStoragePath } from "./storage-path.js";
|
|
12
|
+
const nodeOptions = Effect.fn("DurableHarness.nodeOptions")(function* (instanceDirectory) {
|
|
13
|
+
const fileSystem = yield* FileSystem.FileSystem;
|
|
14
|
+
const path = yield* Path.Path;
|
|
15
|
+
const file = durableStoragePath(path, instanceDirectory);
|
|
16
|
+
const models = yield* Effect.tryPromise({
|
|
17
|
+
try: (signal) => ModelRuntime.create({ signal }),
|
|
18
|
+
catch: (cause) => durableError("load the Pi model runtime", cause),
|
|
19
|
+
});
|
|
20
|
+
// Only the Pi user's global settings: the instance folder's own `.pi/` is not trusted.
|
|
21
|
+
const settings = SettingsManager.create(instanceDirectory, getAgentDir(), {
|
|
22
|
+
projectTrusted: false,
|
|
23
|
+
});
|
|
24
|
+
const defaultModel = Option.flatMap(Option.fromNullishOr(settings.getDefaultProvider()), (provider) => Option.map(Option.fromNullishOr(settings.getDefaultModel()), (modelId) => ({
|
|
25
|
+
provider,
|
|
26
|
+
modelId,
|
|
27
|
+
})));
|
|
28
|
+
yield* Effect.logInfo("Durable harness storage", { file });
|
|
29
|
+
return {
|
|
30
|
+
openStorage: fileSystem.makeDirectory(path.dirname(file), { recursive: true }).pipe(Effect.mapError((cause) => durableError("create the durable storage folder", cause)), Effect.andThen(Effect.tryPromise({
|
|
31
|
+
try: () => openNodeSqliteStorage(file),
|
|
32
|
+
catch: (cause) => durableError("open the durable storage", cause),
|
|
33
|
+
}))),
|
|
34
|
+
models,
|
|
35
|
+
defaultModel,
|
|
36
|
+
};
|
|
37
|
+
}, Effect.provide(NodeServices.layer));
|
|
38
|
+
/**
|
|
39
|
+
* Provides the durable harness on `.usine/durable.sqlite` with Pi's configured models and
|
|
40
|
+
* credentials.
|
|
41
|
+
*/
|
|
42
|
+
export const harnessLayer = (instanceDirectory) => Layer.unwrap(Effect.map(nodeOptions(instanceDirectory), durableHarnessLayer));
|
|
43
|
+
const childImplementations = Layer.mergeAll(claudeChildBackendLayer.pipe(Layer.provide(claudeSdkLive)), codexChildBackendLayer.pipe(Layer.provide(codexAppServerLive)), piChildBackendLayer.pipe(Layer.provide(piSdkLive)));
|
|
44
|
+
/** Provides the Claude Code, Codex, and Pi child backends, selected by the Agent's harness. */
|
|
45
|
+
export const childBackendLayer = childDispatcherLayer.pipe(Layer.provide(childImplementations));
|
|
46
|
+
/**
|
|
47
|
+
* Provides the Node `AttemptRuntime` with the real child backends. Building it resumes every
|
|
48
|
+
* unfinished Attempt.
|
|
49
|
+
*/
|
|
50
|
+
export const layer = (instanceDirectory) => attemptRuntimeLayer.pipe(Layer.provideMerge(harnessLayer(instanceDirectory)), Layer.provide(childBackendLayer));
|
|
51
|
+
//# sourceMappingURL=live.js.map
|
package/dist/live.js.map
ADDED
|
@@ -0,0 +1 @@
|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Root":"","sources":["../src/storage-path.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAe,EAAE,iBAAoC,EAAU,EAAE,CAClG,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,QAAQ,EAAE,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { AssistantMessage } from "@earendil-works/pi-ai";
|
|
2
|
+
import { type FauxResponseStep } from "@earendil-works/pi-ai/providers/faux";
|
|
3
|
+
import { ChildBackend, type ChildRequest } from "@usine/agents/runtime";
|
|
4
|
+
import { type AgentSessionEvent, ParentSession } from "@usine/core/agent/session";
|
|
5
|
+
import * as AttemptChannel from "@usine/core/attempt/channel";
|
|
6
|
+
import { type AttemptFailure } from "@usine/core/attempt/failure";
|
|
7
|
+
import { StepResult } from "@usine/core/step/result";
|
|
8
|
+
import { Context, Duration, Effect, Layer, Option } from "effect";
|
|
9
|
+
import { AttemptReport, type AttemptRequest, AttemptRuntime } from "./attempt-runtime.ts";
|
|
10
|
+
import { type DurableHarnessOptions } from "./harness.ts";
|
|
11
|
+
export type ParentStep = FauxResponseStep;
|
|
12
|
+
/** The model ID that the testing layer serves. */
|
|
13
|
+
export declare const PARENT_MODEL: string & import("effect/Brand").Brand<"ModelId">;
|
|
14
|
+
/** Returns a parent turn that calls the `subagent` tool with `task`. */
|
|
15
|
+
export declare const delegate: (task: string) => AssistantMessage;
|
|
16
|
+
/** Returns a parent turn whose final answer is `text`. */
|
|
17
|
+
export declare const answer: (text: string) => AssistantMessage;
|
|
18
|
+
/**
|
|
19
|
+
* Returns pi-ai model access that answers requests with `steps` in order, at any reasoning effort
|
|
20
|
+
* up to `high`.
|
|
21
|
+
*/
|
|
22
|
+
export declare const fauxParent: (steps: ReadonlyArray<ParentStep>) => Pick<DurableHarnessOptions, "models" | "defaultModel">;
|
|
23
|
+
/** A child launched by the stub backend and finished by the test. */
|
|
24
|
+
export interface StubChild {
|
|
25
|
+
readonly request: ChildRequest;
|
|
26
|
+
readonly emit: (event: AgentSessionEvent) => Effect.Effect<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Reads the queued operator messages, then finishes with `message` as the report. Under a Hold,
|
|
29
|
+
* the report is delayed until release.
|
|
30
|
+
*/
|
|
31
|
+
readonly reply: (message: string) => Effect.Effect<void>;
|
|
32
|
+
/** Reads the queued operator messages, as a harness does at a turn boundary. */
|
|
33
|
+
readonly readQueued: Effect.Effect<void>;
|
|
34
|
+
/** Finishes with a blocked report, which fails the Attempt unless the parent relays it. */
|
|
35
|
+
readonly block: (message: string) => Effect.Effect<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Finishes by asking the operator `question`, which fails the Attempt unless the parent relays
|
|
38
|
+
* it.
|
|
39
|
+
*/
|
|
40
|
+
readonly ask: (question: string) => Effect.Effect<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Finishes with a harness failure, which fails the Attempt with `AgentFailure` unless the parent
|
|
43
|
+
* reports otherwise.
|
|
44
|
+
*/
|
|
45
|
+
readonly fail: (message: string) => Effect.Effect<void>;
|
|
46
|
+
/** Completes when the parent's tool call interrupts the child (abort, cancel, or shutdown). */
|
|
47
|
+
readonly interrupted: Effect.Effect<void>;
|
|
48
|
+
readonly interventions: Effect.Effect<ReadonlyArray<AttemptChannel.OperatorAction>>;
|
|
49
|
+
}
|
|
50
|
+
declare const StubChildren_base: Context.ServiceClass<StubChildren, "@usine/durable/testing/StubChildren", {
|
|
51
|
+
readonly next: Effect.Effect<StubChild>;
|
|
52
|
+
}>;
|
|
53
|
+
/** The children launched by the stub backend, in launch order. */
|
|
54
|
+
export declare class StubChildren extends StubChildren_base {
|
|
55
|
+
}
|
|
56
|
+
/** A `ChildBackend` whose children the test drives through `StubChildren`. */
|
|
57
|
+
export declare const stubChildBackendLayer: Layer.Layer<ChildBackend | StubChildren>;
|
|
58
|
+
export interface DurableTestingOptions {
|
|
59
|
+
/** The SQLite file path. To simulate a restart, build another layer on the same file. */
|
|
60
|
+
readonly database: string;
|
|
61
|
+
/** The parent model's answers, one per request. */
|
|
62
|
+
readonly parent: ReadonlyArray<ParentStep>;
|
|
63
|
+
}
|
|
64
|
+
/** Returns a durable Attempt runtime with a scripted parent model and stub children. */
|
|
65
|
+
export declare const layer: (options: DurableTestingOptions) => Layer.Layer<AttemptRuntime | ChildBackend | import("./harness.ts").DurableHarness | StubChildren, import("./harness.ts").DurableHarnessError, never>;
|
|
66
|
+
export interface StubParentContext {
|
|
67
|
+
/**
|
|
68
|
+
* The request passed to this `execute` call, which differs from the stored request on reattach.
|
|
69
|
+
*/
|
|
70
|
+
readonly request: AttemptRequest;
|
|
71
|
+
/** Records an outbound envelope with the task's next sequence number. */
|
|
72
|
+
readonly emit: (payload: AttemptChannel.OutboundPayload) => Effect.Effect<void, AttemptFailure>;
|
|
73
|
+
readonly session: ParentSession;
|
|
74
|
+
/** Whether this call reattached a task started by a previous runtime. */
|
|
75
|
+
readonly reattached: boolean;
|
|
76
|
+
}
|
|
77
|
+
/** The stub parent's work after `Started`, returning the final message or a full report. */
|
|
78
|
+
export type StubParent = (context: StubParentContext) => Effect.Effect<string | AttemptReport, AttemptFailure>;
|
|
79
|
+
type StubTaskState = {
|
|
80
|
+
readonly _tag: "live";
|
|
81
|
+
} | {
|
|
82
|
+
readonly _tag: "finished";
|
|
83
|
+
readonly report: AttemptReport;
|
|
84
|
+
result: Option.Option<StepResult>;
|
|
85
|
+
} | {
|
|
86
|
+
readonly _tag: "canceled";
|
|
87
|
+
};
|
|
88
|
+
interface StubTask {
|
|
89
|
+
readonly request: AttemptRequest;
|
|
90
|
+
state: StubTaskState;
|
|
91
|
+
outbound: number;
|
|
92
|
+
inbound: number;
|
|
93
|
+
}
|
|
94
|
+
/** Stub runtime storage that persists across runtime rebuilds, to simulate a restart. */
|
|
95
|
+
export declare class StubStorage {
|
|
96
|
+
/** The stub tasks by Attempt ID, with their creating request and state. */
|
|
97
|
+
readonly tasks: Map<string & import("effect/Brand").Brand<"AttemptId">, StubTask>;
|
|
98
|
+
/** The time stored by `recordUnsupervised`, by Attempt ID. */
|
|
99
|
+
readonly unsupervised: Map<string & import("effect/Brand").Brand<"AttemptId">, Duration.Duration>;
|
|
100
|
+
}
|
|
101
|
+
/** Completes immediately with `Completed: <task>`. */
|
|
102
|
+
export declare const completes: StubParent;
|
|
103
|
+
/** Waits `millis` milliseconds, then completes like `completes`. */
|
|
104
|
+
export declare const worksFor: (millis: number) => StubParent;
|
|
105
|
+
/**
|
|
106
|
+
* Returns an in-memory `AttemptRuntime` over `storage` for tests that need no parent model. An
|
|
107
|
+
* interrupted `execute` or a failing parent leaves the task live until it is canceled.
|
|
108
|
+
*/
|
|
109
|
+
export declare const stubAttemptRuntime: (storage: StubStorage, parent?: StubParent) => Layer.Layer<AttemptRuntime, never, never>;
|
|
110
|
+
export {};
|
|
111
|
+
//# sourceMappingURL=testing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,EACL,KAAK,gBAAgB,EAKtB,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EAML,YAAY,EACZ,KAAK,YAAY,EAKlB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,KAAK,iBAAiB,EAEtB,aAAa,EAMd,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,cAAc,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAgB,KAAK,cAAc,EAAgB,MAAM,6BAA6B,CAAC;AAC9F,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAEL,OAAO,EAGP,QAAQ,EACR,MAAM,EACN,KAAK,EACL,MAAM,EAGP,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,aAAa,EACb,KAAK,cAAc,EACnB,cAAc,EAKf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