va-claw 0.2.0 → 0.2.3

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 (94) hide show
  1. package/README.md +13 -2
  2. package/README.zh-CN.md +13 -2
  3. package/dist/va-claw-bundle.mjs +212 -77
  4. package/package.json +5 -1
  5. package/packages/channels/discord/dist/.tsbuildinfo +1 -1
  6. package/packages/channels/discord/dist/runtime.test.js +9 -9
  7. package/packages/channels/discord/dist/runtime.test.js.map +1 -1
  8. package/packages/channels/dist/.tsbuildinfo +1 -1
  9. package/packages/channels/dist/index.d.ts +4 -2
  10. package/packages/channels/dist/index.d.ts.map +1 -1
  11. package/packages/channels/dist/index.js +6 -1
  12. package/packages/channels/dist/index.js.map +1 -1
  13. package/packages/channels/dist/lark.d.ts +3 -0
  14. package/packages/channels/dist/lark.d.ts.map +1 -0
  15. package/packages/channels/dist/lark.js +2 -0
  16. package/packages/channels/dist/lark.js.map +1 -0
  17. package/packages/channels/lark/dist/.tsbuildinfo +1 -0
  18. package/packages/channels/lark/dist/cli.d.ts +15 -0
  19. package/packages/channels/lark/dist/cli.d.ts.map +1 -0
  20. package/packages/channels/lark/dist/cli.js +61 -0
  21. package/packages/channels/lark/dist/cli.js.map +1 -0
  22. package/packages/channels/lark/dist/cli.test.d.ts +2 -0
  23. package/packages/channels/lark/dist/cli.test.d.ts.map +1 -0
  24. package/packages/channels/lark/dist/cli.test.js +21 -0
  25. package/packages/channels/lark/dist/cli.test.js.map +1 -0
  26. package/packages/channels/lark/dist/index.d.ts +14 -0
  27. package/packages/channels/lark/dist/index.d.ts.map +1 -0
  28. package/packages/channels/lark/dist/index.js +41 -0
  29. package/packages/channels/lark/dist/index.js.map +1 -0
  30. package/packages/channels/lark/dist/lark-client.d.ts +76 -0
  31. package/packages/channels/lark/dist/lark-client.d.ts.map +1 -0
  32. package/packages/channels/lark/dist/lark-client.js +167 -0
  33. package/packages/channels/lark/dist/lark-client.js.map +1 -0
  34. package/packages/channels/lark/dist/lark.test.d.ts +2 -0
  35. package/packages/channels/lark/dist/lark.test.d.ts.map +1 -0
  36. package/packages/channels/lark/dist/lark.test.js +196 -0
  37. package/packages/channels/lark/dist/lark.test.js.map +1 -0
  38. package/packages/channels/lark/dist/message.d.ts +15 -0
  39. package/packages/channels/lark/dist/message.d.ts.map +1 -0
  40. package/packages/channels/lark/dist/message.js +108 -0
  41. package/packages/channels/lark/dist/message.js.map +1 -0
  42. package/packages/channels/lark/dist/types.d.ts +39 -0
  43. package/packages/channels/lark/dist/types.d.ts.map +1 -0
  44. package/packages/channels/lark/dist/types.js +2 -0
  45. package/packages/channels/lark/dist/types.js.map +1 -0
  46. package/packages/channels/lark/package.json +21 -0
  47. package/packages/channels/package.json +6 -1
  48. package/packages/channels/slack/dist/.tsbuildinfo +1 -1
  49. package/packages/channels/slack/dist/slack.test.js +6 -7
  50. package/packages/channels/slack/dist/slack.test.js.map +1 -1
  51. package/packages/channels/telegram/dist/.tsbuildinfo +1 -1
  52. package/packages/channels/telegram/dist/cli.test.js.map +1 -1
  53. package/packages/channels/telegram/dist/telegram.test.js +6 -7
  54. package/packages/channels/telegram/dist/telegram.test.js.map +1 -1
  55. package/packages/cli/dist/.tsbuildinfo +1 -1
  56. package/packages/cli/dist/channel-handlers.js +115 -66
  57. package/packages/cli/dist/deps.js +106 -71
  58. package/packages/cli/dist/index.js +100 -9
  59. package/packages/cli/dist/program.js +119 -151
  60. package/packages/cli/dist/test-helpers.js +104 -87
  61. package/packages/cli/dist/types.js +0 -2
  62. package/packages/daemon/dist/.tsbuildinfo +1 -1
  63. package/packages/daemon/dist/runner.d.ts.map +1 -1
  64. package/packages/daemon/dist/runner.js +15 -1
  65. package/packages/daemon/dist/runner.js.map +1 -1
  66. package/packages/daemon/dist/runtime.d.ts +6 -2
  67. package/packages/daemon/dist/runtime.d.ts.map +1 -1
  68. package/packages/daemon/dist/runtime.js +2 -2
  69. package/packages/daemon/dist/runtime.js.map +1 -1
  70. package/packages/daemon/dist/wake-cycle.d.ts +1 -0
  71. package/packages/daemon/dist/wake-cycle.d.ts.map +1 -1
  72. package/packages/daemon/dist/wake-cycle.js +7 -0
  73. package/packages/daemon/dist/wake-cycle.js.map +1 -1
  74. package/packages/daemon/package.json +1 -0
  75. package/packages/identity/dist/.tsbuildinfo +1 -1
  76. package/packages/identity/dist/defaults.d.ts.map +1 -1
  77. package/packages/identity/dist/defaults.js +13 -0
  78. package/packages/identity/dist/defaults.js.map +1 -1
  79. package/packages/identity/dist/types.d.ts +7 -0
  80. package/packages/identity/dist/types.d.ts.map +1 -1
  81. package/packages/identity/test/storage.test.mjs +10 -0
  82. package/packages/memory/dist/.tsbuildinfo +1 -1
  83. package/packages/memory/dist/embedding.d.ts +11 -1
  84. package/packages/memory/dist/embedding.d.ts.map +1 -1
  85. package/packages/memory/dist/embedding.js +44 -15
  86. package/packages/memory/dist/embedding.js.map +1 -1
  87. package/packages/memory/dist/memory-store.d.ts +3 -0
  88. package/packages/memory/dist/memory-store.d.ts.map +1 -1
  89. package/packages/memory/dist/memory-store.js +58 -18
  90. package/packages/memory/dist/memory-store.js.map +1 -1
  91. package/packages/memory/dist/sqlite.js.map +1 -1
  92. package/packages/memory/package.json +3 -0
  93. package/packages/skills/dist/.tsbuildinfo +1 -1
  94. package/skills/install-va-claw.md +12 -0
@@ -1,82 +1,117 @@
1
1
  import { spawnSync } from "node:child_process";
2
2
  import { readFile } from "node:fs/promises";
3
3
  import { createInterface } from "node:readline/promises";
4
- import { DEFAULT_CONFIG_PATH, getDaemonStatus, installDaemonService, loadIdentity, runInstallWizard, saveIdentity, startDaemon, stopDaemon, toClaudeMdSnippet, toCodexSystemPrompt, uninstallDaemonService, } from "./deps-exports.js";
5
- import { clear, consolidate, count, get, list, memorize, recall, reflect, search, update, forget, } from "@va-claw/memory";
4
+ import {
5
+ DEFAULT_CONFIG_PATH,
6
+ getDaemonStatus,
7
+ installDaemonService,
8
+ loadIdentity,
9
+ runInstallWizard,
10
+ saveIdentity,
11
+ startDaemon,
12
+ stopDaemon,
13
+ toClaudeMdSnippet,
14
+ toCodexSystemPrompt,
15
+ uninstallDaemonService
16
+ } from "./deps-exports.js";
17
+ import {
18
+ clear,
19
+ consolidate,
20
+ count,
21
+ get,
22
+ list,
23
+ memorize,
24
+ recall,
25
+ reflect,
26
+ search,
27
+ update,
28
+ forget
29
+ } from "@va-claw/memory";
6
30
  import { installSkill, listSkills, loadSkill, removeSkill } from "../../skills/dist/index.js";
7
- import { fileExists, resolveClaudeMdPath, resolveCodexInstructionsPath, resolveClawRegistryPath, resolveMemoryDbPath, upsertManagedBlock, removeManagedBlock, wrapCodexPrompt, } from "./install-files.js";
8
- export function createDefaultCliDeps() {
9
- return {
10
- claudePath: resolveClaudeMdPath(),
11
- codexPath: resolveCodexInstructionsPath(),
12
- configPath: DEFAULT_CONFIG_PATH,
13
- memoryDbPath: resolveMemoryDbPath(),
14
- clawRegistryPath: resolveClawRegistryPath(),
15
- platform: process.platform,
16
- spawnSync,
17
- stdout: process.stdout,
18
- stderr: process.stderr,
19
- fileExists,
20
- readTextFile: (path) => readFile(path, "utf8"),
21
- upsertManagedBlock,
22
- removeManagedBlock,
23
- wrapCodexPrompt,
24
- loadIdentity: () => loadIdentity(),
25
- saveIdentity: (config) => saveIdentity(config),
26
- runInstallWizard,
27
- toClaudeMdSnippet,
28
- toCodexSystemPrompt,
29
- installDaemonService,
30
- uninstallDaemonService,
31
- startDaemon,
32
- stopDaemon,
33
- getDaemonStatus,
34
- memoryMemorize: (key, essence, options) => memorize(key, essence, options),
35
- memoryGet: (key) => get(key),
36
- memoryUpdate: (key, changes) => update(key, changes),
37
- memoryForget: (key) => forget(key),
38
- memoryRecall: (query, limit) => recall(query, limit),
39
- memoryConsolidate: () => consolidate(),
40
- memoryReflect: () => reflect(),
41
- memoryCount: () => count(),
42
- memorySearch: (query, limit) => search(query, limit),
43
- memoryList: (limit) => list(limit),
44
- memoryClear: () => clear(),
45
- startTelegramChannel: (config) => loadChannelsModule().then((module) => module.startTelegramChannel(config)),
46
- stopTelegramChannel: (channel) => loadChannelsModule().then((module) => module.stopTelegramChannel(channel)),
47
- startSlackChannel: (config) => loadChannelsModule().then((module) => module.startSlackChannel(config)),
48
- stopSlackChannel: (channel) => loadChannelsModule().then((module) => module.stopSlackChannel(channel)),
49
- skillInstall: (content, name) => installSkill(content, name),
50
- skillList: (dir) => listSkills(dir),
51
- skillLoad: (nameOrPath) => loadSkill(nameOrPath),
52
- skillRemove: (name) => removeSkill(name),
53
- confirm: (message) => askForConfirmation(message),
54
- prompt: (message, initialValue) => askForValue(message, initialValue),
55
- };
31
+ import {
32
+ fileExists,
33
+ resolveClaudeMdPath,
34
+ resolveCodexInstructionsPath,
35
+ resolveClawRegistryPath,
36
+ resolveMemoryDbPath,
37
+ upsertManagedBlock,
38
+ removeManagedBlock,
39
+ wrapCodexPrompt
40
+ } from "./install-files.js";
41
+ function createDefaultCliDeps() {
42
+ return {
43
+ claudePath: resolveClaudeMdPath(),
44
+ codexPath: resolveCodexInstructionsPath(),
45
+ configPath: DEFAULT_CONFIG_PATH,
46
+ memoryDbPath: resolveMemoryDbPath(),
47
+ clawRegistryPath: resolveClawRegistryPath(),
48
+ platform: process.platform,
49
+ spawnSync,
50
+ stdout: process.stdout,
51
+ stderr: process.stderr,
52
+ fileExists,
53
+ readTextFile: (path) => readFile(path, "utf8"),
54
+ upsertManagedBlock,
55
+ removeManagedBlock,
56
+ wrapCodexPrompt,
57
+ loadIdentity: () => loadIdentity(),
58
+ saveIdentity: (config) => saveIdentity(config),
59
+ runInstallWizard,
60
+ toClaudeMdSnippet,
61
+ toCodexSystemPrompt,
62
+ installDaemonService,
63
+ uninstallDaemonService,
64
+ startDaemon,
65
+ stopDaemon,
66
+ getDaemonStatus,
67
+ memoryMemorize: (key, essence, options) => memorize(key, essence, options),
68
+ memoryGet: (key) => get(key),
69
+ memoryUpdate: (key, changes) => update(key, changes),
70
+ memoryForget: (key) => forget(key),
71
+ memoryRecall: (query, limit) => recall(query, limit),
72
+ memoryConsolidate: () => consolidate(),
73
+ memoryReflect: () => reflect(),
74
+ memoryCount: () => count(),
75
+ memorySearch: (query, limit) => search(query, limit),
76
+ memoryList: (limit) => list(limit),
77
+ memoryClear: () => clear(),
78
+ startTelegramChannel: (config) => loadChannelsModule().then((module) => module.startTelegramChannel(config)),
79
+ stopTelegramChannel: (channel) => loadChannelsModule().then((module) => module.stopTelegramChannel(channel)),
80
+ startLarkChannel: (config) => loadChannelsModule().then((module) => module.startLarkChannel(config)),
81
+ stopLarkChannel: (channel) => loadChannelsModule().then((module) => module.stopLarkChannel(channel)),
82
+ startSlackChannel: (config) => loadChannelsModule().then((module) => module.startSlackChannel(config)),
83
+ stopSlackChannel: (channel) => loadChannelsModule().then((module) => module.stopSlackChannel(channel)),
84
+ skillInstall: (content, name) => installSkill(content, name),
85
+ skillList: (dir) => listSkills(dir),
86
+ skillLoad: (nameOrPath) => loadSkill(nameOrPath),
87
+ skillRemove: (name) => removeSkill(name),
88
+ confirm: (message) => askForConfirmation(message),
89
+ prompt: (message, initialValue) => askForValue(message, initialValue)
90
+ };
56
91
  }
57
92
  async function askForConfirmation(message) {
58
- const rl = createInterface({ input: process.stdin, output: process.stdout });
59
- try {
60
- const value = await rl.question(`${message} [y/N] `);
61
- return ["y", "yes"].includes(value.trim().toLowerCase());
62
- }
63
- finally {
64
- rl.close();
65
- }
93
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
94
+ try {
95
+ const value = await rl.question(`${message} [y/N] `);
96
+ return ["y", "yes"].includes(value.trim().toLowerCase());
97
+ } finally {
98
+ rl.close();
99
+ }
66
100
  }
67
101
  async function askForValue(message, initialValue = "") {
68
- const rl = createInterface({ input: process.stdin, output: process.stdout });
69
- const suffix = initialValue.trim() === "" ? "" : ` [${initialValue}]`;
70
- try {
71
- const value = await rl.question(`${message}${suffix} `);
72
- return value.trim() === "" ? initialValue : value.trim();
73
- }
74
- finally {
75
- rl.close();
76
- }
102
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
103
+ const suffix = initialValue.trim() === "" ? "" : ` [${initialValue}]`;
104
+ try {
105
+ const value = await rl.question(`${message}${suffix} `);
106
+ return value.trim() === "" ? initialValue : value.trim();
107
+ } finally {
108
+ rl.close();
109
+ }
77
110
  }
78
111
  async function loadChannelsModule() {
79
- const moduleUrl = new URL("../../channels/dist/index.js", import.meta.url);
80
- return import(moduleUrl.href);
112
+ const moduleUrl = new URL("../../channels/dist/index.js", import.meta.url);
113
+ return import(moduleUrl.href);
81
114
  }
82
- //# sourceMappingURL=deps.js.map
115
+ export {
116
+ createDefaultCliDeps
117
+ };
@@ -1,9 +1,100 @@
1
- export { createDefaultCliDeps } from "./deps.js";
2
- export { runSlackChannelSetup, runSlackChannelStart, runSlackChannelStatus, runTelegramChannelSetup, runTelegramChannelStart, runTelegramChannelStatus, } from "./channel-handlers.js";
3
- export { runInstall, runMemoryClear, runMemoryList, runMemorySearch, runClawAdd, runClawHeartbeat, runClawList, runClawRemove, runClawStatus, runClawUpdate, runProtocol, runSkillAdd, runSkillList, runSkillRemove, runSkillShow, runStart, runStatus, runStop, runUninstall, } from "./handlers.js";
4
- export { CODEX_MARKERS, CLAUDE_MARKERS, fileExists, resolveClawRegistryPath, resolveClaudeMdPath, resolveCodexInstructionsPath, resolveMemoryDbPath, removeManagedBlock, upsertManagedBlock, wrapCodexPrompt, } from "./install-files.js";
5
- export { countMemoryEntries, findLastWakeAt } from "./memory-status.js";
6
- export { formatMemoryEntries, formatSkills, writeLine } from "./output.js";
7
- export { detectServiceType, probeServiceRunning, stopInstalledService } from "./platform.js";
8
- export { createCliProgram, runCli } from "./program.js";
9
- //# sourceMappingURL=index.js.map
1
+ import { createDefaultCliDeps } from "./deps.js";
2
+ import {
3
+ runLarkChannelSetup,
4
+ runLarkChannelStart,
5
+ runLarkChannelStatus,
6
+ runSlackChannelSetup,
7
+ runSlackChannelStart,
8
+ runSlackChannelStatus,
9
+ runTelegramChannelSetup,
10
+ runTelegramChannelStart,
11
+ runTelegramChannelStatus
12
+ } from "./channel-handlers.js";
13
+ import {
14
+ runInstall,
15
+ runMemoryClear,
16
+ runMemoryList,
17
+ runMemorySearch,
18
+ runClawAdd,
19
+ runClawHeartbeat,
20
+ runClawList,
21
+ runClawRemove,
22
+ runClawStatus,
23
+ runClawUpdate,
24
+ runProtocol,
25
+ runSkillAdd,
26
+ runSkillList,
27
+ runSkillRemove,
28
+ runSkillShow,
29
+ runStart,
30
+ runStatus,
31
+ runStop,
32
+ runUninstall
33
+ } from "./handlers.js";
34
+ import {
35
+ CODEX_MARKERS,
36
+ CLAUDE_MARKERS,
37
+ fileExists,
38
+ resolveClawRegistryPath,
39
+ resolveClaudeMdPath,
40
+ resolveCodexInstructionsPath,
41
+ resolveMemoryDbPath,
42
+ removeManagedBlock,
43
+ upsertManagedBlock,
44
+ wrapCodexPrompt
45
+ } from "./install-files.js";
46
+ import { countMemoryEntries, findLastWakeAt } from "./memory-status.js";
47
+ import { formatMemoryEntries, formatSkills, writeLine } from "./output.js";
48
+ import { detectServiceType, probeServiceRunning, stopInstalledService } from "./platform.js";
49
+ import { createCliProgram, runCli } from "./program.js";
50
+ export {
51
+ CLAUDE_MARKERS,
52
+ CODEX_MARKERS,
53
+ countMemoryEntries,
54
+ createCliProgram,
55
+ createDefaultCliDeps,
56
+ detectServiceType,
57
+ fileExists,
58
+ findLastWakeAt,
59
+ formatMemoryEntries,
60
+ formatSkills,
61
+ probeServiceRunning,
62
+ removeManagedBlock,
63
+ resolveClaudeMdPath,
64
+ resolveClawRegistryPath,
65
+ resolveCodexInstructionsPath,
66
+ resolveMemoryDbPath,
67
+ runClawAdd,
68
+ runClawHeartbeat,
69
+ runClawList,
70
+ runClawRemove,
71
+ runClawStatus,
72
+ runClawUpdate,
73
+ runCli,
74
+ runInstall,
75
+ runLarkChannelSetup,
76
+ runLarkChannelStart,
77
+ runLarkChannelStatus,
78
+ runMemoryClear,
79
+ runMemoryList,
80
+ runMemorySearch,
81
+ runProtocol,
82
+ runSkillAdd,
83
+ runSkillList,
84
+ runSkillRemove,
85
+ runSkillShow,
86
+ runSlackChannelSetup,
87
+ runSlackChannelStart,
88
+ runSlackChannelStatus,
89
+ runStart,
90
+ runStatus,
91
+ runStop,
92
+ runTelegramChannelSetup,
93
+ runTelegramChannelStart,
94
+ runTelegramChannelStatus,
95
+ runUninstall,
96
+ stopInstalledService,
97
+ upsertManagedBlock,
98
+ wrapCodexPrompt,
99
+ writeLine
100
+ };
@@ -1,155 +1,123 @@
1
1
  import { Command } from "commander";
2
2
  import { createDefaultCliDeps } from "./deps.js";
3
- import { runInstall, runDiscordSetup, runDiscordStart, runDiscordStatus, runMemoryClear, runMemoryConsolidate, runMemoryList, runMemoryReflect, runMemoryGet, runMemoryForget, runMemorySearch, runMemoryMemorize, runMemoryRecall, runMemoryUpdate, runProtocol, runSkillAdd, runSkillList, runSkillRemove, runSkillShow, runStart, runClawAdd, runClawHeartbeat, runClawList, runClawRemove, runClawStatus, runClawUpdate, runStatus, runStop, runUninstall, } from "./handlers.js";
4
- import { runSlackChannelSetup as runSlackSetup, runSlackChannelStart as runSlackStart, runSlackChannelStatus as runSlackStatus, runTelegramChannelSetup as runTelegramSetup, runTelegramChannelStart as runTelegramStart, runTelegramChannelStatus as runTelegramStatus, } from "./channel-handlers.js";
5
- export function createCliProgram(deps = createDefaultCliDeps()) {
6
- const program = new Command("va-claw");
7
- program.description("va-claw CLI");
8
- program.showHelpAfterError();
9
- program
10
- .command("install")
11
- .description("Install va-claw config, prompt injections, and daemon service.")
12
- .option("--for <target>", "claude-code | codex | all", "all")
13
- .action(async (options) => runInstall((options.for ?? "all"), deps));
14
- program.command("start").description("Start the daemon in the foreground.").action(async () => runStart(deps));
15
- program.command("stop").description("Stop the daemon.").action(async () => runStop(deps));
16
- program.command("status").description("Show daemon and memory status.").action(async () => runStatus(deps));
17
- program.command("uninstall").description("Remove daemon service and injected prompts.").action(async () => runUninstall(deps));
18
- program
19
- .command("protocol")
20
- .description("Emit a machine-readable protocol summary for agent-facing integrations.")
21
- .option("--text", "Print a human-readable protocol summary instead of JSON.")
22
- .action(async (options) => runProtocol(deps, Boolean(options.text)));
23
- const memory = program.command("memory").description("Memory operations.");
24
- memory
25
- .command("search")
26
- .description("Search memory.")
27
- .argument("<query>")
28
- .action(async (query) => runMemorySearch(query, deps));
29
- memory
30
- .command("memorize")
31
- .description("Store or update a memory entry by key.")
32
- .argument("<key>")
33
- .argument("<essence>")
34
- .option("--tags <tags>", "Comma-separated tags.")
35
- .option("--details <details>", "Details text.")
36
- .option("--importance <importance>", "Importance from 0 to 1.")
37
- .action((key, essence, options) => runMemoryMemorize(key, essence, options, deps));
38
- memory
39
- .command("get")
40
- .description("Get a memory entry by key.")
41
- .argument("<key>")
42
- .action(async (key) => runMemoryGet(key, deps));
43
- memory
44
- .command("update")
45
- .description("Update a memory entry by key.")
46
- .argument("<key>")
47
- .option("--essence <essence>", "Replace essence text.")
48
- .option("--tags <tags>", "Comma-separated tags.")
49
- .option("--importance <importance>", "Importance from 0 to 1.")
50
- .option("--details <details>", "Replace details text.")
51
- .action((key, options) => runMemoryUpdate(key, options, deps));
52
- memory.command("list").description("List recent memory entries.").action(async () => runMemoryList(deps));
53
- memory
54
- .command("forget")
55
- .description("Forget a memory by key.")
56
- .argument("<key>")
57
- .action(async (key) => runMemoryForget(key, deps));
58
- memory
59
- .command("recall")
60
- .description("Recall memories by query.")
61
- .argument("<query>")
62
- .option("--limit <limit>", "Max results.")
63
- .action((query, options) => runMemoryRecall(query, options.limit ? Number(options.limit) : 5, deps));
64
- memory.command("consolidate").description("Consolidate memory store.").action(async () => runMemoryConsolidate(deps));
65
- memory.command("reflect").description("Reflect memory map grouped by tags.").action(async () => runMemoryReflect(deps));
66
- memory.command("clear").description("Clear all memory entries.").action(async () => runMemoryClear(deps));
67
- const skill = program.command("skill").description("Skill operations.");
68
- skill.command("list").description("List installed and project skills.").action(async () => runSkillList(deps));
69
- skill
70
- .command("add")
71
- .description("Install a skill from a local Markdown file or URL.\n\nTip: vet unknown skills first — va-claw skill add https://clawhub.ai/spclaudehome/Skill-vetter")
72
- .argument("<path-or-url>")
73
- .action(async (pathOrUrl) => runSkillAdd(pathOrUrl, deps));
74
- skill
75
- .command("remove")
76
- .description("Remove an installed skill by name.")
77
- .argument("<name>")
78
- .action(async (name) => runSkillRemove(name, deps));
79
- skill
80
- .command("show")
81
- .description("Show the raw Markdown content for a skill.")
82
- .argument("<name>")
83
- .action(async (name) => runSkillShow(name, deps));
84
- const channel = program.command("channel").description("Channel operations.");
85
- const discord = channel.command("discord").description("Discord channel operations.");
86
- discord.command("setup").description("Configure Discord bot credentials.").action(async () => runDiscordSetup(deps));
87
- discord.command("start").description("Start the Discord channel in the foreground.").action(async () => runDiscordStart(deps));
88
- discord.command("status").description("Show Discord channel status.").action(async () => runDiscordStatus(deps));
89
- const telegram = channel.command("telegram").description("Telegram channel operations.");
90
- telegram
91
- .command("setup")
92
- .description("Configure Telegram bot credentials.")
93
- .option("--token <token>", "Telegram bot token")
94
- .option("--cli-command <command>", "CLI command to invoke for each message")
95
- .action(async (options) => runTelegramSetup(options.token, options.cliCommand, deps));
96
- telegram.command("start").description("Start the Telegram channel in the foreground.").action(async () => runTelegramStart(deps));
97
- telegram.command("status").description("Show Telegram channel status.").action(async () => runTelegramStatus(deps));
98
- const slack = channel.command("slack").description("Slack channel operations.");
99
- slack
100
- .command("setup")
101
- .description("Configure Slack bot credentials.")
102
- .option("--bot-token <token>", "Slack bot token")
103
- .option("--app-token <token>", "Slack app token")
104
- .option("--cli-command <command>", "CLI command to invoke for each message")
105
- .action(async (options) => runSlackSetup(options.botToken, options.appToken, options.cliCommand, deps));
106
- slack.command("start").description("Start the Slack channel in the foreground.").action(async () => runSlackStart(deps));
107
- slack.command("status").description("Show Slack channel status.").action(async () => runSlackStatus(deps));
108
- const claw = program.command("claw").description("Long-running claw operations.");
109
- claw.command("status").description("Show claw status and daemon summary.").action(async () => runClawStatus(deps));
110
- claw.command("list").description("List all registered claws.").action(async () => runClawList(deps));
111
- claw
112
- .command("add")
113
- .description("Register a long-running claw.")
114
- .argument("<name>")
115
- .option("--goal <goal>", "Describe what this claw is responsible for.")
116
- .option("--status <status>", "running | working | idle | waiting | error | offline | stopped.")
117
- .option("--cli-command <command>", "Command to execute this claw's actions (default: va-claw).")
118
- .option("--note <note>", "Single-line note for this claw.")
119
- .option("--tags <tags>", "Comma-separated tags.")
120
- .action((name, options) => runClawAdd(name, options, deps));
121
- claw
122
- .command("set")
123
- .description("Update a claw's state.")
124
- .argument("<name>")
125
- .option("--goal <goal>", "New goal for this claw.")
126
- .option("--status <status>", "running | working | idle | waiting | error | offline | stopped.")
127
- .option("--cli-command <command>", "Update command used for this claw.")
128
- .option("--note <note>", "Update note.")
129
- .option("--tags <tags>", "Replace tags, comma-separated.")
130
- .option("--seen", "Mark claw as alive now.")
131
- .action((name, options) => runClawUpdate(name, { ...options, seen: options.seen ? "true" : undefined }, deps));
132
- claw
133
- .command("heartbeat")
134
- .description("Mark a claw as active and update lastSeenAt.")
135
- .argument("<name>")
136
- .action((name) => runClawHeartbeat(name, deps));
137
- claw
138
- .command("remove")
139
- .description("Unregister a claw.")
140
- .argument("<name>")
141
- .action((name) => runClawRemove(name, deps));
142
- return program;
3
+ import {
4
+ runInstall,
5
+ runDiscordSetup,
6
+ runDiscordStart,
7
+ runDiscordStatus,
8
+ runMemoryClear,
9
+ runMemoryConsolidate,
10
+ runMemoryList,
11
+ runMemoryReflect,
12
+ runMemoryGet,
13
+ runMemoryForget,
14
+ runMemorySearch,
15
+ runMemoryMemorize,
16
+ runMemoryRecall,
17
+ runMemoryUpdate,
18
+ runProtocol,
19
+ runSkillAdd,
20
+ runSkillList,
21
+ runSkillRemove,
22
+ runSkillShow,
23
+ runStart,
24
+ runClawAdd,
25
+ runClawHeartbeat,
26
+ runClawList,
27
+ runClawRemove,
28
+ runClawStatus,
29
+ runClawUpdate,
30
+ runStatus,
31
+ runStop,
32
+ runUninstall
33
+ } from "./handlers.js";
34
+ import {
35
+ runLarkChannelSetup as runLarkSetup,
36
+ runLarkChannelStart as runLarkStart,
37
+ runLarkChannelStatus as runLarkStatus,
38
+ runSlackChannelSetup as runSlackSetup,
39
+ runSlackChannelStart as runSlackStart,
40
+ runSlackChannelStatus as runSlackStatus,
41
+ runTelegramChannelSetup as runTelegramSetup,
42
+ runTelegramChannelStart as runTelegramStart,
43
+ runTelegramChannelStatus as runTelegramStatus
44
+ } from "./channel-handlers.js";
45
+ function createCliProgram(deps = createDefaultCliDeps()) {
46
+ const program = new Command("va-claw");
47
+ program.description("va-claw CLI");
48
+ program.showHelpAfterError();
49
+ program.command("install").description("Install va-claw config, prompt injections, and daemon service.").option("--for <target>", "claude-code | codex | all", "all").action(async (options) => runInstall(options.for ?? "all", deps));
50
+ program.command("start").description("Start the daemon in the foreground.").action(async () => runStart(deps));
51
+ program.command("stop").description("Stop the daemon.").action(async () => runStop(deps));
52
+ program.command("status").description("Show daemon and memory status.").action(async () => runStatus(deps));
53
+ program.command("uninstall").description("Remove daemon service and injected prompts.").action(async () => runUninstall(deps));
54
+ program.command("protocol").description("Emit a machine-readable protocol summary for agent-facing integrations.").option("--text", "Print a human-readable protocol summary instead of JSON.").action(async (options) => runProtocol(deps, Boolean(options.text)));
55
+ const memory = program.command("memory").description("Memory operations.");
56
+ memory.command("search").description("Search memory.").argument("<query>").action(async (query) => runMemorySearch(query, deps));
57
+ memory.command("memorize").description("Store or update a memory entry by key.").argument("<key>").argument("<essence>").option("--tags <tags>", "Comma-separated tags.").option("--details <details>", "Details text.").option("--importance <importance>", "Importance from 0 to 1.").action(
58
+ (key, essence, options) => runMemoryMemorize(key, essence, options, deps)
59
+ );
60
+ memory.command("get").description("Get a memory entry by key.").argument("<key>").action(async (key) => runMemoryGet(key, deps));
61
+ memory.command("update").description("Update a memory entry by key.").argument("<key>").option("--essence <essence>", "Replace essence text.").option("--tags <tags>", "Comma-separated tags.").option("--importance <importance>", "Importance from 0 to 1.").option("--details <details>", "Replace details text.").action(
62
+ (key, options) => runMemoryUpdate(key, options, deps)
63
+ );
64
+ memory.command("list").description("List recent memory entries.").action(async () => runMemoryList(deps));
65
+ memory.command("forget").description("Forget a memory by key.").argument("<key>").action(async (key) => runMemoryForget(key, deps));
66
+ memory.command("recall").description("Recall memories by query.").argument("<query>").option("--limit <limit>", "Max results.").action(
67
+ (query, options) => runMemoryRecall(query, options.limit ? Number(options.limit) : 5, deps)
68
+ );
69
+ memory.command("consolidate").description("Consolidate memory store.").action(async () => runMemoryConsolidate(deps));
70
+ memory.command("reflect").description("Reflect memory map grouped by tags.").action(async () => runMemoryReflect(deps));
71
+ memory.command("clear").description("Clear all memory entries.").action(async () => runMemoryClear(deps));
72
+ const skill = program.command("skill").description("Skill operations.");
73
+ skill.command("list").description("List installed and project skills.").action(async () => runSkillList(deps));
74
+ skill.command("add").description("Install a skill from a local Markdown file or URL.\n\nTip: vet unknown skills first \u2014 va-claw skill add https://clawhub.ai/spclaudehome/Skill-vetter").argument("<path-or-url>").action(async (pathOrUrl) => runSkillAdd(pathOrUrl, deps));
75
+ skill.command("remove").description("Remove an installed skill by name.").argument("<name>").action(async (name) => runSkillRemove(name, deps));
76
+ skill.command("show").description("Show the raw Markdown content for a skill.").argument("<name>").action(async (name) => runSkillShow(name, deps));
77
+ const channel = program.command("channel").description("Channel operations.");
78
+ const discord = channel.command("discord").description("Discord channel operations.");
79
+ discord.command("setup").description("Configure Discord bot credentials.").action(async () => runDiscordSetup(deps));
80
+ discord.command("start").description("Start the Discord channel in the foreground.").action(async () => runDiscordStart(deps));
81
+ discord.command("status").description("Show Discord channel status.").action(async () => runDiscordStatus(deps));
82
+ const telegram = channel.command("telegram").description("Telegram channel operations.");
83
+ telegram.command("setup").description("Configure Telegram bot credentials.").option("--token <token>", "Telegram bot token").option("--cli-command <command>", "CLI command to invoke for each message").action(
84
+ async (options) => runTelegramSetup(options.token, options.cliCommand, deps)
85
+ );
86
+ telegram.command("start").description("Start the Telegram channel in the foreground.").action(async () => runTelegramStart(deps));
87
+ telegram.command("status").description("Show Telegram channel status.").action(async () => runTelegramStatus(deps));
88
+ const lark = channel.command("lark").description("Lark (Feishu) channel operations.");
89
+ lark.command("setup").description("Configure Lark (Feishu) bot credentials.").option("--app-id <id>", "Lark app ID").option("--app-secret <secret>", "Lark app secret").option("--cli-command <command>", "CLI command to invoke for each message").action(
90
+ async (options) => runLarkSetup(options.appId, options.appSecret, options.cliCommand, deps)
91
+ );
92
+ lark.command("start").description("Start the Lark channel in the foreground.").action(async () => runLarkStart(deps));
93
+ lark.command("status").description("Show Lark channel status.").action(async () => runLarkStatus(deps));
94
+ const slack = channel.command("slack").description("Slack channel operations.");
95
+ slack.command("setup").description("Configure Slack bot credentials.").option("--bot-token <token>", "Slack bot token").option("--app-token <token>", "Slack app token").option("--cli-command <command>", "CLI command to invoke for each message").action(
96
+ async (options) => runSlackSetup(options.botToken, options.appToken, options.cliCommand, deps)
97
+ );
98
+ slack.command("start").description("Start the Slack channel in the foreground.").action(async () => runSlackStart(deps));
99
+ slack.command("status").description("Show Slack channel status.").action(async () => runSlackStatus(deps));
100
+ const claw = program.command("claw").description("Long-running claw operations.");
101
+ claw.command("status").description("Show claw status and daemon summary.").action(async () => runClawStatus(deps));
102
+ claw.command("list").description("List all registered claws.").action(async () => runClawList(deps));
103
+ claw.command("add").description("Register a long-running claw.").argument("<name>").option("--goal <goal>", "Describe what this claw is responsible for.").option("--status <status>", "running | working | idle | waiting | error | offline | stopped.").option("--cli-command <command>", "Command to execute this claw's actions (default: va-claw).").option("--note <note>", "Single-line note for this claw.").option("--tags <tags>", "Comma-separated tags.").action((name, options) => runClawAdd(name, options, deps));
104
+ claw.command("set").description("Update a claw's state.").argument("<name>").option("--goal <goal>", "New goal for this claw.").option("--status <status>", "running | working | idle | waiting | error | offline | stopped.").option("--cli-command <command>", "Update command used for this claw.").option("--note <note>", "Update note.").option("--tags <tags>", "Replace tags, comma-separated.").option("--seen", "Mark claw as alive now.").action((name, options) => runClawUpdate(name, { ...options, seen: options.seen ? "true" : void 0 }, deps));
105
+ claw.command("heartbeat").description("Mark a claw as active and update lastSeenAt.").argument("<name>").action((name) => runClawHeartbeat(name, deps));
106
+ claw.command("remove").description("Unregister a claw.").argument("<name>").action((name) => runClawRemove(name, deps));
107
+ return program;
143
108
  }
144
- export async function runCli(argv = process.argv, deps) {
145
- const program = createCliProgram(deps ?? createDefaultCliDeps());
146
- try {
147
- await program.parseAsync(argv);
148
- }
149
- catch (error) {
150
- const message = error instanceof Error ? error.message : String(error);
151
- (deps ?? createDefaultCliDeps()).stderr.write(`${message}\n`);
152
- process.exitCode = 1;
153
- }
109
+ async function runCli(argv = process.argv, deps) {
110
+ const program = createCliProgram(deps ?? createDefaultCliDeps());
111
+ try {
112
+ await program.parseAsync(argv);
113
+ } catch (error) {
114
+ const message = error instanceof Error ? error.message : String(error);
115
+ (deps ?? createDefaultCliDeps()).stderr.write(`${message}
116
+ `);
117
+ process.exitCode = 1;
118
+ }
154
119
  }
155
- //# sourceMappingURL=program.js.map
120
+ export {
121
+ createCliProgram,
122
+ runCli
123
+ };