negotium 0.3.1 → 0.3.3
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/agent-helpers.js +53 -4
- package/dist/agent-helpers.js.map +5 -5
- package/dist/hosted-agent.js +2 -2
- package/dist/hosted-agent.js.map +2 -2
- package/dist/main.js +53 -4
- package/dist/main.js.map +5 -5
- package/dist/mcp-factories.js +53 -4
- package/dist/mcp-factories.js.map +5 -5
- package/dist/prompts.js +2 -2
- package/dist/prompts.js.map +3 -3
- package/dist/registry.js +2 -2
- package/dist/registry.js.map +2 -2
- package/dist/runtime/src/prompts/builders.ts +1 -1
- package/dist/runtime/src/runtime/visual-html.ts +50 -1
- package/dist/runtime/src/version.ts +1 -1
- package/dist/runtime-helpers.js +51 -2
- package/dist/runtime-helpers.js.map +3 -3
- package/dist/types/packages/core/src/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/mcp-factories.js
CHANGED
|
@@ -1017,7 +1017,7 @@ var init_claude_registry = __esm(() => {
|
|
|
1017
1017
|
});
|
|
1018
1018
|
|
|
1019
1019
|
// ../../packages/core/src/version.ts
|
|
1020
|
-
var NEGOTIUM_VERSION = "0.3.
|
|
1020
|
+
var NEGOTIUM_VERSION = "0.3.3";
|
|
1021
1021
|
|
|
1022
1022
|
// ../../packages/core/src/agents/codex-native-multi-agent.ts
|
|
1023
1023
|
import { spawn as spawn2 } from "child_process";
|
|
@@ -10221,7 +10221,7 @@ function buildRuntimeToolSection(opts, extensions) {
|
|
|
10221
10221
|
const askUserToolLine = agentKind === "codex" ? `When you need a blocking user choice, call the \`ask_user_question\` function in the \`${runtimeNamespace}\` namespace with { question: "...", choices: [{ label: "...", description?: "..." }] }.` : `When you need a blocking user choice, call the MCP tool "${runtimeNamespace}__ask_user_question" with { question: "...", choices: [{ label: "...", description?: "..." }] }.`;
|
|
10222
10222
|
const scheduleSelfToolLine = agentKind === "codex" ? `For a one-shot delayed continuation within 24 hours, call the \`schedule_self\` function in the \`${runtimeNamespace}\` namespace with { delay_seconds: number, message: "self-contained future instruction" }. Only one pending self-schedule is allowed per topic; use \`get_self_schedule\`, \`update_self_schedule\`, or \`cancel_self_schedule\` in that namespace to manage it. Use cron-manager for recurring schedules.` : `For a one-shot delayed continuation within 24 hours, call the MCP tool "${runtimeNamespace}__schedule_self" with { delay_seconds: number, message: "self-contained future instruction" }. Only one pending self-schedule is allowed per topic; manage it with "${runtimeNamespace}__get_self_schedule", "${runtimeNamespace}__update_self_schedule", or "${runtimeNamespace}__cancel_self_schedule". Use cron-manager for recurring schedules.`;
|
|
10223
10223
|
const taskToolLine = agentKind === "codex" ? `For task tracking, use \`task_create\`, \`task_update\`, \`task_list\`, \`task_get\`, and \`task_delete\` functions in the \`${taskNamespace}\` namespace.` : `For task tracking, use MCP tools "${taskNamespace}__task_create", "${taskNamespace}__task_update", "${taskNamespace}__task_list", "${taskNamespace}__task_get", and "${taskNamespace}__task_delete".`;
|
|
10224
|
-
const decisionToolLine = `
|
|
10224
|
+
const decisionToolLine = `Record a decision with the shared Decision tools in the \`${decisionNamespace}\` namespace whenever you pick between real alternatives and the choice will constrain later work: which layer or repository owns a fix, what a version number claims, which dependency version to pin, what an interface promises, which of two diagnoses you are acting on. Write it at the moment you choose, not as a summary at the end of the turn, and link the decision it follows from or supersedes. Do not record routine task progress or temporary implementation details.`;
|
|
10225
10225
|
const runtimeToolRef = (name) => agentKind === "codex" ? `\`${name}\`` : `"${runtimeNamespace}__${name}"`;
|
|
10226
10226
|
const spawnSubagentToolLine = `Use ${runtimeToolRef("spawn_subagent")} for self-contained parallel or long-running background work; keep quick work inline.`;
|
|
10227
10227
|
const lifecycleToolLine = `For staged work, call ${runtimeToolRef("create_subagent")} then ${runtimeToolRef("start_subagent")}. Create fixes \`task\` and \`report_mode\`; start takes only the room ID, so create after inputs are known unless preparing a \`tell_session\` receiver. Manage descendants with ${runtimeToolRef("list_subagents")} and ${runtimeToolRef("delete_subagent")}, and non-parent tell routes with ${runtimeToolRef("grant_subagent_tell")} and ${runtimeToolRef("revoke_subagent_tell")}. Direct-parent reporting needs no grant. Use ${runtimeToolRef("list_memory_topics")} to select \`memory_topic\`.`;
|
|
@@ -14837,11 +14837,58 @@ function buildMermaidHtml(code, theme, scriptUrl = MERMAID_BROWSER_ASSET_RELATIV
|
|
|
14837
14837
|
<script data-otium-mermaid-runtime src="${safeScriptUrl}"></script>
|
|
14838
14838
|
<script>
|
|
14839
14839
|
(async () => {
|
|
14840
|
+
// An unrendered document reports itself in more than one voice: Mermaid's
|
|
14841
|
+
// own 0x0 guard, and the browser refusing geometry on a path that was
|
|
14842
|
+
// never laid out. Both mean the same thing, so both are worth one retry
|
|
14843
|
+
// and, if it still fails, the same explanation.
|
|
14844
|
+
const unrendered = (error) => {
|
|
14845
|
+
const message = String(error && error.message ? error.message : error);
|
|
14846
|
+
return message.indexOf("not in render tree") !== -1 || message.indexOf("path is empty") !== -1;
|
|
14847
|
+
};
|
|
14840
14848
|
try {
|
|
14841
14849
|
const runtime = globalThis.mermaid;
|
|
14842
14850
|
if (!runtime) throw new Error("Mermaid renderer failed to load.");
|
|
14843
14851
|
runtime.initialize({ startOnLoad: false, securityLevel: "strict", theme: ${safeTheme} });
|
|
14844
|
-
|
|
14852
|
+
const host = document.querySelector(".mermaid");
|
|
14853
|
+
// Mermaid sizes every label by appending a probe <svg> to the body and
|
|
14854
|
+
// reading getBBox(), and it throws "svg element not in render tree" the
|
|
14855
|
+
// moment that comes back 0x0. That is what a hidden panel looks like from
|
|
14856
|
+
// in here: the document exists but nothing is in the render tree, so the
|
|
14857
|
+
// measurement has no geometry to report. Ask the same question Mermaid
|
|
14858
|
+
// will ask, and only start once it has an answer.
|
|
14859
|
+
const measurable = () => {
|
|
14860
|
+
const probe = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
14861
|
+
const text = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
14862
|
+
text.textContent = "M";
|
|
14863
|
+
probe.appendChild(text);
|
|
14864
|
+
document.body.appendChild(probe);
|
|
14865
|
+
let box = { width: 0, height: 0 };
|
|
14866
|
+
try { box = text.getBBox(); } catch (ignored) {}
|
|
14867
|
+
probe.remove();
|
|
14868
|
+
return box.width > 0 || box.height > 0;
|
|
14869
|
+
};
|
|
14870
|
+
// requestAnimationFrame is the right clock here: a hidden document stops
|
|
14871
|
+
// being animated, so this waits without spinning and resumes on the frame
|
|
14872
|
+
// the panel is shown. The cap counts rendered frames, not wall time.
|
|
14873
|
+
const waitUntilMeasurable = async (maxFrames) => {
|
|
14874
|
+
for (let frame = 0; frame < maxFrames; frame += 1) {
|
|
14875
|
+
if (measurable()) return true;
|
|
14876
|
+
await new Promise((next) => requestAnimationFrame(next));
|
|
14877
|
+
}
|
|
14878
|
+
return measurable();
|
|
14879
|
+
};
|
|
14880
|
+
await waitUntilMeasurable(600);
|
|
14881
|
+
try {
|
|
14882
|
+
await runtime.run({ querySelector: ".mermaid" });
|
|
14883
|
+
} catch (firstAttempt) {
|
|
14884
|
+
if (!unrendered(firstAttempt)) throw firstAttempt;
|
|
14885
|
+
// The panel can be hidden again between the probe and the real measure.
|
|
14886
|
+
// Clear the marker Mermaid leaves behind so the retry is not skipped as
|
|
14887
|
+
// already done, then wait for the render tree once more.
|
|
14888
|
+
host.removeAttribute("data-processed");
|
|
14889
|
+
await waitUntilMeasurable(600);
|
|
14890
|
+
await runtime.run({ querySelector: ".mermaid" });
|
|
14891
|
+
}
|
|
14845
14892
|
const viewport = document.querySelector(".viewport");
|
|
14846
14893
|
const svg = document.querySelector(".mermaid svg");
|
|
14847
14894
|
const value = document.querySelector(".zoom-value");
|
|
@@ -14877,6 +14924,8 @@ function buildMermaidHtml(code, theme, scriptUrl = MERMAID_BROWSER_ASSET_RELATIV
|
|
|
14877
14924
|
// for a syntax error that does not exist. Say what actually moves it.
|
|
14878
14925
|
const note = raw.indexOf("Could not find a suitable point") !== -1
|
|
14879
14926
|
? "Two nodes ended up too close together for Mermaid to fit a label on the edge between them. Renaming a node, adding another, or setting an explicit direction usually spreads the layout enough to render."
|
|
14927
|
+
: unrendered(error)
|
|
14928
|
+
? "The panel stayed hidden long enough that there was never a laid-out page to measure the diagram against. Reopening the panel renders it."
|
|
14880
14929
|
: "This diagram could not be rendered.";
|
|
14881
14930
|
document.querySelector(".viewport").innerHTML =
|
|
14882
14931
|
'<div class="failure"><p>' + escape(note) +
|
|
@@ -21489,4 +21538,4 @@ export {
|
|
|
21489
21538
|
createAgentHealthMcpServer
|
|
21490
21539
|
};
|
|
21491
21540
|
|
|
21492
|
-
//# debugId=
|
|
21541
|
+
//# debugId=989B4D867D24F24064756E2164756E21
|