@runcofactor/cli 0.13.0 → 0.15.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.
Files changed (147) hide show
  1. package/dist/account-22LMP5PX.js +255 -0
  2. package/dist/account-22LMP5PX.js.map +1 -0
  3. package/dist/{api-catalog-7HLEN7C2.js → api-catalog-WTFQNLK6.js} +5 -5
  4. package/dist/{attachment-OVNQD6Z2.js → attachment-U3NKVPEY.js} +5 -5
  5. package/dist/augmentor-5GMNAX4M.js +198 -0
  6. package/dist/augmentor-5GMNAX4M.js.map +1 -0
  7. package/dist/{auth-VUHL74FH.js → auth-VQG2CDUD.js} +3 -3
  8. package/dist/{chunk-PZ4LCN6K.js → chunk-3X3NW7QA.js} +2 -2
  9. package/dist/{chunk-VGTKUOYS.js → chunk-46IUJXSD.js} +2 -2
  10. package/dist/{chunk-YN763NWQ.js → chunk-7VMO2WOZ.js} +10 -4
  11. package/dist/chunk-7VMO2WOZ.js.map +1 -0
  12. package/dist/{chunk-Z5LUTUDN.js → chunk-CMGI7UZD.js} +3 -3
  13. package/dist/{chunk-EEN2TZUQ.js → chunk-FNPMWDUQ.js} +3 -3
  14. package/dist/{chunk-EJ4U242G.js → chunk-HDFYUFBI.js} +2 -2
  15. package/dist/{chunk-JZMJUPZP.js → chunk-JMJVGMXI.js} +2 -2
  16. package/dist/{chunk-JZMJUPZP.js.map → chunk-JMJVGMXI.js.map} +1 -1
  17. package/dist/{chunk-QGI4UCJX.js → chunk-JYGNMKZ5.js} +62 -35
  18. package/dist/chunk-JYGNMKZ5.js.map +1 -0
  19. package/dist/{chunk-CRHPDPRS.js → chunk-KCHKFYVX.js} +30 -8
  20. package/dist/{chunk-CRHPDPRS.js.map → chunk-KCHKFYVX.js.map} +1 -1
  21. package/dist/{chunk-ZD3KHESI.js → chunk-KRWRUU6R.js} +27 -7
  22. package/dist/chunk-KRWRUU6R.js.map +1 -0
  23. package/dist/{chunk-ENDHMYEJ.js → chunk-NHTEKEYE.js} +3 -3
  24. package/dist/{chunk-CQE46HSM.js → chunk-PRBRSIZP.js} +14 -8
  25. package/dist/chunk-PRBRSIZP.js.map +1 -0
  26. package/dist/{chunk-NL7CVG56.js → chunk-UETBLPKM.js} +57 -10
  27. package/dist/chunk-UETBLPKM.js.map +1 -0
  28. package/dist/{chunk-QQVWGWPI.js → chunk-VGYN2KU2.js} +8494 -1504
  29. package/dist/chunk-VGYN2KU2.js.map +1 -0
  30. package/dist/{chunk-ZTOE3ND3.js → chunk-XJ5YYYGC.js} +4 -4
  31. package/dist/{credential-LO2SEEHU.js → credential-E6KUHRGU.js} +5 -5
  32. package/dist/{credential-template-ZN7W7734.js → credential-template-4GPOPBGD.js} +5 -5
  33. package/dist/{debug-workflow-R3RYYAXK.js → debug-workflow-XCLCY6S7.js} +5 -5
  34. package/dist/{docs-DIAFBDXQ.js → docs-COCZYMW6.js} +95 -11
  35. package/dist/docs-COCZYMW6.js.map +1 -0
  36. package/dist/{doctor-NZPUSCRE.js → doctor-ERIVTCQS.js} +3 -3
  37. package/dist/{environment-RQVU4P5M.js → environment-7Y4BV6XY.js} +5 -5
  38. package/dist/{feature-flag-XG26RURR.js → feature-flag-MHONEX6T.js} +98 -12
  39. package/dist/feature-flag-MHONEX6T.js.map +1 -0
  40. package/dist/index.js +107 -51
  41. package/dist/index.js.map +1 -1
  42. package/dist/{init-EDNLKGPT.js → init-OROOM4HF.js} +5 -5
  43. package/dist/{install-FYZ3HNZK.js → install-OJFXHY6U.js} +5 -5
  44. package/dist/{issues-NNRVTJ4L.js → issues-32GONR6C.js} +5 -5
  45. package/dist/{knobs-A2BOBH22.js → knobs-UQGGY3CP.js} +7 -6
  46. package/dist/knobs-UQGGY3CP.js.map +1 -0
  47. package/dist/{list-F33VZ4BJ.js → list-ZMIKEC5P.js} +5 -5
  48. package/dist/{local-DQDTM3XA.js → local-PUD24GGQ.js} +7 -7
  49. package/dist/{login-BUMVIB36.js → login-BSO7YX2D.js} +5 -5
  50. package/dist/{mcp-B5Y5CDMQ.js → mcp-4LS7OJUT.js} +9 -9
  51. package/dist/{mcp-B5Y5CDMQ.js.map → mcp-4LS7OJUT.js.map} +1 -1
  52. package/dist/{pdf-extract-ABWV3L5X.js → pdf-extract-YHE54XU4.js} +2 -2
  53. package/dist/product-3JKSJCBC.js +346 -0
  54. package/dist/product-3JKSJCBC.js.map +1 -0
  55. package/dist/{property-NJ4SRXQG.js → property-K5DBL4UE.js} +5 -5
  56. package/dist/{psql-VBZFCMNR.js → psql-PQFUFTSE.js} +3 -3
  57. package/dist/{record-WAO36O7G.js → record-EIIYLFJ4.js} +6 -6
  58. package/dist/{redis-DHZXHL4S.js → redis-BU36EZZI.js} +3 -3
  59. package/dist/redis-BU36EZZI.js.map +1 -0
  60. package/dist/{release-STJKUKTE.js → release-LYC2P7DZ.js} +5 -5
  61. package/dist/{sandbox-DWSGLY7B.js → sandbox-CKHXXZHU.js} +51 -7
  62. package/dist/sandbox-CKHXXZHU.js.map +1 -0
  63. package/dist/{scenarios-HCIDY725.js → scenarios-2XJ2G3KR.js} +5 -5
  64. package/dist/{session-Y5RHU54D.js → session-UTOD5ZYH.js} +8 -9
  65. package/dist/session-UTOD5ZYH.js.map +1 -0
  66. package/dist/{skill-23WAHUOB.js → skill-GMAERMQL.js} +10 -10
  67. package/dist/{skill-23WAHUOB.js.map → skill-GMAERMQL.js.map} +1 -1
  68. package/dist/skills/debug-run/SKILL.md +7 -1
  69. package/dist/skills/debug-run/history/1.3.1.md +279 -0
  70. package/dist/skills/debug-run/version.json +1 -1
  71. package/dist/skills/optimize-cache/SKILL.md +29 -2
  72. package/dist/{spec-LM5XHOQ5.js → spec-2NP36U3Y.js} +5 -5
  73. package/dist/{src-22RI5VP2.js → src-4T6GHXVO.js} +2 -2
  74. package/dist/{src-NCJPUAE6.js → src-CG52HEE7.js} +10 -8
  75. package/dist/{src-Y3K7UJEF.js → src-PK5OZXCM.js} +2 -2
  76. package/dist/{src-BGDRMOKC.js → src-UEOOC425.js} +295 -102
  77. package/dist/src-UEOOC425.js.map +1 -0
  78. package/dist/{start-SWY55CZX.js → start-3C7EEFW2.js} +5 -5
  79. package/dist/{tag-YSU2XXPI.js → tag-JSHOMLBR.js} +6 -6
  80. package/dist/{task-NLBKLD7D.js → task-YGWVYTBJ.js} +5 -5
  81. package/dist/{test-suite-QCPWZ2LS.js → test-suite-LI7ZH367.js} +10 -8
  82. package/dist/{test-suite-QCPWZ2LS.js.map → test-suite-LI7ZH367.js.map} +1 -1
  83. package/dist/trace-UMLOSIIR.js +16 -0
  84. package/dist/{triage-TT4BMDBU.js → triage-ZWJG4NBJ.js} +6 -6
  85. package/dist/{upgrade-6ZUFETKX.js → upgrade-S7CGEK6H.js} +3 -3
  86. package/dist/{workflow-2CX3ZNOQ.js → workflow-T4HSAOGW.js} +86 -15
  87. package/dist/workflow-T4HSAOGW.js.map +1 -0
  88. package/dist/{workflow-cache-GXNE6SU2.js → workflow-cache-XVEZ36KF.js} +8 -8
  89. package/dist/{workflow-debug-PRX3DWGD.js → workflow-debug-T2BULXZ7.js} +9 -9
  90. package/dist/{workflow-proposals-BW327WGL.js → workflow-proposals-XXEZICN2.js} +5 -7
  91. package/dist/workflow-proposals-XXEZICN2.js.map +1 -0
  92. package/package.json +1 -1
  93. package/dist/chunk-CQE46HSM.js.map +0 -1
  94. package/dist/chunk-NL7CVG56.js.map +0 -1
  95. package/dist/chunk-QGI4UCJX.js.map +0 -1
  96. package/dist/chunk-QQVWGWPI.js.map +0 -1
  97. package/dist/chunk-YN763NWQ.js.map +0 -1
  98. package/dist/chunk-ZD3KHESI.js.map +0 -1
  99. package/dist/docs-DIAFBDXQ.js.map +0 -1
  100. package/dist/feature-flag-XG26RURR.js.map +0 -1
  101. package/dist/knobs-A2BOBH22.js.map +0 -1
  102. package/dist/redis-DHZXHL4S.js.map +0 -1
  103. package/dist/sandbox-DWSGLY7B.js.map +0 -1
  104. package/dist/session-Y5RHU54D.js.map +0 -1
  105. package/dist/src-BGDRMOKC.js.map +0 -1
  106. package/dist/trace-A3ZY6K26.js +0 -16
  107. package/dist/workflow-2CX3ZNOQ.js.map +0 -1
  108. package/dist/workflow-proposals-BW327WGL.js.map +0 -1
  109. /package/dist/{api-catalog-7HLEN7C2.js.map → api-catalog-WTFQNLK6.js.map} +0 -0
  110. /package/dist/{attachment-OVNQD6Z2.js.map → attachment-U3NKVPEY.js.map} +0 -0
  111. /package/dist/{auth-VUHL74FH.js.map → auth-VQG2CDUD.js.map} +0 -0
  112. /package/dist/{chunk-PZ4LCN6K.js.map → chunk-3X3NW7QA.js.map} +0 -0
  113. /package/dist/{chunk-VGTKUOYS.js.map → chunk-46IUJXSD.js.map} +0 -0
  114. /package/dist/{chunk-Z5LUTUDN.js.map → chunk-CMGI7UZD.js.map} +0 -0
  115. /package/dist/{chunk-EEN2TZUQ.js.map → chunk-FNPMWDUQ.js.map} +0 -0
  116. /package/dist/{chunk-EJ4U242G.js.map → chunk-HDFYUFBI.js.map} +0 -0
  117. /package/dist/{chunk-ENDHMYEJ.js.map → chunk-NHTEKEYE.js.map} +0 -0
  118. /package/dist/{chunk-ZTOE3ND3.js.map → chunk-XJ5YYYGC.js.map} +0 -0
  119. /package/dist/{credential-LO2SEEHU.js.map → credential-E6KUHRGU.js.map} +0 -0
  120. /package/dist/{credential-template-ZN7W7734.js.map → credential-template-4GPOPBGD.js.map} +0 -0
  121. /package/dist/{debug-workflow-R3RYYAXK.js.map → debug-workflow-XCLCY6S7.js.map} +0 -0
  122. /package/dist/{doctor-NZPUSCRE.js.map → doctor-ERIVTCQS.js.map} +0 -0
  123. /package/dist/{environment-RQVU4P5M.js.map → environment-7Y4BV6XY.js.map} +0 -0
  124. /package/dist/{init-EDNLKGPT.js.map → init-OROOM4HF.js.map} +0 -0
  125. /package/dist/{install-FYZ3HNZK.js.map → install-OJFXHY6U.js.map} +0 -0
  126. /package/dist/{issues-NNRVTJ4L.js.map → issues-32GONR6C.js.map} +0 -0
  127. /package/dist/{list-F33VZ4BJ.js.map → list-ZMIKEC5P.js.map} +0 -0
  128. /package/dist/{local-DQDTM3XA.js.map → local-PUD24GGQ.js.map} +0 -0
  129. /package/dist/{login-BUMVIB36.js.map → login-BSO7YX2D.js.map} +0 -0
  130. /package/dist/{pdf-extract-ABWV3L5X.js.map → pdf-extract-YHE54XU4.js.map} +0 -0
  131. /package/dist/{property-NJ4SRXQG.js.map → property-K5DBL4UE.js.map} +0 -0
  132. /package/dist/{psql-VBZFCMNR.js.map → psql-PQFUFTSE.js.map} +0 -0
  133. /package/dist/{record-WAO36O7G.js.map → record-EIIYLFJ4.js.map} +0 -0
  134. /package/dist/{release-STJKUKTE.js.map → release-LYC2P7DZ.js.map} +0 -0
  135. /package/dist/{scenarios-HCIDY725.js.map → scenarios-2XJ2G3KR.js.map} +0 -0
  136. /package/dist/{spec-LM5XHOQ5.js.map → spec-2NP36U3Y.js.map} +0 -0
  137. /package/dist/{src-22RI5VP2.js.map → src-4T6GHXVO.js.map} +0 -0
  138. /package/dist/{src-NCJPUAE6.js.map → src-CG52HEE7.js.map} +0 -0
  139. /package/dist/{src-Y3K7UJEF.js.map → src-PK5OZXCM.js.map} +0 -0
  140. /package/dist/{start-SWY55CZX.js.map → start-3C7EEFW2.js.map} +0 -0
  141. /package/dist/{tag-YSU2XXPI.js.map → tag-JSHOMLBR.js.map} +0 -0
  142. /package/dist/{task-NLBKLD7D.js.map → task-YGWVYTBJ.js.map} +0 -0
  143. /package/dist/{trace-A3ZY6K26.js.map → trace-UMLOSIIR.js.map} +0 -0
  144. /package/dist/{triage-TT4BMDBU.js.map → triage-ZWJG4NBJ.js.map} +0 -0
  145. /package/dist/{upgrade-6ZUFETKX.js.map → upgrade-S7CGEK6H.js.map} +0 -0
  146. /package/dist/{workflow-cache-GXNE6SU2.js.map → workflow-cache-XVEZ36KF.js.map} +0 -0
  147. /package/dist/{workflow-debug-PRX3DWGD.js.map → workflow-debug-T2BULXZ7.js.map} +0 -0
@@ -1,12 +1,12 @@
1
1
  import { createRequire as __cr } from "module"; const require = __cr(import.meta.url);
2
2
  import {
3
3
  apiRequest
4
- } from "./chunk-CQE46HSM.js";
4
+ } from "./chunk-PRBRSIZP.js";
5
5
  import {
6
6
  getArgValue,
7
7
  hasFlag,
8
8
  resolveConfig
9
- } from "./chunk-PZ4LCN6K.js";
9
+ } from "./chunk-3X3NW7QA.js";
10
10
 
11
11
  // src/tag.ts
12
12
  import process from "process";
@@ -423,4 +423,4 @@ export {
423
423
  applyWorkflowTagFlags,
424
424
  runTag
425
425
  };
426
- //# sourceMappingURL=chunk-EEN2TZUQ.js.map
426
+ //# sourceMappingURL=chunk-FNPMWDUQ.js.map
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __cr } from "module"; const require = __cr(import.meta.url);
2
2
  import {
3
3
  PlaywrightClient
4
- } from "./chunk-QQVWGWPI.js";
4
+ } from "./chunk-VGYN2KU2.js";
5
5
 
6
6
  // src/local-browser/host.ts
7
7
  var HEARTBEAT_INTERVAL_MS = 3e4;
@@ -410,4 +410,4 @@ export {
410
410
  LocalBrowserHost,
411
411
  USER_PAUSED_ERROR
412
412
  };
413
- //# sourceMappingURL=chunk-EJ4U242G.js.map
413
+ //# sourceMappingURL=chunk-HDFYUFBI.js.map
@@ -36,7 +36,7 @@ function readBrandEnvFor(canaryName, brand, env = process.env) {
36
36
  const order = brand === "cofactor" ? [cofactorName, canaryName] : [canaryName, cofactorName];
37
37
  for (const name of order) {
38
38
  const value = env[name];
39
- if (value != null && value !== "") return value;
39
+ if (value !== null && value !== void 0 && value !== "") return value;
40
40
  }
41
41
  return void 0;
42
42
  }
@@ -89,4 +89,4 @@ export {
89
89
  splitSpecExtension,
90
90
  installConsoleBranding
91
91
  };
92
- //# sourceMappingURL=chunk-JZMJUPZP.js.map
92
+ //# sourceMappingURL=chunk-JMJVGMXI.js.map
@@ -1 +1 @@
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 !== '') 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,cAAc,WAAW,EACjC,QAAQ,kBAAkB,iBAAiB;AAChD;AAeO,SAAS,gBACd,YACA,OACA,MAAyB,QAAQ,KACb;AACpB,QAAM,eAAe,WAAW,QAAQ,YAAY,WAAW;AAC/D,QAAM,QAAQ,UAAU,aAAa,CAAC,cAAc,UAAU,IAAI,CAAC,YAAY,YAAY;AAC3F,aAAW,QAAQ,OAAO;AACxB,UAAM,QAAQ,IAAI,IAAI;AACtB,QAAI,SAAS,QAAQ,UAAU,GAAI,QAAO;AAAA,EAC5C;AACA,SAAO;AACT;AAGO,SAAS,aACd,YACA,MAAyB,QAAQ,KACb;AACpB,SAAO,gBAAgB,YAAY,SAAS,GAAG;AACjD;AAYO,IAAM,kBAAkB,CAAC,gBAAgB,YAAY;AAQrD,IAAM,YAAY,CAAC,YAAY,QAAQ;AAGvC,SAAS,iBAAiB,OAAsB;AACrD,SAAO,UAAU,aAAa,iBAAiB;AACjD;AAGO,SAAS,WAAW,OAAsB;AAC/C,SAAO,KAAK,KAAK,UAAU,aAAa,aAAa,UAAU,OAAO;AACxE;AAGO,IAAM,gBAAwB,iBAAiB,OAAO;AAGtD,IAAM,UAAkB,WAAW,OAAO;AAU1C,SAAS,mBAA6B;AAC3C,SAAO,UAAU,IAAI,CAAC,SAAS,KAAK,KAAK,MAAM,OAAO,CAAC;AACzD;AAGO,SAAS,WAAW,MAAuB;AAChD,SAAO,gBAAgB,KAAK,CAAC,QAAQ,KAAK,SAAS,GAAG,CAAC;AACzD;AAOO,SAAS,mBAAmB,MAAoD;AACrF,aAAW,OAAO,iBAAiB;AACjC,QAAI,KAAK,SAAS,GAAG,EAAG,QAAO,EAAE,MAAM,KAAK,MAAM,GAAG,CAAC,IAAI,MAAM,GAAG,IAAI;AAAA,EACzE;AACA,SAAO;AACT;AAQO,SAAS,yBAA+B;AAC7C,MAAI,YAAY,SAAU;AAC1B,QAAM,UAAU,CAAC,OAAO,SAAS,QAAQ,MAAM;AAC/C,aAAW,UAAU,SAAS;AAC5B,UAAM,WAAW,QAAQ,MAAM,EAAE,KAAK,OAAO;AAC7C,YAAQ,MAAM,IAAI,IAAI,SAAoB;AACxC,eAAS,GAAG,KAAK,IAAI,CAAC,QAAS,OAAO,QAAQ,WAAW,UAAU,GAAG,IAAI,GAAI,CAAC;AAAA,IACjF;AAAA,EACF;AACF;","names":["require"]}
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,cAAc,WAAW,EACjC,QAAQ,kBAAkB,iBAAiB;AAChD;AAeO,SAAS,gBACd,YACA,OACA,MAAyB,QAAQ,KACb;AACpB,QAAM,eAAe,WAAW,QAAQ,YAAY,WAAW;AAC/D,QAAM,QAAQ,UAAU,aAAa,CAAC,cAAc,UAAU,IAAI,CAAC,YAAY,YAAY;AAC3F,aAAW,QAAQ,OAAO;AACxB,UAAM,QAAQ,IAAI,IAAI;AACtB,QAAI,UAAU,QAAQ,UAAU,UAAa,UAAU,GAAI,QAAO;AAAA,EACpE;AACA,SAAO;AACT;AAGO,SAAS,aACd,YACA,MAAyB,QAAQ,KACb;AACpB,SAAO,gBAAgB,YAAY,SAAS,GAAG;AACjD;AAYO,IAAM,kBAAkB,CAAC,gBAAgB,YAAY;AAQrD,IAAM,YAAY,CAAC,YAAY,QAAQ;AAGvC,SAAS,iBAAiB,OAAsB;AACrD,SAAO,UAAU,aAAa,iBAAiB;AACjD;AAGO,SAAS,WAAW,OAAsB;AAC/C,SAAO,KAAK,KAAK,UAAU,aAAa,aAAa,UAAU,OAAO;AACxE;AAGO,IAAM,gBAAwB,iBAAiB,OAAO;AAGtD,IAAM,UAAkB,WAAW,OAAO;AAU1C,SAAS,mBAA6B;AAC3C,SAAO,UAAU,IAAI,CAAC,SAAS,KAAK,KAAK,MAAM,OAAO,CAAC;AACzD;AAGO,SAAS,WAAW,MAAuB;AAChD,SAAO,gBAAgB,KAAK,CAAC,QAAQ,KAAK,SAAS,GAAG,CAAC;AACzD;AAOO,SAAS,mBAAmB,MAAoD;AACrF,aAAW,OAAO,iBAAiB;AACjC,QAAI,KAAK,SAAS,GAAG,EAAG,QAAO,EAAE,MAAM,KAAK,MAAM,GAAG,CAAC,IAAI,MAAM,GAAG,IAAI;AAAA,EACzE;AACA,SAAO;AACT;AAQO,SAAS,yBAA+B;AAC7C,MAAI,YAAY,SAAU;AAC1B,QAAM,UAAU,CAAC,OAAO,SAAS,QAAQ,MAAM;AAC/C,aAAW,UAAU,SAAS;AAC5B,UAAM,WAAW,QAAQ,MAAM,EAAE,KAAK,OAAO;AAC7C,YAAQ,MAAM,IAAI,IAAI,SAAoB;AACxC,eAAS,GAAG,KAAK,IAAI,CAAC,QAAS,OAAO,QAAQ,WAAW,UAAU,GAAG,IAAI,GAAI,CAAC;AAAA,IACjF;AAAA,EACF;AACF;","names":["require"]}
@@ -95,7 +95,7 @@ function normalizeNodeType(input) {
95
95
  }
96
96
 
97
97
  // ../types/src/index.ts
98
- import { z as z5 } from "zod";
98
+ import { z as z6 } from "zod";
99
99
 
100
100
  // ../types/src/credentials.ts
101
101
  import { z } from "zod";
@@ -172,11 +172,6 @@ var TLDR_LIMIT = 512;
172
172
  var URL_LIMIT = 2048;
173
173
  var STORAGE_KEY_LIMIT = 1024;
174
174
  var DIAGNOSTIC_LIMIT = 4e3;
175
- var NarrationTranscriptSegmentSchema = z2.object({
176
- startMs: z2.number().int().min(0),
177
- endMs: z2.number().int().min(1),
178
- text: z2.string().min(1)
179
- });
180
175
  var RecordIssueOccurrencePayloadSchema = z2.object({
181
176
  orgId: UUID,
182
177
  propertyId: UUID,
@@ -206,8 +201,6 @@ var RecordIssueOccurrencePayloadSchema = z2.object({
206
201
  videoStorageKey: optionalLimitedString(STORAGE_KEY_LIMIT),
207
202
  /** Action timeline for video overlay synchronization */
208
203
  videoTimelineJson: z2.unknown().optional().nullable(),
209
- /** Timed narration transcript for video overlay */
210
- narrationTranscriptJson: z2.array(NarrationTranscriptSegmentSchema).optional().nullable(),
211
204
  consoleLogExcerpt: optionalLimitedString(DIAGNOSTIC_LIMIT),
212
205
  networkFailureUrl: optionalLimitedString(URL_LIMIT),
213
206
  networkFailureStatus: z2.number().int().optional().nullable().transform((value) => value ?? null),
@@ -232,6 +225,21 @@ var benchmarkWorkflowSuiteConfigSchema = z3.object({
232
225
  sendSlackSummary: z3.boolean().optional()
233
226
  });
234
227
 
228
+ // ../types/src/api-sequence.ts
229
+ import { z as z4 } from "zod";
230
+ var ValidationOperatorSchema = z4.enum([
231
+ "equals",
232
+ "not_equals",
233
+ "gt",
234
+ "lt",
235
+ "gte",
236
+ "lte",
237
+ "contains",
238
+ "not_contains",
239
+ "is_set",
240
+ "is_not_set"
241
+ ]);
242
+
235
243
  // ../types/src/sandbox-tasks.ts
236
244
  var CHECKLIST_ITEMS = [
237
245
  {
@@ -443,11 +451,11 @@ var MACRO_ARG_COUNTS = new Map(MACRO_CATALOG.map((m) => [m.name, m.args.length])
443
451
  var MACRO_PATTERN = /(?<!\\)\$([A-Z_]+)\(([^)]*)\)/g;
444
452
 
445
453
  // ../types/src/workflow-node-schemas.ts
446
- import { z as z4 } from "zod";
447
- var FormFieldSchema = z4.object({
448
- name: z4.string().describe('Unique field identifier (snake_case, e.g., "search_query", "recipient_email")'),
449
- label: z4.string().describe('Human-friendly label (e.g., "Search Query", "Recipient Email")'),
450
- type: z4.enum([
454
+ import { z as z5 } from "zod";
455
+ var FormFieldSchema = z5.object({
456
+ name: z5.string().describe('Unique field identifier (snake_case, e.g., "search_query", "recipient_email")'),
457
+ label: z5.string().describe('Human-friendly label (e.g., "Search Query", "Recipient Email")'),
458
+ type: z5.enum([
451
459
  "text",
452
460
  "email",
453
461
  "password",
@@ -458,19 +466,38 @@ var FormFieldSchema = z4.object({
458
466
  "multiselect",
459
467
  "file"
460
468
  ]).optional().describe('Input type, defaults to "text"'),
461
- required: z4.boolean().optional().describe("Whether this field is required"),
462
- value: z4.string().describe("The value to use for this field"),
463
- options: z4.array(z4.object({ value: z4.string(), label: z4.string() })).optional().describe("If type is select/multiselect, provide allowed options here")
469
+ required: z5.boolean().optional().describe("Whether this field is required"),
470
+ value: z5.string().describe("The value to use for this field"),
471
+ options: z5.array(z5.object({ value: z5.string(), label: z5.string() })).optional().describe("If type is select/multiselect, provide allowed options here")
464
472
  });
465
- var AssertionSeverityEnum = z4.enum(["warn", "fail", "fatal"]);
466
- var InlineAssertionSchema = z4.object({
467
- condition: z4.string().describe("What to verify after the action"),
473
+ var AssertionSeverityEnum = z5.enum(["warn", "fail", "fatal"]);
474
+ var InlineAssertionSchema = z5.object({
475
+ condition: z5.string().describe("What to verify after the action"),
468
476
  severity: AssertionSeverityEnum.describe(
469
477
  "fatal = stop the test immediately on failure, fail = mark the run failed but keep going, warn = log a warning and continue (run still passes)"
470
478
  ),
471
- agentic: z4.boolean().optional().describe("true if requires visual/complex evaluation that cannot be cached")
479
+ agentic: z5.boolean().optional().describe("true if requires visual/complex evaluation that cannot be cached")
480
+ });
481
+ var ConditionSubjectSchema = z5.discriminatedUnion("kind", [
482
+ z5.object({
483
+ kind: z5.literal("variable"),
484
+ name: z5.string().describe('Input/variable name, e.g. "count" for $var.count')
485
+ }),
486
+ z5.object({
487
+ kind: z5.literal("acting_as")
488
+ })
489
+ ]);
490
+ var ConditionPredicateSchema = z5.object({
491
+ subject: ConditionSubjectSchema,
492
+ operator: ValidationOperatorSchema,
493
+ /**
494
+ * Right-hand operand. For a `variable` subject this is a literal (or `$var`
495
+ * reference); for `acting_as` it is a credential template id. Omitted for the
496
+ * unary operators `is_set` / `is_not_set`.
497
+ */
498
+ value: z5.string().optional()
472
499
  });
473
- var NodeTypeEnum = z4.enum([
500
+ var NodeTypeEnum = z5.enum([
474
501
  "login",
475
502
  "navigate",
476
503
  "action",
@@ -580,24 +607,24 @@ function isPositiveIntegerString(value) {
580
607
  if (!value || !/^\d+$/.test(value)) return false;
581
608
  return Number(value) > 0;
582
609
  }
583
- var playbookStepAgentSchema = z5.object({
584
- order: z5.number().describe("Step number (1-based)."),
585
- action: z5.enum(PLAYBOOK_STEP_ACTIONS).describe(
610
+ var playbookStepAgentSchema = z6.object({
611
+ order: z6.number().describe("Step number (1-based)."),
612
+ action: z6.enum(PLAYBOOK_STEP_ACTIONS).describe(
586
613
  'The type of browser interaction. PREFER DETERMINISTIC VERBS even when verbose \u2014 three deterministic steps beat one agentic step, because deterministic steps replay via Playwright with no agent dispatch. Each replayable playbook step must be 1:1 with an exposed browser tool you actually used and must correspond to zero or one recorded actionRef. If you cannot accomplish the intent with the browser tools you have, do not add a playbook step for it; report the limitation outside playbookSteps. Do not summarize several recorded actions into one "other" step; report the same 1:1 browser primitives you actually used. The only multi-field exception is one fill_form step for one browser_fill_form action. Use "verify" for assertion checks \u2014 both inline assertions and completion assertions proving the action succeeded. Use "verify" for inspection language such as "inspect whether", "confirm", "observe", or "check" when the result is visible in the DOM. Use "capture" instead only when the observed value is needed by later steps. Use "fill" for single-field inputs. Use "fill_form" when browser_fill_form was called to fill multiple fields at once \u2014 one fill_form step per call. Use "click" for checkboxes, switches, toggle buttons, and click-to-focus interactions. There is no separate "toggle" or "focus" action. Use "upload" for file upload actions, including generated CSV/file, attach file, choose file, import file, and document/image attachment intents (browser_action action="upload"). Set params.path to the staged attachment handle, generated file variable, or filename reference used by the upload tool (e.g. {path: "$var.csv_file"}), and include actionRefs pointing to the recorded file_upload action. Do NOT use "other" for file attachment/upload/import intents. Use "scroll" only when scrolling is the user-visible action being tested; routine browser_scroll calls for visibility, inspection, or video framing are observation steps and should usually be omitted from playbookSteps. Use "press_key" for keyboard actions (Enter, Escape, Tab, arrows). Use "press_key" with params.key="Escape" to dismiss a popover, dropdown, panel, or modal when Escape was the recorded action; use "click" if the recorded action clicked a close button or outside target. There is no separate "dismiss" action. Use "drag" for drag-and-drop interactions. Use "resize" when browser_resize was used to resize the viewport. Set params.width and params.height to positive integer pixel values and include the actionRef pointing to the recorded resize action. Use "capture" to extract app-generated values (IDs, codes, URLs) for later steps via $var.name, but only from a visible DOM target or the current URL. Do not capture from performance/network timing, storage, hidden DOM, or app-global state. Use "screenshot" only when browser_screenshot itself is the requested evidence capture. Set params.label when a label was used, optionally params.fullPage="true". Do not use screenshot for routine visual checks after actions; use verify when a browser_assert proves visible state. Use "extract_table" when browser_extract_table was used to extract tabular data from the page. Use "python_execute" when python_execute was used with cache_label to run a data validation script. Use "verify_download" when browser_download(action="list") / browser_list_downloads proves that a file matching some pattern was downloaded. Set params.pattern to a glob (supports *, ?) or substring; optionally params.timeoutMs. This is currently agent-only at replay, so do not set actionRefs. Use "verify_download_content" when browser_download(action="read") / browser_read_download content proves CSV headers, PDF text, exported rows, or similar downloaded-file content. Set params.contains or params.pattern to the expected content predicate. This is currently agent-only at replay, so do not set actionRefs. Use "agent_loop" ONLY when the action set is genuinely unknown until runtime \u2014 variable count of items (e.g. "toggle row checkboxes until 3 selected"), conditional retry that depends on UI state, or a runtime predicate over non-DOM state. Set params.goal to a one-sentence checkable predicate (e.g. params.goal = "3 grid row checkboxes are selected"). DO NOT use agent_loop for: known-N iteration (write N deterministic steps), single click that might double-fire (use "click"), retry-on-flake (the runtime handles that). agent_loop steps replay via a Playwright override authored after first run; they are non-deterministic on first run, so the bar is high. Network/devtools/API inspections and unsupported browser environment mutations are diagnostic-only unless there is an exposed browser tool for the action. If visible page state proves the condition, record that as "verify"; otherwise omit the diagnostic observation from playbookSteps. Do not use "other". If no concrete browser-tool-backed action above fits, omit the observation from playbookSteps and report the limitation outside the playbook.'
587
614
  ),
588
- target: z5.string().describe(
615
+ target: z6.string().describe(
589
616
  `Human-readable element description using visible labels, placeholders, or aria-labels. Examples: "'Submit' button", "'Email' input field", "'Status' dropdown". For upload actions, describe the file input and include the attachment name (e.g. "CSV file input for 'testing-checklist.csv'"). Never use coordinates, ref IDs, or internal identifiers.`
590
617
  ),
591
- params: z5.record(z5.string(), z5.string()).optional().describe(
618
+ params: z6.record(z6.string(), z6.string()).optional().describe(
592
619
  'Data values using $var.name references and $MACRO() expressions \u2014 NEVER hard-coded literals. Common keys: value (for fill: {value: "$EMAIL()"}), option (for select: {option: "Admin"} \u2014 fixed app constants like dropdown options are allowed as literals), url (for navigate: {url: "$var.target_url"}), path (for upload: {path: "$var.file_path"}), key (for press_key: {key: "Enter"}, {key: "Escape"}), width and height (for resize: {width: "390", height: "844"}), label and fullPage (for screenshot: {label: "seats-table", fullPage: "true"}), pattern or contains (for download verification: {pattern: "report-*.csv"} or {contains: "Expected Header"}), expression + saveAs (for capture: prefer a visible DOM ref expression or "() => window.location.href"; do not use performance.getEntries() or other network/storage/global state; e.g. {saveAs: "order_confirmation_id"}). For fill_form: keys are field names from the fill_form call, values are $var.name or $MACRO() (e.g. {company: "$var.company", email: "$EMAIL()"}). Available macros: $UUID(), $EMAIL(), $FIRST_NAME(), $LAST_NAME(), $PHONE(), $RANDOM_STRING(n), $RANDOM_INT(min,max), $TODAY(), $DATE(days), $NOW(), $TIMESTAMP(), $SEQUENCE("name").'
593
620
  ),
594
- note: z5.string().optional().describe(
621
+ note: z6.string().optional().describe(
595
622
  'Timing or quirk notes ONLY (e.g. "Wait 1s for modal animation", "Scroll into view first"). Do NOT put data values, optional markers, or verification notes here.'
596
623
  ),
597
- actionRefs: z5.array(z5.number()).max(1).optional().describe(
624
+ actionRefs: z6.array(z6.number()).max(1).optional().describe(
598
625
  'Zero or one recorded browser action index that corresponds to this playbook step. Interaction tools, browser_resize, capture evaluates (browser_evaluate with saveAs), and browser_assert produce [Action #N] tags \u2014 collect those indices here. Read-only browser_snapshot and plain browser_evaluate without saveAs do NOT produce action indices. browser_scroll and browser_screenshot may produce action indices when they are the primary requested tool call; omit actionRefs when no action tag was emitted. If you took multiple cacheable UI actions, report multiple 1:1 playbook steps instead of putting multiple refs on one step or summarizing them as "other". A fill_form call is a single action \u2014 use one fill_form playbook step with one actionRef. For a click that triggers a native dialog, keep one click actionRef on the click step and set expectedDialogs rather than adding a separate dialog actionRef. Actions not referenced by any playbook step are considered exploratory and will be discarded by the cache compiler.'
599
626
  ),
600
- expectedDialogs: z5.enum(["accept", "dismiss"]).optional().describe(
627
+ expectedDialogs: z6.enum(["accept", "dismiss"]).optional().describe(
601
628
  'Set when this step is known to fire a native browser dialog (alert/confirm/prompt) \u2014 e.g. clicking a "Delete" button that prompts "Are you sure?". On replay the runtime pre-arms the dialog handler with this action automatically. In free-form runs, you should call the dialog tool (browser_dialog for consolidated tools, browser_handle_dialog for legacy tools) with this action immediately before the step. Do not add a separate dialog step \u2014 keeping the pre-arm on the triggering step keeps the pre-arm and the triggering action in one place.'
602
629
  )
603
630
  }).superRefine((step, ctx) => {
@@ -605,7 +632,7 @@ var playbookStepAgentSchema = z5.object({
605
632
  const goal = step.params?.goal;
606
633
  if (!goal || goal.trim().length === 0) {
607
634
  ctx.addIssue({
608
- code: z5.ZodIssueCode.custom,
635
+ code: z6.ZodIssueCode.custom,
609
636
  path: ["params", "goal"],
610
637
  message: 'agent_loop steps must set params.goal to a one-sentence checkable predicate (e.g. "3 grid row checkboxes are selected").'
611
638
  });
@@ -615,7 +642,7 @@ var playbookStepAgentSchema = z5.object({
615
642
  const pattern = step.params?.pattern;
616
643
  if (!pattern || pattern.trim().length === 0) {
617
644
  ctx.addIssue({
618
- code: z5.ZodIssueCode.custom,
645
+ code: z6.ZodIssueCode.custom,
619
646
  path: ["params", "pattern"],
620
647
  message: "verify_download steps must set params.pattern to a glob (supports *, ?) or substring matching the expected filename."
621
648
  });
@@ -626,7 +653,7 @@ var playbookStepAgentSchema = z5.object({
626
653
  const contains = step.params?.contains;
627
654
  if ((!pattern || pattern.trim().length === 0) && (!contains || contains.trim().length === 0)) {
628
655
  ctx.addIssue({
629
- code: z5.ZodIssueCode.custom,
656
+ code: z6.ZodIssueCode.custom,
630
657
  path: ["params"],
631
658
  message: "verify_download_content steps must set params.contains or params.pattern for the expected downloaded content."
632
659
  });
@@ -637,14 +664,14 @@ var playbookStepAgentSchema = z5.object({
637
664
  const height = step.params?.height;
638
665
  if (!isPositiveIntegerString(width)) {
639
666
  ctx.addIssue({
640
- code: z5.ZodIssueCode.custom,
667
+ code: z6.ZodIssueCode.custom,
641
668
  path: ["params", "width"],
642
669
  message: "resize steps must set params.width to a positive integer pixel value."
643
670
  });
644
671
  }
645
672
  if (!isPositiveIntegerString(height)) {
646
673
  ctx.addIssue({
647
- code: z5.ZodIssueCode.custom,
674
+ code: z6.ZodIssueCode.custom,
648
675
  path: ["params", "height"],
649
676
  message: "resize steps must set params.height to a positive integer pixel value."
650
677
  });
@@ -666,4 +693,4 @@ export {
666
693
  stableIdentifierPrefix,
667
694
  stableAttrSelector
668
695
  };
669
- //# sourceMappingURL=chunk-QGI4UCJX.js.map
696
+ //# sourceMappingURL=chunk-JYGNMKZ5.js.map