@slock-ai/daemon 0.47.0 → 0.48.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.
@@ -640,6 +640,22 @@ var actionCardActionSchema = z.discriminatedUnion("type", [
640
640
  channelAddMemberOperationSchema
641
641
  ]);
642
642
 
643
+ // ../shared/src/translationLanguages.ts
644
+ var SUPPORTED_TRANSLATION_LANGUAGE_CODES = [
645
+ "en",
646
+ "zh-cn",
647
+ "zh-tw",
648
+ "ja",
649
+ "ko",
650
+ "es",
651
+ "fr",
652
+ "de",
653
+ "pt-br"
654
+ ];
655
+ var SUPPORTED_TRANSLATION_LANGUAGE_SET = new Set(
656
+ SUPPORTED_TRANSLATION_LANGUAGE_CODES
657
+ );
658
+
643
659
  // ../shared/src/testing/failpoints.ts
644
660
  var NoopFailpointRegistry = class {
645
661
  get enabled() {
@@ -750,7 +766,7 @@ var DISPLAY_PLAN_CONFIG = {
750
766
  };
751
767
 
752
768
  // src/agentProcessManager.ts
753
- import { mkdirSync as mkdirSync4, readdirSync as readdirSync2, statSync as statSync2, writeFileSync as writeFileSync7 } from "fs";
769
+ import { mkdirSync as mkdirSync4, readdirSync as readdirSync3, statSync as statSync2, writeFileSync as writeFileSync7 } from "fs";
754
770
  import { mkdir, writeFile, access, readdir as readdir2, stat as stat2, readFile, rm as rm2 } from "fs/promises";
755
771
  import { createHash as createHash2 } from "crypto";
756
772
  import path11 from "path";
@@ -846,22 +862,23 @@ Use the \`slock\` CLI for chat / task / attachment operations. The daemon inject
846
862
  6. **\`slock thread unfollow\`** \u2014 Stop receiving ordinary delivery for a thread you no longer need to follow. This only affects your own agent attention state.
847
863
  7. **\`slock message read\`** \u2014 Read past messages from a channel, DM, or thread. Supports \`before\` / \`after\` pagination and \`around\` for centered context.
848
864
  8. **\`slock message search\`** \u2014 Search messages visible to you, then inspect a hit with \`slock message read\`.
849
- 9. **\`slock task list\`** \u2014 View a channel's task board.
850
- 10. **\`slock task create\`** \u2014 Create new task-messages in a channel (supports batch titles; equivalent to sending a new message and publishing it as a task-message, not claiming it for yourself).
851
- 11. **\`slock task claim\`** \u2014 Claim tasks by number or message ID (supports batch, handles conflicts).
852
- 12. **\`slock task unclaim\`** \u2014 Release your claim on a task.
853
- 13. **\`slock task update\`** \u2014 Change a task's status (e.g. to in_review or done).
854
- 14. **\`slock attachment upload\`** \u2014 Upload a file to attach to a message. Uses content sniffing for image previews; pass \`--mime-type\` only when you know the exact type. Returns an attachment ID to pass to \`slock message send\`.
855
- 15. **\`slock attachment view\`** \u2014 Download an attached file by its attachment ID so you can inspect it locally.
856
- 16. **\`slock profile show\`** \u2014 Show your own profile, or another visible profile via \`@handle\`. Mirrors the canonical Slock profile view.
857
- 17. **\`slock profile update\`** \u2014 Update your own profile. Supports \`--avatar-file <path>\`, \`--display-name <name>\`, and \`--description <text>\`. Values must be non-empty. Provide at least one flag per call; multiple flags can be combined.
858
- 18. **\`slock reminder schedule\`** \u2014 Schedule a reminder for yourself later, at a specific time, or on a recurring cadence.
859
- 19. **\`slock reminder list\`** \u2014 List your reminders, including lifecycle history for each reminder.
860
- 20. **\`slock reminder snooze\`** \u2014 Push a reminder later without replacing it.
861
- 21. **\`slock reminder update\`** \u2014 Change a reminder's title, schedule, or recurrence without creating a new reminder.
862
- 22. **\`slock reminder cancel\`** \u2014 Cancel one of your reminders by ID.
863
- 23. **\`slock reminder log\`** \u2014 Show the event log for a reminder, including fires, dismissals, and reschedules.
864
- 24. **\`slock action prepare\`** \u2014 Prepare an action card for a human to commit (B-mode quick-commit shortcut). Posts a card the human can click to execute the action under their own identity. Pass \`--target <ch>\` and pipe the action JSON on stdin (variants: \`channel:create\`, \`agent:create\`).
865
+ 9. **\`slock message react\`** \u2014 Add or remove your reaction on a message. Use sparingly: prefer acknowledgement/follow-up signals like \u{1F440}, and do not auto-react to every merge, deploy, or task completion with celebratory emoji.
866
+ 10. **\`slock task list\`** \u2014 View a channel's task board.
867
+ 11. **\`slock task create\`** \u2014 Create new task-messages in a channel (supports batch titles; equivalent to sending a new message and publishing it as a task-message, not claiming it for yourself).
868
+ 12. **\`slock task claim\`** \u2014 Claim tasks by number or message ID (supports batch, handles conflicts).
869
+ 13. **\`slock task unclaim\`** \u2014 Release your claim on a task.
870
+ 14. **\`slock task update\`** \u2014 Change a task's status (e.g. to in_review or done).
871
+ 15. **\`slock attachment upload\`** \u2014 Upload a file to attach to a message. Uses content sniffing for image previews; pass \`--mime-type\` only when you know the exact type. Returns an attachment ID to pass to \`slock message send\`.
872
+ 16. **\`slock attachment view\`** \u2014 Download an attached file by its attachment ID so you can inspect it locally.
873
+ 17. **\`slock profile show\`** \u2014 Show your own profile, or another visible profile via \`@handle\`. Mirrors the canonical Slock profile view.
874
+ 18. **\`slock profile update\`** \u2014 Update your own profile. Supports \`--avatar-file <path>\`, \`--display-name <name>\`, and \`--description <text>\`. Values must be non-empty. Provide at least one flag per call; multiple flags can be combined.
875
+ 19. **\`slock reminder schedule\`** \u2014 Schedule a reminder for yourself later, at a specific time, or on a recurring cadence.
876
+ 20. **\`slock reminder list\`** \u2014 List your reminders, including lifecycle history for each reminder.
877
+ 21. **\`slock reminder snooze\`** \u2014 Push a reminder later without replacing it.
878
+ 22. **\`slock reminder update\`** \u2014 Change a reminder's title, schedule, or recurrence without creating a new reminder.
879
+ 23. **\`slock reminder cancel\`** \u2014 Cancel one of your reminders by ID.
880
+ 24. **\`slock reminder log\`** \u2014 Show the event log for a reminder, including fires, dismissals, and reschedules.
881
+ 25. **\`slock action prepare\`** \u2014 Prepare an action card for a human to commit (B-mode quick-commit shortcut). Posts a card the human can click to execute the action under their own identity. Pass \`--target <ch>\` and pipe the action JSON on stdin (variants: \`channel:create\`, \`agent:create\`).
865
882
 
866
883
  The CLI prints human-readable canonical text on success (matching the format you see in received messages and history). On failure it prints JSON to stderr:
867
884
  - failure \u2192 stderr \`{"ok":false,"code":"...","message":"..."}\` with non-zero exit
@@ -1772,7 +1789,7 @@ var ClaudeDriver = class {
1772
1789
 
1773
1790
  // src/drivers/codex.ts
1774
1791
  import { spawn as spawn2, execSync } from "child_process";
1775
- import { existsSync as existsSync3, readFileSync as readFileSync2 } from "fs";
1792
+ import { existsSync as existsSync3, readFileSync as readFileSync2, readdirSync as readdirSync2 } from "fs";
1776
1793
  import os2 from "os";
1777
1794
  import path4 from "path";
1778
1795
  function getCodexNotificationErrorMessage(params) {
@@ -1801,11 +1818,29 @@ function ensureGitRepoForCodex(workingDirectory, deps = {}) {
1801
1818
  );
1802
1819
  }
1803
1820
  var CODEX_DESKTOP_BUNDLE_PATH = "/Applications/Codex.app/Contents/Resources/codex";
1821
+ function resolveWindowsSandboxRunner(deps = {}) {
1822
+ const homeDir = deps.homeDir ?? os2.homedir();
1823
+ const sandboxBinDir = path4.join(homeDir, ".codex", ".sandbox-bin");
1824
+ if (!(deps.existsSyncFn ?? existsSync3)(sandboxBinDir)) return null;
1825
+ try {
1826
+ const files = readdirSync2(sandboxBinDir);
1827
+ const runners = files.filter((f) => f.startsWith("codex-command-runner") && f.endsWith(".exe")).sort((a, b) => b.localeCompare(a));
1828
+ if (runners.length > 0) return path4.join(sandboxBinDir, runners[0]);
1829
+ } catch {
1830
+ }
1831
+ return null;
1832
+ }
1804
1833
  function resolveCodexCommand(deps = {}) {
1805
1834
  const pathCommand = resolveCommandOnPath("codex", deps);
1806
1835
  if (pathCommand) return pathCommand;
1807
- if ((deps.platform ?? process.platform) !== "darwin") return null;
1808
- return firstExistingPath([CODEX_DESKTOP_BUNDLE_PATH], deps);
1836
+ const platform = deps.platform ?? process.platform;
1837
+ if (platform === "darwin") {
1838
+ return firstExistingPath([CODEX_DESKTOP_BUNDLE_PATH], deps);
1839
+ }
1840
+ if (platform === "win32") {
1841
+ return resolveWindowsSandboxRunner(deps);
1842
+ }
1843
+ return null;
1809
1844
  }
1810
1845
  function probeCodex(deps = {}) {
1811
1846
  if ((deps.platform ?? process.platform) === "win32") {
@@ -1846,6 +1881,13 @@ function resolveCodexSpawn(commandArgs, deps = {}) {
1846
1881
  }
1847
1882
  }
1848
1883
  if (!codexEntry) {
1884
+ const sandboxRunner = resolveWindowsSandboxRunner(deps);
1885
+ if (sandboxRunner) {
1886
+ return {
1887
+ command: sandboxRunner,
1888
+ args: commandArgs
1889
+ };
1890
+ }
1849
1891
  throw new Error(
1850
1892
  "Cannot resolve Codex CLI entry point on Windows. Ensure @openai/codex is installed globally via npm (npm i -g @openai/codex)."
1851
1893
  );
@@ -3772,7 +3814,7 @@ function findSessionJsonl(root, predicate) {
3772
3814
  if (depth < 0 || visited >= maxEntries) return null;
3773
3815
  let entries;
3774
3816
  try {
3775
- entries = readdirSync2(dir, { withFileTypes: true }).sort((a, b) => b.name.localeCompare(a.name));
3817
+ entries = readdirSync3(dir, { withFileTypes: true }).sort((a, b) => b.name.localeCompare(a.name));
3776
3818
  } catch {
3777
3819
  return null;
3778
3820
  }
@@ -7120,7 +7162,7 @@ function acquireDaemonMachineLock(options) {
7120
7162
  }
7121
7163
 
7122
7164
  // src/localTraceSink.ts
7123
- import { appendFileSync, mkdirSync as mkdirSync6, readdirSync as readdirSync3, rmSync as rmSync3, statSync as statSync4, writeFileSync as writeFileSync9 } from "fs";
7165
+ import { appendFileSync, mkdirSync as mkdirSync6, readdirSync as readdirSync4, rmSync as rmSync3, statSync as statSync4, writeFileSync as writeFileSync9 } from "fs";
7124
7166
  import path13 from "path";
7125
7167
  var DEFAULT_MAX_FILE_BYTES = 5 * 1024 * 1024;
7126
7168
  var DEFAULT_MAX_FILE_AGE_MS = 5 * 60 * 1e3;
@@ -7198,7 +7240,7 @@ var LocalRotatingTraceSink = class {
7198
7240
  }
7199
7241
  }
7200
7242
  pruneOldFiles() {
7201
- const files = readdirSync3(this.traceDir).filter((name) => name.startsWith("daemon-trace-") && name.endsWith(".jsonl")).sort();
7243
+ const files = readdirSync4(this.traceDir).filter((name) => name.startsWith("daemon-trace-") && name.endsWith(".jsonl")).sort();
7202
7244
  const excess = files.length - this.maxFiles;
7203
7245
  if (excess <= 0) return;
7204
7246
  for (const file of files.slice(0, excess)) {
package/dist/cli/index.js CHANGED
@@ -14016,6 +14016,22 @@ function validateActionCardAction(action) {
14016
14016
  return null;
14017
14017
  }
14018
14018
 
14019
+ // ../shared/src/translationLanguages.ts
14020
+ var SUPPORTED_TRANSLATION_LANGUAGE_CODES = [
14021
+ "en",
14022
+ "zh-cn",
14023
+ "zh-tw",
14024
+ "ja",
14025
+ "ko",
14026
+ "es",
14027
+ "fr",
14028
+ "de",
14029
+ "pt-br"
14030
+ ];
14031
+ var SUPPORTED_TRANSLATION_LANGUAGE_SET = new Set(
14032
+ SUPPORTED_TRANSLATION_LANGUAGE_CODES
14033
+ );
14034
+
14019
14035
  // ../shared/src/testing/failpoints.ts
14020
14036
  var NoopFailpointRegistry = class {
14021
14037
  get enabled() {
@@ -14206,8 +14222,14 @@ var ApiClient = class {
14206
14222
  if (res.ok) {
14207
14223
  data = parsed;
14208
14224
  } else {
14209
- error48 = parsed?.error ?? `HTTP ${res.status}`;
14210
- errorCode = parsed?.errorCode ?? null;
14225
+ const body = parsed;
14226
+ if (res.status === 403 && body?.requiredScope) {
14227
+ errorCode = "SCOPE_DENIED";
14228
+ error48 = `Permission denied. The human has revoked the \`${body.requiredScope}\` capability for this agent under the agent profile's Permissions tab, so this command can't run. If you need it, ask the human to re-enable the corresponding toggle.`;
14229
+ } else {
14230
+ error48 = body?.error ?? `HTTP ${res.status}`;
14231
+ errorCode = body?.errorCode ?? null;
14232
+ }
14211
14233
  }
14212
14234
  } else if (!res.ok) {
14213
14235
  error48 = `HTTP ${res.status}`;
@@ -15004,6 +15026,50 @@ function registerSearchCommand(parent) {
15004
15026
  });
15005
15027
  }
15006
15028
 
15029
+ // src/commands/message/react.ts
15030
+ function normalizeReactionEmoji(value) {
15031
+ const emoji3 = value.trim();
15032
+ if (!emoji3 || emoji3.length > 16 || /\s/.test(emoji3)) {
15033
+ throw new Error("A single reaction emoji is required");
15034
+ }
15035
+ return emoji3;
15036
+ }
15037
+ function registerReactCommand(parent) {
15038
+ parent.command("react").description("Add or remove your reaction on a message").requiredOption("--message-id <id>", "Message UUID to react to").requiredOption("--emoji <emoji>", "Reaction emoji").option("--remove", "Remove your reaction instead of adding it").addHelpText("after", [
15039
+ "",
15040
+ "Agent guidance:",
15041
+ " Use reactions sparingly. Prefer acknowledgement/follow-up signals like \u{1F440}.",
15042
+ " Do not auto-react to every merge, deploy, or task completion with celebratory emoji."
15043
+ ].join("\n")).action(async (opts) => {
15044
+ let ctx;
15045
+ try {
15046
+ ctx = loadAgentContext();
15047
+ } catch (err) {
15048
+ if (err instanceof AgentBootstrapError) fail(err.code, err.message);
15049
+ throw err;
15050
+ }
15051
+ let emoji3;
15052
+ try {
15053
+ emoji3 = normalizeReactionEmoji(opts.emoji);
15054
+ } catch (err) {
15055
+ fail("INVALID_REACTION", err instanceof Error ? err.message : "Invalid reaction emoji");
15056
+ }
15057
+ const client = new ApiClient(ctx);
15058
+ const res = await client.request(
15059
+ opts.remove ? "DELETE" : "POST",
15060
+ `/internal/agent/${encodeURIComponent(ctx.agentId)}/messages/${encodeURIComponent(opts.messageId)}/reactions`,
15061
+ { emoji: emoji3 }
15062
+ );
15063
+ if (!res.ok) {
15064
+ const code = res.status >= 500 ? "SERVER_5XX" : "REACT_FAILED";
15065
+ fail(code, res.error ?? `HTTP ${res.status}`);
15066
+ }
15067
+ const verb = opts.remove ? "removed from" : "added to";
15068
+ process.stdout.write(`Reaction ${emoji3} ${verb} message ${opts.messageId.slice(0, 8)}.
15069
+ `);
15070
+ });
15071
+ }
15072
+
15007
15073
  // src/commands/attachment/upload.ts
15008
15074
  import { existsSync, statSync, readFileSync } from "fs";
15009
15075
  import { basename } from "path";
@@ -16041,6 +16107,7 @@ registerSendCommand(messageCmd);
16041
16107
  registerCheckCommand(messageCmd);
16042
16108
  registerReadCommand(messageCmd);
16043
16109
  registerSearchCommand(messageCmd);
16110
+ registerReactCommand(messageCmd);
16044
16111
  var attachmentCmd = program.command("attachment").description("Attachment operations");
16045
16112
  registerAttachmentUploadCommand(attachmentCmd);
16046
16113
  registerAttachmentViewCommand(attachmentCmd);
package/dist/core.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  resolveSlockCliPath,
10
10
  resolveWorkspaceDirectoryPath,
11
11
  scanWorkspaceDirectories
12
- } from "./chunk-77TJIZSE.js";
12
+ } from "./chunk-EDE2E6QR.js";
13
13
  import {
14
14
  subscribeDaemonLogs
15
15
  } from "./chunk-B7XIMLOT.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-77TJIZSE.js";
6
+ } from "./chunk-EDE2E6QR.js";
7
7
  import "./chunk-B7XIMLOT.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.47.0",
3
+ "version": "0.48.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "slock-daemon": "dist/index.js"