@molecule/api-ai-tools 1.6.2 → 1.6.4

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 CHANGED
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
3
3
  Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
4
4
  Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
5
5
  To change this document, edit the module-level JSDoc in src/index.ts.
6
- Generated: 2026-10-16T15:37:48.365Z
6
+ Generated: 2026-10-16T16:49:27.760Z
7
7
  -->
8
8
 
9
9
  # @molecule/api-ai-tools
@@ -644,6 +644,27 @@ function buildAgentPrompt(ctx: PromptContext): string
644
644
 
645
645
  **Returns:** Fully assembled system prompt text for the coding agent.
646
646
 
647
+ #### `taskStopCommand(backend, taskId)`
648
+
649
+ The command that stops a running background task, read from the sandbox's own pid files.
650
+
651
+ THE one builder for it, so every note that hands the executor a way to stop a run hands over the
652
+ same pid-only form: a `pkill -f <something>` matches the shell running it (its argv IS the
653
+ command), and `molecule-dev/api/src/ai/pattern-kill-guard.ts` holds exactly that — X1
654
+ xr-molecule-flash-m87's stuck note suggested `kill $(cat /tmp/<id>.pid) 2>/dev/null; pkill -f
655
+ <id>.sh`, which the platform's own guard then refused, and the same shape cost a refused call at
656
+ +21:57. The pid tree is the whole of what the pattern was for: the detached shell and every
657
+ process under it.
658
+
659
+ ```typescript
660
+ function taskStopCommand(backend: ExecutionBackend, taskId: string): Promise<string>
661
+ ```
662
+
663
+ - `backend` — The execution backend.
664
+ - `taskId` — The task's `mol-bg-…` handle.
665
+
666
+ **Returns:** The command to hand the executor — `kill <pids>` — falling back to the task's own pid file when the walk comes back empty (a sandbox without `pgrep`, or a pid file already gone, in which case the pid-file form is still the one the platform's guard names).
667
+
647
668
  #### `moleculeDistReadNote(path)`
648
669
 
649
670
  The steer attached to a SUCCESSFUL read of a package's built output. The ENOENT
package/dist/tools.d.ts CHANGED
@@ -7,6 +7,24 @@
7
7
  * @module
8
8
  */
9
9
  import type { AITool } from '@molecule/api-ai';
10
+ /**
11
+ * The command that stops a running background task, read from the sandbox's own pid files.
12
+ *
13
+ * THE one builder for it, so every note that hands the executor a way to stop a run hands over the
14
+ * same pid-only form: a `pkill -f <something>` matches the shell running it (its argv IS the
15
+ * command), and `molecule-dev/api/src/ai/pattern-kill-guard.ts` holds exactly that — X1
16
+ * xr-molecule-flash-m87's stuck note suggested `kill $(cat /tmp/<id>.pid) 2>/dev/null; pkill -f
17
+ * <id>.sh`, which the platform's own guard then refused, and the same shape cost a refused call at
18
+ * +21:57. The pid tree is the whole of what the pattern was for: the detached shell and every
19
+ * process under it.
20
+ *
21
+ * @param backend - The execution backend.
22
+ * @param taskId - The task's `mol-bg-…` handle.
23
+ * @returns The command to hand the executor — `kill <pids>` — falling back to the task's own pid
24
+ * file when the walk comes back empty (a sandbox without `pgrep`, or a pid file already gone,
25
+ * in which case the pid-file form is still the one the platform's guard names).
26
+ */
27
+ export declare function taskStopCommand(backend: ExecutionBackend, taskId: string): Promise<string>;
10
28
  import type { ExecutionBackend, ToolBuildConfig } from './types.js';
11
29
  /**
12
30
  * The steer attached to a SUCCESSFUL read of a package's built output. The ENOENT
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAkL9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAoEnE;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAUhE;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,CAAC,EAAE,eAAe,GAAG,MAAM,EAAE,CAm5DxF"}
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAsE9C;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAahG;AAwHD,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAoEnE;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAUhE;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,CAAC,EAAE,eAAe,GAAG,MAAM,EAAE,CA65DxF"}
package/dist/tools.js CHANGED
@@ -63,13 +63,21 @@ const taskPidsCommand = (taskId) => `R=$(cat /tmp/${taskId}.pid 2>/dev/null); `
63
63
  /**
64
64
  * The command that stops a running background task, read from the sandbox's own pid files.
65
65
  *
66
+ * THE one builder for it, so every note that hands the executor a way to stop a run hands over the
67
+ * same pid-only form: a `pkill -f <something>` matches the shell running it (its argv IS the
68
+ * command), and `molecule-dev/api/src/ai/pattern-kill-guard.ts` holds exactly that — X1
69
+ * xr-molecule-flash-m87's stuck note suggested `kill $(cat /tmp/<id>.pid) 2>/dev/null; pkill -f
70
+ * <id>.sh`, which the platform's own guard then refused, and the same shape cost a refused call at
71
+ * +21:57. The pid tree is the whole of what the pattern was for: the detached shell and every
72
+ * process under it.
73
+ *
66
74
  * @param backend - The execution backend.
67
75
  * @param taskId - The task's `mol-bg-…` handle.
68
76
  * @returns The command to hand the executor — `kill <pids>` — falling back to the task's own pid
69
77
  * file when the walk comes back empty (a sandbox without `pgrep`, or a pid file already gone,
70
78
  * in which case the pid-file form is still the one the platform's guard names).
71
79
  */
72
- async function taskStopCommand(backend, taskId) {
80
+ export async function taskStopCommand(backend, taskId) {
73
81
  const fallback = `kill $(cat /tmp/${taskId}.pid)`;
74
82
  try {
75
83
  const r = await backend.run(taskPidsCommand(taskId), { timeout: 10_000 });
@@ -122,7 +130,8 @@ function logProgress(log) {
122
130
  /**
123
131
  * What a wait knows about the command BESIDES "it has not exited": how long it
124
132
  * has been running, whether its output is still growing, how far its own log
125
- * says it has got, and how much longer that implies.
133
+ * says it has got, and how much longer that implies — one fact per clause, built
134
+ * here so the note carrying them cannot state one of them twice.
126
135
  *
127
136
  * X1 flash-m62 (2026-10-16) spent three 290 s waits on one 8.3-minute suite and
128
137
  * every answer read only "Still running after 280s": the run could not tell a
@@ -131,35 +140,63 @@ function logProgress(log) {
131
140
  * waiting. The elapsed time comes from the task id, the progress from the log
132
141
  * this wait already read, and the time left is the rate so far, said as such.
133
142
  *
143
+ * X1 flash-m87 §+47:20 (2026-10-16): that suite's answer read "Still running
144
+ * after 342s of waiting, and its output is still growing (71839 bytes) — slow,
145
+ * not stuck." and then this sentence, which opens with the same growth clause
146
+ * and gives the same elapsed time in its other format — one answer, two facts,
147
+ * each said twice. The clauses ARE the facts, and {@link runningNote} is the
148
+ * only place they become a sentence, so a lead the caller writes itself cannot
149
+ * repeat one (the way `deployOwedNote` returns one sentence rather than a join).
150
+ *
134
151
  * @param o - The wait's facts: `taskId`, the `slice` of the log it read,
135
152
  * `stillWriting` (the log grew during this wait), `bytes` (the log's size, null
136
- * when unreadable), and `ceilingMs` (this call's ceiling, for "one more wait").
137
- * @returns A sentence to append to a running note, or '' when nothing is known.
153
+ * when unreadable), `ceilingMs` (this call's ceiling, for "one more wait"), and
154
+ * `waitedMs` (this call's own wait, the elapsed figure when the id carries no
155
+ * start stamp).
156
+ * @returns The clauses in reading order. The first states the elapsed time, so a
157
+ * sentence built from them always says something.
138
158
  */
139
- function waitProgressNote(o) {
159
+ function waitProgressClauses(o) {
140
160
  const startedAt = taskStartedAt(o.taskId);
141
- const elapsedMs = startedAt === null ? null : Math.max(0, Date.now() - startedAt);
142
- const parts = [];
143
- if (elapsedMs !== null)
144
- parts.push(`it has been running ${durationText(elapsedMs)}`);
161
+ const sinceStart = startedAt === null ? null : Math.max(0, Date.now() - startedAt);
162
+ // A task id this process minted always carries its start stamp; a synthetic one
163
+ // does not, and the time this call spent waiting is then the floor for how long
164
+ // the command has been running — it ran throughout that wait.
165
+ const clauses = [
166
+ sinceStart === null
167
+ ? `it has been running at least ${durationText(o.waitedMs)}`
168
+ : `it has been running ${durationText(sinceStart)}`,
169
+ ];
145
170
  if (o.stillWriting)
146
- parts.push(`its output is still growing (${o.bytes} bytes) — slow, not stuck`);
171
+ clauses.push(`its output is still growing (${o.bytes} bytes) — slow, not stuck`);
147
172
  else if (o.bytes !== null)
148
- parts.push(`its log has not grown during this wait (${o.bytes} bytes)`);
173
+ clauses.push(`its log has not grown during this wait (${o.bytes} bytes)`);
149
174
  const counter = logProgress(o.slice);
150
175
  if (counter) {
151
- parts.push(`its log is at ${counter.done} of ${counter.total}`);
152
- if (elapsedMs !== null && counter.done > 0 && counter.done < counter.total) {
153
- const leftMs = Math.round((elapsedMs * (counter.total - counter.done)) / counter.done);
154
- parts.push(leftMs <= o.ceilingMs
176
+ clauses.push(`its log is at ${counter.done} of ${counter.total}`);
177
+ // The rate is the task's own elapsed time, never this call's wait: with no
178
+ // start stamp, "34 tests in the 290 s I just waited" would be reported as the
179
+ // speed of a suite that has been walking for ten minutes.
180
+ if (sinceStart !== null && counter.done > 0 && counter.done < counter.total) {
181
+ const leftMs = Math.round((sinceStart * (counter.total - counter.done)) / counter.done);
182
+ clauses.push(leftMs <= o.ceilingMs
155
183
  ? `about ${durationText(leftMs)} left at that rate — one more wait covers it`
156
184
  : `about ${durationText(leftMs)} left at that rate (${Math.ceil(leftMs / o.ceilingMs)} more waits)`);
157
185
  }
158
186
  }
159
- if (!parts.length)
187
+ return clauses;
188
+ }
189
+ /**
190
+ * One sentence from clauses: joined by "; ", capitalised and punctuated once.
191
+ *
192
+ * @param clauses - The facts to state, each in its own clause.
193
+ * @returns The sentence, or '' when there is nothing to say.
194
+ */
195
+ function runningNote(clauses) {
196
+ if (!clauses.length)
160
197
  return '';
161
- const sentence = parts.join('; ');
162
- return ` ${sentence[0].toUpperCase()}${sentence.slice(1)}.`;
198
+ const joined = clauses.join('; ');
199
+ return `${joined[0].toUpperCase()}${joined.slice(1)}.`;
163
200
  }
164
201
  import { checkBlockedCommand, declaredBudgetSeconds, DEFAULT_SEARCH_EXCLUDED_DIRS, directoryReadHint, emptyCallError, failureCausesNote, findPatternArgs, fusedLine, htmlOutline, isEnvFilePath, isOutsideRoot, isPlaywrightRunCommand, isValidGlob, linesWithinSerialized, MAX_BATCH_READ_FILES, MAX_FIND_RESULTS, MAX_HTML_INLINE_CHARS, MAX_OUTPUT_SIZE, MAX_READ_CALL_CHARS, MAX_READ_RETURN_CHARS, MAX_READ_SIZE, MAX_SEARCH_CONTEXT_LINES, MAX_SEARCH_RESULTS, MAX_WRITE_SIZE, outputIsWithheldUntilExit, outputRedirectTarget, parseCheckCommand, parseCheckProblem, pathArgError, printsOnlySource, READ_RESULT_ENVELOPE_CHARS, redactSecrets, redactSecretsInCode, repeatingFailure, repeatingFailureNote, resolvePath, RUNNING_FAILURE_LINES, runningCauseCommand, runningOutputSliceCommand, serializedChars, shellQuote, sliceLines, SMALL_FILE_WHOLE_CHARS, streamingBackgroundCommand, stripControlChars, suiteRunPriorityLaunch, truncateMiddle, universalCause, whitespaceTolerantReplace, } from './utilities.js';
165
202
  /**
@@ -1739,8 +1776,8 @@ export function buildTools(backend, config) {
1739
1776
  status: 'stuck',
1740
1777
  waitedMs: waitedBefore,
1741
1778
  note: `You have already waited ${Math.round(waitedBefore / 1000)}s on this command and it ` +
1742
- `has not exited — it is stuck, not slow. Kill it (exec_command: kill $(cat /tmp/${taskId}.pid) ` +
1743
- `2>/dev/null; pkill -f ${taskId}.sh) and move on; do not wait on it again.`,
1779
+ `has not exited — it is stuck, not slow. Kill it (\`exec_command: ` +
1780
+ `${await taskStopCommand(backend, taskId)}\`) and move on; do not wait on it again.`,
1744
1781
  };
1745
1782
  }
1746
1783
  // The id names files under /tmp; only an id this tool minted may be used
@@ -1853,13 +1890,19 @@ export function buildTools(backend, config) {
1853
1890
  // No slice: the notes still say how to peek, and the task id still
1854
1891
  // carries how long the command has been running.
1855
1892
  }
1856
- const progress = waitProgressNote({
1893
+ // ONE sentence of facts, each said once, then what to do next: the lead
1894
+ // this branch used to write ("Still running after 342s of waiting, and its
1895
+ // output is still growing (71839 bytes) — slow, not stuck") restated the
1896
+ // elapsed time and the growth clause these clauses already hold — the same
1897
+ // sentence, twice (X1 flash-m87 §+47:20).
1898
+ const progress = runningNote(waitProgressClauses({
1857
1899
  taskId,
1858
1900
  slice: soFar,
1859
1901
  stillWriting,
1860
1902
  bytes: grownTo,
1861
1903
  ceilingMs: ceiling,
1862
- });
1904
+ waitedMs: waitedBefore + waitedMs,
1905
+ }));
1863
1906
  const sliceField = soFar.trim() ? { outputSoFar: sanitizeOutput(soFar) } : {};
1864
1907
  if (stillWriting && waitedBefore + waitedMs >= stuckAfterMs()) {
1865
1908
  waitedByTask.set(taskId, 0);
@@ -1868,9 +1911,8 @@ export function buildTools(backend, config) {
1868
1911
  status: 'running',
1869
1912
  waitedMs,
1870
1913
  ...sliceField,
1871
- note: `Still running after ${Math.round((waitedBefore + waitedMs) / 1000)}s of waiting, and its ` +
1872
- `output is still growing (${grownTo} bytes) — slow, not stuck.${progress} Call wait_for_task ` +
1873
- `again to keep waiting; peek with exec_command: tail ${log}.`,
1914
+ note: `${progress} Call wait_for_task again to keep waiting; peek with exec_command: ` +
1915
+ `tail ${log}.`,
1874
1916
  };
1875
1917
  }
1876
1918
  if (waitedBefore + waitedMs >= stuckAfterMs()) {
@@ -1880,8 +1922,8 @@ export function buildTools(backend, config) {
1880
1922
  waitedMs: waitedBefore + waitedMs,
1881
1923
  note: `${Math.round((waitedBefore + waitedMs) / 1000)}s of waiting and it has not exited — it is ` +
1882
1924
  `stuck, not slow. See what it printed with exec_command (tail /tmp/${taskId}.log — ` +
1883
- `read_file cannot reach /tmp), kill it (exec_command: ` +
1884
- `kill $(cat /tmp/${taskId}.pid) 2>/dev/null; pkill -f ${taskId}.sh) and move on; do not wait on it again.`,
1925
+ `read_file cannot reach /tmp), kill it (\`exec_command: ` +
1926
+ `${await taskStopCommand(backend, taskId)}\`) and move on; do not wait on it again.`,
1885
1927
  };
1886
1928
  }
1887
1929
  return {
@@ -1889,7 +1931,10 @@ export function buildTools(backend, config) {
1889
1931
  status: 'running',
1890
1932
  waitedMs,
1891
1933
  ...sliceField,
1892
- note: `Still running after ${Math.round(waitedMs / 1000)}s.${progress} Call wait_for_task again to ` +
1934
+ // No "Still running after Ns" lead here either: the clauses already say
1935
+ // how long it has been running, and the lead said it a second time in
1936
+ // the other format (X1 flash-m87 §+47:20).
1937
+ note: `${progress} Call wait_for_task again to ` +
1893
1938
  `keep waiting — its result carries the log output. ` +
1894
1939
  (soFar.trim()
1895
1940
  ? `outputSoFar is the failure lines so far (up to ${RUNNING_FAILURE_LINES}) and then the end of ` +
@@ -1 +1 @@
1
- {"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../src/utilities.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAS5C;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAAI,GAAG,MAAM,KAAG,MAEE,CAAA;AAuGhD;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAK/C;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAErD;AAKD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,M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AS,CACvB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAChB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAgBvC"}
package/dist/utilities.js CHANGED
@@ -1516,6 +1516,12 @@ export const FAILURE_CAUSE_TESTS_LISTED = 6;
1516
1516
  * The shortest unambiguous tail of a logged path's FILE (`…/specs/e2e/articles.spec.ts` →
1517
1517
  * `e2e/articles.spec.ts`).
1518
1518
  *
1519
+ * Used only where a COUNT of files is what the sentence needs; every note that names a
1520
+ * test to the executor prints the path the log wrote, because that is the path its own
1521
+ * re-run hint names and the one the executor can paste back into a command (flash-m82
1522
+ * read a shortened `e2e/auth.spec.ts:19` as a file the app owned, and rewrote its config
1523
+ * over a suite path that was already right).
1524
+ *
1519
1525
  * @param file - A path as {@link specFile} returns it.
1520
1526
  * @returns The last two path segments.
1521
1527
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/api-ai-tools",
3
- "version": "1.6.2",
3
+ "version": "1.6.4",
4
4
  "description": "Shared AI agent tools with backend abstraction for sandbox and local execution",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -31,7 +31,7 @@
31
31
  "@molecule/api-ai": "^1.0.1"
32
32
  },
33
33
  "devDependencies": {
34
- "@molecule/api-ai": "1.3.2",
34
+ "@molecule/api-ai": "1.3.3",
35
35
  "@types/node": "26.1.2",
36
36
  "esbuild": "0.28.2",
37
37
  "typescript": "6.0.3",