@runcofactor/cli 0.15.0 → 0.15.2
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/dist/{account-22LMP5PX.js → account-62I7FG5G.js} +5 -5
- package/dist/{api-catalog-WTFQNLK6.js → api-catalog-CAJUASVC.js} +5 -5
- package/dist/{attachment-U3NKVPEY.js → attachment-RL4AZUJE.js} +5 -5
- package/dist/{augmentor-5GMNAX4M.js → augmentor-GAF3MFY6.js} +5 -5
- package/dist/{auth-VQG2CDUD.js → auth-DURHUZDW.js} +3 -3
- package/dist/{chunk-7VMO2WOZ.js → chunk-26U3DGUM.js} +2 -2
- package/dist/{chunk-JMJVGMXI.js → chunk-32P26BZT.js} +2 -2
- package/dist/chunk-32P26BZT.js.map +1 -0
- package/dist/{chunk-VGYN2KU2.js → chunk-5R4HMSNX.js} +69 -9
- package/dist/chunk-5R4HMSNX.js.map +1 -0
- package/dist/{chunk-46IUJXSD.js → chunk-AQPJQ5AE.js} +2 -2
- package/dist/{chunk-PRBRSIZP.js → chunk-CFJXYPTF.js} +3 -3
- package/dist/{chunk-UETBLPKM.js → chunk-CJEKEW7R.js} +3 -3
- package/dist/{chunk-CMGI7UZD.js → chunk-G5SXUXSU.js} +3 -3
- package/dist/{chunk-XJ5YYYGC.js → chunk-HKQ5XQAQ.js} +4 -4
- package/dist/{chunk-3X3NW7QA.js → chunk-IGHDIWZU.js} +2 -2
- package/dist/{chunk-JYGNMKZ5.js → chunk-IWKJQZJQ.js} +115 -92
- package/dist/chunk-IWKJQZJQ.js.map +1 -0
- package/dist/{chunk-KCHKFYVX.js → chunk-PXFDH6YL.js} +34 -1
- package/dist/{chunk-KCHKFYVX.js.map → chunk-PXFDH6YL.js.map} +1 -1
- package/dist/{chunk-HDFYUFBI.js → chunk-UZ2ZA5A6.js} +2 -2
- package/dist/{chunk-FNPMWDUQ.js → chunk-VKBTI5EF.js} +3 -3
- package/dist/{chunk-NHTEKEYE.js → chunk-ZXRVFFCY.js} +3 -3
- package/dist/{credential-E6KUHRGU.js → credential-JGVSEGVH.js} +5 -5
- package/dist/{credential-template-4GPOPBGD.js → credential-template-CWWMOKB2.js} +5 -5
- package/dist/{debug-workflow-XCLCY6S7.js → debug-workflow-BXRU72YZ.js} +5 -5
- package/dist/{docs-COCZYMW6.js → docs-PVBXPTGR.js} +5 -5
- package/dist/{doctor-ERIVTCQS.js → doctor-RHMKD4W5.js} +3 -3
- package/dist/{environment-7Y4BV6XY.js → environment-WZKIO3R3.js} +5 -5
- package/dist/{feature-flag-MHONEX6T.js → feature-flag-K5REGGDY.js} +5 -5
- package/dist/index.js +45 -45
- package/dist/{init-OROOM4HF.js → init-FFUZO5D7.js} +5 -5
- package/dist/{install-OJFXHY6U.js → install-XRKEQAFZ.js} +5 -5
- package/dist/{issues-32GONR6C.js → issues-I3V6GEXU.js} +5 -5
- package/dist/{knobs-UQGGY3CP.js → knobs-6WLJMB44.js} +5 -5
- package/dist/{list-ZMIKEC5P.js → list-PHC7VYNS.js} +5 -5
- package/dist/{local-PUD24GGQ.js → local-VGYRSW22.js} +7 -7
- package/dist/{login-BSO7YX2D.js → login-QPU2BKG2.js} +5 -5
- package/dist/{mcp-4LS7OJUT.js → mcp-LA452TOA.js} +8 -8
- package/dist/{product-3JKSJCBC.js → product-RSZV5HMB.js} +5 -5
- package/dist/{property-K5DBL4UE.js → property-YP4GHQAR.js} +5 -5
- package/dist/{psql-PQFUFTSE.js → psql-XGLBI6T7.js} +3 -3
- package/dist/{record-EIIYLFJ4.js → record-KWKHP2ZY.js} +6 -6
- package/dist/{redis-BU36EZZI.js → redis-VJGCUJPV.js} +3 -3
- package/dist/{release-LYC2P7DZ.js → release-NDRHPW6V.js} +5 -5
- package/dist/{sandbox-CKHXXZHU.js → sandbox-OOCANWOG.js} +5 -5
- package/dist/{scenarios-2XJ2G3KR.js → scenarios-2HRLCGFY.js} +5 -5
- package/dist/{session-UTOD5ZYH.js → session-M4ULYDYP.js} +7 -7
- package/dist/{skill-GMAERMQL.js → skill-4DGPRDUC.js} +2 -2
- package/dist/skills/optimize-cache/SKILL.md +26 -10
- package/dist/{spec-2NP36U3Y.js → spec-XZ2TKUFZ.js} +5 -5
- package/dist/{src-UEOOC425.js → src-7LAXXTVG.js} +34 -6
- package/dist/{src-UEOOC425.js.map → src-7LAXXTVG.js.map} +1 -1
- package/dist/{src-CG52HEE7.js → src-CV57ZD6I.js} +3 -3
- package/dist/{src-4T6GHXVO.js → src-HL7HEJIW.js} +2 -2
- package/dist/{src-PK5OZXCM.js → src-OU7544PM.js} +6 -4
- package/dist/{start-3C7EEFW2.js → start-IYKF3C3X.js} +5 -5
- package/dist/{tag-JSHOMLBR.js → tag-T45MMSCH.js} +6 -6
- package/dist/{task-YGWVYTBJ.js → task-MCUHAVTD.js} +5 -5
- package/dist/{test-suite-LI7ZH367.js → test-suite-BICBRSBP.js} +7 -7
- package/dist/{trace-UMLOSIIR.js → trace-2BAPMYAS.js} +6 -6
- package/dist/{triage-ZWJG4NBJ.js → triage-M3RZ2ASB.js} +6 -6
- package/dist/{upgrade-S7CGEK6H.js → upgrade-4QCRAUHP.js} +3 -3
- package/dist/{workflow-T4HSAOGW.js → workflow-ZGJU4QCV.js} +11 -11
- package/dist/{workflow-cache-XVEZ36KF.js → workflow-cache-M4N325UT.js} +26 -13
- package/dist/workflow-cache-M4N325UT.js.map +1 -0
- package/dist/{workflow-debug-T2BULXZ7.js → workflow-debug-W4USZH35.js} +8 -8
- package/dist/{workflow-proposals-XXEZICN2.js → workflow-proposals-5E3DTYZB.js} +5 -5
- package/package.json +5 -1
- package/dist/chunk-JMJVGMXI.js.map +0 -1
- package/dist/chunk-JYGNMKZ5.js.map +0 -1
- package/dist/chunk-VGYN2KU2.js.map +0 -1
- package/dist/workflow-cache-XVEZ36KF.js.map +0 -1
- /package/dist/{account-22LMP5PX.js.map → account-62I7FG5G.js.map} +0 -0
- /package/dist/{api-catalog-WTFQNLK6.js.map → api-catalog-CAJUASVC.js.map} +0 -0
- /package/dist/{attachment-U3NKVPEY.js.map → attachment-RL4AZUJE.js.map} +0 -0
- /package/dist/{augmentor-5GMNAX4M.js.map → augmentor-GAF3MFY6.js.map} +0 -0
- /package/dist/{auth-VQG2CDUD.js.map → auth-DURHUZDW.js.map} +0 -0
- /package/dist/{chunk-7VMO2WOZ.js.map → chunk-26U3DGUM.js.map} +0 -0
- /package/dist/{chunk-46IUJXSD.js.map → chunk-AQPJQ5AE.js.map} +0 -0
- /package/dist/{chunk-PRBRSIZP.js.map → chunk-CFJXYPTF.js.map} +0 -0
- /package/dist/{chunk-UETBLPKM.js.map → chunk-CJEKEW7R.js.map} +0 -0
- /package/dist/{chunk-CMGI7UZD.js.map → chunk-G5SXUXSU.js.map} +0 -0
- /package/dist/{chunk-XJ5YYYGC.js.map → chunk-HKQ5XQAQ.js.map} +0 -0
- /package/dist/{chunk-3X3NW7QA.js.map → chunk-IGHDIWZU.js.map} +0 -0
- /package/dist/{chunk-HDFYUFBI.js.map → chunk-UZ2ZA5A6.js.map} +0 -0
- /package/dist/{chunk-FNPMWDUQ.js.map → chunk-VKBTI5EF.js.map} +0 -0
- /package/dist/{chunk-NHTEKEYE.js.map → chunk-ZXRVFFCY.js.map} +0 -0
- /package/dist/{credential-E6KUHRGU.js.map → credential-JGVSEGVH.js.map} +0 -0
- /package/dist/{credential-template-4GPOPBGD.js.map → credential-template-CWWMOKB2.js.map} +0 -0
- /package/dist/{debug-workflow-XCLCY6S7.js.map → debug-workflow-BXRU72YZ.js.map} +0 -0
- /package/dist/{docs-COCZYMW6.js.map → docs-PVBXPTGR.js.map} +0 -0
- /package/dist/{doctor-ERIVTCQS.js.map → doctor-RHMKD4W5.js.map} +0 -0
- /package/dist/{environment-7Y4BV6XY.js.map → environment-WZKIO3R3.js.map} +0 -0
- /package/dist/{feature-flag-MHONEX6T.js.map → feature-flag-K5REGGDY.js.map} +0 -0
- /package/dist/{init-OROOM4HF.js.map → init-FFUZO5D7.js.map} +0 -0
- /package/dist/{install-OJFXHY6U.js.map → install-XRKEQAFZ.js.map} +0 -0
- /package/dist/{issues-32GONR6C.js.map → issues-I3V6GEXU.js.map} +0 -0
- /package/dist/{knobs-UQGGY3CP.js.map → knobs-6WLJMB44.js.map} +0 -0
- /package/dist/{list-ZMIKEC5P.js.map → list-PHC7VYNS.js.map} +0 -0
- /package/dist/{local-PUD24GGQ.js.map → local-VGYRSW22.js.map} +0 -0
- /package/dist/{login-BSO7YX2D.js.map → login-QPU2BKG2.js.map} +0 -0
- /package/dist/{mcp-4LS7OJUT.js.map → mcp-LA452TOA.js.map} +0 -0
- /package/dist/{product-3JKSJCBC.js.map → product-RSZV5HMB.js.map} +0 -0
- /package/dist/{property-K5DBL4UE.js.map → property-YP4GHQAR.js.map} +0 -0
- /package/dist/{psql-PQFUFTSE.js.map → psql-XGLBI6T7.js.map} +0 -0
- /package/dist/{record-EIIYLFJ4.js.map → record-KWKHP2ZY.js.map} +0 -0
- /package/dist/{redis-BU36EZZI.js.map → redis-VJGCUJPV.js.map} +0 -0
- /package/dist/{release-LYC2P7DZ.js.map → release-NDRHPW6V.js.map} +0 -0
- /package/dist/{sandbox-CKHXXZHU.js.map → sandbox-OOCANWOG.js.map} +0 -0
- /package/dist/{scenarios-2XJ2G3KR.js.map → scenarios-2HRLCGFY.js.map} +0 -0
- /package/dist/{session-UTOD5ZYH.js.map → session-M4ULYDYP.js.map} +0 -0
- /package/dist/{skill-GMAERMQL.js.map → skill-4DGPRDUC.js.map} +0 -0
- /package/dist/{spec-2NP36U3Y.js.map → spec-XZ2TKUFZ.js.map} +0 -0
- /package/dist/{src-CG52HEE7.js.map → src-CV57ZD6I.js.map} +0 -0
- /package/dist/{src-4T6GHXVO.js.map → src-HL7HEJIW.js.map} +0 -0
- /package/dist/{src-PK5OZXCM.js.map → src-OU7544PM.js.map} +0 -0
- /package/dist/{start-3C7EEFW2.js.map → start-IYKF3C3X.js.map} +0 -0
- /package/dist/{tag-JSHOMLBR.js.map → tag-T45MMSCH.js.map} +0 -0
- /package/dist/{task-YGWVYTBJ.js.map → task-MCUHAVTD.js.map} +0 -0
- /package/dist/{test-suite-LI7ZH367.js.map → test-suite-BICBRSBP.js.map} +0 -0
- /package/dist/{trace-UMLOSIIR.js.map → trace-2BAPMYAS.js.map} +0 -0
- /package/dist/{triage-ZWJG4NBJ.js.map → triage-M3RZ2ASB.js.map} +0 -0
- /package/dist/{upgrade-S7CGEK6H.js.map → upgrade-4QCRAUHP.js.map} +0 -0
- /package/dist/{workflow-T4HSAOGW.js.map → workflow-ZGJU4QCV.js.map} +0 -0
- /package/dist/{workflow-debug-T2BULXZ7.js.map → workflow-debug-W4USZH35.js.map} +0 -0
- /package/dist/{workflow-proposals-XXEZICN2.js.map → workflow-proposals-5E3DTYZB.js.map} +0 -0
|
@@ -113,9 +113,9 @@ import {
|
|
|
113
113
|
withRecoveryNotice,
|
|
114
114
|
withRecoveryNoticeMCP,
|
|
115
115
|
withToolTimeout
|
|
116
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-5R4HMSNX.js";
|
|
117
117
|
import "./chunk-JWHYXEA2.js";
|
|
118
|
-
import "./chunk-
|
|
118
|
+
import "./chunk-IWKJQZJQ.js";
|
|
119
119
|
import "./chunk-6LEZCKKV.js";
|
|
120
120
|
import {
|
|
121
121
|
consoleLogger,
|
|
@@ -244,4 +244,4 @@ export {
|
|
|
244
244
|
withRecoveryNoticeMCP,
|
|
245
245
|
withToolTimeout
|
|
246
246
|
};
|
|
247
|
-
//# sourceMappingURL=src-
|
|
247
|
+
//# sourceMappingURL=src-CV57ZD6I.js.map
|
|
@@ -2,7 +2,7 @@ import { createRequire as __cr } from "module"; const require = __cr(import.meta
|
|
|
2
2
|
import {
|
|
3
3
|
parseTraceActions,
|
|
4
4
|
reconstructSnapshots
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-PXFDH6YL.js";
|
|
6
6
|
import "./chunk-VKVL7WBN.js";
|
|
7
7
|
|
|
8
8
|
// ../diagnostic-workspace/src/assemble-workspace.ts
|
|
@@ -1521,4 +1521,4 @@ export {
|
|
|
1521
1521
|
writeStepRollups,
|
|
1522
1522
|
writeSummary
|
|
1523
1523
|
};
|
|
1524
|
-
//# sourceMappingURL=src-
|
|
1524
|
+
//# sourceMappingURL=src-HL7HEJIW.js.map
|
|
@@ -5,8 +5,9 @@ import {
|
|
|
5
5
|
filterMutationActions,
|
|
6
6
|
parseTraceActions,
|
|
7
7
|
parseTraceGroups,
|
|
8
|
-
reconstructSnapshots
|
|
9
|
-
|
|
8
|
+
reconstructSnapshots,
|
|
9
|
+
toMutationIndex
|
|
10
|
+
} from "./chunk-PXFDH6YL.js";
|
|
10
11
|
import "./chunk-VKVL7WBN.js";
|
|
11
12
|
export {
|
|
12
13
|
cleanupTrace,
|
|
@@ -14,6 +15,7 @@ export {
|
|
|
14
15
|
filterMutationActions,
|
|
15
16
|
parseTraceActions,
|
|
16
17
|
parseTraceGroups,
|
|
17
|
-
reconstructSnapshots
|
|
18
|
+
reconstructSnapshots,
|
|
19
|
+
toMutationIndex
|
|
18
20
|
};
|
|
19
|
-
//# sourceMappingURL=src-
|
|
21
|
+
//# sourceMappingURL=src-OU7544PM.js.map
|
|
@@ -7,15 +7,15 @@ import {
|
|
|
7
7
|
fetchList,
|
|
8
8
|
promptChoice,
|
|
9
9
|
selectProperty
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-CFJXYPTF.js";
|
|
11
11
|
import "./chunk-3CZU7XCS.js";
|
|
12
12
|
import {
|
|
13
13
|
getArgValue,
|
|
14
14
|
resolveConfig
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-IGHDIWZU.js";
|
|
16
|
+
import "./chunk-32P26BZT.js";
|
|
17
17
|
import "./chunk-JWHYXEA2.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-IWKJQZJQ.js";
|
|
19
19
|
import "./chunk-VKVL7WBN.js";
|
|
20
20
|
|
|
21
21
|
// src/local/start.ts
|
|
@@ -149,4 +149,4 @@ Use \`canary session\` commands to interact with the browser.`);
|
|
|
149
149
|
export {
|
|
150
150
|
runLocalStart
|
|
151
151
|
};
|
|
152
|
-
//# sourceMappingURL=start-
|
|
152
|
+
//# sourceMappingURL=start-IYKF3C3X.js.map
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
formatUnknownTagsError,
|
|
6
6
|
resolveTagNames,
|
|
7
7
|
runTag
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-VKBTI5EF.js";
|
|
9
|
+
import "./chunk-CFJXYPTF.js";
|
|
10
10
|
import "./chunk-3CZU7XCS.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-IGHDIWZU.js";
|
|
12
|
+
import "./chunk-32P26BZT.js";
|
|
13
13
|
import "./chunk-JWHYXEA2.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-IWKJQZJQ.js";
|
|
15
15
|
import "./chunk-VKVL7WBN.js";
|
|
16
16
|
export {
|
|
17
17
|
applyWorkflowTagFlags,
|
|
@@ -20,4 +20,4 @@ export {
|
|
|
20
20
|
resolveTagNames,
|
|
21
21
|
runTag
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=tag-
|
|
23
|
+
//# sourceMappingURL=tag-T45MMSCH.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { createRequire as __cr } from "module"; const require = __cr(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
apiRequest
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CFJXYPTF.js";
|
|
5
5
|
import "./chunk-3CZU7XCS.js";
|
|
6
6
|
import {
|
|
7
7
|
getArgValue,
|
|
8
8
|
hasFlag,
|
|
9
9
|
resolveConfig
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-IGHDIWZU.js";
|
|
11
|
+
import "./chunk-32P26BZT.js";
|
|
12
12
|
import "./chunk-JWHYXEA2.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-IWKJQZJQ.js";
|
|
14
14
|
import "./chunk-VKVL7WBN.js";
|
|
15
15
|
|
|
16
16
|
// src/task.ts
|
|
@@ -920,4 +920,4 @@ async function runTask(argv) {
|
|
|
920
920
|
export {
|
|
921
921
|
runTask
|
|
922
922
|
};
|
|
923
|
-
//# sourceMappingURL=task-
|
|
923
|
+
//# sourceMappingURL=task-MCUHAVTD.js.map
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { createRequire as __cr } from "module"; const require = __cr(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
runRemoteTest
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CJEKEW7R.js";
|
|
5
5
|
import {
|
|
6
6
|
isTriageEnabledForExecution
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ZXRVFFCY.js";
|
|
8
8
|
import {
|
|
9
9
|
apiRequest
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-CFJXYPTF.js";
|
|
11
11
|
import "./chunk-3CZU7XCS.js";
|
|
12
12
|
import {
|
|
13
13
|
getArgValue,
|
|
14
14
|
hasFlag,
|
|
15
15
|
resolveConfig
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-IGHDIWZU.js";
|
|
17
|
+
import "./chunk-32P26BZT.js";
|
|
18
18
|
import "./chunk-JWHYXEA2.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-IWKJQZJQ.js";
|
|
20
20
|
import "./chunk-VKVL7WBN.js";
|
|
21
21
|
|
|
22
22
|
// src/test-suite.ts
|
|
@@ -396,4 +396,4 @@ async function runTestSuite(argv) {
|
|
|
396
396
|
export {
|
|
397
397
|
runTestSuite
|
|
398
398
|
};
|
|
399
|
-
//# sourceMappingURL=test-suite-
|
|
399
|
+
//# sourceMappingURL=test-suite-BICBRSBP.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { createRequire as __cr } from "module"; const require = __cr(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
runTrace
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-HKQ5XQAQ.js";
|
|
5
|
+
import "./chunk-IGHDIWZU.js";
|
|
6
|
+
import "./chunk-32P26BZT.js";
|
|
7
|
+
import "./chunk-5R4HMSNX.js";
|
|
8
8
|
import "./chunk-JWHYXEA2.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-IWKJQZJQ.js";
|
|
10
10
|
import "./chunk-6LEZCKKV.js";
|
|
11
11
|
import "./chunk-KRWRUU6R.js";
|
|
12
12
|
import "./chunk-VKVL7WBN.js";
|
|
13
13
|
export {
|
|
14
14
|
runTrace
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=trace-
|
|
16
|
+
//# sourceMappingURL=trace-2BAPMYAS.js.map
|
|
@@ -2,16 +2,16 @@ import { createRequire as __cr } from "module"; const require = __cr(import.meta
|
|
|
2
2
|
import {
|
|
3
3
|
isTriageEnabledForExecution,
|
|
4
4
|
runTriage
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-ZXRVFFCY.js";
|
|
6
|
+
import "./chunk-CFJXYPTF.js";
|
|
7
7
|
import "./chunk-3CZU7XCS.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-IGHDIWZU.js";
|
|
9
|
+
import "./chunk-32P26BZT.js";
|
|
10
10
|
import "./chunk-JWHYXEA2.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-IWKJQZJQ.js";
|
|
12
12
|
import "./chunk-VKVL7WBN.js";
|
|
13
13
|
export {
|
|
14
14
|
isTriageEnabledForExecution,
|
|
15
15
|
runTriage
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=triage-
|
|
17
|
+
//# sourceMappingURL=triage-M3RZ2ASB.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRequire as __cr } from "module"; const require = __cr(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
clearUpdateCache
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-AQPJQ5AE.js";
|
|
5
5
|
import {
|
|
6
6
|
packageName
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-32P26BZT.js";
|
|
8
8
|
import "./chunk-VKVL7WBN.js";
|
|
9
9
|
|
|
10
10
|
// src/upgrade.ts
|
|
@@ -58,4 +58,4 @@ Successfully upgraded ${packageName}.`);
|
|
|
58
58
|
export {
|
|
59
59
|
runUpgrade
|
|
60
60
|
};
|
|
61
|
-
//# sourceMappingURL=upgrade-
|
|
61
|
+
//# sourceMappingURL=upgrade-4QCRAUHP.js.map
|
|
@@ -4,17 +4,17 @@ import {
|
|
|
4
4
|
} from "./chunk-4NRDONSC.js";
|
|
5
5
|
import {
|
|
6
6
|
workflowToSpec
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-26U3DGUM.js";
|
|
8
8
|
import {
|
|
9
9
|
applyWorkflowTagFlags
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-VKBTI5EF.js";
|
|
11
11
|
import {
|
|
12
12
|
alignSnapshotNodeIds
|
|
13
13
|
} from "./chunk-JDBCZ3Z2.js";
|
|
14
14
|
import {
|
|
15
15
|
apiRequest,
|
|
16
16
|
renderWorkflowUserError
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-CFJXYPTF.js";
|
|
18
18
|
import {
|
|
19
19
|
apiFetch,
|
|
20
20
|
exitOnFailure,
|
|
@@ -25,16 +25,16 @@ import {
|
|
|
25
25
|
hasFlag,
|
|
26
26
|
resolveAppUrl,
|
|
27
27
|
resolveConfig
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-IGHDIWZU.js";
|
|
29
29
|
import {
|
|
30
30
|
specExtension
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-32P26BZT.js";
|
|
32
32
|
import "./chunk-JWHYXEA2.js";
|
|
33
33
|
import {
|
|
34
34
|
NODE_TYPE_LABEL,
|
|
35
35
|
USER_SETTABLE_WORKFLOW_STATUSES,
|
|
36
36
|
normalizeNodeType
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-IWKJQZJQ.js";
|
|
38
38
|
import "./chunk-VKVL7WBN.js";
|
|
39
39
|
|
|
40
40
|
// src/workflow.ts
|
|
@@ -3673,7 +3673,7 @@ async function runWorkflow(argv) {
|
|
|
3673
3673
|
return;
|
|
3674
3674
|
}
|
|
3675
3675
|
if (subCommand === "debug" && hasFlag(rest, "--help", "-h")) {
|
|
3676
|
-
const { handleWorkflowDebug } = await import("./workflow-debug-
|
|
3676
|
+
const { handleWorkflowDebug } = await import("./workflow-debug-W4USZH35.js");
|
|
3677
3677
|
await handleWorkflowDebug(rest, "", "");
|
|
3678
3678
|
return;
|
|
3679
3679
|
}
|
|
@@ -3751,7 +3751,7 @@ async function runWorkflow(argv) {
|
|
|
3751
3751
|
await handleWorkflowSync(rest, apiUrl, token);
|
|
3752
3752
|
break;
|
|
3753
3753
|
case "proposals": {
|
|
3754
|
-
const { handleWorkflowProposals } = await import("./workflow-proposals-
|
|
3754
|
+
const { handleWorkflowProposals } = await import("./workflow-proposals-5E3DTYZB.js");
|
|
3755
3755
|
await handleWorkflowProposals(rest, apiUrl, token);
|
|
3756
3756
|
break;
|
|
3757
3757
|
}
|
|
@@ -3762,12 +3762,12 @@ async function runWorkflow(argv) {
|
|
|
3762
3762
|
await handleWorkflowApiSequence(rest, apiUrl, token);
|
|
3763
3763
|
break;
|
|
3764
3764
|
case "cache": {
|
|
3765
|
-
const { handleWorkflowCache } = await import("./workflow-cache-
|
|
3765
|
+
const { handleWorkflowCache } = await import("./workflow-cache-M4N325UT.js");
|
|
3766
3766
|
await handleWorkflowCache(rest, apiUrl, token);
|
|
3767
3767
|
break;
|
|
3768
3768
|
}
|
|
3769
3769
|
case "debug": {
|
|
3770
|
-
const { handleWorkflowDebug } = await import("./workflow-debug-
|
|
3770
|
+
const { handleWorkflowDebug } = await import("./workflow-debug-W4USZH35.js");
|
|
3771
3771
|
await handleWorkflowDebug(rest, apiUrl, token);
|
|
3772
3772
|
break;
|
|
3773
3773
|
}
|
|
@@ -3780,4 +3780,4 @@ async function runWorkflow(argv) {
|
|
|
3780
3780
|
export {
|
|
3781
3781
|
runWorkflow
|
|
3782
3782
|
};
|
|
3783
|
-
//# sourceMappingURL=workflow-
|
|
3783
|
+
//# sourceMappingURL=workflow-ZGJU4QCV.js.map
|
|
@@ -2,14 +2,14 @@ import { createRequire as __cr } from "module"; const require = __cr(import.meta
|
|
|
2
2
|
import {
|
|
3
3
|
apiRequest,
|
|
4
4
|
promptInput
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-CFJXYPTF.js";
|
|
6
6
|
import "./chunk-3CZU7XCS.js";
|
|
7
7
|
import {
|
|
8
8
|
hasFlag
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-IGHDIWZU.js";
|
|
10
|
+
import "./chunk-32P26BZT.js";
|
|
11
11
|
import "./chunk-JWHYXEA2.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-IWKJQZJQ.js";
|
|
13
13
|
import "./chunk-VKVL7WBN.js";
|
|
14
14
|
|
|
15
15
|
// src/workflow-cache.ts
|
|
@@ -266,11 +266,11 @@ async function handleSubstrate(argv) {
|
|
|
266
266
|
const actionIndexRaw = flagValue(argv, "--action");
|
|
267
267
|
const phase = flagValue(argv, "--phase") ?? "before";
|
|
268
268
|
if (!workspace || actionIndexRaw === void 0) {
|
|
269
|
-
console.error("Usage: canary workflow cache substrate --workspace <dir> --action <idx> [--phase before|after]");
|
|
269
|
+
console.error("Usage: canary workflow cache substrate --workspace <dir> --action <idx> [--phase before|after] (idx = position in browser/actions.jsonl / segments.json)");
|
|
270
270
|
process.exit(1);
|
|
271
271
|
}
|
|
272
272
|
const actionIndex = Number(actionIndexRaw);
|
|
273
|
-
const { SubstrateMaterializer } = await import("./src-
|
|
273
|
+
const { SubstrateMaterializer } = await import("./src-7LAXXTVG.js");
|
|
274
274
|
const path = await import("path");
|
|
275
275
|
const materializer = new SubstrateMaterializer({
|
|
276
276
|
traceZipPath: path.join(workspace, "browser", "trace.zip"),
|
|
@@ -295,7 +295,7 @@ async function handleLocator(argv) {
|
|
|
295
295
|
const ref = flagValue(argv, "--ref");
|
|
296
296
|
const phase = flagValue(argv, "--phase") ?? "before";
|
|
297
297
|
if (!workspace || actionIndexRaw === void 0 || !ref) {
|
|
298
|
-
console.error("Usage: canary workflow cache locator --workspace <dir> --action <idx> --ref <ref> [--var name=value ...]");
|
|
298
|
+
console.error("Usage: canary workflow cache locator --workspace <dir> --action <idx> --ref <ref> [--var name=value ...] (idx = position in browser/actions.jsonl / segments.json)");
|
|
299
299
|
process.exit(1);
|
|
300
300
|
}
|
|
301
301
|
const variableValues = {};
|
|
@@ -306,8 +306,8 @@ async function handleLocator(argv) {
|
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
308
|
const actionIndex = Number(actionIndexRaw);
|
|
309
|
-
const { HeadlessDomSession, SubstrateMaterializer, LocatorVerifier, buildLocator } = await import("./src-
|
|
310
|
-
const { parseSnapshot } = await import("./src-
|
|
309
|
+
const { HeadlessDomSession, SubstrateMaterializer, LocatorVerifier, buildLocator } = await import("./src-7LAXXTVG.js");
|
|
310
|
+
const { parseSnapshot } = await import("./src-CV57ZD6I.js");
|
|
311
311
|
const path = await import("path");
|
|
312
312
|
const session = new HeadlessDomSession();
|
|
313
313
|
const materializer = new SubstrateMaterializer({
|
|
@@ -353,8 +353,11 @@ async function handleCommit(argv, apiUrl, token) {
|
|
|
353
353
|
const nodeId = flagValue(argv, "--node");
|
|
354
354
|
const recipePath = flagValue(argv, "--recipe");
|
|
355
355
|
const json = hasFlag(argv, "--json");
|
|
356
|
+
const dryRun = hasFlag(argv, "--dry-run");
|
|
356
357
|
if (!workflowId || !nodeId || !recipePath) {
|
|
357
|
-
console.error(
|
|
358
|
+
console.error(
|
|
359
|
+
"Usage: canary workflow cache commit <workflowId> --node <nodeId> --recipe <file.json> [--dry-run]"
|
|
360
|
+
);
|
|
358
361
|
process.exit(1);
|
|
359
362
|
}
|
|
360
363
|
const fs = await import("fs/promises");
|
|
@@ -364,17 +367,27 @@ async function handleCommit(argv, apiUrl, token) {
|
|
|
364
367
|
token,
|
|
365
368
|
"POST",
|
|
366
369
|
`/workflows/${workflowId}/nodes/${nodeId}/cache-recipe`,
|
|
367
|
-
recipe
|
|
370
|
+
dryRun ? { ...recipe, dryRun: true } : recipe
|
|
368
371
|
);
|
|
369
372
|
if (!result.ok) {
|
|
370
373
|
if (json) console.log(JSON.stringify(result, null, 2));
|
|
371
|
-
else
|
|
374
|
+
else {
|
|
375
|
+
console.error(`Error: ${result.error ?? "Unknown error"}`);
|
|
376
|
+
if (result.detail && result.detail !== result.error) console.error(` ${result.detail}`);
|
|
377
|
+
for (const issue of result.issues ?? []) console.error(` - ${issue}`);
|
|
378
|
+
}
|
|
372
379
|
process.exit(1);
|
|
373
380
|
}
|
|
374
381
|
if (json) {
|
|
375
382
|
console.log(JSON.stringify(result, null, 2));
|
|
376
383
|
return;
|
|
377
384
|
}
|
|
385
|
+
if (result.dryRun) {
|
|
386
|
+
console.log(
|
|
387
|
+
`Dry run OK: recipe validates and passes the commit guards (${result.cachedStepCount} cached, ${result.gapStepCount} gap steps; would mint under hash ${result.nodeHash})`
|
|
388
|
+
);
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
378
391
|
console.log(
|
|
379
392
|
`Recipe committed: cache ${result.cacheId} under hash ${result.nodeHash} (${result.cachedStepCount} cached, ${result.gapStepCount} gap steps)`
|
|
380
393
|
);
|
|
@@ -383,4 +396,4 @@ export {
|
|
|
383
396
|
buildCacheClearBody,
|
|
384
397
|
handleWorkflowCache
|
|
385
398
|
};
|
|
386
|
-
//# sourceMappingURL=workflow-cache-
|
|
399
|
+
//# sourceMappingURL=workflow-cache-M4N325UT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/workflow-cache.ts"],"sourcesContent":["/**\n * CLI handlers for `canary workflow cache {status,clear,optimize,substrate,locator,commit}`.\n *\n * @module WorkflowCacheCLI\n */\n\nimport process from 'node:process';\nimport { hasFlag } from './auth.js';\nimport { apiRequest, promptInput } from './cli-helpers.js';\n\ntype CacheStatusResponse = {\n ok: boolean;\n error?: string;\n workflowId?: string;\n nodes?: Array<{\n nodeId: string;\n cacheId: string;\n compilerVersion: number | null;\n playbookHealth: string | null;\n stepFailureCounts: Record<string, number> | null;\n cachedAt: string | null;\n lastUsedAt: string | null;\n useCount: number;\n gapCount: number;\n }>;\n};\n\ntype CacheClearResponse = {\n ok: boolean;\n error?: string;\n invalidated?: number;\n mode?: string;\n};\n\ntype WorkflowResetResponse = {\n ok: boolean;\n error?: string;\n nodesReset?: number;\n};\n\ntype OptimizeResponse = {\n ok: boolean;\n error?: string;\n jobId?: string;\n runId?: string;\n};\n\ntype CacheRecipeResponse = {\n ok: boolean;\n error?: string;\n /** Server-side failure message with the full guard/validation context. */\n detail?: string;\n /** Actionable validation issues from the recipe builder. */\n issues?: string[];\n cacheId?: string;\n nodeHash?: string;\n cachedStepCount?: number;\n gapStepCount?: number;\n dryRun?: boolean;\n};\n\nfunction flagValue(argv: string[], name: string): string | undefined {\n const i = argv.indexOf(name);\n if (i === -1 || i === argv.length - 1) return undefined;\n return argv[i + 1];\n}\n\n/**\n * Pure helper: build the `cache-clear` request body from parsed argv flags.\n * Returns a discriminated result so callers can surface parse errors without\n * the helper itself writing to stderr or calling `process.exit`.\n *\n * Exported for unit testing.\n */\nexport function buildCacheClearBody(opts: {\n nodeId?: string;\n belowVersionRaw?: string;\n staleOnly?: boolean;\n mode?: string;\n}):\n | { ok: true; body: Record<string, unknown> }\n | { ok: false; error: string } {\n const body: Record<string, unknown> = {};\n if (opts.nodeId) body.nodeId = opts.nodeId;\n if (opts.belowVersionRaw !== undefined) {\n const n = Number(opts.belowVersionRaw);\n if (!Number.isInteger(n) || n <= 0) {\n return {\n ok: false,\n error: `--below-version must be a positive integer, got \"${opts.belowVersionRaw}\"`,\n };\n }\n body.belowVersion = n;\n }\n if (opts.staleOnly) body.staleOnly = true;\n if (opts.mode) {\n if (opts.mode !== 'all' && opts.mode !== 'hard') {\n return {\n ok: false,\n error: `--mode must be \"all\" or \"hard\", got \"${opts.mode}\"`,\n };\n }\n body.mode = opts.mode;\n }\n\n const modeCount =\n (body.nodeId !== undefined ? 1 : 0) +\n (body.belowVersion !== undefined ? 1 : 0) +\n (body.staleOnly !== undefined ? 1 : 0) +\n (body.mode !== undefined ? 1 : 0);\n if (modeCount === 0) {\n return {\n ok: false,\n error:\n 'cache clear requires one of: --node <id>, --below-version <n>, --stale-only, --mode all, or --mode hard',\n };\n }\n if (modeCount > 1) {\n return {\n ok: false,\n error: 'cache clear accepts exactly one of --node / --below-version / --stale-only / --mode',\n };\n }\n return { ok: true, body };\n}\n\nfunction printUsage(): void {\n console.error(\n [\n 'Usage:',\n ' canary workflow cache status <workflowId> [--json]',\n ' canary workflow cache clear <workflowId> <mode> [--json]',\n ' canary workflow cache optimize <workflowId> [--run <runId>] [--json]',\n ' canary workflow cache substrate --workspace <dir> --action <idx> [--phase before|after]',\n ' canary workflow cache locator --workspace <dir> --action <idx> --ref <ref> [--var k=v ...]',\n ' canary workflow cache commit <workflowId> --node <nodeId> --recipe <file.json> [--json]',\n '',\n 'Cache clear modes (pick exactly one):',\n ' --node <nodeId> Invalidate one node\\'s cache row',\n ' --below-version <n> Invalidate caches with compilerVersion < n',\n ' --stale-only Invalidate caches whose playbookHealth = \"stale\"',\n ' --mode all Invalidate every cache row (rows kept, isValid=false)',\n ' --mode hard DESTRUCTIVE: delete cache rows, strip playbookSteps',\n ' from node configs, and null lastRunId. Equivalent to',\n ' the UI \"Reset flow\" button. Requires --yes.',\n '',\n 'Options:',\n ' --yes Skip the interactive confirmation for --mode hard',\n ' --json Output raw JSON',\n ].join('\\n')\n );\n}\n\nexport async function handleWorkflowCache(\n argv: string[],\n apiUrl: string,\n token: string\n): Promise<void> {\n const [sub, ...rest] = argv;\n if (!sub || hasFlag(argv, '--help', '-h')) {\n printUsage();\n return;\n }\n\n switch (sub) {\n case 'status':\n await handleStatus(rest, apiUrl, token);\n return;\n case 'clear':\n await handleClear(rest, apiUrl, token);\n return;\n case 'optimize':\n await handleOptimize(rest, apiUrl, token);\n return;\n case 'substrate':\n await handleSubstrate(rest);\n return;\n case 'locator':\n await handleLocator(rest);\n return;\n case 'commit':\n await handleCommit(rest, apiUrl, token);\n return;\n default:\n console.error(`Unknown cache sub-command: ${sub}`);\n printUsage();\n process.exit(1);\n }\n}\n\nasync function handleStatus(argv: string[], apiUrl: string, token: string): Promise<void> {\n const workflowId = argv.find((a) => !a.startsWith('-'));\n if (!workflowId) {\n console.error('Missing workflowId.');\n printUsage();\n process.exit(1);\n }\n const json = hasFlag(argv, '--json');\n\n const result = await apiRequest<CacheStatusResponse>(\n apiUrl,\n token,\n 'GET',\n `/workflows/${workflowId}/cache-status`\n );\n\n if (!result.ok) {\n if (json) console.log(JSON.stringify(result, null, 2));\n else console.error(`Error: ${result.error ?? 'Unknown error'}`);\n process.exit(1);\n }\n\n if (json) {\n console.log(JSON.stringify(result, null, 2));\n return;\n }\n\n const nodes = result.nodes ?? [];\n console.log(`Cache status for workflow ${workflowId} (${nodes.length} valid cache rows)\\n`);\n if (nodes.length === 0) {\n console.log(' No valid caches.');\n return;\n }\n\n for (const n of nodes) {\n const health = n.playbookHealth ?? '—';\n const ver = n.compilerVersion ?? 'pre-v2';\n const gaps = n.gapCount;\n const age = n.cachedAt ? new Date(n.cachedAt).toISOString().slice(0, 10) : '—';\n console.log(\n ` node=${n.nodeId.slice(0, 8)} compilerVersion=${ver} health=${health} gaps=${gaps} cachedAt=${age} uses=${n.useCount}`\n );\n }\n}\n\nasync function handleClear(argv: string[], apiUrl: string, token: string): Promise<void> {\n const workflowId = argv.find((a) => !a.startsWith('-'));\n if (!workflowId) {\n console.error('Missing workflowId.');\n printUsage();\n process.exit(1);\n }\n const json = hasFlag(argv, '--json');\n\n const built = buildCacheClearBody({\n nodeId: flagValue(argv, '--node'),\n belowVersionRaw: flagValue(argv, '--below-version'),\n staleOnly: hasFlag(argv, '--stale-only'),\n mode: flagValue(argv, '--mode'),\n });\n if (!built.ok) {\n console.error(built.error);\n process.exit(1);\n }\n const body = built.body;\n\n if (body.mode === 'hard') {\n await handleHardReset(workflowId, hasFlag(argv, '--yes'), json, apiUrl, token);\n return;\n }\n\n const result = await apiRequest<CacheClearResponse>(\n apiUrl,\n token,\n 'POST',\n `/workflows/${workflowId}/cache-clear`,\n body\n );\n\n if (!result.ok) {\n if (json) console.log(JSON.stringify(result, null, 2));\n else console.error(`Error: ${result.error ?? 'Unknown error'}`);\n process.exit(1);\n }\n\n if (json) {\n console.log(JSON.stringify(result, null, 2));\n return;\n }\n\n console.log(`Cleared (${result.mode}): ${result.invalidated ?? 0} cache row(s)`);\n}\n\nasync function handleHardReset(\n workflowId: string,\n yesFlag: boolean,\n json: boolean,\n apiUrl: string,\n token: string\n): Promise<void> {\n if (!yesFlag) {\n console.log(\n [\n '',\n `Hard reset on workflow ${workflowId} will:`,\n ' - DELETE all cached browser actions for this workflow',\n ' - REMOVE playbookSteps from every node config',\n ' - CLEAR the workflow lastRunId',\n '',\n 'This is equivalent to the UI \"Reset flow\" button and cannot be undone.',\n '',\n ].join('\\n')\n );\n const answer = await promptInput('Type \"yes\" to confirm');\n if (answer.toLowerCase() !== 'yes') {\n console.error('Aborted.');\n process.exit(1);\n }\n }\n\n const result = await apiRequest<WorkflowResetResponse>(\n apiUrl,\n token,\n 'POST',\n `/workflows/${workflowId}/reset`\n );\n\n if (!result.ok) {\n if (json) console.log(JSON.stringify(result, null, 2));\n else console.error(`Error: ${result.error ?? 'Unknown error'}`);\n process.exit(1);\n }\n\n if (json) {\n console.log(JSON.stringify(result, null, 2));\n return;\n }\n\n console.log(\n `Reset workflow: ${result.nodesReset ?? 0} node(s) cleared (cache rows deleted, playbook steps removed, lastRunId cleared)`\n );\n}\n\nasync function handleOptimize(argv: string[], apiUrl: string, token: string): Promise<void> {\n const workflowId = argv.find((a) => !a.startsWith('-'));\n if (!workflowId) {\n console.error('Missing workflowId.');\n printUsage();\n process.exit(1);\n }\n const json = hasFlag(argv, '--json');\n const runId = flagValue(argv, '--run');\n\n const result = await apiRequest<OptimizeResponse>(\n apiUrl,\n token,\n 'POST',\n `/workflows/${workflowId}/optimize-cache`,\n runId ? { runId } : {}\n );\n\n if (!result.ok) {\n if (json) console.log(JSON.stringify(result, null, 2));\n else console.error(`Error: ${result.error ?? 'Unknown error'}`);\n process.exit(1);\n }\n\n if (json) {\n console.log(JSON.stringify(result, null, 2));\n return;\n }\n\n console.log(`Cache optimizer job enqueued: ${result.jobId} (harvesting run ${result.runId})`);\n}\n\n/**\n * Reconstruct one trace action's page state and capture its substrate-v2,\n * entirely locally against a materialized run workspace\n * (`canary workflow debug materialize <runId> --out <dir>`).\n */\nasync function handleSubstrate(argv: string[]): Promise<void> {\n const workspace = flagValue(argv, '--workspace');\n const actionIndexRaw = flagValue(argv, '--action');\n const phase = (flagValue(argv, '--phase') ?? 'before') as 'before' | 'after';\n if (!workspace || actionIndexRaw === undefined) {\n console.error('Usage: canary workflow cache substrate --workspace <dir> --action <idx> [--phase before|after] (idx = position in browser/actions.jsonl / segments.json)');\n process.exit(1);\n }\n const actionIndex = Number(actionIndexRaw);\n const { SubstrateMaterializer } = await import('@chatsdet/workflow-cache');\n const path = await import('node:path');\n const materializer = new SubstrateMaterializer({\n traceZipPath: path.join(workspace, 'browser', 'trace.zip'),\n outDir: path.join(workspace, 'optimizer', 'substrates'),\n });\n try {\n const result = await materializer.materialize(actionIndex, phase);\n console.log(\n JSON.stringify(\n { substratePath: result.substratePath, domPath: result.domPath },\n null,\n 2\n )\n );\n } finally {\n await materializer.close();\n }\n}\n\n/**\n * Derive a deterministic locator for an element (by aria-ref) and verify it\n * offline against the trace-reconstructed DOM. Locally, no API.\n */\nasync function handleLocator(argv: string[]): Promise<void> {\n const workspace = flagValue(argv, '--workspace');\n const actionIndexRaw = flagValue(argv, '--action');\n const ref = flagValue(argv, '--ref');\n const phase = (flagValue(argv, '--phase') ?? 'before') as 'before' | 'after';\n if (!workspace || actionIndexRaw === undefined || !ref) {\n console.error('Usage: canary workflow cache locator --workspace <dir> --action <idx> --ref <ref> [--var name=value ...] (idx = position in browser/actions.jsonl / segments.json)');\n process.exit(1);\n }\n const variableValues: Record<string, string> = {};\n for (let i = 0; i < argv.length - 1; i++) {\n if (argv[i] === '--var') {\n const [name, ...valueParts] = (argv[i + 1] ?? '').split('=');\n if (name && valueParts.length > 0) variableValues[name] = valueParts.join('=');\n }\n }\n const actionIndex = Number(actionIndexRaw);\n const { HeadlessDomSession, SubstrateMaterializer, LocatorVerifier, buildLocator } = await import(\n '@chatsdet/workflow-cache'\n );\n const { parseSnapshot } = await import('@chatsdet/browser-core');\n const path = await import('node:path');\n // One Chromium for capture + verification — they must share a rendering\n // environment or the aria-ref table shifts between the two.\n const session = new HeadlessDomSession();\n const materializer = new SubstrateMaterializer({\n traceZipPath: path.join(workspace, 'browser', 'trace.zip'),\n outDir: path.join(workspace, 'optimizer', 'substrates'),\n session,\n });\n const verifier = new LocatorVerifier({ session });\n try {\n const substrate = await materializer.materialize(actionIndex, phase);\n const snapshot = parseSnapshot(substrate.substrateYaml);\n const built = buildLocator(snapshot, ref, variableValues);\n if (built.irreducible) {\n console.log(\n JSON.stringify(\n { verified: false, irreducible: true, reason: 'no unique predicate — mark as gap' },\n null,\n 2\n )\n );\n process.exit(2);\n }\n const verification = await verifier.verify({\n domPath: substrate.domPath,\n targetRef: ref,\n strategy: built.selectors,\n variableValues,\n });\n console.log(\n JSON.stringify(\n { verified: verification.verdict, predicate: built.predicate, selectors: built.selectors, verification },\n null,\n 2\n )\n );\n if (!verification.verdict) process.exit(2);\n } finally {\n await session.close();\n }\n}\n\n/** Commit an optimizer-authored recipe through the server-validated endpoint. */\nasync function handleCommit(argv: string[], apiUrl: string, token: string): Promise<void> {\n const workflowId = argv.find((a) => !a.startsWith('-'));\n const nodeId = flagValue(argv, '--node');\n const recipePath = flagValue(argv, '--recipe');\n const json = hasFlag(argv, '--json');\n const dryRun = hasFlag(argv, '--dry-run');\n if (!workflowId || !nodeId || !recipePath) {\n console.error(\n 'Usage: canary workflow cache commit <workflowId> --node <nodeId> --recipe <file.json> [--dry-run]'\n );\n process.exit(1);\n }\n const fs = await import('node:fs/promises');\n const recipe = JSON.parse(await fs.readFile(recipePath, 'utf-8')) as Record<string, unknown>;\n const result = await apiRequest<CacheRecipeResponse>(\n apiUrl,\n token,\n 'POST',\n `/workflows/${workflowId}/nodes/${nodeId}/cache-recipe`,\n dryRun ? { ...recipe, dryRun: true } : recipe\n );\n if (!result.ok) {\n if (json) console.log(JSON.stringify(result, null, 2));\n else {\n console.error(`Error: ${result.error ?? 'Unknown error'}`);\n if (result.detail && result.detail !== result.error) console.error(` ${result.detail}`);\n for (const issue of result.issues ?? []) console.error(` - ${issue}`);\n }\n process.exit(1);\n }\n if (json) {\n console.log(JSON.stringify(result, null, 2));\n return;\n }\n if (result.dryRun) {\n console.log(\n `Dry run OK: recipe validates and passes the commit guards ` +\n `(${result.cachedStepCount} cached, ${result.gapStepCount} gap steps; would mint under hash ${result.nodeHash})`\n );\n return;\n }\n console.log(\n `Recipe committed: cache ${result.cacheId} under hash ${result.nodeHash} ` +\n `(${result.cachedStepCount} cached, ${result.gapStepCount} gap steps)`\n );\n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","names":[]}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { createRequire as __cr } from "module"; const require = __cr(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
runTrace
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-HKQ5XQAQ.js";
|
|
5
5
|
import {
|
|
6
6
|
apiRequest
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-CFJXYPTF.js";
|
|
8
8
|
import "./chunk-3CZU7XCS.js";
|
|
9
9
|
import {
|
|
10
10
|
getArgValue,
|
|
11
11
|
hasFlag
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-IGHDIWZU.js";
|
|
13
|
+
import "./chunk-32P26BZT.js";
|
|
14
|
+
import "./chunk-5R4HMSNX.js";
|
|
15
15
|
import "./chunk-JWHYXEA2.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-IWKJQZJQ.js";
|
|
17
17
|
import "./chunk-6LEZCKKV.js";
|
|
18
18
|
import "./chunk-KRWRUU6R.js";
|
|
19
19
|
import "./chunk-VKVL7WBN.js";
|
|
@@ -875,7 +875,7 @@ async function handleMaterialize(argv, apiUrl, token) {
|
|
|
875
875
|
const runId = requireRunId(argv);
|
|
876
876
|
const workflowId = await resolveWorkflowId(argv, runId, apiUrl, token);
|
|
877
877
|
const outDir = getArgValue(argv, "--out") ?? `./diag-${runId}`;
|
|
878
|
-
const { assembleWorkspace } = await import("./src-
|
|
878
|
+
const { assembleWorkspace } = await import("./src-HL7HEJIW.js");
|
|
879
879
|
const dataUrl = `${apiUrl}/workflows/${encodeURIComponent(workflowId)}/runs/${encodeURIComponent(runId)}/debug/materialize-data`;
|
|
880
880
|
const dataRes = await fetch(dataUrl, { headers: { Authorization: `Bearer ${token}` } });
|
|
881
881
|
if (!dataRes.ok) {
|
|
@@ -925,4 +925,4 @@ async function handleMaterialize(argv, apiUrl, token) {
|
|
|
925
925
|
export {
|
|
926
926
|
handleWorkflowDebug
|
|
927
927
|
};
|
|
928
|
-
//# sourceMappingURL=workflow-debug-
|
|
928
|
+
//# sourceMappingURL=workflow-debug-W4USZH35.js.map
|
|
@@ -6,15 +6,15 @@ import {
|
|
|
6
6
|
} from "./chunk-JDBCZ3Z2.js";
|
|
7
7
|
import {
|
|
8
8
|
apiRequest
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CFJXYPTF.js";
|
|
10
10
|
import "./chunk-3CZU7XCS.js";
|
|
11
11
|
import {
|
|
12
12
|
getArgValue,
|
|
13
13
|
hasFlag
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-IGHDIWZU.js";
|
|
15
|
+
import "./chunk-32P26BZT.js";
|
|
16
16
|
import "./chunk-JWHYXEA2.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-IWKJQZJQ.js";
|
|
18
18
|
import "./chunk-VKVL7WBN.js";
|
|
19
19
|
|
|
20
20
|
// src/workflow-proposals.ts
|
|
@@ -378,4 +378,4 @@ export {
|
|
|
378
378
|
_internalsForTesting,
|
|
379
379
|
handleWorkflowProposals
|
|
380
380
|
};
|
|
381
|
-
//# sourceMappingURL=workflow-proposals-
|
|
381
|
+
//# sourceMappingURL=workflow-proposals-5E3DTYZB.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runcofactor/cli",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
".": {
|
|
10
10
|
"import": "./dist/index.js",
|
|
11
11
|
"types": "./dist/index.d.ts"
|
|
12
|
+
},
|
|
13
|
+
"./brand": {
|
|
14
|
+
"types": "./src/brand.ts",
|
|
15
|
+
"import": "./src/brand.ts"
|
|
12
16
|
}
|
|
13
17
|
},
|
|
14
18
|
"bin": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/brand.ts"],"sourcesContent":["/**\n * Brand resolution for the dual-published CLI.\n *\n * We ship a single build to two npm packages:\n * - `@canaryai/cli` → binary `canary` (legacy brand)\n * - `@runcofactor/cli` → binary `cofactor` (new brand)\n *\n * Both packages contain the identical artifact; they differ only in their\n * `name` and `bin` map (rewritten at publish time — see\n * `.github/workflows/publish-canary-cli.yml`). Everything brand-specific is\n * therefore derived at runtime:\n *\n * - `command` comes from the invoked binary name (`basename(process.argv[1])`),\n * so output reflects how the user called it (`brandText` rewrites legacy\n * `canary` display strings to the active brand).\n * - `packageName` comes from the installed package's own `package.json`, so\n * self-upgrade and the update check target whatever package was installed.\n *\n * The legacy `canary` brand is the default for every non-`cofactor` invocation\n * (`node dist/index.js`, dev scripts, tests), which keeps existing behaviour\n * byte-for-byte unchanged.\n *\n * @module\n */\n\nimport { createRequire } from 'node:module';\nimport path from 'node:path';\nimport process from 'node:process';\n\nconst require = createRequire(import.meta.url);\nconst pkg = require('../package.json') as { name: string; version: string };\n\nexport type Brand = 'canary' | 'cofactor';\n\n/**\n * Resolve the brand from the invoked binary path (`process.argv[1]`). The\n * global-install shim is named `canary` or `cofactor` (npm/bun/pnpm bin link),\n * so the basename is the brand. Everything else (`node dist/index.js`, dev\n * scripts, tests) defaults to the legacy `canary` brand. Pure for testing.\n */\nexport function resolveBrandFromArgv(argv1: string | undefined): Brand {\n if (argv1) {\n const base = path.basename(argv1).replace(/\\.[^./\\\\]+$/, '').toLowerCase();\n if (base.includes('cofactor')) return 'cofactor';\n }\n return 'canary';\n}\n\n/** The invoked command / binary name, e.g. `canary` or `cofactor`. */\nexport const command: Brand = resolveBrandFromArgv(process.argv[1]);\n\n/** npm package name of the installed CLI, read from its own package.json. */\nexport const packageName: string = pkg.name;\n\n/** CLI version, read from package.json. */\nexport const version: string = pkg.version;\n\n/**\n * Rewrite display strings authored against the legacy `canary` brand to the\n * active brand. Identity for the `canary` brand (so legacy output never\n * changes). Two precise, word-anchored rules:\n *\n * 1. The invocation token `canary ` followed by a lowercase letter (i.e. a\n * sub-command or `canary v1.2.3`). Anchored on a non-word, non-hyphen\n * boundary so it never touches `trycanary.ai`, `x-canary-request-id`,\n * `canary-cli`, or `CANARY_API_TOKEN`.\n * 2. The prose noun `Canary` (capitalized, standalone word) → display name.\n */\nconst INVOCATION_RE = /(^|[^\\w-])canary(?= [a-z])/g;\nconst PROSE_RE = /\\bCanary\\b/g;\n\n/** Pure brand rewrite for a given target brand. Identity for `canary`. */\nexport function brandTextFor(text: string, brand: Brand): string {\n if (brand === 'canary') return text;\n const display = brand === 'cofactor' ? 'Cofactor' : 'Canary';\n return text\n .replace(INVOCATION_RE, (_m, prefix: string) => `${prefix}${brand}`)\n .replace(PROSE_RE, display);\n}\n\nfunction brandText(text: string): string {\n return brandTextFor(text, command);\n}\n\n/**\n * Rewrite a bundled skill template's content to the target brand for the\n * `canary skill install` / `canary skill <name>` output. Builds on\n * {@link brandTextFor} (invocation tokens + the prose noun) and additionally\n * maps the brand-specific identifiers that {@link brandTextFor} deliberately\n * leaves intact for console output — but which a distributed skill file must\n * carry per brand:\n *\n * - inline binary: `` `canary` `` → `` `cofactor` `` (a backtick-wrapped bare\n * binary reference, e.g. \"the `canary` CLI\" — `brandTextFor` only rewrites\n * `canary <subcommand>` invocations, not the standalone binary name)\n * - npm package: `@canaryai/cli` → `@runcofactor/cli`\n * - env prefix: `CANARY_*` → `COFACTOR_*`\n * - domains: `*.trycanary.ai` → `*.runcofactor.com`\n *\n * Identity for the `canary` brand, so legacy skill text installs byte-for-byte\n * unchanged. The skill's frontmatter `name:` is never an invocation/prose/token\n * match (it's `canary-basic`, hyphenated), so the install directory key is\n * preserved. Trigger keywords in prose (e.g. \"mentions canary, canary CLI\")\n * intentionally keep the legacy term so the skill still activates for users who\n * say \"canary\". Pure (brand injectable).\n */\nexport function brandSkillContentFor(content: string, brand: Brand): string {\n const base = brandTextFor(content, brand);\n if (brand !== 'cofactor') return base;\n return base\n .replace(/`canary`/g, '`cofactor`')\n .replace(/@canaryai\\/cli/g, '@runcofactor/cli')\n .replace(/\\bCANARY_/g, 'COFACTOR_')\n .replace(/trycanary\\.ai/g, 'runcofactor.com');\n}\n\n/**\n * Read a brand-prefixed environment variable, accepting EITHER brand's prefix.\n *\n * The two published brands historically diverged: the binary only ever read the\n * legacy `CANARY_*` names, but the cofactor docs tell users to set `COFACTOR_*`\n * (e.g. `COFACTOR_API_TOKEN`). This bridges that gap — a value set under either\n * prefix is honoured regardless of which binary (`canary` / `cofactor`) was\n * invoked. When both are set, the active brand's prefix wins.\n *\n * `canaryName` is the legacy `CANARY_`-prefixed name; the `COFACTOR_` variant is\n * derived from it. Empty strings are treated as unset so a blank value can't\n * shadow a real one set under the other prefix. Pure (brand + env injectable).\n */\nexport function readBrandEnvFor(\n canaryName: string,\n brand: Brand,\n env: NodeJS.ProcessEnv = process.env,\n): string | undefined {\n const cofactorName = canaryName.replace(/^CANARY_/, 'COFACTOR_');\n const order = brand === 'cofactor' ? [cofactorName, canaryName] : [canaryName, cofactorName];\n for (const name of order) {\n const value = env[name];\n if (value !== null && value !== undefined && value !== '') return value;\n }\n return undefined;\n}\n\n/** Read a brand-prefixed env var for the active brand. See {@link readBrandEnvFor}. */\nexport function readBrandEnv(\n canaryName: string,\n env: NodeJS.ProcessEnv = process.env,\n): string | undefined {\n return readBrandEnvFor(canaryName, command, env);\n}\n\n/**\n * Workflow spec file convention — brand-aware, backwards compatible.\n *\n * The spec extension and default directory follow the active brand: the\n * `cofactor` binary writes `.cofactor.md` into `cofactor/specs`, the legacy\n * `canary` binary writes `.canary.md` into `canary/specs` (byte-for-byte\n * unchanged). Reading/discovery always accepts BOTH — {@link SPEC_EXTENSIONS}\n * and {@link SPEC_DIRS} list every recognized variant (newest brand first), so\n * an existing `.canary.md` repo keeps working under either binary.\n */\nexport const SPEC_EXTENSIONS = ['.cofactor.md', '.canary.md'] as const;\n\n/**\n * Default spec-directory roots, newest brand first. Each is used as\n * `<root>/specs`. The ordering is a precedence contract: consumers that merge\n * across roots (e.g. `pull --all`) must treat earlier entries as higher\n * priority, so the active/new brand's copy wins over a legacy one.\n */\nexport const SPEC_DIRS = ['cofactor', 'canary'] as const;\n\n/** Spec-file extension to WRITE for a given brand. See {@link SPEC_EXTENSIONS}. */\nexport function specExtensionFor(brand: Brand): string {\n return brand === 'cofactor' ? '.cofactor.md' : '.canary.md';\n}\n\n/** Default spec directory (`<root>/specs`) to WRITE into for a given brand. */\nexport function specDirFor(brand: Brand): string {\n return path.join(brand === 'cofactor' ? 'cofactor' : 'canary', 'specs');\n}\n\n/** Spec-file extension to WRITE for the active brand. See {@link specExtensionFor}. */\nexport const specExtension: string = specExtensionFor(command);\n\n/** Default spec directory to WRITE into for the active brand. See {@link specDirFor}. */\nexport const specDir: string = specDirFor(command);\n\n/**\n * Every spec directory to READ from, highest precedence first — `<root>/specs`\n * for each {@link SPEC_DIRS} root. This is the single source of the spec-dir\n * convention for discovery; consumers merge across these in order (first-seen\n * wins) so the active brand's copy beats a legacy one. Brand-independent: a\n * `cofactor` run still discovers an existing `canary/specs` repo, and vice\n * versa.\n */\nexport function readableSpecDirs(): string[] {\n return SPEC_DIRS.map((root) => path.join(root, 'specs'));\n}\n\n/** True if `name` ends with any recognized spec extension (either brand). */\nexport function isSpecFile(name: string): boolean {\n return SPEC_EXTENSIONS.some((ext) => name.endsWith(ext));\n}\n\n/**\n * Split a recognized spec extension off `name`, returning `{ base, ext }` for\n * the first matching {@link SPEC_EXTENSIONS} entry, or `null` if none match.\n * Lets callers derive sibling names (e.g. `.stamped`) without assuming a brand.\n */\nexport function splitSpecExtension(name: string): { base: string; ext: string } | null {\n for (const ext of SPEC_EXTENSIONS) {\n if (name.endsWith(ext)) return { base: name.slice(0, -ext.length), ext };\n }\n return null;\n}\n\n/**\n * Install brand rewriting over the `console` methods used for human-readable\n * output. No-op for the `canary` brand. Skipped by the caller for machine\n * output (`--json`/`--format`) and the `mcp` JSON-RPC transport, where rewriting\n * could corrupt structured payloads — display branding only.\n */\nexport function installConsoleBranding(): void {\n if (command === 'canary') return;\n const methods = ['log', 'error', 'warn', 'info'] as const;\n for (const method of methods) {\n const original = console[method].bind(console);\n console[method] = (...args: unknown[]) => {\n original(...args.map((arg) => (typeof arg === 'string' ? brandText(arg) : arg)));\n };\n }\n}\n"],"mappings":";;;AAyBA,SAAS,qBAAqB;AAC9B,OAAO,UAAU;AACjB,OAAO,aAAa;AAEpB,IAAMA,WAAU,cAAc,YAAY,GAAG;AAC7C,IAAM,MAAMA,SAAQ,iBAAiB;AAU9B,SAAS,qBAAqB,OAAkC;AACrE,MAAI,OAAO;AACT,UAAM,OAAO,KAAK,SAAS,KAAK,EAAE,QAAQ,eAAe,EAAE,EAAE,YAAY;AACzE,QAAI,KAAK,SAAS,UAAU,EAAG,QAAO;AAAA,EACxC;AACA,SAAO;AACT;AAGO,IAAM,UAAiB,qBAAqB,QAAQ,KAAK,CAAC,CAAC;AAG3D,IAAM,cAAsB,IAAI;AAGhC,IAAM,UAAkB,IAAI;AAanC,IAAM,gBAAgB;AACtB,IAAM,WAAW;AAGV,SAAS,aAAa,MAAc,OAAsB;AAC/D,MAAI,UAAU,SAAU,QAAO;AAC/B,QAAM,UAAU,UAAU,aAAa,aAAa;AACpD,SAAO,KACJ,QAAQ,eAAe,CAAC,IAAI,WAAmB,GAAG,MAAM,GAAG,KAAK,EAAE,EAClE,QAAQ,UAAU,OAAO;AAC9B;AAEA,SAAS,UAAU,MAAsB;AACvC,SAAO,aAAa,MAAM,OAAO;AACnC;AAwBO,SAAS,qBAAqB,SAAiB,OAAsB;AAC1E,QAAM,OAAO,aAAa,SAAS,KAAK;AACxC,MAAI,UAAU,WAAY,QAAO;AACjC,SAAO,KACJ,QAAQ,aAAa,YAAY,EACjC,QAAQ,mBAAmB,kBAAkB,EAC7C,QAAQ,cAA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