@botconnector/bccli 0.5.0-rc.4 → 0.5.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 (187) hide show
  1. package/LICENSE +21 -203
  2. package/README.en.md +253 -0
  3. package/README.md +250 -0
  4. package/dist/abort.d.ts +5 -0
  5. package/dist/acp-HWHF25KU.js +221 -0
  6. package/dist/acp.d.ts +44 -0
  7. package/dist/agent.d.ts +158 -0
  8. package/dist/agents.d.ts +4 -0
  9. package/dist/args-XA77XUMD.js +13 -0
  10. package/dist/args.d.ts +59 -0
  11. package/dist/budget.d.ts +26 -0
  12. package/dist/checkpoints.d.ts +35 -0
  13. package/dist/chunk-2IP5F3EK.js +56 -0
  14. package/dist/chunk-5CVHTYBQ.js +270 -0
  15. package/dist/chunk-6LO6YRDY.js +216 -0
  16. package/dist/chunk-6PJRWKVI.js +50 -0
  17. package/dist/chunk-6YRTPXGY.js +8 -0
  18. package/dist/chunk-7OTFZK4B.js +159 -0
  19. package/dist/chunk-7U7CMKKI.js +861 -0
  20. package/dist/chunk-A3NBWIEQ.js +2706 -0
  21. package/dist/chunk-FY543EQW.js +50 -0
  22. package/dist/chunk-IDZLHEVL.js +524 -0
  23. package/dist/chunk-IF5RNXBI.js +341 -0
  24. package/dist/chunk-M5T4AM4I.js +256 -0
  25. package/dist/chunk-NGFWBVHD.js +71 -0
  26. package/dist/chunk-OCEQ2TRJ.js +1075 -0
  27. package/dist/chunk-OK2USAXX.js +88 -0
  28. package/dist/chunk-PSO7R5AD.js +10 -0
  29. package/dist/chunk-RLSQAZBT.js +78 -0
  30. package/dist/chunk-VPFCIUC6.js +91 -0
  31. package/dist/chunk-YGBTNDPK.js +202 -0
  32. package/dist/chunk-YYTFJUO2.js +148 -0
  33. package/dist/chunk-ZXWRLN7E.js +378 -0
  34. package/dist/cli.d.ts +1 -0
  35. package/dist/cli.js +251 -0
  36. package/dist/clipboardImage.d.ts +17 -0
  37. package/dist/commands.d.ts +16 -0
  38. package/dist/completion-IRVEVW6H.js +125 -0
  39. package/dist/completion.d.ts +14 -0
  40. package/dist/config-OVWCUVY7.js +25 -0
  41. package/dist/config-S3CZUIBB.js +34 -0
  42. package/dist/config.d.ts +99 -0
  43. package/dist/context.d.ts +13 -0
  44. package/dist/contextWindow.d.ts +3 -0
  45. package/dist/diff.d.ts +7 -0
  46. package/dist/exit.d.ts +9 -0
  47. package/dist/extensions.d.ts +34 -0
  48. package/dist/ghBotCli-FYKJDJOD.js +680 -0
  49. package/dist/ghBotCli.d.ts +9 -0
  50. package/dist/ghBotDispatch.d.ts +68 -0
  51. package/dist/ghBotRunner.d.ts +82 -0
  52. package/dist/ghBotServe.d.ts +21 -0
  53. package/dist/ghBotWebhook.d.ts +45 -0
  54. package/dist/hooks.d.ts +27 -0
  55. package/dist/i18n/id.d.ts +1 -0
  56. package/dist/i18n.d.ts +16 -0
  57. package/dist/integrationCli-GY73S2K7.js +876 -0
  58. package/dist/integrationCli.d.ts +9 -0
  59. package/dist/keybinds.d.ts +22 -0
  60. package/dist/login-KSN63EM4.js +18 -0
  61. package/dist/login.d.ts +21 -0
  62. package/dist/lsp.d.ts +73 -0
  63. package/dist/mcp/catalog.d.ts +14 -0
  64. package/dist/mcp/config.d.ts +36 -0
  65. package/dist/mcp/manager.d.ts +52 -0
  66. package/dist/mcp/oauth.d.ts +82 -0
  67. package/dist/mcpCli-VWSCCDWT.js +113 -0
  68. package/dist/mcpCli.d.ts +3 -0
  69. package/dist/mcpServer/serve.d.ts +8 -0
  70. package/dist/mcpServer/server.d.ts +19 -0
  71. package/dist/models.d.ts +13 -0
  72. package/dist/modelsCli-4Q6KFWV2.js +36 -0
  73. package/dist/modelsCli.d.ts +15 -0
  74. package/dist/npmRunner-LU43GM3W.js +46 -0
  75. package/dist/npmRunner.d.ts +21 -0
  76. package/dist/oauthLogin-JWXQZTMZ.js +210 -0
  77. package/dist/oauthLogin.d.ts +47 -0
  78. package/dist/onboarding.d.ts +6 -0
  79. package/dist/permissions.d.ts +30 -0
  80. package/dist/pluginSpec.d.ts +25 -0
  81. package/dist/plugins.d.ts +45 -0
  82. package/dist/pluginsCli-7XWDLJEL.js +288 -0
  83. package/dist/pluginsCli.d.ts +16 -0
  84. package/dist/prCli-FH7N26D4.js +94 -0
  85. package/dist/prCli.d.ts +46 -0
  86. package/dist/presets.d.ts +8 -0
  87. package/dist/print.d.ts +17 -0
  88. package/dist/provider.d.ts +145 -0
  89. package/dist/providerCli-YMG4G56R.js +15 -0
  90. package/dist/providerCli.d.ts +17 -0
  91. package/dist/providers.d.ts +6 -0
  92. package/dist/reasoning.d.ts +12 -0
  93. package/dist/repomap.d.ts +10 -0
  94. package/dist/sdk.d.ts +61 -0
  95. package/dist/sdk.js +6532 -0
  96. package/dist/serve-HSFF6MGB.js +178 -0
  97. package/dist/serve-R2IHP26A.js +532 -0
  98. package/dist/serve.d.ts +37 -0
  99. package/dist/serveHeartbeat.d.ts +14 -0
  100. package/dist/serveProtocol.d.ts +47 -0
  101. package/dist/session-YM36TGU7.js +12 -0
  102. package/dist/session.d.ts +33 -0
  103. package/dist/setup-3YB6EKYX.js +24 -0
  104. package/dist/setup.d.ts +79 -0
  105. package/dist/slash/copy.d.ts +1 -0
  106. package/dist/slash/diff.d.ts +1 -0
  107. package/dist/slash/doctor.d.ts +18 -0
  108. package/dist/slash/export.d.ts +2 -0
  109. package/dist/slash/info.d.ts +46 -0
  110. package/dist/slash/memory.d.ts +10 -0
  111. package/dist/statsCli-I4TSDU3X.js +353 -0
  112. package/dist/statsCli.d.ts +62 -0
  113. package/dist/textToolCalls.d.ts +6 -0
  114. package/dist/thinking.d.ts +17 -0
  115. package/dist/tokenBudget.d.ts +22 -0
  116. package/dist/tools/bash.d.ts +54 -0
  117. package/dist/tools/diagnostics.d.ts +13 -0
  118. package/dist/tools/edit.d.ts +12 -0
  119. package/dist/tools/fetch.d.ts +41 -0
  120. package/dist/tools/glob.d.ts +5 -0
  121. package/dist/tools/globSafety.d.ts +7 -0
  122. package/dist/tools/grep.d.ts +25 -0
  123. package/dist/tools/ignore.d.ts +2 -0
  124. package/dist/tools/index.d.ts +12 -0
  125. package/dist/tools/memory.d.ts +13 -0
  126. package/dist/tools/paths.d.ts +4 -0
  127. package/dist/tools/plan.d.ts +10 -0
  128. package/dist/tools/read.d.ts +16 -0
  129. package/dist/tools/repomap.d.ts +2 -0
  130. package/dist/tools/sandbox.d.ts +15 -0
  131. package/dist/tools/shell.d.ts +18 -0
  132. package/dist/tools/skill.d.ts +3 -0
  133. package/dist/tools/task.d.ts +28 -0
  134. package/dist/tools/todo.d.ts +13 -0
  135. package/dist/tools/types.d.ts +52 -0
  136. package/dist/tools/websearch.d.ts +9 -0
  137. package/dist/tools/write.d.ts +5 -0
  138. package/dist/transferCli-3B4LMOYI.js +73 -0
  139. package/dist/transferCli.d.ts +23 -0
  140. package/dist/ui/App.d.ts +7 -0
  141. package/dist/ui/DiffView.d.ts +3 -0
  142. package/dist/ui/EditableText.d.ts +7 -0
  143. package/dist/ui/LinePrompt.d.ts +6 -0
  144. package/dist/ui/ListPicker.d.ts +11 -0
  145. package/dist/ui/Markdown.d.ts +8 -0
  146. package/dist/ui/McpMenu.d.ts +11 -0
  147. package/dist/ui/ModelPicker.d.ts +6 -0
  148. package/dist/ui/PermissionPrompt.d.ts +5 -0
  149. package/dist/ui/PlanApproval.d.ts +5 -0
  150. package/dist/ui/PromptInput.d.ts +20 -0
  151. package/dist/ui/ProviderMenu.d.ts +10 -0
  152. package/dist/ui/Spinner.d.ts +4 -0
  153. package/dist/ui/StatusBar.d.ts +14 -0
  154. package/dist/ui/TodoList.d.ts +4 -0
  155. package/dist/ui/ToolBlock.d.ts +14 -0
  156. package/dist/ui/complete.d.ts +8 -0
  157. package/dist/ui/index.d.ts +7 -0
  158. package/dist/ui/lineEdit.d.ts +42 -0
  159. package/dist/ui/liveCap.d.ts +29 -0
  160. package/dist/ui/markdownLayout.d.ts +23 -0
  161. package/dist/ui/replay.d.ts +4 -0
  162. package/dist/ui/stdinFilter.d.ts +18 -0
  163. package/dist/ui/table.d.ts +20 -0
  164. package/dist/ui/theme.d.ts +5 -0
  165. package/dist/ui/thinkingMouse.d.ts +38 -0
  166. package/dist/ui/transcript.d.ts +55 -0
  167. package/dist/ui/tty.d.ts +11 -0
  168. package/dist/ui/vim.d.ts +26 -0
  169. package/dist/ui-TAZMRXRI.js +3044 -0
  170. package/dist/update-XC3B6SJC.js +145 -0
  171. package/dist/update.d.ts +30 -0
  172. package/dist/verify.d.ts +16 -0
  173. package/dist/version.d.ts +1 -0
  174. package/dist/webBudget.d.ts +25 -0
  175. package/dist/worktree.d.ts +12 -0
  176. package/package.json +59 -35
  177. package/THIRD_PARTY_NOTICES.md +0 -9
  178. package/branding.mjs +0 -347
  179. package/cli.mjs +0 -120
  180. package/core.mjs +0 -260
  181. package/credentials.mjs +0 -52
  182. package/gateway.mjs +0 -2
  183. package/model-command.mjs +0 -61
  184. package/provider-cli.mjs +0 -77
  185. package/providers.mjs +0 -166
  186. package/proxy.mjs +0 -242
  187. package/startup-menu.mjs +0 -120
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ ConfigError
4
+ } from "./chunk-ZXWRLN7E.js";
5
+ import {
6
+ t
7
+ } from "./chunk-IDZLHEVL.js";
8
+
9
+ // src/mcp/catalog.ts
10
+ var CATALOG = [
11
+ { name: "playwright", description: "control a browser (open pages, click, fill forms, screenshot)", config: { command: "npx", args: ["-y", "@playwright/mcp@latest"] } },
12
+ { name: "context7", description: "up-to-date library documentation", config: { type: "http", url: "https://mcp.context7.com/mcp" } },
13
+ { name: "fetch", description: "fetch web pages as markdown (needs uv)", config: { command: "uvx", args: ["mcp-server-fetch"] } },
14
+ {
15
+ name: "filesystem",
16
+ description: "access folders outside the project",
17
+ // biome-ignore lint/suspicious/noTemplateCurlyInString: ${dir} is filled by fillTemplate, not a template literal
18
+ config: { command: "npx", args: ["-y", "@modelcontextprotocol/server-filesystem", "${dir}"] },
19
+ inputs: [{ key: "dir", label: "Folder the server may access" }]
20
+ },
21
+ { name: "git", description: "structured git operations (needs uv)", config: { command: "uvx", args: ["mcp-server-git"] } },
22
+ {
23
+ name: "github",
24
+ description: "GitHub issues, PRs, and repos",
25
+ // biome-ignore lint/suspicious/noTemplateCurlyInString: ${token} is filled by fillTemplate, not a template literal
26
+ config: { type: "http", url: "https://api.githubcopilot.com/mcp/", headers: { Authorization: "Bearer ${token}" } },
27
+ inputs: [{ key: "token", label: "GitHub Personal Access Token", secret: true }]
28
+ }
29
+ ];
30
+ function fillTemplate(config, values) {
31
+ const missing = /* @__PURE__ */ new Set();
32
+ const fill = (s) => s.replace(/\$\{([A-Za-z0-9_]+)\}/g, (_m, key) => {
33
+ if (!values[key]) missing.add(key);
34
+ return values[key] ?? "";
35
+ });
36
+ const mapValues = (o) => Object.fromEntries(Object.entries(o).map(([k, v]) => [k, fill(v)]));
37
+ const out = config.type === "http" ? { type: "http", url: fill(config.url), ...config.headers ? { headers: mapValues(config.headers) } : {} } : {
38
+ ...config.type ? { type: config.type } : {},
39
+ command: fill(config.command),
40
+ ...config.args ? { args: config.args.map(fill) } : {},
41
+ ...config.env ? { env: mapValues(config.env) } : {}
42
+ };
43
+ if (missing.size) throw new ConfigError(t("Missing MCP fields: {fields}", { fields: [...missing].join(", ") }));
44
+ return out;
45
+ }
46
+
47
+ export {
48
+ CATALOG,
49
+ fillTemplate
50
+ };
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/version.ts
4
+ var VERSION = true ? "0.5.1" : "0.0.0-dev";
5
+
6
+ export {
7
+ VERSION
8
+ };
@@ -0,0 +1,159 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ defaultOpen
4
+ } from "./chunk-YGBTNDPK.js";
5
+ import {
6
+ removeCredential,
7
+ saveCredential
8
+ } from "./chunk-ZXWRLN7E.js";
9
+ import {
10
+ t
11
+ } from "./chunk-IDZLHEVL.js";
12
+
13
+ // src/login.ts
14
+ function readSecret(prompt) {
15
+ return new Promise((resolve) => {
16
+ process.stdout.write(prompt);
17
+ const stdin = process.stdin;
18
+ if (!stdin.isTTY) {
19
+ let data = "";
20
+ stdin.on("data", (d) => {
21
+ data += d;
22
+ });
23
+ stdin.on("end", () => resolve(data.trim()));
24
+ return;
25
+ }
26
+ let value = "";
27
+ stdin.setRawMode(true);
28
+ stdin.resume();
29
+ const onData = (buffer) => {
30
+ for (const ch of buffer.toString()) {
31
+ if (ch === "\r" || ch === "\n") {
32
+ stdin.setRawMode(false);
33
+ stdin.pause();
34
+ stdin.off("data", onData);
35
+ process.stdout.write("\n");
36
+ resolve(value.trim());
37
+ return;
38
+ }
39
+ if (ch === "") process.exit(130);
40
+ if (ch === "\x7F" || ch === "\b") value = value.slice(0, -1);
41
+ else value += ch;
42
+ }
43
+ };
44
+ stdin.on("data", onData);
45
+ });
46
+ }
47
+ function echoFor(ch) {
48
+ const code = ch.codePointAt(0) ?? 0;
49
+ if (code < 32 || code === 127) return void 0;
50
+ return ch;
51
+ }
52
+ function readLine(prompt) {
53
+ return new Promise((resolve) => {
54
+ process.stdout.write(prompt);
55
+ const stdin = process.stdin;
56
+ if (!stdin.isTTY) {
57
+ let data = "";
58
+ stdin.on("data", (d) => {
59
+ data += d;
60
+ });
61
+ stdin.on("end", () => resolve(data.trim()));
62
+ return;
63
+ }
64
+ let value = "";
65
+ stdin.setRawMode(true);
66
+ stdin.resume();
67
+ const onData = (buffer) => {
68
+ for (const ch of buffer.toString()) {
69
+ const code = ch.charCodeAt(0);
70
+ if (code === 13 || code === 10) {
71
+ stdin.setRawMode(false);
72
+ stdin.pause();
73
+ stdin.off("data", onData);
74
+ process.stdout.write("\n");
75
+ resolve(value.trim());
76
+ return;
77
+ }
78
+ if (code === 3) process.exit(130);
79
+ if (code === 127 || code === 8) {
80
+ if (value) {
81
+ value = value.slice(0, -1);
82
+ process.stdout.write("\b \b");
83
+ }
84
+ continue;
85
+ }
86
+ const echo = echoFor(ch);
87
+ if (echo) process.stdout.write(echo);
88
+ value += ch;
89
+ }
90
+ };
91
+ stdin.on("data", onData);
92
+ });
93
+ }
94
+ function defaultLoginDeps() {
95
+ return {
96
+ out: (s) => console.log(s),
97
+ err: (s) => console.error(s),
98
+ env: process.env,
99
+ isTTY: process.stdin.isTTY ?? false,
100
+ open: (url) => defaultOpen(new URL(url)),
101
+ readLine,
102
+ saveCredential: (id, key) => saveCredential(id, key, process.env),
103
+ removeCredential: (id) => removeCredential(id, process.env),
104
+ fetch: globalThis.fetch,
105
+ // Wiring NYATA jalur lama: persis runLogin lama (provider add + prompt key).
106
+ legacyAdd: async (providerId, targetCwd) => {
107
+ const { runProviderCommand } = await import("./providerCli-YMG4G56R.js");
108
+ const { parseCliArgs: parse } = await import("./args-XA77XUMD.js");
109
+ return runProviderCommand(parse(["provider", "add", providerId]), {
110
+ env: process.env,
111
+ cwd: targetCwd,
112
+ out: (s) => console.log(s),
113
+ err: (s) => console.error(s),
114
+ readSecret
115
+ });
116
+ }
117
+ };
118
+ }
119
+ async function runLogin(providerId, cwd, args, deps) {
120
+ if (args.key && args.logout) {
121
+ deps.err(t("Use either --key or --logout, not both."));
122
+ return 1;
123
+ }
124
+ if (args.logout) {
125
+ if (providerId !== "openrouter") {
126
+ deps.err(
127
+ t("Logout is not supported for {id}; use bccli provider remove {id} to delete its stored key and config.", {
128
+ id: providerId
129
+ })
130
+ );
131
+ return 1;
132
+ }
133
+ const { runOauthLogout } = await import("./oauthLogin-JWXQZTMZ.js");
134
+ return runOauthLogout({ out: deps.out, err: deps.err, env: deps.env, removeCredential: deps.removeCredential });
135
+ }
136
+ if (args.key) return deps.legacyAdd(providerId, cwd);
137
+ if (providerId === "openrouter") {
138
+ const { runOauthLogin } = await import("./oauthLogin-JWXQZTMZ.js");
139
+ return runOauthLogin({
140
+ out: deps.out,
141
+ err: deps.err,
142
+ env: deps.env,
143
+ isTTY: deps.isTTY,
144
+ open: deps.open,
145
+ readLine: deps.readLine,
146
+ saveCredential: deps.saveCredential,
147
+ fetch: deps.fetch
148
+ });
149
+ }
150
+ return deps.legacyAdd(providerId, cwd);
151
+ }
152
+
153
+ export {
154
+ readSecret,
155
+ echoFor,
156
+ readLine,
157
+ defaultLoginDeps,
158
+ runLogin
159
+ };