@botconnector/bccli 0.4.0-beta.9 → 0.4.1

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 (183) hide show
  1. package/README.en.md +253 -0
  2. package/README.md +93 -6
  3. package/dist/abort.d.ts +5 -0
  4. package/dist/acp-3PHBAI64.js +182 -0
  5. package/dist/acp.d.ts +27 -0
  6. package/dist/agent.d.ts +143 -0
  7. package/dist/agents.d.ts +4 -0
  8. package/dist/args-W6BNKY7K.js +13 -0
  9. package/dist/args.d.ts +51 -0
  10. package/dist/budget.d.ts +23 -0
  11. package/dist/checkpoints.d.ts +34 -0
  12. package/dist/{chunk-BFZXRKW5.js → chunk-24JN75FZ.js} +29 -7
  13. package/dist/chunk-45SDLMTV.js +341 -0
  14. package/dist/chunk-75BECX4F.js +56 -0
  15. package/dist/{chunk-SJH3YLW4.js → chunk-BC7UXFE4.js} +69 -6
  16. package/dist/chunk-BGXNR74O.js +733 -0
  17. package/dist/chunk-BKGFA2PT.js +8 -0
  18. package/dist/{chunk-CLN4Z5E3.js → chunk-BLOYFIAD.js} +6 -3
  19. package/dist/chunk-BXQQCUAC.js +145 -0
  20. package/dist/chunk-FLQPE4S5.js +373 -0
  21. package/dist/chunk-GN4W3T6E.js +76 -0
  22. package/dist/{chunk-7S6JXQCH.js → chunk-JHPGOAXU.js} +2 -1
  23. package/dist/chunk-MFHCQQEN.js +201 -0
  24. package/dist/chunk-MHIYLXJC.js +143 -0
  25. package/dist/chunk-PSO7R5AD.js +10 -0
  26. package/dist/chunk-PZRKU4UM.js +2143 -0
  27. package/dist/chunk-QZKLZELZ.js +64 -0
  28. package/dist/chunk-R5RE46CW.js +231 -0
  29. package/dist/chunk-UZWJQF67.js +500 -0
  30. package/dist/{chunk-DX7CZTBB.js → chunk-WI22M2ID.js} +14 -9
  31. package/dist/chunk-WNACAUDK.js +946 -0
  32. package/dist/chunk-XV7ZVL4J.js +235 -0
  33. package/dist/cli.d.ts +1 -0
  34. package/dist/cli.js +150 -1382
  35. package/dist/clipboardImage.d.ts +17 -0
  36. package/dist/commands.d.ts +16 -0
  37. package/dist/completion-HPPFDAPB.js +125 -0
  38. package/dist/completion.d.ts +14 -0
  39. package/dist/{config-YUNKPCNB.js → config-DIDLDONU.js} +5 -2
  40. package/dist/config-IU76CPK2.js +34 -0
  41. package/dist/config.d.ts +97 -0
  42. package/dist/context.d.ts +13 -0
  43. package/dist/contextWindow.d.ts +3 -0
  44. package/dist/diff.d.ts +7 -0
  45. package/dist/exit.d.ts +9 -0
  46. package/dist/extensions.d.ts +34 -0
  47. package/dist/ghBotCli-E3VPHNZY.js +677 -0
  48. package/dist/ghBotCli.d.ts +9 -0
  49. package/dist/ghBotDispatch.d.ts +68 -0
  50. package/dist/ghBotRunner.d.ts +82 -0
  51. package/dist/ghBotServe.d.ts +21 -0
  52. package/dist/ghBotWebhook.d.ts +45 -0
  53. package/dist/hooks.d.ts +27 -0
  54. package/dist/i18n/id.d.ts +1 -0
  55. package/dist/i18n.d.ts +16 -0
  56. package/dist/integrationCli-Q2YPDTPG.js +685 -0
  57. package/dist/integrationCli.d.ts +9 -0
  58. package/dist/keybinds.d.ts +22 -0
  59. package/dist/login-FP3BB44A.js +16 -0
  60. package/dist/login.d.ts +19 -0
  61. package/dist/lsp.d.ts +47 -0
  62. package/dist/mcp/catalog.d.ts +14 -0
  63. package/dist/mcp/config.d.ts +36 -0
  64. package/dist/mcp/manager.d.ts +34 -0
  65. package/dist/mcp/oauth.d.ts +82 -0
  66. package/dist/{mcpCli-DZWQPTOS.js → mcpCli-SNBDUWJN.js} +42 -9
  67. package/dist/mcpCli.d.ts +3 -0
  68. package/dist/mcpServer/serve.d.ts +8 -0
  69. package/dist/mcpServer/server.d.ts +19 -0
  70. package/dist/models.d.ts +13 -0
  71. package/dist/modelsCli-CZ2HNGKR.js +36 -0
  72. package/dist/modelsCli.d.ts +15 -0
  73. package/dist/npmRunner-LU43GM3W.js +46 -0
  74. package/dist/npmRunner.d.ts +21 -0
  75. package/dist/oauthLogin-6FWQABJ7.js +210 -0
  76. package/dist/oauthLogin.d.ts +47 -0
  77. package/dist/permissions.d.ts +30 -0
  78. package/dist/pluginSpec.d.ts +25 -0
  79. package/dist/plugins.d.ts +45 -0
  80. package/dist/pluginsCli-LPIUUDWB.js +284 -0
  81. package/dist/pluginsCli.d.ts +16 -0
  82. package/dist/prCli-5IMV3VNQ.js +78 -0
  83. package/dist/prCli.d.ts +33 -0
  84. package/dist/presets.d.ts +8 -0
  85. package/dist/print.d.ts +14 -0
  86. package/dist/provider.d.ts +140 -0
  87. package/dist/providerCli-NMUFXAAS.js +15 -0
  88. package/dist/providerCli.d.ts +17 -0
  89. package/dist/providers.d.ts +6 -0
  90. package/dist/reasoning.d.ts +12 -0
  91. package/dist/repomap.d.ts +10 -0
  92. package/dist/sdk.d.ts +57 -0
  93. package/dist/sdk.js +5571 -0
  94. package/dist/serve-KWOECK5W.js +178 -0
  95. package/dist/serve-X2ZV4S5U.js +521 -0
  96. package/dist/serve.d.ts +37 -0
  97. package/dist/serveHeartbeat.d.ts +14 -0
  98. package/dist/serveProtocol.d.ts +47 -0
  99. package/dist/session-GKEXDJKZ.js +12 -0
  100. package/dist/session.d.ts +30 -0
  101. package/dist/setup-OV3NWQN5.js +24 -0
  102. package/dist/setup.d.ts +74 -0
  103. package/dist/slash/copy.d.ts +1 -0
  104. package/dist/slash/diff.d.ts +1 -0
  105. package/dist/slash/doctor.d.ts +18 -0
  106. package/dist/slash/export.d.ts +2 -0
  107. package/dist/slash/info.d.ts +45 -0
  108. package/dist/slash/memory.d.ts +10 -0
  109. package/dist/statsCli-CF3R7ATL.js +353 -0
  110. package/dist/statsCli.d.ts +62 -0
  111. package/dist/textToolCalls.d.ts +6 -0
  112. package/dist/thinking.d.ts +17 -0
  113. package/dist/tokenBudget.d.ts +22 -0
  114. package/dist/tools/bash.d.ts +52 -0
  115. package/dist/tools/diagnostics.d.ts +5 -0
  116. package/dist/tools/edit.d.ts +7 -0
  117. package/dist/tools/fetch.d.ts +41 -0
  118. package/dist/tools/glob.d.ts +5 -0
  119. package/dist/tools/globSafety.d.ts +7 -0
  120. package/dist/tools/grep.d.ts +13 -0
  121. package/dist/tools/ignore.d.ts +2 -0
  122. package/dist/tools/index.d.ts +12 -0
  123. package/dist/tools/memory.d.ts +13 -0
  124. package/dist/tools/paths.d.ts +2 -0
  125. package/dist/tools/plan.d.ts +10 -0
  126. package/dist/tools/read.d.ts +16 -0
  127. package/dist/tools/repomap.d.ts +2 -0
  128. package/dist/tools/sandbox.d.ts +12 -0
  129. package/dist/tools/shell.d.ts +18 -0
  130. package/dist/tools/skill.d.ts +3 -0
  131. package/dist/tools/task.d.ts +28 -0
  132. package/dist/tools/todo.d.ts +13 -0
  133. package/dist/tools/types.d.ts +52 -0
  134. package/dist/tools/websearch.d.ts +9 -0
  135. package/dist/tools/write.d.ts +5 -0
  136. package/dist/transferCli-YUFPI6AH.js +71 -0
  137. package/dist/transferCli.d.ts +23 -0
  138. package/dist/ui/App.d.ts +7 -0
  139. package/dist/ui/DiffView.d.ts +3 -0
  140. package/dist/ui/EditableText.d.ts +7 -0
  141. package/dist/ui/LinePrompt.d.ts +6 -0
  142. package/dist/ui/ListPicker.d.ts +11 -0
  143. package/dist/ui/Markdown.d.ts +8 -0
  144. package/dist/ui/McpMenu.d.ts +11 -0
  145. package/dist/ui/ModelPicker.d.ts +6 -0
  146. package/dist/ui/PermissionPrompt.d.ts +5 -0
  147. package/dist/ui/PlanApproval.d.ts +5 -0
  148. package/dist/ui/PromptInput.d.ts +18 -0
  149. package/dist/ui/ProviderMenu.d.ts +10 -0
  150. package/dist/ui/Spinner.d.ts +4 -0
  151. package/dist/ui/StatusBar.d.ts +9 -0
  152. package/dist/ui/TodoList.d.ts +4 -0
  153. package/dist/ui/ToolBlock.d.ts +14 -0
  154. package/dist/ui/complete.d.ts +1 -0
  155. package/dist/ui/focusReport.d.ts +1 -0
  156. package/dist/ui/index.d.ts +7 -0
  157. package/dist/ui/lineEdit.d.ts +42 -0
  158. package/dist/ui/replay.d.ts +4 -0
  159. package/dist/ui/table.d.ts +20 -0
  160. package/dist/ui/theme.d.ts +5 -0
  161. package/dist/ui/thinkingMouse.d.ts +33 -0
  162. package/dist/ui/transcript.d.ts +55 -0
  163. package/dist/ui/vim.d.ts +26 -0
  164. package/dist/ui-IVIFNUCC.js +2367 -0
  165. package/dist/update-TZ2G6KQ3.js +145 -0
  166. package/dist/update.d.ts +30 -0
  167. package/dist/verify.d.ts +16 -0
  168. package/dist/version.d.ts +1 -0
  169. package/dist/webBudget.d.ts +25 -0
  170. package/dist/worktree.d.ts +12 -0
  171. package/package.json +42 -8
  172. package/dist/args-JPVSGCGY.js +0 -12
  173. package/dist/chunk-2MGINW4O.js +0 -114
  174. package/dist/chunk-ELML4KVQ.js +0 -76
  175. package/dist/chunk-ISGBGFSU.js +0 -52
  176. package/dist/chunk-KV27KTOX.js +0 -254
  177. package/dist/chunk-U7GK73CK.js +0 -341
  178. package/dist/chunk-ZYCYTEKD.js +0 -96
  179. package/dist/integrationCli-BGT5UZU4.js +0 -223
  180. package/dist/login-6K32PIXV.js +0 -9
  181. package/dist/providerCli-Q7LRM2NP.js +0 -12
  182. package/dist/session-7UB77CEG.js +0 -9
  183. package/dist/ui-6GTQUJOE.js +0 -1415
@@ -0,0 +1,17 @@
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>;
@@ -0,0 +1,16 @@
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;
@@ -0,0 +1,125 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ t
4
+ } from "./chunk-UZWJQF67.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
+ };
@@ -0,0 +1,14 @@
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,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  addGlobalServer,
4
+ expandEnvVars,
4
5
  globalMcpPath,
5
6
  projectMcpPath,
6
7
  projectTrust,
@@ -8,10 +9,12 @@ import {
8
9
  removeGlobalServer,
9
10
  serversToStart,
10
11
  setProjectTrust
11
- } from "./chunk-BFZXRKW5.js";
12
- import "./chunk-2MGINW4O.js";
12
+ } from "./chunk-24JN75FZ.js";
13
+ import "./chunk-FLQPE4S5.js";
14
+ import "./chunk-UZWJQF67.js";
13
15
  export {
14
16
  addGlobalServer,
17
+ expandEnvVars,
15
18
  globalMcpPath,
16
19
  projectMcpPath,
17
20
  projectTrust,
@@ -0,0 +1,34 @@
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-FLQPE4S5.js";
18
+ import "./chunk-UZWJQF67.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
+ };
@@ -0,0 +1,97 @@
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
+ permissionMode: PermissionMode;
16
+ reasoning: ReasoningLevel;
17
+ /** Show provider-supplied reasoning summaries in the TUI. Global setting only. */
18
+ thinkingVisible?: boolean;
19
+ /** 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. */
20
+ sessionRetentionDays?: number | null;
21
+ /** 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. */
22
+ thinkingClickCollapse?: boolean;
23
+ /** Tool-call step cap per turn. Omitted, null or 0 means unlimited (the default); a positive number opts into a cap. */
24
+ maxSteps?: number | null;
25
+ /** Interface language; only the global config is read for it. */
26
+ language?: Lang;
27
+ /** Tool/session hooks; only the global config is read — the project file is untrusted and must never execute code. */
28
+ hooks?: HooksConfig;
29
+ /** Attach images read from disk as vision parts. Only the global config is read; default true. */
30
+ vision?: boolean;
31
+ /** Bash network gate: "offline" blocks known internet commands. Only the global config is read. */
32
+ networkPolicy?: 'allow' | 'offline';
33
+ /** JS plugin specs, loaded at boot. Only the global config is read — the project file must never execute code. */
34
+ plugins?: string[];
35
+ /** Resolved TUI key bindings; only the global config is read (a cloned project must not rebind your keys). */
36
+ keybinds: Record<KeybindAction, Keybind>;
37
+ /** Commands run after a turn that edited files (aider --test-cmd style). Only the global config is read. */
38
+ verifyCommands: string[];
39
+ /** Per-session token/USD budget; the agent stops calling the model once it is exceeded. Only the global config is read. */
40
+ usageCap?: UsageCap;
41
+ /** Daily npm registry check with a notice when a newer bccli exists. Only the global config is read; default "on". */
42
+ updateCheck?: 'on' | 'off';
43
+ /** Include a repo map (files + top-level symbols) in the system prompt. Only the global config is read; default false. */
44
+ repoMap: boolean;
45
+ /** Color theme name. Only the global config is read; default "default". */
46
+ theme: string;
47
+ /** Prompt editing style. Only the global config is read; default "emacs". */
48
+ editor: 'emacs' | 'vim';
49
+ /** Run bash commands inside the OS sandbox (macOS sandbox-exec / Linux bwrap). Only the global config is read; default "off". */
50
+ sandbox: 'off' | 'on';
51
+ /** LSP servers used by the diagnostics tool. Only the global config is read (it spawns commands). */
52
+ lsp?: {
53
+ servers: LspServer[];
54
+ };
55
+ providers: Record<string, ProviderConfig>;
56
+ allow: string[];
57
+ /** Provider ids that came from the (untrusted) project config. */
58
+ projectProviders?: string[];
59
+ }
60
+ export interface ResolvedModel {
61
+ providerId: string;
62
+ model: string;
63
+ baseURL: string;
64
+ apiKey?: string;
65
+ }
66
+ export declare class ConfigError extends Error {
67
+ }
68
+ /**
69
+ * Default cap on tool-call steps per turn for the main agent: none, like Claude Code, Codex and
70
+ * OpenCode (its `steps` is unset = unlimited). The turn runs until the model stops or the user
71
+ * presses Esc. Set maxSteps in the global config to a positive number to opt into a safety cap
72
+ * (the "type continue" notice then appears when it is reached).
73
+ */
74
+ export declare const DEFAULT_MAX_STEPS: number | null;
75
+ export declare function bccliHome(env?: NodeJS.ProcessEnv): string;
76
+ export declare function readJsonConfig(path: string): Partial<Config>;
77
+ export declare function loadConfig(cwd: string, env?: NodeJS.ProcessEnv): Config;
78
+ export declare function globalConfigPath(env?: NodeJS.ProcessEnv): string;
79
+ export declare function readGlobalPlugins(env?: NodeJS.ProcessEnv): string[];
80
+ export declare function writeFileAtomic(path: string, data: string, mode?: number): void;
81
+ /**
82
+ * A corrupt JSON file must never be silently treated as empty: the next write would
83
+ * wipe whatever the user had. Move it aside in place (timestamped, same folder) so
84
+ * the data stays recoverable, and warn on stderr. Returns the backup path.
85
+ */
86
+ export declare function quarantineCorruptFile(path: string, error: unknown): string | undefined;
87
+ /**
88
+ * Read-modify-write of the global config.json. `mutate` throwing aborts before
89
+ * any write; the write itself is atomic (tmp + rename in the same directory),
90
+ * so a failed run never leaves a truncated or half-updated config.
91
+ */
92
+ export declare function updateGlobalConfig(env: NodeJS.ProcessEnv, mutate: (cfg: Record<string, unknown>) => void): void;
93
+ export declare function readCredentials(env?: NodeJS.ProcessEnv): Record<string, string>;
94
+ export declare function saveCredential(providerId: string, key: string, env?: NodeJS.ProcessEnv): void;
95
+ export declare function resolveModel(config: Config, modelRef: string, env?: NodeJS.ProcessEnv): ResolvedModel;
96
+ /** Returns false when there was no stored key to remove. */
97
+ export declare function removeCredential(providerId: string, env?: NodeJS.ProcessEnv): boolean;
@@ -0,0 +1,13 @@
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;
@@ -0,0 +1,3 @@
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 ADDED
@@ -0,0 +1,7 @@
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 ADDED
@@ -0,0 +1,9 @@
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;
@@ -0,0 +1,34 @@
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[];