@nodetool-ai/kernel 0.8.8 → 0.8.9-beta.2
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/.nodetool-build-stamp +1 -1
- package/dist/actor.d.ts +1 -479
- package/dist/actor.d.ts.map +1 -1
- package/dist/actor.js +1 -1911
- package/dist/actor.js.map +1 -1
- package/dist/correlation-analysis.d.ts +1 -103
- package/dist/correlation-analysis.d.ts.map +1 -1
- package/dist/correlation-analysis.js +1 -845
- package/dist/correlation-analysis.js.map +1 -1
- package/dist/durable-inbox.d.ts +1 -90
- package/dist/durable-inbox.d.ts.map +1 -1
- package/dist/durable-inbox.js +1 -210
- package/dist/durable-inbox.js.map +1 -1
- package/dist/dynamic-slots.d.ts +1 -72
- package/dist/dynamic-slots.d.ts.map +1 -1
- package/dist/dynamic-slots.js +1 -191
- package/dist/dynamic-slots.js.map +1 -1
- package/dist/edge-ids.d.ts +1 -10
- package/dist/edge-ids.d.ts.map +1 -1
- package/dist/edge-ids.js +1 -14
- package/dist/edge-ids.js.map +1 -1
- package/dist/graph-utils.d.ts +1 -71
- package/dist/graph-utils.d.ts.map +1 -1
- package/dist/graph-utils.js +1 -283
- package/dist/graph-utils.js.map +1 -1
- package/dist/graph.d.ts +1 -203
- package/dist/graph.d.ts.map +1 -1
- package/dist/graph.js +1 -867
- package/dist/graph.js.map +1 -1
- package/dist/inbox.d.ts +1 -264
- package/dist/inbox.d.ts.map +1 -1
- package/dist/inbox.js +1 -551
- package/dist/inbox.js.map +1 -1
- package/dist/index.d.ts +1 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -19
- package/dist/index.js.map +1 -1
- package/dist/io.d.ts +1 -188
- package/dist/io.d.ts.map +1 -1
- package/dist/io.js +1 -238
- package/dist/io.js.map +1 -1
- package/dist/loop.d.ts +1 -35
- package/dist/loop.d.ts.map +1 -1
- package/dist/loop.js +1 -165
- package/dist/loop.js.map +1 -1
- package/dist/message-stream.d.ts +1 -31
- package/dist/message-stream.d.ts.map +1 -1
- package/dist/message-stream.js +1 -63
- package/dist/message-stream.js.map +1 -1
- package/dist/predicates.d.ts +1 -7
- package/dist/predicates.d.ts.map +1 -1
- package/dist/predicates.js +1 -7
- package/dist/predicates.js.map +1 -1
- package/dist/run-state.d.ts +1 -64
- package/dist/run-state.d.ts.map +1 -1
- package/dist/run-state.js +1 -41
- package/dist/run-state.js.map +1 -1
- package/dist/runner.d.ts +1 -523
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +1 -2126
- package/dist/runner.js.map +1 -1
- package/dist/substitute-validator.d.ts +1 -43
- package/dist/substitute-validator.d.ts.map +1 -1
- package/dist/substitute-validator.js +1 -168
- package/dist/substitute-validator.js.map +1 -1
- package/dist/supervisor.d.ts +1 -147
- package/dist/supervisor.d.ts.map +1 -1
- package/dist/supervisor.js +1 -286
- package/dist/supervisor.js.map +1 -1
- package/dist/trigger-wakeup.d.ts +1 -122
- package/dist/trigger-wakeup.d.ts.map +1 -1
- package/dist/trigger-wakeup.js +1 -220
- package/dist/trigger-wakeup.js.map +1 -1
- package/package.json +4 -4
package/dist/message-stream.d.ts
CHANGED
|
@@ -1,32 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Buffers live processing messages for server and portable workflow hosts.
|
|
3
|
-
* Closing detaches the listener and lets queued terminal messages drain.
|
|
4
|
-
*
|
|
5
|
-
* The queue is bounded. A caller that opts into capture (see
|
|
6
|
-
* `ExecutionSessionOptions.captureMessages`) but never iterates would
|
|
7
|
-
* otherwise retain every message of the run — including real-time audio
|
|
8
|
-
* chunks, which the kernel's own message retention deliberately avoids
|
|
9
|
-
* holding (roughly 25 MB/minute). Past the limit the stream stops queueing
|
|
10
|
-
* and the iterator throws, so a non-draining consumer fails loudly instead of
|
|
11
|
-
* growing until the run ends.
|
|
12
|
-
*/
|
|
13
|
-
import type { ProcessingMessage } from "@nodetool-ai/protocol";
|
|
14
|
-
/** Queued messages allowed to pile up before the stream gives up. */
|
|
15
|
-
export declare const DEFAULT_MESSAGE_BUFFER_LIMIT = 10000;
|
|
16
|
-
export declare class MessageStream implements AsyncIterable<ProcessingMessage> {
|
|
17
|
-
private readonly queue;
|
|
18
|
-
private waiter;
|
|
19
|
-
private closed;
|
|
20
|
-
private overflowedAt;
|
|
21
|
-
private readonly limit;
|
|
22
|
-
private readonly unsubscribe;
|
|
23
|
-
/** `limit` of 0 (or a negative number) means unbounded. */
|
|
24
|
-
constructor(context: {
|
|
25
|
-
addMessageListener(listener: (message: ProcessingMessage) => void): () => void;
|
|
26
|
-
}, limit?: number);
|
|
27
|
-
private wake;
|
|
28
|
-
/** Stop feeding new messages into the queue. Already-queued messages still drain. */
|
|
29
|
-
close(): void;
|
|
30
|
-
[Symbol.asyncIterator](): AsyncIterator<ProcessingMessage>;
|
|
31
|
-
}
|
|
1
|
+
export * from "@nodetool-ai/execution-core/message-stream";
|
|
32
2
|
//# sourceMappingURL=message-stream.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-stream.d.ts","sourceRoot":"","sources":["../src/message-stream.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"message-stream.d.ts","sourceRoot":"","sources":["../src/message-stream.ts"],"names":[],"mappings":"AAAA,cAAc,4CAA4C,CAAC"}
|
package/dist/message-stream.js
CHANGED
|
@@ -1,64 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export const DEFAULT_MESSAGE_BUFFER_LIMIT = 10_000;
|
|
3
|
-
export class MessageStream {
|
|
4
|
-
queue = [];
|
|
5
|
-
waiter = null;
|
|
6
|
-
closed = false;
|
|
7
|
-
overflowedAt = null;
|
|
8
|
-
limit;
|
|
9
|
-
unsubscribe;
|
|
10
|
-
/** `limit` of 0 (or a negative number) means unbounded. */
|
|
11
|
-
constructor(context, limit = DEFAULT_MESSAGE_BUFFER_LIMIT) {
|
|
12
|
-
this.limit = limit > 0 ? limit : Number.POSITIVE_INFINITY;
|
|
13
|
-
this.unsubscribe = context.addMessageListener((message) => {
|
|
14
|
-
if (this.queue.length >= this.limit) {
|
|
15
|
-
if (this.overflowedAt === null) {
|
|
16
|
-
this.overflowedAt = this.queue.length;
|
|
17
|
-
this.unsubscribe();
|
|
18
|
-
}
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
this.queue.push(message);
|
|
22
|
-
this.wake();
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
wake() {
|
|
26
|
-
const w = this.waiter;
|
|
27
|
-
this.waiter = null;
|
|
28
|
-
w?.();
|
|
29
|
-
}
|
|
30
|
-
/** Stop feeding new messages into the queue. Already-queued messages still drain. */
|
|
31
|
-
close() {
|
|
32
|
-
if (this.closed)
|
|
33
|
-
return;
|
|
34
|
-
this.closed = true;
|
|
35
|
-
this.unsubscribe();
|
|
36
|
-
this.wake();
|
|
37
|
-
}
|
|
38
|
-
async *[Symbol.asyncIterator]() {
|
|
39
|
-
for (;;) {
|
|
40
|
-
// Drain batches so a large backlog does not shift an array per message.
|
|
41
|
-
const batch = this.queue.splice(0);
|
|
42
|
-
for (const message of batch) {
|
|
43
|
-
yield message;
|
|
44
|
-
}
|
|
45
|
-
if (this.overflowedAt !== null) {
|
|
46
|
-
throw new Error(`Workflow message stream overflowed after ${this.overflowedAt} ` +
|
|
47
|
-
`queued messages (limit ${this.limit}) — the consumer fell behind, ` +
|
|
48
|
-
"so messages past that point were dropped rather than retained. " +
|
|
49
|
-
"Iterate `session.messages` as the run progresses, or raise " +
|
|
50
|
-
"`limits.messageBufferLimit`.");
|
|
51
|
-
}
|
|
52
|
-
// Messages can arrive (and the stream can close) while the consumer
|
|
53
|
-
// holds a yield above. Drain them before deciding to stop or wait.
|
|
54
|
-
if (this.queue.length > 0)
|
|
55
|
-
continue;
|
|
56
|
-
if (this.closed)
|
|
57
|
-
return;
|
|
58
|
-
await new Promise((resolve) => {
|
|
59
|
-
this.waiter = resolve;
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
1
|
+
export * from "@nodetool-ai/execution-core/message-stream";
|
|
64
2
|
//# sourceMappingURL=message-stream.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-stream.js","sourceRoot":"","sources":["../src/message-stream.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"message-stream.js","sourceRoot":"","sources":["../src/message-stream.ts"],"names":[],"mappings":"AAAA,cAAc,4CAA4C,CAAC"}
|
package/dist/predicates.d.ts
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* The workspace's named type predicates, re-exported for the runner's call
|
|
3
|
-
* sites. The definitions live in `@nodetool-ai/protocol`.
|
|
4
|
-
*/
|
|
5
|
-
export { isBoolean, isCallable, isNonEmptyString, isNumber, isString,
|
|
6
|
-
/** An object value. Arrays pass — the sites that care test `Array.isArray`. */
|
|
7
|
-
isObjectLike as isObjectValue } from "@nodetool-ai/protocol";
|
|
1
|
+
export * from "@nodetool-ai/execution-core/predicates";
|
|
8
2
|
//# sourceMappingURL=predicates.d.ts.map
|
package/dist/predicates.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"predicates.d.ts","sourceRoot":"","sources":["../src/predicates.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"predicates.d.ts","sourceRoot":"","sources":["../src/predicates.ts"],"names":[],"mappings":"AAAA,cAAc,wCAAwC,CAAC"}
|
package/dist/predicates.js
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* The workspace's named type predicates, re-exported for the runner's call
|
|
3
|
-
* sites. The definitions live in `@nodetool-ai/protocol`.
|
|
4
|
-
*/
|
|
5
|
-
export { isBoolean, isCallable, isNonEmptyString, isNumber, isString,
|
|
6
|
-
/** An object value. Arrays pass — the sites that care test `Array.isArray`. */
|
|
7
|
-
isObjectLike as isObjectValue } from "@nodetool-ai/protocol";
|
|
1
|
+
export * from "@nodetool-ai/execution-core/predicates";
|
|
8
2
|
//# sourceMappingURL=predicates.js.map
|
package/dist/predicates.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"predicates.js","sourceRoot":"","sources":["../src/predicates.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"predicates.js","sourceRoot":"","sources":["../src/predicates.ts"],"names":[],"mappings":"AAAA,cAAc,wCAAwC,CAAC"}
|
package/dist/run-state.d.ts
CHANGED
|
@@ -1,65 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* What a supervisor may read about a run in flight.
|
|
3
|
-
*
|
|
4
|
-
* The design's two supervisor tools (`get_run_state`, `read_node_output`) are
|
|
5
|
-
* pull-based on purpose: the runner already holds this state, so there is no
|
|
6
|
-
* observation pipeline to feed and a clean run costs nothing. This module is
|
|
7
|
-
* the read side of that — the runner implements it, the agent package consumes
|
|
8
|
-
* it, and the dependency arrow stays `kernel ← agents`.
|
|
9
|
-
*
|
|
10
|
-
* See docs/workflow-supervisor-design.md §6.
|
|
11
|
-
*/
|
|
12
|
-
/** Per-node summary in the run digest. */
|
|
13
|
-
export interface NodeRunState {
|
|
14
|
-
nodeId: string;
|
|
15
|
-
nodeType: string;
|
|
16
|
-
/**
|
|
17
|
-
* `pending` — spawned, nothing emitted yet; `running` — emitted at least
|
|
18
|
-
* once and still live; `completed` / `failed` — the actor is gone.
|
|
19
|
-
*/
|
|
20
|
-
status: "pending" | "running" | "completed" | "failed";
|
|
21
|
-
/** Invocations that produced output. */
|
|
22
|
-
emissions: number;
|
|
23
|
-
/** Escalations raised by this node so far, including the current one. */
|
|
24
|
-
escalations: number;
|
|
25
|
-
/** The node's terminal error, once it has one. Redacted at construction. */
|
|
26
|
-
error?: string;
|
|
27
|
-
}
|
|
28
|
-
export interface RunStateDigest {
|
|
29
|
-
jobId: string;
|
|
30
|
-
nodes: NodeRunState[];
|
|
31
|
-
/** Provider spend recorded for the whole run so far, in USD. */
|
|
32
|
-
costUsd: number;
|
|
33
|
-
}
|
|
34
|
-
/** One node's recorded output for a single invocation. */
|
|
35
|
-
export interface NodeOutputRead {
|
|
36
|
-
nodeId: string;
|
|
37
|
-
/** The lineage the recorded invocation ran under, as `root=index` pairs. */
|
|
38
|
-
lineage: string[];
|
|
39
|
-
outputs: Record<string, unknown>;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Read-only view of a run, handed to a `SupervisorHandle` when the run starts.
|
|
43
|
-
*/
|
|
44
|
-
export interface RunStateReader {
|
|
45
|
-
digest(): RunStateDigest;
|
|
46
|
-
/**
|
|
47
|
-
* The most recent output of `nodeId` on an invocation causally related to
|
|
48
|
-
* `lineage` — same fan-out roots, same indices. A sibling item's output is
|
|
49
|
-
* not related to the failing one, so it is refused (`null`) rather than
|
|
50
|
-
* handed over as repair material. Design §6.
|
|
51
|
-
*/
|
|
52
|
-
readOutput(nodeId: string, lineage: readonly string[]): NodeOutputRead | null;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Whether `recorded` belongs to the same causal branch as `lineage`.
|
|
56
|
-
*
|
|
57
|
-
* A producer upstream of the failing invocation ran under a lineage that is a
|
|
58
|
-
* subset of it: every fan-out root it carries also appears downstream, with the
|
|
59
|
-
* same index. Two conditions therefore refuse a read — an index that disagrees
|
|
60
|
-
* (a sibling item) and a root the failing invocation never entered (an
|
|
61
|
-
* unrelated fan-out). An empty recorded lineage is a single-fire node, which is
|
|
62
|
-
* upstream of everything.
|
|
63
|
-
*/
|
|
64
|
-
export declare function lineageRelated(recorded: readonly string[], lineage: readonly string[]): boolean;
|
|
1
|
+
export * from "@nodetool-ai/execution-core/run-state";
|
|
65
2
|
//# sourceMappingURL=run-state.d.ts.map
|
package/dist/run-state.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-state.d.ts","sourceRoot":"","sources":["../src/run-state.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"run-state.d.ts","sourceRoot":"","sources":["../src/run-state.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC"}
|
package/dist/run-state.js
CHANGED
|
@@ -1,42 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* What a supervisor may read about a run in flight.
|
|
3
|
-
*
|
|
4
|
-
* The design's two supervisor tools (`get_run_state`, `read_node_output`) are
|
|
5
|
-
* pull-based on purpose: the runner already holds this state, so there is no
|
|
6
|
-
* observation pipeline to feed and a clean run costs nothing. This module is
|
|
7
|
-
* the read side of that — the runner implements it, the agent package consumes
|
|
8
|
-
* it, and the dependency arrow stays `kernel ← agents`.
|
|
9
|
-
*
|
|
10
|
-
* See docs/workflow-supervisor-design.md §6.
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Whether `recorded` belongs to the same causal branch as `lineage`.
|
|
14
|
-
*
|
|
15
|
-
* A producer upstream of the failing invocation ran under a lineage that is a
|
|
16
|
-
* subset of it: every fan-out root it carries also appears downstream, with the
|
|
17
|
-
* same index. Two conditions therefore refuse a read — an index that disagrees
|
|
18
|
-
* (a sibling item) and a root the failing invocation never entered (an
|
|
19
|
-
* unrelated fan-out). An empty recorded lineage is a single-fire node, which is
|
|
20
|
-
* upstream of everything.
|
|
21
|
-
*/
|
|
22
|
-
export function lineageRelated(recorded, lineage) {
|
|
23
|
-
if (recorded.length === 0)
|
|
24
|
-
return true;
|
|
25
|
-
const scope = new Map();
|
|
26
|
-
for (const pair of lineage) {
|
|
27
|
-
const eq = pair.indexOf("=");
|
|
28
|
-
if (eq === -1)
|
|
29
|
-
continue;
|
|
30
|
-
scope.set(pair.slice(0, eq), pair.slice(eq + 1));
|
|
31
|
-
}
|
|
32
|
-
for (const pair of recorded) {
|
|
33
|
-
const eq = pair.indexOf("=");
|
|
34
|
-
if (eq === -1)
|
|
35
|
-
return false;
|
|
36
|
-
const root = pair.slice(0, eq);
|
|
37
|
-
if (scope.get(root) !== pair.slice(eq + 1))
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
return true;
|
|
41
|
-
}
|
|
1
|
+
export * from "@nodetool-ai/execution-core/run-state";
|
|
42
2
|
//# sourceMappingURL=run-state.js.map
|
package/dist/run-state.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-state.js","sourceRoot":"","sources":["../src/run-state.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"run-state.js","sourceRoot":"","sources":["../src/run-state.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC"}
|