@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
@@ -1,68 +0,0 @@
1
- import type { CommentDelivery } from './ghBotWebhook';
2
- export interface GhBotConfig {
3
- enabled: boolean;
4
- path: string;
5
- secretEnv: string;
6
- repos: string[];
7
- users: string[];
8
- maxBodyBytes: number;
9
- maxActive: number;
10
- maxQueue: number;
11
- stepLimit: number;
12
- timeoutMs: number;
13
- /** Kapasitas completed-LRU (opsional; default 1000) — dipakai test utk memperkecil. */
14
- dedupCap?: number;
15
- }
16
- /** Validasi ketat + default aman (off-by-default). */
17
- export declare function ghBotConfigFrom(raw: unknown): GhBotConfig;
18
- export type AcceptResult = 'queued' | 'dedup' | 'inflight' | 'filtered' | 'full' | 'closed';
19
- export interface GhBotHubDeps {
20
- out(s: string): void;
21
- err(s: string): void;
22
- /** SATU signal (deadline ∪ close) diteruskan ke collect+draft+post. */
23
- runJob(d: CommentDelivery, signal: AbortSignal): Promise<{
24
- ok: boolean;
25
- reason?: string;
26
- }>;
27
- }
28
- export interface CloseSummary {
29
- aborted: number;
30
- terminationConfirmed: number;
31
- terminationUnconfirmed: number;
32
- }
33
- /**
34
- * Admission atomik (spec §4): filter → cek duplikat (inFlight/LRU) → cek kapasitas →
35
- * reservasi dalam satu blok sinkron. `full` TIDAK menyimpan dedup. Worker membersihkan
36
- * active/inFlight di finally pada resolve MAUPUN reject (dibungkus Promise.resolve().then
37
- * agar throw sinkron pun masuk jalur catch). Job gagal tidak masuk completed-LRU.
38
- */
39
- export declare class GhBotHub {
40
- private readonly cfg;
41
- private readonly deps;
42
- private readonly inFlight;
43
- private readonly completed;
44
- private readonly completedOrder;
45
- private readonly queue;
46
- private active;
47
- private closed;
48
- private closing;
49
- private readonly closeController;
50
- private readonly closeReasons;
51
- private readonly idleWaiters;
52
- private readonly dedupCap;
53
- /** Akumulasi SEMUA job (di/di luar close) — §9.19: unconfirmed terhitung walau gagal sebelum close. */
54
- private unconfirmedTotal;
55
- constructor(cfg: GhBotConfig, deps: GhBotHubDeps);
56
- accept(delivery: CommentDelivery): AcceptResult;
57
- private pump;
58
- private pushCompleted;
59
- private maybeIdle;
60
- whenIdle(): Promise<void>;
61
- close(): Promise<CloseSummary>;
62
- stats(): {
63
- queued: number;
64
- active: number;
65
- inflight: number;
66
- completed: number;
67
- };
68
- }
@@ -1,82 +0,0 @@
1
- import { spawn } from 'node:child_process';
2
- import type { AgentEvent } from './agent';
3
- import { type CommentDelivery } from './ghBotWebhook';
4
- export interface GhDeps {
5
- /** ASYNC (spawn, bukan spawnSync), argv array tanpa shell; stdin opsional utk `--input -`
6
- * (EPIPE ditangani); signal → child di-kill; settle sekali via close/error. */
7
- spawn(argv: string[], opts?: {
8
- signal?: AbortSignal;
9
- stdin?: string;
10
- }): Promise<{
11
- code: number;
12
- stdout: string;
13
- stderr: string;
14
- }>;
15
- }
16
- /** Instruksi draf — system prompt murni (tanpa data konteks). */
17
- export declare function ghSystemPrompt(): string;
18
- export interface CreateGhSpawnOptions {
19
- spawnImpl?: typeof spawn;
20
- killGraceMs?: number;
21
- hardMs?: number;
22
- }
23
- /**
24
- * Spawn async dgn settle HANYA dari `close` (KECUALI hard-timeout force-settle),
25
- * eskalasi `kill('SIGKILL')` eksplisit, marker SELALU ikut di hard-timeout, dan
26
- * cleanup listener/pipe di settle (data telat aman). Lihat spec §6.4.
27
- */
28
- export declare function createGhSpawn(cmd?: string, o?: CreateGhSpawnOptions): GhDeps['spawn'];
29
- /**
30
- * Konteks di-pra-kumpulkan: selalu issue view; bila isPR → pr view + pr diff.
31
- * SEMUA gh command membawa --repo dari delivery tervalidasi (tanpa cwd).
32
- * Data masuk blok <untrusted-github>; komentar 8KB, issue body 64KB, diff 100KB (byte UTF-8).
33
- */
34
- export declare function collectGhContext(d: CommentDelivery, deps: {
35
- gh: GhDeps;
36
- signal: AbortSignal;
37
- }): Promise<{
38
- ok: true;
39
- context: string;
40
- } | {
41
- ok: false;
42
- reason: string;
43
- }>;
44
- export type DraftStopReason = 'done' | 'aborted' | 'stepLimit' | 'budgetExceeded' | 'error' | 'none';
45
- /** Kolektor event agent: text append; textReplace MENGGANTI; stopReason = event terminal terakhir. */
46
- export declare function createDraftCollector(): {
47
- onEvent(e: AgentEvent): void;
48
- result(): {
49
- text: string;
50
- stopReason: DraftStopReason;
51
- };
52
- };
53
- /**
54
- * Sukses HANYA stopReason 'done' + teks non-kosong; selain itu gagal (tanpa post).
55
- * dispose SELALU di finally.
56
- */
57
- export declare function runDraft(context: string, signal: AbortSignal, deps: {
58
- createAgent(): {
59
- run(prompt: string, signal: AbortSignal): Promise<{
60
- text: string;
61
- stopReason: DraftStopReason;
62
- }>;
63
- dispose(): Promise<void> | void;
64
- };
65
- system: string;
66
- }): Promise<{
67
- ok: true;
68
- text: string;
69
- } | {
70
- ok: false;
71
- reason: string;
72
- }>;
73
- /** Post komentar via stdin JSON — hasil TERSTRUKTUR (koreksi review #1). */
74
- export declare function postReply(d: CommentDelivery, text: string, deps: {
75
- gh: GhDeps;
76
- signal: AbortSignal;
77
- }): Promise<{
78
- ok: true;
79
- } | {
80
- ok: false;
81
- reason: string;
82
- }>;
@@ -1,21 +0,0 @@
1
- import { type GhBotConfig, type CloseSummary } from './ghBotDispatch';
2
- import type { Provider } from './provider';
3
- import { type GhDeps } from './ghBotRunner';
4
- export interface GhBotServeOptions {
5
- port?: number;
6
- host?: string;
7
- config: GhBotConfig;
8
- /** Aksesor per-request (rotasi secret tanpa restart — spec §3). */
9
- getSecret: () => string | undefined;
10
- env?: NodeJS.ProcessEnv;
11
- provider?: Provider;
12
- fetch?: typeof globalThis.fetch;
13
- gh?: GhDeps;
14
- out?: (s?: string) => void;
15
- err?: (s?: string) => void;
16
- }
17
- export interface GhBotHandle {
18
- port: number;
19
- close(): Promise<CloseSummary>;
20
- }
21
- export declare function startGhBot(opts: GhBotServeOptions): Promise<GhBotHandle>;
@@ -1,45 +0,0 @@
1
- /** Header wajib GitHub webhook delivery. */
2
- export declare const GITHUB_HEADERS: readonly ['x-hub-signature-256', 'x-hub-delivery', 'x-hub-event'];
3
- export interface CommentDelivery {
4
- delivery: string;
5
- event: string;
6
- action: string;
7
- repo: string;
8
- number: number;
9
- isPR: boolean;
10
- author: string;
11
- authorType: string;
12
- body: string;
13
- }
14
- export type VerifyOutcome = {
15
- ok: true;
16
- delivery: CommentDelivery;
17
- } | {
18
- ok: false;
19
- status: 400 | 401 | 405 | 413 | 415 | 503;
20
- message: string;
21
- };
22
- /** 'sha256=<hex>' atas byte mentah — dipakai verifikasi dan fixture test. */
23
- export declare function signBody(rawBody: Buffer, secret: string): string;
24
- declare const HARD_TIMEOUT_MARKER = "<child did not close after termination>";
25
- export { HARD_TIMEOUT_MARKER };
26
- /**
27
- * Urutan persis spec §3: method → content-type → size (byte) → header wajib →
28
- * secret (aksesor per-request) → HMAC atas Buffer MENTAH → decode UTF-8 fatal →
29
- * parse → tipe-guard field event. HMAC selalu sebelum decode/parse.
30
- */
31
- export declare function verifyAndParse(rawBody: Buffer, headers: Record<string, string | undefined>, opts: {
32
- method: string;
33
- contentType: string | undefined;
34
- maxBodyBytes: number;
35
- getSecret: () => string | undefined;
36
- }, jsonParse?: (text: string) => unknown): VerifyOutcome;
37
- /**
38
- * '/bccli <task>' → task trim; '/bccli' tanpa task → null (tanpa balasan);
39
- * prefix lain / komentar biasa → null.
40
- */
41
- export declare function extractCommand(body: string): string | null;
42
- /** Potong di batas code point dengan budget byte UTF-8 — tak pernah membelah karakter. */
43
- export declare function truncateUtf8Bytes(text: string, maxBytes: number, marker?: string): string;
44
- /** 60% kepala + 40% ekor dalam SATU budget byte, dengan marker di tengah. */
45
- export declare function truncateHeadTailUtf8(text: string, maxBytes: number, marker?: string): string;
package/dist/hooks.d.ts DELETED
@@ -1,27 +0,0 @@
1
- export type HookEvent = 'PreToolUse' | 'PostToolUse' | 'SessionStart' | 'Stop';
2
- export interface HookRule {
3
- /** Glob over the tool name ('*' matches everything, omitted = every tool). Tool events only. */
4
- match?: string;
5
- command: string;
6
- }
7
- export type HooksConfig = Partial<Record<HookEvent, HookRule[]>>;
8
- export interface HookOutcome {
9
- /** PreToolUse only: the tool call is denied with this message instead of running. */
10
- blocked?: string;
11
- warnings: string[];
12
- }
13
- export interface HookRunOptions {
14
- env?: NodeJS.ProcessEnv;
15
- cwd?: string;
16
- timeoutMs?: number;
17
- }
18
- /**
19
- * Runs the configured hooks for one event, in order. A PreToolUse hook that exits
20
- * with code 2 blocks the tool call (Claude Code semantics); any other failure is a
21
- * non-blocking warning. Hooks receive BCCLI_HOOK_EVENT/TOOL/INPUT/OUTPUT env vars.
22
- */
23
- export declare function runHooks(hooks: HooksConfig | undefined, event: HookEvent, payload?: {
24
- tool?: string;
25
- input?: unknown;
26
- output?: string;
27
- }, opts?: HookRunOptions): Promise<HookOutcome>;
package/dist/i18n/id.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare const ID: Record<string, string>;
package/dist/i18n.d.ts DELETED
@@ -1,16 +0,0 @@
1
- export type Lang = 'en' | 'id';
2
- export declare const LANGS: readonly Lang[];
3
- export declare function parseLang(value: string | undefined): Lang | undefined;
4
- export declare function setLanguage(lang: Lang): void;
5
- export declare function getLanguage(): Lang;
6
- /** Locale for dates and numbers, matching the UI language. */
7
- export declare const locale: () => string;
8
- /**
9
- * User-facing text. The English sentence is the key; Indonesian lives in i18n/id.ts.
10
- * Placeholders are `{name}`. Text the model reads (tool results, prompts) is plain English and does not go through here.
11
- */
12
- export declare function t(en: string, params?: Record<string, string | number>): string;
13
- /** `--lang x` or `--lang=x` from raw argv, so even argument errors can be shown in the right language. */
14
- export declare function langFromArgv(argv: string[]): Lang | undefined;
15
- /** --lang, then BCCLI_LANG, then the `language` of the global config, then English. */
16
- export declare function resolveLanguage(argv: string[], env: NodeJS.ProcessEnv, fromConfig?: string): Lang;