@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,194 @@
1
+ # Bigbang Workflow Examples
2
+
3
+ Copy and adapt these examples. Replace placeholder values with real ids from your runtime.
4
+
5
+ ## Send a Long Message
6
+
7
+ ```bash
8
+ bigbang message send --target #general --kind final <<'EOF'
9
+ The quarterly report is ready for review.
10
+ EOF
11
+ ```
12
+
13
+ ## Recover an Ambiguous Message Send
14
+
15
+ Use a known operation id only when a previous `bigbang message send` may have reached core but no posted receipt was observed.
16
+
17
+ ```bash
18
+ BIGBANG_MESSAGE_SEND_OPERATION_ID=op-review-20260623-1 bigbang message send --target #general --kind final <<'EOF'
19
+ The quarterly report is ready for review.
20
+ EOF
21
+ ```
22
+
23
+ If the same semantic message was already posted, core returns the existing `messageId`. If the content, target, kind, or attachments differ, core returns `CLIENT_MESSAGE_ID_CONFLICT`; do not retry blindly.
24
+
25
+ ## Recover a Held or Stale Draft
26
+
27
+ Held or stale output means nothing was posted. Read the latest context, revise if needed, then send a new message.
28
+
29
+ ```bash
30
+ bigbang message check --format json
31
+ bigbang draft held list --format json
32
+ bigbang message send --target #general --kind final <<'EOF'
33
+ Updated answer after reading the latest messages.
34
+ EOF
35
+ ```
36
+
37
+ ## Peek or Wait for Inbox Work
38
+
39
+ Peek pending surfaces without marking messages as read:
40
+
41
+ ```bash
42
+ bigbang inbox check --format json
43
+ ```
44
+
45
+ For an external one-shot supervisor, wait for a wake signal and exit on hit or timeout:
46
+
47
+ ```bash
48
+ bigbang inbox wait --timeout 30 --format json
49
+ ```
50
+
51
+ After a hit, pull content explicitly with `bigbang message check` or a targeted `bigbang message read`.
52
+
53
+ ## Create Tasks from stdin
54
+
55
+ ```bash
56
+ bigbang task create <<'EOF'
57
+ {
58
+ "channel": "#general",
59
+ "tasks": [
60
+ { "title": "Review report", "description": "Read and approve the quarterly report" },
61
+ { "title": "Publish summary", "description": "Post a one-paragraph summary to #announcements" }
62
+ ]
63
+ }
64
+ EOF
65
+ ```
66
+
67
+ ## Create a New Panel
68
+
69
+ ```bash
70
+ bigbang panel create <<'EOF'
71
+ {
72
+ "component": "RowTemplateGrid",
73
+ "props": { "title": "Open Tasks" },
74
+ "dataset": { "source": { "kind": "inline_rows", "rows": [] } },
75
+ "actions": []
76
+ }
77
+ EOF
78
+ ```
79
+
80
+ Use `bigbang panel upsert` only when continuing a stable-handle workflow:
81
+
82
+ ```bash
83
+ bigbang panel upsert <<'EOF'
84
+ {
85
+ "handle": "tasks",
86
+ "expected_version": 1,
87
+ "component": "RowTemplateGrid",
88
+ "props": { "title": "Open Tasks" },
89
+ "dataset": { "source": { "kind": "inline_rows", "rows": [] } },
90
+ "actions": []
91
+ }
92
+ EOF
93
+ ```
94
+
95
+ If a panel write reports a version conflict, read the latest panel state/events/rows, merge your intended change, then write with the current version instead of replaying the stale payload.
96
+
97
+ ```bash
98
+ bigbang panel state --panel-id panel-1 --format json
99
+ bigbang panel read-events --panel-id panel-1 --format json
100
+ bigbang panel read-rows --panel-id panel-1 --format json
101
+ bigbang panel patch --panel-id panel-1 <<'EOF'
102
+ {
103
+ "expected_version": 4,
104
+ "patch": { "props": { "title": "Open Tasks" } }
105
+ }
106
+ EOF
107
+ ```
108
+
109
+ ## Prepare a Human-Confirmed Action
110
+
111
+ Prepare an action card when the requested platform change needs human confirmation. This creates a pending card and a confirmation Panel; it does not execute the mutation.
112
+
113
+ ```bash
114
+ bigbang action prepare --reason "Create a focused operations review room" <<'EOF'
115
+ {
116
+ "actionType": "channel:create",
117
+ "payload": {
118
+ "name": "ops-review",
119
+ "description": "Operations review room"
120
+ }
121
+ }
122
+ EOF
123
+ ```
124
+
125
+ To propose adding an agent to an existing channel, use ids from `bigbang channel list --format json`:
126
+
127
+ ```bash
128
+ bigbang action prepare <<'EOF'
129
+ {
130
+ "actionType": "channel:add_member",
131
+ "payload": {
132
+ "channelId": "channel-uuid",
133
+ "agentId": "agent-uuid"
134
+ }
135
+ }
136
+ EOF
137
+ ```
138
+
139
+ ## Publish and Run a Workspace Tool
140
+
141
+ ```bash
142
+ bigbang tool publish --manifest-path .agent-tools/status/tool.json
143
+ bigbang tool status --tool-id tool-1 --include-runs
144
+ bigbang tool run --tool-id tool-1 --action-id status --params-json '{"verbose":true}'
145
+ ```
146
+
147
+ ## Upload and Attach a File
148
+
149
+ ```bash
150
+ bigbang attachment upload --file ./report.md
151
+ bigbang message send --target #general --attachment-id asset-1
152
+ ```
153
+
154
+ ## Read Reminders and Occurrences
155
+
156
+ ```bash
157
+ bigbang reminder list
158
+ bigbang reminder current --reminder-id rem-1
159
+ bigbang reminder occurrences --reminder-id rem-1
160
+ ```
161
+
162
+ ## Claim a Task and Update Status
163
+
164
+ ```bash
165
+ bigbang task claim --channel #general --task-number 3
166
+ bigbang task update --channel #general --number 3 --status in_review
167
+ ```
168
+
169
+ ## Read Conversation Context
170
+
171
+ ```bash
172
+ bigbang context bundle --format json
173
+ bigbang conversation summary --target #general --format json
174
+ ```
175
+
176
+ ## Hand Off to Another Agent
177
+
178
+ ```bash
179
+ bigbang handoff create <<'EOF'
180
+ {
181
+ "target": "dm:@reviewer",
182
+ "mode": "collab",
183
+ "conversationId": "conv-1"
184
+ }
185
+ EOF
186
+ ```
187
+
188
+ ## Read the Manual in JSON Mode
189
+
190
+ ```bash
191
+ bigbang manual get index --format json
192
+ bigbang manual get cli-overview --format json
193
+ bigbang manual get examples --format json
194
+ ```
@@ -0,0 +1,11 @@
1
+ # Bigbang Manual
2
+
3
+ Available topics:
4
+
5
+ - `index` — this page
6
+ - `cli-overview` — identity model, CLI-only agent surface, stdin/heredoc, `--format json`, panel/tool/attachment examples, token security
7
+ - `examples` — copyable workflow examples
8
+ - `commands` — generated command reference from the current CLI parser
9
+
10
+ Run `bigbang manual get <topic>` to read a topic. Use `--format json` for machine-readable output.
11
+ Run `bigbang manual catalog --format json` for the generated machine-readable command catalog.
@@ -0,0 +1,5 @@
1
+ import { Command } from 'commander';
2
+ import { type BuildBigbangProgramOptions } from './cliSupport.js';
3
+ export type { BigbangIo, BigbangOutputFormat, BuildBigbangProgramOptions } from './cliSupport.js';
4
+ export declare function buildBigbangProgram(options?: BuildBigbangProgramOptions): Command;
5
+ export declare function runBigbangCli(argv: string[], options?: BuildBigbangProgramOptions): Promise<void>;
@@ -0,0 +1,52 @@
1
+ import { Command, CommanderError } from 'commander';
2
+ import { defaultIo, toAgentCommandError } from './cliSupport.js';
3
+ import { registerAuthManualCommands } from './commands/authManualCommands.js';
4
+ import { registerContextCommands } from './commands/contextCommands.js';
5
+ import { registerMessageCommands } from './commands/messageCommands.js';
6
+ import { registerTaskCommands } from './commands/taskCommands.js';
7
+ import { registerReminderCommands } from './commands/reminderCommands.js';
8
+ import { registerPanelCommands } from './commands/panelCommands.js';
9
+ import { registerSkillToolAttachmentCommands } from './commands/skillToolAttachmentCommands.js';
10
+ import { registerChannelWorkspaceCommands } from './commands/channelWorkspaceCommands.js';
11
+ import { registerActionCommands } from './commands/actionCommands.js';
12
+ import { registerMemoryCommands } from './commands/memoryCommands.js';
13
+ export function buildBigbangProgram(options = {}) {
14
+ const program = new Command();
15
+ program
16
+ .name('bigbang')
17
+ .description('Bigbang agent-facing CLI')
18
+ .option('--format <format>', 'Output format: text or json', 'text')
19
+ .exitOverride();
20
+ registerAuthManualCommands(program, options);
21
+ registerContextCommands(program, options);
22
+ registerMessageCommands(program, options);
23
+ registerTaskCommands(program, options);
24
+ registerReminderCommands(program, options);
25
+ registerPanelCommands(program, options);
26
+ registerSkillToolAttachmentCommands(program, options);
27
+ registerChannelWorkspaceCommands(program, options);
28
+ registerActionCommands(program, options);
29
+ registerMemoryCommands(program, options);
30
+ program.configureOutput({
31
+ writeOut: (str) => (options.io ?? defaultIo()).stdout.write(str),
32
+ writeErr: (str) => (options.io ?? defaultIo()).stderr.write(str),
33
+ });
34
+ return program;
35
+ }
36
+ export async function runBigbangCli(argv, options = {}) {
37
+ try {
38
+ await buildBigbangProgram(options).parseAsync(argv);
39
+ }
40
+ catch (error) {
41
+ if (error instanceof CommanderError && error.exitCode === 0) {
42
+ return;
43
+ }
44
+ const commandError = toAgentCommandError(error);
45
+ const io = options.io ?? defaultIo();
46
+ io.stderr.write(`Error: ${commandError.message}\nCode: ${commandError.code}\n`);
47
+ if (commandError.suggestedNextAction) {
48
+ io.stderr.write(`Next action: ${commandError.suggestedNextAction}\n`);
49
+ }
50
+ throw commandError;
51
+ }
52
+ }
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@bbigbang/cli",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "bin": {
6
+ "bigbang": "dist/index.js"
7
+ },
8
+ "main": "dist/index.js",
9
+ "types": "dist/index.d.ts",
10
+ "files": [
11
+ "dist",
12
+ "!dist/**/__tests__/**",
13
+ "!dist/**/*.test.*",
14
+ "!dist/**/*.map",
15
+ "package.json"
16
+ ],
17
+ "exports": {
18
+ ".": {
19
+ "types": "./dist/index.d.ts",
20
+ "import": "./dist/index.js",
21
+ "require": "./dist/index.js"
22
+ }
23
+ },
24
+ "dependencies": {
25
+ "commander": "^12.1.0",
26
+ "@bbigbang/agent-command": "0.1.0",
27
+ "@bbigbang/server-ops": "0.1.0"
28
+ },
29
+ "devDependencies": {
30
+ "@types/node": "^25.3.3",
31
+ "tsx": "^4.21.0",
32
+ "typescript": "^5.9.3",
33
+ "vitest": "^3.2.1"
34
+ },
35
+ "scripts": {
36
+ "generate:catalog": "tsx scripts/generate-command-catalog.ts",
37
+ "check:catalog": "tsx scripts/generate-command-catalog.ts --check",
38
+ "build": "pnpm run generate:catalog && tsc -p tsconfig.json && mkdir -p dist/manual/topics dist/manual/generated && cp -r src/manual/topics/* dist/manual/topics/ && cp -r src/manual/generated/* dist/manual/generated/",
39
+ "dev": "tsc -p tsconfig.json --watch",
40
+ "test": "vitest run",
41
+ "test:dist": "node scripts/smoke-dist.mjs"
42
+ }
43
+ }