@adhdev/daemon-standalone 0.9.82-rc.327 → 0.9.82-rc.329

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/public/index.html CHANGED
@@ -7,7 +7,7 @@
7
7
  <meta name="description" content="ADHDev self-hosted dashboard for controlling AI agents" />
8
8
  <link rel="icon" href="/otter-logo.png" />
9
9
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet" />
10
- <script type="module" crossorigin src="/assets/index-COSRbW4F.js"></script>
10
+ <script type="module" crossorigin src="/assets/index-BOZQRbrj.js"></script>
11
11
  <link rel="modulepreload" crossorigin href="/assets/vendor-BHUMCOj6.js">
12
12
  <link rel="stylesheet" crossorigin href="/assets/index-B-j0dOYD.css">
13
13
  </head>
@@ -2656,6 +2656,32 @@ var MESH_SUGGEST_REFINE_CONFIG_TOOL = {
2656
2656
  }
2657
2657
  }
2658
2658
  };
2659
+ var MESH_CHANGE_IMPACT_CONFIG_SCHEMA_TOOL = {
2660
+ name: "mesh_change_impact_config_schema",
2661
+ description: "Return the Change Impact config JSON schema and supported repo-local config locations. Change Impact config declaratively classifies which package/file changes between the live daemon build and workspace HEAD require a daemon rebuild/restart vs. a web-only redeploy vs. nothing. Declarative only \u2014 config is parsed, never executed.",
2662
+ inputSchema: { type: "object", properties: {} }
2663
+ };
2664
+ var MESH_VALIDATE_CHANGE_IMPACT_CONFIG_TOOL = {
2665
+ name: "mesh_validate_change_impact_config",
2666
+ description: "Validate a Change Impact config for a node/workspace and report valid/errors. Loads .adhdev/change-impact.{json,yaml,yml} (or repo-mesh-change-impact.* alias) from the repo unless an inline config is provided.",
2667
+ inputSchema: {
2668
+ type: "object",
2669
+ properties: {
2670
+ node_id: { type: "string", description: "Optional node/workspace whose change-impact config should be loaded. Defaults to the first mesh node." },
2671
+ config: { type: "object", description: "Optional inline config object to validate instead of loading from the repo." }
2672
+ }
2673
+ }
2674
+ };
2675
+ var MESH_SUGGEST_CHANGE_IMPACT_CONFIG_TOOL = {
2676
+ name: "mesh_suggest_change_impact_config",
2677
+ description: "Suggest a Change Impact config scaffold from the repo package layout (web-* \u2192 web-only, others \u2192 daemon-runtime, plus docs/license markers as non-runtime). Heuristic scaffold only \u2014 the draft must be reviewed and saved before it takes effect; nothing is executed.",
2678
+ inputSchema: {
2679
+ type: "object",
2680
+ properties: {
2681
+ node_id: { type: "string", description: "Optional node/workspace used for suggestions. Defaults to the first mesh node." }
2682
+ }
2683
+ }
2684
+ };
2659
2685
  var MESH_INIT_TOOL = {
2660
2686
  name: "mesh_init",
2661
2687
  description: "One-click mesh onboarding for an existing git project. Detects installed CLI providers, suggests Refinery (.adhdev/refine.json) and worktree bootstrap (.adhdev/worktree_bootstrap.json) configs, optionally writes them to disk, and recommends a node providerPriority from the detected providers. Suggestions are scaffold only and never execute until saved; providerPriority is a recommendation to apply to node policy, not auto-applied. Defaults to dry-run (no files written) and never overwrites an existing config unless overwrite=true.",
@@ -2713,6 +2739,9 @@ var ALL_MESH_TOOLS = [
2713
2739
  MESH_REFINE_CONFIG_SCHEMA_TOOL,
2714
2740
  MESH_VALIDATE_REFINE_CONFIG_TOOL,
2715
2741
  MESH_SUGGEST_REFINE_CONFIG_TOOL,
2742
+ MESH_CHANGE_IMPACT_CONFIG_SCHEMA_TOOL,
2743
+ MESH_VALIDATE_CHANGE_IMPACT_CONFIG_TOOL,
2744
+ MESH_SUGGEST_CHANGE_IMPACT_CONFIG_TOOL,
2716
2745
  MESH_INIT_TOOL,
2717
2746
  MESH_REFINE_PLAN_TOOL,
2718
2747
  MESH_CLEANUP_SESSIONS_TOOL,
@@ -3203,39 +3232,17 @@ async function meshPruneStaleDirect(ctx, args = {}) {
3203
3232
  const liveNodes = await collectMeshViewQueueNodesWithLiveSessions(ctx);
3204
3233
  const ledgerEntries = (0, import_daemon_core.readLedgerEntries)(ctx.mesh.id, { tail: 500 });
3205
3234
  const directDispatches = (0, import_daemon_core.getActiveDirectDispatches)(ctx.mesh.id);
3206
- const activeWorkEvidence = (0, import_daemon_core.buildMeshActiveWork)({
3235
+ const result = (0, import_daemon_core.pruneStaleDirectDispatches)({
3207
3236
  meshId: ctx.mesh.id,
3208
3237
  queue: (0, import_daemon_core.getQueue)(ctx.mesh.id),
3209
3238
  ledgerEntries,
3210
3239
  directDispatches,
3211
3240
  nodes: liveNodes,
3212
- includeTerminalDirect: includeTerminal
3241
+ execute,
3242
+ includeTerminal,
3243
+ source: "mesh_prune_stale_direct"
3213
3244
  });
3214
- const candidates = [
3215
- ...activeWorkEvidence.staleDirectWork,
3216
- ...includeTerminal ? activeWorkEvidence.terminalDirectWork : []
3217
- ];
3218
- const storeTaskIds = new Set(directDispatches.map((d) => d.taskId));
3219
- const prunable = [];
3220
- const preservedUnacknowledged = [];
3221
- const preservedLedgerOnly = [];
3222
- const preservedNotOrphan = [];
3223
- for (const record of candidates) {
3224
- const classification = (0, import_daemon_core.classifyStaleDirectForPrune)(record, { includeTerminal });
3225
- if (classification === "preserve_unacknowledged") {
3226
- preservedUnacknowledged.push(record);
3227
- continue;
3228
- }
3229
- if (classification === "preserve_active") {
3230
- preservedNotOrphan.push(record);
3231
- continue;
3232
- }
3233
- if (!storeTaskIds.has(record.taskId)) {
3234
- preservedLedgerOnly.push(record);
3235
- continue;
3236
- }
3237
- prunable.push(record);
3238
- }
3245
+ const { prunable, prunedCount, preservedUnacknowledged, preservedLedgerOnly, preservedNotOrphan } = result;
3239
3246
  const summarize = (records) => records.map((r) => ({
3240
3247
  taskId: r.taskId,
3241
3248
  nodeId: r.nodeId,
@@ -3246,25 +3253,12 @@ async function meshPruneStaleDirect(ctx, args = {}) {
3246
3253
  taskTitle: r.taskTitle,
3247
3254
  createdAt: r.createdAt
3248
3255
  }));
3249
- let prunedCount = 0;
3250
- if (execute && prunable.length) {
3251
- prunedCount = (0, import_daemon_core.deleteDirectDispatchesByTaskId)(ctx.mesh.id, prunable.map((r) => r.taskId));
3252
- (0, import_daemon_core.appendLedgerEntry)(ctx.mesh.id, {
3253
- kind: "direct_dispatch_pruned",
3254
- payload: {
3255
- source: "mesh_prune_stale_direct",
3256
- prunedCount,
3257
- taskIds: prunable.map((r) => r.taskId),
3258
- reasons: Array.from(new Set(prunable.map((r) => r.staleReason || (r.terminal ? "terminal" : "unknown"))))
3259
- }
3260
- });
3261
- }
3262
3256
  return JSON.stringify({
3263
3257
  success: true,
3264
- mode: execute ? "execute" : "dry_run",
3258
+ mode: result.mode,
3265
3259
  meshId: ctx.mesh.id,
3266
3260
  includeTerminal,
3267
- candidateCount: candidates.length,
3261
+ candidateCount: result.candidateCount,
3268
3262
  prunableCount: prunable.length,
3269
3263
  prunedCount,
3270
3264
  prunable: summarize(prunable),
@@ -4388,6 +4382,26 @@ async function meshSuggestRefineConfig(ctx, args) {
4388
4382
  });
4389
4383
  return JSON.stringify(result, null, 2);
4390
4384
  }
4385
+ async function meshChangeImpactConfigSchema(ctx) {
4386
+ const node = resolveRefineConfigNode(ctx);
4387
+ const result = await commandForNode(ctx, node, "get_mesh_change_impact_config_schema", {});
4388
+ return JSON.stringify(result, null, 2);
4389
+ }
4390
+ async function meshValidateChangeImpactConfig(ctx, args) {
4391
+ const node = resolveRefineConfigNode(ctx, args.node_id);
4392
+ const result = await commandForNode(ctx, node, "validate_mesh_change_impact_config", {
4393
+ workspace: node.workspace,
4394
+ ...args.config ? { config: args.config } : {}
4395
+ });
4396
+ return JSON.stringify(result, null, 2);
4397
+ }
4398
+ async function meshSuggestChangeImpactConfig(ctx, args) {
4399
+ const node = resolveRefineConfigNode(ctx, args.node_id);
4400
+ const result = await commandForNode(ctx, node, "suggest_mesh_change_impact_config", {
4401
+ workspace: node.workspace
4402
+ });
4403
+ return JSON.stringify(result, null, 2);
4404
+ }
4391
4405
  async function meshInit(ctx, args) {
4392
4406
  const node = resolveRefineConfigNode(ctx, args.node_id);
4393
4407
  const result = await commandForNode(ctx, node, "mesh_init", {
@@ -5653,6 +5667,15 @@ async function startMcpServer(opts) {
5653
5667
  case "mesh_suggest_refine_config":
5654
5668
  text = await meshSuggestRefineConfig(meshCtx, a);
5655
5669
  break;
5670
+ case "mesh_change_impact_config_schema":
5671
+ text = await meshChangeImpactConfigSchema(meshCtx);
5672
+ break;
5673
+ case "mesh_validate_change_impact_config":
5674
+ text = await meshValidateChangeImpactConfig(meshCtx, a);
5675
+ break;
5676
+ case "mesh_suggest_change_impact_config":
5677
+ text = await meshSuggestChangeImpactConfig(meshCtx, a);
5678
+ break;
5656
5679
  case "mesh_init":
5657
5680
  text = await meshInit(meshCtx, a);
5658
5681
  break;