@yawlabs/mcp 1.1.8 → 1.1.10

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.
@@ -3868,6 +3868,17 @@ function sidecarsRoot(home = homedir3()) {
3868
3868
  function sidecarsNodeModules(home = homedir3()) {
3869
3869
  return path2.join(sidecarsRoot(home), "node_modules");
3870
3870
  }
3871
+ var GIT_DIRNAME = "git";
3872
+ var GIT_BUILD_SHA_LEN = 12;
3873
+ function gitRoot(home = homedir3()) {
3874
+ return path2.join(userConfigDir(home), GIT_DIRNAME);
3875
+ }
3876
+ function gitBuildDir(namespace, commit, home = homedir3()) {
3877
+ return path2.join(gitRoot(home), namespace, commit.slice(0, GIT_BUILD_SHA_LEN));
3878
+ }
3879
+ function gitFailedPath(namespace, commit, home = homedir3()) {
3880
+ return `${gitBuildDir(namespace, commit, home)}.failed`;
3881
+ }
3871
3882
  function userConfigDir(home = homedir3()) {
3872
3883
  return path2.join(home, CONFIG_DIRNAME);
3873
3884
  }
@@ -4660,7 +4671,7 @@ function npxSpec(args) {
4660
4671
  const spec = args[idx];
4661
4672
  return spec.startsWith("-") ? null : spec;
4662
4673
  }
4663
- var MIN_OAM_VERSION = "0.19.1";
4674
+ var MIN_OAM_VERSION = "0.19.5";
4664
4675
  var OAM_INSTALL_SH = "curl -fsSL https://oamjs.org/install.sh | sh";
4665
4676
  var OAM_INSTALL_PS1 = "irm https://oamjs.org/install.ps1 | iex";
4666
4677
  function oamInstallCommand(os) {
@@ -4695,7 +4706,7 @@ function oamBuildTreeFix(os, viaOamBin = false) {
4695
4706
  }
4696
4707
  function oamHeapOomHint(stderr) {
4697
4708
  if (!stderr.includes("OAM-RT-OOM")) return null;
4698
- return `The oam-hosted child hit its V8 heap cap. Raise it with OAM_MAX_HEAP_MB=<mb> in this server's env, or set "runtime": "node" for this server in bundles.json.`;
4709
+ return `The oam-hosted child hit its V8 heap cap. Raise it where it is set: the --max-old-space-size=<mb> flag in this server's node args if it has one (that wins), else NODE_OPTIONS=--max-old-space-size=<mb> in its env (honored by oam and node alike, and it takes precedence over OAM_MAX_HEAP_MB), or OAM_MAX_HEAP_MB=<mb> when nothing sets --max-old-space-size; or set "runtime": "node" for this server in bundles.json.`;
4699
4710
  }
4700
4711
  var warnedOamUnavailable = false;
4701
4712
  function oamFailureLabel(failure) {
@@ -5062,11 +5073,73 @@ function nodeLaunchKind(command) {
5062
5073
  return null;
5063
5074
  }
5064
5075
  var TS_ENTRY_RE = /\.[mc]?ts$/i;
5076
+ var POSITIVE_INT = /^[1-9]\d*$/;
5077
+ var OAM_HOSTABLE_NODE_BOOLEAN_FLAGS = /* @__PURE__ */ new Set([
5078
+ "--no-warnings",
5079
+ "--no-deprecation",
5080
+ "--trace-warnings",
5081
+ "--trace-deprecation",
5082
+ "--throw-deprecation",
5083
+ "--trace-uncaught",
5084
+ "--expose-gc"
5085
+ ]);
5086
+ var OAM_HOSTABLE_NODE_VALUE_FLAGS = /* @__PURE__ */ new Map([
5087
+ ["--max-old-space-size", POSITIVE_INT],
5088
+ ["--max-http-header-size", POSITIVE_INT],
5089
+ ["--dns-result-order", /^(?:verbatim|ipv4first|ipv6first)$/],
5090
+ ["--disable-warning", /^[A-Za-z0-9_]+$/]
5091
+ ]);
5092
+ function scanNodeLaunchFlags(args) {
5093
+ const flags = [];
5094
+ for (let i = 0; i < args.length; i++) {
5095
+ const a = args[i];
5096
+ if (!a.startsWith("-")) {
5097
+ if (a === "") return { kind: "no-entry" };
5098
+ return { kind: "entry", flags, entry: a, rest: args.slice(i + 1) };
5099
+ }
5100
+ const eq = a.indexOf("=");
5101
+ const name = eq === -1 ? a : a.slice(0, eq);
5102
+ if (OAM_HOSTABLE_NODE_BOOLEAN_FLAGS.has(name)) {
5103
+ if (eq !== -1) return { kind: "refused", flag: name, why: "bad-value" };
5104
+ } else {
5105
+ const valueRe = OAM_HOSTABLE_NODE_VALUE_FLAGS.get(name);
5106
+ if (valueRe === void 0) return { kind: "refused", flag: name, why: "unlisted" };
5107
+ if (eq === -1) return { kind: "refused", flag: name, why: "spaced-value" };
5108
+ if (!valueRe.test(a.slice(eq + 1))) return { kind: "refused", flag: name, why: "bad-value" };
5109
+ }
5110
+ flags.push(a);
5111
+ }
5112
+ return { kind: "no-entry" };
5113
+ }
5114
+ function describeNodeFlagRefusal(flag, why) {
5115
+ if (why === "spaced-value") {
5116
+ return `the node launch gives ${flag} its value as a separate argument; yaw-mcp hosts it on oam only as ${flag}=<value>`;
5117
+ }
5118
+ if (why === "bad-value") return `the node launch gives ${flag} a value yaw-mcp does not pass to oam`;
5119
+ return `the node launch carries the node flag ${flag}, which yaw-mcp does not host on oam`;
5120
+ }
5121
+ var OAM_SPACED_VALUE_OPTIONS = /* @__PURE__ */ new Set([
5122
+ "--check",
5123
+ "--record",
5124
+ "--replay",
5125
+ "--env-file",
5126
+ "--env-file-if-exists",
5127
+ "--input-type",
5128
+ "--max-http-header-size",
5129
+ "--max-old-space-size",
5130
+ "--v8-pool-size",
5131
+ "--trace-require-module",
5132
+ "--dns-result-order",
5133
+ "--disable-warning",
5134
+ "--redirect-warnings",
5135
+ "--allow-fs-read",
5136
+ "--allow-fs-write"
5137
+ ]);
5065
5138
  function rewriteForOam(command, args, deps) {
5066
5139
  const bin = deps.oamBin;
5067
5140
  if (!bin) return { command, args };
5068
- const toOam = (entry, rest) => {
5069
- const flags = TS_ENTRY_RE.test(entry) ? ["--no-check"] : [];
5141
+ const toOam = (entry, rest, nodeFlags = []) => {
5142
+ const flags = [...nodeFlags, ...TS_ENTRY_RE.test(entry) ? ["--no-check"] : []];
5070
5143
  return {
5071
5144
  command: bin,
5072
5145
  args: rest.length > 0 ? ["run", ...flags, entry, "--", ...rest] : ["run", ...flags, entry]
@@ -5074,10 +5147,17 @@ function rewriteForOam(command, args, deps) {
5074
5147
  };
5075
5148
  const kind = nodeLaunchKind(command);
5076
5149
  if (kind === "node") {
5077
- const [entry, ...rest] = args;
5078
- if (!entry) return { command, args };
5079
- if (entry.startsWith("-")) return { command, args };
5080
- return toOam(entry, rest);
5150
+ const scan = scanNodeLaunchFlags(args);
5151
+ if (scan.kind === "no-entry") return { command, args };
5152
+ if (scan.kind === "refused") {
5153
+ log("debug", "node launch carries a node flag yaw-mcp does not host on oam; staying on node", {
5154
+ flag: scan.flag,
5155
+ why: scan.why,
5156
+ argc: args.length
5157
+ });
5158
+ return { command, args };
5159
+ }
5160
+ return toOam(scan.entry, scan.rest, scan.flags);
5081
5161
  }
5082
5162
  if (kind === "npx") {
5083
5163
  const specIdx = npxSpecIndex(args);
@@ -5785,17 +5865,17 @@ async function oamFloorLines(probe) {
5785
5865
  }
5786
5866
  async function defaultRunningPrefix(argvPath) {
5787
5867
  if (isTestSandbox()) return null;
5788
- const { detectRunningInstallPrefix: detectRunningInstallPrefix2 } = await import("./auto-upgrade-QLY5Y4ZM.js");
5868
+ const { detectRunningInstallPrefix: detectRunningInstallPrefix2 } = await import("./auto-upgrade-BFZR7HIL.js");
5789
5869
  return detectRunningInstallPrefix2(argvPath);
5790
5870
  }
5791
5871
  async function defaultAcquireLock(prefixDir) {
5792
5872
  if (isTestSandbox()) return () => {
5793
5873
  };
5794
- const { acquireUpgradeLock: acquireUpgradeLock2 } = await import("./auto-upgrade-QLY5Y4ZM.js");
5874
+ const { acquireUpgradeLock: acquireUpgradeLock2 } = await import("./auto-upgrade-BFZR7HIL.js");
5795
5875
  return acquireUpgradeLock2(prefixDir);
5796
5876
  }
5797
5877
  async function upgradeLockPath(prefixDir) {
5798
- const { UPGRADE_LOCK_NAME: UPGRADE_LOCK_NAME2 } = await import("./auto-upgrade-QLY5Y4ZM.js");
5878
+ const { UPGRADE_LOCK_NAME: UPGRADE_LOCK_NAME2 } = await import("./auto-upgrade-BFZR7HIL.js");
5799
5879
  return join11(prefixDir, UPGRADE_LOCK_NAME2);
5800
5880
  }
5801
5881
  async function defaultSpawn(cmd, args, cwd) {
@@ -5858,7 +5938,7 @@ async function runUpgrade(opts = {}) {
5858
5938
  if (method === "global-npm") {
5859
5939
  rawPrefix = await (opts.runningPrefix ?? defaultRunningPrefix)(argvPath);
5860
5940
  if (rawPrefix !== null) {
5861
- const { quoteArgForDisplay: quoteArgForDisplay2, quoteShellArgIfNeeded: quoteShellArgIfNeeded2 } = await import("./auto-upgrade-QLY5Y4ZM.js");
5941
+ const { quoteArgForDisplay: quoteArgForDisplay2, quoteShellArgIfNeeded: quoteShellArgIfNeeded2 } = await import("./auto-upgrade-BFZR7HIL.js");
5862
5942
  const spawnForm = quoteShellArgIfNeeded2(rawPrefix, opts.platform);
5863
5943
  const displayForm = quoteArgForDisplay2(rawPrefix, opts.platform);
5864
5944
  if (spawnForm !== null && displayForm !== null) {
@@ -5990,7 +6070,7 @@ async function runUpgrade(opts = {}) {
5990
6070
  return { exitCode: 3, lines };
5991
6071
  }
5992
6072
  function readCurrentVersion() {
5993
- return true ? "1.1.8" : "dev";
6073
+ return true ? "1.1.10" : "dev";
5994
6074
  }
5995
6075
 
5996
6076
  // src/auto-upgrade.ts
@@ -6282,7 +6362,7 @@ function defaultSpawn2(cmd, args, onDone = () => {
6282
6362
  }
6283
6363
  async function maybeAutoUpgrade(deps = {}) {
6284
6364
  if (isFeatureDisabled("YAW_MCP_AUTO_UPGRADE")) return;
6285
- const current = deps.currentVersion ?? (true ? "1.1.8" : "dev");
6365
+ const current = deps.currentVersion ?? (true ? "1.1.10" : "dev");
6286
6366
  if (current === "dev") return;
6287
6367
  const argvPath = deps.argvPath ?? process.argv[1];
6288
6368
  let method = (deps.isSeaImpl ? await deps.isSeaImpl() : await detectSea()) ? "binary" : detectInstallMethod(argvPath, realpathSync3, ["unknown", "local-node-modules"]);
@@ -6407,6 +6487,10 @@ export {
6407
6487
  CONFIG_DIRNAME,
6408
6488
  sidecarsRoot,
6409
6489
  sidecarsNodeModules,
6490
+ GIT_BUILD_SHA_LEN,
6491
+ gitRoot,
6492
+ gitBuildDir,
6493
+ gitFailedPath,
6410
6494
  userConfigDir,
6411
6495
  normalizeForCompare,
6412
6496
  tildePath,
@@ -6492,8 +6576,14 @@ export {
6492
6576
  oamHeapOomHint,
6493
6577
  oamFailureLabel,
6494
6578
  compareVersions,
6579
+ resolveBinAbsolute,
6495
6580
  probeOam,
6496
6581
  nodeLaunchKind,
6582
+ scanNodeLaunchFlags,
6583
+ describeNodeFlagRefusal,
6584
+ OAM_SPACED_VALUE_OPTIONS,
6585
+ managedNodeBin,
6586
+ packageEntry,
6497
6587
  resolveStableNpmEntry,
6498
6588
  resolveOamSpawn,
6499
6589
  resolveManagedSpawn,
@@ -0,0 +1,126 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ GIT_CONSENT_FILENAME,
4
+ GIT_CREDENTIALS_REFUSAL,
5
+ GIT_LOCK_NAME,
6
+ GIT_MANIFEST_FILENAME,
7
+ GIT_MISSING_MESSAGE,
8
+ GIT_PIN_LOCK_WAIT_MS,
9
+ GIT_REFS_FILENAME,
10
+ GIT_STATE_FILENAME,
11
+ PNPM_FILTER_NAME_RE,
12
+ buildGitSource,
13
+ buildMatchesHost,
14
+ buildPinnedGitEntries,
15
+ consentLines,
16
+ detectPackageManager,
17
+ discardBuild,
18
+ gcGitBuilds,
19
+ gitAuthMessage,
20
+ gitAvailable,
21
+ gitCheckoutDir,
22
+ gitConsentPath,
23
+ gitEntryBuilt,
24
+ gitHostKeyMessage,
25
+ gitLivenessWarning,
26
+ gitRefProblem,
27
+ gitRefsPath,
28
+ gitStatePath,
29
+ hasRepoConsent,
30
+ inferredEntry,
31
+ keptBuilds,
32
+ lifecycleScripts,
33
+ listRemoteRefs,
34
+ newerTags,
35
+ normalizeRepoUrl,
36
+ parseGitSpec,
37
+ planBuild,
38
+ planGitRemoval,
39
+ prepareGit,
40
+ printable,
41
+ readBuildMarker,
42
+ readGitManifest,
43
+ readGitState,
44
+ readVaultSecret,
45
+ recordGitPin,
46
+ recordLoadedGitPin,
47
+ recordRepoConsent,
48
+ redactGitOutput,
49
+ removeGitCheckout,
50
+ removeTree,
51
+ repoConfigFiles,
52
+ resolveGitRef,
53
+ resolvePmCommand,
54
+ resolveRefIn,
55
+ runGit,
56
+ scrubUrlUserinfo,
57
+ sweepStaging,
58
+ tokenUsername,
59
+ treeSizeBytes,
60
+ tryRemoveTree,
61
+ writeAskpassHelper,
62
+ writeGitState
63
+ } from "./chunk-DQ4KOZI5.js";
64
+ import "./chunk-X54WSPEC.js";
65
+ export {
66
+ GIT_CONSENT_FILENAME,
67
+ GIT_CREDENTIALS_REFUSAL,
68
+ GIT_LOCK_NAME,
69
+ GIT_MANIFEST_FILENAME,
70
+ GIT_MISSING_MESSAGE,
71
+ GIT_PIN_LOCK_WAIT_MS,
72
+ GIT_REFS_FILENAME,
73
+ GIT_STATE_FILENAME,
74
+ PNPM_FILTER_NAME_RE,
75
+ buildGitSource,
76
+ buildMatchesHost,
77
+ buildPinnedGitEntries,
78
+ consentLines,
79
+ detectPackageManager,
80
+ discardBuild,
81
+ gcGitBuilds,
82
+ gitAuthMessage,
83
+ gitAvailable,
84
+ gitCheckoutDir,
85
+ gitConsentPath,
86
+ gitEntryBuilt,
87
+ gitHostKeyMessage,
88
+ gitLivenessWarning,
89
+ gitRefProblem,
90
+ gitRefsPath,
91
+ gitStatePath,
92
+ hasRepoConsent,
93
+ inferredEntry,
94
+ keptBuilds,
95
+ lifecycleScripts,
96
+ listRemoteRefs,
97
+ newerTags,
98
+ normalizeRepoUrl,
99
+ parseGitSpec,
100
+ planBuild,
101
+ planGitRemoval,
102
+ prepareGit,
103
+ printable,
104
+ readBuildMarker,
105
+ readGitManifest,
106
+ readGitState,
107
+ readVaultSecret,
108
+ recordGitPin,
109
+ recordLoadedGitPin,
110
+ recordRepoConsent,
111
+ redactGitOutput,
112
+ removeGitCheckout,
113
+ removeTree,
114
+ repoConfigFiles,
115
+ resolveGitRef,
116
+ resolvePmCommand,
117
+ resolveRefIn,
118
+ runGit,
119
+ scrubUrlUserinfo,
120
+ sweepStaging,
121
+ tokenUsername,
122
+ treeSizeBytes,
123
+ tryRemoveTree,
124
+ writeAskpassHelper,
125
+ writeGitState
126
+ };