@jevitate/cli 0.12.0 → 0.14.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 (271) hide show
  1. package/dist/author-journey-cli.d.ts +9 -0
  2. package/dist/author-journey-cli.js +18 -1
  3. package/dist/author-journey-cli.js.map +1 -1
  4. package/dist/bin.js +25673 -24216
  5. package/dist/build-info.generated.js +2 -2
  6. package/dist/catalog-analysis.js +4 -2
  7. package/dist/catalog-analysis.js.map +1 -1
  8. package/dist/catalog-bundle-api.js +1 -3
  9. package/dist/catalog-bundle-api.js.map +1 -1
  10. package/dist/catalog-bundle-findings.js +1 -3
  11. package/dist/catalog-bundle-findings.js.map +1 -1
  12. package/dist/catalog-bundle.js +1 -4
  13. package/dist/catalog-bundle.js.map +1 -1
  14. package/dist/catalog-cli.js +48 -6
  15. package/dist/catalog-cli.js.map +1 -1
  16. package/dist/catalog-review.d.ts +8 -0
  17. package/dist/catalog-review.js +26 -0
  18. package/dist/catalog-review.js.map +1 -1
  19. package/dist/catalog.d.ts +42 -0
  20. package/dist/catalog.js +67 -4
  21. package/dist/catalog.js.map +1 -1
  22. package/dist/check-execute.js +9 -0
  23. package/dist/check-execute.js.map +1 -1
  24. package/dist/check-plan.d.ts +5 -2
  25. package/dist/check-plan.js +9 -5
  26. package/dist/check-plan.js.map +1 -1
  27. package/dist/check-suite.js +1 -3
  28. package/dist/check-suite.js.map +1 -1
  29. package/dist/cli-output.js +1 -3
  30. package/dist/cli-output.js.map +1 -1
  31. package/dist/cli-shared.d.ts +1 -1
  32. package/dist/cli-shared.js +2 -0
  33. package/dist/cli-shared.js.map +1 -1
  34. package/dist/defect-evidence.js +4 -8
  35. package/dist/defect-evidence.js.map +1 -1
  36. package/dist/environments.d.ts +1 -1
  37. package/dist/environments.js +1 -1
  38. package/dist/environments.js.map +1 -1
  39. package/dist/exit-codes.d.ts +0 -1
  40. package/dist/exit-codes.js +2 -0
  41. package/dist/exit-codes.js.map +1 -1
  42. package/dist/explore-adversarial.d.ts +10 -1
  43. package/dist/explore-adversarial.js +3 -0
  44. package/dist/explore-adversarial.js.map +1 -1
  45. package/dist/explore-cli/adversarial-strategy.d.ts +3 -0
  46. package/dist/explore-cli/adversarial-strategy.js +101 -0
  47. package/dist/explore-cli/adversarial-strategy.js.map +1 -0
  48. package/dist/explore-cli/coverage-strategy.d.ts +3 -0
  49. package/dist/explore-cli/coverage-strategy.js +97 -0
  50. package/dist/explore-cli/coverage-strategy.js.map +1 -0
  51. package/dist/explore-cli/feature-strategy.d.ts +3 -0
  52. package/dist/explore-cli/feature-strategy.js +60 -0
  53. package/dist/explore-cli/feature-strategy.js.map +1 -0
  54. package/dist/explore-cli/goal-strategy.d.ts +3 -0
  55. package/dist/explore-cli/goal-strategy.js +185 -0
  56. package/dist/explore-cli/goal-strategy.js.map +1 -0
  57. package/dist/explore-cli/options.d.ts +3 -0
  58. package/dist/explore-cli/options.js +157 -0
  59. package/dist/explore-cli/options.js.map +1 -0
  60. package/dist/explore-cli/run.d.ts +7 -0
  61. package/dist/explore-cli/run.js +702 -0
  62. package/dist/explore-cli/run.js.map +1 -0
  63. package/dist/explore-cli/scope-region.d.ts +17 -0
  64. package/dist/explore-cli/scope-region.js +24 -0
  65. package/dist/explore-cli/scope-region.js.map +1 -0
  66. package/dist/explore-cli/shared.d.ts +167 -0
  67. package/dist/explore-cli/shared.js +20 -0
  68. package/dist/explore-cli/shared.js.map +1 -0
  69. package/dist/explore-cli/usability-strategy.d.ts +3 -0
  70. package/dist/explore-cli/usability-strategy.js +137 -0
  71. package/dist/explore-cli/usability-strategy.js.map +1 -0
  72. package/dist/explore-cli.d.ts +2 -2
  73. package/dist/explore-cli.js +2 -1347
  74. package/dist/explore-cli.js.map +1 -1
  75. package/dist/explore-coverage.d.ts +10 -1
  76. package/dist/explore-coverage.js +3 -0
  77. package/dist/explore-coverage.js.map +1 -1
  78. package/dist/explore-feature.d.ts +6 -0
  79. package/dist/explore-feature.js +1 -0
  80. package/dist/explore-feature.js.map +1 -1
  81. package/dist/explore-goal.d.ts +6 -0
  82. package/dist/explore-goal.js +1 -0
  83. package/dist/explore-goal.js.map +1 -1
  84. package/dist/explore-specs.d.ts +3 -1
  85. package/dist/explore-specs.js +2 -1
  86. package/dist/explore-specs.js.map +1 -1
  87. package/dist/github-issue-filer.js +1 -4
  88. package/dist/github-issue-filer.js.map +1 -1
  89. package/dist/goal-run-flags.d.ts +0 -1
  90. package/dist/goal-run-flags.js.map +1 -1
  91. package/dist/inbox-cli.js +1 -3
  92. package/dist/inbox-cli.js.map +1 -1
  93. package/dist/init-skills.js +1 -4
  94. package/dist/init-skills.js.map +1 -1
  95. package/dist/journey-anchor-api.d.ts +10 -9
  96. package/dist/journey-anchor-api.js +12 -22
  97. package/dist/journey-anchor-api.js.map +1 -1
  98. package/dist/journey-anchor-cli.d.ts +1 -1
  99. package/dist/journey-anchor-cli.js +22 -8
  100. package/dist/journey-anchor-cli.js.map +1 -1
  101. package/dist/journey-cli/anchors.d.ts +4 -0
  102. package/dist/journey-cli/anchors.js +48 -0
  103. package/dist/journey-cli/anchors.js.map +1 -0
  104. package/dist/journey-cli/find.d.ts +4 -0
  105. package/dist/journey-cli/find.js +44 -0
  106. package/dist/journey-cli/find.js.map +1 -0
  107. package/dist/journey-cli/lint.d.ts +4 -0
  108. package/dist/journey-cli/lint.js +84 -0
  109. package/dist/journey-cli/lint.js.map +1 -0
  110. package/dist/journey-cli/list.d.ts +4 -0
  111. package/dist/journey-cli/list.js +48 -0
  112. package/dist/journey-cli/list.js.map +1 -0
  113. package/dist/journey-cli/migrate.d.ts +4 -0
  114. package/dist/journey-cli/migrate.js +101 -0
  115. package/dist/journey-cli/migrate.js.map +1 -0
  116. package/dist/journey-cli/promote.d.ts +4 -0
  117. package/dist/journey-cli/promote.js +181 -0
  118. package/dist/journey-cli/promote.js.map +1 -0
  119. package/dist/journey-cli/publish.d.ts +4 -0
  120. package/dist/journey-cli/publish.js +70 -0
  121. package/dist/journey-cli/publish.js.map +1 -0
  122. package/dist/journey-cli/review.d.ts +4 -0
  123. package/dist/journey-cli/review.js +108 -0
  124. package/dist/journey-cli/review.js.map +1 -0
  125. package/dist/journey-cli/run.d.ts +4 -0
  126. package/dist/journey-cli/run.js +244 -0
  127. package/dist/journey-cli/run.js.map +1 -0
  128. package/dist/journey-cli/shared.d.ts +9 -0
  129. package/dist/journey-cli/shared.js +12 -0
  130. package/dist/journey-cli/shared.js.map +1 -0
  131. package/dist/journey-cli/verify.d.ts +4 -0
  132. package/dist/journey-cli/verify.js +125 -0
  133. package/dist/journey-cli/verify.js.map +1 -0
  134. package/dist/journey-cli.d.ts +3 -2
  135. package/dist/journey-cli.js +25 -950
  136. package/dist/journey-cli.js.map +1 -1
  137. package/dist/journey-link-api.d.ts +40 -0
  138. package/dist/journey-link-api.js +90 -0
  139. package/dist/journey-link-api.js.map +1 -0
  140. package/dist/journey-link-cli.d.ts +7 -0
  141. package/dist/journey-link-cli.js +58 -0
  142. package/dist/journey-link-cli.js.map +1 -0
  143. package/dist/journey-link-hints.d.ts +8 -0
  144. package/dist/journey-link-hints.js +68 -0
  145. package/dist/journey-link-hints.js.map +1 -0
  146. package/dist/journey-lint-sarif.js +3 -0
  147. package/dist/journey-lint-sarif.js.map +1 -1
  148. package/dist/journey-network-checks.d.ts +9 -1
  149. package/dist/journey-network-checks.js +55 -12
  150. package/dist/journey-network-checks.js.map +1 -1
  151. package/dist/journey-prefix.d.ts +9 -1
  152. package/dist/journey-prefix.js +12 -0
  153. package/dist/journey-prefix.js.map +1 -1
  154. package/dist/journey-review/render.d.ts +43 -0
  155. package/dist/journey-review/render.js +461 -0
  156. package/dist/journey-review/render.js.map +1 -0
  157. package/dist/journey-review-api.d.ts +1 -0
  158. package/dist/journey-review-api.js +7 -0
  159. package/dist/journey-review-api.js.map +1 -1
  160. package/dist/journey-review-store.js +1 -0
  161. package/dist/journey-review-store.js.map +1 -1
  162. package/dist/journey-review.d.ts +6 -4
  163. package/dist/journey-review.js +18 -393
  164. package/dist/journey-review.js.map +1 -1
  165. package/dist/journey-verify.js +2 -1
  166. package/dist/journey-verify.js.map +1 -1
  167. package/dist/ledger-api.js +1 -4
  168. package/dist/ledger-api.js.map +1 -1
  169. package/dist/locator-health-api.js +1 -3
  170. package/dist/locator-health-api.js.map +1 -1
  171. package/dist/locator-health.d.ts +0 -1
  172. package/dist/locator-health.js +0 -3
  173. package/dist/locator-health.js.map +1 -1
  174. package/dist/log-classes.js +1 -3
  175. package/dist/log-classes.js.map +1 -1
  176. package/dist/log-sources.js +17 -1
  177. package/dist/log-sources.js.map +1 -1
  178. package/dist/mcp-api.js +16 -821
  179. package/dist/mcp-api.js.map +1 -1
  180. package/dist/mcp-cli-tools.js +48 -7
  181. package/dist/mcp-cli-tools.js.map +1 -1
  182. package/dist/mcp-tools/cli.d.ts +3 -0
  183. package/dist/mcp-tools/cli.js +20 -0
  184. package/dist/mcp-tools/cli.js.map +1 -0
  185. package/dist/mcp-tools/explore.d.ts +3 -0
  186. package/dist/mcp-tools/explore.js +141 -0
  187. package/dist/mcp-tools/explore.js.map +1 -0
  188. package/dist/mcp-tools/findings.d.ts +3 -0
  189. package/dist/mcp-tools/findings.js +277 -0
  190. package/dist/mcp-tools/findings.js.map +1 -0
  191. package/dist/mcp-tools/inbox.d.ts +3 -0
  192. package/dist/mcp-tools/inbox.js +106 -0
  193. package/dist/mcp-tools/inbox.js.map +1 -0
  194. package/dist/mcp-tools/journey.d.ts +3 -0
  195. package/dist/mcp-tools/journey.js +260 -0
  196. package/dist/mcp-tools/journey.js.map +1 -0
  197. package/dist/mcp-tools/shared.d.ts +39 -0
  198. package/dist/mcp-tools/shared.js +69 -0
  199. package/dist/mcp-tools/shared.js.map +1 -0
  200. package/dist/mission-fixtures.js +1 -8
  201. package/dist/mission-fixtures.js.map +1 -1
  202. package/dist/mission-queue-cli.js +1 -3
  203. package/dist/mission-queue-cli.js.map +1 -1
  204. package/dist/multi-run.js +1 -3
  205. package/dist/multi-run.js.map +1 -1
  206. package/dist/pre-approval.js +4 -4
  207. package/dist/pre-approval.js.map +1 -1
  208. package/dist/readiness.js +2 -2
  209. package/dist/readiness.js.map +1 -1
  210. package/dist/report-api.js +1 -4
  211. package/dist/report-api.js.map +1 -1
  212. package/dist/resource-preflight.js.map +1 -1
  213. package/dist/run-metadata.js +1 -3
  214. package/dist/run-metadata.js.map +1 -1
  215. package/dist/run-tags-cli.d.ts +0 -2
  216. package/dist/run-tags-cli.js +0 -4
  217. package/dist/run-tags-cli.js.map +1 -1
  218. package/dist/session-check.js +1 -3
  219. package/dist/session-check.js.map +1 -1
  220. package/dist/signal-triage.js +6 -2
  221. package/dist/signal-triage.js.map +1 -1
  222. package/dist/suite-explore-options.d.ts +8 -0
  223. package/dist/suite-explore-options.js +4 -0
  224. package/dist/suite-explore-options.js.map +1 -1
  225. package/dist/sweep-api.d.ts +9 -0
  226. package/dist/sweep-api.js +70 -4
  227. package/dist/sweep-api.js.map +1 -1
  228. package/dist/sweep-cli.d.ts +2 -0
  229. package/dist/sweep-cli.js +22 -5
  230. package/dist/sweep-cli.js.map +1 -1
  231. package/dist/transcript-file.d.ts +0 -3
  232. package/dist/transcript-file.js +0 -9
  233. package/dist/transcript-file.js.map +1 -1
  234. package/dist/ui-api.js +1 -4
  235. package/dist/ui-api.js.map +1 -1
  236. package/dist/ux-usability/analysis.d.ts +14 -0
  237. package/dist/ux-usability/analysis.js +106 -0
  238. package/dist/ux-usability/analysis.js.map +1 -0
  239. package/dist/ux-usability/done-adjudication.d.ts +15 -0
  240. package/dist/ux-usability/done-adjudication.js +56 -0
  241. package/dist/ux-usability/done-adjudication.js.map +1 -0
  242. package/dist/ux-usability/hang.d.ts +5 -0
  243. package/dist/ux-usability/hang.js +41 -0
  244. package/dist/ux-usability/hang.js.map +1 -0
  245. package/dist/ux-usability/loop.d.ts +15 -0
  246. package/dist/ux-usability/loop.js +104 -0
  247. package/dist/ux-usability/loop.js.map +1 -0
  248. package/dist/ux-usability/observe.d.ts +7 -0
  249. package/dist/ux-usability/observe.js +89 -0
  250. package/dist/ux-usability/observe.js.map +1 -0
  251. package/dist/ux-usability/result.d.ts +11 -0
  252. package/dist/ux-usability/result.js +113 -0
  253. package/dist/ux-usability/result.js.map +1 -0
  254. package/dist/ux-usability/setup.d.ts +76 -0
  255. package/dist/ux-usability/setup.js +204 -0
  256. package/dist/ux-usability/setup.js.map +1 -0
  257. package/dist/ux-usability/teardown.d.ts +3 -0
  258. package/dist/ux-usability/teardown.js +13 -0
  259. package/dist/ux-usability/teardown.js.map +1 -0
  260. package/dist/ux-usability.d.ts +20 -17
  261. package/dist/ux-usability.js +15 -589
  262. package/dist/ux-usability.js.map +1 -1
  263. package/dist/verify-fix-api.js +1 -4
  264. package/dist/verify-fix-api.js.map +1 -1
  265. package/package.json +5 -6
  266. package/skills/jevitate-explore/SKILL.md +9 -1
  267. package/skills/jevitate-getting-started/SKILL.md +1 -0
  268. package/skills/jevitate-promotion-ready/SKILL.md +76 -0
  269. package/skills/jevitate-record/SKILL.md +3 -0
  270. package/skills/jevitate-run-journey/SKILL.md +3 -0
  271. package/skills/jevitate-test-campaign/SKILL.md +5 -3
@@ -0,0 +1,44 @@
1
+ import { FsJourneyStore, JourneyRegistry } from "@jevitate/journey";
2
+ import { ok, fail } from "../envelope.js";
3
+ import { resolveJourneysDir, emitJson } from "../cli-shared.js";
4
+ /** Registers `jevitate journey find`. */
5
+ export function registerJourneyFind(journey, program, deps) {
6
+ // RULING 5: uses `JourneyRegistry.find` (from `@jevitate/journey`) directly —
7
+ // NEVER `@jevitate/mcp-facade`'s `findCapabilities` — Slice 1 forbids the CLI
8
+ // depending on `@jevitate/mcp-facade`. `JourneyRegistry.find` is already
9
+ // promoted-only, so this is the same promoted-only view without the
10
+ // forbidden dependency.
11
+ journey
12
+ .command("find <query>")
13
+ .option("--dir <path>", "journeys directory (default: the repo's .jevitate/journeys; outside a repo ~/.jevitate/journeys)")
14
+ .option("--json", "emit a JSON envelope")
15
+ .action(async function (query) {
16
+ const { dir, json } = this.opts();
17
+ try {
18
+ const store = new FsJourneyStore(resolveJourneysDir(deps, dir));
19
+ const registry = new JourneyRegistry(store);
20
+ const metas = await registry.find(query);
21
+ const capabilities = metas.map((m) => ({
22
+ id: m.id,
23
+ name: m.name,
24
+ description: m.description,
25
+ params: m.params,
26
+ }));
27
+ const envelope = ok(capabilities);
28
+ if (json) {
29
+ emitJson(program, envelope);
30
+ }
31
+ else {
32
+ const out = program.configureOutput().writeOut;
33
+ for (const c of capabilities) {
34
+ out?.(`${c.id}\t${c.name}\tparams=[${c.params.join(", ")}]\n`);
35
+ }
36
+ process.exitCode = 0;
37
+ }
38
+ }
39
+ catch (err) {
40
+ emitJson(program, fail("E_JOURNEY_FIND", String(err)));
41
+ }
42
+ });
43
+ }
44
+ //# sourceMappingURL=find.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find.js","sourceRoot":"","sources":["../../src/journey-cli/find.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAgB,kBAAkB,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE9E,yCAAyC;AACzC,MAAM,UAAU,mBAAmB,CAAC,OAAgB,EAAE,OAAgB,EAAE,IAAa;IACnF,8EAA8E;IAC9E,8EAA8E;IAC9E,yEAAyE;IACzE,oEAAoE;IACpE,wBAAwB;IACxB,OAAO;SACJ,OAAO,CAAC,cAAc,CAAC;SACvB,MAAM,CAAC,cAAc,EAAE,kGAAkG,CAAC;SAC1H,MAAM,CAAC,QAAQ,EAAE,sBAAsB,CAAC;SACxC,MAAM,CAAC,KAAK,WAA0B,KAAa;QAClD,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,IAAI,EAAoC,CAAC;QACpE,IAAI,CAAC;YACH,MAA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/** Registers `jevitate journey lint`. */
4
+ export declare function registerJourneyLint(journey: Command, program: Command, deps: CliDeps): void;
@@ -0,0 +1,84 @@
1
+ import { writeFile } from "node:fs/promises";
2
+ import { ok, fail } from "../envelope.js";
3
+ import { lintJourneyById, UnknownJourneyError } from "../journey-api.js";
4
+ import { resolveCatalogDir } from "../catalog-api.js";
5
+ import { anchorEditFailure } from "../journey-anchor-cli.js";
6
+ import { fixJourneyAnchors } from "../journey-anchor-api.js";
7
+ import { currentEngineInfo } from "../engine.js";
8
+ import { renderJourneyLintSarif } from "../journey-lint-sarif.js";
9
+ import { resolveJourneysDir, emitJson } from "../cli-shared.js";
10
+ import { lintFindingLine } from "./shared.js";
11
+ import { FsJourneyStore } from "@jevitate/journey";
12
+ import { journeyLinkWarnings } from "../journey-link-hints.js";
13
+ /** Registers `jevitate journey lint`. */
14
+ export function registerJourneyLint(journey, program, deps) {
15
+ // #401 — the assertion-strength lint: which assertions cannot prove the Journey's outcome. CI can
16
+ // gate on it (`--json`/`--sarif`, exit 1 when any error); `promote` runs the same lint first.
17
+ journey
18
+ .command("lint <id>")
19
+ .description("report a Journey's weak assertions (writes without an asserted effect, visibility-only claims, nothing after the last write, …)")
20
+ .option("--dir <path>", "journeys directory (default: the repo's .jevitate/journeys; outside a repo ~/.jevitate/journeys)")
21
+ .option("--sarif <file>", "also write a SARIF 2.1.0 log here")
22
+ .option("--fix", "#487: stamp the step id of each anchor that references a step by number only, write the Journey (#507: on a promoted Journey its approval goes stale), and report what was fixed")
23
+ .option("--json", "emit a JSON envelope")
24
+ .action(async function (id) {
25
+ const { dir, json, sarif, fix } = this.opts();
26
+ try {
27
+ let fixResult;
28
+ if (fix === true) {
29
+ try {
30
+ fixResult = await fixJourneyAnchors(resolveJourneysDir(deps, dir), id);
31
+ }
32
+ catch (err) {
33
+ if (err instanceof UnknownJourneyError)
34
+ throw err;
35
+ anchorEditFailure(program, err);
36
+ return;
37
+ }
38
+ }
39
+ const fixed = fixResult?.stamped ?? [];
40
+ // #507: stamping a promoted Journey makes its approval stale — say so, with the re-approval command.
41
+ const reapproval = fixResult?.needsReapproval === true ? { needsReapproval: true, reapproveCommand: fixResult.reapproveCommand } : {};
42
+ const journeysDir = resolveJourneysDir(deps, dir);
43
+ const catalogDir = resolveCatalogDir(deps.catalogDir);
44
+ const linted = await lintJourneyById(journeysDir, id, { catalogDir });
45
+ // #523: catalog-aware, advisory: a missing job / persona link is a warning with its fix.
46
+ const stored = await new FsJourneyStore(journeysDir).get(id);
47
+ const linkFindings = stored === null ? [] : await journeyLinkWarnings(catalogDir, stored);
48
+ const result = { ...linted, findings: [...linted.findings, ...linkFindings], warnings: linted.warnings + linkFindings.length };
49
+ if (sarif !== undefined) {
50
+ const log = renderJourneyLintSarif({ id: result.id, findings: result.findings, version: currentEngineInfo().version });
51
+ await writeFile(sarif, `${JSON.stringify(log, null, 2)}\n`);
52
+ }
53
+ if (json) {
54
+ emitJson(program, ok({ id: result.id, findings: result.findings, errors: result.errors, warnings: result.warnings, ...(fix === true ? { fixed, ...reapproval } : {}) }));
55
+ }
56
+ else {
57
+ const out = program.configureOutput().writeOut;
58
+ if (fix === true) {
59
+ for (const a of fixed)
60
+ out?.(`fixed: anchor '${a.name}' now carries stepId '${a.stepId}' (step ${a.step})\n`);
61
+ if (fixed.length === 0)
62
+ out?.("fixed: nothing — no anchor references a step by number only\n");
63
+ if (fixResult?.needsReapproval === true) {
64
+ out?.(`journey '${id}' is promoted: its approval is now stale (kept for the review diff; \`journey review --stale\` lists it, \`check --require-approvals\` fails it)\n`);
65
+ out?.(`re-approve after review: ${fixResult.reapproveCommand}\n`);
66
+ }
67
+ }
68
+ for (const finding of result.findings)
69
+ out?.(`${lintFindingLine(finding)}\n`);
70
+ out?.(`${result.errors} error(s), ${result.warnings} warning(s) — journey '${result.id}'\n`);
71
+ }
72
+ process.exitCode = result.errors > 0 ? 1 : 0;
73
+ }
74
+ catch (err) {
75
+ if (err instanceof UnknownJourneyError) {
76
+ emitJson(program, fail("E_UNKNOWN_JOURNEY", String(err.message)));
77
+ }
78
+ else {
79
+ emitJson(program, fail("E_JOURNEY_LINT_ARGS", String(err instanceof Error ? err.message : err)));
80
+ }
81
+ }
82
+ });
83
+ }
84
+ //# sourceMappingURL=lint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lint.js","sourceRoot":"","sources":["../../src/journey-cli/lint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAgB,kBAAkB,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,yCAAyC;AACzC,MAAM,UAAU,mBAAmB,CAAC,OAAgB,EAAE,OAAgB,EAAE,IAAa;IACnF,kGAAkG;IAClG,8FAA8F;IAC9F,OAAO;SACJ,OAAO,CAAC,WAAW,CAAC;SACpB,WAAW,CAAC,iIAAiI,CAAC;SAC9I,MAAM,CAAC,cAAc,EAAE,kGAAkG,CAAC;SAC1H,MAAM,CAAC,gBAAgB,EAAE,mCAAmC,CAAC;SAC7D,MAAM,CAAC,OAAO,EAAE,kL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commander";
2
+ import { type CliDeps } from "../cli-shared.js";
3
+ /** Registers `jevitate journey list`. */
4
+ export declare function registerJourneyList(journey: Command, program: Command, deps: CliDeps): void;
@@ -0,0 +1,48 @@
1
+ import { FsJourneyStore } from "@jevitate/journey";
2
+ import { ok, fail } from "../envelope.js";
3
+ import { describeProvenance } from "../approval-provenance.js";
4
+ import { resolveJourneysDir, emitJson } from "../cli-shared.js";
5
+ /** Registers `jevitate journey list`. */
6
+ export function registerJourneyList(journey, program, deps) {
7
+ /**
8
+ * `journey list` = ALL journeys' metadata via the store directly
9
+ * (promoted AND unpromoted) — a local/dev-facing listing of everything on
10
+ * disk. `journey find` (below) = promoted-only, via `JourneyRegistry.find`
11
+ * — the same promoted-only projection external callers (e.g. the
12
+ * mcp-facade) see. Keeping these distinct means `list` is useful for
13
+ * authoring/debugging while `find` genuinely reflects what's discoverable.
14
+ */
15
+ journey
16
+ .command("list")
17
+ .option("--dir <path>", "journeys directory (default: the repo's .jevitate/journeys; outside a repo ~/.jevitate/journeys)")
18
+ .option("--json", "emit a JSON envelope")
19
+ .action(async function () {
20
+ const { dir, json } = this.opts();
21
+ try {
22
+ const store = new FsJourneyStore(resolveJourneysDir(deps, dir));
23
+ const metas = await store.list();
24
+ const envelope = ok(metas);
25
+ if (json) {
26
+ emitJson(program, envelope);
27
+ }
28
+ else {
29
+ const out = program.configureOutput().writeOut;
30
+ if (metas.length === 0) {
31
+ out?.("no journeys yet — record one with `jevitate record` (see jevitate record --help)\n");
32
+ }
33
+ else {
34
+ for (const m of metas) {
35
+ // #437: how a promoted Journey's approval was made ("approved non-interactively (likely an agent: CLAUDECODE)").
36
+ const how = m.promoted && m.approval !== undefined ? ` — ${describeProvenance(m.approval.provenance)}` : "";
37
+ out?.(`${m.id}\t${m.name}${m.promoted ? "" : " (unpromoted)"}${how}\n`);
38
+ }
39
+ }
40
+ process.exitCode = 0;
41
+ }
42
+ }
43
+ catch (err) {
44
+ emitJson(program, fail("E_JOURNEY_LIST", String(err)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AC;oBACN,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;wBACtB,iHAAiH;wBACjH,MAAM,GAAG,GAAG,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,kBAAkB,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;wBAC5G,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,eAAe,GAAG,GAAG,IAAI,CAAC,CAAC;oBAC1E,CAAC;gBACH,CAAC;gBACD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YACvB,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACzD,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Command } from "commander";
2
+ import { type CliDeps } from "../cli-shared.js";
3
+ /** Registers `jevitate journey migrate`. */
4
+ export declare function registerJourneyMigrate(journey: Command, program: Command, deps: CliDeps): void;
@@ -0,0 +1,101 @@
1
+ import { existsSync } from "node:fs";
2
+ import { ok, fail } from "../envelope.js";
3
+ import { migrateStepIds, renderMigrateStepIds } from "../journey-migrate-api.js";
4
+ import { migrateLabels, renderMigrateLabels } from "../journey-labels-migrate-api.js";
5
+ import { resolveCatalogDir } from "../catalog-api.js";
6
+ import { withSiteGate } from "../site-gate-cli.js";
7
+ import { environmentFromFlags, isEnvironmentError, withEnvironmentFlags } from "../environments.js";
8
+ import { resolveDbPath, resolveJourneysDir, withBrowserLaunchFlags, browserRunFromFlags, collectParam, emitJson, environmentSeams } from "../cli-shared.js";
9
+ /** Registers `jevitate journey migrate`. */
10
+ export function registerJourneyMigrate(journey, program, deps) {
11
+ // #467b — the one-time step-id backfill: CLI only (a repo rewrite the operator runs and commits; no MCP tool).
12
+ // #497 — `--labels`: the opt-in label backfill; a real replay of each Journey (the app must be running). CLI only.
13
+ withEnvironmentFlags(withBrowserLaunchFlags(journey.command("migrate")))
14
+ .description("one-time repo rewrite, CLI only. #467: --step-ids mints a stable step id on every recorded step that has none (every Journey and recording in the project) and points anchors at them. #497: --labels REPLAYS the Journeys (the app must be running; side effects happen) and stores each step's visible label for the review sheet. Both change every promoted Journey's hash: re-approve them (journey review --stale). Never approves")
15
+ .option("--step-ids", "mint missing step ids")
16
+ .option("--labels", "#497: replay the Journeys and store each step's visible label (exclusive with --step-ids; needs the app running)")
17
+ .option("--id <id...>", "#497: with --labels, only these Journeys (default: every local Journey)")
18
+ .option("--param <kv>", "#497: with --labels, a replay param as key=value (repeatable; each Journey gets only the ones it declares)", collectParam, {})
19
+ .option("--storage-state <file>", "#497: with --labels, Playwright storageState JSON to start the replays authenticated; must exist")
20
+ .option("--dry-run", "report what would change, write nothing (with --labels the replay still runs)")
21
+ .option("--dir <path>", "journeys directory (default: the repo's .jevitate/journeys; outside a repo ~/.jevitate/journeys)")
22
+ .option("--json", "emit a JSON envelope")
23
+ .action(async function () {
24
+ const { stepIds, labels, id: ids, param, storageState: storageStateFlag, dryRun, dir, json } = this.opts();
25
+ if (labels === true && stepIds === true) {
26
+ emitJson(program, fail("E_JOURNEY_MIGRATE_ARGS", "--labels and --step-ids are exclusive: run one migration at a time"));
27
+ return;
28
+ }
29
+ if (stepIds !== true && labels !== true) {
30
+ emitJson(program, fail("E_JOURNEY_MIGRATE_ARGS", "name the migration: --step-ids or --labels"));
31
+ return;
32
+ }
33
+ if (labels !== true) {
34
+ const labelOnly = [ids !== undefined ? "--id" : "", Object.keys(param).length > 0 ? "--param" : "", storageStateFlag !== undefined ? "--storage-state" : "", this.opts().env !== undefined ? "--env" : "", this.opts().baseUrl !== undefined ? "--base-url" : ""].filter((f) => f !== "");
35
+ if (labelOnly.length > 0) {
36
+ emitJson(program, fail("E_JOURNEY_MIGRATE_ARGS", `${labelOnly.join(", ")} only apply to --labels (the replay); --step-ids does not run the app`));
37
+ return;
38
+ }
39
+ try {
40
+ const result = await migrateStepIds({ journeysDir: resolveJourneysDir(deps, dir), projectDir: resolveCatalogDir(deps.catalogDir), dryRun: dryRun === true });
41
+ if (json)
42
+ emitJson(program, ok(result));
43
+ else
44
+ program.configureOutput().writeOut?.(renderMigrateStepIds(result));
45
+ process.exitCode = 0;
46
+ }
47
+ catch (err) {
48
+ emitJson(program, fail("E_JOURNEY_MIGRATE", String(err instanceof Error ? err.message : err)));
49
+ }
50
+ return;
51
+ }
52
+ const { env: envName, baseUrl } = this.opts();
53
+ let environment;
54
+ try {
55
+ environment = environmentFromFlags({ ...(envName === undefined ? {} : { env: envName }), ...(baseUrl === undefined ? {} : { baseUrl }) }, environmentSeams(deps));
56
+ }
57
+ catch (err) {
58
+ if (!isEnvironmentError(err))
59
+ throw err;
60
+ emitJson(program, fail(err.code, err.message));
61
+ return;
62
+ }
63
+ const storageState = storageStateFlag ?? environment?.storageState;
64
+ if (storageState !== undefined && !existsSync(storageState)) {
65
+ emitJson(program, fail("E_JOURNEY_MIGRATE_ARGS", `storage state not found: ${storageState}`));
66
+ return;
67
+ }
68
+ let browser;
69
+ try {
70
+ browser = browserRunFromFlags(this.opts(), deps.explore?.env ?? process.env);
71
+ }
72
+ catch (err) {
73
+ emitJson(program, fail("E_JOURNEY_MIGRATE_ARGS", err instanceof Error ? err.message : String(err)));
74
+ return;
75
+ }
76
+ try {
77
+ const result = await withSiteGate(resolveDbPath(deps), (siteGate) => migrateLabels({
78
+ journeysDir: resolveJourneysDir(deps, dir),
79
+ ...(ids === undefined ? {} : { ids }),
80
+ dryRun: dryRun === true,
81
+ params: param,
82
+ run: {
83
+ ...(siteGate === undefined ? {} : { siteGate }),
84
+ ...(deps.explore?.browserPortFactory === undefined ? {} : { browserPortFactory: deps.explore.browserPortFactory }),
85
+ ...(browser === undefined ? {} : { browser }),
86
+ ...(storageState === undefined ? {} : { storageState }),
87
+ ...(environment === undefined ? {} : { environment }),
88
+ },
89
+ }));
90
+ if (json)
91
+ emitJson(program, ok(result));
92
+ else
93
+ program.configureOutput().writeOut?.(renderMigrateLabels(result));
94
+ process.exitCode = 0;
95
+ }
96
+ catch (err) {
97
+ emitJson(program, fail("E_JOURNEY_MIGRATE", String(err instanceof Error ? err.message : err)));
98
+ }
99
+ });
100
+ }
101
+ //# sourceMappingURL=migrate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../src/journey-cli/migrate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,oBAAoB,EAA0D,MAAM,oBAAoB,CAAC;AAC5J,OAAO,EAAgB,aAAa,EAAE,kBAAkB,EAA2B,sBAAsB,EAAE,mBAAmB,EAAkB,YAAY,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEnN,4CAA4C;AAC5C,MAAM,UAAU,sBAAsB,CAAC,OAAgB,EAAE,OAAgB,EAAE,IAAa;IACtF,+GAA+G;IAC/G,mHAAmH;IACnH,oBAAoB,CAAC,sBAAsB,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;SACrE,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e,EAAE,CAAC,QAAQ,EAAE,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC;YACvE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,mBAAmB,EAAE,MAAM,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACjG,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type CliDeps } from "../cli-shared.js";
2
+ import { Command } from "commander";
3
+ /** Registers `jevitate journey promote`. */
4
+ export declare function registerJourneyPromote(journey: Command, program: Command, deps: CliDeps): void;
@@ -0,0 +1,181 @@
1
+ import { JEV_PROVIDER_FLAG_HELP, jevProviderArg, resolveJourneysDir, emitJson, GatewaySelectionError } from "../cli-shared.js";
2
+ import { REAL_JEV_FLAG_HELP, jevSetupFor } from "../catalog-cli.js";
3
+ import { readFile } from "node:fs/promises";
4
+ import { MissingCredentialError } from "@jevitate/ai-core";
5
+ import { ok, fail } from "../envelope.js";
6
+ import { promoteJourney, WeakJourneyError, UnknownJourneyError, StaleReviewError, JourneyProposalArgsError } from "../journey-api.js";
7
+ import { reviewRenderOptions } from "../review-render-options.js";
8
+ import { ReviewSheetError, renderReviewText, reviewSheetHash } from "../journey-review.js";
9
+ import { reviewJourneyById } from "../journey-review-api.js";
10
+ import { ReviewSidecarError } from "../journey-review-store.js";
11
+ import { JourneyProposalInvalidError, JourneyProposalNotFoundError, JourneyProposalProofError, JourneyProposalStaleError, isProposalId } from "../journey-proposal-store.js";
12
+ import { rejectionProvenance, approvalRefusal, checkNonInteractiveReason, describeProvenance, makeApprovalConfirm } from "../approval-provenance.js";
13
+ import { UnvettedLinksError, resolveCatalogDir } from "../catalog-api.js";
14
+ import { CatalogInputError } from "../catalog.js";
15
+ import { ApprovalFindingsError } from "../pre-approval.js";
16
+ import { TargetConfigError } from "../target-config.js";
17
+ import { FULL_FLAG_HELP, lintFindingLine, targetsOpts } from "./shared.js";
18
+ /** Registers `jevitate journey promote`. */
19
+ export function registerJourneyPromote(journey, program, deps) {
20
+ // #124 — promote a local Journey so it becomes discoverable/runnable (journey
21
+ // find / MCP find_capabilities / run_journey), mirroring `mission target
22
+ // promote`'s human-approval-gate semantics: promoting is a deliberate,
23
+ // explicit act, never automatic (an authored Journey's `metadata.promoted`
24
+ // always starts `false` — see `explore-author-journey`/`jevitate record`).
25
+ journey
26
+ .command("promote <id>")
27
+ .description("promote a local Journey (human-approval gate) so it becomes discoverable/runnable; shows its review sheet first and records the approval")
28
+ .option("--dir <path>", "journeys directory (default: the repo's .jevitate/journeys; outside a repo ~/.jevitate/journeys)")
29
+ .option("--accept-weak <reason>", "#401: promote a Journey whose assertions cannot prove its outcome, recording the reason")
30
+ .option("--full", FULL_FLAG_HELP)
31
+ .option("--reviewed-hash <hash>", "#432: the content hash of the review sheet you read; refused (E_JOURNEY_REVIEW_STALE) if the Journey changed since")
32
+ .option("--review-sheet <file>", "#432: the review sheet file you read (journey review --out); its content hash binds the approval like --reviewed-hash")
33
+ .option("--accept-unvetted <reason>", "#433: promote although its linked job/persona is not approved (unknown, draft or stale), recording the reason in approval.waivers")
34
+ .option("--accept-findings <reason>", "#433: promote although pre-approval findings need an acknowledgment, recording the reason in approval.acceptedFindings")
35
+ .option("--real", `${REAL_JEV_FLAG_HELP}; a conflicting/duplicate pair classification at or above the documented threshold then needs --accept-findings`)
36
+ .option("--jev-provider <provider>", JEV_PROVIDER_FLAG_HELP, jevProviderArg)
37
+ .option("--non-interactive-approval <reason>", "#437: approve without a terminal confirmation (a scripted setup), recorded as channel non-interactive (ci under a CI marker) with the reason — never as a person's; check --require-approvals fails it. A coding agent never uses this: it hands the approval to a person")
38
+ .option("--proposal <pid>", "#453: accept this pending self-heal proposal (journey review shows it): the Journey is replaced by the proposed revision through every gate, bound to its proposedHash")
39
+ .option("--reject-proposal <pid>", "#453: reject this pending self-heal proposal (needs --reason); the stored Journey is untouched")
40
+ .option("--reason <text>", "#453: why the proposal is rejected (recorded with the rejection)")
41
+ .option("--json", "emit a JSON envelope")
42
+ .action(async function (id) {
43
+ const { dir, json, full, acceptWeak, reviewedHash: hashFlag, reviewSheet, acceptUnvetted, acceptFindings, real, jevProvider, nonInteractiveApproval, proposal, rejectProposal, reason } = this.opts();
44
+ try {
45
+ checkNonInteractiveReason(nonInteractiveApproval);
46
+ const journeysDir = resolveJourneysDir(deps, dir);
47
+ // #453: the proposal flags, validated before anything is read (an id is 12 hex characters — never a path).
48
+ for (const [flag, value] of [["--proposal", proposal], ["--reject-proposal", rejectProposal]]) {
49
+ if (value !== undefined && !isProposalId(value)) {
50
+ emitJson(program, fail("E_JOURNEY_PROPOSAL_ARGS", `${flag} needs a proposal id (12 hex characters, shown by \`journey review\`), not '${value}'`));
51
+ return;
52
+ }
53
+ }
54
+ if (proposal !== undefined && rejectProposal !== undefined) {
55
+ emitJson(program, fail("E_JOURNEY_PROPOSAL_ARGS", "--proposal and --reject-proposal are exclusive: accept or reject, not both"));
56
+ return;
57
+ }
58
+ if (rejectProposal !== undefined && (reason ?? "").trim() === "") {
59
+ emitJson(program, fail("E_JOURNEY_PROPOSAL_ARGS", "--reject-proposal needs --reason <text> (it is recorded with the rejection)"));
60
+ return;
61
+ }
62
+ if (reason !== undefined && rejectProposal === undefined) {
63
+ emitJson(program, fail("E_JOURNEY_PROPOSAL_ARGS", "--reason belongs to --reject-proposal"));
64
+ return;
65
+ }
66
+ if (proposal !== undefined && reviewSheet !== undefined) {
67
+ emitJson(program, fail("E_JOURNEY_PROPOSAL_ARGS", "--review-sheet binds the stored Journey's hash; with --proposal bind with --reviewed-hash <proposedHash>"));
68
+ return;
69
+ }
70
+ if (rejectProposal !== undefined) {
71
+ const rejected = await promoteJourney(journeysDir, id, {
72
+ rejectProposal,
73
+ reason: reason ?? "",
74
+ rejectProvenance: rejectionProvenance(deps.approval, reason ?? ""),
75
+ });
76
+ if (json)
77
+ emitJson(program, ok({ ...rejected.metadata, rejectedProposal: rejectProposal }));
78
+ else {
79
+ program.configureOutput().writeOut?.(`rejected proposal ${rejectProposal} for journey '${rejected.metadata.id}'; the stored Journey is unchanged\n`);
80
+ process.exitCode = 0;
81
+ }
82
+ return;
83
+ }
84
+ // #432: what the reviewer read — a hash, a sheet file, or (human mode) the sheet shown below.
85
+ let reviewedHash = hashFlag?.trim().toLowerCase();
86
+ if (reviewedHash !== undefined && !/^[0-9a-f]{64}$/.test(reviewedHash)) {
87
+ emitJson(program, fail("E_JOURNEY_REVIEW_ARGS", "--reviewed-hash needs the 64-hex content hash a review sheet shows"));
88
+ return;
89
+ }
90
+ if (reviewSheet !== undefined) {
91
+ let text;
92
+ try {
93
+ text = await readFile(reviewSheet, "utf8");
94
+ }
95
+ catch (e) {
96
+ emitJson(program, fail("E_JOURNEY_REVIEW_ARGS", `cannot read --review-sheet ${reviewSheet}: ${e instanceof Error ? e.message : String(e)}`));
97
+ return;
98
+ }
99
+ const fromSheet = reviewSheetHash(text);
100
+ if (reviewedHash !== undefined && reviewedHash !== fromSheet) {
101
+ emitJson(program, fail("E_JOURNEY_REVIEW_ARGS", "--reviewed-hash and --review-sheet name different content hashes"));
102
+ return;
103
+ }
104
+ reviewedHash = fromSheet;
105
+ }
106
+ // #434/#435: the readiness checks and the catalog analysis run before every approval; Jev only with --real.
107
+ const jev = await jevSetupFor(deps, resolveCatalogDir(deps.catalogDir), { real, jevProvider });
108
+ let attention;
109
+ if (!json) {
110
+ // Human mode: the sheet is shown before promoting, and the approval binds to what was shown.
111
+ const { review } = await reviewJourneyById(journeysDir, id, { ...targetsOpts(deps), catalogDir: resolveCatalogDir(deps.catalogDir), readiness: true, jev, action: "journey promote" });
112
+ program.configureOutput().writeOut?.(`${renderReviewText(review, reviewRenderOptions({ full: full === true }))}\n`);
113
+ attention = review.attention;
114
+ reviewedHash ??= proposal === undefined ? review.contentHash : review.proposal?.proposedHash;
115
+ }
116
+ const journeyResult = await promoteJourney(journeysDir, id, {
117
+ jev,
118
+ ...(proposal === undefined ? {} : { proposal }),
119
+ ...(acceptWeak === undefined ? {} : { acceptWeak }),
120
+ ...(reviewedHash === undefined ? {} : { reviewedHash }),
121
+ ...(acceptUnvetted === undefined ? {} : { acceptUnvetted }),
122
+ ...(acceptFindings === undefined ? {} : { acceptFindings }),
123
+ catalogDir: resolveCatalogDir(deps.catalogDir),
124
+ // #437: a typed confirmation on a TTY (or the escape hatch, or the MCP channel), recorded as provenance.
125
+ confirm: ((confirm) => (request) => confirm(attention === undefined ? request : { ...request, attention }))(makeApprovalConfirm(deps.approval, nonInteractiveApproval === undefined ? {} : { nonInteractiveReason: nonInteractiveApproval })),
126
+ });
127
+ const envelope = ok(journeyResult.metadata);
128
+ if (json) {
129
+ emitJson(program, envelope);
130
+ }
131
+ else {
132
+ program.configureOutput().writeOut?.(`promoted journey '${journeyResult.metadata.id}' (approved content hash ${journeyResult.metadata.approval?.contentHash ?? ""}; ${describeProvenance(journeyResult.metadata.approval?.provenance)})\n`);
133
+ process.exitCode = 0;
134
+ }
135
+ }
136
+ catch (err) {
137
+ const refusal = approvalRefusal(err);
138
+ if (refusal !== null) {
139
+ emitJson(program, fail(refusal.code, refusal.message));
140
+ }
141
+ else if (err instanceof UnknownJourneyError) {
142
+ emitJson(program, fail("E_UNKNOWN_JOURNEY", String(err.message)));
143
+ }
144
+ else if (err instanceof JourneyProposalArgsError ||
145
+ err instanceof JourneyProposalNotFoundError ||
146
+ err instanceof JourneyProposalStaleError ||
147
+ err instanceof JourneyProposalProofError ||
148
+ err instanceof JourneyProposalInvalidError) {
149
+ emitJson(program, fail(err.code, err.message));
150
+ }
151
+ else if (err instanceof StaleReviewError || err instanceof ReviewSheetError || err instanceof ReviewSidecarError || err instanceof TargetConfigError) {
152
+ emitJson(program, fail(err instanceof TargetConfigError ? "E_TARGET_CONFIG" : err.code, err.message));
153
+ }
154
+ else if (err instanceof WeakJourneyError) {
155
+ // #401: the findings printed before the refusal (human mode); the reason the gate is here.
156
+ if (!json) {
157
+ const out = program.configureOutput().writeOut;
158
+ for (const finding of err.findings)
159
+ out?.(`${lintFindingLine(finding)}\n`);
160
+ }
161
+ emitJson(program, fail("E_JOURNEY_WEAK", String(err.message)));
162
+ process.exitCode = 1;
163
+ }
164
+ else if (err instanceof UnvettedLinksError || err instanceof ApprovalFindingsError) {
165
+ // #433: a gate on the catalog — exit 1 (a gating finding), like E_JOURNEY_WEAK.
166
+ emitJson(program, fail(err.code, err.message));
167
+ process.exitCode = 1;
168
+ }
169
+ else if (err instanceof CatalogInputError) {
170
+ emitJson(program, fail(err.code, err.message));
171
+ }
172
+ else if (err instanceof GatewaySelectionError || err instanceof MissingCredentialError) {
173
+ emitJson(program, fail("E_AI_SETUP_REQUIRED", err.message));
174
+ }
175
+ else {
176
+ emitJson(program, fail("E_JOURNEY_PROMOTE", String(err instanceof Error ? err.message : err)));
177
+ }
178
+ }
179
+ });
180
+ }
181
+ //# sourceMappingURL=promote.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promote.js","sourceRoot":"","sources":["../../src/journey-cli/promote.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,sBAAsB,EAAE,cAAc,EAAE,kBAAkB,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC7I,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;A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AC,OAAO,CAAC,CAAC,CAAC,CAAC;gBAC/D,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YACvB,CAAC;iBAAM,IAAI,GAAG,YAAY,kBAAkB,IAAI,GAAG,YAAY,qBAAqB,EAAE,CAAC;gBACrF,gFAAgF;gBAChF,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;gBAC/C,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YACvB,CAAC;iBAAM,IAAI,GAAG,YAAY,iBAAiB,EAAE,CAAC;gBAC5C,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;YACjD,CAAC;iBAAM,IAAI,GAAG,YAAY,qBAAqB,IAAI,GAAG,YAAY,sBAAsB,EAAE,CAAC;gBACzF,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,qBAAqB,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;YAC9D,CAAC;iBAAM,CAAC;gBACN,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,mBAAmB,EAAE,MAAM,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACjG,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Command } from "commander";
2
+ import { type CliDeps } from "../cli-shared.js";
3
+ /** Registers `jevitate journey publish`. */
4
+ export declare function registerJourneyPublish(journey: Command, program: Command, deps: CliDeps): void;
@@ -0,0 +1,70 @@
1
+ import { ok, fail } from "../envelope.js";
2
+ import { UnknownJourneyError } from "../journey-api.js";
3
+ import { publishJourneyToSource, realGhPort, NotPromotedError, NoDeclaredOriginsError } from "../source-api.js";
4
+ import { UnknownSourceError, EmbeddedSecretError, UndeclaredOriginError } from "@jevitate/sources";
5
+ import { resolveJourneysDir, resolveSourceApiDeps, emitJson } from "../cli-shared.js";
6
+ /** Registers `jevitate journey publish`. */
7
+ export function registerJourneyPublish(journey, program, deps) {
8
+ // #19 — publish a promoted local Journey to a registered distributed source.
9
+ // Preserves every publish-side guard in `@jevitate/sources` (promoted-only,
10
+ // secret-references-only, declared-origin coverage); writes onto a NEW
11
+ // `publish/<id>` branch and degrades gracefully when `gh` is absent.
12
+ journey
13
+ .command("publish <id>")
14
+ .requiredOption("--to <source>", "registered source name to publish into")
15
+ .option("--dir <path>", "journeys directory (default: the repo's .jevitate/journeys; outside a repo ~/.jevitate/journeys)")
16
+ .option("--declare-origin <origin>", "origin this Journey is authorized for (repeatable; default: derived from navigate steps)", (v, prev) => [...prev, v], [])
17
+ .option("--as <id>", "publish under a different id than the local one")
18
+ .option("--json", "emit a JSON envelope")
19
+ .action(async function (id) {
20
+ const { to, dir, declareOrigin, as: asId, json } = this.opts();
21
+ try {
22
+ const apiDeps = resolveSourceApiDeps(deps);
23
+ const gh = deps.sources?.gh ?? realGhPort;
24
+ const result = await publishJourneyToSource({ ...apiDeps, gh }, {
25
+ journeysDir: resolveJourneysDir(deps, dir),
26
+ id,
27
+ toSource: to,
28
+ declareOrigins: declareOrigin,
29
+ asId,
30
+ });
31
+ const envelope = ok(result);
32
+ if (json) {
33
+ emitJson(program, envelope);
34
+ }
35
+ else {
36
+ const out = program.configureOutput().writeOut;
37
+ out?.(`published '${id}' to '${to}' on branch ${result.branch}\n`);
38
+ if (result.prUrl)
39
+ out?.(`PR: ${result.prUrl}\n`);
40
+ else if (result.instructions)
41
+ out?.(`${result.instructions}\n`);
42
+ process.exitCode = 0;
43
+ }
44
+ }
45
+ catch (err) {
46
+ if (err instanceof UnknownSourceError) {
47
+ emitJson(program, fail("E_JOURNEY_PUBLISH_UNKNOWN_SOURCE", err.message));
48
+ }
49
+ else if (err instanceof UnknownJourneyError) {
50
+ emitJson(program, fail("E_JOURNEY_PUBLISH_UNKNOWN_JOURNEY", err.message));
51
+ }
52
+ else if (err instanceof NotPromotedError) {
53
+ emitJson(program, fail("E_JOURNEY_PUBLISH_NOT_PROMOTED", err.message));
54
+ }
55
+ else if (err instanceof NoDeclaredOriginsError) {
56
+ emitJson(program, fail("E_JOURNEY_PUBLISH_NO_ORIGINS", err.message));
57
+ }
58
+ else if (err instanceof EmbeddedSecretError) {
59
+ emitJson(program, fail("E_JOURNEY_PUBLISH_SECRET", err.message));
60
+ }
61
+ else if (err instanceof UndeclaredOriginError) {
62
+ emitJson(program, fail("E_JOURNEY_PUBLISH_ORIGIN", err.message));
63
+ }
64
+ else {
65
+ emitJson(program, fail("E_JOURNEY_PUBLISH", String(err instanceof Error ? err.message : err)));
66
+ }
67
+ }
68
+ });
69
+ }
70
+ //# sourceMappingURL=publish.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publish.js","sourceRoot":"","sources":["../../src/journey-cli/publish.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAChH,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AACnG,OAAO,EAAgB,kBAAkB,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEpG,4CAA4C;AAC5C,MAAM,UAAU,sBAAsB,CAAC,OAAgB,EAAE,OAAgB,EAAE,IAAa;IACtF,6EAA6E;IAC7E,4EAA4E;IAC5E,uEAAuE;IACvE,qEAAqE;IACrE,OAAO;SACJ,OAAO,CAAC,cAAc,CAAC;SACvB,cAAc,CAAC,eAAe,EAAE,wCAAwC,CAAC;SACz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