@g3nomaly/skills 1.0.1 → 1.0.2
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/cli/adapter.d.ts +42 -8
- package/dist/cli/adapter.d.ts.map +1 -1
- package/dist/cli/adapter.js +37 -7
- package/dist/cli/adapter.js.map +1 -1
- package/dist/cli/commands/add.d.ts +10 -1
- package/dist/cli/commands/add.d.ts.map +1 -1
- package/dist/cli/commands/add.js +5 -1
- package/dist/cli/commands/add.js.map +1 -1
- package/dist/cli/commands/init.d.ts +25 -2
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +31 -1
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/ls.d.ts +12 -3
- package/dist/cli/commands/ls.d.ts.map +1 -1
- package/dist/cli/commands/ls.js +6 -1
- package/dist/cli/commands/ls.js.map +1 -1
- package/dist/cli/commands/remove.d.ts +10 -1
- package/dist/cli/commands/remove.d.ts.map +1 -1
- package/dist/cli/commands/remove.js +5 -1
- package/dist/cli/commands/remove.js.map +1 -1
- package/dist/cli/commands/source.d.ts +35 -6
- package/dist/cli/commands/source.d.ts.map +1 -1
- package/dist/cli/commands/source.js +22 -4
- package/dist/cli/commands/source.js.map +1 -1
- package/dist/cli/commands/update.d.ts +10 -1
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/commands/update.js +5 -1
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/index.js +6 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/packages/install.d.ts +9 -4
- package/dist/packages/install.d.ts.map +1 -1
- package/dist/packages/install.js +3 -2
- package/dist/packages/install.js.map +1 -1
- package/dist/registry/locate.d.ts +15 -4
- package/dist/registry/locate.d.ts.map +1 -1
- package/dist/registry/locate.js +10 -3
- package/dist/registry/locate.js.map +1 -1
- package/dist/registry/manifest.d.ts +2 -1
- package/dist/registry/manifest.d.ts.map +1 -1
- package/dist/registry/manifest.js +2 -1
- package/dist/registry/manifest.js.map +1 -1
- package/dist/registry/readSkillDir.d.ts +2 -1
- package/dist/registry/readSkillDir.d.ts.map +1 -1
- package/dist/registry/readSkillDir.js +8 -3
- package/dist/registry/readSkillDir.js.map +1 -1
- package/dist/registry/readSource.d.ts +4 -1
- package/dist/registry/readSource.d.ts.map +1 -1
- package/dist/registry/readSource.js +4 -1
- package/dist/registry/readSource.js.map +1 -1
- package/dist/registry/types.d.ts +11 -0
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/registry/types.js +0 -5
- package/dist/registry/types.js.map +1 -1
- package/dist/utils/frontmatter.d.ts +3 -1
- package/dist/utils/frontmatter.d.ts.map +1 -1
- package/dist/utils/frontmatter.js +3 -1
- package/dist/utils/frontmatter.js.map +1 -1
- package/package.json +2 -2
package/dist/cli/adapter.d.ts
CHANGED
|
@@ -4,30 +4,64 @@ import type { InstallCommandContext, ManifestTarget } from "@g3nomaly/core/cli";
|
|
|
4
4
|
import type { SourceRegistry } from "@g3nomaly/core/installer";
|
|
5
5
|
import type { RegisteredSource } from "@g3nomaly/core/sources";
|
|
6
6
|
import type { SkillMeta, SkillRegistry } from "../registry/types";
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* @brief Injection point for tests; the real project root comes from git discovery.
|
|
9
|
+
*
|
|
10
|
+
* @property resolveProjectRoot - Replaces git discovery, e.g. `() => "/tmp/project"`.
|
|
11
|
+
*/
|
|
8
12
|
export interface ProjectDeps {
|
|
9
13
|
resolveProjectRoot?: typeof resolveProjectRoot;
|
|
10
14
|
}
|
|
11
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* @brief Anchors the command to the git project and loads its config; exits when outside a repo.
|
|
17
|
+
*
|
|
18
|
+
* @param deps - Test injection; the default discovers the project from git.
|
|
19
|
+
* @returns The project root and its loaded config.
|
|
20
|
+
*/
|
|
12
21
|
export declare function openSkillProject(deps?: ProjectDeps): Promise<{
|
|
13
22
|
projectRoot: string;
|
|
14
23
|
config: G3nConfig;
|
|
15
24
|
}>;
|
|
16
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* @brief One target per configured harness, narrowed to `only` when given; exits on an unreadable `skills.json`.
|
|
27
|
+
*
|
|
28
|
+
* @param config - Loaded g3n config holding the configured harnesses.
|
|
29
|
+
* @param projectRoot - Absolute project root the install directories are relative to.
|
|
30
|
+
* @param only - Harness names to narrow to, e.g. `["claude"]`; every configured target when absent or empty.
|
|
31
|
+
* @returns One target per harness, each with its install directory and manifest.
|
|
32
|
+
*/
|
|
17
33
|
export declare function skillTargets(config: G3nConfig, projectRoot: string, only?: string[]): ManifestTarget[];
|
|
18
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* @brief Built-in sources plus those registered in any of the targets' `skills.json`.
|
|
36
|
+
*
|
|
37
|
+
* @param targets - Targets whose manifests are read.
|
|
38
|
+
* @returns The sources, built-in ones first.
|
|
39
|
+
*/
|
|
19
40
|
export declare function skillSources(targets: readonly ManifestTarget[]): RegisteredSource[];
|
|
20
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* @brief Installed skills of one target.
|
|
43
|
+
*
|
|
44
|
+
* @param target - Target whose `skills.json` is read.
|
|
45
|
+
* @returns The installed skills keyed by skill key.
|
|
46
|
+
*/
|
|
21
47
|
export declare function installedSkills(target: ManifestTarget): SkillRegistry;
|
|
22
48
|
/** What the core install and source commands print and check for skills. */
|
|
23
49
|
export declare const SKILL_CONTEXT: InstallCommandContext<SkillMeta>;
|
|
24
50
|
/**
|
|
25
|
-
* Reads the skills of the targets' sources, or only those of `only`, and
|
|
51
|
+
* @brief Reads the skills of the targets' sources, or only those of `only`, and
|
|
26
52
|
* prints what could not be read; the caller disposes the result.
|
|
27
53
|
*
|
|
28
|
-
* @param
|
|
54
|
+
* @param targets - Targets whose sources are read.
|
|
55
|
+
* @param projectRoot - Absolute project root the sources are checked out under.
|
|
56
|
+
* @param only - Source name to read alone; exits when no such source is registered.
|
|
57
|
+
* @returns The skills per source; dispose it once read.
|
|
29
58
|
*/
|
|
30
59
|
export declare function openSkillRegistry(targets: readonly ManifestTarget[], projectRoot: string, only?: string): Promise<SourceRegistry<SkillMeta>>;
|
|
31
|
-
/**
|
|
60
|
+
/**
|
|
61
|
+
* @brief Installs the packages of the given skills in one target and prints each failure; sets exit code 1 on any.
|
|
62
|
+
*
|
|
63
|
+
* @param target - Target whose install directory holds the skills.
|
|
64
|
+
* @param keys - Skill keys to install, e.g. `["emphasise"]`.
|
|
65
|
+
*/
|
|
32
66
|
export declare function installPackagesReporting(target: ManifestTarget, keys: readonly string[]): Promise<void>;
|
|
33
67
|
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/cli/adapter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiC,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEhF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAI/D,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIlE
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/cli/adapter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiC,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEhF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAI/D,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIlE;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,kBAAkB,CAAC,EAAE,OAAO,kBAAkB,CAAC;CAChD;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,SAAS,CAAA;CAAE,CAAC,CAOlH;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,CAWtG;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,GAAG,gBAAgB,EAAE,CAEnF;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,aAAa,CAErE;AAED,4EAA4E;AAC5E,eAAO,MAAM,aAAa,EAAE,qBAAqB,CAAC,SAAS,CAAsE,CAAC;AAElI;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAIlJ;AAED;;;;;GAKG;AACH,wBAAsB,wBAAwB,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAM7G"}
|
package/dist/cli/adapter.js
CHANGED
|
@@ -8,7 +8,12 @@ import { readSkillSource } from "../registry/readSource";
|
|
|
8
8
|
import { SkillMetaSchema } from "../registry/types";
|
|
9
9
|
import { installSkillPackages } from "../packages/install";
|
|
10
10
|
import { BUILTIN_SOURCES } from "../sources/builtins";
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* @brief Anchors the command to the git project and loads its config; exits when outside a repo.
|
|
13
|
+
*
|
|
14
|
+
* @param deps - Test injection; the default discovers the project from git.
|
|
15
|
+
* @returns The project root and its loaded config.
|
|
16
|
+
*/
|
|
12
17
|
export async function openSkillProject(deps = {}) {
|
|
13
18
|
const projectRoot = (deps.resolveProjectRoot ?? resolveProjectRoot)();
|
|
14
19
|
if (projectRoot === null) {
|
|
@@ -17,7 +22,14 @@ export async function openSkillProject(deps = {}) {
|
|
|
17
22
|
}
|
|
18
23
|
return { projectRoot, config: await loadConfig(projectRoot) };
|
|
19
24
|
}
|
|
20
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* @brief One target per configured harness, narrowed to `only` when given; exits on an unreadable `skills.json`.
|
|
27
|
+
*
|
|
28
|
+
* @param config - Loaded g3n config holding the configured harnesses.
|
|
29
|
+
* @param projectRoot - Absolute project root the install directories are relative to.
|
|
30
|
+
* @param only - Harness names to narrow to, e.g. `["claude"]`; every configured target when absent or empty.
|
|
31
|
+
* @returns One target per harness, each with its install directory and manifest.
|
|
32
|
+
*/
|
|
21
33
|
export function skillTargets(config, projectRoot, only) {
|
|
22
34
|
const settings = config.skills.settings;
|
|
23
35
|
const wanted = only === undefined || only.length === 0
|
|
@@ -29,28 +41,46 @@ export function skillTargets(config, projectRoot, only) {
|
|
|
29
41
|
return { label: target, installDir: path.join(projectRoot, installDir), store: manifest.store, manifest };
|
|
30
42
|
});
|
|
31
43
|
}
|
|
32
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* @brief Built-in sources plus those registered in any of the targets' `skills.json`.
|
|
46
|
+
*
|
|
47
|
+
* @param targets - Targets whose manifests are read.
|
|
48
|
+
* @returns The sources, built-in ones first.
|
|
49
|
+
*/
|
|
33
50
|
export function skillSources(targets) {
|
|
34
51
|
return manifestSources(targets.map((t) => t.manifest), BUILTIN_SOURCES);
|
|
35
52
|
}
|
|
36
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* @brief Installed skills of one target.
|
|
55
|
+
*
|
|
56
|
+
* @param target - Target whose `skills.json` is read.
|
|
57
|
+
* @returns The installed skills keyed by skill key.
|
|
58
|
+
*/
|
|
37
59
|
export function installedSkills(target) {
|
|
38
60
|
return installedEntries(target.manifest, SkillMetaSchema);
|
|
39
61
|
}
|
|
40
62
|
/** What the core install and source commands print and check for skills. */
|
|
41
63
|
export const SKILL_CONTEXT = { bin: "g3n-skills", noun: "skill", entrySchema: SkillMetaSchema };
|
|
42
64
|
/**
|
|
43
|
-
* Reads the skills of the targets' sources, or only those of `only`, and
|
|
65
|
+
* @brief Reads the skills of the targets' sources, or only those of `only`, and
|
|
44
66
|
* prints what could not be read; the caller disposes the result.
|
|
45
67
|
*
|
|
46
|
-
* @param
|
|
68
|
+
* @param targets - Targets whose sources are read.
|
|
69
|
+
* @param projectRoot - Absolute project root the sources are checked out under.
|
|
70
|
+
* @param only - Source name to read alone; exits when no such source is registered.
|
|
71
|
+
* @returns The skills per source; dispose it once read.
|
|
47
72
|
*/
|
|
48
73
|
export async function openSkillRegistry(targets, projectRoot, only) {
|
|
49
74
|
const registry = await loadSourceRegistry(narrowSources(skillSources(targets), only, "g3n-skills"), projectRoot, readSkillSource);
|
|
50
75
|
reportSourceRegistry(registry);
|
|
51
76
|
return registry;
|
|
52
77
|
}
|
|
53
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* @brief Installs the packages of the given skills in one target and prints each failure; sets exit code 1 on any.
|
|
80
|
+
*
|
|
81
|
+
* @param target - Target whose install directory holds the skills.
|
|
82
|
+
* @param keys - Skill keys to install, e.g. `["emphasise"]`.
|
|
83
|
+
*/
|
|
54
84
|
export async function installPackagesReporting(target, keys) {
|
|
55
85
|
for (const result of await installSkillPackages(target.installDir, keys)) {
|
|
56
86
|
if (result.error === undefined)
|
package/dist/cli/adapter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../src/cli/adapter.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE1F,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE/F,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAGtH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../src/cli/adapter.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE1F,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE/F,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAGtH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,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GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,sEAAsE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAC9J,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
|
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
import type { InstallOptions } from "@g3nomaly/core/cli";
|
|
2
2
|
import type { ProjectDeps } from "../adapter";
|
|
3
|
+
/**
|
|
4
|
+
* @brief Options of `addCommand`, on top of the core install options.
|
|
5
|
+
*
|
|
6
|
+
* @property targets - Harness names to install into, e.g. `["claude"]`; every configured target when absent.
|
|
7
|
+
*/
|
|
3
8
|
export interface AddOptions extends InstallOptions {
|
|
4
9
|
targets?: string[];
|
|
5
10
|
}
|
|
6
11
|
/**
|
|
7
|
-
* Installs skills or whole groups from the registered sources into every
|
|
12
|
+
* @brief Installs skills or whole groups from the registered sources into every
|
|
8
13
|
* configured target, each with the skills it depends on from any source, and
|
|
9
14
|
* installs the packages of the skills that ship a `package.json`. A name more
|
|
10
15
|
* than one source offers is picked as `<name>@<source>`; with no names the
|
|
11
16
|
* user picks from what the sources offer.
|
|
17
|
+
*
|
|
18
|
+
* @param names - Skill keys or groups to install, e.g. `emphasise`; empty to pick from the sources.
|
|
19
|
+
* @param options - Force flag and the `targets` to narrow the install to.
|
|
20
|
+
* @param deps - Test injection.
|
|
12
21
|
*/
|
|
13
22
|
export declare function addCommand(names: string[], options?: AddOptions, deps?: ProjectDeps): Promise<void>;
|
|
14
23
|
//# sourceMappingURL=add.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/add.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,WAAW,UAAW,SAAQ,cAAc;IAChD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/add.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;GAIG;AACH,MAAM,WAAW,UAAW,SAAQ,cAAc;IAChD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,UAAe,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CASjH"}
|
package/dist/cli/commands/add.js
CHANGED
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
import { addFromSources } from "@g3nomaly/core/cli";
|
|
3
3
|
import { SKILL_CONTEXT, installPackagesReporting, openSkillProject, openSkillRegistry, skillTargets } from "../adapter";
|
|
4
4
|
/**
|
|
5
|
-
* Installs skills or whole groups from the registered sources into every
|
|
5
|
+
* @brief Installs skills or whole groups from the registered sources into every
|
|
6
6
|
* configured target, each with the skills it depends on from any source, and
|
|
7
7
|
* installs the packages of the skills that ship a `package.json`. A name more
|
|
8
8
|
* than one source offers is picked as `<name>@<source>`; with no names the
|
|
9
9
|
* user picks from what the sources offer.
|
|
10
|
+
*
|
|
11
|
+
* @param names - Skill keys or groups to install, e.g. `emphasise`; empty to pick from the sources.
|
|
12
|
+
* @param options - Force flag and the `targets` to narrow the install to.
|
|
13
|
+
* @param deps - Test injection.
|
|
10
14
|
*/
|
|
11
15
|
export async function addCommand(names, options = {}, deps = {}) {
|
|
12
16
|
const { projectRoot, config } = await openSkillProject(deps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../../src/cli/commands/add.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../../src/cli/commands/add.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAYxH;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,KAAe,EAAE,OAAO,GAAe,EAAE,EAAE,IAAI,GAAgB,EAAE;IAChG,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC7D,MAAM,OAAO,GAAI,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACpE,MAAM,QAAQ,GAAG,MAAM,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAC/D,IAAI,CAAC;QACH,MAAM,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,wBAAwB,CAAC,CAAC;IACnG,CAAC;YAAS,CAAC;QACT,QAAQ,CAAC,OAAO,EAAE,CAAC;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -1,22 +1,45 @@
|
|
|
1
1
|
import type { SkillTarget, SkillsSettings } from "@g3nomaly/core/config";
|
|
2
2
|
import type { Dialogue, DialogueAnswers } from "@g3nomaly/core/cli";
|
|
3
3
|
import type { ProjectDeps } from "../adapter";
|
|
4
|
+
/**
|
|
5
|
+
* @brief Options of `initCommand`; the preset options skip the prompts.
|
|
6
|
+
*
|
|
7
|
+
* @property force - Reconfigure without asking when a config already exists.
|
|
8
|
+
* @property targets - Harness names to configure, e.g. `["claude", "codex"]`; skips the harness prompt.
|
|
9
|
+
* @property answers - Preset dialogue answers by step id; skips the terminal prompt.
|
|
10
|
+
*/
|
|
4
11
|
export interface InitOptions {
|
|
5
12
|
force?: boolean;
|
|
6
13
|
targets?: string[];
|
|
7
|
-
/** Preset dialogue answers by step id; skips the terminal prompt. */
|
|
8
14
|
answers?: DialogueAnswers;
|
|
9
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* @brief Answers of the init dialogue, parsed into the skills settings.
|
|
18
|
+
*
|
|
19
|
+
* @property targets - Harnesses to install skills for.
|
|
20
|
+
* @property claudeDir - Claude skills directory, relative to the project root, e.g. `.claude/skills`.
|
|
21
|
+
* @property codexDir - Codex skills directory, relative to the project root, e.g. `.codex/skills`.
|
|
22
|
+
*/
|
|
10
23
|
export interface SkillsInitAnswers {
|
|
11
24
|
targets: SkillTarget[];
|
|
12
25
|
claudeDir: string;
|
|
13
26
|
codexDir: string;
|
|
14
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* @brief Input of the init dialogue: the settings its steps start from.
|
|
30
|
+
*
|
|
31
|
+
* @property settings - Current skills settings, the initial value of each step.
|
|
32
|
+
*/
|
|
15
33
|
interface SkillsInitInput extends Record<string, unknown> {
|
|
16
34
|
settings: SkillsSettings;
|
|
17
35
|
}
|
|
18
36
|
export declare const initDialogue: Dialogue<SkillsInitInput>;
|
|
19
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* @brief Configures which harnesses skills are installed for.
|
|
39
|
+
*
|
|
40
|
+
* @param options - Force flag, targets and preset answers.
|
|
41
|
+
* @param deps - Test injection.
|
|
42
|
+
*/
|
|
20
43
|
export declare function initCommand(options?: InitOptions, deps?: ProjectDeps): Promise<void>;
|
|
21
44
|
export {};
|
|
22
45
|
//# sourceMappingURL=init.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAa,WAAW,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEpF,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAI,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAa,WAAW,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEpF,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAI,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,eAAe,CAAC;CAC3B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAI,WAAW,EAAE,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAG,MAAM,CAAC;CACnB;AAWD;;;;GAIG;AACH,UAAU,eAAgB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACvD,QAAQ,EAAE,cAAc,CAAC;CAC1B;AAYD,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,eAAe,CA6BlD,CAAC;AAgDF;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,OAAO,GAAE,WAAgB,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CA+ClG"}
|
|
@@ -7,6 +7,12 @@ import { z } from "zod";
|
|
|
7
7
|
import { SkillTargetSchema, configExists, loadConfig, resolveProjectRoot, saveConfig } from "@g3nomaly/core/config";
|
|
8
8
|
import { StepKind, c, runDialogue, runDialogueValue } from "@g3nomaly/core/cli";
|
|
9
9
|
const TargetsSchema = z.array(SkillTargetSchema);
|
|
10
|
+
/**
|
|
11
|
+
* @brief Validates a directory answer: rejects a blank one.
|
|
12
|
+
*
|
|
13
|
+
* @param v - Text the user typed; `undefined` when nothing was typed.
|
|
14
|
+
* @returns The error message to show, or `undefined` when the value is valid.
|
|
15
|
+
*/
|
|
10
16
|
const notEmpty = (v) => (v?.trim() ? undefined : "Directory cannot be empty");
|
|
11
17
|
const reconfigureDialogue = {
|
|
12
18
|
steps: {
|
|
@@ -47,6 +53,11 @@ export const initDialogue = {
|
|
|
47
53
|
},
|
|
48
54
|
},
|
|
49
55
|
};
|
|
56
|
+
/**
|
|
57
|
+
* @brief The printed lines of the skills settings: harnesses and their directories.
|
|
58
|
+
*
|
|
59
|
+
* @param targets - Harnesses to list.
|
|
60
|
+
*/
|
|
50
61
|
function settingsLines(targets, claudeDir, codexDir) {
|
|
51
62
|
return [
|
|
52
63
|
` targets: ${targets.map((t) => c.target(t)).join(", ")}`,
|
|
@@ -54,6 +65,13 @@ function settingsLines(targets, claudeDir, codexDir) {
|
|
|
54
65
|
` codex dir: ${c.dir(codexDir)}`,
|
|
55
66
|
];
|
|
56
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* @brief Answers taken from the preset options.
|
|
70
|
+
*
|
|
71
|
+
* @param options - Command options; `targets` is the preset.
|
|
72
|
+
* @param config - Loaded config whose directories fill the answers.
|
|
73
|
+
* @returns The preset answers, or `null` when no targets were given.
|
|
74
|
+
*/
|
|
57
75
|
function fromOptions(options, config) {
|
|
58
76
|
if (options.targets === undefined)
|
|
59
77
|
return null;
|
|
@@ -64,6 +82,13 @@ function fromOptions(options, config) {
|
|
|
64
82
|
codexDir: s.installDirs.codex,
|
|
65
83
|
};
|
|
66
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* @brief Parses the dialogue record into answers, keeping the configured directories where a step gave none.
|
|
87
|
+
*
|
|
88
|
+
* @param record - Answers of the dialogue by step id.
|
|
89
|
+
* @param config - Loaded config whose directories are the fallback.
|
|
90
|
+
* @returns The parsed answers.
|
|
91
|
+
*/
|
|
67
92
|
function parseAnswers(record, config) {
|
|
68
93
|
const s = config.skills.settings;
|
|
69
94
|
return {
|
|
@@ -72,7 +97,12 @@ function parseAnswers(record, config) {
|
|
|
72
97
|
codexDir: typeof record.codexDir === "string" ? record.codexDir : s.installDirs.codex,
|
|
73
98
|
};
|
|
74
99
|
}
|
|
75
|
-
/**
|
|
100
|
+
/**
|
|
101
|
+
* @brief Configures which harnesses skills are installed for.
|
|
102
|
+
*
|
|
103
|
+
* @param options - Force flag, targets and preset answers.
|
|
104
|
+
* @param deps - Test injection.
|
|
105
|
+
*/
|
|
76
106
|
export async function initCommand(options = {}, deps = {}) {
|
|
77
107
|
p.intro(chalk.bold.cyan("g3n-skills init"));
|
|
78
108
|
const projectRoot = (deps.resolveProjectRoot ?? resolveProjectRoot)();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE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|
1
1
|
import type { LSOptions } from "@g3nomaly/core/cli";
|
|
2
2
|
import type { ProjectDeps } from "../adapter";
|
|
3
|
+
/**
|
|
4
|
+
* @brief Options of `lsCommand`, on top of the core list options.
|
|
5
|
+
*
|
|
6
|
+
* @property installed - List what `skills.json` records instead of what the sources offer.
|
|
7
|
+
* @property source - Only the skills of this registered source, e.g. `g3n-skills`.
|
|
8
|
+
*/
|
|
3
9
|
export interface LsOptions extends LSOptions {
|
|
4
|
-
/** List what `skills.json` records instead of what the sources offer */
|
|
5
10
|
installed?: boolean;
|
|
6
|
-
/** Only the skills of this registered source */
|
|
7
11
|
source?: string;
|
|
8
12
|
}
|
|
9
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* @brief Lists the skills the registered sources offer, `●` marking installed ones, or with `installed` only what is installed.
|
|
15
|
+
*
|
|
16
|
+
* @param options - Output and filter options.
|
|
17
|
+
* @param deps - Test injection.
|
|
18
|
+
*/
|
|
10
19
|
export declare function lsCommand(options?: LsOptions, deps?: ProjectDeps): Promise<void>;
|
|
11
20
|
//# sourceMappingURL=ls.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ls.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/ls.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,WAAW,SAAU,SAAQ,SAAS;IAC1C,
|
|
1
|
+
{"version":3,"file":"ls.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/ls.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,WAAW,SAAU,SAAQ,SAAS;IAC1C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAK,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAsB,SAAS,CAAC,OAAO,GAAE,SAAc,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiB9F"}
|
package/dist/cli/commands/ls.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
// packages/skills/src/cli/commands/ls.ts
|
|
2
2
|
import { lsEntries, lsSourceRegistry } from "@g3nomaly/core/cli";
|
|
3
3
|
import { installedSkills, openSkillProject, openSkillRegistry, skillSources, skillTargets } from "../adapter";
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* @brief Lists the skills the registered sources offer, `●` marking installed ones, or with `installed` only what is installed.
|
|
6
|
+
*
|
|
7
|
+
* @param options - Output and filter options.
|
|
8
|
+
* @param deps - Test injection.
|
|
9
|
+
*/
|
|
5
10
|
export async function lsCommand(options = {}, deps = {}) {
|
|
6
11
|
const { projectRoot, config } = await openSkillProject(deps);
|
|
7
12
|
const targets = skillTargets(config, projectRoot);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ls.js","sourceRoot":"","sources":["../../../src/cli/commands/ls.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGjE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"ls.js","sourceRoot":"","sources":["../../../src/cli/commands/ls.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGjE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAc9G;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,OAAO,GAAc,EAAE,EAAE,IAAI,GAAgB,EAAE;IAC7E,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC7D,MAAM,OAAO,GAAK,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACpD,MAAM,SAAS,GAAkB,EAAE,CAAC;IACpC,KAAK,MAAM,MAAM,IAAI,OAAO;QAAE,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;YAAE,SAAS,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC;IAE3H,IAAI,OAAO,CAAC,SAAS,KAAK,IAAI,EAAE,CAAC;QAC/B,SAAS,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC9B,OAAO;IACT,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,iBAAiB,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/E,IAAI,CAAC;QACH,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IACxE,CAAC;YAAS,CAAC;QACT,QAAQ,CAAC,OAAO,EAAE,CAAC;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import type { InstallOptions } from "@g3nomaly/core/cli";
|
|
2
2
|
import type { ProjectDeps } from "../adapter";
|
|
3
|
+
/**
|
|
4
|
+
* @brief Options of `removeCommand`, on top of the core install options.
|
|
5
|
+
*
|
|
6
|
+
* @property targets - Harness names to remove from, e.g. `["codex"]`; every configured target when absent.
|
|
7
|
+
*/
|
|
3
8
|
export interface RemoveOptions extends InstallOptions {
|
|
4
9
|
targets?: string[];
|
|
5
10
|
}
|
|
6
11
|
/**
|
|
7
|
-
* Removes installed skills, hooks included, with the packages installed into
|
|
12
|
+
* @brief Removes installed skills, hooks included, with the packages installed into
|
|
8
13
|
* them, and drops them from each target's `skills.json`. Works from the
|
|
9
14
|
* manifests alone; installed dependents are offered for removal too.
|
|
15
|
+
*
|
|
16
|
+
* @param names - Installed skill keys to remove.
|
|
17
|
+
* @param options - Force flag and the `targets` to narrow the removal to.
|
|
18
|
+
* @param deps - Test injection.
|
|
10
19
|
*/
|
|
11
20
|
export declare function removeCommand(names: string[], options?: RemoveOptions, deps?: ProjectDeps): Promise<void>;
|
|
12
21
|
//# sourceMappingURL=remove.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/remove.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,WAAW,aAAc,SAAQ,cAAc;IACnD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED
|
|
1
|
+
{"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/remove.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;GAIG;AACH,MAAM,WAAW,aAAc,SAAQ,cAAc;IACnD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,aAAkB,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAIvH"}
|
|
@@ -3,9 +3,13 @@ import { removeFromTargets } from "@g3nomaly/core/cli";
|
|
|
3
3
|
import { removeSkillPackages } from "../../packages/install";
|
|
4
4
|
import { SKILL_CONTEXT, openSkillProject, skillTargets } from "../adapter";
|
|
5
5
|
/**
|
|
6
|
-
* Removes installed skills, hooks included, with the packages installed into
|
|
6
|
+
* @brief Removes installed skills, hooks included, with the packages installed into
|
|
7
7
|
* them, and drops them from each target's `skills.json`. Works from the
|
|
8
8
|
* manifests alone; installed dependents are offered for removal too.
|
|
9
|
+
*
|
|
10
|
+
* @param names - Installed skill keys to remove.
|
|
11
|
+
* @param options - Force flag and the `targets` to narrow the removal to.
|
|
12
|
+
* @param deps - Test injection.
|
|
9
13
|
*/
|
|
10
14
|
export async function removeCommand(names, options = {}, deps = {}) {
|
|
11
15
|
const { projectRoot, config } = await openSkillProject(deps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove.js","sourceRoot":"","sources":["../../../src/cli/commands/remove.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"remove.js","sourceRoot":"","sources":["../../../src/cli/commands/remove.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAY3E;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,KAAe,EAAE,OAAO,GAAkB,EAAE,EAAE,IAAI,GAAgB,EAAE;IACtG,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC7D,MAAM,OAAO,GAAG,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACnE,MAAM,iBAAiB,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC,mBAAmB,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;AACxI,CAAC"}
|
|
@@ -1,29 +1,58 @@
|
|
|
1
1
|
import type { ProjectDeps } from "../adapter";
|
|
2
|
+
/**
|
|
3
|
+
* @brief Options of `sourceAddCommand`.
|
|
4
|
+
*
|
|
5
|
+
* @property name - Name to register under; derived from the source when absent.
|
|
6
|
+
* @property ref - Branch or tag a git source is pinned to.
|
|
7
|
+
* @property targets - Harness names to register in; every configured target when absent.
|
|
8
|
+
*/
|
|
2
9
|
export interface SourceAddOptions {
|
|
3
|
-
/** Name to register under; derived from the source when absent */
|
|
4
10
|
name?: string;
|
|
5
|
-
/** Branch or tag a git source is pinned to */
|
|
6
11
|
ref?: string;
|
|
7
12
|
targets?: string[];
|
|
8
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* @brief Options of `sourceLsCommand`.
|
|
16
|
+
*
|
|
17
|
+
* @property json - Print the list as JSON.
|
|
18
|
+
* @property targets - Harness names to list for; every configured target when absent.
|
|
19
|
+
*/
|
|
9
20
|
export interface SourceLsOptions {
|
|
10
21
|
json?: boolean;
|
|
11
22
|
targets?: string[];
|
|
12
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* @brief Options of `sourceRemoveCommand`.
|
|
26
|
+
*
|
|
27
|
+
* @property force - Unregister even when installed skills came from the source.
|
|
28
|
+
* @property targets - Harness names to unregister from; every configured target when absent.
|
|
29
|
+
*/
|
|
13
30
|
export interface SourceRemoveOptions {
|
|
14
|
-
/** Unregister even when installed skills came from the source */
|
|
15
31
|
force?: boolean;
|
|
16
32
|
targets?: string[];
|
|
17
33
|
}
|
|
18
34
|
/**
|
|
19
|
-
* Registers a git repository, npm package or local folder as a skill source
|
|
35
|
+
* @brief Registers a git repository, npm package or local folder as a skill source
|
|
20
36
|
* in every target's `skills.json`, after checking it offers at least one skill.
|
|
21
37
|
*
|
|
22
38
|
* @param input - The source as typed, e.g. `owner/repo`, `npm:@scope/skills` or `./my-skills`
|
|
39
|
+
* @param options - Name, ref and targets of the source.
|
|
40
|
+
* @param deps - Test injection.
|
|
23
41
|
*/
|
|
24
42
|
export declare function sourceAddCommand(input: string, options?: SourceAddOptions, deps?: ProjectDeps): Promise<void>;
|
|
25
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* @brief Lists each target's sources, built-in ones first, with how many installed skills came from each.
|
|
45
|
+
*
|
|
46
|
+
* @param options - Output format and the `targets` to list for.
|
|
47
|
+
* @param deps - Test injection.
|
|
48
|
+
*/
|
|
26
49
|
export declare function sourceLsCommand(options?: SourceLsOptions, deps?: ProjectDeps): Promise<void>;
|
|
27
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* @brief Unregisters a source from every target; refused for built-in sources and, unless forced, while skills came from it.
|
|
52
|
+
*
|
|
53
|
+
* @param name - Name of the source to unregister, as `source ls` prints it.
|
|
54
|
+
* @param options - Force flag and the `targets` to unregister from.
|
|
55
|
+
* @param deps - Test injection.
|
|
56
|
+
*/
|
|
28
57
|
export declare function sourceRemoveCommand(name: string, options?: SourceRemoveOptions, deps?: ProjectDeps): Promise<void>;
|
|
29
58
|
//# sourceMappingURL=source.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/source.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,WAAW,gBAAgB;IAC/B,
|
|
1
|
+
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/source.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAK,MAAM,CAAC;IACjB,GAAG,CAAC,EAAM,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAK,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAI,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAYD;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAI3H;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,OAAO,GAAE,eAAoB,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAG1G;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAGhI"}
|
|
@@ -3,27 +3,45 @@ import { addSourceEntries, lsSources, removeSourceEntries } from "@g3nomaly/core
|
|
|
3
3
|
import { readSkillSource } from "../../registry/readSource";
|
|
4
4
|
import { BUILTIN_SOURCES } from "../../sources/builtins";
|
|
5
5
|
import { SKILL_CONTEXT, openSkillProject, skillTargets } from "../adapter";
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* @brief What the core source commands need to know about skills.
|
|
8
|
+
*
|
|
9
|
+
* @param projectRoot - Absolute project root the sources are resolved from.
|
|
10
|
+
* @returns The skill context with the built-in sources and the skill reader.
|
|
11
|
+
*/
|
|
7
12
|
function sourceContext(projectRoot) {
|
|
8
13
|
return { ...SKILL_CONTEXT, builtins: BUILTIN_SOURCES, readSource: readSkillSource, projectRoot };
|
|
9
14
|
}
|
|
10
15
|
/**
|
|
11
|
-
* Registers a git repository, npm package or local folder as a skill source
|
|
16
|
+
* @brief Registers a git repository, npm package or local folder as a skill source
|
|
12
17
|
* in every target's `skills.json`, after checking it offers at least one skill.
|
|
13
18
|
*
|
|
14
19
|
* @param input - The source as typed, e.g. `owner/repo`, `npm:@scope/skills` or `./my-skills`
|
|
20
|
+
* @param options - Name, ref and targets of the source.
|
|
21
|
+
* @param deps - Test injection.
|
|
15
22
|
*/
|
|
16
23
|
export async function sourceAddCommand(input, options = {}, deps = {}) {
|
|
17
24
|
const { projectRoot, config } = await openSkillProject(deps);
|
|
18
25
|
const targets = skillTargets(config, projectRoot, options.targets);
|
|
19
26
|
await addSourceEntries(targets, input, { name: options.name, ref: options.ref }, sourceContext(projectRoot));
|
|
20
27
|
}
|
|
21
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* @brief Lists each target's sources, built-in ones first, with how many installed skills came from each.
|
|
30
|
+
*
|
|
31
|
+
* @param options - Output format and the `targets` to list for.
|
|
32
|
+
* @param deps - Test injection.
|
|
33
|
+
*/
|
|
22
34
|
export async function sourceLsCommand(options = {}, deps = {}) {
|
|
23
35
|
const { projectRoot, config } = await openSkillProject(deps);
|
|
24
36
|
lsSources(skillTargets(config, projectRoot, options.targets), options, sourceContext(projectRoot));
|
|
25
37
|
}
|
|
26
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* @brief Unregisters a source from every target; refused for built-in sources and, unless forced, while skills came from it.
|
|
40
|
+
*
|
|
41
|
+
* @param name - Name of the source to unregister, as `source ls` prints it.
|
|
42
|
+
* @param options - Force flag and the `targets` to unregister from.
|
|
43
|
+
* @param deps - Test injection.
|
|
44
|
+
*/
|
|
27
45
|
export async function sourceRemoveCommand(name, options = {}, deps = {}) {
|
|
28
46
|
const { projectRoot, config } = await openSkillProject(deps);
|
|
29
47
|
removeSourceEntries(skillTargets(config, projectRoot, options.targets), name, options, sourceContext(projectRoot));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.js","sourceRoot":"","sources":["../../../src/cli/commands/source.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEtF,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"source.js","sourceRoot":"","sources":["../../../src/cli/commands/source.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEtF,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAsC3E;;;;;GAKG;AACH,SAAS,aAAa,CAAC,WAAmB;IACxC,OAAO,EAAE,GAAG,aAAa,EAAE,QAAQ,EAAE,eAAe,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,CAAC;AACnG,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,KAAa,EAAE,OAAO,GAAqB,EAAE,EAAE,IAAI,GAAgB,EAAE;IAC1G,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,CA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