@molecule/api-ai-tools 1.16.7 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +341 -5
- package/dist/backends/local.d.ts.map +1 -1
- package/dist/backends/local.js +60 -14
- package/dist/command-plan.d.ts +71 -0
- package/dist/command-plan.d.ts.map +1 -0
- package/dist/command-plan.js +116 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -0
- package/dist/playwright-feedback-reporter.d.ts +16 -0
- package/dist/playwright-feedback-reporter.d.ts.map +1 -0
- package/dist/playwright-feedback-reporter.js +79 -0
- package/dist/playwright-feedback-selection.d.ts +13 -0
- package/dist/playwright-feedback-selection.d.ts.map +1 -0
- package/dist/playwright-feedback-selection.js +206 -0
- package/dist/playwright-feedback-types.d.ts +65 -0
- package/dist/playwright-feedback-types.d.ts.map +1 -0
- package/dist/playwright-feedback-types.js +1 -0
- package/dist/playwright-feedback.d.ts +42 -0
- package/dist/playwright-feedback.d.ts.map +1 -0
- package/dist/playwright-feedback.js +318 -0
- package/dist/suite-overlap.d.ts.map +1 -1
- package/dist/suite-overlap.js +2 -1
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +49 -21
- package/dist/trace-artifacts.d.ts.map +1 -1
- package/dist/trace-artifacts.js +2 -1
- package/dist/utilities.d.ts +4 -1
- package/dist/utilities.d.ts.map +1 -1
- package/dist/utilities.js +14 -1
- package/package.json +5 -1
package/dist/utilities.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
7
|
import { posix } from 'path';
|
|
8
|
+
import { commandPlan, commandPlanLogRead, logicalCommandText } from './command-plan.js';
|
|
8
9
|
import { commandSegments, executedCommands, locatedCommandSegments, statementArgumentEnd, statementBoundary, withoutTimeoutWrapper, } from './command-position.js';
|
|
9
10
|
import { classifyRunFailure } from './failure-kind.js';
|
|
10
11
|
import { commandRunsNoTests } from './no-test-run.js';
|
|
@@ -664,6 +665,10 @@ function isStatusOnlyStep(step) {
|
|
|
664
665
|
* when one was actually wired — or `error` when the command starts the suite more than once.
|
|
665
666
|
*/
|
|
666
667
|
export function streamingBackgroundCommand(command, context, reportPath) {
|
|
668
|
+
// Opaque launchers prepare each logical step with this same function before wrapping it.
|
|
669
|
+
// Rewriting the outer command cannot change an encoded payload and can corrupt its metadata.
|
|
670
|
+
if (commandPlan(command))
|
|
671
|
+
return { command, changes: [] };
|
|
667
672
|
// A command that runs no test is not a run to keep a growing log for: nothing about it is
|
|
668
673
|
// rewritten (flash-m79's `--list` was read as a whole-suite run end to end, and got a ~4 KB
|
|
669
674
|
// refusal to send itself again with `--max-failures=15`).
|
|
@@ -1106,6 +1111,7 @@ const SUITE_RUN_COMMANDS = [
|
|
|
1106
1111
|
* @returns One entry per suite-running statement, as the parser read it (empty when none).
|
|
1107
1112
|
*/
|
|
1108
1113
|
export function suiteRunStatements(command) {
|
|
1114
|
+
command = logicalCommandText(command);
|
|
1109
1115
|
if (commandRunsNoTests(command))
|
|
1110
1116
|
return [];
|
|
1111
1117
|
return commandSegments(command)
|
|
@@ -2673,6 +2679,7 @@ export const RUNNING_FAILURE_LINE_RE = '^[[:space:]]*(✘|✗|×|✖|✕|[0-9]+\
|
|
|
2673
2679
|
*
|
|
2674
2680
|
* @param log - The task log path.
|
|
2675
2681
|
* @param own - A file the command redirects its own output to, if any.
|
|
2682
|
+
* @param command - Executed command, whose logical plan supplies live step boundaries if present.
|
|
2676
2683
|
* @returns The shell command, safe to hand to the execution backend as-is.
|
|
2677
2684
|
*/
|
|
2678
2685
|
export function runningOutputSliceCommand(log, own) {
|
|
@@ -2682,6 +2689,8 @@ export function runningOutputSliceCommand(log, own) {
|
|
|
2682
2689
|
}
|
|
2683
2690
|
/** Bytes of a running log a repeating-cause look reads back. */
|
|
2684
2691
|
export const REPEATING_CAUSE_TAIL_BYTES = 40_000;
|
|
2692
|
+
/** Whole-step history retained for wrapped plans; ordinary diagnostic logs fit inside this bound. */
|
|
2693
|
+
export const COMMAND_PLAN_LOG_CHARS = 4_000_000;
|
|
2685
2694
|
/**
|
|
2686
2695
|
* The shell command whose stdout is enough of a running log to tell whether one cause is
|
|
2687
2696
|
* repeating: its tail, {@link REPEATING_CAUSE_TAIL_BYTES} of it.
|
|
@@ -2696,8 +2705,11 @@ export const REPEATING_CAUSE_TAIL_BYTES = 40_000;
|
|
|
2696
2705
|
* @param own - A file the command redirects its own output to, if any.
|
|
2697
2706
|
* @returns The shell command, safe to hand to the execution backend as-is.
|
|
2698
2707
|
*/
|
|
2699
|
-
export function runningCauseCommand(log, own) {
|
|
2708
|
+
export function runningCauseCommand(log, own, command) {
|
|
2700
2709
|
const read = `cat ${log}${own ? ` ${shellQuote(own)}` : ''} 2>/dev/null`;
|
|
2710
|
+
const plan = command ? commandPlan(command) : null;
|
|
2711
|
+
if (plan)
|
|
2712
|
+
return `${read} | awk ${shellQuote(commandPlanLogRead(plan, COMMAND_PLAN_LOG_CHARS))}`;
|
|
2701
2713
|
return `${read} | tail -c ${REPEATING_CAUSE_TAIL_BYTES}`;
|
|
2702
2714
|
}
|
|
2703
2715
|
/** Bytes of a running log a diagnostic note reads back: one {@link REPEATING_CAUSE_TAIL_BYTES} window. */
|
|
@@ -3610,6 +3622,7 @@ const PLAYWRIGHT_VALUE_FLAGS = new Set([
|
|
|
3610
3622
|
* suite) or the selection cannot be told.
|
|
3611
3623
|
*/
|
|
3612
3624
|
export function specFilesSelected(command) {
|
|
3625
|
+
command = logicalCommandText(command);
|
|
3613
3626
|
for (const segment of commandSegments(command)) {
|
|
3614
3627
|
if (!/^playwright\s+test\b/.test(segment.text))
|
|
3615
3628
|
continue;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/api-ai-tools",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.0",
|
|
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",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@molecule/api-ai": "1.6.0",
|
|
35
|
+
"@playwright/test": "1.64.1",
|
|
35
36
|
"@types/node": "26.6.5",
|
|
36
37
|
"esbuild": "0.28.2",
|
|
37
38
|
"typescript": "6.0.3",
|
|
@@ -46,5 +47,8 @@
|
|
|
46
47
|
"bugs": "https://github.com/molecule-dev/molecule/issues",
|
|
47
48
|
"publishConfig": {
|
|
48
49
|
"access": "public"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"typescript": "6.0.3"
|
|
49
53
|
}
|
|
50
54
|
}
|