@molecule/api-ai-tools 1.10.3 → 1.10.5

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.
@@ -0,0 +1,115 @@
1
+ /**
2
+ * An inline interpreter program (`python3 -c`, `python3 - <<EOF`, `node -e`) that only touches local
3
+ * files — work that takes milliseconds or never ends, never minutes of honest progress.
4
+ *
5
+ * xr-molecule-flash-m200 (+03:45, 2026-10-19) spent 291 s of a 60-minute cap on
6
+ * `python3 - <<'EOF' … re.findall(r'([^{}]*:before[^{}]*)\{content:"[^"]*"\}', s) … EOF` rewriting a
7
+ * minified CSS file whose first rule is one ~25 KB selector list: the pattern's two unbounded
8
+ * `[^{}]*` around a literal backtrack cubically, printed nothing, and was stopped by the tool's
9
+ * full 290 s budget. The step was also unnecessary. Nothing in the tool distinguished that program
10
+ * — a local text transform that either finishes at once or is stuck — from a build that is genuinely
11
+ * slow, so it was given a build's budget and a build's advice ("run it in the background"), which
12
+ * only turns a hang into a longer hang.
13
+ *
14
+ * So an inline interpreter program with no network, install, test-runner, build or server verb gets
15
+ * a short budget ({@link INLINE_SCRIPT_BUDGET_MS}), and a cut says what happened: a runaway
16
+ * transform, not slow work ({@link inlineScriptRunawaySentence}).
17
+ *
18
+ * @module
19
+ */
20
+ import { commandSegments } from './command-position.js';
21
+ import { startsServerProgram } from './server-command.js';
22
+ import { isSuiteRunCommand } from './utilities.js';
23
+ /**
24
+ * How long an inline interpreter program that only reads and writes local files may run.
25
+ *
26
+ * Such work finishes in milliseconds; if it has not finished in twenty seconds it never will
27
+ * (a backtracking regex on a large file, a loop waiting on something that is not coming), so this
28
+ * is a runaway detector, not a performance budget.
29
+ */
30
+ export const INLINE_SCRIPT_BUDGET_MS = 20_000;
31
+ /** The interpreters a model writes an inline program in. */
32
+ const INLINE_INTERPRETERS = new Set([
33
+ 'python',
34
+ 'node',
35
+ 'nodejs',
36
+ 'perl',
37
+ 'ruby',
38
+ 'php',
39
+ ]);
40
+ /** `python3`, `python3.12`, `python` — every spelling of the same interpreter in command position. */
41
+ const PYTHON = /^python(?:3(?:\.\d+)?)?$/;
42
+ /**
43
+ * A flag that makes the interpreter read its PROGRAM from the command line (or stdin) instead of a
44
+ * script file: `-c`, `-e`, `--eval`, `--print`.
45
+ */
46
+ const INLINE_FLAG = /^(?:-[A-Za-z]*[ce]|--(?:eval|print)(?:=|$))/;
47
+ /** A heredoc operator whose delimiter follows it: `<<'EOF'`, `<<EOF`, `<<-EOF`. Not a here-string. */
48
+ const HEREDOC = /^<<-?\s*['"]?[A-Za-z_]/;
49
+ /**
50
+ * Effects that make an inline program something OTHER than a local text transform, so it keeps the
51
+ * tool's full budget: the network, an install, a test runner, a build, a container. Matched against
52
+ * the whole command, heredoc body included — a `urllib` import inside the program is exactly the
53
+ * case this list exists for.
54
+ *
55
+ * Every listed word is a false NEGATIVE when it appears in a comment or a string (the program keeps
56
+ * the long budget and the old advice). That is the safe direction: this list must never shrink the
57
+ * budget of a command that reaches outside the box.
58
+ */
59
+ const EXTERNAL_EFFECT = /\b(?:curl|wget|aria2c|rsync|scp|sftp|ftp|ssh|urllib3?|httpx|aiohttp|axios|requests|fetch|XMLHttpRequest|socket|net\.connect|https?:\/\/|npm|npx|pnpm|yarn|bun|pip3?|conda|cargo|gem|composer|playwright|vitest|jest|hurl|vite|tsc|webpack|esbuild|rollup|docker|cmake|gradle|mvn|make|subprocess|Popen|child_process|execSync|spawnSync|git|psql|mysql|mongosh?|redis-cli|sqlite3)\b|\bos\.system\b|\b(?:http\.server|flask|fastapi|uvicorn|gunicorn)\b/i;
60
+ /**
61
+ * Whether one parsed statement runs an interpreter program written inline.
62
+ *
63
+ * The heredoc body is already blanked by the parser, so `python3 - <<'EOF'` reads as the program
64
+ * `python3` with the arguments `-` and `<<'EOF'` — the two shapes a program on stdin is written in.
65
+ *
66
+ * @param segment - One statement of the command.
67
+ * @returns The interpreter's name when the statement is an inline program, otherwise null.
68
+ */
69
+ function inlineProgram(segment) {
70
+ const name = segment.program.replace(/^.*\//, '');
71
+ if (!PYTHON.test(name) && !INLINE_INTERPRETERS.has(name))
72
+ return null;
73
+ const args = segment.args.map((arg) => arg.replace(/^(["'])(.*)\1$/, '$2'));
74
+ const inline = args.some((arg) => arg === '-' || HEREDOC.test(arg) || INLINE_FLAG.test(arg));
75
+ return inline ? name : null;
76
+ }
77
+ /**
78
+ * The interpreter of an INLINE program that only reads and writes local files — the shape that gets
79
+ * {@link INLINE_SCRIPT_BUDGET_MS} instead of the tool's command budget.
80
+ *
81
+ * An inline program with any external effect keeps the full budget: no network, install, test
82
+ * runner, build or server verb may appear anywhere in the command ({@link EXTERNAL_EFFECT}), and
83
+ * the command must not be a suite run or a foreground server (the platform's own classifiers).
84
+ *
85
+ * @param command - The command as the executor sent it.
86
+ * @returns The interpreter's name (`python3`, `node`, …), or null when this is not the shape.
87
+ */
88
+ export function inlineLocalScriptCommand(command) {
89
+ if (typeof command !== 'string' || !command.trim())
90
+ return null;
91
+ if (EXTERNAL_EFFECT.test(command))
92
+ return null;
93
+ if (isSuiteRunCommand(command) || startsServerProgram(command))
94
+ return null;
95
+ for (const segment of commandSegments(command)) {
96
+ const interpreter = inlineProgram(segment);
97
+ if (interpreter !== null)
98
+ return interpreter;
99
+ }
100
+ return null;
101
+ }
102
+ /**
103
+ * What a cut inline program's result says instead of the background advice: the work never was
104
+ * slow, it is stuck, and re-running it — here or in the background — cannot help.
105
+ *
106
+ * @param interpreter - The interpreter the program ran under (`python3`, `node`, …).
107
+ * @param seconds - The short budget it was stopped at, in seconds.
108
+ * @returns The sentence the result carries.
109
+ */
110
+ export function inlineScriptRunawaySentence(interpreter, seconds) {
111
+ return (`${interpreter} ran ${seconds} s without finishing on a local text transform — that is a ` +
112
+ 'runaway (e.g. regex backtracking on a large file), not slow work; do not move it to the ' +
113
+ 'background. Rewrite the transform (a non-backtracking pattern, or a plain string split), ' +
114
+ 'or check whether the step is needed at all.');
115
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,UAAU,CAAA;CACvB;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CA2U1C,CAAA"}
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,UAAU,CAAA;CACvB;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CA8U1C,CAAA"}
package/dist/schemas.js CHANGED
@@ -28,6 +28,9 @@ export const TOOL_SCHEMAS = {
28
28
  'file before editing it. When you need more than one file — surveying a project, ' +
29
29
  'gathering the files behind one feature — pass them all as `paths` in ONE call rather ' +
30
30
  'than calling this tool once per file: same content, a fraction of the time. ' +
31
+ 'Independent calls go in ONE response: read every file you need together (one `paths` ' +
32
+ 'call, or several `read_file` calls in the same response) — they run at once. Only a call ' +
33
+ 'that needs another call’s result waits for it. ' +
31
34
  'For a @molecule package\u2019s docs call read_molecule_doc instead — one call, the whole ' +
32
35
  'document. A file that fits one read result comes back whole; do not page through it with ' +
33
36
  'offset/limit.',
@@ -64,7 +67,7 @@ export const TOOL_SCHEMAS = {
64
67
  },
65
68
  write_file: {
66
69
  name: 'write_file',
67
- description: "Create or overwrite a file with full content. Use edit_file for small targeted changes instead. The result gives the file's line count (and a small file's numbered lines).",
70
+ description: "Create or overwrite a file with full content. Use edit_file for small targeted changes instead. The result gives the file's line count (and a small file's numbered lines). Independent calls go in ONE response: write every file you already know the content of together — one write_file call per file, different paths, in the same response — instead of one file per round trip. Only a call that needs another call's result waits for it.",
68
71
  parameters: {
69
72
  type: 'object',
70
73
  properties: {
@@ -82,7 +85,7 @@ export const TOOL_SCHEMAS = {
82
85
  },
83
86
  edit_file: {
84
87
  name: 'edit_file',
85
- description: 'Make targeted search-and-replace edits to a file. Preferred over write_file for small changes. Each old_string must match exactly once in the file, unless that replacement sets replace_all to change every occurrence (a rename, a repeated call). The result shows each edited region as it now reads, with line numbers, so there is no need to re-read the file to check an edit.',
88
+ description: 'Make targeted search-and-replace edits to a file. Preferred over write_file for small changes. Each old_string must match exactly once in the file, unless that replacement sets replace_all to change every occurrence (a rename, a repeated call). The result shows each edited region as it now reads, with line numbers, so there is no need to re-read the file to check an edit. Independent calls go in ONE response: edits to different files you already know how to make go together in the same response, one edit_file call per file. Only a call that needs another call’s result waits for it.',
86
89
  parameters: {
87
90
  type: 'object',
88
91
  properties: {
@@ -147,13 +150,13 @@ export const TOOL_SCHEMAS = {
147
150
  },
148
151
  find_files: {
149
152
  name: 'find_files',
150
- description: "Find files by name or glob pattern recursively. Excludes node_modules and .git. Use for discovering files by name (e.g. '*.tsx', 'Dashboard*', 'index.*'). A pattern containing '/' matches the path instead: 'e2e/*.spec.ts', 'src/**/App.tsx', '**/SELECTORS.md'.",
153
+ description: "Find files by name or glob pattern recursively. Excludes node_modules and .git. Use for discovering files by name (e.g. '*.tsx', 'Dashboard*', 'index.*'). A pattern containing '/' matches the path instead: 'e2e/*.spec.ts', 'src/**/App.tsx', '**/SELECTORS.md'. Several extensions go in one brace group: '*.{ts,tsx}'.",
151
154
  parameters: {
152
155
  type: 'object',
153
156
  properties: {
154
157
  pattern: {
155
158
  type: 'string',
156
- description: "File name or glob pattern (e.g. '*.tsx', 'Dashboard*'). A pattern containing '/' is matched against the file's path, so 'src/**/App.tsx' and 'e2e/*.spec.ts' work.",
159
+ description: "File name or glob pattern (e.g. '*.tsx', 'Dashboard*'). A pattern containing '/' is matched against the file's path, so 'src/**/App.tsx' and 'e2e/*.spec.ts' work. Several extensions go in one brace group of comma-separated alternatives: '*.{ts,tsx,yml}' (up to 16).",
157
160
  },
158
161
  path: {
159
162
  type: 'string',
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AA4K9C;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAahG;AA6ZD,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAsHnE;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAEA,CAAA;AAE9B;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,wBAAwB,QAI6C,CAAA;AA2ElF;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAUhE;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,qBAAqB;IACpC,iFAAiF;IACjF,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,8FAA8F;IAC9F,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;CAC5B;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAA;AAoBpF;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IAAE,MAAM,CAA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BAAqB,CAAC,CAAA;AAoBpF;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,CAAC,GACxE,qBAAqB,CAkBvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,qBAAqB,GAC5B,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAiCxB;AA2GD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,CAAC,EAAE,eAAe,GAAG,MAAM,EAAE,CA40FxF"}
package/dist/tools.js CHANGED
@@ -9,6 +9,7 @@
9
9
  import { posix } from 'path';
10
10
  import { commandCutRun, CUT_AT_BUDGET, cutRunSentence, suiteRunExitCode, suiteSummary, } from './cut-run.js';
11
11
  import { addChangeSpan, changedSpan, countLines, renderEditExcerpt, renderSmallFile, } from './edit-excerpt.js';
12
+ import { INLINE_SCRIPT_BUDGET_MS, inlineLocalScriptCommand, inlineScriptRunawaySentence, } from './inline-script.js';
12
13
  import { guardToolExecute, missingParamError, ToolInputError } from './input-normalizer.js';
13
14
  import { diffLineCount } from './line-diff.js';
14
15
  import { pipelineExitCodeNote } from './pipeline-exit-note.js';
@@ -54,6 +55,49 @@ const inlineFailuresByTask = new Set();
54
55
  * resolves the failing test's `file:line` against the wrong suite.
55
56
  */
56
57
  const runByTask = new Map();
58
+ /**
59
+ * The background task ids each backend launched. Every map above is keyed by task id alone and is
60
+ * shared by every project this process serves, so a task is only ever read as THIS project's when
61
+ * this backend started it or its files are in this project's sandbox ({@link ownedTaskIds}).
62
+ * Without that, a sleep in one project was held for a walk running in another's sandbox, and its
63
+ * note carried that project's command (xr-molecule-flash-m208 +12:00, waiting on m207's walk).
64
+ */
65
+ const launchedByBackend = new WeakMap();
66
+ /** A task id this tool minted — the only shape a /tmp path is ever built from. */
67
+ const TASK_ID = /^mol-bg-[a-z0-9]+-[a-z0-9]+$/;
68
+ /**
69
+ * Which of `ids` are this project's tasks: launched through this backend, or with the files a
70
+ * launch writes (`/tmp/<id>.sh`, `.log`, `.pid`) present in this backend's sandbox — the second
71
+ * answer survives an API restart, which empties process memory but not the sandbox.
72
+ *
73
+ * @param backend - The project's execution backend.
74
+ * @param ids - Candidate task ids.
75
+ * @returns The owned subset, or null when none is known to be owned and the sandbox could not answer.
76
+ */
77
+ async function ownedTaskIds(backend, ids) {
78
+ const launched = launchedByBackend.get(backend);
79
+ const owned = new Set(ids.filter((id) => launched?.has(id)));
80
+ const rest = [...new Set(ids)].filter((id) => !owned.has(id) && TASK_ID.test(id));
81
+ if (!rest.length)
82
+ return owned;
83
+ let stdout;
84
+ try {
85
+ const r = await backend.run(`for i in ${rest.join(' ')}; do ` +
86
+ `{ [ -e /tmp/$i.sh ] || [ -e /tmp/$i.log ] || [ -e /tmp/$i.pid ]; } && echo "MOL_OWN_TASK $i"; ` +
87
+ `done; echo MOL_OWN_TASKS_END`, { timeout: 5_000 });
88
+ stdout = String(r.stdout ?? '');
89
+ }
90
+ catch (_error) {
91
+ // The sandbox did not answer: only what this backend launched is known to be its own.
92
+ return owned.size ? owned : null;
93
+ }
94
+ if (!stdout.includes('MOL_OWN_TASKS_END'))
95
+ return owned.size ? owned : null;
96
+ for (const m of stdout.matchAll(/^MOL_OWN_TASK (\S+)$/gm))
97
+ if (rest.includes(m[1]))
98
+ owned.add(m[1]);
99
+ return owned;
100
+ }
57
101
  /**
58
102
  * Why a finished suite run's result carries no exit code: the code a pipeline reports is its last
59
103
  * stage's, and a stage after the runner (or a code of 0 beside a failure in the tally) is not the
@@ -461,9 +505,15 @@ function runningNote(clauses) {
461
505
  * caller attaches as `outputSoFar`; null when no task answers this command.
462
506
  */
463
507
  async function backgroundTaskState(backend, command, seconds, ceilingMs) {
464
- const ids = [...runByTask.keys()];
465
- if (!ids.length)
508
+ // Only this project's tasks: the registry holds every project's, newest last. Bounded, because
509
+ // each candidate is one test in the ownership probe.
510
+ const recent = [...runByTask.keys()].slice(-64);
511
+ if (!recent.length)
512
+ return null;
513
+ const owned = await ownedTaskIds(backend, recent);
514
+ if (!owned?.size)
466
515
  return null;
516
+ const ids = recent.filter((id) => owned.has(id));
467
517
  const exitCodeOf = async (id) => {
468
518
  try {
469
519
  const raw = await backend.readFile(`/tmp/${id}.exit`);
@@ -548,12 +598,18 @@ async function backgroundTaskState(backend, command, seconds, ceilingMs) {
548
598
  }
549
599
  import { suiteCommandTarget } from './suite-overlap.js';
550
600
  import { diagnosisTraceCommand } from './trace-artifacts.js';
551
- import { checkBlockedCommand, declaredBudgetSeconds, DEFAULT_SEARCH_EXCLUDED_DIRS, directoryReadHint, earlyReturnCause, emptyCallError, failureCausesNote, findPathArgs, findPatternArgs, fusedLine, htmlOutline, isCommandTimeout, isEnvFilePath, isOutsideRoot, isPlaywrightRunCommand, isSuiteRunCommand, isValidGlob, linesWithinSerialized, literalDirPrefix, logShowsInlineFailureBodies, 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, repeatedSuiteRunError, repeatingFailure, repeatingFailureNote, resolvePath, RUNNING_FAILURE_LINES, runningCauseCommand, runningOutputSliceCommand, searchTimeoutError, serializedChars, shellQuote, sliceLines, SMALL_FILE_WHOLE_CHARS, streamingBackgroundCommand, stripControlChars, suiteRunBudgetCommand, suiteRunConfigCommand, suiteRunPipelinePlacement, suiteRunPriorityLaunch, TOOL_RESULT_CHARS, truncateMiddle, universalCause, whitespaceTolerantReplace, withoutSuiteTimeout, } from './utilities.js';
601
+ import { BRACE_GLOB_HINT, checkBlockedCommand, declaredBudgetSeconds, DEFAULT_SEARCH_EXCLUDED_DIRS, directoryReadHint, earlyReturnCause, emptyCallError, expandBraceGlob, failureCausesNote, findPathArgs, findPatternArgs, fusedLine, htmlOutline, isCommandTimeout, isEnvFilePath, isOutsideRoot, isPlaywrightRunCommand, isSuiteRunCommand, linesWithinSerialized, literalDirPrefix, logShowsInlineFailureBodies, 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, repeatedSuiteRunError, repeatingFailure, repeatingFailureNote, resolvePath, RUNNING_FAILURE_LINES, runningCauseCommand, runningOutputSliceCommand, searchTimeoutError, serializedChars, shellQuote, sliceLines, SMALL_FILE_WHOLE_CHARS, streamingBackgroundCommand, stripControlChars, suiteRunBudgetCommand, suiteRunConfigCommand, suiteRunPipelinePlacement, suiteRunPriorityLaunch, TOOL_RESULT_CHARS, truncateMiddle, universalCause, whitespaceTolerantReplace, withoutSuiteTimeout, } from './utilities.js';
552
602
  /**
553
603
  * How long exec_command waits for a command it backgrounded only because the
554
604
  * command asked for more than the tool's ceiling, before handing back a task id.
555
605
  */
556
606
  const OVER_CEILING_GRACE_MS = 45_000;
607
+ /**
608
+ * How close to this tool's ceiling an executor-written bound has to be before it is read as the
609
+ * ceiling written down rather than a budget for the walk: `timeout 290` beside a 290 s ceiling.
610
+ * The slack covers the rounding an executor does (`timeout 300` for a 290 s budget).
611
+ */
612
+ const CEILING_FITTED_SLACK_SECONDS = 30;
557
613
  /**
558
614
  * The machine-readable mark on a result whose run carried the supplied suite's own settings
559
615
  * ({@link ToolBuildConfig.suiteBudget}) — the flags and derived config actually written, every
@@ -615,61 +671,40 @@ export const SUITE_OVER_BUDGET_ADVICE = 'A test suite is not a bigger unit to sp
615
671
  */
616
672
  const SEARCH_TIMEOUT_MS = 10_000;
617
673
  /**
618
- * The most alternatives one brace group in a `search_files` include may expand
619
- * to. The point is to accept the ordinary multi-extension form a model writes
620
- * from habit (`*.{ts,tsx,yml,json,md}`), not to grow a glob engine: a group is
621
- * bounded so a pattern cannot turn one grep call into hundreds.
674
+ * The include-glob error. It keeps the original character-rule sentence and
675
+ * names the accepted multi-extension form, so a refusal teaches the syntax
676
+ * rather than only reporting that the value was wrong.
677
+ */
678
+ const INCLUDE_GLOB_ERROR = 'Invalid include glob pattern. Allowed: alphanumeric and @ * ? . _ - / [ ] ( ), ' +
679
+ BRACE_GLOB_HINT;
680
+ /**
681
+ * The `find_files` pattern error. Same shape as {@link INCLUDE_GLOB_ERROR} —
682
+ * the brace sentence is shared, so a brace refusal reads the same in both
683
+ * search tools — with the route-directory note this tool has always carried.
622
684
  */
623
- const MAX_INCLUDE_BRACE_ALTERNATIVES = 16;
685
+ const FIND_PATTERN_ERROR = 'Invalid pattern. Allowed: alphanumeric and @ * ? . _ - / [ ] ( ) ' +
686
+ '(brackets/parens support Next.js route dirs like [id] or (group)), ' +
687
+ BRACE_GLOB_HINT;
624
688
  /**
625
- * Expand ONE level of brace alternatives in a `search_files` include pattern,
626
- * validating every expanded pattern.
627
- *
628
- * `grep --include` has no brace expansion of its own (the shell that would do it
629
- * is never involved — the pattern is `shellQuote`d first), so the group has to
630
- * be expanded here and each alternative passed as its own `--include`. The
631
- * m189 run wrote the everyday `*.{ts,tsx,yml,json,md}` and the search was
632
- * refused outright, costing a round trip and pushing the agent to a narrower
633
- * search.
689
+ * The `find` predicate for one or more expanded patterns, ORed inside parens
690
+ * when a brace group expanded to more than one.
634
691
  *
635
- * Bounded on purpose: one level of braces, alternatives split on `,`, at most
636
- * {@link MAX_INCLUDE_BRACE_ALTERNATIVES}, none empty, and each EXPANDED
637
- * pattern must still pass {@link isValidGlob} — so a shell metacharacter in any
638
- * alternative (`*.{ts,$(rm)}`) is refused exactly as a bare one is.
639
- *
640
- * @param pattern - The user-supplied `include` value.
641
- * @returns Every pattern to pass to grep, or null when the value is not
642
- * accepted (the caller reports the include-glob error).
692
+ * @param patterns - Patterns, each already accepted by the glob character rule.
693
+ * @returns A predicate list for `find`.
643
694
  */
644
- function expandIncludeGlob(pattern) {
645
- const open = pattern.indexOf('{');
646
- if (open === -1)
647
- return isValidGlob(pattern) ? [pattern] : null;
648
- const close = pattern.indexOf('}', open + 1);
649
- if (close === -1)
650
- return null;
651
- // One level only: a second `{` before the close or a second `}` after it is a
652
- // nested/malformed group, not an alternative.
653
- const nextOpen = pattern.indexOf('{', open + 1);
654
- if (nextOpen !== -1 && nextOpen < close)
655
- return null;
656
- if (pattern.indexOf('}', close + 1) !== -1)
657
- return null;
658
- const alternatives = pattern.slice(open + 1, close).split(',');
659
- if (alternatives.length > MAX_INCLUDE_BRACE_ALTERNATIVES)
660
- return null;
661
- if (alternatives.some((alt) => alt.length === 0))
662
- return null;
663
- const expanded = alternatives.map((alt) => `${pattern.slice(0, open)}${alt}${pattern.slice(close + 1)}`);
664
- return expanded.every((p) => isValidGlob(p)) ? expanded : null;
695
+ function findArgsForPatterns(patterns) {
696
+ return joinFindArgs(patterns.map((p) => findPatternArgs(p)));
665
697
  }
666
698
  /**
667
- * The include-glob error. It keeps the original character-rule sentence and
668
- * names the accepted multi-extension form, so a refusal teaches the syntax
669
- * rather than only reporting that the value was wrong.
699
+ * Join `find` predicates into one, parenthesising an OR when a brace group
700
+ * expanded to more than one alternative.
701
+ *
702
+ * @param args - One predicate expansion per alternative.
703
+ * @returns The predicate text.
670
704
  */
671
- const INCLUDE_GLOB_ERROR = 'Invalid include glob pattern. Allowed: alphanumeric and @ * ? . _ - / [ ] ( ), ' +
672
- 'or one brace group of up to 16 comma-separated alternatives such as *.{ts,tsx}.';
705
+ function joinFindArgs(args) {
706
+ return args.length === 1 ? args[0] : `\\( ${args.join(' -o ')} \\)`;
707
+ }
673
708
  /**
674
709
  * The share of its budget a command must use before the "you asked for more than
675
710
  * this tool's ceiling" note is worth attaching. Below it the clamp changed nothing
@@ -915,7 +950,7 @@ function packageCatalog(path) {
915
950
  * @returns Array of AITool objects ready to pass to an AI provider
916
951
  */
917
952
  export function buildTools(backend, config) {
918
- const { include, exclude, pathGuards = true, symlinkGuards = false, redactSecrets: doRedact = true, blockDangerousCommands = false, blockCommand, execTimeoutMs = 120_000, commandBudgetMs, overCeilingGraceMs = OVER_CEILING_GRACE_MS, searchExcludedDirs, outlineLargeHtml, excludedTestTitles, requiredSuiteEnv, onAfterWrite, onFileDiff, onFileChange, } = config ?? {};
953
+ const { include, exclude, pathGuards = true, symlinkGuards = false, redactSecrets: doRedact = true, blockDangerousCommands = false, blockCommand, execTimeoutMs = 120_000, commandBudgetMs, overCeilingGraceMs = OVER_CEILING_GRACE_MS, searchExcludedDirs, outlineLargeHtml, excludedTestTitles, requiredSuiteEnv, suiteRunMs, onAfterWrite, onFileDiff, onFileChange, } = config ?? {};
919
954
  const root = backend.projectRoot;
920
955
  // A host-filesystem backend with escape guards off is the combination the
921
956
  // audit flagged: `pathGuards` off lets `..` paths out of the workspace,
@@ -2262,7 +2297,7 @@ export function buildTools(backend, config) {
2262
2297
  : 0;
2263
2298
  // `--include` has no brace expansion inside the quoted grep argument, so
2264
2299
  // a brace group is expanded here and grep gets one --include per pattern.
2265
- const includes = include ? expandIncludeGlob(include) : [];
2300
+ const includes = include ? expandBraceGlob(include) : [];
2266
2301
  if (includes === null)
2267
2302
  return { error: INCLUDE_GLOB_ERROR };
2268
2303
  const symlinkErr = await checkSymlink(path);
@@ -2339,11 +2374,12 @@ export function buildTools(backend, config) {
2339
2374
  return {
2340
2375
  error: 'find_files requires a non-empty "pattern" argument (a filename or glob, e.g. "*.tsx" or "index.ts").',
2341
2376
  };
2342
- if (!isValidGlob(pattern))
2343
- return {
2344
- error: 'Invalid pattern. Allowed: alphanumeric and @ * ? . _ - / [ ] ( ) ' +
2345
- '(brackets/parens support Next.js route dirs like [id] or (group)).',
2346
- };
2377
+ // `find` has no brace expansion either — the pattern is shell-quoted
2378
+ // before it reaches it — so `*.{ts,tsx}` expands here into one predicate
2379
+ // per alternative (xr-molecule-flash-m199).
2380
+ const patterns = expandBraceGlob(pattern);
2381
+ if (patterns === null)
2382
+ return { error: FIND_PATTERN_ERROR };
2347
2383
  const symlinkErr = await checkSymlink(path);
2348
2384
  if (symlinkErr)
2349
2385
  return { error: symlinkErr };
@@ -2355,9 +2391,12 @@ export function buildTools(backend, config) {
2355
2391
  // the model meant answered a `list_files` instantly (xr-molecule-flash-m94).
2356
2392
  // A bare first segment (`helpers/*`) is left alone on purpose: it means "any
2357
2393
  // `helpers/` below the root" (xr-molecule-flash-m77, see literalDirPrefix).
2358
- const prefixDir = literalDirPrefix(pattern);
2394
+ // Brace alternatives may each name a directory (`{src/a,src/b}/*.ts`),
2395
+ // so a narrowing prefix is used only when every expansion agrees on it.
2396
+ const prefixes = patterns.map((p) => literalDirPrefix(p));
2397
+ const prefixDir = prefixes.every((p) => p === prefixes[0]) ? prefixes[0] : null;
2359
2398
  let findRoot = path;
2360
- let findArgs = findPatternArgs(pattern);
2399
+ let findArgs = findArgsForPatterns(patterns);
2361
2400
  let missingPrefix;
2362
2401
  try {
2363
2402
  if (prefixDir) {
@@ -2369,7 +2408,7 @@ export function buildTools(backend, config) {
2369
2408
  findRoot = candidate;
2370
2409
  // The remainder keeps the `-path` form: `*` crosses `/`, so a `.d.ts`
2371
2410
  // in `dist/utilities/` is still found (see findPathArgs).
2372
- findArgs = findPathArgs(pattern.replace(/^(?:\.?\/)+/, '').slice(prefixDir.length + 1));
2411
+ findArgs = joinFindArgs(patterns.map((p) => findPathArgs(p.replace(/^(?:\.?\/)+/, '').slice(prefixDir.length + 1))));
2373
2412
  }
2374
2413
  else {
2375
2414
  missingPrefix = `"${candidate}" does not exist; searched all of ${path}.`;
@@ -2624,10 +2663,44 @@ export function buildTools(backend, config) {
2624
2663
  // this tool's ceiling — and in the background the ceiling no longer applies, so the
2625
2664
  // `timeout N` the executor wrote to fit it is the only bound left, and it kills the
2626
2665
  // walk mid-run with no tally (X1 xr-molecule-flash-m143 +24:45). Lift it from the
2627
- // statement that runs the suite. A run the EXECUTOR detached keeps the bound it chose.
2628
- const lifted = overCeiling && input.run_in_background !== true
2629
- ? withoutSuiteTimeout(command)
2630
- : { command, seconds: null };
2666
+ // statement that runs the suite.
2667
+ //
2668
+ // A run the EXECUTOR detached itself is lifted too when its bound is not a bound for
2669
+ // the walk: a number no larger than this tool's ceiling is the ceiling written down
2670
+ // (`timeout 290` beside a 290 s ceiling), and a number shorter than the whole walk the
2671
+ // consumer measured kills it just the same (xr-molecule-flash-m200: a deployed walk
2672
+ // killed at test 103 of 138 by `timeout 290` beside a 290 s ceiling). A bound that is a
2673
+ // real budget for the walk is kept (`timeout 900`).
2674
+ let wholeRunMs = null;
2675
+ let lifted = { command, seconds: null };
2676
+ if (overCeiling && input.run_in_background !== true) {
2677
+ lifted = withoutSuiteTimeout(command);
2678
+ }
2679
+ else if (input.run_in_background === true && isSuiteRunCommand(command)) {
2680
+ const candidate = withoutSuiteTimeout(command);
2681
+ if (candidate.seconds !== null && candidate.seconds > 0) {
2682
+ let measured = null;
2683
+ try {
2684
+ measured = (await suiteRunMs?.(command, cwd)) ?? null;
2685
+ }
2686
+ catch (_error) {
2687
+ // A consumer's reading that fails changes nothing: the ceiling rule still runs.
2688
+ measured = null;
2689
+ }
2690
+ const fitsCeiling = ceilingSeconds > 0 &&
2691
+ candidate.seconds <= ceilingSeconds + CEILING_FITTED_SLACK_SECONDS;
2692
+ const shorterThanWalk = measured !== null &&
2693
+ Number.isFinite(measured) &&
2694
+ measured > 0 &&
2695
+ candidate.seconds * 1000 < measured;
2696
+ if (fitsCeiling || shorterThanWalk) {
2697
+ lifted = candidate;
2698
+ // The duration is named only when it is what justifies the lift: a measured walk
2699
+ // shorter than the bound says nothing about why a ceiling-sized bound goes.
2700
+ wholeRunMs = shorterThanWalk ? measured : null;
2701
+ }
2702
+ }
2703
+ }
2631
2704
  if (lifted.seconds !== null)
2632
2705
  command = lifted.command;
2633
2706
  // Keep the log growing while it runs (see streamingBackgroundCommand):
@@ -2649,9 +2722,13 @@ export function buildTools(backend, config) {
2649
2722
  streaming.changes.unshift(traced.change);
2650
2723
  // Said once, in the result that also hands back the task id or the run's output.
2651
2724
  if (lifted.seconds !== null) {
2652
- streaming.changes.unshift(`Dropped your \`timeout ${lifted.seconds}\` from the suite run: in the background it ` +
2653
- 'is bounded by `wait_for_task` and the turn’s deadline, not by this tool’s ' +
2654
- 'ceiling, so the bound you wrote would only have killed the walk.');
2725
+ streaming.changes.unshift(wholeRunMs !== null
2726
+ ? `Dropped your \`timeout ${lifted.seconds}\` from the suite run: a whole walk takes ` +
2727
+ `~${durationText(wholeRunMs)} and runs in the background, where it is bounded by ` +
2728
+ '`wait_for_task` and the turn’s deadline — the bound would only have killed the walk.'
2729
+ : `Dropped your \`timeout ${lifted.seconds}\` from the suite run: in the background it ` +
2730
+ 'is bounded by `wait_for_task` and the turn’s deadline, not by this tool’s ' +
2731
+ 'ceiling, so the bound you wrote would only have killed the walk.');
2655
2732
  }
2656
2733
  // A whole-suite run starves the sandbox it shares with the app and with
2657
2734
  // every command the executor sends next, so it starts at lower CPU and
@@ -2670,6 +2747,9 @@ export function buildTools(backend, config) {
2670
2747
  // given it, so the command says nothing about what the log will carry. A wait reads the
2671
2748
  // log itself (see inlineFailuresByTask).
2672
2749
  runByTask.set(id, { command: streaming.command, cwd });
2750
+ const launched = launchedByBackend.get(backend) ?? new Set();
2751
+ launched.add(id);
2752
+ launchedByBackend.set(backend, launched);
2673
2753
  await backend.writeFile(script, `${streaming.command}\n`);
2674
2754
  // The clock the grace return below reports a stopped run against: the command is
2675
2755
  // started here, and how long it ran is what a stop at its own bound is read from.
@@ -2808,7 +2888,16 @@ export function buildTools(backend, config) {
2808
2888
  // overrun is stopped there, the whole process group, and everything
2809
2889
  // printed until then comes back with exit code 124 — instead of an outer
2810
2890
  // timeout discarding the run and its output together.
2811
- const budgetSeconds = commandBudgetMs ? Math.max(1, Math.round(commandBudgetMs / 1000)) : 0;
2891
+ // An inline interpreter program that only reads and writes local files (a `python3`
2892
+ // heredoc, `node -e`) finishes in milliseconds or never ends — xr-molecule-flash-m200
2893
+ // (+03:45) burned 291 s on a backtracking `re.findall` over a minified CSS file, then was
2894
+ // told to "run it in the background", which only moves the hang. It gets a short budget
2895
+ // instead of the build budget, and a cut says what it is (inline-script.ts).
2896
+ const inlineScript = inlineLocalScriptCommand(command);
2897
+ const toolCeilingMs = inlineScript === null
2898
+ ? commandBudgetMs
2899
+ : Math.min(commandBudgetMs ?? INLINE_SCRIPT_BUDGET_MS, INLINE_SCRIPT_BUDGET_MS);
2900
+ const budgetSeconds = toolCeilingMs ? Math.max(1, Math.round(toolCeilingMs / 1000)) : 0;
2812
2901
  // A requested budget is honored DOWNWARD only. The model used to send
2813
2902
  // `timeout: 900000` for a test suite, the field was not declared so it
2814
2903
  // was silently dropped, and the command was killed at the ceiling with
@@ -2816,10 +2905,13 @@ export function buildTools(backend, config) {
2816
2905
  // before the overrun message could teach anything (X0 R83/R84). Now the
2817
2906
  // ceiling is reported the FIRST time a larger one is asked for.
2818
2907
  const requestedMs = Number(input.timeout);
2819
- const wantsMore = Number.isFinite(requestedMs) && requestedMs > 0 && requestedMs > (commandBudgetMs ?? 0);
2820
- const effectiveBudgetMs = Number.isFinite(requestedMs) && requestedMs > 0 && commandBudgetMs
2821
- ? Math.min(requestedMs, commandBudgetMs)
2822
- : commandBudgetMs;
2908
+ const wantsMore = inlineScript === null &&
2909
+ Number.isFinite(requestedMs) &&
2910
+ requestedMs > 0 &&
2911
+ requestedMs > (toolCeilingMs ?? 0);
2912
+ const effectiveBudgetMs = Number.isFinite(requestedMs) && requestedMs > 0 && toolCeilingMs
2913
+ ? Math.min(requestedMs, toolCeilingMs)
2914
+ : toolCeilingMs;
2823
2915
  const startedAt = Date.now();
2824
2916
  const result = await backend.run(command, {
2825
2917
  cwd,
@@ -2883,11 +2975,13 @@ export function buildTools(backend, config) {
2883
2975
  ? ' — and a pipe through tail/head holds everything back until the command ends, so it printed nothing: run it without the pipe (use a line reporter and let the output stream)'
2884
2976
  : ''}. `
2885
2977
  : '') +
2886
- (startsServerProgram(command)
2887
- ? SERVER_OVER_BUDGET_ADVICE
2888
- : isSuiteRunCommand(command)
2889
- ? SUITE_OVER_BUDGET_ADVICE
2890
- : SPLIT_WORK_ADVICE),
2978
+ (inlineScript !== null
2979
+ ? inlineScriptRunawaySentence(inlineScript, cut.seconds)
2980
+ : startsServerProgram(command)
2981
+ ? SERVER_OVER_BUDGET_ADVICE
2982
+ : isSuiteRunCommand(command)
2983
+ ? SUITE_OVER_BUDGET_ADVICE
2984
+ : SPLIT_WORK_ADVICE),
2891
2985
  };
2892
2986
  }
2893
2987
  // A pipeline reports its LAST stage's code: `tsc | head` says 0 beside a printed type
@@ -2969,6 +3063,26 @@ export function buildTools(backend, config) {
2969
3063
  // server-side costs no round trip and no context.
2970
3064
  async wait_for_task(input) {
2971
3065
  const taskId = typeof input.taskId === 'string' ? input.taskId.trim() : '';
3066
+ // An id another project launched is not this project's to wait on — its files are in that
3067
+ // project's sandbox, so a wait here would poll for an exit file that never appears, and its
3068
+ // wait time would count against that project's own stuck clock (xr-molecule-flash-m208
3069
+ // +12:00 waited ~5 min on m207's walk). Answered at once, before any per-task state is read.
3070
+ if (TASK_ID.test(taskId)) {
3071
+ const owned = await ownedTaskIds(backend, [taskId]);
3072
+ if (owned && !owned.has(taskId)) {
3073
+ const recent = [...runByTask.keys()].slice(-64);
3074
+ const mine = (await ownedTaskIds(backend, recent)) ?? new Set();
3075
+ const list = recent.filter((id) => mine.has(id)).reverse();
3076
+ return {
3077
+ taskId,
3078
+ status: 'unknown',
3079
+ note: `No background task \`${taskId}\` was started in this project — ` +
3080
+ (list.length
3081
+ ? `the ids this project launched are: ${list.map((id) => `\`${id}\``).join(', ')}.`
3082
+ : 'this project has launched no background task.'),
3083
+ };
3084
+ }
3085
+ }
2972
3086
  // Where a task writes its own output is process memory; the task is not.
2973
3087
  // An API process swapped mid-run (a release, a patch, a crash) leaves the
2974
3088
  // command running in the sandbox with nothing left that remembers the file
@@ -1 +1 @@
1
- {"version":3,"file":"trace-artifacts.d.ts","sourceRoot":"","sources":["../src/trace-artifacts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAKH,iEAAiE;AACjE,MAAM,WAAW,YAAY;IAC3B,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAA;IACd,iGAAiG;IACjG,IAAI,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,oFAAoF;IACpF,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;;;;OAQG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,iFAAiF;IACjF,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAe;IAC9B,yFA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