@robota-sdk/agent-cli 3.0.0-beta.10 → 3.0.0-beta.11

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/dist/node/bin.cjs CHANGED
@@ -30,26 +30,7 @@ var import_node_path2 = require("path");
30
30
  var import_node_url = require("url");
31
31
  var readline = __toESM(require("readline"), 1);
32
32
  var import_agent_sdk2 = require("@robota-sdk/agent-sdk");
33
-
34
- // src/permissions/permission-prompt.ts
35
- var import_chalk = __toESM(require("chalk"), 1);
36
- var PERMISSION_OPTIONS = ["Allow", "Deny"];
37
- var ALLOW_INDEX = 0;
38
- function formatArgs(toolArgs) {
39
- const entries = Object.entries(toolArgs);
40
- if (entries.length === 0) {
41
- return "(no arguments)";
42
- }
43
- return entries.map(([k, v]) => `${k}: ${typeof v === "string" ? v : JSON.stringify(v)}`).join(", ");
44
- }
45
- async function promptForApproval(terminal, toolName, toolArgs) {
46
- terminal.writeLine("");
47
- terminal.writeLine(import_chalk.default.yellow(`[Permission Required] Tool: ${toolName}`));
48
- terminal.writeLine(import_chalk.default.dim(` ${formatArgs(toolArgs)}`));
49
- terminal.writeLine("");
50
- const selected = await terminal.select(PERMISSION_OPTIONS, ALLOW_INDEX);
51
- return selected === ALLOW_INDEX;
52
- }
33
+ var import_agent_sdk3 = require("@robota-sdk/agent-sdk");
53
34
 
54
35
  // src/ui/render.tsx
55
36
  var import_ink9 = require("ink");
@@ -326,7 +307,7 @@ var import_ink6 = require("ink");
326
307
  var import_react = require("react");
327
308
  var import_ink3 = require("ink");
328
309
  var import_string_width = __toESM(require("string-width"), 1);
329
- var import_chalk2 = __toESM(require("chalk"), 1);
310
+ var import_chalk = __toESM(require("chalk"), 1);
330
311
  var import_jsx_runtime3 = require("react/jsx-runtime");
331
312
  function CjkTextInput({
332
313
  value,
@@ -407,22 +388,22 @@ function CjkTextInput({
407
388
  }
408
389
  function renderWithCursor(value, cursorOffset, placeholder, showCursor) {
409
390
  if (!showCursor) {
410
- return value.length > 0 ? value : placeholder ? import_chalk2.default.gray(placeholder) : "";
391
+ return value.length > 0 ? value : placeholder ? import_chalk.default.gray(placeholder) : "";
411
392
  }
412
393
  if (value.length === 0) {
413
394
  if (placeholder.length > 0) {
414
- return import_chalk2.default.inverse(placeholder[0]) + import_chalk2.default.gray(placeholder.slice(1));
395
+ return import_chalk.default.inverse(placeholder[0]) + import_chalk.default.gray(placeholder.slice(1));
415
396
  }
416
- return import_chalk2.default.inverse(" ");
397
+ return import_chalk.default.inverse(" ");
417
398
  }
418
399
  const chars = [...value];
419
400
  let rendered = "";
420
401
  for (let i = 0; i < chars.length; i++) {
421
402
  const char = chars[i] ?? "";
422
- rendered += i === cursorOffset ? import_chalk2.default.inverse(char) : char;
403
+ rendered += i === cursorOffset ? import_chalk.default.inverse(char) : char;
423
404
  }
424
405
  if (cursorOffset >= chars.length) {
425
- rendered += import_chalk2.default.inverse(" ");
406
+ rendered += import_chalk.default.inverse(" ");
426
407
  }
427
408
  return rendered;
428
409
  }
@@ -638,7 +619,7 @@ var import_react4 = __toESM(require("react"), 1);
638
619
  var import_ink7 = require("ink");
639
620
  var import_jsx_runtime7 = require("react/jsx-runtime");
640
621
  var OPTIONS = ["Allow", "Allow always (this session)", "Deny"];
641
- function formatArgs2(args) {
622
+ function formatArgs(args) {
642
623
  const entries = Object.entries(args);
643
624
  if (entries.length === 0) return "(no arguments)";
644
625
  return entries.map(([k, v]) => `${k}: ${typeof v === "string" ? v : JSON.stringify(v)}`).join(", ");
@@ -687,7 +668,7 @@ function PermissionPrompt({ request }) {
687
668
  ] }),
688
669
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_ink7.Text, { dimColor: true, children: [
689
670
  " ",
690
- formatArgs2(request.toolArgs)
671
+ formatArgs(request.toolArgs)
691
672
  ] }),
692
673
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_ink7.Box, { marginTop: 1, children: OPTIONS.map((opt, i) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_ink7.Box, { marginRight: 2, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_ink7.Text, { color: i === selected ? "cyan" : void 0, bold: i === selected, children: [
693
674
  i === selected ? "> " : " ",
@@ -1333,7 +1314,7 @@ async function startCli() {
1333
1314
  sessionLogger: new import_agent_sdk2.FileSessionLogger(paths.logs),
1334
1315
  projectInfo,
1335
1316
  permissionMode: args.permissionMode,
1336
- promptForApproval
1317
+ promptForApproval: import_agent_sdk3.promptForApproval
1337
1318
  });
1338
1319
  const response = await session.run(prompt);
1339
1320
  process.stdout.write(response + "\n");
package/dist/node/bin.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  startCli
4
- } from "./chunk-UT4RQDTI.js";
4
+ } from "./chunk-CT2VGJIF.js";
5
5
 
6
6
  // src/bin.ts
7
7
  process.on("uncaughtException", (err) => {
@@ -13,26 +13,7 @@ import {
13
13
  FileSessionLogger as FileSessionLogger2,
14
14
  projectPaths as projectPaths2
15
15
  } from "@robota-sdk/agent-sdk";
16
-
17
- // src/permissions/permission-prompt.ts
18
- import chalk from "chalk";
19
- var PERMISSION_OPTIONS = ["Allow", "Deny"];
20
- var ALLOW_INDEX = 0;
21
- function formatArgs(toolArgs) {
22
- const entries = Object.entries(toolArgs);
23
- if (entries.length === 0) {
24
- return "(no arguments)";
25
- }
26
- return entries.map(([k, v]) => `${k}: ${typeof v === "string" ? v : JSON.stringify(v)}`).join(", ");
27
- }
28
- async function promptForApproval(terminal, toolName, toolArgs) {
29
- terminal.writeLine("");
30
- terminal.writeLine(chalk.yellow(`[Permission Required] Tool: ${toolName}`));
31
- terminal.writeLine(chalk.dim(` ${formatArgs(toolArgs)}`));
32
- terminal.writeLine("");
33
- const selected = await terminal.select(PERMISSION_OPTIONS, ALLOW_INDEX);
34
- return selected === ALLOW_INDEX;
35
- }
16
+ import { promptForApproval } from "@robota-sdk/agent-sdk";
36
17
 
37
18
  // src/ui/render.tsx
38
19
  import { render } from "ink";
@@ -309,7 +290,7 @@ import { Box as Box4, Text as Text6, useInput as useInput2 } from "ink";
309
290
  import { useRef, useState } from "react";
310
291
  import { Text as Text3, useInput, useCursor } from "ink";
311
292
  import stringWidth from "string-width";
312
- import chalk2 from "chalk";
293
+ import chalk from "chalk";
313
294
  import { jsx as jsx3 } from "react/jsx-runtime";
314
295
  function CjkTextInput({
315
296
  value,
@@ -390,22 +371,22 @@ function CjkTextInput({
390
371
  }
391
372
  function renderWithCursor(value, cursorOffset, placeholder, showCursor) {
392
373
  if (!showCursor) {
393
- return value.length > 0 ? value : placeholder ? chalk2.gray(placeholder) : "";
374
+ return value.length > 0 ? value : placeholder ? chalk.gray(placeholder) : "";
394
375
  }
395
376
  if (value.length === 0) {
396
377
  if (placeholder.length > 0) {
397
- return chalk2.inverse(placeholder[0]) + chalk2.gray(placeholder.slice(1));
378
+ return chalk.inverse(placeholder[0]) + chalk.gray(placeholder.slice(1));
398
379
  }
399
- return chalk2.inverse(" ");
380
+ return chalk.inverse(" ");
400
381
  }
401
382
  const chars = [...value];
402
383
  let rendered = "";
403
384
  for (let i = 0; i < chars.length; i++) {
404
385
  const char = chars[i] ?? "";
405
- rendered += i === cursorOffset ? chalk2.inverse(char) : char;
386
+ rendered += i === cursorOffset ? chalk.inverse(char) : char;
406
387
  }
407
388
  if (cursorOffset >= chars.length) {
408
- rendered += chalk2.inverse(" ");
389
+ rendered += chalk.inverse(" ");
409
390
  }
410
391
  return rendered;
411
392
  }
@@ -621,7 +602,7 @@ import React4 from "react";
621
602
  import { Box as Box5, Text as Text7, useInput as useInput3 } from "ink";
622
603
  import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
623
604
  var OPTIONS = ["Allow", "Allow always (this session)", "Deny"];
624
- function formatArgs2(args) {
605
+ function formatArgs(args) {
625
606
  const entries = Object.entries(args);
626
607
  if (entries.length === 0) return "(no arguments)";
627
608
  return entries.map(([k, v]) => `${k}: ${typeof v === "string" ? v : JSON.stringify(v)}`).join(", ");
@@ -670,7 +651,7 @@ function PermissionPrompt({ request }) {
670
651
  ] }),
671
652
  /* @__PURE__ */ jsxs5(Text7, { dimColor: true, children: [
672
653
  " ",
673
- formatArgs2(request.toolArgs)
654
+ formatArgs(request.toolArgs)
674
655
  ] }),
675
656
  /* @__PURE__ */ jsx7(Box5, { marginTop: 1, children: OPTIONS.map((opt, i) => /* @__PURE__ */ jsx7(Box5, { marginRight: 2, children: /* @__PURE__ */ jsxs5(Text7, { color: i === selected ? "cyan" : void 0, bold: i === selected, children: [
676
657
  i === selected ? "> " : " ",
@@ -30,14 +30,14 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/index.ts
31
31
  var index_exports = {};
32
32
  __export(index_exports, {
33
- Session: () => import_agent_sdk3.Session,
34
- SessionStore: () => import_agent_sdk3.SessionStore,
35
- TRUST_TO_MODE: () => import_agent_sdk3.TRUST_TO_MODE,
36
- query: () => import_agent_sdk3.query,
33
+ Session: () => import_agent_sdk4.Session,
34
+ SessionStore: () => import_agent_sdk4.SessionStore,
35
+ TRUST_TO_MODE: () => import_agent_sdk4.TRUST_TO_MODE,
36
+ query: () => import_agent_sdk4.query,
37
37
  startCli: () => startCli
38
38
  });
39
39
  module.exports = __toCommonJS(index_exports);
40
- var import_agent_sdk3 = require("@robota-sdk/agent-sdk");
40
+ var import_agent_sdk4 = require("@robota-sdk/agent-sdk");
41
41
 
42
42
  // src/cli.ts
43
43
  var import_node_util = require("util");
@@ -46,26 +46,7 @@ var import_node_path2 = require("path");
46
46
  var import_node_url = require("url");
47
47
  var readline = __toESM(require("readline"), 1);
48
48
  var import_agent_sdk2 = require("@robota-sdk/agent-sdk");
49
-
50
- // src/permissions/permission-prompt.ts
51
- var import_chalk = __toESM(require("chalk"), 1);
52
- var PERMISSION_OPTIONS = ["Allow", "Deny"];
53
- var ALLOW_INDEX = 0;
54
- function formatArgs(toolArgs) {
55
- const entries = Object.entries(toolArgs);
56
- if (entries.length === 0) {
57
- return "(no arguments)";
58
- }
59
- return entries.map(([k, v]) => `${k}: ${typeof v === "string" ? v : JSON.stringify(v)}`).join(", ");
60
- }
61
- async function promptForApproval(terminal, toolName, toolArgs) {
62
- terminal.writeLine("");
63
- terminal.writeLine(import_chalk.default.yellow(`[Permission Required] Tool: ${toolName}`));
64
- terminal.writeLine(import_chalk.default.dim(` ${formatArgs(toolArgs)}`));
65
- terminal.writeLine("");
66
- const selected = await terminal.select(PERMISSION_OPTIONS, ALLOW_INDEX);
67
- return selected === ALLOW_INDEX;
68
- }
49
+ var import_agent_sdk3 = require("@robota-sdk/agent-sdk");
69
50
 
70
51
  // src/ui/render.tsx
71
52
  var import_ink9 = require("ink");
@@ -342,7 +323,7 @@ var import_ink6 = require("ink");
342
323
  var import_react = require("react");
343
324
  var import_ink3 = require("ink");
344
325
  var import_string_width = __toESM(require("string-width"), 1);
345
- var import_chalk2 = __toESM(require("chalk"), 1);
326
+ var import_chalk = __toESM(require("chalk"), 1);
346
327
  var import_jsx_runtime3 = require("react/jsx-runtime");
347
328
  function CjkTextInput({
348
329
  value,
@@ -423,22 +404,22 @@ function CjkTextInput({
423
404
  }
424
405
  function renderWithCursor(value, cursorOffset, placeholder, showCursor) {
425
406
  if (!showCursor) {
426
- return value.length > 0 ? value : placeholder ? import_chalk2.default.gray(placeholder) : "";
407
+ return value.length > 0 ? value : placeholder ? import_chalk.default.gray(placeholder) : "";
427
408
  }
428
409
  if (value.length === 0) {
429
410
  if (placeholder.length > 0) {
430
- return import_chalk2.default.inverse(placeholder[0]) + import_chalk2.default.gray(placeholder.slice(1));
411
+ return import_chalk.default.inverse(placeholder[0]) + import_chalk.default.gray(placeholder.slice(1));
431
412
  }
432
- return import_chalk2.default.inverse(" ");
413
+ return import_chalk.default.inverse(" ");
433
414
  }
434
415
  const chars = [...value];
435
416
  let rendered = "";
436
417
  for (let i = 0; i < chars.length; i++) {
437
418
  const char = chars[i] ?? "";
438
- rendered += i === cursorOffset ? import_chalk2.default.inverse(char) : char;
419
+ rendered += i === cursorOffset ? import_chalk.default.inverse(char) : char;
439
420
  }
440
421
  if (cursorOffset >= chars.length) {
441
- rendered += import_chalk2.default.inverse(" ");
422
+ rendered += import_chalk.default.inverse(" ");
442
423
  }
443
424
  return rendered;
444
425
  }
@@ -654,7 +635,7 @@ var import_react4 = __toESM(require("react"), 1);
654
635
  var import_ink7 = require("ink");
655
636
  var import_jsx_runtime7 = require("react/jsx-runtime");
656
637
  var OPTIONS = ["Allow", "Allow always (this session)", "Deny"];
657
- function formatArgs2(args) {
638
+ function formatArgs(args) {
658
639
  const entries = Object.entries(args);
659
640
  if (entries.length === 0) return "(no arguments)";
660
641
  return entries.map(([k, v]) => `${k}: ${typeof v === "string" ? v : JSON.stringify(v)}`).join(", ");
@@ -703,7 +684,7 @@ function PermissionPrompt({ request }) {
703
684
  ] }),
704
685
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_ink7.Text, { dimColor: true, children: [
705
686
  " ",
706
- formatArgs2(request.toolArgs)
687
+ formatArgs(request.toolArgs)
707
688
  ] }),
708
689
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_ink7.Box, { marginTop: 1, children: OPTIONS.map((opt, i) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_ink7.Box, { marginRight: 2, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_ink7.Text, { color: i === selected ? "cyan" : void 0, bold: i === selected, children: [
709
690
  i === selected ? "> " : " ",
@@ -1349,7 +1330,7 @@ async function startCli() {
1349
1330
  sessionLogger: new import_agent_sdk2.FileSessionLogger(paths.logs),
1350
1331
  projectInfo,
1351
1332
  permissionMode: args.permissionMode,
1352
- promptForApproval
1333
+ promptForApproval: import_agent_sdk3.promptForApproval
1353
1334
  });
1354
1335
  const response = await session.run(prompt);
1355
1336
  process.stdout.write(response + "\n");
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  startCli
3
- } from "./chunk-UT4RQDTI.js";
3
+ } from "./chunk-CT2VGJIF.js";
4
4
 
5
5
  // src/index.ts
6
6
  import { Session, SessionStore, query, TRUST_TO_MODE } from "@robota-sdk/agent-sdk";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robota-sdk/agent-cli",
3
- "version": "3.0.0-beta.10",
3
+ "version": "3.0.0-beta.11",
4
4
  "description": "AI coding assistant CLI built on Robota SDK",
5
5
  "type": "module",
6
6
  "bin": {
@@ -35,8 +35,8 @@
35
35
  "marked-terminal": "^7.3.0",
36
36
  "react": "19.2.4",
37
37
  "string-width": "^8.2.0",
38
- "@robota-sdk/agent-core": "3.0.0-beta.10",
39
- "@robota-sdk/agent-sdk": "3.0.0-beta.10"
38
+ "@robota-sdk/agent-core": "3.0.0-beta.11",
39
+ "@robota-sdk/agent-sdk": "3.0.0-beta.11"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/marked": "^6.0.0",