@botconnector/bccli 0.4.0-beta.42 → 0.4.0-beta.43

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 (46) hide show
  1. package/dist/{acp-PP7ZONVQ.js → acp-U25MNDND.js} +2 -2
  2. package/dist/{args-3DGIMRTG.js → args-MFTMBNRN.js} +4 -4
  3. package/dist/{chunk-LYFN6AEV.js → chunk-25DSN3Y3.js} +4 -4
  4. package/dist/{chunk-A2XKKKKU.js → chunk-2ON3WIDP.js} +4 -4
  5. package/dist/{chunk-HVGXCPDG.js → chunk-BQHKN7JI.js} +1 -1
  6. package/dist/{chunk-ADS5FDWL.js → chunk-CYTRCZXI.js} +20 -7
  7. package/dist/{chunk-Q2ZBR4OU.js → chunk-DUSVS3XK.js} +1 -1
  8. package/dist/{chunk-AGIZBZ64.js → chunk-GIGWZFCY.js} +1 -1
  9. package/dist/{chunk-3P5N6UPF.js → chunk-I7GXIJCY.js} +2 -2
  10. package/dist/{chunk-QZM66F3A.js → chunk-NVRNFR4S.js} +1 -1
  11. package/dist/{chunk-DRK3XTVZ.js → chunk-PSRNKKGA.js} +1 -1
  12. package/dist/{chunk-NFJPKNHL.js → chunk-PZC2Q6MJ.js} +2 -2
  13. package/dist/{chunk-VBEX5YHF.js → chunk-QHNWI3OT.js} +22 -1
  14. package/dist/{chunk-LYQHLA43.js → chunk-RMDW3OQ6.js} +2 -2
  15. package/dist/{chunk-O74EQFYI.js → chunk-TW5HZOTB.js} +3 -3
  16. package/dist/chunk-U6PCNS4B.js +20 -0
  17. package/dist/{chunk-I422TPGX.js → chunk-VO6MF6JJ.js} +1 -1
  18. package/dist/{chunk-I4THUZRD.js → chunk-Y3QKYORR.js} +6 -6
  19. package/dist/{chunk-HQB227LD.js → chunk-ZGH4B7OU.js} +15 -23
  20. package/dist/{chunk-AWNQDAOY.js → chunk-ZKMSTD6G.js} +1 -1
  21. package/dist/cli.js +52 -31
  22. package/dist/completion-6K4AXKK2.js +125 -0
  23. package/dist/{config-UKEKWMCG.js → config-LCY27K3L.js} +2 -2
  24. package/dist/{config-LFT2FNSE.js → config-Z4HSA435.js} +3 -3
  25. package/dist/{ghBotCli-DWQXAIKE.js → ghBotCli-TJMKJU3E.js} +14 -13
  26. package/dist/{integrationCli-RSJCJ3NW.js → integrationCli-33KU6GIK.js} +2 -2
  27. package/dist/{login-L3SUO4H4.js → login-LNF7ZV2S.js} +3 -3
  28. package/dist/{mcpCli-RSLEDQQ7.js → mcpCli-TXFS3AOJ.js} +5 -5
  29. package/dist/{modelsCli-IKZLORLH.js → modelsCli-IZSMIYVB.js} +6 -6
  30. package/dist/{oauthLogin-XHEMYL6L.js → oauthLogin-QGDYTOW7.js} +1 -1
  31. package/dist/{pluginsCli-MRS547WG.js → pluginsCli-RD4QW3DX.js} +2 -2
  32. package/dist/prCli-NR3ZQMST.js +73 -0
  33. package/dist/providerCli-AA3CHCGV.js +15 -0
  34. package/dist/sdk.js +34 -5
  35. package/dist/{serve-GFNJ5PSL.js → serve-F7BYQ7X6.js} +15 -14
  36. package/dist/{serve-A4E67R5E.js → serve-YNKE332Z.js} +3 -3
  37. package/dist/session-KRV2UP5C.js +12 -0
  38. package/dist/setup-L4OPF3XW.js +24 -0
  39. package/dist/statsCli-RPCIMT5R.js +109 -0
  40. package/dist/transferCli-RQBB6RVY.js +71 -0
  41. package/dist/{ui-STI6HSOR.js → ui-4ZTUMTYM.js} +12 -12
  42. package/dist/{update-KMWE2P2I.js → update-7SSREI2O.js} +2 -2
  43. package/package.json +1 -1
  44. package/dist/providerCli-7GRUL3BS.js +0 -15
  45. package/dist/session-VKVBMGCC.js +0 -12
  46. package/dist/setup-XWX64X5Q.js +0 -23
@@ -0,0 +1,109 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ estimateTokens
4
+ } from "./chunk-U6PCNS4B.js";
5
+ import {
6
+ t
7
+ } from "./chunk-QHNWI3OT.js";
8
+
9
+ // src/statsCli.ts
10
+ import { existsSync, readdirSync, readFileSync, statSync } from "fs";
11
+ import { join } from "path";
12
+ function isUsageRecord(value) {
13
+ if (!value || typeof value !== "object") return false;
14
+ const v = value;
15
+ return v.t === "usage" && typeof v.inputTokens === "number" && typeof v.outputTokens === "number";
16
+ }
17
+ function aggregateSessions(home, opts) {
18
+ const now = opts.now ?? Date.now();
19
+ const cutoff = now - opts.days * 864e5;
20
+ const root = join(home, "sessions");
21
+ if (!existsSync(root)) return [];
22
+ const byProject = /* @__PURE__ */ new Map();
23
+ for (const project of readdirSync(root)) {
24
+ const dir = join(root, project);
25
+ let st;
26
+ try {
27
+ st = statSync(dir);
28
+ } catch {
29
+ continue;
30
+ }
31
+ if (!st.isDirectory()) continue;
32
+ for (const file of readdirSync(dir)) {
33
+ if (!file.endsWith(".jsonl")) continue;
34
+ const path = join(dir, file);
35
+ let fst;
36
+ try {
37
+ fst = statSync(path);
38
+ } catch {
39
+ continue;
40
+ }
41
+ if (fst.mtimeMs < cutoff) continue;
42
+ let row = byProject.get(project);
43
+ if (!row) {
44
+ row = { project, sessions: 0, messages: 0, inputTokens: 0, outputTokens: 0, usageInputTokens: 0, usageOutputTokens: 0 };
45
+ byProject.set(project, row);
46
+ }
47
+ row.sessions++;
48
+ for (const line of readFileSync(path, "utf8").split("\n")) {
49
+ if (!line.trim()) continue;
50
+ let record;
51
+ try {
52
+ record = JSON.parse(line);
53
+ } catch {
54
+ continue;
55
+ }
56
+ if (isUsageRecord(record)) {
57
+ row.usageInputTokens += record.inputTokens;
58
+ row.usageOutputTokens += record.outputTokens;
59
+ continue;
60
+ }
61
+ const r = record;
62
+ if (r?.t !== "msg" || !r.m) continue;
63
+ row.messages++;
64
+ const text = typeof r.m.content === "string" ? r.m.content : JSON.stringify(r.m.content ?? "");
65
+ const tokens = estimateTokens(text);
66
+ if (r.m.role === "user") row.inputTokens += tokens;
67
+ else if (r.m.role === "assistant") row.outputTokens += tokens;
68
+ }
69
+ }
70
+ }
71
+ return [...byProject.values()].sort((a, b) => b.messages - a.messages || a.project.localeCompare(b.project));
72
+ }
73
+ function runStatsCommand(args, deps) {
74
+ let days = 7;
75
+ const rest = args.subArgs;
76
+ for (let i = 0; i < rest.length; i++) {
77
+ if (rest[i] === "--days") {
78
+ const raw = rest[++i];
79
+ const n = Number(raw);
80
+ if (!Number.isInteger(n) || n < 1) {
81
+ deps.err?.(t("--days must be a positive integer"));
82
+ return 1;
83
+ }
84
+ days = n;
85
+ } else if (rest[i].startsWith("--days=")) {
86
+ const n = Number(rest[i].slice("--days=".length));
87
+ if (!Number.isInteger(n) || n < 1) {
88
+ deps.err?.(t("--days must be a positive integer"));
89
+ return 1;
90
+ }
91
+ days = n;
92
+ }
93
+ }
94
+ const rows = aggregateSessions(args.home, { days, now: args.now });
95
+ if (!rows.length) {
96
+ deps.out(t("no sessions in the last {days} day(s)", { days: String(days) }));
97
+ return 0;
98
+ }
99
+ deps.out(t("sessions (last {days} day(s)):", { days: String(days) }));
100
+ for (const r of rows) {
101
+ const usage = r.usageInputTokens + r.usageOutputTokens > 0 ? ` ${t("recorded")}: ${r.usageInputTokens}in/${r.usageOutputTokens}out` : "";
102
+ deps.out(`${r.project} ${r.sessions} ${t("session(s)")} ${r.messages} ${t("message(s)")} ~${r.inputTokens}in/~${r.outputTokens}out${usage}`);
103
+ }
104
+ return 0;
105
+ }
106
+ export {
107
+ aggregateSessions,
108
+ runStatsCommand
109
+ };
@@ -0,0 +1,71 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ Session
4
+ } from "./chunk-BQHKN7JI.js";
5
+ import "./chunk-RMDW3OQ6.js";
6
+ import "./chunk-ZKMSTD6G.js";
7
+ import {
8
+ t
9
+ } from "./chunk-QHNWI3OT.js";
10
+
11
+ // src/transferCli.ts
12
+ import { copyFileSync, existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from "fs";
13
+ import { dirname, join } from "path";
14
+ function runExportCommand(args, deps) {
15
+ const first = (args.subArgs[0] ?? "").trim();
16
+ let source;
17
+ let dest;
18
+ if (first && first.endsWith(".jsonl") && existsSync(first) && statSync(first).isFile()) {
19
+ source = first;
20
+ dest = args.subArgs[1];
21
+ } else {
22
+ const latest = Session.latest(args.home, args.cwd);
23
+ if (!latest) {
24
+ deps.err?.(t("no session to export in this folder"));
25
+ return 1;
26
+ }
27
+ source = latest.file;
28
+ dest = first || void 0;
29
+ }
30
+ if (!dest) {
31
+ for (const line of readFileSync(source, "utf8").split("\n")) {
32
+ if (line.trim()) deps.out(line);
33
+ }
34
+ return 0;
35
+ }
36
+ mkdirSync(dirname(dest), { recursive: true });
37
+ copyFileSync(source, dest);
38
+ deps.out(t("exported {file}", { file: dest }));
39
+ return 0;
40
+ }
41
+ function runImportCommand(args, deps) {
42
+ const src = (args.subArgs[0] ?? "").trim();
43
+ if (!src || !existsSync(src)) {
44
+ deps.err?.(t("file not found: {file}", { file: src || "(none)" }));
45
+ return 1;
46
+ }
47
+ const raw = readFileSync(src, "utf8");
48
+ const lines = raw.split("\n").filter((l) => l.trim());
49
+ for (const line of lines) {
50
+ try {
51
+ JSON.parse(line);
52
+ } catch {
53
+ deps.err?.(t("invalid session file (non-JSON line): {file}", { file: src }));
54
+ return 1;
55
+ }
56
+ }
57
+ const slug = args.cwd.replace(/[^a-zA-Z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(-100) || "root";
58
+ const dir = join(args.home, "sessions", slug);
59
+ mkdirSync(dir, { recursive: true });
60
+ const stamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
61
+ const dest = join(dir, `${stamp}-imported.jsonl`);
62
+ writeFileSync(dest, lines.length ? `${lines.join("\n")}
63
+ ` : "");
64
+ deps.out(t("imported {n} record(s) into {file}", { n: String(lines.length), file: dest }));
65
+ return 0;
66
+ }
67
+ export {
68
+ readdirSync,
69
+ runExportCommand,
70
+ runImportCommand
71
+ };
@@ -2,14 +2,14 @@
2
2
  import {
3
3
  CATALOG,
4
4
  fillTemplate
5
- } from "./chunk-3P5N6UPF.js";
5
+ } from "./chunk-I7GXIJCY.js";
6
6
  import {
7
7
  MAX_VERIFY_ROUNDS,
8
8
  runVerify,
9
9
  toolLabel,
10
10
  verifyFollowup,
11
11
  worktreeListText
12
- } from "./chunk-O74EQFYI.js";
12
+ } from "./chunk-TW5HZOTB.js";
13
13
  import {
14
14
  BUILTIN_AGENTS,
15
15
  appendMemory,
@@ -21,7 +21,7 @@ import {
21
21
  renderBackgroundTasks,
22
22
  runHooks,
23
23
  validateGlobPattern
24
- } from "./chunk-DRK3XTVZ.js";
24
+ } from "./chunk-PSRNKKGA.js";
25
25
  import "./chunk-PSO7R5AD.js";
26
26
  import {
27
27
  nextMode
@@ -30,39 +30,39 @@ import {
30
30
  hasKey,
31
31
  providerName,
32
32
  writeGlobalConfig
33
- } from "./chunk-I422TPGX.js";
33
+ } from "./chunk-VO6MF6JJ.js";
34
34
  import {
35
35
  Session
36
- } from "./chunk-HVGXCPDG.js";
36
+ } from "./chunk-BQHKN7JI.js";
37
37
  import {
38
38
  contentText
39
- } from "./chunk-LYQHLA43.js";
39
+ } from "./chunk-RMDW3OQ6.js";
40
40
  import {
41
41
  REASONING_LEVELS,
42
42
  assertReasoningSupported,
43
43
  parseReasoningLevel,
44
44
  supportedReasoningLevels
45
- } from "./chunk-AWNQDAOY.js";
45
+ } from "./chunk-ZKMSTD6G.js";
46
46
  import {
47
47
  addGlobalServer,
48
48
  globalMcpPath,
49
49
  readMcpFile,
50
50
  removeGlobalServer
51
- } from "./chunk-NFJPKNHL.js";
51
+ } from "./chunk-PZC2Q6MJ.js";
52
52
  import {
53
53
  ACCENT,
54
54
  PRESETS,
55
55
  color,
56
56
  matchKeybind,
57
57
  removeCredential
58
- } from "./chunk-AGIZBZ64.js";
58
+ } from "./chunk-GIGWZFCY.js";
59
59
  import {
60
60
  getLanguage,
61
61
  locale,
62
62
  parseLang,
63
63
  setLanguage,
64
64
  t
65
- } from "./chunk-VBEX5YHF.js";
65
+ } from "./chunk-QHNWI3OT.js";
66
66
 
67
67
  // src/ui/index.tsx
68
68
  import { render } from "ink";
@@ -2239,7 +2239,7 @@ ${t2.output}`);
2239
2239
  import { jsx as jsx17 } from "react/jsx-runtime";
2240
2240
  async function startInteractive(rt, opts) {
2241
2241
  if (opts.resume) {
2242
- const { Session: Session2 } = await import("./session-VKVBMGCC.js");
2242
+ const { Session: Session2 } = await import("./session-KRV2UP5C.js");
2243
2243
  const list = Session2.list(rt.home, rt.cwd).slice(0, 20);
2244
2244
  if (!list.length) console.log(t("No sessions in this folder yet; starting a new one."));
2245
2245
  else {
@@ -2254,7 +2254,7 @@ async function startInteractive(rt, opts) {
2254
2254
  if (chosen) rt.resume(chosen.session);
2255
2255
  }
2256
2256
  }
2257
- const { serversToStart, setProjectTrust } = await import("./config-LFT2FNSE.js");
2257
+ const { serversToStart, setProjectTrust } = await import("./config-Z4HSA435.js");
2258
2258
  const plan = serversToStart(rt.home, rt.cwd);
2259
2259
  if (plan.needTrust.length) {
2260
2260
  const { createInterface } = await import("readline/promises");
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  VERSION
4
- } from "./chunk-Q2ZBR4OU.js";
4
+ } from "./chunk-DUSVS3XK.js";
5
5
  import {
6
6
  t
7
- } from "./chunk-VBEX5YHF.js";
7
+ } from "./chunk-QHNWI3OT.js";
8
8
 
9
9
  // src/update.ts
10
10
  import { spawnSync } from "child_process";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botconnector/bccli",
3
- "version": "0.4.0-beta.42",
3
+ "version": "0.4.0-beta.43",
4
4
  "description": "BCCLI — BotConnector AI coding agent for the terminal",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- addProviderKey,
4
- runProviderCommand
5
- } from "./chunk-A2XKKKKU.js";
6
- import "./chunk-LYFN6AEV.js";
7
- import "./chunk-I422TPGX.js";
8
- import "./chunk-LYQHLA43.js";
9
- import "./chunk-AWNQDAOY.js";
10
- import "./chunk-AGIZBZ64.js";
11
- import "./chunk-VBEX5YHF.js";
12
- export {
13
- addProviderKey,
14
- runProviderCommand
15
- };
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- Session,
4
- pruneSessions
5
- } from "./chunk-HVGXCPDG.js";
6
- import "./chunk-LYQHLA43.js";
7
- import "./chunk-AWNQDAOY.js";
8
- import "./chunk-VBEX5YHF.js";
9
- export {
10
- Session,
11
- pruneSessions
12
- };
@@ -1,23 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- createRuntime,
4
- lunaPtcAutoEnabled
5
- } from "./chunk-HQB227LD.js";
6
- import "./chunk-DRK3XTVZ.js";
7
- import "./chunk-QZM66F3A.js";
8
- import "./chunk-PSO7R5AD.js";
9
- import "./chunk-GAFJEQTJ.js";
10
- import "./chunk-A2XKKKKU.js";
11
- import "./chunk-LYFN6AEV.js";
12
- import "./chunk-I422TPGX.js";
13
- import "./chunk-7F3IWBPQ.js";
14
- import "./chunk-HVGXCPDG.js";
15
- import "./chunk-LYQHLA43.js";
16
- import "./chunk-AWNQDAOY.js";
17
- import "./chunk-NFJPKNHL.js";
18
- import "./chunk-AGIZBZ64.js";
19
- import "./chunk-VBEX5YHF.js";
20
- export {
21
- createRuntime,
22
- lunaPtcAutoEnabled
23
- };