@alwaysmeticulous/cli 2.331.2 → 2.332.0
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 +16 -0
- package/dist/commands/onboard/__tests__/install-skills.spec.js +120 -5
- package/dist/commands/onboard/__tests__/install-skills.spec.js.map +1 -1
- package/dist/commands/onboard/__tests__/print-next-steps.spec.d.ts +2 -0
- package/dist/commands/onboard/__tests__/print-next-steps.spec.d.ts.map +1 -0
- package/dist/commands/onboard/__tests__/print-next-steps.spec.js +67 -0
- package/dist/commands/onboard/__tests__/print-next-steps.spec.js.map +1 -0
- package/dist/commands/onboard/__tests__/resolve-project.spec.d.ts +2 -0
- package/dist/commands/onboard/__tests__/resolve-project.spec.d.ts.map +1 -0
- package/dist/commands/onboard/__tests__/resolve-project.spec.js +44 -0
- package/dist/commands/onboard/__tests__/resolve-project.spec.js.map +1 -0
- package/dist/commands/onboard/__tests__/safe-repo-fs.spec.js +104 -25
- package/dist/commands/onboard/__tests__/safe-repo-fs.spec.js.map +1 -1
- package/dist/commands/onboard/__tests__/skills-install-choice.spec.d.ts +2 -0
- package/dist/commands/onboard/__tests__/skills-install-choice.spec.d.ts.map +1 -0
- package/dist/commands/onboard/__tests__/skills-install-choice.spec.js +51 -0
- package/dist/commands/onboard/__tests__/skills-install-choice.spec.js.map +1 -0
- package/dist/commands/onboard/__tests__/validate-ci-yaml.spec.d.ts +2 -0
- package/dist/commands/onboard/__tests__/validate-ci-yaml.spec.d.ts.map +1 -0
- package/dist/commands/onboard/__tests__/validate-ci-yaml.spec.js +112 -0
- package/dist/commands/onboard/__tests__/validate-ci-yaml.spec.js.map +1 -0
- package/dist/commands/onboard/build-context.d.ts +1 -0
- package/dist/commands/onboard/build-context.d.ts.map +1 -1
- package/dist/commands/onboard/build-context.js +6 -6
- package/dist/commands/onboard/build-context.js.map +1 -1
- package/dist/commands/onboard/customer-agents.json +0 -1
- package/dist/commands/onboard/customer-docs.json +1 -0
- package/dist/commands/onboard/docs-urls.d.ts +2 -0
- package/dist/commands/onboard/docs-urls.d.ts.map +1 -1
- package/dist/commands/onboard/docs-urls.js +5 -3
- package/dist/commands/onboard/docs-urls.js.map +1 -1
- package/dist/commands/onboard/index.d.ts.map +1 -1
- package/dist/commands/onboard/index.js +8 -6
- package/dist/commands/onboard/index.js.map +1 -1
- package/dist/commands/onboard/launch-agent.d.ts +1 -0
- package/dist/commands/onboard/launch-agent.d.ts.map +1 -1
- package/dist/commands/onboard/launch-agent.js +26 -15
- package/dist/commands/onboard/launch-agent.js.map +1 -1
- package/dist/commands/onboard/resolve-project.d.ts +9 -1
- package/dist/commands/onboard/resolve-project.d.ts.map +1 -1
- package/dist/commands/onboard/resolve-project.js +26 -4
- package/dist/commands/onboard/resolve-project.js.map +1 -1
- package/dist/commands/onboard/safe-repo-fs.d.ts +23 -16
- package/dist/commands/onboard/safe-repo-fs.d.ts.map +1 -1
- package/dist/commands/onboard/safe-repo-fs.js +78 -36
- package/dist/commands/onboard/safe-repo-fs.js.map +1 -1
- package/dist/commands/onboard/setup-agent-integrations.d.ts +2 -1
- package/dist/commands/onboard/setup-agent-integrations.d.ts.map +1 -1
- package/dist/commands/onboard/setup-agent-integrations.js +122 -13
- package/dist/commands/onboard/setup-agent-integrations.js.map +1 -1
- package/dist/commands/onboard/templates/CLAUDE.md +22 -9
- package/dist/commands/onboard/templates/agents/ci-setup.md +28 -0
- package/dist/commands/onboard/templates/agents/recorder-installation.md +6 -0
- package/dist/commands/onboard/templates/docs/ci.ts +2 -6
- package/dist/commands/onboard/templates/docs/github-actions-v2.ts +43 -37
- package/dist/commands/onboard/templates/docs/how-to/connect-git-provider.ts +26 -0
- package/dist/commands/onboard/templates/docs/how-to/typescript-types.ts +1 -1
- package/dist/commands/onboard/templates/docs/onboarding-guide.ts +77 -356
- package/dist/commands/onboard/templates/docs/recorder-getting-started.ts +5 -2
- package/dist/commands/onboard/templates/docs/recorder-snippets/script-based-instructions/nuxtjs-instructions.ts +1 -1
- package/dist/commands/onboard/templates/docs/recorder-snippets/script-based-instructions/rsbuild-instructions.ts +1 -1
- package/dist/commands/onboard/templates/docs/recorder-snippets/script-based-instructions/vite-instructions.ts +1 -1
- package/dist/commands/onboard/templates/docs/reference/cli-commands.ts +37 -0
- package/dist/commands/onboard/validate-ci-yaml.d.ts +22 -0
- package/dist/commands/onboard/validate-ci-yaml.d.ts.map +1 -0
- package/dist/commands/onboard/validate-ci-yaml.js +113 -0
- package/dist/commands/onboard/validate-ci-yaml.js.map +1 -0
- package/package.json +14 -13
- package/dist/commands/onboard/templates/agents/local-simulation-verification.md +0 -96
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4c6969bb-ef7f-54be-b273-ff59df82ad58")}catch(e){}}();
|
|
3
3
|
|
|
4
4
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
5
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
6
|
};
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.resolveOnboardProject = void 0;
|
|
8
|
+
exports.ensureOnboardAuthenticated = exports.resolveOnboardProject = void 0;
|
|
9
9
|
const client_1 = require("@alwaysmeticulous/client");
|
|
10
10
|
const chalk_1 = __importDefault(require("chalk"));
|
|
11
11
|
const cli_user_error_1 = require("../../utils/cli-user-error");
|
|
@@ -13,12 +13,15 @@ const select_project_1 = require("../../utils/select-project");
|
|
|
13
13
|
/**
|
|
14
14
|
* Resolves which Meticulous project this onboard run is for.
|
|
15
15
|
*
|
|
16
|
+
* - Not logged in: interactive runs open a browser OAuth flow; otherwise errors.
|
|
16
17
|
* - Interactive OAuth: searchable picker (type to filter, ↑/↓ to select).
|
|
17
18
|
* - `--project` / sole accessible project / project-scoped API token: no prompt.
|
|
18
19
|
* - Non-interactive OAuth with several projects: requires `--project`.
|
|
19
|
-
* -
|
|
20
|
+
* - Project lookup failure after login: returns null and continues with local
|
|
21
|
+
* git context only.
|
|
20
22
|
*/
|
|
21
23
|
const resolveOnboardProject = async (options) => {
|
|
24
|
+
await (0, exports.ensureOnboardAuthenticated)(options.apiToken);
|
|
22
25
|
try {
|
|
23
26
|
const apiToken = await (0, client_1.resolveApiTokenWithOAuth)({
|
|
24
27
|
apiToken: options.apiToken,
|
|
@@ -51,6 +54,25 @@ const resolveOnboardProject = async (options) => {
|
|
|
51
54
|
}
|
|
52
55
|
};
|
|
53
56
|
exports.resolveOnboardProject = resolveOnboardProject;
|
|
57
|
+
/**
|
|
58
|
+
* Makes sure onboard has a token before it tries to pick a project. Interactive
|
|
59
|
+
* runs open the same browser OAuth page as `auth login`, tagged so that page
|
|
60
|
+
* does not print the agent-facing sign-in steps.
|
|
61
|
+
*/
|
|
62
|
+
const ensureOnboardAuthenticated = async (apiToken) => {
|
|
63
|
+
if (await (0, client_1.getAuthToken)(apiToken)) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (!(0, client_1.isInteractiveContext)()) {
|
|
67
|
+
throw new cli_user_error_1.CliUserError("`meticulous onboard` needs you to be logged in. Run it in an interactive " +
|
|
68
|
+
"terminal so it can open a browser, pass `--apiToken`, set " +
|
|
69
|
+
"METICULOUS_API_TOKEN, or run `meticulous auth login --device` first " +
|
|
70
|
+
"on a remote machine.");
|
|
71
|
+
}
|
|
72
|
+
console.log("Not logged in. Opening the browser to sign in to Meticulous…");
|
|
73
|
+
await (0, client_1.performOAuthLogin)({ intent: client_1.CLI_LOGIN_INTENT_ONBOARD });
|
|
74
|
+
};
|
|
75
|
+
exports.ensureOnboardAuthenticated = ensureOnboardAuthenticated;
|
|
54
76
|
const selectOAuthProjectId = async (options) => {
|
|
55
77
|
const { client, project } = options;
|
|
56
78
|
if (project) {
|
|
@@ -89,4 +111,4 @@ const promptForOnboardProject = async (client, projects) => {
|
|
|
89
111
|
});
|
|
90
112
|
};
|
|
91
113
|
//# sourceMappingURL=resolve-project.js.map
|
|
92
|
-
//# debugId=
|
|
114
|
+
//# debugId=4c6969bb-ef7f-54be-b273-ff59df82ad58
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-project.js","sources":["../../../src/commands/onboard/resolve-project.ts"],"sourceRoot":"","names":[],"mappings":";;;;;;;;AACA,
|
|
1
|
+
{"version":3,"file":"resolve-project.js","sources":["../../../src/commands/onboard/resolve-project.ts"],"sourceRoot":"","names":[],"mappings":";;;;;;;;AACA,qDAWkC;AAElC,kDAA0B;AAC1B,+DAA0D;AAC1D,+DAIoC;AAEpC;;;;;;;;;GASG;AACI,MAAM,qBAAqB,GAAG,KAAK,EAAE,OAG3C,EAA2B,EAAE;IAC5B,MAAM,IAAA,kCAA0B,EAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEnD,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,IAAA,iCAAwB,EAAC;YAC9C,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,IAAA,8BAAqB,EAAC;YACzC,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;QAEH,0DAA0D;QAC1D,IAAI,QAAQ,IAAI,CAAC,IAAA,mBAAU,EAAC,QAAQ,CAAC,EAAE,CAAC;YACtC,OAAO,MAAM,IAAA,mBAAU,EAAC,MAAM,CAAC,CAAC;QAClC,CAAC;QAED,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QAAQ,GAAG,MAAM,uBAAuB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACjE,MAAM,IAAA,+BAAsB,EAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;IAClD,OAAO,QAAQ,CAAC,EAAE,CAAC;AACrB,CAAC,CAAC;AAEF,MAAM,uBAAuB,GAAG,KAAK,EACnC,MAAwB,EACxB,QAAwB,EACD,EAAE;IACzB,MAAM,QAAQ,GAAG,MAAM,IAAA,+BAAsB,EAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC;QACjE,SAAS,EAAE,IAAqB;KACjC,CAAC,CAAC,CAAC;IAEJ,OAAO,IAAA,iCAAgB,EAAC,QAAQ,EAAE;QAChC,OAAO,EAAE,8CAA8C;QACvD,gBAAgB,EAAE,QAAQ,CAAC,SAAS;KACrC,CAAC,CAAC;AACL,CAAC,CAAC","debugId":"4c6969bb-ef7f-54be-b273-ff59df82ad58"}
|
|
@@ -35,25 +35,32 @@ export declare const isRealDirectoryInsideProject: (projectRoot: string, absolut
|
|
|
35
35
|
*/
|
|
36
36
|
export declare const SKILLS_INSTALL_DIR_ROOTS: readonly [".claude", ".agents", ".cursor"];
|
|
37
37
|
export declare const SKILLS_INSTALL_FILE_TARGETS: readonly ["skills-lock.json"];
|
|
38
|
+
export interface SkillsInstallTargets {
|
|
39
|
+
/**
|
|
40
|
+
* Symlinks at or under a dest this install will write, which we cannot
|
|
41
|
+
* replace ourselves. Non-empty means the installer must not run.
|
|
42
|
+
*/
|
|
43
|
+
blockingLinks: string[];
|
|
44
|
+
}
|
|
38
45
|
/**
|
|
39
|
-
* Rejects symlinks
|
|
46
|
+
* Rejects parent-path symlinks the installer would write through, then
|
|
40
47
|
* creates the destination directory roots as real directories inside the repo.
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
48
|
+
*
|
|
49
|
+
* `skillNames` is the exact set of skills this install will write, so the
|
|
50
|
+
* guard only looks at those dests. A link for any other skill belongs to
|
|
51
|
+
* another tool, is never written through, and is ignored.
|
|
52
|
+
*
|
|
53
|
+
* A dest we are about to write, such as `.claude/skills/meticulous-cli`, is
|
|
54
|
+
* often a leftover *link* into a cache from `skills add` without `--copy`.
|
|
55
|
+
* Unlink those (the link only, never the target) so `--copy` can write a real
|
|
56
|
+
* directory. A symlink nested inside such a dest is reported instead: the
|
|
57
|
+
* installer would write through it and it is not ours to delete.
|
|
51
58
|
*/
|
|
52
|
-
export declare const
|
|
59
|
+
export declare const prepareSafeSkillsInstallTargets: (projectRoot: string, skillNames: readonly string[]) => SkillsInstallTargets;
|
|
53
60
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
61
|
+
* Re-checks the dests this install wrote, so a TOCTOU symlink plant during the
|
|
62
|
+
* install cannot go unnoticed — including nested ones. Dests for other tools'
|
|
63
|
+
* skills are not ours to police.
|
|
57
64
|
*/
|
|
58
|
-
export declare const
|
|
65
|
+
export declare const assertSafeSkillsInstallTargets: (projectRoot: string, skillNames: readonly string[]) => void;
|
|
59
66
|
//# sourceMappingURL=safe-repo-fs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe-repo-fs.d.ts","sourceRoot":"","sources":["../../../src/commands/onboard/safe-repo-fs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"safe-repo-fs.d.ts","sourceRoot":"","sources":["../../../src/commands/onboard/safe-repo-fs.ts"],"names":[],"mappings":"AAqBA;;;GAGG;AACH,eAAO,MAAM,sBAAsB,gBAAiB,MAAM,KAAG,MAW5D,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,gBAClB,MAAM,gBACL,MAAM,KACnB,MAmDF,CAAC;AAEF,eAAO,MAAM,aAAa,gBACX,MAAM,gBACL,MAAM,KACnB,MAOF,CAAC;AAEF,eAAO,MAAM,iBAAiB,gBACf,MAAM,gBACL,MAAM,QACd,MAAM,GAAG,MAAM,CAAC,eAAe,KACpC,MAUF,CAAC;AAEF,eAAO,MAAM,gBAAgB,gBACd,MAAM,gBACL,MAAM,sBACA,MAAM,KACzB,MAQF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,gBAC1B,MAAM,gBACL,MAAM,KACnB,MAiBF,CAAC;AAMF,eAAO,MAAM,yBAAyB,iBAAkB,MAAM,KAAG,MAgBhE,CAAC;AAEF,eAAO,MAAM,gBAAgB,SAAU,MAAM,aAAa,MAAM,KAAG,OAQlE,CAAC;AAUF;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,gBAC1B,MAAM,gBACL,MAAM,KACnB,OAaF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,4CAI3B,CAAC;AAEX,eAAO,MAAM,2BAA2B,+BAAgC,CAAC;AAEzE,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,+BAA+B,gBAC7B,MAAM,cACP,SAAS,MAAM,EAAE,KAC5B,oBAgDF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,gBAC5B,MAAM,cACP,SAAS,MAAM,EAAE,KAC5B,IAoBF,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="fbfbe7af-9159-507e-bce1-4a58bf776bc3")}catch(e){}}();
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.
|
|
5
|
+
exports.assertSafeSkillsInstallTargets = exports.prepareSafeSkillsInstallTargets = exports.SKILLS_INSTALL_FILE_TARGETS = exports.SKILLS_INSTALL_DIR_ROOTS = exports.isRealDirectoryInsideProject = exports.isPathInsideRoot = exports.normalizeRelativeRepoPath = exports.assertWorkspaceInsideProject = exports.copyFileSafeSync = exports.writeFileSafeSync = exports.mkdirSafeSync = exports.resolveSafeWritePath = exports.resolveRealProjectRoot = void 0;
|
|
6
6
|
const fs_1 = require("fs");
|
|
7
7
|
const path_1 = require("path");
|
|
8
8
|
const cli_user_error_1 = require("../../utils/cli-user-error");
|
|
@@ -188,14 +188,20 @@ exports.SKILLS_INSTALL_DIR_ROOTS = [
|
|
|
188
188
|
];
|
|
189
189
|
exports.SKILLS_INSTALL_FILE_TARGETS = ["skills-lock.json"];
|
|
190
190
|
/**
|
|
191
|
-
* Rejects symlinks
|
|
191
|
+
* Rejects parent-path symlinks the installer would write through, then
|
|
192
192
|
* creates the destination directory roots as real directories inside the repo.
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
193
|
+
*
|
|
194
|
+
* `skillNames` is the exact set of skills this install will write, so the
|
|
195
|
+
* guard only looks at those dests. A link for any other skill belongs to
|
|
196
|
+
* another tool, is never written through, and is ignored.
|
|
197
|
+
*
|
|
198
|
+
* A dest we are about to write, such as `.claude/skills/meticulous-cli`, is
|
|
199
|
+
* often a leftover *link* into a cache from `skills add` without `--copy`.
|
|
200
|
+
* Unlink those (the link only, never the target) so `--copy` can write a real
|
|
201
|
+
* directory. A symlink nested inside such a dest is reported instead: the
|
|
202
|
+
* installer would write through it and it is not ours to delete.
|
|
197
203
|
*/
|
|
198
|
-
const prepareSafeSkillsInstallTargets = (projectRoot) => {
|
|
204
|
+
const prepareSafeSkillsInstallTargets = (projectRoot, skillNames) => {
|
|
199
205
|
for (const file of exports.SKILLS_INSTALL_FILE_TARGETS) {
|
|
200
206
|
// Throws if the path (or any parent component) is a symlink.
|
|
201
207
|
(0, exports.resolveSafeWritePath)(projectRoot, file);
|
|
@@ -204,15 +210,41 @@ const prepareSafeSkillsInstallTargets = (projectRoot) => {
|
|
|
204
210
|
(0, exports.mkdirSafeSync)(projectRoot, dir);
|
|
205
211
|
(0, exports.mkdirSafeSync)(projectRoot, (0, path_1.join)(dir, "skills"));
|
|
206
212
|
}
|
|
207
|
-
|
|
213
|
+
const replaceable = [];
|
|
214
|
+
const blockingLinks = [];
|
|
215
|
+
for (const dest of skillDestPaths(projectRoot, skillNames)) {
|
|
216
|
+
const stat = tryLstat(dest.absolutePath);
|
|
217
|
+
if (!stat) {
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
if (stat.isSymbolicLink()) {
|
|
221
|
+
replaceable.push(dest.relativeDisplay);
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
if (stat.isDirectory()) {
|
|
225
|
+
collectSymlinksUnderDirectory(dest.absolutePath, dest.relativeDisplay, blockingLinks);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
if (blockingLinks.length > 0) {
|
|
229
|
+
// The installer will not run, so leave the leftover links as they are.
|
|
230
|
+
return { blockingLinks };
|
|
231
|
+
}
|
|
232
|
+
const realRoot = (0, exports.resolveRealProjectRoot)(projectRoot);
|
|
233
|
+
for (const relative of replaceable) {
|
|
234
|
+
(0, fs_1.unlinkSync)((0, path_1.join)(realRoot, relative));
|
|
235
|
+
}
|
|
236
|
+
if (replaceable.length > 0) {
|
|
237
|
+
console.log(` Replaced leftover Meticulous skill link(s) so they can be copied into the repo: ${replaceable.join(", ")}`);
|
|
238
|
+
}
|
|
239
|
+
return { blockingLinks: [] };
|
|
208
240
|
};
|
|
209
241
|
exports.prepareSafeSkillsInstallTargets = prepareSafeSkillsInstallTargets;
|
|
210
242
|
/**
|
|
211
|
-
* Re-checks
|
|
212
|
-
*
|
|
213
|
-
*
|
|
243
|
+
* Re-checks the dests this install wrote, so a TOCTOU symlink plant during the
|
|
244
|
+
* install cannot go unnoticed — including nested ones. Dests for other tools'
|
|
245
|
+
* skills are not ours to police.
|
|
214
246
|
*/
|
|
215
|
-
const assertSafeSkillsInstallTargets = (projectRoot) => {
|
|
247
|
+
const assertSafeSkillsInstallTargets = (projectRoot, skillNames) => {
|
|
216
248
|
for (const file of exports.SKILLS_INSTALL_FILE_TARGETS) {
|
|
217
249
|
(0, exports.resolveSafeWritePath)(projectRoot, file);
|
|
218
250
|
}
|
|
@@ -220,47 +252,57 @@ const assertSafeSkillsInstallTargets = (projectRoot) => {
|
|
|
220
252
|
(0, exports.resolveSafeWritePath)(projectRoot, dir);
|
|
221
253
|
(0, exports.resolveSafeWritePath)(projectRoot, (0, path_1.join)(dir, "skills"));
|
|
222
254
|
}
|
|
223
|
-
|
|
255
|
+
const found = [];
|
|
256
|
+
for (const dest of skillDestPaths(projectRoot, skillNames)) {
|
|
257
|
+
collectSymlinksAtPath(dest.absolutePath, dest.relativeDisplay, found);
|
|
258
|
+
}
|
|
259
|
+
const [first] = found;
|
|
260
|
+
if (first !== undefined) {
|
|
261
|
+
throw new cli_user_error_1.CliUserError(`Refusing to write through symlink at '${first}'. ` +
|
|
262
|
+
`Remove or replace it, then re-run \`meticulous onboard\`.`);
|
|
263
|
+
}
|
|
224
264
|
};
|
|
225
265
|
exports.assertSafeSkillsInstallTargets = assertSafeSkillsInstallTargets;
|
|
226
|
-
/**
|
|
227
|
-
|
|
228
|
-
* and `.cursor/skills`. Matches `resolveSafeWritePath`: any symlink is refused,
|
|
229
|
-
* not only ones that currently resolve outside the repo.
|
|
230
|
-
*/
|
|
231
|
-
const assertNoSymlinksUnderSkillsTrees = (projectRoot) => {
|
|
266
|
+
/** Where each named skill lands, under every agent's skills directory. */
|
|
267
|
+
const skillDestPaths = (projectRoot, skillNames) => {
|
|
232
268
|
const realRoot = (0, exports.resolveRealProjectRoot)(projectRoot);
|
|
269
|
+
const dests = [];
|
|
233
270
|
for (const dir of exports.SKILLS_INSTALL_DIR_ROOTS) {
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
|
|
271
|
+
for (const name of skillNames) {
|
|
272
|
+
dests.push({
|
|
273
|
+
absolutePath: (0, path_1.join)(realRoot, dir, "skills", name),
|
|
274
|
+
relativeDisplay: `${dir}/skills/${name}`,
|
|
275
|
+
});
|
|
276
|
+
}
|
|
237
277
|
}
|
|
278
|
+
return dests;
|
|
238
279
|
};
|
|
239
|
-
|
|
240
|
-
const
|
|
241
|
-
|
|
242
|
-
if (!dirStat) {
|
|
280
|
+
const collectSymlinksAtPath = (absolutePath, relativeDisplay, found) => {
|
|
281
|
+
const stat = tryLstat(absolutePath);
|
|
282
|
+
if (!stat) {
|
|
243
283
|
return;
|
|
244
284
|
}
|
|
245
|
-
if (
|
|
246
|
-
|
|
247
|
-
`Remove or replace it, then re-run \`meticulous onboard\`.`);
|
|
248
|
-
}
|
|
249
|
-
if (!dirStat.isDirectory()) {
|
|
285
|
+
if (stat.isSymbolicLink()) {
|
|
286
|
+
found.push(relativeDisplay);
|
|
250
287
|
return;
|
|
251
288
|
}
|
|
289
|
+
if (stat.isDirectory()) {
|
|
290
|
+
collectSymlinksUnderDirectory(absolutePath, relativeDisplay, found);
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
const collectSymlinksUnderDirectory = (absoluteDir, relativeDisplay, found) => {
|
|
252
294
|
for (const entry of (0, fs_1.readdirSync)(absoluteDir, { withFileTypes: true })) {
|
|
253
295
|
const childRelative = `${relativeDisplay}/${entry.name}`;
|
|
254
296
|
// Check symlink before isDirectory(): a symlink-to-dir can report as both
|
|
255
297
|
// depending on platform / Node version.
|
|
256
298
|
if (entry.isSymbolicLink()) {
|
|
257
|
-
|
|
258
|
-
|
|
299
|
+
found.push(childRelative);
|
|
300
|
+
continue;
|
|
259
301
|
}
|
|
260
302
|
if (entry.isDirectory()) {
|
|
261
|
-
|
|
303
|
+
collectSymlinksUnderDirectory((0, path_1.join)(absoluteDir, entry.name), childRelative, found);
|
|
262
304
|
}
|
|
263
305
|
}
|
|
264
306
|
};
|
|
265
307
|
//# sourceMappingURL=safe-repo-fs.js.map
|
|
266
|
-
//# debugId=
|
|
308
|
+
//# debugId=fbfbe7af-9159-507e-bce1-4a58bf776bc3
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe-repo-fs.js","sources":["../../../src/commands/onboard/safe-repo-fs.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"safe-repo-fs.js","sources":["../../../src/commands/onboard/safe-repo-fs.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAA,2BASY;AACZ,+BAQc;AACd,+DAA0D;AAE1D;;;GAGG;AACI,MAAM,sBAAsB,GAAG,CAAC,WAAmB,EAAU,EAAE;IACpE,MAAM,QAAQ,GAAG,IAAA,cAAO,EAAC,WAAW,CAAC,CAAC;IACtC,IAAI,CAAC,IAAA,eAAU,EAAC,QAAQ,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,6BAAY,CAAC,gCAAgC,QAAQ,EAAE,CAAC,CAAC;IACrE,CAAC;IACD,MAAM,IAAI,GAAG,IAAA,cAAS,EAAC,QAAQ,CAAC,CAAC;IACjC,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;QAC1B,0EAA0E;QAC1E,0CAA0C;IAC5C,CAAC;IACD,OAAO,IAAA,iBAAY,EAAC,QAAQ,CAAC,CAAC;AAChC,CAAC,CAAC;AAXW,QAAA,sBAAsB,0BAWjC;AAEF;;;;;;;GAOG;AACI,MAAM,oBAAoB,GAAG,CAClC,WAAmB,EACnB,YAAoB,EACZ,EAAE;IACV,MAAM,QAAQ,GAAG,IAAA,8BAAsB,EAAC,WAAW,CAA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a,GAAG,GAAG,eAAe,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;QACzD,0EAA0E;QAC1E,wCAAwC;QACxC,IAAI,KAAK,CAAC,cAAc,EAAE,EAAE,CAAC;YAC3B,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YAC1B,SAAS;QACX,CAAC;QACD,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,6BAA6B,CAC3B,IAAA,WAAI,EAAC,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC,EAC7B,aAAa,EACb,KAAK,CACN,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC,CAAC","debugId":"fbfbe7af-9159-507e-bce1-4a58bf776bc3"}
|
|
@@ -10,7 +10,8 @@ export declare const SKILLS_ADD_ARGS: readonly ["add", "alwaysmeticulous/skills"
|
|
|
10
10
|
export declare const AGENT_INTEGRATION_PATHS: readonly [".claude/skills/", ".agents/skills/", ".cursor/skills/", "skills-lock.json", ".mcp.json", ".cursor/mcp.json", ".codex/config.toml"];
|
|
11
11
|
export declare const setupAgentIntegrations: (options: {
|
|
12
12
|
projectRoot: string;
|
|
13
|
-
}) => string[]
|
|
13
|
+
}) => Promise<string[]>;
|
|
14
|
+
export declare const confirmSkillsInstall: () => Promise<boolean>;
|
|
14
15
|
export declare const installSkills: (projectRoot: string) => boolean;
|
|
15
16
|
/**
|
|
16
17
|
* Drops env vars that can redirect Node/npm resolution or inject code into
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-agent-integrations.d.ts","sourceRoot":"","sources":["../../../src/commands/onboard/setup-agent-integrations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setup-agent-integrations.d.ts","sourceRoot":"","sources":["../../../src/commands/onboard/setup-agent-integrations.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,kBAAkB,sCAAsC,CAAC;AAEtE;;;GAGG;AACH,eAAO,MAAM,uBAAuB,kBAAkB,CAAC;AAEvD,oEAAoE;AACpE,eAAO,MAAM,eAAe,gJAalB,CAAC;AAEX,iFAAiF;AACjF,eAAO,MAAM,uBAAuB,+IAQ1B,CAAC;AAEX,eAAO,MAAM,sBAAsB,YAAmB;IACpD,WAAW,EAAE,MAAM,CAAC;CACrB,KAAG,OAAO,CAAC,MAAM,EAAE,CAwBnB,CAAC;AAEF,eAAO,MAAM,oBAAoB,QAAa,OAAO,CAAC,OAAO,CA6B5D,CAAC;AAEF,eAAO,MAAM,aAAa,gBAAiB,MAAM,KAAG,OAoEnD,CAAC;AAmGF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,wBAAwB,QAC9B,MAAM,CAAC,UAAU,KACrB,MAAM,CAAC,UAyBT,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,QAAO;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;CA6CrB,CAAC;AA+BF,iFAAiF;AACjF,eAAO,MAAM,gBAAgB,gBAAiB,MAAM,KAAG,IAkDtD,CAAC;AAuFF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,aACxB,OAAO,YACP,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAChC,OAcF,CAAC"}
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5baae447-1bf5-5010-a094-6f07a00f2bf7")}catch(e){}}();
|
|
3
3
|
|
|
4
4
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
5
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
6
|
};
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.isExactJsonServerConfig = exports.ensureProjectMcp = exports.materializeTrustedSkillsCli = exports.sanitizeSkillsInstallEnv = exports.installSkills = exports.setupAgentIntegrations = exports.AGENT_INTEGRATION_PATHS = exports.SKILLS_ADD_ARGS = exports.SKILLS_CLI_PACKAGE_SPEC = exports.METICULOUS_MCP_URL = void 0;
|
|
8
|
+
exports.isExactJsonServerConfig = exports.ensureProjectMcp = exports.materializeTrustedSkillsCli = exports.sanitizeSkillsInstallEnv = exports.installSkills = exports.confirmSkillsInstall = exports.setupAgentIntegrations = exports.AGENT_INTEGRATION_PATHS = exports.SKILLS_ADD_ARGS = exports.SKILLS_CLI_PACKAGE_SPEC = exports.METICULOUS_MCP_URL = void 0;
|
|
9
9
|
const child_process_1 = require("child_process");
|
|
10
10
|
const fs_1 = require("fs");
|
|
11
11
|
const os_1 = require("os");
|
|
12
12
|
const path_1 = require("path");
|
|
13
|
+
const client_1 = require("@alwaysmeticulous/client");
|
|
13
14
|
const chalk_1 = __importDefault(require("chalk"));
|
|
15
|
+
const inquirer_1 = __importDefault(require("inquirer"));
|
|
14
16
|
const cli_user_error_1 = require("../../utils/cli-user-error");
|
|
15
17
|
const codex_mcp_1 = require("./codex-mcp");
|
|
18
|
+
const docs_urls_1 = require("./docs-urls");
|
|
16
19
|
const safe_repo_fs_1 = require("./safe-repo-fs");
|
|
17
20
|
exports.METICULOUS_MCP_URL = "https://app.meticulous.ai/api/mcp";
|
|
18
21
|
/**
|
|
@@ -45,11 +48,12 @@ exports.AGENT_INTEGRATION_PATHS = [
|
|
|
45
48
|
".cursor/mcp.json",
|
|
46
49
|
".codex/config.toml",
|
|
47
50
|
];
|
|
48
|
-
const setupAgentIntegrations = (options) => {
|
|
51
|
+
const setupAgentIntegrations = async (options) => {
|
|
49
52
|
console.log(chalk_1.default.bold("Setting up Meticulous agent integrations…"));
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
const installMeticulousSkills = await (0, exports.confirmSkillsInstall)();
|
|
54
|
+
const skillsInstalled = installMeticulousSkills
|
|
55
|
+
? (0, exports.installSkills)(options.projectRoot)
|
|
56
|
+
: false;
|
|
53
57
|
installProjectMcp(options.projectRoot);
|
|
54
58
|
const created = listExistingIntegrationPaths(options.projectRoot, skillsInstalled);
|
|
55
59
|
if (created.length > 0) {
|
|
@@ -61,20 +65,47 @@ const setupAgentIntegrations = (options) => {
|
|
|
61
65
|
return created;
|
|
62
66
|
};
|
|
63
67
|
exports.setupAgentIntegrations = setupAgentIntegrations;
|
|
68
|
+
const confirmSkillsInstall = async () => {
|
|
69
|
+
// Preserve existing behavior for headless/automated onboard runs, where
|
|
70
|
+
// there is no terminal in which to ask the user.
|
|
71
|
+
if (!(0, client_1.isInteractiveContext)()) {
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
console.log(" Meticulous skills allow coding agents to interact with Meticulous and run common workflows.");
|
|
75
|
+
console.log(` Learn more: ${chalk_1.default.cyan(docs_urls_1.AGENTS_SETUP_DOCS_URL)}`);
|
|
76
|
+
console.log(chalk_1.default.dim(" This is optional and does not change the onboarding agent or its prompt."));
|
|
77
|
+
const { installSkills: shouldInstallSkills } = await inquirer_1.default.prompt([
|
|
78
|
+
{
|
|
79
|
+
type: "confirm",
|
|
80
|
+
name: "installSkills",
|
|
81
|
+
message: "Download Meticulous skills into this repository?",
|
|
82
|
+
default: true,
|
|
83
|
+
},
|
|
84
|
+
]);
|
|
85
|
+
console.log("");
|
|
86
|
+
return shouldInstallSkills;
|
|
87
|
+
};
|
|
88
|
+
exports.confirmSkillsInstall = confirmSkillsInstall;
|
|
64
89
|
const installSkills = (projectRoot) => {
|
|
65
|
-
// Reject repo-seeded symlinks on every path the skills installer may write
|
|
66
|
-
// (`.claude`, `.agents`, `.cursor`, `skills-lock.json`), then create those
|
|
67
|
-
// directory roots as real dirs before handing control to the installer.
|
|
68
|
-
(0, safe_repo_fs_1.prepareSafeSkillsInstallTargets)(projectRoot);
|
|
69
90
|
// Never `npx skills` with cwd=projectRoot: npx prefers a repo-local
|
|
70
91
|
// `node_modules/.bin/skills` (or a `file:` dependency) over the registry,
|
|
71
92
|
// so an untrusted repo could run arbitrary code before any agent sandbox.
|
|
72
93
|
// Materialize the registry CLI into a throwaway prefix, then invoke it by
|
|
73
94
|
// absolute path via `node`.
|
|
74
95
|
let trustedCli = null;
|
|
96
|
+
let skillNames;
|
|
75
97
|
let result;
|
|
76
98
|
try {
|
|
77
99
|
trustedCli = (0, exports.materializeTrustedSkillsCli)();
|
|
100
|
+
skillNames = discoverSkillNames(trustedCli.cliEntry);
|
|
101
|
+
// Reject repo-seeded symlinks on every path this install will write
|
|
102
|
+
// (`.claude`, `.agents`, `.cursor`, `skills-lock.json`), then create those
|
|
103
|
+
// directory roots as real dirs before handing control to the installer.
|
|
104
|
+
const { blockingLinks } = (0, safe_repo_fs_1.prepareSafeSkillsInstallTargets)(projectRoot, skillNames);
|
|
105
|
+
if (blockingLinks.length > 0) {
|
|
106
|
+
reportSkippedSkillsInstall(blockingLinks);
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
78
109
|
result = (0, child_process_1.spawnSync)(process.execPath, [trustedCli.cliEntry, ...exports.SKILLS_ADD_ARGS], {
|
|
79
110
|
cwd: projectRoot,
|
|
80
111
|
stdio: "inherit",
|
|
@@ -82,10 +113,12 @@ const installSkills = (projectRoot) => {
|
|
|
82
113
|
});
|
|
83
114
|
}
|
|
84
115
|
catch (error) {
|
|
116
|
+
if (error instanceof cli_user_error_1.CliUserError) {
|
|
117
|
+
throw error;
|
|
118
|
+
}
|
|
85
119
|
const detail = error instanceof Error ? `: ${error.message}` : `: ${String(error)}`;
|
|
86
120
|
console.log(chalk_1.default.yellow(` Could not install Meticulous skills${detail}. Continuing without them.`));
|
|
87
121
|
console.log(chalk_1.default.dim(` Retry: ${skillsInstallRetryHint(projectRoot)}`));
|
|
88
|
-
(0, safe_repo_fs_1.assertSafeSkillsInstallTargets)(projectRoot);
|
|
89
122
|
return false;
|
|
90
123
|
}
|
|
91
124
|
finally {
|
|
@@ -93,7 +126,7 @@ const installSkills = (projectRoot) => {
|
|
|
93
126
|
}
|
|
94
127
|
// Always re-check after the installer — a failed or partial install can
|
|
95
128
|
// still plant a symlink escape on a destination we pre-created.
|
|
96
|
-
(0, safe_repo_fs_1.assertSafeSkillsInstallTargets)(projectRoot);
|
|
129
|
+
(0, safe_repo_fs_1.assertSafeSkillsInstallTargets)(projectRoot, skillNames);
|
|
97
130
|
if (result.error || result.status !== 0) {
|
|
98
131
|
const detail = result.error ? `: ${result.error.message}` : "";
|
|
99
132
|
console.log(chalk_1.default.yellow(` Could not install Meticulous skills${detail}. Continuing without them.`));
|
|
@@ -104,6 +137,82 @@ const installSkills = (projectRoot) => {
|
|
|
104
137
|
return true;
|
|
105
138
|
};
|
|
106
139
|
exports.installSkills = installSkills;
|
|
140
|
+
const reportSkippedSkillsInstall = (blockingLinks) => {
|
|
141
|
+
console.log(chalk_1.default.yellow(" Skipping Meticulous skills install — onboard will not write through " +
|
|
142
|
+
`these symlinks:\n${blockingLinks
|
|
143
|
+
.map((link) => ` - ${link}`)
|
|
144
|
+
.join("\n")}`));
|
|
145
|
+
console.log(chalk_1.default.dim(" Remove or replace them and re-run `meticulous onboard` to install the skills."));
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* Names of the skills the real install will write, found by installing into a
|
|
149
|
+
* throwaway directory first. Every dest outside this set belongs to another
|
|
150
|
+
* tool, so onboard neither touches it nor lets it block the install.
|
|
151
|
+
*/
|
|
152
|
+
const discoverSkillNames = (cliEntry) => {
|
|
153
|
+
const stagingDir = (0, fs_1.mkdtempSync)((0, path_1.join)((0, os_1.tmpdir)(), "meticulous-skills-list-"));
|
|
154
|
+
try {
|
|
155
|
+
const result = (0, child_process_1.spawnSync)(process.execPath, [cliEntry, ...exports.SKILLS_ADD_ARGS], {
|
|
156
|
+
cwd: stagingDir,
|
|
157
|
+
encoding: "utf8",
|
|
158
|
+
env: (0, exports.sanitizeSkillsInstallEnv)(process.env),
|
|
159
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
160
|
+
});
|
|
161
|
+
if (result.error || result.status !== 0) {
|
|
162
|
+
const stderr = (result.stderr ?? "").toString().trim();
|
|
163
|
+
throw new Error(result.error?.message ??
|
|
164
|
+
(stderr.length > 0 ? stderr : `skills add exited ${result.status}`));
|
|
165
|
+
}
|
|
166
|
+
const names = collectStagedSkillNames(stagingDir);
|
|
167
|
+
if (names.length === 0) {
|
|
168
|
+
// Carrying on with an empty list would silently disable every guard
|
|
169
|
+
// below while the real install still writes.
|
|
170
|
+
throw new Error("the skills CLI staged no skills, so onboard cannot tell which paths it would write");
|
|
171
|
+
}
|
|
172
|
+
return names;
|
|
173
|
+
}
|
|
174
|
+
finally {
|
|
175
|
+
(0, fs_1.rmSync)(stagingDir, { recursive: true, force: true });
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* Skill names in a staging directory. Read from every agent root and from the
|
|
180
|
+
* lockfile, since which roots the CLI writes depends on the agents it detects.
|
|
181
|
+
*/
|
|
182
|
+
const collectStagedSkillNames = (stagingDir) => {
|
|
183
|
+
const names = new Set();
|
|
184
|
+
for (const dir of safe_repo_fs_1.SKILLS_INSTALL_DIR_ROOTS) {
|
|
185
|
+
const stagedSkills = (0, path_1.join)(stagingDir, dir, "skills");
|
|
186
|
+
if (!(0, fs_1.existsSync)(stagedSkills)) {
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
for (const entry of (0, fs_1.readdirSync)(stagedSkills, { withFileTypes: true })) {
|
|
190
|
+
if (entry.isDirectory()) {
|
|
191
|
+
names.add(entry.name);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
for (const name of readStagedLockSkillNames(stagingDir)) {
|
|
196
|
+
names.add(name);
|
|
197
|
+
}
|
|
198
|
+
return [...names];
|
|
199
|
+
};
|
|
200
|
+
const readStagedLockSkillNames = (stagingDir) => {
|
|
201
|
+
const lockPath = (0, path_1.join)(stagingDir, "skills-lock.json");
|
|
202
|
+
if (!(0, fs_1.existsSync)(lockPath)) {
|
|
203
|
+
return [];
|
|
204
|
+
}
|
|
205
|
+
try {
|
|
206
|
+
const parsed = JSON.parse((0, fs_1.readFileSync)(lockPath, "utf8"));
|
|
207
|
+
const skills = parsed?.skills;
|
|
208
|
+
return typeof skills === "object" && skills !== null
|
|
209
|
+
? Object.keys(skills)
|
|
210
|
+
: [];
|
|
211
|
+
}
|
|
212
|
+
catch {
|
|
213
|
+
return [];
|
|
214
|
+
}
|
|
215
|
+
};
|
|
107
216
|
/** Matches a `node_modules/.bin` PATH entry, on either path separator. */
|
|
108
217
|
const isPackageBinPathEntry = (entry) => /(?:^|[\\/])node_modules[\\/]\.bin[\\/]?$/u.test(entry.trim());
|
|
109
218
|
/**
|
|
@@ -321,4 +430,4 @@ const isExactJsonServerConfig = (existing, expected) => {
|
|
|
321
430
|
};
|
|
322
431
|
exports.isExactJsonServerConfig = isExactJsonServerConfig;
|
|
323
432
|
//# sourceMappingURL=setup-agent-integrations.js.map
|
|
324
|
-
//# debugId=
|
|
433
|
+
//# debugId=5baae447-1bf5-5010-a094-6f07a00f2bf7
|