@bbigbang/cli 0.1.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.
Files changed (34) hide show
  1. package/dist/cliSupport.d.ts +166 -0
  2. package/dist/cliSupport.js +1306 -0
  3. package/dist/commandCatalog.d.ts +36 -0
  4. package/dist/commandCatalog.js +152 -0
  5. package/dist/commands/actionCommands.d.ts +3 -0
  6. package/dist/commands/actionCommands.js +43 -0
  7. package/dist/commands/authManualCommands.d.ts +3 -0
  8. package/dist/commands/authManualCommands.js +60 -0
  9. package/dist/commands/channelWorkspaceCommands.d.ts +3 -0
  10. package/dist/commands/channelWorkspaceCommands.js +105 -0
  11. package/dist/commands/contextCommands.d.ts +3 -0
  12. package/dist/commands/contextCommands.js +253 -0
  13. package/dist/commands/memoryCommands.d.ts +3 -0
  14. package/dist/commands/memoryCommands.js +154 -0
  15. package/dist/commands/messageCommands.d.ts +3 -0
  16. package/dist/commands/messageCommands.js +241 -0
  17. package/dist/commands/panelCommands.d.ts +3 -0
  18. package/dist/commands/panelCommands.js +218 -0
  19. package/dist/commands/reminderCommands.d.ts +3 -0
  20. package/dist/commands/reminderCommands.js +220 -0
  21. package/dist/commands/skillToolAttachmentCommands.d.ts +3 -0
  22. package/dist/commands/skillToolAttachmentCommands.js +261 -0
  23. package/dist/commands/taskCommands.d.ts +3 -0
  24. package/dist/commands/taskCommands.js +195 -0
  25. package/dist/index.d.ts +2 -0
  26. package/dist/index.js +8 -0
  27. package/dist/manual/generated/command-catalog.json +12452 -0
  28. package/dist/manual/topics/cli-overview.md +116 -0
  29. package/dist/manual/topics/commands.md +706 -0
  30. package/dist/manual/topics/examples.md +194 -0
  31. package/dist/manual/topics/index.md +11 -0
  32. package/dist/program.d.ts +5 -0
  33. package/dist/program.js +52 -0
  34. package/package.json +43 -0
@@ -0,0 +1,253 @@
1
+ import { joinServer, runBridge } from '@bbigbang/server-ops';
2
+ import { AGENT_COMMAND_ERROR_CODES, AgentCommandError, appendCommonBody, createRuntime, parseNonNegativeInteger, parsePositiveInteger, readRequiredJsonStdin, responseError, summarizeContextBundle, summarizeConversationList, summarizeConversationSummary, summarizeHeldMessageDrafts, summarizeHandoffCreate, summarizeHandoffStatus, summarizeInboxCheck, summarizeInboxWait, summarizeRuntimePresence, summarizeSelfState, summarizeServerDirectory, writeOutput } from '../cliSupport.js';
3
+ export function registerContextCommands(program, options) {
4
+ const server = program.command('server').description('Server and runtime summary');
5
+ server.command('info')
6
+ .description('Print server directory (channels, agents, humans)')
7
+ .action(async () => {
8
+ const runtime = createRuntime(program, options);
9
+ const response = await runtime.client.request('GET', `/api/internal/agent/${encodeURIComponent(runtime.context.agentId)}/server`);
10
+ if (!response.ok)
11
+ throw responseError(response, 'server info failed');
12
+ writeOutput(runtime, summarizeServerDirectory(response.data), response.data);
13
+ });
14
+ server.command('join')
15
+ .description('Install this machine as a Bigbang server connected to a public Hub')
16
+ .requiredOption('--hub-url <url>', 'Public Hub URL')
17
+ .requiredOption('--token <token>', 'One-time Hub registration token')
18
+ .requiredOption('--server-id <id>', 'Issued server id')
19
+ .requiredOption('--server-slug <slug>', 'Issued server slug')
20
+ .requiredOption('--server-name <name>', 'Issued server name')
21
+ .requiredOption('--version <semver>', 'Package version issued by the Hub')
22
+ .option('--install-packages <packages>', 'Comma-separated npm package specs to install for core/node/CLI')
23
+ .option('--port <n>', 'Local core port', '3100')
24
+ .option('--service <kind>', 'systemd, tmux, or none', 'systemd')
25
+ .option('--dry-run', 'Print planned actions without writing files or starting services')
26
+ .action(async (opts) => {
27
+ await joinServer({
28
+ hubUrl: opts.hubUrl,
29
+ token: opts.token,
30
+ serverId: opts.serverId,
31
+ serverSlug: opts.serverSlug,
32
+ serverName: opts.serverName,
33
+ version: opts.version,
34
+ installPackages: parseInstallPackagesOption(opts.installPackages),
35
+ port: Number(opts.port),
36
+ service: opts.service,
37
+ dryRun: opts.dryRun === true,
38
+ });
39
+ });
40
+ server.command('bridge')
41
+ .description('Run the outbound bridge that connects a local server to a public Hub')
42
+ .option('--hub-url <url>', 'Public Hub URL')
43
+ .option('--token <token>', 'Hub registration or persisted bridge token')
44
+ .option('--credential-path <path>', 'Path for persisted bridge credentials')
45
+ .option('--server-id <id>', 'Server id')
46
+ .option('--server-slug <slug>', 'Server slug')
47
+ .option('--server-name <name>', 'Server name')
48
+ .option('--version <semver>', 'Running package version')
49
+ .option('--core-url <url>', 'Local core HTTP URL')
50
+ .action(async (opts) => {
51
+ await runBridge({
52
+ hubUrl: opts.hubUrl,
53
+ token: opts.token,
54
+ credentialPath: opts.credentialPath,
55
+ serverId: opts.serverId,
56
+ serverSlug: opts.serverSlug,
57
+ serverName: opts.serverName,
58
+ version: opts.version,
59
+ coreUrl: opts.coreUrl,
60
+ });
61
+ });
62
+ const inbox = program.command('inbox').description('Inbox peek helpers');
63
+ inbox.command('check')
64
+ .description('Peek pending inbox surfaces without advancing read checkpoints')
65
+ .option('--channel <target>', 'Optional channel, DM, or thread target filter')
66
+ .option('--limit <n>', 'Max surfaces to list')
67
+ .action(async (opts) => {
68
+ const runtime = createRuntime(program, options);
69
+ const params = new URLSearchParams();
70
+ const channel = typeof opts.channel === 'string' ? opts.channel.trim() : '';
71
+ if (channel)
72
+ params.set('channel', channel);
73
+ const limit = parsePositiveInteger('limit', opts.limit);
74
+ if (limit !== undefined)
75
+ params.set('limit', String(Math.min(limit, 100)));
76
+ const qs = params.toString();
77
+ const response = await runtime.client.request('GET', `/api/internal/agent/${encodeURIComponent(runtime.context.agentId)}/inbox${qs ? `?${qs}` : ''}`);
78
+ if (!response.ok)
79
+ throw responseError(response, 'inbox check failed');
80
+ writeOutput(runtime, summarizeInboxCheck(response.data), response.data);
81
+ });
82
+ inbox.command('wait')
83
+ .description('Wait once for pending inbox surfaces without advancing read checkpoints')
84
+ .option('--channel <target>', 'Optional channel, DM, or thread target filter')
85
+ .option('--limit <n>', 'Max surfaces to list')
86
+ .option('--timeout <s>', 'Max seconds to wait before exiting', '30')
87
+ .action(async (opts) => {
88
+ const runtime = createRuntime(program, options);
89
+ const params = new URLSearchParams();
90
+ const channel = typeof opts.channel === 'string' ? opts.channel.trim() : '';
91
+ if (channel)
92
+ params.set('channel', channel);
93
+ const limit = parsePositiveInteger('limit', opts.limit);
94
+ if (limit !== undefined)
95
+ params.set('limit', String(Math.min(limit, 100)));
96
+ const timeoutSeconds = parseNonNegativeInteger('timeout', opts.timeout) ?? 30;
97
+ params.set('timeout_ms', String(Math.min(timeoutSeconds * 1000, 60000)));
98
+ const qs = params.toString();
99
+ const response = await runtime.client.request('GET', `/api/internal/agent/${encodeURIComponent(runtime.context.agentId)}/inbox/wait${qs ? `?${qs}` : ''}`, undefined, { retry: 'never' });
100
+ if (!response.ok)
101
+ throw responseError(response, 'inbox wait failed');
102
+ writeOutput(runtime, summarizeInboxWait(response.data), response.data);
103
+ });
104
+ const self = program.command('self').description('Current agent self-state helpers');
105
+ self.command('state')
106
+ .description('Print self-state report for the current conversation')
107
+ .action(async () => {
108
+ const runtime = createRuntime(program, options);
109
+ const params = new URLSearchParams();
110
+ if (runtime.context.conversationId)
111
+ params.set('conversationId', runtime.context.conversationId);
112
+ const qs = params.toString();
113
+ const response = await runtime.client.request('GET', `/api/internal/agent/${encodeURIComponent(runtime.context.agentId)}/self-state${qs ? `?${qs}` : ''}`);
114
+ if (!response.ok)
115
+ throw responseError(response, 'self state failed');
116
+ writeOutput(runtime, summarizeSelfState(response.data), response.data);
117
+ });
118
+ const runtimeCommand = program.command('runtime').description('Runtime presence helpers');
119
+ runtimeCommand.command('presence')
120
+ .description('Print runtime presence report for the current conversation')
121
+ .action(async () => {
122
+ const runtime = createRuntime(program, options);
123
+ const params = new URLSearchParams();
124
+ if (runtime.context.conversationId)
125
+ params.set('conversationId', runtime.context.conversationId);
126
+ const qs = params.toString();
127
+ const response = await runtime.client.request('GET', `/api/internal/agent/${encodeURIComponent(runtime.context.agentId)}/runtime-presence${qs ? `?${qs}` : ''}`);
128
+ if (!response.ok)
129
+ throw responseError(response, 'runtime presence failed');
130
+ writeOutput(runtime, summarizeRuntimePresence(response.data), response.data);
131
+ });
132
+ const conversation = program.command('conversation').description('Conversation discovery and summary helpers');
133
+ conversation.command('list')
134
+ .description('List conversations visible to the current agent')
135
+ .option('--status <status>', 'Filter by status: all, idle, queued, active, recovering, awaiting_approval, failed', 'all')
136
+ .action(async (opts) => {
137
+ const runtime = createRuntime(program, options);
138
+ const status = typeof opts.status === 'string' ? opts.status.trim() : 'all';
139
+ const params = new URLSearchParams();
140
+ if (status !== 'all')
141
+ params.set('status', status);
142
+ const qs = params.toString();
143
+ const response = await runtime.client.request('GET', `/api/internal/agent/${encodeURIComponent(runtime.context.agentId)}/my-conversations${qs ? `?${qs}` : ''}`);
144
+ if (!response.ok)
145
+ throw responseError(response, 'list conversations failed');
146
+ writeOutput(runtime, summarizeConversationList(response.data), response.data);
147
+ });
148
+ conversation.command('summary')
149
+ .description('Fetch a summary for a target or conversation id')
150
+ .option('--target <target>', 'Conversation target such as #general, dm:@name, or thread target')
151
+ .option('--conversation-id <id>', 'Conversation id')
152
+ .action(async (opts) => {
153
+ const runtime = createRuntime(program, options);
154
+ const target = typeof opts.target === 'string' ? opts.target.trim() : '';
155
+ const conversationId = typeof opts.conversationId === 'string' ? opts.conversationId.trim() : '';
156
+ if (!target && !conversationId) {
157
+ throw new AgentCommandError(AGENT_COMMAND_ERROR_CODES.INVALID_ARG, 'conversation summary requires --target or --conversation-id.', { suggestedNextAction: 'Pass a target such as --target #general or --conversation-id conv-123.' });
158
+ }
159
+ const params = new URLSearchParams();
160
+ if (target)
161
+ params.set('target', target);
162
+ if (conversationId)
163
+ params.set('conversation_id', conversationId);
164
+ const response = await runtime.client.request('GET', `/api/internal/agent/${encodeURIComponent(runtime.context.agentId)}/conversation-summary?${params.toString()}`);
165
+ if (!response.ok)
166
+ throw responseError(response, 'conversation summary failed');
167
+ writeOutput(runtime, summarizeConversationSummary(response.data), response.data);
168
+ });
169
+ const context = program.command('context').description('Context bundle helpers');
170
+ context.command('bundle')
171
+ .description('Build a context bundle for the current conversation')
172
+ .option('--max-surfaces <n>', 'Max neighboring surfaces to include')
173
+ .option('--max-tasks <n>', 'Max related tasks to include')
174
+ .option('--max-handoffs <n>', 'Max related handoffs to include')
175
+ .action(async (opts) => {
176
+ const runtime = createRuntime(program, options);
177
+ const conversationId = runtime.context.conversationId?.trim();
178
+ if (!conversationId) {
179
+ throw new AgentCommandError(AGENT_COMMAND_ERROR_CODES.MISSING_CONVERSATION_ID, 'context bundle requires BIGBANG_CONVERSATION_ID.', { suggestedNextAction: 'Run this command from an Bigbang managed conversation runtime.' });
180
+ }
181
+ const body = { conversationId };
182
+ const maxSurfaces = parsePositiveInteger('max-surfaces', opts.maxSurfaces);
183
+ if (maxSurfaces !== undefined)
184
+ body.maxSurfaces = maxSurfaces;
185
+ const maxTasks = parsePositiveInteger('max-tasks', opts.maxTasks);
186
+ if (maxTasks !== undefined)
187
+ body.maxTasks = maxTasks;
188
+ const maxHandoffs = parsePositiveInteger('max-handoffs', opts.maxHandoffs);
189
+ if (maxHandoffs !== undefined)
190
+ body.maxHandoffs = maxHandoffs;
191
+ const response = await runtime.client.request('POST', `/api/internal/agent/${encodeURIComponent(runtime.context.agentId)}/context-bundle`, body);
192
+ if (!response.ok)
193
+ throw responseError(response, 'context bundle failed');
194
+ writeOutput(runtime, summarizeContextBundle(response.data), response.data);
195
+ });
196
+ const draft = program.command('draft').description('Draft message helpers');
197
+ const draftHeld = draft.command('held').description('Held message draft operations');
198
+ draftHeld.command('list')
199
+ .description('List held message drafts for the current agent')
200
+ .option('--status <status>', 'Draft status filter')
201
+ .option('--limit <n>', 'Max drafts to return')
202
+ .action(async (opts) => {
203
+ const runtime = createRuntime(program, options);
204
+ const params = new URLSearchParams();
205
+ const status = typeof opts.status === 'string' ? opts.status.trim() : '';
206
+ if (status)
207
+ params.set('status', status);
208
+ const limit = parsePositiveInteger('limit', opts.limit);
209
+ if (limit !== undefined)
210
+ params.set('limit', String(Math.min(limit, 100)));
211
+ const qs = params.toString();
212
+ const response = await runtime.client.request('GET', `/api/internal/agent/${encodeURIComponent(runtime.context.agentId)}/held-message-drafts${qs ? `?${qs}` : ''}`);
213
+ if (!response.ok)
214
+ throw responseError(response, 'list held message drafts failed');
215
+ writeOutput(runtime, summarizeHeldMessageDrafts(response.data), response.data);
216
+ });
217
+ const handoff = program.command('handoff').description('Conversation handoff operations');
218
+ handoff.command('create')
219
+ .description('Create a handoff from stdin JSON (target, mode, goal, optional context)')
220
+ .action(async () => {
221
+ const runtime = createRuntime(program, options);
222
+ const stdin = await readRequiredJsonStdin(runtime.io.stdin, 'handoff create JSON payload');
223
+ if (!stdin || typeof stdin !== 'object' || Array.isArray(stdin)) {
224
+ throw new AgentCommandError(AGENT_COMMAND_ERROR_CODES.INVALID_JSON_STDIN, 'handoff create JSON payload must be an object.', { suggestedNextAction: 'Pipe an object such as {"target":"#review","mode":"delegate_only","goal":"Review the plan."}' });
225
+ }
226
+ const body = appendCommonBody(runtime, {
227
+ ...stdin,
228
+ conversationId: typeof stdin.conversationId === 'string' ? stdin.conversationId.trim() : runtime.context.conversationId,
229
+ });
230
+ const response = await runtime.client.request('POST', `/api/internal/agent/${encodeURIComponent(runtime.context.agentId)}/handoff`, body);
231
+ if (!response.ok)
232
+ throw responseError(response, 'handoff create failed');
233
+ writeOutput(runtime, summarizeHandoffCreate(response.data), response.data);
234
+ });
235
+ handoff.command('status')
236
+ .description('Read the status of a handoff by id')
237
+ .argument('<handoff-id>', 'Handoff id')
238
+ .action(async (handoffId) => {
239
+ const runtime = createRuntime(program, options);
240
+ const response = await runtime.client.request('GET', `/api/internal/agent/${encodeURIComponent(runtime.context.agentId)}/handoffs/${encodeURIComponent(handoffId)}`);
241
+ if (!response.ok)
242
+ throw responseError(response, 'handoff status failed');
243
+ writeOutput(runtime, summarizeHandoffStatus(response.data), response.data);
244
+ });
245
+ }
246
+ function parseInstallPackagesOption(value) {
247
+ if (typeof value !== 'string' || !value.trim())
248
+ return [];
249
+ return value
250
+ .split(',')
251
+ .map((item) => item.trim())
252
+ .filter(Boolean);
253
+ }
@@ -0,0 +1,3 @@
1
+ import type { Command } from 'commander';
2
+ import type { BuildBigbangProgramOptions } from '../cliSupport.js';
3
+ export declare function registerMemoryCommands(program: Command, options: BuildBigbangProgramOptions): void;
@@ -0,0 +1,154 @@
1
+ import { appendCommonBody, createRuntime, parseNumber, parsePositiveInteger, parseRequiredNumber, requireString, responseError, writeOutput, } from '../cliSupport.js';
2
+ function summarizeMemoryNode(node) {
3
+ const topic = typeof node.topic === 'string' ? node.topic : '(untitled)';
4
+ const status = typeof node.status === 'string' ? node.status : 'unknown';
5
+ const category = typeof node.category === 'string' ? node.category : 'unknown';
6
+ const importance = typeof node.importance === 'number' ? node.importance.toFixed(2) : '?';
7
+ const nodeId = typeof node.nodeId === 'string' ? node.nodeId : '';
8
+ return `${nodeId} [${status}/${category}] ${topic} (importance ${importance})`;
9
+ }
10
+ function summarizeMemoryEdge(edge) {
11
+ const edgeId = typeof edge.edgeId === 'string' ? edge.edgeId : '';
12
+ const relation = typeof edge.relation === 'string' ? edge.relation : 'related_to';
13
+ const source = typeof edge.sourceNodeId === 'string' ? edge.sourceNodeId : '';
14
+ const target = typeof edge.targetNodeId === 'string' ? edge.targetNodeId : '';
15
+ return `${edgeId} ${source} -${relation}-> ${target}`;
16
+ }
17
+ export function registerMemoryCommands(program, options) {
18
+ const memory = program.command('memory').description('Memory network operations');
19
+ const node = memory.command('node').description('Memory node operations');
20
+ const edge = memory.command('edge').description('Memory edge operations');
21
+ node.command('create')
22
+ .description('Create a memory node')
23
+ .requiredOption('--topic <topic>', 'Memory topic')
24
+ .requiredOption('--summary <summary>', 'Memory summary')
25
+ .requiredOption('--category <category>', 'Memory category')
26
+ .option('--importance <value>', 'Importance 0-1', parseNumber)
27
+ .option('--source-message-id <id>', 'Source message id')
28
+ .option('--source-snippet <snippet>', 'Source message snippet')
29
+ .option('--status <status>', 'Node status (draft/confirmed/retired)', 'draft')
30
+ .action(async (opts) => {
31
+ const runtime = createRuntime(program, options);
32
+ const body = appendCommonBody(runtime, {
33
+ topic: requireString(opts.topic, '--topic'),
34
+ summary: requireString(opts.summary, '--summary'),
35
+ category: requireString(opts.category, '--category'),
36
+ ...(opts.importance != null ? { importance: opts.importance } : {}),
37
+ ...(opts.sourceMessageId ? { sourceMessageId: opts.sourceMessageId } : {}),
38
+ ...(opts.sourceSnippet ? { sourceSnippet: opts.sourceSnippet } : {}),
39
+ status: opts.status ?? 'draft',
40
+ });
41
+ const response = await runtime.client.request('POST', `/api/internal/agent/${encodeURIComponent(runtime.context.agentId)}/memory/nodes`, body);
42
+ if (!response.ok)
43
+ throw responseError(response, 'memory node create');
44
+ const created = response.data;
45
+ writeOutput(runtime, summarizeMemoryNode(created), created);
46
+ });
47
+ node.command('list')
48
+ .description('List memory nodes')
49
+ .option('--category <category>', 'Filter by category')
50
+ .option('--status <status>', 'Filter by status')
51
+ .option('--since <timestamp>', 'Filter by updated_at >= timestamp', parsePositiveInteger)
52
+ .action(async (opts) => {
53
+ const runtime = createRuntime(program, options);
54
+ const params = new URLSearchParams();
55
+ if (opts.category)
56
+ params.set('category', opts.category);
57
+ if (opts.status)
58
+ params.set('status', opts.status);
59
+ if (opts.since != null)
60
+ params.set('since', String(opts.since));
61
+ const qs = params.toString();
62
+ const response = await runtime.client.request('GET', `/api/internal/agent/${encodeURIComponent(runtime.context.agentId)}/memory/nodes${qs ? `?${qs}` : ''}`);
63
+ if (!response.ok)
64
+ throw responseError(response, 'memory node list');
65
+ const payload = response.data;
66
+ const nodes = payload.nodes ?? [];
67
+ writeOutput(runtime, nodes.map(summarizeMemoryNode).join('\n') || 'No memory nodes.', payload);
68
+ });
69
+ node.command('update')
70
+ .description('Update a memory node')
71
+ .argument('<node_id>', 'Memory node id')
72
+ .option('--reinforce', 'Reinforce memory')
73
+ .option('--retire', 'Retire memory')
74
+ .option('--confirm', 'Confirm draft memory')
75
+ .option('--topic <topic>', 'Update topic')
76
+ .option('--summary <summary>', 'Update summary')
77
+ .option('--importance <value>', 'Update importance', parseNumber)
78
+ .action(async (nodeId, opts) => {
79
+ const runtime = createRuntime(program, options);
80
+ const body = appendCommonBody(runtime, {
81
+ ...(opts.reinforce ? { reinforce: true } : {}),
82
+ ...(opts.retire ? { retire: true } : {}),
83
+ ...(opts.confirm ? { confirm: true } : {}),
84
+ ...(opts.topic ? { topic: opts.topic } : {}),
85
+ ...(opts.summary ? { summary: opts.summary } : {}),
86
+ ...(opts.importance != null ? { importance: opts.importance } : {}),
87
+ });
88
+ const response = await runtime.client.request('PATCH', `/api/internal/agent/${encodeURIComponent(runtime.context.agentId)}/memory/nodes/${encodeURIComponent(nodeId)}`, body);
89
+ if (!response.ok)
90
+ throw responseError(response, 'memory node update');
91
+ const updated = response.data;
92
+ writeOutput(runtime, summarizeMemoryNode(updated), updated);
93
+ });
94
+ node.command('search')
95
+ .description('Search memory nodes')
96
+ .requiredOption('--query <query>', 'Search query')
97
+ .action(async (opts) => {
98
+ const runtime = createRuntime(program, options);
99
+ const params = new URLSearchParams({ query: requireString(opts.query, '--query') });
100
+ const response = await runtime.client.request('GET', `/api/internal/agent/${encodeURIComponent(runtime.context.agentId)}/memory/nodes?${params.toString()}`);
101
+ if (!response.ok)
102
+ throw responseError(response, 'memory node search');
103
+ const payload = response.data;
104
+ const nodes = payload.nodes ?? [];
105
+ writeOutput(runtime, nodes.map(summarizeMemoryNode).join('\n') || 'No matching memory nodes.', payload);
106
+ });
107
+ edge.command('create')
108
+ .description('Create a memory edge')
109
+ .requiredOption('--source <node_id>', 'Source node id')
110
+ .requiredOption('--target <node_id>', 'Target node id')
111
+ .requiredOption('--relation <relation>', 'Edge relation')
112
+ .option('--strength <value>', 'Edge strength 0-1', parseNumber)
113
+ .action(async (opts) => {
114
+ const runtime = createRuntime(program, options);
115
+ const body = appendCommonBody(runtime, {
116
+ sourceNodeId: requireString(opts.source, '--source'),
117
+ targetNodeId: requireString(opts.target, '--target'),
118
+ relation: requireString(opts.relation, '--relation'),
119
+ ...(opts.strength != null ? { strength: opts.strength } : {}),
120
+ });
121
+ const response = await runtime.client.request('POST', `/api/internal/agent/${encodeURIComponent(runtime.context.agentId)}/memory/edges`, body);
122
+ if (!response.ok)
123
+ throw responseError(response, 'memory edge create');
124
+ const created = response.data;
125
+ writeOutput(runtime, summarizeMemoryEdge(created), created);
126
+ });
127
+ edge.command('list')
128
+ .description('List memory edges')
129
+ .option('--node <node_id>', 'Filter by node id')
130
+ .action(async (opts) => {
131
+ const runtime = createRuntime(program, options);
132
+ const params = new URLSearchParams();
133
+ if (opts.node)
134
+ params.set('node', opts.node);
135
+ const qs = params.toString();
136
+ const response = await runtime.client.request('GET', `/api/internal/agent/${encodeURIComponent(runtime.context.agentId)}/memory/edges${qs ? `?${qs}` : ''}`);
137
+ if (!response.ok)
138
+ throw responseError(response, 'memory edge list');
139
+ const payload = response.data;
140
+ const edges = payload.edges ?? [];
141
+ writeOutput(runtime, edges.map(summarizeMemoryEdge).join('\n') || 'No memory edges.', payload);
142
+ });
143
+ memory.command('dream-watermark')
144
+ .description('Report dream processing watermark')
145
+ .requiredOption('--seq <message_seq>', 'Last processed message seq', (value) => parseRequiredNumber('seq', value))
146
+ .action(async (opts) => {
147
+ const runtime = createRuntime(program, options);
148
+ const body = appendCommonBody(runtime, { seq: opts.seq });
149
+ const response = await runtime.client.request('POST', `/api/internal/agent/${encodeURIComponent(runtime.context.agentId)}/memory/dream-watermark`, body);
150
+ if (!response.ok)
151
+ throw responseError(response, 'memory dream-watermark');
152
+ writeOutput(runtime, `watermark seq=${opts.seq}`, response.data);
153
+ });
154
+ }
@@ -0,0 +1,3 @@
1
+ import { type Command } from 'commander';
2
+ import type { BuildBigbangProgramOptions } from '../cliSupport.js';
3
+ export declare function registerMessageCommands(program: Command, options: BuildBigbangProgramOptions): void;