loadouts 0.1.11
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/LICENSE +201 -0
- package/README.md +108 -0
- package/bundled/loadouts/loadouts.yaml +5 -0
- package/bundled/skills/loadout-usage/SKILL.md +110 -0
- package/dist/builtins/index.d.ts +14 -0
- package/dist/builtins/index.d.ts.map +1 -0
- package/dist/builtins/index.js +58 -0
- package/dist/builtins/index.js.map +1 -0
- package/dist/builtins/kinds/extension.d.ts +3 -0
- package/dist/builtins/kinds/extension.d.ts.map +1 -0
- package/dist/builtins/kinds/extension.js +9 -0
- package/dist/builtins/kinds/extension.js.map +1 -0
- package/dist/builtins/kinds/instruction.d.ts +3 -0
- package/dist/builtins/kinds/instruction.d.ts.map +1 -0
- package/dist/builtins/kinds/instruction.js +8 -0
- package/dist/builtins/kinds/instruction.js.map +1 -0
- package/dist/builtins/kinds/prompt.d.ts +3 -0
- package/dist/builtins/kinds/prompt.d.ts.map +1 -0
- package/dist/builtins/kinds/prompt.js +8 -0
- package/dist/builtins/kinds/prompt.js.map +1 -0
- package/dist/builtins/kinds/rule.d.ts +3 -0
- package/dist/builtins/kinds/rule.d.ts.map +1 -0
- package/dist/builtins/kinds/rule.js +10 -0
- package/dist/builtins/kinds/rule.js.map +1 -0
- package/dist/builtins/kinds/skill.d.ts +3 -0
- package/dist/builtins/kinds/skill.d.ts.map +1 -0
- package/dist/builtins/kinds/skill.js +8 -0
- package/dist/builtins/kinds/skill.js.map +1 -0
- package/dist/builtins/kinds/theme.d.ts +3 -0
- package/dist/builtins/kinds/theme.d.ts.map +1 -0
- package/dist/builtins/kinds/theme.js +8 -0
- package/dist/builtins/kinds/theme.js.map +1 -0
- package/dist/builtins/tools/claude-code.d.ts +3 -0
- package/dist/builtins/tools/claude-code.d.ts.map +1 -0
- package/dist/builtins/tools/claude-code.js +30 -0
- package/dist/builtins/tools/claude-code.js.map +1 -0
- package/dist/builtins/tools/codex.d.ts +3 -0
- package/dist/builtins/tools/codex.d.ts.map +1 -0
- package/dist/builtins/tools/codex.js +17 -0
- package/dist/builtins/tools/codex.js.map +1 -0
- package/dist/builtins/tools/cursor.d.ts +3 -0
- package/dist/builtins/tools/cursor.d.ts.map +1 -0
- package/dist/builtins/tools/cursor.js +22 -0
- package/dist/builtins/tools/cursor.js.map +1 -0
- package/dist/builtins/tools/opencode.d.ts +3 -0
- package/dist/builtins/tools/opencode.d.ts.map +1 -0
- package/dist/builtins/tools/opencode.js +45 -0
- package/dist/builtins/tools/opencode.js.map +1 -0
- package/dist/builtins/tools/pi.d.ts +3 -0
- package/dist/builtins/tools/pi.d.ts.map +1 -0
- package/dist/builtins/tools/pi.js +22 -0
- package/dist/builtins/tools/pi.js.map +1 -0
- package/dist/cli/commands/activate.d.ts +12 -0
- package/dist/cli/commands/activate.d.ts.map +1 -0
- package/dist/cli/commands/activate.js +70 -0
- package/dist/cli/commands/activate.js.map +1 -0
- package/dist/cli/commands/check.d.ts +12 -0
- package/dist/cli/commands/check.d.ts.map +1 -0
- package/dist/cli/commands/check.js +152 -0
- package/dist/cli/commands/check.js.map +1 -0
- package/dist/cli/commands/clear.d.ts +12 -0
- package/dist/cli/commands/clear.d.ts.map +1 -0
- package/dist/cli/commands/clear.js +25 -0
- package/dist/cli/commands/clear.js.map +1 -0
- package/dist/cli/commands/create.d.ts +11 -0
- package/dist/cli/commands/create.d.ts.map +1 -0
- package/dist/cli/commands/create.js +113 -0
- package/dist/cli/commands/create.js.map +1 -0
- package/dist/cli/commands/deactivate.d.ts +12 -0
- package/dist/cli/commands/deactivate.d.ts.map +1 -0
- package/dist/cli/commands/deactivate.js +67 -0
- package/dist/cli/commands/deactivate.js.map +1 -0
- package/dist/cli/commands/diff.d.ts +16 -0
- package/dist/cli/commands/diff.d.ts.map +1 -0
- package/dist/cli/commands/diff.js +144 -0
- package/dist/cli/commands/diff.js.map +1 -0
- package/dist/cli/commands/docs.d.ts +12 -0
- package/dist/cli/commands/docs.d.ts.map +1 -0
- package/dist/cli/commands/docs.js +115 -0
- package/dist/cli/commands/docs.js.map +1 -0
- package/dist/cli/commands/edit.d.ts +11 -0
- package/dist/cli/commands/edit.d.ts.map +1 -0
- package/dist/cli/commands/edit.js +71 -0
- package/dist/cli/commands/edit.js.map +1 -0
- package/dist/cli/commands/fallback.d.ts +9 -0
- package/dist/cli/commands/fallback.d.ts.map +1 -0
- package/dist/cli/commands/fallback.js +35 -0
- package/dist/cli/commands/fallback.js.map +1 -0
- package/dist/cli/commands/info.d.ts +23 -0
- package/dist/cli/commands/info.d.ts.map +1 -0
- package/dist/cli/commands/info.js +314 -0
- package/dist/cli/commands/info.js.map +1 -0
- package/dist/cli/commands/init.d.ts +18 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +255 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/install.d.ts +27 -0
- package/dist/cli/commands/install.d.ts.map +1 -0
- package/dist/cli/commands/install.js +586 -0
- package/dist/cli/commands/install.js.map +1 -0
- package/dist/cli/commands/instructions.d.ts +8 -0
- package/dist/cli/commands/instructions.d.ts.map +1 -0
- package/dist/cli/commands/instructions.js +218 -0
- package/dist/cli/commands/instructions.js.map +1 -0
- package/dist/cli/commands/kinds.d.ts +6 -0
- package/dist/cli/commands/kinds.d.ts.map +1 -0
- package/dist/cli/commands/kinds.js +59 -0
- package/dist/cli/commands/kinds.js.map +1 -0
- package/dist/cli/commands/list.d.ts +12 -0
- package/dist/cli/commands/list.d.ts.map +1 -0
- package/dist/cli/commands/list.js +182 -0
- package/dist/cli/commands/list.js.map +1 -0
- package/dist/cli/commands/policy.d.ts +28 -0
- package/dist/cli/commands/policy.d.ts.map +1 -0
- package/dist/cli/commands/policy.js +50 -0
- package/dist/cli/commands/policy.js.map +1 -0
- package/dist/cli/commands/remove.d.ts +24 -0
- package/dist/cli/commands/remove.d.ts.map +1 -0
- package/dist/cli/commands/remove.js +64 -0
- package/dist/cli/commands/remove.js.map +1 -0
- package/dist/cli/commands/render-engine.d.ts +36 -0
- package/dist/cli/commands/render-engine.d.ts.map +1 -0
- package/dist/cli/commands/render-engine.js +177 -0
- package/dist/cli/commands/render-engine.js.map +1 -0
- package/dist/cli/commands/rule.d.ts +11 -0
- package/dist/cli/commands/rule.d.ts.map +1 -0
- package/dist/cli/commands/rule.js +302 -0
- package/dist/cli/commands/rule.js.map +1 -0
- package/dist/cli/commands/sanitize.d.ts +14 -0
- package/dist/cli/commands/sanitize.d.ts.map +1 -0
- package/dist/cli/commands/sanitize.js +62 -0
- package/dist/cli/commands/sanitize.js.map +1 -0
- package/dist/cli/commands/skill.d.ts +11 -0
- package/dist/cli/commands/skill.d.ts.map +1 -0
- package/dist/cli/commands/skill.js +380 -0
- package/dist/cli/commands/skill.js.map +1 -0
- package/dist/cli/commands/status.d.ts +26 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +454 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/sync.d.ts +14 -0
- package/dist/cli/commands/sync.d.ts.map +1 -0
- package/dist/cli/commands/sync.js +53 -0
- package/dist/cli/commands/sync.js.map +1 -0
- package/dist/cli/commands/update.d.ts +3 -0
- package/dist/cli/commands/update.d.ts.map +1 -0
- package/dist/cli/commands/update.js +48 -0
- package/dist/cli/commands/update.js.map +1 -0
- package/dist/cli/index.d.ts +11 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +134 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/core/config.d.ts +64 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +166 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/discovery.d.ts +50 -0
- package/dist/core/discovery.d.ts.map +1 -0
- package/dist/core/discovery.js +249 -0
- package/dist/core/discovery.js.map +1 -0
- package/dist/core/fallback.d.ts +23 -0
- package/dist/core/fallback.d.ts.map +1 -0
- package/dist/core/fallback.js +119 -0
- package/dist/core/fallback.js.map +1 -0
- package/dist/core/import-discovery.d.ts +56 -0
- package/dist/core/import-discovery.d.ts.map +1 -0
- package/dist/core/import-discovery.js +304 -0
- package/dist/core/import-discovery.js.map +1 -0
- package/dist/core/kindLoader.d.ts +119 -0
- package/dist/core/kindLoader.d.ts.map +1 -0
- package/dist/core/kindLoader.js +141 -0
- package/dist/core/kindLoader.js.map +1 -0
- package/dist/core/manifest.d.ts +39 -0
- package/dist/core/manifest.d.ts.map +1 -0
- package/dist/core/manifest.js +167 -0
- package/dist/core/manifest.js.map +1 -0
- package/dist/core/plugin.d.ts +22 -0
- package/dist/core/plugin.d.ts.map +1 -0
- package/dist/core/plugin.js +20 -0
- package/dist/core/plugin.js.map +1 -0
- package/dist/core/registry.d.ts +115 -0
- package/dist/core/registry.d.ts.map +1 -0
- package/dist/core/registry.js +105 -0
- package/dist/core/registry.js.map +1 -0
- package/dist/core/render.d.ts +64 -0
- package/dist/core/render.d.ts.map +1 -0
- package/dist/core/render.js +457 -0
- package/dist/core/render.js.map +1 -0
- package/dist/core/resolve.d.ts +39 -0
- package/dist/core/resolve.d.ts.map +1 -0
- package/dist/core/resolve.js +128 -0
- package/dist/core/resolve.js.map +1 -0
- package/dist/core/schema.d.ts +308 -0
- package/dist/core/schema.d.ts.map +1 -0
- package/dist/core/schema.js +81 -0
- package/dist/core/schema.js.map +1 -0
- package/dist/core/scope.d.ts +74 -0
- package/dist/core/scope.d.ts.map +1 -0
- package/dist/core/scope.js +176 -0
- package/dist/core/scope.js.map +1 -0
- package/dist/core/template.d.ts +32 -0
- package/dist/core/template.d.ts.map +1 -0
- package/dist/core/template.js +32 -0
- package/dist/core/template.js.map +1 -0
- package/dist/core/tokens.d.ts +33 -0
- package/dist/core/tokens.d.ts.map +1 -0
- package/dist/core/tokens.js +97 -0
- package/dist/core/tokens.js.map +1 -0
- package/dist/core/types.d.ts +103 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +10 -0
- package/dist/core/types.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/artifact-paths.d.ts +39 -0
- package/dist/lib/artifact-paths.d.ts.map +1 -0
- package/dist/lib/artifact-paths.js +83 -0
- package/dist/lib/artifact-paths.js.map +1 -0
- package/dist/lib/artifact-table.d.ts +126 -0
- package/dist/lib/artifact-table.d.ts.map +1 -0
- package/dist/lib/artifact-table.js +263 -0
- package/dist/lib/artifact-table.js.map +1 -0
- package/dist/lib/editor.d.ts +17 -0
- package/dist/lib/editor.d.ts.map +1 -0
- package/dist/lib/editor.js +33 -0
- package/dist/lib/editor.js.map +1 -0
- package/dist/lib/fs.d.ts +87 -0
- package/dist/lib/fs.d.ts.map +1 -0
- package/dist/lib/fs.js +229 -0
- package/dist/lib/fs.js.map +1 -0
- package/dist/lib/git.d.ts +13 -0
- package/dist/lib/git.d.ts.map +1 -0
- package/dist/lib/git.js +28 -0
- package/dist/lib/git.js.map +1 -0
- package/dist/lib/gitignore.d.ts +26 -0
- package/dist/lib/gitignore.d.ts.map +1 -0
- package/dist/lib/gitignore.js +97 -0
- package/dist/lib/gitignore.js.map +1 -0
- package/dist/lib/loadout-column.d.ts +66 -0
- package/dist/lib/loadout-column.d.ts.map +1 -0
- package/dist/lib/loadout-column.js +66 -0
- package/dist/lib/loadout-column.js.map +1 -0
- package/dist/lib/output.d.ts +15 -0
- package/dist/lib/output.d.ts.map +1 -0
- package/dist/lib/output.js +32 -0
- package/dist/lib/output.js.map +1 -0
- package/dist/lib/scope-indicators.d.ts +60 -0
- package/dist/lib/scope-indicators.d.ts.map +1 -0
- package/dist/lib/scope-indicators.js +110 -0
- package/dist/lib/scope-indicators.js.map +1 -0
- package/docs/authoring.md +182 -0
- package/docs/commands.md +192 -0
- package/docs/concepts.md +114 -0
- package/docs/index.md +60 -0
- package/docs/quickstart.md +100 -0
- package/docs/troubleshooting.md +147 -0
- package/docs/visual-language.md +251 -0
- package/docs/workflows.md +184 -0
- package/package.json +54 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../../src/builtins/tools/claude-code.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAavD,eAAO,MAAM,cAAc,EAAE,QAgB5B,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as path from "node:path";
|
|
2
|
+
import * as os from "node:os";
|
|
3
|
+
/**
|
|
4
|
+
* Claude Code reads CLAUDE.md (not AGENTS.md). We generate a thin wrapper
|
|
5
|
+
* that references the canonical AGENTS.md so both files stay in sync.
|
|
6
|
+
*/
|
|
7
|
+
const CLAUDE_WRAPPER = `# Claude Code Instructions
|
|
8
|
+
|
|
9
|
+
> This file is auto-generated by Loadouts. Edit .loadouts/AGENTS.md instead.
|
|
10
|
+
|
|
11
|
+
See [AGENTS.md](AGENTS.md) for project instructions.
|
|
12
|
+
`;
|
|
13
|
+
export const claudeCodeTool = {
|
|
14
|
+
name: "claude-code",
|
|
15
|
+
basePath: {
|
|
16
|
+
global: path.join(os.homedir(), ".claude"),
|
|
17
|
+
project: ".claude",
|
|
18
|
+
},
|
|
19
|
+
supports: ["rule", "skill", "instruction"],
|
|
20
|
+
targets: {
|
|
21
|
+
rule: { path: "{base}/rules/{stem}.md" },
|
|
22
|
+
skill: { path: "{base}/skills/{name}" },
|
|
23
|
+
instruction: {
|
|
24
|
+
path: { project: "CLAUDE.md", global: "{home}/CLAUDE.md" },
|
|
25
|
+
mode: "generate",
|
|
26
|
+
generate: () => CLAUDE_WRAPPER,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=claude-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../../src/builtins/tools/claude-code.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAG9B;;;GAGG;AACH,MAAM,cAAc,GAAG;;;;;CAKtB,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAa;IACtC,IAAI,EAAE,aAAa;IACnB,QAAQ,EAAE;QACR,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,CAAC;QAC1C,OAAO,EAAE,SAAS;KACnB;IACD,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,aAAa,CAAC;IAC1C,OAAO,EAAE;QACP,IAAI,EAAE,EAAE,IAAI,EAAE,wBAAwB,EAAE;QACxC,KAAK,EAAE,EAAE,IAAI,EAAE,sBAAsB,EAAE;QACvC,WAAW,EAAE;YACX,IAAI,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,kBAAkB,EAAE;YAC1D,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE,GAAG,EAAE,CAAC,cAAc;SAC/B;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../../src/builtins/tools/codex.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEvD,eAAO,MAAM,SAAS,EAAE,QAavB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as path from "node:path";
|
|
2
|
+
import * as os from "node:os";
|
|
3
|
+
export const codexTool = {
|
|
4
|
+
name: "codex",
|
|
5
|
+
basePath: {
|
|
6
|
+
global: path.join(os.homedir(), ".agents"),
|
|
7
|
+
project: ".agents",
|
|
8
|
+
},
|
|
9
|
+
supports: ["skill", "instruction"],
|
|
10
|
+
targets: {
|
|
11
|
+
skill: { path: "{base}/skills/{name}" },
|
|
12
|
+
instruction: {
|
|
13
|
+
path: { project: "AGENTS.md", global: "{home}/AGENTS.md" },
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=codex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex.js","sourceRoot":"","sources":["../../../src/builtins/tools/codex.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAG9B,MAAM,CAAC,MAAM,SAAS,GAAa;IACjC,IAAI,EAAE,OAAO;IACb,QAAQ,EAAE;QACR,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,CAAC;QAC1C,OAAO,EAAE,SAAS;KACnB;IACD,QAAQ,EAAE,CAAC,OAAO,EAAE,aAAa,CAAC;IAClC,OAAO,EAAE;QACP,KAAK,EAAE,EAAE,IAAI,EAAE,sBAAsB,EAAE;QACvC,WAAW,EAAE;YACX,IAAI,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,kBAAkB,EAAE;SAC3D;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../../src/builtins/tools/cursor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEvD,eAAO,MAAM,UAAU,EAAE,QAkBxB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as path from "node:path";
|
|
2
|
+
import * as os from "node:os";
|
|
3
|
+
export const cursorTool = {
|
|
4
|
+
name: "cursor",
|
|
5
|
+
basePath: {
|
|
6
|
+
global: path.join(os.homedir(), ".cursor"),
|
|
7
|
+
project: ".cursor",
|
|
8
|
+
},
|
|
9
|
+
supports: ["rule", "skill", "instruction"],
|
|
10
|
+
targets: {
|
|
11
|
+
// Cursor requires .mdc extension and expects paths/globs mirrored.
|
|
12
|
+
rule: {
|
|
13
|
+
path: "{base}/rules/{stem}.mdc",
|
|
14
|
+
transform: "cursor-frontmatter",
|
|
15
|
+
},
|
|
16
|
+
skill: { path: "{base}/skills/{name}" },
|
|
17
|
+
instruction: {
|
|
18
|
+
path: { project: "AGENTS.md", global: "{home}/AGENTS.md" },
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=cursor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../../src/builtins/tools/cursor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAG9B,MAAM,CAAC,MAAM,UAAU,GAAa;IAClC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE;QACR,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,CAAC;QAC1C,OAAO,EAAE,SAAS;KACnB;IACD,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,aAAa,CAAC;IAC1C,OAAO,EAAE;QACP,mEAAmE;QACnE,IAAI,EAAE;YACJ,IAAI,EAAE,yBAAyB;YAC/B,SAAS,EAAE,oBAAoB;SAChC;QACD,KAAK,EAAE,EAAE,IAAI,EAAE,sBAAsB,EAAE;QACvC,WAAW,EAAE;YACX,IAAI,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,kBAAkB,EAAE;SAC3D;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opencode.d.ts","sourceRoot":"","sources":["../../../src/builtins/tools/opencode.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAsCvD,eAAO,MAAM,YAAY,EAAE,QAe1B,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as path from "node:path";
|
|
2
|
+
import * as os from "node:os";
|
|
3
|
+
import { readFile, fileExists } from "../../lib/fs.js";
|
|
4
|
+
async function validate(scope) {
|
|
5
|
+
const projectRoot = scope === "global" ? os.homedir() : process.cwd();
|
|
6
|
+
const configPath = path.join(projectRoot, "opencode.json");
|
|
7
|
+
const warnings = [];
|
|
8
|
+
const errors = [];
|
|
9
|
+
if (!fileExists(configPath)) {
|
|
10
|
+
warnings.push("opencode.json not found. OpenCode rules require the opencode-rules plugin.");
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
try {
|
|
14
|
+
const config = JSON.parse(readFile(configPath));
|
|
15
|
+
const hasPlugin = config.plugins?.includes("opencode-rules") ||
|
|
16
|
+
config.plugins?.some((p) => typeof p === "object" &&
|
|
17
|
+
p !== null &&
|
|
18
|
+
p.name === "opencode-rules");
|
|
19
|
+
if (!hasPlugin) {
|
|
20
|
+
warnings.push('opencode-rules plugin not configured. Add "opencode-rules" to plugins in opencode.json.');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
warnings.push("Could not parse opencode.json to check for rules plugin.");
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return { valid: errors.length === 0, warnings, errors };
|
|
28
|
+
}
|
|
29
|
+
export const opencodeTool = {
|
|
30
|
+
name: "opencode",
|
|
31
|
+
basePath: {
|
|
32
|
+
global: path.join(os.homedir(), ".config", "opencode"),
|
|
33
|
+
project: ".opencode",
|
|
34
|
+
},
|
|
35
|
+
supports: ["rule", "skill", "instruction"],
|
|
36
|
+
targets: {
|
|
37
|
+
rule: { path: "{base}/rules/{stem}.md" },
|
|
38
|
+
skill: { path: "{base}/skills/{name}" },
|
|
39
|
+
instruction: {
|
|
40
|
+
path: { project: "AGENTS.md", global: "{home}/AGENTS.md" },
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
validate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AC,MAAM,CAAC;YACP,QAAQ,CAAC,IAAI,CAAC,0DAA0D,CAAC,CAAC;QAC5E,CAAC;IACH,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AAC1D,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAAa;IACpC,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE;QACR,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC;QACtD,OAAO,EAAE,WAAW;KACrB;IACD,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,aAAa,CAAC;IAC1C,OAAO,EAAE;QACP,IAAI,EAAE,EAAE,IAAI,EAAE,wBAAwB,EAAE;QACxC,KAAK,EAAE,EAAE,IAAI,EAAE,sBAAsB,EAAE;QACvC,WAAW,EAAE;YACX,IAAI,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,kBAAkB,EAAE;SAC3D;KACF;IACD,QAAQ;CACT,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pi.d.ts","sourceRoot":"","sources":["../../../src/builtins/tools/pi.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEvD,eAAO,MAAM,MAAM,EAAE,QAkBpB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as path from "node:path";
|
|
2
|
+
import * as os from "node:os";
|
|
3
|
+
export const piTool = {
|
|
4
|
+
name: "pi",
|
|
5
|
+
basePath: {
|
|
6
|
+
global: path.join(os.homedir(), ".pi", "agent"),
|
|
7
|
+
project: ".pi",
|
|
8
|
+
},
|
|
9
|
+
// Note: "rule" intentionally omitted - pi has no native rules concept.
|
|
10
|
+
// Users can map rules to prompts if needed, or use a compatibility extension.
|
|
11
|
+
supports: ["skill", "instruction", "prompt", "extension", "theme"],
|
|
12
|
+
targets: {
|
|
13
|
+
skill: { path: "{base}/skills/{name}" },
|
|
14
|
+
instruction: {
|
|
15
|
+
path: { project: "AGENTS.md", global: "{home}/AGENTS.md" },
|
|
16
|
+
},
|
|
17
|
+
prompt: { path: "{base}/prompts/{stem}.md" },
|
|
18
|
+
extension: { path: "{base}/extensions/{stem}.ts" },
|
|
19
|
+
theme: { path: "{base}/themes/{stem}.json" },
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=pi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pi.js","sourceRoot":"","sources":["../../../src/builtins/tools/pi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAG9B,MAAM,CAAC,MAAM,MAAM,GAAa;IAC9B,IAAI,EAAE,IAAI;IACV,QAAQ,EAAE;QACR,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC;QAC/C,OAAO,EAAE,KAAK;KACf;IACD,uEAAuE;IACvE,8EAA8E;IAC9E,QAAQ,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,CAAC;IAClE,OAAO,EAAE;QACP,KAAK,EAAE,EAAE,IAAI,EAAE,sBAAsB,EAAE;QACvC,WAAW,EAAE;YACX,IAAI,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,kBAAkB,EAAE;SAC3D;QACD,MAAM,EAAE,EAAE,IAAI,EAAE,0BAA0B,EAAE;QAC5C,SAAS,EAAE,EAAE,IAAI,EAAE,6BAA6B,EAAE;QAClD,KAAK,EAAE,EAAE,IAAI,EAAE,2BAA2B,EAAE;KAC7C;CACF,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* loadout activate — Add loadout(s) to the active set.
|
|
3
|
+
*
|
|
4
|
+
* Scope flags:
|
|
5
|
+
* -l / --local → project scope only
|
|
6
|
+
* -g / --global → global scope only
|
|
7
|
+
* -a / --all → activate in both scopes
|
|
8
|
+
* (none) → auto-detect; error if name exists in both
|
|
9
|
+
*/
|
|
10
|
+
import { Command } from "commander";
|
|
11
|
+
export declare const activateCommand: Command;
|
|
12
|
+
//# sourceMappingURL=activate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activate.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/activate.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkBpC,eAAO,MAAM,eAAe,SA2DxB,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* loadout activate — Add loadout(s) to the active set.
|
|
3
|
+
*
|
|
4
|
+
* Scope flags:
|
|
5
|
+
* -l / --local → project scope only
|
|
6
|
+
* -g / --global → global scope only
|
|
7
|
+
* -a / --all → activate in both scopes
|
|
8
|
+
* (none) → auto-detect; error if name exists in both
|
|
9
|
+
*/
|
|
10
|
+
import { Command } from "commander";
|
|
11
|
+
import { getContext } from "../../core/discovery.js";
|
|
12
|
+
import { loadState } from "../../core/manifest.js";
|
|
13
|
+
import { resolveContexts, requireScopeForName, SCOPE_FLAGS, } from "../../core/scope.js";
|
|
14
|
+
import { computeActivateSet } from "./policy.js";
|
|
15
|
+
import { applyTargetSet } from "./render-engine.js";
|
|
16
|
+
import { log } from "../../lib/output.js";
|
|
17
|
+
export const activateCommand = new Command("activate")
|
|
18
|
+
.description("Activate loadout(s) (add to active set)")
|
|
19
|
+
.argument("<names...>", "Loadout names to activate")
|
|
20
|
+
.option(...SCOPE_FLAGS.local)
|
|
21
|
+
.option(...SCOPE_FLAGS.global)
|
|
22
|
+
.option(...SCOPE_FLAGS.all)
|
|
23
|
+
.option("--dry-run", "Preview changes without applying")
|
|
24
|
+
.action(async (names, options) => {
|
|
25
|
+
const cwd = process.cwd();
|
|
26
|
+
// If --all, activate in both scopes
|
|
27
|
+
if (options.all) {
|
|
28
|
+
const { contexts } = await resolveContexts(options, cwd);
|
|
29
|
+
for (const ctx of contexts) {
|
|
30
|
+
const current = loadState(ctx.configPath)?.active ?? [];
|
|
31
|
+
const { targets, earlyExit } = computeActivateSet(current, names);
|
|
32
|
+
if (earlyExit) {
|
|
33
|
+
log.warn(`[${ctx.scope}] ${earlyExit}`);
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
await applyTargetSet(ctx, targets, {
|
|
37
|
+
dryRun: options.dryRun,
|
|
38
|
+
verb: "Activated",
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
// Otherwise, resolve each name to its scope
|
|
44
|
+
// For simplicity, require all names to resolve to the same scope
|
|
45
|
+
// (or use explicit -l/-g)
|
|
46
|
+
let targetScope;
|
|
47
|
+
if (options.local) {
|
|
48
|
+
targetScope = "project";
|
|
49
|
+
}
|
|
50
|
+
else if (options.global) {
|
|
51
|
+
targetScope = "global";
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
// Auto-detect from first name, require all to match
|
|
55
|
+
targetScope = await requireScopeForName(names[0], options, cwd);
|
|
56
|
+
// Verify all names exist in that scope (let the render engine handle actual validation)
|
|
57
|
+
}
|
|
58
|
+
const ctx = await getContext(targetScope, cwd);
|
|
59
|
+
const current = loadState(ctx.configPath)?.active ?? [];
|
|
60
|
+
const { targets, earlyExit } = computeActivateSet(current, names);
|
|
61
|
+
if (earlyExit) {
|
|
62
|
+
log.error(earlyExit);
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
await applyTargetSet(ctx, targets, {
|
|
66
|
+
dryRun: options.dryRun,
|
|
67
|
+
verb: "Activated",
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
//# sourceMappingURL=activate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activate.js","sourceRoot":"","sources":["../../../src/cli/commands/activate.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,WAAW,GAEZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAO1C,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC;KACnD,WAAW,CAAC,yCAAyC,CAAC;KACtD,QAAQ,CAAC,YAAY,EAAE,2BAA2B,CAAC;KACnD,MAAM,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC;KAC5B,MAAM,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC;KAC7B,MAAM,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC;KAC1B,MAAM,CAAC,WAAW,EAAE,kCAAkC,CAAC;KACvD,MAAM,CAAC,KAAK,EAAE,KAAe,EAAE,OAAwB,EAAE,EAAE;IAC1D,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAE1B,oCAAoC;IACpC,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,eAAe,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QACzD,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;YAC3B,MAAM,OAA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AC,CAAC;IAClB,CAAC;IAED,MAAM,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE;QACjC,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,IAAI,EAAE,WAAW;KAClB,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* loadout check — Validate a loadout.
|
|
3
|
+
*
|
|
4
|
+
* Scope flags:
|
|
5
|
+
* -l / --local → project scope only
|
|
6
|
+
* -g / --global → global scope only
|
|
7
|
+
* -a / --all → check both scopes (default)
|
|
8
|
+
* (none) → all available scopes
|
|
9
|
+
*/
|
|
10
|
+
import { Command } from "commander";
|
|
11
|
+
export declare const checkCommand: Command;
|
|
12
|
+
//# sourceMappingURL=check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/check.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkHpC,eAAO,MAAM,YAAY,SAmErB,CAAC"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* loadout check — Validate a loadout.
|
|
3
|
+
*
|
|
4
|
+
* Scope flags:
|
|
5
|
+
* -l / --local → project scope only
|
|
6
|
+
* -g / --global → global scope only
|
|
7
|
+
* -a / --all → check both scopes (default)
|
|
8
|
+
* (none) → all available scopes
|
|
9
|
+
*/
|
|
10
|
+
import { Command } from "commander";
|
|
11
|
+
import * as os from "node:os";
|
|
12
|
+
import * as path from "node:path";
|
|
13
|
+
import { findNearestLoadoutRoot, getGlobalRoot, getProjectRoot, } from "../../core/discovery.js";
|
|
14
|
+
import { parseRootConfig, listLoadouts, parseLoadoutDefinition, } from "../../core/config.js";
|
|
15
|
+
import { resolveLoadout, getInstructionItem } from "../../core/resolve.js";
|
|
16
|
+
import { planRender } from "../../core/render.js";
|
|
17
|
+
import { registry } from "../../core/registry.js";
|
|
18
|
+
import { resolveScopes, SCOPE_FLAGS } from "../../core/scope.js";
|
|
19
|
+
import { fileExists } from "../../lib/fs.js";
|
|
20
|
+
import { log, heading, list } from "../../lib/output.js";
|
|
21
|
+
async function checkRoot(root, projectRoot, scope, verbose) {
|
|
22
|
+
let hasErrors = false;
|
|
23
|
+
let hasWarnings = false;
|
|
24
|
+
const scopeLabel = scope === "global" ? "Global" : "Project";
|
|
25
|
+
log.info(`Checking ${scopeLabel} (${root.path})`);
|
|
26
|
+
// Check root config
|
|
27
|
+
try {
|
|
28
|
+
parseRootConfig(root.path);
|
|
29
|
+
if (verbose) {
|
|
30
|
+
log.success(" loadouts.yaml valid");
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
catch (err) {
|
|
34
|
+
log.error(` loadouts.yaml invalid: ${err instanceof Error ? err.message : String(err)}`);
|
|
35
|
+
hasErrors = true;
|
|
36
|
+
}
|
|
37
|
+
// Check each loadout definition
|
|
38
|
+
const loadoutNames = listLoadouts(root.path);
|
|
39
|
+
for (const name of loadoutNames) {
|
|
40
|
+
const defPath = path.join(root.path, "loadouts", `${name}.yaml`);
|
|
41
|
+
const ymlPath = path.join(root.path, "loadouts", `${name}.yml`);
|
|
42
|
+
const filePath = fileExists(defPath) ? defPath : ymlPath;
|
|
43
|
+
try {
|
|
44
|
+
parseLoadoutDefinition(filePath);
|
|
45
|
+
if (verbose) {
|
|
46
|
+
log.success(` loadouts/${name}.yaml valid`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
log.error(` loadouts/${name}.yaml invalid: ${err instanceof Error ? err.message : String(err)}`);
|
|
51
|
+
hasErrors = true;
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
// Try to resolve the loadout
|
|
55
|
+
try {
|
|
56
|
+
const loadout = resolveLoadout(name, [root]);
|
|
57
|
+
if (verbose) {
|
|
58
|
+
log.success(` loadouts/${name}.yaml resolves`);
|
|
59
|
+
}
|
|
60
|
+
// Dry-run apply to check for collisions
|
|
61
|
+
const instructionItem = getInstructionItem(root.path, loadout.tools);
|
|
62
|
+
if (instructionItem) {
|
|
63
|
+
loadout.items.push(instructionItem);
|
|
64
|
+
}
|
|
65
|
+
const plan = await planRender(loadout, projectRoot, scope, root.path);
|
|
66
|
+
if (plan.errors.length > 0) {
|
|
67
|
+
log.warn(` ${name}: ${plan.errors.length} render errors`);
|
|
68
|
+
if (verbose) {
|
|
69
|
+
list(plan.errors);
|
|
70
|
+
}
|
|
71
|
+
hasWarnings = true;
|
|
72
|
+
}
|
|
73
|
+
if (plan.shadowed.length > 0) {
|
|
74
|
+
log.warn(` ${name}: ${plan.shadowed.length} outputs would be shadowed by unmanaged files`);
|
|
75
|
+
if (verbose) {
|
|
76
|
+
list(plan.shadowed.map((s) => s.targetPath));
|
|
77
|
+
}
|
|
78
|
+
hasWarnings = true;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
catch (err) {
|
|
82
|
+
log.error(` ${name}: failed to resolve: ${err instanceof Error ? err.message : String(err)}`);
|
|
83
|
+
hasErrors = true;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return { errors: hasErrors, warnings: hasWarnings };
|
|
87
|
+
}
|
|
88
|
+
export const checkCommand = new Command("check")
|
|
89
|
+
.description("Validate a loadout")
|
|
90
|
+
.option(...SCOPE_FLAGS.local)
|
|
91
|
+
.option(...SCOPE_FLAGS.global)
|
|
92
|
+
.option(...SCOPE_FLAGS.all)
|
|
93
|
+
.option("-v, --verbose", "Show detailed validation output")
|
|
94
|
+
.action(async (options) => {
|
|
95
|
+
const cwd = process.cwd();
|
|
96
|
+
const scopes = await resolveScopes(options, cwd);
|
|
97
|
+
let hasErrors = false;
|
|
98
|
+
let hasWarnings = false;
|
|
99
|
+
heading("Checking loadout");
|
|
100
|
+
console.log();
|
|
101
|
+
for (const scope of scopes) {
|
|
102
|
+
let root = null;
|
|
103
|
+
let projectRoot;
|
|
104
|
+
if (scope === "project") {
|
|
105
|
+
root = await findNearestLoadoutRoot(cwd);
|
|
106
|
+
projectRoot = await getProjectRoot(cwd);
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
root = getGlobalRoot();
|
|
110
|
+
projectRoot = os.homedir();
|
|
111
|
+
}
|
|
112
|
+
if (!root)
|
|
113
|
+
continue;
|
|
114
|
+
const result = await checkRoot(root, projectRoot, scope, !!options.verbose);
|
|
115
|
+
hasErrors = hasErrors || result.errors;
|
|
116
|
+
hasWarnings = hasWarnings || result.warnings;
|
|
117
|
+
console.log();
|
|
118
|
+
}
|
|
119
|
+
// Check tool prerequisites
|
|
120
|
+
log.info("Checking tool prerequisites");
|
|
121
|
+
for (const tool of registry.allTools()) {
|
|
122
|
+
if (tool.validate) {
|
|
123
|
+
const result = await tool.validate("project");
|
|
124
|
+
if (result.errors.length > 0) {
|
|
125
|
+
log.error(` ${tool.name}:`);
|
|
126
|
+
list(result.errors);
|
|
127
|
+
hasErrors = true;
|
|
128
|
+
}
|
|
129
|
+
else if (result.warnings.length > 0) {
|
|
130
|
+
log.warn(` ${tool.name}:`);
|
|
131
|
+
list(result.warnings);
|
|
132
|
+
hasWarnings = true;
|
|
133
|
+
}
|
|
134
|
+
else if (options.verbose) {
|
|
135
|
+
log.success(` ${tool.name}: OK`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
// Summary
|
|
140
|
+
console.log();
|
|
141
|
+
if (hasErrors) {
|
|
142
|
+
log.error("Validation failed with errors");
|
|
143
|
+
process.exit(1);
|
|
144
|
+
}
|
|
145
|
+
else if (hasWarnings) {
|
|
146
|
+
log.warn("Validation passed with warnings");
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
log.success("All checks passed");
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
//# sourceMappingURL=check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check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ACd,GAAG,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;QAC3C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;SAAM,IAAI,WAAW,EAAE,CAAC;QACvB,GAAG,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;IAC9C,CAAC;SAAM,CAAC;QACN,GAAG,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACnC,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* loadout clear — Deactivate all loadouts and remove outputs.
|
|
3
|
+
*
|
|
4
|
+
* Scope flags:
|
|
5
|
+
* -l / --local → project scope only
|
|
6
|
+
* -g / --global → global scope only
|
|
7
|
+
* -a / --all → clear both scopes (default)
|
|
8
|
+
* (none) → all available scopes
|
|
9
|
+
*/
|
|
10
|
+
import { Command } from "commander";
|
|
11
|
+
export declare const clearCommand: Command;
|
|
12
|
+
//# sourceMappingURL=clear.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clear.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/clear.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,eAAO,MAAM,YAAY,SAYrB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* loadout clear — Deactivate all loadouts and remove outputs.
|
|
3
|
+
*
|
|
4
|
+
* Scope flags:
|
|
5
|
+
* -l / --local → project scope only
|
|
6
|
+
* -g / --global → global scope only
|
|
7
|
+
* -a / --all → clear both scopes (default)
|
|
8
|
+
* (none) → all available scopes
|
|
9
|
+
*/
|
|
10
|
+
import { Command } from "commander";
|
|
11
|
+
import { resolveContexts, SCOPE_FLAGS } from "../../core/scope.js";
|
|
12
|
+
import { clearAllOutputs } from "./render-engine.js";
|
|
13
|
+
export const clearCommand = new Command("clear")
|
|
14
|
+
.description("Deactivate all loadouts and remove outputs")
|
|
15
|
+
.option(...SCOPE_FLAGS.local)
|
|
16
|
+
.option(...SCOPE_FLAGS.global)
|
|
17
|
+
.option(...SCOPE_FLAGS.all)
|
|
18
|
+
.option("--dry-run", "Preview changes without applying")
|
|
19
|
+
.action(async (options) => {
|
|
20
|
+
const { contexts } = await resolveContexts(options);
|
|
21
|
+
for (const ctx of contexts) {
|
|
22
|
+
await clearAllOutputs(ctx, { dryRun: options.dryRun });
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=clear.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clear.js","sourceRoot":"","sources":["../../../src/cli/commands/clear.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAmB,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAMrD,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC;KAC7C,WAAW,CAAC,4CAA4C,CAAC;KACzD,MAAM,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC;KAC5B,MAAM,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC;KAC7B,MAAM,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC;KAC1B,MAAM,CAAC,WAAW,EAAE,kCAAkC,CAAC;KACvD,MAAM,CAAC,KAAK,EAAE,OAAqB,EAAE,EAAE;IACtC,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,eAAe,CAAC,OAAO,CAAC,CAAC;IAEpD,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC3B,MAAM,eAAe,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACzD,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* loadout create — Create a new loadout definition.
|
|
3
|
+
*
|
|
4
|
+
* Scope flags:
|
|
5
|
+
* -l / --local → create in project .loadouts/
|
|
6
|
+
* -g / --global → create in ~/.config/loadouts
|
|
7
|
+
* (none) → project if in one, else global
|
|
8
|
+
*/
|
|
9
|
+
import { Command } from "commander";
|
|
10
|
+
export declare const createCommand: Command;
|
|
11
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/create.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAepC,eAAO,MAAM,aAAa,SAoGtB,CAAC"}
|