@agentskit/cli 0.13.40 → 0.13.42
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 +0 -1
- package/dist/bin.cjs +41 -97
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.js +1 -1
- package/dist/{chunk-7ALDICSL.js → chunk-Z4BXQEGB.js} +43 -99
- package/dist/chunk-Z4BXQEGB.js.map +1 -0
- package/dist/index.cjs +41 -97
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +1 -1
- package/package.json +19 -18
- package/dist/chunk-7ALDICSL.js.map +0 -1
package/README.md
CHANGED
|
@@ -30,7 +30,6 @@ Chat with any LLM, scaffold projects, and run agents — all from your terminal.
|
|
|
30
30
|
- **AgentsKit**: compose it with the other packages in this repo to build agents from small, swappable parts.
|
|
31
31
|
- **Registry**: look for ready agents and templates that already use this layer at [registry.agentskit.io](https://registry.agentskit.io).
|
|
32
32
|
- **Playbook**: learn the production patterns behind this layer at [playbook.agentskit.io](https://playbook.agentskit.io).
|
|
33
|
-
- **AKOS**: run the same concepts with enterprise deployment, governance, and observability at [akos.agentskit.io](https://akos.agentskit.io).
|
|
34
33
|
|
|
35
34
|
Docs: [package guide](https://www.agentskit.io/docs/reference/packages/cli) · [agent handoff](https://github.com/AgentsKit-io/agentskit/blob/main/llms.txt)
|
|
36
35
|
|
package/dist/bin.cjs
CHANGED
|
@@ -15,12 +15,13 @@ var tools = require('@agentskit/tools');
|
|
|
15
15
|
var skills = require('@agentskit/skills');
|
|
16
16
|
var memory = require('@agentskit/memory');
|
|
17
17
|
var integrations = require('@agentskit/integrations');
|
|
18
|
-
var
|
|
18
|
+
var crossPlatform = require('@agentskit/cross-platform');
|
|
19
19
|
var jsxRuntime = require('react/jsx-runtime');
|
|
20
20
|
var url = require('url');
|
|
21
21
|
var runtime = require('@agentskit/runtime');
|
|
22
22
|
var prompts = require('@inquirer/prompts');
|
|
23
23
|
var kleur = require('kleur');
|
|
24
|
+
var child_process = require('child_process');
|
|
24
25
|
var module$1 = require('module');
|
|
25
26
|
var chokidar = require('chokidar');
|
|
26
27
|
var rag = require('@agentskit/rag');
|
|
@@ -39,7 +40,7 @@ var chokidar__default = /*#__PURE__*/_interopDefault(chokidar);
|
|
|
39
40
|
|
|
40
41
|
// package.json
|
|
41
42
|
var package_default = {
|
|
42
|
-
version: "0.13.
|
|
43
|
+
version: "0.13.42"};
|
|
43
44
|
async function loadJsonConfig(path6) {
|
|
44
45
|
try {
|
|
45
46
|
const raw = await promises.readFile(path6, "utf8");
|
|
@@ -152,7 +153,7 @@ var providers = {
|
|
|
152
153
|
deepseek: {
|
|
153
154
|
label: "DeepSeek",
|
|
154
155
|
envKeys: ["DEEPSEEK_API_KEY"],
|
|
155
|
-
defaultModel: "deepseek-
|
|
156
|
+
defaultModel: "deepseek-flash",
|
|
156
157
|
factory: (c) => adapters.deepseek(c)
|
|
157
158
|
},
|
|
158
159
|
grok: {
|
|
@@ -164,7 +165,7 @@ var providers = {
|
|
|
164
165
|
kimi: {
|
|
165
166
|
label: "Kimi",
|
|
166
167
|
envKeys: ["KIMI_API_KEY", "MOONSHOT_API_KEY"],
|
|
167
|
-
defaultModel: "kimi-k2
|
|
168
|
+
defaultModel: "kimi-k2.6",
|
|
168
169
|
factory: (c) => adapters.kimi(c)
|
|
169
170
|
},
|
|
170
171
|
groq: {
|
|
@@ -917,90 +918,37 @@ function configHooksToHandlers(config) {
|
|
|
917
918
|
}
|
|
918
919
|
return handlers;
|
|
919
920
|
}
|
|
920
|
-
function runShellHook(entry, payload) {
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
const child = child_process.spawn("sh", ["-c", entry.run], {
|
|
931
|
-
stdio: ["pipe", "pipe", "inherit"],
|
|
932
|
-
detached: true
|
|
933
|
-
});
|
|
934
|
-
let stdout = "";
|
|
935
|
-
let stdoutBytes = 0;
|
|
936
|
-
child.stdout.on("data", (chunk) => {
|
|
937
|
-
const text = chunk.toString();
|
|
938
|
-
const bytes = Buffer.byteLength(text);
|
|
939
|
-
if (stdoutBytes + bytes > MAX_HOOK_STDOUT_BYTES) {
|
|
940
|
-
if (child.pid !== void 0) {
|
|
941
|
-
try {
|
|
942
|
-
process.kill(-child.pid, "SIGKILL");
|
|
943
|
-
} catch {
|
|
944
|
-
}
|
|
945
|
-
}
|
|
946
|
-
try {
|
|
947
|
-
child.kill("SIGKILL");
|
|
948
|
-
} catch {
|
|
949
|
-
}
|
|
950
|
-
settle({ decision: "block", reason: `shell hook output exceeded ${MAX_HOOK_STDOUT_BYTES} bytes` });
|
|
951
|
-
return;
|
|
952
|
-
}
|
|
953
|
-
stdoutBytes += bytes;
|
|
954
|
-
stdout += text;
|
|
955
|
-
});
|
|
956
|
-
const timer = setTimeout(() => {
|
|
957
|
-
if (child.pid !== void 0) {
|
|
958
|
-
try {
|
|
959
|
-
process.kill(-child.pid, "SIGKILL");
|
|
960
|
-
} catch {
|
|
961
|
-
}
|
|
962
|
-
}
|
|
963
|
-
try {
|
|
964
|
-
child.kill("SIGKILL");
|
|
965
|
-
} catch {
|
|
966
|
-
}
|
|
967
|
-
settle({ decision: "block", reason: `shell hook timed out after ${timeoutMs}ms` });
|
|
968
|
-
}, timeoutMs);
|
|
969
|
-
child.stdin.on("error", () => {
|
|
970
|
-
});
|
|
971
|
-
child.on("close", (code) => {
|
|
972
|
-
if (code !== 0) {
|
|
973
|
-
settle({
|
|
974
|
-
decision: "block",
|
|
975
|
-
reason: `shell hook exited with code ${code}`
|
|
976
|
-
});
|
|
977
|
-
return;
|
|
978
|
-
}
|
|
979
|
-
const trimmed = stdout.trim();
|
|
980
|
-
if (!trimmed) {
|
|
981
|
-
settle({ decision: "continue" });
|
|
982
|
-
return;
|
|
983
|
-
}
|
|
984
|
-
try {
|
|
985
|
-
const parsed = JSON.parse(trimmed);
|
|
986
|
-
if (!parsed || typeof parsed !== "object" || !("decision" in parsed) || !["continue", "block", "modify"].includes(String(parsed.decision))) {
|
|
987
|
-
settle({ decision: "block", reason: "shell hook returned an invalid decision" });
|
|
988
|
-
} else {
|
|
989
|
-
settle(parsed);
|
|
990
|
-
}
|
|
991
|
-
} catch {
|
|
992
|
-
settle({ decision: "block", reason: "shell hook returned invalid JSON" });
|
|
993
|
-
}
|
|
994
|
-
});
|
|
995
|
-
child.on("error", (err) => {
|
|
996
|
-
settle({ decision: "block", reason: err.message });
|
|
921
|
+
async function runShellHook(entry, payload) {
|
|
922
|
+
const timeoutMs = entry.timeout ?? 5e3;
|
|
923
|
+
let result;
|
|
924
|
+
try {
|
|
925
|
+
result = await crossPlatform.runShell(entry.run, {
|
|
926
|
+
input: JSON.stringify(payload),
|
|
927
|
+
timeoutMs,
|
|
928
|
+
// Hooks are fire-and-judge: no grace period once the budget is spent.
|
|
929
|
+
killGraceMs: 0,
|
|
930
|
+
maxOutputBytes: MAX_HOOK_STDOUT_BYTES
|
|
997
931
|
});
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
932
|
+
} catch (err) {
|
|
933
|
+
return { decision: "block", reason: err instanceof Error ? err.message : String(err) };
|
|
934
|
+
}
|
|
935
|
+
if (result.stderr) process.stderr.write(result.stderr);
|
|
936
|
+
if (result.truncated) {
|
|
937
|
+
return { decision: "block", reason: `shell hook output exceeded ${MAX_HOOK_STDOUT_BYTES} bytes` };
|
|
938
|
+
}
|
|
939
|
+
if (result.timedOut) return { decision: "block", reason: `shell hook timed out after ${timeoutMs}ms` };
|
|
940
|
+
if (result.code !== 0) return { decision: "block", reason: `shell hook exited with code ${result.code}` };
|
|
941
|
+
const trimmed = result.stdout.trim();
|
|
942
|
+
if (!trimmed) return { decision: "continue" };
|
|
943
|
+
try {
|
|
944
|
+
const parsed = JSON.parse(trimmed);
|
|
945
|
+
if (!parsed || typeof parsed !== "object" || !("decision" in parsed) || !["continue", "block", "modify"].includes(String(parsed.decision))) {
|
|
946
|
+
return { decision: "block", reason: "shell hook returned an invalid decision" };
|
|
1002
947
|
}
|
|
1003
|
-
|
|
948
|
+
return parsed;
|
|
949
|
+
} catch {
|
|
950
|
+
return { decision: "block", reason: "shell hook returned invalid JSON" };
|
|
951
|
+
}
|
|
1004
952
|
}
|
|
1005
953
|
function groupIntoTurns(messages) {
|
|
1006
954
|
const turns = [];
|
|
@@ -1357,10 +1305,9 @@ var McpClient = class {
|
|
|
1357
1305
|
}
|
|
1358
1306
|
async start() {
|
|
1359
1307
|
if (this.child) return;
|
|
1360
|
-
const child =
|
|
1308
|
+
const child = crossPlatform.spawnNodeChild(this.spec.command, this.spec.args ?? [], {
|
|
1361
1309
|
env: { ...process.env, ...this.spec.env ?? {} },
|
|
1362
|
-
stdio:
|
|
1363
|
-
detached: process.platform !== "win32"
|
|
1310
|
+
stdio: "pipe"
|
|
1364
1311
|
});
|
|
1365
1312
|
this.child = child;
|
|
1366
1313
|
child.stdout.on("data", (chunk) => this.onStdout(chunk.toString()));
|
|
@@ -1399,11 +1346,8 @@ var McpClient = class {
|
|
|
1399
1346
|
const child = this.child;
|
|
1400
1347
|
if (!child || child.killed) return;
|
|
1401
1348
|
const kill = (signal) => {
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
else child.kill(signal);
|
|
1405
|
-
} catch {
|
|
1406
|
-
}
|
|
1349
|
+
if (child.pid === void 0 || child.exitCode !== null || child.signalCode !== null) return;
|
|
1350
|
+
void crossPlatform.killProcessTree(child.pid, signal, (sig) => child.kill(sig));
|
|
1407
1351
|
};
|
|
1408
1352
|
kill("SIGTERM");
|
|
1409
1353
|
const timer = setTimeout(() => kill("SIGKILL"), DISPOSE_GRACE_MS);
|
|
@@ -3524,7 +3468,7 @@ var PROVIDER_REGISTRY = [
|
|
|
3524
3468
|
catalogId: "deepseek",
|
|
3525
3469
|
env: { status: "required", keys: ["DEEPSEEK_API_KEY"] },
|
|
3526
3470
|
reachability: { status: "supported", url: "https://api.deepseek.com/models" },
|
|
3527
|
-
defaultModel: { status: "known", id: "deepseek-
|
|
3471
|
+
defaultModel: { status: "known", id: "deepseek-flash" }
|
|
3528
3472
|
},
|
|
3529
3473
|
{
|
|
3530
3474
|
id: "grok",
|
|
@@ -3542,7 +3486,7 @@ var PROVIDER_REGISTRY = [
|
|
|
3542
3486
|
catalogId: "moonshotai",
|
|
3543
3487
|
env: { status: "required", keys: ["KIMI_API_KEY", "MOONSHOT_API_KEY"] },
|
|
3544
3488
|
reachability: { status: "supported", url: "https://api.moonshot.ai/v1/models" },
|
|
3545
|
-
defaultModel: { status: "known", id: "kimi-k2
|
|
3489
|
+
defaultModel: { status: "known", id: "kimi-k2.6" }
|
|
3546
3490
|
},
|
|
3547
3491
|
{
|
|
3548
3492
|
id: "groq",
|
|
@@ -3596,7 +3540,7 @@ var PROVIDER_REGISTRY = [
|
|
|
3596
3540
|
catalogId: "fireworks-ai",
|
|
3597
3541
|
env: { status: "required", keys: ["FIREWORKS_API_KEY"] },
|
|
3598
3542
|
reachability: { status: "supported", url: "https://api.fireworks.ai/inference/v1/models" },
|
|
3599
|
-
defaultModel: { status: "known", id: "accounts/fireworks/models/deepseek-v4-flash" }
|
|
3543
|
+
defaultModel: { status: "known", id: "accounts/fireworks/models/deepseek-v4-flash-0731" }
|
|
3600
3544
|
},
|
|
3601
3545
|
{
|
|
3602
3546
|
id: "huggingface",
|