@molecule/api-ai-tools 1.9.6 → 1.9.8
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 +178 -9
- package/dist/command-position.d.ts +36 -0
- package/dist/command-position.d.ts.map +1 -1
- package/dist/command-position.js +192 -19
- package/dist/cut-run.d.ts +8 -0
- package/dist/cut-run.d.ts.map +1 -1
- package/dist/cut-run.js +20 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/line-diff.d.ts +34 -0
- package/dist/line-diff.d.ts.map +1 -0
- package/dist/line-diff.js +150 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +70 -22
- package/dist/trace-artifacts.d.ts +57 -1
- package/dist/trace-artifacts.d.ts.map +1 -1
- package/dist/trace-artifacts.js +381 -43
- package/dist/utilities.d.ts +55 -5
- package/dist/utilities.d.ts.map +1 -1
- package/dist/utilities.js +150 -15
- package/package.json +1 -1
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-
|
|
6
|
+
Generated: 2026-10-18T02:50:39.697Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/api-ai-tools
|
|
@@ -133,6 +133,18 @@ interface LocatedCommandSegment {
|
|
|
133
133
|
* statements are one pipeline (`|`, never `;`) asks it instead of reading the text between them.
|
|
134
134
|
*/
|
|
135
135
|
separator: string
|
|
136
|
+
/**
|
|
137
|
+
* The separator that ENDED this statement — `&` when the shell backgrounds it (so the process
|
|
138
|
+
* writes its own output, not the command's), '' for the last statement of a command.
|
|
139
|
+
*/
|
|
140
|
+
terminator: string
|
|
141
|
+
/**
|
|
142
|
+
* The file this statement sends its own output to (`> out.log`, `>> log`, `&> run.log`,
|
|
143
|
+
* `| tee file`), or null. Only a redirect written at the command's own level counts: one
|
|
144
|
+
* inside a `( … )` / `{ … }` group writes through that group, and one that feeds a heredoc's
|
|
145
|
+
* file (`cat > cfg.ts <<'EOF'`) is writing a config (X1 flash-m44, flash-m136).
|
|
146
|
+
*/
|
|
147
|
+
redirectTarget: string | null
|
|
136
148
|
}
|
|
137
149
|
```
|
|
138
150
|
|
|
@@ -175,6 +187,14 @@ interface CutRun {
|
|
|
175
187
|
seconds: number
|
|
176
188
|
/** Whether this tool's budget stopped it or the `timeout` the command carried. */
|
|
177
189
|
stoppedBy: CutBy
|
|
190
|
+
/**
|
|
191
|
+
* Whether this was a detached background task, read with no budget of this tool's own
|
|
192
|
+
* ({@link commandCutRun}'s `budgetSeconds` is 0). A background run is bounded by what its own
|
|
193
|
+
* command carries — so a `command-timeout` cut there is that prefix killing the walk, and the
|
|
194
|
+
* executor must be told to drop the prefix, never to start the run in the background it is
|
|
195
|
+
* already in (X1 xr-molecule-flash-m143 +24:45).
|
|
196
|
+
*/
|
|
197
|
+
background: boolean
|
|
178
198
|
/**
|
|
179
199
|
* The exit code the run's own process reported, or null when the code in the result belongs to
|
|
180
200
|
* the pipeline's filter (`… | tail`) rather than to the run — the case that read as success.
|
|
@@ -388,6 +408,16 @@ interface TraceArtifact {
|
|
|
388
408
|
line: number
|
|
389
409
|
/** The requests the page made, the interesting ones first ({@link traceArtifactsScript}). */
|
|
390
410
|
requests: TraceRequest[]
|
|
411
|
+
/**
|
|
412
|
+
* The request the failing step itself sent: the trace's LAST `fetch`/`xhr` in recording order
|
|
413
|
+
* (a click's own call), else its document request. It leads the note's row, because a click that
|
|
414
|
+
* changed nothing is explained by the request the click sent and what came back — xr-molecule-
|
|
415
|
+
* flash-m135's Follow click sent `DELETE /api/profiles/x/follow → 200` (its `following` state was
|
|
416
|
+
* stale) and the note listed only the test's earlier, answered requests.
|
|
417
|
+
*
|
|
418
|
+
* Absent when the trace recorded neither, and on traces read before this field existed.
|
|
419
|
+
*/
|
|
420
|
+
lead?: TraceRequest
|
|
391
421
|
/** The console errors and page errors the page raised. */
|
|
392
422
|
console: string[]
|
|
393
423
|
/**
|
|
@@ -728,6 +758,21 @@ interface UniversalCause {
|
|
|
728
758
|
count: number
|
|
729
759
|
/** The distinct spec files they live in, in the order the log named them. */
|
|
730
760
|
files: string[]
|
|
761
|
+
/**
|
|
762
|
+
* The cause is that the page rendered NOTHING: every failure so far is a wait for an element
|
|
763
|
+
* the page never painted, whatever the selector asked for ({@link emptyPageCause}). One cause
|
|
764
|
+
* is failing every test even though no two failures share an error signature, so the note says
|
|
765
|
+
* so in the page's terms instead of naming one locator as the signature.
|
|
766
|
+
*/
|
|
767
|
+
pageRendersNothing?: true
|
|
768
|
+
/** The page's own uncaught error, when the run printed one. */
|
|
769
|
+
pageError?: string
|
|
770
|
+
/**
|
|
771
|
+
* The distinct failures this cause covers, in log order — the rows a note lists for
|
|
772
|
+
* {@link pageRendersNothing}. Absent for a signature cause, whose rows are the repeating
|
|
773
|
+
* failure's own tests.
|
|
774
|
+
*/
|
|
775
|
+
tests?: FailedTest[]
|
|
731
776
|
}
|
|
732
777
|
```
|
|
733
778
|
|
|
@@ -983,6 +1028,35 @@ function commandTimeoutSeconds(command: string): number | null
|
|
|
983
1028
|
|
|
984
1029
|
**Returns:** The seconds the command allows itself, or null.
|
|
985
1030
|
|
|
1031
|
+
#### `withoutTimeoutWrapper(command, which)`
|
|
1032
|
+
|
|
1033
|
+
The command with the `timeout <N>` wrapper lifted off the statements `which` selects, and the
|
|
1034
|
+
largest bound that was lifted.
|
|
1035
|
+
|
|
1036
|
+
The platform moves a run to the background precisely because its own bound cannot fit this
|
|
1037
|
+
tool's ceiling, and a background task has no ceiling — its wait is bounded by `wait_for_task`
|
|
1038
|
+
and the turn's deadline. The `timeout N` an executor wrote to fit the ceiling therefore keeps
|
|
1039
|
+
killing the run at N in the background, where nothing needed it: X1 xr-molecule-flash-m143
|
|
1040
|
+
(+24:45) wrote `timeout 280` for a 31-test walk, the tool backgrounded it, and the prefix stopped
|
|
1041
|
+
the walk with no tally — then the cut sentence told the executor to "run it in the background",
|
|
1042
|
+
which is where it already was.
|
|
1043
|
+
|
|
1044
|
+
The wrapper is found by the same parse every other command reader uses ({@link commandStart}):
|
|
1045
|
+
`timeout` in an argument bounds nothing, and the wrapper's own flags (`-k`/`--kill-after`,
|
|
1046
|
+
`-s`/`--signal`) are stepped over, so `timeout -k 5 280 …` is `280`.
|
|
1047
|
+
|
|
1048
|
+
```typescript
|
|
1049
|
+
function withoutTimeoutWrapper(
|
|
1050
|
+
command: string,
|
|
1051
|
+
which: (segment: CommandSegment) => boolean,
|
|
1052
|
+
): { command: string; seconds: number | null }
|
|
1053
|
+
```
|
|
1054
|
+
|
|
1055
|
+
- `command` — The shell command.
|
|
1056
|
+
- `which` — The statements to lift the wrapper from (a suite run, for the background path).
|
|
1057
|
+
|
|
1058
|
+
**Returns:** The rewritten command, and the largest lifted bound (null when nothing was lifted).
|
|
1059
|
+
|
|
986
1060
|
#### `runsInCommandPosition(command, pattern)`
|
|
987
1061
|
|
|
988
1062
|
Whether any segment of the command runs a program whose command-position text matches
|
|
@@ -1259,6 +1333,28 @@ function guardAITool(tool: T, options?: GuardOptions): T
|
|
|
1259
1333
|
|
|
1260
1334
|
**Returns:** A copy with a guarded `execute`.
|
|
1261
1335
|
|
|
1336
|
+
#### `diffLineCount(oldLines, newLines)`
|
|
1337
|
+
|
|
1338
|
+
Count truly added/removed lines between two line arrays using LCS.
|
|
1339
|
+
|
|
1340
|
+
Bounded by construction, so a whole-file edit cannot allocate a quadratic
|
|
1341
|
+
table here: the longest common prefix and suffix are trimmed first (exact —
|
|
1342
|
+
those lines belong to every optimal diff, and on the usual small edit they
|
|
1343
|
+
shrink the table to the edited span), and what is left is capped (see
|
|
1344
|
+
{@link lcsLength}).
|
|
1345
|
+
|
|
1346
|
+
```typescript
|
|
1347
|
+
function diffLineCount(
|
|
1348
|
+
oldLines: readonly string[],
|
|
1349
|
+
newLines: readonly string[],
|
|
1350
|
+
): { added: number; removed: number }
|
|
1351
|
+
```
|
|
1352
|
+
|
|
1353
|
+
- `oldLines` — The original lines array.
|
|
1354
|
+
- `newLines` — The modified lines array.
|
|
1355
|
+
|
|
1356
|
+
**Returns:** An object with the number of added and removed lines.
|
|
1357
|
+
|
|
1262
1358
|
#### `commandRunsNoTests(command)`
|
|
1263
1359
|
|
|
1264
1360
|
Whether a shell command invokes a test runner and EVERY such invocation only prints — so the
|
|
@@ -1721,7 +1817,29 @@ function unansweredRequest(request: TraceRequest): boolean
|
|
|
1721
1817
|
|
|
1722
1818
|
**Returns:** True when the request is still in flight and worth naming.
|
|
1723
1819
|
|
|
1724
|
-
#### `
|
|
1820
|
+
#### `stalledDocumentSubresource(request)`
|
|
1821
|
+
|
|
1822
|
+
Whether a trace recorded a DOCUMENT SUBRESOURCE that never finished: a stylesheet, script or
|
|
1823
|
+
other asset the page itself loads, with no response and no error text — still in flight when
|
|
1824
|
+
the navigation timed out.
|
|
1825
|
+
|
|
1826
|
+
The page shell's own incidental requests (`/sw.js`, the manifest, a favicon, a font) are
|
|
1827
|
+
excepted for the reason {@link isStaticAssetRequest} documents: m125's run was sent to write a
|
|
1828
|
+
caching service worker by an aborted `/sw.js`. A pending `/assets/*.css` is different — the
|
|
1829
|
+
navigation blocks on it, so it is the reason `page.goto` ran out of time rather than one of the
|
|
1830
|
+
app's API calls (xr-molecule-flash-m135 +34:10: three deployed `page.goto` timeouts on tests that
|
|
1831
|
+
pass locally, one 88 KB stylesheet fetch measured at 27 s, and the failing tests' traces each
|
|
1832
|
+
held the never-answered CSS while the note said "the cause is in the page").
|
|
1833
|
+
|
|
1834
|
+
```typescript
|
|
1835
|
+
function stalledDocumentSubresource(request: TraceRequest): boolean
|
|
1836
|
+
```
|
|
1837
|
+
|
|
1838
|
+
- `request` — One request a trace recorded.
|
|
1839
|
+
|
|
1840
|
+
**Returns:** True when the request is a document subresource that never finished.
|
|
1841
|
+
|
|
1842
|
+
#### `failureTraceNote(items, target, earlierFailures, apiPrefixes)`
|
|
1725
1843
|
|
|
1726
1844
|
The note a failed suite run's result carries: what each failing test's page actually sent, and
|
|
1727
1845
|
what came back.
|
|
@@ -1742,8 +1860,8 @@ A 4xx request carries what the page SENT beside its status, so a wrapped body is
|
|
|
1742
1860
|
line rather than inferred from the status; when one of those bodies is an object whose only key
|
|
1743
1861
|
is `data`, the note names the call shape that produces it (xr-molecule-flash-m111 +11:36).
|
|
1744
1862
|
|
|
1745
|
-
|
|
1746
|
-
|
|
1863
|
+
Every row opens with the request the failing step ITSELF sent ({@link TraceArtifact.lead}) and
|
|
1864
|
+
its response — whatever its status — because the question a `waiting for locator` failure asks
|
|
1747
1865
|
|
|
1748
1866
|
_(description truncated — read the full text in `node_modules/@molecule/api-ai-tools/dist/trace-artifacts.d.ts`.)_
|
|
1749
1867
|
|
|
@@ -1752,12 +1870,14 @@ function failureTraceNote(
|
|
|
1752
1870
|
items: readonly TraceArtifact[],
|
|
1753
1871
|
target: string,
|
|
1754
1872
|
earlierFailures?: readonly string[],
|
|
1873
|
+
apiPrefixes?: readonly string[],
|
|
1755
1874
|
): string | null
|
|
1756
1875
|
```
|
|
1757
1876
|
|
|
1758
1877
|
- `items` — The traces {@link parseTraceArtifacts} read.
|
|
1759
1878
|
- `target` — Where the run went — the deployed host, as the note names it.
|
|
1760
1879
|
- `earlierFailures` — The failing `file:line`s earlier walks of this suite left, so a repeat is ranked above a one-off. Empty when the caller knows of no earlier walk.
|
|
1880
|
+
- `apiPrefixes` — The API path prefixes the app's client config names (`['/api']`), read from the app by the caller. Empty when the caller could not read one; the traces' own requests may still supply it. Never a hard-coded literal.
|
|
1761
1881
|
|
|
1762
1882
|
**Returns:** The note, or null when no trace held a recorded response, a real failure or a console error.
|
|
1763
1883
|
|
|
@@ -1947,13 +2067,24 @@ The file a command sends its own output to, when it redirects it (`> out.txt`,
|
|
|
1947
2067
|
this leaves its task log empty, so the log is the wrong place to look and an empty
|
|
1948
2068
|
log proves nothing (X1 flash-m29).
|
|
1949
2069
|
|
|
2070
|
+
Which redirect counts is decided by the command's own shell structure, from the same
|
|
2071
|
+
parse every other command reader uses: a redirect written in a BACKGROUNDED statement
|
|
2072
|
+
(`… &`) or inside a `( … )` / `{ … }` group writes that process's or group's output, not
|
|
2073
|
+
the command's. The platform's own preview launch is exactly that — the preview server is
|
|
2074
|
+
started with `>/tmp/mol-preview-4173.log 2>&1 &` inside the build/serve prelude, and the
|
|
2075
|
+
suite's foreground command follows it — so a reader that took the last `>` in the whole
|
|
2076
|
+
text told a run its output went to the PREVIEW's log (X1 flash-m136 +18:31).
|
|
2077
|
+
|
|
2078
|
+
The target comes back without its shell quotes: `> '/tmp/x.log'` is `/tmp/x.log`, and
|
|
2079
|
+
the callers resolve a relative one against the command's cwd.
|
|
2080
|
+
|
|
1950
2081
|
```typescript
|
|
1951
2082
|
function outputRedirectTarget(command: string): string | null
|
|
1952
2083
|
```
|
|
1953
2084
|
|
|
1954
2085
|
- `command` — The shell command.
|
|
1955
2086
|
|
|
1956
|
-
**Returns:** The target
|
|
2087
|
+
**Returns:** The target, or null (`/dev/null` and `&1`/`&2` are not files).
|
|
1957
2088
|
|
|
1958
2089
|
#### `streamingBackgroundCommand(command)`
|
|
1959
2090
|
|
|
@@ -2005,6 +2136,24 @@ function isSuiteRunCommand(command: string): boolean
|
|
|
2005
2136
|
|
|
2006
2137
|
**Returns:** True when the command starts one of those runners.
|
|
2007
2138
|
|
|
2139
|
+
#### `withoutSuiteTimeout(command)`
|
|
2140
|
+
|
|
2141
|
+
The command with the `timeout <N>` wrapper lifted off the statement that runs the suite, and the
|
|
2142
|
+
bound that was lifted.
|
|
2143
|
+
|
|
2144
|
+
Used where the platform moves a run to the background: the executor wrote the bound to fit this
|
|
2145
|
+
tool's foreground ceiling, and in the background that ceiling no longer applies — the task is
|
|
2146
|
+
bounded by `wait_for_task` and the turn's deadline — so the prefix only kills the walk
|
|
2147
|
+
({@link withoutTimeoutWrapper}; X1 xr-molecule-flash-m143 +24:45).
|
|
2148
|
+
|
|
2149
|
+
```typescript
|
|
2150
|
+
function withoutSuiteTimeout(command: string): { command: string; seconds: number | null }
|
|
2151
|
+
```
|
|
2152
|
+
|
|
2153
|
+
- `command` — The shell command.
|
|
2154
|
+
|
|
2155
|
+
**Returns:** The rewritten command, and the largest lifted bound (null when nothing was lifted).
|
|
2156
|
+
|
|
2008
2157
|
#### `isPlaywrightRunCommand(command)`
|
|
2009
2158
|
|
|
2010
2159
|
Whether a command starts a Playwright run — a `playwright test` in command position, in a form
|
|
@@ -2624,13 +2773,13 @@ alongside the others.
|
|
|
2624
2773
|
```typescript
|
|
2625
2774
|
function universalCause(
|
|
2626
2775
|
log: string,
|
|
2627
|
-
found: RepeatingFailure,
|
|
2776
|
+
found: RepeatingFailure | null,
|
|
2628
2777
|
command?: string | null,
|
|
2629
2778
|
): UniversalCause | null
|
|
2630
2779
|
```
|
|
2631
2780
|
|
|
2632
2781
|
- `log` — The log so far.
|
|
2633
|
-
- `found` — The repeating cause {@link repeatingFailure} found in it.
|
|
2782
|
+
- `found` — The repeating cause {@link repeatingFailure} found in it, or null when no two failures share a signature (a page that renders nothing fails each spec at its own first locator — {@link emptyPageCause} still reads that run).
|
|
2634
2783
|
- `command` — How the run was started, when the caller knows it: its spec-file selection scales the file threshold ({@link specFilesSelected}).
|
|
2635
2784
|
|
|
2636
2785
|
**Returns:** The cause's count and files, or null when the run is not failing whole.
|
|
@@ -2661,12 +2810,12 @@ _(description truncated — read the full text in `node_modules/@molecule/api-ai
|
|
|
2661
2810
|
|
|
2662
2811
|
```typescript
|
|
2663
2812
|
function earlyReturnCause(
|
|
2664
|
-
found: RepeatingFailure,
|
|
2813
|
+
found: RepeatingFailure | null,
|
|
2665
2814
|
universal: UniversalCause | null | undefined,
|
|
2666
2815
|
): UniversalCause | null
|
|
2667
2816
|
```
|
|
2668
2817
|
|
|
2669
|
-
- `found` — What {@link repeatingFailure} found mid-run.
|
|
2818
|
+
- `found` — What {@link repeatingFailure} found mid-run, or null when no signature repeats.
|
|
2670
2819
|
- `universal` — What {@link universalCause} found for it, if anything.
|
|
2671
2820
|
|
|
2672
2821
|
**Returns:** The cause to stop the run over, or null — in which case nothing may be stopped, the wait keeps going, and the finding rides the run's result as a note.
|
|
@@ -3046,6 +3195,16 @@ How much of the response body the note prints — the API's first error line.
|
|
|
3046
3195
|
const TRACE_NOTE_GOT_CHARS: 120
|
|
3047
3196
|
```
|
|
3048
3197
|
|
|
3198
|
+
#### `TRACE_NOTE_LEAD_GOT_CHARS`
|
|
3199
|
+
|
|
3200
|
+
How much of the FAILING STEP's response body the note prints. Longer than
|
|
3201
|
+
{@link TRACE_NOTE_GOT_CHARS}: it is the one line that answers "what did the click actually get
|
|
3202
|
+
back", and an app's own body (`{"profile":{…}}`) can carry the answer past its first clause.
|
|
3203
|
+
|
|
3204
|
+
```typescript
|
|
3205
|
+
const TRACE_NOTE_LEAD_GOT_CHARS: 200
|
|
3206
|
+
```
|
|
3207
|
+
|
|
3049
3208
|
#### `DIAGNOSIS_TRACE_FLAG`
|
|
3050
3209
|
|
|
3051
3210
|
The `--trace` flag this platform adds, and the only value it adds it with.
|
|
@@ -3363,6 +3522,16 @@ property of the run rather than of a page.
|
|
|
3363
3522
|
const UNIVERSAL_CAUSE_FILES: 3
|
|
3364
3523
|
```
|
|
3365
3524
|
|
|
3525
|
+
#### `EMPTY_PAGE_CAUSE_TESTS`
|
|
3526
|
+
|
|
3527
|
+
How many tests a run must have walked — with nothing passing since its first failure — before
|
|
3528
|
+
"the page renders nothing" can be its one cause. A handful of failures is a handful of bugs;
|
|
3529
|
+
a page that never painted fails every spec that reaches it, and m141's walk had 36 by +20:30.
|
|
3530
|
+
|
|
3531
|
+
```typescript
|
|
3532
|
+
const EMPTY_PAGE_CAUSE_TESTS: 15
|
|
3533
|
+
```
|
|
3534
|
+
|
|
3366
3535
|
#### `CONNECTION_CAUSE_TESTS`
|
|
3367
3536
|
|
|
3368
3537
|
How many tests a connection-class cause must cover before the run is stopped even when they
|
|
@@ -114,6 +114,18 @@ export interface LocatedCommandSegment {
|
|
|
114
114
|
* statements are one pipeline (`|`, never `;`) asks it instead of reading the text between them.
|
|
115
115
|
*/
|
|
116
116
|
separator: string;
|
|
117
|
+
/**
|
|
118
|
+
* The separator that ENDED this statement — `&` when the shell backgrounds it (so the process
|
|
119
|
+
* writes its own output, not the command's), '' for the last statement of a command.
|
|
120
|
+
*/
|
|
121
|
+
terminator: string;
|
|
122
|
+
/**
|
|
123
|
+
* The file this statement sends its own output to (`> out.log`, `>> log`, `&> run.log`,
|
|
124
|
+
* `| tee file`), or null. Only a redirect written at the command's own level counts: one
|
|
125
|
+
* inside a `( … )` / `{ … }` group writes through that group, and one that feeds a heredoc's
|
|
126
|
+
* file (`cat > cfg.ts <<'EOF'`) is writing a config (X1 flash-m44, flash-m136).
|
|
127
|
+
*/
|
|
128
|
+
redirectTarget: string | null;
|
|
117
129
|
}
|
|
118
130
|
/**
|
|
119
131
|
* Every statement of a command, with its own assignments and where it sits — assignment-only
|
|
@@ -160,6 +172,30 @@ export declare function statementArgumentEnd(command: string, start: number | nu
|
|
|
160
172
|
* @returns The seconds the command allows itself, or null.
|
|
161
173
|
*/
|
|
162
174
|
export declare function commandTimeoutSeconds(command: string): number | null;
|
|
175
|
+
/**
|
|
176
|
+
* The command with the `timeout <N>` wrapper lifted off the statements `which` selects, and the
|
|
177
|
+
* largest bound that was lifted.
|
|
178
|
+
*
|
|
179
|
+
* The platform moves a run to the background precisely because its own bound cannot fit this
|
|
180
|
+
* tool's ceiling, and a background task has no ceiling — its wait is bounded by `wait_for_task`
|
|
181
|
+
* and the turn's deadline. The `timeout N` an executor wrote to fit the ceiling therefore keeps
|
|
182
|
+
* killing the run at N in the background, where nothing needed it: X1 xr-molecule-flash-m143
|
|
183
|
+
* (+24:45) wrote `timeout 280` for a 31-test walk, the tool backgrounded it, and the prefix stopped
|
|
184
|
+
* the walk with no tally — then the cut sentence told the executor to "run it in the background",
|
|
185
|
+
* which is where it already was.
|
|
186
|
+
*
|
|
187
|
+
* The wrapper is found by the same parse every other command reader uses ({@link commandStart}):
|
|
188
|
+
* `timeout` in an argument bounds nothing, and the wrapper's own flags (`-k`/`--kill-after`,
|
|
189
|
+
* `-s`/`--signal`) are stepped over, so `timeout -k 5 280 …` is `280`.
|
|
190
|
+
*
|
|
191
|
+
* @param command - The shell command.
|
|
192
|
+
* @param which - The statements to lift the wrapper from (a suite run, for the background path).
|
|
193
|
+
* @returns The rewritten command, and the largest lifted bound (null when nothing was lifted).
|
|
194
|
+
*/
|
|
195
|
+
export declare function withoutTimeoutWrapper(command: string, which: (segment: CommandSegment) => boolean): {
|
|
196
|
+
command: string;
|
|
197
|
+
seconds: number | null;
|
|
198
|
+
};
|
|
163
199
|
/**
|
|
164
200
|
* Whether any segment of the command runs a program whose command-position text matches
|
|
165
201
|
* `pattern` — the one question a runner-kind table asks.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-position.d.ts","sourceRoot":"","sources":["../src/command-position.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,uFAAuF;AACvF,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAA;IACf,qFAAqF;IACrF,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;IACvB,4FAA4F;IAC5F,IAAI,EAAE,MAAM,CAAA;IACZ;;;OAGG;IACH,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;CAC9B;AAqND;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAM3D;
|
|
1
|
+
{"version":3,"file":"command-position.d.ts","sourceRoot":"","sources":["../src/command-position.ts"],"names":[],"mappings":"AAAA;;;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