clawdbot 2026.1.4-1 → 2026.1.5-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.
Files changed (116) hide show
  1. package/CHANGELOG.md +32 -6
  2. package/README.md +26 -1
  3. package/dist/agents/pi-embedded-runner.js +2 -0
  4. package/dist/agents/pi-embedded-subscribe.js +18 -3
  5. package/dist/agents/pi-tools.js +45 -6
  6. package/dist/agents/tools/browser-tool.js +38 -89
  7. package/dist/agents/tools/cron-tool.js +8 -8
  8. package/dist/agents/workspace.js +8 -1
  9. package/dist/auto-reply/command-detection.js +26 -0
  10. package/dist/auto-reply/reply/agent-runner.js +15 -8
  11. package/dist/auto-reply/reply/commands.js +36 -25
  12. package/dist/auto-reply/reply/directive-handling.js +4 -2
  13. package/dist/auto-reply/reply/directives.js +12 -0
  14. package/dist/auto-reply/reply/session-updates.js +2 -4
  15. package/dist/auto-reply/reply.js +26 -4
  16. package/dist/browser/config.js +22 -4
  17. package/dist/browser/profiles-service.js +3 -1
  18. package/dist/browser/profiles.js +14 -3
  19. package/dist/canvas-host/a2ui/.bundle.hash +2 -0
  20. package/dist/cli/gateway-cli.js +2 -2
  21. package/dist/cli/profile.js +81 -0
  22. package/dist/cli/program.js +10 -1
  23. package/dist/cli/run-main.js +33 -0
  24. package/dist/commands/configure.js +5 -0
  25. package/dist/commands/onboard-providers.js +1 -1
  26. package/dist/commands/setup.js +4 -1
  27. package/dist/config/defaults.js +56 -0
  28. package/dist/config/io.js +47 -6
  29. package/dist/config/paths.js +2 -2
  30. package/dist/config/port-defaults.js +32 -0
  31. package/dist/config/sessions.js +3 -2
  32. package/dist/config/validation.js +2 -2
  33. package/dist/config/zod-schema.js +16 -0
  34. package/dist/discord/monitor.js +75 -266
  35. package/dist/entry.js +16 -0
  36. package/dist/gateway/call.js +8 -1
  37. package/dist/gateway/server-methods/chat.js +1 -1
  38. package/dist/gateway/server.js +14 -3
  39. package/dist/index.js +2 -2
  40. package/dist/infra/control-ui-assets.js +118 -0
  41. package/dist/infra/dotenv.js +15 -0
  42. package/dist/infra/shell-env.js +79 -0
  43. package/dist/infra/system-events.js +50 -23
  44. package/dist/macos/relay.js +8 -2
  45. package/dist/telegram/bot.js +24 -1
  46. package/dist/utils.js +8 -2
  47. package/dist/web/auto-reply.js +18 -21
  48. package/dist/web/inbound.js +5 -1
  49. package/dist/web/qr-image.js +4 -4
  50. package/dist/web/session.js +2 -3
  51. package/docs/agent.md +0 -2
  52. package/docs/assets/markdown.css +4 -1
  53. package/docs/audio.md +0 -2
  54. package/docs/clawd.md +0 -2
  55. package/docs/configuration.md +62 -3
  56. package/docs/docs.json +9 -1
  57. package/docs/faq.md +32 -7
  58. package/docs/gateway.md +28 -0
  59. package/docs/images.md +0 -2
  60. package/docs/index.md +2 -4
  61. package/docs/mac/icon.md +1 -1
  62. package/docs/nix.md +57 -11
  63. package/docs/onboarding.md +0 -2
  64. package/docs/refactor/webagent-session.md +0 -2
  65. package/docs/research/memory.md +1 -1
  66. package/docs/skills.md +0 -2
  67. package/docs/templates/AGENTS.md +2 -2
  68. package/docs/tools.md +15 -0
  69. package/docs/whatsapp.md +2 -0
  70. package/package.json +9 -16
  71. package/dist/control-ui/assets/index-BFID3yAA.css +0 -1
  72. package/dist/control-ui/assets/index-CE_axlTS.js +0 -2235
  73. package/dist/control-ui/assets/index-CE_axlTS.js.map +0 -1
  74. package/dist/control-ui/index.html +0 -15
  75. package/dist/daemon/constants.js +0 -10
  76. package/dist/daemon/launchd.js +0 -276
  77. package/dist/daemon/legacy.js +0 -63
  78. package/dist/daemon/program-args.js +0 -76
  79. package/dist/daemon/schtasks.js +0 -257
  80. package/dist/daemon/service.js +0 -60
  81. package/dist/daemon/systemd.js +0 -266
  82. package/dist/imessage/client.js +0 -165
  83. package/dist/imessage/index.js +0 -3
  84. package/dist/imessage/monitor.js +0 -272
  85. package/dist/imessage/probe.js +0 -26
  86. package/dist/imessage/send.js +0 -83
  87. package/dist/imessage/targets.js +0 -176
  88. package/dist/signal/client.js +0 -134
  89. package/dist/signal/daemon.js +0 -69
  90. package/dist/signal/index.js +0 -3
  91. package/dist/signal/monitor.js +0 -336
  92. package/dist/signal/probe.js +0 -46
  93. package/dist/signal/send.js +0 -91
  94. package/dist/slack/actions.js +0 -97
  95. package/dist/slack/index.js +0 -5
  96. package/dist/slack/monitor.js +0 -1029
  97. package/dist/slack/probe.js +0 -47
  98. package/dist/slack/send.js +0 -131
  99. package/dist/slack/token.js +0 -10
  100. package/dist/tui/commands.js +0 -74
  101. package/dist/tui/components/assistant-message.js +0 -16
  102. package/dist/tui/components/chat-log.js +0 -92
  103. package/dist/tui/components/custom-editor.js +0 -53
  104. package/dist/tui/components/selectors.js +0 -8
  105. package/dist/tui/components/tool-execution.js +0 -111
  106. package/dist/tui/components/user-message.js +0 -17
  107. package/dist/tui/gateway-chat.js +0 -140
  108. package/dist/tui/layout.js +0 -41
  109. package/dist/tui/message-list.js +0 -57
  110. package/dist/tui/theme/theme.js +0 -80
  111. package/dist/tui/theme.js +0 -25
  112. package/dist/tui/tui.js +0 -708
  113. package/dist/wizard/clack-prompter.js +0 -56
  114. package/dist/wizard/onboarding.js +0 -452
  115. package/dist/wizard/prompts.js +0 -6
  116. package/dist/wizard/session.js +0 -203
@@ -1,140 +0,0 @@
1
- import { randomUUID } from "node:crypto";
2
- import { loadConfig, resolveGatewayPort } from "../config/config.js";
3
- import { GatewayClient } from "../gateway/client.js";
4
- import { PROTOCOL_VERSION, } from "../gateway/protocol/index.js";
5
- import { VERSION } from "../version.js";
6
- export class GatewayChatClient {
7
- client;
8
- readyPromise;
9
- resolveReady;
10
- connection;
11
- hello;
12
- onEvent;
13
- onConnected;
14
- onDisconnected;
15
- onGap;
16
- constructor(opts) {
17
- const resolved = resolveGatewayConnection(opts);
18
- this.connection = resolved;
19
- this.readyPromise = new Promise((resolve) => {
20
- this.resolveReady = resolve;
21
- });
22
- this.client = new GatewayClient({
23
- url: resolved.url,
24
- token: resolved.token,
25
- password: resolved.password,
26
- clientName: "clawdbot-tui",
27
- clientVersion: VERSION,
28
- platform: process.platform,
29
- mode: "tui",
30
- instanceId: randomUUID(),
31
- minProtocol: PROTOCOL_VERSION,
32
- maxProtocol: PROTOCOL_VERSION,
33
- onHelloOk: (hello) => {
34
- this.hello = hello;
35
- this.resolveReady?.();
36
- this.onConnected?.();
37
- },
38
- onEvent: (evt) => {
39
- this.onEvent?.({
40
- event: evt.event,
41
- payload: evt.payload,
42
- seq: evt.seq,
43
- });
44
- },
45
- onClose: (_code, reason) => {
46
- this.onDisconnected?.(reason);
47
- },
48
- onGap: (info) => {
49
- this.onGap?.(info);
50
- },
51
- });
52
- }
53
- start() {
54
- this.client.start();
55
- }
56
- stop() {
57
- this.client.stop();
58
- }
59
- async waitForReady() {
60
- await this.readyPromise;
61
- }
62
- async sendChat(opts) {
63
- const runId = randomUUID();
64
- await this.client.request("chat.send", {
65
- sessionKey: opts.sessionKey,
66
- message: opts.message,
67
- thinking: opts.thinking,
68
- deliver: opts.deliver,
69
- timeoutMs: opts.timeoutMs,
70
- idempotencyKey: runId,
71
- });
72
- return { runId };
73
- }
74
- async abortChat(opts) {
75
- return await this.client.request("chat.abort", {
76
- sessionKey: opts.sessionKey,
77
- runId: opts.runId,
78
- });
79
- }
80
- async loadHistory(opts) {
81
- return await this.client.request("chat.history", {
82
- sessionKey: opts.sessionKey,
83
- limit: opts.limit,
84
- });
85
- }
86
- async listSessions(opts) {
87
- return await this.client.request("sessions.list", {
88
- limit: opts?.limit,
89
- activeMinutes: opts?.activeMinutes,
90
- includeGlobal: opts?.includeGlobal,
91
- includeUnknown: opts?.includeUnknown,
92
- });
93
- }
94
- async patchSession(opts) {
95
- return await this.client.request("sessions.patch", opts);
96
- }
97
- async resetSession(key) {
98
- return await this.client.request("sessions.reset", { key });
99
- }
100
- async getStatus() {
101
- return await this.client.request("status");
102
- }
103
- async listModels() {
104
- const res = await this.client.request("models.list");
105
- return Array.isArray(res?.models) ? res.models : [];
106
- }
107
- }
108
- export function resolveGatewayConnection(opts) {
109
- const config = loadConfig();
110
- const isRemoteMode = config.gateway?.mode === "remote";
111
- const remote = isRemoteMode ? config.gateway?.remote : undefined;
112
- const authToken = config.gateway?.auth?.token;
113
- const localPort = resolveGatewayPort(config);
114
- const url = (typeof opts.url === "string" && opts.url.trim().length > 0
115
- ? opts.url.trim()
116
- : undefined) ||
117
- (typeof remote?.url === "string" && remote.url.trim().length > 0
118
- ? remote.url.trim()
119
- : undefined) ||
120
- `ws://127.0.0.1:${localPort}`;
121
- const token = (typeof opts.token === "string" && opts.token.trim().length > 0
122
- ? opts.token.trim()
123
- : undefined) ||
124
- (isRemoteMode
125
- ? typeof remote?.token === "string" && remote.token.trim().length > 0
126
- ? remote.token.trim()
127
- : undefined
128
- : process.env.CLAWDBOT_GATEWAY_TOKEN?.trim() ||
129
- (typeof authToken === "string" && authToken.trim().length > 0
130
- ? authToken.trim()
131
- : undefined));
132
- const password = (typeof opts.password === "string" && opts.password.trim().length > 0
133
- ? opts.password.trim()
134
- : undefined) ||
135
- process.env.CLAWDBOT_GATEWAY_PASSWORD?.trim() ||
136
- (typeof remote?.password === "string" && remote.password.trim().length > 0
137
- ? remote.password.trim()
138
- : undefined);
139
- return { url, token, password };
140
- }
@@ -1,41 +0,0 @@
1
- export class ChatLayout {
2
- header;
3
- messages;
4
- status;
5
- input;
6
- constructor(header, messages, status, input) {
7
- this.header = header;
8
- this.messages = messages;
9
- this.status = status;
10
- this.input = input;
11
- }
12
- invalidate() {
13
- this.header.invalidate?.();
14
- this.messages.invalidate?.();
15
- this.status.invalidate?.();
16
- this.input.invalidate?.();
17
- }
18
- render(width) {
19
- const rows = process.stdout.rows ?? 24;
20
- const headerLines = this.header.render(width);
21
- const statusLines = this.status.render(width);
22
- const inputLines = this.input.render(width);
23
- const reserved = headerLines.length + statusLines.length + inputLines.length;
24
- const available = Math.max(rows - reserved, 0);
25
- const messageLines = this.messages.render(width);
26
- const slicedMessages = available > 0
27
- ? messageLines.slice(Math.max(0, messageLines.length - available))
28
- : [];
29
- const lines = [
30
- ...headerLines,
31
- ...slicedMessages,
32
- ...statusLines,
33
- ...inputLines,
34
- ];
35
- if (lines.length < rows) {
36
- const padding = Array.from({ length: rows - lines.length }, () => "");
37
- return [...lines, ...padding];
38
- }
39
- return lines.slice(0, rows);
40
- }
41
- }
@@ -1,57 +0,0 @@
1
- import crypto from "node:crypto";
2
- import { Container, Markdown, Spacer, Text } from "@mariozechner/pi-tui";
3
- import { theme } from "./theme.js";
4
- export class MessageList extends Container {
5
- markdownTheme;
6
- styles;
7
- assistantById = new Map();
8
- constructor(markdownTheme, styles) {
9
- super();
10
- this.markdownTheme = markdownTheme;
11
- this.styles = styles;
12
- }
13
- clearAll() {
14
- this.assistantById.clear();
15
- this.clear();
16
- }
17
- addSystem(text) {
18
- this.addMessage("system", text, this.styles.system);
19
- }
20
- addTool(text) {
21
- this.addMessage("tool", text, this.styles.tool);
22
- }
23
- addUser(text) {
24
- this.addMessage("user", text, this.styles.user);
25
- }
26
- addAssistant(text, id) {
27
- const messageId = id ?? crypto.randomUUID();
28
- const label = new Text(theme.assistant("clawd"), 1, 0);
29
- const body = new Markdown(text, 1, 0, this.markdownTheme, this.styles.assistant);
30
- const group = new Container();
31
- group.addChild(label);
32
- group.addChild(body);
33
- this.addChild(group);
34
- this.addChild(new Spacer(1));
35
- this.assistantById.set(messageId, body);
36
- return messageId;
37
- }
38
- updateAssistant(id, text) {
39
- const component = this.assistantById.get(id);
40
- if (!component)
41
- return;
42
- component.setText(text);
43
- }
44
- addMessage(role, text, style) {
45
- const label = new Text(role === "user"
46
- ? theme.user("you")
47
- : role === "system"
48
- ? theme.system("system")
49
- : theme.dim("tool"), 1, 0);
50
- const body = new Markdown(text, 1, 0, this.markdownTheme, style);
51
- const group = new Container();
52
- group.addChild(label);
53
- group.addChild(body);
54
- this.addChild(group);
55
- this.addChild(new Spacer(1));
56
- }
57
- }
@@ -1,80 +0,0 @@
1
- import chalk from "chalk";
2
- const palette = {
3
- text: "#E8E3D5",
4
- dim: "#7B7F87",
5
- accent: "#F6C453",
6
- accentSoft: "#F2A65A",
7
- border: "#3C414B",
8
- userBg: "#2B2F36",
9
- userText: "#F3EEE0",
10
- systemText: "#9BA3B2",
11
- toolPendingBg: "#1F2A2F",
12
- toolSuccessBg: "#1E2D23",
13
- toolErrorBg: "#2F1F1F",
14
- toolTitle: "#F6C453",
15
- toolOutput: "#E1DACB",
16
- quote: "#8CC8FF",
17
- quoteBorder: "#3B4D6B",
18
- code: "#F0C987",
19
- codeBlock: "#1E232A",
20
- codeBorder: "#343A45",
21
- link: "#7DD3A5",
22
- error: "#F97066",
23
- success: "#7DD3A5",
24
- };
25
- const fg = (hex) => (text) => chalk.hex(hex)(text);
26
- const bg = (hex) => (text) => chalk.bgHex(hex)(text);
27
- export const theme = {
28
- fg: fg(palette.text),
29
- dim: fg(palette.dim),
30
- accent: fg(palette.accent),
31
- accentSoft: fg(palette.accentSoft),
32
- success: fg(palette.success),
33
- error: fg(palette.error),
34
- header: (text) => chalk.bold(fg(palette.accent)(text)),
35
- system: fg(palette.systemText),
36
- userBg: bg(palette.userBg),
37
- userText: fg(palette.userText),
38
- toolTitle: fg(palette.toolTitle),
39
- toolOutput: fg(palette.toolOutput),
40
- toolPendingBg: bg(palette.toolPendingBg),
41
- toolSuccessBg: bg(palette.toolSuccessBg),
42
- toolErrorBg: bg(palette.toolErrorBg),
43
- border: fg(palette.border),
44
- bold: (text) => chalk.bold(text),
45
- italic: (text) => chalk.italic(text),
46
- };
47
- export const markdownTheme = {
48
- heading: (text) => chalk.bold(fg(palette.accent)(text)),
49
- link: (text) => fg(palette.link)(text),
50
- linkUrl: (text) => chalk.dim(text),
51
- code: (text) => fg(palette.code)(text),
52
- codeBlock: (text) => fg(palette.code)(text),
53
- codeBlockBorder: (text) => fg(palette.codeBorder)(text),
54
- quote: (text) => fg(palette.quote)(text),
55
- quoteBorder: (text) => fg(palette.quoteBorder)(text),
56
- hr: (text) => fg(palette.border)(text),
57
- listBullet: (text) => fg(palette.accentSoft)(text),
58
- bold: (text) => chalk.bold(text),
59
- italic: (text) => chalk.italic(text),
60
- strikethrough: (text) => chalk.strikethrough(text),
61
- underline: (text) => chalk.underline(text),
62
- };
63
- export const selectListTheme = {
64
- selectedPrefix: (text) => fg(palette.accent)(text),
65
- selectedText: (text) => chalk.bold(fg(palette.accent)(text)),
66
- description: (text) => fg(palette.dim)(text),
67
- scrollInfo: (text) => fg(palette.dim)(text),
68
- noMatch: (text) => fg(palette.dim)(text),
69
- };
70
- export const settingsListTheme = {
71
- label: (text, selected) => selected ? chalk.bold(fg(palette.accent)(text)) : fg(palette.text)(text),
72
- value: (text, selected) => selected ? fg(palette.accentSoft)(text) : fg(palette.dim)(text),
73
- description: (text) => fg(palette.systemText)(text),
74
- cursor: fg(palette.accent)("→ "),
75
- hint: (text) => fg(palette.dim)(text),
76
- };
77
- export const editorTheme = {
78
- borderColor: (text) => fg(palette.border)(text),
79
- selectList: selectListTheme,
80
- };
package/dist/tui/theme.js DELETED
@@ -1,25 +0,0 @@
1
- import chalk from "chalk";
2
- export const markdownTheme = {
3
- heading: (text) => chalk.bold.cyan(text),
4
- link: (text) => chalk.blue(text),
5
- linkUrl: (text) => chalk.gray(text),
6
- code: (text) => chalk.yellow(text),
7
- codeBlock: (text) => chalk.yellow(text),
8
- codeBlockBorder: (text) => chalk.gray(text),
9
- quote: (text) => chalk.gray(text),
10
- quoteBorder: (text) => chalk.gray(text),
11
- hr: (text) => chalk.gray(text),
12
- listBullet: (text) => chalk.cyan(text),
13
- bold: (text) => chalk.bold(text),
14
- italic: (text) => chalk.italic(text),
15
- strikethrough: (text) => chalk.strikethrough(text),
16
- underline: (text) => chalk.underline(text),
17
- };
18
- export const theme = {
19
- header: (text) => chalk.bold.cyan(text),
20
- dim: (text) => chalk.gray(text),
21
- user: (text) => chalk.cyan(text),
22
- assistant: (text) => chalk.green(text),
23
- system: (text) => chalk.magenta(text),
24
- error: (text) => chalk.red(text),
25
- };