@plune-ai/cairn 0.3.4 → 0.4.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 +20 -7
- package/dist/agent/graph.d.ts +24 -530
- package/dist/agent/graph.d.ts.map +1 -1
- package/dist/agent/graph.js +144 -207
- package/dist/agent/graph.js.map +1 -1
- package/dist/agent/index.d.ts +2 -2
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +260 -201
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/repair-loop.d.ts +8 -0
- package/dist/agent/repair-loop.d.ts.map +1 -1
- package/dist/agent/repair-loop.js +17 -5
- package/dist/agent/repair-loop.js.map +1 -1
- package/dist/agent/summary.d.ts +7 -0
- package/dist/agent/summary.d.ts.map +1 -1
- package/dist/agent/summary.js +11 -2
- package/dist/agent/summary.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +20 -10
- package/dist/cli/index.js.map +1 -1
- package/dist/codegen/lint.d.ts +11 -0
- package/dist/codegen/lint.d.ts.map +1 -0
- package/dist/codegen/lint.js +37 -0
- package/dist/codegen/lint.js.map +1 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +7 -0
- package/dist/config/index.js.map +1 -1
- package/dist/config/schema.d.ts +2 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/modalities/explore.d.ts.map +1 -1
- package/dist/core/modalities/explore.js +8 -4
- package/dist/core/modalities/explore.js.map +1 -1
- package/dist/core/modality.d.ts +4 -0
- package/dist/core/modality.d.ts.map +1 -1
- package/dist/core/modality.js +1 -0
- package/dist/core/modality.js.map +1 -1
- package/dist/core/progress.d.ts +13 -0
- package/dist/core/progress.d.ts.map +1 -0
- package/dist/core/progress.js +63 -0
- package/dist/core/progress.js.map +1 -0
- package/dist/core/registry.js +1 -1
- package/dist/core/registry.js.map +1 -1
- package/dist/design/dedup.d.ts +14 -0
- package/dist/design/dedup.d.ts.map +1 -0
- package/dist/design/dedup.js +64 -0
- package/dist/design/dedup.js.map +1 -0
- package/dist/design/index.d.ts.map +1 -1
- package/dist/design/index.js +3 -1
- package/dist/design/index.js.map +1 -1
- package/dist/eval/scorers.d.ts.map +1 -1
- package/dist/eval/scorers.js +33 -0
- package/dist/eval/scorers.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/llm/routing.d.ts +5 -1
- package/dist/llm/routing.d.ts.map +1 -1
- package/dist/llm/routing.js +7 -2
- package/dist/llm/routing.js.map +1 -1
- package/dist/llm/structured.d.ts +1 -1
- package/dist/llm/structured.d.ts.map +1 -1
- package/dist/llm/structured.js +2 -2
- package/dist/llm/structured.js.map +1 -1
- package/dist/prompts/local/qa-playwright-ts-writer.d.ts +1 -1
- package/dist/prompts/local/qa-playwright-ts-writer.d.ts.map +1 -1
- package/dist/prompts/local/qa-playwright-ts-writer.js +1 -0
- package/dist/prompts/local/qa-playwright-ts-writer.js.map +1 -1
- package/dist/prompts/local/qa-testcase-from-ui.d.ts +1 -1
- package/dist/prompts/local/qa-testcase-from-ui.d.ts.map +1 -1
- package/dist/prompts/local/qa-testcase-from-ui.js +2 -1
- package/dist/prompts/local/qa-testcase-from-ui.js.map +1 -1
- package/dist/telemetry/index.d.ts +6 -0
- package/dist/telemetry/index.d.ts.map +1 -1
- package/dist/telemetry/index.js +15 -2
- package/dist/telemetry/index.js.map +1 -1
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/App.js +17 -7
- package/dist/tui/App.js.map +1 -1
- package/dist/tui/hooks/use-runner.d.ts.map +1 -1
- package/dist/tui/hooks/use-runner.js +4 -2
- package/dist/tui/hooks/use-runner.js.map +1 -1
- package/dist/tui/index.d.ts.map +1 -1
- package/dist/tui/index.js +18 -3
- package/dist/tui/index.js.map +1 -1
- package/dist/tui/keys.d.ts +29 -0
- package/dist/tui/keys.d.ts.map +1 -0
- package/dist/tui/keys.js +27 -0
- package/dist/tui/keys.js.map +1 -0
- package/dist/tui/router-context.d.ts +6 -1
- package/dist/tui/router-context.d.ts.map +1 -1
- package/dist/tui/router-context.js.map +1 -1
- package/dist/tui/screens/form-screen.d.ts.map +1 -1
- package/dist/tui/screens/form-screen.js +55 -5
- package/dist/tui/screens/form-screen.js.map +1 -1
- package/dist/tui/types.d.ts +3 -0
- package/dist/tui/types.d.ts.map +1 -1
- package/dist/validate/index.d.ts +4 -0
- package/dist/validate/index.d.ts.map +1 -1
- package/dist/validate/index.js +7 -2
- package/dist/validate/index.js.map +1 -1
- package/dist/validate/runner.d.ts +5 -1
- package/dist/validate/runner.d.ts.map +1 -1
- package/dist/validate/runner.js +7 -4
- package/dist/validate/runner.js.map +1 -1
- package/package.json +8 -8
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* Prompt for generating @playwright/test code from test cases (ADR-0005).
|
|
3
3
|
* Provenance: ported from AZANIR/qa-skills → `qa-playwright-ts-writer` (authored by the maintainer; included here under Apache-2.0). ADR-0008.
|
|
4
4
|
*/
|
|
5
|
-
export declare const QA_PLAYWRIGHT_TS_WRITER = "You are an experienced Playwright test automation engineer (@playwright/test, TypeScript).\nGenerate RUNNABLE spec files covering the provided test cases.\n\nPage under test:\n- URL: {{baseUrl}}\n- Purpose: {{pageSemantics}}\n\nInteractive elements (ref \u00B7 role \u00B7 name; \u00D7N = repeated, several identical):\n{{elements}}\n\nTest cases to cover:\n{{testCases}}\n\nObserved state transitions (for state-transition assertions \u2014 use exactly these before\u2192after):\n{{transitions}}\n\nRules (STRICT):\n- Each file is complete valid TypeScript: import { test, expect } from '@playwright/test';\n- At the start of each test: await page.goto('{{baseUrl}}');\n- Locators ONLY user-facing by role+name: page.getByRole('button', { name: 'Sign In' }), getByLabel, getByText. NO CSS/XPath/testid.\n- Repeated elements (marked \u00D7N \u2014 list/table rows): the locator resolves to several \u2192 ALWAYS use .first() (or .nth(i)), e.g. page.getByRole('button', { name: 'Download PDF' }).first(). Otherwise Playwright throws a strict-mode error.\n- An element marked [first click tab \"X\"] lives behind a tab/view: first await page.getByRole(...{ name: 'X' }).click(), and ONLY then interact with it (otherwise it is not visible).\n- One test case \u2192 one test('<name>', async ({ page }) => { ... }) with verifiable await expect(...).\n- Wrap logical steps in await test.step('<step description>', async () => { ... }) \u2014 a more readable run report.\n- Assertions must match really observable behavior; do not invent elements outside the list.\n- Read-only assertions by default (toBeVisible/toBeEnabled/toBeChecked). For destructive controls (Delete, Submit, Convert, Log out, Add) \u2014 only await expect(...).toBeVisible(), do NOT click.\n- Each test() is INDEPENDENT: starts with await page.goto('{{baseUrl}}') (clean state); do NOT rely on state from another test.\n- One or two RELATED assertions per test; no brittle chains or mega-tests.\n- The code is self-contained and must parse with tsc.\n\nFILE STRUCTURE:\n- All STATIC cases (visibility/state checks, no actions) \u2192 ONE file static-checks.spec.ts (each case = a separate test() inside).\n- Each ACTIVE case (with actions) \u2192 a SEPARATE file, named after the case (e.g. add-user-flow.spec.ts).\n\nReturn files: an array of objects { path: '<name>.spec.ts', content: '<full file code>' }.";
|
|
5
|
+
export declare const QA_PLAYWRIGHT_TS_WRITER = "You are an experienced Playwright test automation engineer (@playwright/test, TypeScript).\nGenerate RUNNABLE spec files covering the provided test cases.\n\nPage under test:\n- URL: {{baseUrl}}\n- Purpose: {{pageSemantics}}\n\nInteractive elements (ref \u00B7 role \u00B7 name; \u00D7N = repeated, several identical):\n{{elements}}\n\nTest cases to cover:\n{{testCases}}\n\nObserved state transitions (for state-transition assertions \u2014 use exactly these before\u2192after):\n{{transitions}}\n\nRules (STRICT):\n- Each file is complete valid TypeScript: import { test, expect } from '@playwright/test';\n- At the start of each test: await page.goto('{{baseUrl}}');\n- Locators ONLY user-facing by role+name: page.getByRole('button', { name: 'Sign In' }), getByLabel, getByText. NO CSS/XPath/testid.\n- Repeated elements (marked \u00D7N \u2014 list/table rows): the locator resolves to several \u2192 ALWAYS use .first() (or .nth(i)), e.g. page.getByRole('button', { name: 'Download PDF' }).first(). Otherwise Playwright throws a strict-mode error.\n- An element marked [first click tab \"X\"] lives behind a tab/view: first await page.getByRole(...{ name: 'X' }).click(), and ONLY then interact with it (otherwise it is not visible).\n- Waiting (STRICT): rely on web-first auto-retrying assertions (await expect(locator).toBeVisible()/toBeEnabled()). NEVER page.waitForTimeout(...) or waitForLoadState('networkidle') \u2014 both are flaky. Playwright auto-waits for actionability; do NOT add manual sleeps.\n- One test case \u2192 one test('<name>', async ({ page }) => { ... }) with verifiable await expect(...).\n- Wrap logical steps in await test.step('<step description>', async () => { ... }) \u2014 a more readable run report.\n- Assertions must match really observable behavior; do not invent elements outside the list.\n- Read-only assertions by default (toBeVisible/toBeEnabled/toBeChecked). For destructive controls (Delete, Submit, Convert, Log out, Add) \u2014 only await expect(...).toBeVisible(), do NOT click.\n- Each test() is INDEPENDENT: starts with await page.goto('{{baseUrl}}') (clean state); do NOT rely on state from another test.\n- One or two RELATED assertions per test; no brittle chains or mega-tests.\n- The code is self-contained and must parse with tsc.\n\nFILE STRUCTURE:\n- All STATIC cases (visibility/state checks, no actions) \u2192 ONE file static-checks.spec.ts (each case = a separate test() inside).\n- Each ACTIVE case (with actions) \u2192 a SEPARATE file, named after the case (e.g. add-user-flow.spec.ts).\n\nReturn files: an array of objects { path: '<name>.spec.ts', content: '<full file code>' }.";
|
|
6
6
|
//# sourceMappingURL=qa-playwright-ts-writer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"qa-playwright-ts-writer.d.ts","sourceRoot":"","sources":["../../../src/prompts/local/qa-playwright-ts-writer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"qa-playwright-ts-writer.d.ts","sourceRoot":"","sources":["../../../src/prompts/local/qa-playwright-ts-writer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,uBAAuB,6lFAmCuD,CAAC"}
|
|
@@ -24,6 +24,7 @@ Rules (STRICT):
|
|
|
24
24
|
- Locators ONLY user-facing by role+name: page.getByRole('button', { name: 'Sign In' }), getByLabel, getByText. NO CSS/XPath/testid.
|
|
25
25
|
- Repeated elements (marked ×N — list/table rows): the locator resolves to several → ALWAYS use .first() (or .nth(i)), e.g. page.getByRole('button', { name: 'Download PDF' }).first(). Otherwise Playwright throws a strict-mode error.
|
|
26
26
|
- An element marked [first click tab "X"] lives behind a tab/view: first await page.getByRole(...{ name: 'X' }).click(), and ONLY then interact with it (otherwise it is not visible).
|
|
27
|
+
- Waiting (STRICT): rely on web-first auto-retrying assertions (await expect(locator).toBeVisible()/toBeEnabled()). NEVER page.waitForTimeout(...) or waitForLoadState('networkidle') — both are flaky. Playwright auto-waits for actionability; do NOT add manual sleeps.
|
|
27
28
|
- One test case → one test('<name>', async ({ page }) => { ... }) with verifiable await expect(...).
|
|
28
29
|
- Wrap logical steps in await test.step('<step description>', async () => { ... }) — a more readable run report.
|
|
29
30
|
- Assertions must match really observable behavior; do not invent elements outside the list.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"qa-playwright-ts-writer.js","sourceRoot":"","sources":["../../../src/prompts/local/qa-playwright-ts-writer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG
|
|
1
|
+
{"version":3,"file":"qa-playwright-ts-writer.js","sourceRoot":"","sources":["../../../src/prompts/local/qa-playwright-ts-writer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2FAmCoD,CAAC"}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* Main prompt for generating test cases from a page.
|
|
3
3
|
* Provenance: ported from AZANIR/qa-skills → `qa-testcase-from-ui` (authored by the maintainer; included here under Apache-2.0). ADR-0008.
|
|
4
4
|
*/
|
|
5
|
-
export declare const QA_TESTCASE_FROM_UI = "You are an experienced QA engineer. Based on the explored page, generate UI test cases.\nIMPORTANT: write all title, steps, expected in {{language}} \u2014 do not mix languages (even if the checklist/page is in another language).\n\nPage purpose:\n{{pageSemantics}}\n\nInteractive elements (ref \u00B7 role \u00B7 name; \u00D7N = repeated, several identical on the page \u2014 e.g. list rows). All REALLY present. In elementRefs use ONLY these refs \u2014 do not invent or change them:\n{{elements}}\n\nObserved state transitions (act\u2192observe). GROUND state-transition assertions ON THESE \u2014 do not invent consequences:\n{{transitions}}\n\nDomain knowledge (credentials, validation rules, nuances \u2014 account for these in the cases):\n{{knowledge}}\n\n{{experience}}\n\n{{style}}\n\n{{methodology}}\n\n{{checklist}}\n\nGenerate clear, verifiable test cases. For each:\n- title \u2014 concise title;\n- technique \u2014 applied 29119-4 technique;\n- kind \u2014 \"static\" (visibility/state check only, no actions) or \"active\" (with actions: click/fill/navigation);\n- type \u2014 \"Positive\" (valid scenario) or \"Negative\" (invalid/erroneous input);\n- execution \u2014 \"auto\" (can be RELIABLY automated: read-only checks on verified locators) or \"manual\" (full generation/submit, security/XSS, UI-UX/visual/responsiveness, irreversible actions \u2014 the bot does NOT automate these);\n- preconditions \u2014 preconditions (e.g. \"user is logged in\", \"page X is open\");\n- steps \u2014 DETAILED unambiguous steps with REAL element labels (e.g. 'Click \"Generate CV\"', 'Enter text into the \"Vacancy text\" field');\n- expected \u2014 verifiable expected result;\n- priority \u2014 critical | high | medium | low;\n- elementRefs \u2014 real refs from the list above that the case touches.\n\nASSERTION SAFETY:\n- Read-only by default: check visibility/state (toBeVisible/toBeEnabled/toBeChecked), not the consequences of actions.\n- For destructive/irreversible controls (Delete, Remove, Submit, Convert, Log out, Add \u2014 anything that writes data or signs out) \u2014 only check that the element is VISIBLE; do NOT click or perform the action.\n\nSTABILITY (CRITICAL):\n- One case = ONE logical check (one expected). Do NOT combine many assertions in one case \u2014 a mega-test fails entirely if any single part is off.\n- Each case is INDEPENDENT and starts from a CLEAN page. Do NOT assume state left by another case.\n- Do NOT generate contradictory cases (e.g. one expects toggle=on, another toggle=off from a fresh start). For a toggle take EXACTLY ONE transition from the \"Observed state transitions\" (before\u2192after).\n\nCover happy path AND negative/edge scenarios. No duplicates or trivialities.\n\nFULL CHECKLIST COVERAGE: do NOT skip checklist items. If an item cannot be reliably automated (full generation/submit flow, security/XSS, UI-UX/visual/responsiveness, irreversible actions) \u2014 STILL create a case, but set execution=\"manual\" (it will not be automated, but it is documented for manual testing). Every checklist item \u2192 at least one case (auto or manual).";
|
|
5
|
+
export declare const QA_TESTCASE_FROM_UI = "You are an experienced QA engineer. Based on the explored page, generate UI test cases.\nIMPORTANT: write all title, steps, expected in {{language}} \u2014 do not mix languages (even if the checklist/page is in another language).\n\nPage purpose:\n{{pageSemantics}}\n\nInteractive elements (ref \u00B7 role \u00B7 name; \u00D7N = repeated, several identical on the page \u2014 e.g. list rows). All REALLY present. In elementRefs use ONLY these refs \u2014 do not invent or change them:\n{{elements}}\n\nObserved state transitions (act\u2192observe). GROUND state-transition assertions ON THESE \u2014 do not invent consequences:\n{{transitions}}\n\nDomain knowledge (credentials, validation rules, nuances \u2014 account for these in the cases):\n{{knowledge}}\n\n{{experience}}\n\n{{style}}\n\n{{methodology}}\n\n{{checklist}}\n\nGenerate clear, verifiable test cases. For each:\n- title \u2014 concise title;\n- technique \u2014 applied 29119-4 technique;\n- kind \u2014 \"static\" (visibility/state check only, no actions) or \"active\" (with actions: click/fill/navigation);\n- type \u2014 \"Positive\" (valid scenario) or \"Negative\" (invalid/erroneous input);\n- execution \u2014 \"auto\" (can be RELIABLY automated: read-only checks on verified locators) or \"manual\" (full generation/submit, security/XSS, UI-UX/visual/responsiveness, irreversible actions \u2014 the bot does NOT automate these);\n- preconditions \u2014 preconditions (e.g. \"user is logged in\", \"page X is open\");\n- steps \u2014 DETAILED unambiguous steps with REAL element labels (e.g. 'Click \"Generate CV\"', 'Enter text into the \"Vacancy text\" field');\n- expected \u2014 verifiable expected result;\n- priority \u2014 critical | high | medium | low;\n- elementRefs \u2014 real refs from the list above that the case touches.\n\nASSERTION SAFETY:\n- Read-only by default: check visibility/state (toBeVisible/toBeEnabled/toBeChecked), not the consequences of actions.\n- For destructive/irreversible controls (Delete, Remove, Submit, Convert, Log out, Add \u2014 anything that writes data or signs out) \u2014 only check that the element is VISIBLE; do NOT click or perform the action.\n\nSTABILITY (CRITICAL):\n- One case = ONE logical check (one expected). Do NOT combine many assertions in one case \u2014 a mega-test fails entirely if any single part is off.\n- Each case is INDEPENDENT and starts from a CLEAN page. Do NOT assume state left by another case.\n- Do NOT generate contradictory cases (e.g. one expects toggle=on, another toggle=off from a fresh start). For a toggle take EXACTLY ONE transition from the \"Observed state transitions\" (before\u2192after).\n\nCover happy path AND negative/edge scenarios. No duplicates or trivialities (no two cases with the same technique + same elements + same steps).\nTECHNIQUE BREADTH: apply a VARIETY of 29119-4 techniques where the page allows \u2014 equivalence-partitioning, boundary-value, decision-table, state-transition, error-guessing \u2014 not just exploratory.\n\nFULL CHECKLIST COVERAGE: do NOT skip checklist items. If an item cannot be reliably automated (full generation/submit flow, security/XSS, UI-UX/visual/responsiveness, irreversible actions) \u2014 STILL create a case, but set execution=\"manual\" (it will not be automated, but it is documented for manual testing). Every checklist item \u2192 at least one case (auto or manual).";
|
|
6
6
|
//# sourceMappingURL=qa-testcase-from-ui.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"qa-testcase-from-ui.d.ts","sourceRoot":"","sources":["../../../src/prompts/local/qa-testcase-from-ui.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"qa-testcase-from-ui.d.ts","sourceRoot":"","sources":["../../../src/prompts/local/qa-testcase-from-ui.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,mBAAmB,y0GA+C+U,CAAC"}
|
|
@@ -46,7 +46,8 @@ STABILITY (CRITICAL):
|
|
|
46
46
|
- Each case is INDEPENDENT and starts from a CLEAN page. Do NOT assume state left by another case.
|
|
47
47
|
- Do NOT generate contradictory cases (e.g. one expects toggle=on, another toggle=off from a fresh start). For a toggle take EXACTLY ONE transition from the "Observed state transitions" (before→after).
|
|
48
48
|
|
|
49
|
-
Cover happy path AND negative/edge scenarios. No duplicates or trivialities.
|
|
49
|
+
Cover happy path AND negative/edge scenarios. No duplicates or trivialities (no two cases with the same technique + same elements + same steps).
|
|
50
|
+
TECHNIQUE BREADTH: apply a VARIETY of 29119-4 techniques where the page allows — equivalence-partitioning, boundary-value, decision-table, state-transition, error-guessing — not just exploratory.
|
|
50
51
|
|
|
51
52
|
FULL CHECKLIST COVERAGE: do NOT skip checklist items. If an item cannot be reliably automated (full generation/submit flow, security/XSS, UI-UX/visual/responsiveness, irreversible actions) — STILL create a case, but set execution="manual" (it will not be automated, but it is documented for manual testing). Every checklist item → at least one case (auto or manual).`;
|
|
52
53
|
//# sourceMappingURL=qa-testcase-from-ui.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"qa-testcase-from-ui.js","sourceRoot":"","sources":["../../../src/prompts/local/qa-testcase-from-ui.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG
|
|
1
|
+
{"version":3,"file":"qa-testcase-from-ui.js","sourceRoot":"","sources":["../../../src/prompts/local/qa-testcase-from-ui.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+WA+C4U,CAAC"}
|
|
@@ -17,6 +17,12 @@ export interface Telemetry {
|
|
|
17
17
|
callbackHandler?: CallbackHandler;
|
|
18
18
|
client?: LangfuseClient;
|
|
19
19
|
shutdown: () => Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Wraps `fn` in a root Langfuse span so that all nested LangChain callback-handler
|
|
22
|
+
* generations are collected under ONE trace (rather than N separate traces). When
|
|
23
|
+
* telemetry is disabled, `fn` is called directly (no-op path). (Task 2, ADR-0012)
|
|
24
|
+
*/
|
|
25
|
+
runInTrace: <T>(name: string, metadata: Record<string, unknown>, fn: () => Promise<T>) => Promise<T>;
|
|
20
26
|
}
|
|
21
27
|
/**
|
|
22
28
|
* Telemetry bootstrap. Returns a no-op (so the bot works offline — ADR-0004/0006) when Langfuse is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/telemetry/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/telemetry/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B;;;;OAIG;IACH,UAAU,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;CACtG;AAOD;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAuDtE"}
|
package/dist/telemetry/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** The offline / not-configured / packages-absent result: a no-op so the bot runs without tracing. */
|
|
2
2
|
function noopTelemetry() {
|
|
3
|
-
return { enabled: false, shutdown: async () => { } };
|
|
3
|
+
return { enabled: false, shutdown: async () => { }, runInTrace: (_n, _m, fn) => fn() };
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
6
|
* Telemetry bootstrap. Returns a no-op (so the bot works offline — ADR-0004/0006) when Langfuse is
|
|
@@ -17,11 +17,13 @@ export async function initTelemetry(cfg) {
|
|
|
17
17
|
let lfOtel;
|
|
18
18
|
let lfLangchain;
|
|
19
19
|
let lfClient;
|
|
20
|
+
let lfTracing;
|
|
20
21
|
try {
|
|
21
22
|
otel = await import("@opentelemetry/sdk-node");
|
|
22
23
|
lfOtel = await import("@langfuse/otel");
|
|
23
24
|
lfLangchain = await import("@langfuse/langchain");
|
|
24
25
|
lfClient = await import("@langfuse/client");
|
|
26
|
+
lfTracing = await import("@langfuse/tracing");
|
|
25
27
|
}
|
|
26
28
|
catch {
|
|
27
29
|
process.stderr.write("[cairn] Langfuse is configured (LANGFUSE_* set) but the optional tracing packages are not " +
|
|
@@ -40,6 +42,17 @@ export async function initTelemetry(cfg) {
|
|
|
40
42
|
await spanProcessor.forceFlush();
|
|
41
43
|
await sdk.shutdown();
|
|
42
44
|
};
|
|
43
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Wraps `fn` in a root Langfuse span via `startActiveObservation`, so that all nested
|
|
47
|
+
* LangChain CallbackHandler generations attach to ONE trace instead of N separate traces.
|
|
48
|
+
* The span name becomes the Langfuse trace name. `metadata` is stored as span metadata.
|
|
49
|
+
* (Task 2 — real API: `startActiveObservation(name, fn)`, callback receives `LangfuseSpan`;
|
|
50
|
+
* `span.updateTrace` does NOT exist in v5.4.1 — use `span.update({ metadata })` instead.)
|
|
51
|
+
*/
|
|
52
|
+
const runInTrace = (name, metadata, fn) => lfTracing.startActiveObservation(name, async (span) => {
|
|
53
|
+
span.update({ metadata });
|
|
54
|
+
return fn();
|
|
55
|
+
});
|
|
56
|
+
return { enabled: true, callbackHandler, client, shutdown, runInTrace };
|
|
44
57
|
}
|
|
45
58
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/telemetry/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/telemetry/index.ts"],"names":[],"mappings":"AA4BA,sGAAsG;AACtG,SAAS,aAAa;IACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;AACxF,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,GAAc;IAChD,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO;QAAE,OAAO,aAAa,EAAE,CAAC;IAElD,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,GAAG,CAAC,QAAQ,CAAC;IAEvD,4FAA4F;IAC5F,gGAAgG;IAChG,IAAI,IAA8C,CAAC;IACnD,IAAI,MAAuC,CAA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AC;IACvB,CAAC,CAAC;IAEF;;;;;;OAMG;IACH,MAAM,UAAU,GAAG,CAAI,IAAY,EAAE,QAAiC,EAAE,EAAoB,EAAc,EAAE,CAC1G,SAAS,CAAC,sBAAsB,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACpD,IAAI,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC1B,OAAO,EAAE,EAAE,CAAC;IACd,CAAC,CAAe,CAAC;IAEnB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;AAC1E,CAAC"}
|
package/dist/tui/App.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/tui/App.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/tui/App.tsx"],"names":[],"mappings":"AAcA;;;GAGG;AACH,wBAAgB,GAAG,gCA4ClB"}
|
package/dist/tui/App.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useReducer, useState } from "react";
|
|
2
|
+
import { useReducer, useRef, useState } from "react";
|
|
3
3
|
import { Box, useApp, useInput } from "ink";
|
|
4
4
|
import { routerReducer, initialRouter, currentScreen, canGoBack } from "./router.js";
|
|
5
5
|
import { RouterProvider } from "./router-context.js";
|
|
6
|
+
import { globalKeyAction } from "./keys.js";
|
|
6
7
|
import { ErrorBoundary } from "./components/error-boundary.js";
|
|
7
8
|
import { Help } from "./components/help.js";
|
|
8
9
|
import { LauncherScreen } from "./screens/launcher-screen.js";
|
|
@@ -19,6 +20,9 @@ export function App() {
|
|
|
19
20
|
const { exit } = useApp();
|
|
20
21
|
const [router, dispatch] = useReducer(routerReducer, initialRouter);
|
|
21
22
|
const [inTextField, setInTextField] = useState(false);
|
|
23
|
+
// A screen (e.g. the wizard) can register a back handler that intercepts Escape; a ref avoids
|
|
24
|
+
// re-rendering and lets the global useInput closure always read the latest handler.
|
|
25
|
+
const backHandler = useRef(null);
|
|
22
26
|
const screen = currentScreen(router);
|
|
23
27
|
const backable = canGoBack(router);
|
|
24
28
|
const api = {
|
|
@@ -27,16 +31,22 @@ export function App() {
|
|
|
27
31
|
replace: (s) => dispatch({ type: "replace", screen: s }),
|
|
28
32
|
canGoBack: backable,
|
|
29
33
|
setInTextField,
|
|
34
|
+
setBackHandler: (fn) => {
|
|
35
|
+
backHandler.current = fn;
|
|
36
|
+
},
|
|
30
37
|
};
|
|
31
38
|
useInput((input, key) => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
39
|
+
const action = globalKeyAction(input, key, { inTextField });
|
|
40
|
+
if (action?.type === "back") {
|
|
41
|
+
// A screen may consume the back (e.g. the wizard steps to its previous field) — only when it
|
|
42
|
+
// does NOT consume do we pop the router stack. Escape works even inside a text field now.
|
|
43
|
+
const consumed = backHandler.current?.() ?? false;
|
|
44
|
+
if (!consumed && backable)
|
|
45
|
+
dispatch({ type: "back" });
|
|
36
46
|
return;
|
|
37
47
|
}
|
|
38
|
-
if (
|
|
39
|
-
|
|
48
|
+
if (action?.type === "quit")
|
|
49
|
+
exit();
|
|
40
50
|
});
|
|
41
51
|
return (_jsx(RouterProvider, { value: api, children: _jsx(ErrorBoundary, { children: _jsxs(Box, { flexDirection: "column", padding: 1, children: [renderScreen(screen), screen.name !== "runDetail" ? _jsx(Help, { canGoBack: backable }) : null] }) }) }));
|
|
42
52
|
}
|
package/dist/tui/App.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.js","sourceRoot":"","sources":["../../src/tui/App.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3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AAEnF,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,QAAQ,CAAC;IAChB,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,KAAK,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,SAAS,CAAA;KAAE,CAAC;CAC9C;AA6CD;;;;GAIG;AACH,wBAAgB,SAAS;;qBAKC,OAAO,UAAU,UAAU,KAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"use-runner.d.ts","sourceRoot":"","sources":["../../../src/tui/hooks/use-runner.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG9E,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAC7D,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEnF,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,QAAQ,CAAC;IAChB,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,KAAK,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,SAAS,CAAA;KAAE,CAAC;CAC9C;AA6CD;;;;GAIG;AACH,wBAAgB,SAAS;;qBAKC,OAAO,UAAU,UAAU,KAAG,IAAI;mBA6DtC,IAAI;EAKzB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useReducer, useRef } from "react";
|
|
2
2
|
import { readFile } from "node:fs/promises";
|
|
3
|
-
import {
|
|
3
|
+
import { resolveConfig, runExploration, runDesign, runAutomate } from "../../index.js";
|
|
4
4
|
import { nodesFor, seedNodes, parseNode, advanceNodes, completeNodes } from "../theme.js";
|
|
5
5
|
const MAX_LOG = 200;
|
|
6
6
|
const initial = { phase: "idle", nodes: [], log: [] };
|
|
@@ -55,7 +55,9 @@ export function useRunner() {
|
|
|
55
55
|
dispatch({ type: "start", nodes: seedNodes(nodesFor(command)) });
|
|
56
56
|
void (async () => {
|
|
57
57
|
try {
|
|
58
|
-
|
|
58
|
+
// Parity with the CLI: form-chosen backend/channel/routing override env (resolveConfig only
|
|
59
|
+
// touches a SET flag), so a TUI run can match `cairn … --channel chrome` etc.
|
|
60
|
+
const config = resolveConfig({ backend: values.backend, channel: values.channel, routing: values.routing }, process.env);
|
|
59
61
|
const onProgress = (event) => {
|
|
60
62
|
if (!cancelled.current)
|
|
61
63
|
dispatch({ type: "progress", event });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-runner.js","sourceRoot":"","sources":["../../../src/tui/hooks/use-runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"use-runner.js","sourceRoot":"","sources":["../../../src/tui/hooks/use-runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEvF,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAoB1F,MAAM,OAAO,GAA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;QACH,CAAC,CAAC,EAAE,CAAC;IACP,CAAC,CAAC;IAEF,MAAM,OAAO,GAAG,GAAS,EAAE;QACzB,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC;IAC3B,CAAC,CAAC;IAEF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AACnC,CAAC"}
|
package/dist/tui/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tui/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAsB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tui/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAsB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAsB9C"}
|
package/dist/tui/index.js
CHANGED
|
@@ -4,9 +4,24 @@
|
|
|
4
4
|
* (other CLI commands and library embedders never load them).
|
|
5
5
|
*/
|
|
6
6
|
export async function mountTui() {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
let React;
|
|
8
|
+
let render;
|
|
9
|
+
let App;
|
|
10
|
+
try {
|
|
11
|
+
React = (await import("react")).default;
|
|
12
|
+
({ render } = await import("ink"));
|
|
13
|
+
({ App } = await import("./App.js"));
|
|
14
|
+
}
|
|
15
|
+
catch (e) {
|
|
16
|
+
const code = e.code;
|
|
17
|
+
if (code === "ERR_MODULE_NOT_FOUND" || code === "MODULE_NOT_FOUND") {
|
|
18
|
+
process.stderr.write("[cairn] The interactive TUI needs optional deps that are not installed.\n" +
|
|
19
|
+
" Install: npm i ink react ink-select-input ink-spinner ink-text-input\n" +
|
|
20
|
+
" Or use explicit commands (no TUI needed): cairn explore <url> · cairn design <url>\n");
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
throw e;
|
|
24
|
+
}
|
|
10
25
|
const { waitUntilExit } = render(React.createElement(App), { exitOnCtrlC: true });
|
|
11
26
|
await waitUntilExit();
|
|
12
27
|
}
|
package/dist/tui/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tui/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ;IAC5B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tui/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ;IAC5B,IAAI,KAA6B,CAAC;IAClC,IAAI,MAAsC,CAAC;IAC3C,IAAI,GAAqC,CAAC;IAC1C,IAAI,CAAC;QACH,KAAK,GAAG,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;QACxC,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACnC,CAAC,EAAE,GAAG,EAAE,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;IACvC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,IAAI,GAAI,CAAuB,CAAC,IAAI,CAAC;QAC3C,IAAI,IAAI,KAAK,sBAAsB,IAAI,IAAI,KAAK,kBAAkB,EAAE,CAAC;YACnE,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,2EAA2E;gBACzE,2EAA2E;gBAC3E,yFAAyF,CAC5F,CAAC;YACF,OAAO;QACT,CAAC;QACD,MAAM,CAAC,CAAC;IACV,CAAC;IACD,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;IAClF,MAAM,aAAa,EAAE,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure key-handling logic for the TUI, kept free of React/Ink so it is trivially unit-testable
|
|
3
|
+
* (same philosophy as router.ts). App.tsx maps these intents onto exit()/router navigation.
|
|
4
|
+
*/
|
|
5
|
+
export type KeyAction = {
|
|
6
|
+
type: "quit";
|
|
7
|
+
} | {
|
|
8
|
+
type: "back";
|
|
9
|
+
} | null;
|
|
10
|
+
/**
|
|
11
|
+
* Maps a keypress to a global intent.
|
|
12
|
+
* - Escape ALWAYS backs out — even while a text field owns the keyboard (esc is not a printable key,
|
|
13
|
+
* so the field does not need it). This is what lets the user leave a form from its first (text) step.
|
|
14
|
+
* - "q" quits only when no text field is focused (otherwise it is a character being typed).
|
|
15
|
+
*/
|
|
16
|
+
export declare function globalKeyAction(input: string, key: {
|
|
17
|
+
escape?: boolean;
|
|
18
|
+
}, opts: {
|
|
19
|
+
inTextField: boolean;
|
|
20
|
+
}): KeyAction;
|
|
21
|
+
/**
|
|
22
|
+
* Wizard step-back. Returns the previous step and `consumed: true` when there is somewhere to go back
|
|
23
|
+
* to; at step 0 returns `consumed: false` so the caller pops the whole screen (form → launcher) instead.
|
|
24
|
+
*/
|
|
25
|
+
export declare function stepBack(stepIndex: number): {
|
|
26
|
+
stepIndex: number;
|
|
27
|
+
consumed: boolean;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/tui/keys.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,SAAS,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC;AAEnE;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,EACb,GAAG,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,EACzB,IAAI,EAAE;IAAE,WAAW,EAAE,OAAO,CAAA;CAAE,GAC7B,SAAS,CAKX;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAEpF"}
|
package/dist/tui/keys.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure key-handling logic for the TUI, kept free of React/Ink so it is trivially unit-testable
|
|
3
|
+
* (same philosophy as router.ts). App.tsx maps these intents onto exit()/router navigation.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Maps a keypress to a global intent.
|
|
7
|
+
* - Escape ALWAYS backs out — even while a text field owns the keyboard (esc is not a printable key,
|
|
8
|
+
* so the field does not need it). This is what lets the user leave a form from its first (text) step.
|
|
9
|
+
* - "q" quits only when no text field is focused (otherwise it is a character being typed).
|
|
10
|
+
*/
|
|
11
|
+
export function globalKeyAction(input, key, opts) {
|
|
12
|
+
if (key.escape)
|
|
13
|
+
return { type: "back" };
|
|
14
|
+
if (opts.inTextField)
|
|
15
|
+
return null; // the focused text field owns printable keys (incl. "q")
|
|
16
|
+
if (input === "q")
|
|
17
|
+
return { type: "quit" };
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Wizard step-back. Returns the previous step and `consumed: true` when there is somewhere to go back
|
|
22
|
+
* to; at step 0 returns `consumed: false` so the caller pops the whole screen (form → launcher) instead.
|
|
23
|
+
*/
|
|
24
|
+
export function stepBack(stepIndex) {
|
|
25
|
+
return stepIndex > 0 ? { stepIndex: stepIndex - 1, consumed: true } : { stepIndex, consumed: false };
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../../src/tui/keys.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAC7B,KAAa,EACb,GAAyB,EACzB,IAA8B;IAE9B,IAAI,GAAG,CAAC,MAAM;QAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IACxC,IAAI,IAAI,CAAC,WAAW;QAAE,OAAO,IAAI,CAAC,CAAC,yDAAyD;IAC5F,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAC3C,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,SAAiB;IACxC,OAAO,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,GAAG,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AACvG,CAAC"}
|
|
@@ -4,8 +4,13 @@ export interface RouterApi {
|
|
|
4
4
|
back: () => void;
|
|
5
5
|
replace: (screen: Screen) => void;
|
|
6
6
|
canGoBack: boolean;
|
|
7
|
-
/** Screens with a focused text input set this true so global `q
|
|
7
|
+
/** Screens with a focused text input set this true so the global `q` shortcut doesn't steal a typed key. */
|
|
8
8
|
setInTextField: (v: boolean) => void;
|
|
9
|
+
/**
|
|
10
|
+
* A screen may intercept the global "back" (Escape) — e.g. a wizard steps back internally.
|
|
11
|
+
* Return `true` if consumed; `false`/unset → the global handler does the default router pop.
|
|
12
|
+
*/
|
|
13
|
+
setBackHandler: (fn: (() => boolean) | null) => void;
|
|
9
14
|
}
|
|
10
15
|
export declare const RouterProvider: import("react").Provider<RouterApi | null>;
|
|
11
16
|
export declare function useRouter(): RouterApi;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router-context.d.ts","sourceRoot":"","sources":["../../src/tui/router-context.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,
|
|
1
|
+
{"version":3,"file":"router-context.d.ts","sourceRoot":"","sources":["../../src/tui/router-context.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,4GAA4G;IAC5G,cAAc,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC;;;OAGG;IACH,cAAc,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,OAAO,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;CACtD;AAID,eAAO,MAAM,cAAc,4CAAyB,CAAC;AAErD,wBAAgB,SAAS,IAAI,SAAS,CAIrC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router-context.js","sourceRoot":"","sources":["../../src/tui/router-context.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"router-context.js","sourceRoot":"","sources":["../../src/tui/router-context.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAiBlD,MAAM,aAAa,GAAG,aAAa,CAAmB,IAAI,CAAC,CAAC;AAE5D,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAC,QAAQ,CAAC;AAErD,MAAM,UAAU,SAAS;IACvB,MAAM,GAAG,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;IACtC,IAAI,CAAC,GAAG;QAAE,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IAC5E,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-screen.d.ts","sourceRoot":"","sources":["../../../src/tui/screens/form-screen.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"form-screen.d.ts","sourceRoot":"","sources":["../../../src/tui/screens/form-screen.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAiB,MAAM,aAAa,CAAC;AAkDtE,qFAAqF;AACrF,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAA;CAAE,+BAuKnG"}
|
|
@@ -3,14 +3,17 @@ import { useEffect, useState } from "react";
|
|
|
3
3
|
import { Box, Text, useInput } from "ink";
|
|
4
4
|
import SelectInput from "ink-select-input";
|
|
5
5
|
import { useRouter } from "../router-context.js";
|
|
6
|
+
import { stepBack } from "../keys.js";
|
|
6
7
|
import { Field } from "../components/field.js";
|
|
7
8
|
import { SessionPicker } from "../components/session-picker.js";
|
|
8
9
|
function stepsFor(command) {
|
|
10
|
+
// backend/channel/routing give the TUI parity with the CLI flags (--backend/--channel/--routing);
|
|
11
|
+
// observe runs no LLM, so it omits routing. "(default)" on any of them leaves the env untouched.
|
|
9
12
|
if (command === "automate")
|
|
10
|
-
return ["runDir", "session", "validate", "submit"];
|
|
13
|
+
return ["runDir", "session", "validate", "backend", "channel", "routing", "submit"];
|
|
11
14
|
if (command === "observe")
|
|
12
|
-
return ["url", "session", "headed", "submit"];
|
|
13
|
-
return ["url", "session", "checklist", "style", "headed", "submit"]; // explore / design
|
|
15
|
+
return ["url", "session", "headed", "backend", "channel", "submit"];
|
|
16
|
+
return ["url", "session", "checklist", "style", "headed", "backend", "channel", "routing", "submit"]; // explore / design
|
|
14
17
|
}
|
|
15
18
|
const STYLE_ITEMS = [
|
|
16
19
|
{ label: "all — full coverage", value: "all" },
|
|
@@ -22,19 +25,45 @@ const YESNO = [
|
|
|
22
25
|
{ label: "no", value: "no" },
|
|
23
26
|
{ label: "yes", value: "yes" },
|
|
24
27
|
];
|
|
28
|
+
// "(default)" → empty value → leave env/default untouched (resolveConfig only overrides a SET flag).
|
|
29
|
+
const BACKEND_ITEMS = [
|
|
30
|
+
{ label: "(default — lib / env)", value: "" },
|
|
31
|
+
{ label: "lib — Playwright library", value: "lib" },
|
|
32
|
+
{ label: "cli — @playwright/cli wrapper", value: "cli" },
|
|
33
|
+
];
|
|
34
|
+
const CHANNEL_ITEMS = [
|
|
35
|
+
{ label: "(default — bundled Chromium)", value: "" },
|
|
36
|
+
{ label: "chrome — system Chrome", value: "chrome" },
|
|
37
|
+
{ label: "msedge — system Edge", value: "msedge" },
|
|
38
|
+
];
|
|
39
|
+
const ROUTING_ITEMS = [
|
|
40
|
+
{ label: "(default — profile/env)", value: "" },
|
|
41
|
+
{ label: "fast — Groq worker", value: "fast" },
|
|
42
|
+
{ label: "volume — OpenRouter worker", value: "volume" },
|
|
43
|
+
];
|
|
25
44
|
/** Sequential wizard: one field per step, ⏎ advances, last step runs the command. */
|
|
26
45
|
export function FormScreen({ command, initial }) {
|
|
27
|
-
const { navigate, setInTextField } = useRouter();
|
|
46
|
+
const { navigate, setInTextField, setBackHandler } = useRouter();
|
|
28
47
|
const [values, setValues] = useState({ url: "", style: "all", headed: false, ...initial });
|
|
29
48
|
const [stepIndex, setStepIndex] = useState(0);
|
|
30
49
|
const steps = stepsFor(command);
|
|
31
50
|
const step = steps[stepIndex] ?? "submit";
|
|
32
51
|
const isText = step === "url" || step === "runDir" || step === "checklist";
|
|
33
|
-
// Suppress global q
|
|
52
|
+
// Suppress the global `q` shortcut only while a text field owns the keyboard (Escape is unaffected).
|
|
34
53
|
useEffect(() => {
|
|
35
54
|
setInTextField(isText);
|
|
36
55
|
return () => setInTextField(false);
|
|
37
56
|
}, [isText, setInTextField]);
|
|
57
|
+
// Escape steps back through the wizard; at step 0 it isn't consumed, so App pops to the launcher.
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
setBackHandler(() => {
|
|
60
|
+
const r = stepBack(stepIndex);
|
|
61
|
+
if (r.consumed)
|
|
62
|
+
setStepIndex(r.stepIndex);
|
|
63
|
+
return r.consumed;
|
|
64
|
+
});
|
|
65
|
+
return () => setBackHandler(null);
|
|
66
|
+
}, [stepIndex, setBackHandler]);
|
|
38
67
|
const advance = () => setStepIndex((i) => Math.min(i + 1, steps.length - 1));
|
|
39
68
|
const set = (k, v) => setValues((s) => ({ ...s, [k]: v }));
|
|
40
69
|
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: "cyan", bold: true, children: command }), _jsx(FormSummary, { values: values, command: command }), _jsx(Box, { marginTop: 1, children: renderStep() })] }));
|
|
@@ -66,6 +95,21 @@ export function FormScreen({ command, initial }) {
|
|
|
66
95
|
set("validate", it.value === "yes");
|
|
67
96
|
advance();
|
|
68
97
|
} })] }));
|
|
98
|
+
case "backend":
|
|
99
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { children: "Browser backend:" }), _jsx(SelectInput, { items: BACKEND_ITEMS, onSelect: (it) => {
|
|
100
|
+
set("backend", (it.value || undefined));
|
|
101
|
+
advance();
|
|
102
|
+
} })] }));
|
|
103
|
+
case "channel":
|
|
104
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { children: "Browser channel (drive a system browser):" }), _jsx(SelectInput, { items: CHANNEL_ITEMS, onSelect: (it) => {
|
|
105
|
+
set("channel", it.value || undefined);
|
|
106
|
+
advance();
|
|
107
|
+
} })] }));
|
|
108
|
+
case "routing":
|
|
109
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { children: "LLM routing preset:" }), _jsx(SelectInput, { items: ROUTING_ITEMS, onSelect: (it) => {
|
|
110
|
+
set("routing", it.value || undefined);
|
|
111
|
+
advance();
|
|
112
|
+
} })] }));
|
|
69
113
|
case "submit":
|
|
70
114
|
return (_jsx(SubmitStep, { command: command, onRun: () => navigate({ name: "dashboard", command, values }) }));
|
|
71
115
|
}
|
|
@@ -97,6 +141,12 @@ function FormSummary({ values, command }) {
|
|
|
97
141
|
}
|
|
98
142
|
if (values.session)
|
|
99
143
|
rows.push(`session: ${values.session}`);
|
|
144
|
+
if (values.backend)
|
|
145
|
+
rows.push(`backend: ${values.backend}`);
|
|
146
|
+
if (values.channel)
|
|
147
|
+
rows.push(`channel: ${values.channel}`);
|
|
148
|
+
if (values.routing)
|
|
149
|
+
rows.push(`routing: ${values.routing}`);
|
|
100
150
|
if (rows.length === 0)
|
|
101
151
|
return null;
|
|
102
152
|
return (_jsx(Box, { flexDirection: "column", marginTop: 1, children: rows.map((r) => (_jsxs(Text, { dimColor: true, children: ["\u00B7 ", r] }, r))) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-screen.js","sourceRoot":"","sources":["../../../src/tui/screens/form-screen.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"form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AAED,gEAAgE;AAChE,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;CACvC"}
|
package/dist/validate/index.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ export type { RawTestResult, TestStatus } from "./runner.js";
|
|
|
4
4
|
export interface TestResult {
|
|
5
5
|
test: string;
|
|
6
6
|
status: "passed" | "failed" | "flaky";
|
|
7
|
+
/** Playwright's failure message for a non-green test (carried into the repair hint). */
|
|
8
|
+
error?: string;
|
|
7
9
|
}
|
|
8
10
|
export interface ValidationReport {
|
|
9
11
|
results: TestResult[];
|
|
@@ -23,6 +25,8 @@ export interface ValidateOptions {
|
|
|
23
25
|
storageStatePath?: string;
|
|
24
26
|
/** Browser channel (chrome/msedge) → run the suite on the system browser (no bundled Chromium). */
|
|
25
27
|
channel?: string;
|
|
28
|
+
/** Parallel Playwright workers (default 5; from cfg.playwrightWorkers / PLAYWRIGHT_WORKERS). */
|
|
29
|
+
workers?: number;
|
|
26
30
|
}
|
|
27
31
|
/**
|
|
28
32
|
* Run the generated suite (already written to runDir/tests) N times and classify it.
|