@igorjpimenta/manifold 0.0.0-stage → 2026.11.22-beta.3
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/.migrations/ops/0000_futuristic_karma.sql +111 -0
- package/.migrations/ops/0001_low_maximus.sql +7 -0
- package/.migrations/ops/meta/0000_snapshot.json +763 -0
- package/.migrations/ops/meta/0001_snapshot.json +173 -0
- package/.migrations/ops/meta/_journal.json +20 -0
- package/.migrations/runtime/0000_real_boomer.sql +180 -0
- package/.migrations/runtime/0001_hot_dakota_north.sql +2 -0
- package/.migrations/runtime/0002_breezy_vertigo.sql +8 -0
- package/.migrations/runtime/0003_dashing_jack_flag.sql +5 -0
- package/.migrations/runtime/0004_panoramic_ego.sql +1 -0
- package/.migrations/runtime/0005_tidy_ben_grimm.sql +10 -0
- package/.migrations/runtime/0006_wet_nightmare.sql +57 -0
- package/.migrations/runtime/0007_ambiguous_chronomancer.sql +8 -0
- package/.migrations/runtime/0008_wealthy_thundra.sql +301 -0
- package/.migrations/runtime/0009_lying_shocker.sql +96 -0
- package/.migrations/runtime/0010_solid_phantom_reporter.sql +160 -0
- package/.migrations/runtime/0011_windy_demogoblin.sql +175 -0
- package/.migrations/runtime/0012_restore_harness_fks.sql +103 -0
- package/.migrations/runtime/meta/0000_snapshot.json +1181 -0
- package/.migrations/runtime/meta/0001_snapshot.json +1209 -0
- package/.migrations/runtime/meta/0002_snapshot.json +1261 -0
- package/.migrations/runtime/meta/0003_snapshot.json +1292 -0
- package/.migrations/runtime/meta/0004_snapshot.json +1240 -0
- package/.migrations/runtime/meta/0006_snapshot.json +1310 -0
- package/.migrations/runtime/meta/0007_snapshot.json +1362 -0
- package/.migrations/runtime/meta/0008_snapshot.json +1742 -0
- package/.migrations/runtime/meta/0009_snapshot.json +2413 -0
- package/.migrations/runtime/meta/0010_snapshot.json +2562 -0
- package/.migrations/runtime/meta/0011_snapshot.json +2812 -0
- package/.migrations/runtime/meta/0012_snapshot.json +2812 -0
- package/.migrations/runtime/meta/_journal.json +97 -0
- package/README.md +1583 -2
- package/RELEASING.md +89 -0
- package/agent/fleet.js +100 -0
- package/bin/cli.js +854 -0
- package/bin/manifold.js +4 -0
- package/boot/flow-revival.js +536 -0
- package/budget/index.js +495 -0
- package/budget/lib.js +59 -0
- package/dashboard/cost.js +528 -0
- package/dashboard/dist/assets/index-CUfp63sj.css +1 -0
- package/dashboard/dist/assets/index-Qy9JMpma.js +371 -0
- package/dashboard/dist/index.html +13 -0
- package/dashboard/event-log.js +267 -0
- package/dashboard/index.html +12 -0
- package/dashboard/package-lock.json +2877 -0
- package/dashboard/package.json +37 -0
- package/dashboard/pipeline-graph.js +131 -0
- package/dashboard/postcss.config.js +6 -0
- package/dashboard/search.js +183 -0
- package/dashboard/server.js +1015 -0
- package/dashboard/src/App.tsx +42 -0
- package/dashboard/src/api/client.ts +118 -0
- package/dashboard/src/api/types.ts +510 -0
- package/dashboard/src/api/ws.tsx +112 -0
- package/dashboard/src/components/CancelButton.tsx +63 -0
- package/dashboard/src/components/ClickToCopy.tsx +68 -0
- package/dashboard/src/components/CopyButton.tsx +61 -0
- package/dashboard/src/components/DailyCostTrend.tsx +85 -0
- package/dashboard/src/components/DailyTimeTrend.tsx +94 -0
- package/dashboard/src/components/Funnel.tsx +149 -0
- package/dashboard/src/components/GateForm.tsx +158 -0
- package/dashboard/src/components/GraphView.tsx +302 -0
- package/dashboard/src/components/GroupPathsSummary.tsx +47 -0
- package/dashboard/src/components/Histogram.tsx +292 -0
- package/dashboard/src/components/Layout.tsx +28 -0
- package/dashboard/src/components/NeedsAttention.tsx +98 -0
- package/dashboard/src/components/NodeContextCard.tsx +132 -0
- package/dashboard/src/components/PathTrail.tsx +35 -0
- package/dashboard/src/components/PipelineCostBreakdown.tsx +277 -0
- package/dashboard/src/components/RerunButton.tsx +46 -0
- package/dashboard/src/components/RunComparison.tsx +53 -0
- package/dashboard/src/components/Sparkline.tsx +94 -0
- package/dashboard/src/components/StatStrip.tsx +147 -0
- package/dashboard/src/components/StateTree.tsx +84 -0
- package/dashboard/src/components/StatusBadge.tsx +18 -0
- package/dashboard/src/components/SubflowPathPills.tsx +38 -0
- package/dashboard/src/components/SubflowSummary.tsx +24 -0
- package/dashboard/src/components/SubflowsCard.tsx +327 -0
- package/dashboard/src/components/TodayStrip.tsx +86 -0
- package/dashboard/src/components/TranscriptPane.tsx +99 -0
- package/dashboard/src/components/TranscriptRow.tsx +69 -0
- package/dashboard/src/components/ui/badge.tsx +38 -0
- package/dashboard/src/components/ui/button.tsx +28 -0
- package/dashboard/src/components/ui/card.tsx +42 -0
- package/dashboard/src/components/ui/skeleton.tsx +9 -0
- package/dashboard/src/components/ui/table.tsx +62 -0
- package/dashboard/src/index.css +26 -0
- package/dashboard/src/lib/anomaly.ts +42 -0
- package/dashboard/src/lib/format.ts +30 -0
- package/dashboard/src/lib/step-history.ts +13 -0
- package/dashboard/src/lib/subflow.ts +154 -0
- package/dashboard/src/lib/use-click-outside.ts +28 -0
- package/dashboard/src/lib/use-ignored-clusters.ts +67 -0
- package/dashboard/src/lib/utils.ts +6 -0
- package/dashboard/src/main.tsx +10 -0
- package/dashboard/src/types/shims.d.ts +4 -0
- package/dashboard/src/views/Home.tsx +478 -0
- package/dashboard/src/views/PipelineDetail.tsx +1185 -0
- package/dashboard/src/views/PipelinesList.tsx +111 -0
- package/dashboard/src/views/RunDetail.tsx +248 -0
- package/dashboard/src/views/Search.tsx +196 -0
- package/dashboard/stats.js +668 -0
- package/dashboard/tailwind.config.ts +43 -0
- package/dashboard/tree-stats.js +12 -0
- package/dashboard/tsconfig.json +25 -0
- package/dashboard/views.js +231 -0
- package/dashboard/vite.config.ts +34 -0
- package/drizzle.config.js +12 -0
- package/drizzle.config.ops.js +12 -0
- package/elevation.js +116 -0
- package/engine/admission-promotion-resume.js +127 -0
- package/engine/agent-dispatch.js +64 -0
- package/engine/child-resume-trigger.js +315 -0
- package/engine/executor-budget.js +87 -0
- package/engine/executor-cancel.js +83 -0
- package/engine/executor-errors.js +122 -0
- package/engine/executor-helpers.js +254 -0
- package/engine/executor-nodes.js +292 -0
- package/engine/executor-persist.js +212 -0
- package/engine/executor-subflow-children.js +275 -0
- package/engine/executor.js +1013 -0
- package/engine/global-concurrency.js +33 -0
- package/engine/loader.js +528 -0
- package/engine/needs-resolver.js +229 -0
- package/engine/pipelines-watcher.js +133 -0
- package/engine/result-replay.js +34 -0
- package/engine/revival-messages.js +11 -0
- package/engine/spawn-child.js +55 -0
- package/engine/wait-for-flow-settlement.js +109 -0
- package/events/catalog.js +26 -0
- package/events/emit.js +44 -0
- package/events/kinds.js +118 -0
- package/events/serve-ws.js +74 -0
- package/events/stream.js +35 -0
- package/events/ws-dialog.js +257 -0
- package/events/ws-frame.js +194 -0
- package/events/ws-run-events.js +70 -0
- package/events.js +32 -0
- package/gates/gate-resolver.js +576 -0
- package/gates/paused-flows.js +55 -0
- package/graphql/columns.js +67 -0
- package/graphql/schema.js +333 -0
- package/index.js +49 -0
- package/mcp/http.js +159 -0
- package/mcp/identity.js +94 -0
- package/mcp/stdio.js +80 -0
- package/mcp/tools.js +245 -0
- package/mcp/wire-ops.js +178 -0
- package/package.json +49 -4
- package/routes/bearer-auth.js +57 -0
- package/routes/discuss-audio.js +87 -0
- package/routes/discuss-component.js +39 -0
- package/routes/discuss-draft.js +159 -0
- package/routes/discuss-helpers.js +20 -0
- package/routes/discuss.js +848 -0
- package/routes/failures.js +104 -0
- package/routes/graphql.js +61 -0
- package/routes/health.js +54 -0
- package/routes/operator-discuss.js +193 -0
- package/routes/operator-resume.js +32 -0
- package/routes/operator-retry.js +301 -0
- package/routes/operator.js +539 -0
- package/routes/pipelines.js +118 -0
- package/routes/runs.js +1129 -0
- package/scripts/ci/import-check.mjs +50 -0
- package/scripts/link-core-self.mjs +31 -0
- package/scripts/with-guard.sh +24 -0
- package/server/app.js +503 -0
- package/server/registry.js +53 -0
- package/server/serve.js +163 -0
- package/state/admission-queue-store.js +325 -0
- package/state/attribution-registries.js +102 -0
- package/state/batch-writer.js +162 -0
- package/state/db-guard.js +63 -0
- package/state/db-health.js +27 -0
- package/state/db.js +122 -0
- package/state/discuss-store.js +299 -0
- package/state/failure-store.js +427 -0
- package/state/migrate.js +104 -0
- package/state/node-cost.js +67 -0
- package/state/node-executions.js +775 -0
- package/state/node-health-store.js +124 -0
- package/state/ops-merge.js +93 -0
- package/state/paths.js +146 -0
- package/state/pipeline-dirs.js +99 -0
- package/state/pipeline-registry.js +449 -0
- package/state/run-store.js +697 -0
- package/state/schema.js +438 -0
- package/state/schema.ops.js +44 -0
- package/state/session-index.js +177 -0
- package/state/session-keys.js +39 -0
- package/state/state-store.js +311 -0
- package/state/subflow-state.js +126 -0
- package/state/tool-handoff.js +169 -0
- package/telemetry/budget-alert.js +353 -0
- package/telemetry/cli.js +331 -0
- package/telemetry/grammar.js +119 -0
- package/telemetry/http-budget.js +132 -0
- package/telemetry/http-cost.js +670 -0
- package/telemetry/http-helpers.js +134 -0
- package/telemetry/http-tree.js +349 -0
- package/telemetry/http.js +44 -0
- package/telemetry/index.js +307 -0
- package/telemetry/ingest.js +134 -0
- package/telemetry/labels.js +115 -0
- package/telemetry/pricer.js +77 -0
- package/telemetry/resolver.js +314 -0
- package/telemetry/store.js +147 -0
- package/utils/run-patch.js +43 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Config } from "tailwindcss";
|
|
2
|
+
|
|
3
|
+
// Palette mirrors the previous vanilla styles.css so the React + Tailwind
|
|
4
|
+
// dashboard matches the established look (dark theme, GitHub-ish accents).
|
|
5
|
+
// Status colors keep their names so existing JSX class strings read like
|
|
6
|
+
// English: `bg-status-succeeded text-status-succeeded` etc.
|
|
7
|
+
export default {
|
|
8
|
+
content: ["./index.html", "./src/**/*.{ts,tsx}"],
|
|
9
|
+
darkMode: "class",
|
|
10
|
+
theme: {
|
|
11
|
+
extend: {
|
|
12
|
+
colors: {
|
|
13
|
+
bg: {
|
|
14
|
+
DEFAULT: "#0e1116",
|
|
15
|
+
elev: "#161b22",
|
|
16
|
+
elev2: "#1f262e",
|
|
17
|
+
},
|
|
18
|
+
border: {
|
|
19
|
+
DEFAULT: "#2a3038",
|
|
20
|
+
},
|
|
21
|
+
fg: {
|
|
22
|
+
DEFAULT: "#d8dde6",
|
|
23
|
+
dim: "#8b949e",
|
|
24
|
+
},
|
|
25
|
+
accent: "#58a6ff",
|
|
26
|
+
status: {
|
|
27
|
+
green: "#3fb950",
|
|
28
|
+
amber: "#d29922",
|
|
29
|
+
red: "#f85149",
|
|
30
|
+
blue: "#1f6feb",
|
|
31
|
+
grey: "#6e7681",
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
fontFamily: {
|
|
35
|
+
mono: ['ui-monospace', '"SF Mono"', 'Menlo', 'Consolas', 'monospace'],
|
|
36
|
+
},
|
|
37
|
+
fontSize: {
|
|
38
|
+
"2xs": "10px",
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
plugins: [],
|
|
43
|
+
} satisfies Config;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Small, dependency-free home for stats derived from the GET
|
|
2
|
+
// /manifold/runs/:flowId/tree response shape (routes/runs.js's
|
|
3
|
+
// buildTreeNodeRows) — kept out of server.js so it stays importable by unit
|
|
4
|
+
// tests without pulling in device.js's `openclaw` package dependency.
|
|
5
|
+
|
|
6
|
+
// deriveSystemSummary's stepsExecuted. Sum of executionCount across every
|
|
7
|
+
// top-level invocation row, not tree.length — a node re-entered via
|
|
8
|
+
// retry/recheck gets more than one execution under the SAME invocation row.
|
|
9
|
+
export function stepsExecutedFromTree(tree) {
|
|
10
|
+
if (!Array.isArray(tree)) return 0;
|
|
11
|
+
return tree.reduce((sum, row) => sum + (row?.executionCount ?? 0), 0);
|
|
12
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"lib": ["ES2023", "DOM", "DOM.Iterable"],
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"moduleResolution": "bundler",
|
|
9
|
+
"allowImportingTsExtensions": false,
|
|
10
|
+
"resolveJsonModule": true,
|
|
11
|
+
"isolatedModules": true,
|
|
12
|
+
"moduleDetection": "force",
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"jsx": "react-jsx",
|
|
15
|
+
"strict": true,
|
|
16
|
+
"noUnusedLocals": false,
|
|
17
|
+
"noUnusedParameters": false,
|
|
18
|
+
"noFallthroughCasesInSwitch": true,
|
|
19
|
+
"baseUrl": ".",
|
|
20
|
+
"paths": {
|
|
21
|
+
"@/*": ["./src/*"]
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"include": ["src", "vite.config.ts", "tailwind.config.ts"]
|
|
25
|
+
}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
// Pipeline-declared dashboard views. Each pipeline can opt into
|
|
2
|
+
// extra surfaces on its detail page by exporting a `views: [...]`
|
|
3
|
+
// array; the dashboard renders them generically — no per-pipeline
|
|
4
|
+
// dashboard code.
|
|
5
|
+
//
|
|
6
|
+
// View shape (pipeline-side):
|
|
7
|
+
//
|
|
8
|
+
// {
|
|
9
|
+
// id: "outcomes", // stable, per-pipeline-unique
|
|
10
|
+
// kind: "funnel", // currently the only kind
|
|
11
|
+
// label: "outcomes (last 30d)", // card title
|
|
12
|
+
// source: {
|
|
13
|
+
// kind: "frontmatter-dir",
|
|
14
|
+
// path: "/abs/path/to/dir",
|
|
15
|
+
// timeField: "sent-at", // optional; default "sent-at"
|
|
16
|
+
// },
|
|
17
|
+
// stages: [
|
|
18
|
+
// { id: "sent", label: "sent" }, // no filter ⇒ matches all records
|
|
19
|
+
// { id: "replied", label: "replied", outcomeIn: ["replied","qualified","meeting-scheduled","won"] },
|
|
20
|
+
// { id: "won", label: "won", outcomeEq: "won" },
|
|
21
|
+
// ],
|
|
22
|
+
// }
|
|
23
|
+
//
|
|
24
|
+
// To add a new view kind: extend `computeView` with the new branch and
|
|
25
|
+
// add a record-loader if it pulls from a new source kind. The
|
|
26
|
+
// frontend's <DeclaredView> dispatcher mirrors the same `kind` switch.
|
|
27
|
+
|
|
28
|
+
import { readdir, readFile, stat } from "node:fs/promises";
|
|
29
|
+
import path from "node:path";
|
|
30
|
+
|
|
31
|
+
// ─── Top-level dispatcher ────────────────────────────────────────────────────
|
|
32
|
+
|
|
33
|
+
export async function computeViews(pipeline, { sinceMs = null } = {}) {
|
|
34
|
+
if (!Array.isArray(pipeline?.views) || pipeline.views.length === 0) return [];
|
|
35
|
+
// Each view is independent; parallelise the IO. The frontmatter-dir
|
|
36
|
+
// loader is already libuv-pool-bound, so this won't fan out further
|
|
37
|
+
// than Node can handle.
|
|
38
|
+
return Promise.all(pipeline.views.map((v) => computeView(v, { sinceMs })));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async function computeView(view, { sinceMs }) {
|
|
42
|
+
// Per-view sinceDays overrides the caller-supplied window.
|
|
43
|
+
const effectiveSinceMs = typeof view.sinceDays === "number" && view.sinceDays > 0
|
|
44
|
+
? Date.now() - view.sinceDays * 86_400_000
|
|
45
|
+
: sinceMs;
|
|
46
|
+
const base = { id: view.id, kind: view.kind, label: view.label, sinceMs: effectiveSinceMs };
|
|
47
|
+
try {
|
|
48
|
+
if (view.kind === "funnel") return { ...base, ...(await computeFunnelView(view, { sinceMs: effectiveSinceMs })) };
|
|
49
|
+
if (view.kind === "metric") return { ...base, ...(await computeMetricView(view, { sinceMs: effectiveSinceMs })) };
|
|
50
|
+
if (view.kind === "table") return { ...base, ...(await computeTableView(view, { sinceMs: effectiveSinceMs })) };
|
|
51
|
+
return { ...base, error: `unknown view kind: ${view.kind}` };
|
|
52
|
+
} catch (err) {
|
|
53
|
+
return { ...base, error: err?.message ?? String(err) };
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// ─── kind: "funnel" ──────────────────────────────────────────────────────────
|
|
58
|
+
|
|
59
|
+
async function computeFunnelView(view, { sinceMs }) {
|
|
60
|
+
const records = await loadRecords(view.source, { sinceMs });
|
|
61
|
+
if (!records) return { total: 0, funnel: [] };
|
|
62
|
+
const stageDefs = Array.isArray(view.stages) ? view.stages : [];
|
|
63
|
+
|
|
64
|
+
// Compute each stage's count by counting records that match the
|
|
65
|
+
// stage's filter. Stages are filters over the full record set —
|
|
66
|
+
// they don't have to be nested supersets, but for an honest funnel
|
|
67
|
+
// they should be (each later stage ⊆ earlier stage). That's the
|
|
68
|
+
// pipeline author's responsibility.
|
|
69
|
+
const stages = stageDefs.map((s) => ({
|
|
70
|
+
...s,
|
|
71
|
+
count: records.filter((r) => matchStage(r, s)).length,
|
|
72
|
+
}));
|
|
73
|
+
|
|
74
|
+
const out = stages.map((s, i) => ({
|
|
75
|
+
id: s.id,
|
|
76
|
+
label: s.label ?? s.id,
|
|
77
|
+
count: s.count,
|
|
78
|
+
conversionFromPrev: i === 0
|
|
79
|
+
? null
|
|
80
|
+
: (stages[i - 1].count > 0 ? s.count / stages[i - 1].count : null),
|
|
81
|
+
}));
|
|
82
|
+
if (out.length > 1 && stages[0].count > 0) {
|
|
83
|
+
out[out.length - 1].conversionFromStart = out[out.length - 1].count / stages[0].count;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Per-`outcome` distribution — handy for funnels over frontmatter
|
|
87
|
+
// sources where the field name is "outcome". When the source uses a
|
|
88
|
+
// different field name (future) this is omitted.
|
|
89
|
+
const byOutcome = {};
|
|
90
|
+
for (const r of records) {
|
|
91
|
+
if (typeof r.outcome === "string") {
|
|
92
|
+
byOutcome[r.outcome] = (byOutcome[r.outcome] ?? 0) + 1;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return {
|
|
97
|
+
total: records.length,
|
|
98
|
+
funnel: out,
|
|
99
|
+
byOutcome: Object.keys(byOutcome).length > 0 ? byOutcome : undefined,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function matchStage(record, stage) {
|
|
104
|
+
if (Array.isArray(stage.outcomeIn) && stage.outcomeIn.length > 0) {
|
|
105
|
+
return stage.outcomeIn.includes(record.outcome);
|
|
106
|
+
}
|
|
107
|
+
if (typeof stage.outcomeEq === "string") {
|
|
108
|
+
return record.outcome === stage.outcomeEq;
|
|
109
|
+
}
|
|
110
|
+
// No filter declared — stage matches every record (used for "sent",
|
|
111
|
+
// i.e. the cohort base of a funnel).
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// ─── kind: "metric" ──────────────────────────────────────────────────────────
|
|
116
|
+
//
|
|
117
|
+
// compute: "count" — number of records in the window
|
|
118
|
+
// compute: "sum:fieldName" — sum of record[fieldName] (parsed as float)
|
|
119
|
+
// compute: "avg:fieldName" — average of record[fieldName]
|
|
120
|
+
|
|
121
|
+
async function computeMetricView(view, { sinceMs }) {
|
|
122
|
+
const records = await loadRecords(view.source, { sinceMs });
|
|
123
|
+
if (!records) return { value: null };
|
|
124
|
+
const compute = view.compute ?? "count";
|
|
125
|
+
if (compute === "count") return { value: records.length, compute };
|
|
126
|
+
const [op, field] = compute.split(":");
|
|
127
|
+
if (!field) return { value: null, error: `metric compute "${compute}" must be "count" or "op:field"` };
|
|
128
|
+
const nums = records.map((r) => parseFloat(r[field])).filter((n) => Number.isFinite(n));
|
|
129
|
+
if (nums.length === 0) return { value: null, compute };
|
|
130
|
+
if (op === "sum") return { value: nums.reduce((a, b) => a + b, 0), compute };
|
|
131
|
+
if (op === "avg") return { value: nums.reduce((a, b) => a + b, 0) / nums.length, compute };
|
|
132
|
+
return { value: null, error: `unknown metric op "${op}"` };
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// ─── kind: "table" ───────────────────────────────────────────────────────────
|
|
136
|
+
//
|
|
137
|
+
// columns: string[] — frontmatter fields to include in each row
|
|
138
|
+
// limit: number — max rows (default 50), most-recent first
|
|
139
|
+
// sortBy: string — frontmatter field to sort by (default: timeField)
|
|
140
|
+
|
|
141
|
+
async function computeTableView(view, { sinceMs }) {
|
|
142
|
+
const records = await loadRecords(view.source, { sinceMs });
|
|
143
|
+
if (!records) return { columns: view.columns ?? [], rows: [], total: 0 };
|
|
144
|
+
const columns = Array.isArray(view.columns) && view.columns.length > 0
|
|
145
|
+
? view.columns
|
|
146
|
+
: Object.keys(records[0] ?? {}).filter((k) => !k.startsWith("__"));
|
|
147
|
+
const sortField = view.sortBy ?? view.source?.timeField ?? "sent-at";
|
|
148
|
+
const sorted = [...records].sort((a, b) => {
|
|
149
|
+
const at = a[sortField] ?? a.__ts ?? 0;
|
|
150
|
+
const bt = b[sortField] ?? b.__ts ?? 0;
|
|
151
|
+
return (typeof bt === "number" ? bt : 0) - (typeof at === "number" ? at : 0);
|
|
152
|
+
});
|
|
153
|
+
const limit = typeof view.limit === "number" && view.limit > 0 ? view.limit : 50;
|
|
154
|
+
const rows = sorted.slice(0, limit).map((r) => {
|
|
155
|
+
const row = {};
|
|
156
|
+
for (const col of columns) row[col] = r[col] ?? null;
|
|
157
|
+
return row;
|
|
158
|
+
});
|
|
159
|
+
return { columns, rows, total: records.length };
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// ─── source loaders ──────────────────────────────────────────────────────────
|
|
163
|
+
|
|
164
|
+
async function loadRecords(source, { sinceMs }) {
|
|
165
|
+
if (!source || typeof source !== "object") return null;
|
|
166
|
+
if (source.kind === "frontmatter-dir") return loadFrontmatterDirRecords(source, { sinceMs });
|
|
167
|
+
return null;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const FRONTMATTER_RE = /^---\r?\n([\s\S]*?)\r?\n---/;
|
|
171
|
+
|
|
172
|
+
// Minimal YAML frontmatter extractor. The sent/*.md files use flat
|
|
173
|
+
// `key: value` lines (no nesting, no arrays). A full YAML parser would
|
|
174
|
+
// be overkill for five-key headers and would change the build surface.
|
|
175
|
+
function parseFrontmatter(text) {
|
|
176
|
+
const m = text.match(FRONTMATTER_RE);
|
|
177
|
+
if (!m) return null;
|
|
178
|
+
const out = {};
|
|
179
|
+
for (const line of m[1].split(/\r?\n/)) {
|
|
180
|
+
const kv = line.match(/^([^:]+):\s*(.*)$/);
|
|
181
|
+
if (!kv) continue;
|
|
182
|
+
let v = kv[2].trim();
|
|
183
|
+
if (
|
|
184
|
+
(v.startsWith('"') && v.endsWith('"')) ||
|
|
185
|
+
(v.startsWith("'") && v.endsWith("'"))
|
|
186
|
+
) v = v.slice(1, -1);
|
|
187
|
+
out[kv[1].trim()] = v;
|
|
188
|
+
}
|
|
189
|
+
return out;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function parseDate(raw) {
|
|
193
|
+
if (!raw) return null;
|
|
194
|
+
const t = Date.parse(raw);
|
|
195
|
+
return Number.isFinite(t) ? t : null;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
async function loadFrontmatterDirRecords({ path: dir, timeField = "sent-at" }, { sinceMs }) {
|
|
199
|
+
if (!dir || typeof dir !== "string") return null;
|
|
200
|
+
try {
|
|
201
|
+
const s = await stat(dir);
|
|
202
|
+
if (!s.isDirectory()) return null;
|
|
203
|
+
} catch { return null; }
|
|
204
|
+
|
|
205
|
+
let files;
|
|
206
|
+
try { files = await readdir(dir); }
|
|
207
|
+
catch { return null; }
|
|
208
|
+
|
|
209
|
+
const records = [];
|
|
210
|
+
await Promise.all(files.map(async (f) => {
|
|
211
|
+
if (!f.endsWith(".md")) return;
|
|
212
|
+
let raw;
|
|
213
|
+
try { raw = await readFile(path.join(dir, f), "utf-8"); }
|
|
214
|
+
catch { return; }
|
|
215
|
+
const fm = parseFrontmatter(raw);
|
|
216
|
+
if (!fm) return;
|
|
217
|
+
const ts = parseDate(fm[timeField]);
|
|
218
|
+
if (sinceMs != null) {
|
|
219
|
+
// Records missing the time field are excluded from windowed
|
|
220
|
+
// queries — better to be honest about the cohort than to
|
|
221
|
+
// silently inflate it with unknown-date records.
|
|
222
|
+
if (ts == null || ts < sinceMs) return;
|
|
223
|
+
}
|
|
224
|
+
records.push({
|
|
225
|
+
id: f.replace(/\.md$/, ""),
|
|
226
|
+
...fm,
|
|
227
|
+
__ts: ts,
|
|
228
|
+
});
|
|
229
|
+
}));
|
|
230
|
+
return records;
|
|
231
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { defineConfig } from "vite";
|
|
2
|
+
import react from "@vitejs/plugin-react";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
|
|
5
|
+
// Built under base `/graph/` so the dashboard can be mounted as a subpath
|
|
6
|
+
// behind tailscale serve (e.g. https://<tailnet>/graph/) without asset paths
|
|
7
|
+
// colliding with the gateway at `/`. server.js strips the prefix for direct
|
|
8
|
+
// loopback requests, and tailscale serve strips it on the proxy side, so the
|
|
9
|
+
// same bundle works both ways.
|
|
10
|
+
export default defineConfig({
|
|
11
|
+
base: "/graph/",
|
|
12
|
+
plugins: [react()],
|
|
13
|
+
resolve: {
|
|
14
|
+
alias: {
|
|
15
|
+
"@": path.resolve(__dirname, "./src"),
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
build: {
|
|
19
|
+
outDir: "dist",
|
|
20
|
+
emptyOutDir: true,
|
|
21
|
+
rollupOptions: {
|
|
22
|
+
output: {
|
|
23
|
+
manualChunks: undefined,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
server: {
|
|
28
|
+
port: 5173,
|
|
29
|
+
proxy: {
|
|
30
|
+
"/graph/api": { target: "http://127.0.0.1:7430", changeOrigin: false },
|
|
31
|
+
"/graph/static": { target: "http://127.0.0.1:7430", changeOrigin: false },
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineConfig } from "drizzle-kit";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
dialect: "sqlite",
|
|
7
|
+
schema: "./state/schema.js",
|
|
8
|
+
out: "./.migrations/runtime",
|
|
9
|
+
dbCredentials: {
|
|
10
|
+
url: path.join(os.homedir(), ".openclaw", "runtime.sqlite"),
|
|
11
|
+
},
|
|
12
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineConfig } from "drizzle-kit";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
dialect: "sqlite",
|
|
7
|
+
schema: "./state/schema.ops.js",
|
|
8
|
+
out: "./.migrations/ops",
|
|
9
|
+
dbCredentials: {
|
|
10
|
+
url: path.join(os.homedir(), ".openclaw", "ops.sqlite"),
|
|
11
|
+
},
|
|
12
|
+
});
|
package/elevation.js
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// elevation.js — plugin-side helper for routes that need ambient operator
|
|
2
|
+
// scope but are exposed via `auth: "plugin"` (so they accept device tokens
|
|
3
|
+
// instead of the env-var token).
|
|
4
|
+
//
|
|
5
|
+
// The problem this fixes:
|
|
6
|
+
// Plugin-auth HTTP routes don't get an operator scope on the request —
|
|
7
|
+
// they get "the plugin handles auth" with NO scope propagation. Anything
|
|
8
|
+
// inside the handler that scope-checks against operator.* (notably
|
|
9
|
+
// subagent.run, which gateway-internally requires operator.write) fails
|
|
10
|
+
// with `missing scope: operator.write` even when the device token has
|
|
11
|
+
// operator.write declared. This includes async work scheduled via
|
|
12
|
+
// setImmediate from inside the handler — the orphaned context has no
|
|
13
|
+
// ambient operator scope either.
|
|
14
|
+
//
|
|
15
|
+
// The mechanism:
|
|
16
|
+
// The gateway's `auth: "gateway"` middleware DOES set ambient operator
|
|
17
|
+
// scope: when an HTTP request authenticates via the shared-secret
|
|
18
|
+
// env-var token (OPENCLAW_GATEWAY_TOKEN), the auth path attaches
|
|
19
|
+
// CLI_DEFAULT_OPERATOR_SCOPES (admin/write/read/approvals/pairing/
|
|
20
|
+
// talk.secrets) — see http-auth-utils-Chseq2ys.js. Routes registered
|
|
21
|
+
// with `auth: "gateway"` inherit that scope ambient through their
|
|
22
|
+
// handler execution.
|
|
23
|
+
//
|
|
24
|
+
// So a plugin-auth route can validate its device token, then loopback
|
|
25
|
+
// over localhost to a sibling `auth: "gateway"` route using the env-var
|
|
26
|
+
// Bearer to perform the operator-scoped work. The elevation crosses
|
|
27
|
+
// the auth boundary cleanly: device-token auth in front, env-var auth
|
|
28
|
+
// inside, no token leakage to clients.
|
|
29
|
+
//
|
|
30
|
+
// Usage pattern:
|
|
31
|
+
// In your external (auth: "plugin") route:
|
|
32
|
+
// const { ok, status, body } = await invokeElevated("/manifold/_elev/start", payload);
|
|
33
|
+
// res.statusCode = status;
|
|
34
|
+
// res.end(body);
|
|
35
|
+
// In your internal (auth: "gateway") route:
|
|
36
|
+
// handler: async (req, res) => {
|
|
37
|
+
// // Body already validated by the caller (or re-validate). Scope is
|
|
38
|
+
// // ambient operator.*. Do the work that needs it.
|
|
39
|
+
// }
|
|
40
|
+
//
|
|
41
|
+
// When NOT to use this:
|
|
42
|
+
// - For purely read-only operations, just keep auth: "plugin" — they
|
|
43
|
+
// don't need operator.write.
|
|
44
|
+
// - For routes whose auth is acceptable as env-var only (e.g. internal
|
|
45
|
+
// gateway-to-gateway), register directly with auth: "gateway" and
|
|
46
|
+
// skip the loopback.
|
|
47
|
+
|
|
48
|
+
import http from "node:http";
|
|
49
|
+
|
|
50
|
+
const GATEWAY_PORT = Number(process.env.OPENCLAW_GATEWAY_PORT) || 18789;
|
|
51
|
+
const GATEWAY_HOST = "127.0.0.1";
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* POST to a gateway-auth route on loopback with the env-var Bearer, so the
|
|
55
|
+
* target handler runs with CLI_DEFAULT_OPERATOR_SCOPES ambient.
|
|
56
|
+
*
|
|
57
|
+
* Returns { ok, status, body, error? } — body is the raw response string.
|
|
58
|
+
* Caller is responsible for content-type interpretation.
|
|
59
|
+
*
|
|
60
|
+
* `opts.timeoutMs` defaults to 30s — fine for routes that schedule work
|
|
61
|
+
* and return quickly (e.g. /manifold/_elev/start kicks off a flow via
|
|
62
|
+
* setImmediate). Routes that block on subagent.run (e.g. /_elev/discuss
|
|
63
|
+
* waits up to 5 min for Herculano to compose a reply) MUST pass a
|
|
64
|
+
* timeout above the inner wait, or the loopback gives up while the
|
|
65
|
+
* inner work is still in flight and surfaces a confusing 500.
|
|
66
|
+
*/
|
|
67
|
+
export async function invokeElevated(path, payload, opts = {}) {
|
|
68
|
+
const timeoutMs = Number.isFinite(opts.timeoutMs) ? opts.timeoutMs : 30_000;
|
|
69
|
+
const token = process.env.OPENCLAW_GATEWAY_TOKEN;
|
|
70
|
+
if (!token) {
|
|
71
|
+
return {
|
|
72
|
+
ok: false,
|
|
73
|
+
status: 503,
|
|
74
|
+
body: JSON.stringify({ ok: false, code: "no_gateway_token", error: "OPENCLAW_GATEWAY_TOKEN unset" }),
|
|
75
|
+
error: "no_gateway_token",
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
const body = typeof payload === "string" ? payload : JSON.stringify(payload ?? {});
|
|
79
|
+
return new Promise((resolve) => {
|
|
80
|
+
const req = http.request({
|
|
81
|
+
hostname: GATEWAY_HOST,
|
|
82
|
+
port: GATEWAY_PORT,
|
|
83
|
+
method: "POST",
|
|
84
|
+
path,
|
|
85
|
+
headers: {
|
|
86
|
+
"Content-Type": "application/json",
|
|
87
|
+
"Authorization": `Bearer ${token}`,
|
|
88
|
+
"Content-Length": Buffer.byteLength(body),
|
|
89
|
+
},
|
|
90
|
+
}, (res) => {
|
|
91
|
+
let raw = "";
|
|
92
|
+
res.setEncoding("utf8");
|
|
93
|
+
res.on("data", (chunk) => { raw += chunk; });
|
|
94
|
+
res.on("end", () => {
|
|
95
|
+
resolve({
|
|
96
|
+
ok: res.statusCode >= 200 && res.statusCode < 300,
|
|
97
|
+
status: res.statusCode ?? 0,
|
|
98
|
+
body: raw,
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
req.on("error", (err) => {
|
|
103
|
+
resolve({
|
|
104
|
+
ok: false,
|
|
105
|
+
status: 0,
|
|
106
|
+
body: JSON.stringify({ ok: false, code: "loopback_failed", error: err?.message ?? String(err) }),
|
|
107
|
+
error: err?.message ?? String(err),
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
req.setTimeout(timeoutMs, () => {
|
|
111
|
+
req.destroy(new Error("loopback timeout"));
|
|
112
|
+
});
|
|
113
|
+
req.write(body);
|
|
114
|
+
req.end();
|
|
115
|
+
});
|
|
116
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
// admission-promotion-resume.js — wakes a flow once admission-queue-
|
|
2
|
+
// store.js's release()/releaseByFlow()/fillFreeSlots() promotes it out of
|
|
3
|
+
// "queued" and into "admitted" — i.e. once a slot in the shared pool
|
|
4
|
+
// actually frees up. Handles both admission kinds: kind:"child-dispatch" (a
|
|
5
|
+
// queued subflow child) and kind:"flow-start" (a queued root flow, or a
|
|
6
|
+
// root flow re-queued on resume from a gate — see engine/child-resume-
|
|
7
|
+
// trigger.js's admitAndSetRunning/flipToRunningAndResume).
|
|
8
|
+
//
|
|
9
|
+
// A queued flow/child has no in-process waiter at all: it's a real
|
|
10
|
+
// flow_runs row that may have been queued for hours by a process that has
|
|
11
|
+
// since restarted. Promoting it means flipping that row to 'running' and
|
|
12
|
+
// re-entering the engine via resume(), like any other blocked/queued-flow
|
|
13
|
+
// wake in this codebase — engine/child-resume-trigger.js's
|
|
14
|
+
// flipToRunningAndResume already does exactly that.
|
|
15
|
+
//
|
|
16
|
+
// The promoted flow's run is DETACHED from the releaser's call stack
|
|
17
|
+
// (scheduleDetachedResume below): the durable part — the admission
|
|
18
|
+
// promotion and the flip to 'running' — is still awaited, but resume()
|
|
19
|
+
// itself starts on its own tick. Awaiting it inline would make whoever
|
|
20
|
+
// called release() — often a flow that just went blocked or terminal inside
|
|
21
|
+
// its own state-store write — wait for the promoted flow's whole run to
|
|
22
|
+
// reach its next block point, and that run can release and promote the
|
|
23
|
+
// next flow inline in turn, nesting every flow in the queue inside the
|
|
24
|
+
// first releaser's call.
|
|
25
|
+
//
|
|
26
|
+
// Gateway readiness: a flow/child woken here may not have run at all since
|
|
27
|
+
// the gateway restarted (a queued admission survives a crash same as any
|
|
28
|
+
// other flow_runs row), so it can reach an agent-kind node inside the
|
|
29
|
+
// gateway's startup window. Nothing to wait for here: resume() is the
|
|
30
|
+
// executor's, and every agent dispatch it makes goes through the executor's
|
|
31
|
+
// readiness gate (the harness's run-turn gate).
|
|
32
|
+
|
|
33
|
+
import { flipToRunningAndResume } from "./child-resume-trigger.js";
|
|
34
|
+
|
|
35
|
+
// On globalThis, not module scope: extensions/manifold/** can load through
|
|
36
|
+
// both jiti and native ESM in one process, and a CLI command's
|
|
37
|
+
// drainDetachedResumes() must see tasks scheduled by either instance.
|
|
38
|
+
const PENDING_KEY = "__manifold_detached_resumes__";
|
|
39
|
+
function pendingResumes() {
|
|
40
|
+
if (!globalThis[PENDING_KEY]) globalThis[PENDING_KEY] = new Set();
|
|
41
|
+
return globalThis[PENDING_KEY];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Starts resume(flowId) on the next tick, in its own call stack. Never
|
|
45
|
+
// throws and never rejects — a failure is logged tagged with `context`,
|
|
46
|
+
// since the caller has already returned by the time the run happens.
|
|
47
|
+
export function scheduleDetachedResume(resume, flowId, { logger, context } = {}) {
|
|
48
|
+
const pending = pendingResumes();
|
|
49
|
+
const task = new Promise((ready) => setImmediate(ready))
|
|
50
|
+
.then(() => resume(flowId))
|
|
51
|
+
.catch((err) => {
|
|
52
|
+
logger?.warn?.(`${context ?? "admission-promotion-resume"}: detached resume [${String(flowId).slice(0, 8)}] failed: ${err?.message ?? err}`);
|
|
53
|
+
})
|
|
54
|
+
.finally(() => pending.delete(task));
|
|
55
|
+
pending.add(task);
|
|
56
|
+
return task;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// For short-lived processes (CLI commands) that must not exit while a
|
|
60
|
+
// detached resume is still pending. Loops because a resumed run can itself
|
|
61
|
+
// release a slot and schedule another detached resume.
|
|
62
|
+
export async function drainDetachedResumes() {
|
|
63
|
+
const pending = pendingResumes();
|
|
64
|
+
while (pending.size > 0) {
|
|
65
|
+
await Promise.allSettled([...pending]);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const RESUMABLE_KINDS = new Set(["child-dispatch", "flow-start"]);
|
|
70
|
+
|
|
71
|
+
// Guards against driving a promoted row whose kind this engine doesn't
|
|
72
|
+
// admit — such a row has no flow run to flip.
|
|
73
|
+
export function isEngineResumableKind(kind) {
|
|
74
|
+
return RESUMABLE_KINDS.has(kind);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Flips the promoted flow to 'running' (awaited) and schedules its run
|
|
78
|
+
// (detached — see this file's header), so `resumed: true` means "flipped
|
|
79
|
+
// and scheduled", not "ran".
|
|
80
|
+
export async function resumePromotedAdmission({ promoted, runStore, resume, logger, api, context }) {
|
|
81
|
+
if (!promoted || !isEngineResumableKind(promoted.kind)) {
|
|
82
|
+
return { resumed: false, reason: "not_a_resumable_promotion" };
|
|
83
|
+
}
|
|
84
|
+
if (typeof resume !== "function") return { resumed: false, reason: "no_resume_fn" };
|
|
85
|
+
const detachedResume = (flowId) => { scheduleDetachedResume(resume, flowId, { logger, api, context }); };
|
|
86
|
+
// No admissionQueueStore passed here, deliberately — this flow was just
|
|
87
|
+
// PROMOTED, meaning its admission row is already 'admitted'. Asking
|
|
88
|
+
// flipToRunningAndResume to re-admit would claim a second, duplicate
|
|
89
|
+
// entry for the same flow+kind.
|
|
90
|
+
return flipToRunningAndResume({ parentFlowId: promoted.flowId, runStore, resume: detachedResume, logger, api });
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// wakePromotedRelease — the ONE place every admissionQueueStore.release()/
|
|
94
|
+
// releaseByFlow() call site should go through, instead of each
|
|
95
|
+
// independently re-deriving the same "if (result.promoted) { await
|
|
96
|
+
// resumePromotedAdmission(...).catch(err => logger.warn(...)) }" glue.
|
|
97
|
+
//
|
|
98
|
+
// `releaseResult` is whatever release()/releaseByFlow() resolved to, or an
|
|
99
|
+
// array of several (state-store.js's triggerAdmissionRelease releases both
|
|
100
|
+
// flow-start and child-dispatch for the SAME departing flow in one
|
|
101
|
+
// Promise.all — at most one of the two can ever carry a real promotion, so
|
|
102
|
+
// the first non-null wins). An unsuccessful outcome — resumePromotedAdmission
|
|
103
|
+
// resolving {resumed:false}, or throwing outright — logs a warning tagged
|
|
104
|
+
// with the caller-supplied `context`, so no call site has to remember to
|
|
105
|
+
// check `result.resumed` itself.
|
|
106
|
+
//
|
|
107
|
+
// Returns resumePromotedAdmission's own result shape ({resumed, reason,
|
|
108
|
+
// ...}) so a caller that wants to act on the outcome (e.g. bin/cli.js's
|
|
109
|
+
// release-leaked-admission, which prints it for the operator) still can;
|
|
110
|
+
// callers that are purely fire-and-forget can ignore the return value.
|
|
111
|
+
export async function wakePromotedRelease(releaseResult, { runStore, resume, logger, api, context }) {
|
|
112
|
+
const results = Array.isArray(releaseResult) ? releaseResult : [releaseResult];
|
|
113
|
+
const promoted = results.reduce((found, r) => found ?? r?.promoted ?? null, null);
|
|
114
|
+
if (!promoted || !isEngineResumableKind(promoted.kind)) {
|
|
115
|
+
return { resumed: false, reason: "nothing_to_wake" };
|
|
116
|
+
}
|
|
117
|
+
try {
|
|
118
|
+
const result = await resumePromotedAdmission({ promoted, runStore, resume, logger, api, context });
|
|
119
|
+
if (!result.resumed) {
|
|
120
|
+
logger?.warn?.(`${context}: promoted [${promoted.id.slice(0, 8)}] did not resume: ${result.reason ?? "unknown"}`);
|
|
121
|
+
}
|
|
122
|
+
return result;
|
|
123
|
+
} catch (err) {
|
|
124
|
+
logger?.warn?.(`${context}: resume after promotion [${promoted.id.slice(0, 8)}] failed: ${err?.message ?? err}`);
|
|
125
|
+
return { resumed: false, reason: "threw", error: err?.message ?? String(err) };
|
|
126
|
+
}
|
|
127
|
+
}
|