@tempo-ai/mcp 0.0.101 → 0.0.102-staging.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.
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-6HT4KAGI.js";
5
+ } from "./chunk-2ZXV6PYD.js";
6
6
  import "./chunk-J43EDR63.js";
7
7
 
8
8
  // src/bin.ts
@@ -8,7 +8,7 @@ import {
8
8
  import { Client } from "@modelcontextprotocol/sdk/client/index.js";
9
9
  import { InMemoryTransport } from "@modelcontextprotocol/sdk/inMemory.js";
10
10
  async function connectAggregate(options) {
11
- const { createTempoAggregate } = await import("./serve-JG5U3XF4.js");
11
+ const { createTempoAggregate } = await import("./serve-PQ3MLJHP.js");
12
12
  const handle = await createTempoAggregate(options);
13
13
  const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();
14
14
  const client = new Client({ name: "tempo-mcp-cli", version: "0" });
@@ -127,4 +127,4 @@ export {
127
127
  runCall,
128
128
  runTools
129
129
  };
130
- //# sourceMappingURL=call-6CDIHKDB.js.map
130
+ //# sourceMappingURL=call-JRAJWRA2.js.map
@@ -157,7 +157,7 @@ async function run(argv) {
157
157
  process.stderr.write(USAGE);
158
158
  return 1;
159
159
  }
160
- const { runServe } = await import("./serve-JG5U3XF4.js");
160
+ const { runServe } = await import("./serve-PQ3MLJHP.js");
161
161
  return await runServe(options);
162
162
  }
163
163
  switch (subcommand) {
@@ -172,11 +172,11 @@ async function run(argv) {
172
172
  return await runToken(rest);
173
173
  }
174
174
  case "tools": {
175
- const { runTools } = await import("./call-6CDIHKDB.js");
175
+ const { runTools } = await import("./call-JRAJWRA2.js");
176
176
  return await runTools(rest);
177
177
  }
178
178
  case "call": {
179
- const { runCall } = await import("./call-6CDIHKDB.js");
179
+ const { runCall } = await import("./call-JRAJWRA2.js");
180
180
  return await runCall(rest);
181
181
  }
182
182
  default:
@@ -195,4 +195,4 @@ async function run(argv) {
195
195
  export {
196
196
  run
197
197
  };
198
- //# sourceMappingURL=chunk-6HT4KAGI.js.map
198
+ //# sourceMappingURL=chunk-2ZXV6PYD.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-6HT4KAGI.js";
4
+ } from "./chunk-2ZXV6PYD.js";
5
5
  import "./chunk-J43EDR63.js";
6
6
  export {
7
7
  run
@@ -24428,12 +24428,16 @@ var AppDevServer = class _AppDevServer {
24428
24428
  * least one persisted pid + birth identity must exist, every such process
24429
24429
  * must be gone after the proof-gated reap, and an occupied recorded port
24430
24430
  * must be attributable to an identifiable foreign process. Missing/corrupt
24431
- * state therefore stays unresolved until reboot proves no process survived.
24431
+ * Missing state and live/foreign ownership are distinct from a confirmed
24432
+ * orphan whose identity-proven cleanup failed.
24432
24433
  */
24433
24434
  async reconcilePersistedProcess() {
24434
24435
  const persisted = await this.readPersistedState();
24435
- if (!persisted) return false;
24436
- if (!await this.mayReapPersistedProcess(persisted)) return false;
24436
+ if (!persisted) return "nothing_to_reconcile";
24437
+ const ownership = await this.classifyPersistedProcessOwnership(persisted);
24438
+ if (ownership !== "reapable") {
24439
+ return ownership;
24440
+ }
24437
24441
  const identities = [
24438
24442
  [persisted.pid, persisted.pidStartedAt, "shell"],
24439
24443
  [persisted.serverPid, persisted.serverPidStartedAt, "server"]
@@ -24441,7 +24445,7 @@ var AppDevServer = class _AppDevServer {
24441
24445
  const hadProcessIdentity = identities.some(
24442
24446
  ([pid, startedAt]) => pid != null && startedAt != null
24443
24447
  );
24444
- if (!hadProcessIdentity) return false;
24448
+ if (!hadProcessIdentity) return "nothing_to_reconcile";
24445
24449
  if (persisted.pid != null && await pidStartIdentityMatches(persisted.pid, persisted.pidStartedAt)) {
24446
24450
  const outcome = await reapOwnedProcessGroup(persisted.pid);
24447
24451
  devLog("app-devserver:registry-orphan-group-reap", {
@@ -24465,24 +24469,24 @@ var AppDevServer = class _AppDevServer {
24465
24469
  }
24466
24470
  for (const [pid, startedAt] of identities) {
24467
24471
  if (pid != null && await pidStartIdentityMatches(pid, startedAt)) {
24468
- return false;
24472
+ return "orphan_cleanup_failed";
24469
24473
  }
24470
24474
  }
24471
24475
  if (!await isPortFree(persisted.port)) {
24472
24476
  const listenerPid = await findPortListenerPid(persisted.port);
24473
24477
  if (listenerPid == null || persisted.serverPidStartedAt == null) {
24474
- return false;
24478
+ return "foreign_process";
24475
24479
  }
24476
24480
  if (listenerPid === persisted.serverPid && await pidStartIdentityMatches(
24477
24481
  listenerPid,
24478
24482
  persisted.serverPidStartedAt
24479
24483
  )) {
24480
- return false;
24484
+ return "orphan_cleanup_failed";
24481
24485
  }
24482
24486
  }
24483
24487
  await this.persistChildPid(null);
24484
24488
  await this.persistServerPid(null);
24485
- return true;
24489
+ return "orphan_reaped";
24486
24490
  }
24487
24491
  onStatusChange(listener) {
24488
24492
  this.listeners.push(listener);
@@ -25200,18 +25204,21 @@ Hint: ${hint.hint}` : ""}`;
25200
25204
  };
25201
25205
  }
25202
25206
  async mayReapPersistedProcess(persisted) {
25207
+ return await this.classifyPersistedProcessOwnership(persisted) === "reapable";
25208
+ }
25209
+ async classifyPersistedProcessOwnership(persisted) {
25203
25210
  const ownership = this.options.ownership;
25204
- if (!ownership) return true;
25211
+ if (!ownership) return "reapable";
25205
25212
  if (persisted.ownerId !== ownership.ownerId || persisted.managerPid == null || persisted.managerStartedAt == null) {
25206
- return false;
25213
+ return "foreign_process";
25207
25214
  }
25208
25215
  if (persisted.managerPid === ownership.managerPid && persisted.managerStartedAt === ownership.managerStartedAt) {
25209
- return true;
25216
+ return "reapable";
25210
25217
  }
25211
- return !await pidStartIdentityMatches(
25218
+ return await pidStartIdentityMatches(
25212
25219
  persisted.managerPid,
25213
25220
  persisted.managerStartedAt
25214
- );
25221
+ ) ? "live_sibling" : "reapable";
25215
25222
  }
25216
25223
  async readPersistedState() {
25217
25224
  try {
@@ -29789,7 +29796,7 @@ var TempoDevServer = class _TempoDevServer {
29789
29796
  try {
29790
29797
  await mkdir6(this.tempoRoot, { recursive: true });
29791
29798
  const { staleDevserverUrl, staleDevserverOwner } = await this.hydrateStatusFromDisk();
29792
- const persistedDevserverReconciled = await this.reconcilePersistedDevserverUrl(
29799
+ const persistedDevserverReconciliation = await this.reconcilePersistedDevserverUrl(
29793
29800
  staleDevserverUrl,
29794
29801
  staleDevserverOwner
29795
29802
  );
@@ -29815,7 +29822,7 @@ var TempoDevServer = class _TempoDevServer {
29815
29822
  changedFiles: reconcileResult.changedFiles,
29816
29823
  generation: reconcileResult.generation,
29817
29824
  initialized: true,
29818
- persistedDevserverReconciled
29825
+ persistedDevserverReconciliation
29819
29826
  };
29820
29827
  } catch (error) {
29821
29828
  this.state.setupStatus = "error";
@@ -30305,8 +30312,8 @@ var TempoDevServer = class _TempoDevServer {
30305
30312
  // branch `state.devserverUrl` in THIS instance is left untouched: a
30306
30313
  // persisted URL is never resurrected into live state.
30307
30314
  async reconcilePersistedDevserverUrl(staleUrl, staleOwner) {
30308
- if (!staleUrl) return false;
30309
- if (staleUrl === this.state.devserverUrl) return false;
30315
+ if (!staleUrl) return "nothing_to_reconcile";
30316
+ if (staleUrl === this.state.devserverUrl) return "current_runtime";
30310
30317
  const markedOurs = staleOwner !== null && supervisorAppInstanceId !== null && staleOwner.appInstanceId === supervisorAppInstanceId;
30311
30318
  if (markedOurs) {
30312
30319
  if (isPidAlive(staleOwner.managerPid)) {
@@ -30314,7 +30321,7 @@ var TempoDevServer = class _TempoDevServer {
30314
30321
  url: staleUrl,
30315
30322
  markerPid: staleOwner.managerPid
30316
30323
  });
30317
- return false;
30324
+ return "live_sibling";
30318
30325
  }
30319
30326
  return await this.purgeOwnedOrphanDevserver(staleUrl, staleOwner);
30320
30327
  }
@@ -30326,7 +30333,7 @@ var TempoDevServer = class _TempoDevServer {
30326
30333
  );
30327
30334
  if (outcome === "ok") {
30328
30335
  devLog("supervisor:stale_url_live_sibling", { url: staleUrl });
30329
- return false;
30336
+ return "live_sibling";
30330
30337
  }
30331
30338
  if (outcome === "unreachable") {
30332
30339
  devLog("supervisor:stale_url_cleared", {
@@ -30334,11 +30341,11 @@ var TempoDevServer = class _TempoDevServer {
30334
30341
  reason: "unreachable"
30335
30342
  });
30336
30343
  await this.persistStatus();
30337
- return true;
30344
+ return "orphan_absent";
30338
30345
  } else {
30339
30346
  devLog("supervisor:stale_url_foreign_left_alone", { url: staleUrl });
30340
30347
  await this.persistStatus();
30341
- return false;
30348
+ return "foreign_process";
30342
30349
  }
30343
30350
  }
30344
30351
  // Clean up a server OUR app instance started whose managing supervisor is
@@ -30397,7 +30404,7 @@ var TempoDevServer = class _TempoDevServer {
30397
30404
  if (reconciled) {
30398
30405
  await this.persistStatus();
30399
30406
  }
30400
- return reconciled;
30407
+ return reconciled ? "orphan_reaped" : "orphan_cleanup_failed";
30401
30408
  }
30402
30409
  async persistStatus() {
30403
30410
  const nextStatus = {
@@ -45029,7 +45036,7 @@ function isExternallyExposed(toolName, opts) {
45029
45036
  }
45030
45037
 
45031
45038
  // src/version.ts
45032
- var CLI_VERSION = "0.0.101";
45039
+ var CLI_VERSION = "0.0.102-staging.2";
45033
45040
 
45034
45041
  // src/canvas-hooks.ts
45035
45042
  var import_pngjs3 = __toESM(require_png(), 1);
@@ -46876,4 +46883,4 @@ export {
46876
46883
  runServe,
46877
46884
  scopeParamsFor
46878
46885
  };
46879
- //# sourceMappingURL=serve-JG5U3XF4.js.map
46886
+ //# sourceMappingURL=serve-PQ3MLJHP.js.map