@slock-ai/daemon 0.37.0 → 0.37.1-alpha.1

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.
@@ -645,7 +645,7 @@ server.tool(
645
645
  const agents = data.agents ?? [];
646
646
  const humans = data.humans ?? [];
647
647
  text += "### Channels\n";
648
- text += "Use `#channel-name` with send_message to post in a channel. `joined` means you currently belong to that channel.\n";
648
+ 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.\n';
649
649
  if (channels.length > 0) {
650
650
  for (const t of channels) {
651
651
  const status = t.joined ? "joined" : "not joined";
@@ -973,7 +973,7 @@ server.tool(
973
973
  1. By task number: claim existing tasks shown in list_tasks. Use task_numbers=[1, 3].
974
974
  2. By message ID: convert a regular top-level message into a task and claim it. Use message_ids=["a1b2c3d4"]. The message ID is the 8-character msg= value from received messages or read_history.
975
975
 
976
- Thread messages cannot be claimed or converted into tasks. If a task is in "todo" status, claiming auto-advances it to "in_progress". If another agent already claimed it, the claim fails \u2014 do not work on that task, move on. Always claim before starting any work to prevent duplicate effort.`,
976
+ Thread messages and system messages (e.g. task-claim / task-status announcements) cannot be claimed or converted into tasks \u2014 if a system message describes an action you should take, just do it; otherwise ignore it. If a task is in "todo" status, claiming auto-advances it to "in_progress". If another agent already claimed it, the claim fails \u2014 do not work on that task, move on. Always claim before starting any work to prevent duplicate effort.`,
977
977
  {
978
978
  channel: z.string().describe("The channel \u2014 e.g. '#engineering'"),
979
979
  task_numbers: z.array(z.number()).optional().describe("Task numbers to claim (from list_tasks output, e.g. [1, 3])"),
@@ -7,10 +7,159 @@ import {
7
7
  import path10 from "path";
8
8
  import os4 from "os";
9
9
  import { createRequire } from "module";
10
- import { execSync as execSync2 } from "child_process";
11
10
  import { accessSync } from "fs";
12
11
  import { fileURLToPath } from "url";
13
12
 
13
+ // ../shared/src/toolDisplay.ts
14
+ var TOOL_DISPLAY_METADATA = {
15
+ send_message: { logLabel: "Sending message", activityLabel: "Sending message\u2026", summaryKind: "message_target" },
16
+ check_messages: { logLabel: "Checking messages", activityLabel: "Checking messages\u2026", summaryKind: "none" },
17
+ wait_for_message: { logLabel: "Waiting for messages", activityLabel: "Waiting for messages\u2026", summaryKind: "none" },
18
+ receive_message: { logLabel: "Checking messages", activityLabel: "Checking messages\u2026", summaryKind: "none" },
19
+ read_history: { logLabel: "Reading history", activityLabel: "Reading history\u2026", summaryKind: "history_target" },
20
+ search_messages: { logLabel: "Searching messages", activityLabel: "Searching messages\u2026", summaryKind: "query" },
21
+ list_server: { logLabel: "Listing server", activityLabel: "Listing server\u2026", summaryKind: "none" },
22
+ list_tasks: { logLabel: "Listing tasks", activityLabel: "Listing tasks\u2026", summaryKind: "channel" },
23
+ create_tasks: { logLabel: "Creating tasks", activityLabel: "Creating tasks\u2026", summaryKind: "channel" },
24
+ claim_tasks: { logLabel: "Claiming tasks", activityLabel: "Claiming tasks\u2026", summaryKind: "claim_tasks" },
25
+ unclaim_task: { logLabel: "Unclaiming task", activityLabel: "Unclaiming task\u2026", summaryKind: "task_ref" },
26
+ update_task_status: { logLabel: "Updating task status", activityLabel: "Updating task status\u2026", summaryKind: "task_ref" },
27
+ join_channel: { logLabel: "Joining channel", activityLabel: "Joining channel\u2026", summaryKind: "target" },
28
+ leave_channel: { logLabel: "Leaving channel", activityLabel: "Leaving channel\u2026", summaryKind: "target" },
29
+ upload_file: { logLabel: "Uploading file", activityLabel: "Uploading file\u2026", summaryKind: "file_path" },
30
+ view_file: { logLabel: "Viewing file", activityLabel: "Viewing file\u2026", summaryKind: "none" },
31
+ read_file: { logLabel: "Reading file", activityLabel: "Reading file\u2026", summaryKind: "file_path" },
32
+ write_file: { logLabel: "Writing file", activityLabel: "Writing file\u2026", summaryKind: "file_path" },
33
+ edit_file: { logLabel: "Editing file", activityLabel: "Editing file\u2026", summaryKind: "file_path" },
34
+ bash: { logLabel: "Running command", activityLabel: "Running command\u2026", summaryKind: "command" },
35
+ glob: { logLabel: "Searching files", activityLabel: "Searching files\u2026", summaryKind: "pattern" },
36
+ grep: { logLabel: "Searching code", activityLabel: "Searching code\u2026", summaryKind: "pattern" },
37
+ web_fetch: { logLabel: "Fetching web", activityLabel: "Fetching web\u2026", summaryKind: "url" },
38
+ web_search: { logLabel: "Searching web", activityLabel: "Searching web\u2026", summaryKind: "query" },
39
+ todo_write: { logLabel: "Updating tasks", activityLabel: "Updating tasks\u2026", summaryKind: "none" },
40
+ collab_tool_call: { logLabel: "Collaborating", activityLabel: "Collaborating\u2026", summaryKind: "none" }
41
+ };
42
+ var KNOWN_TOOL_ALIASES = {
43
+ send_message: "send_message",
44
+ check_messages: "check_messages",
45
+ wait_for_message: "wait_for_message",
46
+ receive_message: "receive_message",
47
+ read_history: "read_history",
48
+ search_messages: "search_messages",
49
+ list_server: "list_server",
50
+ list_tasks: "list_tasks",
51
+ create_tasks: "create_tasks",
52
+ claim_tasks: "claim_tasks",
53
+ unclaim_task: "unclaim_task",
54
+ update_task_status: "update_task_status",
55
+ join_channel: "join_channel",
56
+ leave_channel: "leave_channel",
57
+ upload_file: "upload_file",
58
+ view_file: "view_file",
59
+ Read: "read_file",
60
+ read_file: "read_file",
61
+ ReadFile: "read_file",
62
+ file_read: "read_file",
63
+ Write: "write_file",
64
+ write_file: "write_file",
65
+ WriteFile: "write_file",
66
+ file_write: "write_file",
67
+ Edit: "edit_file",
68
+ edit_file: "edit_file",
69
+ EditFile: "edit_file",
70
+ file_change: "edit_file",
71
+ StrReplaceFile: "edit_file",
72
+ Bash: "bash",
73
+ bash: "bash",
74
+ shell: "bash",
75
+ Shell: "bash",
76
+ command_execution: "bash",
77
+ run_shell_command: "bash",
78
+ Glob: "glob",
79
+ glob: "glob",
80
+ search_files: "glob",
81
+ Grep: "grep",
82
+ grep: "grep",
83
+ WebFetch: "web_fetch",
84
+ web_fetch: "web_fetch",
85
+ fetch_url: "web_fetch",
86
+ FetchURL: "web_fetch",
87
+ WebSearch: "web_search",
88
+ web_search: "web_search",
89
+ SearchWeb: "web_search",
90
+ TodoWrite: "todo_write",
91
+ SetTodoList: "todo_write",
92
+ collab_tool_call: "collab_tool_call"
93
+ };
94
+ var MCP_CHAT_NAMESPACE_PREFIXES = ["mcp__chat__", "mcp_chat_"];
95
+ function normalizeToolLookupName(toolName) {
96
+ for (const prefix of MCP_CHAT_NAMESPACE_PREFIXES) {
97
+ if (toolName.startsWith(prefix)) {
98
+ return toolName.slice(prefix.length);
99
+ }
100
+ }
101
+ return toolName;
102
+ }
103
+ function stripToolNamespace(toolName) {
104
+ const normalized = normalizeToolLookupName(toolName);
105
+ return normalized.replace(/^mcp__\w+__/, "");
106
+ }
107
+ function truncateLabel(text, max = 20) {
108
+ return text.length > max ? `${text.slice(0, max)}\u2026` : text;
109
+ }
110
+ function formatTaskNumbers(value) {
111
+ if (Array.isArray(value)) return value.map((taskNumber) => `#t${taskNumber}`).join(",");
112
+ if (value == null || value === "") return "";
113
+ return `#t${value}`;
114
+ }
115
+ function asObject(input) {
116
+ return input && typeof input === "object" ? input : null;
117
+ }
118
+ function resolveToolSemantic(toolName) {
119
+ const normalized = normalizeToolLookupName(toolName);
120
+ return KNOWN_TOOL_ALIASES[normalized] ?? null;
121
+ }
122
+ function getToolActivityLabel(toolName) {
123
+ const semantic = resolveToolSemantic(toolName);
124
+ if (semantic) return TOOL_DISPLAY_METADATA[semantic].activityLabel;
125
+ return `Using ${truncateLabel(stripToolNamespace(toolName))}\u2026`;
126
+ }
127
+ function summarizeToolInput(toolName, input) {
128
+ const semantic = resolveToolSemantic(toolName);
129
+ const value = asObject(input);
130
+ if (!semantic || !value) return "";
131
+ switch (TOOL_DISPLAY_METADATA[semantic].summaryKind) {
132
+ case "none":
133
+ return "";
134
+ case "file_path":
135
+ return value.file_path || value.path || "";
136
+ case "command": {
137
+ const command = value.command || "";
138
+ return typeof command === "string" && command.length > 100 ? `${command.slice(0, 100)}\u2026` : command;
139
+ }
140
+ case "pattern":
141
+ return value.pattern || value.query || "";
142
+ case "query":
143
+ return value.query || "";
144
+ case "url":
145
+ return value.url || "";
146
+ case "message_target":
147
+ return value.target || value.channel || (value.dm_to ? `DM:@${value.dm_to}` : "");
148
+ case "history_target":
149
+ return value.target || value.channel || "";
150
+ case "channel":
151
+ return value.channel || "";
152
+ case "claim_tasks": {
153
+ const tasks = formatTaskNumbers(value.task_numbers);
154
+ return value.channel && tasks ? `${value.channel} ${tasks}` : value.channel || "";
155
+ }
156
+ case "task_ref":
157
+ return value.channel && value.task_number != null ? `${value.channel} #t${value.task_number}` : "";
158
+ case "target":
159
+ return value.target || "";
160
+ }
161
+ }
162
+
14
163
  // ../shared/src/testing/failpoints.ts
15
164
  var NoopFailpointRegistry = class {
16
165
  get enabled() {
@@ -82,7 +231,7 @@ var RUNTIMES = [
82
231
  { id: "codex", displayName: "Codex CLI", binary: "codex", supported: true },
83
232
  { id: "kimi", displayName: "Kimi CLI", binary: "kimi", supported: true },
84
233
  { id: "copilot", displayName: "Copilot CLI", binary: "copilot", supported: true },
85
- { id: "cursor", displayName: "Cursor CLI", binary: "agent", supported: true },
234
+ { id: "cursor", displayName: "Cursor CLI", binary: "cursor-agent", supported: true },
86
235
  { id: "gemini", displayName: "Gemini CLI", binary: "gemini", supported: true }
87
236
  ];
88
237
  var PLAN_CONFIG = {
@@ -203,6 +352,8 @@ Header fields:
203
352
  - \`time=\` \u2014 timestamp.
204
353
  - \`type=\` \u2014 sender kind. Values are \`human\`, \`agent\`, or \`system\`.
205
354
 
355
+ \`type=system\` messages announce state changes in the channel (task events, channel archived/unarchived, etc.). They are informational \u2014 don't reply to them unless they clearly request action (e.g. a task was just assigned to you). In particular, archive/unarchive notifications do not need any response. If a channel is archived, further writes there will be rejected.
356
+
206
357
  ### Sending messages
207
358
 
208
359
  - **Reply to a channel**: \`send_message(target="#channel-name", content="...")\`
@@ -226,6 +377,7 @@ Threads are sub-conversations attached to a specific message. They let you discu
226
377
  ### Discovering people and channels
227
378
 
228
379
  Call \`list_server\` to see all channels in this server, which ones you have joined, other agents, and humans.
380
+ Visible public channels may appear even when \`joined=false\`. In that state you can still inspect them with \`read_history\`, but you cannot send messages there or receive ordinary channel delivery until a human adds you to the channel.
229
381
 
230
382
  ### Channel awareness
231
383
 
@@ -292,9 +444,9 @@ When you receive a notification about new tasks, check the task board and claim
292
444
 
293
445
  ## @Mentions
294
446
 
295
- In channel group chats, you can @mention people by their unique name (e.g. "@alice" or "@bob").
296
- - Your stable Slock @mention handle is \`@${config.name}\`.
297
- - Your display name is \`${config.displayName || config.name}\`. Treat it as presentation only \u2014 when reasoning about identity and @mentions, prefer your stable \`name\`.
447
+ In channel group chats, you can @mention people by their unique name (e.g. @alice or @bob).
448
+ - Your stable Slock @mention handle is @${config.name}.
449
+ - Your display name is ${config.displayName || config.name}. Treat it as presentation only \u2014 when reasoning about identity and @mentions, prefer your stable name.
298
450
  - Every human and agent has a unique \`name\` \u2014 this is their stable identifier for @mentions.
299
451
  - Mention others, not yourself \u2014 assign reviews and follow-ups to teammates.
300
452
  - @mentions only reach people inside the channel \u2014 channels are the isolation boundary.
@@ -315,13 +467,16 @@ Keep the user informed. They cannot see your internal reasoning, so:
315
467
  - **Before stopping, check for concrete blockers you own.** If you still owe a specific handoff, review, decision, or reply that is currently blocking a specific person, send one minimal actionable message to that person or channel before stopping.
316
468
  - **Skip idle narration.** Only send messages when you have actionable content \u2014 avoid broadcasting that you are waiting or idle.
317
469
 
318
- ### Formatting \u2014 No HTML
470
+ ### Formatting \u2014 Mentions & Channel Refs
319
471
 
320
- Use plain-text @mentions (e.g. \`@alice\`) and #channel references (e.g. \`#general\`, \`#1\`) \u2014 no HTML tags.
472
+ Slock auto-renders these inline tokens as interactive links whenever they appear as bare text in your message:
321
473
 
322
- When referring to a task in message content, use the explicit form \`task #123\`. Do not use bare \`#123\` for task references \u2014 bare \`#123\` is ambiguous with PR, issue, and release references.
474
+ - @alice \u2014 links to a user
475
+ - #general or #1 \u2014 links to a channel
476
+ - #engineering:b885b5ae \u2014 links to a specific thread (channel name + msg ID suffix)
477
+ - task #123 \u2014 links to a task (always write "task #N", not bare "#N" which is ambiguous with PRs/issues)
323
478
 
324
- When referencing a channel or mentioning someone, write them as plain text without backticks. Backtick-wrapped mentions render as code instead of interactive links.
479
+ Write them inline as plain words in your sentence \u2014 the same way you'd type any other word \u2014 and Slock turns them into clickable references.
325
480
 
326
481
  ### Formatting \u2014 URLs in non-English text
327
482
 
@@ -436,11 +591,34 @@ import path from "path";
436
591
  function normalizeExecOutput(raw) {
437
592
  return Buffer.isBuffer(raw) ? raw.toString("utf8") : String(raw ?? "");
438
593
  }
594
+ function resolveCommandOnWindows(command, env, execFileSyncFn) {
595
+ const script = "$cmd = Get-Command -Name $args[0] -ErrorAction Stop | Select-Object -First 1; if ($cmd.Path) { $cmd.Path } elseif ($cmd.Source) { $cmd.Source } elseif ($cmd.Definition) { $cmd.Definition }";
596
+ try {
597
+ const output = normalizeExecOutput(execFileSyncFn("powershell.exe", [
598
+ "-NoProfile",
599
+ "-NonInteractive",
600
+ "-Command",
601
+ script,
602
+ "--%",
603
+ command
604
+ ], {
605
+ stdio: ["ignore", "pipe", "ignore"],
606
+ env
607
+ }));
608
+ const resolved = output.trim().split(/\r?\n/)[0];
609
+ return resolved || command;
610
+ } catch {
611
+ return null;
612
+ }
613
+ }
439
614
  function resolveCommandOnPath(command, deps = {}) {
440
615
  const platform = deps.platform ?? process.platform;
441
616
  const env = deps.env ?? process.env;
442
617
  const execFileSyncFn = deps.execFileSyncFn ?? execFileSync;
443
- const locator = platform === "win32" ? "where" : "which";
618
+ if (platform === "win32") {
619
+ return resolveCommandOnWindows(command, env, execFileSyncFn);
620
+ }
621
+ const locator = "which";
444
622
  try {
445
623
  const output = normalizeExecOutput(execFileSyncFn(locator, [command], {
446
624
  stdio: ["ignore", "pipe", "ignore"],
@@ -663,67 +841,6 @@ var ClaudeDriver = class {
663
841
  messageNotificationStyle: "poll"
664
842
  });
665
843
  }
666
- toolDisplayName(name) {
667
- if (name === "mcp__chat__upload_file") return "Uploading file\u2026";
668
- if (name === "mcp__chat__view_file") return "Viewing file\u2026";
669
- if (name === "mcp__chat__list_tasks") return "Listing tasks\u2026";
670
- if (name === "mcp__chat__create_tasks") return "Creating tasks\u2026";
671
- if (name === "mcp__chat__claim_tasks") return "Claiming tasks\u2026";
672
- if (name === "mcp__chat__unclaim_task") return "Unclaiming task\u2026";
673
- if (name === "mcp__chat__update_task_status") return "Updating task status\u2026";
674
- if (name === "mcp__chat__list_server") return "Listing server\u2026";
675
- if (name === "mcp__chat__read_history") return "Reading history\u2026";
676
- if (name === "mcp__chat__search_messages") return "Searching messages\u2026";
677
- if (name === "mcp__chat__check_messages") return "Checking messages\u2026";
678
- if (name.startsWith("mcp__chat__")) return "";
679
- if (name === "Read" || name === "read_file") return "Reading file\u2026";
680
- if (name === "Write" || name === "write_file") return "Writing file\u2026";
681
- if (name === "Edit" || name === "edit_file") return "Editing file\u2026";
682
- if (name === "Bash" || name === "bash") return "Running command\u2026";
683
- if (name === "Glob" || name === "glob") return "Searching files\u2026";
684
- if (name === "Grep" || name === "grep") return "Searching code\u2026";
685
- if (name === "WebFetch" || name === "web_fetch") return "Fetching web\u2026";
686
- if (name === "WebSearch" || name === "web_search") return "Searching web\u2026";
687
- if (name === "TodoWrite") return "Updating tasks\u2026";
688
- return `Using ${name.length > 20 ? name.slice(0, 20) + "\u2026" : name}\u2026`;
689
- }
690
- summarizeToolInput(name, input) {
691
- if (!input || typeof input !== "object") return "";
692
- try {
693
- if (name === "Read" || name === "read_file") return input.file_path || input.path || "";
694
- if (name === "Write" || name === "write_file") return input.file_path || input.path || "";
695
- if (name === "Edit" || name === "edit_file") return input.file_path || input.path || "";
696
- if (name === "Bash" || name === "bash") {
697
- const cmd = input.command || "";
698
- return cmd.length > 100 ? cmd.slice(0, 100) + "\u2026" : cmd;
699
- }
700
- if (name === "Glob" || name === "glob") return input.pattern || "";
701
- if (name === "Grep" || name === "grep") return input.pattern || "";
702
- if (name === "WebFetch" || name === "web_fetch") return input.url || "";
703
- if (name === "WebSearch" || name === "web_search") return input.query || "";
704
- if (name === "mcp__chat__send_message") {
705
- return input.target || input.channel || (input.dm_to ? `DM:@${input.dm_to}` : "");
706
- }
707
- if (name === "mcp__chat__read_history") return input.target || input.channel || "";
708
- if (name === "mcp__chat__search_messages") return input.query || "";
709
- if (name === "mcp__chat__list_tasks") return input.channel || "";
710
- if (name === "mcp__chat__create_tasks") return input.channel || "";
711
- if (name === "mcp__chat__claim_tasks") {
712
- const nums = input.task_numbers;
713
- return input.channel ? `${input.channel} #${Array.isArray(nums) ? nums.join(",#t") : nums}` : "";
714
- }
715
- if (name === "mcp__chat__unclaim_task") {
716
- return input.channel ? `${input.channel} #${input.task_number}` : "";
717
- }
718
- if (name === "mcp__chat__update_task_status") {
719
- return input.channel ? `${input.channel} #${input.task_number}` : "";
720
- }
721
- if (name === "mcp__chat__upload_file") return input.file_path || "";
722
- return "";
723
- } catch {
724
- return "";
725
- }
726
- }
727
844
  };
728
845
 
729
846
  // src/drivers/codex.ts
@@ -1120,61 +1237,6 @@ var CodexDriver = class {
1120
1237
  messageNotificationStyle: "direct"
1121
1238
  });
1122
1239
  }
1123
- toolDisplayName(name) {
1124
- if (name === `${this.mcpToolPrefix}upload_file`) return "Uploading file\u2026";
1125
- if (name === `${this.mcpToolPrefix}view_file`) return "Viewing file\u2026";
1126
- if (name === `${this.mcpToolPrefix}list_tasks`) return "Listing tasks\u2026";
1127
- if (name === `${this.mcpToolPrefix}create_tasks`) return "Creating tasks\u2026";
1128
- if (name === `${this.mcpToolPrefix}claim_tasks`) return "Claiming tasks\u2026";
1129
- if (name === `${this.mcpToolPrefix}unclaim_task`) return "Unclaiming task\u2026";
1130
- if (name === `${this.mcpToolPrefix}update_task_status`) return "Updating task status\u2026";
1131
- if (name === `${this.mcpToolPrefix}list_server`) return "Listing server\u2026";
1132
- if (name === `${this.mcpToolPrefix}read_history`) return "Reading history\u2026";
1133
- if (name === `${this.mcpToolPrefix}search_messages`) return "Searching messages\u2026";
1134
- if (name === `${this.mcpToolPrefix}check_messages`) return "Checking messages\u2026";
1135
- if (name.startsWith(this.mcpToolPrefix)) return "";
1136
- if (name === "shell" || name === "command_execution") return "Running command\u2026";
1137
- if (name === "file_change") return "Editing file\u2026";
1138
- if (name === "file_read") return "Reading file\u2026";
1139
- if (name === "file_write") return "Writing file\u2026";
1140
- if (name === "web_search") return "Searching web\u2026";
1141
- if (name === "collab_tool_call") return "Collaborating\u2026";
1142
- return `Using ${name.length > 20 ? name.slice(0, 20) + "\u2026" : name}\u2026`;
1143
- }
1144
- summarizeToolInput(name, input) {
1145
- if (!input || typeof input !== "object") return "";
1146
- try {
1147
- if (name === "shell" || name === "command_execution") {
1148
- const cmd = input.command || "";
1149
- return cmd.length > 100 ? cmd.slice(0, 100) + "\u2026" : cmd;
1150
- }
1151
- if (name === "file_change") return input.path || "";
1152
- if (name === "file_read") return input.path || input.file_path || "";
1153
- if (name === "file_write") return input.path || input.file_path || "";
1154
- if (name === "web_search") return input.query || "";
1155
- if (name === `${this.mcpToolPrefix}send_message`) {
1156
- return input.target || input.channel || (input.dm_to ? `DM:@${input.dm_to}` : "");
1157
- }
1158
- if (name === `${this.mcpToolPrefix}read_history`) return input.target || input.channel || "";
1159
- if (name === `${this.mcpToolPrefix}search_messages`) return input.query || "";
1160
- if (name === `${this.mcpToolPrefix}list_tasks`) return input.channel || "";
1161
- if (name === `${this.mcpToolPrefix}create_tasks`) return input.channel || "";
1162
- if (name === `${this.mcpToolPrefix}claim_tasks`) {
1163
- const nums = input.task_numbers;
1164
- return input.channel ? `${input.channel} #${Array.isArray(nums) ? nums.join(",#") : nums}` : "";
1165
- }
1166
- if (name === `${this.mcpToolPrefix}unclaim_task`) {
1167
- return input.channel ? `${input.channel} #${input.task_number}` : "";
1168
- }
1169
- if (name === `${this.mcpToolPrefix}update_task_status`) {
1170
- return input.channel ? `${input.channel} #${input.task_number}` : "";
1171
- }
1172
- if (name === `${this.mcpToolPrefix}upload_file`) return input.file_path || "";
1173
- return "";
1174
- } catch {
1175
- return "";
1176
- }
1177
- }
1178
1240
  nextRequestId() {
1179
1241
  this.requestId += 1;
1180
1242
  return this.requestId;
@@ -1384,50 +1446,6 @@ var CopilotDriver = class {
1384
1446
  messageNotificationStyle: "poll"
1385
1447
  });
1386
1448
  }
1387
- toolDisplayName(name) {
1388
- if (name === "list_tasks") return "Viewing task board\u2026";
1389
- if (name === "create_tasks") return "Creating tasks\u2026";
1390
- if (name === "claim_tasks") return "Claiming tasks\u2026";
1391
- if (name === "unclaim_task") return "Unclaiming task\u2026";
1392
- if (name === "update_task_status") return "Updating task\u2026";
1393
- if (name === "send_message" || name === "receive_message" || name === "read_history" || name === "list_server") return "";
1394
- if (name === "shell" || name === "Shell") return "Running command\u2026";
1395
- if (name === "read_file" || name === "ReadFile") return "Reading file\u2026";
1396
- if (name === "write_file" || name === "WriteFile" || name === "edit_file" || name === "EditFile") return "Editing file\u2026";
1397
- if (name === "search_files" || name === "Glob" || name === "Grep") return "Searching code\u2026";
1398
- if (name === "web_search" || name === "SearchWeb") return "Searching web\u2026";
1399
- if (name === "fetch_url" || name === "FetchURL") return "Fetching web\u2026";
1400
- return `Using ${name.length > 20 ? name.slice(0, 20) + "\u2026" : name}\u2026`;
1401
- }
1402
- summarizeToolInput(name, input) {
1403
- if (!input || typeof input !== "object") return "";
1404
- try {
1405
- if (name === "shell" || name === "Shell") {
1406
- const cmd = input.command || "";
1407
- return cmd.length > 100 ? cmd.slice(0, 100) + "\u2026" : cmd;
1408
- }
1409
- if (name === "read_file" || name === "ReadFile" || name === "write_file" || name === "WriteFile" || name === "edit_file" || name === "EditFile") {
1410
- return input.path || input.file_path || "";
1411
- }
1412
- if (name === "Glob" || name === "Grep" || name === "search_files") return input.pattern || input.query || "";
1413
- if (name === "web_search" || name === "SearchWeb") return input.query || "";
1414
- if (name === "fetch_url" || name === "FetchURL") return input.url || "";
1415
- if (name === "send_message") return input.target || input.channel || "";
1416
- if (name === "read_history") return input.target || input.channel || "";
1417
- if (name === "list_tasks") return input.channel || "";
1418
- if (name === "create_tasks") return input.channel || "";
1419
- if (name === "claim_tasks") {
1420
- const nums = input.task_numbers;
1421
- return input.channel ? `${input.channel} #t${Array.isArray(nums) ? nums.join(",#t") : nums}` : "";
1422
- }
1423
- if (name === "unclaim_task" || name === "update_task_status") {
1424
- return input.channel ? `${input.channel} #t${input.task_number}` : "";
1425
- }
1426
- return "";
1427
- } catch {
1428
- return "";
1429
- }
1430
- }
1431
1449
  };
1432
1450
 
1433
1451
  // src/drivers/cursor.ts
@@ -1472,7 +1490,7 @@ var CursorDriver = class {
1472
1490
  }
1473
1491
  args.push(ctx.prompt);
1474
1492
  const spawnEnv = { ...process.env, FORCE_COLOR: "0", NO_COLOR: "1", ...ctx.config.envVars || {} };
1475
- const proc = spawn4("agent", args, {
1493
+ const proc = spawn4("cursor-agent", args, {
1476
1494
  cwd: ctx.workingDirectory,
1477
1495
  stdio: ["pipe", "pipe", "pipe"],
1478
1496
  env: spawnEnv,
@@ -1544,67 +1562,6 @@ var CursorDriver = class {
1544
1562
  messageNotificationStyle: "poll"
1545
1563
  });
1546
1564
  }
1547
- toolDisplayName(name) {
1548
- if (name === "mcp__chat__upload_file") return "Uploading file\u2026";
1549
- if (name === "mcp__chat__view_file") return "Viewing file\u2026";
1550
- if (name === "mcp__chat__list_tasks") return "Listing tasks\u2026";
1551
- if (name === "mcp__chat__create_tasks") return "Creating tasks\u2026";
1552
- if (name === "mcp__chat__claim_tasks") return "Claiming tasks\u2026";
1553
- if (name === "mcp__chat__unclaim_task") return "Unclaiming task\u2026";
1554
- if (name === "mcp__chat__update_task_status") return "Updating task status\u2026";
1555
- if (name === "mcp__chat__list_server") return "Listing server\u2026";
1556
- if (name === "mcp__chat__read_history") return "Reading history\u2026";
1557
- if (name === "mcp__chat__search_messages") return "Searching messages\u2026";
1558
- if (name === "mcp__chat__check_messages") return "Checking messages\u2026";
1559
- if (name.startsWith("mcp__chat__")) return "";
1560
- if (name === "Read" || name === "read_file") return "Reading file\u2026";
1561
- if (name === "Write" || name === "write_file") return "Writing file\u2026";
1562
- if (name === "Edit" || name === "edit_file") return "Editing file\u2026";
1563
- if (name === "Bash" || name === "bash") return "Running command\u2026";
1564
- if (name === "Glob" || name === "glob") return "Searching files\u2026";
1565
- if (name === "Grep" || name === "grep") return "Searching code\u2026";
1566
- if (name === "WebFetch" || name === "web_fetch") return "Fetching web\u2026";
1567
- if (name === "WebSearch" || name === "web_search") return "Searching web\u2026";
1568
- if (name === "TodoWrite") return "Updating tasks\u2026";
1569
- return `Using ${name.length > 20 ? name.slice(0, 20) + "\u2026" : name}\u2026`;
1570
- }
1571
- summarizeToolInput(name, input) {
1572
- if (!input || typeof input !== "object") return "";
1573
- try {
1574
- if (name === "Read" || name === "read_file") return input.file_path || input.path || "";
1575
- if (name === "Write" || name === "write_file") return input.file_path || input.path || "";
1576
- if (name === "Edit" || name === "edit_file") return input.file_path || input.path || "";
1577
- if (name === "Bash" || name === "bash") {
1578
- const cmd = input.command || "";
1579
- return cmd.length > 100 ? cmd.slice(0, 100) + "\u2026" : cmd;
1580
- }
1581
- if (name === "Glob" || name === "glob") return input.pattern || "";
1582
- if (name === "Grep" || name === "grep") return input.pattern || "";
1583
- if (name === "WebFetch" || name === "web_fetch") return input.url || "";
1584
- if (name === "WebSearch" || name === "web_search") return input.query || "";
1585
- if (name === "mcp__chat__send_message") {
1586
- return input.target || input.channel || (input.dm_to ? `DM:@${input.dm_to}` : "");
1587
- }
1588
- if (name === "mcp__chat__read_history") return input.target || input.channel || "";
1589
- if (name === "mcp__chat__search_messages") return input.query || "";
1590
- if (name === "mcp__chat__list_tasks") return input.channel || "";
1591
- if (name === "mcp__chat__create_tasks") return input.channel || "";
1592
- if (name === "mcp__chat__claim_tasks") {
1593
- const nums = input.task_numbers;
1594
- return input.channel ? `${input.channel} #${Array.isArray(nums) ? nums.join(",#t") : nums}` : "";
1595
- }
1596
- if (name === "mcp__chat__unclaim_task") {
1597
- return input.channel ? `${input.channel} #${input.task_number}` : "";
1598
- }
1599
- if (name === "mcp__chat__update_task_status") {
1600
- return input.channel ? `${input.channel} #${input.task_number}` : "";
1601
- }
1602
- if (name === "mcp__chat__upload_file") return input.file_path || "";
1603
- return "";
1604
- } catch {
1605
- return "";
1606
- }
1607
- }
1608
1565
  };
1609
1566
 
1610
1567
  // src/drivers/gemini.ts
@@ -1720,50 +1677,6 @@ var GeminiDriver = class {
1720
1677
  messageNotificationStyle: "poll"
1721
1678
  });
1722
1679
  }
1723
- toolDisplayName(name) {
1724
- if (name === "list_tasks") return "Viewing task board\u2026";
1725
- if (name === "create_tasks") return "Creating tasks\u2026";
1726
- if (name === "claim_tasks") return "Claiming tasks\u2026";
1727
- if (name === "unclaim_task") return "Unclaiming task\u2026";
1728
- if (name === "update_task_status") return "Updating task\u2026";
1729
- if (name === "send_message" || name === "receive_message" || name === "read_history" || name === "list_server") return "";
1730
- if (name === "shell" || name === "Shell") return "Running command\u2026";
1731
- if (name === "read_file" || name === "ReadFile") return "Reading file\u2026";
1732
- if (name === "write_file" || name === "WriteFile" || name === "edit_file" || name === "EditFile") return "Editing file\u2026";
1733
- if (name === "search_files" || name === "Glob" || name === "Grep") return "Searching code\u2026";
1734
- if (name === "web_search" || name === "SearchWeb") return "Searching web\u2026";
1735
- if (name === "fetch_url" || name === "FetchURL") return "Fetching web\u2026";
1736
- return `Using ${name.length > 20 ? name.slice(0, 20) + "\u2026" : name}\u2026`;
1737
- }
1738
- summarizeToolInput(name, input) {
1739
- if (!input || typeof input !== "object") return "";
1740
- try {
1741
- if (name === "shell" || name === "Shell") {
1742
- const cmd = input.command || "";
1743
- return cmd.length > 100 ? cmd.slice(0, 100) + "\u2026" : cmd;
1744
- }
1745
- if (name === "read_file" || name === "ReadFile" || name === "write_file" || name === "WriteFile" || name === "edit_file" || name === "EditFile") {
1746
- return input.path || input.file_path || "";
1747
- }
1748
- if (name === "Glob" || name === "Grep" || name === "search_files") return input.pattern || input.query || "";
1749
- if (name === "web_search" || name === "SearchWeb") return input.query || "";
1750
- if (name === "fetch_url" || name === "FetchURL") return input.url || "";
1751
- if (name === "send_message") return input.target || input.channel || "";
1752
- if (name === "read_history") return input.target || input.channel || "";
1753
- if (name === "list_tasks") return input.channel || "";
1754
- if (name === "create_tasks") return input.channel || "";
1755
- if (name === "claim_tasks") {
1756
- const nums = input.task_numbers;
1757
- return input.channel ? `${input.channel} #t${Array.isArray(nums) ? nums.join(",#t") : nums}` : "";
1758
- }
1759
- if (name === "unclaim_task" || name === "update_task_status") {
1760
- return input.channel ? `${input.channel} #t${input.task_number}` : "";
1761
- }
1762
- return "";
1763
- } catch {
1764
- return "";
1765
- }
1766
- }
1767
1680
  };
1768
1681
 
1769
1682
  // src/drivers/kimi.ts
@@ -1945,51 +1858,6 @@ var KimiDriver = class {
1945
1858
  messageNotificationStyle: "direct"
1946
1859
  });
1947
1860
  }
1948
- toolDisplayName(name) {
1949
- if (name === "list_tasks") return "Viewing task board\u2026";
1950
- if (name === "create_tasks") return "Creating tasks\u2026";
1951
- if (name === "claim_tasks") return "Claiming tasks\u2026";
1952
- if (name === "unclaim_task") return "Unclaiming task\u2026";
1953
- if (name === "update_task_status") return "Updating task\u2026";
1954
- if (name === "send_message" || name === "receive_message" || name === "read_history" || name === "list_server") return "";
1955
- if (name === "Shell") return "Running command\u2026";
1956
- if (name === "ReadFile") return "Reading file\u2026";
1957
- if (name === "WriteFile" || name === "StrReplaceFile") return "Editing file\u2026";
1958
- if (name === "Glob" || name === "Grep") return "Searching code\u2026";
1959
- if (name === "SearchWeb") return "Searching web\u2026";
1960
- if (name === "FetchURL") return "Fetching web\u2026";
1961
- if (name === "SetTodoList") return "Updating tasks\u2026";
1962
- return `Using ${name.length > 20 ? name.slice(0, 20) + "\u2026" : name}\u2026`;
1963
- }
1964
- summarizeToolInput(name, input) {
1965
- if (!input || typeof input !== "object") return "";
1966
- try {
1967
- if (name === "Shell") {
1968
- const cmd = input.command || "";
1969
- return cmd.length > 100 ? cmd.slice(0, 100) + "\u2026" : cmd;
1970
- }
1971
- if (name === "ReadFile" || name === "WriteFile" || name === "StrReplaceFile") {
1972
- return input.path || "";
1973
- }
1974
- if (name === "Glob" || name === "Grep") return input.pattern || input.query || "";
1975
- if (name === "SearchWeb") return input.query || "";
1976
- if (name === "FetchURL") return input.url || "";
1977
- if (name === "send_message") return input.target || input.channel || "";
1978
- if (name === "read_history") return input.target || input.channel || "";
1979
- if (name === "list_tasks") return input.channel || "";
1980
- if (name === "create_tasks") return input.channel || "";
1981
- if (name === "claim_tasks") {
1982
- const nums = input.task_numbers;
1983
- return input.channel ? `${input.channel} #t${Array.isArray(nums) ? nums.join(",#t") : nums}` : "";
1984
- }
1985
- if (name === "unclaim_task" || name === "update_task_status") {
1986
- return input.channel ? `${input.channel} #t${input.task_number}` : "";
1987
- }
1988
- return "";
1989
- } catch {
1990
- return "";
1991
- }
1992
- }
1993
1861
  async detectModels() {
1994
1862
  return detectKimiModels();
1995
1863
  }
@@ -2312,13 +2180,15 @@ var AgentProcessManager = class _AgentProcessManager {
2312
2180
  chatBridgePath;
2313
2181
  sendToServer;
2314
2182
  daemonApiKey;
2183
+ serverUrl;
2315
2184
  dataDir;
2316
2185
  driverResolver;
2317
2186
  defaultAgentEnvVarsProvider;
2318
- constructor(chatBridgePath, sendToServer, daemonApiKey, opts = {}) {
2187
+ constructor(chatBridgePath, sendToServer, daemonApiKey, opts) {
2319
2188
  this.chatBridgePath = chatBridgePath;
2320
2189
  this.sendToServer = sendToServer;
2321
2190
  this.daemonApiKey = daemonApiKey;
2191
+ this.serverUrl = opts.serverUrl;
2322
2192
  this.dataDir = opts.dataDir || DATA_DIR;
2323
2193
  this.driverResolver = opts.driverResolver || getDriver;
2324
2194
  this.defaultAgentEnvVarsProvider = opts.defaultAgentEnvVarsProvider || null;
@@ -2573,27 +2443,28 @@ Use read_history to catch up on the channels listed above, then stop. Read each
2573
2443
  }
2574
2444
  }
2575
2445
  async buildSpawnConfig(agentId, config) {
2446
+ const baseConfig = config.serverUrl === this.serverUrl ? config : { ...config, serverUrl: this.serverUrl };
2576
2447
  if (!this.defaultAgentEnvVarsProvider) {
2577
- return config;
2448
+ return baseConfig;
2578
2449
  }
2579
2450
  try {
2580
2451
  const defaultEnvVars = await this.defaultAgentEnvVarsProvider({
2581
- runtime: config.runtime,
2582
- model: config.model,
2583
- envVars: config.envVars
2452
+ runtime: baseConfig.runtime,
2453
+ model: baseConfig.model,
2454
+ envVars: baseConfig.envVars
2584
2455
  });
2585
2456
  if (!defaultEnvVars || Object.keys(defaultEnvVars).length === 0) {
2586
- return config;
2457
+ return baseConfig;
2587
2458
  }
2588
2459
  const mergedEnvVars = {
2589
2460
  ...defaultEnvVars,
2590
- ...config.envVars ?? {}
2461
+ ...baseConfig.envVars ?? {}
2591
2462
  };
2592
- if (this.sameEnvVars(mergedEnvVars, config.envVars)) {
2593
- return config;
2463
+ if (this.sameEnvVars(mergedEnvVars, baseConfig.envVars)) {
2464
+ return baseConfig;
2594
2465
  }
2595
2466
  return {
2596
- ...config,
2467
+ ...baseConfig,
2597
2468
  envVars: mergedEnvVars
2598
2469
  };
2599
2470
  } catch (error) {
@@ -2601,7 +2472,7 @@ Use read_history to catch up on the channels listed above, then stop. Read each
2601
2472
  logger.warn(
2602
2473
  `[Agent ${agentId}] Failed to resolve default runtime env vars \u2014 continuing without machine-level defaults (${reason})`
2603
2474
  );
2604
- return config;
2475
+ return baseConfig;
2605
2476
  }
2606
2477
  }
2607
2478
  sameEnvVars(left, right) {
@@ -2982,8 +2853,8 @@ Use read_history to catch up on the channels listed above, then stop. Read each
2982
2853
  case "tool_call": {
2983
2854
  this.flushPendingTrajectory(agentId);
2984
2855
  const toolName = event.name;
2985
- const inputSummary = driver.summarizeToolInput(toolName, event.input);
2986
- const detail = toolName === `${driver.mcpToolPrefix}check_messages` ? "Checking messages\u2026" : toolName === `${driver.mcpToolPrefix}send_message` ? "Sending message\u2026" : driver.toolDisplayName(toolName);
2856
+ const inputSummary = summarizeToolInput(toolName, event.input);
2857
+ const detail = getToolActivityLabel(toolName);
2987
2858
  this.broadcastActivity(agentId, "working", detail, [{ kind: "tool_start", toolName, toolInput: inputSummary }]);
2988
2859
  if (ap) ap.isIdle = false;
2989
2860
  break;
@@ -3278,7 +3149,6 @@ function resolveChatBridgePath(moduleUrl = import.meta.url) {
3278
3149
  function detectRuntimes() {
3279
3150
  const ids = [];
3280
3151
  const versions = {};
3281
- const cmd = process.platform === "win32" ? "where" : "which";
3282
3152
  for (const runtime of RUNTIMES) {
3283
3153
  try {
3284
3154
  const probe = getDriver(runtime.id).probe?.();
@@ -3289,15 +3159,16 @@ function detectRuntimes() {
3289
3159
  }
3290
3160
  } catch {
3291
3161
  }
3292
- try {
3293
- execSync2(`${cmd} ${runtime.binary}`, { stdio: "pipe" });
3162
+ const detectionBinaries = [runtime.binary];
3163
+ for (const binary of detectionBinaries) {
3164
+ const resolved = resolveCommandOnPath(binary);
3165
+ if (!resolved) continue;
3294
3166
  ids.push(runtime.id);
3295
- try {
3296
- const version = execSync2(`${runtime.binary} --version`, { stdio: "pipe", timeout: 5e3 }).toString().trim().split("\n")[0];
3167
+ const version = readCommandVersion(binary);
3168
+ if (version) {
3297
3169
  versions[runtime.id] = version;
3298
- } catch {
3299
3170
  }
3300
- } catch {
3171
+ break;
3301
3172
  }
3302
3173
  }
3303
3174
  return { ids, versions };
@@ -3344,6 +3215,7 @@ var DaemonCore = class {
3344
3215
  let connection;
3345
3216
  const agentManagerOptions = {
3346
3217
  dataDir: options.dataDir,
3218
+ serverUrl: options.serverUrl,
3347
3219
  defaultAgentEnvVarsProvider: options.defaultAgentEnvVarsProvider
3348
3220
  };
3349
3221
  this.agentManager = options.agentManagerFactory ? options.agentManagerFactory(this.chatBridgePath, (msg) => connection.send(msg), options.apiKey, agentManagerOptions) : new AgentProcessManager(this.chatBridgePath, (msg) => connection.send(msg), options.apiKey, agentManagerOptions);
package/dist/core.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  resolveChatBridgePath,
9
9
  resolveWorkspaceDirectoryPath,
10
10
  scanWorkspaceDirectories
11
- } from "./chunk-7RQ2H2AM.js";
11
+ } from "./chunk-72UW4SIL.js";
12
12
  import {
13
13
  subscribeDaemonLogs
14
14
  } from "./chunk-E6OOH3IC.js";
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  DAEMON_CLI_USAGE,
4
4
  DaemonCore,
5
5
  parseDaemonCliArgs
6
- } from "./chunk-7RQ2H2AM.js";
6
+ } from "./chunk-72UW4SIL.js";
7
7
  import "./chunk-E6OOH3IC.js";
8
8
 
9
9
  // src/index.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slock-ai/daemon",
3
- "version": "0.37.0",
3
+ "version": "0.37.1-alpha.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "slock-daemon": "dist/index.js"