@sapiom/harness 0.8.9 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +63 -0
- package/README.md +11 -1
- package/dist/core/agent-project-discovery.d.ts +235 -1
- package/dist/core/agent-project-discovery.d.ts.map +1 -1
- package/dist/core/agent-project-discovery.js +303 -1
- package/dist/core/agent-project-discovery.js.map +1 -1
- package/dist/core/canvas-interconnections.d.ts +31 -0
- package/dist/core/canvas-interconnections.d.ts.map +1 -1
- package/dist/core/canvas-interconnections.js +294 -21
- package/dist/core/canvas-interconnections.js.map +1 -1
- package/dist/core/canvas-render.d.ts +32 -0
- package/dist/core/canvas-render.d.ts.map +1 -1
- package/dist/core/canvas-render.js +50 -41
- package/dist/core/canvas-render.js.map +1 -1
- package/dist/core/definition-name.d.ts +12 -0
- package/dist/core/definition-name.d.ts.map +1 -1
- package/dist/core/definition-name.js +14 -5
- package/dist/core/definition-name.js.map +1 -1
- package/dist/core/system-graph-inventory.d.ts +68 -0
- package/dist/core/system-graph-inventory.d.ts.map +1 -0
- package/dist/core/system-graph-inventory.js +312 -0
- package/dist/core/system-graph-inventory.js.map +1 -0
- package/dist/core/system-graph-relationships.d.ts +41 -0
- package/dist/core/system-graph-relationships.d.ts.map +1 -0
- package/dist/core/system-graph-relationships.js +98 -0
- package/dist/core/system-graph-relationships.js.map +1 -0
- package/dist/core/system-graph-store.d.ts +45 -0
- package/dist/core/system-graph-store.d.ts.map +1 -0
- package/dist/core/system-graph-store.js +222 -0
- package/dist/core/system-graph-store.js.map +1 -0
- package/dist/core/system-graph-watcher.d.ts +51 -0
- package/dist/core/system-graph-watcher.d.ts.map +1 -0
- package/dist/core/system-graph-watcher.js +448 -0
- package/dist/core/system-graph-watcher.js.map +1 -0
- package/dist/core/system-graph.d.ts +43 -0
- package/dist/core/system-graph.d.ts.map +1 -0
- package/dist/core/system-graph.js +321 -0
- package/dist/core/system-graph.js.map +1 -0
- package/dist/core/workflow-registry.d.ts +84 -6
- package/dist/core/workflow-registry.d.ts.map +1 -1
- package/dist/core/workflow-registry.js +191 -91
- package/dist/core/workflow-registry.js.map +1 -1
- package/dist/core/workspace-watcher.d.ts +21 -13
- package/dist/core/workspace-watcher.d.ts.map +1 -1
- package/dist/core/workspace-watcher.js +79 -81
- package/dist/core/workspace-watcher.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/server/agent-move.d.ts +134 -0
- package/dist/server/agent-move.d.ts.map +1 -0
- package/dist/server/agent-move.js +343 -0
- package/dist/server/agent-move.js.map +1 -0
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +275 -22
- package/dist/server/index.js.map +1 -1
- package/dist/server/rest.d.ts +3 -0
- package/dist/server/rest.d.ts.map +1 -1
- package/dist/server/rest.js +3 -0
- package/dist/server/rest.js.map +1 -1
- package/dist/server/studio-rail.d.ts +76 -0
- package/dist/server/studio-rail.d.ts.map +1 -0
- package/dist/server/studio-rail.js +234 -0
- package/dist/server/studio-rail.js.map +1 -0
- package/dist/server/system-graph.d.ts +14 -0
- package/dist/server/system-graph.d.ts.map +1 -0
- package/dist/server/system-graph.js +40 -0
- package/dist/server/system-graph.js.map +1 -0
- package/dist/server/workflow-graph.d.ts +43 -0
- package/dist/server/workflow-graph.d.ts.map +1 -0
- package/dist/server/workflow-graph.js +200 -0
- package/dist/server/workflow-graph.js.map +1 -0
- package/dist/shared/system-graph.d.ts +59 -0
- package/dist/shared/system-graph.d.ts.map +1 -0
- package/dist/shared/system-graph.js +76 -0
- package/dist/shared/system-graph.js.map +1 -0
- package/dist/shared/types.d.ts +45 -0
- package/dist/shared/types.d.ts.map +1 -1
- package/dist/shared/types.js.map +1 -1
- package/dist/web/assets/index-2Fab6dzf.js +508 -0
- package/dist/web/assets/index-D0doaFvT.css +32 -0
- package/dist/web/index.html +2 -2
- package/package.json +5 -5
- package/dist/web/assets/index-B18B2y5o.js +0 -494
- package/dist/web/assets/index-jGBbXx9R.css +0 -32
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Workflow registry (workstream W2's backend slice).
|
|
3
3
|
*
|
|
4
|
-
* Discovers orchestration projects by scanning a directory tree (bounded
|
|
5
|
-
* depth
|
|
6
|
-
*
|
|
4
|
+
* Discovers orchestration projects by scanning a directory tree (bounded by
|
|
5
|
+
* depth, by directories visited, and by the scan root's own repository) for
|
|
6
|
+
* `sapiom.json` marker files, tracks
|
|
7
|
+
* manually-connected paths, and persists the combined list to
|
|
8
|
+
* HARNESS_PATHS.workflows. Exposes an
|
|
7
9
|
* Express router implementing the /api/workflows surface from
|
|
8
10
|
* src/shared/types.ts; the integrator mounts it (and express.json()) on the
|
|
9
11
|
* shared app.
|
|
@@ -13,7 +15,7 @@ import * as os from "node:os";
|
|
|
13
15
|
import * as path from "node:path";
|
|
14
16
|
import { Router } from "express";
|
|
15
17
|
import { HARNESS_PATHS } from "../shared/types.js";
|
|
16
|
-
import {
|
|
18
|
+
import { AgentProjectScanBudget, inspectAgentProjectMarker, isAgentProjectScanIgnoredDir, readAgentProjectMarker, walkAgentProjectTreeAsync, } from "./agent-project-discovery.js";
|
|
17
19
|
import { hasTraversalSegment, resolveWithinRoot } from "./path-safety.js";
|
|
18
20
|
function expandHome(inputPath) {
|
|
19
21
|
if (inputPath === "~")
|
|
@@ -23,7 +25,8 @@ function expandHome(inputPath) {
|
|
|
23
25
|
return inputPath;
|
|
24
26
|
}
|
|
25
27
|
// `dir` reaching these sinks is always a resolved absolute path (from
|
|
26
|
-
// path.resolve in scan/connectPath, or a confined descent in
|
|
28
|
+
// path.resolve in scan/connectPath, or a confined descent in the scan walk),
|
|
29
|
+
// so a
|
|
27
30
|
// `..` segment can never survive. Asserting it anyway keeps the no-traversal
|
|
28
31
|
// guarantee explicit and local to each fs read, and covers the arbitrary
|
|
29
32
|
// path connectPath accepts (which has no scan root to confine it to).
|
|
@@ -37,10 +40,6 @@ async function inspectMarker(dir) {
|
|
|
37
40
|
return { status: "invalid" };
|
|
38
41
|
return inspectAgentProjectMarker(dir);
|
|
39
42
|
}
|
|
40
|
-
function isConfirmedMissingPath(error) {
|
|
41
|
-
const code = error.code;
|
|
42
|
-
return code === "ENOENT" || code === "ENOTDIR";
|
|
43
|
-
}
|
|
44
43
|
async function nameFor(dir) {
|
|
45
44
|
if (hasTraversalSegment(dir))
|
|
46
45
|
return path.basename(dir);
|
|
@@ -56,64 +55,82 @@ async function nameFor(dir) {
|
|
|
56
55
|
return path.basename(dir);
|
|
57
56
|
}
|
|
58
57
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
58
|
+
* Scans `root` for agent projects, bounded by depth, by directories visited,
|
|
59
|
+
* AND by the repository the root belongs to (core/agent-project-discovery.ts
|
|
60
|
+
* owns that policy and the numbers behind it). A directory carrying a marker is
|
|
61
|
+
* registered and not descended into; a directory that is a repository checkout
|
|
62
|
+
* of its own is reported as a boundary and not descended into either, so one
|
|
63
|
+
* scan registers one project tree rather than every neighbouring clone.
|
|
64
|
+
*
|
|
65
|
+
* Every directory touched is confined to `root` (the tree the caller asked to
|
|
66
|
+
* scan): the walk starts at `root` itself and only ever descends into a direct
|
|
67
|
+
* child, so no crafted entry name can walk the scan outside `root` — and
|
|
68
|
+
* `resolveWithinRoot` re-asserts that at the sink, local to each fs read.
|
|
69
|
+
* Symlinked entries report `isDirectory() === false` (withFileTypes uses raw
|
|
70
|
+
* dirent info, not a followed stat) and so are never descended into either,
|
|
71
|
+
* which is what makes a symlink cycle terminate.
|
|
72
|
+
*
|
|
73
|
+
* Exported so the perf benchmark can measure the real scanner against an
|
|
74
|
+
* explicit budget rather than a copy of its traversal.
|
|
66
75
|
*/
|
|
67
|
-
async function
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
let entries;
|
|
96
|
-
try {
|
|
97
|
-
entries = await fs.readdir(safeDir, { withFileTypes: true });
|
|
98
|
-
}
|
|
99
|
-
catch (error) {
|
|
100
|
-
if (!isConfirmedMissingPath(error))
|
|
76
|
+
export async function scanAgentProjects(root, budget = new AgentProjectScanBudget(), options = {}) {
|
|
77
|
+
const absoluteRoot = path.resolve(root);
|
|
78
|
+
const found = [];
|
|
79
|
+
const unreconciledRoots = [];
|
|
80
|
+
const repositoryBoundaries = [];
|
|
81
|
+
const onDirectory = async (dir) => {
|
|
82
|
+
const safeDir = resolveWithinRoot(absoluteRoot, dir);
|
|
83
|
+
if (!safeDir)
|
|
84
|
+
return "stop";
|
|
85
|
+
const markerResult = await inspectMarker(safeDir);
|
|
86
|
+
if (markerResult.status === "valid") {
|
|
87
|
+
const marker = markerResult.marker;
|
|
88
|
+
found.push({
|
|
89
|
+
name: await nameFor(safeDir),
|
|
90
|
+
path: safeDir,
|
|
91
|
+
definitionId: marker.definitionId ?? null,
|
|
92
|
+
definitionSlug: marker.name ?? null,
|
|
93
|
+
templateId: marker.templateId ?? null,
|
|
94
|
+
forkId: marker.forkId ?? null,
|
|
95
|
+
starterId: marker.starterId ?? null,
|
|
96
|
+
source: "scan",
|
|
97
|
+
});
|
|
98
|
+
return "stop";
|
|
99
|
+
}
|
|
100
|
+
if (markerResult.status === "unreadable") {
|
|
101
|
+
// The directory may still be a valid project. Treat the whole subtree as
|
|
102
|
+
// opaque for this pass so a transient filesystem error neither removes an
|
|
103
|
+
// existing entry nor discovers children that should be hidden beneath it.
|
|
101
104
|
unreconciledRoots.push(safeDir);
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
105
|
+
return "stop";
|
|
106
|
+
}
|
|
107
|
+
return "descend";
|
|
108
|
+
};
|
|
109
|
+
await walkAgentProjectTreeAsync(absoluteRoot, {
|
|
110
|
+
onDirectory,
|
|
111
|
+
onUnreadable: (dir) => unreconciledRoots.push(dir),
|
|
112
|
+
onRepositoryBoundary: (dir) => {
|
|
113
|
+
repositoryBoundaries.push(dir);
|
|
114
|
+
// Also onto the budget, so a caller that only holds the budget (the
|
|
115
|
+
// server's scan wrapper) can explain an empty result.
|
|
116
|
+
budget.repositoryBoundaries.push(dir);
|
|
117
|
+
},
|
|
118
|
+
}, budget, options);
|
|
119
|
+
return { found, unreconciledRoots, repositoryBoundaries, budget };
|
|
109
120
|
}
|
|
110
121
|
/**
|
|
111
122
|
* Whether a previously scanned path is inside the exact traversal envelope of
|
|
112
123
|
* a new scan. Only those entries may be reconciled away when their marker is no
|
|
113
124
|
* longer found; a narrow scan must never delete projects discovered from a
|
|
114
125
|
* different root.
|
|
126
|
+
*
|
|
127
|
+
* `envelopeDepth` is the scan's own report of how deep it got, not the static
|
|
128
|
+
* cap: a scan the node budget cut short covered fewer levels than it was
|
|
129
|
+
* allowed to, and reconciling at the allowance would delete rows it simply
|
|
130
|
+
* never looked for. The walk is breadth-first, so every level at or above
|
|
131
|
+
* `envelopeDepth` is complete and safe to reconcile.
|
|
115
132
|
*/
|
|
116
|
-
function isCoveredByScan(root, candidate) {
|
|
133
|
+
function isCoveredByScan(root, candidate, envelopeDepth) {
|
|
117
134
|
const relative = path.relative(root, candidate);
|
|
118
135
|
if (relative === "")
|
|
119
136
|
return true;
|
|
@@ -121,12 +138,58 @@ function isCoveredByScan(root, candidate) {
|
|
|
121
138
|
return false;
|
|
122
139
|
}
|
|
123
140
|
const segments = relative.split(path.sep).filter(Boolean);
|
|
124
|
-
return (segments.length <=
|
|
141
|
+
return (segments.length <= envelopeDepth &&
|
|
125
142
|
!segments.some((segment) => isAgentProjectScanIgnoredDir(segment)));
|
|
126
143
|
}
|
|
127
144
|
function isProtectedByIncompleteScan(candidate, unreconciledRoots) {
|
|
128
145
|
return unreconciledRoots.some((unreconciledRoot) => resolveWithinRoot(unreconciledRoot, candidate) !== null);
|
|
129
146
|
}
|
|
147
|
+
/**
|
|
148
|
+
* Whether a previously known path sits inside a nested checkout this scan
|
|
149
|
+
* deliberately did not enter.
|
|
150
|
+
*
|
|
151
|
+
* Reconciliation's rule is "the registry may only forget a project it can prove
|
|
152
|
+
* it would have looked for", and the repository boundary changes what a scan
|
|
153
|
+
* looks for. Without this, opening `~/src` after having opened `~/src/some-repo`
|
|
154
|
+
* would DELETE that repo's agents: the scan stops at the boundary, finds no
|
|
155
|
+
* marker below it, and the depth envelope alone would call them gone.
|
|
156
|
+
*/
|
|
157
|
+
function isBehindRepositoryBoundary(candidate, repositoryBoundaries) {
|
|
158
|
+
return repositoryBoundaries.some((boundary) => resolveWithinRoot(boundary, candidate) !== null);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* How often {@link WorkflowRegistry.list} re-checks that every registered path
|
|
162
|
+
* still exists. Round 1's note claimed the registry "prunes lazily"; it did
|
|
163
|
+
* not — pruning only happened where a caller remembered to ask (server boot, a
|
|
164
|
+
* session's workspace rescan, an agent move), so a deleted agent stayed on the
|
|
165
|
+
* rail until one of those happened to run. This interval is what makes the
|
|
166
|
+
* claim true: one `stat` per entry, at most this often, on any read.
|
|
167
|
+
*/
|
|
168
|
+
const LAZY_PRUNE_INTERVAL_MS = 30000;
|
|
169
|
+
/**
|
|
170
|
+
* Splits entries into "path still there" and "path confirmed gone". Only
|
|
171
|
+
* ENOENT/ENOTDIR counts as gone: an unbuilt, unreadable or momentarily
|
|
172
|
+
* unstattable directory is kept, because losing a real project to a transient
|
|
173
|
+
* filesystem error is far worse than carrying a dead row for one more sweep.
|
|
174
|
+
*/
|
|
175
|
+
async function partitionByPathExists(workflows) {
|
|
176
|
+
const kept = [];
|
|
177
|
+
const pruned = [];
|
|
178
|
+
for (const workflow of workflows) {
|
|
179
|
+
try {
|
|
180
|
+
await fs.stat(workflow.path);
|
|
181
|
+
kept.push(workflow);
|
|
182
|
+
}
|
|
183
|
+
catch (err) {
|
|
184
|
+
const code = err.code;
|
|
185
|
+
if (code === "ENOENT" || code === "ENOTDIR")
|
|
186
|
+
pruned.push(workflow);
|
|
187
|
+
else
|
|
188
|
+
kept.push(workflow);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return { kept, pruned };
|
|
192
|
+
}
|
|
130
193
|
export class WorkflowRegistry {
|
|
131
194
|
constructor(registryPath = expandHome(HARNESS_PATHS.workflows)) {
|
|
132
195
|
this.registryPath = registryPath;
|
|
@@ -136,6 +199,8 @@ export class WorkflowRegistry {
|
|
|
136
199
|
* interleave and drop entries from the persisted file. Mirrors the pattern
|
|
137
200
|
* used by SessionManager.persist() (session-manager.ts:278,851-853). */
|
|
138
201
|
this.writeQueue = Promise.resolve();
|
|
202
|
+
/** Epoch ms of the last confirmed-missing sweep — see LAZY_PRUNE_INTERVAL_MS. */
|
|
203
|
+
this.lastPruneAt = 0;
|
|
139
204
|
}
|
|
140
205
|
async ensureLoaded() {
|
|
141
206
|
if (this.loaded)
|
|
@@ -167,8 +232,24 @@ export class WorkflowRegistry {
|
|
|
167
232
|
this.writeQueue = next.then(() => { }, () => { });
|
|
168
233
|
return next;
|
|
169
234
|
}
|
|
235
|
+
/**
|
|
236
|
+
* The registry as it stands — and the point at which stale entries actually
|
|
237
|
+
* leave. A read runs {@link prune} when one is due
|
|
238
|
+
* (LAZY_PRUNE_INTERVAL_MS), so an agent whose directory the user deleted
|
|
239
|
+
* disappears from `GET /api/workflows` on its own rather than waiting for the
|
|
240
|
+
* next server boot. Cheap by construction: one `stat` per entry, throttled,
|
|
241
|
+
* and the file is only rewritten when something was actually dropped.
|
|
242
|
+
*/
|
|
170
243
|
async list() {
|
|
171
244
|
await this.ensureLoaded();
|
|
245
|
+
if (Date.now() - this.lastPruneAt >= LAZY_PRUNE_INTERVAL_MS) {
|
|
246
|
+
// CLAIM THE INTERVAL BEFORE SWEEPING. `lastPruneAt` used to be written
|
|
247
|
+
// only inside the queued task, so every read in a burst passed the
|
|
248
|
+
// throttle and queued its own full stat sweep of the whole registry.
|
|
249
|
+
// Claiming it here closes the burst to one sweep per interval.
|
|
250
|
+
this.lastPruneAt = Date.now();
|
|
251
|
+
await this.prune();
|
|
252
|
+
}
|
|
172
253
|
return this.workflows;
|
|
173
254
|
}
|
|
174
255
|
/**
|
|
@@ -180,58 +261,72 @@ export class WorkflowRegistry {
|
|
|
180
261
|
* stays registered. Returns what was pruned so the caller can log it.
|
|
181
262
|
*/
|
|
182
263
|
async prune() {
|
|
264
|
+
await this.ensureLoaded();
|
|
265
|
+
// THE STAT SWEEP RUNS OUTSIDE THE WRITE QUEUE. It only reads the
|
|
266
|
+
// filesystem, so putting it behind `enqueue` made the rail's hot read
|
|
267
|
+
// (`GET /api/workflows`, via list()) block until any in-flight `scan()`
|
|
268
|
+
// finished — 239 ms on a measured real root, 6.8 s uncapped — where it used
|
|
269
|
+
// to answer from memory. Only the WRITE needs the lock, and only when
|
|
270
|
+
// something was actually dropped, which is the rare case.
|
|
271
|
+
const { pruned } = await partitionByPathExists(this.workflows);
|
|
272
|
+
this.lastPruneAt = Date.now();
|
|
273
|
+
if (pruned.length === 0)
|
|
274
|
+
return [];
|
|
275
|
+
const gone = new Set(pruned.map((workflow) => workflow.path));
|
|
183
276
|
return this.enqueue(async () => {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
pruned.push(workflow);
|
|
196
|
-
else
|
|
197
|
-
kept.push(workflow);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
if (pruned.length > 0) {
|
|
201
|
-
this.workflows = kept;
|
|
202
|
-
await this.persist();
|
|
203
|
-
}
|
|
204
|
-
return pruned;
|
|
277
|
+
// RE-DERIVE FROM CURRENT STATE rather than assigning the `kept` computed
|
|
278
|
+
// above: a scan may have registered entries while we were statting, and
|
|
279
|
+
// writing a stale snapshot back would silently drop them. Removing a set
|
|
280
|
+
// of known-missing paths is safe whatever else changed meanwhile.
|
|
281
|
+
const before = this.workflows;
|
|
282
|
+
const removed = before.filter((workflow) => gone.has(workflow.path));
|
|
283
|
+
if (removed.length === 0)
|
|
284
|
+
return [];
|
|
285
|
+
this.workflows = before.filter((workflow) => !gone.has(workflow.path));
|
|
286
|
+
await this.persist();
|
|
287
|
+
return removed;
|
|
205
288
|
});
|
|
206
289
|
}
|
|
207
290
|
/**
|
|
291
|
+
* `budget` is overridable so a caller (and the tests that pin this rule) can
|
|
292
|
+
* scan with a narrower allowance than the shipped default; the reconciliation
|
|
293
|
+
* envelope follows whatever the scan actually managed to cover.
|
|
294
|
+
*
|
|
208
295
|
* Scans `root`, refreshes discovered projects, and removes scan-sourced rows
|
|
209
296
|
* in this scan's traversal envelope when their marker is confirmed gone or
|
|
210
|
-
* invalid. Rows beneath a temporarily unreadable directory survive this pass
|
|
211
|
-
*
|
|
297
|
+
* invalid. Rows beneath a temporarily unreadable directory survive this pass,
|
|
298
|
+
* as do rows below the depth the scan actually completed when the node budget
|
|
299
|
+
* cut it short; manually connected rows remain until their path itself is
|
|
300
|
+
* pruned.
|
|
212
301
|
*/
|
|
213
|
-
async scan(root) {
|
|
302
|
+
async scan(root, budget = new AgentProjectScanBudget()) {
|
|
214
303
|
return this.enqueue(async () => {
|
|
215
304
|
await this.ensureLoaded();
|
|
216
305
|
const absoluteRoot = path.resolve(expandHome(root));
|
|
217
|
-
const found =
|
|
218
|
-
const unreconciledRoots = [];
|
|
219
|
-
await scanDir(absoluteRoot, absoluteRoot, 0, found, unreconciledRoots);
|
|
306
|
+
const { found, unreconciledRoots, repositoryBoundaries } = await scanAgentProjects(absoluteRoot, budget);
|
|
220
307
|
const foundPaths = new Set(found.map((workflow) => workflow.path));
|
|
221
308
|
const byPath = new Map(this.workflows
|
|
222
309
|
.filter((workflow) => workflow.source !== "scan" ||
|
|
223
|
-
!isCoveredByScan(absoluteRoot, workflow.path) ||
|
|
310
|
+
!isCoveredByScan(absoluteRoot, workflow.path, budget.envelopeDepth) ||
|
|
224
311
|
foundPaths.has(workflow.path) ||
|
|
225
|
-
isProtectedByIncompleteScan(workflow.path, unreconciledRoots)
|
|
312
|
+
isProtectedByIncompleteScan(workflow.path, unreconciledRoots) ||
|
|
313
|
+
isBehindRepositoryBoundary(workflow.path, repositoryBoundaries))
|
|
226
314
|
.map((workflow) => [workflow.path, workflow]));
|
|
227
315
|
for (const workflow of found) {
|
|
228
316
|
const existing = byPath.get(workflow.path);
|
|
229
317
|
// A manually-connected entry keeps its `source`; a scan only refreshes name/definitionId.
|
|
230
318
|
byPath.set(workflow.path, existing ? { ...existing, ...workflow, source: existing.source } : workflow);
|
|
231
319
|
}
|
|
232
|
-
|
|
320
|
+
// Registry-wide, not envelope-wide: a scan is the most frequent write
|
|
321
|
+
// this file gets, and an entry whose directory is CONFIRMED gone has no
|
|
322
|
+
// claim to survive it regardless of which root turned it up. Without
|
|
323
|
+
// this, a dead row rooted somewhere the studio never scans again lives
|
|
324
|
+
// for as long as the install does.
|
|
325
|
+
const { kept, pruned } = await partitionByPathExists(Array.from(byPath.values()));
|
|
326
|
+
this.lastPruneAt = Date.now();
|
|
327
|
+
this.workflows = kept;
|
|
233
328
|
await this.persist();
|
|
234
|
-
return found;
|
|
329
|
+
return found.filter((workflow) => !pruned.some((dead) => dead.path === workflow.path));
|
|
235
330
|
});
|
|
236
331
|
}
|
|
237
332
|
/** Registers an arbitrary path (the "+ Connect" flow); marker is optional at connect time. */
|
|
@@ -285,7 +380,12 @@ export function createWorkflowsRouter(registry) {
|
|
|
285
380
|
return;
|
|
286
381
|
}
|
|
287
382
|
try {
|
|
288
|
-
|
|
383
|
+
// Responds with the OUTCOME, not a bare array: see WorkflowScanOutcome
|
|
384
|
+
// for why `found` alone lets a caller state a falsehood.
|
|
385
|
+
const outcome = registry.scanWithBoundaries
|
|
386
|
+
? await registry.scanWithBoundaries(root)
|
|
387
|
+
: { found: await registry.scan(root), repositoryBoundaries: [] };
|
|
388
|
+
res.json(outcome);
|
|
289
389
|
}
|
|
290
390
|
catch (err) {
|
|
291
391
|
res.status(500).json({ error: err.message });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-registry.js","sourceRoot":"","sources":["../../src/core/workflow-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,MAAM,EAAgC,MAAM,SAAS,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAqB,MAAM,oBAAoB,CAAC;AACtE,OAAO,EACL,4BAA4B,EAG5B,yBAAyB,EACzB,4BAA4B,EAC5B,sBAAsB,GACvB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1E,SAAS,UAAU,CAAC,SAAiB;IACnC,IAAI,SAAS,KAAK,GAAG;QAAE,OAAO,EAAE,CAAC,OAAO,EAAE,CAAC;IAC3C,IAAI,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACnF,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,sEAAsE;AACtE,4EAA4E;AAC5E,6EAA6E;AAC7E,yEAAyE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;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAG,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,23 +1,31 @@
|
|
|
1
|
+
import { AgentProjectScanBudget } from "./agent-project-discovery.js";
|
|
1
2
|
/**
|
|
2
3
|
* Fingerprint of the set of workflow-marker directories under `root` (sorted,
|
|
3
|
-
* bounded depth, ignored subtrees skipped), plus
|
|
4
|
-
* that are temporarily unreadable
|
|
5
|
-
*
|
|
4
|
+
* bounded by depth AND by directories visited, ignored subtrees skipped), plus
|
|
5
|
+
* opaque sentinels for subtrees that are temporarily unreadable or that the
|
|
6
|
+
* node budget kept the walk out of. Changes when a workflow is added, removed,
|
|
7
|
+
* renamed, or crosses one of those boundaries — not when unrelated readable
|
|
6
8
|
* files are edited. Exported for direct testing.
|
|
7
9
|
*
|
|
8
|
-
* The synchronous form
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* The synchronous form remains for the session watcher, whose constructor
|
|
11
|
+
* requires an immediate baseline. Project-graph watchers use the async form
|
|
12
|
+
* for startup, native-event checks, and polling so a wide Project never walks
|
|
13
|
+
* synchronously on the server loop.
|
|
14
|
+
*
|
|
15
|
+
* `budget` is injectable so a benchmark can read the directories visited off
|
|
16
|
+
* the same object the walk spends, and so a test can force truncation. Pass the
|
|
17
|
+
* SAME limits to both forms: the two produce identical fingerprints on one tree
|
|
18
|
+
* only when their bounds match, and SessionWorkspaceWatcher compares a sync
|
|
19
|
+
* baseline against an async poll result.
|
|
12
20
|
*/
|
|
13
|
-
export declare function snapshotWorkspaceWorkflows(root: string): string;
|
|
21
|
+
export declare function snapshotWorkspaceWorkflows(root: string, budget?: AgentProjectScanBudget): string;
|
|
14
22
|
/**
|
|
15
|
-
* Async variant
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* direct testing.
|
|
23
|
+
* Async variant for graph watcher baselines/event checks and polling
|
|
24
|
+
* fallbacks — yields between directories so a wide workspace cannot stutter
|
|
25
|
+
* the event loop. Produces the same fingerprint as the sync version. Exported
|
|
26
|
+
* for direct testing.
|
|
19
27
|
*/
|
|
20
|
-
export declare function snapshotWorkspaceWorkflowsAsync(root: string): Promise<string>;
|
|
28
|
+
export declare function snapshotWorkspaceWorkflowsAsync(root: string, budget?: AgentProjectScanBudget): Promise<string>;
|
|
21
29
|
export interface WorkspaceWatcherManagerDeps {
|
|
22
30
|
/** Debounced per-session notification that the workspace's workflow set may
|
|
23
31
|
* have changed — the integrator re-scans that session's cwd and broadcasts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-watcher.d.ts","sourceRoot":"","sources":["../../src/core/workspace-watcher.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"workspace-watcher.d.ts","sourceRoot":"","sources":["../../src/core/workspace-watcher.ts"],"names":[],"mappings":"AAsCA,OAAO,EAEL,sBAAsB,EAOvB,MAAM,8BAA8B,CAAC;AAwEtC;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,sBAAsC,GAC7C,MAAM,CAaR;AAED;;;;;GAKG;AACH,wBAAsB,+BAA+B,CACnD,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,sBAAsC,GAC7C,OAAO,CAAC,MAAM,CAAC,CAajB;AAmGD,MAAM,WAAW,2BAA2B;IAC1C;;4DAEwD;IACxD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1C;AAED,0EAA0E;AAC1E,qBAAa,uBAAuB;IAGtB,OAAO,CAAC,QAAQ,CAAC,IAAI;IAFjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA8C;gBAE1C,IAAI,EAAE,2BAA2B;IAE9D,kEAAkE;IAClE,KAAK,CAAC,gBAAgB,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAQlD,IAAI,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI;IAKpC,OAAO,IAAI,IAAI;IAIf,8EAA8E;IAC9E,IAAI,IAAI,IAAI,MAAM,CAEjB;CACF"}
|