@wayai/cli 0.3.68 → 0.3.69
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/index.js +52 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9373,6 +9373,41 @@ var init_hub_binding = __esm({
|
|
|
9373
9373
|
}
|
|
9374
9374
|
});
|
|
9375
9375
|
|
|
9376
|
+
// src/lib/skill-symlink.ts
|
|
9377
|
+
import { existsSync as existsSync8, lstatSync, mkdirSync as mkdirSync4, rmSync, symlinkSync } from "fs";
|
|
9378
|
+
import { join as join11 } from "path";
|
|
9379
|
+
function healClaudeSkillLink(root) {
|
|
9380
|
+
try {
|
|
9381
|
+
const source = join11(root, ".agents", "skills", SKILL_NAME);
|
|
9382
|
+
if (!existsSync8(join11(source, SKILL_FILENAME))) return false;
|
|
9383
|
+
const link = join11(root, ".claude", "skills", SKILL_NAME);
|
|
9384
|
+
if (existsSync8(join11(link, SKILL_FILENAME))) return false;
|
|
9385
|
+
let entry = null;
|
|
9386
|
+
try {
|
|
9387
|
+
entry = lstatSync(link);
|
|
9388
|
+
} catch {
|
|
9389
|
+
entry = null;
|
|
9390
|
+
}
|
|
9391
|
+
if (entry) {
|
|
9392
|
+
if (!entry.isSymbolicLink()) return false;
|
|
9393
|
+
rmSync(link, { force: true });
|
|
9394
|
+
}
|
|
9395
|
+
mkdirSync4(join11(root, ".claude", "skills"), { recursive: true });
|
|
9396
|
+
symlinkSync(join11("..", "..", ".agents", "skills", SKILL_NAME), link, "dir");
|
|
9397
|
+
return true;
|
|
9398
|
+
} catch {
|
|
9399
|
+
return false;
|
|
9400
|
+
}
|
|
9401
|
+
}
|
|
9402
|
+
var SKILL_NAME;
|
|
9403
|
+
var init_skill_symlink = __esm({
|
|
9404
|
+
"src/lib/skill-symlink.ts"() {
|
|
9405
|
+
"use strict";
|
|
9406
|
+
init_skill_version();
|
|
9407
|
+
SKILL_NAME = "wayai";
|
|
9408
|
+
}
|
|
9409
|
+
});
|
|
9410
|
+
|
|
9376
9411
|
// src/commands/status.ts
|
|
9377
9412
|
var status_exports = {};
|
|
9378
9413
|
__export(status_exports, {
|
|
@@ -9383,8 +9418,7 @@ import * as path8 from "path";
|
|
|
9383
9418
|
function parseArgs(args2) {
|
|
9384
9419
|
return { json: args2.includes("--json") };
|
|
9385
9420
|
}
|
|
9386
|
-
function buildSkillState() {
|
|
9387
|
-
const projectRoot = findGitRoot() ?? process.cwd();
|
|
9421
|
+
function buildSkillState(projectRoot) {
|
|
9388
9422
|
const installs = findInstalledSkills(projectRoot);
|
|
9389
9423
|
if (installs.length === 0) {
|
|
9390
9424
|
return { installed: false, version: null, latest: null, paths: [] };
|
|
@@ -9414,7 +9448,13 @@ async function statusCommand(args2, pkg2) {
|
|
|
9414
9448
|
const workspace = buildWorkspaceState(repoConfig);
|
|
9415
9449
|
const cachedCliLatest = readCachedLatest(CLI_CACHE_FILE);
|
|
9416
9450
|
const cliLatest = cachedCliLatest && isNewerVersion(cachedCliLatest, pkg2.version) ? cachedCliLatest : null;
|
|
9417
|
-
const
|
|
9451
|
+
const projectRoot = findGitRoot() ?? process.cwd();
|
|
9452
|
+
if (healClaudeSkillLink(projectRoot)) {
|
|
9453
|
+
console.error(
|
|
9454
|
+
"Linked .claude/skills/wayai \u2192 .agents/skills/wayai so Claude Code can load the WayAI skill."
|
|
9455
|
+
);
|
|
9456
|
+
}
|
|
9457
|
+
const skill = buildSkillState(projectRoot);
|
|
9418
9458
|
let boundHubId = null;
|
|
9419
9459
|
try {
|
|
9420
9460
|
boundHubId = readBinding();
|
|
@@ -9537,6 +9577,7 @@ var init_status = __esm({
|
|
|
9537
9577
|
init_api_client();
|
|
9538
9578
|
init_version_cache();
|
|
9539
9579
|
init_skill_version();
|
|
9580
|
+
init_skill_symlink();
|
|
9540
9581
|
init_utils();
|
|
9541
9582
|
init_report_inbox();
|
|
9542
9583
|
}
|
|
@@ -9584,20 +9625,20 @@ __export(init_exports, {
|
|
|
9584
9625
|
parseArgs: () => parseArgs3,
|
|
9585
9626
|
writeWorkspaceFiles: () => writeWorkspaceFiles
|
|
9586
9627
|
});
|
|
9587
|
-
import { existsSync as
|
|
9628
|
+
import { existsSync as existsSync9, mkdirSync as mkdirSync5, writeFileSync as writeFileSync6 } from "fs";
|
|
9588
9629
|
import path9 from "path";
|
|
9589
9630
|
function writeWorkspaceFiles(gitRoot) {
|
|
9590
9631
|
const created = [];
|
|
9591
9632
|
for (const { name, content } of SHIM_FILES) {
|
|
9592
9633
|
const filePath = path9.join(gitRoot, name);
|
|
9593
|
-
if (!
|
|
9634
|
+
if (!existsSync9(filePath)) {
|
|
9594
9635
|
writeFileSync6(filePath, content);
|
|
9595
9636
|
created.push(name);
|
|
9596
9637
|
}
|
|
9597
9638
|
}
|
|
9598
9639
|
const hubsDir = resolveLayout(gitRoot).hubsDir;
|
|
9599
|
-
if (!
|
|
9600
|
-
|
|
9640
|
+
if (!existsSync9(hubsDir)) {
|
|
9641
|
+
mkdirSync5(hubsDir, { recursive: true });
|
|
9601
9642
|
created.push(`${path9.relative(gitRoot, hubsDir)}/`);
|
|
9602
9643
|
}
|
|
9603
9644
|
return created;
|
|
@@ -18502,11 +18543,11 @@ var init_admin = __esm({
|
|
|
18502
18543
|
|
|
18503
18544
|
// src/commands/report-create.ts
|
|
18504
18545
|
import { readFileSync as readFileSync16 } from "fs";
|
|
18505
|
-
import { dirname as dirname8, join as
|
|
18546
|
+
import { dirname as dirname8, join as join24 } from "path";
|
|
18506
18547
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
18507
18548
|
function getCliVersion() {
|
|
18508
18549
|
try {
|
|
18509
|
-
const pkg2 = JSON.parse(readFileSync16(
|
|
18550
|
+
const pkg2 = JSON.parse(readFileSync16(join24(__dirname, "..", "..", "package.json"), "utf-8"));
|
|
18510
18551
|
return `cli@${pkg2.version}`;
|
|
18511
18552
|
} catch {
|
|
18512
18553
|
return "cli@unknown";
|
|
@@ -18890,7 +18931,7 @@ var init_update = __esm({
|
|
|
18890
18931
|
init_sentry();
|
|
18891
18932
|
import { readFileSync as readFileSync17 } from "fs";
|
|
18892
18933
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
18893
|
-
import { dirname as dirname9, join as
|
|
18934
|
+
import { dirname as dirname9, join as join25 } from "path";
|
|
18894
18935
|
|
|
18895
18936
|
// src/lib/errors.ts
|
|
18896
18937
|
init_api_client();
|
|
@@ -19067,7 +19108,7 @@ Run \`wayai admin skill install\` to update.`);
|
|
|
19067
19108
|
|
|
19068
19109
|
// src/index.ts
|
|
19069
19110
|
var __dirname2 = dirname9(fileURLToPath3(import.meta.url));
|
|
19070
|
-
var pkg = JSON.parse(readFileSync17(
|
|
19111
|
+
var pkg = JSON.parse(readFileSync17(join25(__dirname2, "..", "package.json"), "utf-8"));
|
|
19071
19112
|
var [, , command, ...args] = process.argv;
|
|
19072
19113
|
var isBackgroundRefresh = command === REFRESH_COMMAND;
|
|
19073
19114
|
if (!isBackgroundRefresh) initSentry(command);
|