@agentskit/cli 0.5.2 → 0.5.3

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
@@ -43,14 +43,25 @@ agentskit init --template ink --dir my-cli
43
43
  agentskit run --help
44
44
  ```
45
45
 
46
+ ### agentskit init
47
+
48
+ ![agentskit init](https://raw.githubusercontent.com/AgentsKit-io/agentskit/main/apps/docs-next/public/demos/init.gif)
49
+
46
50
  ## Features
47
51
 
48
52
  - `agentskit chat` — interactive streaming chat in the terminal powered by `@agentskit/ink`
49
53
  - `agentskit init` — interactive project generator (React or Ink templates, production-ready structure)
50
54
  - `agentskit run` — execute headless runtime agents from the terminal
55
+ - `agentskit doctor` — diagnose your environment, packages, and provider config
56
+ - `agentskit dev` — hot-reload agent development
57
+ - `agentskit tunnel` — expose local agent via public URL
51
58
  - Provider flags: `--provider`, `--model`, `--system`, `--skill`, `--memory`
52
59
  - Env-var based key injection — works seamlessly in CI and scripts
53
60
 
61
+ ### agentskit doctor
62
+
63
+ ![agentskit doctor](https://raw.githubusercontent.com/AgentsKit-io/agentskit/main/apps/docs-next/public/demos/doctor.gif)
64
+
54
65
  ## Ecosystem
55
66
 
56
67
  | Package | Role |
package/dist/bin.cjs CHANGED
@@ -233,11 +233,31 @@ function resolveMemory(backend, memoryPath) {
233
233
  return memory.fileChatMemory(memoryPath);
234
234
  }
235
235
  }
236
+ function groupIntoTurns(messages) {
237
+ const turns = [];
238
+ let current = [];
239
+ for (const message of messages) {
240
+ if (message.role === "user") {
241
+ if (current.length > 0) turns.push(current);
242
+ current = [message];
243
+ } else if (message.role === "system") {
244
+ if (current.length > 0) turns.push(current);
245
+ turns.push([message]);
246
+ current = [];
247
+ } else {
248
+ current.push(message);
249
+ }
250
+ }
251
+ if (current.length > 0) turns.push(current);
252
+ return turns;
253
+ }
236
254
  function ChatApp(options) {
237
- const adapter = React3.useMemo(
238
- () => resolveChatProvider(options).adapter,
239
- [options.apiKey, options.baseUrl, options.model, options.provider]
240
- );
255
+ const runtime = React3.useMemo(() => resolveChatProvider(options), [
256
+ options.apiKey,
257
+ options.baseUrl,
258
+ options.model,
259
+ options.provider
260
+ ]);
241
261
  const memory = React3.useMemo(
242
262
  () => resolveMemory(options.memoryBackend, options.memoryPath ?? ".agentskit-history.json"),
243
263
  [options.memoryPath, options.memoryBackend]
@@ -251,21 +271,51 @@ function ChatApp(options) {
251
271
  return resolved;
252
272
  }, [options.skill]);
253
273
  const chat = ink$1.useChat({
254
- adapter,
274
+ adapter: runtime.adapter,
255
275
  memory,
256
276
  systemPrompt: options.system,
257
277
  tools: tools.length > 0 ? tools : void 0,
258
278
  skills
259
279
  });
280
+ const turns = React3.useMemo(() => groupIntoTurns(chat.messages), [chat.messages]);
281
+ const toolNames = options.tools ? options.tools.split(",").map((s) => s.trim()).filter(Boolean) : [];
260
282
  return /* @__PURE__ */ jsxRuntime.jsxs(ink.Box, { flexDirection: "column", gap: 1, children: [
261
- /* @__PURE__ */ jsxRuntime.jsx(ink.Text, { bold: true, color: "cyan", children: "AgentsKit CLI" }),
262
- /* @__PURE__ */ jsxRuntime.jsx(ink.Text, { dimColor: true, children: "Press Enter to send. Live providers use env vars or --api-key, and demo mode stays available for zero-config usage." }),
263
- /* @__PURE__ */ jsxRuntime.jsx(ink$1.ChatContainer, { children: chat.messages.map((message) => /* @__PURE__ */ jsxRuntime.jsxs(ink.Box, { flexDirection: "column", marginBottom: 1, children: [
264
- /* @__PURE__ */ jsxRuntime.jsx(ink$1.Message, { message }),
265
- message.toolCalls?.map((toolCall) => /* @__PURE__ */ jsxRuntime.jsx(ink$1.ToolCallView, { toolCall }, toolCall.id))
266
- ] }, message.id)) }),
267
- /* @__PURE__ */ jsxRuntime.jsx(ink$1.ThinkingIndicator, { visible: chat.status === "streaming" }),
268
- /* @__PURE__ */ jsxRuntime.jsx(ink$1.InputBar, { chat, placeholder: "Type a message and press Enter..." })
283
+ /* @__PURE__ */ jsxRuntime.jsx(
284
+ ink$1.StatusHeader,
285
+ {
286
+ provider: runtime.provider,
287
+ model: runtime.model,
288
+ mode: runtime.mode,
289
+ tools: toolNames,
290
+ messageCount: chat.messages.length
291
+ }
292
+ ),
293
+ /* @__PURE__ */ jsxRuntime.jsx(ink$1.ChatContainer, { children: turns.map((turn, turnIdx) => {
294
+ const assistantSteps = turn.filter((m) => m.role === "assistant").length;
295
+ let stepIndex = 0;
296
+ return /* @__PURE__ */ jsxRuntime.jsx(ink.Box, { flexDirection: "column", gap: 1, children: turn.map((message) => {
297
+ const showStep = message.role === "assistant" && assistantSteps > 1;
298
+ if (showStep) stepIndex++;
299
+ return /* @__PURE__ */ jsxRuntime.jsxs(ink.Box, { flexDirection: "column", children: [
300
+ showStep ? /* @__PURE__ */ jsxRuntime.jsxs(ink.Text, { dimColor: true, children: [
301
+ "\u21BB step ",
302
+ stepIndex,
303
+ "/",
304
+ assistantSteps
305
+ ] }) : null,
306
+ /* @__PURE__ */ jsxRuntime.jsx(ink$1.Message, { message }),
307
+ message.toolCalls?.map((toolCall) => /* @__PURE__ */ jsxRuntime.jsx(ink$1.ToolCallView, { toolCall, expanded: true }, toolCall.id))
308
+ ] }, message.id);
309
+ }) }, `turn-${turnIdx}`);
310
+ }) }),
311
+ /* @__PURE__ */ jsxRuntime.jsx(
312
+ ink$1.ThinkingIndicator,
313
+ {
314
+ visible: chat.status === "streaming",
315
+ label: toolNames.length > 0 ? "agent working" : "thinking"
316
+ }
317
+ ),
318
+ /* @__PURE__ */ jsxRuntime.jsx(ink$1.InputBar, { chat, placeholder: "Type a message and press Enter\u2026" })
269
319
  ] });
270
320
  }
271
321
  function renderChatHeader(options) {