@slock-ai/daemon 0.55.3 → 0.55.5

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/cli/index.js CHANGED
@@ -294,6 +294,10 @@ var ApiClient = class {
294
294
  if (suffix === "/send") return "/internal/agent-api/send";
295
295
  if (suffix.startsWith("/history")) return `/internal/agent-api/history${suffix.slice("/history".length)}`;
296
296
  if (suffix.startsWith("/search")) return `/internal/agent-api/search${suffix.slice("/search".length)}`;
297
+ const messageResolve = /^\/messages\/([^/]+)\/resolve$/.exec(suffix);
298
+ if (messageResolve) {
299
+ return `/internal/agent-api/messages/${messageResolve[1]}/resolve`;
300
+ }
297
301
  if (suffix.startsWith("/channel-members")) return `/internal/agent-api/channel-members${suffix.slice("/channel-members".length)}`;
298
302
  if (suffix === "/knowledge" || suffix.startsWith("/knowledge?")) {
299
303
  return `/internal/agent-api/knowledge${suffix.slice("/knowledge".length)}`;
@@ -15214,7 +15218,8 @@ var RUNTIMES = [
15214
15218
  { id: "copilot", displayName: "Copilot CLI", binary: "copilot", supported: true },
15215
15219
  { id: "cursor", displayName: "Cursor CLI", binary: "cursor-agent", supported: true },
15216
15220
  { id: "gemini", displayName: "Gemini CLI", binary: "gemini", supported: true },
15217
- { id: "opencode", displayName: "OpenCode", binary: "opencode", supported: true }
15221
+ { id: "opencode", displayName: "OpenCode", binary: "opencode", supported: true },
15222
+ { id: "pi", displayName: "Pi CLI", binary: "pi", supported: true }
15218
15223
  ];
15219
15224
  function getRuntimeDisplayName(id) {
15220
15225
  return RUNTIMES.find((r) => r.id === id)?.displayName ?? id;
@@ -15694,7 +15699,7 @@ function toKnowledgeErrorCode(errorCode2, status) {
15694
15699
  var knowledgeGetCommand = defineCommand(
15695
15700
  {
15696
15701
  name: "get",
15697
- description: "Fetch an agent knowledge topic from the current server",
15702
+ description: "Fetch a Slock Manual for Agents topic from the current server",
15698
15703
  arguments: ["<topic>"],
15699
15704
  options: [
15700
15705
  {
@@ -15722,7 +15727,7 @@ var knowledgeGetCommand = defineCommand(
15722
15727
  throw new CliError({
15723
15728
  code: toKnowledgeErrorCode(res.errorCode, res.status),
15724
15729
  message: res.error ?? `HTTP ${res.status}`,
15725
- suggestedNextAction: res.suggestedNextAction ?? (res.errorCode === "knowledge_not_found" ? "Run `slock knowledge get index` to see all available knowledge topics." : void 0)
15730
+ suggestedNextAction: res.suggestedNextAction ?? (res.errorCode === "knowledge_not_found" ? "Run `slock manual get index` to see all available manual topics." : void 0)
15726
15731
  });
15727
15732
  }
15728
15733
  const data = res.data;
@@ -16462,6 +16467,32 @@ function buildReadPath(agentId, opts) {
16462
16467
  if (opts.limit !== void 0) params.set("limit", String(opts.limit));
16463
16468
  return `/internal/agent/${encodeURIComponent(agentId)}/history?${params.toString()}`;
16464
16469
  }
16470
+ function mapReadFailure(res) {
16471
+ if (res.errorCode === "NOT_FOUND") {
16472
+ return new CliError({
16473
+ code: "NOT_FOUND",
16474
+ message: res.error ?? `HTTP ${res.status}`,
16475
+ suggestedNextAction: res.suggestedNextAction ?? void 0
16476
+ });
16477
+ }
16478
+ if (res.errorCode === "AMBIGUOUS_ID") {
16479
+ return new CliError({
16480
+ code: "AMBIGUOUS_ID",
16481
+ message: res.error ?? `HTTP ${res.status}`,
16482
+ suggestedNextAction: res.suggestedNextAction ?? "Use the full message UUID instead of the 8-character short id."
16483
+ });
16484
+ }
16485
+ if (res.errorCode === "INVALID_ARG") {
16486
+ return new CliError({
16487
+ code: "INVALID_ARG",
16488
+ message: res.error ?? `HTTP ${res.status}`
16489
+ });
16490
+ }
16491
+ return new CliError({
16492
+ code: res.status >= 500 ? "SERVER_5XX" : "READ_FAILED",
16493
+ message: res.error ?? `HTTP ${res.status}`
16494
+ });
16495
+ }
16465
16496
  function validateReadOpts(opts) {
16466
16497
  const channel = opts.channel?.trim();
16467
16498
  if (!channel) {
@@ -16470,13 +16501,13 @@ function validateReadOpts(opts) {
16470
16501
  message: "--channel is required"
16471
16502
  });
16472
16503
  }
16473
- const before = parsePositiveInt("before", opts.before);
16474
- const after = parsePositiveInt("after", opts.after);
16475
16504
  const limit = parsePositiveInt("limit", opts.limit);
16505
+ const before = opts.before?.trim();
16506
+ const after = opts.after?.trim();
16476
16507
  return {
16477
16508
  channel,
16478
- ...before !== void 0 ? { before } : {},
16479
- ...after !== void 0 ? { after } : {},
16509
+ ...before ? { before } : {},
16510
+ ...after ? { after } : {},
16480
16511
  ...opts.around !== void 0 ? { around: opts.around } : {},
16481
16512
  ...limit !== void 0 ? { limit } : {}
16482
16513
  };
@@ -16487,9 +16518,9 @@ var messageReadCommand = defineCommand(
16487
16518
  description: "Read message history for a channel, DM, or thread",
16488
16519
  options: [
16489
16520
  { flags: "--channel <target>", description: "Target: '#channel', 'dm:@peer', '#channel:threadId', 'dm:@peer:threadId'" },
16490
- { flags: "--before <seq>", description: "Return messages strictly before this seq (paginate backwards)" },
16491
- { flags: "--after <seq>", description: "Return messages strictly after this seq (paginate forwards)" },
16492
- { flags: "--around <idOrSeq>", description: "Center the window on this messageId or seq" },
16521
+ { flags: "--before <idOrSeq>", description: "Return messages strictly before this message id or seq anchor" },
16522
+ { flags: "--after <idOrSeq>", description: "Return messages strictly after this message id or seq anchor" },
16523
+ { flags: "--around <idOrSeq>", description: "Center the window on this message id or seq anchor" },
16493
16524
  { flags: "--limit <n>", description: "Max messages to return (server default applies if omitted)" }
16494
16525
  ]
16495
16526
  },
@@ -16502,10 +16533,7 @@ var messageReadCommand = defineCommand(
16502
16533
  buildReadPath(agentContext.agentId, readOpts)
16503
16534
  );
16504
16535
  if (!res.ok) {
16505
- throw new CliError({
16506
- code: res.status >= 500 ? "SERVER_5XX" : "READ_FAILED",
16507
- message: res.error ?? `HTTP ${res.status}`
16508
- });
16536
+ throw mapReadFailure(res);
16509
16537
  }
16510
16538
  writeText(
16511
16539
  ctx.io,
@@ -16639,6 +16667,77 @@ function registerSearchCommand(parent, runtimeOptions) {
16639
16667
  registerCliCommand(parent, messageSearchCommand, runtimeOptions);
16640
16668
  }
16641
16669
 
16670
+ // src/commands/message/resolve.ts
16671
+ function buildResolvePath(agentId, id) {
16672
+ return `/internal/agent/${encodeURIComponent(agentId)}/messages/${encodeURIComponent(id)}/resolve`;
16673
+ }
16674
+ function mapResolveError(res) {
16675
+ const message = res.error ?? `HTTP ${res.status}`;
16676
+ if (res.errorCode === "AMBIGUOUS_ID") {
16677
+ return {
16678
+ code: "AMBIGUOUS_ID",
16679
+ message,
16680
+ suggestedNextAction: "Use the full message UUID instead of the 8-character short id."
16681
+ };
16682
+ }
16683
+ if (res.errorCode === "NOT_FOUND" || res.status === 404) {
16684
+ return {
16685
+ code: "NOT_FOUND",
16686
+ message,
16687
+ suggestedNextAction: "Use slock message search to find the message, or slock message read --around only when you want nearby context rather than proof that this id exists."
16688
+ };
16689
+ }
16690
+ if (res.errorCode === "INVALID_ARG" || res.status === 400) {
16691
+ return { code: "INVALID_ARG", message };
16692
+ }
16693
+ return {
16694
+ code: res.status >= 500 ? "SERVER_5XX" : "READ_FAILED",
16695
+ message
16696
+ };
16697
+ }
16698
+ var messageResolveCommand = defineCommand(
16699
+ {
16700
+ name: "resolve",
16701
+ description: "Resolve a message id exactly and print the canonical message",
16702
+ arguments: ["<id>"]
16703
+ },
16704
+ async (ctx, rawId) => {
16705
+ const id = rawId?.trim();
16706
+ if (!id) {
16707
+ throw new CliError({
16708
+ code: "INVALID_ARG",
16709
+ message: "<id> is required"
16710
+ });
16711
+ }
16712
+ const agentContext = ctx.loadAgentContext();
16713
+ const client = ctx.createApiClient(agentContext);
16714
+ const res = await client.request(
16715
+ "GET",
16716
+ buildResolvePath(agentContext.agentId, id)
16717
+ );
16718
+ if (!res.ok) {
16719
+ const mapped = mapResolveError(res);
16720
+ throw new CliError(mapped);
16721
+ }
16722
+ const message = res.data?.message;
16723
+ if (!message) {
16724
+ throw new CliError({
16725
+ code: "INVALID_JSON_RESPONSE",
16726
+ message: "Missing message in resolve response"
16727
+ });
16728
+ }
16729
+ writeText(ctx.io, `${formatMessages([{
16730
+ ...message,
16731
+ parent_channel_type: message.parent_channel_type ?? void 0,
16732
+ parent_channel_name: message.parent_channel_name ?? void 0
16733
+ }])}
16734
+ `);
16735
+ }
16736
+ );
16737
+ function registerResolveCommand(parent, runtimeOptions) {
16738
+ registerCliCommand(parent, messageResolveCommand, runtimeOptions);
16739
+ }
16740
+
16642
16741
  // src/commands/message/react.ts
16643
16742
  function normalizeReactionEmoji(value) {
16644
16743
  const emoji3 = value.trim();
@@ -18476,13 +18575,16 @@ var threadCmd = program.command("thread").description("Thread attention operatio
18476
18575
  registerThreadUnfollowCommand(threadCmd);
18477
18576
  var serverCmd = program.command("server").description("Server / workspace introspection");
18478
18577
  registerServerInfoCommand(serverCmd);
18479
- var knowledgeCmd = program.command("knowledge").description("Agent knowledge retrieval (canonical Slock product knowledge topics)");
18578
+ var manualCmd = program.command("manual").description("Slock Manual for Agents retrieval (canonical operating topics)");
18579
+ registerKnowledgeGetCommand(manualCmd);
18580
+ var knowledgeCmd = program.command("knowledge").description("Legacy alias for `slock manual`");
18480
18581
  registerKnowledgeGetCommand(knowledgeCmd);
18481
18582
  var messageCmd = program.command("message").description("Message operations");
18482
18583
  registerSendCommand(messageCmd);
18483
18584
  registerCheckCommand(messageCmd);
18484
18585
  registerReadCommand(messageCmd);
18485
18586
  registerSearchCommand(messageCmd);
18587
+ registerResolveCommand(messageCmd);
18486
18588
  registerReactCommand(messageCmd);
18487
18589
  var attachmentCmd = program.command("attachment").description("Attachment operations");
18488
18590
  registerAttachmentUploadCommand(attachmentCmd);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@slock-ai/cli",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "type": "module"
5
5
  }
package/dist/core.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  resolveSlockCliPath,
10
10
  resolveWorkspaceDirectoryPath,
11
11
  scanWorkspaceDirectories
12
- } from "./chunk-DLB2KVD7.js";
12
+ } from "./chunk-NXNXMFLC.js";
13
13
  import {
14
14
  subscribeDaemonLogs
15
15
  } from "./chunk-M2KQBJR3.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-DLB2KVD7.js";
6
+ } from "./chunk-NXNXMFLC.js";
7
7
  import "./chunk-M2KQBJR3.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.55.3",
3
+ "version": "0.55.5",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "slock-daemon": "dist/index.js"