@botconnector/bccli 0.4.16 → 0.5.0-rc.4

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 (185) hide show
  1. package/LICENSE +203 -21
  2. package/THIRD_PARTY_NOTICES.md +9 -0
  3. package/branding.mjs +347 -0
  4. package/cli.mjs +120 -0
  5. package/core.mjs +260 -0
  6. package/credentials.mjs +52 -0
  7. package/gateway.mjs +2 -0
  8. package/model-command.mjs +61 -0
  9. package/package.json +35 -59
  10. package/provider-cli.mjs +77 -0
  11. package/providers.mjs +166 -0
  12. package/proxy.mjs +242 -0
  13. package/startup-menu.mjs +120 -0
  14. package/README.en.md +0 -253
  15. package/README.md +0 -250
  16. package/dist/abort.d.ts +0 -5
  17. package/dist/acp-JZW3XHE5.js +0 -221
  18. package/dist/acp.d.ts +0 -44
  19. package/dist/agent.d.ts +0 -147
  20. package/dist/agents.d.ts +0 -4
  21. package/dist/args-XVO7TB4C.js +0 -13
  22. package/dist/args.d.ts +0 -59
  23. package/dist/budget.d.ts +0 -26
  24. package/dist/checkpoints.d.ts +0 -35
  25. package/dist/chunk-3CYQYHPK.js +0 -202
  26. package/dist/chunk-6JK4IBGK.js +0 -1075
  27. package/dist/chunk-6SDRWEPN.js +0 -50
  28. package/dist/chunk-7GM6NN5E.js +0 -341
  29. package/dist/chunk-7XD47KN5.js +0 -71
  30. package/dist/chunk-INMSTUB2.js +0 -56
  31. package/dist/chunk-ISOKH5WB.js +0 -256
  32. package/dist/chunk-JUC3ZOCV.js +0 -50
  33. package/dist/chunk-KDVL2NP6.js +0 -861
  34. package/dist/chunk-KEKDRROL.js +0 -216
  35. package/dist/chunk-KJIXA6MP.js +0 -159
  36. package/dist/chunk-OK2USAXX.js +0 -88
  37. package/dist/chunk-PSO7R5AD.js +0 -10
  38. package/dist/chunk-Q42ZGVAQ.js +0 -91
  39. package/dist/chunk-R754XIBJ.js +0 -523
  40. package/dist/chunk-S3QEZDKB.js +0 -270
  41. package/dist/chunk-SWNRA3EW.js +0 -78
  42. package/dist/chunk-TLCL6DC7.js +0 -378
  43. package/dist/chunk-V5D6PJQN.js +0 -8
  44. package/dist/chunk-YYTFJUO2.js +0 -148
  45. package/dist/chunk-ZJRZTMJF.js +0 -2669
  46. package/dist/cli.d.ts +0 -1
  47. package/dist/cli.js +0 -233
  48. package/dist/clipboardImage.d.ts +0 -17
  49. package/dist/commands.d.ts +0 -16
  50. package/dist/completion-Q7VHOPPV.js +0 -125
  51. package/dist/completion.d.ts +0 -14
  52. package/dist/config-T7MKGJVG.js +0 -34
  53. package/dist/config-YYEAEN2C.js +0 -25
  54. package/dist/config.d.ts +0 -99
  55. package/dist/context.d.ts +0 -13
  56. package/dist/contextWindow.d.ts +0 -3
  57. package/dist/diff.d.ts +0 -7
  58. package/dist/exit.d.ts +0 -9
  59. package/dist/extensions.d.ts +0 -34
  60. package/dist/ghBotCli-7VUGI63S.js +0 -680
  61. package/dist/ghBotCli.d.ts +0 -9
  62. package/dist/ghBotDispatch.d.ts +0 -68
  63. package/dist/ghBotRunner.d.ts +0 -82
  64. package/dist/ghBotServe.d.ts +0 -21
  65. package/dist/ghBotWebhook.d.ts +0 -45
  66. package/dist/hooks.d.ts +0 -27
  67. package/dist/i18n/id.d.ts +0 -1
  68. package/dist/i18n.d.ts +0 -16
  69. package/dist/integrationCli-FBRSTF5F.js +0 -876
  70. package/dist/integrationCli.d.ts +0 -9
  71. package/dist/keybinds.d.ts +0 -22
  72. package/dist/login-BSMUGW7L.js +0 -18
  73. package/dist/login.d.ts +0 -21
  74. package/dist/lsp.d.ts +0 -73
  75. package/dist/mcp/catalog.d.ts +0 -14
  76. package/dist/mcp/config.d.ts +0 -36
  77. package/dist/mcp/manager.d.ts +0 -52
  78. package/dist/mcp/oauth.d.ts +0 -82
  79. package/dist/mcpCli-ZT7CRYMP.js +0 -113
  80. package/dist/mcpCli.d.ts +0 -3
  81. package/dist/mcpServer/serve.d.ts +0 -8
  82. package/dist/mcpServer/server.d.ts +0 -19
  83. package/dist/models.d.ts +0 -13
  84. package/dist/modelsCli-2ZRW4CC4.js +0 -36
  85. package/dist/modelsCli.d.ts +0 -15
  86. package/dist/npmRunner-LU43GM3W.js +0 -46
  87. package/dist/npmRunner.d.ts +0 -21
  88. package/dist/oauthLogin-THSM6FE7.js +0 -210
  89. package/dist/oauthLogin.d.ts +0 -47
  90. package/dist/permissions.d.ts +0 -30
  91. package/dist/pluginSpec.d.ts +0 -25
  92. package/dist/plugins.d.ts +0 -45
  93. package/dist/pluginsCli-EKQI4CJW.js +0 -288
  94. package/dist/pluginsCli.d.ts +0 -16
  95. package/dist/prCli-FMQTOBIV.js +0 -94
  96. package/dist/prCli.d.ts +0 -46
  97. package/dist/presets.d.ts +0 -8
  98. package/dist/print.d.ts +0 -17
  99. package/dist/provider.d.ts +0 -145
  100. package/dist/providerCli-3TFEKV4C.js +0 -15
  101. package/dist/providerCli.d.ts +0 -17
  102. package/dist/providers.d.ts +0 -6
  103. package/dist/reasoning.d.ts +0 -12
  104. package/dist/repomap.d.ts +0 -10
  105. package/dist/sdk.d.ts +0 -61
  106. package/dist/sdk.js +0 -6494
  107. package/dist/serve-3BODPEPR.js +0 -532
  108. package/dist/serve-V6YVZTNR.js +0 -178
  109. package/dist/serve.d.ts +0 -37
  110. package/dist/serveHeartbeat.d.ts +0 -14
  111. package/dist/serveProtocol.d.ts +0 -47
  112. package/dist/session-LX4UNPCD.js +0 -12
  113. package/dist/session.d.ts +0 -33
  114. package/dist/setup-MFG3BWEU.js +0 -24
  115. package/dist/setup.d.ts +0 -79
  116. package/dist/slash/copy.d.ts +0 -1
  117. package/dist/slash/diff.d.ts +0 -1
  118. package/dist/slash/doctor.d.ts +0 -18
  119. package/dist/slash/export.d.ts +0 -2
  120. package/dist/slash/info.d.ts +0 -46
  121. package/dist/slash/memory.d.ts +0 -10
  122. package/dist/statsCli-7MIQHLVW.js +0 -353
  123. package/dist/statsCli.d.ts +0 -62
  124. package/dist/textToolCalls.d.ts +0 -6
  125. package/dist/thinking.d.ts +0 -17
  126. package/dist/tokenBudget.d.ts +0 -22
  127. package/dist/tools/bash.d.ts +0 -54
  128. package/dist/tools/diagnostics.d.ts +0 -13
  129. package/dist/tools/edit.d.ts +0 -12
  130. package/dist/tools/fetch.d.ts +0 -41
  131. package/dist/tools/glob.d.ts +0 -5
  132. package/dist/tools/globSafety.d.ts +0 -7
  133. package/dist/tools/grep.d.ts +0 -25
  134. package/dist/tools/ignore.d.ts +0 -2
  135. package/dist/tools/index.d.ts +0 -12
  136. package/dist/tools/memory.d.ts +0 -13
  137. package/dist/tools/paths.d.ts +0 -4
  138. package/dist/tools/plan.d.ts +0 -10
  139. package/dist/tools/read.d.ts +0 -16
  140. package/dist/tools/repomap.d.ts +0 -2
  141. package/dist/tools/sandbox.d.ts +0 -15
  142. package/dist/tools/shell.d.ts +0 -18
  143. package/dist/tools/skill.d.ts +0 -3
  144. package/dist/tools/task.d.ts +0 -28
  145. package/dist/tools/todo.d.ts +0 -13
  146. package/dist/tools/types.d.ts +0 -52
  147. package/dist/tools/websearch.d.ts +0 -9
  148. package/dist/tools/write.d.ts +0 -5
  149. package/dist/transferCli-SRSYQLSJ.js +0 -73
  150. package/dist/transferCli.d.ts +0 -23
  151. package/dist/ui/App.d.ts +0 -7
  152. package/dist/ui/DiffView.d.ts +0 -3
  153. package/dist/ui/EditableText.d.ts +0 -7
  154. package/dist/ui/LinePrompt.d.ts +0 -6
  155. package/dist/ui/ListPicker.d.ts +0 -11
  156. package/dist/ui/Markdown.d.ts +0 -8
  157. package/dist/ui/McpMenu.d.ts +0 -11
  158. package/dist/ui/ModelPicker.d.ts +0 -6
  159. package/dist/ui/PermissionPrompt.d.ts +0 -5
  160. package/dist/ui/PlanApproval.d.ts +0 -5
  161. package/dist/ui/PromptInput.d.ts +0 -20
  162. package/dist/ui/ProviderMenu.d.ts +0 -10
  163. package/dist/ui/Spinner.d.ts +0 -4
  164. package/dist/ui/StatusBar.d.ts +0 -9
  165. package/dist/ui/TodoList.d.ts +0 -4
  166. package/dist/ui/ToolBlock.d.ts +0 -14
  167. package/dist/ui/complete.d.ts +0 -8
  168. package/dist/ui/index.d.ts +0 -7
  169. package/dist/ui/lineEdit.d.ts +0 -42
  170. package/dist/ui/liveCap.d.ts +0 -9
  171. package/dist/ui/replay.d.ts +0 -4
  172. package/dist/ui/stdinFilter.d.ts +0 -18
  173. package/dist/ui/table.d.ts +0 -20
  174. package/dist/ui/theme.d.ts +0 -5
  175. package/dist/ui/thinkingMouse.d.ts +0 -38
  176. package/dist/ui/transcript.d.ts +0 -55
  177. package/dist/ui/tty.d.ts +0 -11
  178. package/dist/ui/vim.d.ts +0 -26
  179. package/dist/ui-LZ4JGF2V.js +0 -2913
  180. package/dist/update-P7MU4ZM7.js +0 -145
  181. package/dist/update.d.ts +0 -30
  182. package/dist/verify.d.ts +0 -16
  183. package/dist/version.d.ts +0 -1
  184. package/dist/webBudget.d.ts +0 -25
  185. package/dist/worktree.d.ts +0 -12
package/dist/cli.d.ts DELETED
@@ -1 +0,0 @@
1
- export {};
package/dist/cli.js DELETED
@@ -1,233 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- resolvePrintPrompt,
4
- resolveWorktree,
5
- runPrint
6
- } from "./chunk-S3QEZDKB.js";
7
- import {
8
- createRuntime
9
- } from "./chunk-ZJRZTMJF.js";
10
- import "./chunk-OK2USAXX.js";
11
- import "./chunk-KDVL2NP6.js";
12
- import "./chunk-7GM6NN5E.js";
13
- import "./chunk-PSO7R5AD.js";
14
- import {
15
- VERSION
16
- } from "./chunk-V5D6PJQN.js";
17
- import {
18
- helpText,
19
- parseCliArgs
20
- } from "./chunk-ISOKH5WB.js";
21
- import "./chunk-YYTFJUO2.js";
22
- import "./chunk-SWNRA3EW.js";
23
- import "./chunk-INMSTUB2.js";
24
- import {
25
- readGlobalConfigFile
26
- } from "./chunk-6SDRWEPN.js";
27
- import {
28
- defaultLoginDeps,
29
- runLogin
30
- } from "./chunk-KJIXA6MP.js";
31
- import "./chunk-3CYQYHPK.js";
32
- import {
33
- pruneSessions
34
- } from "./chunk-KEKDRROL.js";
35
- import "./chunk-6JK4IBGK.js";
36
- import "./chunk-7XD47KN5.js";
37
- import "./chunk-Q42ZGVAQ.js";
38
- import {
39
- ConfigError,
40
- setTheme
41
- } from "./chunk-TLCL6DC7.js";
42
- import {
43
- resolveLanguage,
44
- setLanguage,
45
- t
46
- } from "./chunk-R754XIBJ.js";
47
-
48
- // src/exit.ts
49
- var EXIT_GRACE_MS = 1e3;
50
- function settleExit(code, deps) {
51
- const d = {
52
- setExitCode: (c) => {
53
- process.exitCode = c;
54
- },
55
- exit: (c) => process.exit(c),
56
- setTimer: (fn, ms) => setTimeout(fn, ms),
57
- ...deps
58
- };
59
- d.setExitCode(code);
60
- const force = d.setTimer(() => d.exit(code), EXIT_GRACE_MS);
61
- force.unref();
62
- }
63
-
64
- // src/cli.ts
65
- function chooseLanguage(argv) {
66
- let fromConfig;
67
- try {
68
- fromConfig = readGlobalConfigFile(process.env).language;
69
- } catch {
70
- }
71
- setLanguage(resolveLanguage(argv, process.env, fromConfig));
72
- }
73
- async function main() {
74
- chooseLanguage(process.argv.slice(2));
75
- const args = parseCliArgs(process.argv.slice(2));
76
- if (args.version) {
77
- console.log(VERSION);
78
- return 0;
79
- }
80
- if (args.help) {
81
- console.log(helpText());
82
- return 0;
83
- }
84
- let cwd = process.cwd();
85
- if (args.worktree) cwd = (await resolveWorktree(cwd, args.worktree)).path;
86
- if (args.command === "login") return runLogin(args.loginProvider ?? "bc-cloud", cwd, args, defaultLoginDeps());
87
- if (args.command === "mcp") {
88
- const { runMcpCommand } = await import("./mcpCli-ZT7CRYMP.js");
89
- const { readSecret } = await import("./login-BSMUGW7L.js");
90
- return runMcpCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), readSecret });
91
- }
92
- if (args.command === "provider") {
93
- const { runProviderCommand } = await import("./providerCli-3TFEKV4C.js");
94
- const { readSecret } = await import("./login-BSMUGW7L.js");
95
- return runProviderCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), readSecret });
96
- }
97
- if (args.command === "connect" || args.command === "disconnect" || args.command === "integrations") {
98
- const { runIntegrationCommand } = await import("./integrationCli-FBRSTF5F.js");
99
- return runIntegrationCommand(args, {
100
- env: process.env,
101
- cwd,
102
- out: (s) => console.log(s),
103
- err: (s) => console.error(s),
104
- fetch: globalThis.fetch
105
- });
106
- }
107
- if (args.command === "models") {
108
- const { runModelsCommand } = await import("./modelsCli-2ZRW4CC4.js");
109
- return runModelsCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), fetch: globalThis.fetch });
110
- }
111
- if (args.command === "update") {
112
- const { runUpdateCommand } = await import("./update-P7MU4ZM7.js");
113
- return runUpdateCommand({ env: process.env });
114
- }
115
- if (args.command === "acp") {
116
- const { runtimeAgent, runAcp } = await import("./acp-JZW3XHE5.js");
117
- await runAcp(process.stdin, process.stdout, { cwd, newAgent: (c) => runtimeAgent(c, args.allowAll) });
118
- return 0;
119
- }
120
- if (args.command === "serve") {
121
- const { serveBanner, startServe } = await import("./serve-3BODPEPR.js");
122
- const handle = await startServe({ port: args.port, host: args.host, token: args.token, cwd, env: process.env });
123
- process.stderr.write(serveBanner(handle, { token: args.token }));
124
- await new Promise((resolve) => {
125
- const stop = () => {
126
- void handle.close().finally(resolve);
127
- };
128
- process.once("SIGINT", stop);
129
- process.once("SIGTERM", stop);
130
- });
131
- return 0;
132
- }
133
- if (args.command === "plugins") {
134
- const { runPluginsCommand } = await import("./pluginsCli-EKQI4CJW.js");
135
- const { readGlobalPlugins, updateGlobalConfig } = await import("./config-T7MKGJVG.js");
136
- const { runNpmSync } = await import("./npmRunner-LU43GM3W.js");
137
- return runPluginsCommand(args, {
138
- out: (s) => console.log(s),
139
- err: (s) => console.error(s),
140
- env: process.env,
141
- runNpm: async (prefix, argv) => runNpmSync(prefix, argv),
142
- readPlugins: () => readGlobalPlugins(process.env),
143
- savePlugins: (entries) => updateGlobalConfig(process.env, (cfg) => {
144
- cfg.plugins = entries;
145
- })
146
- });
147
- }
148
- if (args.command === "gh-bot") {
149
- const { runGhBotCommand } = await import("./ghBotCli-7VUGI63S.js");
150
- return runGhBotCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s) });
151
- }
152
- if (args.command === "completion") {
153
- const { runCompletionCommand } = await import("./completion-Q7VHOPPV.js");
154
- return runCompletionCommand(args, { out: (s) => console.log(s), err: (s) => console.error(s) });
155
- }
156
- if (args.command === "stats") {
157
- const { runStatsCommand } = await import("./statsCli-7MIQHLVW.js");
158
- const { bccliHome } = await import("./config-T7MKGJVG.js");
159
- return runStatsCommand(
160
- { subArgs: args.subArgs, home: bccliHome(process.env), cwd, days: args.days, tools: args.tools, models: args.models, project: args.project },
161
- { out: (s) => console.log(s), err: (s) => console.error(s) }
162
- );
163
- }
164
- if (args.command === "export" || args.command === "import") {
165
- const { runExportCommand, runImportCommand } = await import("./transferCli-SRSYQLSJ.js");
166
- const { bccliHome } = await import("./config-T7MKGJVG.js");
167
- const deps = { subArgs: args.subArgs, home: bccliHome(process.env), cwd };
168
- const io = { out: (s) => console.log(s), err: (s) => console.error(s) };
169
- return args.command === "export" ? runExportCommand(deps, io) : runImportCommand(deps, io);
170
- }
171
- if (args.command === "pr") {
172
- const { runPrCommand } = await import("./prCli-FMQTOBIV.js");
173
- return runPrCommand(
174
- {
175
- subArgs: args.subArgs,
176
- cwd,
177
- allowAll: args.allowAll,
178
- repo: args.repo,
179
- model: args.model,
180
- reasoning: args.reasoning,
181
- permissionMode: args.permissionMode,
182
- allowedTools: args.allowedTools
183
- },
184
- { out: (s) => console.log(s), err: (s) => console.error(s) }
185
- );
186
- }
187
- const rt = createRuntime({ cwd, args });
188
- setTheme(rt.config.theme);
189
- try {
190
- if (rt.config.sessionRetentionDays) pruneSessions(rt.home, Date.now(), rt.config.sessionRetentionDays);
191
- } catch {
192
- }
193
- if (args.print) {
194
- let stdinText;
195
- if (!process.stdin.isTTY) {
196
- const chunks = [];
197
- for await (const chunk of process.stdin) chunks.push(Buffer.from(chunk));
198
- if (chunks.length) stdinText = Buffer.concat(chunks).toString("utf8");
199
- }
200
- const finalPrompt = resolvePrintPrompt(args.prompt, stdinText);
201
- if (!finalPrompt) throw new ConfigError(t('-p mode needs a task, e.g. bccli -p "explain this repo"'));
202
- const { serversToStart } = await import("./config-YYEAEN2C.js");
203
- const plan = serversToStart(rt.home, cwd);
204
- for (const s of plan.needTrust) {
205
- console.error(t('Project MCP server "{name}" skipped (not approved yet; run interactive bccli once to approve it).', { name: s.name }));
206
- }
207
- await rt.startMcp(plan.start);
208
- try {
209
- return await runPrint(rt, finalPrompt, void 0, { allowAll: args.allowAll, outputFormat: args.outputFormat, failOnToolError: args.failOnToolError });
210
- } finally {
211
- await rt.mcp.stop();
212
- }
213
- }
214
- if (!process.stdin.isTTY) throw new ConfigError(t('Interactive mode needs a terminal. For scripts/CI use: bccli -p "task"'));
215
- let updateMessage;
216
- if (rt.config.updateCheck !== "off" && !process.env.BCCLI_NO_UPDATE_CHECK) {
217
- try {
218
- const { checkForUpdate } = await import("./update-P7MU4ZM7.js");
219
- const update = await checkForUpdate({ home: rt.home, fetch: globalThis.fetch, now: /* @__PURE__ */ new Date() });
220
- updateMessage = update;
221
- } catch {
222
- }
223
- }
224
- const { startInteractive } = await import("./ui-LZ4JGF2V.js");
225
- return startInteractive(rt, { initialPrompt: args.prompt, resume: args.resume, version: VERSION, updateMessage });
226
- }
227
- main().then(
228
- (code) => settleExit(code),
229
- (error) => {
230
- console.error(error instanceof ConfigError || error?.code === "ERR_PARSE_ARGS_UNKNOWN_OPTION" ? error.message : error);
231
- settleExit(1);
232
- }
233
- );
@@ -1,17 +0,0 @@
1
- export interface GrabDeps {
2
- platform: NodeJS.Platform;
3
- tmpdir: string;
4
- now: Date;
5
- run?(cmd: string, args: string[]): Promise<{
6
- code: number;
7
- output: string;
8
- }>;
9
- }
10
- export declare function clipboardTarget(tmpdir: string, now: Date): string;
11
- /** Terminals cannot transmit images, so each platform's clipboard tool saves a PNG we can point the model at. */
12
- export declare function clipboardCommand(platform: NodeJS.Platform, target: string): {
13
- cmd: string;
14
- args: string[];
15
- } | undefined;
16
- /** Returns the saved PNG path, or undefined when the clipboard holds no image / the platform is unsupported. */
17
- export declare function grabClipboardImage(deps: GrabDeps): Promise<string | undefined>;
@@ -1,16 +0,0 @@
1
- import type { CommandDef } from './extensions';
2
- /** Descriptions are English keys; wrap them in t() when showing them. */
3
- export declare const SLASH_COMMANDS: {
4
- name: string;
5
- description: string;
6
- }[];
7
- export declare function parseSlash(text: string): {
8
- name: string;
9
- args: string;
10
- } | undefined;
11
- export declare function expandCommand(def: CommandDef, args: string): string;
12
- /**
13
- * /pr: the model runs gh itself (installed on PATH), so this is a prompt, not a fetch.
14
- * Empty selector = the PR of the current branch, falling back to a branch diff.
15
- */
16
- export declare function prReviewPrompt(selector: string): string;
@@ -1,125 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- t
4
- } from "./chunk-R754XIBJ.js";
5
-
6
- // src/completion.ts
7
- var SHELLS = ["bash", "zsh", "fish", "powershell"];
8
- function isCompletionShell(value) {
9
- return SHELLS.includes(value);
10
- }
11
- var COMMANDS = [
12
- "completion",
13
- "stats",
14
- "export",
15
- "import",
16
- "pr",
17
- "login",
18
- "models",
19
- "update",
20
- "acp",
21
- "serve",
22
- "plugins",
23
- "gh-bot",
24
- "provider",
25
- "mcp",
26
- "connect",
27
- "disconnect",
28
- "integrations"
29
- ];
30
- var FLAGS = [
31
- "-p",
32
- "--print",
33
- "-m",
34
- "--model",
35
- "--reasoning",
36
- "-c",
37
- "--continue",
38
- "-r",
39
- "--resume",
40
- "--allow-all",
41
- "--allowed-tools",
42
- "-w",
43
- "--worktree",
44
- "--output-format",
45
- "--permission-mode",
46
- "--lang",
47
- "-v",
48
- "--version",
49
- "-h",
50
- "--help"
51
- ];
52
- var WORDS = [...COMMANDS, ...FLAGS].join(" ");
53
- function bashScript() {
54
- return `# bccli bash completion \u2014 add to your shell rc:
55
- # bccli completion bash > ~/.local/share/bash-completion/completions/bccli
56
- _bccli_complete() {
57
- local cur
58
- cur="\${COMP_WORDS[COMP_CWORD]}"
59
- COMPREPLY=( $(compgen -W "${WORDS}" -- "$cur") )
60
- }
61
- complete -F _bccli_complete bccli
62
- `;
63
- }
64
- function zshScript() {
65
- return `# bccli zsh completion \u2014 add to your shell rc:
66
- # bccli completion zsh > "\${fpath[1]}/_bccli"
67
- #compdef bccli
68
- _bccli() {
69
- local -a words_list
70
- words_list=(${WORDS})
71
- _describe 'command' words_list
72
- }
73
- compdef _bccli bccli
74
- `;
75
- }
76
- function fishScript() {
77
- const lines = [
78
- "# bccli fish completion \u2014 add to your config:",
79
- "# bccli completion fish > ~/.config/fish/completions/bccli.fish",
80
- `# flags: ${FLAGS.join(" ")}`
81
- ];
82
- for (const w of COMMANDS) lines.push(`complete -c bccli -f -a '${w}'`);
83
- for (const f of FLAGS) lines.push(`complete -c bccli -l '${f.replace(/^-+/, "")}'`);
84
- return `${lines.join("\n")}
85
- `;
86
- }
87
- function powershellScript() {
88
- return `# bccli powershell completion \u2014 add to your profile:
89
- # bccli completion powershell >> $PROFILE
90
- Register-ArgumentCompleter -Native -CommandName bccli -ScriptBlock {
91
- param($wordToComplete, $commandAst, $cursorPosition)
92
- $words = '${WORDS}' -split ' '
93
- $words | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
94
- [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
95
- }
96
- }
97
- `;
98
- }
99
- function completionScript(shell) {
100
- switch (shell) {
101
- case "bash":
102
- return bashScript();
103
- case "zsh":
104
- return zshScript();
105
- case "fish":
106
- return fishScript();
107
- case "powershell":
108
- return powershellScript();
109
- }
110
- }
111
- function runCompletionCommand(args, deps) {
112
- const shell = (args.subArgs[0] ?? "").trim();
113
- if (!shell || !isCompletionShell(shell)) {
114
- deps.err?.(t("usage: bccli completion <{shells}>", { shells: SHELLS.join(", ") }));
115
- return 1;
116
- }
117
- for (const line of completionScript(shell).split("\n")) deps.out(line);
118
- return 0;
119
- }
120
- export {
121
- SHELLS,
122
- completionScript,
123
- isCompletionShell,
124
- runCompletionCommand
125
- };
@@ -1,14 +0,0 @@
1
- import type { CliArgs } from './args';
2
- export declare const SHELLS: readonly ['bash', 'zsh', 'fish', 'powershell'];
3
- export type CompletionShell = (typeof SHELLS)[number];
4
- export declare function isCompletionShell(value: string): value is CompletionShell;
5
- /** Completion script for a supported shell (bash, zsh, fish, powershell). */
6
- export declare function completionScript(shell: CompletionShell): string;
7
- export interface CompletionDeps {
8
- out(line: string): void;
9
- err?(line: string): void;
10
- }
11
- /**
12
- * `bccli completion <bash|zsh|fish|powershell>` — print a completion script to stdout.
13
- */
14
- export declare function runCompletionCommand(args: Pick<CliArgs, 'subArgs'>, deps: CompletionDeps): number;
@@ -1,34 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- ConfigError,
4
- DEFAULT_MAX_STEPS,
5
- bccliHome,
6
- globalConfigPath,
7
- loadConfig,
8
- quarantineCorruptFile,
9
- readCredentials,
10
- readGlobalPlugins,
11
- readJsonConfig,
12
- removeCredential,
13
- resolveModel,
14
- saveCredential,
15
- updateGlobalConfig,
16
- writeFileAtomic
17
- } from "./chunk-TLCL6DC7.js";
18
- import "./chunk-R754XIBJ.js";
19
- export {
20
- ConfigError,
21
- DEFAULT_MAX_STEPS,
22
- bccliHome,
23
- globalConfigPath,
24
- loadConfig,
25
- quarantineCorruptFile,
26
- readCredentials,
27
- readGlobalPlugins,
28
- readJsonConfig,
29
- removeCredential,
30
- resolveModel,
31
- saveCredential,
32
- updateGlobalConfig,
33
- writeFileAtomic
34
- };
@@ -1,25 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- addGlobalServer,
4
- expandEnvVars,
5
- globalMcpPath,
6
- projectMcpPath,
7
- projectTrust,
8
- readMcpFile,
9
- removeGlobalServer,
10
- serversToStart,
11
- setProjectTrust
12
- } from "./chunk-Q42ZGVAQ.js";
13
- import "./chunk-TLCL6DC7.js";
14
- import "./chunk-R754XIBJ.js";
15
- export {
16
- addGlobalServer,
17
- expandEnvVars,
18
- globalMcpPath,
19
- projectMcpPath,
20
- projectTrust,
21
- readMcpFile,
22
- removeGlobalServer,
23
- serversToStart,
24
- setProjectTrust
25
- };
package/dist/config.d.ts DELETED
@@ -1,99 +0,0 @@
1
- import type { ReasoningLevel } from './reasoning';
2
- import type { HooksConfig } from './hooks';
3
- import { type Keybind, type KeybindAction } from './keybinds';
4
- import type { LspServer } from './lsp';
5
- import type { UsageCap } from './budget';
6
- import type { Lang } from './i18n';
7
- export type PermissionMode = 'default' | 'acceptEdits' | 'plan' | 'allowAll';
8
- export interface ProviderConfig {
9
- baseURL: string;
10
- apiKeyEnv?: string;
11
- name?: string;
12
- }
13
- export interface Config {
14
- model: string;
15
- /** Optional list of fallback model refs tried in order on 429 / 5xx / connection errors. */
16
- fallbackModels?: string[];
17
- permissionMode: PermissionMode;
18
- reasoning: ReasoningLevel;
19
- /** Show provider-supplied reasoning summaries in the TUI. Global setting only. */
20
- thinkingVisible?: boolean;
21
- /** Delete saved sessions older than this many days at startup. Omitted, null or 0 keeps them until you delete them (the default). Global setting only. */
22
- sessionRetentionDays?: number | null;
23
- /** Click the Thinking block to expand/collapse it. Off by default: it needs terminal mouse reporting, which blocks drag-to-copy. Global setting only; ctrl+t works either way. */
24
- thinkingClickCollapse?: boolean;
25
- /** Tool-call step cap per turn. Omitted, null or 0 means unlimited (the default); a positive number opts into a cap. */
26
- maxSteps?: number | null;
27
- /** Interface language; only the global config is read for it. */
28
- language?: Lang;
29
- /** Tool/session hooks; only the global config is read — the project file is untrusted and must never execute code. */
30
- hooks?: HooksConfig;
31
- /** Attach images read from disk as vision parts. Only the global config is read; default true. */
32
- vision?: boolean;
33
- /** Bash network gate: "offline" blocks known internet commands. Only the global config is read. */
34
- networkPolicy?: 'allow' | 'offline';
35
- /** JS plugin specs, loaded at boot. Only the global config is read — the project file must never execute code. */
36
- plugins?: string[];
37
- /** Resolved TUI key bindings; only the global config is read (a cloned project must not rebind your keys). */
38
- keybinds: Record<KeybindAction, Keybind>;
39
- /** Commands run after a turn that edited files (aider --test-cmd style). Only the global config is read. */
40
- verifyCommands: string[];
41
- /** Per-session token/USD budget; the agent stops calling the model once it is exceeded. Only the global config is read. */
42
- usageCap?: UsageCap;
43
- /** Daily npm registry check with a notice when a newer bccli exists. Only the global config is read; default "on". */
44
- updateCheck?: 'on' | 'off';
45
- /** Include a repo map (files + top-level symbols) in the system prompt. Only the global config is read; default false. */
46
- repoMap: boolean;
47
- /** Color theme name. Only the global config is read; default "default". */
48
- theme: string;
49
- /** Prompt editing style. Only the global config is read; default "emacs". */
50
- editor: 'emacs' | 'vim';
51
- /** Run bash commands inside the OS sandbox (macOS sandbox-exec / Linux bwrap). Only the global config is read; default "off". */
52
- sandbox: 'off' | 'on';
53
- /** LSP servers used by the diagnostics tool. Only the global config is read (it spawns commands). */
54
- lsp?: {
55
- servers: LspServer[];
56
- };
57
- providers: Record<string, ProviderConfig>;
58
- allow: string[];
59
- /** Provider ids that came from the (untrusted) project config. */
60
- projectProviders?: string[];
61
- }
62
- export interface ResolvedModel {
63
- providerId: string;
64
- model: string;
65
- baseURL: string;
66
- apiKey?: string;
67
- }
68
- export declare class ConfigError extends Error {
69
- }
70
- /**
71
- * Default cap on tool-call steps per turn for the main agent: none, like Claude Code, Codex and
72
- * OpenCode (its `steps` is unset = unlimited). The turn runs until the model stops or the user
73
- * presses Esc. Set maxSteps in the global config to a positive number to opt into a safety cap
74
- * (the "type continue" notice then appears when it is reached).
75
- */
76
- export declare const DEFAULT_MAX_STEPS: number | null;
77
- export declare function bccliHome(env?: NodeJS.ProcessEnv): string;
78
- export declare function readJsonConfig(path: string): Partial<Config>;
79
- export declare function loadConfig(cwd: string, env?: NodeJS.ProcessEnv): Config;
80
- export declare function globalConfigPath(env?: NodeJS.ProcessEnv): string;
81
- export declare function readGlobalPlugins(env?: NodeJS.ProcessEnv): string[];
82
- export declare function writeFileAtomic(path: string, data: string, mode?: number): void;
83
- /**
84
- * A corrupt JSON file must never be silently treated as empty: the next write would
85
- * wipe whatever the user had. Move it aside in place (timestamped, same folder) so
86
- * the data stays recoverable, and warn on stderr. Returns the backup path.
87
- */
88
- export declare function quarantineCorruptFile(path: string, error: unknown): string | undefined;
89
- /**
90
- * Read-modify-write of the global config.json. `mutate` throwing aborts before
91
- * any write; the write itself is atomic (tmp + rename in the same directory),
92
- * so a failed run never leaves a truncated or half-updated config.
93
- */
94
- export declare function updateGlobalConfig(env: NodeJS.ProcessEnv, mutate: (cfg: Record<string, unknown>) => void): void;
95
- export declare function readCredentials(env?: NodeJS.ProcessEnv): Record<string, string>;
96
- export declare function saveCredential(providerId: string, key: string, env?: NodeJS.ProcessEnv): void;
97
- export declare function resolveModel(config: Config, modelRef: string, env?: NodeJS.ProcessEnv): ResolvedModel;
98
- /** Returns false when there was no stored key to remove. */
99
- export declare function removeCredential(providerId: string, env?: NodeJS.ProcessEnv): boolean;
package/dist/context.d.ts DELETED
@@ -1,13 +0,0 @@
1
- import type { SkillDef } from './extensions';
2
- /** Instruction files in load order: global BCCLI.md, then AGENTS.md/BCCLI.md from the filesystem root down to cwd. */
3
- export declare function instructionPaths(cwd: string, home: string): string[];
4
- export declare function loadInstructions(cwd: string, home: string): string;
5
- export declare function buildSystemPrompt(opts: {
6
- cwd: string;
7
- home: string;
8
- model: string;
9
- date?: string;
10
- platform?: string;
11
- skills?: SkillDef[];
12
- repoMap?: string;
13
- }): string;
@@ -1,3 +0,0 @@
1
- export declare const DEFAULT_CONTEXT_WINDOW = 128000;
2
- /** Resolves the context window for a `provider/model` ref; `BCCLI_CONTEXT_WINDOW` overrides everything. */
3
- export declare function contextWindowFor(modelRef: string, env?: NodeJS.ProcessEnv): number;
package/dist/diff.d.ts DELETED
@@ -1,7 +0,0 @@
1
- export interface DiffLine {
2
- kind: 'add' | 'del' | 'ctx';
3
- line: number;
4
- text: string;
5
- }
6
- export declare function diffLines(oldText: string, newText: string): DiffLine[];
7
- export declare function formatDiff(lines: DiffLine[]): string;
package/dist/exit.d.ts DELETED
@@ -1,9 +0,0 @@
1
- export declare const EXIT_GRACE_MS = 1000;
2
- export interface ExitDeps {
3
- setExitCode: (code: number) => void;
4
- exit: (code: number) => void;
5
- setTimer: (fn: () => void, ms: number) => {
6
- unref: () => void;
7
- };
8
- }
9
- export declare function settleExit(code: number, deps?: Partial<ExitDeps>): void;
@@ -1,34 +0,0 @@
1
- export interface SkillDef {
2
- name: string;
3
- description: string;
4
- dir: string;
5
- file: string;
6
- }
7
- export interface CommandDef {
8
- name: string;
9
- description?: string;
10
- argumentHint?: string;
11
- body: string;
12
- }
13
- export interface AgentDef {
14
- name: string;
15
- description: string;
16
- tools?: string[];
17
- model?: string;
18
- prompt: string;
19
- maxSteps?: number;
20
- /** Run this agent concurrently with sibling task calls even when its tools can write. */
21
- parallel?: boolean;
22
- }
23
- export interface ExtensionRoots {
24
- cwd: string;
25
- home: string;
26
- userHome: string;
27
- }
28
- export declare function parseFrontmatter(text: string): {
29
- data: Record<string, string | string[]>;
30
- body: string;
31
- };
32
- export declare function loadSkills(r: ExtensionRoots): SkillDef[];
33
- export declare function loadCommands(r: ExtensionRoots): CommandDef[];
34
- export declare function loadAgentDefs(r: ExtensionRoots): AgentDef[];