@ironbee-ai/cli 0.8.2 → 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.
Files changed (143) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +48 -17
  3. package/dist/clients/claude/commands/ironbee-verify.md +19 -106
  4. package/dist/clients/claude/hooks/clear-verdict.d.ts.map +1 -1
  5. package/dist/clients/claude/hooks/clear-verdict.js +25 -4
  6. package/dist/clients/claude/hooks/clear-verdict.js.map +1 -1
  7. package/dist/clients/claude/hooks/require-verdict.d.ts +3 -3
  8. package/dist/clients/claude/hooks/require-verdict.d.ts.map +1 -1
  9. package/dist/clients/claude/hooks/require-verdict.js +26 -8
  10. package/dist/clients/claude/hooks/require-verdict.js.map +1 -1
  11. package/dist/clients/claude/hooks/require-verification.d.ts +6 -5
  12. package/dist/clients/claude/hooks/require-verification.d.ts.map +1 -1
  13. package/dist/clients/claude/hooks/require-verification.js +20 -17
  14. package/dist/clients/claude/hooks/require-verification.js.map +1 -1
  15. package/dist/clients/claude/hooks/track-action-monitor.d.ts.map +1 -1
  16. package/dist/clients/claude/hooks/track-action-monitor.js +4 -1
  17. package/dist/clients/claude/hooks/track-action-monitor.js.map +1 -1
  18. package/dist/clients/claude/hooks/track-action.d.ts +11 -8
  19. package/dist/clients/claude/hooks/track-action.d.ts.map +1 -1
  20. package/dist/clients/claude/hooks/track-action.js +14 -9
  21. package/dist/clients/claude/hooks/track-action.js.map +1 -1
  22. package/dist/clients/claude/index.d.ts.map +1 -1
  23. package/dist/clients/claude/index.js +79 -18
  24. package/dist/clients/claude/index.js.map +1 -1
  25. package/dist/clients/claude/platforms/command-verify.backend.md +74 -0
  26. package/dist/clients/claude/platforms/command-verify.browser.md +108 -0
  27. package/dist/clients/claude/platforms/command-verify.node.md +67 -0
  28. package/dist/clients/claude/platforms/rule.backend.md +23 -0
  29. package/dist/clients/claude/platforms/rule.browser.md +17 -0
  30. package/dist/clients/claude/{fragments → platforms}/rule.node.md +3 -3
  31. package/dist/clients/claude/platforms/skill.backend.md +65 -0
  32. package/dist/clients/claude/platforms/skill.browser.md +31 -0
  33. package/dist/clients/claude/{fragments → platforms}/skill.node.md +2 -2
  34. package/dist/clients/claude/rules/ironbee-verification.md +14 -13
  35. package/dist/clients/claude/skills/ironbee-verification.md +19 -49
  36. package/dist/clients/cursor/commands/ironbee-verify/SKILL.md +21 -108
  37. package/dist/clients/cursor/hooks/clear-verdict.d.ts.map +1 -1
  38. package/dist/clients/cursor/hooks/clear-verdict.js +31 -5
  39. package/dist/clients/cursor/hooks/clear-verdict.js.map +1 -1
  40. package/dist/clients/cursor/hooks/require-verdict.d.ts +1 -1
  41. package/dist/clients/cursor/hooks/require-verdict.d.ts.map +1 -1
  42. package/dist/clients/cursor/hooks/require-verdict.js +27 -6
  43. package/dist/clients/cursor/hooks/require-verdict.js.map +1 -1
  44. package/dist/clients/cursor/hooks/require-verification.d.ts.map +1 -1
  45. package/dist/clients/cursor/hooks/require-verification.js +9 -5
  46. package/dist/clients/cursor/hooks/require-verification.js.map +1 -1
  47. package/dist/clients/cursor/hooks/track-action-monitor.d.ts.map +1 -1
  48. package/dist/clients/cursor/hooks/track-action-monitor.js +4 -1
  49. package/dist/clients/cursor/hooks/track-action-monitor.js.map +1 -1
  50. package/dist/clients/cursor/hooks/track-action.d.ts +14 -12
  51. package/dist/clients/cursor/hooks/track-action.d.ts.map +1 -1
  52. package/dist/clients/cursor/hooks/track-action.js +25 -16
  53. package/dist/clients/cursor/hooks/track-action.js.map +1 -1
  54. package/dist/clients/cursor/index.d.ts.map +1 -1
  55. package/dist/clients/cursor/index.js +45 -11
  56. package/dist/clients/cursor/index.js.map +1 -1
  57. package/dist/clients/cursor/platforms/command-verify.backend.md +74 -0
  58. package/dist/clients/cursor/platforms/command-verify.browser.md +108 -0
  59. package/dist/clients/cursor/platforms/command-verify.node.md +67 -0
  60. package/dist/clients/cursor/platforms/rule.backend.md +23 -0
  61. package/dist/clients/cursor/platforms/rule.browser.md +17 -0
  62. package/dist/clients/cursor/{fragments → platforms}/rule.node.md +3 -3
  63. package/dist/clients/cursor/platforms/skill.backend.md +65 -0
  64. package/dist/clients/cursor/platforms/skill.browser.md +31 -0
  65. package/dist/clients/cursor/{fragments → platforms}/skill.node.md +2 -2
  66. package/dist/clients/cursor/rules/ironbee-verification.mdc +14 -13
  67. package/dist/clients/cursor/skills/ironbee-verification.md +19 -49
  68. package/dist/commands/backend.d.ts +17 -0
  69. package/dist/commands/backend.d.ts.map +1 -0
  70. package/dist/commands/backend.js +58 -0
  71. package/dist/commands/backend.js.map +1 -0
  72. package/dist/commands/browser.d.ts +19 -0
  73. package/dist/commands/browser.d.ts.map +1 -0
  74. package/dist/commands/browser.js +60 -0
  75. package/dist/commands/browser.js.map +1 -0
  76. package/dist/commands/config.d.ts +45 -10
  77. package/dist/commands/config.d.ts.map +1 -1
  78. package/dist/commands/config.js +80 -28
  79. package/dist/commands/config.js.map +1 -1
  80. package/dist/commands/cycle-toggle.d.ts +89 -0
  81. package/dist/commands/cycle-toggle.d.ts.map +1 -0
  82. package/dist/commands/cycle-toggle.js +264 -0
  83. package/dist/commands/cycle-toggle.js.map +1 -0
  84. package/dist/commands/disable-verification.d.ts.map +1 -1
  85. package/dist/commands/disable-verification.js +5 -2
  86. package/dist/commands/disable-verification.js.map +1 -1
  87. package/dist/commands/enable-verification.d.ts.map +1 -1
  88. package/dist/commands/enable-verification.js +5 -2
  89. package/dist/commands/enable-verification.js.map +1 -1
  90. package/dist/commands/node.d.ts +16 -0
  91. package/dist/commands/node.d.ts.map +1 -0
  92. package/dist/commands/node.js +57 -0
  93. package/dist/commands/node.js.map +1 -0
  94. package/dist/commands/verification-toggle.d.ts +18 -1
  95. package/dist/commands/verification-toggle.d.ts.map +1 -1
  96. package/dist/commands/verification-toggle.js +96 -21
  97. package/dist/commands/verification-toggle.js.map +1 -1
  98. package/dist/hooks/core/actions.d.ts +20 -2
  99. package/dist/hooks/core/actions.d.ts.map +1 -1
  100. package/dist/hooks/core/actions.js.map +1 -1
  101. package/dist/hooks/core/file-diff.d.ts +17 -0
  102. package/dist/hooks/core/file-diff.d.ts.map +1 -1
  103. package/dist/hooks/core/file-diff.js +72 -0
  104. package/dist/hooks/core/file-diff.js.map +1 -1
  105. package/dist/hooks/core/tool-use-stash.d.ts +7 -1
  106. package/dist/hooks/core/tool-use-stash.d.ts.map +1 -1
  107. package/dist/hooks/core/tool-use-stash.js.map +1 -1
  108. package/dist/hooks/core/verify-gate.d.ts.map +1 -1
  109. package/dist/hooks/core/verify-gate.js +44 -14
  110. package/dist/hooks/core/verify-gate.js.map +1 -1
  111. package/dist/index.js +9 -6
  112. package/dist/index.js.map +1 -1
  113. package/dist/lib/config.d.ts +218 -36
  114. package/dist/lib/config.d.ts.map +1 -1
  115. package/dist/lib/config.js +359 -95
  116. package/dist/lib/config.js.map +1 -1
  117. package/dist/lib/gitignore.d.ts +26 -11
  118. package/dist/lib/gitignore.d.ts.map +1 -1
  119. package/dist/lib/gitignore.js +71 -24
  120. package/dist/lib/gitignore.js.map +1 -1
  121. package/dist/lib/platform-section.d.ts +126 -0
  122. package/dist/lib/platform-section.d.ts.map +1 -0
  123. package/dist/lib/platform-section.js +279 -0
  124. package/dist/lib/platform-section.js.map +1 -0
  125. package/package.json +1 -1
  126. package/dist/clients/claude/fragments/command-verify.node.md +0 -33
  127. package/dist/clients/cursor/fragments/command-verify.node.md +0 -33
  128. package/dist/commands/backend-toggle.d.ts +0 -45
  129. package/dist/commands/backend-toggle.d.ts.map +0 -1
  130. package/dist/commands/backend-toggle.js +0 -192
  131. package/dist/commands/backend-toggle.js.map +0 -1
  132. package/dist/commands/disable-backend.d.ts +0 -14
  133. package/dist/commands/disable-backend.d.ts.map +0 -1
  134. package/dist/commands/disable-backend.js +0 -34
  135. package/dist/commands/disable-backend.js.map +0 -1
  136. package/dist/commands/enable-backend.d.ts +0 -15
  137. package/dist/commands/enable-backend.d.ts.map +0 -1
  138. package/dist/commands/enable-backend.js +0 -35
  139. package/dist/commands/enable-backend.js.map +0 -1
  140. package/dist/lib/runtime-section.d.ts +0 -118
  141. package/dist/lib/runtime-section.d.ts.map +0 -1
  142. package/dist/lib/runtime-section.js +0 -256
  143. package/dist/lib/runtime-section.js.map +0 -1
@@ -1,34 +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 output_1 = require("../lib/output");
18
- const backend_toggle_1 = require("./backend-toggle");
19
- exports.disableBackendCommand = new commander_1.Command("disable-backend")
20
- .description("Disable backend verification for a runtime in the current project (resets verifyPatterns to []; preserves other customizations).")
21
- .argument("<runtime>", `Runtime to disable. Available: ${(0, backend_toggle_1.knownRuntimes)().join(", ")}.`)
22
- .option("-p, --project-dir <dir>", "Project directory (default: cwd).")
23
- .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).`)
24
- .action((runtime, opts) => {
25
- try {
26
- const projectDir = opts.projectDir ?? process.cwd();
27
- (0, backend_toggle_1.applyDisableBackend)(runtime, projectDir, opts.client);
28
- }
29
- catch (e) {
30
- console.error(`${output_1.pc.red("✗")} ${e instanceof Error ? e.message : e}`);
31
- process.exit(1);
32
- }
33
- });
34
- //# sourceMappingURL=disable-backend.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"disable-backend.js","sourceRoot":"","sources":["../../src/commands/disable-backend.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAEH,yCAAoC;AACpC,kDAAkD;AAClD,0CAAmC;AACnC,qDAAsE;AAEzD,QAAA,qBAAqB,GAAY,IAAI,mBAAO,CAAC,iBAAiB,CAAC;KACvE,WAAW,CAAC,kIAAkI,CAAC;KAC/I,QAAQ,CAAC,WAAW,EAAE,kCAAkC,IAAA,8BAAa,GAAE,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;KACtF,MAAM,CAAC,yBAAyB,EAAE,mCAAmC,CAAC;KACtE,MAAM,CAAC,iBAAiB,EAAE,kDAAkD,IAAA,sBAAW,GAAE,kGAAkG,CAAC;KAC5L,MAAM,CAAC,CAAC,OAAe,EAAE,IAA8C,EAAQ,EAAE;IAC9E,IAAI,CAAC;QACD,MAAM,UAAU,GAAW,IAAI,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAC5D,IAAA,oCAAmB,EAAC,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1D,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,15 +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;AAKpC,eAAO,MAAM,oBAAoB,EAAE,OAa7B,CAAC"}
@@ -1,35 +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 output_1 = require("../lib/output");
19
- const backend_toggle_1 = require("./backend-toggle");
20
- exports.enableBackendCommand = new commander_1.Command("enable-backend")
21
- .description("Enable backend verification for a runtime in the current project (writes default verifyPatterns).")
22
- .argument("<runtime>", `Runtime to enable. Available: ${(0, backend_toggle_1.knownRuntimes)().join(", ")}.`)
23
- .option("-p, --project-dir <dir>", "Project directory (default: cwd).")
24
- .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).`)
25
- .action((runtime, opts) => {
26
- try {
27
- const projectDir = opts.projectDir ?? process.cwd();
28
- (0, backend_toggle_1.applyEnableBackend)(runtime, projectDir, opts.client);
29
- }
30
- catch (e) {
31
- console.error(`${output_1.pc.red("✗")} ${e instanceof Error ? e.message : e}`);
32
- process.exit(1);
33
- }
34
- });
35
- //# 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,0CAAmC;AACnC,qDAAqE;AAExD,QAAA,oBAAoB,GAAY,IAAI,mBAAO,CAAC,gBAAgB,CAAC;KACrE,WAAW,CAAC,mGAAmG,CAAC;KAChH,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,iBAAiB,EAAE,kDAAkD,IAAA,sBAAW,GAAE,kGAAkG,CAAC;KAC5L,MAAM,CAAC,CAAC,OAAe,EAAE,IAA8C,EAAQ,EAAE;IAC9E,IAAI,CAAC;QACD,MAAM,UAAU,GAAW,IAAI,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAC5D,IAAA,mCAAkB,EAAC,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACzD,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,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,EAC3C,YAAY,CAAC,EAAE,MAAM,EAAE,GACxB,MAAM,EAAE,CAiCV;AAED;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CACvC,UAAU,EAAE,MAAM,EAClB,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GAC5C,IAAI,CAON"}
@@ -1,256 +0,0 @@
1
- "use strict";
2
- /**
3
- * Runtime-section toggling for skill / rule / command markdown files.
4
- *
5
- * Each agent-facing markdown file (skill, rule, slash command) carries one
6
- * or more marker blocks per backend runtime. Two marker syntaxes are
7
- * supported:
8
- *
9
- * <!--IRONBEE:RUNTIME:node-->
10
- * ...content here...
11
- * <!--/IRONBEE:RUNTIME:node-->
12
- *
13
- * (the unkeyed form — handy when a file only needs a single block per
14
- * runtime), and:
15
- *
16
- * <!--IRONBEE:RUNTIME:node:tldr-->
17
- * ...short heads-up content...
18
- * <!--/IRONBEE:RUNTIME:node:tldr-->
19
- * ...
20
- * <!--IRONBEE:RUNTIME:node:full-->
21
- * ...detailed flow...
22
- * <!--/IRONBEE:RUNTIME:node:full-->
23
- *
24
- * (the keyed form — handy when the same runtime needs different content at
25
- * different positions in the same file: short summary up top, full flow at
26
- * the bottom, etc.). Keys are alphanumeric + hyphen.
27
- *
28
- * Two states per block:
29
- * - **disabled** — replaced with a short placeholder telling the agent
30
- * the runtime is off and reminding them not to invoke runtime tools
31
- * when the backend isn't actually that runtime.
32
- * - **enabled** — replaced with the full guidance fragment for that
33
- * runtime + key.
34
- *
35
- * `ironbee install` writes one or the other based on config state at
36
- * install time. `ironbee enable-backend <runtime>` /
37
- * `disable-backend <runtime>` flip already-installed files in place — no
38
- * re-install needed. The marker block (and its key) is preserved on every
39
- * flip so the toggle is always reversible.
40
- */
41
- Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.RUNTIME_TARGETS = void 0;
43
- exports.applyRuntimeSection = applyRuntimeSection;
44
- exports.fragmentFilename = fragmentFilename;
45
- exports.readFragment = readFragment;
46
- exports.toggleRuntimeSectionInFile = toggleRuntimeSectionInFile;
47
- exports.applyRuntimeToProjectFiles = applyRuntimeToProjectFiles;
48
- exports.syncRuntimeSectionsToConfig = syncRuntimeSectionsToConfig;
49
- const fs_1 = require("fs");
50
- const logger_1 = require("./logger");
51
- const config_1 = require("./config");
52
- /** Per-runtime placeholder content (shown when runtime is disabled). */
53
- const PLACEHOLDERS = {
54
- node: [
55
- "<!-- Node backend verification is OFF for this project.",
56
- " - If your backend is Node.js: run `ironbee enable-backend node` to enable.",
57
- " This file will be auto-updated with the node-cycle guidance.",
58
- " - If your backend is Java / Python / Go / Rust / .NET / Ruby / PHP / Elixir / etc.:",
59
- " leave this OFF — `ndt_*` tools only attach to V8/Node processes and will fail elsewhere.",
60
- " - When OFF, do NOT invoke any `ndt_*` tools voluntarily. -->",
61
- ].join("\n"),
62
- };
63
- /** Escape a runtime name for use inside a regex. Runtime names are short
64
- * ASCII identifiers but be defensive anyway. */
65
- function escapeRegex(s) {
66
- return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
67
- }
68
- /** Build the start-marker regex for a runtime. The captured group is the
69
- * optional key (empty when the keyless form is used). */
70
- function startMarkerRegex(runtime) {
71
- return new RegExp(`<!--IRONBEE:RUNTIME:${escapeRegex(runtime)}(?::([\\w-]+))?-->`, "g");
72
- }
73
- /** Build the end marker for a runtime + key. Key may be empty for keyless. */
74
- function endMarkerFor(runtime, key) {
75
- return key.length > 0
76
- ? `<!--/IRONBEE:RUNTIME:${runtime}:${key}-->`
77
- : `<!--/IRONBEE:RUNTIME:${runtime}-->`;
78
- }
79
- function findMarkerBlocks(content, runtime, fileLabel) {
80
- const re = startMarkerRegex(runtime);
81
- const blocks = [];
82
- const keysSeen = new Set();
83
- let m = re.exec(content);
84
- while (m !== null) {
85
- const key = m[1] ?? "";
86
- const startEnd = m.index + m[0].length;
87
- const endMarker = endMarkerFor(runtime, key);
88
- const endIdx = content.indexOf(endMarker, startEnd);
89
- if (endIdx === -1) {
90
- const labelSuffix = fileLabel ? ` in ${fileLabel}` : "";
91
- const keyDisplay = key.length > 0 ? `${runtime}:${key}` : runtime;
92
- logger_1.logger.debug(`runtime-section ${keyDisplay}: start marker found without matching end marker${labelSuffix}`);
93
- m = re.exec(content);
94
- continue;
95
- }
96
- if (keysSeen.has(key)) {
97
- const labelSuffix = fileLabel ? ` in ${fileLabel}` : "";
98
- const keyDisplay = key.length > 0 ? `${runtime}:${key}` : runtime;
99
- logger_1.logger.warn(`runtime-section ${keyDisplay}: multiple marker blocks with the same key${labelSuffix} — only the first will be updated. ` +
100
- `Either consolidate the blocks or use distinct keys (\`IRONBEE:RUNTIME:${runtime}:<key>\`) per position.`);
101
- m = re.exec(content);
102
- continue;
103
- }
104
- keysSeen.add(key);
105
- blocks.push({ key, startEnd, endIdx });
106
- m = re.exec(content);
107
- }
108
- return blocks;
109
- }
110
- /**
111
- * Replace the contents of every runtime-section marker block for `runtime`
112
- * in `fileContent`. Returns the new content (or the original content if no
113
- * markers are found).
114
- *
115
- * Each block in the file is independently resolved. The same runtime can
116
- * have multiple blocks distinguished by their key — see file header for
117
- * the syntax. Blocks that share a key are still treated as a structural
118
- * bug: only the first is updated and a warning is emitted.
119
- *
120
- * The markers themselves are preserved so the operation is reversible.
121
- */
122
- function applyRuntimeSection(fileContent, runtime, replacement, fileLabel) {
123
- const getRepl = typeof replacement === "function"
124
- ? replacement
125
- : () => replacement;
126
- const blocks = findMarkerBlocks(fileContent, runtime, fileLabel);
127
- if (blocks.length === 0) {
128
- return fileContent;
129
- }
130
- const placeholder = PLACEHOLDERS[runtime];
131
- if (placeholder === undefined) {
132
- throw new Error(`No placeholder registered for runtime '${runtime}'.`);
133
- }
134
- // Apply replacements in REVERSE so earlier indices stay valid as we
135
- // splice. Keep each marker pair intact; only the inner content moves.
136
- let result = fileContent;
137
- for (let i = blocks.length - 1; i >= 0; i--) {
138
- const b = blocks[i];
139
- const inner = getRepl(b.key) ?? placeholder;
140
- const before = result.substring(0, b.startEnd);
141
- const after = result.substring(b.endIdx);
142
- result = `${before}\n${inner}\n${after}`;
143
- }
144
- return result;
145
- }
146
- /**
147
- * Build the on-disk fragment filename for `(fragmentBase, runtime, key)`:
148
- * - keyless block (`key === ""`) → `<base>.<runtime>.md`
149
- * - keyed block → `<base>.<runtime>.<key>.md`
150
- */
151
- function fragmentFilename(fragmentBase, runtime, key) {
152
- return key.length > 0
153
- ? `${fragmentBase}.${runtime}.${key}.md`
154
- : `${fragmentBase}.${runtime}.md`;
155
- }
156
- /** Read a fragment file from `${baseDir}/${name}`. Throws when missing. */
157
- function readFragment(baseDir, name) {
158
- const path = `${baseDir}/${name}`;
159
- if (!(0, fs_1.existsSync)(path)) {
160
- throw new Error(`Runtime fragment not found: ${path}`);
161
- }
162
- return (0, fs_1.readFileSync)(path, "utf-8").trimEnd();
163
- }
164
- /**
165
- * Read the file at `targetPath`, apply the runtime section toggle, and
166
- * write back if the content actually changed. No-op when the marker is
167
- * missing.
168
- */
169
- function toggleRuntimeSectionInFile(targetPath, runtime, replacement) {
170
- if (!(0, fs_1.existsSync)(targetPath)) {
171
- return false;
172
- }
173
- const original = (0, fs_1.readFileSync)(targetPath, "utf-8");
174
- const updated = applyRuntimeSection(original, runtime, replacement, targetPath);
175
- if (updated === original) {
176
- return false;
177
- }
178
- (0, fs_1.writeFileSync)(targetPath, updated);
179
- return true;
180
- }
181
- /** Project files that carry runtime markers, per client. */
182
- exports.RUNTIME_TARGETS = {
183
- claude: [
184
- { projectRelativePath: ".claude/skills/ironbee-verification.md", fragmentBase: "skill" },
185
- { projectRelativePath: ".claude/rules/ironbee-verification.md", fragmentBase: "rule" },
186
- { projectRelativePath: ".claude/commands/ironbee-verify.md", fragmentBase: "command-verify" },
187
- ],
188
- cursor: [
189
- { projectRelativePath: ".cursor/skills/ironbee-verification.md", fragmentBase: "skill" },
190
- { projectRelativePath: ".cursor/rules/ironbee-verification.mdc", fragmentBase: "rule" },
191
- { projectRelativePath: ".cursor/commands/ironbee-verify/SKILL.md", fragmentBase: "command-verify" },
192
- ],
193
- };
194
- /**
195
- * Toggle every runtime-section block (across every key) in every installed
196
- * md file across all known clients in `projectDir`. Files that don't exist
197
- * are silently skipped (the client may not be installed for this project).
198
- *
199
- * When `enabled === true`, fragments for each block's key are loaded from
200
- * `fragmentsDirFor(client)`. Missing fragment files for a key fall back to
201
- * the placeholder rather than crashing — the source md is the source of
202
- * truth for which keys exist; missing fragments are an authoring gap.
203
- *
204
- * Returns the list of project-relative paths that were updated.
205
- */
206
- function applyRuntimeToProjectFiles(projectDir, runtime, enabled, fragmentsDirFor, clientFilter) {
207
- const updated = [];
208
- const allClients = Object.keys(exports.RUNTIME_TARGETS);
209
- const clientsToApply = clientFilter === undefined
210
- ? allClients
211
- : allClients.filter((c) => clientFilter.includes(c));
212
- for (const client of clientsToApply) {
213
- const targets = exports.RUNTIME_TARGETS[client];
214
- const fragmentsDir = fragmentsDirFor(client);
215
- for (const t of targets) {
216
- const target = `${projectDir}/${t.projectRelativePath}`;
217
- if (!(0, fs_1.existsSync)(target)) {
218
- continue;
219
- }
220
- const resolver = enabled
221
- ? (key) => {
222
- const path = `${fragmentsDir}/${fragmentFilename(t.fragmentBase, runtime, key)}`;
223
- if (!(0, fs_1.existsSync)(path)) {
224
- const keyDisplay = key.length > 0 ? `${runtime}:${key}` : runtime;
225
- logger_1.logger.warn(`runtime-section ${keyDisplay}: missing fragment ${path} for ${t.projectRelativePath} — falling back to placeholder.`);
226
- return null;
227
- }
228
- return (0, fs_1.readFileSync)(path, "utf-8").trimEnd();
229
- }
230
- : null;
231
- if (toggleRuntimeSectionInFile(target, runtime, resolver)) {
232
- updated.push(t.projectRelativePath);
233
- }
234
- }
235
- }
236
- return updated;
237
- }
238
- /**
239
- * Sync every registered runtime's section in the project's installed md
240
- * files to match the current config state — ON when the runtime has
241
- * non-empty `backend.<runtime>.verifyPatterns`, OFF otherwise.
242
- *
243
- * Called by `ironbee install` right after the source md files are written
244
- * so that re-installing a project that already enabled a runtime preserves
245
- * the enabled fragment in the freshly-written files (instead of leaving
246
- * the source's empty marker block visible).
247
- */
248
- function syncRuntimeSectionsToConfig(projectDir, fragmentsDirFor) {
249
- const config = (0, config_1.loadConfig)(projectDir);
250
- for (const runtime of Object.keys(config_1.RUNTIME_TO_SERVER)) {
251
- const patterns = config.backend?.[runtime]?.verifyPatterns;
252
- const enabled = Array.isArray(patterns) && patterns.length > 0;
253
- applyRuntimeToProjectFiles(projectDir, runtime, enabled, fragmentsDirFor);
254
- }
255
- }
256
- //# sourceMappingURL=runtime-section.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime-section.js","sourceRoot":"","sources":["../../src/lib/runtime-section.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;;;AAyGH,kDA+BC;AAOD,4CAIC;AAGD,oCAMC;AAOD,gEAeC;AA8CD,gEAuCC;AAYD,kEAUC;AA3RD,2BAA6D;AAC7D,qCAAkC;AAClC,qCAAyD;AAEzD,wEAAwE;AACxE,MAAM,YAAY,GAA2B;IACzC,IAAI,EAAE;QACF,yDAAyD;QACzD,iFAAiF;QACjF,qEAAqE;QACrE,0FAA0F;QAC1F,iGAAiG;QACjG,mEAAmE;KACtE,CAAC,IAAI,CAAC,IAAI,CAAC;CACf,CAAC;AAEF;iDACiD;AACjD,SAAS,WAAW,CAAC,CAAS;IAC1B,OAAO,CAAC,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;AACpD,CAAC;AAED;0DA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