@sapiom/harness 0.8.8 → 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.
Files changed (88) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/README.md +11 -1
  3. package/dist/core/agent-project-discovery.d.ts +235 -1
  4. package/dist/core/agent-project-discovery.d.ts.map +1 -1
  5. package/dist/core/agent-project-discovery.js +303 -1
  6. package/dist/core/agent-project-discovery.js.map +1 -1
  7. package/dist/core/canvas-interconnections.d.ts +31 -0
  8. package/dist/core/canvas-interconnections.d.ts.map +1 -1
  9. package/dist/core/canvas-interconnections.js +294 -21
  10. package/dist/core/canvas-interconnections.js.map +1 -1
  11. package/dist/core/canvas-render.d.ts +32 -0
  12. package/dist/core/canvas-render.d.ts.map +1 -1
  13. package/dist/core/canvas-render.js +50 -41
  14. package/dist/core/canvas-render.js.map +1 -1
  15. package/dist/core/definition-name.d.ts +12 -0
  16. package/dist/core/definition-name.d.ts.map +1 -1
  17. package/dist/core/definition-name.js +14 -5
  18. package/dist/core/definition-name.js.map +1 -1
  19. package/dist/core/system-graph-inventory.d.ts +68 -0
  20. package/dist/core/system-graph-inventory.d.ts.map +1 -0
  21. package/dist/core/system-graph-inventory.js +312 -0
  22. package/dist/core/system-graph-inventory.js.map +1 -0
  23. package/dist/core/system-graph-relationships.d.ts +41 -0
  24. package/dist/core/system-graph-relationships.d.ts.map +1 -0
  25. package/dist/core/system-graph-relationships.js +98 -0
  26. package/dist/core/system-graph-relationships.js.map +1 -0
  27. package/dist/core/system-graph-store.d.ts +45 -0
  28. package/dist/core/system-graph-store.d.ts.map +1 -0
  29. package/dist/core/system-graph-store.js +222 -0
  30. package/dist/core/system-graph-store.js.map +1 -0
  31. package/dist/core/system-graph-watcher.d.ts +51 -0
  32. package/dist/core/system-graph-watcher.d.ts.map +1 -0
  33. package/dist/core/system-graph-watcher.js +448 -0
  34. package/dist/core/system-graph-watcher.js.map +1 -0
  35. package/dist/core/system-graph.d.ts +43 -0
  36. package/dist/core/system-graph.d.ts.map +1 -0
  37. package/dist/core/system-graph.js +321 -0
  38. package/dist/core/system-graph.js.map +1 -0
  39. package/dist/core/workflow-registry.d.ts +84 -6
  40. package/dist/core/workflow-registry.d.ts.map +1 -1
  41. package/dist/core/workflow-registry.js +191 -91
  42. package/dist/core/workflow-registry.js.map +1 -1
  43. package/dist/core/workspace-watcher.d.ts +21 -13
  44. package/dist/core/workspace-watcher.d.ts.map +1 -1
  45. package/dist/core/workspace-watcher.js +79 -81
  46. package/dist/core/workspace-watcher.js.map +1 -1
  47. package/dist/index.d.ts +1 -0
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js.map +1 -1
  50. package/dist/profiles/default.d.ts.map +1 -1
  51. package/dist/profiles/default.js +4 -2
  52. package/dist/profiles/default.js.map +1 -1
  53. package/dist/server/agent-move.d.ts +134 -0
  54. package/dist/server/agent-move.d.ts.map +1 -0
  55. package/dist/server/agent-move.js +343 -0
  56. package/dist/server/agent-move.js.map +1 -0
  57. package/dist/server/index.d.ts.map +1 -1
  58. package/dist/server/index.js +275 -22
  59. package/dist/server/index.js.map +1 -1
  60. package/dist/server/rest.d.ts +3 -0
  61. package/dist/server/rest.d.ts.map +1 -1
  62. package/dist/server/rest.js +3 -0
  63. package/dist/server/rest.js.map +1 -1
  64. package/dist/server/studio-rail.d.ts +76 -0
  65. package/dist/server/studio-rail.d.ts.map +1 -0
  66. package/dist/server/studio-rail.js +234 -0
  67. package/dist/server/studio-rail.js.map +1 -0
  68. package/dist/server/system-graph.d.ts +14 -0
  69. package/dist/server/system-graph.d.ts.map +1 -0
  70. package/dist/server/system-graph.js +40 -0
  71. package/dist/server/system-graph.js.map +1 -0
  72. package/dist/server/workflow-graph.d.ts +43 -0
  73. package/dist/server/workflow-graph.d.ts.map +1 -0
  74. package/dist/server/workflow-graph.js +200 -0
  75. package/dist/server/workflow-graph.js.map +1 -0
  76. package/dist/shared/system-graph.d.ts +59 -0
  77. package/dist/shared/system-graph.d.ts.map +1 -0
  78. package/dist/shared/system-graph.js +76 -0
  79. package/dist/shared/system-graph.js.map +1 -0
  80. package/dist/shared/types.d.ts +45 -0
  81. package/dist/shared/types.d.ts.map +1 -1
  82. package/dist/shared/types.js.map +1 -1
  83. package/dist/web/assets/index-2Fab6dzf.js +508 -0
  84. package/dist/web/assets/index-D0doaFvT.css +32 -0
  85. package/dist/web/index.html +2 -2
  86. package/package.json +5 -5
  87. package/dist/web/assets/index-DrTPW10E.js +0 -494
  88. package/dist/web/assets/index-jGBbXx9R.css +0 -32
@@ -28,23 +28,66 @@
28
28
  * The fallback walk is async (fs/promises) to avoid blocking the event loop
29
29
  * on a wide cwd — the poll interval is longer than the watch debounce,
30
30
  * so a filesystem event via the watcher is still the fast path.
31
+ *
32
+ * Both walks run core/agent-project-discovery.ts's shared bounded traversal, so
33
+ * "which directories a scan of this root covers" has one definition here and in
34
+ * the workflow registry. The fingerprint's budget is deliberately the tighter of
35
+ * the two — see AGENT_PROJECT_WATCH_MAX_NODES.
31
36
  */
32
37
  import * as fs from "node:fs";
33
- import * as fsp from "node:fs/promises";
34
38
  import * as path from "node:path";
35
- import { AGENT_PROJECT_SCAN_MAX_DEPTH, inspectAgentProjectMarker, inspectAgentProjectMarkerSync, isAgentProjectScanIgnoredDir, } from "./agent-project-discovery.js";
39
+ import { AGENT_PROJECT_WATCH_MAX_NODES, AgentProjectScanBudget, inspectAgentProjectMarker, inspectAgentProjectMarkerSync, isAgentProjectScanIgnoredDir, walkAgentProjectTree, walkAgentProjectTreeAsync, } from "./agent-project-discovery.js";
36
40
  const DEBOUNCE_MS = 250;
37
41
  /** Longer than the watch debounce — the watcher path is the fast signal;
38
42
  * the poll is just a backstop for platforms without recursive fs.watch. */
39
43
  const POLL_INTERVAL_MS = 2000;
40
44
  const UNREADABLE_FINGERPRINT = "<unreadable>";
41
- function isConfirmedMissing(error) {
42
- const code = error.code;
43
- return code === "ENOENT" || code === "ENOTDIR";
44
- }
45
+ /** Sentinel for "the node budget stopped this walk at depth N" — see
46
+ * addTruncatedFingerprint. */
47
+ const TRUNCATED_FINGERPRINT = "<truncated>";
45
48
  function addUnreadableFingerprint(fingerprints, dir) {
46
49
  fingerprints.push(`${dir}\0${UNREADABLE_FINGERPRINT}`);
47
50
  }
51
+ /** A fresh watch budget — tighter than a registry scan's, because this walk is
52
+ * synchronous and re-runs on the debounce after every save. */
53
+ function watchBudget() {
54
+ return new AgentProjectScanBudget({ maxNodes: AGENT_PROJECT_WATCH_MAX_NODES });
55
+ }
56
+ /**
57
+ * One sentinel, keyed by root and the depth the node budget cut at, when a walk
58
+ * did not cover the whole tree.
59
+ *
60
+ * It is one entry rather than one per unvisited directory for two reasons: the
61
+ * unvisited frontier can be tens of thousands of directories on a real root,
62
+ * and the cut depth is the only thing about it that is *stable*. The walk is
63
+ * breadth-first over sorted entries, so the cut lands in the same place on
64
+ * every pass over an unchanged tree, and the fingerprint stays put instead of
65
+ * flapping and rescanning the workspace forever.
66
+ */
67
+ function addTruncatedFingerprint(fingerprints, root, budget) {
68
+ if (!budget.truncated)
69
+ return;
70
+ fingerprints.push(`${root}\0${TRUNCATED_FINGERPRINT}@${budget.truncatedAtDepth}`);
71
+ }
72
+ /**
73
+ * Classifies one directory for the fingerprint, shared by the sync and async
74
+ * walks so they cannot disagree. Returns what the walk should do next.
75
+ */
76
+ function fingerprintDirectory(markerDirs, dir, markerResult) {
77
+ if (markerResult.status === "valid") {
78
+ markerDirs.push(`${dir}\0${JSON.stringify(markerResult.marker)}`);
79
+ return "stop";
80
+ }
81
+ // Preserve "temporarily unreadable" as a distinct state. If it collapsed
82
+ // to the same fingerprint as an absent/invalid project, a quick
83
+ // unreadable -> invalid transition could be swallowed by the debounce and
84
+ // leave a stale workflow in the registry until some later filesystem event.
85
+ if (markerResult.status === "unreadable") {
86
+ addUnreadableFingerprint(markerDirs, dir);
87
+ return "stop";
88
+ }
89
+ return "descend";
90
+ }
48
91
  function firstSegmentIgnored(relPath) {
49
92
  for (const segment of relPath.split(path.sep)) {
50
93
  if (segment && isAgentProjectScanIgnoredDir(segment))
@@ -54,90 +97,45 @@ function firstSegmentIgnored(relPath) {
54
97
  }
55
98
  /**
56
99
  * Fingerprint of the set of workflow-marker directories under `root` (sorted,
57
- * bounded depth, ignored subtrees skipped), plus opaque sentinels for subtrees
58
- * that are temporarily unreadable. Changes when a workflow is added, removed,
59
- * renamed, or crosses that unreadable boundary not when unrelated readable
100
+ * bounded by depth AND by directories visited, ignored subtrees skipped), plus
101
+ * opaque sentinels for subtrees that are temporarily unreadable or that the
102
+ * node budget kept the walk out of. Changes when a workflow is added, removed,
103
+ * renamed, or crosses one of those boundaries — not when unrelated readable
60
104
  * files are edited. Exported for direct testing.
61
105
  *
62
- * The synchronous form is retained for callers that need an immediate
63
- * baseline at construction time (before async I/O is possible). The
64
- * polling fallback uses the async form to avoid blocking the event loop on
65
- * a wide directory tree.
106
+ * The synchronous form remains for the session watcher, whose constructor
107
+ * requires an immediate baseline. Project-graph watchers use the async form
108
+ * for startup, native-event checks, and polling so a wide Project never walks
109
+ * synchronously on the server loop.
110
+ *
111
+ * `budget` is injectable so a benchmark can read the directories visited off
112
+ * the same object the walk spends, and so a test can force truncation. Pass the
113
+ * SAME limits to both forms: the two produce identical fingerprints on one tree
114
+ * only when their bounds match, and SessionWorkspaceWatcher compares a sync
115
+ * baseline against an async poll result.
66
116
  */
67
- export function snapshotWorkspaceWorkflows(root) {
117
+ export function snapshotWorkspaceWorkflows(root, budget = watchBudget()) {
68
118
  const markerDirs = [];
69
- const walk = (dir, depth) => {
70
- if (depth > AGENT_PROJECT_SCAN_MAX_DEPTH)
71
- return;
72
- // Preserve "temporarily unreadable" as a distinct state. If it collapsed
73
- // to the same fingerprint as an absent/invalid project, a quick
74
- // unreadable -> invalid transition could be swallowed by the debounce and
75
- // leave a stale workflow in the registry until some later filesystem event.
76
- const markerResult = inspectAgentProjectMarkerSync(dir);
77
- if (markerResult.status === "valid") {
78
- markerDirs.push(`${dir}\0${JSON.stringify(markerResult.marker)}`);
79
- return;
80
- }
81
- if (markerResult.status === "unreadable") {
82
- addUnreadableFingerprint(markerDirs, dir);
83
- return;
84
- }
85
- let entries;
86
- try {
87
- entries = fs.readdirSync(dir, { withFileTypes: true });
88
- }
89
- catch (error) {
90
- if (!isConfirmedMissing(error)) {
91
- addUnreadableFingerprint(markerDirs, dir);
92
- }
93
- return;
94
- }
95
- for (const entry of entries) {
96
- if (!entry.isDirectory() || isAgentProjectScanIgnoredDir(entry.name))
97
- continue;
98
- walk(path.join(dir, entry.name), depth + 1);
99
- }
100
- };
101
- walk(root, 0);
119
+ walkAgentProjectTree(root, {
120
+ onDirectory: (dir) => fingerprintDirectory(markerDirs, dir, inspectAgentProjectMarkerSync(dir)),
121
+ onUnreadable: (dir) => addUnreadableFingerprint(markerDirs, dir),
122
+ }, budget);
123
+ addTruncatedFingerprint(markerDirs, path.resolve(root), budget);
102
124
  return markerDirs.sort().join("|");
103
125
  }
104
126
  /**
105
- * Async variant used by the polling fallback yields between directories so
106
- * a wide workspace can't stutter the event loop on platforms without recursive
107
- * fs.watch. Produces the same fingerprint as the sync version. Exported for
108
- * direct testing.
127
+ * Async variant for graph watcher baselines/event checks and polling
128
+ * fallbacks yields between directories so a wide workspace cannot stutter
129
+ * the event loop. Produces the same fingerprint as the sync version. Exported
130
+ * for direct testing.
109
131
  */
110
- export async function snapshotWorkspaceWorkflowsAsync(root) {
132
+ export async function snapshotWorkspaceWorkflowsAsync(root, budget = watchBudget()) {
111
133
  const markerDirs = [];
112
- const walk = async (dir, depth) => {
113
- if (depth > AGENT_PROJECT_SCAN_MAX_DEPTH)
114
- return;
115
- const markerResult = await inspectAgentProjectMarker(dir);
116
- if (markerResult.status === "valid") {
117
- markerDirs.push(`${dir}\0${JSON.stringify(markerResult.marker)}`);
118
- return;
119
- }
120
- if (markerResult.status === "unreadable") {
121
- addUnreadableFingerprint(markerDirs, dir);
122
- return;
123
- }
124
- let entries;
125
- try {
126
- entries = await fsp.readdir(dir, { withFileTypes: true });
127
- }
128
- catch (error) {
129
- if (!isConfirmedMissing(error)) {
130
- addUnreadableFingerprint(markerDirs, dir);
131
- }
132
- return;
133
- }
134
- for (const entry of entries) {
135
- if (!entry.isDirectory() || isAgentProjectScanIgnoredDir(entry.name))
136
- continue;
137
- await walk(path.join(dir, entry.name), depth + 1);
138
- }
139
- };
140
- await walk(root, 0);
134
+ await walkAgentProjectTreeAsync(root, {
135
+ onDirectory: async (dir) => fingerprintDirectory(markerDirs, dir, await inspectAgentProjectMarker(dir)),
136
+ onUnreadable: (dir) => addUnreadableFingerprint(markerDirs, dir),
137
+ }, budget);
138
+ addTruncatedFingerprint(markerDirs, path.resolve(root), budget);
141
139
  return markerDirs.sort().join("|");
142
140
  }
143
141
  /** One session's workspace watcher. */
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-watcher.js","sourceRoot":"","sources":["../../src/core/workspace-watcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAC;AACxC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,EACzB,6BAA6B,EAC7B,4BAA4B,GAC7B,MAAM,8BAA8B,CAAC;AAEtC,MAAM,WAAW,GAAG,GAAG,CAAC;AACxB;4EAC4E;AAC5E,MAAM,gBAAgB,GAAG,IAAK,CAAC;AAC/B,MAAM,sBAAsB,GAAG,cAAc,CAAC;AAE9C,SAAS,kBAAkB,CAAC,KAAc;IACxC,MAAM,IAAI,GAAI,KAA+B,CAAC,IAAI,CAAC;IACnD,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,SAAS,CAAC;AACjD,CAAC;AAED,SAAS,wBAAwB,CAAC,YAAsB,EAAE,GAAW;IACnE,YAAY,CAAC,IAAI,CAAC,GAA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AC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CACnF,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,gBAAwB;QAC3B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE,KAAK,EAAE,CAAC;QAC7C,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;IACzC,CAAC;IAED,OAAO;QACL,KAAK,MAAM,gBAAgB,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YAAE,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACxF,CAAC;IAED,8EAA8E;IAC9E,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC5B,CAAC;CACF"}
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@
3
3
  * interface; this export exists so other packages can reuse the contract.
4
4
  */
5
5
  export * from "./shared/types.js";
6
+ export type { WorkspaceScopeSummary } from "./shared/system-graph.js";
6
7
  export { AGENT_STUDIO_PRODUCT_NAME } from "./shared/branding.js";
7
8
  export { HarnessError, UnknownSessionError, SessionNotReadyError, SessionNotResumeableError, SessionAlreadyLiveError, AdapterNotFoundError, ExternalHarnessError, SpawnTargetError, } from "./core/errors.js";
8
9
  export { listHarnessAdapters, getHarnessAdapter, createHarnessAdapterRegistry, UnknownHarnessAdapterError, } from "./core/adapters/registry.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,EACpB,yBAAyB,EACzB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,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AmB,EACnB,iBAAiB,EACjB,4BAA4B,EAC5B,0BAA0B,GAC3B,MAAM,6BAA6B,CAAC;AASrC,8EAA8E;AAC9E,+EAA+E;AAC/E,kFAAkF;AAClF,mFAAmF;AACnF,6EAA6E;AAC7E,8EAA8E;AAC9E,+EAA+E;AAC/E,iEAAiE;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACxE,6EAA6E;AAC7E,8EAA8E;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,+EAA+E;AAC/E,+EAA+E;AAC/E,gFAAgF;AAChF,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../src/profiles/default.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,QA6E1B,CAAC"}
1
+ {"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../src/profiles/default.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,QA+E1B,CAAC"}
@@ -27,8 +27,10 @@ platform-driven multi-turn loop → \`ctx.sapiom.models.run\` (never for a
27
27
  one-shot — it overthinks); dispatching a deployed agent by slug →
28
28
  \`ctx.sapiom.agents.run\`. Structured output = tool-use/schema output — read
29
29
  the \`tool_use\` block's input, never string-parse; a plain-text reply reads
30
- only \`type === 'text'\` blocks. Omit \`model\`
31
- (recommended) or pin the \`smart\` label; raw provider ids are never
30
+ only \`type === 'text'\` blocks. **Omit \`model\` entirely** — the platform
31
+ routes it, and \`smart\` is already the default, so naming it changes
32
+ nothing. Reach for \`small\`/\`medium\`/\`large\` only to choose a class
33
+ deliberately. Raw provider ids are never
32
34
  honored. Results disclose the served class + lane. Debugging a run: the
33
35
  Run Inspector, or the per-step I/O endpoint documented in the guide.
34
36
  Guide: https://docs.sapiom.ai/guides/choose-a-call-surface.
@@ -1 +1 @@
1
- {"version":3,"file":"default.js","sourceRoot":"","sources":["../../src/profiles/default.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6EpC,CAAC,IAAI,EAAE,CAAC"}
1
+ {"version":3,"file":"default.js","sourceRoot":"","sources":["../../src/profiles/default.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+EpC,CAAC,IAAI,EAAE,CAAC"}
@@ -0,0 +1,134 @@
1
+ import { type Router as ExpressRouter } from "express";
2
+ /** What actually performed the move — reported back so a caller (and the test)
3
+ * can see which branch ran. */
4
+ export type MoveKind = "git" | "rename";
5
+ export interface AgentMoveResponse {
6
+ ok: true;
7
+ /** False for the silent no-op: `to` resolved to `from`, nothing happened. */
8
+ moved: boolean;
9
+ from: string;
10
+ to: string;
11
+ kind: MoveKind | null;
12
+ }
13
+ export interface AgentMoveDeps {
14
+ /**
15
+ * The registered agent at this absolute path, or null. Only a registered
16
+ * agent may be moved: the rail can only drag rows it renders, and the rows
17
+ * it renders come from this same cache.
18
+ */
19
+ resolveAgent: (agentPath: string) => {
20
+ name: string;
21
+ path: string;
22
+ } | null;
23
+ /**
24
+ * Every directory an agent may be dropped INTO: the project roots the studio
25
+ * knows about, plus the branching directories the Project axis renders
26
+ * between a root and an agent. `moveTargetDirs` below derives exactly that
27
+ * set from the two things the server already holds, so "a directory the rail
28
+ * can show" and "a directory this route will move into" are one list.
29
+ */
30
+ listMoveTargetDirs: () => string[] | Promise<string[]>;
31
+ /**
32
+ * Applied AFTER a successful move, before the response. The integrator's job:
33
+ * remap live session cwds that sat inside the moved tree, prune the registry
34
+ * of the path that no longer exists, rescan the destination, and broadcast
35
+ * `workflows.changed` so the rail re-derives the tree from the new path.
36
+ */
37
+ onMoved: (from: string, to: string) => Promise<void>;
38
+ }
39
+ /** Whether `child` IS `parent` or sits beneath it, on segment boundaries — so
40
+ * `…/ads-v2` is never read as a child of `…/ads`. Node-side twin of the
41
+ * browser's `paths.isWithinDir`; `path.relative` does the normalizing. */
42
+ export declare function isWithinDir(parent: string, child: string): boolean;
43
+ /**
44
+ * Every directory the Project axis can offer as a drop target, derived from the
45
+ * only two things the server holds: the roots the studio knows about and the
46
+ * agents the registry has found.
47
+ *
48
+ * This mirrors `web/src/lib/project-tree.ts` exactly, because it has to. That
49
+ * module tries each root, keeps the agents beneath it, and renders the path
50
+ * segments between them as directory rows; a row that exists there is a row a
51
+ * drag can land on, and nothing else is. So: each root, plus each directory
52
+ * between a root and an agent inside it.
53
+ *
54
+ * KNOWN GAP, deliberately: the rail also shows `pendingCwds` — a folder chosen
55
+ * for an agent that is still being created — and the server has no such list.
56
+ * Dropping into a project that exists only mid-creation is refused with the
57
+ * "directory the studio doesn't show" message until the folder lands in
58
+ * `recentDirs`, which is the next thing that happens to it. Refusing a rare
59
+ * drop is the right side to fail on for a route that renames user code.
60
+ */
61
+ export declare function moveTargetDirs(roots: readonly string[], agentPaths: readonly string[]): string[];
62
+ /**
63
+ * The path `p` becomes once `from` has moved to `to` — unchanged when `p` is
64
+ * not inside `from`.
65
+ *
66
+ * Everything under the moved directory travels with it, so a nested agent and a
67
+ * SESSION whose cwd sat inside the tree are remapped by the same rule. Without
68
+ * this a session keeps pointing at a directory that no longer exists.
69
+ */
70
+ export declare function remapUnder(p: string, from: string, to: string): string;
71
+ /**
72
+ * Rewrites every live session that sat inside the moved tree, IN PLACE, and
73
+ * returns how many changed.
74
+ *
75
+ * A function rather than a loop at the wiring site because this is the criterion
76
+ * "sessions whose cwd sat inside the moved directory follow it", and a rule that
77
+ * lives inside a route's callback cannot be tested. On disk the session's own
78
+ * process cwd follows the directory automatically (a cwd is an inode, not a
79
+ * string), so what has to be corrected is the RECORD — the path the studio shows,
80
+ * files under, and reboots the session at. Left stale, the session's project row
81
+ * points at a directory that no longer exists.
82
+ *
83
+ * `boundWorkflowPath` travels the same way: the binding names the agent's
84
+ * directory, and the agent just moved.
85
+ *
86
+ * In place, because the session manager owns these objects and hands out live
87
+ * references — `setBoundWorkflowPath` mutates them the same way.
88
+ */
89
+ export declare function remapSessions(sessions: Array<{
90
+ cwd: string;
91
+ boundWorkflowPath?: string | null;
92
+ }>, from: string, to: string): number;
93
+ /**
94
+ * Whether git TRACKS anything inside `dir`.
95
+ *
96
+ * `ls-files` rather than `rev-parse --is-inside-work-tree`: a directory can sit
97
+ * inside a repo and be entirely gitignored (a scratch agent under a checkout's
98
+ * `tmp/`), and `git mv` refuses those. "Inside a repo" is the wrong question;
99
+ * "does git know about these files" is the one that predicts whether `git mv`
100
+ * can do the job. No repo at all, or git not installed, reads as untracked.
101
+ */
102
+ export declare function isGitTracked(dir: string): Promise<boolean>;
103
+ /**
104
+ * Moves the directory, preferring the tracked path.
105
+ *
106
+ * A `git mv` failure falls THROUGH to the plain rename rather than failing the
107
+ * request: the commonest reason is a destination outside this work tree (moving
108
+ * an agent out of a checkout is a legitimate move), and the untracked branch
109
+ * would have done exactly this anyway. What must never happen is a move that
110
+ * half-succeeds, and neither branch can do that — both are single operations.
111
+ */
112
+ export declare function performMove(from: string, to: string): Promise<MoveKind>;
113
+ /**
114
+ * The route's OWN refusal, from the filesystem rather than from a path list —
115
+ * a message when the move must not happen, null when it may.
116
+ *
117
+ * Ordered so the most specific truth wins: a destination inside the source is
118
+ * the move that destroys the thing being moved (`mv a a/b` relocates the
119
+ * destination along with the source and leaves nothing behind), and it is worth
120
+ * saying so rather than reporting whatever `stat` happens to find there.
121
+ */
122
+ export declare function refuseMoveOnDisk(from: string, to: string): Promise<string | null>;
123
+ /**
124
+ * POST /api/agents/move { from, to } -> AgentMoveResponse
125
+ *
126
+ * 400 — a malformed or unregistered `from`, or a `to` that asks for a rename.
127
+ * 409 — a refusal, with the reason in `error` so the rail can show it verbatim:
128
+ * a destination inside the source, a destination the studio doesn't show, or
129
+ * anything `stat` finds already sitting there. 200 with `moved: false` — `to`
130
+ * resolved to `from`: the user let go somewhere harmless, and the SILENT no-op
131
+ * is a success, not a complaint.
132
+ */
133
+ export declare function createAgentMoveRouter(deps: AgentMoveDeps): ExpressRouter;
134
+ //# sourceMappingURL=agent-move.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-move.d.ts","sourceRoot":"","sources":["../../src/server/agent-move.ts"],"names":[],"mappings":"AAgDA,OAAO,EAAU,KAAK,MAAM,IAAI,aAAa,EAAE,MAAM,SAAS,CAAC;AAI/D;gCACgC;AAChC,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,QAAQ,CAAC;AAExC,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,IAAI,CAAC;IACT,6EAA6E;IAC7E,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAA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