@botconnector/bccli 0.4.17 → 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 (186) 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-HWHF25KU.js +0 -221
  18. package/dist/acp.d.ts +0 -44
  19. package/dist/agent.d.ts +0 -158
  20. package/dist/agents.d.ts +0 -4
  21. package/dist/args-XA77XUMD.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-2IP5F3EK.js +0 -56
  26. package/dist/chunk-5CVHTYBQ.js +0 -270
  27. package/dist/chunk-6LO6YRDY.js +0 -216
  28. package/dist/chunk-6PJRWKVI.js +0 -50
  29. package/dist/chunk-7OTFZK4B.js +0 -159
  30. package/dist/chunk-7U7CMKKI.js +0 -861
  31. package/dist/chunk-A3NBWIEQ.js +0 -2706
  32. package/dist/chunk-FY543EQW.js +0 -50
  33. package/dist/chunk-IDZLHEVL.js +0 -524
  34. package/dist/chunk-IF5RNXBI.js +0 -341
  35. package/dist/chunk-M5T4AM4I.js +0 -256
  36. package/dist/chunk-NGFWBVHD.js +0 -71
  37. package/dist/chunk-OCEQ2TRJ.js +0 -1075
  38. package/dist/chunk-OK2USAXX.js +0 -88
  39. package/dist/chunk-PSO7R5AD.js +0 -10
  40. package/dist/chunk-RLSQAZBT.js +0 -78
  41. package/dist/chunk-VPFCIUC6.js +0 -91
  42. package/dist/chunk-XP5MTJN2.js +0 -8
  43. package/dist/chunk-YGBTNDPK.js +0 -202
  44. package/dist/chunk-YYTFJUO2.js +0 -148
  45. package/dist/chunk-ZXWRLN7E.js +0 -378
  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-IRVEVW6H.js +0 -125
  51. package/dist/completion.d.ts +0 -14
  52. package/dist/config-OVWCUVY7.js +0 -25
  53. package/dist/config-S3CZUIBB.js +0 -34
  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-FYKJDJOD.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-GY73S2K7.js +0 -876
  70. package/dist/integrationCli.d.ts +0 -9
  71. package/dist/keybinds.d.ts +0 -22
  72. package/dist/login-KSN63EM4.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-VWSCCDWT.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-4Q6KFWV2.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-JWXQZTMZ.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-7XWDLJEL.js +0 -288
  94. package/dist/pluginsCli.d.ts +0 -16
  95. package/dist/prCli-FH7N26D4.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-YMG4G56R.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 -6532
  107. package/dist/serve-HSFF6MGB.js +0 -178
  108. package/dist/serve-HUQNVOSP.js +0 -532
  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-YM36TGU7.js +0 -12
  113. package/dist/session.d.ts +0 -33
  114. package/dist/setup-3YB6EKYX.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-I4TSDU3X.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-3B4LMOYI.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 -14
  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 -29
  171. package/dist/ui/markdownLayout.d.ts +0 -23
  172. package/dist/ui/replay.d.ts +0 -4
  173. package/dist/ui/stdinFilter.d.ts +0 -18
  174. package/dist/ui/table.d.ts +0 -20
  175. package/dist/ui/theme.d.ts +0 -5
  176. package/dist/ui/thinkingMouse.d.ts +0 -38
  177. package/dist/ui/transcript.d.ts +0 -55
  178. package/dist/ui/tty.d.ts +0 -11
  179. package/dist/ui/vim.d.ts +0 -26
  180. package/dist/ui-TAZMRXRI.js +0 -3044
  181. package/dist/update-5V425FIK.js +0 -145
  182. package/dist/update.d.ts +0 -30
  183. package/dist/verify.d.ts +0 -16
  184. package/dist/version.d.ts +0 -1
  185. package/dist/webBudget.d.ts +0 -25
  186. package/dist/worktree.d.ts +0 -12
@@ -1,145 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- VERSION
4
- } from "./chunk-XP5MTJN2.js";
5
- import {
6
- t
7
- } from "./chunk-IDZLHEVL.js";
8
-
9
- // src/update.ts
10
- import { spawnSync } from "child_process";
11
- import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "fs";
12
- import { dirname, join } from "path";
13
- var REGISTRY_URL = "https://registry.npmjs.org/-/package/@botconnector/bccli/dist-tags";
14
- var CHECK_INTERVAL_MS = 24 * 60 * 60 * 1e3;
15
- function splitVersion(v) {
16
- const i = v.indexOf("-");
17
- const coreStr = i < 0 ? v : v.slice(0, i);
18
- const preStr = i < 0 ? "" : v.slice(i + 1);
19
- return {
20
- core: coreStr.split(".").map((p) => Number.parseInt(p, 10) || 0),
21
- pre: preStr ? preStr.split(".") : []
22
- };
23
- }
24
- function compareVersions(a, b) {
25
- const A = splitVersion(a);
26
- const B = splitVersion(b);
27
- for (let i = 0; i < Math.max(A.core.length, B.core.length); i++) {
28
- const x = A.core[i] ?? 0;
29
- const y = B.core[i] ?? 0;
30
- if (x !== y) return x < y ? -1 : 1;
31
- }
32
- if (!A.pre.length && !B.pre.length) return 0;
33
- if (!A.pre.length) return 1;
34
- if (!B.pre.length) return -1;
35
- for (let i = 0; i < Math.max(A.pre.length, B.pre.length); i++) {
36
- const x = A.pre[i];
37
- const y = B.pre[i];
38
- if (x === void 0) return -1;
39
- if (y === void 0) return 1;
40
- const nx = Number.parseInt(x, 10);
41
- const ny = Number.parseInt(y, 10);
42
- if (String(nx) === x && String(ny) === y) {
43
- if (nx !== ny) return nx < ny ? -1 : 1;
44
- } else if (x !== y) {
45
- return x < y ? -1 : 1;
46
- }
47
- }
48
- return 0;
49
- }
50
- function channelFor(version) {
51
- return version.includes("-") ? "next" : "latest";
52
- }
53
- function cachePath(home) {
54
- return join(home, "update-check.json");
55
- }
56
- function readCache(home) {
57
- try {
58
- const parsed = JSON.parse(readFileSync(cachePath(home), "utf8"));
59
- return typeof parsed?.checkedAt === "string" ? parsed : void 0;
60
- } catch {
61
- return void 0;
62
- }
63
- }
64
- function writeCache(home, cache) {
65
- mkdirSync(home, { recursive: true });
66
- const tmp = `${cachePath(home)}.tmp`;
67
- writeFileSync(tmp, JSON.stringify(cache));
68
- renameSync(tmp, cachePath(home));
69
- }
70
- function dueForCheck(cache, now, intervalMs = CHECK_INTERVAL_MS) {
71
- if (!cache) return true;
72
- const at = Date.parse(cache.checkedAt);
73
- if (!Number.isFinite(at)) return true;
74
- return now.getTime() - at >= intervalMs;
75
- }
76
- function updateNotice(current, latest) {
77
- if (!latest || latest.length > 64 || !/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(latest) || compareVersions(current, latest) >= 0) return void 0;
78
- return t("A new bccli is available: {latest} (you have {current}). Run: bccli update", { latest, current });
79
- }
80
- function notifyOnce(home, cache) {
81
- const message = updateNotice(VERSION, cache?.latest);
82
- if (!message || !cache?.latest || cache.notified === cache.latest) return void 0;
83
- writeCache(home, { ...cache, notified: cache.latest });
84
- return message;
85
- }
86
- async function checkForUpdate(deps) {
87
- try {
88
- const cached = readCache(deps.home);
89
- if (!dueForCheck(cached, deps.now)) return notifyOnce(deps.home, cached);
90
- const res = await deps.fetch(REGISTRY_URL, { signal: AbortSignal.timeout(deps.timeoutMs ?? 3e3) });
91
- if (!res.ok) return notifyOnce(deps.home, cached);
92
- const tags = await res.json();
93
- const latest = tags[channelFor(VERSION)] ?? tags.latest;
94
- const updated = { checkedAt: deps.now.toISOString(), latest, notified: cached?.notified };
95
- writeCache(deps.home, updated);
96
- return notifyOnce(deps.home, updated);
97
- } catch {
98
- return void 0;
99
- }
100
- }
101
- function updateSpawnCommand(version, platform = process.platform, nodeExecPath = process.execPath, targetVersion) {
102
- const spec = `@botconnector/bccli@${targetVersion ?? channelFor(version)}`;
103
- if (platform !== "win32") return { command: "npm", args: ["i", "-g", spec] };
104
- const npmCli = join(dirname(nodeExecPath), "node_modules", "npm", "bin", "npm-cli.js");
105
- return { command: nodeExecPath, args: [npmCli, "i", "-g", spec], npmCli };
106
- }
107
- async function runUpdateCommand(deps) {
108
- const current = deps.env.BCCLI_VERSION_OVERRIDE ?? VERSION;
109
- let target;
110
- try {
111
- const response = await (deps.fetch ?? fetch)(REGISTRY_URL, {
112
- signal: AbortSignal.timeout(8e3),
113
- cache: "no-store",
114
- headers: { "cache-control": "no-cache" }
115
- });
116
- if (!response.ok) throw new Error(`HTTP ${response.status}`);
117
- const tags = await response.json();
118
- target = tags[channelFor(current)];
119
- if (!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(target ?? "")) throw new Error("invalid registry version");
120
- } catch (error) {
121
- console.error(`Could not verify BCCLI update version: ${String(error)}. No changes made.`);
122
- return 1;
123
- }
124
- if (compareVersions(target, current) <= 0) {
125
- console.log(`BCCLI ${current} is already up to date (registry: ${target}); no changes made.`);
126
- return 0;
127
- }
128
- const spec = updateSpawnCommand(current, deps.platform, deps.nodeExecPath, target);
129
- if (spec.npmCli && !existsSync(spec.npmCli)) {
130
- console.error(`npm CLI was not found at ${spec.npmCli}. Update manually with: npm install -g @botconnector/bccli@${channelFor(deps.env.BCCLI_VERSION_OVERRIDE ?? VERSION)}`);
131
- return 1;
132
- }
133
- const r = (deps.spawn ?? spawnSync)(spec.command, spec.args, { stdio: "inherit", env: deps.env, shell: false });
134
- if (r.error) console.error(`BCCLI update failed: ${r.error.message}. Try: npm install -g @botconnector/bccli@${channelFor(deps.env.BCCLI_VERSION_OVERRIDE ?? VERSION)}`);
135
- return typeof r.status === "number" ? r.status : 1;
136
- }
137
- export {
138
- channelFor,
139
- checkForUpdate,
140
- compareVersions,
141
- dueForCheck,
142
- runUpdateCommand,
143
- updateNotice,
144
- updateSpawnCommand
145
- };
package/dist/update.d.ts DELETED
@@ -1,30 +0,0 @@
1
- import { spawnSync } from 'node:child_process';
2
- export interface UpdateCache {
3
- checkedAt: string;
4
- latest?: string;
5
- notified?: string;
6
- }
7
- /** Simplified semver: numeric cores, prerelease sorts below release, numeric prerelease parts compare numerically. */
8
- export declare function compareVersions(a: string, b: string): number;
9
- export declare function channelFor(version: string): 'next' | 'latest';
10
- export declare function dueForCheck(cache: UpdateCache | undefined, now: Date, intervalMs?: number): boolean;
11
- export declare function updateNotice(current: string, latest: string | undefined): string | undefined;
12
- /** Best-effort registry check with a 24h cache; never throws, never blocks startup for long. */
13
- export declare function checkForUpdate(deps: {
14
- home: string;
15
- fetch: typeof fetch;
16
- now: Date;
17
- timeoutMs?: number;
18
- }): Promise<string | undefined>;
19
- export declare function updateSpawnCommand(version: string, platform?: NodeJS.Platform, nodeExecPath?: string, targetVersion?: string): {
20
- command: string;
21
- args: string[];
22
- npmCli?: string;
23
- };
24
- export declare function runUpdateCommand(deps: {
25
- env: NodeJS.ProcessEnv;
26
- spawn?: typeof spawnSync;
27
- platform?: NodeJS.Platform;
28
- nodeExecPath?: string;
29
- fetch?: typeof fetch;
30
- }): Promise<number>;
package/dist/verify.d.ts DELETED
@@ -1,16 +0,0 @@
1
- import { runCommand } from './tools/bash';
2
- export interface VerifyFailure {
3
- cmd: string;
4
- exitCode: number;
5
- output: string;
6
- }
7
- /** Fix rounds per user turn; keeps a failing verify command from looping forever. */
8
- export declare const MAX_VERIFY_ROUNDS = 2;
9
- export declare function runVerify(commands: string[], opts: {
10
- cwd: string;
11
- env: NodeJS.ProcessEnv;
12
- signal: AbortSignal;
13
- timeoutMs?: number;
14
- run?: typeof runCommand;
15
- }): Promise<VerifyFailure[]>;
16
- export declare function verifyFollowup(failures: VerifyFailure[], maxBytes?: number): string;
package/dist/version.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare const VERSION: string;
@@ -1,25 +0,0 @@
1
- import type { ChatMessage } from './provider';
2
- export declare const isStub: (content: string) => boolean;
3
- /**
4
- * Replaces old `fetch` results with a one-line stub, in one batch and only once they add up to more than
5
- * PRUNE_MIN_TOKENS, so the prompt prefix (and its cache) changes rarely. The newest KEEP_TOKENS worth stay intact.
6
- */
7
- export declare function pruneOldFetches(messages: ChatMessage[]): boolean;
8
- export interface WebBudgetLimits {
9
- perTurn?: number;
10
- sessionChars?: number;
11
- }
12
- export declare class WebBudget {
13
- private fetches;
14
- private chars;
15
- private readonly perTurn;
16
- private readonly sessionChars;
17
- constructor(limits?: WebBudgetLimits);
18
- startTurn(): void;
19
- /** Gives back a reservation, e.g. when the fetch was served from cache and cost nothing. */
20
- refund(): void;
21
- reset(): void;
22
- /** Reserves one fetch; returns the refusal to show the model when over budget. */
23
- take(): string | undefined;
24
- record(chars: number): void;
25
- }
@@ -1,12 +0,0 @@
1
- export interface WorktreePlan {
2
- path: string;
3
- created: boolean;
4
- }
5
- /**
6
- * Resolve (creating when needed) the sibling worktree for `-w <name>`: always derived from the
7
- * MAIN checkout, so running inside an existing worktree nests nothing. The returned path becomes
8
- * the session cwd, so config, prompts, sessions, and permissions all follow it.
9
- */
10
- export declare function resolveWorktree(cwd: string, name: string, bin?: string): Promise<WorktreePlan>;
11
- /** Read-only status for /worktree: what exists and how to remove it safely. */
12
- export declare function worktreeListText(cwd: string, bin?: string): Promise<string>;