@slock-ai/daemon 0.41.1-alpha.0 → 0.43.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/dist/chat-bridge.js +25 -2
- package/dist/{chunk-JAB3HALZ.js → chunk-37O7EHYE.js} +910 -159
- package/dist/cli/index.js +542 -4
- package/dist/core.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/chat-bridge.js
CHANGED
|
@@ -338,6 +338,7 @@ var authToken = "";
|
|
|
338
338
|
var runtime = "unknown";
|
|
339
339
|
var launchId = "";
|
|
340
340
|
var deprecatedShimMode = false;
|
|
341
|
+
var runtimeActionsOnlyMode = false;
|
|
341
342
|
for (let i = 0; i < args.length; i++) {
|
|
342
343
|
if (args[i] === "--agent-id" && args[i + 1]) agentId = args[++i];
|
|
343
344
|
if (args[i] === "--server-url" && args[i + 1]) serverUrl = args[++i];
|
|
@@ -345,6 +346,7 @@ for (let i = 0; i < args.length; i++) {
|
|
|
345
346
|
if (args[i] === "--runtime" && args[i + 1]) runtime = args[++i];
|
|
346
347
|
if (args[i] === "--launch-id" && args[i + 1]) launchId = args[++i];
|
|
347
348
|
if (args[i] === "--deprecated-shim") deprecatedShimMode = true;
|
|
349
|
+
if (args[i] === "--runtime-actions-only") runtimeActionsOnlyMode = true;
|
|
348
350
|
}
|
|
349
351
|
if (!agentId) {
|
|
350
352
|
console.error("Missing --agent-id");
|
|
@@ -502,6 +504,26 @@ function formatSenderHandle(message) {
|
|
|
502
504
|
const senderDescription = message.sender_description ?? message.senderDescription ?? null;
|
|
503
505
|
return senderDescription ? `@${senderName} \u2014 ${senderDescription}` : `@${senderName}`;
|
|
504
506
|
}
|
|
507
|
+
function formatRuntimeContext(ctx) {
|
|
508
|
+
if (!ctx) return "";
|
|
509
|
+
const lines = [
|
|
510
|
+
"### Current Runtime",
|
|
511
|
+
"Authoritative context for this agent process. Do not infer computer identity from hostname or cwd when this section is present."
|
|
512
|
+
];
|
|
513
|
+
if (ctx.agentId) lines.push(`- Agent ID: ${ctx.agentId}`);
|
|
514
|
+
if (ctx.serverId) lines.push(`- Server ID: ${ctx.serverId}`);
|
|
515
|
+
if (ctx.machineName || ctx.machineId) {
|
|
516
|
+
const label = ctx.machineName && ctx.machineId ? `${ctx.machineName} (${ctx.machineId})` : ctx.machineName || ctx.machineId;
|
|
517
|
+
lines.push(`- Computer: ${label}`);
|
|
518
|
+
}
|
|
519
|
+
if (ctx.machineHostname) lines.push(`- Hostname: ${ctx.machineHostname}`);
|
|
520
|
+
if (ctx.machineOs) lines.push(`- OS: ${ctx.machineOs}`);
|
|
521
|
+
if (ctx.daemonVersion) lines.push(`- Daemon: v${ctx.daemonVersion}`);
|
|
522
|
+
if (ctx.workspacePath) lines.push(`- Workspace: ${ctx.workspacePath}`);
|
|
523
|
+
return lines.length > 2 ? `${lines.join("\n")}
|
|
524
|
+
|
|
525
|
+
` : "";
|
|
526
|
+
}
|
|
505
527
|
async function listServerChannels() {
|
|
506
528
|
const { response: res, data } = await executeJsonRequest(
|
|
507
529
|
`${serverUrl}/internal/agent/${agentId}/server`,
|
|
@@ -557,7 +579,7 @@ function registerDeprecatedTool(tool) {
|
|
|
557
579
|
}
|
|
558
580
|
);
|
|
559
581
|
}
|
|
560
|
-
if (deprecatedShimMode) {
|
|
582
|
+
if (deprecatedShimMode && !runtimeActionsOnlyMode) {
|
|
561
583
|
for (const tool of DEPRECATED_MCP_TOOL_DEFINITIONS) {
|
|
562
584
|
registerDeprecatedTool(tool);
|
|
563
585
|
}
|
|
@@ -607,7 +629,7 @@ server.tool(
|
|
|
607
629
|
}
|
|
608
630
|
}
|
|
609
631
|
);
|
|
610
|
-
if (!deprecatedShimMode) {
|
|
632
|
+
if (!deprecatedShimMode && !runtimeActionsOnlyMode) {
|
|
611
633
|
let formatMessages = function(messages) {
|
|
612
634
|
return messages.map((m) => {
|
|
613
635
|
const target = formatTarget(m);
|
|
@@ -887,6 +909,7 @@ Use this ID in send_message's attachment_ids parameter to include it in a messag
|
|
|
887
909
|
const channels = data.channels ?? [];
|
|
888
910
|
const agents = data.agents ?? [];
|
|
889
911
|
const humans = data.humans ?? [];
|
|
912
|
+
text += formatRuntimeContext(data.runtimeContext);
|
|
890
913
|
text += "### Channels\n";
|
|
891
914
|
text += 'Visible public channels may appear even when `joined=false`. Use `read_history(channel="#name")` to inspect them. When a channel is not joined, you cannot send messages there or receive ordinary channel delivery until a human adds you to the channel. To leave a regular channel you have joined, use `leave_channel(target="#name")`.\n';
|
|
892
915
|
if (channels.length > 0) {
|