@nodetool-ai/cli-execution 0.0.0-stage → 0.8.9-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.nodetool-build-stamp +1 -0
- package/dist/debug/browser-runner.d.ts +21 -0
- package/dist/debug/browser-runner.d.ts.map +1 -0
- package/dist/debug/browser-runner.js +196 -0
- package/dist/debug/browser-runner.js.map +1 -0
- package/dist/debug/collector.d.ts +9 -0
- package/dist/debug/collector.d.ts.map +1 -0
- package/dist/debug/collector.js +9 -0
- package/dist/debug/collector.js.map +1 -0
- package/dist/debug/diff.d.ts +48 -0
- package/dist/debug/diff.d.ts.map +1 -0
- package/dist/debug/diff.js +68 -0
- package/dist/debug/diff.js.map +1 -0
- package/dist/debug/harness.d.ts +11 -0
- package/dist/debug/harness.d.ts.map +1 -0
- package/dist/debug/harness.js +102 -0
- package/dist/debug/harness.js.map +1 -0
- package/dist/debug/index.d.ts +17 -0
- package/dist/debug/index.d.ts.map +1 -0
- package/dist/debug/index.js +16 -0
- package/dist/debug/index.js.map +1 -0
- package/dist/debug/markdown.d.ts +3 -0
- package/dist/debug/markdown.d.ts.map +1 -0
- package/dist/debug/markdown.js +127 -0
- package/dist/debug/markdown.js.map +1 -0
- package/dist/debug/server-runner.d.ts +24 -0
- package/dist/debug/server-runner.d.ts.map +1 -0
- package/dist/debug/server-runner.js +211 -0
- package/dist/debug/server-runner.js.map +1 -0
- package/dist/debug/target.d.ts +34 -0
- package/dist/debug/target.d.ts.map +1 -0
- package/dist/debug/target.js +95 -0
- package/dist/debug/target.js.map +1 -0
- package/dist/debug/trace.d.ts +30 -0
- package/dist/debug/trace.d.ts.map +1 -0
- package/dist/debug/trace.js +87 -0
- package/dist/debug/trace.js.map +1 -0
- package/dist/debug/types.d.ts +82 -0
- package/dist/debug/types.d.ts.map +1 -0
- package/dist/debug/types.js +13 -0
- package/dist/debug/types.js.map +1 -0
- package/dist/debug/verdict.d.ts +3 -0
- package/dist/debug/verdict.d.ts.map +1 -0
- package/dist/debug/verdict.js +78 -0
- package/dist/debug/verdict.js.map +1 -0
- package/dist/debug/watch.d.ts +23 -0
- package/dist/debug/watch.d.ts.map +1 -0
- package/dist/debug/watch.js +68 -0
- package/dist/debug/watch.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/local-model-interfaces.d.ts +20 -0
- package/dist/local-model-interfaces.d.ts.map +1 -0
- package/dist/local-model-interfaces.js +39 -0
- package/dist/local-model-interfaces.js.map +1 -0
- package/dist/node/run-node.d.ts +31 -0
- package/dist/node/run-node.d.ts.map +1 -0
- package/dist/node/run-node.js +92 -0
- package/dist/node/run-node.js.map +1 -0
- package/dist/node-registry.d.ts +29 -0
- package/dist/node-registry.d.ts.map +1 -0
- package/dist/node-registry.js +38 -0
- package/dist/node-registry.js.map +1 -0
- package/dist/packs/host.d.ts +14 -0
- package/dist/packs/host.d.ts.map +1 -0
- package/dist/packs/host.js +38 -0
- package/dist/packs/host.js.map +1 -0
- package/dist/run-budget.d.ts +40 -0
- package/dist/run-budget.d.ts.map +1 -0
- package/dist/run-budget.js +119 -0
- package/dist/run-budget.js.map +1 -0
- package/dist/run-dsl-supervised.d.ts +11 -0
- package/dist/run-dsl-supervised.d.ts.map +1 -0
- package/dist/run-dsl-supervised.js +89 -0
- package/dist/run-dsl-supervised.js.map +1 -0
- package/dist/run-dsl.d.ts +40 -0
- package/dist/run-dsl.d.ts.map +1 -0
- package/dist/run-dsl.js +65 -0
- package/dist/run-dsl.js.map +1 -0
- package/dist/run-json.d.ts +24 -0
- package/dist/run-json.d.ts.map +1 -0
- package/dist/run-json.js +132 -0
- package/dist/run-json.js.map +1 -0
- package/dist/sandbox-catalog.d.ts +26 -0
- package/dist/sandbox-catalog.d.ts.map +1 -0
- package/dist/sandbox-catalog.js +83 -0
- package/dist/sandbox-catalog.js.map +1 -0
- package/dist/supervisor.d.ts +97 -0
- package/dist/supervisor.d.ts.map +1 -0
- package/dist/supervisor.js +194 -0
- package/dist/supervisor.js.map +1 -0
- package/dist/validate/index.d.ts +29 -0
- package/dist/validate/index.d.ts.map +1 -0
- package/dist/validate/index.js +79 -0
- package/dist/validate/index.js.map +1 -0
- package/dist/workflow-file.d.ts +3 -0
- package/dist/workflow-file.d.ts.map +1 -0
- package/dist/workflow-file.js +176 -0
- package/dist/workflow-file.js.map +1 -0
- package/package.json +70 -4
- package/README.md +0 -3
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reads and summarizes the OpenTelemetry JSONL trace a debug run produces.
|
|
3
|
+
*
|
|
4
|
+
* The runtime's `JsonlFileSpanExporter` writes one span per line in the shape
|
|
5
|
+
* documented in AGENTS.md (workflow.run → node.process → agent.* → llm.*). We
|
|
6
|
+
* roll those up into per-name timing plus token/cost totals from the
|
|
7
|
+
* `gen_ai.usage.*` attributes carried by every llm.chat / llm.stream span.
|
|
8
|
+
*/
|
|
9
|
+
import { readFile } from "node:fs/promises";
|
|
10
|
+
import { isNumber } from "@nodetool-ai/cli-common/predicates";
|
|
11
|
+
const SLOWEST_LIMIT = 10;
|
|
12
|
+
/** Parse a JSONL trace file body, skipping blank/corrupt lines. */
|
|
13
|
+
export function parseTraceJsonl(text) {
|
|
14
|
+
const spans = [];
|
|
15
|
+
for (const line of text.split("\n")) {
|
|
16
|
+
const trimmed = line.trim();
|
|
17
|
+
if (!trimmed)
|
|
18
|
+
continue;
|
|
19
|
+
try {
|
|
20
|
+
spans.push(JSON.parse(trimmed));
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
// Ignore partial/corrupt lines (e.g. a crash mid-write).
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return spans;
|
|
27
|
+
}
|
|
28
|
+
function numAttr(attrs, key) {
|
|
29
|
+
const v = attrs[key];
|
|
30
|
+
return isNumber(v) ? v : 0;
|
|
31
|
+
}
|
|
32
|
+
/** Roll spans up into a `TraceSummary`. */
|
|
33
|
+
export function summarizeSpans(spans) {
|
|
34
|
+
const byName = {};
|
|
35
|
+
let inputTokens = 0;
|
|
36
|
+
let outputTokens = 0;
|
|
37
|
+
let totalTokens = 0;
|
|
38
|
+
let costUsd = 0;
|
|
39
|
+
let minStart = Number.POSITIVE_INFINITY;
|
|
40
|
+
let maxEnd = Number.NEGATIVE_INFINITY;
|
|
41
|
+
for (const span of spans) {
|
|
42
|
+
const bucket = (byName[span.name] ??= { count: 0, totalDurationMs: 0 });
|
|
43
|
+
bucket.count += 1;
|
|
44
|
+
bucket.totalDurationMs += span.duration_ms;
|
|
45
|
+
if (Number.isFinite(span.start_time_ms))
|
|
46
|
+
minStart = Math.min(minStart, span.start_time_ms);
|
|
47
|
+
if (Number.isFinite(span.end_time_ms))
|
|
48
|
+
maxEnd = Math.max(maxEnd, span.end_time_ms);
|
|
49
|
+
const a = span.attributes ?? {};
|
|
50
|
+
inputTokens += numAttr(a, "gen_ai.usage.input_tokens");
|
|
51
|
+
outputTokens += numAttr(a, "gen_ai.usage.output_tokens");
|
|
52
|
+
totalTokens += numAttr(a, "gen_ai.usage.total_tokens");
|
|
53
|
+
costUsd += numAttr(a, "gen_ai.usage.cost_usd");
|
|
54
|
+
}
|
|
55
|
+
const slowest = spans
|
|
56
|
+
.slice()
|
|
57
|
+
.sort((x, y) => y.duration_ms - x.duration_ms)
|
|
58
|
+
.slice(0, SLOWEST_LIMIT)
|
|
59
|
+
.map((s) => ({ name: s.name, durationMs: s.duration_ms, status: s.status?.code ?? "UNSET" }));
|
|
60
|
+
return {
|
|
61
|
+
spanCount: spans.length,
|
|
62
|
+
totalDurationMs: spans.length > 0 && minStart !== Number.POSITIVE_INFINITY ? maxEnd - minStart : null,
|
|
63
|
+
tokens: {
|
|
64
|
+
input: inputTokens,
|
|
65
|
+
output: outputTokens,
|
|
66
|
+
total: totalTokens || inputTokens + outputTokens
|
|
67
|
+
},
|
|
68
|
+
costUsd,
|
|
69
|
+
byName,
|
|
70
|
+
slowest
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
/** Read + summarize a trace file. Returns null when the file is missing/empty. */
|
|
74
|
+
export async function readTraceSummary(path) {
|
|
75
|
+
let text;
|
|
76
|
+
try {
|
|
77
|
+
text = await readFile(path, "utf8");
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
const spans = parseTraceJsonl(text);
|
|
83
|
+
if (spans.length === 0)
|
|
84
|
+
return null;
|
|
85
|
+
return summarizeSpans(spans);
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=trace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../../src/debug/trace.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAkB9D,MAAM,aAAa,GAAG,EAAE,CAAC;AAEzB,mEAAmE;AACnE,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,MAAM,KAAK,GAAgB,EAAE,CAAC;IAC9B,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACpC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAC5B,IAAI,CAAC,OAAO;YAAE,SAAS;QACvB,IAAI,CAAC;YACH,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAc,CAAC,CAAC;QAC/C,CAAC;QAAC,MAAM,CAAC;YACP,yDAAyD;QAC3D,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,OAAO,CAAC,KAA8B,EAAE,GAAW;IAC1D,MAAM,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAA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OAAO,IAAI,CAAC;IACpC,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types for the workflow debug harness.
|
|
3
|
+
*
|
|
4
|
+
* The harness runs a workflow end-to-end on two surfaces — the headless server
|
|
5
|
+
* (kernel `WorkflowRunner`) and a real browser (the `e2e_runner` page driven by
|
|
6
|
+
* Playwright) — and folds everything worth inspecting into a single
|
|
7
|
+
* `DebugReport`: the workflow graph JSON, every processing message (logs, node
|
|
8
|
+
* IO, outputs, edges, LLM calls), an OpenTelemetry span summary, browser console
|
|
9
|
+
* errors and a screenshot. The report is written to a bundle directory and also
|
|
10
|
+
* returned so an agent can iterate without re-parsing files.
|
|
11
|
+
*/
|
|
12
|
+
import type { DebugGraph, DebugTargetInfo, DebugVerdict, ExecutionSummary, ServerRunReport } from "@nodetool-ai/execution/debug";
|
|
13
|
+
import type { SupervisorRunConfig } from "../supervisor.js";
|
|
14
|
+
export type { DebugError, DebugGraph, DebugTargetInfo, DebugVerdict, EdgeDebug, ExecutionSummary, LlmCallDebug, LogEntry, NodeDebug, NodeOutput, RunVerdict, ServerRunReport, TraceSummary } from "@nodetool-ai/execution/debug";
|
|
15
|
+
/** A canvas screenshot captured at one stage of the browser run. */
|
|
16
|
+
interface BrowserStageShot {
|
|
17
|
+
/** 0-based capture order. */
|
|
18
|
+
index: number;
|
|
19
|
+
/** Run status at capture time (running until the final frame). */
|
|
20
|
+
status: string;
|
|
21
|
+
/** Bundle-relative path to the screenshot. */
|
|
22
|
+
file: string;
|
|
23
|
+
}
|
|
24
|
+
export interface BrowserRunReport {
|
|
25
|
+
surface: "browser";
|
|
26
|
+
ok: boolean;
|
|
27
|
+
status: string;
|
|
28
|
+
error: string | null;
|
|
29
|
+
durationMs: number | null;
|
|
30
|
+
summary: ExecutionSummary;
|
|
31
|
+
consoleErrors: string[];
|
|
32
|
+
/** Bundle-relative path to the final settled screenshot. */
|
|
33
|
+
screenshotFile?: string;
|
|
34
|
+
/** Canvas screenshots captured at successive stages of the run. */
|
|
35
|
+
stages?: BrowserStageShot[];
|
|
36
|
+
/** Bundle-relative path to the raw browser RunRecord JSON. */
|
|
37
|
+
recordFile?: string;
|
|
38
|
+
/** Set when the browser surface could not run (missing deps / browser). */
|
|
39
|
+
unavailableReason?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface DebugReport {
|
|
42
|
+
generatedAt: string;
|
|
43
|
+
target: DebugTargetInfo;
|
|
44
|
+
/** The workflow graph JSON (runner shape). */
|
|
45
|
+
workflow: DebugGraph;
|
|
46
|
+
server: ServerRunReport | null;
|
|
47
|
+
browser: BrowserRunReport | null;
|
|
48
|
+
verdict: DebugVerdict;
|
|
49
|
+
/** Absolute path to the on-disk bundle, when one was written. */
|
|
50
|
+
bundleDir: string | null;
|
|
51
|
+
}
|
|
52
|
+
/** Options that drive a debug run. */
|
|
53
|
+
export interface DebugOptions {
|
|
54
|
+
/** Run the headless server surface. Default true. */
|
|
55
|
+
server?: boolean;
|
|
56
|
+
/** Run the real-browser surface (Playwright). Expensive; default false. */
|
|
57
|
+
browser?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Capture an OpenTelemetry trace of the server run (timing/tokens/cost).
|
|
60
|
+
* Expensive — loads the OTel SDK and adds per-span overhead. Default false.
|
|
61
|
+
*/
|
|
62
|
+
trace?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* On the browser surface, capture a canvas screenshot at every stage of the
|
|
65
|
+
* run instead of only the final frame. Expensive; implies `browser`. Default
|
|
66
|
+
* false.
|
|
67
|
+
*/
|
|
68
|
+
stages?: boolean;
|
|
69
|
+
/** Input params keyed by input-node name. */
|
|
70
|
+
params?: Record<string, unknown>;
|
|
71
|
+
/** Bundle output directory. When omitted a timestamped dir is generated. */
|
|
72
|
+
outDir?: string;
|
|
73
|
+
/** Per-surface run timeout, ms. */
|
|
74
|
+
timeoutMs?: number;
|
|
75
|
+
/**
|
|
76
|
+
* Supervise the server surface (`--supervise` and its bounds). The browser
|
|
77
|
+
* surface runs the workflow through the web runtime, which has no supervisor
|
|
78
|
+
* of its own until the editor toggle ships, so it is unaffected.
|
|
79
|
+
*/
|
|
80
|
+
supervisor?: SupervisorRunConfig;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/debug/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EACV,UAAU,EACV,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,eAAe,EAChB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,YAAY,EACV,UAAU,EACV,UAAU,EACV,eAAe,EACf,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,UAAU,EACV,UAAU,EACV,eAAe,EACf,YAAY,EACb,MAAM,8BAA8B,CAAC;AAEtC,oEAAoE;AACpE,UAAU,gBAAgB;IACxB,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,MAAM,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,SAAS,CAAC;IACnB,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,EAAE,gBAAgB,CAAC;IAC1B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,4DAA4D;IAC5D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mEAAmE;IACnE,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC5B,8DAA8D;IAC9D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2EAA2E;IAC3E,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,eAAe,CAAC;IACxB,8CAA8C;IAC9C,QAAQ,EAAE,UAAU,CAAC;IACrB,MAAM,EAAE,eAAe,GAAG,IAAI,CAAC;IAC/B,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACjC,OAAO,EAAE,YAAY,CAAC;IACtB,iEAAiE;IACjE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,sCAAsC;AACtC,MAAM,WAAW,YAAY;IAC3B,qDAAqD;IACrD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,UAAU,CAAC,EAAE,mBAAmB,CAAC;CAClC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types for the workflow debug harness.
|
|
3
|
+
*
|
|
4
|
+
* The harness runs a workflow end-to-end on two surfaces — the headless server
|
|
5
|
+
* (kernel `WorkflowRunner`) and a real browser (the `e2e_runner` page driven by
|
|
6
|
+
* Playwright) — and folds everything worth inspecting into a single
|
|
7
|
+
* `DebugReport`: the workflow graph JSON, every processing message (logs, node
|
|
8
|
+
* IO, outputs, edges, LLM calls), an OpenTelemetry span summary, browser console
|
|
9
|
+
* errors and a screenshot. The report is written to a bundle directory and also
|
|
10
|
+
* returned so an agent can iterate without re-parsing files.
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/debug/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verdict.d.ts","sourceRoot":"","sources":["../../src/debug/verdict.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACZ,eAAe,EAChB,MAAM,YAAY,CAAC;AAEpB,wBAAgB,YAAY,CAC1B,MAAM,EAAE,eAAe,GAAG,IAAI,EAC9B,OAAO,EAAE,gBAAgB,GAAG,IAAI,GAC/B,YAAY,CAgFd"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-surface triage: turns the server/browser run reports into a single
|
|
3
|
+
* pass/fail verdict plus an ordered list of concrete issues an agent can act on.
|
|
4
|
+
*
|
|
5
|
+
* The per-surface triage itself lives in `@nodetool-ai/execution` so the HTTP
|
|
6
|
+
* debug endpoint and the agent-facing `debug_workflow` tool reach the same
|
|
7
|
+
* verdict for the same run; this module only composes the two surfaces.
|
|
8
|
+
*/
|
|
9
|
+
import { collectInterventionWarnings, collectRunIssues, describeErrors } from "@nodetool-ai/execution/debug";
|
|
10
|
+
export function buildVerdict(server, browser) {
|
|
11
|
+
const issues = [];
|
|
12
|
+
if (server) {
|
|
13
|
+
issues.push(...collectRunIssues("Server", server.summary, {
|
|
14
|
+
ok: server.ok,
|
|
15
|
+
status: server.status,
|
|
16
|
+
error: server.error
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
19
|
+
if (browser) {
|
|
20
|
+
if (browser.unavailableReason) {
|
|
21
|
+
issues.push(`Browser run unavailable: ${browser.unavailableReason}`);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
if (!browser.ok) {
|
|
25
|
+
issues.push(`Browser run ended ${browser.status}${browser.error ? `: ${browser.error}` : ""}`);
|
|
26
|
+
}
|
|
27
|
+
issues.push(...describeErrors("Browser node", browser.summary.errors));
|
|
28
|
+
for (const err of browser.consoleErrors.slice(0, 5)) {
|
|
29
|
+
issues.push(`Browser console error: ${err.replace(/\s+/g, " ").slice(0, 200)}`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
// A surface that genuinely ran and completed is the bar for "ok"; an
|
|
34
|
+
// unavailable browser surface doesn't fail the verdict on its own.
|
|
35
|
+
const serverOk = server ? server.ok : true;
|
|
36
|
+
const browserRan = browser ? !browser.unavailableReason : true;
|
|
37
|
+
const browserOk = browser && browserRan ? browser.ok : true;
|
|
38
|
+
// At least one surface must have actually run. Zero surfaces means zero
|
|
39
|
+
// evidence, which is not the same as a clean run.
|
|
40
|
+
const ranSomewhere = Boolean(server) || (Boolean(browser) && browserRan);
|
|
41
|
+
if (!ranSomewhere) {
|
|
42
|
+
issues.unshift("No surface ran — nothing was executed, so nothing was verified");
|
|
43
|
+
}
|
|
44
|
+
const ok = ranSomewhere &&
|
|
45
|
+
serverOk &&
|
|
46
|
+
browserOk &&
|
|
47
|
+
issues.filter((i) => !i.startsWith("Browser run unavailable")).length === 0;
|
|
48
|
+
let headline;
|
|
49
|
+
if (ok) {
|
|
50
|
+
const surfaces = [
|
|
51
|
+
server && "server",
|
|
52
|
+
browser && !browser.unavailableReason && "browser"
|
|
53
|
+
]
|
|
54
|
+
.filter(Boolean)
|
|
55
|
+
.join(" + ");
|
|
56
|
+
headline = `Workflow ran clean on ${surfaces}.`;
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
const first = issues[0] ?? "unknown failure";
|
|
60
|
+
headline = `Workflow has issues — ${first}`;
|
|
61
|
+
}
|
|
62
|
+
// Supervisor decisions are warnings, never issues: a run the supervisor
|
|
63
|
+
// rescued is still a run that completed, but a reader has to be told what
|
|
64
|
+
// was skipped or repaired to get there.
|
|
65
|
+
const warnings = server
|
|
66
|
+
? collectInterventionWarnings("Server", server.summary)
|
|
67
|
+
: [];
|
|
68
|
+
const verdict = {
|
|
69
|
+
ok,
|
|
70
|
+
headline: ok && warnings.length > 0 ? `${headline} (supervised)` : headline,
|
|
71
|
+
issues
|
|
72
|
+
};
|
|
73
|
+
if (warnings.length > 0) {
|
|
74
|
+
verdict.warnings = warnings;
|
|
75
|
+
}
|
|
76
|
+
return verdict;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=verdict.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verdict.js","sourceRoot":"","sources":["../../src/debug/verdict.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,2BAA2B,EAC3B,gBAAgB,EAChB,cAAc,EACf,MAAM,8BAA8B,CAAC;AAOtC,MAAM,UAAU,YAAY,CAC1B,MAA8B,EAC9B,OAAgC;IAEhC,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,CAAC,IAAI,CACT,GAAG,gBAAgB,CAAC,QAAQ,EAAE,MAAM,CAAC,OAAO,EAAE;YAC5C,EAAE,EAAE,MAAM,CAAC,EAAE;YACb,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,KAAK,EAAE,MAAM,CAAC,KAAK;SACpB,CAAC,CACH,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,EAAE,CAAC;QACZ,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;YAC9B,MAAM,CAAC,IAAI,CAAC,4BAA4B,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAC;QACvE,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;gBAChB,MAAM,CAAC,IAAI,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AC,CAAC,CAAC,CAAC,UAAU,CAAC,yBAAyB,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;IAE9E,IAAI,QAAgB,CAAC;IACrB,IAAI,EAAE,EAAE,CAAC;QACP,MAAM,QAAQ,GAAG;YACf,MAAM,IAAI,QAAQ;YAClB,OAAO,IAAI,CAAC,OAAO,CAAC,iBAAiB,IAAI,SAAS;SACnD;aACE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,KAAK,CAAC,CAAC;QACf,QAAQ,GAAG,yBAAyB,QAAQ,GAAG,CAAC;IAClD,CAAC;SAAM,CAAC;QACN,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,iBAAiB,CAAC;QAC7C,QAAQ,GAAG,yBAAyB,KAAK,EAAE,CAAC;IAC9C,CAAC;IAED,wEAAwE;IACxE,0EAA0E;IAC1E,wCAAwC;IACxC,MAAM,QAAQ,GAAG,MAAM;QACrB,CAAC,CAAC,2BAA2B,CAAC,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC;QACvD,CAAC,CAAC,EAAE,CAAC;IAEP,MAAM,OAAO,GAAiB;QAC5B,EAAE;QACF,QAAQ,EAAE,EAAE,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,eAAe,CAAC,CAAC,CAAC,QAAQ;QAC3E,MAAM;KACP,CAAC;IACF,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxB,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC9B,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type RunSnapshot } from "./diff.js";
|
|
2
|
+
/** Minimal shape of `fs.watch`, narrowed to what the loop uses. */
|
|
3
|
+
export type FileWatcher = (path: string, onChange: () => void) => {
|
|
4
|
+
close: () => void;
|
|
5
|
+
};
|
|
6
|
+
export interface WatchLoopInit<T> {
|
|
7
|
+
/** The file whose saves trigger a re-run. */
|
|
8
|
+
file: string;
|
|
9
|
+
/** The run already performed, so the first diff has something to compare to. */
|
|
10
|
+
first: T;
|
|
11
|
+
run: () => Promise<T>;
|
|
12
|
+
snapshot: (result: T) => RunSnapshot;
|
|
13
|
+
/** Label for the status transition line, e.g. `server` or `stage`. */
|
|
14
|
+
statusLabel?: string;
|
|
15
|
+
log: (line: string) => void;
|
|
16
|
+
/** Resolves to stop watching. Defaults to the first SIGINT. */
|
|
17
|
+
stop?: Promise<void>;
|
|
18
|
+
debounceMs?: number;
|
|
19
|
+
watchFile?: FileWatcher;
|
|
20
|
+
}
|
|
21
|
+
/** Watch `file`, re-running and diffing until the stop signal resolves. */
|
|
22
|
+
export declare function runWatchLoop<T>(init: WatchLoopInit<T>): Promise<void>;
|
|
23
|
+
//# sourceMappingURL=watch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../src/debug/watch.ts"],"names":[],"mappings":"AAaA,OAAO,EAAwB,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAEnE,mEAAmE;AACnE,MAAM,MAAM,WAAW,GAAG,CACxB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,IAAI,KACjB;IAAE,KAAK,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AAE3B,MAAM,WAAW,aAAa,CAAC,CAAC;IAC9B,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,gFAAgF;IAChF,KAAK,EAAE,CAAC,CAAC;IACT,GAAG,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC;IACtB,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,WAAW,CAAC;IACrC,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,+DAA+D;IAC/D,IAAI,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,WAAW,CAAC;CACzB;AAaD,2EAA2E;AAC3E,wBAAsB,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CA0C3E"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The watch loop `nodetool debug --watch` and `nodetool app build --watch`
|
|
3
|
+
* share: re-run on save, diff the new run against the last one, print only what
|
|
4
|
+
* moved.
|
|
5
|
+
*
|
|
6
|
+
* The loop owns the awkward parts — debouncing an editor's write burst, never
|
|
7
|
+
* running two passes at once, surviving a run that throws — and nothing else.
|
|
8
|
+
* What a run means is the caller's: it supplies `run` and a projection into
|
|
9
|
+
* {@link RunSnapshot}, which is what the differ compares. The watcher and the
|
|
10
|
+
* stop signal are injectable so the loop is testable without touching the file
|
|
11
|
+
* system or the process.
|
|
12
|
+
*/
|
|
13
|
+
import { watch } from "node:fs";
|
|
14
|
+
import { diffRuns, formatDiff } from "./diff.js";
|
|
15
|
+
const defaultWatcher = (path, onChange) => watch(path, onChange);
|
|
16
|
+
function sigintStop(log) {
|
|
17
|
+
return new Promise((resolve) => {
|
|
18
|
+
process.on("SIGINT", () => {
|
|
19
|
+
log("\nStopped watching.");
|
|
20
|
+
resolve();
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/** Watch `file`, re-running and diffing until the stop signal resolves. */
|
|
25
|
+
export async function runWatchLoop(init) {
|
|
26
|
+
const log = init.log;
|
|
27
|
+
log(`\nWatching ${init.file} — edit to re-run, Ctrl-C to stop.`);
|
|
28
|
+
let previous = init.snapshot(init.first);
|
|
29
|
+
let running = false;
|
|
30
|
+
let pending = false;
|
|
31
|
+
let timer = null;
|
|
32
|
+
const rerun = async () => {
|
|
33
|
+
if (running) {
|
|
34
|
+
pending = true;
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
running = true;
|
|
38
|
+
try {
|
|
39
|
+
const next = init.snapshot(await init.run());
|
|
40
|
+
const diff = diffRuns(previous, next);
|
|
41
|
+
previous = next;
|
|
42
|
+
log(`\n── re-run @ ${new Date().toLocaleTimeString()} ──`);
|
|
43
|
+
log(formatDiff(diff, init.statusLabel));
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
log(`Re-run failed: ${String(e)}`);
|
|
47
|
+
}
|
|
48
|
+
finally {
|
|
49
|
+
running = false;
|
|
50
|
+
if (pending) {
|
|
51
|
+
pending = false;
|
|
52
|
+
await rerun();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const debounceMs = init.debounceMs ?? 200;
|
|
57
|
+
const watcher = (init.watchFile ?? defaultWatcher)(init.file, () => {
|
|
58
|
+
// Debounce editor write bursts (one save → several change events).
|
|
59
|
+
if (timer)
|
|
60
|
+
clearTimeout(timer);
|
|
61
|
+
timer = setTimeout(() => void rerun(), debounceMs);
|
|
62
|
+
});
|
|
63
|
+
await (init.stop ?? sigintStop(log));
|
|
64
|
+
if (timer)
|
|
65
|
+
clearTimeout(timer);
|
|
66
|
+
watcher.close();
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=watch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch.js","sourceRoot":"","sources":["../../src/debug/watch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAoB,MAAM,WAAW,CAAC;AAwBnE,MAAM,cAAc,GAAgB,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAE9E,SAAS,UAAU,CAAC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CAAC,CAAC;QACrC,CAAC;gBAAS,CAAC;YACT,OAAO,GAAG,KAAK,CAAC;YAChB,IAAI,OAAO,EAAE,CAAC;gBACZ,OAAO,GAAG,KAAK,CAAC;gBAChB,MAAM,KAAK,EAAE,CAAC;YAChB,CAAC;QACH,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,GAAG,CAAC;IAC1C,MAAM,OAAO,GAAG,CAAC,IAAI,CAAC,SAAS,IAAI,cAAc,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE;QACjE,mEAAmE;QACnE,IAAI,KAAK;YAAE,YAAY,CAAC,KAAK,CAAC,CAAC;QAC/B,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,KAAK,KAAK,EAAE,EAAE,UAAU,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;IACrC,IAAI,KAAK;QAAE,YAAY,CAAC,KAAK,CAAC,CAAC;IAC/B,OAAO,CAAC,KAAK,EAAE,CAAC;AAClB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The persistence a local (no-server) run gets: assets and timeline sequences,
|
|
3
|
+
* against the same database `setupDb()` opens.
|
|
4
|
+
*
|
|
5
|
+
* Installed process-wide by each command that runs a graph, so every context
|
|
6
|
+
* built downstream answers the same way. Wiring it per-entrance is what let
|
|
7
|
+
* `nodetool debug` and `nodetool workflows run` disagree: a workflow that
|
|
8
|
+
* saved an image ran under one and threw "ProcessingContext model interface
|
|
9
|
+
* 'createAsset' is not configured" under the other.
|
|
10
|
+
*
|
|
11
|
+
* `createAsset` is the server's own implementation, imported rather than
|
|
12
|
+
* rewritten — the local copy this replaced wrote no thumbnail and left
|
|
13
|
+
* `parent_id` null, so a CLI-generated asset was invisible in every
|
|
14
|
+
* folder-scoped listing in the UI.
|
|
15
|
+
*/
|
|
16
|
+
import type { ProcessingContextModelInterfaces } from "@nodetool-ai/runtime";
|
|
17
|
+
export declare function localModelInterfaces(): Promise<ProcessingContextModelInterfaces>;
|
|
18
|
+
/** Install them as this process's default, once. */
|
|
19
|
+
export declare function installLocalModelInterfaces(): Promise<void>;
|
|
20
|
+
//# sourceMappingURL=local-model-interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-model-interfaces.d.ts","sourceRoot":"","sources":["../src/local-model-interfaces.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AAG7E,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,gCAAgC,CAAC,CActF;AAID,oDAAoD;AACpD,wBAAgB,2BAA2B,IAAI,OAAO,CAAC,IAAI,CAAC,CAO3D"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The persistence a local (no-server) run gets: assets and timeline sequences,
|
|
3
|
+
* against the same database `setupDb()` opens.
|
|
4
|
+
*
|
|
5
|
+
* Installed process-wide by each command that runs a graph, so every context
|
|
6
|
+
* built downstream answers the same way. Wiring it per-entrance is what let
|
|
7
|
+
* `nodetool debug` and `nodetool workflows run` disagree: a workflow that
|
|
8
|
+
* saved an image ran under one and threw "ProcessingContext model interface
|
|
9
|
+
* 'createAsset' is not configured" under the other.
|
|
10
|
+
*
|
|
11
|
+
* `createAsset` is the server's own implementation, imported rather than
|
|
12
|
+
* rewritten — the local copy this replaced wrote no thumbnail and left
|
|
13
|
+
* `parent_id` null, so a CLI-generated asset was invisible in every
|
|
14
|
+
* folder-scoped listing in the UI.
|
|
15
|
+
*/
|
|
16
|
+
import { setDefaultModelInterfaces } from "@nodetool-ai/runtime";
|
|
17
|
+
export async function localModelInterfaces() {
|
|
18
|
+
const { createAssetModelInterface, updateAssetBytesModelInterface } = await import("@nodetool-ai/asset-services");
|
|
19
|
+
// Storyboards, the entity library and the game templates, from the same
|
|
20
|
+
// module the server installs — a harness run has to write the rows a server
|
|
21
|
+
// run writes, or it proves nothing about the server.
|
|
22
|
+
const { documentModelInterfaces } = await import("@nodetool-ai/document-services");
|
|
23
|
+
return {
|
|
24
|
+
createAsset: createAssetModelInterface,
|
|
25
|
+
updateAssetBytes: updateAssetBytesModelInterface,
|
|
26
|
+
...documentModelInterfaces()
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
let installed = null;
|
|
30
|
+
/** Install them as this process's default, once. */
|
|
31
|
+
export function installLocalModelInterfaces() {
|
|
32
|
+
if (!installed) {
|
|
33
|
+
installed = localModelInterfaces().then((interfaces) => {
|
|
34
|
+
setDefaultModelInterfaces(interfaces);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
return installed;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=local-model-interfaces.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-model-interfaces.js","sourceRoot":"","sources":["../src/local-model-interfaces.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,MAAM,CAAC,KAAK,UAAU,oBAAoB;IACxC,MAAM,EAAE,yBAAyB,EAAE,8BAA8B,EAAE,GACjE,MAAM,MAAM,CAAC,6BAA6B,CAAC,CAAC;IAC9C,wEAAwE;IACxE,4EAA4E;IAC5E,qDAAqD;IACrD,MAAM,EAAE,uBAAuB,EAAE,GAAG,MAAM,MAAM,CAC9C,gCAAgC,CACjC,CAAC;IACF,OAAO;QACL,WAAW,EAAE,yBAAyB;QACtC,gBAAgB,EAAE,8BAA8B;QAChD,GAAG,uBAAuB,EAAE;KAC7B,CAAC;AACJ,CAAC;AAED,IAAI,SAAS,GAAyB,IAAI,CAAC;AAE3C,oDAAoD;AACpD,MAAM,UAAU,2BAA2B;IACzC,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,SAAS,GAAG,oBAAoB,EAAE,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE;YACrD,yBAAyB,CAAC,UAAU,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type MissingRuntimeDetails, type MissingPackDetails } from "@nodetool-ai/protocol";
|
|
2
|
+
interface NodeRunResult {
|
|
3
|
+
nodeType: string;
|
|
4
|
+
title: string | null;
|
|
5
|
+
ok: boolean;
|
|
6
|
+
error: string | null;
|
|
7
|
+
missingRuntime?: MissingRuntimeDetails;
|
|
8
|
+
missingPack?: MissingPackDetails;
|
|
9
|
+
durationMs: number;
|
|
10
|
+
/** Every record emitted by the node (one entry for a one-shot process()). */
|
|
11
|
+
chunks: Array<Record<string, unknown>>;
|
|
12
|
+
/** Declared output handles, for reference. */
|
|
13
|
+
outputs: Array<{
|
|
14
|
+
name: string;
|
|
15
|
+
type: string;
|
|
16
|
+
}>;
|
|
17
|
+
}
|
|
18
|
+
interface RunSingleNodeOptions {
|
|
19
|
+
/** Property values keyed by @prop name. */
|
|
20
|
+
props?: Record<string, unknown>;
|
|
21
|
+
/**
|
|
22
|
+
* Resolves secrets (API keys) for nodes that need them. Injected by the
|
|
23
|
+
* caller so this module stays free of a hard `@nodetool-ai/models` import
|
|
24
|
+
* (which would pull in the SQLite native binding for hermetic runs). When
|
|
25
|
+
* omitted, every secret resolves to null.
|
|
26
|
+
*/
|
|
27
|
+
secretResolver?: (key: string) => Promise<string | null>;
|
|
28
|
+
}
|
|
29
|
+
export declare function runSingleNode(nodeType: string, options?: RunSingleNodeOptions): Promise<NodeRunResult>;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=run-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-node.d.ts","sourceRoot":"","sources":["../../src/node/run-node.ts"],"names":[],"mappings":"AAWA,OAAO,EAAiD,KAAK,qBAAqB,EAAE,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAK3I,UAAU,aAAa;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,EAAE,EAAE,OAAO,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,cAAc,CAAC,EAAE,qBAAqB,CAAC;IACvC,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,6EAA6E;IAC7E,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACvC,8CAA8C;IAC9C,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChD;AAED,UAAU,oBAAoB;IAC5B,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAC1D;AAUD,wBAAsB,aAAa,CACjC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,aAAa,CAAC,CAyExB"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs a single node in isolation — instantiate it from the registry, feed it a
|
|
3
|
+
* property bag, and capture what its `process()` / `genProcess()` emits. Lets an
|
|
4
|
+
* agent exercise one node's logic without authoring a whole workflow.
|
|
5
|
+
*
|
|
6
|
+
* Integration code (pulls in every node pack + a runtime context), so it's
|
|
7
|
+
* exercised end-to-end rather than unit-tested.
|
|
8
|
+
*/
|
|
9
|
+
import { getDefaultAssetsPath } from "@nodetool-ai/config";
|
|
10
|
+
import { PERMISSION_GATE_CONTEXT_KEY, ProcessingContext, headlessGate } from "@nodetool-ai/runtime";
|
|
11
|
+
import { FileStorageAdapter } from "@nodetool-ai/storage";
|
|
12
|
+
import { missingRuntimeDetailsOf, missingPackDetailsOf } from "@nodetool-ai/protocol";
|
|
13
|
+
import { buildFullRegistry } from "../node-registry.js";
|
|
14
|
+
import { findMissingPacks } from "@nodetool-ai/execution";
|
|
15
|
+
import { MissingPackError } from "@nodetool-ai/protocol";
|
|
16
|
+
function typeMetaToString(tm) {
|
|
17
|
+
if (!tm)
|
|
18
|
+
return "";
|
|
19
|
+
const args = (tm.type_args ?? [])
|
|
20
|
+
.map(typeMetaToString)
|
|
21
|
+
.filter(Boolean);
|
|
22
|
+
return args.length > 0 ? `${tm.type}[${args.join(", ")}]` : tm.type;
|
|
23
|
+
}
|
|
24
|
+
export async function runSingleNode(nodeType, options = {}) {
|
|
25
|
+
const registry = await buildFullRegistry();
|
|
26
|
+
const missing = await findMissingPacks({ nodes: [{ type: nodeType, properties: options.props ?? {} }] }, registry);
|
|
27
|
+
if (missing) {
|
|
28
|
+
throw new MissingPackError(missing);
|
|
29
|
+
}
|
|
30
|
+
if (!registry.has(nodeType)) {
|
|
31
|
+
throw new Error(`Unknown node type "${nodeType}". It is not in the local TS registry (Python-only nodes can't be run this way).`);
|
|
32
|
+
}
|
|
33
|
+
const cls = registry.getClass(nodeType);
|
|
34
|
+
const meta = registry.getMetadata(nodeType);
|
|
35
|
+
const title = meta?.title ?? null;
|
|
36
|
+
const outputs = (meta?.outputs ?? []).map((o) => ({
|
|
37
|
+
name: o.name,
|
|
38
|
+
type: typeMetaToString(o.type)
|
|
39
|
+
}));
|
|
40
|
+
if (cls.isStreamingInput) {
|
|
41
|
+
throw new Error(`Node "${nodeType}" is a streaming-input node — it consumes a live input stream and must run inside a graph. Use \`nodetool debug\` instead.`);
|
|
42
|
+
}
|
|
43
|
+
const props = options.props ?? {};
|
|
44
|
+
const executor = registry.resolve({ id: "single-run", type: nodeType, properties: props });
|
|
45
|
+
const context = new ProcessingContext({
|
|
46
|
+
jobId: `node-run-${Date.now()}`,
|
|
47
|
+
workflowId: null,
|
|
48
|
+
userId: "1",
|
|
49
|
+
secretResolver: options.secretResolver ?? (() => Promise.resolve(null)),
|
|
50
|
+
storage: new FileStorageAdapter(getDefaultAssetsPath())
|
|
51
|
+
});
|
|
52
|
+
context.set(PERMISSION_GATE_CONTEXT_KEY, headlessGate("node run"));
|
|
53
|
+
const startedAt = Date.now();
|
|
54
|
+
const chunks = [];
|
|
55
|
+
try {
|
|
56
|
+
// Drain genProcess: this covers both one-shot nodes (the default genProcess
|
|
57
|
+
// yields process() once) and streaming-output nodes that override it.
|
|
58
|
+
for await (const chunk of executor.genProcess(props, context)) {
|
|
59
|
+
chunks.push(chunk);
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
nodeType,
|
|
63
|
+
title,
|
|
64
|
+
ok: true,
|
|
65
|
+
error: null,
|
|
66
|
+
durationMs: Date.now() - startedAt,
|
|
67
|
+
chunks,
|
|
68
|
+
outputs
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
const missingRuntime = missingRuntimeDetailsOf(err);
|
|
73
|
+
const missingPack = missingPackDetailsOf(err);
|
|
74
|
+
const result = {
|
|
75
|
+
nodeType,
|
|
76
|
+
title,
|
|
77
|
+
ok: false,
|
|
78
|
+
error: err instanceof Error ? err.message : String(err),
|
|
79
|
+
durationMs: Date.now() - startedAt,
|
|
80
|
+
chunks,
|
|
81
|
+
outputs
|
|
82
|
+
};
|
|
83
|
+
if (missingRuntime) {
|
|
84
|
+
result.missingRuntime = missingRuntime;
|
|
85
|
+
}
|
|
86
|
+
if (missingPack) {
|
|
87
|
+
result.missingPack = missingPack;
|
|
88
|
+
}
|
|
89
|
+
return result;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=run-node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-node.js","sourceRoot":"","sources":["../../src/node/run-node.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpG,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAuD,MAAM,uBAAuB,CAAC;AAC3I,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AA4BzD,SAAS,gBAAgB,CAAC,EAAuD;IAC/E,IAAI,CAAC,EAAE;QAAE,OAAO,EAAE,CAAC;IACnB,MAAM,IAAI,GAAI,CAAC,EAAE,CAAC,SAAS,IAAI,EAAE,CAAoD;SAClF,GAAG,CAAC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