@edda-business/mcp 0.73.0 → 0.74.0
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 +1 -1
- package/src/server.js +26 -2
package/package.json
CHANGED
package/src/server.js
CHANGED
|
@@ -128,6 +128,28 @@ async function uploadLocalFile(filePath, { sourceId } = {}) {
|
|
|
128
128
|
return { originalId: r?.original?.id ?? null, name, sha256, bytes: r?.original?.byte_size ?? bytes.length };
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
+
// A submit-only seat has no `inbox` tool, so the submit response is the ONLY place it can learn
|
|
132
|
+
// what happened to anything it sent. Render it there or the loop never closes.
|
|
133
|
+
function loopLines(r) {
|
|
134
|
+
const out = [];
|
|
135
|
+
const d = r?.recent_decisions;
|
|
136
|
+
if (d && d.total) {
|
|
137
|
+
const bits = [];
|
|
138
|
+
if (d.filed) bits.push(`${d.filed} filed`);
|
|
139
|
+
if (d.rejected) bits.push(`${d.rejected} rejected`);
|
|
140
|
+
out.push("", `Since ${String(d.since).slice(0, 10)}, of what you sent: ${bits.join(", ") || `${d.total} decided`}.`);
|
|
141
|
+
for (const e of d.examples ?? []) {
|
|
142
|
+
out.push(e.status === "rejected"
|
|
143
|
+
? ` ✗ ${e.name} — rejected${e.reason ? ` — ${e.reason}` : " (no reason given)"}`
|
|
144
|
+
: ` ✓ ${e.name} → ${e.location}`);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (typeof r?.pending_mine === "number" && r.pending_mine > 0) {
|
|
148
|
+
out.push(`${r.pending_mine} of your submissions ${r.pending_mine === 1 ? "is" : "are"} still waiting for review.`);
|
|
149
|
+
}
|
|
150
|
+
return out;
|
|
151
|
+
}
|
|
152
|
+
|
|
131
153
|
export function createServer() {
|
|
132
154
|
// EfB seat boundary: with EDDA_MCP_READONLY set (the flag Hermes EfB box profiles use),
|
|
133
155
|
// the personal agent gets EXACTLY search + read — the write tools (push/update/create) are
|
|
@@ -388,10 +410,11 @@ export function createServer() {
|
|
|
388
410
|
const n = Array.isArray(claims) ? claims.length : 0;
|
|
389
411
|
// Say what is waiting, including the belief change — the person needs to know a claim is
|
|
390
412
|
// pending a human decision, not quietly applied.
|
|
391
|
-
return text(
|
|
413
|
+
return text([
|
|
392
414
|
`Staged "${name}" into the company Inbox (${rc?.location ?? "Inbox"}). The company will route it to the right folder on the next reconcile.`
|
|
393
415
|
+ (n ? `\n${n} proposed knowledge update${n === 1 ? "" : "s"} rides with it — shown in the review gate as a belief change and applied only on approval.` : ""),
|
|
394
|
-
|
|
416
|
+
...loopLines(r),
|
|
417
|
+
].join("\n"));
|
|
395
418
|
} catch (e) {
|
|
396
419
|
const msg = String(e?.message || e);
|
|
397
420
|
if (msg.includes("read_only") || msg.includes("admins_only") || msg.includes("(403)")) return text("This seat is read-only on the company Edda, so it can search and read but not contribute. Ask an admin for a write role.");
|
|
@@ -469,6 +492,7 @@ export function createServer() {
|
|
|
469
492
|
else if (rec.suggestion_dropped) lines.push(` • ${rec.name} — staged; your suggested destination was dropped (not visible to you)`);
|
|
470
493
|
}
|
|
471
494
|
lines.push("", "They wait for a person to review and file them. Nothing has been placed in a project yet.");
|
|
495
|
+
lines.push(...loopLines(r));
|
|
472
496
|
return text(lines.join("\n"));
|
|
473
497
|
} catch (e) {
|
|
474
498
|
const msg = String(e?.message || e);
|