@tempo-ai/mcp 0.0.136-staging.1 → 0.0.137-staging.1

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.
package/dist/bin.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { createRequire as __tempoCreateRequire } from 'node:module'; const require = __tempoCreateRequire(import.meta.url);
3
3
  import {
4
4
  run
5
- } from "./chunk-3KFLJC3H.js";
5
+ } from "./chunk-MG2MJVWM.js";
6
6
  import "./chunk-4R6XIZCX.js";
7
7
  import "./chunk-JKT5N6IQ.js";
8
8
 
@@ -9,7 +9,7 @@ import "./chunk-JKT5N6IQ.js";
9
9
  import { Client } from "@modelcontextprotocol/sdk/client/index.js";
10
10
  import { InMemoryTransport } from "@modelcontextprotocol/sdk/inMemory.js";
11
11
  async function connectAggregate(options) {
12
- const { createTempoAggregate } = await import("./serve-VVKSMWYG.js");
12
+ const { createTempoAggregate } = await import("./serve-4WVS2BRU.js");
13
13
  const handle = await createTempoAggregate(options, { stageDocuments: false });
14
14
  const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();
15
15
  const client = new Client({ name: "tempo-mcp-cli", version: "0" });
@@ -128,4 +128,4 @@ export {
128
128
  runCall,
129
129
  runTools
130
130
  };
131
- //# sourceMappingURL=call-CPSN77IM.js.map
131
+ //# sourceMappingURL=call-ZWKOIOOI.js.map
@@ -122,7 +122,7 @@ async function run(argv) {
122
122
  process.stderr.write(USAGE);
123
123
  return 1;
124
124
  }
125
- const { runServe } = await import("./serve-VVKSMWYG.js");
125
+ const { runServe } = await import("./serve-4WVS2BRU.js");
126
126
  return await runServe(options);
127
127
  }
128
128
  switch (subcommand) {
@@ -137,11 +137,11 @@ async function run(argv) {
137
137
  return await runToken(rest);
138
138
  }
139
139
  case "tools": {
140
- const { runTools } = await import("./call-CPSN77IM.js");
140
+ const { runTools } = await import("./call-ZWKOIOOI.js");
141
141
  return await runTools(rest);
142
142
  }
143
143
  case "call": {
144
- const { runCall } = await import("./call-CPSN77IM.js");
144
+ const { runCall } = await import("./call-ZWKOIOOI.js");
145
145
  return await runCall(rest);
146
146
  }
147
147
  default:
@@ -164,4 +164,4 @@ async function run(argv) {
164
164
  export {
165
165
  run
166
166
  };
167
- //# sourceMappingURL=chunk-3KFLJC3H.js.map
167
+ //# sourceMappingURL=chunk-MG2MJVWM.js.map
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __tempoCreateRequire } from 'node:module'; const require = __tempoCreateRequire(import.meta.url);
2
2
  import {
3
3
  run
4
- } from "./chunk-3KFLJC3H.js";
4
+ } from "./chunk-MG2MJVWM.js";
5
5
  import "./chunk-4R6XIZCX.js";
6
6
  import "./chunk-JKT5N6IQ.js";
7
7
  export {
@@ -88171,7 +88171,7 @@ var MissingRootDepsError = class extends TempoDevServerError {
88171
88171
  // ../tempo-sdk/package.json
88172
88172
  var package_default = {
88173
88173
  name: "tempo-sdk",
88174
- version: "0.0.87",
88174
+ version: "0.0.89",
88175
88175
  publishConfig: {
88176
88176
  tag: "sdk-v2-latest"
88177
88177
  },
@@ -98412,6 +98412,26 @@ function waitForInstallBarrier(work, signal) {
98412
98412
  signal
98413
98413
  );
98414
98414
  }
98415
+ var projectInstalls = /* @__PURE__ */ new Map();
98416
+ async function runExclusiveProjectInstall(projectRoot, signal, install) {
98417
+ const key = path26.resolve(projectRoot);
98418
+ const ahead = projectInstalls.get(key);
98419
+ let finished;
98420
+ const done = new Promise((resolve2) => {
98421
+ finished = resolve2;
98422
+ });
98423
+ const turn = ahead ? ahead.then(() => done) : done;
98424
+ projectInstalls.set(key, turn);
98425
+ try {
98426
+ if (ahead) await waitForInstallBarrier(ahead, signal);
98427
+ return await install();
98428
+ } finally {
98429
+ finished();
98430
+ void turn.then(() => {
98431
+ if (projectInstalls.get(key) === turn) projectInstalls.delete(key);
98432
+ });
98433
+ }
98434
+ }
98415
98435
  function createSuffixedTempoNextDistDir() {
98416
98436
  const nonce = `${Date.now().toString(36)}${Math.random().toString(36).slice(2, 6)}`;
98417
98437
  return `${TEMPO_NEXT_STABLE_DIST_DIR}-${nonce}`;
@@ -99368,6 +99388,9 @@ var TempoDevServer = class _TempoDevServer {
99368
99388
  // after Next reports an observed lock conflict for that directory.
99369
99389
  this.nextDistDir = null;
99370
99390
  this.nextDistDirClaim = null;
99391
+ /** The dependency inputs (each package root's completion key) that the
99392
+ * last consecutive failed installs ran with. */
99393
+ this.installFailure = null;
99371
99394
  const paths = resolveRuntimePaths(config.tempoConfigPath);
99372
99395
  this.config = {
99373
99396
  ...config,
@@ -99459,9 +99482,6 @@ var TempoDevServer = class _TempoDevServer {
99459
99482
  }
99460
99483
  }
99461
99484
  }
99462
- static {
99463
- this.installBarriers = /* @__PURE__ */ new Map();
99464
- }
99465
99485
  getConfig() {
99466
99486
  return {
99467
99487
  ...this.config,
@@ -99597,6 +99617,7 @@ var TempoDevServer = class _TempoDevServer {
99597
99617
  updateSdkScript: this.config.scripts.updateSdk,
99598
99618
  startScript: this.config.scripts.start,
99599
99619
  forceInstall: options2?.forceInstall ?? false,
99620
+ rerunInstall: options2?.rerunInstall ?? false,
99600
99621
  dependenciesInstalled: this.state.dependenciesInstalled
99601
99622
  });
99602
99623
  if (!this.state.initialized) {
@@ -99796,9 +99817,9 @@ var TempoDevServer = class _TempoDevServer {
99796
99817
  }
99797
99818
  await this.selectNodeRuntimeForStart();
99798
99819
  throwIfLaunchAborted(options2?.signal);
99799
- if (options2?.forceInstall || !this.state.dependenciesInstalled) {
99820
+ if (options2?.forceInstall || options2?.rerunInstall || !this.state.dependenciesInstalled) {
99800
99821
  await this.installDependenciesForStart(
99801
- options2?.forceInstall === true,
99822
+ options2?.forceInstall ? "clean" : options2?.rerunInstall ? "rerun" : "if-needed",
99802
99823
  options2?.signal,
99803
99824
  options2?.onInstallOutput,
99804
99825
  options2?.onInstallStart
@@ -100207,7 +100228,55 @@ var TempoDevServer = class _TempoDevServer {
100207
100228
  });
100208
100229
  this.checkedLegacyDependencyLock = true;
100209
100230
  }
100210
- async installDependenciesForStart(forceInstall, signal, onOutput, onInstallStart) {
100231
+ /**
100232
+ * Install for packages missing from a folder the project's own install
100233
+ * covers. Runs that install once, whichever folders asked. After the first
100234
+ * install and one retry have failed on the same dependency inputs, this
100235
+ * reports the failure instead of running again; a new start still installs.
100236
+ * The inputs are the project root's and each asking package root's
100237
+ * manifest, so fixing any of them earns a fresh attempt.
100238
+ */
100239
+ async installWorkspacePackages(options2 = {}) {
100240
+ const inputs = await installInputs([
100241
+ this.projectRoot,
100242
+ ...options2.packageRoots ?? []
100243
+ ]);
100244
+ const failure2 = this.installFailure;
100245
+ if (failure2 && failure2.count >= MAX_WORKSPACE_INSTALL_ATTEMPTS && [...inputs].every(
100246
+ ([root3, key]) => failure2.inputs.has(root3) && failure2.inputs.get(root3) === key
100247
+ )) {
100248
+ throw failure2.error;
100249
+ }
100250
+ await this.installDependenciesForStart(
100251
+ "if-needed",
100252
+ options2.signal,
100253
+ options2.onOutput,
100254
+ options2.onInstallStart,
100255
+ () => this.buildWorkspaceInstallSteps(),
100256
+ options2.onTransientLockFailure,
100257
+ inputs
100258
+ );
100259
+ }
100260
+ async buildWorkspaceInstallSteps() {
100261
+ if (!looksLikeGeneratedInstallScript(
100262
+ this.config.scripts.install.trim(),
100263
+ path26.relative(this.projectRoot, this.appRoot).split(path26.sep).join("/")
100264
+ )) {
100265
+ return this.buildInstallSteps("rerun");
100266
+ }
100267
+ const manager = await detectOwningPackageManager(this.projectRoot);
100268
+ if (!manager) return [];
100269
+ return filterProtectedInstallSteps([
100270
+ {
100271
+ cwd: this.projectRoot,
100272
+ command: await buildSafeInstallCommand(manager, this.projectRoot),
100273
+ label: "project root install",
100274
+ markerRoots: [this.projectRoot]
100275
+ }
100276
+ ]);
100277
+ }
100278
+ async installDependenciesForStart(mode, signal, onOutput, onInstallStart, buildSteps = () => this.buildInstallSteps(mode), onTransientLockFailure, inputs) {
100279
+ const attemptInputs = inputs ?? await installInputs([this.projectRoot]);
100211
100280
  const installTimer = devTimer("supervisor:install", {
100212
100281
  tempoRoot: this.tempoRoot,
100213
100282
  commandCwd: this.commandCwd,
@@ -100216,7 +100285,7 @@ var TempoDevServer = class _TempoDevServer {
100216
100285
  try {
100217
100286
  const installWork = async () => {
100218
100287
  throwIfLaunchAborted(signal);
100219
- const steps = await this.buildInstallSteps(forceInstall);
100288
+ const steps = await buildSteps();
100220
100289
  if (steps.length === 0) {
100221
100290
  return;
100222
100291
  }
@@ -100231,14 +100300,15 @@ var TempoDevServer = class _TempoDevServer {
100231
100300
  signal,
100232
100301
  onOutput,
100233
100302
  this.projectRoot,
100234
- await this.nuxtSidecarNodePathEnv()
100303
+ await this.nuxtSidecarNodePathEnv(),
100304
+ onTransientLockFailure
100235
100305
  );
100236
100306
  }
100237
100307
  } catch (error) {
100238
100308
  throwIfLaunchAborted(signal);
100239
100309
  if (!steps.some((step) => step.label === "custom tempo install") || !missingInstallEnvironment(error))
100240
100310
  throw error;
100241
- const localSteps = await this.buildInstallSteps(false, false);
100311
+ const localSteps = await this.buildInstallSteps("if-needed", false);
100242
100312
  if (!localSteps.length) throw error;
100243
100313
  console.warn(
100244
100314
  "[tempo-devserver] The configured installer needs unavailable local tooling; trying a local dependency install for this launch."
@@ -100255,34 +100325,36 @@ var TempoDevServer = class _TempoDevServer {
100255
100325
  }
100256
100326
  }
100257
100327
  };
100258
- while (_TempoDevServer.installBarriers.has(this.projectRoot)) {
100259
- await waitForInstallBarrier(
100260
- _TempoDevServer.installBarriers.get(this.projectRoot),
100261
- signal
100262
- );
100263
- }
100264
- const work = installWork();
100265
- _TempoDevServer.installBarriers.set(this.projectRoot, work);
100266
- try {
100267
- await work;
100268
- } finally {
100269
- if (_TempoDevServer.installBarriers.get(this.projectRoot) === work) {
100270
- _TempoDevServer.installBarriers.delete(this.projectRoot);
100271
- }
100272
- }
100328
+ await runExclusiveProjectInstall(this.projectRoot, signal, installWork);
100273
100329
  throwIfLaunchAborted(signal);
100274
100330
  this.state.dependenciesInstalled = true;
100275
100331
  await this.persistStatus();
100332
+ this.installFailure = null;
100276
100333
  installTimer.done({ ok: true });
100277
100334
  } catch (error) {
100278
100335
  installTimer.done({
100279
100336
  ok: false,
100280
100337
  message: error instanceof Error ? error.message : String(error)
100281
100338
  });
100339
+ if (!signal?.aborted) {
100340
+ const previous = this.installFailure;
100341
+ const continues = previous !== null && [...attemptInputs].every(
100342
+ ([root3, key]) => !previous.inputs.has(root3) || previous.inputs.get(root3) === key
100343
+ );
100344
+ this.installFailure = {
100345
+ count: continues ? previous.count + 1 : 1,
100346
+ error,
100347
+ inputs: new Map([
100348
+ ...continues ? previous.inputs : [],
100349
+ ...attemptInputs
100350
+ ])
100351
+ };
100352
+ }
100282
100353
  throw error;
100283
100354
  }
100284
100355
  }
100285
- async buildInstallSteps(forceInstall, useConfiguredScript = true) {
100356
+ async buildInstallSteps(mode, useConfiguredScript = true) {
100357
+ const forceInstall = mode !== "if-needed";
100286
100358
  const configuredInstall = this.config.scripts.install.trim();
100287
100359
  if (useConfiguredScript && !looksLikeGeneratedInstallScript(
100288
100360
  configuredInstall,
@@ -100363,7 +100435,7 @@ var TempoDevServer = class _TempoDevServer {
100363
100435
  // routine "not ready" after a COMPLETED install (deps changed) does an
100364
100436
  // ordinary incremental install — cheap when already satisfied, and npm
100365
100437
  // restores any missing optional-native binary. See TEM-820.
100366
- cleanBeforeInstall: forceInstall || await installWasInterrupted(this.tempoRoot),
100438
+ cleanBeforeInstall: mode === "clean" || await installWasInterrupted(this.tempoRoot),
100367
100439
  // Record completion only after `npm install` exits 0 so an interrupted
100368
100440
  // install is never mistaken for a finished one on the next start.
100369
100441
  markerRoots: [this.tempoRoot]
@@ -101963,6 +102035,15 @@ async function installWasInterrupted(packageRoot) {
101963
102035
  }
101964
102036
  var INSTALL_COMPLETION_MARKER_VERSION = "tempo-install-complete-v3";
101965
102037
  var EXTERNAL_LAYOUT_INSTALL_MARKER = ".tempo-external-install-complete";
102038
+ async function installInputs(roots) {
102039
+ return new Map(
102040
+ await Promise.all(
102041
+ [...new Set(roots.map((root3) => path26.resolve(root3)))].map(
102042
+ async (root3) => [root3, await computeInstallCompletionKey(root3)]
102043
+ )
102044
+ )
102045
+ );
102046
+ }
101966
102047
  async function computeInstallCompletionKey(packageRoot) {
101967
102048
  const packageJsonPath = path26.join(packageRoot, "package.json");
101968
102049
  const raw = await readTextFileOptional(packageJsonPath);
@@ -102448,7 +102529,8 @@ function isIgnoredBuildScriptsOnlyFailure(output) {
102448
102529
  return /ERR_PNPM_IGNORED_BUILDS/.test(output);
102449
102530
  }
102450
102531
  var INSTALL_LOCK_RETRY_DELAYS_MS = [1e3, 3e3, 6e3];
102451
- async function runInstallCommandWithLockRetry(command, cwd, runCommandFn = runShellCommand, retryDelaysMs = INSTALL_LOCK_RETRY_DELAYS_MS, signal) {
102532
+ var MAX_WORKSPACE_INSTALL_ATTEMPTS = 2;
102533
+ async function runInstallCommandWithLockRetry(command, cwd, runCommandFn = runShellCommand, retryDelaysMs = INSTALL_LOCK_RETRY_DELAYS_MS, signal, onTransientLockFailure) {
102452
102534
  for (let attempt = 0; ; attempt += 1) {
102453
102535
  throwIfLaunchAborted(signal);
102454
102536
  try {
@@ -102460,11 +102542,12 @@ async function runInstallCommandWithLockRetry(command, cwd, runCommandFn = runSh
102460
102542
  const delay3 = retryDelaysMs[attempt];
102461
102543
  if (delay3 === void 0 || !isTransientFsLockOutput(output)) throw error;
102462
102544
  devLog("supervisor:install_lock_retry", { command, attempt, delay: delay3 });
102545
+ if (attempt === 0) await onTransientLockFailure?.();
102463
102546
  await waitForLaunchDelay(delay3, signal);
102464
102547
  }
102465
102548
  }
102466
102549
  }
102467
- async function runInstallStep(step, signal, onOutput, projectRoot = step.cwd, extraEnv = {}) {
102550
+ async function runInstallStep(step, signal, onOutput, projectRoot = step.cwd, extraEnv = {}, onTransientLockFailure) {
102468
102551
  throwIfLaunchAborted(signal);
102469
102552
  await Promise.all(
102470
102553
  [
@@ -102494,7 +102577,8 @@ async function runInstallStep(step, signal, onOutput, projectRoot = step.cwd, ex
102494
102577
  step.cwd,
102495
102578
  (command, cwd, signal2) => runShellCommand(command, cwd, signal2, onOutput, projectRoot, extraEnv),
102496
102579
  INSTALL_LOCK_RETRY_DELAYS_MS,
102497
- signal
102580
+ signal,
102581
+ onTransientLockFailure
102498
102582
  );
102499
102583
  } catch (error) {
102500
102584
  throwIfLaunchAborted(signal);
@@ -116120,6 +116204,11 @@ var TempoProject = class _TempoProject {
116120
116204
  packageRoots: [appRoot]
116121
116205
  });
116122
116206
  }
116207
+ async installWorkspacePackages(options2) {
116208
+ const config = await this.getResolvedConfig();
116209
+ const devserver = await this.getDevServer(config);
116210
+ await devserver.installWorkspacePackages(options2);
116211
+ }
116123
116212
  async startDevServer(options2) {
116124
116213
  const config = await this.getResolvedConfig();
116125
116214
  const devserver = await this.getDevServer(config);
@@ -135679,7 +135768,7 @@ function buildBackends(runtime, toolsets, workspace) {
135679
135768
  }
135680
135769
 
135681
135770
  // src/version.ts
135682
- var CLI_VERSION = "0.0.136-staging.1";
135771
+ var CLI_VERSION = "0.0.137-staging.1";
135683
135772
 
135684
135773
  // src/canvas-hooks.ts
135685
135774
  var import_pngjs4 = __toESM(require_png(), 1);
@@ -136918,4 +137007,4 @@ unpdf/dist/index.mjs:
136918
137007
  * @license Apache-2.0
136919
137008
  *)
136920
137009
  */
136921
- //# sourceMappingURL=serve-VVKSMWYG.js.map
137010
+ //# sourceMappingURL=serve-4WVS2BRU.js.map