@sanity-labs/nuum 0.5.0 → 0.5.2
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/README.md +1 -1
- package/dist/index.js +91 -65
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -237,7 +237,7 @@ Reflection searches the full conversation history (via FTS5 full-text search) an
|
|
|
237
237
|
ANTHROPIC_API_KEY=your-key-here
|
|
238
238
|
|
|
239
239
|
# Optional (defaults shown)
|
|
240
|
-
AGENT_MODEL_REASONING=claude-opus-4-
|
|
240
|
+
AGENT_MODEL_REASONING=claude-opus-4-6
|
|
241
241
|
AGENT_MODEL_WORKHORSE=claude-sonnet-4-5-20250929
|
|
242
242
|
AGENT_MODEL_FAST=claude-haiku-4-5-20251001
|
|
243
243
|
AGENT_DB=./agent.db
|
package/dist/index.js
CHANGED
|
@@ -45318,79 +45318,103 @@ var Mcp;
|
|
|
45318
45318
|
Mcp.getToolNames = getToolNames;
|
|
45319
45319
|
})(Mcp ||= {});
|
|
45320
45320
|
|
|
45321
|
+
// src/version.ts
|
|
45322
|
+
var VERSION = "0.5.2";
|
|
45323
|
+
var GIT_HASH = "91ca6b6";
|
|
45324
|
+
var VERSION_STRING = `nuum v${VERSION} (${GIT_HASH})`;
|
|
45325
|
+
|
|
45321
45326
|
// src/tool/mcp-status.ts
|
|
45322
45327
|
var parameters5 = exports_external.object({});
|
|
45323
|
-
var
|
|
45324
|
-
description: `
|
|
45328
|
+
var SystemStatusTool = Tool.define("system_status", {
|
|
45329
|
+
description: `Get system status including version, models, and MCP server connections.
|
|
45325
45330
|
|
|
45326
45331
|
Shows:
|
|
45327
|
-
-
|
|
45328
|
-
-
|
|
45329
|
-
-
|
|
45332
|
+
- Nuum version and git hash
|
|
45333
|
+
- Configured models (reasoning, workhorse, fast tiers)
|
|
45334
|
+
- MCP server connection status and available tools
|
|
45330
45335
|
|
|
45331
45336
|
Use this when:
|
|
45337
|
+
- You want to verify what version of nuum is running
|
|
45338
|
+
- You need to check which models are configured
|
|
45332
45339
|
- A tool you expect isn't available
|
|
45333
|
-
- You want to see what MCP capabilities are configured
|
|
45334
45340
|
- Debugging MCP connection issues`,
|
|
45335
45341
|
parameters: parameters5,
|
|
45336
45342
|
async execute(_args, _ctx) {
|
|
45337
|
-
const
|
|
45338
|
-
const
|
|
45339
|
-
|
|
45343
|
+
const config2 = Config.get();
|
|
45344
|
+
const mcpStatus = Mcp.getStatus();
|
|
45345
|
+
const mcpToolNames = Mcp.getToolNames();
|
|
45346
|
+
let output = `## System Status
|
|
45340
45347
|
|
|
45341
45348
|
`;
|
|
45342
|
-
|
|
45343
|
-
output += `No MCP servers configured.
|
|
45349
|
+
output += `### Version
|
|
45344
45350
|
`;
|
|
45345
|
-
|
|
45346
|
-
|
|
45347
|
-
title: "MCP Status",
|
|
45348
|
-
metadata: {
|
|
45349
|
-
serverCount: 0,
|
|
45350
|
-
connectedCount: 0,
|
|
45351
|
-
toolCount: 0
|
|
45352
|
-
}
|
|
45353
|
-
};
|
|
45354
|
-
}
|
|
45355
|
-
let connectedCount = 0;
|
|
45356
|
-
for (const server of status) {
|
|
45357
|
-
const statusIcon = server.status === "connected" ? "\u2713" : server.status === "connecting" ? "\u22EF" : "\u2717";
|
|
45358
|
-
output += `### ${server.name} ${statusIcon}
|
|
45351
|
+
output += `- **nuum** v${VERSION} (${GIT_HASH})
|
|
45352
|
+
|
|
45359
45353
|
`;
|
|
45360
|
-
|
|
45354
|
+
output += `### Models
|
|
45361
45355
|
`;
|
|
45362
|
-
|
|
45363
|
-
connectedCount++;
|
|
45364
|
-
output += `- Tools: ${server.toolCount}
|
|
45356
|
+
output += `- **Reasoning:** ${config2.models.reasoning}
|
|
45365
45357
|
`;
|
|
45366
|
-
|
|
45367
|
-
if (serverTools.length > 0) {
|
|
45368
|
-
output += `- Available:
|
|
45358
|
+
output += `- **Workhorse:** ${config2.models.workhorse}
|
|
45369
45359
|
`;
|
|
45370
|
-
|
|
45371
|
-
|
|
45372
|
-
|
|
45360
|
+
output += `- **Fast:** ${config2.models.fast}
|
|
45361
|
+
|
|
45362
|
+
`;
|
|
45363
|
+
output += `### MCP Servers
|
|
45364
|
+
|
|
45365
|
+
`;
|
|
45366
|
+
if (mcpStatus.length === 0) {
|
|
45367
|
+
output += `No MCP servers configured.
|
|
45368
|
+
`;
|
|
45369
|
+
} else {
|
|
45370
|
+
let connectedCount = 0;
|
|
45371
|
+
for (const server of mcpStatus) {
|
|
45372
|
+
const statusIcon = server.status === "connected" ? "\u2713" : server.status === "connecting" ? "\u22EF" : "\u2717";
|
|
45373
|
+
output += `**${server.name}** ${statusIcon}
|
|
45374
|
+
`;
|
|
45375
|
+
if (server.status === "connected") {
|
|
45376
|
+
connectedCount++;
|
|
45377
|
+
const serverTools = mcpToolNames.filter((t) => t.startsWith(`${server.name}__`));
|
|
45378
|
+
output += `- ${server.toolCount} tools: ${serverTools.map((t) => t.replace(`${server.name}__`, "")).join(", ")}
|
|
45379
|
+
`;
|
|
45380
|
+
} else if (server.error) {
|
|
45381
|
+
output += `- Error: ${server.error}
|
|
45382
|
+
`;
|
|
45383
|
+
} else {
|
|
45384
|
+
output += `- Status: ${server.status}
|
|
45373
45385
|
`;
|
|
45374
|
-
}
|
|
45375
45386
|
}
|
|
45376
|
-
|
|
45377
|
-
output += `- Error: ${server.error}
|
|
45387
|
+
output += `
|
|
45378
45388
|
`;
|
|
45379
45389
|
}
|
|
45380
|
-
|
|
45390
|
+
const totalTools = mcpToolNames.length;
|
|
45391
|
+
output += `---
|
|
45381
45392
|
`;
|
|
45382
|
-
|
|
45383
|
-
output += `---
|
|
45384
|
-
`;
|
|
45385
|
-
output += `**Summary:** ${connectedCount}/${status.length} servers connected, ${toolNames.length} tools available
|
|
45393
|
+
output += `**MCP Summary:** ${connectedCount}/${mcpStatus.length} servers connected, ${totalTools} tools available
|
|
45386
45394
|
`;
|
|
45395
|
+
return {
|
|
45396
|
+
output,
|
|
45397
|
+
title: "System Status",
|
|
45398
|
+
metadata: {
|
|
45399
|
+
version: VERSION,
|
|
45400
|
+
gitHash: GIT_HASH,
|
|
45401
|
+
models: config2.models,
|
|
45402
|
+
mcpServerCount: mcpStatus.length,
|
|
45403
|
+
mcpConnectedCount: connectedCount,
|
|
45404
|
+
mcpToolCount: totalTools
|
|
45405
|
+
}
|
|
45406
|
+
};
|
|
45407
|
+
}
|
|
45387
45408
|
return {
|
|
45388
45409
|
output,
|
|
45389
|
-
title: "
|
|
45410
|
+
title: "System Status",
|
|
45390
45411
|
metadata: {
|
|
45391
|
-
|
|
45392
|
-
|
|
45393
|
-
|
|
45412
|
+
version: VERSION,
|
|
45413
|
+
gitHash: GIT_HASH,
|
|
45414
|
+
models: config2.models,
|
|
45415
|
+
mcpServerCount: 0,
|
|
45416
|
+
mcpConnectedCount: 0,
|
|
45417
|
+
mcpToolCount: 0
|
|
45394
45418
|
}
|
|
45395
45419
|
};
|
|
45396
45420
|
}
|
|
@@ -47075,12 +47099,12 @@ function summarizeToolResult(toolName, result) {
|
|
|
47075
47099
|
case "ltm_reparent":
|
|
47076
47100
|
case "ltm_rename":
|
|
47077
47101
|
return result.slice(0, 60);
|
|
47078
|
-
case "
|
|
47102
|
+
case "system_status": {
|
|
47079
47103
|
const match = result.match(/(\d+)\/(\d+) servers connected, (\d+) tools/);
|
|
47080
47104
|
if (match) {
|
|
47081
47105
|
return `${match[1]}/${match[2]} servers, ${match[3]} tools`;
|
|
47082
47106
|
}
|
|
47083
|
-
return "
|
|
47107
|
+
return "system status retrieved";
|
|
47084
47108
|
}
|
|
47085
47109
|
default:
|
|
47086
47110
|
return result.length > 60 ? result.slice(0, 57) + "..." : result;
|
|
@@ -47199,10 +47223,10 @@ function buildTools(storage, sessionId, messageId, abortSignal) {
|
|
|
47199
47223
|
parameters: WebFetchTool.definition.parameters,
|
|
47200
47224
|
execute: async (args, { toolCallId }) => safeExecute("web_fetch", () => WebFetchTool.definition.execute(args, factory.createContext(toolCallId)))
|
|
47201
47225
|
});
|
|
47202
|
-
tools.
|
|
47203
|
-
description:
|
|
47204
|
-
parameters:
|
|
47205
|
-
execute: async (args, { toolCallId }) => safeExecute("
|
|
47226
|
+
tools.system_status = tool({
|
|
47227
|
+
description: SystemStatusTool.definition.description,
|
|
47228
|
+
parameters: SystemStatusTool.definition.parameters,
|
|
47229
|
+
execute: async (args, { toolCallId }) => safeExecute("system_status", () => SystemStatusTool.definition.execute(args, factory.createContext(toolCallId)))
|
|
47206
47230
|
});
|
|
47207
47231
|
tools.present_set_mission = tool({
|
|
47208
47232
|
description: "Set the current mission (high-level objective)",
|
|
@@ -47423,7 +47447,7 @@ async function runAgent(prompt, options) {
|
|
|
47423
47447
|
}
|
|
47424
47448
|
onEvent?.({
|
|
47425
47449
|
type: "tool_result",
|
|
47426
|
-
content: toolResult
|
|
47450
|
+
content: toolResult,
|
|
47427
47451
|
toolCallId
|
|
47428
47452
|
});
|
|
47429
47453
|
},
|
|
@@ -48228,12 +48252,22 @@ function toolResult(toolUseId, content, isError = false) {
|
|
|
48228
48252
|
is_error: isError || undefined
|
|
48229
48253
|
};
|
|
48230
48254
|
}
|
|
48255
|
+
function userToolResult(toolUseId, content, sessionId, isError = false) {
|
|
48256
|
+
return {
|
|
48257
|
+
type: "user",
|
|
48258
|
+
message: {
|
|
48259
|
+
role: "user",
|
|
48260
|
+
content: [toolResult(toolUseId, content, isError)]
|
|
48261
|
+
},
|
|
48262
|
+
session_id: sessionId
|
|
48263
|
+
};
|
|
48264
|
+
}
|
|
48231
48265
|
function resultMessage(sessionId, subtype, durationMs, numTurns, options = {}) {
|
|
48232
48266
|
return {
|
|
48233
48267
|
type: "result",
|
|
48234
48268
|
subtype,
|
|
48235
48269
|
duration_ms: durationMs,
|
|
48236
|
-
is_error: subtype
|
|
48270
|
+
is_error: subtype !== "success" && subtype !== "cancelled",
|
|
48237
48271
|
num_turns: numTurns,
|
|
48238
48272
|
session_id: sessionId,
|
|
48239
48273
|
result: options.result,
|
|
@@ -48531,7 +48565,7 @@ ${content}`
|
|
|
48531
48565
|
}
|
|
48532
48566
|
const message = error2 instanceof Error ? error2.message : String(error2);
|
|
48533
48567
|
log14.error("turn failed", { sessionId, error: message });
|
|
48534
|
-
this.send(resultMessage(sessionId, "
|
|
48568
|
+
this.send(resultMessage(sessionId, "error_during_execution", Date.now() - (this.currentTurn?.startTime ?? Date.now()), this.currentTurn?.numTurns ?? 0, {
|
|
48535
48569
|
result: message
|
|
48536
48570
|
}));
|
|
48537
48571
|
} finally {
|
|
@@ -48595,10 +48629,7 @@ ${content}`
|
|
|
48595
48629
|
case "tool_result":
|
|
48596
48630
|
if (event.toolCallId) {
|
|
48597
48631
|
this.currentTurn.numTurns++;
|
|
48598
|
-
this.send(
|
|
48599
|
-
tool_result: toolResult(event.toolCallId, event.content),
|
|
48600
|
-
session_id: sessionId
|
|
48601
|
-
}));
|
|
48632
|
+
this.send(userToolResult(event.toolCallId, event.content, sessionId));
|
|
48602
48633
|
}
|
|
48603
48634
|
break;
|
|
48604
48635
|
case "error":
|
|
@@ -48962,11 +48993,6 @@ async function runRepl(options) {
|
|
|
48962
48993
|
await session.start();
|
|
48963
48994
|
}
|
|
48964
48995
|
|
|
48965
|
-
// src/version.ts
|
|
48966
|
-
var VERSION = "0.5.0";
|
|
48967
|
-
var GIT_HASH = "767263f";
|
|
48968
|
-
var VERSION_STRING = `nuum v${VERSION} (${GIT_HASH})`;
|
|
48969
|
-
|
|
48970
48996
|
// src/cli/error.ts
|
|
48971
48997
|
function categorizeError(error2) {
|
|
48972
48998
|
if (!(error2 instanceof Error)) {
|