@adhdev/daemon-core 0.9.82-rc.436 → 0.9.82-rc.438

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/index.mjs CHANGED
@@ -404,10 +404,10 @@ function readInjected(value) {
404
404
  }
405
405
  function getDaemonBuildInfo() {
406
406
  if (cached) return cached;
407
- const commit = readInjected(true ? "db891cf6efe138b52b7a1c4aa5b4f874b5309ed3" : void 0) ?? "unknown";
408
- const commitShort = readInjected(true ? "db891cf6" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
409
- const version = readInjected(true ? "0.9.82-rc.436" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
410
- const builtAt = readInjected(true ? "2026-06-30T16:41:06.336Z" : void 0);
407
+ const commit = readInjected(true ? "84f8b9ff2e41b3bbf8375a9e4594c0ec33905b6e" : void 0) ?? "unknown";
408
+ const commitShort = readInjected(true ? "84f8b9ff" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
409
+ const version = readInjected(true ? "0.9.82-rc.438" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
410
+ const builtAt = readInjected(true ? "2026-07-01T02:03:18.523Z" : void 0);
411
411
  cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
412
412
  return cached;
413
413
  }
@@ -2857,16 +2857,21 @@ __export(mesh_config_exports, {
2857
2857
  createMesh: () => createMesh,
2858
2858
  createMeshHostPairingToken: () => createMeshHostPairingToken,
2859
2859
  deleteMesh: () => deleteMesh,
2860
+ getMagiKindPanel: () => getMagiKindPanel,
2860
2861
  getMagiPanel: () => getMagiPanel,
2861
2862
  getMesh: () => getMesh,
2862
2863
  getMeshByRepo: () => getMeshByRepo,
2864
+ listMagiKindPanels: () => listMagiKindPanels,
2863
2865
  listMagiPanels: () => listMagiPanels,
2864
2866
  listMeshes: () => listMeshes,
2865
2867
  markMeshHostPairingJoined: () => markMeshHostPairingJoined,
2866
2868
  normalizeMagiPanel: () => normalizeMagiPanel,
2869
+ normalizeMagiSlots: () => normalizeMagiSlots,
2867
2870
  normalizeRepoIdentity: () => normalizeRepoIdentity,
2871
+ removeMagiKindPanel: () => removeMagiKindPanel,
2868
2872
  removeMagiPanel: () => removeMagiPanel,
2869
2873
  removeNode: () => removeNode,
2874
+ setMagiKindPanel: () => setMagiKindPanel,
2870
2875
  tokenIdForManualPairing: () => tokenIdForManualPairing,
2871
2876
  updateMesh: () => updateMesh,
2872
2877
  updateNode: () => updateNode,
@@ -3285,11 +3290,13 @@ function normalizeMagiPanel(config) {
3285
3290
  throw new Error(`invalid_magi_panel: member[${idx}].provider is required`);
3286
3291
  }
3287
3292
  const nodeId = typeof m.nodeId === "string" && m.nodeId.trim() ? m.nodeId.trim() : void 0;
3293
+ const model = typeof m.model === "string" && m.model.trim() ? m.model.trim() : void 0;
3288
3294
  const capabilityTags = normalizeCapabilityTags(m.capabilityTags);
3289
3295
  const n = normalizeReplicaCount(m.n);
3290
3296
  return {
3291
3297
  provider,
3292
3298
  ...nodeId ? { nodeId } : {},
3299
+ ...model ? { model } : {},
3293
3300
  ...capabilityTags ? { capabilityTags } : {},
3294
3301
  ...n !== void 0 ? { n } : {}
3295
3302
  };
@@ -3342,7 +3349,78 @@ function removeMagiPanel(name) {
3342
3349
  saveMeshConfig(stored);
3343
3350
  return true;
3344
3351
  }
3345
- var mergeMeshPolicy, MAX_MAGI_PANEL_MEMBERS;
3352
+ function normalizeMagiTaskKindKey(raw) {
3353
+ const s2 = typeof raw === "string" ? raw.trim().toLowerCase() : "";
3354
+ if (!MAGI_KIND_PANEL_KINDS.includes(s2)) {
3355
+ throw new Error(`invalid_magi_kind_panel: task_kind must be one of ${MAGI_KIND_PANEL_KINDS.join(" / ")} (got '${s2 || "(empty)"}')`);
3356
+ }
3357
+ return s2;
3358
+ }
3359
+ function normalizeMagiSlots(slots) {
3360
+ if (!Array.isArray(slots) || slots.length === 0) {
3361
+ throw new Error("invalid_magi_kind_panel: slots must be a non-empty array");
3362
+ }
3363
+ if (slots.length > MAX_MAGI_KIND_SLOTS) {
3364
+ throw new Error(`invalid_magi_kind_panel: too many slots (max ${MAX_MAGI_KIND_SLOTS})`);
3365
+ }
3366
+ return slots.map((entry, idx) => {
3367
+ if (!entry || typeof entry !== "object" || Array.isArray(entry)) {
3368
+ throw new Error(`invalid_magi_kind_panel: slot[${idx}] must be an object`);
3369
+ }
3370
+ const s2 = entry;
3371
+ const provider = typeof s2.provider === "string" ? s2.provider.trim() : "";
3372
+ if (!provider) {
3373
+ throw new Error(`invalid_magi_kind_panel: slot[${idx}].provider is required`);
3374
+ }
3375
+ const nodeId = typeof s2.nodeId === "string" && s2.nodeId.trim() ? s2.nodeId.trim() : void 0;
3376
+ const model = typeof s2.model === "string" && s2.model.trim() ? s2.model.trim() : void 0;
3377
+ const capabilityTags = normalizeCapabilityTags(s2.capabilityTags);
3378
+ const n = normalizeReplicaCount(s2.n);
3379
+ return {
3380
+ provider,
3381
+ ...nodeId ? { nodeId } : {},
3382
+ ...model ? { model } : {},
3383
+ ...capabilityTags ? { capabilityTags } : {},
3384
+ ...n !== void 0 ? { n } : {}
3385
+ };
3386
+ });
3387
+ }
3388
+ function listMagiKindPanels() {
3389
+ return loadMeshConfig().magiKindPanels ?? {};
3390
+ }
3391
+ function getMagiKindPanel(kind) {
3392
+ let key2;
3393
+ try {
3394
+ key2 = normalizeMagiTaskKindKey(kind);
3395
+ } catch {
3396
+ return void 0;
3397
+ }
3398
+ return loadMeshConfig().magiKindPanels?.[key2];
3399
+ }
3400
+ function setMagiKindPanel(kind, slots) {
3401
+ const key2 = normalizeMagiTaskKindKey(kind);
3402
+ const normalized = normalizeMagiSlots(slots);
3403
+ const stored = loadMeshConfig();
3404
+ const map = stored.magiKindPanels ?? {};
3405
+ map[key2] = normalized;
3406
+ stored.magiKindPanels = map;
3407
+ saveMeshConfig(stored);
3408
+ return normalized;
3409
+ }
3410
+ function removeMagiKindPanel(kind) {
3411
+ let key2;
3412
+ try {
3413
+ key2 = normalizeMagiTaskKindKey(kind);
3414
+ } catch {
3415
+ return false;
3416
+ }
3417
+ const stored = loadMeshConfig();
3418
+ if (!stored.magiKindPanels || !stored.magiKindPanels[key2]) return false;
3419
+ delete stored.magiKindPanels[key2];
3420
+ saveMeshConfig(stored);
3421
+ return true;
3422
+ }
3423
+ var mergeMeshPolicy, MAX_MAGI_PANEL_MEMBERS, MAGI_KIND_PANEL_KINDS, MAX_MAGI_KIND_SLOTS;
3346
3424
  var init_mesh_config = __esm({
3347
3425
  "src/config/mesh-config.ts"() {
3348
3426
  "use strict";
@@ -3352,6 +3430,8 @@ var init_mesh_config = __esm({
3352
3430
  init_mesh_host_ownership();
3353
3431
  mergeMeshPolicy = mergeAndNormalizePolicy;
3354
3432
  MAX_MAGI_PANEL_MEMBERS = 24;
3433
+ MAGI_KIND_PANEL_KINDS = ["claim_audit", "rca", "design", "freeform"];
3434
+ MAX_MAGI_KIND_SLOTS = 24;
3355
3435
  }
3356
3436
  });
3357
3437
 
@@ -5272,6 +5352,7 @@ function enqueueTask(meshId, message, opts) {
5272
5352
  ...dependsOn.length > 0 ? { dependsOn } : {},
5273
5353
  ...typeof opts?.missionId === "string" && opts.missionId.trim() ? { missionId: opts.missionId.trim() } : {},
5274
5354
  ...typeof opts?.consensusGroupId === "string" && opts.consensusGroupId.trim() ? { consensusGroupId: opts.consensusGroupId.trim() } : {},
5355
+ ...typeof opts?.model === "string" && opts.model.trim() ? { model: opts.model.trim() } : {},
5275
5356
  ...typeof opts?.sourceCoordinatorSessionId === "string" && opts.sourceCoordinatorSessionId.trim() ? { sourceCoordinatorSessionId: opts.sourceCoordinatorSessionId.trim() } : {},
5276
5357
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
5277
5358
  updatedAt: (/* @__PURE__ */ new Date()).toISOString()
@@ -12973,7 +13054,10 @@ async function maybeAutoLaunchOneQueueSession(components, meshId, mesh) {
12973
13054
  launchResult2 = await components.dispatchMeshCommand(launchTarget.daemonId, "launch_cli", {
12974
13055
  cliType: resolved.providerType,
12975
13056
  dir: node.workspace,
12976
- settings: remoteSettings
13057
+ settings: remoteSettings,
13058
+ // MAGI-KIND-PANEL model axis: forward the task's model override so the
13059
+ // remote worker session launches with it (initialModel). Best-effort.
13060
+ ...typeof task.model === "string" && task.model.trim() ? { initialModel: task.model.trim() } : {}
12977
13061
  });
12978
13062
  } catch (e) {
12979
13063
  markAutoLaunch(meshId, task.id, { status: "failed", reason: `remote_launch_dispatch_failed: ${e?.message || String(e)}`, nodeId, providerType: resolved.providerType });
@@ -12999,7 +13083,10 @@ async function maybeAutoLaunchOneQueueSession(components, meshId, mesh) {
12999
13083
  const launchResult = await components.cliManager.handleCliCommand("launch_cli", {
13000
13084
  cliType: resolved.providerType,
13001
13085
  dir: node.workspace,
13002
- settings: launchSettings
13086
+ settings: launchSettings,
13087
+ // MAGI-KIND-PANEL model axis: local launch forwards the task's model
13088
+ // override as initialModel (CLI → modelLaunchArgs; ACP → setConfigOption).
13089
+ ...typeof task.model === "string" && task.model.trim() ? { initialModel: task.model.trim() } : {}
13003
13090
  });
13004
13091
  if (!launchResult?.success) {
13005
13092
  const reason = launchResult?.error || "launch_cli_failed";
@@ -18256,6 +18343,11 @@ var init_provider_schema = __esm({
18256
18343
  minimum: 0,
18257
18344
  description: "Delay between pasting prompt text and pressing Enter."
18258
18345
  },
18346
+ modelLaunchArgs: {
18347
+ type: "array",
18348
+ items: { type: "string" },
18349
+ description: "Template for expanding an initialModel selection into launch args. '{{model}}' is substituted with the model string (e.g. ['--model', '{{model}}'] \u2192 --model opus). Applied at launch when a model is requested for this CLI provider (MAGI kind-panel model axis). Absent \u2192 no launch-time model selection."
18350
+ },
18259
18351
  scriptCallBudgetMs: {
18260
18352
  type: "integer",
18261
18353
  minimum: 1,
@@ -43953,6 +44045,11 @@ function expandResumeArgs(template, sessionId) {
43953
44045
  if (!Array.isArray(template) || template.length === 0) return void 0;
43954
44046
  return template.map((part) => part === "{{id}}" ? sessionId : part);
43955
44047
  }
44048
+ function expandModelLaunchArgs(template, model) {
44049
+ const m = typeof model === "string" ? model.trim() : "";
44050
+ if (!m || !Array.isArray(template) || template.length === 0) return void 0;
44051
+ return template.map((part) => part === "{{model}}" ? m : part);
44052
+ }
43956
44053
  function readSubcommandSessionId(args, subcommands) {
43957
44054
  const resumeIndex = args.findIndex((arg) => subcommands.includes(arg));
43958
44055
  if (resumeIndex < 0) return void 0;
@@ -44345,7 +44442,12 @@ Run 'adhdev doctor' for detailed diagnostics.`
44345
44442
  if (provider) {
44346
44443
  console.log(colorize("cyan", ` \u{1F4E6} Using provider: ${provider.name} (${provider.type})`));
44347
44444
  }
44348
- const sessionBinding = resolveCliSessionBinding(provider, normalizedType, cliArgs, options?.resumeSessionId);
44445
+ const modelLaunchArgs = expandModelLaunchArgs(provider?.modelLaunchArgs, initialModel);
44446
+ const cliArgsWithModel = modelLaunchArgs ? [...modelLaunchArgs, ...cliArgs || []] : cliArgs;
44447
+ if (initialModel && !modelLaunchArgs) {
44448
+ LOG.warn("CLI", `[${normalizedType}] initialModel='${initialModel}' requested but provider declares no modelLaunchArgs template \u2014 launching without model selection.`);
44449
+ }
44450
+ const sessionBinding = resolveCliSessionBinding(provider, normalizedType, cliArgsWithModel, options?.resumeSessionId);
44349
44451
  const resolvedCliArgs = sessionBinding.cliArgs;
44350
44452
  const instanceManager = this.deps.getInstanceManager();
44351
44453
  if (provider && instanceManager) {
@@ -49232,6 +49334,42 @@ var meshCrudHandlers = {
49232
49334
  return { success: false, error: e.message };
49233
49335
  }
49234
49336
  },
49337
+ // ─── MAGI kind → panel bindings (MAGI-KIND-PANEL, machine-local config) ───
49338
+ // Per-task_kind slot lists in ~/.adhdev/meshes.json `magiKindPanels`. Same
49339
+ // owner-only gating and structured-error precedent as the magi_panel_* handlers
49340
+ // above (not listed in canPeerUsePrivilegedShareCommand → owner-only). set/remove
49341
+ // are WRITE commands; list is read-only. normalizeMagiSlots (inside setMagiKindPanel)
49342
+ // surfaces invalid_magi_kind_panel: … messages verbatim for the editor.
49343
+ magi_kind_panel_list: async (_ctx, _args) => {
49344
+ try {
49345
+ const { listMagiKindPanels: listMagiKindPanels2 } = await Promise.resolve().then(() => (init_mesh_config(), mesh_config_exports));
49346
+ return { success: true, kindPanels: listMagiKindPanels2() };
49347
+ } catch (e) {
49348
+ return { success: false, error: e.message };
49349
+ }
49350
+ },
49351
+ magi_kind_panel_set: async (_ctx, args) => {
49352
+ const kind = typeof args?.kind === "string" ? args.kind.trim() : "";
49353
+ if (!kind) return { success: false, error: "invalid_magi_kind_panel: task_kind is required" };
49354
+ try {
49355
+ const { setMagiKindPanel: setMagiKindPanel2 } = await Promise.resolve().then(() => (init_mesh_config(), mesh_config_exports));
49356
+ const slots = setMagiKindPanel2(kind, args?.slots);
49357
+ return { success: true, kind, slots };
49358
+ } catch (e) {
49359
+ return { success: false, error: e.message };
49360
+ }
49361
+ },
49362
+ magi_kind_panel_remove: async (_ctx, args) => {
49363
+ const kind = typeof args?.kind === "string" ? args.kind.trim() : "";
49364
+ if (!kind) return { success: false, error: "invalid_magi_kind_panel: task_kind is required" };
49365
+ try {
49366
+ const { removeMagiKindPanel: removeMagiKindPanel2 } = await Promise.resolve().then(() => (init_mesh_config(), mesh_config_exports));
49367
+ const removed = removeMagiKindPanel2(kind);
49368
+ return { success: true, removed };
49369
+ } catch (e) {
49370
+ return { success: false, error: e.message };
49371
+ }
49372
+ },
49235
49373
  add_mesh_node: async (ctx, args) => {
49236
49374
  const meshId = typeof args?.meshId === "string" ? args.meshId.trim() : "";
49237
49375
  const workspace = typeof args?.workspace === "string" ? args.workspace.trim() : "";
@@ -65274,6 +65412,7 @@ export {
65274
65412
  getLedgerDir,
65275
65413
  getLedgerSummary,
65276
65414
  getLogLevel,
65415
+ getMagiKindPanel,
65277
65416
  getMagiPanel,
65278
65417
  getMesh,
65279
65418
  getMeshByRepo,
@@ -65330,6 +65469,7 @@ export {
65330
65469
  launchWithCdp,
65331
65470
  listCoordinatorsForWorkspace,
65332
65471
  listHostedCliRuntimes,
65472
+ listMagiKindPanels,
65333
65473
  listMagiPanels,
65334
65474
  listMeshMissionSummaries,
65335
65475
  listMeshes,
@@ -65365,6 +65505,7 @@ export {
65365
65505
  normalizeInteractivePrompt,
65366
65506
  normalizeInteractivePromptResponse,
65367
65507
  normalizeMagiPanel,
65508
+ normalizeMagiSlots,
65368
65509
  normalizeManagedStatus,
65369
65510
  normalizeMeshCapabilityTags,
65370
65511
  normalizeMeshDaemonRole,
@@ -65402,6 +65543,7 @@ export {
65402
65543
  recordMeshToolCall,
65403
65544
  registerExtensionProviders,
65404
65545
  registerMeshCoordinator,
65546
+ removeMagiKindPanel,
65405
65547
  removeMagiPanel,
65406
65548
  removeNode,
65407
65549
  removeWorktree,
@@ -65436,6 +65578,7 @@ export {
65436
65578
  saveState,
65437
65579
  setDebugRuntimeConfig,
65438
65580
  setLogLevel,
65581
+ setMagiKindPanel,
65439
65582
  setupIdeInstance,
65440
65583
  shouldAutoRestoreHostedSessionsOnStartup,
65441
65584
  shouldCollectTraceCategory,