@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.
- package/LICENSE +203 -21
- package/THIRD_PARTY_NOTICES.md +9 -0
- package/branding.mjs +347 -0
- package/cli.mjs +120 -0
- package/core.mjs +260 -0
- package/credentials.mjs +52 -0
- package/gateway.mjs +2 -0
- package/model-command.mjs +61 -0
- package/package.json +35 -59
- package/provider-cli.mjs +77 -0
- package/providers.mjs +166 -0
- package/proxy.mjs +242 -0
- package/startup-menu.mjs +120 -0
- package/README.en.md +0 -253
- package/README.md +0 -250
- package/dist/abort.d.ts +0 -5
- package/dist/acp-JZW3XHE5.js +0 -221
- package/dist/acp.d.ts +0 -44
- package/dist/agent.d.ts +0 -147
- package/dist/agents.d.ts +0 -4
- package/dist/args-XVO7TB4C.js +0 -13
- package/dist/args.d.ts +0 -59
- package/dist/budget.d.ts +0 -26
- package/dist/checkpoints.d.ts +0 -35
- package/dist/chunk-3CYQYHPK.js +0 -202
- package/dist/chunk-6JK4IBGK.js +0 -1075
- package/dist/chunk-6SDRWEPN.js +0 -50
- package/dist/chunk-7GM6NN5E.js +0 -341
- package/dist/chunk-7XD47KN5.js +0 -71
- package/dist/chunk-INMSTUB2.js +0 -56
- package/dist/chunk-ISOKH5WB.js +0 -256
- package/dist/chunk-JUC3ZOCV.js +0 -50
- package/dist/chunk-KDVL2NP6.js +0 -861
- package/dist/chunk-KEKDRROL.js +0 -216
- package/dist/chunk-KJIXA6MP.js +0 -159
- package/dist/chunk-OK2USAXX.js +0 -88
- package/dist/chunk-PSO7R5AD.js +0 -10
- package/dist/chunk-Q42ZGVAQ.js +0 -91
- package/dist/chunk-R754XIBJ.js +0 -523
- package/dist/chunk-S3QEZDKB.js +0 -270
- package/dist/chunk-SWNRA3EW.js +0 -78
- package/dist/chunk-TLCL6DC7.js +0 -378
- package/dist/chunk-V5D6PJQN.js +0 -8
- package/dist/chunk-YYTFJUO2.js +0 -148
- package/dist/chunk-ZJRZTMJF.js +0 -2669
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +0 -233
- package/dist/clipboardImage.d.ts +0 -17
- package/dist/commands.d.ts +0 -16
- package/dist/completion-Q7VHOPPV.js +0 -125
- package/dist/completion.d.ts +0 -14
- package/dist/config-T7MKGJVG.js +0 -34
- package/dist/config-YYEAEN2C.js +0 -25
- package/dist/config.d.ts +0 -99
- package/dist/context.d.ts +0 -13
- package/dist/contextWindow.d.ts +0 -3
- package/dist/diff.d.ts +0 -7
- package/dist/exit.d.ts +0 -9
- package/dist/extensions.d.ts +0 -34
- package/dist/ghBotCli-7VUGI63S.js +0 -680
- package/dist/ghBotCli.d.ts +0 -9
- package/dist/ghBotDispatch.d.ts +0 -68
- package/dist/ghBotRunner.d.ts +0 -82
- package/dist/ghBotServe.d.ts +0 -21
- package/dist/ghBotWebhook.d.ts +0 -45
- package/dist/hooks.d.ts +0 -27
- package/dist/i18n/id.d.ts +0 -1
- package/dist/i18n.d.ts +0 -16
- package/dist/integrationCli-FBRSTF5F.js +0 -876
- package/dist/integrationCli.d.ts +0 -9
- package/dist/keybinds.d.ts +0 -22
- package/dist/login-BSMUGW7L.js +0 -18
- package/dist/login.d.ts +0 -21
- package/dist/lsp.d.ts +0 -73
- package/dist/mcp/catalog.d.ts +0 -14
- package/dist/mcp/config.d.ts +0 -36
- package/dist/mcp/manager.d.ts +0 -52
- package/dist/mcp/oauth.d.ts +0 -82
- package/dist/mcpCli-ZT7CRYMP.js +0 -113
- package/dist/mcpCli.d.ts +0 -3
- package/dist/mcpServer/serve.d.ts +0 -8
- package/dist/mcpServer/server.d.ts +0 -19
- package/dist/models.d.ts +0 -13
- package/dist/modelsCli-2ZRW4CC4.js +0 -36
- package/dist/modelsCli.d.ts +0 -15
- package/dist/npmRunner-LU43GM3W.js +0 -46
- package/dist/npmRunner.d.ts +0 -21
- package/dist/oauthLogin-THSM6FE7.js +0 -210
- package/dist/oauthLogin.d.ts +0 -47
- package/dist/permissions.d.ts +0 -30
- package/dist/pluginSpec.d.ts +0 -25
- package/dist/plugins.d.ts +0 -45
- package/dist/pluginsCli-EKQI4CJW.js +0 -288
- package/dist/pluginsCli.d.ts +0 -16
- package/dist/prCli-FMQTOBIV.js +0 -94
- package/dist/prCli.d.ts +0 -46
- package/dist/presets.d.ts +0 -8
- package/dist/print.d.ts +0 -17
- package/dist/provider.d.ts +0 -145
- package/dist/providerCli-3TFEKV4C.js +0 -15
- package/dist/providerCli.d.ts +0 -17
- package/dist/providers.d.ts +0 -6
- package/dist/reasoning.d.ts +0 -12
- package/dist/repomap.d.ts +0 -10
- package/dist/sdk.d.ts +0 -61
- package/dist/sdk.js +0 -6494
- package/dist/serve-3BODPEPR.js +0 -532
- package/dist/serve-V6YVZTNR.js +0 -178
- package/dist/serve.d.ts +0 -37
- package/dist/serveHeartbeat.d.ts +0 -14
- package/dist/serveProtocol.d.ts +0 -47
- package/dist/session-LX4UNPCD.js +0 -12
- package/dist/session.d.ts +0 -33
- package/dist/setup-MFG3BWEU.js +0 -24
- package/dist/setup.d.ts +0 -79
- package/dist/slash/copy.d.ts +0 -1
- package/dist/slash/diff.d.ts +0 -1
- package/dist/slash/doctor.d.ts +0 -18
- package/dist/slash/export.d.ts +0 -2
- package/dist/slash/info.d.ts +0 -46
- package/dist/slash/memory.d.ts +0 -10
- package/dist/statsCli-7MIQHLVW.js +0 -353
- package/dist/statsCli.d.ts +0 -62
- package/dist/textToolCalls.d.ts +0 -6
- package/dist/thinking.d.ts +0 -17
- package/dist/tokenBudget.d.ts +0 -22
- package/dist/tools/bash.d.ts +0 -54
- package/dist/tools/diagnostics.d.ts +0 -13
- package/dist/tools/edit.d.ts +0 -12
- package/dist/tools/fetch.d.ts +0 -41
- package/dist/tools/glob.d.ts +0 -5
- package/dist/tools/globSafety.d.ts +0 -7
- package/dist/tools/grep.d.ts +0 -25
- package/dist/tools/ignore.d.ts +0 -2
- package/dist/tools/index.d.ts +0 -12
- package/dist/tools/memory.d.ts +0 -13
- package/dist/tools/paths.d.ts +0 -4
- package/dist/tools/plan.d.ts +0 -10
- package/dist/tools/read.d.ts +0 -16
- package/dist/tools/repomap.d.ts +0 -2
- package/dist/tools/sandbox.d.ts +0 -15
- package/dist/tools/shell.d.ts +0 -18
- package/dist/tools/skill.d.ts +0 -3
- package/dist/tools/task.d.ts +0 -28
- package/dist/tools/todo.d.ts +0 -13
- package/dist/tools/types.d.ts +0 -52
- package/dist/tools/websearch.d.ts +0 -9
- package/dist/tools/write.d.ts +0 -5
- package/dist/transferCli-SRSYQLSJ.js +0 -73
- package/dist/transferCli.d.ts +0 -23
- package/dist/ui/App.d.ts +0 -7
- package/dist/ui/DiffView.d.ts +0 -3
- package/dist/ui/EditableText.d.ts +0 -7
- package/dist/ui/LinePrompt.d.ts +0 -6
- package/dist/ui/ListPicker.d.ts +0 -11
- package/dist/ui/Markdown.d.ts +0 -8
- package/dist/ui/McpMenu.d.ts +0 -11
- package/dist/ui/ModelPicker.d.ts +0 -6
- package/dist/ui/PermissionPrompt.d.ts +0 -5
- package/dist/ui/PlanApproval.d.ts +0 -5
- package/dist/ui/PromptInput.d.ts +0 -20
- package/dist/ui/ProviderMenu.d.ts +0 -10
- package/dist/ui/Spinner.d.ts +0 -4
- package/dist/ui/StatusBar.d.ts +0 -9
- package/dist/ui/TodoList.d.ts +0 -4
- package/dist/ui/ToolBlock.d.ts +0 -14
- package/dist/ui/complete.d.ts +0 -8
- package/dist/ui/index.d.ts +0 -7
- package/dist/ui/lineEdit.d.ts +0 -42
- package/dist/ui/liveCap.d.ts +0 -9
- package/dist/ui/replay.d.ts +0 -4
- package/dist/ui/stdinFilter.d.ts +0 -18
- package/dist/ui/table.d.ts +0 -20
- package/dist/ui/theme.d.ts +0 -5
- package/dist/ui/thinkingMouse.d.ts +0 -38
- package/dist/ui/transcript.d.ts +0 -55
- package/dist/ui/tty.d.ts +0 -11
- package/dist/ui/vim.d.ts +0 -26
- package/dist/ui-LZ4JGF2V.js +0 -2913
- package/dist/update-P7MU4ZM7.js +0 -145
- package/dist/update.d.ts +0 -30
- package/dist/verify.d.ts +0 -16
- package/dist/version.d.ts +0 -1
- package/dist/webBudget.d.ts +0 -25
- package/dist/worktree.d.ts +0 -12
package/dist/tools/plan.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Permissions } from '../permissions';
|
|
2
|
-
import { type Tool } from './types';
|
|
3
|
-
export type PlanDecision = 'acceptEdits' | 'default' | 'allowAll' | 'no';
|
|
4
|
-
export interface Interaction {
|
|
5
|
-
approvePlan(plan: string): Promise<PlanDecision>;
|
|
6
|
-
}
|
|
7
|
-
export declare function createExitPlanTool(opts: {
|
|
8
|
-
permissions: Permissions;
|
|
9
|
-
interaction: Interaction;
|
|
10
|
-
}): Tool;
|
package/dist/tools/read.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const MAX_IMAGE_BYTES: number;
|
|
3
|
-
export interface ReadToolOptions {
|
|
4
|
-
/** Attach images to the conversation as vision parts instead of refusing binary files. Default true. */
|
|
5
|
-
vision?: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare function createReadTool(options?: ReadToolOptions): import("./types").Tool<z.ZodObject<{
|
|
8
|
-
path: z.ZodString;
|
|
9
|
-
offset: z.ZodOptional<z.ZodNumber>;
|
|
10
|
-
limit: z.ZodOptional<z.ZodNumber>;
|
|
11
|
-
}, z.core.$strip>>;
|
|
12
|
-
export declare const readTool: import("./types").Tool<z.ZodObject<{
|
|
13
|
-
path: z.ZodString;
|
|
14
|
-
offset: z.ZodOptional<z.ZodNumber>;
|
|
15
|
-
limit: z.ZodOptional<z.ZodNumber>;
|
|
16
|
-
}, z.core.$strip>>;
|
package/dist/tools/repomap.d.ts
DELETED
package/dist/tools/sandbox.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare function sandboxSupported(platform: NodeJS.Platform): boolean;
|
|
2
|
-
/** Converts a Windows drive path (`C:\Users\foo`) into its WSL `/mnt/c/Users/foo` mount path. */
|
|
3
|
-
export declare function winPathToWsl(winPath: string): string;
|
|
4
|
-
/** Seatbelt profile: read everything, write only under cwd + temp areas, network only when allowed. */
|
|
5
|
-
export declare function darwinProfile(cwd: string, network: boolean): string;
|
|
6
|
-
/**
|
|
7
|
-
* Wrap a shell command in the platform sandbox, or undefined when the platform has none
|
|
8
|
-
* (the caller then refuses to run it sandboxed rather than silently running it raw).
|
|
9
|
-
*/
|
|
10
|
-
export declare function sandboxArgv(command: string, opts: {
|
|
11
|
-
platform: NodeJS.Platform;
|
|
12
|
-
cwd: string;
|
|
13
|
-
network: boolean;
|
|
14
|
-
wslBwrap?: boolean;
|
|
15
|
-
}): string[] | undefined;
|
package/dist/tools/shell.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* How a command string is run. `undefined` (posix) keeps the default `sh -c` behaviour.
|
|
3
|
-
* On Windows we never use cmd.exe: Git Bash gives the usual Unix tools (tail, grep, ls,
|
|
4
|
-
* sed); without it we fall back to Windows PowerShell with UTF-8 output.
|
|
5
|
-
*/
|
|
6
|
-
export interface ShellSpec {
|
|
7
|
-
name: 'bash' | 'powershell';
|
|
8
|
-
file: string;
|
|
9
|
-
args: (command: string) => string[];
|
|
10
|
-
}
|
|
11
|
-
export interface ShellDeps {
|
|
12
|
-
platform: NodeJS.Platform;
|
|
13
|
-
env: NodeJS.ProcessEnv;
|
|
14
|
-
exists: (path: string) => boolean;
|
|
15
|
-
}
|
|
16
|
-
export declare function resolveShell(deps: ShellDeps): ShellSpec | undefined;
|
|
17
|
-
/** Shell for the current machine, resolved once. */
|
|
18
|
-
export declare function defaultShell(): ShellSpec | undefined;
|
package/dist/tools/skill.d.ts
DELETED
package/dist/tools/task.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { AgentDef } from '../extensions';
|
|
2
|
-
import type { Permissions } from '../permissions';
|
|
3
|
-
import type { Provider } from '../provider';
|
|
4
|
-
import type { ReasoningLevel } from '../reasoning';
|
|
5
|
-
import { type Tool } from './types';
|
|
6
|
-
import type { HooksConfig } from '../hooks';
|
|
7
|
-
type TaskToolOptionsPluginEmit = (event: 'PreToolUse' | 'PostToolUse' | 'SessionStart' | 'Stop', payload?: {
|
|
8
|
-
tool?: string;
|
|
9
|
-
input?: unknown;
|
|
10
|
-
output?: string;
|
|
11
|
-
}) => Promise<void>;
|
|
12
|
-
export interface TaskToolOptions {
|
|
13
|
-
agents: AgentDef[];
|
|
14
|
-
baseTools: () => Tool[];
|
|
15
|
-
permissions: Permissions;
|
|
16
|
-
provider: () => Provider;
|
|
17
|
-
providerFor: (modelRef: string) => Provider;
|
|
18
|
-
systemPrompt: string | ((modelRef?: string) => string);
|
|
19
|
-
cwd: string;
|
|
20
|
-
reasoning?: () => ReasoningLevel;
|
|
21
|
-
/** Inherited by subagents so their tool calls fire the same hooks as the main agent. */
|
|
22
|
-
hooks?: HooksConfig;
|
|
23
|
-
/** Inherited by subagents so their tool calls fire the same plugin observers as the main agent. */
|
|
24
|
-
pluginEmit?: TaskToolOptionsPluginEmit;
|
|
25
|
-
env?: NodeJS.ProcessEnv;
|
|
26
|
-
}
|
|
27
|
-
export declare function createTaskTool(opts: TaskToolOptions): Tool;
|
|
28
|
-
export {};
|
package/dist/tools/todo.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type Tool } from './types';
|
|
2
|
-
export type TodoStatus = 'pending' | 'in_progress' | 'completed';
|
|
3
|
-
export interface TodoItem {
|
|
4
|
-
content: string;
|
|
5
|
-
status: TodoStatus;
|
|
6
|
-
}
|
|
7
|
-
export declare class TodoStore {
|
|
8
|
-
items: TodoItem[];
|
|
9
|
-
private readonly listeners;
|
|
10
|
-
set(items: TodoItem[]): void;
|
|
11
|
-
subscribe(fn: (items: TodoItem[]) => void): () => void;
|
|
12
|
-
}
|
|
13
|
-
export declare function createTodoTool(store: TodoStore): Tool;
|
package/dist/tools/types.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { z } from 'zod';
|
|
2
|
-
import type { AgentEvent, AskPermission } from '../agent';
|
|
3
|
-
import type { Usage } from '../provider';
|
|
4
|
-
export type PermissionKind = 'read' | 'edit' | 'bash' | 'fetch' | 'mcp';
|
|
5
|
-
export interface ToolContext {
|
|
6
|
-
cwd: string;
|
|
7
|
-
signal: AbortSignal;
|
|
8
|
-
/** Absolute paths read in this session; edit/write of existing files require membership. */
|
|
9
|
-
readFiles: Set<string>;
|
|
10
|
-
callId?: string;
|
|
11
|
-
emit?: (event: AgentEvent) => void;
|
|
12
|
-
ask?: AskPermission;
|
|
13
|
-
addUsage?: (usage: Usage) => void;
|
|
14
|
-
/** A fetch that was answered from cache calls this so it does not count against the per-turn fetch limit. */
|
|
15
|
-
refundFetch?: () => void;
|
|
16
|
-
/** Called with the absolute path before a file is written, so the change can be undone. */
|
|
17
|
-
checkpoint?: (absPath: string) => Promise<void>;
|
|
18
|
-
}
|
|
19
|
-
export interface ImageAttachment {
|
|
20
|
-
mediaType: string;
|
|
21
|
-
/** Base64 (no data: prefix). */
|
|
22
|
-
data: string;
|
|
23
|
-
path: string;
|
|
24
|
-
}
|
|
25
|
-
export interface ToolResult {
|
|
26
|
-
/** Sent back to the model. */
|
|
27
|
-
output: string;
|
|
28
|
-
isError?: boolean;
|
|
29
|
-
/** Optional richer text for the UI (e.g. a diff). */
|
|
30
|
-
display?: string;
|
|
31
|
-
/** Image files read this call; the agent injects them as a user message with image parts. */
|
|
32
|
-
images?: ImageAttachment[];
|
|
33
|
-
}
|
|
34
|
-
export interface Tool<S extends z.ZodType = z.ZodType> {
|
|
35
|
-
name: string;
|
|
36
|
-
description: string;
|
|
37
|
-
schema: S;
|
|
38
|
-
kind: PermissionKind;
|
|
39
|
-
/** Raw JSON schema sent to the model instead of converting `schema` (used for MCP tools). */
|
|
40
|
-
jsonSchema?: Record<string, unknown>;
|
|
41
|
-
outputJsonSchema?: Record<string, unknown>;
|
|
42
|
-
target(input: z.infer<S>): string;
|
|
43
|
-
preview?(input: z.infer<S>, ctx: ToolContext): Promise<string | undefined>;
|
|
44
|
-
/** Cheap pre-check run before asking permission; returns an error message when the call cannot succeed. */
|
|
45
|
-
validate?(input: z.infer<S>, ctx: ToolContext): Promise<string | undefined>;
|
|
46
|
-
/** Consecutive calls whose tool returns true here run concurrently. */
|
|
47
|
-
parallelSafe?(input: z.infer<S>): boolean;
|
|
48
|
-
/** Internal safety metadata: safe to call from a bounded read-only PTC program. */
|
|
49
|
-
programmaticSafe?: boolean;
|
|
50
|
-
run(input: z.infer<S>, ctx: ToolContext): Promise<ToolResult>;
|
|
51
|
-
}
|
|
52
|
-
export declare function defineTool<S extends z.ZodType>(tool: Tool<S>): Tool<S>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type Tool } from './types';
|
|
2
|
-
export declare function createWebSearchTool(opts: {
|
|
3
|
-
/** BotConnector Cloud endpoint + key, when the user has one; searches then go through our server. */
|
|
4
|
-
botconnector: () => {
|
|
5
|
-
baseURL: string;
|
|
6
|
-
apiKey: string;
|
|
7
|
-
} | undefined;
|
|
8
|
-
keenableURL?: string;
|
|
9
|
-
}): Tool;
|
package/dist/tools/write.d.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
Session
|
|
4
|
-
} from "./chunk-KEKDRROL.js";
|
|
5
|
-
import "./chunk-6JK4IBGK.js";
|
|
6
|
-
import "./chunk-7XD47KN5.js";
|
|
7
|
-
import {
|
|
8
|
-
t
|
|
9
|
-
} from "./chunk-R754XIBJ.js";
|
|
10
|
-
|
|
11
|
-
// src/transferCli.ts
|
|
12
|
-
import { copyFileSync, existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from "fs";
|
|
13
|
-
import { dirname, join, resolve } from "path";
|
|
14
|
-
function runExportCommand(args, deps) {
|
|
15
|
-
const first = (args.subArgs[0] ?? "").trim();
|
|
16
|
-
let source;
|
|
17
|
-
let dest;
|
|
18
|
-
const sessionsRoot = resolve(args.home, "sessions");
|
|
19
|
-
const isSourceSession = first.endsWith(".jsonl") && existsSync(first) && statSync(first).isFile() && (args.subArgs.length >= 2 || resolve(first).startsWith(sessionsRoot));
|
|
20
|
-
if (isSourceSession) {
|
|
21
|
-
source = first;
|
|
22
|
-
dest = args.subArgs[1];
|
|
23
|
-
} else {
|
|
24
|
-
const latest = Session.latest(args.home, args.cwd);
|
|
25
|
-
if (!latest) {
|
|
26
|
-
deps.err?.(t("no session to export in this folder"));
|
|
27
|
-
return 1;
|
|
28
|
-
}
|
|
29
|
-
source = latest.file;
|
|
30
|
-
dest = first || void 0;
|
|
31
|
-
}
|
|
32
|
-
if (!dest) {
|
|
33
|
-
for (const line of readFileSync(source, "utf8").split("\n")) {
|
|
34
|
-
if (line.trim()) deps.out(line);
|
|
35
|
-
}
|
|
36
|
-
return 0;
|
|
37
|
-
}
|
|
38
|
-
mkdirSync(dirname(dest), { recursive: true });
|
|
39
|
-
copyFileSync(source, dest);
|
|
40
|
-
deps.out(t("exported {file}", { file: dest }));
|
|
41
|
-
return 0;
|
|
42
|
-
}
|
|
43
|
-
function runImportCommand(args, deps) {
|
|
44
|
-
const src = (args.subArgs[0] ?? "").trim();
|
|
45
|
-
if (!src || !existsSync(src)) {
|
|
46
|
-
deps.err?.(t("file not found: {file}", { file: src || "(none)" }));
|
|
47
|
-
return 1;
|
|
48
|
-
}
|
|
49
|
-
const raw = readFileSync(src, "utf8");
|
|
50
|
-
const lines = raw.split("\n").filter((l) => l.trim());
|
|
51
|
-
for (const line of lines) {
|
|
52
|
-
try {
|
|
53
|
-
JSON.parse(line);
|
|
54
|
-
} catch {
|
|
55
|
-
deps.err?.(t("invalid session file (non-JSON line): {file}", { file: src }));
|
|
56
|
-
return 1;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
const slug = args.cwd.replace(/[^a-zA-Z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(-100) || "root";
|
|
60
|
-
const dir = join(args.home, "sessions", slug);
|
|
61
|
-
mkdirSync(dir, { recursive: true });
|
|
62
|
-
const stamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
63
|
-
const dest = join(dir, `${stamp}-imported.jsonl`);
|
|
64
|
-
writeFileSync(dest, lines.length ? `${lines.join("\n")}
|
|
65
|
-
` : "");
|
|
66
|
-
deps.out(t("imported {n} record(s) into {file}", { n: String(lines.length), file: dest }));
|
|
67
|
-
return 0;
|
|
68
|
-
}
|
|
69
|
-
export {
|
|
70
|
-
readdirSync,
|
|
71
|
-
runExportCommand,
|
|
72
|
-
runImportCommand
|
|
73
|
-
};
|
package/dist/transferCli.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { readdirSync } from 'node:fs';
|
|
2
|
-
export interface TransferCliArgs {
|
|
3
|
-
subArgs: string[];
|
|
4
|
-
home: string;
|
|
5
|
-
cwd: string;
|
|
6
|
-
}
|
|
7
|
-
export interface TransferDeps {
|
|
8
|
-
out(line: string): void;
|
|
9
|
-
err?(line: string): void;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* `bccli export [file]` — copy the latest session in this folder to `file`
|
|
13
|
-
* (or stdout when no file is given). Older sessions can be exported by
|
|
14
|
-
* passing their absolute JSONL path as the first argument.
|
|
15
|
-
*/
|
|
16
|
-
export declare function runExportCommand(args: TransferCliArgs, deps: TransferDeps): number;
|
|
17
|
-
/**
|
|
18
|
-
* `bccli import <file>` — copy a session JSONL into the current project.
|
|
19
|
-
* Every line must parse as JSON before anything is written (atomic).
|
|
20
|
-
*/
|
|
21
|
-
export declare function runImportCommand(args: TransferCliArgs, deps: TransferDeps): number;
|
|
22
|
-
/** Re-exported for tests that need the latest-session helper. */
|
|
23
|
-
export { readdirSync };
|
package/dist/ui/App.d.ts
DELETED
package/dist/ui/DiffView.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type LineState } from './lineEdit';
|
|
2
|
-
/** A line of text with the cursor drawn where it is (the character under it, or a space at the end, in reverse video). */
|
|
3
|
-
export declare function EditableText({ state, mask, showCursor }: {
|
|
4
|
-
state: LineState;
|
|
5
|
-
mask?: boolean;
|
|
6
|
-
showCursor?: boolean;
|
|
7
|
-
}): import("react").JSX.Element;
|
package/dist/ui/LinePrompt.d.ts
DELETED
package/dist/ui/ListPicker.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface ListItem {
|
|
2
|
-
id: string;
|
|
3
|
-
label: string;
|
|
4
|
-
hint?: string;
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare function ListPicker({ title, items, onPick }: {
|
|
8
|
-
title: string;
|
|
9
|
-
items: ListItem[];
|
|
10
|
-
onPick(id?: string): void;
|
|
11
|
-
}): import("react").JSX.Element;
|
package/dist/ui/Markdown.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `indent` is how many columns the surrounding UI already uses (a bullet, a border), so tables and rules are
|
|
3
|
-
* sized to what is really left of the terminal width.
|
|
4
|
-
*/
|
|
5
|
-
export declare function Markdown({ text, indent }: {
|
|
6
|
-
text: string;
|
|
7
|
-
indent?: number;
|
|
8
|
-
}): import("react").JSX.Element;
|
package/dist/ui/McpMenu.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface McpMenuItem {
|
|
2
|
-
name: string;
|
|
3
|
-
description: string;
|
|
4
|
-
status: 'ready' | 'error' | 'starting' | 'off';
|
|
5
|
-
error?: string;
|
|
6
|
-
installed: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare function McpMenu({ items, onPick }: {
|
|
9
|
-
items: McpMenuItem[];
|
|
10
|
-
onPick(name: string | undefined): void;
|
|
11
|
-
}): import("react").JSX.Element;
|
package/dist/ui/ModelPicker.d.ts
DELETED
package/dist/ui/PromptInput.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export interface PromptInputProps {
|
|
2
|
-
disabled?: boolean;
|
|
3
|
-
history: string[];
|
|
4
|
-
cwd: string;
|
|
5
|
-
onSubmit(text: string): void;
|
|
6
|
-
extraCommands?: {
|
|
7
|
-
name: string;
|
|
8
|
-
description: string;
|
|
9
|
-
}[];
|
|
10
|
-
/** Text inserted at the cursor from outside (e.g. a pasted clipboard image path); `n` triggers each insert. */
|
|
11
|
-
injected?: {
|
|
12
|
-
text: string;
|
|
13
|
-
n: number;
|
|
14
|
-
};
|
|
15
|
-
/** Vim editing: Esc enters normal mode (hjkl/w/b/0/$/x/dd/dw/i/a/A/o/O). */
|
|
16
|
-
vim?: boolean;
|
|
17
|
-
/** Called when Tab is pressed on an empty prompt (e.g. to toggle Thinking without Ctrl+T). */
|
|
18
|
-
onEmptyTab?: () => void;
|
|
19
|
-
}
|
|
20
|
-
export declare function PromptInput({ disabled, history, cwd, onSubmit, extraCommands, injected, vim, onEmptyTab }: PromptInputProps): import("react").JSX.Element;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export interface ProviderEntry {
|
|
2
|
-
id: string;
|
|
3
|
-
name: string;
|
|
4
|
-
ready: boolean;
|
|
5
|
-
baseURL: string;
|
|
6
|
-
}
|
|
7
|
-
export declare function ProviderMenu({ entries, onPick }: {
|
|
8
|
-
entries: ProviderEntry[];
|
|
9
|
-
onPick(id: string | 'custom' | undefined): void;
|
|
10
|
-
}): import("react").JSX.Element;
|
package/dist/ui/Spinner.d.ts
DELETED
package/dist/ui/StatusBar.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { PermissionMode } from '../config';
|
|
2
|
-
import type { ReasoningLevel } from '../reasoning';
|
|
3
|
-
export declare function StatusBar({ mode, tokens, busy, model, reasoning }: {
|
|
4
|
-
mode: PermissionMode;
|
|
5
|
-
tokens: number;
|
|
6
|
-
busy: boolean;
|
|
7
|
-
model?: string;
|
|
8
|
-
reasoning?: ReasoningLevel;
|
|
9
|
-
}): import("react").JSX.Element;
|
package/dist/ui/TodoList.d.ts
DELETED
package/dist/ui/ToolBlock.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { SubLine } from './transcript';
|
|
2
|
-
export interface ToolBlockProps {
|
|
3
|
-
tool: string;
|
|
4
|
-
target: string;
|
|
5
|
-
output?: string;
|
|
6
|
-
display?: string;
|
|
7
|
-
isError?: boolean;
|
|
8
|
-
done: boolean;
|
|
9
|
-
expanded?: boolean;
|
|
10
|
-
sub?: SubLine[];
|
|
11
|
-
/** Display spec of the "show full output" keybind, so the hint follows a rebound key. */
|
|
12
|
-
moreBind?: string;
|
|
13
|
-
}
|
|
14
|
-
export declare function ToolBlock({ tool, target, output, display, isError, done, expanded, sub, moreBind }: ToolBlockProps): import("react").JSX.Element;
|
package/dist/ui/complete.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare function listFileSuggestions(value: string, cwd: string, limit?: number): string[];
|
|
2
|
-
export declare function applyFileSuggestion(value: string, pick: string): string;
|
|
3
|
-
export declare function completeFile(value: string, cwd: string): string;
|
|
4
|
-
/**
|
|
5
|
-
* Pre-attaches small non-secret project files referenced via `@path/to/file` in a user prompt,
|
|
6
|
-
* and records them in `readFiles` so the model can inspect or edit them without an extra tool turn.
|
|
7
|
-
*/
|
|
8
|
-
export declare function expandAtFileMentions(prompt: string, cwd: string, readFiles?: Set<string>): string;
|
package/dist/ui/index.d.ts
DELETED
package/dist/ui/lineEdit.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export interface LineState {
|
|
2
|
-
value: string;
|
|
3
|
-
cursor: number;
|
|
4
|
-
}
|
|
5
|
-
export interface EditKey {
|
|
6
|
-
leftArrow?: boolean;
|
|
7
|
-
rightArrow?: boolean;
|
|
8
|
-
home?: boolean;
|
|
9
|
-
end?: boolean;
|
|
10
|
-
backspace?: boolean;
|
|
11
|
-
delete?: boolean;
|
|
12
|
-
ctrl?: boolean;
|
|
13
|
-
meta?: boolean;
|
|
14
|
-
}
|
|
15
|
-
export declare function prevBoundary(text: string, pos: number): number;
|
|
16
|
-
export declare function nextBoundary(text: string, pos: number): number;
|
|
17
|
-
/** Start of the word before the cursor: skips spaces, then the word itself. */
|
|
18
|
-
export declare function wordLeft(text: string, pos: number): number;
|
|
19
|
-
/** End of the word after the cursor: skips spaces, then the word itself. */
|
|
20
|
-
export declare function wordRight(text: string, pos: number): number;
|
|
21
|
-
export declare const lineStart: (text: string, pos: number) => number;
|
|
22
|
-
export declare function lineEnd(text: string, pos: number): number;
|
|
23
|
-
export declare const lineCount: (text: string) => number;
|
|
24
|
-
/** Moves to the same column one line up or down; undefined when there is no such line. */
|
|
25
|
-
export declare function moveLine(text: string, pos: number, direction: -1 | 1): number | undefined;
|
|
26
|
-
export declare const atEnd: (s: LineState) => boolean;
|
|
27
|
-
export declare function insert(s: LineState, text: string): LineState;
|
|
28
|
-
/**
|
|
29
|
-
* The result of an editing key, or undefined when the key is not one of them (Enter, Esc, Tab and the arrows that
|
|
30
|
-
* walk through history belong to the caller). Printable text goes through `insert`.
|
|
31
|
-
*/
|
|
32
|
-
export declare function applyEditKey(s: LineState, input: string, key: EditKey): LineState | undefined;
|
|
33
|
-
/** What to draw: the text before the cursor, the character under it (a space at the end or on a line break), the rest. */
|
|
34
|
-
export declare function splitAtCursor(s: LineState): {
|
|
35
|
-
before: string;
|
|
36
|
-
at: string;
|
|
37
|
-
after: string;
|
|
38
|
-
};
|
|
39
|
-
/** The characters of a text as the user sees them. */
|
|
40
|
-
export declare const graphemes: (text: string) => string[];
|
|
41
|
-
/** The same cursor over a hidden text (an API key): one dot per character. */
|
|
42
|
-
export declare function masked(s: LineState): LineState;
|
package/dist/ui/liveCap.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Live assistant text is drawn inside the Ink frame, so on a real terminal it is capped to the rows left after the
|
|
3
|
-
* prompt and status bar; the hidden part is announced instead of silently dropped. Piped stdout has no rows to
|
|
4
|
-
* respect (`bccli | tee log`, CI harnesses), so the text is kept whole there.
|
|
5
|
-
*/
|
|
6
|
-
export declare function capLiveMarkdown(raw: string, options: {
|
|
7
|
-
isRealTty: boolean;
|
|
8
|
-
maxLines: number;
|
|
9
|
-
}): string;
|
package/dist/ui/replay.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type ChatMessage } from '../provider';
|
|
2
|
-
import { type Entry } from './transcript';
|
|
3
|
-
/** The screen rows for a resumed conversation: a notice, then every user and assistant text message in order. */
|
|
4
|
-
export declare function replayEntries(history: ChatMessage[]): Entry[];
|
package/dist/ui/stdinFilter.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Terminals without SGR support answer mouse tracking (`\x1b[?1000h`, which bccli only turns on while the Thinking
|
|
3
|
-
* block is clickable) with legacy X10 reports: `ESC [ M` followed by three raw bytes. Ink 8 drops the `ESC [ M`
|
|
4
|
-
* prefix but passes those three bytes to `useInput` as if typed, so they land in the prompt as punctuation.
|
|
5
|
-
* Remove the whole report here, where the prefix is still visible.
|
|
6
|
-
*
|
|
7
|
-
* `carry` is the tail of a report split across chunks; feed it back as the second argument on the next chunk.
|
|
8
|
-
*/
|
|
9
|
-
export declare function stripLegacyMouseReports(chunk: string, carry?: string): {
|
|
10
|
-
text: string;
|
|
11
|
-
carry: string;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Ink owns the input stream, so a report can only be kept out of `useInput` if it never reaches Ink's reader.
|
|
15
|
-
* Ink 8 reads stdin with `read()`, so the filter wraps that single method: everything that is not an X10 report is
|
|
16
|
-
* forwarded byte for byte and every other stream property (raw mode, TTY flags, event handlers) stays the real one.
|
|
17
|
-
*/
|
|
18
|
-
export declare function installLegacyMouseFilter(source: NodeJS.ReadStream): () => void;
|
package/dist/ui/table.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export type Style = 'plain' | 'bold' | 'italic' | 'strike' | 'link' | 'code' | 'dim';
|
|
2
|
-
export interface Seg {
|
|
3
|
-
text: string;
|
|
4
|
-
style: Style;
|
|
5
|
-
}
|
|
6
|
-
export type Align = 'left' | 'center' | 'right';
|
|
7
|
-
export interface TableData {
|
|
8
|
-
header: Seg[][];
|
|
9
|
-
align: Align[];
|
|
10
|
-
rows: Seg[][][];
|
|
11
|
-
}
|
|
12
|
-
export declare function charWidth(cp: number): number;
|
|
13
|
-
export declare function displayWidth(text: string): number;
|
|
14
|
-
export declare function parseInline(text: string): Seg[];
|
|
15
|
-
/** A table starting at lines[start] (header row, separator row, body rows), or undefined. `end` is the next line to read. */
|
|
16
|
-
export declare function parseTable(lines: string[], start: number): {
|
|
17
|
-
table: TableData;
|
|
18
|
-
end: number;
|
|
19
|
-
} | undefined;
|
|
20
|
-
export declare function layoutTable(table: TableData, width: number): Seg[][];
|
package/dist/ui/theme.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const THEMES: readonly ['default', 'blue', 'amber', 'magenta', 'mono'];
|
|
2
|
-
export declare function setTheme(name: string): void;
|
|
3
|
-
export declare function currentTheme(): string;
|
|
4
|
-
export declare function color(name: string): string | undefined;
|
|
5
|
-
export declare const ACCENT = "green";
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/** SGR terminal mouse position (1-based), used only for the live Thinking status. */
|
|
2
|
-
export interface MousePress {
|
|
3
|
-
x: number;
|
|
4
|
-
y: number;
|
|
5
|
-
}
|
|
6
|
-
export declare function parseMousePress(value: string): MousePress | undefined;
|
|
7
|
-
export declare function parseCursorPosition(value: string): {
|
|
8
|
-
row: number;
|
|
9
|
-
col: number;
|
|
10
|
-
} | undefined;
|
|
11
|
-
/** Ink returns local element positions, not viewport coordinates. The cursor rests after the live frame. */
|
|
12
|
-
export declare function clickedThinking(click: MousePress, cursorRow: number, rootHeight: number, target: {
|
|
13
|
-
x: number;
|
|
14
|
-
y: number;
|
|
15
|
-
width: number;
|
|
16
|
-
height: number;
|
|
17
|
-
}): boolean;
|
|
18
|
-
/** Detect raw SGR wheel packets in a raw stdin data chunk (before ESC is stripped), used to suspend mouse capture. */
|
|
19
|
-
export declare function hasMouseWheelSequence(chunk: string): boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Sequence fragments Ink 8 does not recognise (mouse, cursor reports) are dropped when complete, but an incomplete
|
|
22
|
-
* escape is flushed as literal input after ~20 ms. That fragment must never be typed into a prompt or filter.
|
|
23
|
-
*/
|
|
24
|
-
export declare function isControlReportFragment(input: string): boolean;
|
|
25
|
-
/** Tokenize split/coalesced Windows ConPTY SGR presses and cursor reports. */
|
|
26
|
-
export declare function parseThinkingReports(value: string): {
|
|
27
|
-
events: Array<{
|
|
28
|
-
type: 'mouse';
|
|
29
|
-
press: MousePress;
|
|
30
|
-
} | {
|
|
31
|
-
type: 'cursor';
|
|
32
|
-
cursor: {
|
|
33
|
-
row: number;
|
|
34
|
-
col: number;
|
|
35
|
-
};
|
|
36
|
-
}>;
|
|
37
|
-
rest: string;
|
|
38
|
-
};
|