@adhdev/daemon-standalone 1.0.18-rc.10 → 1.0.18-rc.12

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>
10
+ <script type="module" crossorigin src="/assets/index-DhFzhHc7.js"></script>
11
11
  <link rel="modulepreload" crossorigin href="/assets/vendor-DyCWA2YZ.js">
12
- <link rel="stylesheet" crossorigin href="/assets/index-CQVaCclg.css">
12
+ <link rel="stylesheet" crossorigin href="/assets/index-DTkEOmrO.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,
@@ -7075,6 +7109,25 @@ async function meshApprove(ctx, args) {
7075
7109
  });
7076
7110
  return JSON.stringify(result, null, 2);
7077
7111
  }
7112
+ async function meshAnswerQuestion(ctx, args) {
7113
+ const node = await findNodeWithRefresh(ctx, args.node_id);
7114
+ if (!args.promptId || typeof args.promptId !== "string") {
7115
+ return JSON.stringify({ success: false, error: "promptId is required (from the agent:waiting_choice event)." }, null, 2);
7116
+ }
7117
+ if (!Array.isArray(args.answers)) {
7118
+ return JSON.stringify({ success: false, error: "answers must be an array (one entry per question)." }, null, 2);
7119
+ }
7120
+ const result = await commandForNode(ctx, node, "interactive_prompt_response", {
7121
+ targetSessionId: args.session_id,
7122
+ sessionId: args.session_id,
7123
+ workspace: node.workspace,
7124
+ response: {
7125
+ promptId: args.promptId,
7126
+ answers: args.answers
7127
+ }
7128
+ });
7129
+ return JSON.stringify(result, null, 2);
7130
+ }
7078
7131
  async function meshListPendingApprovals(ctx, _args = {}) {
7079
7132
  (0, import_daemon_core4.recordMeshToolCall)({ meshId: ctx.mesh.id, tool: "mesh_list_pending_approvals" });
7080
7133
  await refreshMeshFromDaemon(ctx);
@@ -8691,6 +8744,9 @@ async function startMcpServer(opts) {
8691
8744
  case "mesh_approve":
8692
8745
  text = await meshApprove(meshCtx, a);
8693
8746
  break;
8747
+ case "mesh_answer_question":
8748
+ text = await meshAnswerQuestion(meshCtx, a);
8749
+ break;
8694
8750
  case "mesh_list_pending_approvals":
8695
8751
  text = await meshListPendingApprovals(meshCtx, a);
8696
8752
  break;