@robota-sdk/agent-cli 3.0.0-beta.41 → 3.0.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.
package/README.md CHANGED
@@ -260,9 +260,19 @@ Session logs are written to `.robota/logs/{sessionId}.jsonl` in JSONL format by
260
260
 
261
261
  ## Architecture
262
262
 
263
+ The CLI is a pure TUI layer. All business logic lives in `@robota-sdk/agent-sdk`'s `InteractiveSession`. `useInteractiveSession` is the sole React↔SDK bridge, converting SDK events to React state.
264
+
263
265
  ```
264
266
  bin.ts → cli.ts (arg parsing)
265
- └── ui/render.tsx → App.tsx (Ink TUI)
267
+ └── ui/render.tsx → App.tsx (thin JSX shell)
268
+ ├── useInteractiveSession (ONLY React↔SDK bridge)
269
+ │ ├── InteractiveSession (SDK)
270
+ │ ├── CommandRegistry (SDK, re-exported by CLI)
271
+ │ │ ├── BuiltinCommandSource (SDK)
272
+ │ │ ├── SkillCommandSource (SDK, discovers from 4 paths)
273
+ │ │ └── PluginCommandSource (CLI-local)
274
+ │ └── SystemCommandExecutor (SDK)
275
+ ├── plugin-hooks-merger.ts (merges plugin hooks into SDK config)
266
276
  ├── MessageList.tsx
267
277
  ├── InputArea.tsx (CjkTextInput, bracketed paste, slash detection)
268
278
  ├── StatusBar.tsx (mode, model, context %, message count)
@@ -272,12 +282,7 @@ bin.ts → cli.ts (arg parsing)
272
282
  ├── MenuSelect.tsx (arrow-key menu, Plugin TUI)
273
283
  ├── PluginTUI.tsx (plugin management screen stack)
274
284
  ├── TextPrompt.tsx (text input for Plugin TUI)
275
- ├── ConfirmPrompt.tsx (reusable yes/no prompt)
276
- ├── CommandRegistry
277
- │ ├── BuiltinCommandSource
278
- │ ├── SkillCommandSource (discovers from 4 paths)
279
- │ └── PluginCommandSource (from installed plugins)
280
- └── Session (from @robota-sdk/agent-sessions)
285
+ └── ConfirmPrompt.tsx (reusable yes/no prompt)
281
286
  ```
282
287
 
283
288
  ## Dependencies
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-KX3JUGSB.js";
4
+ } from "./chunk-SYGOHAAL.js";
5
5
 
6
6
  // src/bin.ts
7
7
  process.on("uncaughtException", (err) => {
@@ -434,11 +434,12 @@ function useInteractiveSession(props) {
434
434
  };
435
435
  const onThinking = (thinking) => {
436
436
  setIsThinking(thinking);
437
- if (!thinking) {
438
- setIsAborting(false);
437
+ if (thinking) {
439
438
  streamBuf = "";
440
439
  setStreamingText("");
441
440
  setActiveTools([]);
441
+ } else {
442
+ setIsAborting(false);
442
443
  }
443
444
  };
444
445
  const onComplete = (result) => {
@@ -512,9 +513,13 @@ function useInteractiveSession(props) {
512
513
  }
513
514
  const skillCmd = registry.getCommands().find((c) => c.name === cmd && (c.source === "skill" || c.source === "plugin"));
514
515
  if (skillCmd) {
516
+ addMessage(createSystemMessage(`Invoking ${skillCmd.source}: ${cmd}`));
515
517
  const prompt = await buildSkillPrompt(input, registry);
516
518
  if (prompt) {
517
- await interactiveSession.submit(prompt);
519
+ const qualifiedName = registry.resolveQualifiedName(cmd);
520
+ const hookInput = qualifiedName ? `/${qualifiedName}${input.slice(1 + cmd.length)}` : input;
521
+ await interactiveSession.submit(prompt, input, hookInput);
522
+ setPendingPrompt(interactiveSession.getPendingPrompt());
518
523
  return;
519
524
  }
520
525
  }
@@ -530,6 +535,7 @@ function useInteractiveSession(props) {
530
535
  return;
531
536
  }
532
537
  await interactiveSession.submit(input);
538
+ setPendingPrompt(interactiveSession.getPendingPrompt());
533
539
  },
534
540
  [interactiveSession, commandExecutor, registry, addMessage]
535
541
  );
@@ -2049,7 +2055,7 @@ function App(props) {
2049
2055
  ] }),
2050
2056
  /* @__PURE__ */ jsxs11(Box11, { flexDirection: "column", paddingX: 1, flexGrow: 1, children: [
2051
2057
  /* @__PURE__ */ jsx13(MessageList, { messages }),
2052
- isThinking && /* @__PURE__ */ jsx13(Box11, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ jsx13(StreamingIndicator, { text: streamingText, activeTools }) })
2058
+ (isThinking || activeTools.length > 0) && /* @__PURE__ */ jsx13(Box11, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ jsx13(StreamingIndicator, { text: streamingText, activeTools }) })
2053
2059
  ] }),
2054
2060
  permissionRequest && /* @__PURE__ */ jsx13(PermissionPrompt, { request: permissionRequest }),
2055
2061
  pendingModelId && /* @__PURE__ */ jsx13(
@@ -460,11 +460,12 @@ function useInteractiveSession(props) {
460
460
  };
461
461
  const onThinking = (thinking) => {
462
462
  setIsThinking(thinking);
463
- if (!thinking) {
464
- setIsAborting(false);
463
+ if (thinking) {
465
464
  streamBuf = "";
466
465
  setStreamingText("");
467
466
  setActiveTools([]);
467
+ } else {
468
+ setIsAborting(false);
468
469
  }
469
470
  };
470
471
  const onComplete = (result) => {
@@ -538,9 +539,13 @@ function useInteractiveSession(props) {
538
539
  }
539
540
  const skillCmd = registry.getCommands().find((c) => c.name === cmd && (c.source === "skill" || c.source === "plugin"));
540
541
  if (skillCmd) {
542
+ addMessage((0, import_agent_core.createSystemMessage)(`Invoking ${skillCmd.source}: ${cmd}`));
541
543
  const prompt = await buildSkillPrompt(input, registry);
542
544
  if (prompt) {
543
- await interactiveSession.submit(prompt);
545
+ const qualifiedName = registry.resolveQualifiedName(cmd);
546
+ const hookInput = qualifiedName ? `/${qualifiedName}${input.slice(1 + cmd.length)}` : input;
547
+ await interactiveSession.submit(prompt, input, hookInput);
548
+ setPendingPrompt(interactiveSession.getPendingPrompt());
544
549
  return;
545
550
  }
546
551
  }
@@ -556,6 +561,7 @@ function useInteractiveSession(props) {
556
561
  return;
557
562
  }
558
563
  await interactiveSession.submit(input);
564
+ setPendingPrompt(interactiveSession.getPendingPrompt());
559
565
  },
560
566
  [interactiveSession, commandExecutor, registry, addMessage]
561
567
  );
@@ -2070,7 +2076,7 @@ function App(props) {
2070
2076
  ] }),
2071
2077
  /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_ink13.Box, { flexDirection: "column", paddingX: 1, flexGrow: 1, children: [
2072
2078
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MessageList, { messages }),
2073
- isThinking && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_ink13.Box, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(StreamingIndicator, { text: streamingText, activeTools }) })
2079
+ (isThinking || activeTools.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_ink13.Box, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(StreamingIndicator, { text: streamingText, activeTools }) })
2074
2080
  ] }),
2075
2081
  permissionRequest && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(PermissionPrompt, { request: permissionRequest }),
2076
2082
  pendingModelId && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  startCli
3
- } from "./chunk-KX3JUGSB.js";
3
+ } from "./chunk-SYGOHAAL.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.41",
3
+ "version": "3.0.0-beta.43",
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.34",
39
- "@robota-sdk/agent-sdk": "3.0.0-beta.35"
38
+ "@robota-sdk/agent-core": "3.0.0-beta.43",
39
+ "@robota-sdk/agent-sdk": "3.0.0-beta.43"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/marked": "^6.0.0",