@shapeshift-labs/loom 0.1.15 → 0.1.17
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/README.md +156 -6
- package/dist/capabilities.d.ts.map +1 -1
- package/dist/capabilities.js +21 -3
- package/dist/capabilities.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +160 -2
- package/dist/cli.js.map +1 -1
- package/dist/delegate.d.ts +9 -4
- package/dist/delegate.d.ts.map +1 -1
- package/dist/delegate.js +113 -3
- package/dist/delegate.js.map +1 -1
- package/dist/graph-frontier-run-convert.d.ts +6 -0
- package/dist/graph-frontier-run-convert.d.ts.map +1 -0
- package/dist/graph-frontier-run-convert.js +219 -0
- package/dist/graph-frontier-run-convert.js.map +1 -0
- package/dist/graph-frontier-run-records.d.ts +9 -0
- package/dist/graph-frontier-run-records.d.ts.map +1 -0
- package/dist/graph-frontier-run-records.js +105 -0
- package/dist/graph-frontier-run-records.js.map +1 -0
- package/dist/graph-frontier-run.d.ts +6 -0
- package/dist/graph-frontier-run.d.ts.map +1 -0
- package/dist/graph-frontier-run.js +63 -0
- package/dist/graph-frontier-run.js.map +1 -0
- package/dist/graph-live.d.ts +6 -0
- package/dist/graph-live.d.ts.map +1 -0
- package/dist/graph-live.js +251 -0
- package/dist/graph-live.js.map +1 -0
- package/dist/graph.d.ts +42 -1
- package/dist/graph.d.ts.map +1 -1
- package/dist/graph.js +824 -1
- package/dist/graph.js.map +1 -1
- package/dist/help.d.ts.map +1 -1
- package/dist/help.js +27 -0
- package/dist/help.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/output.d.ts.map +1 -1
- package/dist/output.js +45 -1
- package/dist/output.js.map +1 -1
- package/dist/status-ui-health.d.ts +4 -0
- package/dist/status-ui-health.d.ts.map +1 -0
- package/dist/status-ui-health.js +91 -0
- package/dist/status-ui-health.js.map +1 -0
- package/dist/status-ui.d.ts +40 -0
- package/dist/status-ui.d.ts.map +1 -0
- package/dist/status-ui.js +249 -0
- package/dist/status-ui.js.map +1 -0
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +5 -1
- package/dist/status.js.map +1 -1
- package/dist/swarm.d.ts.map +1 -1
- package/dist/swarm.js +2 -0
- package/dist/swarm.js.map +1 -1
- package/dist/types.d.ts +409 -0
- package/dist/types.d.ts.map +1 -1
- package/frontier.source-policy.json +21 -1
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -34,8 +34,11 @@ Loom gives a repository a durable semantic workspace:
|
|
|
34
34
|
- `.loom/index.json` records the current imported source graph.
|
|
35
35
|
- `.loom/refs/` and `.loom/HEAD` track semantic graph snapshots.
|
|
36
36
|
- `.loom/graph/current.json` is the current machine-readable source graph.
|
|
37
|
+
- `.loom/graph/runs/` stores durable swarm run graphs by run id.
|
|
37
38
|
- `.loom/projections/` stores target-language projection plans.
|
|
38
39
|
- `loom swarm ...` delegates to Frontier Swarm / Codex worker orchestration.
|
|
40
|
+
- `loom ui ...` opens the dark Loom dashboard against a swarm run or collected
|
|
41
|
+
swarm collection for inspecting and steering workers.
|
|
39
42
|
- `loom lang ...` delegates to Frontier Lang parsing, source import, slicing,
|
|
40
43
|
projection, and universal AST commands.
|
|
41
44
|
- `loom frontier ...` delegates to Frontier Framework app, evidence, harness,
|
|
@@ -51,6 +54,9 @@ loom scan
|
|
|
51
54
|
loom status --json
|
|
52
55
|
loom snapshot -m "initial semantic graph"
|
|
53
56
|
loom diff --json
|
|
57
|
+
loom run-graph status my-run --json
|
|
58
|
+
loom run-graph import-swarm agent-runs/my-run/collected/run-graph.json --run-id my-run
|
|
59
|
+
loom run-graph import-swarm agent-runs/my-run/live-run-graph-events.jsonl --run-id my-run
|
|
54
60
|
loom project --to python
|
|
55
61
|
loom capabilities
|
|
56
62
|
loom version
|
|
@@ -96,13 +102,19 @@ Output: `.loom/graph/current.json`, `.loom/index.json`,
|
|
|
96
102
|
### `loom status`
|
|
97
103
|
|
|
98
104
|
Reports whether the project has Loom config, a current graph, git dirtiness,
|
|
99
|
-
semantic HEAD/ref information, installed Frontier package versions,
|
|
100
|
-
|
|
105
|
+
semantic HEAD/ref information, installed Frontier package versions, delegate
|
|
106
|
+
command availability, and UI launch hints for detected local swarm runs or
|
|
107
|
+
collections.
|
|
101
108
|
|
|
102
109
|
```sh
|
|
103
110
|
loom status [--json]
|
|
104
111
|
```
|
|
105
112
|
|
|
113
|
+
`--json` includes a `uiLaunch` block with canonical `loom ui ...` and
|
|
114
|
+
`loom swarm dashboard ...` commands. When Loom sees local run evidence under
|
|
115
|
+
`agent-runs/` or `.loom/runs/`, it reports ready-to-copy targets with both bare
|
|
116
|
+
path commands and explicit `--run` or `--collection` forms.
|
|
117
|
+
|
|
106
118
|
### `loom graph`
|
|
107
119
|
|
|
108
120
|
Prints `.loom/graph/current.json`.
|
|
@@ -111,6 +123,62 @@ Prints `.loom/graph/current.json`.
|
|
|
111
123
|
loom graph [--json]
|
|
112
124
|
```
|
|
113
125
|
|
|
126
|
+
### `loom run-graph`
|
|
127
|
+
|
|
128
|
+
Reads and writes durable run dependency graphs stored under
|
|
129
|
+
`.loom/graph/runs/`. Run ids are sanitized into stable filenames, so a run id
|
|
130
|
+
such as `agent-runs/my-run` is stored as
|
|
131
|
+
`.loom/graph/runs/agent-runs_my-run.json`.
|
|
132
|
+
|
|
133
|
+
```sh
|
|
134
|
+
loom run-graph read [<run-id>] [--run-id <id>]
|
|
135
|
+
loom run-graph status [<run-id>] [--run-id <id>] [--json]
|
|
136
|
+
loom run-graph write-json <file|-> [--run-id <id>] [--json]
|
|
137
|
+
loom run-graph import-swarm <json-or-jsonl|-> [--run-id <id>] [--json]
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
`read` prints the stored `loom.run-graph` JSON. `status` reports whether the
|
|
141
|
+
graph file is missing, present, or present but invalid without surfacing a raw
|
|
142
|
+
stack trace. `write-json` stores a JSON `loom.run-graph` document using the
|
|
143
|
+
existing Loom run graph writer; pass `-` to read from stdin. `import-swarm`
|
|
144
|
+
normalizes a `frontier.swarm-codex.run-graph` artifact, such as
|
|
145
|
+
`agent-runs/<run>/collected/run-graph.json`, or a live
|
|
146
|
+
`frontier.swarm-codex.live-run-graph-event` JSONL stream, such as
|
|
147
|
+
`agent-runs/<run>/live-run-graph-events.jsonl`, into Loom's durable
|
|
148
|
+
`.loom/graph/runs/` model. Imported graphs are stored as `loom.run-graph`
|
|
149
|
+
documents with `source: "frontier-swarm-codex"`, `sourceKind`, and
|
|
150
|
+
`sourceMetadata` pointing back to the original artifact path/run directory.
|
|
151
|
+
Live JSONL imports also record `sourceMetadata.eventCount` and
|
|
152
|
+
`sourceMetadata.eventTypes`. Native Loom graphs can use `source:
|
|
153
|
+
"loom-native"`; `status --json` includes `sourceKind` so tools can distinguish
|
|
154
|
+
native and imported graphs without parsing free-form metadata.
|
|
155
|
+
|
|
156
|
+
`loom.run-graph` also accepts an optional `decisionGraph` section for typed
|
|
157
|
+
durable decision graphs. The legacy `graph.nodes: string[]` and dependency
|
|
158
|
+
indexes stay compatible for older job graph readers, while `decisionGraph`
|
|
159
|
+
stores typed nodes, edges, events, snapshots, indexes, and records for evidence,
|
|
160
|
+
gates, semantic changes, merge candidates, tournaments, panels, replays, and
|
|
161
|
+
improvement loops. Built-in node kinds include `intent`, `task`, `worker`,
|
|
162
|
+
`candidate`, `evidence`, `gate`, `decision`, `merge`, `replay`, and `rsi`.
|
|
163
|
+
Swarm imports populate this section alongside the legacy graph.
|
|
164
|
+
|
|
165
|
+
Typed summaries include `summary.typedCounts` when imported data contains
|
|
166
|
+
recognizable intents, tasks, workers, candidates, gates, evidence, merges,
|
|
167
|
+
panels, tournaments, RSI loops, or semantic changes. `status` prints a compact
|
|
168
|
+
`typed graph:` line for non-JSON output. The JavaScript API also exports
|
|
169
|
+
projection and chunk helpers so UI/read-models can be derived from graph truth
|
|
170
|
+
instead of becoming separate sources of truth:
|
|
171
|
+
|
|
172
|
+
```ts
|
|
173
|
+
const chain = buildRunGraphChainChunk(['intent:demo', 'task:demo', 'worker:demo']);
|
|
174
|
+
const mergeGate = buildRunGraphPatternChunk('merge-gate', [
|
|
175
|
+
'candidate:demo',
|
|
176
|
+
'gate:tests',
|
|
177
|
+
'merge:demo'
|
|
178
|
+
]);
|
|
179
|
+
const panels = createLoomRunGraphPanelRecords(runGraph.decisionGraph);
|
|
180
|
+
```
|
|
181
|
+
|
|
114
182
|
### `loom diff`
|
|
115
183
|
|
|
116
184
|
Compares the saved graph with the current source tree without mutating `.loom/`.
|
|
@@ -162,13 +230,18 @@ loom doctor [--json]
|
|
|
162
230
|
```
|
|
163
231
|
|
|
164
232
|
Required packages are Frontier core, Frontier Lang, Frontier Lang CLI, Frontier
|
|
165
|
-
Lang compiler, Frontier Swarm, Frontier Swarm Codex,
|
|
233
|
+
Lang compiler, Frontier Swarm, Frontier Swarm Codex, Frontier Loom UI, and
|
|
234
|
+
Frontier Framework.
|
|
166
235
|
|
|
167
236
|
Plain output lists missing packages and delegate availability. `--json` also
|
|
168
237
|
includes `packageName`, `binName`, `required`, `available`, `version`, `cliPath`,
|
|
169
238
|
`resolution`, `pathRequired`, `pathAvailable`, and resolution `error` fields.
|
|
170
239
|
Delegates resolve from installed package bins, so raw `frontier-swarm` or
|
|
171
240
|
`frontier-lang` binaries do not need to be on `PATH` when `loom ...` works.
|
|
241
|
+
For local package development, override a delegate with
|
|
242
|
+
`LOOM_DELEGATE_<COMMAND>_CLI=/path/to/dist/cli.js` or
|
|
243
|
+
`LOOM_DELEGATE_<COMMAND>_PACKAGE_ROOT=/path/to/package`; hyphenated commands
|
|
244
|
+
use underscores, such as `LOOM_DELEGATE_SWARM_CODEX_CLI`.
|
|
172
245
|
|
|
173
246
|
### `loom capabilities`
|
|
174
247
|
|
|
@@ -209,15 +282,51 @@ loom swarm doctor
|
|
|
209
282
|
loom swarm plan --manifest agent-ownership.json --tasks work-queue.json --outDir agent-runs/plan
|
|
210
283
|
loom swarm run --manifest agent-ownership.json --tasks work-queue.json --workspace copy --concurrency 8
|
|
211
284
|
loom swarm collect --run agent-runs/my-run
|
|
285
|
+
loom swarm dashboard agent-runs/my-run/collected
|
|
286
|
+
loom swarm ui agent-runs/my-run --open
|
|
287
|
+
loom ui agent-runs/my-run
|
|
288
|
+
loom swarm continue --collection agent-runs/my-run/collected --backlog swarm-backlog.json --routing-policy model-routing-policy.json
|
|
289
|
+
LOOM_DELEGATE_SWARM_CODEX_CLI=../frontier-swarm-codex/dist/cli.js loom swarm-codex continue --collection agent-runs/my-run/collected
|
|
212
290
|
loom swarm query --run agent-runs/my-run --semantic --readiness ready
|
|
213
291
|
loom swarm tournament show --run agent-runs/my-run
|
|
214
292
|
```
|
|
215
293
|
|
|
216
294
|
This exposes swarm planning, run/resume/stop, collect/query, merge admission,
|
|
217
|
-
semantic sidecar inspection, adaptive/tournament scheduling,
|
|
218
|
-
|
|
295
|
+
semantic sidecar inspection, adaptive/tournament scheduling, continuation from
|
|
296
|
+
collected child backlogs/model-routing feedback, scoring, cleanup, repair-links,
|
|
297
|
+
and verification commands provided by
|
|
219
298
|
`@shapeshift-labs/frontier-swarm-codex`.
|
|
220
299
|
|
|
300
|
+
### `loom ui`
|
|
301
|
+
|
|
302
|
+
Delegates to the installed Frontier Loom UI package. `loom swarm dashboard` and
|
|
303
|
+
`loom swarm ui` are aliases that keep the dashboard discoverable from swarm
|
|
304
|
+
workflows. A bare path is treated as `--run` unless it looks like a collected
|
|
305
|
+
swarm collection directory or `collection.json`, in which case Loom forwards it
|
|
306
|
+
as `--collection`.
|
|
307
|
+
|
|
308
|
+
```sh
|
|
309
|
+
loom ui [<run-or-collection>] [frontier-loom-ui options...]
|
|
310
|
+
loom swarm dashboard [<run-or-collection>] [frontier-loom-ui options...]
|
|
311
|
+
loom swarm ui [<run-or-collection>] [frontier-loom-ui options...]
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
Examples:
|
|
315
|
+
|
|
316
|
+
```sh
|
|
317
|
+
loom ui agent-runs/my-run
|
|
318
|
+
loom swarm dashboard agent-runs/my-run --open
|
|
319
|
+
loom swarm ui agent-runs/my-run --port 4173
|
|
320
|
+
loom swarm dashboard agent-runs/my-run/collected
|
|
321
|
+
loom ui --collection agent-runs/my-run/collected --continuation agent-runs/my-run/continuation
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
The UI reads dashboard snapshots from `@shapeshift-labs/frontier-swarm-codex`
|
|
325
|
+
and writes steering intent files for the coordinator to consume. The snapshot
|
|
326
|
+
schema and steering API stay in the swarm packages rather than inside the UI.
|
|
327
|
+
Run `loom status --json` to discover local `uiLaunch.detected` run and
|
|
328
|
+
collection commands before opening a dashboard.
|
|
329
|
+
|
|
221
330
|
### `loom lang`
|
|
222
331
|
|
|
223
332
|
Delegates to the published Frontier Lang CLI.
|
|
@@ -313,8 +422,17 @@ import {
|
|
|
313
422
|
snapshotLoomProject,
|
|
314
423
|
diffLoomProject,
|
|
315
424
|
createLoomProjectionPlan,
|
|
425
|
+
importSwarmCodexRunGraph,
|
|
426
|
+
normalizeSwarmCodexLiveRunGraphEvents,
|
|
427
|
+
normalizeSwarmCodexRunGraph,
|
|
428
|
+
parseSwarmCodexRunGraphInput,
|
|
429
|
+
buildRunGraphChainChunk,
|
|
430
|
+
buildRunGraphPatternChunk,
|
|
431
|
+
createLoomRunGraphPanelRecords,
|
|
432
|
+
readLoomRunGraph,
|
|
316
433
|
readLoomCapabilities,
|
|
317
|
-
runDelegateCommand
|
|
434
|
+
runDelegateCommand,
|
|
435
|
+
writeLoomRunGraph
|
|
318
436
|
} from '@shapeshift-labs/loom';
|
|
319
437
|
|
|
320
438
|
await initLoomProject({ name: 'demo', include: ['src/**/*.ts'] });
|
|
@@ -322,6 +440,38 @@ const scan = await scanLoomProject();
|
|
|
322
440
|
const snapshot = await snapshotLoomProject({ message: 'semantic checkpoint' });
|
|
323
441
|
const diff = await diffLoomProject();
|
|
324
442
|
const projection = await createLoomProjectionPlan({ target: 'python' });
|
|
443
|
+
await writeLoomRunGraph({
|
|
444
|
+
kind: 'loom.run-graph',
|
|
445
|
+
version: 1,
|
|
446
|
+
generatedAt: new Date().toISOString(),
|
|
447
|
+
root: process.cwd(),
|
|
448
|
+
runId: 'demo',
|
|
449
|
+
summary: { nodes: 1, edges: 0, roots: 1, leaves: 1, issues: 0 },
|
|
450
|
+
graph: {
|
|
451
|
+
nodes: ['task-1'],
|
|
452
|
+
edges: [],
|
|
453
|
+
dependentsByJobId: { 'task-1': [] },
|
|
454
|
+
dependenciesByJobId: { 'task-1': [] },
|
|
455
|
+
roots: ['task-1'],
|
|
456
|
+
leaves: ['task-1'],
|
|
457
|
+
issues: []
|
|
458
|
+
}
|
|
459
|
+
});
|
|
460
|
+
const runGraph = await readLoomRunGraph({ runId: 'demo' });
|
|
461
|
+
const imported = await importSwarmCodexRunGraph(swarmCodexRunGraphJson, {
|
|
462
|
+
runId: 'agent-runs/demo',
|
|
463
|
+
sourcePath: 'agent-runs/demo/collected/run-graph.json'
|
|
464
|
+
});
|
|
465
|
+
const normalized = normalizeSwarmCodexRunGraph(swarmCodexRunGraphJson, {
|
|
466
|
+
runId: 'agent-runs/demo'
|
|
467
|
+
});
|
|
468
|
+
const liveEvents = parseSwarmCodexRunGraphInput(liveRunGraphJsonl);
|
|
469
|
+
const liveGraph = Array.isArray(liveEvents)
|
|
470
|
+
? normalizeSwarmCodexLiveRunGraphEvents(liveEvents, {
|
|
471
|
+
runId: 'agent-runs/demo',
|
|
472
|
+
sourcePath: 'agent-runs/demo/live-run-graph-events.jsonl'
|
|
473
|
+
})
|
|
474
|
+
: normalizeSwarmCodexRunGraph(liveEvents);
|
|
325
475
|
const capabilities = await readLoomCapabilities();
|
|
326
476
|
await runDelegateCommand('lang', ['import', 'src/app.ts', '--sidecar']);
|
|
327
477
|
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAepD,wBAAsB,oBAAoB,CAAC,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAQtG;AAED,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAepD,wBAAsB,oBAAoB,CAAC,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAQtG;AAED,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CA8BhF"}
|
package/dist/capabilities.js
CHANGED
|
@@ -28,9 +28,14 @@ export async function inspectDelegates() {
|
|
|
28
28
|
for (const target of listDelegateTargets()) {
|
|
29
29
|
let available = false;
|
|
30
30
|
let cliPath;
|
|
31
|
+
let packageRoot;
|
|
32
|
+
let resolution;
|
|
31
33
|
let error;
|
|
32
34
|
try {
|
|
33
|
-
|
|
35
|
+
const resolved = resolveDelegateTarget(target.command);
|
|
36
|
+
cliPath = resolved.cliPath;
|
|
37
|
+
packageRoot = resolved.packageRoot;
|
|
38
|
+
resolution = resolved.resolution;
|
|
34
39
|
available = true;
|
|
35
40
|
}
|
|
36
41
|
catch (caught) {
|
|
@@ -39,9 +44,10 @@ export async function inspectDelegates() {
|
|
|
39
44
|
rows.push({
|
|
40
45
|
...target,
|
|
41
46
|
available,
|
|
42
|
-
version: await
|
|
47
|
+
version: await readDelegateVersion(packageRoot, target.packageName),
|
|
43
48
|
cliPath,
|
|
44
|
-
|
|
49
|
+
packageRoot,
|
|
50
|
+
resolution: resolution ?? null,
|
|
45
51
|
pathRequired: false,
|
|
46
52
|
pathAvailable: isOnPath(target.binName),
|
|
47
53
|
error
|
|
@@ -49,6 +55,18 @@ export async function inspectDelegates() {
|
|
|
49
55
|
}
|
|
50
56
|
return rows;
|
|
51
57
|
}
|
|
58
|
+
async function readDelegateVersion(packageRoot, packageName) {
|
|
59
|
+
if (packageRoot) {
|
|
60
|
+
try {
|
|
61
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(packageRoot, 'package.json'), 'utf8'));
|
|
62
|
+
return pkg.version ?? null;
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
// Fall through to package resolution.
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return await packageVersion(packageName) ?? null;
|
|
69
|
+
}
|
|
52
70
|
function isOnPath(binName) {
|
|
53
71
|
const paths = process.env.PATH?.split(path.delimiter).filter(Boolean) ?? [];
|
|
54
72
|
const candidates = process.platform === 'win32' ? [binName, `${binName}.cmd`, `${binName}.exe`] : [binName];
|
package/dist/capabilities.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAG3E,MAAM,cAAc,GAAG;IACrB,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,6DAA6D,EAAE;IAC3F,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,iEAAiE,EAAE;IAC/F,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,wDAAwD,EAAE;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AE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IAC5E,MAAM,UAAU,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,GAAG,OAAO,MAAM,EAAE,GAAG,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IAC5G,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;QACxB,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACnC,IAAI,CAAC;gBACH,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;oBAAE,OAAO,IAAI,CAAC;YAC5D,CAAC;YAAC,MAAM,CAAC;gBACP,kCAAkC;YACpC,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AA6BA,wBAAsB,UAAU,CAAC,IAAI,WAAwB,GAAG,OAAO,CAAC,MAAM,CAAC,CAuD9E"}
|
package/dist/cli.js
CHANGED
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
import fs from 'node:fs';
|
|
3
3
|
import { pathToFileURL } from 'node:url';
|
|
4
4
|
import { parseArgs, boolArg, listArg, stringArg } from './args.js';
|
|
5
|
-
import { packageVersion } from './common.js';
|
|
5
|
+
import { abs, packageVersion, pathExists, readJson, resolveRoot } from './common.js';
|
|
6
6
|
import { readLoomCapabilities } from './capabilities.js';
|
|
7
|
+
import { readLoomConfig } from './config.js';
|
|
7
8
|
import { helpText } from './help.js';
|
|
8
9
|
import { printResult } from './output.js';
|
|
9
10
|
import { initLoomProject } from './init.js';
|
|
10
11
|
import { scanLoomProject } from './scan.js';
|
|
11
12
|
import { readLoomStatus, doctorLoomProject } from './status.js';
|
|
12
|
-
import { readLoomGraph } from './graph.js';
|
|
13
|
+
import { importFrontierRunEvents, importSwarmCodexRunGraph, loomRunGraphSourceKind, parseFrontierRunEventsInput, parseSwarmCodexRunGraphInput, readLoomGraph, readLoomRunGraph, writeLoomRunGraph } from './graph.js';
|
|
13
14
|
import { diffLoomProject } from './diff.js';
|
|
14
15
|
import { createLoomProjectionPlan } from './project.js';
|
|
15
16
|
import { catLoomObject, snapshotLoomProject } from './snapshot.js';
|
|
@@ -49,6 +50,9 @@ export async function runLoomCli(argv = process.argv.slice(2)) {
|
|
|
49
50
|
else if (command === 'graph') {
|
|
50
51
|
printResult(await readLoomGraph(), json);
|
|
51
52
|
}
|
|
53
|
+
else if (command === 'run-graph') {
|
|
54
|
+
return await runLoomRunGraphCommand(args, json);
|
|
55
|
+
}
|
|
52
56
|
else if (command === 'diff') {
|
|
53
57
|
printResult(await diffLoomProject(), json);
|
|
54
58
|
}
|
|
@@ -87,6 +91,160 @@ export async function runLoomCli(argv = process.argv.slice(2)) {
|
|
|
87
91
|
return 1;
|
|
88
92
|
}
|
|
89
93
|
}
|
|
94
|
+
async function runLoomRunGraphCommand(args, json) {
|
|
95
|
+
const subcommand = args._[0] ?? 'status';
|
|
96
|
+
if (subcommand === 'help' || subcommand === '--help' || subcommand === '-h') {
|
|
97
|
+
process.stdout.write(runGraphHelpText());
|
|
98
|
+
return 0;
|
|
99
|
+
}
|
|
100
|
+
if (subcommand === 'read') {
|
|
101
|
+
const runId = runGraphRunId(args, 1);
|
|
102
|
+
printResult(await readLoomRunGraph({ root: stringArg(args.root), runId }), true);
|
|
103
|
+
return 0;
|
|
104
|
+
}
|
|
105
|
+
if (subcommand === 'status') {
|
|
106
|
+
printResult(await readLoomRunGraphStatus({ root: stringArg(args.root), runId: runGraphRunId(args, 1) }), json);
|
|
107
|
+
return 0;
|
|
108
|
+
}
|
|
109
|
+
if (subcommand === 'write-json') {
|
|
110
|
+
const input = args._[1] ?? stringArg(args.input);
|
|
111
|
+
if (!input)
|
|
112
|
+
throw new Error('run-graph write-json requires <file|->');
|
|
113
|
+
const graph = await readRunGraphJson(input);
|
|
114
|
+
const targetRunId = runGraphRunId(args, 2) ?? graph.runId ?? 'current';
|
|
115
|
+
const path = await writeLoomRunGraph(graph, { root: stringArg(args.root), runId: targetRunId });
|
|
116
|
+
printResult({
|
|
117
|
+
ok: true,
|
|
118
|
+
message: `wrote loom run graph ${targetRunId}`,
|
|
119
|
+
path,
|
|
120
|
+
runId: targetRunId,
|
|
121
|
+
present: true,
|
|
122
|
+
graphSummary: graph.summary
|
|
123
|
+
}, json);
|
|
124
|
+
return 0;
|
|
125
|
+
}
|
|
126
|
+
if (subcommand === 'import-swarm' || subcommand === 'import-swarm-codex') {
|
|
127
|
+
const input = args._[1] ?? stringArg(args.input);
|
|
128
|
+
if (!input)
|
|
129
|
+
throw new Error('run-graph import-swarm requires <file|->');
|
|
130
|
+
const graph = parseSwarmCodexRunGraphInput(readTextInput(input));
|
|
131
|
+
const targetRunId = runGraphRunId(args, 2);
|
|
132
|
+
printResult(await importSwarmCodexRunGraph(graph, {
|
|
133
|
+
root: stringArg(args.root),
|
|
134
|
+
runId: targetRunId,
|
|
135
|
+
sourcePath: input === '-' ? 'stdin' : input
|
|
136
|
+
}), json);
|
|
137
|
+
return 0;
|
|
138
|
+
}
|
|
139
|
+
if (subcommand === 'import-frontier-run' || subcommand === 'import-run') {
|
|
140
|
+
const input = args._[1] ?? stringArg(args.input);
|
|
141
|
+
if (!input)
|
|
142
|
+
throw new Error('run-graph import-frontier-run requires <run-events.jsonl|->');
|
|
143
|
+
const events = parseFrontierRunEventsInput(readTextInput(input));
|
|
144
|
+
const targetRunId = runGraphRunId(args, 2);
|
|
145
|
+
printResult(await importFrontierRunEvents(events, {
|
|
146
|
+
root: stringArg(args.root),
|
|
147
|
+
runId: targetRunId,
|
|
148
|
+
sourcePath: input === '-' ? 'stdin' : input
|
|
149
|
+
}), json);
|
|
150
|
+
return 0;
|
|
151
|
+
}
|
|
152
|
+
throw new Error(`unknown run-graph command: ${subcommand}`);
|
|
153
|
+
}
|
|
154
|
+
async function readLoomRunGraphStatus(options) {
|
|
155
|
+
const root = resolveRoot(options.root);
|
|
156
|
+
const runId = options.runId ?? 'current';
|
|
157
|
+
const label = options.runId ?? 'current';
|
|
158
|
+
let path;
|
|
159
|
+
try {
|
|
160
|
+
const config = await readLoomConfig(root);
|
|
161
|
+
path = abs(root, `${config.generated.graph}/runs/${loomRunGraphFileName(options.runId)}.json`);
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
return {
|
|
165
|
+
ok: false,
|
|
166
|
+
message: errorMessage(error),
|
|
167
|
+
runId: label,
|
|
168
|
+
present: false
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
if (!(await pathExists(path))) {
|
|
172
|
+
return {
|
|
173
|
+
ok: false,
|
|
174
|
+
message: `missing loom run graph for ${label}`,
|
|
175
|
+
path,
|
|
176
|
+
runId: label,
|
|
177
|
+
present: false
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
try {
|
|
181
|
+
const graph = await readLoomRunGraph(options);
|
|
182
|
+
const sourceKind = loomRunGraphSourceKind(graph);
|
|
183
|
+
return {
|
|
184
|
+
ok: true,
|
|
185
|
+
message: `found loom run graph ${graph.runId ?? runId}`,
|
|
186
|
+
path,
|
|
187
|
+
runId: graph.runId ?? runId,
|
|
188
|
+
present: true,
|
|
189
|
+
planId: graph.planId,
|
|
190
|
+
source: graph.source ?? sourceKind,
|
|
191
|
+
sourceKind,
|
|
192
|
+
sourceMetadata: graph.sourceMetadata,
|
|
193
|
+
graphSummary: graph.summary
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
catch (error) {
|
|
197
|
+
return {
|
|
198
|
+
ok: false,
|
|
199
|
+
message: `invalid loom run graph for ${label}: ${errorMessage(error)}`,
|
|
200
|
+
path,
|
|
201
|
+
runId: label,
|
|
202
|
+
present: true
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
function runGraphRunId(args, positionalIndex) {
|
|
207
|
+
return stringArg(args['run-id'] ?? args.runId ?? args.run ?? args.id) ?? args._[positionalIndex];
|
|
208
|
+
}
|
|
209
|
+
async function readRunGraphJson(input) {
|
|
210
|
+
return readJsonInput(input);
|
|
211
|
+
}
|
|
212
|
+
async function readJsonInput(input) {
|
|
213
|
+
if (input === '-')
|
|
214
|
+
return JSON.parse(readTextInput(input));
|
|
215
|
+
return readJson(input);
|
|
216
|
+
}
|
|
217
|
+
function readTextInput(input) {
|
|
218
|
+
if (input === '-')
|
|
219
|
+
return fs.readFileSync(0, 'utf8');
|
|
220
|
+
return fs.readFileSync(input, 'utf8');
|
|
221
|
+
}
|
|
222
|
+
function loomRunGraphFileName(runId = 'current') {
|
|
223
|
+
const cleaned = runId.trim().replace(/[^A-Za-z0-9._-]+/g, '_').replace(/^_+|_+$/g, '');
|
|
224
|
+
return cleaned || 'current';
|
|
225
|
+
}
|
|
226
|
+
function runGraphHelpText() {
|
|
227
|
+
return `loom run-graph - durable swarm run dependency graph helpers
|
|
228
|
+
|
|
229
|
+
Usage:
|
|
230
|
+
loom run-graph read [<run-id>] [--run-id <id>]
|
|
231
|
+
loom run-graph status [<run-id>] [--run-id <id>] [--json]
|
|
232
|
+
loom run-graph write-json <file|-> [--run-id <id>] [--json]
|
|
233
|
+
loom run-graph import-swarm <json-or-jsonl|-> [--run-id <id>] [--json]
|
|
234
|
+
loom run-graph import-frontier-run <run-events.jsonl|-> [--run-id <id>] [--json]
|
|
235
|
+
|
|
236
|
+
Examples:
|
|
237
|
+
loom run-graph status agent-run-2026 --json
|
|
238
|
+
loom run-graph read agent-run-2026
|
|
239
|
+
loom run-graph write-json run-graph.json --run-id agent-run-2026
|
|
240
|
+
loom run-graph import-swarm agent-runs/my-run/collected/run-graph.json --run-id agent-runs/my-run
|
|
241
|
+
loom run-graph import-swarm agent-runs/my-run/live-run-graph-events.jsonl --run-id agent-runs/my-run
|
|
242
|
+
loom run-graph import-frontier-run agent-runs/my-run/run-events.jsonl --run-id agent-runs/my-run
|
|
243
|
+
`;
|
|
244
|
+
}
|
|
245
|
+
function errorMessage(error) {
|
|
246
|
+
return error instanceof Error ? error.message : String(error);
|
|
247
|
+
}
|
|
90
248
|
function isCliEntrypoint() {
|
|
91
249
|
if (!process.argv[1])
|
|
92
250
|
return false;
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAgB,MAAM,WAAW,CAAC;AACjF,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE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S,YAAY,CAAC,KAAc;IAClC,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC;AAED,SAAS,eAAe;IACtB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IACnC,OAAO,aAAa,CAAC,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;AAClF,CAAC;AAED,IAAI,eAAe,EAAE,EAAE,CAAC;IACtB,UAAU,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;QACzB,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/delegate.d.ts
CHANGED
|
@@ -4,14 +4,19 @@ export interface DelegateTarget {
|
|
|
4
4
|
required: boolean;
|
|
5
5
|
description: string;
|
|
6
6
|
}
|
|
7
|
+
export type DelegateResolution = 'env-cli' | 'env-package-root' | 'package-bin';
|
|
8
|
+
export interface ResolvedDelegateTarget {
|
|
9
|
+
target: DelegateTarget;
|
|
10
|
+
cliPath: string;
|
|
11
|
+
packageRoot?: string;
|
|
12
|
+
resolution: DelegateResolution;
|
|
13
|
+
}
|
|
7
14
|
export declare const delegateTargets: Record<string, DelegateTarget>;
|
|
8
15
|
export declare function isDelegateCommand(command: string): boolean;
|
|
9
16
|
export declare function listDelegateTargets(): Array<{
|
|
10
17
|
command: string;
|
|
11
18
|
} & DelegateTarget>;
|
|
12
|
-
export declare function resolveDelegateTarget(command: string):
|
|
13
|
-
target: DelegateTarget;
|
|
14
|
-
cliPath: string;
|
|
15
|
-
};
|
|
19
|
+
export declare function resolveDelegateTarget(command: string): ResolvedDelegateTarget;
|
|
16
20
|
export declare function runDelegateCommand(command: string, args: string[]): Promise<number>;
|
|
21
|
+
export declare function normalizeLoomUiArgs(args: string[]): string[];
|
|
17
22
|
//# sourceMappingURL=delegate.d.ts.map
|
package/dist/delegate.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegate.d.ts","sourceRoot":"","sources":["../src/delegate.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"delegate.d.ts","sourceRoot":"","sources":["../src/delegate.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,kBAAkB,GAAG,aAAa,CAAC;AAEhF,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,cAAc,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,kBAAkB,CAAC;CAChC;AAED,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CA2C1D,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED,wBAAgB,mBAAmB,IAAI,KAAK,CAAC;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,cAAc,CAAC,CAEjF;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,sBAAsB,CAsB7E;AAED,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAczF;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAa5D"}
|