@delta-infra/cli 1.0.52 → 1.0.54
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/checksums.txt +5 -5
- package/package.json +1 -1
- package/scripts/install-wizard.js +28 -21
package/checksums.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
ed02f76e8f885108df51561405ee75fa9f02c541aeb12b9b608142f355157990 delta-cli-darwin-amd64.tar.gz
|
|
2
|
+
12707c9b5c4647879ef64a74c55f77c70e5c20e0f07324bddcaa85a7fff1ec25 delta-cli-darwin-arm64.tar.gz
|
|
3
|
+
c57385b6367fa4886b49c3fc2af5c1ec9c85539cc4d13f16a25adbcf66ace8ab delta-cli-linux-amd64.tar.gz
|
|
4
|
+
d1195f7300d2a0c4371f4fe6cb43808790d86cd39d875288e0c0b7e1f6b71a4f delta-cli-linux-arm64.tar.gz
|
|
5
|
+
4ed0ca8c9767e340878527936f380528335bf1fc7f45f6f7c71b84026da3bd6c delta-cli-windows-amd64.zip
|
package/package.json
CHANGED
|
@@ -106,8 +106,12 @@ function runSilentAsync(cmd, args, opts = {}) {
|
|
|
106
106
|
execFile(actualCmd, actualArgs, {
|
|
107
107
|
stdio: ["ignore", "pipe", "pipe"],
|
|
108
108
|
...opts,
|
|
109
|
-
}, (err, stdout) => {
|
|
110
|
-
if (err)
|
|
109
|
+
}, (err, stdout, stderr) => {
|
|
110
|
+
if (err) {
|
|
111
|
+
err.stdout = stdout;
|
|
112
|
+
err.stderr = stderr;
|
|
113
|
+
reject(err);
|
|
114
|
+
}
|
|
111
115
|
else resolve(stdout);
|
|
112
116
|
});
|
|
113
117
|
});
|
|
@@ -127,6 +131,7 @@ function osHomedir() {
|
|
|
127
131
|
|
|
128
132
|
function isInteractiveEnv() {
|
|
129
133
|
return !!process.stdin.isTTY &&
|
|
134
|
+
!!process.stdout.isTTY &&
|
|
130
135
|
!process.env.CI &&
|
|
131
136
|
!process.env.NO_COLOR &&
|
|
132
137
|
process.env.TERM !== "dumb";
|
|
@@ -247,19 +252,23 @@ async function stepInstallGlobally(msg) {
|
|
|
247
252
|
}
|
|
248
253
|
}
|
|
249
254
|
|
|
250
|
-
async function skillsAlreadyInstalled() {
|
|
251
|
-
const agentsDir = path.join(osHomedir(), ".agents", "skills");
|
|
252
|
-
return fs.existsSync(path.join(agentsDir, "delta-sandbox", "SKILL.md")) &&
|
|
253
|
-
fs.existsSync(path.join(agentsDir, "delta-shared", "SKILL.md"));
|
|
254
|
-
}
|
|
255
|
-
|
|
256
255
|
function installSkillsFromLocalPackage() {
|
|
257
|
-
const
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
256
|
+
const candidates = [];
|
|
257
|
+
try {
|
|
258
|
+
const npmRoot = runSilent("npm", ["root", "-g"], { timeout: 10000 })
|
|
259
|
+
.toString().trim();
|
|
260
|
+
candidates.push(path.join(npmRoot, PKG, "skills"));
|
|
261
|
+
} catch {}
|
|
262
|
+
candidates.push(path.join(__dirname, "..", "skills"));
|
|
263
|
+
|
|
264
|
+
let pkgSkillsDir = null;
|
|
265
|
+
for (const c of candidates) {
|
|
266
|
+
if (fs.existsSync(path.join(c, "delta-sandbox", "SKILL.md"))) {
|
|
267
|
+
pkgSkillsDir = c;
|
|
268
|
+
break;
|
|
269
|
+
}
|
|
262
270
|
}
|
|
271
|
+
if (!pkgSkillsDir) return false;
|
|
263
272
|
|
|
264
273
|
const home = osHomedir();
|
|
265
274
|
const agentsDir = path.join(home, ".agents", "skills");
|
|
@@ -293,11 +302,6 @@ async function stepInstallSkills(msg) {
|
|
|
293
302
|
const s = createSpinner();
|
|
294
303
|
s.start(msg.step2Spinner);
|
|
295
304
|
try {
|
|
296
|
-
if (await skillsAlreadyInstalled()) {
|
|
297
|
-
s.stop(msg.step2Skip);
|
|
298
|
-
return;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
305
|
try {
|
|
302
306
|
if (installSkillsFromLocalPackage()) {
|
|
303
307
|
s.stop(msg.step2Done);
|
|
@@ -306,21 +310,24 @@ async function stepInstallSkills(msg) {
|
|
|
306
310
|
} catch { }
|
|
307
311
|
|
|
308
312
|
const urls = [
|
|
309
|
-
`https://gh
|
|
310
|
-
`https://
|
|
313
|
+
`https://gh.ddlc.top/https://github.com/${SKILLS_REPO}`,
|
|
314
|
+
`https://ghproxy.net/https://github.com/${SKILLS_REPO}`,
|
|
311
315
|
`https://github.com/${SKILLS_REPO}`,
|
|
312
316
|
];
|
|
313
317
|
let lastErr;
|
|
314
318
|
for (const url of urls) {
|
|
315
319
|
try {
|
|
320
|
+
s.start(`${msg.step2Spinner} (try ${url.split("/")[2]})`);
|
|
316
321
|
await runSilentAsync("npx", ["-y", "skills", "add", url, "-y", "-g"], {
|
|
317
|
-
timeout:
|
|
322
|
+
timeout: 15000,
|
|
318
323
|
env: { ...process.env, GIT_TERMINAL_PROMPT: "0" },
|
|
319
324
|
});
|
|
320
325
|
s.stop(msg.step2Done);
|
|
321
326
|
return;
|
|
322
327
|
} catch (e) {
|
|
323
328
|
lastErr = e;
|
|
329
|
+
if (e && e.stderr) console.error(`[skills mirror failed] ${url}: ${e.stderr.toString().trim().slice(0, 200)}`);
|
|
330
|
+
else if (e && e.message) console.error(`[skills mirror failed] ${url}: ${e.message}`);
|
|
324
331
|
}
|
|
325
332
|
}
|
|
326
333
|
throw lastErr;
|