@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.
- package/README.en.md +253 -0
- package/README.md +93 -6
- package/dist/abort.d.ts +5 -0
- package/dist/acp-3PHBAI64.js +182 -0
- package/dist/acp.d.ts +27 -0
- package/dist/agent.d.ts +143 -0
- package/dist/agents.d.ts +4 -0
- package/dist/args-W6BNKY7K.js +13 -0
- package/dist/args.d.ts +51 -0
- package/dist/budget.d.ts +23 -0
- package/dist/checkpoints.d.ts +34 -0
- package/dist/{chunk-BFZXRKW5.js → chunk-24JN75FZ.js} +29 -7
- package/dist/chunk-45SDLMTV.js +341 -0
- package/dist/chunk-75BECX4F.js +56 -0
- package/dist/{chunk-SJH3YLW4.js → chunk-BC7UXFE4.js} +69 -6
- package/dist/chunk-BGXNR74O.js +733 -0
- package/dist/chunk-BKGFA2PT.js +8 -0
- package/dist/{chunk-CLN4Z5E3.js → chunk-BLOYFIAD.js} +6 -3
- package/dist/chunk-BXQQCUAC.js +145 -0
- package/dist/chunk-FLQPE4S5.js +373 -0
- package/dist/chunk-GN4W3T6E.js +76 -0
- package/dist/{chunk-7S6JXQCH.js → chunk-JHPGOAXU.js} +2 -1
- package/dist/chunk-MFHCQQEN.js +201 -0
- package/dist/chunk-MHIYLXJC.js +143 -0
- package/dist/chunk-PSO7R5AD.js +10 -0
- package/dist/chunk-PZRKU4UM.js +2143 -0
- package/dist/chunk-QZKLZELZ.js +64 -0
- package/dist/chunk-R5RE46CW.js +231 -0
- package/dist/chunk-UZWJQF67.js +500 -0
- package/dist/{chunk-DX7CZTBB.js → chunk-WI22M2ID.js} +14 -9
- package/dist/chunk-WNACAUDK.js +946 -0
- package/dist/chunk-XV7ZVL4J.js +235 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +150 -1382
- package/dist/clipboardImage.d.ts +17 -0
- package/dist/commands.d.ts +16 -0
- package/dist/completion-HPPFDAPB.js +125 -0
- package/dist/completion.d.ts +14 -0
- package/dist/{config-YUNKPCNB.js → config-DIDLDONU.js} +5 -2
- package/dist/config-IU76CPK2.js +34 -0
- package/dist/config.d.ts +97 -0
- package/dist/context.d.ts +13 -0
- package/dist/contextWindow.d.ts +3 -0
- package/dist/diff.d.ts +7 -0
- package/dist/exit.d.ts +9 -0
- package/dist/extensions.d.ts +34 -0
- package/dist/ghBotCli-E3VPHNZY.js +677 -0
- package/dist/ghBotCli.d.ts +9 -0
- package/dist/ghBotDispatch.d.ts +68 -0
- package/dist/ghBotRunner.d.ts +82 -0
- package/dist/ghBotServe.d.ts +21 -0
- package/dist/ghBotWebhook.d.ts +45 -0
- package/dist/hooks.d.ts +27 -0
- package/dist/i18n/id.d.ts +1 -0
- package/dist/i18n.d.ts +16 -0
- package/dist/integrationCli-Q2YPDTPG.js +685 -0
- package/dist/integrationCli.d.ts +9 -0
- package/dist/keybinds.d.ts +22 -0
- package/dist/login-FP3BB44A.js +16 -0
- package/dist/login.d.ts +19 -0
- package/dist/lsp.d.ts +47 -0
- package/dist/mcp/catalog.d.ts +14 -0
- package/dist/mcp/config.d.ts +36 -0
- package/dist/mcp/manager.d.ts +34 -0
- package/dist/mcp/oauth.d.ts +82 -0
- package/dist/{mcpCli-DZWQPTOS.js → mcpCli-SNBDUWJN.js} +42 -9
- package/dist/mcpCli.d.ts +3 -0
- package/dist/mcpServer/serve.d.ts +8 -0
- package/dist/mcpServer/server.d.ts +19 -0
- package/dist/models.d.ts +13 -0
- package/dist/modelsCli-CZ2HNGKR.js +36 -0
- package/dist/modelsCli.d.ts +15 -0
- package/dist/npmRunner-LU43GM3W.js +46 -0
- package/dist/npmRunner.d.ts +21 -0
- package/dist/oauthLogin-6FWQABJ7.js +210 -0
- package/dist/oauthLogin.d.ts +47 -0
- package/dist/permissions.d.ts +30 -0
- package/dist/pluginSpec.d.ts +25 -0
- package/dist/plugins.d.ts +45 -0
- package/dist/pluginsCli-LPIUUDWB.js +284 -0
- package/dist/pluginsCli.d.ts +16 -0
- package/dist/prCli-5IMV3VNQ.js +78 -0
- package/dist/prCli.d.ts +33 -0
- package/dist/presets.d.ts +8 -0
- package/dist/print.d.ts +14 -0
- package/dist/provider.d.ts +140 -0
- package/dist/providerCli-NMUFXAAS.js +15 -0
- package/dist/providerCli.d.ts +17 -0
- package/dist/providers.d.ts +6 -0
- package/dist/reasoning.d.ts +12 -0
- package/dist/repomap.d.ts +10 -0
- package/dist/sdk.d.ts +57 -0
- package/dist/sdk.js +5571 -0
- package/dist/serve-KWOECK5W.js +178 -0
- package/dist/serve-X2ZV4S5U.js +521 -0
- package/dist/serve.d.ts +37 -0
- package/dist/serveHeartbeat.d.ts +14 -0
- package/dist/serveProtocol.d.ts +47 -0
- package/dist/session-GKEXDJKZ.js +12 -0
- package/dist/session.d.ts +30 -0
- package/dist/setup-OV3NWQN5.js +24 -0
- package/dist/setup.d.ts +74 -0
- package/dist/slash/copy.d.ts +1 -0
- package/dist/slash/diff.d.ts +1 -0
- package/dist/slash/doctor.d.ts +18 -0
- package/dist/slash/export.d.ts +2 -0
- package/dist/slash/info.d.ts +45 -0
- package/dist/slash/memory.d.ts +10 -0
- package/dist/statsCli-CF3R7ATL.js +353 -0
- package/dist/statsCli.d.ts +62 -0
- package/dist/textToolCalls.d.ts +6 -0
- package/dist/thinking.d.ts +17 -0
- package/dist/tokenBudget.d.ts +22 -0
- package/dist/tools/bash.d.ts +52 -0
- package/dist/tools/diagnostics.d.ts +5 -0
- package/dist/tools/edit.d.ts +7 -0
- package/dist/tools/fetch.d.ts +41 -0
- package/dist/tools/glob.d.ts +5 -0
- package/dist/tools/globSafety.d.ts +7 -0
- package/dist/tools/grep.d.ts +13 -0
- package/dist/tools/ignore.d.ts +2 -0
- package/dist/tools/index.d.ts +12 -0
- package/dist/tools/memory.d.ts +13 -0
- package/dist/tools/paths.d.ts +2 -0
- package/dist/tools/plan.d.ts +10 -0
- package/dist/tools/read.d.ts +16 -0
- package/dist/tools/repomap.d.ts +2 -0
- package/dist/tools/sandbox.d.ts +12 -0
- package/dist/tools/shell.d.ts +18 -0
- package/dist/tools/skill.d.ts +3 -0
- package/dist/tools/task.d.ts +28 -0
- package/dist/tools/todo.d.ts +13 -0
- package/dist/tools/types.d.ts +52 -0
- package/dist/tools/websearch.d.ts +9 -0
- package/dist/tools/write.d.ts +5 -0
- package/dist/transferCli-YUFPI6AH.js +71 -0
- package/dist/transferCli.d.ts +23 -0
- package/dist/ui/App.d.ts +7 -0
- package/dist/ui/DiffView.d.ts +3 -0
- package/dist/ui/EditableText.d.ts +7 -0
- package/dist/ui/LinePrompt.d.ts +6 -0
- package/dist/ui/ListPicker.d.ts +11 -0
- package/dist/ui/Markdown.d.ts +8 -0
- package/dist/ui/McpMenu.d.ts +11 -0
- package/dist/ui/ModelPicker.d.ts +6 -0
- package/dist/ui/PermissionPrompt.d.ts +5 -0
- package/dist/ui/PlanApproval.d.ts +5 -0
- package/dist/ui/PromptInput.d.ts +18 -0
- package/dist/ui/ProviderMenu.d.ts +10 -0
- package/dist/ui/Spinner.d.ts +4 -0
- package/dist/ui/StatusBar.d.ts +9 -0
- package/dist/ui/TodoList.d.ts +4 -0
- package/dist/ui/ToolBlock.d.ts +14 -0
- package/dist/ui/complete.d.ts +1 -0
- package/dist/ui/focusReport.d.ts +1 -0
- package/dist/ui/index.d.ts +7 -0
- package/dist/ui/lineEdit.d.ts +42 -0
- package/dist/ui/replay.d.ts +4 -0
- package/dist/ui/table.d.ts +20 -0
- package/dist/ui/theme.d.ts +5 -0
- package/dist/ui/thinkingMouse.d.ts +33 -0
- package/dist/ui/transcript.d.ts +55 -0
- package/dist/ui/vim.d.ts +26 -0
- package/dist/ui-IVIFNUCC.js +2367 -0
- package/dist/update-TZ2G6KQ3.js +145 -0
- package/dist/update.d.ts +30 -0
- package/dist/verify.d.ts +16 -0
- package/dist/version.d.ts +1 -0
- package/dist/webBudget.d.ts +25 -0
- package/dist/worktree.d.ts +12 -0
- package/package.json +42 -8
- package/dist/args-JPVSGCGY.js +0 -12
- package/dist/chunk-2MGINW4O.js +0 -114
- package/dist/chunk-ELML4KVQ.js +0 -76
- package/dist/chunk-ISGBGFSU.js +0 -52
- package/dist/chunk-KV27KTOX.js +0 -254
- package/dist/chunk-U7GK73CK.js +0 -341
- package/dist/chunk-ZYCYTEKD.js +0 -96
- package/dist/integrationCli-BGT5UZU4.js +0 -223
- package/dist/login-6K32PIXV.js +0 -9
- package/dist/providerCli-Q7LRM2NP.js +0 -12
- package/dist/session-7UB77CEG.js +0 -9
- package/dist/ui-6GTQUJOE.js +0 -1415
|
@@ -0,0 +1,68 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
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
|
+
}>;
|
|
@@ -0,0 +1,21 @@
|
|
|
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>;
|
|
@@ -0,0 +1,45 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
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>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ID: Record<string, string>;
|
package/dist/i18n.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
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;
|