@adhdev/daemon-standalone 0.9.82-rc.53 → 0.9.82-rc.55

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/daemon-standalone",
3
- "version": "0.9.82-rc.53",
3
+ "version": "0.9.82-rc.55",
4
4
  "description": "ADHDev standalone daemon — embedded HTTP/WS server for local dashboard",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -1428,6 +1428,21 @@ var MESH_GIT_STATUS_TOOL = {
1428
1428
  required: ["node_id"]
1429
1429
  }
1430
1430
  };
1431
+ var MESH_FAST_FORWARD_NODE_TOOL = {
1432
+ name: "mesh_fast_forward_node",
1433
+ description: "Safely dry-run or execute an obvious direct fast-forward for a mesh node without launching an agent session. Defaults to dry-run; execution requires execute=true. Never pushes, rebases, resets, cleans, or checks out arbitrary revisions.",
1434
+ inputSchema: {
1435
+ type: "object",
1436
+ properties: {
1437
+ node_id: { type: "string", description: "Target node ID." },
1438
+ branch: { type: "string", description: "Optional guard: require the node's current branch to match this branch before planning/executing." },
1439
+ execute: { type: "boolean", description: "When true, apply the fast-forward if all safety gates pass. Defaults false/dry-run." },
1440
+ dry_run: { type: "boolean", description: "Preview only. Defaults true unless execute=true; dry_run=true overrides execute." },
1441
+ update_submodules: { type: "boolean", description: "When true, if the root fast-forward changes gitlinks, run only git submodule update --init --recursive and verify submodules clean." }
1442
+ },
1443
+ required: ["node_id"]
1444
+ }
1445
+ };
1431
1446
  var MESH_CHECKPOINT_TOOL = {
1432
1447
  name: "mesh_checkpoint",
1433
1448
  description: "Create a git checkpoint (commit) on a mesh node workspace.",
@@ -1511,7 +1526,7 @@ var MESH_TASK_HISTORY_TOOL = {
1511
1526
  type: "object",
1512
1527
  properties: {
1513
1528
  tail: { type: "number", description: "Number of recent entries to return (default: 20)." },
1514
- kind: { type: "string", description: "Filter by entry kind: task_dispatched, task_completed, task_failed, task_stalled, session_launched, checkpoint_created, node_cloned, node_removed." }
1529
+ kind: { type: "string", description: "Filter by entry kind: task_dispatched, task_completed, task_failed, task_stalled, session_launched, checkpoint_created, node_cloned, node_removed, direct_fast_forward." }
1515
1530
  }
1516
1531
  }
1517
1532
  };
@@ -1589,6 +1604,7 @@ var ALL_MESH_TOOLS = [
1589
1604
  MESH_READ_DEBUG_TOOL,
1590
1605
  MESH_LAUNCH_SESSION_TOOL,
1591
1606
  MESH_GIT_STATUS_TOOL,
1607
+ MESH_FAST_FORWARD_NODE_TOOL,
1592
1608
  MESH_CHECKPOINT_TOOL,
1593
1609
  MESH_APPROVE_TOOL,
1594
1610
  MESH_CLONE_NODE_TOOL,
@@ -2396,6 +2412,51 @@ async function meshGitStatus(ctx, args) {
2396
2412
  }, null, 2);
2397
2413
  }
2398
2414
  }
2415
+ async function meshFastForwardNode(ctx, args) {
2416
+ await refreshMeshFromDaemon(ctx);
2417
+ const node = await findNodeWithRefresh(ctx, args.node_id);
2418
+ const submoduleIgnorePaths = node.policy?.submoduleIgnorePaths || [];
2419
+ if (node.policy?.readOnly) {
2420
+ return JSON.stringify({
2421
+ success: false,
2422
+ code: "node_read_only",
2423
+ nodeId: args.node_id,
2424
+ workspace: node.workspace,
2425
+ allowed: false,
2426
+ willRun: false,
2427
+ executed: false,
2428
+ blockingReasons: ["node_read_only"]
2429
+ }, null, 2);
2430
+ }
2431
+ try {
2432
+ const dryRun = args.dry_run === true || args.execute !== true;
2433
+ const result = await commandForNode(ctx, node, "fast_forward_mesh_node", {
2434
+ meshId: ctx.mesh.id,
2435
+ nodeId: node.id,
2436
+ workspace: node.workspace,
2437
+ branch: typeof args.branch === "string" ? args.branch : void 0,
2438
+ execute: args.execute === true && args.dry_run !== true,
2439
+ dryRun,
2440
+ updateSubmodules: args.update_submodules === true,
2441
+ submoduleIgnorePaths: submoduleIgnorePaths.length > 0 ? submoduleIgnorePaths : void 0
2442
+ });
2443
+ return JSON.stringify(unwrapCommandPayload(result), null, 2);
2444
+ } catch (e) {
2445
+ const failure = buildCoordinatorP2pRelayFailure(e, {
2446
+ command: "fast_forward_mesh_node",
2447
+ targetDaemonId: node.daemonId,
2448
+ nodeId: args.node_id
2449
+ });
2450
+ return JSON.stringify({
2451
+ ...failure,
2452
+ workspace: node.workspace,
2453
+ allowed: false,
2454
+ willRun: false,
2455
+ executed: false,
2456
+ blockingReasons: [failure.code || "mesh_fast_forward_unavailable"]
2457
+ }, null, 2);
2458
+ }
2459
+ }
2399
2460
  async function meshCheckpoint(ctx, args) {
2400
2461
  const node = await findNodeWithRefresh(ctx, args.node_id);
2401
2462
  if (node.policy?.readOnly) {
@@ -4389,6 +4450,9 @@ async function startMcpServer(opts) {
4389
4450
  case "mesh_git_status":
4390
4451
  text = await meshGitStatus(meshCtx, a);
4391
4452
  break;
4453
+ case "mesh_fast_forward_node":
4454
+ text = await meshFastForwardNode(meshCtx, a);
4455
+ break;
4392
4456
  case "mesh_checkpoint":
4393
4457
  text = await meshCheckpoint(meshCtx, a);
4394
4458
  break;