@xiashe/cli 0.1.2 → 0.1.4
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 +3 -1
- package/bin/xiashe.mjs +12 -5
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -18,12 +18,14 @@ xiashe skills list
|
|
|
18
18
|
xiashe skills install copywriting --connection MaxClaw-1 --watch
|
|
19
19
|
xiashe agent issue --name "Local WorkBuddy"
|
|
20
20
|
xiashe agent connect --token "<token>" --name "Local WorkBuddy"
|
|
21
|
-
xiashe agent
|
|
21
|
+
xiashe agent run --ack
|
|
22
22
|
xiashe chat send --chat "New Chat" --content "帮我处理这个文件" --file ./report.pdf --agent "Local WorkBuddy"
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
Local state is stored in `~/.xiashe/config.json`.
|
|
26
26
|
|
|
27
|
+
`xiashe agent run --ack` is the recommended lightweight receiver for shell-capable Agents. It sends cheap heartbeats and only lists/executes work when the backend reports pending tasks or transfers. Default cadence is about 30s while idle, 10s while work is active, and up to 2 minutes after long idle periods.
|
|
28
|
+
|
|
27
29
|
Production defaults:
|
|
28
30
|
|
|
29
31
|
- Convex: `https://api.xiashe.chat`
|
package/bin/xiashe.mjs
CHANGED
|
@@ -64,8 +64,8 @@ Usage:
|
|
|
64
64
|
${c} skills claim <one-time-token>
|
|
65
65
|
|
|
66
66
|
${c} agent issue [--name <name>] [--kind <kind>] [--json]
|
|
67
|
-
${c} agent connect --token <token> [--name <name>] [--kind <kind>]
|
|
68
|
-
${c} agent heartbeat
|
|
67
|
+
${c} agent connect --token <token> [--name <name>] [--kind <kind>] [--webhook-url <https-url>] [--webhook-token <secret>]
|
|
68
|
+
${c} agent heartbeat [--webhook-url <https-url>] [--webhook-token <secret>|--disable-webhook]
|
|
69
69
|
${c} agent list
|
|
70
70
|
${c} agent revoke --agent <id-or-name>
|
|
71
71
|
${c} agent run [--once] [--ack] [--idle-ms <ms>] [--busy-ms <ms>] [--max-idle-ms <ms>]
|
|
@@ -645,6 +645,8 @@ async function cmdAgent(sub, args, global) {
|
|
|
645
645
|
agentName: flags.name || flags['agent-name'] || 'XiaShe CLI Agent',
|
|
646
646
|
agentKind: flags.kind || 'cli',
|
|
647
647
|
agentRef: flags.ref || `${osName()} ${process.cwd()}`,
|
|
648
|
+
webhookUrl: flags['webhook-url'] || undefined,
|
|
649
|
+
webhookAuthToken: flags['webhook-token'] || flags['webhook-auth-token'] || undefined,
|
|
648
650
|
transport: flags.transport || 'npx'
|
|
649
651
|
});
|
|
650
652
|
await saveAgentSession(profileName, claim);
|
|
@@ -654,6 +656,11 @@ async function cmdAgent(sub, args, global) {
|
|
|
654
656
|
if (sub === 'heartbeat') {
|
|
655
657
|
const result = await client.agentHeartbeat({
|
|
656
658
|
status: flags.status || 'online',
|
|
659
|
+
agentName: flags.name || flags['agent-name'] || undefined,
|
|
660
|
+
agentRef: flags.ref || undefined,
|
|
661
|
+
webhookUrl: flags['webhook-url'] || undefined,
|
|
662
|
+
webhookAuthToken: flags['webhook-token'] || flags['webhook-auth-token'] || undefined,
|
|
663
|
+
webhookMode: flags['disable-webhook'] ? 'disabled' : flags['webhook-url'] ? 'notify' : undefined,
|
|
657
664
|
capabilities: parseCsv(flags.capabilities || 'chat,files,tasks,skills')
|
|
658
665
|
});
|
|
659
666
|
print(result, global);
|
|
@@ -713,9 +720,9 @@ async function cmdAgent(sub, args, global) {
|
|
|
713
720
|
}
|
|
714
721
|
|
|
715
722
|
async function cmdAgentReceiver(flags, client, global) {
|
|
716
|
-
const idleMs = numericFlag(flags, 'idle-ms',
|
|
717
|
-
const busyMs = numericFlag(flags, 'busy-ms',
|
|
718
|
-
const maxIdleMs = numericFlag(flags, 'max-idle-ms',
|
|
723
|
+
const idleMs = numericFlag(flags, 'idle-ms', 30_000);
|
|
724
|
+
const busyMs = numericFlag(flags, 'busy-ms', 10_000);
|
|
725
|
+
const maxIdleMs = numericFlag(flags, 'max-idle-ms', 120_000);
|
|
719
726
|
const deadline = Date.now() + numericFlag(flags, 'timeout-ms', 24 * 60 * 60_000);
|
|
720
727
|
const capabilities = parseCsv(flags.capabilities || 'chat,files,tasks,skills');
|
|
721
728
|
const seenTasks = new Set();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xiashe/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"xiashe": "bin/xiashe.mjs"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"README.md"
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xiashe/sdk": "0.1.
|
|
13
|
+
"@xiashe/sdk": "0.1.3"
|
|
14
14
|
},
|
|
15
15
|
"engines": {
|
|
16
16
|
"node": ">=20"
|