adhdev 0.8.50 → 0.8.52

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 (41) hide show
  1. package/dist/cli/index.js +30 -5
  2. package/dist/cli/index.js.map +1 -1
  3. package/dist/index.js +30 -5
  4. package/dist/index.js.map +1 -1
  5. package/package.json +3 -2
  6. package/vendor/terminal-mux-cli/index.d.mts +1 -0
  7. package/vendor/terminal-mux-cli/index.d.ts +1 -0
  8. package/vendor/terminal-mux-cli/index.js +2056 -0
  9. package/vendor/terminal-mux-cli/index.mjs +2048 -0
  10. package/vendor/terminal-mux-cli/node_modules/@adhdev/session-host-core/index.d.mts +427 -0
  11. package/vendor/terminal-mux-cli/node_modules/@adhdev/session-host-core/index.d.ts +427 -0
  12. package/vendor/terminal-mux-cli/node_modules/@adhdev/session-host-core/index.js +617 -0
  13. package/vendor/terminal-mux-cli/node_modules/@adhdev/session-host-core/index.js.map +1 -0
  14. package/vendor/terminal-mux-cli/node_modules/@adhdev/session-host-core/index.mjs +573 -0
  15. package/vendor/terminal-mux-cli/node_modules/@adhdev/session-host-core/index.mjs.map +1 -0
  16. package/vendor/terminal-mux-cli/node_modules/@adhdev/session-host-core/package.json +7 -0
  17. package/vendor/terminal-mux-cli/node_modules/@adhdev/terminal-mux-control/api.d.mts +16 -0
  18. package/vendor/terminal-mux-cli/node_modules/@adhdev/terminal-mux-control/api.d.ts +16 -0
  19. package/vendor/terminal-mux-cli/node_modules/@adhdev/terminal-mux-control/api.js +206 -0
  20. package/vendor/terminal-mux-cli/node_modules/@adhdev/terminal-mux-control/api.mjs +17 -0
  21. package/vendor/terminal-mux-cli/node_modules/@adhdev/terminal-mux-control/chunk-7RNMRPVZ.mjs +183 -0
  22. package/vendor/terminal-mux-cli/node_modules/@adhdev/terminal-mux-control/chunk-R4EFW6W3.mjs +46 -0
  23. package/vendor/terminal-mux-cli/node_modules/@adhdev/terminal-mux-control/chunk-XZWWVN5W.mjs +164 -0
  24. package/vendor/terminal-mux-cli/node_modules/@adhdev/terminal-mux-control/control-socket.d.mts +35 -0
  25. package/vendor/terminal-mux-cli/node_modules/@adhdev/terminal-mux-control/control-socket.d.ts +35 -0
  26. package/vendor/terminal-mux-cli/node_modules/@adhdev/terminal-mux-control/control-socket.js +219 -0
  27. package/vendor/terminal-mux-cli/node_modules/@adhdev/terminal-mux-control/control-socket.mjs +13 -0
  28. package/vendor/terminal-mux-cli/node_modules/@adhdev/terminal-mux-control/index.d.mts +5 -0
  29. package/vendor/terminal-mux-cli/node_modules/@adhdev/terminal-mux-control/index.d.ts +5 -0
  30. package/vendor/terminal-mux-cli/node_modules/@adhdev/terminal-mux-control/index.js +427 -0
  31. package/vendor/terminal-mux-cli/node_modules/@adhdev/terminal-mux-control/index.mjs +34 -0
  32. package/vendor/terminal-mux-cli/node_modules/@adhdev/terminal-mux-control/package.json +33 -0
  33. package/vendor/terminal-mux-cli/node_modules/@adhdev/terminal-mux-control/storage.d.mts +49 -0
  34. package/vendor/terminal-mux-cli/node_modules/@adhdev/terminal-mux-control/storage.d.ts +49 -0
  35. package/vendor/terminal-mux-cli/node_modules/@adhdev/terminal-mux-control/storage.js +222 -0
  36. package/vendor/terminal-mux-cli/node_modules/@adhdev/terminal-mux-control/storage.mjs +16 -0
  37. package/vendor/terminal-mux-cli/node_modules/@adhdev/terminal-mux-core/index.d.mts +162 -0
  38. package/vendor/terminal-mux-cli/node_modules/@adhdev/terminal-mux-core/index.d.ts +162 -0
  39. package/vendor/terminal-mux-cli/node_modules/@adhdev/terminal-mux-core/index.js +985 -0
  40. package/vendor/terminal-mux-cli/node_modules/@adhdev/terminal-mux-core/index.mjs +948 -0
  41. package/vendor/terminal-mux-cli/node_modules/@adhdev/terminal-mux-core/package.json +7 -0
package/dist/index.js CHANGED
@@ -28182,6 +28182,19 @@ var init_acp_provider_instance = __esm({
28182
28182
  }
28183
28183
  });
28184
28184
 
28185
+ // ../../oss/packages/daemon-core/src/commands/hosted-runtime-restore.ts
28186
+ function shouldRestoreHostedRuntime(record2, managerTag) {
28187
+ if (!managerTag) return true;
28188
+ const managedBy = typeof record2.managedBy === "string" ? record2.managedBy.trim() : "";
28189
+ if (!managedBy) return true;
28190
+ return managedBy === managerTag;
28191
+ }
28192
+ var init_hosted_runtime_restore = __esm({
28193
+ "../../oss/packages/daemon-core/src/commands/hosted-runtime-restore.ts"() {
28194
+ "use strict";
28195
+ }
28196
+ });
28197
+
28185
28198
  // ../../oss/packages/daemon-core/src/commands/cli-manager.ts
28186
28199
  function colorize(color, text) {
28187
28200
  const fn = chalkApi?.[color];
@@ -28312,6 +28325,7 @@ var init_cli_manager = __esm({
28312
28325
  init_cli_provider_instance();
28313
28326
  init_acp_provider_instance();
28314
28327
  init_logger();
28328
+ init_hosted_runtime_restore();
28315
28329
  chalkModule = import_chalk.default;
28316
28330
  chalkApi = typeof chalkModule.yellow === "function" ? chalkModule : chalkModule.default || null;
28317
28331
  DaemonCliManager = class {
@@ -28696,8 +28710,16 @@ Run 'adhdev doctor' for detailed diagnostics.`
28696
28710
  const sessions = records || await this.deps.listHostedCliRuntimes?.() || [];
28697
28711
  let restored = 0;
28698
28712
  const restoredBindings = /* @__PURE__ */ new Set();
28713
+ const managerTag = this.deps.hostedRuntimeManagerTag;
28699
28714
  for (const record2 of sessions) {
28700
28715
  if (!record2?.runtimeId || !record2?.cliType || !record2?.workspace) continue;
28716
+ if (!shouldRestoreHostedRuntime(record2, managerTag)) {
28717
+ LOG.info(
28718
+ "CLI",
28719
+ `\u21B7 Skipping hosted runtime restore owned by ${record2.managedBy}: ${record2.runtimeKey || record2.runtimeId}`
28720
+ );
28721
+ continue;
28722
+ }
28701
28723
  if (this.adapters.has(record2.runtimeId) || instanceManager.getInstance(record2.runtimeId)) continue;
28702
28724
  const normalizedType = this.providerLoader.resolveAlias(record2.cliType);
28703
28725
  const providerMeta = this.providerLoader.getMeta(normalizedType);
@@ -40554,7 +40576,8 @@ async function listHostedCliRuntimes(endpoint) {
40554
40576
  cliType: record2.providerType,
40555
40577
  workspace: record2.workspace,
40556
40578
  cliArgs: Array.isArray(record2.meta?.cliArgs) ? record2.meta.cliArgs : [],
40557
- providerSessionId: typeof record2.meta?.providerSessionId === "string" ? String(record2.meta.providerSessionId) : void 0
40579
+ providerSessionId: typeof record2.meta?.providerSessionId === "string" ? String(record2.meta.providerSessionId) : void 0,
40580
+ managedBy: typeof record2.meta?.managedBy === "string" ? String(record2.meta.managedBy) : void 0
40558
40581
  }));
40559
40582
  } finally {
40560
40583
  await client.close().catch(() => {
@@ -49871,7 +49894,7 @@ var init_adhdev_daemon = __esm({
49871
49894
  import_ws3 = require("ws");
49872
49895
  import_chalk2 = __toESM(require("chalk"));
49873
49896
  init_version();
49874
- pkgVersion = resolvePackageVersion({ injectedVersion: "0.8.50" });
49897
+ pkgVersion = resolvePackageVersion({ injectedVersion: "0.8.52" });
49875
49898
  ACTIVE_CHAT_POLL_STATUSES = /* @__PURE__ */ new Set([
49876
49899
  "generating",
49877
49900
  "waiting_approval",
@@ -50340,6 +50363,7 @@ ${err?.stack || ""}`);
50340
50363
  }),
50341
50364
  onStatusChange: () => this.statusReporter?.onStatusChange(),
50342
50365
  removeAgentTracking: (key) => this.statusReporter?.removeAgentTracking(key),
50366
+ hostedRuntimeManagerTag: "adhdev-cloud",
50343
50367
  createPtyTransportFactory: ({ runtimeId, providerType, workspace, cliArgs, providerSessionId, attachExisting }) => new SessionHostPtyTransportFactory({
50344
50368
  endpoint: sessionHostEndpoint,
50345
50369
  ensureReady: async () => {
@@ -50350,12 +50374,13 @@ ${err?.stack || ""}`);
50350
50374
  runtimeId,
50351
50375
  providerType,
50352
50376
  workspace,
50377
+ attachExisting,
50353
50378
  appName: process.env.ADHDEV_SESSION_HOST_NAME || "adhdev",
50354
50379
  meta: {
50355
50380
  cliArgs,
50356
- providerSessionId
50357
- },
50358
- attachExisting
50381
+ providerSessionId,
50382
+ managedBy: "adhdev-cloud"
50383
+ }
50359
50384
  }),
50360
50385
  listHostedCliRuntimes: async () => listHostedCliRuntimes2(sessionHostEndpoint)
50361
50386
  },