@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.
- package/dist/cliSupport.d.ts +166 -0
- package/dist/cliSupport.js +1306 -0
- package/dist/commandCatalog.d.ts +36 -0
- package/dist/commandCatalog.js +152 -0
- package/dist/commands/actionCommands.d.ts +3 -0
- package/dist/commands/actionCommands.js +43 -0
- package/dist/commands/authManualCommands.d.ts +3 -0
- package/dist/commands/authManualCommands.js +60 -0
- package/dist/commands/channelWorkspaceCommands.d.ts +3 -0
- package/dist/commands/channelWorkspaceCommands.js +105 -0
- package/dist/commands/contextCommands.d.ts +3 -0
- package/dist/commands/contextCommands.js +253 -0
- package/dist/commands/memoryCommands.d.ts +3 -0
- package/dist/commands/memoryCommands.js +154 -0
- package/dist/commands/messageCommands.d.ts +3 -0
- package/dist/commands/messageCommands.js +241 -0
- package/dist/commands/panelCommands.d.ts +3 -0
- package/dist/commands/panelCommands.js +218 -0
- package/dist/commands/reminderCommands.d.ts +3 -0
- package/dist/commands/reminderCommands.js +220 -0
- package/dist/commands/skillToolAttachmentCommands.d.ts +3 -0
- package/dist/commands/skillToolAttachmentCommands.js +261 -0
- package/dist/commands/taskCommands.d.ts +3 -0
- package/dist/commands/taskCommands.js +195 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +8 -0
- package/dist/manual/generated/command-catalog.json +12452 -0
- package/dist/manual/topics/cli-overview.md +116 -0
- package/dist/manual/topics/commands.md +706 -0
- package/dist/manual/topics/examples.md +194 -0
- package/dist/manual/topics/index.md +11 -0
- package/dist/program.d.ts +5 -0
- package/dist/program.js +52 -0
- package/package.json +43 -0
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { AGENT_COMMAND_ERROR_CODES, AgentApiClient, AgentCommandError, formatBigbangReceipt, formatMessageHeld, formatPanelVersionConflict, formatTaskHeld, readOptionalStdin, readRequiredJsonStdin, readRequiredStdin, toAgentCommandError, type AgentApiResponse, type AgentApiRetryMode, type AgentCommandContext, type AgentCommandEnv, type StdinLike } from '@bbigbang/agent-command';
|
|
3
|
+
export type BigbangOutputFormat = 'text' | 'json';
|
|
4
|
+
export interface BigbangIo {
|
|
5
|
+
stdin: StdinLike;
|
|
6
|
+
stdout: Pick<NodeJS.WriteStream, 'write'>;
|
|
7
|
+
stderr: Pick<NodeJS.WriteStream, 'write'>;
|
|
8
|
+
}
|
|
9
|
+
export interface BuildBigbangProgramOptions {
|
|
10
|
+
env?: AgentCommandEnv;
|
|
11
|
+
readFile?: (path: string) => string;
|
|
12
|
+
fetch?: typeof fetch;
|
|
13
|
+
sleep?: (ms: number) => Promise<void>;
|
|
14
|
+
io?: BigbangIo;
|
|
15
|
+
}
|
|
16
|
+
export interface Runtime {
|
|
17
|
+
context: AgentCommandContext;
|
|
18
|
+
runId?: string;
|
|
19
|
+
turnId?: string;
|
|
20
|
+
traceId?: string;
|
|
21
|
+
client: AgentApiClient;
|
|
22
|
+
fetch: typeof fetch;
|
|
23
|
+
env: AgentCommandEnv;
|
|
24
|
+
sleep: (ms: number) => Promise<void>;
|
|
25
|
+
readFile: (path: string) => string;
|
|
26
|
+
io: BigbangIo;
|
|
27
|
+
outputFormat: BigbangOutputFormat;
|
|
28
|
+
}
|
|
29
|
+
export declare const MANUAL_TOPICS: readonly ["index", "cli-overview", "examples", "commands"];
|
|
30
|
+
export type ManualTopic = (typeof MANUAL_TOPICS)[number];
|
|
31
|
+
export declare const MANUAL_TOPICS_DIR: string;
|
|
32
|
+
export declare const MANUAL_GENERATED_DIR: string;
|
|
33
|
+
export declare function manualTopicPath(topic: string): string;
|
|
34
|
+
export declare function commandCatalogPath(): string;
|
|
35
|
+
export declare function readManualTopic(runtime: Runtime, topic: string): string;
|
|
36
|
+
export declare function readCommandCatalog(runtime: Runtime): unknown;
|
|
37
|
+
export declare function isManualTopic(topic: string): topic is ManualTopic;
|
|
38
|
+
export declare const ATTACHMENT_UPLOAD_MAX_BYTES: number;
|
|
39
|
+
export declare const ATTACHMENT_TEXT_PREVIEW_MAX_CHARS = 4000;
|
|
40
|
+
export declare const MUTATION_HINTS: {
|
|
41
|
+
readonly messageSend: "Next: run `bigbang message check` for replies.";
|
|
42
|
+
readonly taskCreate: "Next: run `bigbang task list` to review created tasks.";
|
|
43
|
+
readonly taskClaim: "Next: run `bigbang task update --status in_progress` to start work.";
|
|
44
|
+
readonly panelInspect: "Next: run `bigbang panel read-rows --panel-id <id>` to inspect.";
|
|
45
|
+
readonly toolPublish: "Next: run `bigbang tool status --tool-id <id>` to verify.";
|
|
46
|
+
readonly attachmentUpload: "Next: run `bigbang message send --attachment-id <id>` to share it.";
|
|
47
|
+
readonly actionPrepare: "Next: wait for a human admin to confirm or cancel the action card.";
|
|
48
|
+
};
|
|
49
|
+
export declare function withHint(text: string, hint: string): string;
|
|
50
|
+
export declare const MIME_BY_EXTENSION: Record<string, string>;
|
|
51
|
+
export declare function defaultIo(): BigbangIo;
|
|
52
|
+
export declare function parseOutputFormat(raw: unknown): BigbangOutputFormat;
|
|
53
|
+
export declare function writeOutput(runtime: Runtime, text: string, data: unknown): void;
|
|
54
|
+
export declare function writeJson(runtime: Runtime, data: unknown): void;
|
|
55
|
+
export declare function writeReceipt(runtime: Runtime, receipt: Parameters<typeof formatBigbangReceipt>[0]): void;
|
|
56
|
+
export declare function createRuntime(program: Command, options: BuildBigbangProgramOptions): Runtime;
|
|
57
|
+
export declare function repeatOption(value: string, previous?: string[]): string[];
|
|
58
|
+
export declare function parsePositiveInteger(name: string, raw: unknown): number | undefined;
|
|
59
|
+
export declare function parseRequiredPositiveInteger(name: string, raw: unknown): number;
|
|
60
|
+
export declare function parsePositiveIntegerList(name: string, raw: unknown): number[] | undefined;
|
|
61
|
+
export declare function parseNumber(name: string, raw: unknown): number | undefined;
|
|
62
|
+
export declare function parseRequiredNumber(name: string, raw: unknown): number;
|
|
63
|
+
export declare function parseNonNegativeInteger(name: string, raw: unknown): number | undefined;
|
|
64
|
+
export declare function requireString(value: unknown, flag: string): string;
|
|
65
|
+
export declare function requireConversationId(runtime: Runtime, commandName: string): string;
|
|
66
|
+
export declare function responseError(response: AgentApiResponse, fallback: string): AgentCommandError;
|
|
67
|
+
export declare function buildCoreUrl(runtime: Runtime, path: string): string;
|
|
68
|
+
export declare function fetchJsonRaw(runtime: Runtime, path: string, init?: RequestInit, options?: {
|
|
69
|
+
retry?: AgentApiRetryMode;
|
|
70
|
+
}): Promise<AgentApiResponse>;
|
|
71
|
+
export declare function fetchBinaryRaw(runtime: Runtime, path: string, options?: {
|
|
72
|
+
retry?: AgentApiRetryMode;
|
|
73
|
+
}): Promise<{
|
|
74
|
+
ok: true;
|
|
75
|
+
status: number;
|
|
76
|
+
buffer: Buffer;
|
|
77
|
+
contentType: string;
|
|
78
|
+
} | {
|
|
79
|
+
ok: false;
|
|
80
|
+
status: number;
|
|
81
|
+
error: string;
|
|
82
|
+
}>;
|
|
83
|
+
export declare function isHeldResponse(data: unknown): boolean;
|
|
84
|
+
export declare function isSuppressedResponse(data: unknown): boolean;
|
|
85
|
+
export declare function isVersionConflict(response: AgentApiResponse): boolean;
|
|
86
|
+
export declare function isMessageNotResolved(response: AgentApiResponse): boolean;
|
|
87
|
+
export declare function appendCommonBody(runtime: Runtime, body: Record<string, unknown>): Record<string, unknown>;
|
|
88
|
+
export declare function appendRunContextParams(runtime: Runtime, params: URLSearchParams): URLSearchParams;
|
|
89
|
+
export declare function parseJsonStdinOrThrow<T>(runtime: Runtime, label: string): Promise<T>;
|
|
90
|
+
export declare function parseJsonStringOrThrow<T>(content: string, label: string): T;
|
|
91
|
+
export declare function parseJsonObjectStringOrThrow(content: string, label: string): Record<string, unknown>;
|
|
92
|
+
export declare function normalizeExpectedVersion(payload: Record<string, unknown>): Record<string, unknown>;
|
|
93
|
+
export declare function normalizePanelPayload(payload: Record<string, unknown>, commandName: string): Record<string, unknown>;
|
|
94
|
+
export declare function summarizePanelState(data: unknown): string;
|
|
95
|
+
export declare function summarizePanelCollaborators(data: unknown): string;
|
|
96
|
+
export declare function summarizeSkillList(data: unknown): string;
|
|
97
|
+
export declare function summarizeSkillFile(data: unknown): string;
|
|
98
|
+
export declare function normalizeAgentTaskStatus(raw: unknown): 'todo' | 'in_progress' | 'in_review';
|
|
99
|
+
export declare function normalizeTaskListStatus(raw: unknown): 'all' | 'todo' | 'in_progress' | 'in_review' | 'done';
|
|
100
|
+
export declare function normalizeTaskScope(raw: unknown): 'all' | 'dm' | 'channel';
|
|
101
|
+
export declare function summarizeTaskIdentity(task: Record<string, unknown> | null | undefined): string;
|
|
102
|
+
export declare function summarizeTaskSource(task: Record<string, unknown>): string;
|
|
103
|
+
export declare function summarizeTaskList(data: unknown, emptyText: string): string;
|
|
104
|
+
export declare function summarizeTaskLookup(data: unknown): string;
|
|
105
|
+
export declare function formatTaskHistoryEvent(event: Record<string, unknown>): string;
|
|
106
|
+
export declare function summarizeTaskHistory(data: unknown): string;
|
|
107
|
+
export declare function summarizeClaimResults(data: unknown): string;
|
|
108
|
+
export declare function normalizeReminderScheduleKind(raw: unknown): 'one_time' | 'recurring';
|
|
109
|
+
export declare function normalizeOptionalReminderScheduleKind(raw: unknown): 'one_time' | 'recurring' | undefined;
|
|
110
|
+
export declare function normalizeReminderIntervalUnit(raw: unknown): 'hour' | 'day' | 'week' | undefined;
|
|
111
|
+
export declare function parseSnoozeDuration(raw: unknown): {
|
|
112
|
+
until: number;
|
|
113
|
+
durationMs: number;
|
|
114
|
+
};
|
|
115
|
+
export declare function summarizeTimestamp(raw: unknown): string;
|
|
116
|
+
export declare function summarizeReminder(reminder: Record<string, unknown>): string;
|
|
117
|
+
export declare function summarizeReminderList(data: unknown): string;
|
|
118
|
+
export declare function summarizeOccurrence(label: string, occurrence: Record<string, unknown> | null | undefined): string;
|
|
119
|
+
export declare function summarizeReminderOccurrences(data: unknown): string;
|
|
120
|
+
export declare function summarizeReminderCurrent(data: unknown): string;
|
|
121
|
+
export declare function summarizeReminderAction(action: string, data: unknown, fallbackId?: string): string;
|
|
122
|
+
export declare function summarizeActionPrepare(data: unknown): string;
|
|
123
|
+
export declare function summarizeReminderLog(reminderId: string, data: unknown): string;
|
|
124
|
+
export declare function summarizeReminderSnooze(data: unknown): string;
|
|
125
|
+
export declare function summarizeWorkspaceInspect(data: unknown): string;
|
|
126
|
+
export declare function summarizeWorkspaceTree(data: unknown): string;
|
|
127
|
+
export declare function summarizeWorkspaceFile(data: unknown): string;
|
|
128
|
+
export declare function summarizeToolState(state: unknown): string;
|
|
129
|
+
export declare function summarizeToolRun(run: Record<string, unknown> | null | undefined): string;
|
|
130
|
+
export declare function summarizeToolStatus(data: unknown): string;
|
|
131
|
+
export declare function summarizeToolPublish(data: unknown): string;
|
|
132
|
+
export declare function summarizeToolVerification(data: unknown): string;
|
|
133
|
+
export declare function summarizeToolValidate(data: unknown): string;
|
|
134
|
+
export declare function summarizeToolAction(data: unknown, fallbackActionId: string): string;
|
|
135
|
+
export declare function inferMimeType(filePath: string): string;
|
|
136
|
+
export declare function formatSize(bytes: number): string;
|
|
137
|
+
export declare function isTextLikeMimeType(mimeType: string): boolean;
|
|
138
|
+
export declare function isTextLikeAttachment(mimeType: string, metadata: Record<string, unknown>, filename: string): boolean;
|
|
139
|
+
export declare function summarizeAttachmentUpload(data: unknown): string;
|
|
140
|
+
export declare function summarizeAttachmentView(params: {
|
|
141
|
+
attachmentId: string;
|
|
142
|
+
metadata: Record<string, unknown>;
|
|
143
|
+
buffer: Buffer;
|
|
144
|
+
contentType: string;
|
|
145
|
+
}): {
|
|
146
|
+
text: string;
|
|
147
|
+
data: unknown;
|
|
148
|
+
};
|
|
149
|
+
export declare function summarizeAttachmentComments(attachmentId: string, data: unknown): string;
|
|
150
|
+
export declare function summarizeServerDirectory(data: unknown): string;
|
|
151
|
+
export declare function summarizeInboxCheck(data: unknown): string;
|
|
152
|
+
export declare function summarizeInboxWait(data: unknown): string;
|
|
153
|
+
export declare function summarizeSelfState(data: unknown): string;
|
|
154
|
+
export declare function summarizeRuntimePresence(data: unknown): string;
|
|
155
|
+
export declare function summarizeConversationList(data: unknown): string;
|
|
156
|
+
export declare function summarizeConversationSummary(data: unknown): string;
|
|
157
|
+
export declare function summarizeContextBundle(data: unknown): string;
|
|
158
|
+
export declare function summarizeHeldMessageDrafts(data: unknown): string;
|
|
159
|
+
export declare function summarizeHandoffCreate(data: unknown): string;
|
|
160
|
+
export declare function summarizeHandoffStatus(data: unknown): string;
|
|
161
|
+
export declare function summarizePanelComponents(data: unknown): string;
|
|
162
|
+
export declare function summarizeChannelMembers(data: unknown): string;
|
|
163
|
+
export declare function summarizeChannelMutation(data: unknown, verb: 'joined' | 'left'): string;
|
|
164
|
+
export declare function summarizeThreadUnfollow(data: unknown): string;
|
|
165
|
+
export declare function appendReminderConversation(runtime: Runtime, commandName: string, body?: Record<string, unknown>): Record<string, unknown>;
|
|
166
|
+
export { AGENT_COMMAND_ERROR_CODES, AgentCommandError, formatMessageHeld, formatPanelVersionConflict, formatTaskHeld, readOptionalStdin, readRequiredJsonStdin, readRequiredStdin, toAgentCommandError, };
|