@autumnsgrove/lyra 0.0.0-stage → 0.0.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/adapters/cloudflare/index.d.ts +11 -0
- package/dist/adapters/cloudflare/index.d.ts.map +1 -0
- package/dist/adapters/cloudflare/index.js +11 -0
- package/dist/adapters/cloudflare/index.js.map +1 -0
- package/dist/adapters/cloudflare/secrets.d.ts +15 -0
- package/dist/adapters/cloudflare/secrets.d.ts.map +1 -0
- package/dist/adapters/cloudflare/secrets.js +24 -0
- package/dist/adapters/cloudflare/secrets.js.map +1 -0
- package/dist/adapters/cloudflare/storage.d.ts +43 -0
- package/dist/adapters/cloudflare/storage.d.ts.map +1 -0
- package/dist/adapters/cloudflare/storage.js +89 -0
- package/dist/adapters/cloudflare/storage.js.map +1 -0
- package/dist/adapters/cloudflare/waking.d.ts +34 -0
- package/dist/adapters/cloudflare/waking.d.ts.map +1 -0
- package/dist/adapters/cloudflare/waking.js +63 -0
- package/dist/adapters/cloudflare/waking.js.map +1 -0
- package/dist/adapters/memory/ids.d.ts +12 -0
- package/dist/adapters/memory/ids.d.ts.map +1 -0
- package/dist/adapters/memory/ids.js +20 -0
- package/dist/adapters/memory/ids.js.map +1 -0
- package/dist/adapters/memory/index.d.ts +13 -0
- package/dist/adapters/memory/index.d.ts.map +1 -0
- package/dist/adapters/memory/index.js +13 -0
- package/dist/adapters/memory/index.js.map +1 -0
- package/dist/adapters/memory/secrets.d.ts +14 -0
- package/dist/adapters/memory/secrets.d.ts.map +1 -0
- package/dist/adapters/memory/secrets.js +19 -0
- package/dist/adapters/memory/secrets.js.map +1 -0
- package/dist/adapters/memory/storage.d.ts +24 -0
- package/dist/adapters/memory/storage.d.ts.map +1 -0
- package/dist/adapters/memory/storage.js +40 -0
- package/dist/adapters/memory/storage.js.map +1 -0
- package/dist/adapters/memory/waking.d.ts +21 -0
- package/dist/adapters/memory/waking.d.ts.map +1 -0
- package/dist/adapters/memory/waking.js +29 -0
- package/dist/adapters/memory/waking.js.map +1 -0
- package/dist/core/clock.d.ts +22 -0
- package/dist/core/clock.d.ts.map +1 -0
- package/dist/core/clock.js +10 -0
- package/dist/core/clock.js.map +1 -0
- package/dist/core/conversation.d.ts +28 -0
- package/dist/core/conversation.d.ts.map +1 -0
- package/dist/core/conversation.js +9 -0
- package/dist/core/conversation.js.map +1 -0
- package/dist/core/decode-reply.d.ts +28 -0
- package/dist/core/decode-reply.d.ts.map +1 -0
- package/dist/core/decode-reply.js +158 -0
- package/dist/core/decode-reply.js.map +1 -0
- package/dist/core/define-recipe.d.ts +54 -0
- package/dist/core/define-recipe.d.ts.map +1 -0
- package/dist/core/define-recipe.js +96 -0
- package/dist/core/define-recipe.js.map +1 -0
- package/dist/core/events.d.ts +98 -0
- package/dist/core/events.d.ts.map +1 -0
- package/dist/core/events.js +14 -0
- package/dist/core/events.js.map +1 -0
- package/dist/core/execute-tools.d.ts +61 -0
- package/dist/core/execute-tools.d.ts.map +1 -0
- package/dist/core/execute-tools.js +147 -0
- package/dist/core/execute-tools.js.map +1 -0
- package/dist/core/finish.d.ts +53 -0
- package/dist/core/finish.d.ts.map +1 -0
- package/dist/core/finish.js +106 -0
- package/dist/core/finish.js.map +1 -0
- package/dist/core/handles.d.ts +34 -0
- package/dist/core/handles.d.ts.map +1 -0
- package/dist/core/handles.js +81 -0
- package/dist/core/handles.js.map +1 -0
- package/dist/core/json.d.ts +19 -0
- package/dist/core/json.d.ts.map +1 -0
- package/dist/core/json.js +41 -0
- package/dist/core/json.js.map +1 -0
- package/dist/core/limits.d.ts +53 -0
- package/dist/core/limits.d.ts.map +1 -0
- package/dist/core/limits.js +81 -0
- package/dist/core/limits.js.map +1 -0
- package/dist/core/model.d.ts +66 -0
- package/dist/core/model.d.ts.map +1 -0
- package/dist/core/model.js +10 -0
- package/dist/core/model.js.map +1 -0
- package/dist/core/recipe.d.ts +45 -0
- package/dist/core/recipe.d.ts.map +1 -0
- package/dist/core/recipe.js +102 -0
- package/dist/core/recipe.js.map +1 -0
- package/dist/core/result.d.ts +38 -0
- package/dist/core/result.d.ts.map +1 -0
- package/dist/core/result.js +35 -0
- package/dist/core/result.js.map +1 -0
- package/dist/core/resume.d.ts +71 -0
- package/dist/core/resume.d.ts.map +1 -0
- package/dist/core/resume.js +133 -0
- package/dist/core/resume.js.map +1 -0
- package/dist/core/run-handle.d.ts +39 -0
- package/dist/core/run-handle.d.ts.map +1 -0
- package/dist/core/run-handle.js +101 -0
- package/dist/core/run-handle.js.map +1 -0
- package/dist/core/run.d.ts +136 -0
- package/dist/core/run.d.ts.map +1 -0
- package/dist/core/run.js +1095 -0
- package/dist/core/run.js.map +1 -0
- package/dist/core/runtime.d.ts +81 -0
- package/dist/core/runtime.d.ts.map +1 -0
- package/dist/core/runtime.js +201 -0
- package/dist/core/runtime.js.map +1 -0
- package/dist/core/schema.d.ts +119 -0
- package/dist/core/schema.d.ts.map +1 -0
- package/dist/core/schema.js +469 -0
- package/dist/core/schema.js.map +1 -0
- package/dist/core/slots.d.ts +32 -0
- package/dist/core/slots.d.ts.map +1 -0
- package/dist/core/slots.js +10 -0
- package/dist/core/slots.js.map +1 -0
- package/dist/core/state.d.ts +18 -0
- package/dist/core/state.d.ts.map +1 -0
- package/dist/core/state.js +53 -0
- package/dist/core/state.js.map +1 -0
- package/dist/core/system-clock.d.ts +17 -0
- package/dist/core/system-clock.d.ts.map +1 -0
- package/dist/core/system-clock.js +59 -0
- package/dist/core/system-clock.js.map +1 -0
- package/dist/core/tool.d.ts +74 -0
- package/dist/core/tool.d.ts.map +1 -0
- package/dist/core/tool.js +48 -0
- package/dist/core/tool.js.map +1 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -0
- package/dist/record/entries.d.ts +152 -0
- package/dist/record/entries.d.ts.map +1 -0
- package/dist/record/entries.js +497 -0
- package/dist/record/entries.js.map +1 -0
- package/dist/record/load.d.ts +29 -0
- package/dist/record/load.d.ts.map +1 -0
- package/dist/record/load.js +106 -0
- package/dist/record/load.js.map +1 -0
- package/dist/record/replay.d.ts +16 -0
- package/dist/record/replay.d.ts.map +1 -0
- package/dist/record/replay.js +63 -0
- package/dist/record/replay.js.map +1 -0
- package/dist/record/truncate.d.ts +25 -0
- package/dist/record/truncate.d.ts.map +1 -0
- package/dist/record/truncate.js +167 -0
- package/dist/record/truncate.js.map +1 -0
- package/dist/testkit/clock.d.ts +19 -0
- package/dist/testkit/clock.d.ts.map +1 -0
- package/dist/testkit/clock.js +77 -0
- package/dist/testkit/clock.js.map +1 -0
- package/dist/testkit/crashing-storage.d.ts +23 -0
- package/dist/testkit/crashing-storage.d.ts.map +1 -0
- package/dist/testkit/crashing-storage.js +39 -0
- package/dist/testkit/crashing-storage.js.map +1 -0
- package/dist/testkit/index.d.ts +15 -0
- package/dist/testkit/index.d.ts.map +1 -0
- package/dist/testkit/index.js +15 -0
- package/dist/testkit/index.js.map +1 -0
- package/dist/testkit/model.d.ts +53 -0
- package/dist/testkit/model.d.ts.map +1 -0
- package/dist/testkit/model.js +80 -0
- package/dist/testkit/model.js.map +1 -0
- package/dist/testkit/scenario.d.ts +55 -0
- package/dist/testkit/scenario.d.ts.map +1 -0
- package/dist/testkit/scenario.js +505 -0
- package/dist/testkit/scenario.js.map +1 -0
- package/dist/testkit/storage.d.ts +18 -0
- package/dist/testkit/storage.d.ts.map +1 -0
- package/dist/testkit/storage.js +27 -0
- package/dist/testkit/storage.js.map +1 -0
- package/dist/testkit/timeline-recipe.d.ts +59 -0
- package/dist/testkit/timeline-recipe.d.ts.map +1 -0
- package/dist/testkit/timeline-recipe.js +322 -0
- package/dist/testkit/timeline-recipe.js.map +1 -0
- package/dist/testkit/tools.d.ts +47 -0
- package/dist/testkit/tools.d.ts.map +1 -0
- package/dist/testkit/tools.js +82 -0
- package/dist/testkit/tools.js.map +1 -0
- package/package.json +42 -5
- package/README.md +0 -3
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one file allowed to touch the real clock and real randomness.
|
|
3
|
+
*
|
|
4
|
+
* `scripts/importcheck.mjs` fails any other production file under `src/` that
|
|
5
|
+
* calls `Date.now`, `new Date(`, `setTimeout`, `setInterval`, `Math.random` or
|
|
6
|
+
* `console.`, so time and ids are injected everywhere else and a test can
|
|
7
|
+
* control them (docs/implementation/README.md, calls made in advance, 5).
|
|
8
|
+
*/
|
|
9
|
+
/** Bytes in an id's random half. 128 bits is what decision 85 wants for an unguessable id. */
|
|
10
|
+
const ID_BITS = 128;
|
|
11
|
+
/** A clock over the host's own time. Takes the real ones as arguments so this file is testable. */
|
|
12
|
+
function clockFrom(nowMs, wait, cancelWait) {
|
|
13
|
+
return {
|
|
14
|
+
now: nowMs,
|
|
15
|
+
sleep(ms, signal) {
|
|
16
|
+
return new Promise((resolve, reject) => {
|
|
17
|
+
if (signal?.aborted === true) {
|
|
18
|
+
reject(aborted());
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const handle = wait(() => {
|
|
22
|
+
signal?.removeEventListener("abort", onAbort);
|
|
23
|
+
resolve();
|
|
24
|
+
}, ms);
|
|
25
|
+
function onAbort() {
|
|
26
|
+
cancelWait(handle);
|
|
27
|
+
reject(aborted());
|
|
28
|
+
}
|
|
29
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function aborted() {
|
|
35
|
+
const error = new Error("sleep aborted");
|
|
36
|
+
error.name = "AbortError";
|
|
37
|
+
return error;
|
|
38
|
+
}
|
|
39
|
+
/** The host's clock. Use it only where nothing better exists: a test injects a fake. */
|
|
40
|
+
export function systemClock() {
|
|
41
|
+
return clockFrom(() => Date.now(), (callback, ms) => setTimeout(callback, ms), (handle) => clearTimeout(handle));
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Ids from the platform's cryptographic random source, as hex. A prefix such as
|
|
45
|
+
* `e` keeps a record readable; the random half is what cannot be guessed.
|
|
46
|
+
*/
|
|
47
|
+
export function systemIds() {
|
|
48
|
+
return {
|
|
49
|
+
next(prefix) {
|
|
50
|
+
const bytes = crypto.getRandomValues(new Uint8Array(ID_BITS / 8));
|
|
51
|
+
let hex = "";
|
|
52
|
+
for (const byte of bytes) {
|
|
53
|
+
hex += byte.toString(16).padStart(2, "0");
|
|
54
|
+
}
|
|
55
|
+
return `${prefix}_${hex}`;
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=system-clock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system-clock.js","sourceRoot":"","sources":["../../src/core/system-clock.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,8FAA8F;AAC9F,MAAM,OAAO,GAAG,GAAG,CAAC;AAEpB,mGAAmG;AACnG,SAAS,SAAS,CACjB,KAAmB,EACnB,IAAkD,EAClD,UAAoC;IAEpC,OAAO;QACN,GAAG,EAAE,KAAK;QACV,KAAK,CAAC,EAAE,EAAE,MAAM;YACf,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBAC5C,IAAI,MAAM,EAAE,OAAO,KAAK,IAAI,EAAE,CAAC;oBAC9B,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;oBAClB,OAAO;gBACR,CAAC;gBACD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE;oBACxB,MAAM,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;oBAC9C,OAAO,EAAE,CAAC;gBACX,CAAC,EAAE,EAAE,CAAC,CAAC;gBACP,SAAS,OAAO;oBACf,UAAU,CAAC,MAAM,CAAC,CAAC;oBACnB,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;gBACnB,CAAC;gBACD,MAAM,EAAE,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;YAC5D,CAAC,CAAC,CAAC;QACJ,CAAC;KACD,CAAC;AACH,CAAC;AAED,SAAS,OAAO;IACf,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;IACzC,KAAK,CAAC,IAAI,GAAG,YAAY,CAAC;IAC1B,OAAO,KAAK,CAAC;AACd,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,WAAW;IAC1B,OAAO,SAAS,CACf,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,EAChB,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,CAAC,EAC1C,CAAC,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,CAChC,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,SAAS;IACxB,OAAO;QACN,IAAI,CAAC,MAAM;YACV,MAAM,KAAK,GAAG,MAAM,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC;YAClE,IAAI,GAAG,GAAG,EAAE,CAAC;YACb,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;gBAC1B,GAAG,IAAI,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;YAC3C,CAAC;YACD,OAAO,GAAG,MAAM,IAAI,GAAG,EAAE,CAAC;QAC3B,CAAC;KACD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A tool, as step 1 keeps it.
|
|
3
|
+
*
|
|
4
|
+
* Step 3 adds recipes, argument validation and handles. What matters now is
|
|
5
|
+
* that a tool receives untrusted arguments and can only answer with an outcome:
|
|
6
|
+
* an error is a result the model corrects, and a thrown exception is caught by
|
|
7
|
+
* the loop, so a tool can never take a run down (decision 21).
|
|
8
|
+
*/
|
|
9
|
+
import type { JsonObject, JsonValue } from "./json.js";
|
|
10
|
+
import type { ToolSpec } from "./model.js";
|
|
11
|
+
import { type InferSchema, type Validation } from "./schema.js";
|
|
12
|
+
export type { InferSchema };
|
|
13
|
+
export interface ToolContext<S = unknown> {
|
|
14
|
+
/** Fires when the run is stopped or the tool's deadline passes. */
|
|
15
|
+
signal: AbortSignal;
|
|
16
|
+
runId: string;
|
|
17
|
+
callId: string;
|
|
18
|
+
/**
|
|
19
|
+
* A stable name for this call across an interruption: `runId` and `callId`, so a
|
|
20
|
+
* tool that changes something can make repeating it harmless by deduping on this
|
|
21
|
+
* (decision 24).
|
|
22
|
+
*/
|
|
23
|
+
callKey: string;
|
|
24
|
+
/**
|
|
25
|
+
* The recipe's state. A tool may read it here and must not change it: `apply` is
|
|
26
|
+
* the only writer, so a live run and a replayed one cannot drift (decision 112).
|
|
27
|
+
*/
|
|
28
|
+
state: S;
|
|
29
|
+
}
|
|
30
|
+
export interface ToolOutcome {
|
|
31
|
+
isError: boolean;
|
|
32
|
+
/** What the model reads. */
|
|
33
|
+
content: string;
|
|
34
|
+
/** Optional structured detail for a viewer. Never sent to the model. */
|
|
35
|
+
details?: JsonValue;
|
|
36
|
+
/**
|
|
37
|
+
* Set only by `finish`, once the job really is done (decision 25). Step 3
|
|
38
|
+
* gives `finish` the coverage check that makes this claim true.
|
|
39
|
+
*/
|
|
40
|
+
done?: true;
|
|
41
|
+
}
|
|
42
|
+
export interface Tool {
|
|
43
|
+
spec: ToolSpec;
|
|
44
|
+
/** Whether repeating it after an interruption is harmless (decision 24). Default no. */
|
|
45
|
+
safeToRepeat?: boolean;
|
|
46
|
+
execute(args: unknown, ctx: ToolContext): Promise<ToolOutcome>;
|
|
47
|
+
/**
|
|
48
|
+
* The check the loop runs before this tool executes, when the tool has a schema.
|
|
49
|
+
* A tool made by hand (a test fake) has none and is not checked.
|
|
50
|
+
*/
|
|
51
|
+
validate?(args: unknown): Validation<unknown>;
|
|
52
|
+
/**
|
|
53
|
+
* The only place a recipe's state changes (decision 112). The core calls it after
|
|
54
|
+
* a successful execute, and again for every saved result on a resume.
|
|
55
|
+
*/
|
|
56
|
+
apply?(state: unknown, args: unknown, outcome: ToolOutcome): unknown;
|
|
57
|
+
/**
|
|
58
|
+
* Set by `createFinishTool`, so `defineRecipe` can tell a real done-check from a
|
|
59
|
+
* tool that merely borrowed the name (RCP04).
|
|
60
|
+
*/
|
|
61
|
+
finish?: true;
|
|
62
|
+
}
|
|
63
|
+
/** A tool with no parameters, which is the shape `finish` and the fakes have. */
|
|
64
|
+
export declare const NO_PARAMETERS: JsonObject;
|
|
65
|
+
export interface DefineToolOptions<A extends JsonObject, S> {
|
|
66
|
+
name: string;
|
|
67
|
+
description: string;
|
|
68
|
+
parameters: A;
|
|
69
|
+
safeToRepeat?: boolean;
|
|
70
|
+
execute(args: InferSchema<A>, ctx: ToolContext<S>): Promise<ToolOutcome>;
|
|
71
|
+
apply?(state: S, args: InferSchema<A>, outcome: ToolOutcome): S;
|
|
72
|
+
}
|
|
73
|
+
export declare function defineTool<const A extends JsonObject, S = unknown>(options: DefineToolOptions<A, S>): Tool;
|
|
74
|
+
//# sourceMappingURL=tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/core/tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAIN,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,WAAW,EAAE,CAAC;AAE5B,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,OAAO;IACvC,mEAAmE;IACnE,MAAM,EAAE,WAAW,CAAC;IACpB,KAA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AC,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,WAAW,GAAG,CAAC,CAAC;CAChE;AAED,wBAAgB,UAAU,CAAC,KAAK,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,GAAG,OAAO,EACjE,OAAO,EAAE,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,GAC9B,IAAI,CAoCN"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A tool, as step 1 keeps it.
|
|
3
|
+
*
|
|
4
|
+
* Step 3 adds recipes, argument validation and handles. What matters now is
|
|
5
|
+
* that a tool receives untrusted arguments and can only answer with an outcome:
|
|
6
|
+
* an error is a result the model corrects, and a thrown exception is caught by
|
|
7
|
+
* the loop, so a tool can never take a run down (decision 21).
|
|
8
|
+
*/
|
|
9
|
+
import { compileSchema, formatErrors, validateValue, } from "./schema.js";
|
|
10
|
+
/** A tool with no parameters, which is the shape `finish` and the fakes have. */
|
|
11
|
+
export const NO_PARAMETERS = { type: "object", properties: {} };
|
|
12
|
+
export function defineTool(options) {
|
|
13
|
+
// A schema this build cannot compile is a tool author's mistake, and it is
|
|
14
|
+
// thrown here rather than letting the tool silently check nothing (TOL04).
|
|
15
|
+
const compiled = compileSchema(options.parameters);
|
|
16
|
+
const apply = options.apply;
|
|
17
|
+
const tool = {
|
|
18
|
+
spec: {
|
|
19
|
+
name: options.name,
|
|
20
|
+
description: options.description,
|
|
21
|
+
parameters: options.parameters,
|
|
22
|
+
},
|
|
23
|
+
validate: (args) => validateValue(compiled, args),
|
|
24
|
+
execute: async (args, ctx) => {
|
|
25
|
+
// The loop checks arguments before calling this, but a tool called directly
|
|
26
|
+
// (a test, a later host) still never sees a value its schema refuses.
|
|
27
|
+
const checked = validateValue(compiled, args);
|
|
28
|
+
if (!checked.ok) {
|
|
29
|
+
return { isError: true, content: formatErrors(checked.errors) };
|
|
30
|
+
}
|
|
31
|
+
return options.execute(checked.value, ctx);
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
if (options.safeToRepeat !== undefined) {
|
|
35
|
+
tool.safeToRepeat = options.safeToRepeat;
|
|
36
|
+
}
|
|
37
|
+
if (apply !== undefined) {
|
|
38
|
+
tool.apply = (state, args, outcome) => {
|
|
39
|
+
const checked = validateValue(compiled, args);
|
|
40
|
+
if (!checked.ok) {
|
|
41
|
+
return state;
|
|
42
|
+
}
|
|
43
|
+
return apply(state, checked.value, outcome);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return tool;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../../src/core/tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EACN,aAAa,EACb,YAAY,EACZ,aAAa,GAGb,MAAM,aAAa,CAAC;AAyDrB,iFAAiF;AACjF,MAAM,CAAC,MAAM,aAAa,GAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC;AAW5E,MAAM,UAAU,UAAU,CACzB,OAAgC;IAEhC,2EAA2E;IAC3E,2EAA2E;IAC3E,MAAM,QAAQ,GAAG,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACnD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAE5B,MAAM,IAAI,GAAS;QAClB,IAAI,EAAE;YACL,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,UAAU,EAAE,OAAO,CAAC,UAAU;SAC9B;QACD,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAiB,QAAQ,EAAE,IAAI,CAAC;QACjE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE;YAC5B,4EAA4E;YAC5E,sEAAsE;YACtE,MAAM,OAAO,GAAG,aAAa,CAAiB,QAAQ,EAAE,IAAI,CAAC,CAAC;YAC9D,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;gBACjB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YACjE,CAAC;YACD,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,GAAqB,CAAC,CAAC;QAC9D,CAAC;KACD,CAAC;IACF,IAAI,OAAO,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;QACxC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;IAC1C,CAAC;IACD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;YACrC,MAAM,OAAO,GAAG,aAAa,CAAiB,QAAQ,EAAE,IAAI,CAAC,CAAC;YAC9D,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;gBACjB,OAAO,KAAK,CAAC;YACd,CAAC;YACD,OAAO,KAAK,CAAC,KAAU,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAClD,CAAC,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The core entry point.
|
|
3
|
+
*
|
|
4
|
+
* Everything a host writes against: the slots, the vocabulary, the record, and
|
|
5
|
+
* the loop. The types here are the whole contract, so an adapter depends on
|
|
6
|
+
* this entry point and the core depends on nothing (decision 69).
|
|
7
|
+
*
|
|
8
|
+
* Everything in here uses web-standard APIs only. No `node:*` imports, so the
|
|
9
|
+
* same code runs on Cloudflare Workers and on Node (decisions 12 and 13).
|
|
10
|
+
*/
|
|
11
|
+
export * from "./core/clock.js";
|
|
12
|
+
export * from "./core/conversation.js";
|
|
13
|
+
export * from "./core/decode-reply.js";
|
|
14
|
+
export * from "./core/define-recipe.js";
|
|
15
|
+
export * from "./core/events.js";
|
|
16
|
+
export * from "./core/execute-tools.js";
|
|
17
|
+
export * from "./core/finish.js";
|
|
18
|
+
export * from "./core/handles.js";
|
|
19
|
+
export * from "./core/json.js";
|
|
20
|
+
export * from "./core/limits.js";
|
|
21
|
+
export * from "./core/model.js";
|
|
22
|
+
export * from "./core/result.js";
|
|
23
|
+
export * from "./core/recipe.js";
|
|
24
|
+
export * from "./core/run.js";
|
|
25
|
+
export * from "./core/run-handle.js";
|
|
26
|
+
export * from "./core/runtime.js";
|
|
27
|
+
export * from "./core/schema.js";
|
|
28
|
+
export * from "./core/slots.js";
|
|
29
|
+
export * from "./core/state.js";
|
|
30
|
+
export * from "./core/system-clock.js";
|
|
31
|
+
export * from "./core/tool.js";
|
|
32
|
+
export * from "./record/entries.js";
|
|
33
|
+
export * from "./record/load.js";
|
|
34
|
+
export * from "./record/replay.js";
|
|
35
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The core entry point.
|
|
3
|
+
*
|
|
4
|
+
* Everything a host writes against: the slots, the vocabulary, the record, and
|
|
5
|
+
* the loop. The types here are the whole contract, so an adapter depends on
|
|
6
|
+
* this entry point and the core depends on nothing (decision 69).
|
|
7
|
+
*
|
|
8
|
+
* Everything in here uses web-standard APIs only. No `node:*` imports, so the
|
|
9
|
+
* same code runs on Cloudflare Workers and on Node (decisions 12 and 13).
|
|
10
|
+
*/
|
|
11
|
+
export * from "./core/clock.js";
|
|
12
|
+
export * from "./core/conversation.js";
|
|
13
|
+
export * from "./core/decode-reply.js";
|
|
14
|
+
export * from "./core/define-recipe.js";
|
|
15
|
+
export * from "./core/events.js";
|
|
16
|
+
export * from "./core/execute-tools.js";
|
|
17
|
+
export * from "./core/finish.js";
|
|
18
|
+
export * from "./core/handles.js";
|
|
19
|
+
export * from "./core/json.js";
|
|
20
|
+
export * from "./core/limits.js";
|
|
21
|
+
export * from "./core/model.js";
|
|
22
|
+
export * from "./core/result.js";
|
|
23
|
+
export * from "./core/recipe.js";
|
|
24
|
+
export * from "./core/run.js";
|
|
25
|
+
export * from "./core/run-handle.js";
|
|
26
|
+
export * from "./core/runtime.js";
|
|
27
|
+
export * from "./core/schema.js";
|
|
28
|
+
export * from "./core/slots.js";
|
|
29
|
+
export * from "./core/state.js";
|
|
30
|
+
export * from "./core/system-clock.js";
|
|
31
|
+
export * from "./core/tool.js";
|
|
32
|
+
export * from "./record/entries.js";
|
|
33
|
+
export * from "./record/load.js";
|
|
34
|
+
export * from "./record/replay.js";
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The record's entries: their types, and the one place they are written and read
|
|
3
|
+
* (docs/run-record.md, decision 31).
|
|
4
|
+
*
|
|
5
|
+
* The core owns this format. Everything that saves a record saves these lines,
|
|
6
|
+
* and everything that reads one comes back through `load.ts`, so the shape is
|
|
7
|
+
* validated in a single place and an adapter never has to know what an entry is.
|
|
8
|
+
*
|
|
9
|
+
* Encoding is deterministic: the fields go out in a fixed order, so the same run
|
|
10
|
+
* produces the same bytes and a test can compare two records directly.
|
|
11
|
+
*/
|
|
12
|
+
import type { JsonValue } from "../core/json.js";
|
|
13
|
+
import type { FinishReason, ToolCall, Usage } from "../core/model.js";
|
|
14
|
+
import { type Result } from "../core/result.js";
|
|
15
|
+
/** The format this code writes. A record of any other version is refused, not guessed at. */
|
|
16
|
+
export declare const RECORD_VERSION = 1;
|
|
17
|
+
/** One tool as the header pinned it: its name, and the hash of its name and arguments. */
|
|
18
|
+
export interface ToolStamp {
|
|
19
|
+
name: string;
|
|
20
|
+
hash: string;
|
|
21
|
+
}
|
|
22
|
+
/** What a run started with, so a resume after a deploy can check it (decision 91). */
|
|
23
|
+
export interface RecipeStamp {
|
|
24
|
+
name: string;
|
|
25
|
+
version: number;
|
|
26
|
+
toolSetHash: string;
|
|
27
|
+
/** Added in step 2 (REC06): a reworded prompt alone does not stop a run. */
|
|
28
|
+
instructionsHash?: string;
|
|
29
|
+
/** Added in step 2: one hash per tool, so a change can name the tools it touched. */
|
|
30
|
+
tools?: readonly ToolStamp[];
|
|
31
|
+
}
|
|
32
|
+
export interface RecordHeader {
|
|
33
|
+
type: "header";
|
|
34
|
+
v: number;
|
|
35
|
+
run: string;
|
|
36
|
+
task: string;
|
|
37
|
+
startedAt: number;
|
|
38
|
+
host: string;
|
|
39
|
+
recipe?: RecipeStamp;
|
|
40
|
+
}
|
|
41
|
+
/** Every entry carries its own id and the id of the entry before it (decision 30). */
|
|
42
|
+
interface EntryBase {
|
|
43
|
+
id: string;
|
|
44
|
+
parent: string | null;
|
|
45
|
+
ts: number;
|
|
46
|
+
}
|
|
47
|
+
export type MessageLabel = "task" | "steer" | "follow_up" | "reminder";
|
|
48
|
+
/** What was cut to keep an entry under the cap, and how much (decision 90). */
|
|
49
|
+
export interface Truncation {
|
|
50
|
+
field: "content" | "details" | "text" | "reasoning" | "arguments";
|
|
51
|
+
droppedBytes: number;
|
|
52
|
+
}
|
|
53
|
+
export interface UserMessageEntry extends EntryBase {
|
|
54
|
+
type: "user_message";
|
|
55
|
+
label: MessageLabel;
|
|
56
|
+
text: string;
|
|
57
|
+
/**
|
|
58
|
+
* The task's input as JSON, saved only on the `task` message, so a resume can run
|
|
59
|
+
* the recipe's `setup` again and rebuild the state it made (decision 112).
|
|
60
|
+
*/
|
|
61
|
+
details?: JsonValue;
|
|
62
|
+
}
|
|
63
|
+
export interface AssistantMessageEntry extends EntryBase {
|
|
64
|
+
type: "assistant_message";
|
|
65
|
+
text: string;
|
|
66
|
+
reasoning?: string;
|
|
67
|
+
toolCalls: ToolCall[];
|
|
68
|
+
model: string;
|
|
69
|
+
usage: Usage;
|
|
70
|
+
finishReason: FinishReason;
|
|
71
|
+
/** How many times this turn was tried again after a retryable model failure (decision 26). */
|
|
72
|
+
retries?: number;
|
|
73
|
+
/** Set when this entry was cut to fit the cap; the text carries the marker too. */
|
|
74
|
+
truncated?: Truncation;
|
|
75
|
+
}
|
|
76
|
+
export interface ToolMessageEntry extends EntryBase {
|
|
77
|
+
type: "tool_message";
|
|
78
|
+
toolCallId: string;
|
|
79
|
+
isError: boolean;
|
|
80
|
+
content: string;
|
|
81
|
+
/** For a person reading the record, never for the model. */
|
|
82
|
+
details?: JsonValue;
|
|
83
|
+
/**
|
|
84
|
+
* The done-check passed on this call (decision 25). The record keeps it so a
|
|
85
|
+
* resume after a kill can tell an accepted finish from any other result, instead
|
|
86
|
+
* of asking the model for a turn it already gave.
|
|
87
|
+
*/
|
|
88
|
+
done?: true;
|
|
89
|
+
/** Set when this entry was cut to fit the cap; the content carries the marker too. */
|
|
90
|
+
truncated?: Truncation;
|
|
91
|
+
}
|
|
92
|
+
export type RunState = "running" | "parked" | "done" | "failed" | "resumed";
|
|
93
|
+
export interface StatusEntry extends EntryBase {
|
|
94
|
+
type: "status";
|
|
95
|
+
state: RunState;
|
|
96
|
+
/** Why it parked: `stopped`, `stuck`, and the reasons later steps add. */
|
|
97
|
+
reason?: string;
|
|
98
|
+
/** Which part of that reason: a limit's `steps`, `tokens`, `time` or `cost`. */
|
|
99
|
+
detail?: string;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The recipe moved while the run was alive (REC06, REC09): a new version, reworded
|
|
103
|
+
* instructions, or a tool set a person let it continue with. The new pin becomes
|
|
104
|
+
* the one the next resume compares against.
|
|
105
|
+
*/
|
|
106
|
+
export interface RecipeUpdatedEntry extends EntryBase {
|
|
107
|
+
type: "recipe_updated";
|
|
108
|
+
/** Absent when the record had no pin at all, which is what a newer Lyra adds. */
|
|
109
|
+
from?: RecipeStamp;
|
|
110
|
+
to: RecipeStamp;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* The run moved to another model because the first failed after its retries
|
|
114
|
+
* (decision 58). Written where it happened, so the record says which model made
|
|
115
|
+
* which turn.
|
|
116
|
+
*/
|
|
117
|
+
export interface FallbackEntry extends EntryBase {
|
|
118
|
+
type: "fallback";
|
|
119
|
+
from: string;
|
|
120
|
+
to: string;
|
|
121
|
+
reason: string;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Something worth saying that is not a turn, such as a limit the run cannot
|
|
125
|
+
* enforce (LIM05). `kind` says what it is, so a reader skips one it does not know
|
|
126
|
+
* and a later note does not need a format change.
|
|
127
|
+
*/
|
|
128
|
+
export interface NoteEntry extends EntryBase {
|
|
129
|
+
type: "note";
|
|
130
|
+
kind: string;
|
|
131
|
+
text: string;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* A kind this version does not know, kept exactly as it was saved, so a record
|
|
135
|
+
* written by a newer Lyra survives a reader that is older and is not rewritten
|
|
136
|
+
* into something smaller. Replay skips it.
|
|
137
|
+
*/
|
|
138
|
+
export interface UnknownEntry extends EntryBase {
|
|
139
|
+
type: "unknown";
|
|
140
|
+
raw: string;
|
|
141
|
+
}
|
|
142
|
+
export type RecordEntry = UserMessageEntry | AssistantMessageEntry | ToolMessageEntry | StatusEntry | FallbackEntry | RecipeUpdatedEntry | NoteEntry | UnknownEntry;
|
|
143
|
+
export declare function encodeHeader(header: RecordHeader): string;
|
|
144
|
+
export declare function encodeEntry(entry: RecordEntry): string;
|
|
145
|
+
export declare function decodeHeader(value: unknown): Result<RecordHeader>;
|
|
146
|
+
/**
|
|
147
|
+
* One entry, from a parsed line. `raw` is the line as saved, kept only when the
|
|
148
|
+
* kind is one this build does not know, so it can be written back unchanged.
|
|
149
|
+
*/
|
|
150
|
+
export declare function decodeEntry(value: unknown, raw: string): Result<RecordEntry>;
|
|
151
|
+
export {};
|
|
152
|
+
//# sourceMappingURL=entries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entries.d.ts","sourceRoot":"","sources":["../../src/record/entries.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAY,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE1D,6FAA6F;AAC7F,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC,0FAA0F;AAC1F,MAAM,WAAW,SAAS;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACb;AAED,sFAAsF;AACtF,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qFAAqF;IACrF,KAAK,CAAC,EAAE,SAAS,SAAS,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,YAAY;IAC5B,IAAI,EAAE,QAAQ,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;IACV,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,WAAW,CAAC;CACrB;AAED,sFAAsF;AACtF,UAAU,SAAS;IAClB,EAAE,EAAE,MAAM,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