@adhdev/daemon-core 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.
@@ -31,6 +31,7 @@ export interface DaemonInitConfig {
31
31
  removeAgentTracking: (key: string) => void;
32
32
  createPtyTransportFactory?: (params: CliTransportFactoryParams) => PtyTransportFactory | null;
33
33
  listHostedCliRuntimes?: () => Promise<HostedCliRuntimeDescriptor[]>;
34
+ hostedRuntimeManagerTag?: string;
34
35
  };
35
36
  /** CDP config */
36
37
  enabledIdes?: string[];
@@ -25,6 +25,7 @@ export interface CliManagerDeps {
25
25
  getSessionRegistry?(): SessionRegistry | null;
26
26
  createPtyTransportFactory?: (params: CliTransportFactoryParams) => PtyTransportFactory | null;
27
27
  listHostedCliRuntimes?: () => Promise<HostedCliRuntimeDescriptor[]>;
28
+ hostedRuntimeManagerTag?: string;
28
29
  }
29
30
  type CommandResult = {
30
31
  success: boolean;
@@ -49,6 +50,7 @@ export interface HostedCliRuntimeDescriptor {
49
50
  workspace: string;
50
51
  cliArgs?: string[];
51
52
  providerSessionId?: string;
53
+ managedBy?: string;
52
54
  }
53
55
  export declare function supportsExplicitSessionResume(resume?: ProviderResumeCapability): boolean;
54
56
  export declare class DaemonCliManager {
@@ -0,0 +1,3 @@
1
+ export declare function shouldRestoreHostedRuntime(record: {
2
+ managedBy?: string | null | undefined;
3
+ }, managerTag?: string): boolean;
package/dist/index.js CHANGED
@@ -11578,6 +11578,16 @@ var AcpProviderInstance = class {
11578
11578
 
11579
11579
  // src/commands/cli-manager.ts
11580
11580
  init_logger();
11581
+
11582
+ // src/commands/hosted-runtime-restore.ts
11583
+ function shouldRestoreHostedRuntime(record, managerTag) {
11584
+ if (!managerTag) return true;
11585
+ const managedBy = typeof record.managedBy === "string" ? record.managedBy.trim() : "";
11586
+ if (!managedBy) return true;
11587
+ return managedBy === managerTag;
11588
+ }
11589
+
11590
+ // src/commands/cli-manager.ts
11581
11591
  var chalkModule = import_chalk.default;
11582
11592
  var chalkApi = typeof chalkModule.yellow === "function" ? chalkModule : chalkModule.default || null;
11583
11593
  function colorize(color, text) {
@@ -12073,8 +12083,16 @@ Run 'adhdev doctor' for detailed diagnostics.`
12073
12083
  const sessions = records || await this.deps.listHostedCliRuntimes?.() || [];
12074
12084
  let restored = 0;
12075
12085
  const restoredBindings = /* @__PURE__ */ new Set();
12086
+ const managerTag = this.deps.hostedRuntimeManagerTag;
12076
12087
  for (const record of sessions) {
12077
12088
  if (!record?.runtimeId || !record?.cliType || !record?.workspace) continue;
12089
+ if (!shouldRestoreHostedRuntime(record, managerTag)) {
12090
+ LOG.info(
12091
+ "CLI",
12092
+ `\u21B7 Skipping hosted runtime restore owned by ${record.managedBy}: ${record.runtimeKey || record.runtimeId}`
12093
+ );
12094
+ continue;
12095
+ }
12078
12096
  if (this.adapters.has(record.runtimeId) || instanceManager.getInstance(record.runtimeId)) continue;
12079
12097
  const normalizedType = this.providerLoader.resolveAlias(record.cliType);
12080
12098
  const providerMeta = this.providerLoader.getMeta(normalizedType);
@@ -22019,7 +22037,8 @@ async function listHostedCliRuntimes(endpoint) {
22019
22037
  cliType: record.providerType,
22020
22038
  workspace: record.workspace,
22021
22039
  cliArgs: Array.isArray(record.meta?.cliArgs) ? record.meta.cliArgs : [],
22022
- providerSessionId: typeof record.meta?.providerSessionId === "string" ? String(record.meta.providerSessionId) : void 0
22040
+ providerSessionId: typeof record.meta?.providerSessionId === "string" ? String(record.meta.providerSessionId) : void 0,
22041
+ managedBy: typeof record.meta?.managedBy === "string" ? String(record.meta.managedBy) : void 0
22023
22042
  }));
22024
22043
  } finally {
22025
22044
  await client.close().catch(() => {