@xiashe/cli 0.1.8 → 0.1.9
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 +32 -5
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -20,13 +20,15 @@ xiashe agent issue --name "Local WorkBuddy"
|
|
|
20
20
|
xiashe agent connect --token "<token>" --name "Local WorkBuddy"
|
|
21
21
|
xiashe agent run --ack
|
|
22
22
|
xiashe chat send --chat "New Chat" --content "帮我处理这个文件" --file ./report.pdf --agent "Local WorkBuddy"
|
|
23
|
-
xiashe skills publish draft . --source xiashe
|
|
23
|
+
xiashe skills publish draft . --source xiashe
|
|
24
24
|
xiashe skills publish doctor "<submission-id>"
|
|
25
25
|
xiashe skills publish submit "<submission-id>"
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
Local state is stored in `~/.xiashe/config.json`.
|
|
29
29
|
|
|
30
|
+
`skills publish draft` reads `.xiashe/xiashe.skill.json` when present. If the local CLI is not signed in, it can create or reuse the XiaShe Store draft with that registry public token; creator login is only required when the registry token is missing or rejected.
|
|
31
|
+
|
|
30
32
|
`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.
|
|
31
33
|
|
|
32
34
|
Production defaults:
|
package/bin/xiashe.mjs
CHANGED
|
@@ -580,17 +580,32 @@ async function cmdSkillPublish(flags, client, global) {
|
|
|
580
580
|
if (action === 'draft' || action === 'create') {
|
|
581
581
|
const skillDir = flags._[1] && !String(flags._[1]).startsWith('--') ? flags._[1] : '.';
|
|
582
582
|
const draft = await inferPublishDraft(skillDir, flags, client);
|
|
583
|
+
const printableDraft = redactPublishDraft(draft);
|
|
583
584
|
const result = await client.createSkillSubmissionDraft(draft);
|
|
584
585
|
if (global.json) {
|
|
585
|
-
print({ ok: true, ...result, draft }, global);
|
|
586
|
+
print({ ok: true, ...result, draft: printableDraft }, global);
|
|
587
|
+
return;
|
|
588
|
+
}
|
|
589
|
+
if (result.reused) {
|
|
590
|
+
print(
|
|
591
|
+
[
|
|
592
|
+
`Reused existing Skill submission: ${result.submissionId}`,
|
|
593
|
+
`Status: ${result.status || 'existing'}`,
|
|
594
|
+
`Name: ${printableDraft.name}`,
|
|
595
|
+
`Registry: ${printableDraft.registryPublicSkillId || printableDraft.registryEntryId || 'attached'}`,
|
|
596
|
+
'',
|
|
597
|
+
'Duplicate XiaShe Store upload was skipped. Continue with registry/runtime verification and external platform preparation.'
|
|
598
|
+
].join('\n'),
|
|
599
|
+
global
|
|
600
|
+
);
|
|
586
601
|
return;
|
|
587
602
|
}
|
|
588
603
|
print(
|
|
589
604
|
[
|
|
590
605
|
`Created Skill submission draft: ${result.submissionId}`,
|
|
591
|
-
`Name: ${
|
|
592
|
-
`Market: ${
|
|
593
|
-
`Source fingerprint: ${
|
|
606
|
+
`Name: ${printableDraft.name}`,
|
|
607
|
+
`Market: ${printableDraft.market}`,
|
|
608
|
+
`Source fingerprint: ${printableDraft.packageSha256}`,
|
|
594
609
|
'',
|
|
595
610
|
`Next: ${COMMAND_NAME} skills publish doctor ${result.submissionId}`,
|
|
596
611
|
`Then: ${COMMAND_NAME} skills publish submit ${result.submissionId}`
|
|
@@ -660,6 +675,13 @@ async function cmdSkillPublish(flags, client, global) {
|
|
|
660
675
|
fail(`Unknown skills publish command: ${action}`, EXIT_USAGE);
|
|
661
676
|
}
|
|
662
677
|
|
|
678
|
+
function redactPublishDraft(draft) {
|
|
679
|
+
const clean = { ...draft };
|
|
680
|
+
delete clean._registryPublicToken;
|
|
681
|
+
delete clean.registryPublicToken;
|
|
682
|
+
return clean;
|
|
683
|
+
}
|
|
684
|
+
|
|
663
685
|
async function watchSkillJob(client, connectionId, jobId, global) {
|
|
664
686
|
const deadline = Date.now() + Number(global.watchTimeoutMs || 180_000);
|
|
665
687
|
let latest = null;
|
|
@@ -1221,6 +1243,10 @@ async function inferPublishDraft(skillDir, flags, client) {
|
|
|
1221
1243
|
const packageJson = await readJson(path.join(root, 'package.json'));
|
|
1222
1244
|
const skillMd = await readSmallText(path.join(root, 'SKILL.md'));
|
|
1223
1245
|
const readme = await readSmallText(path.join(root, 'README.md'));
|
|
1246
|
+
const registryManifest =
|
|
1247
|
+
await readJson(path.join(root, '.xiashe', 'xiashe.skill.json')) ||
|
|
1248
|
+
await readJson(path.join(root, 'xiashe.skill.json'));
|
|
1249
|
+
const registry = registryManifest?.registry || {};
|
|
1224
1250
|
const text = `${skillMd}\n\n${readme}`;
|
|
1225
1251
|
const digest = await hashPublishDirectory(root);
|
|
1226
1252
|
const name = flags.name || packageJson?.name || firstHeading(text) || path.basename(root);
|
|
@@ -1251,7 +1277,8 @@ async function inferPublishDraft(skillDir, flags, client) {
|
|
|
1251
1277
|
category: flags.category || undefined,
|
|
1252
1278
|
tags: parseCsv(flags.tags),
|
|
1253
1279
|
registryEntryId: flags['registry-entry'] || flags.registryEntryId || undefined,
|
|
1254
|
-
registryPublicSkillId: flags['registry-public-skill-id'] || flags.registryPublicSkillId || undefined,
|
|
1280
|
+
registryPublicSkillId: flags['registry-public-skill-id'] || flags.registryPublicSkillId || registry.skillId || undefined,
|
|
1281
|
+
_registryPublicToken: flags['registry-public-token'] || flags.registryPublicToken || registry.publicToken || undefined,
|
|
1255
1282
|
packageSha256: digest.sha256
|
|
1256
1283
|
};
|
|
1257
1284
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xiashe/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
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.9"
|
|
14
14
|
},
|
|
15
15
|
"engines": {
|
|
16
16
|
"node": ">=20"
|