@tiny-fish/cli 0.41.2-next.329 → 0.41.2-next.330
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/dist/lib/skill-install.js +5 -21
- package/package.json +1 -1
|
@@ -4,10 +4,11 @@ import spawn from 'cross-spawn';
|
|
|
4
4
|
import { loadConfig } from './auth.js';
|
|
5
5
|
import { captureStdio, capturedOutput, replay, SKILL_INSTALL_TIMEOUT_MS, STEP_MAX_BUFFER, } from './cli-install.js';
|
|
6
6
|
import { CURSOR_SKILL_TARGET, NATIVE_MCP_CLIENTS, OPENCLAW, openclawSkillInstallArgs, } from './connect-clients.js';
|
|
7
|
-
import { ConnectInterruptedError, ConnectStepError, probeSupportVariant,
|
|
7
|
+
import { ConnectInterruptedError, ConnectStepError, probeSupportVariant, throwIfInterrupted, } from './connect-runtime.js';
|
|
8
8
|
import { CLI_AGENT_IDENTITY } from './constants.js';
|
|
9
|
-
import { errLine
|
|
9
|
+
import { errLine } from './output.js';
|
|
10
10
|
import { skillTargetDir } from './skill-paths.js';
|
|
11
|
+
import { clearSkillLockEntry, writeWebSkill } from './skill-vendor.js';
|
|
11
12
|
// Supports Hermes without node:util.styleText, so the installer still runs on Node 20.11.
|
|
12
13
|
export const SKILLS_CLI_PACKAGE = 'skills@1.5.15';
|
|
13
14
|
const TINYFISH_WEB_SKILL_SOURCE = 'tinyfish-io/tinyfish-cookbook';
|
|
@@ -50,29 +51,12 @@ function skillOnDisk(agent) {
|
|
|
50
51
|
// SKILL.md, not the dir: `skills` mkdirs before it copies, so a failed copy leaves one.
|
|
51
52
|
return fs.existsSync(path.join(skillTargetDir(agent), 'SKILL.md'));
|
|
52
53
|
}
|
|
53
|
-
// The route tail-slices to 500, so an over-long tail would cut the tag off the front.
|
|
54
|
-
const SKILL_DETAIL_TAIL_MAX_CHARS = 425;
|
|
55
|
-
function absentDetail(addOutput) {
|
|
56
|
-
const tail = sanitizeLine(addOutput).trim().slice(-SKILL_DETAIL_TAIL_MAX_CHARS);
|
|
57
|
-
return tail ? `skill_absent_after_add | ${tail}` : 'skill_absent_after_add';
|
|
58
|
-
}
|
|
59
54
|
export function installWebSkill(client, { verbose }) {
|
|
60
55
|
if (!client.skillAgent)
|
|
61
56
|
return;
|
|
62
57
|
errLine(`Installing the TinyFish web skill in ${client.displayName}...`);
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
env: skillSpawnEnv(),
|
|
66
|
-
});
|
|
67
|
-
const output = capturedOutput(add);
|
|
68
|
-
const addFailed = Boolean(add.error) || add.status !== 0;
|
|
69
|
-
const absent = !addFailed && !skillOnDisk(client.skillAgent);
|
|
70
|
-
if (addFailed || absent) {
|
|
71
|
-
// Built first: its interrupt check must run before any replay.
|
|
72
|
-
const error = spawnStepError(`Could not install the TinyFish web skill in ${client.displayName}`, add, absent ? absentDetail(output) : undefined);
|
|
73
|
-
replay(output);
|
|
74
|
-
throw error;
|
|
75
|
-
}
|
|
58
|
+
writeWebSkill([client.skillAgent]);
|
|
59
|
+
clearSkillLockEntry({ verbose });
|
|
76
60
|
}
|
|
77
61
|
/**
|
|
78
62
|
* Refresh the skill we installed, for the harnesses we installed it in.
|