@jevitate/cli 0.16.1 → 0.18.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 (89) hide show
  1. package/README.md +55 -5
  2. package/dist/author-journey-cli.js +11 -8
  3. package/dist/author-journey-cli.js.map +1 -1
  4. package/dist/bin.js +3126 -1078
  5. package/dist/build-info.generated.js +3 -3
  6. package/dist/catalog-api.d.ts +22 -0
  7. package/dist/catalog-api.js +49 -0
  8. package/dist/catalog-api.js.map +1 -1
  9. package/dist/catalog-cli.js +59 -37
  10. package/dist/catalog-cli.js.map +1 -1
  11. package/dist/cli-shared.d.ts +6 -1
  12. package/dist/cli-shared.js +11 -2
  13. package/dist/cli-shared.js.map +1 -1
  14. package/dist/exit-codes.js +9 -0
  15. package/dist/exit-codes.js.map +1 -1
  16. package/dist/journey-anchor-cli.js +16 -8
  17. package/dist/journey-anchor-cli.js.map +1 -1
  18. package/dist/journey-annotate-cli.js +10 -5
  19. package/dist/journey-annotate-cli.js.map +1 -1
  20. package/dist/journey-api.d.ts +10 -0
  21. package/dist/journey-api.js +23 -2
  22. package/dist/journey-api.js.map +1 -1
  23. package/dist/journey-bundle.d.ts +83 -0
  24. package/dist/journey-bundle.js +252 -0
  25. package/dist/journey-bundle.js.map +1 -0
  26. package/dist/journey-chain.d.ts +105 -0
  27. package/dist/journey-chain.js +331 -0
  28. package/dist/journey-chain.js.map +1 -0
  29. package/dist/journey-cli/anchors.js +11 -6
  30. package/dist/journey-cli/anchors.js.map +1 -1
  31. package/dist/journey-cli/chain.d.ts +8 -0
  32. package/dist/journey-cli/chain.js +113 -0
  33. package/dist/journey-cli/chain.js.map +1 -0
  34. package/dist/journey-cli/find.js +10 -5
  35. package/dist/journey-cli/find.js.map +1 -1
  36. package/dist/journey-cli/lint.js +13 -9
  37. package/dist/journey-cli/lint.js.map +1 -1
  38. package/dist/journey-cli/list.js +10 -5
  39. package/dist/journey-cli/list.js.map +1 -1
  40. package/dist/journey-cli/migrate.js +13 -6
  41. package/dist/journey-cli/migrate.js.map +1 -1
  42. package/dist/journey-cli/promote.js +11 -6
  43. package/dist/journey-cli/promote.js.map +1 -1
  44. package/dist/journey-cli/publish.js +12 -6
  45. package/dist/journey-cli/publish.js.map +1 -1
  46. package/dist/journey-cli/review.js +14 -8
  47. package/dist/journey-cli/review.js.map +1 -1
  48. package/dist/journey-cli/run.js +25 -10
  49. package/dist/journey-cli/run.js.map +1 -1
  50. package/dist/journey-cli/shared.d.ts +19 -1
  51. package/dist/journey-cli/shared.js +28 -0
  52. package/dist/journey-cli/shared.js.map +1 -1
  53. package/dist/journey-cli/verify.js +13 -6
  54. package/dist/journey-cli/verify.js.map +1 -1
  55. package/dist/journey-cli-bundle.d.ts +4 -0
  56. package/dist/journey-cli-bundle.js +70 -0
  57. package/dist/journey-cli-bundle.js.map +1 -0
  58. package/dist/journey-cli-readiness.d.ts +4 -0
  59. package/dist/journey-cli-readiness.js +163 -0
  60. package/dist/journey-cli-readiness.js.map +1 -0
  61. package/dist/journey-cli.d.ts +1 -1
  62. package/dist/journey-cli.js +9 -1
  63. package/dist/journey-cli.js.map +1 -1
  64. package/dist/journey-demo-cli.js +10 -5
  65. package/dist/journey-demo-cli.js.map +1 -1
  66. package/dist/journey-handback.d.ts +62 -0
  67. package/dist/journey-handback.js +150 -0
  68. package/dist/journey-handback.js.map +1 -0
  69. package/dist/journey-link-api.js +1 -1
  70. package/dist/journey-link-api.js.map +1 -1
  71. package/dist/journey-link-cli.js +13 -8
  72. package/dist/journey-link-cli.js.map +1 -1
  73. package/dist/journey-readiness.d.ts +104 -0
  74. package/dist/journey-readiness.js +369 -0
  75. package/dist/journey-readiness.js.map +1 -0
  76. package/dist/journey-verify.d.ts +2 -0
  77. package/dist/journey-verify.js +14 -1
  78. package/dist/journey-verify.js.map +1 -1
  79. package/dist/mcp-cli-tools.js +79 -20
  80. package/dist/mcp-cli-tools.js.map +1 -1
  81. package/dist/program.js +3 -0
  82. package/dist/program.js.map +1 -1
  83. package/dist/project-layout.d.ts +57 -0
  84. package/dist/project-layout.js +144 -0
  85. package/dist/project-layout.js.map +1 -0
  86. package/dist/project-where.d.ts +4 -0
  87. package/dist/project-where.js +48 -0
  88. package/dist/project-where.js.map +1 -0
  89. package/package.json +9 -9
@@ -0,0 +1,331 @@
1
+ import { FsJourneyStore, JourneyRegistry, bindParams, checkCompatibility, handoffKey, journeyParamSchema, outputKeyFields, readRecords as readHandoffRecords, recordFingerprint, validateRecords, validateRequests, } from "@jevitate/journey";
2
+ import { clock } from "@jevitate/domain";
3
+ import { runJourneyProgrammatically, UnknownJourneyError } from "./journey-api.js";
4
+ /** A chain-stopping failure (§5 steps 1, 2 and the §4 request contract). */
5
+ export class JourneyChainError extends Error {
6
+ code;
7
+ constructor(code, message) {
8
+ super(message);
9
+ this.name = "JourneyChainError";
10
+ this.code = code;
11
+ }
12
+ }
13
+ /** §5 step 4: a matched record is missing a field the reply Journey needs — per request, never a guess. */
14
+ export const E_CHAIN_FIELD = "E_CHAIN_FIELD";
15
+ const REQUEST_KEYS = ["commentId", "account", "replyText"];
16
+ /**
17
+ * §4: parse the JSON Lines file of prepare-only requests. `commentId`, `account` and `replyText` are
18
+ * exactly the keys; any other key, a missing key or a non-string value is refused (`E_CHAIN_REQUEST`).
19
+ * Blank lines are skipped; approval metadata stays in Bizops and is not read here.
20
+ */
21
+ export function parseChainRequests(text) {
22
+ const requests = [];
23
+ const lines = text.split(/\r?\n/);
24
+ for (let n = 0; n < lines.length; n++) {
25
+ const line = lines[n]?.trim() ?? "";
26
+ if (line === "")
27
+ continue;
28
+ let parsed;
29
+ try {
30
+ parsed = JSON.parse(line);
31
+ }
32
+ catch {
33
+ throw new JourneyChainError("E_CHAIN_REQUEST", `request line ${n + 1} is not valid JSON`);
34
+ }
35
+ if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
36
+ throw new JourneyChainError("E_CHAIN_REQUEST", `request line ${n + 1} must be a JSON object`);
37
+ }
38
+ const bag = parsed;
39
+ const keys = Object.keys(bag);
40
+ const missing = REQUEST_KEYS.filter((k) => !keys.includes(k));
41
+ const extra = keys.filter((k) => !REQUEST_KEYS.includes(k));
42
+ if (missing.length > 0 || extra.length > 0) {
43
+ throw new JourneyChainError("E_CHAIN_REQUEST", `request line ${n + 1} — missing: [${missing.join(", ")}], unknown: [${extra.join(", ")}]`);
44
+ }
45
+ for (const k of REQUEST_KEYS) {
46
+ if (typeof bag[k] !== "string") {
47
+ throw new JourneyChainError("E_CHAIN_REQUEST", `request line ${n + 1} — ${k} must be a string`);
48
+ }
49
+ }
50
+ requests.push({ commentId: bag.commentId, account: bag.account, replyText: bag.replyText });
51
+ }
52
+ return requests;
53
+ }
54
+ const recordKey = (commentId, account) => `${commentId}\u0000${account}`;
55
+ const asString = (v) => (typeof v === "string" && v !== "" ? v : undefined);
56
+ /**
57
+ * §5 step 2: read the discover run's outputs. A missing or zero `records.count` stops the chain
58
+ * (`E_CHAIN_EMPTY`) — no target is guessed. Every indexed field is read; a missing optional field is
59
+ * left absent.
60
+ */
61
+ function readRecords(output) {
62
+ const bag = output !== null && typeof output === "object" ? output : {};
63
+ const raw = bag["records.count"];
64
+ const count = typeof raw === "string" ? Number.parseInt(raw, 10) : Number.NaN;
65
+ if (!Number.isInteger(count) || count <= 0) {
66
+ throw new JourneyChainError("E_CHAIN_EMPTY", `the discover Journey returned no records (records.count = ${raw === undefined ? "missing" : JSON.stringify(raw)})`);
67
+ }
68
+ const field = (i, name) => asString(bag[`records.${i}.${name}`]);
69
+ const records = Array.from({ length: count }, (_, i) => ({
70
+ commentId: field(i, "commentId"),
71
+ account: field(i, "account"),
72
+ threadId: field(i, "threadId"),
73
+ sourceText: field(i, "sourceText"),
74
+ parentId: field(i, "parentId"),
75
+ }));
76
+ return { count, records };
77
+ }
78
+ /**
79
+ * §3: the reply Journey's params from one record and its approved request — each passed only when
80
+ * the reply Journey declares it, except `replyText`, which it must take. A declared param whose
81
+ * record field is missing is `E_CHAIN_FIELD` for that request (never a guess, never `""`).
82
+ */
83
+ function chainParams(record, request, declared) {
84
+ const sources = {
85
+ commentId: record.commentId,
86
+ replyIdentity: record.account,
87
+ threadId: record.threadId,
88
+ expected_commentid: record.commentId,
89
+ expected_account: record.account,
90
+ expected_sourcetext: record.sourceText,
91
+ expected_parentid: record.parentId,
92
+ };
93
+ const params = { replyText: request.replyText };
94
+ for (const [name, value] of Object.entries(sources)) {
95
+ if (!declared.has(name))
96
+ continue;
97
+ if (value === undefined)
98
+ return { ok: false, detail: `E_CHAIN_FIELD: the record has no value for ${name}` };
99
+ params[name] = value;
100
+ }
101
+ return { ok: true, params };
102
+ }
103
+ /**
104
+ * The contract's no-echo rule: a quarantine reason may quote an assertion's resolved expected value,
105
+ * so the text-bearing params (the reply and the source comment) are replaced by `<param name>`.
106
+ */
107
+ const TEXT_PARAMS = ["replyText", "expected_sourcetext"];
108
+ function redactReason(reason, params, names = TEXT_PARAMS) {
109
+ let out = reason;
110
+ for (const name of names) {
111
+ const value = params[name];
112
+ if (value === undefined || value === "")
113
+ continue;
114
+ for (const form of new Set([value, JSON.stringify(value).slice(1, -1)]))
115
+ out = out.split(form).join(`<param ${name}>`);
116
+ }
117
+ return out;
118
+ }
119
+ /** §5 step 5: the chain succeeded only when every request matched and every run was `ok`. */
120
+ export function chainSucceeded(result) {
121
+ return result.unmatched.length === 0 && result.runs.every((run) => run.outcome === "ok");
122
+ }
123
+ function sharedRunOptions(opts) {
124
+ return {
125
+ dir: opts.dir,
126
+ ...(opts.environment === undefined ? {} : { environment: opts.environment }),
127
+ ...(opts.storageState === undefined ? {} : { storageState: opts.storageState }),
128
+ ...(opts.browser === undefined ? {} : { browser: opts.browser }),
129
+ ...(opts.emulation === undefined ? {} : { emulation: opts.emulation }),
130
+ ...(opts.browserPortFactory === undefined ? {} : { browserPortFactory: opts.browserPortFactory }),
131
+ ...(opts.allow === undefined ? {} : { allow: opts.allow }),
132
+ ...(opts.siteGate === undefined ? {} : { siteGate: opts.siteGate }),
133
+ };
134
+ }
135
+ /** §4 step 5: parse the request file as JSON Lines objects; field validation is `validateRequests`. */
136
+ function parseRequestObjects(text) {
137
+ const requests = [];
138
+ const lines = text.split(/\r?\n/);
139
+ for (let n = 0; n < lines.length; n++) {
140
+ const line = lines[n]?.trim() ?? "";
141
+ if (line === "")
142
+ continue;
143
+ let parsed;
144
+ try {
145
+ parsed = JSON.parse(line);
146
+ }
147
+ catch {
148
+ throw new JourneyChainError("E_CHAIN_REQUEST", `request line ${n + 1} is not valid JSON`);
149
+ }
150
+ if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
151
+ throw new JourneyChainError("E_CHAIN_REQUEST", `request line ${n + 1} must be a JSON object`);
152
+ }
153
+ requests.push(parsed);
154
+ }
155
+ return requests;
156
+ }
157
+ /**
158
+ * §1: the origins a `url` field may name — the run environment's allowlist, else the producer's
159
+ * recorded site, plus its declared `metadata.allowedOrigins` and the run's `--allow`.
160
+ */
161
+ function handoffOrigins(opts, from) {
162
+ const origins = new Set();
163
+ if (opts.environment !== undefined)
164
+ for (const origin of opts.environment.allowedOrigins)
165
+ origins.add(origin);
166
+ else
167
+ origins.add(from.recording.site);
168
+ for (const origin of from.metadata.allowedOrigins ?? [])
169
+ origins.add(origin);
170
+ for (const origin of opts.allow ?? [])
171
+ origins.add(origin);
172
+ return [...origins];
173
+ }
174
+ /** §4/§5 no-echo rule: a param bound to a `text`/`url`/`path` field never appears in a reason. */
175
+ const REDACTED_FIELD_TYPES = ["text", "url", "path"];
176
+ function textBoundParams(inputs, outputs) {
177
+ const names = [];
178
+ for (const [param, binding] of Object.entries(inputs.bindings)) {
179
+ const type = "record" in binding ? outputs.fields[binding.record]?.type : "request" in binding ? inputs.request.fields[binding.request]?.type : undefined;
180
+ if (type !== undefined && REDACTED_FIELD_TYPES.includes(type))
181
+ names.push(param);
182
+ }
183
+ return names;
184
+ }
185
+ /** The `commentId`/`account` identity the §5 result names, read from a request when declared. */
186
+ function requestIdentity(bag) {
187
+ return {
188
+ commentId: typeof bag["commentId"] === "string" ? bag["commentId"] : "",
189
+ account: typeof bag["account"] === "string" ? bag["account"] : "",
190
+ };
191
+ }
192
+ /**
193
+ * §4/§5 handoff branch: validate the records and requests with the pure `@jevitate/journey`
194
+ * validators, match each valid request on `inputs.request.key` against the outputs key, and run `to`
195
+ * once per match with the params `bindParams` resolves. A request matching an invalid or ambiguous
196
+ * record is rejected (never unmatched, never run).
197
+ */
198
+ async function runHandoffChain(inputs, outputs, fromJourney, fromOutput, requestText, capturedAt, opts, shared, runner) {
199
+ const ctx = { allowedOrigins: handoffOrigins(opts, fromJourney) };
200
+ const records = readHandoffRecords(outputs, fromOutput);
201
+ if (records.length === 0)
202
+ throw new JourneyChainError("E_CHAIN_EMPTY", `the producing Journey '${opts.from}' returned no records`);
203
+ const outputKeys = outputKeyFields(outputs);
204
+ const recordValidation = validateRecords(outputs, records, ctx);
205
+ const byKey = new Map();
206
+ const rejectedByKey = new Map();
207
+ for (const record of recordValidation.valid)
208
+ byKey.set(handoffKey(outputKeys, record), record);
209
+ for (const rejection of recordValidation.rejected)
210
+ if (!rejectedByKey.has(rejection.key))
211
+ rejectedByKey.set(rejection.key, rejection);
212
+ const requestValidation = validateRequests(inputs, parseRequestObjects(requestText), ctx);
213
+ const rejected = [...recordValidation.rejected, ...requestValidation.rejected];
214
+ const redactors = textBoundParams(inputs, outputs);
215
+ const runs = [];
216
+ const unmatched = [];
217
+ for (const request of requestValidation.valid) {
218
+ const key = handoffKey(inputs.request.key, request);
219
+ const identity = requestIdentity(request);
220
+ const record = byKey.get(key);
221
+ if (record === undefined) {
222
+ const rejection = rejectedByKey.get(key);
223
+ if (rejection !== undefined)
224
+ rejected.push({ key, reason: rejection.reason, errors: rejection.errors });
225
+ else
226
+ unmatched.push(identity);
227
+ continue;
228
+ }
229
+ const params = bindParams(inputs, record, request);
230
+ const stamp = { contract: inputs.accepts, fingerprint: recordFingerprint(outputs, record), capturedAt };
231
+ try {
232
+ const result = await runner({ ...shared, id: opts.to, params });
233
+ runs.push({
234
+ ...identity,
235
+ outcome: result.outcome,
236
+ ...stamp,
237
+ ...("reason" in result ? { reason: redactReason(result.reason, params, redactors) } : {}),
238
+ });
239
+ }
240
+ catch (err) {
241
+ runs.push({ ...identity, outcome: "error", ...stamp, reason: redactReason(err instanceof Error ? err.message : String(err), params, redactors) });
242
+ }
243
+ }
244
+ return { from: { journey: opts.from, outcome: "ok", records: records.length }, runs, unmatched, rejected };
245
+ }
246
+ /**
247
+ * §5: run `from` once, join each approved request to the record with the same `commentId` and
248
+ * `account`, and run `to` once per match with §3's params. Unmatched requests are listed and never
249
+ * run. A failed `from` stops the chain (`E_CHAIN_FROM_FAILED`); a missing/zero record count stops it
250
+ * (`E_CHAIN_EMPTY`); a malformed request refuses the whole file (`E_CHAIN_REQUEST`).
251
+ */
252
+ export async function runJourneyChain(opts, deps = {}) {
253
+ const runner = deps.runJourney ?? runJourneyProgrammatically;
254
+ const shared = sharedRunOptions(opts);
255
+ const registry = new JourneyRegistry(new FsJourneyStore(opts.dir));
256
+ const toJourney = await registry.get(opts.to);
257
+ if (toJourney === null)
258
+ throw new UnknownJourneyError(`unknown journey '${opts.to}'`);
259
+ const inputs = toJourney.metadata.inputs;
260
+ // §4: the compatibility check always loads the producing Journey, even when drafts are allowed.
261
+ const needsFrom = inputs !== undefined || opts.requirePromoted === true;
262
+ const fromJourney = needsFrom ? await registry.get(opts.from) : null;
263
+ if (needsFrom && fromJourney === null)
264
+ throw new UnknownJourneyError(`unknown journey '${opts.from}'`);
265
+ if (opts.requirePromoted === true) {
266
+ for (const j of [fromJourney, toJourney]) {
267
+ if (!j.metadata.promoted)
268
+ throw new JourneyChainError("E_CHAIN_NOT_PROMOTED", `journey '${j.metadata.id}' is not promoted — a chain runs promoted Journeys (journey chain --allow-draft runs drafts on the CLI)`);
269
+ }
270
+ }
271
+ let handoff;
272
+ if (inputs !== undefined) {
273
+ const issues = checkCompatibility(fromJourney, toJourney);
274
+ if (issues.length > 0)
275
+ throw new JourneyChainError("E_HANDOFF_INCOMPATIBLE", issues.map((issue) => issue.message).join("; "));
276
+ const outputs = fromJourney.metadata.outputs;
277
+ if (outputs === undefined)
278
+ throw new JourneyChainError("E_HANDOFF_INCOMPATIBLE", `the producing Journey '${opts.from}' declares no outputs`);
279
+ handoff = { inputs, outputs };
280
+ }
281
+ // 0.17.0 parses the fixed-key request file before anything runs; the handoff branch validates the
282
+ // JSON Lines objects after the record set is known (§4 step 5).
283
+ const requests = handoff === undefined ? parseChainRequests(opts.requests) : undefined;
284
+ const fromResult = await runner({ ...shared, id: opts.from, params: {} });
285
+ if (fromResult.outcome !== "ok") {
286
+ const reason = "reason" in fromResult ? fromResult.reason : undefined;
287
+ throw new JourneyChainError("E_CHAIN_FROM_FAILED", `discover Journey '${opts.from}' did not run ok (${fromResult.outcome})${reason === undefined ? "" : `: ${reason}`}`);
288
+ }
289
+ if (handoff !== undefined) {
290
+ // §5: `capturedAt` is when the producing run finished, from the injectable clock.
291
+ return runHandoffChain(handoff.inputs, handoff.outputs, fromJourney, fromResult.output, opts.requests, clock.nowIso(), opts, shared, runner);
292
+ }
293
+ const { count, records } = readRecords(fromResult.output);
294
+ // §3: the reply Journey's declared params decide the one conditional mapping (`expected_parentid`).
295
+ const declared = new Set(journeyParamSchema(toJourney).required);
296
+ const byKey = new Map();
297
+ for (const record of records) {
298
+ if (record.commentId !== undefined && record.account !== undefined)
299
+ byKey.set(recordKey(record.commentId, record.account), record);
300
+ }
301
+ const runs = [];
302
+ const unmatched = [];
303
+ for (const request of requests ?? []) {
304
+ const record = byKey.get(recordKey(request.commentId, request.account));
305
+ if (record === undefined) {
306
+ unmatched.push({ commentId: request.commentId, account: request.account });
307
+ continue;
308
+ }
309
+ const mapped = chainParams(record, request, declared);
310
+ if (!mapped.ok) {
311
+ runs.push({ commentId: request.commentId, account: request.account, outcome: E_CHAIN_FIELD, reason: mapped.detail });
312
+ continue;
313
+ }
314
+ try {
315
+ const result = await runner({ ...shared, id: opts.to, params: mapped.params });
316
+ runs.push({
317
+ commentId: request.commentId,
318
+ account: request.account,
319
+ outcome: result.outcome,
320
+ ...("reason" in result ? { reason: redactReason(result.reason, mapped.params) } : {}),
321
+ });
322
+ }
323
+ catch (err) {
324
+ // A param the reply Journey does not take (or any other refusal) fails only this request; the
325
+ // rest of the chain still runs (§5 step 4).
326
+ runs.push({ commentId: request.commentId, account: request.account, outcome: "error", reason: redactReason(err instanceof Error ? err.message : String(err), mapped.params) });
327
+ }
328
+ }
329
+ return { from: { journey: opts.from, outcome: "ok", records: count }, runs, unmatched };
330
+ }
331
+ //# sourceMappingURL=journey-chain.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"journey-chain.js","sourceRoot":"","sources":["../src/journey-chain.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,eAAe,EACf,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,WAAW,IAAI,kBAAkB,EACjC,iBAAiB,EACjB,eAAe,EACf,gBAAgB,GAQjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAKzC,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAA0C,MAAM,kBAAkB,CAAC;AA0B3H,4EAA4E;AAC5E,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IACjC,IAAI,CAAwB;IACrC,YAAY,IAA2B,EAAE,OAAe;QACtD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;QAChC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAED,2GAA2G;AAC3G,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC;AAsC7C,MAAM,YAAY,GAAG,CAAC,WAAW,EAAE,SAAS,EAAE,WAAW,CAAU,CAAC;AAEpE;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,IA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}
@@ -1,24 +1,29 @@
1
1
  import { FsJourneyStore, JourneyRegistry, journeyStepCount, listJourneyAnchors } from "@jevitate/journey";
2
2
  import { ok, fail } from "../envelope.js";
3
3
  import { runAnchorSuggest } from "../journey-anchor-cli.js";
4
- import { resolveJourneysDir, emitJson } from "../cli-shared.js";
4
+ import { emitJson } from "../cli-shared.js";
5
+ import { withProjectFlags } from "../project-layout.js";
6
+ import { DEPRECATED_DIR_HELP, journeyLayout } from "./shared.js";
5
7
  /** Registers `jevitate journey anchors`. */
6
8
  export function registerJourneyAnchors(journey, program, deps) {
7
9
  // #293 — the named states worth exploring from (`explore --from-journey <id> --at-step <name>`).
8
- journey
10
+ withProjectFlags(journey
9
11
  .command("anchors <id>")
10
12
  .description("list a Journey's anchors (#293): named steps to branch a mission off with `explore --from-journey <id> --at-step <name>`, and their suggested probes")
11
13
  .option("--suggest", "propose anchors where the recorded flow changes state (a new page, a form that became valid, a completed write), each with the `journey anchor add` command to accept it; advisory, writes nothing (#487)")
12
- .option("--dir <path>", "journeys directory (default: the repo's .jevitate/journeys; outside a repo ~/.jevitate/journeys)")
14
+ .option("--dir <path>", DEPRECATED_DIR_HELP))
13
15
  .option("--json", "emit a JSON envelope")
14
16
  .action(async function (id) {
15
- const { dir, json, suggest } = this.opts();
17
+ const { dir, project, journeysDir, json, suggest } = this.opts();
18
+ const layout = journeyLayout(program, deps, { dir, project, journeysDir });
19
+ if (layout === null)
20
+ return;
16
21
  if (suggest) {
17
- await runAnchorSuggest(program, deps, id, { dir, json });
22
+ await runAnchorSuggest(program, deps, id, { dir: layout.journeysDir, json });
18
23
  return;
19
24
  }
20
25
  try {
21
- const found = await new JourneyRegistry(new FsJourneyStore(resolveJourneysDir(deps, dir))).get(id);
26
+ const found = await new JourneyRegistry(new FsJourneyStore(layout.journeysDir)).get(id);
22
27
  if (found === null) {
23
28
  emitJson(program, fail("E_UNKNOWN_JOURNEY", `unknown journey '${id}'`));
24
29
  return;
@@ -1 +1 @@
1
- {"version":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AAC;gBACD,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;oBAC7B,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;gBAC1L,CAAC;gBACD,IAAI,CAAC,IAAI,CAAC,QAAQ;oBAAE,GAAG,EAAE,CAAC,kBAAkB,IAAI,CAAC,SAAS,kEAAkE,CAAC,CAAC;gBAC9H,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YACvB,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,wBAAwB,EAAE,MAAM,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACtG,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { Command } from "commander";
2
+ import { type CliDeps } from "../cli-shared.js";
3
+ /**
4
+ * #580: `jevitate journey chain --from <id> --to <id> --requests <file>` (docs/journey-chain-contract.md §5)
5
+ * runs a discover Journey once, then a prepare-only reply Journey once per matched request. Exits 0 only
6
+ * when every request matched and every run was `ok`.
7
+ */
8
+ export declare function registerJourneyChain(journey: Command, program: Command, deps: CliDeps): void;
@@ -0,0 +1,113 @@
1
+ import { existsSync, readFileSync } from "node:fs";
2
+ import { browserRunFromFlags, emitJson, emulationFromFlags, environmentSeams, resolveDbPath, withBrowserLaunchFlags, withEmulationFlags, writeRawResult, } from "../cli-shared.js";
3
+ import { environmentFromFlags, isEnvironmentError, replayAllowFromFlags, withEnvironmentFlags, withReplayAllowFlag, } from "../environments.js";
4
+ import { fail, ok } from "../envelope.js";
5
+ import { UnknownJourneyError } from "../journey-api.js";
6
+ import { chainSucceeded, JourneyChainError, runJourneyChain } from "../journey-chain.js";
7
+ import { withSiteGate } from "../site-gate-cli.js";
8
+ import { withProjectFlags } from "../project-layout.js";
9
+ import { DEPRECATED_DIR_HELP, journeyLayout } from "./shared.js";
10
+ /**
11
+ * #580: `jevitate journey chain --from <id> --to <id> --requests <file>` (docs/journey-chain-contract.md §5)
12
+ * runs a discover Journey once, then a prepare-only reply Journey once per matched request. Exits 0 only
13
+ * when every request matched and every run was `ok`.
14
+ */
15
+ export function registerJourneyChain(journey, program, deps) {
16
+ withReplayAllowFlag(withEnvironmentFlags(withBrowserLaunchFlags(withEmulationFlags(withProjectFlags(journey.command("chain"))))))
17
+ .requiredOption("--from <id>", "the discover Journey, run once to produce the records")
18
+ .requiredOption("--to <id>", "the prepare-only reply Journey, run once per matched request")
19
+ .requiredOption("--requests <file>", "JSON Lines file of approved requests ({commentId, account, replyText})")
20
+ .option("--dir <path>", DEPRECATED_DIR_HELP)
21
+ .option("--storage-state <file>", "Playwright storageState JSON to start each run authenticated; must exist")
22
+ .option("--allow-draft", "also run Journeys that are not promoted (authoring); without it both must be promoted")
23
+ .option("--json", "emit a JSON envelope")
24
+ .action(async function () {
25
+ const locationFlags = this.opts();
26
+ const layout = journeyLayout(program, deps, { dir: locationFlags.dir, project: locationFlags.project, journeysDir: locationFlags.journeysDir });
27
+ if (layout === null)
28
+ return;
29
+ const chainJourneysDir = layout.journeysDir;
30
+ const { from, to, requests: requestsFile, storageState: storageStateFlag, json, allowDraft } = this.opts();
31
+ const { env: envName, baseUrl } = this.opts();
32
+ // #247: --env/--base-url choose where both runs go (unknown env / bad file → 64, nothing opened).
33
+ let environment;
34
+ let allow;
35
+ try {
36
+ allow = replayAllowFromFlags(this.opts().allow);
37
+ environment = environmentFromFlags({ ...(envName === undefined ? {} : { env: envName }), ...(baseUrl === undefined ? {} : { baseUrl }) }, environmentSeams(deps));
38
+ }
39
+ catch (err) {
40
+ if (!isEnvironmentError(err))
41
+ throw err;
42
+ emitJson(program, fail(err.code, err.message));
43
+ return;
44
+ }
45
+ const storageState = storageStateFlag ?? environment?.storageState;
46
+ if (storageState !== undefined && !existsSync(storageState)) {
47
+ emitJson(program, fail("E_CHAIN_ARGS", `storage state not found: ${storageState}`));
48
+ return;
49
+ }
50
+ let requests;
51
+ try {
52
+ requests = readFileSync(requestsFile, "utf8");
53
+ }
54
+ catch (err) {
55
+ emitJson(program, fail("E_CHAIN_ARGS", `could not read requests file ${requestsFile}: ${err instanceof Error ? err.message : String(err)}`));
56
+ return;
57
+ }
58
+ let browser;
59
+ try {
60
+ browser = browserRunFromFlags(this.opts(), deps.explore?.env ?? process.env);
61
+ }
62
+ catch (err) {
63
+ emitJson(program, fail("E_CHAIN_ARGS", err instanceof Error ? err.message : String(err)));
64
+ return;
65
+ }
66
+ let emulation;
67
+ try {
68
+ emulation = emulationFromFlags(this.opts());
69
+ }
70
+ catch (err) {
71
+ emitJson(program, fail("E_CHAIN_ARGS", err instanceof Error ? err.message : String(err)));
72
+ return;
73
+ }
74
+ try {
75
+ const result = await withSiteGate(resolveDbPath(deps), (siteGate) => runJourneyChain({
76
+ from,
77
+ to,
78
+ requests,
79
+ dir: chainJourneysDir,
80
+ requirePromoted: allowDraft !== true,
81
+ ...(siteGate === undefined ? {} : { siteGate }),
82
+ browserPortFactory: deps.explore?.browserPortFactory,
83
+ ...(browser === undefined ? {} : { browser }),
84
+ ...(emulation === undefined ? {} : { emulation }),
85
+ ...(storageState !== undefined ? { storageState } : {}),
86
+ ...(environment === undefined ? {} : { environment }),
87
+ ...(allow.length === 0 ? {} : { allow }),
88
+ }));
89
+ const envelope = ok(result);
90
+ if (json)
91
+ emitJson(program, envelope);
92
+ else
93
+ writeRawResult(program, result);
94
+ // §5 step 5: 0 only when every request matched and every run was `ok`.
95
+ process.exitCode = chainSucceeded(result) ? 0 : 1;
96
+ }
97
+ catch (err) {
98
+ if (err instanceof JourneyChainError) {
99
+ emitJson(program, fail(err.code, err.message));
100
+ }
101
+ else if (err instanceof UnknownJourneyError) {
102
+ emitJson(program, fail("E_UNKNOWN_JOURNEY", String(err.message)));
103
+ }
104
+ else if (isEnvironmentError(err)) {
105
+ emitJson(program, fail(err.code, err.message));
106
+ }
107
+ else {
108
+ emitJson(program, fail("E_CHAIN", String(err instanceof Error ? err.message : err)));
109
+ }
110
+ }
111
+ });
112
+ }
113
+ //# sourceMappingURL=chain.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chain.js","sourceRoot":"","sources":["../../src/journey-cli/chain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEnD,OAAO,EAEL,mBAAmB,EAEnB,QAAQ,EAER,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,sBAAsB,EACtB,kBAAkB,EAClB,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAEL,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EAEpB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC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O,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;YACjD,CAAC;iBAAM,CAAC;gBACN,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACvF,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,6 +1,8 @@
1
1
  import { FsJourneyStore, JourneyRegistry } from "@jevitate/journey";
2
2
  import { ok, fail } from "../envelope.js";
3
- import { resolveJourneysDir, emitJson } from "../cli-shared.js";
3
+ import { emitJson } from "../cli-shared.js";
4
+ import { withProjectFlags } from "../project-layout.js";
5
+ import { DEPRECATED_DIR_HELP, journeyLayout } from "./shared.js";
4
6
  /** Registers `jevitate journey find`. */
5
7
  export function registerJourneyFind(journey, program, deps) {
6
8
  // RULING 5: uses `JourneyRegistry.find` (from `@jevitate/journey`) directly —
@@ -8,14 +10,17 @@ export function registerJourneyFind(journey, program, deps) {
8
10
  // depending on `@jevitate/mcp-facade`. `JourneyRegistry.find` is already
9
11
  // promoted-only, so this is the same promoted-only view without the
10
12
  // forbidden dependency.
11
- journey
13
+ withProjectFlags(journey
12
14
  .command("find <query>")
13
- .option("--dir <path>", "journeys directory (default: the repo's .jevitate/journeys; outside a repo ~/.jevitate/journeys)")
15
+ .option("--dir <path>", DEPRECATED_DIR_HELP))
14
16
  .option("--json", "emit a JSON envelope")
15
17
  .action(async function (query) {
16
- const { dir, json } = this.opts();
18
+ const { dir, project, journeysDir, json } = this.opts();
19
+ const layout = journeyLayout(program, deps, { dir, project, journeysDir });
20
+ if (layout === null)
21
+ return;
17
22
  try {
18
- const store = new FsJourneyStore(resolveJourneysDir(deps, dir));
23
+ const store = new FsJourneyStore(layout.journeysDir);
19
24
  const registry = new JourneyRegistry(store);
20
25
  const metas = await registry.find(query);
21
26
  const capabilities = metas.map((m) => ({
@@ -1 +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,MAAM,KAAK,GAAG,IAAI,cAAc,CAAC,kBAAkB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;YAChE,MAAM,QAAQ,GAAG,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC;YAC5C,MAAM,KAAK,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACzC,MAAM,YAAY,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBACrC,EAAE,EAAE,CAAC,CAAC,EAAE;gBACR,IAAI,EAAE,CAAC,CAAC,IAAI;gBACZ,WAAW,EAAE,CAAC,CAAC,WAAW;gBAC1B,MAAM,EAAE,CAAC,CAAC,MAAM;aACjB,CAAC,CAAC,CAAC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