@synergenius/flow-weaver 0.30.0 → 0.30.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5987,7 +5987,7 @@ var VERSION;
5987
5987
  var init_generated_version = __esm({
5988
5988
  "src/generated-version.ts"() {
5989
5989
  "use strict";
5990
- VERSION = "0.30.0";
5990
+ VERSION = "0.30.2";
5991
5991
  }
5992
5992
  });
5993
5993
 
@@ -9844,14 +9844,14 @@ var require_read_wasm = __commonJS({
9844
9844
  var fs49 = __require("fs");
9845
9845
  var path54 = __require("path");
9846
9846
  module.exports = function readWasm() {
9847
- return new Promise((resolve38, reject) => {
9847
+ return new Promise((resolve39, reject) => {
9848
9848
  const wasmPath = path54.join(__dirname, "mappings.wasm");
9849
9849
  fs49.readFile(wasmPath, null, (error2, data) => {
9850
9850
  if (error2) {
9851
9851
  reject(error2);
9852
9852
  return;
9853
9853
  }
9854
- resolve38(data.buffer);
9854
+ resolve39(data.buffer);
9855
9855
  });
9856
9856
  });
9857
9857
  };
@@ -12059,7 +12059,7 @@ is not a problem with esbuild. You need to fix your environment instead.
12059
12059
  let latestResultPromise;
12060
12060
  let provideLatestResult;
12061
12061
  if (isContext)
12062
- requestCallbacks["on-end"] = (id, request2) => new Promise((resolve38) => {
12062
+ requestCallbacks["on-end"] = (id, request2) => new Promise((resolve39) => {
12063
12063
  buildResponseToResult(request2, (err, result, onEndErrors, onEndWarnings) => {
12064
12064
  const response = {
12065
12065
  errors: onEndErrors,
@@ -12069,7 +12069,7 @@ is not a problem with esbuild. You need to fix your environment instead.
12069
12069
  latestResultPromise = void 0;
12070
12070
  provideLatestResult = void 0;
12071
12071
  sendResponse(id, response);
12072
- resolve38();
12072
+ resolve39();
12073
12073
  });
12074
12074
  });
12075
12075
  sendRequest(refs, request, (error2, response) => {
@@ -12086,10 +12086,10 @@ is not a problem with esbuild. You need to fix your environment instead.
12086
12086
  let didDispose = false;
12087
12087
  const result = {
12088
12088
  rebuild: () => {
12089
- if (!latestResultPromise) latestResultPromise = new Promise((resolve38, reject) => {
12089
+ if (!latestResultPromise) latestResultPromise = new Promise((resolve39, reject) => {
12090
12090
  let settlePromise;
12091
12091
  provideLatestResult = (err, result2) => {
12092
- if (!settlePromise) settlePromise = () => err ? reject(err) : resolve38(result2);
12092
+ if (!settlePromise) settlePromise = () => err ? reject(err) : resolve39(result2);
12093
12093
  };
12094
12094
  const triggerAnotherBuild = () => {
12095
12095
  const request2 = {
@@ -12110,7 +12110,7 @@ is not a problem with esbuild. You need to fix your environment instead.
12110
12110
  });
12111
12111
  return latestResultPromise;
12112
12112
  },
12113
- watch: (options2 = {}) => new Promise((resolve38, reject) => {
12113
+ watch: (options2 = {}) => new Promise((resolve39, reject) => {
12114
12114
  if (!streamIn.hasFS) throw new Error(`Cannot use the "watch" API in this environment`);
12115
12115
  const keys = {};
12116
12116
  const delay = getFlag(options2, keys, "delay", mustBeInteger);
@@ -12122,10 +12122,10 @@ is not a problem with esbuild. You need to fix your environment instead.
12122
12122
  if (delay) request2.delay = delay;
12123
12123
  sendRequest(refs, request2, (error22) => {
12124
12124
  if (error22) reject(new Error(error22));
12125
- else resolve38(void 0);
12125
+ else resolve39(void 0);
12126
12126
  });
12127
12127
  }),
12128
- serve: (options2 = {}) => new Promise((resolve38, reject) => {
12128
+ serve: (options2 = {}) => new Promise((resolve39, reject) => {
12129
12129
  if (!streamIn.hasFS) throw new Error(`Cannot use the "serve" API in this environment`);
12130
12130
  const keys = {};
12131
12131
  const port = getFlag(options2, keys, "port", mustBeValidPortNumber);
@@ -12163,28 +12163,28 @@ is not a problem with esbuild. You need to fix your environment instead.
12163
12163
  sendResponse(id, {});
12164
12164
  };
12165
12165
  }
12166
- resolve38(response2);
12166
+ resolve39(response2);
12167
12167
  });
12168
12168
  }),
12169
- cancel: () => new Promise((resolve38) => {
12170
- if (didDispose) return resolve38();
12169
+ cancel: () => new Promise((resolve39) => {
12170
+ if (didDispose) return resolve39();
12171
12171
  const request2 = {
12172
12172
  command: "cancel",
12173
12173
  key: buildKey
12174
12174
  };
12175
12175
  sendRequest(refs, request2, () => {
12176
- resolve38();
12176
+ resolve39();
12177
12177
  });
12178
12178
  }),
12179
- dispose: () => new Promise((resolve38) => {
12180
- if (didDispose) return resolve38();
12179
+ dispose: () => new Promise((resolve39) => {
12180
+ if (didDispose) return resolve39();
12181
12181
  didDispose = true;
12182
12182
  const request2 = {
12183
12183
  command: "dispose",
12184
12184
  key: buildKey
12185
12185
  };
12186
12186
  sendRequest(refs, request2, () => {
12187
- resolve38();
12187
+ resolve39();
12188
12188
  scheduleOnDisposeCallbacks();
12189
12189
  refs.unref();
12190
12190
  });
@@ -12223,7 +12223,7 @@ is not a problem with esbuild. You need to fix your environment instead.
12223
12223
  onLoad: []
12224
12224
  };
12225
12225
  i++;
12226
- let resolve38 = (path310, options = {}) => {
12226
+ let resolve39 = (path310, options = {}) => {
12227
12227
  if (!isSetupDone) throw new Error('Cannot call "resolve" before plugin setup has completed');
12228
12228
  if (typeof path310 !== "string") throw new Error(`The path to resolve must be a string`);
12229
12229
  let keys2 = /* @__PURE__ */ Object.create(null);
@@ -12267,7 +12267,7 @@ is not a problem with esbuild. You need to fix your environment instead.
12267
12267
  };
12268
12268
  let promise = setup({
12269
12269
  initialOptions,
12270
- resolve: resolve38,
12270
+ resolve: resolve39,
12271
12271
  onStart(callback) {
12272
12272
  let registeredText = `This error came from the "onStart" callback registered here:`;
12273
12273
  let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onStart");
@@ -13145,46 +13145,46 @@ More information: The file containing the code for esbuild's JavaScript API (${_
13145
13145
  }
13146
13146
  };
13147
13147
  longLivedService = {
13148
- build: (options) => new Promise((resolve38, reject) => {
13148
+ build: (options) => new Promise((resolve39, reject) => {
13149
13149
  service.buildOrContext({
13150
13150
  callName: "build",
13151
13151
  refs,
13152
13152
  options,
13153
13153
  isTTY: isTTY2(),
13154
13154
  defaultWD,
13155
- callback: (err, res) => err ? reject(err) : resolve38(res)
13155
+ callback: (err, res) => err ? reject(err) : resolve39(res)
13156
13156
  });
13157
13157
  }),
13158
- context: (options) => new Promise((resolve38, reject) => service.buildOrContext({
13158
+ context: (options) => new Promise((resolve39, reject) => service.buildOrContext({
13159
13159
  callName: "context",
13160
13160
  refs,
13161
13161
  options,
13162
13162
  isTTY: isTTY2(),
13163
13163
  defaultWD,
13164
- callback: (err, res) => err ? reject(err) : resolve38(res)
13164
+ callback: (err, res) => err ? reject(err) : resolve39(res)
13165
13165
  })),
13166
- transform: (input, options) => new Promise((resolve38, reject) => service.transform({
13166
+ transform: (input, options) => new Promise((resolve39, reject) => service.transform({
13167
13167
  callName: "transform",
13168
13168
  refs,
13169
13169
  input,
13170
13170
  options: options || {},
13171
13171
  isTTY: isTTY2(),
13172
13172
  fs: fsAsync,
13173
- callback: (err, res) => err ? reject(err) : resolve38(res)
13173
+ callback: (err, res) => err ? reject(err) : resolve39(res)
13174
13174
  })),
13175
- formatMessages: (messages, options) => new Promise((resolve38, reject) => service.formatMessages({
13175
+ formatMessages: (messages, options) => new Promise((resolve39, reject) => service.formatMessages({
13176
13176
  callName: "formatMessages",
13177
13177
  refs,
13178
13178
  messages,
13179
13179
  options,
13180
- callback: (err, res) => err ? reject(err) : resolve38(res)
13180
+ callback: (err, res) => err ? reject(err) : resolve39(res)
13181
13181
  })),
13182
- analyzeMetafile: (metafile, options) => new Promise((resolve38, reject) => service.analyzeMetafile({
13182
+ analyzeMetafile: (metafile, options) => new Promise((resolve39, reject) => service.analyzeMetafile({
13183
13183
  callName: "analyzeMetafile",
13184
13184
  refs,
13185
13185
  metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile),
13186
13186
  options,
13187
- callback: (err, res) => err ? reject(err) : resolve38(res)
13187
+ callback: (err, res) => err ? reject(err) : resolve39(res)
13188
13188
  }))
13189
13189
  };
13190
13190
  return longLivedService;
@@ -13262,13 +13262,13 @@ error: ${text}`);
13262
13262
  worker.postMessage(msg);
13263
13263
  let status = Atomics.wait(sharedBufferView, 0, 0);
13264
13264
  if (status !== "ok" && status !== "not-equal") throw new Error("Internal error: Atomics.wait() failed: " + status);
13265
- let { message: { id: id2, resolve: resolve38, reject, properties } } = worker_threads2.receiveMessageOnPort(mainPort);
13265
+ let { message: { id: id2, resolve: resolve39, reject, properties } } = worker_threads2.receiveMessageOnPort(mainPort);
13266
13266
  if (id !== id2) throw new Error(`Internal error: Expected id ${id} but got id ${id2}`);
13267
13267
  if (reject) {
13268
13268
  applyProperties(reject, properties);
13269
13269
  throw reject;
13270
13270
  }
13271
- return resolve38;
13271
+ return resolve39;
13272
13272
  };
13273
13273
  worker.unref();
13274
13274
  return {
@@ -14894,7 +14894,15 @@ function generateNodeInstanceTag(instance) {
14894
14894
  if (instance.config?.x !== void 0 && instance.config?.y !== void 0) {
14895
14895
  positionAttr = ` [position: ${Math.round(instance.config.x)} ${Math.round(instance.config.y)}]`;
14896
14896
  }
14897
- return ` * @node ${instance.id} ${instance.nodeType}${parent}${labelAttr}${portOrderAttr}${portLabelAttr}${exprAttr}${pullExecutionAttr}${minimizedAttr}${colorAttr}${iconAttr}${tagsAttr}${suppressAttr}${sizeAttr}${positionAttr}`;
14897
+ let jobAttr = "";
14898
+ if (instance.job) {
14899
+ jobAttr = ` [job: "${instance.job}"]`;
14900
+ }
14901
+ let environmentAttr = "";
14902
+ if (instance.environment) {
14903
+ environmentAttr = ` [environment: "${instance.environment}"]`;
14904
+ }
14905
+ return ` * @node ${instance.id} ${instance.nodeType}${parent}${labelAttr}${portOrderAttr}${portLabelAttr}${exprAttr}${pullExecutionAttr}${minimizedAttr}${colorAttr}${iconAttr}${tagsAttr}${suppressAttr}${sizeAttr}${positionAttr}${jobAttr}${environmentAttr}`;
14898
14906
  }
14899
14907
  function generateFunctionSignature(nodeType) {
14900
14908
  const lines = [];
@@ -26949,22 +26957,24 @@ var init_jsdoc_parser = __esm({
26949
26957
  */
26950
26958
  parseTriggerTag(tag, config2, warnings, tagRegistry) {
26951
26959
  const comment = (tag.getCommentText() || "").trim();
26960
+ const cicdKeywords = ["push", "pull_request", "dispatch", "tag", "schedule"];
26961
+ const firstToken = comment.split(/\s/)[0];
26962
+ if (cicdKeywords.includes(firstToken) && tagRegistry && tagRegistry.has("_cicdTrigger")) {
26963
+ if (!config2.deploy) config2.deploy = {};
26964
+ tagRegistry.handle("_cicdTrigger", comment, "workflow", config2.deploy, warnings);
26965
+ return;
26966
+ }
26952
26967
  const result = parseTriggerLine(`@trigger ${comment}`, warnings);
26953
26968
  if (result) {
26954
- const cicdKeywords = ["push", "pull_request", "dispatch", "tag", "schedule"];
26955
- if (result.event && cicdKeywords.includes(result.event)) {
26956
- warnings.push(
26957
- `@trigger event="${result.event}" is treated as an Inngest event trigger, not a CI/CD trigger. For CI/CD, use: @trigger ${result.event}`
26958
- );
26959
- }
26960
26969
  config2.trigger = config2.trigger || {};
26961
26970
  if (result.event) config2.trigger.event = result.event;
26962
26971
  if (result.cron) config2.trigger.cron = result.cron;
26963
26972
  return;
26964
26973
  }
26965
- if (tagRegistry && tagRegistry.has("_cicdTrigger")) {
26966
- if (!config2.deploy) config2.deploy = {};
26967
- tagRegistry.handle("_cicdTrigger", comment, "workflow", config2.deploy, warnings);
26974
+ if (cicdKeywords.includes(firstToken)) {
26975
+ warnings.push(
26976
+ `@trigger ${firstToken} looks like a CI/CD trigger but no CI/CD pack is installed. Install @synergenius/flow-weaver-pack-cicd to enable CI/CD pipeline annotations.`
26977
+ );
26968
26978
  return;
26969
26979
  }
26970
26980
  warnings.push(`Invalid @trigger format: @trigger ${comment}`);
@@ -50419,7 +50429,7 @@ async function describeCommand(input, options = {}) {
50419
50429
  throw new Error(`File not found: ${filePath}`);
50420
50430
  }
50421
50431
  try {
50422
- const parseResult = await parseWorkflow(filePath, { workflowName });
50432
+ const parseResult = await parseWorkflow(filePath, { workflowName, projectDir: path12.dirname(filePath) });
50423
50433
  if (parseResult.errors.length > 0) {
50424
50434
  throw new Error(`Parse errors:
50425
50435
  ${parseResult.errors.map((err) => ` ${err}`).join("\n")}`);
@@ -52506,6 +52516,7 @@ async function diagramCommand(input, options = {}) {
52506
52516
  if (!fs14.existsSync(filePath)) {
52507
52517
  throw new Error(`File not found: ${filePath}`);
52508
52518
  }
52519
+ await parser.loadPackHandlers(path13.dirname(filePath));
52509
52520
  let result;
52510
52521
  if (ASCII_FORMATS.has(format)) {
52511
52522
  result = fileToASCII(filePath, { ...diagramOptions, format });
@@ -52527,6 +52538,7 @@ var init_diagram2 = __esm({
52527
52538
  "src/cli/commands/diagram.ts"() {
52528
52539
  "use strict";
52529
52540
  init_diagram();
52541
+ init_parser2();
52530
52542
  init_logger();
52531
52543
  init_safe_write();
52532
52544
  ASCII_FORMATS = /* @__PURE__ */ new Set(["ascii", "ascii-compact", "text"]);
@@ -52570,8 +52582,8 @@ async function diffCommand(file1, file2, options = {}) {
52570
52582
  }
52571
52583
  try {
52572
52584
  const [result1, result2] = await Promise.all([
52573
- parseWorkflow(filePath1, { workflowName }),
52574
- parseWorkflow(filePath2, { workflowName })
52585
+ parseWorkflow(filePath1, { workflowName, projectDir: path14.dirname(filePath1) }),
52586
+ parseWorkflow(filePath2, { workflowName, projectDir: path14.dirname(filePath2) })
52575
52587
  ]);
52576
52588
  if (result1.errors.length > 0) {
52577
52589
  throw new Error(`Parse errors in ${file1}:
@@ -52660,7 +52672,7 @@ async function validateCommand(input, options = {}) {
52660
52672
  logger.progress(i + 1, files.length, fileName);
52661
52673
  }
52662
52674
  try {
52663
- const parseResult = await parseWorkflow(file, { workflowName, projectDir: process.cwd() });
52675
+ const parseResult = await parseWorkflow(file, { workflowName, projectDir: path15.dirname(path15.resolve(file)) });
52664
52676
  if (parseResult.warnings.length > 0) {
52665
52677
  if (!json2 && !quiet) {
52666
52678
  logger.warn(`Parse warnings in ${fileName}:`);
@@ -54396,13 +54408,13 @@ var init_promise_polyfill = __esm({
54396
54408
  // Available starting from Node 22
54397
54409
  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers
54398
54410
  static withResolver() {
54399
- let resolve38;
54411
+ let resolve39;
54400
54412
  let reject;
54401
54413
  const promise = new Promise((res, rej) => {
54402
- resolve38 = res;
54414
+ resolve39 = res;
54403
54415
  reject = rej;
54404
54416
  });
54405
- return { promise, resolve: resolve38, reject };
54417
+ return { promise, resolve: resolve39, reject };
54406
54418
  }
54407
54419
  };
54408
54420
  }
@@ -54440,7 +54452,7 @@ function createPrompt(view) {
54440
54452
  output
54441
54453
  });
54442
54454
  const screen = new ScreenManager(rl);
54443
- const { promise, resolve: resolve38, reject } = PromisePolyfill.withResolver();
54455
+ const { promise, resolve: resolve39, reject } = PromisePolyfill.withResolver();
54444
54456
  const cancel = () => reject(new CancelPromptError());
54445
54457
  if (signal) {
54446
54458
  const abort = () => reject(new AbortPromptError({ cause: signal.reason }));
@@ -54467,7 +54479,7 @@ function createPrompt(view) {
54467
54479
  cycle(() => {
54468
54480
  try {
54469
54481
  const nextView = view(config2, (value) => {
54470
- setImmediate(() => resolve38(value));
54482
+ setImmediate(() => resolve39(value));
54471
54483
  });
54472
54484
  if (nextView === void 0) {
54473
54485
  const callerFilename = callSites[1]?.getFileName();
@@ -55278,13 +55290,13 @@ var init_promise_polyfill2 = __esm({
55278
55290
  // Available starting from Node 22
55279
55291
  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers
55280
55292
  static withResolver() {
55281
- let resolve38;
55293
+ let resolve39;
55282
55294
  let reject;
55283
55295
  const promise = new Promise((res, rej) => {
55284
- resolve38 = res;
55296
+ resolve39 = res;
55285
55297
  reject = rej;
55286
55298
  });
55287
- return { promise, resolve: resolve38, reject };
55299
+ return { promise, resolve: resolve39, reject };
55288
55300
  }
55289
55301
  };
55290
55302
  }
@@ -55322,7 +55334,7 @@ function createPrompt2(view) {
55322
55334
  output
55323
55335
  });
55324
55336
  const screen = new ScreenManager2(rl);
55325
- const { promise, resolve: resolve38, reject } = PromisePolyfill2.withResolver();
55337
+ const { promise, resolve: resolve39, reject } = PromisePolyfill2.withResolver();
55326
55338
  const cancel = () => reject(new CancelPromptError2());
55327
55339
  if (signal) {
55328
55340
  const abort = () => reject(new AbortPromptError2({ cause: signal.reason }));
@@ -55349,7 +55361,7 @@ function createPrompt2(view) {
55349
55361
  cycle(() => {
55350
55362
  try {
55351
55363
  const nextView = view(config2, (value) => {
55352
- setImmediate(() => resolve38(value));
55364
+ setImmediate(() => resolve39(value));
55353
55365
  });
55354
55366
  if (nextView === void 0) {
55355
55367
  const callerFilename = callSites[1]?.getFileName();
@@ -56133,13 +56145,13 @@ var init_promise_polyfill3 = __esm({
56133
56145
  // Available starting from Node 22
56134
56146
  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers
56135
56147
  static withResolver() {
56136
- let resolve38;
56148
+ let resolve39;
56137
56149
  let reject;
56138
56150
  const promise = new Promise((res, rej) => {
56139
- resolve38 = res;
56151
+ resolve39 = res;
56140
56152
  reject = rej;
56141
56153
  });
56142
- return { promise, resolve: resolve38, reject };
56154
+ return { promise, resolve: resolve39, reject };
56143
56155
  }
56144
56156
  };
56145
56157
  }
@@ -56177,7 +56189,7 @@ function createPrompt3(view) {
56177
56189
  output
56178
56190
  });
56179
56191
  const screen = new ScreenManager3(rl);
56180
- const { promise, resolve: resolve38, reject } = PromisePolyfill3.withResolver();
56192
+ const { promise, resolve: resolve39, reject } = PromisePolyfill3.withResolver();
56181
56193
  const cancel = () => reject(new CancelPromptError3());
56182
56194
  if (signal) {
56183
56195
  const abort = () => reject(new AbortPromptError3({ cause: signal.reason }));
@@ -56204,7 +56216,7 @@ function createPrompt3(view) {
56204
56216
  cycle(() => {
56205
56217
  try {
56206
56218
  const nextView = view(config2, (value) => {
56207
- setImmediate(() => resolve38(value));
56219
+ setImmediate(() => resolve39(value));
56208
56220
  });
56209
56221
  if (nextView === void 0) {
56210
56222
  const callerFilename = callSites[1]?.getFileName();
@@ -69583,7 +69595,7 @@ var init_protocol = __esm({
69583
69595
  return;
69584
69596
  }
69585
69597
  const pollInterval = task2.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1e3;
69586
- await new Promise((resolve38) => setTimeout(resolve38, pollInterval));
69598
+ await new Promise((resolve39) => setTimeout(resolve39, pollInterval));
69587
69599
  options?.signal?.throwIfAborted();
69588
69600
  }
69589
69601
  } catch (error2) {
@@ -69600,7 +69612,7 @@ var init_protocol = __esm({
69600
69612
  */
69601
69613
  request(request, resultSchema, options) {
69602
69614
  const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options ?? {};
69603
- return new Promise((resolve38, reject) => {
69615
+ return new Promise((resolve39, reject) => {
69604
69616
  const earlyReject = (error2) => {
69605
69617
  reject(error2);
69606
69618
  };
@@ -69678,7 +69690,7 @@ var init_protocol = __esm({
69678
69690
  if (!parseResult.success) {
69679
69691
  reject(parseResult.error);
69680
69692
  } else {
69681
- resolve38(parseResult.data);
69693
+ resolve39(parseResult.data);
69682
69694
  }
69683
69695
  } catch (error2) {
69684
69696
  reject(error2);
@@ -69939,12 +69951,12 @@ var init_protocol = __esm({
69939
69951
  }
69940
69952
  } catch {
69941
69953
  }
69942
- return new Promise((resolve38, reject) => {
69954
+ return new Promise((resolve39, reject) => {
69943
69955
  if (signal.aborted) {
69944
69956
  reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
69945
69957
  return;
69946
69958
  }
69947
- const timeoutId = setTimeout(resolve38, interval);
69959
+ const timeoutId = setTimeout(resolve39, interval);
69948
69960
  signal.addEventListener("abort", () => {
69949
69961
  clearTimeout(timeoutId);
69950
69962
  reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
@@ -72971,7 +72983,7 @@ var require_compile = __commonJS({
72971
72983
  const schOrFunc = root.refs[ref];
72972
72984
  if (schOrFunc)
72973
72985
  return schOrFunc;
72974
- let _sch = resolve38.call(this, root, ref);
72986
+ let _sch = resolve39.call(this, root, ref);
72975
72987
  if (_sch === void 0) {
72976
72988
  const schema2 = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref];
72977
72989
  const { schemaId } = this.opts;
@@ -72998,7 +73010,7 @@ var require_compile = __commonJS({
72998
73010
  function sameSchemaEnv(s1, s2) {
72999
73011
  return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
73000
73012
  }
73001
- function resolve38(root, ref) {
73013
+ function resolve39(root, ref) {
73002
73014
  let sch;
73003
73015
  while (typeof (sch = this.refs[ref]) == "string")
73004
73016
  ref = sch;
@@ -73573,7 +73585,7 @@ var require_fast_uri = __commonJS({
73573
73585
  }
73574
73586
  return uri;
73575
73587
  }
73576
- function resolve38(baseURI, relativeURI, options) {
73588
+ function resolve39(baseURI, relativeURI, options) {
73577
73589
  const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
73578
73590
  const resolved = resolveComponent(parse4(baseURI, schemelessOptions), parse4(relativeURI, schemelessOptions), schemelessOptions, true);
73579
73591
  schemelessOptions.skipEscape = true;
@@ -73800,7 +73812,7 @@ var require_fast_uri = __commonJS({
73800
73812
  var fastUri = {
73801
73813
  SCHEMES,
73802
73814
  normalize,
73803
- resolve: resolve38,
73815
+ resolve: resolve39,
73804
73816
  resolveComponent,
73805
73817
  equal,
73806
73818
  serialize,
@@ -77919,7 +77931,7 @@ var init_mcp = __esm({
77919
77931
  let task = createTaskResult.task;
77920
77932
  const pollInterval = task.pollInterval ?? 5e3;
77921
77933
  while (task.status !== "completed" && task.status !== "failed" && task.status !== "cancelled") {
77922
- await new Promise((resolve38) => setTimeout(resolve38, pollInterval));
77934
+ await new Promise((resolve39) => setTimeout(resolve39, pollInterval));
77923
77935
  const updatedTask = await extra.taskStore.getTask(taskId);
77924
77936
  if (!updatedTask) {
77925
77937
  throw new McpError(ErrorCode.InternalError, `Task ${taskId} not found during polling`);
@@ -78513,12 +78525,12 @@ var init_stdio2 = __esm({
78513
78525
  this.onclose?.();
78514
78526
  }
78515
78527
  send(message) {
78516
- return new Promise((resolve38) => {
78528
+ return new Promise((resolve39) => {
78517
78529
  const json2 = serializeMessage(message);
78518
78530
  if (this._stdout.write(json2)) {
78519
- resolve38();
78531
+ resolve39();
78520
78532
  } else {
78521
- this._stdout.once("drain", resolve38);
78533
+ this._stdout.once("drain", resolve39);
78522
78534
  }
78523
78535
  });
78524
78536
  }
@@ -83249,8 +83261,8 @@ var init_debug_controller = __esm({
83249
83261
  async pause(nodeId, phase, ctx) {
83250
83262
  const state = this.buildState(nodeId, phase, ctx);
83251
83263
  this._pauseResolve?.(state);
83252
- return new Promise((resolve38) => {
83253
- this._gateResolve = (action) => resolve38(action);
83264
+ return new Promise((resolve39) => {
83265
+ this._gateResolve = (action) => resolve39(action);
83254
83266
  });
83255
83267
  }
83256
83268
  applyAction(action) {
@@ -83311,8 +83323,8 @@ var init_debug_controller = __esm({
83311
83323
  return outputs;
83312
83324
  }
83313
83325
  _createPausePromise() {
83314
- return new Promise((resolve38) => {
83315
- this._pauseResolve = resolve38;
83326
+ return new Promise((resolve39) => {
83327
+ this._pauseResolve = resolve39;
83316
83328
  });
83317
83329
  }
83318
83330
  };
@@ -83511,8 +83523,8 @@ var init_agent_channel = __esm({
83511
83523
  */
83512
83524
  async request(agentRequest) {
83513
83525
  this._pauseResolve?.(agentRequest);
83514
- return new Promise((resolve38, reject) => {
83515
- this._resolve = resolve38;
83526
+ return new Promise((resolve39, reject) => {
83527
+ this._resolve = resolve39;
83516
83528
  this._reject = reject;
83517
83529
  });
83518
83530
  }
@@ -83542,8 +83554,8 @@ var init_agent_channel = __esm({
83542
83554
  this._pausePromise = this._createPausePromise();
83543
83555
  }
83544
83556
  _createPausePromise() {
83545
- return new Promise((resolve38) => {
83546
- this._pauseResolve = resolve38;
83557
+ return new Promise((resolve39) => {
83558
+ this._pauseResolve = resolve39;
83547
83559
  });
83548
83560
  }
83549
83561
  };
@@ -84900,7 +84912,7 @@ async function runCommandInner(input, options) {
84900
84912
  let executionOrder = resumeExecutionOrder;
84901
84913
  if (!executionOrder) {
84902
84914
  const source = fs36.readFileSync(filePath, "utf8");
84903
- const parsed = await parseWorkflow(source, { workflowName: options.workflow });
84915
+ const parsed = await parseWorkflow(source, { workflowName: options.workflow, projectDir: path40.dirname(filePath) });
84904
84916
  if (parsed.errors.length === 0) {
84905
84917
  executionOrder = getTopologicalOrder(parsed.ast);
84906
84918
  } else {
@@ -85113,7 +85125,7 @@ async function validateMockConfig(mocks, filePath, workflowName) {
85113
85125
  }
85114
85126
  }
85115
85127
  try {
85116
- const result = await parseWorkflow(filePath, { workflowName });
85128
+ const result = await parseWorkflow(filePath, { workflowName, projectDir: path40.dirname(filePath) });
85117
85129
  if (result.errors.length > 0 || !result.ast?.instances) return;
85118
85130
  const usedNodeTypes = new Set(result.ast.instances.map((i) => i.nodeType));
85119
85131
  for (const [section, nodeType] of Object.entries(MOCK_SECTION_TO_NODE)) {
@@ -85175,13 +85187,13 @@ async function runDebugRepl(controller, execPromise, agentChannel, options) {
85175
85187
  output: process.stderr,
85176
85188
  prompt: "> "
85177
85189
  });
85178
- return new Promise((resolve38, reject) => {
85190
+ return new Promise((resolve39, reject) => {
85179
85191
  let resolved = false;
85180
85192
  function finish(value) {
85181
85193
  if (resolved) return;
85182
85194
  resolved = true;
85183
85195
  rl.close();
85184
- resolve38(value);
85196
+ resolve39(value);
85185
85197
  }
85186
85198
  function fail(err) {
85187
85199
  if (resolved) return;
@@ -85393,7 +85405,7 @@ Workflow completed in ${execResult.executionTime}ms`);
85393
85405
  });
85394
85406
  }
85395
85407
  function promptForInput(question) {
85396
- return new Promise((resolve38) => {
85408
+ return new Promise((resolve39) => {
85397
85409
  const rl = readline8.createInterface({
85398
85410
  input: process.stdin,
85399
85411
  output: process.stderr
@@ -85401,7 +85413,7 @@ function promptForInput(question) {
85401
85413
  });
85402
85414
  rl.question(question, (answer) => {
85403
85415
  rl.close();
85404
- resolve38(answer.trim());
85416
+ resolve39(answer.trim());
85405
85417
  });
85406
85418
  });
85407
85419
  }
@@ -85877,6 +85889,15 @@ __export(serve_exports, {
85877
85889
  import * as path41 from "path";
85878
85890
  import * as fs38 from "fs";
85879
85891
  async function serveCommand(dir, options) {
85892
+ try {
85893
+ await import("fastify");
85894
+ } catch {
85895
+ logger.error("The serve command requires fastify. Install it with:");
85896
+ logger.newline();
85897
+ logger.log(" npm install fastify");
85898
+ logger.newline();
85899
+ process.exit(1);
85900
+ }
85880
85901
  const workflowDir = path41.resolve(dir || ".");
85881
85902
  if (!fs38.existsSync(workflowDir)) {
85882
85903
  throw new Error(`Directory not found: ${workflowDir}`);
@@ -86761,131 +86782,6 @@ var init_implement = __esm({
86761
86782
  }
86762
86783
  });
86763
86784
 
86764
- // src/cli/commands/changelog.ts
86765
- var changelog_exports = {};
86766
- __export(changelog_exports, {
86767
- changelogCommand: () => changelogCommand
86768
- });
86769
- import { execSync as execSync6 } from "child_process";
86770
- function categorize(files) {
86771
- for (const category of CATEGORIES2) {
86772
- if (files.some(category.match)) {
86773
- return category.name;
86774
- }
86775
- }
86776
- return "Other";
86777
- }
86778
- function getGitRange(options) {
86779
- if (options.range) {
86780
- return options.range;
86781
- }
86782
- if (options.lastTag) {
86783
- try {
86784
- const lastTag = execSync6("git describe --tags --abbrev=0", {
86785
- encoding: "utf8"
86786
- }).trim();
86787
- return `${lastTag}..HEAD`;
86788
- } catch {
86789
- logger.warn("No git tags found, showing all commits");
86790
- return "HEAD";
86791
- }
86792
- }
86793
- if (options.since) {
86794
- return `--since="${options.since}"`;
86795
- }
86796
- return "-20";
86797
- }
86798
- function getCommits(rangeArg) {
86799
- const isSinceArg = rangeArg.startsWith("--since");
86800
- const isCountArg = rangeArg.startsWith("-");
86801
- let logCmd;
86802
- if (isSinceArg) {
86803
- logCmd = `git log ${rangeArg} --format="%H %s" --no-merges`;
86804
- } else if (isCountArg) {
86805
- logCmd = `git log ${rangeArg} --format="%H %s" --no-merges`;
86806
- } else {
86807
- logCmd = `git log ${rangeArg} --format="%H %s" --no-merges`;
86808
- }
86809
- const logOutput = execSync6(logCmd, { encoding: "utf8" }).trim();
86810
- if (!logOutput) {
86811
- return [];
86812
- }
86813
- const entries = [];
86814
- for (const line of logOutput.split(/\r?\n/)) {
86815
- if (!line.trim()) continue;
86816
- const spaceIdx = line.indexOf(" ");
86817
- const hash = line.slice(0, spaceIdx);
86818
- const message = line.slice(spaceIdx + 1);
86819
- let files;
86820
- try {
86821
- const filesOutput = execSync6(`git diff-tree --no-commit-id --name-only -r ${hash}`, {
86822
- encoding: "utf8"
86823
- }).trim();
86824
- files = filesOutput ? filesOutput.split(/\r?\n/) : [];
86825
- } catch {
86826
- files = [];
86827
- }
86828
- entries.push({ hash: hash.slice(0, 7), message, files });
86829
- }
86830
- return entries;
86831
- }
86832
- async function changelogCommand(options = {}) {
86833
- const rangeArg = getGitRange(options);
86834
- const rangeLabel = options.range || (options.lastTag ? "last tag" : options.since ? `since ${options.since}` : "recent");
86835
- const commits = getCommits(rangeArg);
86836
- if (commits.length === 0) {
86837
- logger.info("No commits found in the specified range.");
86838
- return;
86839
- }
86840
- const grouped = /* @__PURE__ */ new Map();
86841
- for (const commit of commits) {
86842
- const category = categorize(commit.files);
86843
- if (!grouped.has(category)) {
86844
- grouped.set(category, []);
86845
- }
86846
- grouped.get(category).push(commit);
86847
- }
86848
- console.log(`## Changes (${rangeLabel})
86849
- `);
86850
- const categoryOrder = CATEGORIES2.map((c) => c.name);
86851
- const sortedCategories = [...grouped.keys()].sort((a, b) => {
86852
- const idxA = categoryOrder.indexOf(a);
86853
- const idxB = categoryOrder.indexOf(b);
86854
- if (idxA === -1 && idxB === -1) return a.localeCompare(b);
86855
- if (idxA === -1) return 1;
86856
- if (idxB === -1) return -1;
86857
- return idxA - idxB;
86858
- });
86859
- for (const category of sortedCategories) {
86860
- const categoryCommits = grouped.get(category);
86861
- console.log(`### ${category} (${categoryCommits.length} commit${categoryCommits.length !== 1 ? "s" : ""})
86862
- `);
86863
- for (const commit of categoryCommits) {
86864
- console.log(`- ${commit.hash} ${commit.message}`);
86865
- }
86866
- console.log("");
86867
- }
86868
- }
86869
- var CATEGORIES2;
86870
- var init_changelog = __esm({
86871
- "src/cli/commands/changelog.ts"() {
86872
- "use strict";
86873
- init_logger();
86874
- CATEGORIES2 = [
86875
- { name: "Grammar", match: (f) => /parser|chevrotain|grammar/.test(f) },
86876
- { name: "Code Generation", match: (f) => /generator|body-generator|generate/.test(f) },
86877
- { name: "Differ", match: (f) => f.includes("diff/") },
86878
- { name: "CLI", match: (f) => f.includes("cli/commands/") },
86879
- { name: "MCP Tools", match: (f) => f.includes("mcp/") },
86880
- { name: "Deployment", match: (f) => /deployment|export/.test(f) },
86881
- { name: "Runtime", match: (f) => f.includes("runtime/") },
86882
- { name: "Migration", match: (f) => f.includes("migration/") },
86883
- { name: "Tests", match: (f) => f.includes("tests/") || f.includes(".test.") },
86884
- { name: "Documentation", match: (f) => /doc|readme|changelog/i.test(f) }
86885
- ];
86886
- }
86887
- });
86888
-
86889
86785
  // src/cli/commands/docs.ts
86890
86786
  var docs_exports = {};
86891
86787
  __export(docs_exports, {
@@ -87036,7 +86932,7 @@ __export(market_exports, {
87036
86932
  });
87037
86933
  import * as fs45 from "fs";
87038
86934
  import * as path48 from "path";
87039
- import { execSync as execSync7 } from "child_process";
86935
+ import { execSync as execSync6 } from "child_process";
87040
86936
  async function marketInitCommand(name, options = {}) {
87041
86937
  if (!name.startsWith("flow-weaver-pack-")) {
87042
86938
  const suggested = `flow-weaver-pack-${name}`;
@@ -87265,7 +87161,7 @@ async function marketPublishCommand(directory, options = {}) {
87265
87161
  if (tag) npmArgs.push("--tag", tag);
87266
87162
  try {
87267
87163
  logger.newline();
87268
- execSync7(`npm ${npmArgs.join(" ")}`, { cwd: dir, stdio: "inherit" });
87164
+ execSync6(`npm ${npmArgs.join(" ")}`, { cwd: dir, stdio: "inherit" });
87269
87165
  if (!dryRun) {
87270
87166
  logger.newline();
87271
87167
  logger.success(`Published ${pkg.name}@${pkg.version} to npm`);
@@ -87282,7 +87178,7 @@ async function marketInstallCommand(packageSpec, options = {}) {
87282
87178
  logger.newline();
87283
87179
  }
87284
87180
  try {
87285
- execSync7(`npm install ${packageSpec}`, { stdio: json2 ? "pipe" : "inherit" });
87181
+ execSync6(`npm install ${packageSpec}`, { stdio: json2 ? "pipe" : "inherit" });
87286
87182
  } catch (err) {
87287
87183
  if (json2) {
87288
87184
  console.log(JSON.stringify({ success: false, error: getErrorMessage(err) }));
@@ -87840,15 +87736,15 @@ function readLine(prompt2) {
87840
87736
  return Promise.resolve(null);
87841
87737
  }
87842
87738
  const rl = readline9.createInterface({ input: process.stdin, output: process.stderr });
87843
- return new Promise((resolve38) => {
87739
+ return new Promise((resolve39) => {
87844
87740
  let answered = false;
87845
87741
  rl.question(prompt2, (answer) => {
87846
87742
  answered = true;
87847
87743
  rl.close();
87848
- resolve38(answer.trim());
87744
+ resolve39(answer.trim());
87849
87745
  });
87850
87746
  rl.on("close", () => {
87851
- if (!answered) resolve38(null);
87747
+ if (!answered) resolve39(null);
87852
87748
  });
87853
87749
  });
87854
87750
  }
@@ -88102,7 +87998,7 @@ async function authStatusCommand() {
88102
87998
  }
88103
87999
  function prompt(message, hidden = false) {
88104
88000
  if (hidden && process.stdin.isTTY) {
88105
- return new Promise((resolve38) => {
88001
+ return new Promise((resolve39) => {
88106
88002
  process.stderr.write(message);
88107
88003
  process.stdin.setRawMode(true);
88108
88004
  process.stdin.resume();
@@ -88114,7 +88010,7 @@ function prompt(message, hidden = false) {
88114
88010
  process.stdin.pause();
88115
88011
  process.stdin.removeListener("data", handler);
88116
88012
  process.stderr.write("\n");
88117
- resolve38(input);
88013
+ resolve39(input);
88118
88014
  } else if (ch === "") {
88119
88015
  process.stdin.setRawMode(false);
88120
88016
  process.exit(1);
@@ -88127,11 +88023,11 @@ function prompt(message, hidden = false) {
88127
88023
  process.stdin.on("data", handler);
88128
88024
  });
88129
88025
  }
88130
- return new Promise((resolve38) => {
88026
+ return new Promise((resolve39) => {
88131
88027
  const rl = readline10.createInterface({ input: process.stdin, output: process.stderr });
88132
88028
  rl.question(message, (answer) => {
88133
88029
  rl.close();
88134
- resolve38(answer);
88030
+ resolve39(answer);
88135
88031
  });
88136
88032
  });
88137
88033
  }
@@ -88645,7 +88541,7 @@ var init_device_connection = __esm({
88645
88541
  const wsUrl = this.options.platformUrl.replace(/^http/, "ws").replace(/\/$/, "") + "/ws/device";
88646
88542
  this.log(`Connecting to ${wsUrl}...`);
88647
88543
  this.shouldReconnect = true;
88648
- return new Promise((resolve38, reject) => {
88544
+ return new Promise((resolve39, reject) => {
88649
88545
  try {
88650
88546
  this.ws = new WebSocket(`${wsUrl}?token=${encodeURIComponent(this.options.token)}`);
88651
88547
  } catch (err) {
@@ -88662,7 +88558,7 @@ var init_device_connection = __esm({
88662
88558
  }
88663
88559
  }, 3e4);
88664
88560
  this.options.onConnect?.();
88665
- resolve38();
88561
+ resolve39();
88666
88562
  });
88667
88563
  this.ws.addEventListener("message", async (event) => {
88668
88564
  try {
@@ -88768,12 +88664,12 @@ import * as path52 from "node:path";
88768
88664
  import * as os5 from "node:os";
88769
88665
  import * as readline11 from "node:readline";
88770
88666
  function promptYesNo(message) {
88771
- return new Promise((resolve38) => {
88667
+ return new Promise((resolve39) => {
88772
88668
  const rl = readline11.createInterface({ input: process.stdin, output: process.stderr });
88773
88669
  rl.question(message, (answer) => {
88774
88670
  rl.close();
88775
88671
  const normalized = answer.trim().toLowerCase();
88776
- resolve38(normalized === "" || normalized === "y" || normalized === "yes");
88672
+ resolve39(normalized === "" || normalized === "y" || normalized === "yes");
88777
88673
  });
88778
88674
  });
88779
88675
  }
@@ -88894,15 +88790,15 @@ async function handleConnect(projectDir) {
88894
88790
  try {
88895
88791
  await conn.connect();
88896
88792
  console.log(" \x1B[2mPress Ctrl+C to disconnect.\x1B[0m\n");
88897
- await new Promise((resolve38) => {
88793
+ await new Promise((resolve39) => {
88898
88794
  process.on("SIGINT", () => {
88899
88795
  console.log("\n \x1B[2mDisconnecting...\x1B[0m");
88900
88796
  conn.disconnect();
88901
- resolve38();
88797
+ resolve39();
88902
88798
  });
88903
88799
  process.on("SIGTERM", () => {
88904
88800
  conn.disconnect();
88905
- resolve38();
88801
+ resolve39();
88906
88802
  });
88907
88803
  });
88908
88804
  } catch (err) {
@@ -88960,7 +88856,7 @@ function parseIntStrict(value) {
88960
88856
  // src/cli/index.ts
88961
88857
  init_logger();
88962
88858
  init_error_utils();
88963
- var version2 = true ? "0.30.0" : "0.0.0-dev";
88859
+ var version2 = true ? "0.30.2" : "0.0.0-dev";
88964
88860
  var program2 = new Command();
88965
88861
  program2.name("fw").description("Flow Weaver Annotations - Compile and validate workflow files").option("-v, --version", "Output the current version").option("--no-color", "Disable colors").option("--color", "Force colors").on("option:version", () => {
88966
88862
  logger.banner(version2);
@@ -89156,10 +89052,6 @@ program2.command("implement <input> [node]").description("Replace a stub node wi
89156
89052
  if (options.workflow) options.workflowName = options.workflow;
89157
89053
  await implementCommand2(input, nodeName, options);
89158
89054
  }));
89159
- program2.command("changelog").description("Generate changelog from git history, categorized by file path").option("--last-tag", "From last git tag to HEAD", false).option("--since <date>", 'Date-based range (e.g., "2024-01-01")').option("-r, --range <range>", 'Custom git range (e.g., "v0.1.0..HEAD")').action(wrapAction(async (options) => {
89160
- const { changelogCommand: changelogCommand2 } = await Promise.resolve().then(() => (init_changelog(), changelog_exports));
89161
- await changelogCommand2(options);
89162
- }));
89163
89055
  program2.command("docs [args...]").description("Browse reference documentation").option("--json", "Output as JSON", false).option("--compact", "Return compact LLM-friendly version", false).action(wrapAction(async (args, options) => {
89164
89056
  const { docsListCommand: docsListCommand2, docsReadCommand: docsReadCommand2, docsSearchCommand: docsSearchCommand2 } = await Promise.resolve().then(() => (init_docs2(), docs_exports));
89165
89057
  if (args.length === 0 || args[0] === "list") {