@g3nomaly/mods 0.1.0 → 0.1.1
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 +1 -1
- package/dist/cli/commands/add.d.ts +11 -2
- 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 +10 -2
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +4 -1
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/ls.d.ts +13 -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 +11 -2
- package/dist/cli/commands/remove.js.map +1 -1
- package/dist/cli/commands/source.d.ts +37 -6
- package/dist/cli/commands/source.d.ts.map +1 -1
- package/dist/cli/commands/source.js +23 -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/cli/project.d.ts +34 -11
- package/dist/cli/project.d.ts.map +1 -1
- package/dist/cli/project.js +19 -5
- package/dist/cli/project.js.map +1 -1
- package/dist/cli/viewer.d.ts +3 -2
- package/dist/cli/viewer.d.ts.map +1 -1
- package/dist/cli/viewer.js +3 -2
- package/dist/cli/viewer.js.map +1 -1
- package/dist/registry/locate.d.ts +9 -4
- package/dist/registry/locate.d.ts.map +1 -1
- package/dist/registry/locate.js +4 -3
- package/dist/registry/locate.js.map +1 -1
- package/dist/registry/manifest.d.ts +2 -2
- package/dist/registry/manifest.js +2 -2
- package/dist/registry/readModDir.d.ts +2 -2
- package/dist/registry/readModDir.d.ts.map +1 -1
- package/dist/registry/readModDir.js +8 -3
- package/dist/registry/readModDir.js.map +1 -1
- package/dist/registry/readSource.d.ts +1 -1
- package/dist/registry/readSource.js +1 -1
- package/dist/registry/types.d.ts +15 -0
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/registry/types.js.map +1 -1
- package/dist/viewer/extension.d.ts +16 -6
- package/dist/viewer/extension.d.ts.map +1 -1
- package/dist/viewer/extension.js +10 -4
- package/dist/viewer/extension.js.map +1 -1
- package/dist/viewer/settings.d.ts +13 -7
- package/dist/viewer/settings.d.ts.map +1 -1
- package/dist/viewer/settings.js +10 -3
- package/dist/viewer/settings.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@ bunx @g3nomaly/mods remove mini-game
|
|
|
65
65
|
bunx @g3nomaly/mods ls --installed
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
When you have changed an installed file, `update` asks whether to
|
|
68
|
+
When you have changed an installed file, `update` asks whether to restore the source version, fork the mod under a new name that updates leave alone, or skip it and ask again next time. Pass `-f` to restore without asking, for example in a script.
|
|
69
69
|
|
|
70
70
|
## Other sources
|
|
71
71
|
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
import type { InstallOptions } from "@g3nomaly/core/cli";
|
|
2
2
|
import type { ProjectDeps, Scope } from "../project";
|
|
3
|
+
/**
|
|
4
|
+
* Options of `addCommand`, on top of the core install options.
|
|
5
|
+
*
|
|
6
|
+
* @property scope - Scope to install into; `project` when absent.
|
|
7
|
+
* @property source - Read only this registered source.
|
|
8
|
+
*/
|
|
3
9
|
export interface AddOptions extends InstallOptions {
|
|
4
10
|
scope?: Scope;
|
|
5
|
-
/** Read only this registered source */
|
|
6
11
|
source?: string;
|
|
7
12
|
}
|
|
8
13
|
/**
|
|
9
|
-
* Installs mods, or every mod of a source, from the registered sources into
|
|
14
|
+
* @brief Installs mods, or every mod of a source, from the registered sources into
|
|
10
15
|
* the scope's `.claude/skills/`, records them in `mods.json` and sets up the
|
|
11
16
|
* viewer. A name more than one source offers is picked as `<name>@<source>`;
|
|
12
17
|
* with no names the user picks from what the sources provide.
|
|
18
|
+
*
|
|
19
|
+
* @param names - Mods to install, e.g. `auth-guard` or `auth-guard@my-source`; empty to pick interactively.
|
|
20
|
+
* @param options - Scope, source filter and install options.
|
|
21
|
+
* @param deps - Overrides for the project lookup, used by tests.
|
|
13
22
|
*/
|
|
14
23
|
export declare function addCommand(names: string[], options?: AddOptions, deps?: ProjectDeps): Promise<void>;
|
|
15
24
|
//# 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,KAAK,EAAE,MAAM,YAAY,CAAC;AAGrD,MAAM,WAAW,UAAW,SAAQ,cAAc;IAChD,KAAK,CAAC,EAAG,KAAK,CAAC;IACf,
|
|
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,KAAK,EAAE,MAAM,YAAY,CAAC;AAGrD;;;;;GAKG;AACH,MAAM,WAAW,UAAW,SAAQ,cAAc;IAChD,KAAK,CAAC,EAAG,KAAK,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;GASG;AACH,wBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,UAAe,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAajH"}
|
package/dist/cli/commands/add.js
CHANGED
|
@@ -3,10 +3,14 @@ import { addFromSources, c, lineInfo } from "@g3nomaly/core/cli";
|
|
|
3
3
|
import { MOD_CONTEXT, installedMods, openModProject, openModRegistry } from "../project";
|
|
4
4
|
import { setUpViewer } from "../viewer";
|
|
5
5
|
/**
|
|
6
|
-
* Installs mods, or every mod of a source, from the registered sources into
|
|
6
|
+
* @brief Installs mods, or every mod of a source, from the registered sources into
|
|
7
7
|
* the scope's `.claude/skills/`, records them in `mods.json` and sets up the
|
|
8
8
|
* viewer. A name more than one source offers is picked as `<name>@<source>`;
|
|
9
9
|
* with no names the user picks from what the sources provide.
|
|
10
|
+
*
|
|
11
|
+
* @param names - Mods to install, e.g. `auth-guard` or `auth-guard@my-source`; empty to pick interactively.
|
|
12
|
+
* @param options - Scope, source filter and install options.
|
|
13
|
+
* @param deps - Overrides for the project lookup, used by tests.
|
|
10
14
|
*/
|
|
11
15
|
export async function addCommand(names, options = {}, deps = {}) {
|
|
12
16
|
const project = openModProject(options.scope ?? "project", deps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../../src/cli/commands/add.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,OAAO,EAAE,cAAc,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEzF,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../../src/cli/commands/add.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,OAAO,EAAE,cAAc,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEzF,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAaxC;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,KAAe,EAAE,OAAO,GAAe,EAAE,EAAE,IAAI,GAAgB,EAAE;IAChG,MAAM,OAAO,GAAI,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,SAAS,EAAE,IAAI,CAAC,CAAC;IAClE,MAAM,QAAQ,GAAG,MAAM,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAChE,IAAI,CAAC;QACH,MAAM,cAAc,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;IAChF,CAAC;YAAS,CAAC;QACT,QAAQ,CAAC,OAAO,EAAE,CAAC;IACrB,CAAC;IAED,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACnD,WAAW,CAAC,OAAO,CAAC,CAAC;QACrB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,qDAAqD,CAAC,CAAC,GAAG,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1G,CAAC;AACH,CAAC"}
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import type { ViewerLocation } from "../../viewer";
|
|
2
2
|
import type { ProjectDeps, Scope } from "../project";
|
|
3
|
+
/**
|
|
4
|
+
* Options of `initCommand`.
|
|
5
|
+
*
|
|
6
|
+
* @property scope - Scope to create `mods.json` in; `project` when absent.
|
|
7
|
+
* @property location - Where Claude opens in VS Code; a location already set is kept when absent.
|
|
8
|
+
*/
|
|
3
9
|
export interface InitOptions {
|
|
4
10
|
scope?: Scope;
|
|
5
|
-
/** Where Claude opens in VS Code; a location already set is kept when absent */
|
|
6
11
|
location?: ViewerLocation;
|
|
7
12
|
}
|
|
8
13
|
/**
|
|
9
|
-
* Creates the scope's `mods.json` when missing, sets up the viewer, and lists
|
|
14
|
+
* @brief Creates the scope's `mods.json` when missing, sets up the viewer, and lists
|
|
10
15
|
* the sources mods can be installed from.
|
|
16
|
+
*
|
|
17
|
+
* @param options - Scope and viewer location.
|
|
18
|
+
* @param deps - Overrides for the project lookup, used by tests.
|
|
11
19
|
*/
|
|
12
20
|
export declare function initCommand(options?: InitOptions, deps?: ProjectDeps): void;
|
|
13
21
|
//# sourceMappingURL=init.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAIrD,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAK,KAAK,CAAC;IACjB,
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAIrD;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAK,KAAK,CAAC;IACjB,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,WAAgB,EAAE,IAAI,GAAE,WAAgB,GAAG,IAAI,CAYnF"}
|
|
@@ -7,8 +7,11 @@ import { openModProject } from "../project";
|
|
|
7
7
|
import { setUpViewer } from "../viewer";
|
|
8
8
|
import { sourceLsCommand } from "./source";
|
|
9
9
|
/**
|
|
10
|
-
* Creates the scope's `mods.json` when missing, sets up the viewer, and lists
|
|
10
|
+
* @brief Creates the scope's `mods.json` when missing, sets up the viewer, and lists
|
|
11
11
|
* the sources mods can be installed from.
|
|
12
|
+
*
|
|
13
|
+
* @param options - Scope and viewer location.
|
|
14
|
+
* @param deps - Overrides for the project lookup, used by tests.
|
|
12
15
|
*/
|
|
13
16
|
export function initCommand(options = {}, deps = {}) {
|
|
14
17
|
const project = openModProject(options.scope ?? "project", deps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAa3C;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,OAAO,GAAgB,EAAE,EAAE,IAAI,GAAgB,EAAE;IAC3E,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,SAAS,EAAE,IAAI,CAAC,CAAC;IAEjE,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QACrD,mBAAmB,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;IAClF,CAAC;IACD,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEvC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC;IACnC,eAAe,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,CAAC;IAChD,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC,GAAG,CAAC,oBAAoB,CAAC,kBAAkB,CAAC,CAAC;AAC/G,CAAC"}
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import type { LSOptions } from "@g3nomaly/core/cli";
|
|
2
2
|
import type { ProjectDeps, Scope } from "../project";
|
|
3
|
+
/**
|
|
4
|
+
* Options of `lsCommand`, on top of the core listing options.
|
|
5
|
+
*
|
|
6
|
+
* @property scope - Scope to list; `project` when absent.
|
|
7
|
+
* @property installed - List what `mods.json` records instead of what the sources provide.
|
|
8
|
+
* @property source - Only the mods of this registered source.
|
|
9
|
+
*/
|
|
3
10
|
export interface LsOptions extends LSOptions {
|
|
4
11
|
scope?: Scope;
|
|
5
|
-
/** List what `mods.json` records instead of what the sources provide */
|
|
6
12
|
installed?: boolean;
|
|
7
|
-
/** Only the mods of this registered source */
|
|
8
13
|
source?: string;
|
|
9
14
|
}
|
|
10
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* @brief Lists the mods the scope's sources provide, `●` marking installed ones, or with `installed` only what is installed.
|
|
17
|
+
*
|
|
18
|
+
* @param options - Scope, source filter and listing options.
|
|
19
|
+
* @param deps - Overrides for the project lookup, used by tests.
|
|
20
|
+
*/
|
|
11
21
|
export declare function lsCommand(options?: LsOptions, deps?: ProjectDeps): Promise<void>;
|
|
12
22
|
//# 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;AAEpD,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,WAAW,SAAU,SAAQ,SAAS;IAC1C,KAAK,CAAC,EAAM,KAAK,CAAC;IAClB,
|
|
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;AAEpD,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAErD;;;;;;GAMG;AACH,MAAM,WAAW,SAAU,SAAQ,SAAS;IAC1C,KAAK,CAAC,EAAM,KAAK,CAAC;IAClB,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,CAe9F"}
|
package/dist/cli/commands/ls.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
// packages/mods/src/cli/commands/ls.ts
|
|
2
2
|
import { lsEntries, lsSourceRegistry } from "@g3nomaly/core/cli";
|
|
3
3
|
import { installedMods, openModProject, openModRegistry, modSources } from "../project";
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* @brief Lists the mods the scope's sources provide, `●` marking installed ones, or with `installed` only what is installed.
|
|
6
|
+
*
|
|
7
|
+
* @param options - Scope, source filter and listing options.
|
|
8
|
+
* @param deps - Overrides for the project lookup, used by tests.
|
|
9
|
+
*/
|
|
5
10
|
export async function lsCommand(options = {}, deps = {}) {
|
|
6
11
|
const project = openModProject(options.scope ?? "project", deps);
|
|
7
12
|
const installed = installedMods(project);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ls.js","sourceRoot":"","sources":["../../../src/cli/commands/ls.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"ls.js","sourceRoot":"","sources":["../../../src/cli/commands/ls.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAgBxF;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,OAAO,GAAc,EAAE,EAAE,IAAI,GAAgB,EAAE;IAC7E,MAAM,OAAO,GAAK,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,SAAS,EAAE,IAAI,CAAC,CAAC;IACnE,MAAM,SAAS,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;IAEzC,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,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAChE,IAAI,CAAC;QACH,gBAAgB,CAAC,QAAQ,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IACtE,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, Scope } from "../project";
|
|
3
|
+
/**
|
|
4
|
+
* Options of `removeCommand`, on top of the core install options.
|
|
5
|
+
*
|
|
6
|
+
* @property scope - Scope to remove from; `project` when absent.
|
|
7
|
+
*/
|
|
3
8
|
export interface RemoveOptions extends InstallOptions {
|
|
4
9
|
scope?: Scope;
|
|
5
10
|
}
|
|
6
11
|
/**
|
|
7
|
-
* Removes installed mods, or every mod of a source, with the type
|
|
12
|
+
* @brief Removes installed mods, or every mod of a source, with the type
|
|
8
13
|
* declarations Claude Code wrote beside them, and drops them from
|
|
9
14
|
* `mods.json`. With no names the user picks from what is installed.
|
|
15
|
+
*
|
|
16
|
+
* @param names - Mods to remove; empty to pick from what is installed.
|
|
17
|
+
* @param options - Scope and install options.
|
|
18
|
+
* @param deps - Overrides for the project lookup, used by tests.
|
|
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":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,oBAAoB,CAAC;AAGzE,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,WAAW,aAAc,SAAQ,cAAc;IACnD,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;
|
|
1
|
+
{"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/remove.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,oBAAoB,CAAC;AAGzE,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAErD;;;;GAIG;AACH,MAAM,WAAW,aAAc,SAAQ,cAAc;IACnD,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAoBD;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,aAAkB,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAGvH"}
|
|
@@ -6,7 +6,12 @@ import { createInstallerIO, pruneEmptyDirs } from "@g3nomaly/core/installer";
|
|
|
6
6
|
import { MOD_CONTEXT, openModProject } from "../project";
|
|
7
7
|
/** Folder Claude Code writes the mod API's declarations into when it loads a mod; never recorded in `mods.json`. */
|
|
8
8
|
const ENGINE_TYPES_DIR = path.join(".claude-plugin", "types");
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Deletes the declarations Claude Code wrote into removed mods, then their emptied folders.
|
|
11
|
+
*
|
|
12
|
+
* @param target - Install destination the mods were removed from.
|
|
13
|
+
* @param removed - Folder names of the removed mods.
|
|
14
|
+
*/
|
|
10
15
|
function removeEngineTypes(target, removed) {
|
|
11
16
|
const io = createInstallerIO();
|
|
12
17
|
for (const key of removed) {
|
|
@@ -17,9 +22,13 @@ function removeEngineTypes(target, removed) {
|
|
|
17
22
|
}
|
|
18
23
|
}
|
|
19
24
|
/**
|
|
20
|
-
* Removes installed mods, or every mod of a source, with the type
|
|
25
|
+
* @brief Removes installed mods, or every mod of a source, with the type
|
|
21
26
|
* declarations Claude Code wrote beside them, and drops them from
|
|
22
27
|
* `mods.json`. With no names the user picks from what is installed.
|
|
28
|
+
*
|
|
29
|
+
* @param names - Mods to remove; empty to pick from what is installed.
|
|
30
|
+
* @param options - Scope and install options.
|
|
31
|
+
* @param deps - Overrides for the project lookup, used by tests.
|
|
23
32
|
*/
|
|
24
33
|
export async function removeCommand(names, options = {}, deps = {}) {
|
|
25
34
|
const project = openModProject(options.scope ?? "project", deps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove.js","sourceRoot":"","sources":["../../../src/cli/commands/remove.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"remove.js","sourceRoot":"","sources":["../../../src/cli/commands/remove.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAYzD,oHAAoH;AACpH,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;AAE9D;;;;;GAKG;AACH,SAAS,iBAAiB,CAAC,MAAsB,EAAE,OAAiB;IAClE,MAAM,EAAE,GAAG,iBAAiB,EAAE,CAAC;IAC/B,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;QAC1B,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,GAAG,EAAE,gBAAgB,CAAC,CAAC;QACrE,IAAI,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;YAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACtE,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAChE,CAAC;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,KAAe,EAAE,OAAO,GAAkB,EAAE,EAAE,IAAI,GAAgB,EAAE;IACtG,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,SAAS,EAAE,IAAI,CAAC,CAAC;IACjE,MAAM,iBAAiB,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,iBAAiB,CAAC,CAAC;AAC5F,CAAC"}
|
|
@@ -1,29 +1,60 @@
|
|
|
1
1
|
import type { ProjectDeps, Scope } from "../project";
|
|
2
|
+
/**
|
|
3
|
+
* Options of `sourceAddCommand`.
|
|
4
|
+
*
|
|
5
|
+
* @property scope - Scope to register in; `project` when absent.
|
|
6
|
+
* @property name - Name to register under; derived from the spec when absent.
|
|
7
|
+
* @property ref - Branch or tag of a git source.
|
|
8
|
+
*/
|
|
2
9
|
export interface SourceAddOptions {
|
|
3
10
|
scope?: Scope;
|
|
4
|
-
/** Name to register under; derived from the spec when absent */
|
|
5
11
|
name?: string;
|
|
6
|
-
/** Branch or tag of a git source */
|
|
7
12
|
ref?: string;
|
|
8
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Options of `sourceLsCommand`.
|
|
16
|
+
*
|
|
17
|
+
* @property scope - Scope to list; `project` when absent.
|
|
18
|
+
* @property json - Output as JSON.
|
|
19
|
+
*/
|
|
9
20
|
export interface SourceLsOptions {
|
|
10
21
|
scope?: Scope;
|
|
11
22
|
json?: boolean;
|
|
12
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Options of `sourceRemoveCommand`.
|
|
26
|
+
*
|
|
27
|
+
* @property scope - Scope to unregister from; `project` when absent.
|
|
28
|
+
* @property force - Unregister even while installed mods come from the source.
|
|
29
|
+
*/
|
|
13
30
|
export interface SourceRemoveOptions {
|
|
14
31
|
scope?: Scope;
|
|
15
|
-
/** Unregister even while installed mods come from the source */
|
|
16
32
|
force?: boolean;
|
|
17
33
|
}
|
|
18
34
|
/**
|
|
19
|
-
* Registers a git repository, npm package or local folder as a mod source in
|
|
35
|
+
* @brief Registers a git repository, npm package or local folder as a mod source in
|
|
20
36
|
* the scope's `mods.json`, after checking it provides at least one mod. A
|
|
21
37
|
* local path is stored relative to the project root, and absolute for the
|
|
22
38
|
* user scope, which every project shares.
|
|
39
|
+
*
|
|
40
|
+
* @param input - Git URL, `owner/repo`, npm spec or local folder path.
|
|
41
|
+
* @param options - Scope, name and ref.
|
|
42
|
+
* @param deps - Overrides for the project lookup, used by tests.
|
|
23
43
|
*/
|
|
24
44
|
export declare function sourceAddCommand(input: string, options?: SourceAddOptions, deps?: ProjectDeps): Promise<void>;
|
|
25
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* @brief Lists the built-in and registered sources of the scope, with how many installed mods came from each.
|
|
47
|
+
*
|
|
48
|
+
* @param options - Scope and output format.
|
|
49
|
+
* @param deps - Overrides for the project lookup, used by tests.
|
|
50
|
+
*/
|
|
26
51
|
export declare function sourceLsCommand(options?: SourceLsOptions, deps?: ProjectDeps): void;
|
|
27
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* @brief Unregisters a source; refused for built-in sources and, unless forced, while installed mods came from it.
|
|
54
|
+
*
|
|
55
|
+
* @param name - Name of the source to unregister.
|
|
56
|
+
* @param options - Scope and force flag.
|
|
57
|
+
* @param deps - Overrides for the project lookup, used by tests.
|
|
58
|
+
*/
|
|
28
59
|
export declare function sourceRemoveCommand(name: string, options?: SourceRemoveOptions, deps?: ProjectDeps): void;
|
|
29
60
|
//# 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,EAAc,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjE,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,
|
|
1
|
+
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/source.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAc,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjE;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,IAAI,CAAC,EAAG,MAAM,CAAC;IACf,GAAG,CAAC,EAAI,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,IAAI,CAAC,EAAG,OAAO,CAAC;CACjB;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAWD;;;;;;;;;GASG;AACH,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAG3H;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,GAAE,eAAoB,EAAE,IAAI,GAAE,WAAgB,GAAG,IAAI,CAG3F;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB,EAAE,IAAI,GAAE,WAAgB,GAAG,IAAI,CAGjH"}
|
|
@@ -3,26 +3,45 @@ import { addSourceEntries, lsSources, removeSourceEntries } from "@g3nomaly/core
|
|
|
3
3
|
import { readModSource } from "../../registry/readSource";
|
|
4
4
|
import { BUILTIN_SOURCES } from "../../sources/builtins";
|
|
5
5
|
import { MOD_CONTEXT, openModProject } from "../project";
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* @brief Builds the context the core source commands use for mods in one scope.
|
|
8
|
+
*
|
|
9
|
+
* @param project - Scope the commands work on.
|
|
10
|
+
*/
|
|
7
11
|
function sourceContext(project) {
|
|
8
12
|
return { ...MOD_CONTEXT, builtins: BUILTIN_SOURCES, readSource: readModSource, projectRoot: project.projectRoot };
|
|
9
13
|
}
|
|
10
14
|
/**
|
|
11
|
-
* Registers a git repository, npm package or local folder as a mod source in
|
|
15
|
+
* @brief Registers a git repository, npm package or local folder as a mod source in
|
|
12
16
|
* the scope's `mods.json`, after checking it provides at least one mod. A
|
|
13
17
|
* local path is stored relative to the project root, and absolute for the
|
|
14
18
|
* user scope, which every project shares.
|
|
19
|
+
*
|
|
20
|
+
* @param input - Git URL, `owner/repo`, npm spec or local folder path.
|
|
21
|
+
* @param options - Scope, name and ref.
|
|
22
|
+
* @param deps - Overrides for the project lookup, used by tests.
|
|
15
23
|
*/
|
|
16
24
|
export async function sourceAddCommand(input, options = {}, deps = {}) {
|
|
17
25
|
const project = openModProject(options.scope ?? "project", deps);
|
|
18
26
|
await addSourceEntries([project.target], input, { name: options.name, ref: options.ref, absolutePaths: project.scope === "user" }, sourceContext(project));
|
|
19
27
|
}
|
|
20
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* @brief Lists the built-in and registered sources of the scope, with how many installed mods came from each.
|
|
30
|
+
*
|
|
31
|
+
* @param options - Scope and output format.
|
|
32
|
+
* @param deps - Overrides for the project lookup, used by tests.
|
|
33
|
+
*/
|
|
21
34
|
export function sourceLsCommand(options = {}, deps = {}) {
|
|
22
35
|
const project = openModProject(options.scope ?? "project", deps);
|
|
23
36
|
lsSources([project.target], options, sourceContext(project));
|
|
24
37
|
}
|
|
25
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* @brief Unregisters a source; refused for built-in sources and, unless forced, while installed mods came from it.
|
|
40
|
+
*
|
|
41
|
+
* @param name - Name of the source to unregister.
|
|
42
|
+
* @param options - Scope and force flag.
|
|
43
|
+
* @param deps - Overrides for the project lookup, used by tests.
|
|
44
|
+
*/
|
|
26
45
|
export function sourceRemoveCommand(name, options = {}, deps = {}) {
|
|
27
46
|
const project = openModProject(options.scope ?? "project", deps);
|
|
28
47
|
removeSourceEntries([project.target], name, options, sourceContext(project));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.js","sourceRoot":"","sources":["../../../src/cli/commands/source.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEtF,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"source.js","sourceRoot":"","sources":["../../../src/cli/commands/source.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEtF,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,cA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I,EAAE,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;AAC/E,CAAC"}
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import type { InstallOptions } from "@g3nomaly/core/cli";
|
|
2
2
|
import type { ProjectDeps, Scope } from "../project";
|
|
3
|
+
/**
|
|
4
|
+
* Options of `updateCommand`, on top of the core install options.
|
|
5
|
+
*
|
|
6
|
+
* @property scope - Scope to update; `project` when absent.
|
|
7
|
+
*/
|
|
3
8
|
export interface UpdateOptions extends InstallOptions {
|
|
4
9
|
scope?: Scope;
|
|
5
10
|
}
|
|
6
11
|
/**
|
|
7
|
-
* Re-installs installed mods from the source each one was installed from,
|
|
12
|
+
* @brief Re-installs installed mods from the source each one was installed from,
|
|
8
13
|
* at that source's current revision; with no names, everything installed.
|
|
9
14
|
* Files the user changed since install are kept unless overwritten.
|
|
15
|
+
*
|
|
16
|
+
* @param names - Mods to update; empty for everything installed.
|
|
17
|
+
* @param options - Scope and install options.
|
|
18
|
+
* @param deps - Overrides for the project lookup, used by tests.
|
|
10
19
|
*/
|
|
11
20
|
export declare function updateCommand(names: string[], options?: UpdateOptions, deps?: ProjectDeps): Promise<void>;
|
|
12
21
|
//# sourceMappingURL=update.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/update.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,WAAW,aAAc,SAAQ,cAAc;IACnD,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/update.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAErD;;;;GAIG;AACH,MAAM,WAAW,aAAc,SAAQ,cAAc;IACnD,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,aAAkB,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAGvH"}
|
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
import { updateFromSources } from "@g3nomaly/core/cli";
|
|
3
3
|
import { MOD_CONTEXT, openModProject, openModRegistry } from "../project";
|
|
4
4
|
/**
|
|
5
|
-
* Re-installs installed mods from the source each one was installed from,
|
|
5
|
+
* @brief Re-installs installed mods from the source each one was installed from,
|
|
6
6
|
* at that source's current revision; with no names, everything installed.
|
|
7
7
|
* Files the user changed since install are kept unless overwritten.
|
|
8
|
+
*
|
|
9
|
+
* @param names - Mods to update; empty for everything installed.
|
|
10
|
+
* @param options - Scope and install options.
|
|
11
|
+
* @param deps - Overrides for the project lookup, used by tests.
|
|
8
12
|
*/
|
|
9
13
|
export async function updateCommand(names, options = {}, deps = {}) {
|
|
10
14
|
const project = openModProject(options.scope ?? "project", deps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/cli/commands/update.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/cli/commands/update.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAY1E;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,KAAe,EAAE,OAAO,GAAkB,EAAE,EAAE,IAAI,GAAgB,EAAE;IACtG,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,SAAS,EAAE,IAAI,CAAC,CAAC;IACjE,MAAM,iBAAiB,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;AACzG,CAAC"}
|
package/dist/cli/index.js
CHANGED
|
@@ -9,7 +9,12 @@ import { lsCommand } from "./commands/ls";
|
|
|
9
9
|
import { removeCommand } from "./commands/remove";
|
|
10
10
|
import { sourceAddCommand, sourceLsCommand, sourceRemoveCommand } from "./commands/source";
|
|
11
11
|
import { updateCommand } from "./commands/update";
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* @brief Maps the `--user` flag to a scope, so every command can work on `~/.claude/`.
|
|
14
|
+
*
|
|
15
|
+
* @param opts - Parsed options holding the `--user` flag.
|
|
16
|
+
* @returns `user` when the flag is set, `project` otherwise.
|
|
17
|
+
*/
|
|
13
18
|
function scopeOf(opts) {
|
|
14
19
|
return opts.user === true ? "user" : "project";
|
|
15
20
|
}
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AACA,iCAAiC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO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AG,CAAC,CAAC;AAE/D,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC"}
|
package/dist/cli/project.d.ts
CHANGED
|
@@ -9,41 +9,64 @@ export declare const ScopeSchema: z.ZodEnum<{
|
|
|
9
9
|
project: "project";
|
|
10
10
|
user: "user";
|
|
11
11
|
}>;
|
|
12
|
+
/** Install scope, one of the values of `ScopeSchema`. */
|
|
12
13
|
export type Scope = z.infer<typeof ScopeSchema>;
|
|
13
14
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
15
|
+
* Install scope opened for one command: where mods go, the `mods.json` that
|
|
16
|
+
* records them, and the root that sources resolve against. Created by
|
|
17
|
+
* `openModProject`.
|
|
18
|
+
*
|
|
19
|
+
* @property scope - Scope the project was opened for.
|
|
20
|
+
* @property projectRoot - Absolute root for local source paths and the `node_modules` lookup: the git project, or home for `user` outside one.
|
|
21
|
+
* @property claudeDir - Absolute `.claude/` directory of the scope.
|
|
22
|
+
* @property target - The one install destination with the `mods.json` that backs it.
|
|
16
23
|
*/
|
|
17
24
|
export interface ModProject {
|
|
18
25
|
scope: Scope;
|
|
19
|
-
/** Absolute root for local source paths and the `node_modules` lookup: the git project, or home for `user` outside one */
|
|
20
26
|
projectRoot: string;
|
|
21
|
-
/** Absolute `.claude/` directory of the scope */
|
|
22
27
|
claudeDir: string;
|
|
23
|
-
/** The one install destination with the `mods.json` that backs it */
|
|
24
28
|
target: ManifestTarget;
|
|
25
29
|
}
|
|
26
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* Overrides for the project lookup, used by tests.
|
|
32
|
+
*
|
|
33
|
+
* @property resolveProjectRoot - Replaces git discovery of the project root.
|
|
34
|
+
* @property home - Home folder for the `user` scope, instead of `os.homedir()`.
|
|
35
|
+
*/
|
|
27
36
|
export interface ProjectDeps {
|
|
28
37
|
resolveProjectRoot?: typeof resolveProjectRoot;
|
|
29
38
|
home?: string;
|
|
30
39
|
}
|
|
31
40
|
/**
|
|
32
|
-
* Opens the scope's `.claude/` directory and its `mods.json`. Exits with an
|
|
41
|
+
* @brief Opens the scope's `.claude/` directory and its `mods.json`. Exits with an
|
|
33
42
|
* error when the project scope is asked for outside a git repository.
|
|
43
|
+
*
|
|
44
|
+
* @param scope - Scope to open.
|
|
45
|
+
* @param deps - Overrides for the project lookup, used by tests.
|
|
46
|
+
* @returns The opened project.
|
|
34
47
|
*/
|
|
35
48
|
export declare function openModProject(scope: Scope, deps?: ProjectDeps): ModProject;
|
|
36
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* @brief Lists the sources of a scope: built-in ones first, then those registered in its `mods.json`.
|
|
51
|
+
*
|
|
52
|
+
* @param project - Scope to list sources for.
|
|
53
|
+
*/
|
|
37
54
|
export declare function modSources(project: ModProject): RegisteredSource[];
|
|
38
55
|
/** What the core install and source commands print and check for mods. */
|
|
39
56
|
export declare const MOD_CONTEXT: InstallCommandContext<ModMeta>;
|
|
40
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* @brief Reads the mods installed in the scope.
|
|
59
|
+
*
|
|
60
|
+
* @param project - Scope to read.
|
|
61
|
+
*/
|
|
41
62
|
export declare function installedMods(project: ModProject): ModRegistry;
|
|
42
63
|
/**
|
|
43
|
-
* Reads every mod the scope's sources provide, or only those of `only`, and
|
|
64
|
+
* @brief Reads every mod the scope's sources provide, or only those of `only`, and
|
|
44
65
|
* prints each warning. The caller disposes the result when done.
|
|
45
66
|
*
|
|
46
|
-
* @param
|
|
67
|
+
* @param project - Scope to read sources for.
|
|
68
|
+
* @param only - Source name to read alone; exits when no such source is registered.
|
|
69
|
+
* @returns Registry of the mods read.
|
|
47
70
|
*/
|
|
48
71
|
export declare function openModRegistry(project: ModProject, only?: string): Promise<SourceRegistry<ModMeta>>;
|
|
49
72
|
//# sourceMappingURL=project.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/cli/project.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC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;CAC7B;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,kBAAkB,CAAC,EAAE,OAAO,kBAAkB,CAAC;IAC/C,IAAI,CAAC,EAAgB,MAAM,CAAC;CAC7B;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,GAAE,WAAgB,GAAG,UAAU,CAiB/E;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,UAAU,GAAG,gBAAgB,EAAE,CAElE;AAED,0EAA0E;AAC1E,eAAO,MAAM,WAAW,EAAE,qBAAqB,CAAC,OAAO,CAAgE,CAAC;AAExH;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,UAAU,GAAG,WAAW,CAE9D;AAED;;;;;;;GAOG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAI1G"}
|
package/dist/cli/project.js
CHANGED
|
@@ -14,8 +14,12 @@ export const ScopeSchema = z.enum(["project", "user"]);
|
|
|
14
14
|
/** Folder under `.claude/` that Claude Code auto-loads plugins from, as `<name>@skills-dir`. */
|
|
15
15
|
const INSTALL_DIR = "skills";
|
|
16
16
|
/**
|
|
17
|
-
* Opens the scope's `.claude/` directory and its `mods.json`. Exits with an
|
|
17
|
+
* @brief Opens the scope's `.claude/` directory and its `mods.json`. Exits with an
|
|
18
18
|
* error when the project scope is asked for outside a git repository.
|
|
19
|
+
*
|
|
20
|
+
* @param scope - Scope to open.
|
|
21
|
+
* @param deps - Overrides for the project lookup, used by tests.
|
|
22
|
+
* @returns The opened project.
|
|
19
23
|
*/
|
|
20
24
|
export function openModProject(scope, deps = {}) {
|
|
21
25
|
const home = deps.home ?? os.homedir();
|
|
@@ -34,21 +38,31 @@ export function openModProject(scope, deps = {}) {
|
|
|
34
38
|
target: { label: scope, installDir: path.join(claudeDir, INSTALL_DIR), store: manifest.store, manifest },
|
|
35
39
|
};
|
|
36
40
|
}
|
|
37
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* @brief Lists the sources of a scope: built-in ones first, then those registered in its `mods.json`.
|
|
43
|
+
*
|
|
44
|
+
* @param project - Scope to list sources for.
|
|
45
|
+
*/
|
|
38
46
|
export function modSources(project) {
|
|
39
47
|
return manifestSources([project.target.manifest], BUILTIN_SOURCES);
|
|
40
48
|
}
|
|
41
49
|
/** What the core install and source commands print and check for mods. */
|
|
42
50
|
export const MOD_CONTEXT = { bin: "g3n-mods", noun: "mod", entrySchema: ModMetaSchema };
|
|
43
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* @brief Reads the mods installed in the scope.
|
|
53
|
+
*
|
|
54
|
+
* @param project - Scope to read.
|
|
55
|
+
*/
|
|
44
56
|
export function installedMods(project) {
|
|
45
57
|
return installedEntries(project.target.manifest, ModMetaSchema);
|
|
46
58
|
}
|
|
47
59
|
/**
|
|
48
|
-
* Reads every mod the scope's sources provide, or only those of `only`, and
|
|
60
|
+
* @brief Reads every mod the scope's sources provide, or only those of `only`, and
|
|
49
61
|
* prints each warning. The caller disposes the result when done.
|
|
50
62
|
*
|
|
51
|
-
* @param
|
|
63
|
+
* @param project - Scope to read sources for.
|
|
64
|
+
* @param only - Source name to read alone; exits when no such source is registered.
|
|
65
|
+
* @returns Registry of the mods read.
|
|
52
66
|
*/
|
|
53
67
|
export async function openModRegistry(project, only) {
|
|
54
68
|
const registry = await loadSourceRegistry(narrowSources(modSources(project), only, "g3n-mods"), project.projectRoot, readModSource);
|
package/dist/cli/project.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/cli/project.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,CAAC,EAAE,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CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,eAAe,CAAC,CAAC;AACrE,CAAC;AAED,0EAA0E;AAC1E,MAAM,CAAC,MAAM,WAAW,GAAmC,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC;AAExH;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,OAAmB;IAC/C,OAAO,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;AAClE,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAAmB,EAAE,IAAa;IACtE,MAAM,QAAQ,GAAG,MAAM,kBAAkB,CAAC,aAAa,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,UAAU,CAAC,EAAE,OAAO,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IACpI,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IAC/B,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/cli/viewer.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { ViewerLocation } from "../viewer";
|
|
2
2
|
import type { ModProject } from "./project";
|
|
3
3
|
/**
|
|
4
|
-
* Sets up where mods are seen and prints what it found: the project's VS
|
|
4
|
+
* @brief Sets up where mods are seen and prints what it found: the project's VS
|
|
5
5
|
* Code settings (project scope only) and the installed extension's version
|
|
6
6
|
* against the one the mod API needs.
|
|
7
7
|
*
|
|
8
|
-
* @param
|
|
8
|
+
* @param project - Scope to set up; VS Code settings are written only for `project`.
|
|
9
|
+
* @param location - Where Claude opens; when absent, a location already set is kept.
|
|
9
10
|
*/
|
|
10
11
|
export declare function setUpViewer(project: ModProject, location?: ViewerLocation): void;
|
|
11
12
|
//# sourceMappingURL=viewer.d.ts.map
|
package/dist/cli/viewer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewer.d.ts","sourceRoot":"","sources":["../../src/cli/viewer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C
|
|
1
|
+
{"version":3,"file":"viewer.d.ts","sourceRoot":"","sources":["../../src/cli/viewer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,cAAc,GAAG,IAAI,CAkBhF"}
|
package/dist/cli/viewer.js
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
import { c, lineInfo, lineSuccess, lineWarn } from "@g3nomaly/core/cli";
|
|
3
3
|
import { MIN_ENGINE_VERSION, compareVersions, configureViewer, findClaudeExtension } from "../viewer";
|
|
4
4
|
/**
|
|
5
|
-
* Sets up where mods are seen and prints what it found: the project's VS
|
|
5
|
+
* @brief Sets up where mods are seen and prints what it found: the project's VS
|
|
6
6
|
* Code settings (project scope only) and the installed extension's version
|
|
7
7
|
* against the one the mod API needs.
|
|
8
8
|
*
|
|
9
|
-
* @param
|
|
9
|
+
* @param project - Scope to set up; VS Code settings are written only for `project`.
|
|
10
|
+
* @param location - Where Claude opens; when absent, a location already set is kept.
|
|
10
11
|
*/
|
|
11
12
|
export function setUpViewer(project, location) {
|
|
12
13
|
if (project.scope === "project") {
|
package/dist/cli/viewer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewer.js","sourceRoot":"","sources":["../../src/cli/viewer.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,WAAW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mI,kBAAkB,YAAY,CAAC,CAAC,CAAC;IAC3L,CAAC;SAAM,IAAI,eAAe,CAAC,SAAS,CAAC,OAAO,EAAE,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAC;QACtE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,8BAA8B,SAAS,CAAC,OAAO,eAAe,kBAAkB,kCAAkC,CAAC,CAAC,CAAC;IAC5I,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,2BAA2B,SAAS,CAAC,OAAO,yBAAyB,CAAC,CAAC,GAAG,CAAC,iCAAiC,CAAC,sCAAsC,CAAC,CAAC,CAAC;IAC7K,CAAC;AACH,CAAC"}
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Mod folders found in one source checkout, and what was skipped.
|
|
3
|
+
*
|
|
4
|
+
* @property dirs - Absolute mod folders.
|
|
5
|
+
* @property warnings - Why each skipped plugin or folder was left out.
|
|
6
|
+
*/
|
|
2
7
|
export interface ModScan {
|
|
3
|
-
/** Absolute mod folders */
|
|
4
8
|
dirs: string[];
|
|
5
9
|
warnings: string[];
|
|
6
10
|
}
|
|
7
11
|
/**
|
|
8
|
-
* Finds the mods a source provides. A `marketplace.json` lists them by
|
|
12
|
+
* @brief Finds the mods a source provides. A `marketplace.json` lists them by
|
|
9
13
|
* relative path; without one, the source root is the mod when it is one,
|
|
10
14
|
* else every mod folder directly under `mods/` or the root. Plugins that
|
|
11
15
|
* hold no hooks module are skipped with a warning.
|
|
12
16
|
*
|
|
13
|
-
* @param root - Absolute root of the source checkout
|
|
17
|
+
* @param root - Absolute root of the source checkout.
|
|
18
|
+
* @returns Mod folders, and warnings for what was skipped.
|
|
14
19
|
*/
|
|
15
20
|
export declare function locateMods(root: string): ModScan;
|
|
16
21
|
//# sourceMappingURL=locate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locate.d.ts","sourceRoot":"","sources":["../../src/registry/locate.ts"],"names":[],"mappings":"AAQA
|
|
1
|
+
{"version":3,"file":"locate.d.ts","sourceRoot":"","sources":["../../src/registry/locate.ts"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,MAAM,WAAW,OAAO;IACtB,IAAI,EAAM,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAUD;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAgBhD"}
|
package/dist/registry/locate.js
CHANGED
|
@@ -4,7 +4,7 @@ import path from "node:path";
|
|
|
4
4
|
import { readMarketplace } from "@g3nomaly/core/installer";
|
|
5
5
|
import { isModDir } from "./readModDir";
|
|
6
6
|
const MODS_DIR = "mods";
|
|
7
|
-
/**
|
|
7
|
+
/** Lists the direct child folders of `dir`, leaving out hidden ones and `node_modules`. */
|
|
8
8
|
function childDirs(dir) {
|
|
9
9
|
if (!fs.existsSync(dir))
|
|
10
10
|
return [];
|
|
@@ -13,12 +13,13 @@ function childDirs(dir) {
|
|
|
13
13
|
.map((d) => path.join(dir, d.name));
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* Finds the mods a source provides. A `marketplace.json` lists them by
|
|
16
|
+
* @brief Finds the mods a source provides. A `marketplace.json` lists them by
|
|
17
17
|
* relative path; without one, the source root is the mod when it is one,
|
|
18
18
|
* else every mod folder directly under `mods/` or the root. Plugins that
|
|
19
19
|
* hold no hooks module are skipped with a warning.
|
|
20
20
|
*
|
|
21
|
-
* @param root - Absolute root of the source checkout
|
|
21
|
+
* @param root - Absolute root of the source checkout.
|
|
22
|
+
* @returns Mod folders, and warnings for what was skipped.
|
|
22
23
|
*/
|
|
23
24
|
export function locateMods(root) {
|
|
24
25
|
const marketplace = readMarketplace(root);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locate.js","sourceRoot":"","sources":["../../src/registry/locate.ts"],"names":[],"mappings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GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;QAC3C,MAAM,IAAI,GAAa,EAAE,CAAC;QAC1B,KAAK,MAAM,MAAM,IAAI,WAAW,CAAC,OAAO,EAAE,CAAC;YACzC,IAAI,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC;gBAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;;gBAC3C,QAAQ,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,uDAAuD,CAAC,CAAC;QAC5F,CAAC;QACD,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC;IACzC,CAAC;IAED,IAAI,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IAE1D,MAAM,IAAI,GAAG,CAAC,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,EAAE,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC5F,OAAO,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;AAC3D,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* @brief Builds the path of `mods.json` in a Claude directory.
|
|
3
3
|
*
|
|
4
4
|
* @param claudeDir - Absolute `.claude` directory of the scope, e.g. `/home/me/app/.claude`
|
|
5
|
-
* @returns
|
|
5
|
+
* @returns Absolute path of the file.
|
|
6
6
|
*/
|
|
7
7
|
export declare function modsManifestPath(claudeDir: string): string;
|
|
8
8
|
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
const MANIFEST_FILE = "mods.json";
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* @brief Builds the path of `mods.json` in a Claude directory.
|
|
6
6
|
*
|
|
7
7
|
* @param claudeDir - Absolute `.claude` directory of the scope, e.g. `/home/me/app/.claude`
|
|
8
|
-
* @returns
|
|
8
|
+
* @returns Absolute path of the file.
|
|
9
9
|
*/
|
|
10
10
|
export function modsManifestPath(claudeDir) {
|
|
11
11
|
return path.join(claudeDir, MANIFEST_FILE);
|
|
@@ -2,10 +2,10 @@ import type { ReadContext } from "@g3nomaly/core/installer";
|
|
|
2
2
|
import type { ModMeta } from "./types";
|
|
3
3
|
export declare const PLUGIN_MANIFEST: string;
|
|
4
4
|
export declare const HOOKS_MANIFEST: string;
|
|
5
|
-
/**
|
|
5
|
+
/** Tells whether `dir` holds the plugin and hooks manifests a mod needs; `readModDir` checks the rest. */
|
|
6
6
|
export declare function isModDir(dir: string): boolean;
|
|
7
7
|
/**
|
|
8
|
-
* Reads one mod folder into its registry entry. The key is the folder name,
|
|
8
|
+
* @brief Reads one mod folder into its registry entry. The key is the folder name,
|
|
9
9
|
* which must equal the `name` in its `plugin.json`, the name Claude Code
|
|
10
10
|
* loads it under; every installable file becomes a `files[]` entry at
|
|
11
11
|
* `<key>/<file>`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readModDir.d.ts","sourceRoot":"","sources":["../../src/registry/readModDir.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAwB,OAAO,EAAE,MAAM,SAAS,CAAC;AAE7D,eAAO,MAAM,eAAe,QAA6C,CAAC;AAC1E,eAAO,MAAM,cAAc,QAAoC,CAAC;AAsBhE
|
|
1
|
+
{"version":3,"file":"readModDir.d.ts","sourceRoot":"","sources":["../../src/registry/readModDir.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAwB,OAAO,EAAE,MAAM,SAAS,CAAC;AAE7D,eAAO,MAAM,eAAe,QAA6C,CAAC;AAC1E,eAAO,MAAM,cAAc,QAAoC,CAAC;AAsBhE,0GAA0G;AAC1G,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE7C;AAgBD;;;;;;;;;;;GAWG;AACH,wBAAsB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA8BjG"}
|
|
@@ -21,11 +21,16 @@ const TYPESCRIPT_MODULE = /\.(?:ts|tsx|mts|cts)$/i;
|
|
|
21
21
|
const HooksManifestSchema = z.object({
|
|
22
22
|
modules: z.array(z.string().regex(TYPESCRIPT_MODULE, "must be a TypeScript file (.ts, .tsx, .mts, .cts)")).min(1),
|
|
23
23
|
});
|
|
24
|
-
/**
|
|
24
|
+
/** Tells whether `dir` holds the plugin and hooks manifests a mod needs; `readModDir` checks the rest. */
|
|
25
25
|
export function isModDir(dir) {
|
|
26
26
|
return fs.existsSync(path.join(dir, PLUGIN_MANIFEST)) && fs.existsSync(path.join(dir, HOOKS_MANIFEST));
|
|
27
27
|
}
|
|
28
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* @brief Classifies a file by the top folder it sits in inside the mod.
|
|
30
|
+
*
|
|
31
|
+
* @param relativeToMod - File path relative to the mod folder.
|
|
32
|
+
* @returns Kind of the file; `asset` for anything outside the known folders.
|
|
33
|
+
*/
|
|
29
34
|
function fileType(relativeToMod) {
|
|
30
35
|
const [top] = relativeToMod.split(path.sep);
|
|
31
36
|
if (top === ".claude-plugin")
|
|
@@ -37,7 +42,7 @@ function fileType(relativeToMod) {
|
|
|
37
42
|
return "asset";
|
|
38
43
|
}
|
|
39
44
|
/**
|
|
40
|
-
* Reads one mod folder into its registry entry. The key is the folder name,
|
|
45
|
+
* @brief Reads one mod folder into its registry entry. The key is the folder name,
|
|
41
46
|
* which must equal the `name` in its `plugin.json`, the name Claude Code
|
|
42
47
|
* loads it under; every installable file becomes a `files[]` entry at
|
|
43
48
|
* `<key>/<file>`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readModDir.js","sourceRoot":"","sources":["../../src/registry/readModDir.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAIrD,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC;AAC1E,MAAM,CAAC,MAAM,cAAc,GAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AAEhE,sHAAsH;AACtH,MAAM,YAAY,GAAI,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC,CAAC;AACtE,MAAM,aAAa,GAAG,mDAAmD,CAAC;AAE1E,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,IAAI,EAAS,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,sBAAsB,EAAE,uCAAuC,CAAC;IAC9F,OAAO,EAAM,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACzC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAEH,4DAA4D;AAC5D,MAAM,eAAe,GAAG,wBAAwB,CAAC;AAEjD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C,CAAC,EAAE,CAAC,CAAC;IAC/G,CAAC;IAED,OAAO,CAAC,GAAG,EAAE;YACX,IAAI,EAAS,QAAQ,CAAC,IAAI;YAC1B,WAAW,EAAE,QAAQ,CAAC,WAAW;YACjC,OAAO,EAAM,QAAQ,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO;YAChD,KAAK,EAAQ,OAAO,CAAC,KAAK;YAC1B,MAAM,EAAO,OAAO,CAAC,MAAM;YAC3B,KAAK;SACN,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReadSource } from "@g3nomaly/core/installer";
|
|
2
2
|
import type { ModMeta } from "./types";
|
|
3
3
|
/**
|
|
4
|
-
* Reads every mod a checked-out source provides, with the source as group.
|
|
4
|
+
* @brief Reads every mod a checked-out source provides, with the source as group.
|
|
5
5
|
* An unreadable mod is skipped with a warning. Handed to
|
|
6
6
|
* `loadSourceRegistry` by every mods command.
|
|
7
7
|
*/
|
|
@@ -4,7 +4,7 @@ import { errorMessage } from "@g3nomaly/core/utils";
|
|
|
4
4
|
import { locateMods } from "./locate";
|
|
5
5
|
import { readModDir } from "./readModDir";
|
|
6
6
|
/**
|
|
7
|
-
* Reads every mod a checked-out source provides, with the source as group.
|
|
7
|
+
* @brief Reads every mod a checked-out source provides, with the source as group.
|
|
8
8
|
* An unreadable mod is skipped with a warning. Handed to
|
|
9
9
|
* `loadSourceRegistry` by every mods command.
|
|
10
10
|
*/
|
package/dist/registry/types.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export declare const ModFileTypeSchema: z.ZodEnum<{
|
|
|
6
6
|
manifest: "manifest";
|
|
7
7
|
types: "types";
|
|
8
8
|
}>;
|
|
9
|
+
/** Kind of a mod file: `manifest`, `hooks`, `types` or `asset`. */
|
|
9
10
|
export type ModFileType = z.infer<typeof ModFileTypeSchema>;
|
|
10
11
|
/** One installed or installable file of a mod; `path` is `<mod>/<file>`, relative to the install directory. */
|
|
11
12
|
export declare const ModFileSchema: z.ZodObject<{
|
|
@@ -19,6 +20,12 @@ export declare const ModFileSchema: z.ZodObject<{
|
|
|
19
20
|
types: "types";
|
|
20
21
|
}>;
|
|
21
22
|
}, z.core.$strip>;
|
|
23
|
+
/**
|
|
24
|
+
* File entry of a mod, as `ModFileSchema` parses it.
|
|
25
|
+
*
|
|
26
|
+
* @property path - `<mod>/<file>`, relative to the install directory.
|
|
27
|
+
* @property type - Kind of the file.
|
|
28
|
+
*/
|
|
22
29
|
export type ModFile = z.infer<typeof ModFileSchema>;
|
|
23
30
|
/**
|
|
24
31
|
* One installable mod. Built from a mod folder's `plugin.json` by
|
|
@@ -36,6 +43,7 @@ export declare const ModMetaSchema: z.ZodObject<{
|
|
|
36
43
|
commit: z.ZodOptional<z.ZodString>;
|
|
37
44
|
version: z.ZodOptional<z.ZodString>;
|
|
38
45
|
}, z.core.$strip>;
|
|
46
|
+
forkedFrom: z.ZodOptional<z.ZodString>;
|
|
39
47
|
group: z.ZodString;
|
|
40
48
|
files: z.ZodArray<z.ZodObject<{
|
|
41
49
|
path: z.ZodString;
|
|
@@ -49,6 +57,13 @@ export declare const ModMetaSchema: z.ZodObject<{
|
|
|
49
57
|
}>;
|
|
50
58
|
}, z.core.$strip>>;
|
|
51
59
|
}, z.core.$strip>;
|
|
60
|
+
/**
|
|
61
|
+
* Entry of one mod in `mods.json`, as `ModMetaSchema` parses it.
|
|
62
|
+
*
|
|
63
|
+
* @property group - Source name, so `ls` groups by source.
|
|
64
|
+
* @property files - Installable files of the mod.
|
|
65
|
+
*/
|
|
52
66
|
export type ModMeta = z.infer<typeof ModMetaSchema>;
|
|
67
|
+
/** Mods keyed by their folder name. */
|
|
53
68
|
export type ModRegistry = Record<string, ModMeta>;
|
|
54
69
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/registry/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,mHAAmH;AACnH,eAAO,MAAM,iBAAiB;;;;;EAAkD,CAAC;AAEjF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,+GAA+G;AAC/G,eAAO,MAAM,aAAa;;;;;;;;;;iBAExB,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEpD;;;;GAIG;AACH,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/registry/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,mHAAmH;AACnH,eAAO,MAAM,iBAAiB;;;;;EAAkD,CAAC;AAEjF,mEAAmE;AACnE,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,+GAA+G;AAC/G,eAAO,MAAM,aAAa;;;;;;;;;;iBAExB,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEpD;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;iBAGxB,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,OAAO,GAAO,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACxD,uCAAuC;AACvC,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/registry/types.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,mHAAmH;AACnH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/registry/types.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,mHAAmH;AACnH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AAKjF,+GAA+G;AAC/G,MAAM,CAAC,MAAM,aAAa,GAAG,mBAAmB,CAAC,MAAM,CAAC;IACtD,IAAI,EAAE,iBAAiB;CACxB,CAAC,CAAC;AAUH;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,iBAAiB,CAAC,MAAM,CAAC;IACpD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;CACrC,CAAC,CAAC"}
|
|
@@ -1,18 +1,28 @@
|
|
|
1
1
|
/** Lowest Claude Code release whose mod API the g3n mods are written against. */
|
|
2
2
|
export declare const MIN_ENGINE_VERSION = "2.1.296";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* @brief One installed copy of the Claude Code VS Code extension.
|
|
5
|
+
*
|
|
6
|
+
* @property version - Release the folder name carries, e.g. `2.1.296`.
|
|
7
|
+
* @property dir - Absolute extension folder, e.g. `/home/me/.vscode/extensions/anthropic.claude-code-2.1.296`.
|
|
8
|
+
*/
|
|
4
9
|
export interface ClaudeExtension {
|
|
5
10
|
version: string;
|
|
6
|
-
/** Absolute extension folder */
|
|
7
11
|
dir: string;
|
|
8
12
|
}
|
|
9
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* @brief Compares two `major.minor.patch` versions; negative when `a` is older than `b`.
|
|
15
|
+
*
|
|
16
|
+
* @param a - Version to compare, e.g. `2.1.296`.
|
|
17
|
+
* @param b - Version to compare against, e.g. `2.1.300`.
|
|
18
|
+
* @returns Negative when `a` is older, `0` when equal, positive when `a` is newer.
|
|
19
|
+
*/
|
|
10
20
|
export declare function compareVersions(a: string, b: string): number;
|
|
11
21
|
/**
|
|
12
|
-
* Newest Claude Code extension installed for any editor of the VS Code family.
|
|
22
|
+
* @brief Newest Claude Code extension installed for any editor of the VS Code family.
|
|
13
23
|
*
|
|
14
|
-
* @param home - Home directory to search under; the current user's by default
|
|
15
|
-
* @returns
|
|
24
|
+
* @param home - Home directory to search under; the current user's by default.
|
|
25
|
+
* @returns The newest copy with its version and folder, or `null` when none is installed.
|
|
16
26
|
*/
|
|
17
27
|
export declare function findClaudeExtension(home?: string): ClaudeExtension | null;
|
|
18
28
|
//# sourceMappingURL=extension.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../../src/viewer/extension.ts"],"names":[],"mappings":"AAKA,iFAAiF;AACjF,eAAO,MAAM,kBAAkB,YAAY,CAAC;AAO5C
|
|
1
|
+
{"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../../src/viewer/extension.ts"],"names":[],"mappings":"AAKA,iFAAiF;AACjF,eAAO,MAAM,kBAAkB,YAAY,CAAC;AAO5C;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAM,MAAM,CAAC;CACjB;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAQ5D;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,GAAE,MAAqB,GAAG,eAAe,GAAG,IAAI,CAYvF"}
|
package/dist/viewer/extension.js
CHANGED
|
@@ -7,7 +7,13 @@ export const MIN_ENGINE_VERSION = "2.1.296";
|
|
|
7
7
|
/** Extension folders of the VS Code family, relative to the home directory: local, WSL/SSH server, Insiders, Cursor. */
|
|
8
8
|
const EXTENSION_ROOTS = [".vscode/extensions", ".vscode-server/extensions", ".vscode-insiders/extensions", ".cursor/extensions"];
|
|
9
9
|
const EXTENSION_DIR = /^anthropic\.claude-code-(\d+\.\d+\.\d+)(?:-.+)?$/;
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* @brief Compares two `major.minor.patch` versions; negative when `a` is older than `b`.
|
|
12
|
+
*
|
|
13
|
+
* @param a - Version to compare, e.g. `2.1.296`.
|
|
14
|
+
* @param b - Version to compare against, e.g. `2.1.300`.
|
|
15
|
+
* @returns Negative when `a` is older, `0` when equal, positive when `a` is newer.
|
|
16
|
+
*/
|
|
11
17
|
export function compareVersions(a, b) {
|
|
12
18
|
const pa = a.split(".").map(Number);
|
|
13
19
|
const pb = b.split(".").map(Number);
|
|
@@ -19,10 +25,10 @@ export function compareVersions(a, b) {
|
|
|
19
25
|
return 0;
|
|
20
26
|
}
|
|
21
27
|
/**
|
|
22
|
-
* Newest Claude Code extension installed for any editor of the VS Code family.
|
|
28
|
+
* @brief Newest Claude Code extension installed for any editor of the VS Code family.
|
|
23
29
|
*
|
|
24
|
-
* @param home - Home directory to search under; the current user's by default
|
|
25
|
-
* @returns
|
|
30
|
+
* @param home - Home directory to search under; the current user's by default.
|
|
31
|
+
* @returns The newest copy with its version and folder, or `null` when none is installed.
|
|
26
32
|
*/
|
|
27
33
|
export function findClaudeExtension(home = os.homedir()) {
|
|
28
34
|
let newest = null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension.js","sourceRoot":"","sources":["../../src/viewer/extension.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,iFAAiF;AACjF,MAAM,CAAC,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAE5C,wHAAwH;AACxH,MAAM,eAAe,GAAG,CAAC,oBAAoB,EAAE,2BAA2B,EAAE,6BAA6B,EAAE,oBAAoB,CAAC,CAAC;AAEjI,MAAM,aAAa,GAAG,kDAAkD,CAAC;
|
|
1
|
+
{"version":3,"file":"extension.js","sourceRoot":"","sources":["../../src/viewer/extension.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,iFAAiF;AACjF,MAAM,CAAC,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAE5C,wHAAwH;AACxH,MAAM,eAAe,GAAG,CAAC,oBAAoB,EAAE,2BAA2B,EAAE,6BAA6B,EAAE,oBAAoB,CAAC,CAAC;AAEjI,MAAM,aAAa,GAAG,kDAAkD,CAAC;AAazE;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,CAAS,EAAE,CAAS;IAClD,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACpC,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3B,MAAM,IAAI,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QACzC,IAAI,IAAI,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;IAC9B,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAI,GAAW,EAAE,CAAC,OAAO,EAAE;IAC7D,IAAI,MAAM,GAA2B,IAAI,CAAC;IAC1C,KAAK,MAAM,IAAI,IAAI,eAAe,EAAE,CAAC;QACnC,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAClC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,SAAS;QAClC,KAAK,MAAM,IAAI,IAAI,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;YACvC,MAAM,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YAC9C,IAAI,OAAO,KAAK,SAAS;gBAAE,SAAS;YACpC,IAAI,MAAM,KAAK,IAAI,IAAI,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;gBAAE,MAAM,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,CAAC;QACvH,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -4,28 +4,34 @@ export declare const ViewerLocationSchema: z.ZodEnum<{
|
|
|
4
4
|
panel: "panel";
|
|
5
5
|
sidebar: "sidebar";
|
|
6
6
|
}>;
|
|
7
|
+
/** Value of `ViewerLocationSchema`: `panel` for an editor tab, `sidebar` for the side bar. */
|
|
7
8
|
export type ViewerLocation = z.infer<typeof ViewerLocationSchema>;
|
|
8
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* @brief What `configureViewer` did to the workspace settings.
|
|
11
|
+
*
|
|
12
|
+
* @property kind - `written` when the file changed, `unchanged` when it already held the values, `unreadable` when the file is not plain JSON (comments, trailing commas); nothing is written then.
|
|
13
|
+
* @property file - Absolute path of `.vscode/settings.json`.
|
|
14
|
+
* @property settings - Values that would have been written; present only with `unreadable`.
|
|
15
|
+
*/
|
|
9
16
|
export type ViewerSettingsResult = {
|
|
10
17
|
kind: "written";
|
|
11
18
|
file: string;
|
|
12
19
|
} | {
|
|
13
20
|
kind: "unchanged";
|
|
14
21
|
file: string;
|
|
15
|
-
}
|
|
16
|
-
/** The file exists but is not plain JSON (comments, trailing commas); nothing was written */
|
|
17
|
-
| {
|
|
22
|
+
} | {
|
|
18
23
|
kind: "unreadable";
|
|
19
24
|
file: string;
|
|
20
25
|
settings: Record<string, unknown>;
|
|
21
26
|
};
|
|
22
27
|
/**
|
|
23
|
-
* Points the project's VS Code workspace at the extension's native UI, the
|
|
28
|
+
* @brief Points the project's VS Code workspace at the extension's native UI, the
|
|
24
29
|
* surface mods draw on: sets where Claude opens and turns off terminal mode.
|
|
25
30
|
* Other settings in the file are kept.
|
|
26
31
|
*
|
|
27
|
-
* @param projectRoot - Absolute project root holding `.vscode
|
|
28
|
-
* @param location - Where Claude opens; when absent, a location already set is kept and `panel` is the default
|
|
32
|
+
* @param projectRoot - Absolute project root holding `.vscode/`.
|
|
33
|
+
* @param location - Where Claude opens; when absent, a location already set is kept and `panel` is the default.
|
|
34
|
+
* @returns What was done to the settings file.
|
|
29
35
|
*/
|
|
30
36
|
export declare function configureViewer(projectRoot: string, location?: ViewerLocation): ViewerSettingsResult;
|
|
31
37
|
//# sourceMappingURL=settings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/viewer/settings.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,sFAAsF;AACtF,eAAO,MAAM,oBAAoB;;;EAA+B,CAAC;AAEjE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAQlE
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/viewer/settings.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,sFAAsF;AACtF,eAAO,MAAM,oBAAoB;;;EAA+B,CAAC;AAEjE,8FAA8F;AAC9F,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAQlE;;;;;;GAMG;AACH,MAAM,MAAM,oBAAoB,GAC5B;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACnC;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAAC;AAE5E;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,cAAc,GAAG,oBAAoB,CAkBpG"}
|
package/dist/viewer/settings.js
CHANGED
|
@@ -9,12 +9,13 @@ const LOCATION_KEY = "claudeCode.preferredLocation";
|
|
|
9
9
|
const TERMINAL_KEY = "claudeCode.useTerminal";
|
|
10
10
|
const SettingsSchema = z.record(z.string(), z.unknown());
|
|
11
11
|
/**
|
|
12
|
-
* Points the project's VS Code workspace at the extension's native UI, the
|
|
12
|
+
* @brief Points the project's VS Code workspace at the extension's native UI, the
|
|
13
13
|
* surface mods draw on: sets where Claude opens and turns off terminal mode.
|
|
14
14
|
* Other settings in the file are kept.
|
|
15
15
|
*
|
|
16
|
-
* @param projectRoot - Absolute project root holding `.vscode
|
|
17
|
-
* @param location - Where Claude opens; when absent, a location already set is kept and `panel` is the default
|
|
16
|
+
* @param projectRoot - Absolute project root holding `.vscode/`.
|
|
17
|
+
* @param location - Where Claude opens; when absent, a location already set is kept and `panel` is the default.
|
|
18
|
+
* @returns What was done to the settings file.
|
|
18
19
|
*/
|
|
19
20
|
export function configureViewer(projectRoot, location) {
|
|
20
21
|
const file = path.join(projectRoot, SETTINGS_FILE);
|
|
@@ -33,6 +34,12 @@ export function configureViewer(projectRoot, location) {
|
|
|
33
34
|
fs.writeFileSync(file, JSON.stringify({ ...current, ...wanted }, null, 2) + "\n");
|
|
34
35
|
return { kind: "written", file };
|
|
35
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* @brief Parses JSON text, returning `undefined` instead of throwing.
|
|
39
|
+
*
|
|
40
|
+
* @param text - Raw file contents, e.g. the text of a `settings.json` file.
|
|
41
|
+
* @returns The parsed value, or `undefined` when the text is not valid JSON.
|
|
42
|
+
*/
|
|
36
43
|
function safeJson(text) {
|
|
37
44
|
try {
|
|
38
45
|
return JSON.parse(text);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../src/viewer/settings.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,sFAAsF;AACtF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../src/viewer/settings.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,OA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OAAO,CAAC,EAAE,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,CAAC;IAC3G,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;IAEjF,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;IAE/G,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACtD,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,OAAO,EAAE,GAAG,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAClF,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AACnC,CAAC;AAED;;;;;GAKG;AACH,SAAS,QAAQ,CAAC,IAAY;IAC5B,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAY,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@g3nomaly/mods",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Installer for Claude Code mods: registers mod sources and installs, updates and removes mods from them.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"mods": "bun run src/cli/index.ts"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@g3nomaly/core": "^0.3.
|
|
26
|
+
"@g3nomaly/core": "^0.3.2",
|
|
27
27
|
"chalk": "^6.0.0",
|
|
28
28
|
"commander": "^15.0.0",
|
|
29
29
|
"zod": "^4.4.3"
|