@ironbee-ai/cli 0.8.3 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +42 -17
- package/dist/clients/claude/commands/ironbee-verify.md +19 -106
- package/dist/clients/claude/hooks/require-verdict.d.ts +3 -3
- package/dist/clients/claude/hooks/require-verdict.js +5 -5
- package/dist/clients/claude/hooks/require-verification.d.ts +6 -5
- package/dist/clients/claude/hooks/require-verification.d.ts.map +1 -1
- package/dist/clients/claude/hooks/require-verification.js +20 -17
- package/dist/clients/claude/hooks/require-verification.js.map +1 -1
- package/dist/clients/claude/hooks/track-action-monitor.d.ts.map +1 -1
- package/dist/clients/claude/hooks/track-action-monitor.js +4 -1
- package/dist/clients/claude/hooks/track-action-monitor.js.map +1 -1
- package/dist/clients/claude/hooks/track-action.d.ts +11 -8
- package/dist/clients/claude/hooks/track-action.d.ts.map +1 -1
- package/dist/clients/claude/hooks/track-action.js +14 -9
- package/dist/clients/claude/hooks/track-action.js.map +1 -1
- package/dist/clients/claude/index.d.ts.map +1 -1
- package/dist/clients/claude/index.js +79 -18
- package/dist/clients/claude/index.js.map +1 -1
- package/dist/clients/claude/platforms/command-verify.backend.md +74 -0
- package/dist/clients/claude/platforms/command-verify.browser.md +108 -0
- package/dist/clients/claude/platforms/command-verify.node.md +67 -0
- package/dist/clients/claude/platforms/rule.backend.md +23 -0
- package/dist/clients/claude/platforms/rule.browser.md +17 -0
- package/dist/clients/claude/{fragments → platforms}/rule.node.md +3 -3
- package/dist/clients/claude/platforms/skill.backend.md +65 -0
- package/dist/clients/claude/platforms/skill.browser.md +31 -0
- package/dist/clients/claude/{fragments → platforms}/skill.node.md +2 -2
- package/dist/clients/claude/rules/ironbee-verification.md +14 -13
- package/dist/clients/claude/skills/ironbee-verification.md +19 -49
- package/dist/clients/cursor/commands/ironbee-verify/SKILL.md +21 -108
- package/dist/clients/cursor/hooks/require-verdict.d.ts +1 -1
- package/dist/clients/cursor/hooks/require-verdict.js +3 -3
- package/dist/clients/cursor/hooks/require-verification.d.ts.map +1 -1
- package/dist/clients/cursor/hooks/require-verification.js +9 -5
- package/dist/clients/cursor/hooks/require-verification.js.map +1 -1
- package/dist/clients/cursor/hooks/track-action-monitor.d.ts.map +1 -1
- package/dist/clients/cursor/hooks/track-action-monitor.js +4 -1
- package/dist/clients/cursor/hooks/track-action-monitor.js.map +1 -1
- package/dist/clients/cursor/hooks/track-action.d.ts +14 -12
- package/dist/clients/cursor/hooks/track-action.d.ts.map +1 -1
- package/dist/clients/cursor/hooks/track-action.js +25 -16
- package/dist/clients/cursor/hooks/track-action.js.map +1 -1
- package/dist/clients/cursor/index.d.ts.map +1 -1
- package/dist/clients/cursor/index.js +45 -11
- package/dist/clients/cursor/index.js.map +1 -1
- package/dist/clients/cursor/platforms/command-verify.backend.md +74 -0
- package/dist/clients/cursor/platforms/command-verify.browser.md +108 -0
- package/dist/clients/cursor/platforms/command-verify.node.md +67 -0
- package/dist/clients/cursor/platforms/rule.backend.md +23 -0
- package/dist/clients/cursor/platforms/rule.browser.md +17 -0
- package/dist/clients/cursor/{fragments → platforms}/rule.node.md +3 -3
- package/dist/clients/cursor/platforms/skill.backend.md +65 -0
- package/dist/clients/cursor/platforms/skill.browser.md +31 -0
- package/dist/clients/cursor/{fragments → platforms}/skill.node.md +2 -2
- package/dist/clients/cursor/rules/ironbee-verification.mdc +14 -13
- package/dist/clients/cursor/skills/ironbee-verification.md +19 -49
- package/dist/commands/backend.d.ts +17 -0
- package/dist/commands/backend.d.ts.map +1 -0
- package/dist/commands/backend.js +58 -0
- package/dist/commands/backend.js.map +1 -0
- package/dist/commands/browser.d.ts +19 -0
- package/dist/commands/browser.d.ts.map +1 -0
- package/dist/commands/browser.js +60 -0
- package/dist/commands/browser.js.map +1 -0
- package/dist/commands/config.d.ts +5 -5
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +13 -11
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/cycle-toggle.d.ts +89 -0
- package/dist/commands/cycle-toggle.d.ts.map +1 -0
- package/dist/commands/cycle-toggle.js +264 -0
- package/dist/commands/cycle-toggle.js.map +1 -0
- package/dist/commands/node.d.ts +16 -0
- package/dist/commands/node.d.ts.map +1 -0
- package/dist/commands/node.js +57 -0
- package/dist/commands/node.js.map +1 -0
- package/dist/hooks/core/actions.d.ts +11 -2
- package/dist/hooks/core/actions.d.ts.map +1 -1
- package/dist/hooks/core/actions.js.map +1 -1
- package/dist/hooks/core/verify-gate.d.ts.map +1 -1
- package/dist/hooks/core/verify-gate.js +44 -14
- package/dist/hooks/core/verify-gate.js.map +1 -1
- package/dist/index.js +9 -6
- package/dist/index.js.map +1 -1
- package/dist/lib/config.d.ts +142 -41
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +251 -82
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/platform-section.d.ts +126 -0
- package/dist/lib/platform-section.d.ts.map +1 -0
- package/dist/lib/platform-section.js +279 -0
- package/dist/lib/platform-section.js.map +1 -0
- package/package.json +1 -1
- package/dist/clients/claude/fragments/command-verify.node.md +0 -33
- package/dist/clients/cursor/fragments/command-verify.node.md +0 -33
- package/dist/commands/backend-toggle.d.ts +0 -56
- package/dist/commands/backend-toggle.d.ts.map +0 -1
- package/dist/commands/backend-toggle.js +0 -199
- package/dist/commands/backend-toggle.js.map +0 -1
- package/dist/commands/disable-backend.d.ts +0 -14
- package/dist/commands/disable-backend.d.ts.map +0 -1
- package/dist/commands/disable-backend.js +0 -38
- package/dist/commands/disable-backend.js.map +0 -1
- package/dist/commands/enable-backend.d.ts +0 -15
- package/dist/commands/enable-backend.d.ts.map +0 -1
- package/dist/commands/enable-backend.js +0 -39
- package/dist/commands/enable-backend.js.map +0 -1
- package/dist/lib/runtime-section.d.ts +0 -118
- package/dist/lib/runtime-section.d.ts.map +0 -1
- package/dist/lib/runtime-section.js +0 -256
- package/dist/lib/runtime-section.js.map +0 -1
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Shared helpers for `enable-backend <runtime>` / `disable-backend <runtime>`.
|
|
4
|
-
*
|
|
5
|
-
* Per design §10 — opt-in activation for backend verification per runtime.
|
|
6
|
-
*
|
|
7
|
-
* - `applyEnableBackend(runtime, projectDir)` writes opinionated default
|
|
8
|
-
* `verifyPatterns` to the project config under `backend.<runtime>`.
|
|
9
|
-
* Refuses if patterns are already populated. Other fields
|
|
10
|
-
* (`alwaysRequired`, `evidencePaths`, `additionalVerifyPatterns`) are
|
|
11
|
-
* not written — they merge in from defaults at config-load time.
|
|
12
|
-
*
|
|
13
|
-
* - `applyDisableBackend(runtime, projectDir)` resets `verifyPatterns`
|
|
14
|
-
* to `[]` for the runtime, leaving customizations of other fields
|
|
15
|
-
* intact so a later re-enable restores them. Idempotent.
|
|
16
|
-
*
|
|
17
|
-
* Both throw when `<runtime>` isn't in the registered runtime set
|
|
18
|
-
* (today: just `node`); callers handle the error and exit.
|
|
19
|
-
*/
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.knownRuntimes = knownRuntimes;
|
|
22
|
-
exports.assertKnownRuntime = assertKnownRuntime;
|
|
23
|
-
exports.applyEnableBackend = applyEnableBackend;
|
|
24
|
-
exports.applyDisableBackend = applyDisableBackend;
|
|
25
|
-
const fs_1 = require("fs");
|
|
26
|
-
const path_1 = require("path");
|
|
27
|
-
const registry_1 = require("../clients/registry");
|
|
28
|
-
const logger_1 = require("../lib/logger");
|
|
29
|
-
const output_1 = require("../lib/output");
|
|
30
|
-
const config_1 = require("../lib/config");
|
|
31
|
-
const runtime_section_1 = require("../lib/runtime-section");
|
|
32
|
-
/**
|
|
33
|
-
* Locates the per-client fragments directory at runtime. Fragments live next
|
|
34
|
-
* to the compiled client code (`dist/clients/<client>/fragments/`), so we
|
|
35
|
-
* resolve relative to this file's location — same trick the install code
|
|
36
|
-
* uses to find skill/rule templates.
|
|
37
|
-
*/
|
|
38
|
-
function fragmentsDirFor(client) {
|
|
39
|
-
return (0, path_1.join)(__dirname, "..", "clients", client, "fragments");
|
|
40
|
-
}
|
|
41
|
-
/** Opinionated verifyPatterns written by `enable-backend <runtime>`. */
|
|
42
|
-
const RUNTIME_DEFAULT_VERIFY_PATTERNS = {
|
|
43
|
-
node: [
|
|
44
|
-
"server/**/*.{ts,js,mjs,cjs}",
|
|
45
|
-
"src/server/**/*.{ts,js,mjs,cjs}",
|
|
46
|
-
"backend/**/*.{ts,js,mjs,cjs}",
|
|
47
|
-
"api/**/*.{ts,js,mjs,cjs}",
|
|
48
|
-
"src/api/**/*.{ts,js,mjs,cjs}",
|
|
49
|
-
"pages/api/**/*.{ts,js,mjs,cjs}",
|
|
50
|
-
"app/api/**/*.{ts,js,mjs,cjs}",
|
|
51
|
-
"routes/**/*.{ts,js,mjs,cjs}",
|
|
52
|
-
"**/server.{ts,js,mjs,cjs}",
|
|
53
|
-
],
|
|
54
|
-
};
|
|
55
|
-
function knownRuntimes() {
|
|
56
|
-
const runtimes = [];
|
|
57
|
-
for (const server of config_1.BACKEND_SERVERS) {
|
|
58
|
-
const runtime = Object.keys(config_1.RUNTIME_TO_SERVER).find((k) => config_1.RUNTIME_TO_SERVER[k] === server);
|
|
59
|
-
if (runtime !== undefined) {
|
|
60
|
-
runtimes.push(runtime);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return runtimes;
|
|
64
|
-
}
|
|
65
|
-
function assertKnownRuntime(runtime) {
|
|
66
|
-
const known = knownRuntimes();
|
|
67
|
-
if (!known.includes(runtime)) {
|
|
68
|
-
throw new Error(`Unknown runtime '${runtime}'. Available: ${known.join(", ")}.`);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
function readLayerConfig(configPath) {
|
|
72
|
-
if (!(0, fs_1.existsSync)(configPath)) {
|
|
73
|
-
return {};
|
|
74
|
-
}
|
|
75
|
-
try {
|
|
76
|
-
return JSON.parse((0, fs_1.readFileSync)(configPath, "utf-8"));
|
|
77
|
-
}
|
|
78
|
-
catch (e) {
|
|
79
|
-
logger_1.logger.debug(`failed to read ${configPath}: ${e}`);
|
|
80
|
-
throw new Error(`Config at ${configPath} is not valid JSON: ${e instanceof Error ? e.message : e}`);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
function writeLayerConfig(configPath, config) {
|
|
84
|
-
(0, fs_1.mkdirSync)((0, path_1.join)(configPath, ".."), { recursive: true });
|
|
85
|
-
(0, fs_1.writeFileSync)(configPath, JSON.stringify(config, null, 2) + "\n");
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Resolve the client filter list passed to `applyRuntimeToProjectFiles`. We
|
|
89
|
-
* pass `undefined` for "all" so the helper iterates every registered client
|
|
90
|
-
* (its existsSync gate already skips clients without installed md files);
|
|
91
|
-
* for a specific name we pass `[name]`.
|
|
92
|
-
*
|
|
93
|
-
* Throws on unknown name. `clientName === "all" || undefined` returns
|
|
94
|
-
* undefined (== all clients).
|
|
95
|
-
*/
|
|
96
|
-
function clientFilterForRuntime(projectDir, clientName) {
|
|
97
|
-
if (clientName === undefined || clientName === "all") {
|
|
98
|
-
return undefined;
|
|
99
|
-
}
|
|
100
|
-
// resolveTargetClients validates the name and throws when unknown.
|
|
101
|
-
const clients = (0, registry_1.resolveTargetClients)(projectDir, clientName);
|
|
102
|
-
return clients.map((c) => c.name);
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Enable a backend runtime: write default `verifyPatterns` + splice the
|
|
106
|
-
* runtime fragment into installed skill/rule/command md files.
|
|
107
|
-
*
|
|
108
|
-
* No-op + warning when patterns are already populated **in the targeted
|
|
109
|
-
* layer** (the user must `disable-backend` first to reset, since we don't
|
|
110
|
-
* want to clobber their custom additions). Higher-priority layers' patterns
|
|
111
|
-
* are not consulted by this check — they ride along through `loadConfig`
|
|
112
|
-
* at runtime, but they don't shadow our writes the way they do for boolean
|
|
113
|
-
* `verification.enable` flips.
|
|
114
|
-
*
|
|
115
|
-
* `target` selects which config layer to write:
|
|
116
|
-
* - `"project"` (default) — committed `<project>/.ironbee/config.json`.
|
|
117
|
-
* - `"global"` — `~/.ironbee/config.json`.
|
|
118
|
-
* - `"local"` — gitignored `<project>/.ironbee/config.local.json`.
|
|
119
|
-
*
|
|
120
|
-
* `clientName`: optional filter for which clients' md files to update.
|
|
121
|
-
* Same semantics as `applyVerificationToggle` — `"all"` / `<name>` /
|
|
122
|
-
* undefined (default: every registered client; per-file existsSync gate
|
|
123
|
-
* skips ones without installed artifacts).
|
|
124
|
-
*/
|
|
125
|
-
function applyEnableBackend(runtime, projectDir, target, clientName) {
|
|
126
|
-
assertKnownRuntime(runtime);
|
|
127
|
-
const configPath = (0, config_1.getTargetConfigPath)(target, projectDir);
|
|
128
|
-
const config = readLayerConfig(configPath);
|
|
129
|
-
if (!config.backend) {
|
|
130
|
-
config.backend = {};
|
|
131
|
-
}
|
|
132
|
-
const block = config.backend[runtime] ?? {};
|
|
133
|
-
const existing = Array.isArray(block.verifyPatterns) ? block.verifyPatterns : [];
|
|
134
|
-
if (existing.length > 0) {
|
|
135
|
-
console.log(`${output_1.pc.yellow("⚠")} ${runtime} backend is already enabled in ${target} config (${output_1.pc.dim(configPath)}).\n` +
|
|
136
|
-
` Run ${output_1.pc.cyan(`ironbee disable-backend ${runtime}${target === "project" ? "" : ` --${target}`}`)} first, or empty the verifyPatterns array manually,\n` +
|
|
137
|
-
` then re-run enable-backend to re-apply defaults.`);
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
const defaults = RUNTIME_DEFAULT_VERIFY_PATTERNS[runtime];
|
|
141
|
-
if (defaults === undefined) {
|
|
142
|
-
throw new Error(`No opinionated default patterns registered for runtime '${runtime}'.`);
|
|
143
|
-
}
|
|
144
|
-
block.verifyPatterns = [...defaults];
|
|
145
|
-
config.backend[runtime] = block;
|
|
146
|
-
writeLayerConfig(configPath, config);
|
|
147
|
-
// Splice the runtime fragment into installed md files (skill/rule/command).
|
|
148
|
-
// `clientName` narrows the iteration; without it we sweep every registered
|
|
149
|
-
// client and rely on existsSync to skip ones without installed artifacts.
|
|
150
|
-
const clientFilter = clientFilterForRuntime(projectDir, clientName);
|
|
151
|
-
const updatedFiles = (0, runtime_section_1.applyRuntimeToProjectFiles)(projectDir, runtime, true, fragmentsDirFor, clientFilter);
|
|
152
|
-
console.log(`${output_1.pc.green("✓")} Enabled ${output_1.pc.bold(runtime)} backend verification in ${target} config (${output_1.pc.dim(configPath)}).`);
|
|
153
|
-
console.log(` ${output_1.pc.dim("Patterns applied to backend." + runtime + ".verifyPatterns:")}`);
|
|
154
|
-
for (const p of defaults) {
|
|
155
|
-
console.log(` ${output_1.pc.dim("- " + p)}`);
|
|
156
|
-
}
|
|
157
|
-
if (updatedFiles.length > 0) {
|
|
158
|
-
console.log(`\n ${output_1.pc.dim("Updated agent guidance files:")}`);
|
|
159
|
-
for (const f of updatedFiles) {
|
|
160
|
-
console.log(` ${output_1.pc.dim("- " + f)}`);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
console.log(`\n ${output_1.pc.dim("Edit the patterns to match your project, or add overrides via")} ${output_1.pc.cyan(`backend.${runtime}.additionalVerifyPatterns`)}${output_1.pc.dim(".")}`);
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Disable a backend runtime: reset `verifyPatterns` to `[]` in the
|
|
167
|
-
* targeted layer and reset the runtime fragment in installed
|
|
168
|
-
* skill/rule/command md files.
|
|
169
|
-
*
|
|
170
|
-
* Customizations of `alwaysRequired`, `evidencePaths`, and
|
|
171
|
-
* `additionalVerifyPatterns` are preserved (we only touch `verifyPatterns`).
|
|
172
|
-
* Idempotent — no-op when the targeted layer has no patterns to clear.
|
|
173
|
-
*
|
|
174
|
-
* `target` / `clientName` semantics match `applyEnableBackend`.
|
|
175
|
-
*/
|
|
176
|
-
function applyDisableBackend(runtime, projectDir, target, clientName) {
|
|
177
|
-
assertKnownRuntime(runtime);
|
|
178
|
-
const configPath = (0, config_1.getTargetConfigPath)(target, projectDir);
|
|
179
|
-
const config = readLayerConfig(configPath);
|
|
180
|
-
const block = config.backend?.[runtime];
|
|
181
|
-
const currentPatterns = Array.isArray(block?.verifyPatterns) ? block.verifyPatterns : [];
|
|
182
|
-
if (block === undefined || currentPatterns.length === 0) {
|
|
183
|
-
console.log(`${output_1.pc.dim("·")} ${runtime} backend already disabled in ${target} config (no-op).`);
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
block.verifyPatterns = [];
|
|
187
|
-
writeLayerConfig(configPath, config);
|
|
188
|
-
const clientFilter = clientFilterForRuntime(projectDir, clientName);
|
|
189
|
-
const updatedFiles = (0, runtime_section_1.applyRuntimeToProjectFiles)(projectDir, runtime, false, fragmentsDirFor, clientFilter);
|
|
190
|
-
console.log(`${output_1.pc.green("✓")} Disabled ${output_1.pc.bold(runtime)} backend verification in ${target} config (${output_1.pc.dim(configPath)}).`);
|
|
191
|
-
console.log(` ${output_1.pc.dim("Customizations of alwaysRequired, evidencePaths, additionalVerifyPatterns are preserved.")}`);
|
|
192
|
-
if (updatedFiles.length > 0) {
|
|
193
|
-
console.log(` ${output_1.pc.dim("Reset agent guidance for the runtime block in:")}`);
|
|
194
|
-
for (const f of updatedFiles) {
|
|
195
|
-
console.log(` ${output_1.pc.dim("- " + f)}`);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
//# sourceMappingURL=backend-toggle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"backend-toggle.js","sourceRoot":"","sources":["../../src/commands/backend-toggle.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;AAiDH,sCAWC;AAED,gDAKC;AA0DD,gDAqDC;AAaD,kDA6BC;AA1ND,2BAAwE;AACxE,+BAA4B;AAE5B,kDAA2D;AAC3D,0CAAuC;AACvC,0CAAmC;AACnC,0CAAsG;AACtG,4DA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,CAAC,GAAG,CAAC,MAAM,WAAE,CAAC,GAAG,CAAC,gDAAgD,CAAC,EAAE,CAAC,CAAC;QAC9E,KAAK,MAAM,CAAC,IAAI,YAAY,EAAE,CAAC;YAC3B,OAAO,CAAC,GAAG,CAAC,QAAQ,WAAE,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;QAC5C,CAAC;IACL,CAAC;AACL,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `ironbee disable-backend <runtime>`
|
|
3
|
-
*
|
|
4
|
-
* Disable backend verification for a runtime — resets `verifyPatterns` to
|
|
5
|
-
* `[]` for the runtime, leaving customizations of `alwaysRequired`,
|
|
6
|
-
* `evidencePaths`, and `additionalVerifyPatterns` intact so a later
|
|
7
|
-
* re-enable restores them. Idempotent.
|
|
8
|
-
*
|
|
9
|
-
* Pairs with `enable-backend` (separate file by design — both call shared
|
|
10
|
-
* helpers in `backend-toggle.ts`).
|
|
11
|
-
*/
|
|
12
|
-
import { Command } from "commander";
|
|
13
|
-
export declare const disableBackendCommand: Command;
|
|
14
|
-
//# sourceMappingURL=disable-backend.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"disable-backend.d.ts","sourceRoot":"","sources":["../../src/commands/disable-backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,eAAO,MAAM,qBAAqB,EAAE,OAgB9B,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* `ironbee disable-backend <runtime>`
|
|
4
|
-
*
|
|
5
|
-
* Disable backend verification for a runtime — resets `verifyPatterns` to
|
|
6
|
-
* `[]` for the runtime, leaving customizations of `alwaysRequired`,
|
|
7
|
-
* `evidencePaths`, and `additionalVerifyPatterns` intact so a later
|
|
8
|
-
* re-enable restores them. Idempotent.
|
|
9
|
-
*
|
|
10
|
-
* Pairs with `enable-backend` (separate file by design — both call shared
|
|
11
|
-
* helpers in `backend-toggle.ts`).
|
|
12
|
-
*/
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.disableBackendCommand = void 0;
|
|
15
|
-
const commander_1 = require("commander");
|
|
16
|
-
const registry_1 = require("../clients/registry");
|
|
17
|
-
const config_1 = require("../lib/config");
|
|
18
|
-
const output_1 = require("../lib/output");
|
|
19
|
-
const backend_toggle_1 = require("./backend-toggle");
|
|
20
|
-
exports.disableBackendCommand = new commander_1.Command("disable-backend")
|
|
21
|
-
.description("Disable backend verification for a runtime (resets verifyPatterns to []; preserves other customizations). Default target is the committed project config; -g writes global, --local writes the gitignored personal layer.")
|
|
22
|
-
.argument("<runtime>", `Runtime to disable. Available: ${(0, backend_toggle_1.knownRuntimes)().join(", ")}.`)
|
|
23
|
-
.option("-p, --project-dir <dir>", "Project directory (default: cwd).")
|
|
24
|
-
.option("-g, --global", "Write to the global config (~/.ironbee/config.json) instead of the project.")
|
|
25
|
-
.option("--local", "Write to the gitignored project-local override (<project>/.ironbee/config.local.json). Mutually exclusive with --global.")
|
|
26
|
-
.option("--client <name>", `Only update guidance md files for this client (${(0, registry_1.clientNames)()}), or "all". Default: every registered client (per-file existsSync gate skips uninstalled ones).`)
|
|
27
|
-
.action((runtime, opts) => {
|
|
28
|
-
try {
|
|
29
|
-
const projectDir = opts.projectDir ?? process.cwd();
|
|
30
|
-
const target = (0, config_1.resolveConfigTargetFromFlags)(opts);
|
|
31
|
-
(0, backend_toggle_1.applyDisableBackend)(runtime, projectDir, target, opts.client);
|
|
32
|
-
}
|
|
33
|
-
catch (e) {
|
|
34
|
-
console.error(`${output_1.pc.red("✗")} ${e instanceof Error ? e.message : e}`);
|
|
35
|
-
process.exit(1);
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
//# sourceMappingURL=disable-backend.js.map
|
|
@@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0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `ironbee enable-backend <runtime>`
|
|
3
|
-
*
|
|
4
|
-
* Opt-in activation for backend verification per runtime — writes
|
|
5
|
-
* opinionated default `verifyPatterns` to `backend.<runtime>` in project
|
|
6
|
-
* config and splices the runtime fragment into installed skill/rule/command
|
|
7
|
-
* md files. Refuses if patterns are already populated (the user must
|
|
8
|
-
* `disable-backend` first or clear them manually).
|
|
9
|
-
*
|
|
10
|
-
* Pairs with `disable-backend` (separate file by design — both call shared
|
|
11
|
-
* helpers in `backend-toggle.ts`).
|
|
12
|
-
*/
|
|
13
|
-
import { Command } from "commander";
|
|
14
|
-
export declare const enableBackendCommand: Command;
|
|
15
|
-
//# sourceMappingURL=enable-backend.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"enable-backend.d.ts","sourceRoot":"","sources":["../../src/commands/enable-backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,eAAO,MAAM,oBAAoB,EAAE,OAgB7B,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* `ironbee enable-backend <runtime>`
|
|
4
|
-
*
|
|
5
|
-
* Opt-in activation for backend verification per runtime — writes
|
|
6
|
-
* opinionated default `verifyPatterns` to `backend.<runtime>` in project
|
|
7
|
-
* config and splices the runtime fragment into installed skill/rule/command
|
|
8
|
-
* md files. Refuses if patterns are already populated (the user must
|
|
9
|
-
* `disable-backend` first or clear them manually).
|
|
10
|
-
*
|
|
11
|
-
* Pairs with `disable-backend` (separate file by design — both call shared
|
|
12
|
-
* helpers in `backend-toggle.ts`).
|
|
13
|
-
*/
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.enableBackendCommand = void 0;
|
|
16
|
-
const commander_1 = require("commander");
|
|
17
|
-
const registry_1 = require("../clients/registry");
|
|
18
|
-
const config_1 = require("../lib/config");
|
|
19
|
-
const output_1 = require("../lib/output");
|
|
20
|
-
const backend_toggle_1 = require("./backend-toggle");
|
|
21
|
-
exports.enableBackendCommand = new commander_1.Command("enable-backend")
|
|
22
|
-
.description("Enable backend verification for a runtime (writes default verifyPatterns). Default target is the committed project config; -g writes global, --local writes the gitignored personal layer.")
|
|
23
|
-
.argument("<runtime>", `Runtime to enable. Available: ${(0, backend_toggle_1.knownRuntimes)().join(", ")}.`)
|
|
24
|
-
.option("-p, --project-dir <dir>", "Project directory (default: cwd).")
|
|
25
|
-
.option("-g, --global", "Write to the global config (~/.ironbee/config.json) instead of the project.")
|
|
26
|
-
.option("--local", "Write to the gitignored project-local override (<project>/.ironbee/config.local.json). Mutually exclusive with --global.")
|
|
27
|
-
.option("--client <name>", `Only update guidance md files for this client (${(0, registry_1.clientNames)()}), or "all". Default: every registered client (per-file existsSync gate skips uninstalled ones).`)
|
|
28
|
-
.action((runtime, opts) => {
|
|
29
|
-
try {
|
|
30
|
-
const projectDir = opts.projectDir ?? process.cwd();
|
|
31
|
-
const target = (0, config_1.resolveConfigTargetFromFlags)(opts);
|
|
32
|
-
(0, backend_toggle_1.applyEnableBackend)(runtime, projectDir, target, opts.client);
|
|
33
|
-
}
|
|
34
|
-
catch (e) {
|
|
35
|
-
console.error(`${output_1.pc.red("✗")} ${e instanceof Error ? e.message : e}`);
|
|
36
|
-
process.exit(1);
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
//# sourceMappingURL=enable-backend.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"enable-backend.js","sourceRoot":"","sources":["../../src/commands/enable-backend.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAEH,yCAAoC;AACpC,kDAAkD;AAClD,0CAA2E;AAC3E,0CAAmC;AACnC,qDAAqE;AAExD,QAAA,oBAAoB,GAAY,IAAI,mBAAO,CAAC,gBAAgB,CAAC;KACrE,WAAW,CAAC,4LAA4L,CAAC;KACzM,QAAQ,CAAC,WAAW,EAAE,iCAAiC,IAAA,8BAAa,GAAE,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;KACrF,MAAM,CAAC,yBAAyB,EAAE,mCAAmC,CAAC;KACtE,MAAM,CAAC,cAAc,EAAE,6EAA6E,CAAC;KACrG,MAAM,CAAC,SAAS,EAAE,0HAA0H,CAAC;KAC7I,MAAM,CAAC,iBAAiB,EAAE,kDAAkD,IAAA,sBAAW,GAAE,kGAAkG,CAAC;KAC5L,MAAM,CAAC,CAAC,OAAe,EAAE,IAAiF,EAAQ,EAAE;IACjH,IAAI,CAAC;QACD,MAAM,UAAU,GAAW,IAAI,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAC5D,MAAM,MAAM,GAAiB,IAAA,qCAA4B,EAAC,IAAI,CAAC,CAAC;QAChE,IAAA,mCAAkB,EAAC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACjE,CAAC;IAAC,OAAO,CAAU,EAAE,CAAC;QAClB,OAAO,CAAC,KAAK,CAAC,GAAG,WAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACvE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Runtime-section toggling for skill / rule / command markdown files.
|
|
3
|
-
*
|
|
4
|
-
* Each agent-facing markdown file (skill, rule, slash command) carries one
|
|
5
|
-
* or more marker blocks per backend runtime. Two marker syntaxes are
|
|
6
|
-
* supported:
|
|
7
|
-
*
|
|
8
|
-
* <!--IRONBEE:RUNTIME:node-->
|
|
9
|
-
* ...content here...
|
|
10
|
-
* <!--/IRONBEE:RUNTIME:node-->
|
|
11
|
-
*
|
|
12
|
-
* (the unkeyed form — handy when a file only needs a single block per
|
|
13
|
-
* runtime), and:
|
|
14
|
-
*
|
|
15
|
-
* <!--IRONBEE:RUNTIME:node:tldr-->
|
|
16
|
-
* ...short heads-up content...
|
|
17
|
-
* <!--/IRONBEE:RUNTIME:node:tldr-->
|
|
18
|
-
* ...
|
|
19
|
-
* <!--IRONBEE:RUNTIME:node:full-->
|
|
20
|
-
* ...detailed flow...
|
|
21
|
-
* <!--/IRONBEE:RUNTIME:node:full-->
|
|
22
|
-
*
|
|
23
|
-
* (the keyed form — handy when the same runtime needs different content at
|
|
24
|
-
* different positions in the same file: short summary up top, full flow at
|
|
25
|
-
* the bottom, etc.). Keys are alphanumeric + hyphen.
|
|
26
|
-
*
|
|
27
|
-
* Two states per block:
|
|
28
|
-
* - **disabled** — replaced with a short placeholder telling the agent
|
|
29
|
-
* the runtime is off and reminding them not to invoke runtime tools
|
|
30
|
-
* when the backend isn't actually that runtime.
|
|
31
|
-
* - **enabled** — replaced with the full guidance fragment for that
|
|
32
|
-
* runtime + key.
|
|
33
|
-
*
|
|
34
|
-
* `ironbee install` writes one or the other based on config state at
|
|
35
|
-
* install time. `ironbee enable-backend <runtime>` /
|
|
36
|
-
* `disable-backend <runtime>` flip already-installed files in place — no
|
|
37
|
-
* re-install needed. The marker block (and its key) is preserved on every
|
|
38
|
-
* flip so the toggle is always reversible.
|
|
39
|
-
*/
|
|
40
|
-
/** Type accepted as the `replacement` argument to `applyRuntimeSection`.
|
|
41
|
-
*
|
|
42
|
-
* - `string` → used verbatim for every block (every key) of this runtime.
|
|
43
|
-
* - `null` → placeholder used for every block.
|
|
44
|
-
* - `(key: string) => string | null` → resolved per block; returning null
|
|
45
|
-
* uses the placeholder for that block.
|
|
46
|
-
*/
|
|
47
|
-
export type RuntimeReplacement = string | null | ((key: string) => string | null);
|
|
48
|
-
/**
|
|
49
|
-
* Replace the contents of every runtime-section marker block for `runtime`
|
|
50
|
-
* in `fileContent`. Returns the new content (or the original content if no
|
|
51
|
-
* markers are found).
|
|
52
|
-
*
|
|
53
|
-
* Each block in the file is independently resolved. The same runtime can
|
|
54
|
-
* have multiple blocks distinguished by their key — see file header for
|
|
55
|
-
* the syntax. Blocks that share a key are still treated as a structural
|
|
56
|
-
* bug: only the first is updated and a warning is emitted.
|
|
57
|
-
*
|
|
58
|
-
* The markers themselves are preserved so the operation is reversible.
|
|
59
|
-
*/
|
|
60
|
-
export declare function applyRuntimeSection(fileContent: string, runtime: string, replacement: RuntimeReplacement, fileLabel?: string): string;
|
|
61
|
-
/**
|
|
62
|
-
* Build the on-disk fragment filename for `(fragmentBase, runtime, key)`:
|
|
63
|
-
* - keyless block (`key === ""`) → `<base>.<runtime>.md`
|
|
64
|
-
* - keyed block → `<base>.<runtime>.<key>.md`
|
|
65
|
-
*/
|
|
66
|
-
export declare function fragmentFilename(fragmentBase: string, runtime: string, key: string): string;
|
|
67
|
-
/** Read a fragment file from `${baseDir}/${name}`. Throws when missing. */
|
|
68
|
-
export declare function readFragment(baseDir: string, name: string): string;
|
|
69
|
-
/**
|
|
70
|
-
* Read the file at `targetPath`, apply the runtime section toggle, and
|
|
71
|
-
* write back if the content actually changed. No-op when the marker is
|
|
72
|
-
* missing.
|
|
73
|
-
*/
|
|
74
|
-
export declare function toggleRuntimeSectionInFile(targetPath: string, runtime: string, replacement: RuntimeReplacement): boolean;
|
|
75
|
-
/**
|
|
76
|
-
* One md file in a project that carries runtime markers, paired with the
|
|
77
|
-
* fragment base name to use when the runtime is enabled. Fragments live in
|
|
78
|
-
* the compiled `dist/clients/<client>/fragments/` directory at runtime.
|
|
79
|
-
*
|
|
80
|
-
* The same `fragmentBase` is reused for every key in the file — keyed
|
|
81
|
-
* fragments add `.<key>` before the `.md` extension (see
|
|
82
|
-
* `fragmentFilename`). E.g. fragmentBase `"skill"` + runtime `"node"`
|
|
83
|
-
* resolves to `skill.node.md` for the keyless block, `skill.node.tldr.md`
|
|
84
|
-
* for the `tldr` keyed block, etc.
|
|
85
|
-
*/
|
|
86
|
-
export interface RuntimeTarget {
|
|
87
|
-
/** Project-relative path to the installed md file (e.g. `.claude/skills/...`). */
|
|
88
|
-
projectRelativePath: string;
|
|
89
|
-
/** Fragment file base — see `fragmentFilename` for the full naming rule. */
|
|
90
|
-
fragmentBase: string;
|
|
91
|
-
}
|
|
92
|
-
/** Project files that carry runtime markers, per client. */
|
|
93
|
-
export declare const RUNTIME_TARGETS: Record<string, RuntimeTarget[]>;
|
|
94
|
-
/**
|
|
95
|
-
* Toggle every runtime-section block (across every key) in every installed
|
|
96
|
-
* md file across all known clients in `projectDir`. Files that don't exist
|
|
97
|
-
* are silently skipped (the client may not be installed for this project).
|
|
98
|
-
*
|
|
99
|
-
* When `enabled === true`, fragments for each block's key are loaded from
|
|
100
|
-
* `fragmentsDirFor(client)`. Missing fragment files for a key fall back to
|
|
101
|
-
* the placeholder rather than crashing — the source md is the source of
|
|
102
|
-
* truth for which keys exist; missing fragments are an authoring gap.
|
|
103
|
-
*
|
|
104
|
-
* Returns the list of project-relative paths that were updated.
|
|
105
|
-
*/
|
|
106
|
-
export declare function applyRuntimeToProjectFiles(projectDir: string, runtime: string, enabled: boolean, fragmentsDirFor: (client: string) => string, clientFilter?: string[]): string[];
|
|
107
|
-
/**
|
|
108
|
-
* Sync every registered runtime's section in the project's installed md
|
|
109
|
-
* files to match the current config state — ON when the runtime has
|
|
110
|
-
* non-empty `backend.<runtime>.verifyPatterns`, OFF otherwise.
|
|
111
|
-
*
|
|
112
|
-
* Called by `ironbee install` right after the source md files are written
|
|
113
|
-
* so that re-installing a project that already enabled a runtime preserves
|
|
114
|
-
* the enabled fragment in the freshly-written files (instead of leaving
|
|
115
|
-
* the source's empty marker block visible).
|
|
116
|
-
*/
|
|
117
|
-
export declare function syncRuntimeSectionsToConfig(projectDir: string, fragmentsDirFor: (client: string) => string): void;
|
|
118
|
-
//# sourceMappingURL=runtime-section.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-section.d.ts","sourceRoot":"","sources":["../../src/lib/runtime-section.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAoFH;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC,CAAC;AAElF;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAC/B,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,kBAAkB,EAC/B,SAAS,CAAC,EAAE,MAAM,GACnB,MAAM,CA0BR;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAI3F;AAED,2EAA2E;AAC3E,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMlE;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACtC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,kBAAkB,GAChC,OAAO,CAWT;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,aAAa;IAC1B,kFAAkF;IAClF,mBAAmB,EAAE,MAAM,CAAC;IAC5B,4EAA4E;IAC5E,YAAY,EAAE,MAAM,CAAC;CACxB;AAED,4DAA4D;AAC5D,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,EAAE,CAW3D,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,0BAA0B,CACtC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,OAAO,EAChB,eAAe,EAAE,CAA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