@adhdev/daemon-standalone 1.0.18-rc.9 → 1.0.19

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,9 +7,9 @@
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-Be0j0_PU.js"></script>
11
- <link rel="modulepreload" crossorigin href="/assets/vendor-DyCWA2YZ.js">
12
- <link rel="stylesheet" crossorigin href="/assets/index-CQVaCclg.css">
10
+ <script type="module" crossorigin src="/assets/index-L35P_4ox.js"></script>
11
+ <link rel="modulepreload" crossorigin href="/assets/vendor-cL4V2vaO.js">
12
+ <link rel="stylesheet" crossorigin href="/assets/index-CXZe3Zxn.css">
13
13
  </head>
14
14
  <body>
15
15
  <!-- Apply theme immediately to prevent FOIT (Flash of Incorrect Theme) -->
@@ -391,6 +391,7 @@ var CANONICAL_MESH_TOOL_NAMES = [
391
391
  "mesh_restart_daemon",
392
392
  "mesh_checkpoint",
393
393
  "mesh_approve",
394
+ "mesh_answer_question",
394
395
  "mesh_list_pending_approvals",
395
396
  "mesh_clone_node",
396
397
  "mesh_remove_node",
@@ -1075,6 +1076,38 @@ var MESH_APPROVE_TOOL = {
1075
1076
  required: ["node_id", "session_id", "action"]
1076
1077
  }
1077
1078
  };
1079
+ var MESH_ANSWER_QUESTION_TOOL = {
1080
+ name: "mesh_answer_question",
1081
+ description: 'Answer a multi-choice QUESTION (AskUserQuestion) a delegated agent session is waiting on. This is the counterpart to mesh_approve: a QUESTION (surfaced as an agent:waiting_choice event / status "awaiting_choice") is NOT a yes/no approval \u2014 it offers labelled options (optionally multi-select, optionally a freeform "Type something") and must be answered here, never with mesh_approve. Supply the promptId from the waiting_choice event and one answer per question. Each answer selects option(s) by their exact label OR 1-based index; for a multi-select question pass an array of selections; a freeform answer passes text instead. The daemon drives the correct keystrokes into the provider TUI to submit the selection.',
1082
+ inputSchema: {
1083
+ type: "object",
1084
+ properties: {
1085
+ node_id: { type: "string", description: "Target node ID (from the waiting_choice event / mesh_list_nodes)." },
1086
+ session_id: { type: "string", description: "Agent session ID that is awaiting the question answer." },
1087
+ promptId: { type: "string", description: "The InteractivePrompt promptId from the agent:waiting_choice event. Ensures the answer matches the active prompt." },
1088
+ answers: {
1089
+ type: "array",
1090
+ description: "One entry per question in the prompt (in question order). Each entry answers a single question by selecting option label(s)/index(es), or by supplying freeform text.",
1091
+ items: {
1092
+ type: "object",
1093
+ properties: {
1094
+ questionId: { type: "string", description: "Optional question id from the prompt payload. When omitted, entries are matched to the prompt questions by array position." },
1095
+ select: {
1096
+ description: "The chosen option(s): an option label (string), a 1-based option index (number), or an array of labels/indices for a multi-select question.",
1097
+ oneOf: [
1098
+ { type: "string" },
1099
+ { type: "number" },
1100
+ { type: "array", items: { type: ["string", "number"] } }
1101
+ ]
1102
+ },
1103
+ freeform: { type: "string", description: 'Freeform text answer (for a "Type something" option). Mutually exclusive with select.' }
1104
+ }
1105
+ }
1106
+ }
1107
+ },
1108
+ required: ["node_id", "session_id", "promptId", "answers"]
1109
+ }
1110
+ };
1078
1111
  var MESH_LIST_PENDING_APPROVALS_TOOL = {
1079
1112
  name: "mesh_list_pending_approvals",
1080
1113
  description: "List every session across the mesh that is currently awaiting an approval decision (status awaiting_approval) \u2014 the mesh-wide approval inbox. mesh_approve resolves ONE (node_id, session_id) at a time; this read-only tool enumerates the full pending set so you can see all blocked sessions at once and drive a mesh_approve for each. Each row carries nodeId, sessionId, providerType, taskTitle, and how long it has been waiting (waitingSince/waitingMs), longest-waiting first. Does not mutate anything.",
@@ -1508,6 +1541,7 @@ var ALL_MESH_TOOLS = [
1508
1541
  MESH_RESTART_DAEMON_TOOL,
1509
1542
  MESH_CHECKPOINT_TOOL,
1510
1543
  MESH_APPROVE_TOOL,
1544
+ MESH_ANSWER_QUESTION_TOOL,
1511
1545
  MESH_LIST_PENDING_APPROVALS_TOOL,
1512
1546
  MESH_CLONE_NODE_TOOL,
1513
1547
  MESH_REMOVE_NODE_TOOL,
@@ -6959,6 +6993,19 @@ async function meshLaunchSession(ctx, args) {
6959
6993
  const coordinatorDaemonId = resolveCoordinatorDaemonId(ctx);
6960
6994
  const spawnedSessionVisibility = readSpawnedSessionVisibility(ctx.mesh.policy);
6961
6995
  const delegatedWorkerAutoApprove = (0, import_daemon_core4.resolveDelegatedWorkerAutoApprove)(ctx.mesh.policy, node.policy);
6996
+ let requestedAutoApproveMode;
6997
+ const delegatedWorkerDangerousModeAllow = (0, import_daemon_core4.resolveDelegatedWorkerDangerousModeAllow)(ctx.mesh.policy, node.policy);
6998
+ if (delegatedWorkerAutoApprove !== false) {
6999
+ try {
7000
+ const ws = typeof node.workspace === "string" && node.workspace.trim() ? node.workspace.trim() : "";
7001
+ if (ws) {
7002
+ const repo = (0, import_daemon_core4.loadRepoMeshJsonConfig)(ws);
7003
+ const repoMode = repo.sourceType === "repo_file" ? repo.config?.providerDefaults?.autoApproveModes?.[resolvedProviderType] : void 0;
7004
+ if (typeof repoMode === "string" && repoMode.trim()) requestedAutoApproveMode = repoMode.trim();
7005
+ }
7006
+ } catch {
7007
+ }
7008
+ }
6962
7009
  const isLocalNode = isLocalControlPlaneNode(ctx, node);
6963
7010
  if (node.daemonId && !isLocalNode && !coordinatorDaemonId) {
6964
7011
  return JSON.stringify(buildMissingCoordinatorDaemonIdFailure(ctx, node, resolvedProviderType), null, 2);
@@ -7014,7 +7061,14 @@ async function meshLaunchSession(ctx, args) {
7014
7061
  spawnedSessionVisibility,
7015
7062
  // Delegated worker auto-approval (see resolveDelegatedWorkerAutoApprove).
7016
7063
  // Lands in settingsOverride and beats the global per-provider autoApprove.
7064
+ // When a repo-requested mode ID is present AND auto-approve is enabled,
7065
+ // stamp the mode ID (validated daemon-side) alongside the boolean; the
7066
+ // adapter's resolveProviderAutoApproveMode prefers the mode and fails
7067
+ // closed on an unknown ID. delegatedWorkerDangerousModeAllow rides along
7068
+ // so the adapter can honor/deny a dangerous requested mode.
7017
7069
  autoApprove: delegatedWorkerAutoApprove,
7070
+ ...requestedAutoApproveMode ? { autoApproveMode: requestedAutoApproveMode } : {},
7071
+ delegatedWorkerDangerousModeAllow,
7018
7072
  ...coordinatorDaemonId ? { meshCoordinatorDaemonId: coordinatorDaemonId } : {},
7019
7073
  // (3) Stamp the originating coordinator SESSION at launch too, so a worker
7020
7074
  // launched via mesh_launch_session routes its completions back to the exact
@@ -7075,6 +7129,25 @@ async function meshApprove(ctx, args) {
7075
7129
  });
7076
7130
  return JSON.stringify(result, null, 2);
7077
7131
  }
7132
+ async function meshAnswerQuestion(ctx, args) {
7133
+ const node = await findNodeWithRefresh(ctx, args.node_id);
7134
+ if (!args.promptId || typeof args.promptId !== "string") {
7135
+ return JSON.stringify({ success: false, error: "promptId is required (from the agent:waiting_choice event)." }, null, 2);
7136
+ }
7137
+ if (!Array.isArray(args.answers)) {
7138
+ return JSON.stringify({ success: false, error: "answers must be an array (one entry per question)." }, null, 2);
7139
+ }
7140
+ const result = await commandForNode(ctx, node, "interactive_prompt_response", {
7141
+ targetSessionId: args.session_id,
7142
+ sessionId: args.session_id,
7143
+ workspace: node.workspace,
7144
+ response: {
7145
+ promptId: args.promptId,
7146
+ answers: args.answers
7147
+ }
7148
+ });
7149
+ return JSON.stringify(result, null, 2);
7150
+ }
7078
7151
  async function meshListPendingApprovals(ctx, _args = {}) {
7079
7152
  (0, import_daemon_core4.recordMeshToolCall)({ meshId: ctx.mesh.id, tool: "mesh_list_pending_approvals" });
7080
7153
  await refreshMeshFromDaemon(ctx);
@@ -8612,7 +8685,7 @@ async function startMcpServer(opts) {
8612
8685
  const meshCtx = { mesh, transport, ...localDaemonId ? { localDaemonId } : {}, ...localMachineId ? { localMachineId } : {}, ...coordinatorHostname ? { coordinatorHostname } : {}, ...coordinatorSessionId ? { coordinatorSessionId } : {} };
8613
8686
  const coordinatorPrompt = await buildMeshModeCoordinatorPrompt(mesh);
8614
8687
  const server2 = new import_server.Server(
8615
- { name: "adhdev-mcp-server", version: "1.0.17" },
8688
+ { name: "adhdev-mcp-server", version: "1.0.19" },
8616
8689
  { capabilities: { tools: {}, resources: {} } }
8617
8690
  );
8618
8691
  const { ListResourcesRequestSchema, ReadResourceRequestSchema } = await import("@modelcontextprotocol/sdk/types.js");
@@ -8691,6 +8764,9 @@ async function startMcpServer(opts) {
8691
8764
  case "mesh_approve":
8692
8765
  text = await meshApprove(meshCtx, a);
8693
8766
  break;
8767
+ case "mesh_answer_question":
8768
+ text = await meshAnswerQuestion(meshCtx, a);
8769
+ break;
8694
8770
  case "mesh_list_pending_approvals":
8695
8771
  text = await meshListPendingApprovals(meshCtx, a);
8696
8772
  break;