@adhdev/daemon-standalone 1.0.18-rc.1 → 1.0.18-rc.11
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.js +6600 -4586
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/public/assets/{index-D8z4TEna.js → index-DB3QU2sn.js} +53 -53
- package/public/assets/index-DTkEOmrO.css +1 -0
- package/public/index.html +2 -2
- package/vendor/mcp-server/index.js +96 -3
- package/vendor/mcp-server/index.js.map +1 -1
- package/vendor/session-host-daemon/index.d.mts +7 -0
- package/vendor/session-host-daemon/index.d.ts +7 -0
- package/vendor/session-host-daemon/index.js +117 -18
- package/vendor/session-host-daemon/index.js.map +1 -1
- package/vendor/session-host-daemon/index.mjs +118 -18
- package/vendor/session-host-daemon/index.mjs.map +1 -1
- package/public/assets/index-DU4BBoUD.css +0 -1
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-
|
|
10
|
+
<script type="module" crossorigin src="/assets/index-DB3QU2sn.js"></script>
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/vendor-DyCWA2YZ.js">
|
|
12
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
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.",
|
|
@@ -1171,7 +1204,23 @@ var MESH_RECORD_NOTE_TOOL = {
|
|
|
1171
1204
|
category: {
|
|
1172
1205
|
type: "string",
|
|
1173
1206
|
enum: ["provider_quirk", "pattern_to_avoid", "recovery_lesson"],
|
|
1174
|
-
description: "Optional classification: provider_quirk (a provider/runtime behaves unexpectedly), pattern_to_avoid (an approach that caused problems), recovery_lesson (how a failure was recovered)."
|
|
1207
|
+
description: "Optional classification: provider_quirk (a provider/runtime behaves unexpectedly), pattern_to_avoid (an approach that caused problems), recovery_lesson (how a failure was recovered). Category also governs default read-side retention: recovery_lesson ages out of the injected prompt after ~14 days, pattern_to_avoid after ~30, provider_quirk and uncategorized are durable (never age out). The ledger entry is always kept for audit regardless."
|
|
1208
|
+
},
|
|
1209
|
+
pinned: {
|
|
1210
|
+
type: "boolean",
|
|
1211
|
+
description: "Pin this note so it ALWAYS rides into every coordinator prompt: never dropped by TTL expiry and kept ahead of unpinned notes when the injection cap is hit. Use for durable, high-value operating knowledge you never want to lose from the prompt."
|
|
1212
|
+
},
|
|
1213
|
+
ttl_days: {
|
|
1214
|
+
type: "number",
|
|
1215
|
+
description: "Optional explicit read-side lifespan in days. Resolved to an absolute expiry at record time; after it passes an UNPINNED note is hidden from the injected prompt (but retained in the ledger for audit). Overrides the category default TTL. Ignored when pinned is true."
|
|
1216
|
+
},
|
|
1217
|
+
supersedes: {
|
|
1218
|
+
type: "string",
|
|
1219
|
+
description: "Optional version-supersede: the note_id of an earlier note this one replaces, OR a subject_key shared with earlier notes. At injection any earlier LIVE note matching this id/subject is hidden from the prompt (its ledger entry is retained for audit). Use when you record an updated lesson that makes a prior one obsolete. Pinned notes are never hidden by supersede."
|
|
1220
|
+
},
|
|
1221
|
+
subject_key: {
|
|
1222
|
+
type: "string",
|
|
1223
|
+
description: "Optional stable subject key grouping notes about the same subject. Drives version-supersede targeting and read-side same-class folding (multiple live notes with the same category AND subject_key collapse to one injected entry, newest kept, older ids listed). When omitted, folding falls back to a leading [tag] bracket in the text."
|
|
1175
1224
|
}
|
|
1176
1225
|
},
|
|
1177
1226
|
required: ["text"]
|
|
@@ -1492,6 +1541,7 @@ var ALL_MESH_TOOLS = [
|
|
|
1492
1541
|
MESH_RESTART_DAEMON_TOOL,
|
|
1493
1542
|
MESH_CHECKPOINT_TOOL,
|
|
1494
1543
|
MESH_APPROVE_TOOL,
|
|
1544
|
+
MESH_ANSWER_QUESTION_TOOL,
|
|
1495
1545
|
MESH_LIST_PENDING_APPROVALS_TOOL,
|
|
1496
1546
|
MESH_CLONE_NODE_TOOL,
|
|
1497
1547
|
MESH_REMOVE_NODE_TOOL,
|
|
@@ -4353,6 +4403,15 @@ async function meshRecordNote(ctx, args) {
|
|
|
4353
4403
|
}
|
|
4354
4404
|
const category = args.category === "provider_quirk" || args.category === "pattern_to_avoid" || args.category === "recovery_lesson" ? args.category : void 0;
|
|
4355
4405
|
const createdAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
4406
|
+
const pinned = args.pinned === true ? true : void 0;
|
|
4407
|
+
let expiresAt;
|
|
4408
|
+
if (typeof args.expiresAt === "string" && !Number.isNaN(new Date(args.expiresAt).getTime())) {
|
|
4409
|
+
expiresAt = new Date(args.expiresAt).toISOString();
|
|
4410
|
+
} else if (typeof args.ttl_days === "number" && Number.isFinite(args.ttl_days) && args.ttl_days > 0) {
|
|
4411
|
+
expiresAt = new Date(new Date(createdAt).getTime() + args.ttl_days * 24 * 60 * 60 * 1e3).toISOString();
|
|
4412
|
+
}
|
|
4413
|
+
const supersedes = typeof args.supersedes === "string" && args.supersedes.trim() ? args.supersedes.trim() : void 0;
|
|
4414
|
+
const subjectKey = typeof args.subject_key === "string" && args.subject_key.trim() ? args.subject_key.trim() : void 0;
|
|
4356
4415
|
const sourceCoordinator = ctx.coordinatorSessionId || ctx.localDaemonId || ctx.coordinatorHostname || void 0;
|
|
4357
4416
|
const entry = (0, import_daemon_core4.appendLedgerEntry)(mesh.id, {
|
|
4358
4417
|
kind: "coordinator_operating_note",
|
|
@@ -4361,14 +4420,26 @@ async function meshRecordNote(ctx, args) {
|
|
|
4361
4420
|
text,
|
|
4362
4421
|
...category ? { category } : {},
|
|
4363
4422
|
createdAt,
|
|
4364
|
-
...sourceCoordinator ? { sourceCoordinator } : {}
|
|
4423
|
+
...sourceCoordinator ? { sourceCoordinator } : {},
|
|
4424
|
+
...pinned ? { pinned } : {},
|
|
4425
|
+
...expiresAt ? { expiresAt } : {},
|
|
4426
|
+
...supersedes ? { supersedes } : {},
|
|
4427
|
+
...subjectKey ? { subjectKey } : {}
|
|
4365
4428
|
}
|
|
4366
4429
|
});
|
|
4367
4430
|
return JSON.stringify({
|
|
4368
4431
|
success: true,
|
|
4369
4432
|
meshId: mesh.id,
|
|
4370
4433
|
noteId: entry.id,
|
|
4371
|
-
recorded: {
|
|
4434
|
+
recorded: {
|
|
4435
|
+
text,
|
|
4436
|
+
category: category ?? null,
|
|
4437
|
+
createdAt,
|
|
4438
|
+
pinned: pinned ?? false,
|
|
4439
|
+
expiresAt: expiresAt ?? null,
|
|
4440
|
+
supersedes: supersedes ?? null,
|
|
4441
|
+
subjectKey: subjectKey ?? null
|
|
4442
|
+
},
|
|
4372
4443
|
note: 'Recorded to the mesh ledger. Future coordinators on this mesh will see it under "## Operating Notes" at launch.'
|
|
4373
4444
|
}, null, 2);
|
|
4374
4445
|
}
|
|
@@ -7038,6 +7109,25 @@ async function meshApprove(ctx, args) {
|
|
|
7038
7109
|
});
|
|
7039
7110
|
return JSON.stringify(result, null, 2);
|
|
7040
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
|
+
}
|
|
7041
7131
|
async function meshListPendingApprovals(ctx, _args = {}) {
|
|
7042
7132
|
(0, import_daemon_core4.recordMeshToolCall)({ meshId: ctx.mesh.id, tool: "mesh_list_pending_approvals" });
|
|
7043
7133
|
await refreshMeshFromDaemon(ctx);
|
|
@@ -8654,6 +8744,9 @@ async function startMcpServer(opts) {
|
|
|
8654
8744
|
case "mesh_approve":
|
|
8655
8745
|
text = await meshApprove(meshCtx, a);
|
|
8656
8746
|
break;
|
|
8747
|
+
case "mesh_answer_question":
|
|
8748
|
+
text = await meshAnswerQuestion(meshCtx, a);
|
|
8749
|
+
break;
|
|
8657
8750
|
case "mesh_list_pending_approvals":
|
|
8658
8751
|
text = await meshListPendingApprovals(meshCtx, a);
|
|
8659
8752
|
break;
|