@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 +11 -0
- package/dist/bin.cjs +63 -13
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.js +1 -1
- package/dist/{chunk-KXI7545I.js → chunk-CCPJYGHP.js} +66 -16
- package/dist/chunk-CCPJYGHP.js.map +1 -0
- package/dist/index.cjs +63 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +8 -8
- package/dist/chunk-KXI7545I.js.map +0 -1
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
|
+

|
|
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
|
+

|
|
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
|
|
238
|
-
|
|
239
|
-
|
|
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(
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
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) {
|