@wrongstack/plugins 0.284.1 → 0.286.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/README.md +18 -14
- package/dist/accessibility-auditor/index.d.ts +38 -0
- package/dist/accessibility-auditor/index.d.ts.map +1 -0
- package/dist/accessibility-auditor.d.ts +2 -40
- package/dist/accessibility-auditor.js +10 -15
- package/dist/agent-handoff/index.d.ts +35 -0
- package/dist/agent-handoff/index.d.ts.map +1 -0
- package/dist/agent-handoff.d.ts +2 -37
- package/dist/agent-handoff.js +3 -2
- package/dist/api-compatibility-gate/index.d.ts +36 -0
- package/dist/api-compatibility-gate/index.d.ts.map +1 -0
- package/dist/api-compatibility-gate.d.ts +2 -38
- package/dist/api-compatibility-gate.js +6 -6
- package/dist/auto-doc/index.d.ts +20 -0
- package/dist/auto-doc/index.d.ts.map +1 -0
- package/dist/auto-doc.d.ts +2 -22
- package/dist/auto-doc.js +5 -5
- package/dist/auto-escalate/index.d.ts +43 -0
- package/dist/auto-escalate/index.d.ts.map +1 -0
- package/dist/auto-escalate.d.ts +2 -45
- package/dist/auto-escalate.js +5 -2
- package/dist/auto-i18n-extractor/index.d.ts +34 -0
- package/dist/auto-i18n-extractor/index.d.ts.map +1 -0
- package/dist/auto-i18n-extractor.d.ts +2 -36
- package/dist/auto-i18n-extractor.js +6 -7
- package/dist/branch-guard/index.d.ts +32 -0
- package/dist/branch-guard/index.d.ts.map +1 -0
- package/dist/branch-guard.d.ts +2 -34
- package/dist/branch-guard.js +4 -4
- package/dist/catalog.d.ts +39 -0
- package/dist/catalog.d.ts.map +1 -0
- package/dist/changelog-writer/index.d.ts +71 -0
- package/dist/changelog-writer/index.d.ts.map +1 -0
- package/dist/changelog-writer.d.ts +2 -73
- package/dist/changelog-writer.js +9 -5
- package/dist/checkpoint/index.d.ts +53 -0
- package/dist/checkpoint/index.d.ts.map +1 -0
- package/dist/checkpoint.d.ts +2 -55
- package/dist/checkpoint.js +6 -6
- package/dist/code-metrics/index.d.ts +29 -0
- package/dist/code-metrics/index.d.ts.map +1 -0
- package/dist/code-metrics.d.ts +2 -31
- package/dist/code-metrics.js +13 -15
- package/dist/commit-validator/index.d.ts +31 -0
- package/dist/commit-validator/index.d.ts.map +1 -0
- package/dist/commit-validator.d.ts +2 -33
- package/dist/commit-validator.js +5 -3
- package/dist/config-validator/index.d.ts +46 -0
- package/dist/config-validator/index.d.ts.map +1 -0
- package/dist/config-validator.d.ts +2 -48
- package/dist/config-validator.js +8 -4
- package/dist/context-pins/index.d.ts +43 -0
- package/dist/context-pins/index.d.ts.map +1 -0
- package/dist/context-pins.d.ts +2 -45
- package/dist/context-pins.js +5 -5
- package/dist/cost-tracker/index.d.ts +51 -0
- package/dist/cost-tracker/index.d.ts.map +1 -0
- package/dist/cost-tracker.d.ts +2 -53
- package/dist/cost-tracker.js +4 -4
- package/dist/cron/index.d.ts +12 -0
- package/dist/cron/index.d.ts.map +1 -0
- package/dist/cron.d.ts +2 -14
- package/dist/cron.js +3 -2
- package/dist/dead-code-detector/index.d.ts +32 -0
- package/dist/dead-code-detector/index.d.ts.map +1 -0
- package/dist/dead-code-detector.d.ts +2 -34
- package/dist/dead-code-detector.js +8 -9
- package/dist/dep-guard/index.d.ts +63 -0
- package/dist/dep-guard/index.d.ts.map +1 -0
- package/dist/dep-guard.d.ts +2 -65
- package/dist/dep-guard.js +6 -2
- package/dist/dependency-vulnerability-gate/index.d.ts +33 -0
- package/dist/dependency-vulnerability-gate/index.d.ts.map +1 -0
- package/dist/dependency-vulnerability-gate.d.ts +2 -35
- package/dist/dependency-vulnerability-gate.js +5 -5
- package/dist/diff-summary/index.d.ts +34 -0
- package/dist/diff-summary/index.d.ts.map +1 -0
- package/dist/diff-summary.d.ts +2 -36
- package/dist/diff-summary.js +5 -5
- package/dist/doc-sync-guard/index.d.ts +31 -0
- package/dist/doc-sync-guard/index.d.ts.map +1 -0
- package/dist/doc-sync-guard.d.ts +2 -33
- package/dist/doc-sync-guard.js +4 -4
- package/dist/duplicate-code-detector/index.d.ts +31 -0
- package/dist/duplicate-code-detector/index.d.ts.map +1 -0
- package/dist/duplicate-code-detector.d.ts +2 -33
- package/dist/duplicate-code-detector.js +5 -5
- package/dist/error-lens/index.d.ts +65 -0
- package/dist/error-lens/index.d.ts.map +1 -0
- package/dist/error-lens.d.ts +2 -67
- package/dist/error-lens.js +5 -2
- package/dist/feature-flag-tracker/index.d.ts +36 -0
- package/dist/feature-flag-tracker/index.d.ts.map +1 -0
- package/dist/feature-flag-tracker.d.ts +2 -38
- package/dist/feature-flag-tracker.js +6 -7
- package/dist/file-watcher/index.d.ts +12 -0
- package/dist/file-watcher/index.d.ts.map +1 -0
- package/dist/file-watcher.d.ts +2 -14
- package/dist/file-watcher.js +7 -7
- package/dist/format-on-save/index.d.ts +33 -0
- package/dist/format-on-save/index.d.ts.map +1 -0
- package/dist/format-on-save.d.ts +2 -35
- package/dist/format-on-save.js +6 -6
- package/dist/git-autocommit/index.d.ts +15 -0
- package/dist/git-autocommit/index.d.ts.map +1 -0
- package/dist/git-autocommit.d.ts +2 -17
- package/dist/git-autocommit.js +5 -5
- package/dist/import-organizer/index.d.ts +50 -0
- package/dist/import-organizer/index.d.ts.map +1 -0
- package/dist/import-organizer.d.ts +2 -52
- package/dist/import-organizer.js +6 -6
- package/dist/index.d.ts +186 -64
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +992 -454
- package/dist/injection-shield/index.d.ts +47 -0
- package/dist/injection-shield/index.d.ts.map +1 -0
- package/dist/injection-shield.d.ts +2 -49
- package/dist/injection-shield.js +4 -2
- package/dist/interface-contract-guard/index.d.ts +35 -0
- package/dist/interface-contract-guard/index.d.ts.map +1 -0
- package/dist/interface-contract-guard.d.ts +2 -37
- package/dist/interface-contract-guard.js +6 -7
- package/dist/knowledge-graph/index.d.ts +43 -0
- package/dist/knowledge-graph/index.d.ts.map +1 -0
- package/dist/knowledge-graph.d.ts +2 -45
- package/dist/knowledge-graph.js +5 -5
- package/dist/license-audit-gate/index.d.ts +32 -0
- package/dist/license-audit-gate/index.d.ts.map +1 -0
- package/dist/license-audit-gate.d.ts +2 -34
- package/dist/license-audit-gate.js +6 -7
- package/dist/lint-gate/index.d.ts +31 -0
- package/dist/lint-gate/index.d.ts.map +1 -0
- package/dist/lint-gate.d.ts +2 -33
- package/dist/lint-gate.js +7 -7
- package/dist/llm-cache/index.d.ts +54 -0
- package/dist/llm-cache/index.d.ts.map +1 -0
- package/dist/llm-cache.d.ts +2 -56
- package/dist/llm-cache.js +6 -4
- package/dist/loop-breaker/index.d.ts +4 -0
- package/dist/loop-breaker/index.d.ts.map +1 -0
- package/dist/loop-breaker.d.ts +2 -5
- package/dist/loop-breaker.js +4 -4
- package/dist/migration-planner/index.d.ts +28 -0
- package/dist/migration-planner/index.d.ts.map +1 -0
- package/dist/migration-planner.d.ts +2 -30
- package/dist/migration-planner.js +5 -5
- package/dist/model-router/index.d.ts +67 -0
- package/dist/model-router/index.d.ts.map +1 -0
- package/dist/model-router.d.ts +2 -69
- package/dist/model-router.js +5 -2
- package/dist/notify-hub/index.d.ts +43 -0
- package/dist/notify-hub/index.d.ts.map +1 -0
- package/dist/notify-hub.d.ts +2 -45
- package/dist/notify-hub.js +3 -2
- package/dist/path-guard/index.d.ts +52 -0
- package/dist/path-guard/index.d.ts.map +1 -0
- package/dist/path-guard.d.ts +2 -54
- package/dist/path-guard.js +5 -2
- package/dist/performance-regression-gate/index.d.ts +31 -0
- package/dist/performance-regression-gate/index.d.ts.map +1 -0
- package/dist/performance-regression-gate.d.ts +2 -33
- package/dist/performance-regression-gate.js +5 -5
- package/dist/plugin-stack-observer/index.d.ts +33 -0
- package/dist/plugin-stack-observer/index.d.ts.map +1 -0
- package/dist/plugin-stack-observer.d.ts +2 -35
- package/dist/plugin-stack-observer.js +3 -2
- package/dist/pr-drafter/index.d.ts +33 -0
- package/dist/pr-drafter/index.d.ts.map +1 -0
- package/dist/pr-drafter.d.ts +2 -35
- package/dist/pr-drafter.js +6 -6
- package/dist/prompt-firewall/index.d.ts +55 -0
- package/dist/prompt-firewall/index.d.ts.map +1 -0
- package/dist/prompt-firewall.d.ts +2 -57
- package/dist/prompt-firewall.js +5 -2
- package/dist/refactor-suggester/index.d.ts +36 -0
- package/dist/refactor-suggester/index.d.ts.map +1 -0
- package/dist/refactor-suggester.d.ts +2 -38
- package/dist/refactor-suggester.js +16 -17
- package/dist/release-notes-generator/index.d.ts +25 -0
- package/dist/release-notes-generator/index.d.ts.map +1 -0
- package/dist/release-notes-generator.d.ts +2 -27
- package/dist/release-notes-generator.js +28 -10
- package/dist/runtime/index.d.ts +124 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime.d.ts +1 -0
- package/dist/runtime.js +216 -0
- package/dist/schema-evolution-guard/index.d.ts +40 -0
- package/dist/schema-evolution-guard/index.d.ts.map +1 -0
- package/dist/schema-evolution-guard.d.ts +2 -42
- package/dist/schema-evolution-guard.js +5 -5
- package/dist/secret-scanner/index.d.ts +32 -0
- package/dist/secret-scanner/index.d.ts.map +1 -0
- package/dist/secret-scanner.d.ts +2 -34
- package/dist/secret-scanner.js +3 -2
- package/dist/security-hotspot-scanner/index.d.ts +28 -0
- package/dist/security-hotspot-scanner/index.d.ts.map +1 -0
- package/dist/security-hotspot-scanner.d.ts +2 -30
- package/dist/security-hotspot-scanner.js +6 -6
- package/dist/semantic-search-indexer/index.d.ts +36 -0
- package/dist/semantic-search-indexer/index.d.ts.map +1 -0
- package/dist/semantic-search-indexer.d.ts +2 -38
- package/dist/semantic-search-indexer.js +22 -6
- package/dist/semver-bump/index.d.ts +24 -0
- package/dist/semver-bump/index.d.ts.map +1 -0
- package/dist/semver-bump.d.ts +2 -26
- package/dist/semver-bump.js +10 -8
- package/dist/session-recap/index.d.ts +48 -0
- package/dist/session-recap/index.d.ts.map +1 -0
- package/dist/session-recap.d.ts +2 -50
- package/dist/session-recap.js +6 -4
- package/dist/shell-check/index.d.ts +14 -0
- package/dist/shell-check/index.d.ts.map +1 -0
- package/dist/shell-check.d.ts +2 -16
- package/dist/shell-check.js +6 -6
- package/dist/smart-rename/index.d.ts +24 -0
- package/dist/smart-rename/index.d.ts.map +1 -0
- package/dist/smart-rename.d.ts +2 -26
- package/dist/smart-rename.js +5 -5
- package/dist/spec-linker/index.d.ts +49 -0
- package/dist/spec-linker/index.d.ts.map +1 -0
- package/dist/spec-linker.d.ts +2 -51
- package/dist/spec-linker.js +20086 -244
- package/dist/template-engine/index.d.ts +13 -0
- package/dist/template-engine/index.d.ts.map +1 -0
- package/dist/template-engine.d.ts +2 -15
- package/dist/template-engine.js +7 -7
- package/dist/test-coverage-gate/index.d.ts +35 -0
- package/dist/test-coverage-gate/index.d.ts.map +1 -0
- package/dist/test-coverage-gate.d.ts +2 -37
- package/dist/test-coverage-gate.js +5 -5
- package/dist/test-flake-detector/index.d.ts +25 -0
- package/dist/test-flake-detector/index.d.ts.map +1 -0
- package/dist/test-flake-detector.d.ts +2 -27
- package/dist/test-flake-detector.js +98 -13
- package/dist/test-generator/index.d.ts +30 -0
- package/dist/test-generator/index.d.ts.map +1 -0
- package/dist/test-generator.d.ts +2 -32
- package/dist/test-generator.js +19 -20
- package/dist/test-runner-gate/index.d.ts +35 -0
- package/dist/test-runner-gate/index.d.ts.map +1 -0
- package/dist/test-runner-gate.d.ts +2 -37
- package/dist/test-runner-gate.js +6 -6
- package/dist/todo-listener/index.d.ts +35 -0
- package/dist/todo-listener/index.d.ts.map +1 -0
- package/dist/todo-listener.d.ts +2 -37
- package/dist/todo-listener.js +3 -2
- package/dist/todo-tracker/index.d.ts +4 -0
- package/dist/todo-tracker/index.d.ts.map +1 -0
- package/dist/todo-tracker.d.ts +2 -5
- package/dist/todo-tracker.js +5 -5
- package/dist/token-budget/index.d.ts +38 -0
- package/dist/token-budget/index.d.ts.map +1 -0
- package/dist/token-budget.d.ts +2 -40
- package/dist/token-budget.js +3 -2
- package/dist/token-throttle/index.d.ts +52 -0
- package/dist/token-throttle/index.d.ts.map +1 -0
- package/dist/token-throttle.d.ts +2 -54
- package/dist/token-throttle.js +6 -2
- package/dist/type-gate/index.d.ts +35 -0
- package/dist/type-gate/index.d.ts.map +1 -0
- package/dist/type-gate.d.ts +2 -37
- package/dist/type-gate.js +236 -43
- package/package.json +10 -7
package/dist/llm-cache.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { createHash } from 'crypto';
|
|
2
|
-
|
|
3
1
|
// src/llm-cache/index.ts
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
4
3
|
var state = {
|
|
5
4
|
cache: /* @__PURE__ */ new Map(),
|
|
6
5
|
hits: 0,
|
|
@@ -252,5 +251,8 @@ var plugin = {
|
|
|
252
251
|
}
|
|
253
252
|
};
|
|
254
253
|
var llm_cache_default = plugin;
|
|
255
|
-
|
|
256
|
-
|
|
254
|
+
export {
|
|
255
|
+
llm_cache_default as default,
|
|
256
|
+
fingerprintRequest,
|
|
257
|
+
isDeterministic
|
|
258
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/loop-breaker/index.ts"],"names":[],"mappings":"AA2CA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAqP/C,QAAA,MAAM,MAAM,EAAE,MA6Yb,CAAC;eAEa,MAAM"}
|
package/dist/loop-breaker.d.ts
CHANGED
package/dist/loop-breaker.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { execFile } from 'child_process';
|
|
2
|
-
|
|
3
1
|
// src/loop-breaker/index.ts
|
|
2
|
+
import { execFile } from "node:child_process";
|
|
4
3
|
var state = {
|
|
5
4
|
lastFingerprint: null,
|
|
6
5
|
streak: 0,
|
|
@@ -461,5 +460,6 @@ var plugin = {
|
|
|
461
460
|
}
|
|
462
461
|
};
|
|
463
462
|
var loop_breaker_default = plugin;
|
|
464
|
-
|
|
465
|
-
|
|
463
|
+
export {
|
|
464
|
+
loop_breaker_default as default
|
|
465
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* migration-planner plugin — helps plan dependency or framework migrations.
|
|
3
|
+
*
|
|
4
|
+
* The plugin reads a package CHANGELOG (project root or node_modules) and
|
|
5
|
+
* produces a migration checklist with breaking changes and recommended steps
|
|
6
|
+
* between two versions. If no changelog is available it returns a generic
|
|
7
|
+
* migration guide.
|
|
8
|
+
*
|
|
9
|
+
* Tools registered:
|
|
10
|
+
* - migration_plan — produce a migration checklist for a package/version range
|
|
11
|
+
* - migration_status — report plugin state and counters
|
|
12
|
+
*
|
|
13
|
+
* Config (`config.extensions['migration-planner']`):
|
|
14
|
+
*
|
|
15
|
+
* ```jsonc
|
|
16
|
+
* {
|
|
17
|
+
* "enabled": true,
|
|
18
|
+
* "changelogPaths": ["CHANGELOG.md"],
|
|
19
|
+
* "maxChars": 100_000
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
import type { Plugin } from '@wrongstack/core';
|
|
26
|
+
declare const plugin: Plugin;
|
|
27
|
+
export default plugin;
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migration-planner/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAmP/C,QAAA,MAAM,MAAM,EAAE,MAgOb,CAAC;eAEa,MAAM"}
|
|
@@ -1,30 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* migration-planner plugin — helps plan dependency or framework migrations.
|
|
5
|
-
*
|
|
6
|
-
* The plugin reads a package CHANGELOG (project root or node_modules) and
|
|
7
|
-
* produces a migration checklist with breaking changes and recommended steps
|
|
8
|
-
* between two versions. If no changelog is available it returns a generic
|
|
9
|
-
* migration guide.
|
|
10
|
-
*
|
|
11
|
-
* Tools registered:
|
|
12
|
-
* - migration_plan — produce a migration checklist for a package/version range
|
|
13
|
-
* - migration_status — report plugin state and counters
|
|
14
|
-
*
|
|
15
|
-
* Config (`config.extensions['migration-planner']`):
|
|
16
|
-
*
|
|
17
|
-
* ```jsonc
|
|
18
|
-
* {
|
|
19
|
-
* "enabled": true,
|
|
20
|
-
* "changelogPaths": ["CHANGELOG.md"],
|
|
21
|
-
* "maxChars": 100_000
|
|
22
|
-
* }
|
|
23
|
-
* ```
|
|
24
|
-
*
|
|
25
|
-
* @public
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
declare const plugin: Plugin;
|
|
29
|
-
|
|
30
|
-
export { plugin as default };
|
|
1
|
+
export * from './migration-planner/index.js';
|
|
2
|
+
export { default } from './migration-planner/index.js';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { existsSync, readFileSync } from 'fs';
|
|
2
|
-
import { isAbsolute, resolve, relative } from 'path';
|
|
3
|
-
|
|
4
1
|
// src/migration-planner/index.ts
|
|
2
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
3
|
+
import { isAbsolute, relative, resolve } from "node:path";
|
|
5
4
|
var API_VERSION = "^0.1.10";
|
|
6
5
|
var state = {
|
|
7
6
|
plansGenerated: 0,
|
|
@@ -345,5 +344,6 @@ var plugin = {
|
|
|
345
344
|
}
|
|
346
345
|
};
|
|
347
346
|
var migration_planner_default = plugin;
|
|
348
|
-
|
|
349
|
-
|
|
347
|
+
export {
|
|
348
|
+
migration_planner_default as default
|
|
349
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* model-router plugin — routes each provider call to a different model
|
|
3
|
+
* based on declarative rules, on the wire.
|
|
4
|
+
*
|
|
5
|
+
* Like `llm-cache`, this registers an `AgentExtension.wrapProviderRunner`
|
|
6
|
+
* (composed around EVERY provider call in the agent loop). Before the
|
|
7
|
+
* request goes out, the plugin evaluates an ordered rule list against
|
|
8
|
+
* the request's size and shape and rewrites `request.model` to the
|
|
9
|
+
* first matching rule's target — e.g. small/tool-free turns to a cheap
|
|
10
|
+
* fast model, large refactors to a capable one.
|
|
11
|
+
*
|
|
12
|
+
* IMPORTANT constraint: the active provider instance is fixed for the
|
|
13
|
+
* session. Rerouting only works among models the CURRENT provider
|
|
14
|
+
* serves (e.g. anthropic `haiku` ↔ `opus`). Routing to a model id the
|
|
15
|
+
* provider doesn't recognize will fail at the provider — keep targets
|
|
16
|
+
* within one provider's catalog.
|
|
17
|
+
*
|
|
18
|
+
* Safety posture: opt-in — loads inert until
|
|
19
|
+
* `config.extensions['model-router'].enabled = true`. A `dryRun` mode
|
|
20
|
+
* (default) only records what it WOULD route without changing the model,
|
|
21
|
+
* so you can observe the routing before trusting it.
|
|
22
|
+
*
|
|
23
|
+
* Config (`config.extensions['model-router']`):
|
|
24
|
+
*
|
|
25
|
+
* ```jsonc
|
|
26
|
+
* {
|
|
27
|
+
* "enabled": false,
|
|
28
|
+
* "dryRun": true, // observe only; do not rewrite the model
|
|
29
|
+
* "rules": [
|
|
30
|
+
* { "maxChars": 2000, "hasTools": false, "model": "claude-haiku-4-5" },
|
|
31
|
+
* { "minChars": 40000, "model": "claude-opus-4-8" }
|
|
32
|
+
* ]
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* A rule matches when ALL of its present conditions hold. The first
|
|
37
|
+
* matching rule wins; if none match, the request passes through with its
|
|
38
|
+
* original model.
|
|
39
|
+
*
|
|
40
|
+
* Tools:
|
|
41
|
+
* - `model_router_status` — rules, mode, and per-target routing counts
|
|
42
|
+
*
|
|
43
|
+
* @public
|
|
44
|
+
*/
|
|
45
|
+
import type { Plugin } from '@wrongstack/core';
|
|
46
|
+
interface RouteRule {
|
|
47
|
+
/** Match when the request's total char size is <= this. */
|
|
48
|
+
maxChars?: number | undefined;
|
|
49
|
+
/** Match when the request's total char size is >= this. */
|
|
50
|
+
minChars?: number | undefined;
|
|
51
|
+
/** Match when the request has (true) / lacks (false) tools. */
|
|
52
|
+
hasTools?: boolean | undefined;
|
|
53
|
+
/** The model id to route matching requests to (required). */
|
|
54
|
+
model: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Total character size of the request's actual prompt text (system +
|
|
58
|
+
* message content). Only counts `text` block values and bare-string
|
|
59
|
+
* content — not structural fields like `type`/`role` — so the size is a
|
|
60
|
+
* meaningful proxy for prompt weight.
|
|
61
|
+
*/
|
|
62
|
+
export declare function requestCharSize(request: Record<string, unknown>): number;
|
|
63
|
+
/** First rule whose present conditions all hold, or null. */
|
|
64
|
+
export declare function pickRule(rules: RouteRule[], size: number, hasTools: boolean): RouteRule | null;
|
|
65
|
+
declare const plugin: Plugin;
|
|
66
|
+
export default plugin;
|
|
67
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model-router/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,OAAO,KAAK,EAAE,MAAM,EAAa,MAAM,kBAAkB,CAAC;AAM1D,UAAU,SAAS;IACjB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAC;CACf;AA8DD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAgBxE;AAED,6DAA6D;AAC7D,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAQ9F;AAMD,QAAA,MAAM,MAAM,EAAE,MAyKb,CAAC;eAEa,MAAM"}
|
package/dist/model-router.d.ts
CHANGED
|
@@ -1,69 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* model-router plugin — routes each provider call to a different model
|
|
5
|
-
* based on declarative rules, on the wire.
|
|
6
|
-
*
|
|
7
|
-
* Like `llm-cache`, this registers an `AgentExtension.wrapProviderRunner`
|
|
8
|
-
* (composed around EVERY provider call in the agent loop). Before the
|
|
9
|
-
* request goes out, the plugin evaluates an ordered rule list against
|
|
10
|
-
* the request's size and shape and rewrites `request.model` to the
|
|
11
|
-
* first matching rule's target — e.g. small/tool-free turns to a cheap
|
|
12
|
-
* fast model, large refactors to a capable one.
|
|
13
|
-
*
|
|
14
|
-
* IMPORTANT constraint: the active provider instance is fixed for the
|
|
15
|
-
* session. Rerouting only works among models the CURRENT provider
|
|
16
|
-
* serves (e.g. anthropic `haiku` ↔ `opus`). Routing to a model id the
|
|
17
|
-
* provider doesn't recognize will fail at the provider — keep targets
|
|
18
|
-
* within one provider's catalog.
|
|
19
|
-
*
|
|
20
|
-
* Safety posture: opt-in — loads inert until
|
|
21
|
-
* `config.extensions['model-router'].enabled = true`. A `dryRun` mode
|
|
22
|
-
* (default) only records what it WOULD route without changing the model,
|
|
23
|
-
* so you can observe the routing before trusting it.
|
|
24
|
-
*
|
|
25
|
-
* Config (`config.extensions['model-router']`):
|
|
26
|
-
*
|
|
27
|
-
* ```jsonc
|
|
28
|
-
* {
|
|
29
|
-
* "enabled": false,
|
|
30
|
-
* "dryRun": true, // observe only; do not rewrite the model
|
|
31
|
-
* "rules": [
|
|
32
|
-
* { "maxChars": 2000, "hasTools": false, "model": "claude-haiku-4-5" },
|
|
33
|
-
* { "minChars": 40000, "model": "claude-opus-4-8" }
|
|
34
|
-
* ]
|
|
35
|
-
* }
|
|
36
|
-
* ```
|
|
37
|
-
*
|
|
38
|
-
* A rule matches when ALL of its present conditions hold. The first
|
|
39
|
-
* matching rule wins; if none match, the request passes through with its
|
|
40
|
-
* original model.
|
|
41
|
-
*
|
|
42
|
-
* Tools:
|
|
43
|
-
* - `model_router_status` — rules, mode, and per-target routing counts
|
|
44
|
-
*
|
|
45
|
-
* @public
|
|
46
|
-
*/
|
|
47
|
-
|
|
48
|
-
interface RouteRule {
|
|
49
|
-
/** Match when the request's total char size is <= this. */
|
|
50
|
-
maxChars?: number | undefined;
|
|
51
|
-
/** Match when the request's total char size is >= this. */
|
|
52
|
-
minChars?: number | undefined;
|
|
53
|
-
/** Match when the request has (true) / lacks (false) tools. */
|
|
54
|
-
hasTools?: boolean | undefined;
|
|
55
|
-
/** The model id to route matching requests to (required). */
|
|
56
|
-
model: string;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Total character size of the request's actual prompt text (system +
|
|
60
|
-
* message content). Only counts `text` block values and bare-string
|
|
61
|
-
* content — not structural fields like `type`/`role` — so the size is a
|
|
62
|
-
* meaningful proxy for prompt weight.
|
|
63
|
-
*/
|
|
64
|
-
declare function requestCharSize(request: Record<string, unknown>): number;
|
|
65
|
-
/** First rule whose present conditions all hold, or null. */
|
|
66
|
-
declare function pickRule(rules: RouteRule[], size: number, hasTools: boolean): RouteRule | null;
|
|
67
|
-
declare const plugin: Plugin;
|
|
68
|
-
|
|
69
|
-
export { plugin as default, pickRule, requestCharSize };
|
|
1
|
+
export * from './model-router/index.js';
|
|
2
|
+
export { default } from './model-router/index.js';
|
package/dist/model-router.js
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* notify-hub plugin — pushes session events to a webhook.
|
|
3
|
+
*
|
|
4
|
+
* Long-running autonomous sessions need a way to reach the user when
|
|
5
|
+
* something noteworthy happens and nobody is watching the terminal.
|
|
6
|
+
* notify-hub POSTs compact JSON payloads to a configurable webhook
|
|
7
|
+
* URL (Slack/Discord-compatible via generic JSON, n8n, ntfy, or any
|
|
8
|
+
* HTTP endpoint) for a configurable set of events:
|
|
9
|
+
*
|
|
10
|
+
* - `session.stop` — the agent loop ended (Stop hook)
|
|
11
|
+
* - `tool.error` — a tool invocation failed
|
|
12
|
+
* - `budget.threshold` — a budget threshold event fired on the bus
|
|
13
|
+
*
|
|
14
|
+
* Deliveries are fire-and-forget with a timeout — a dead webhook can
|
|
15
|
+
* never stall the agent. Failures are counted and reported via
|
|
16
|
+
* `notify_hub_status` / `health()`, and delivery stops trying after
|
|
17
|
+
* `maxConsecutiveFailures` (circuit breaker) until setup runs again.
|
|
18
|
+
*
|
|
19
|
+
* The agent can also send an ad-hoc notification with `notify_send`
|
|
20
|
+
* ("tell the user the migration finished").
|
|
21
|
+
*
|
|
22
|
+
* Config (`config.extensions['notify-hub']`):
|
|
23
|
+
*
|
|
24
|
+
* ```jsonc
|
|
25
|
+
* {
|
|
26
|
+
* "enabled": true,
|
|
27
|
+
* "webhookUrl": "", // empty = plugin idles
|
|
28
|
+
* "events": ["session.stop", "tool.error"],
|
|
29
|
+
* "headers": {}, // extra HTTP headers (auth…)
|
|
30
|
+
* "timeoutMs": 5000,
|
|
31
|
+
* "maxConsecutiveFailures": 5
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* Toggle off with `{ "name": "notify-hub", "enabled": false }` in
|
|
36
|
+
* `config.plugins`, or `"enabled": false` in the options above.
|
|
37
|
+
*
|
|
38
|
+
* @public
|
|
39
|
+
*/
|
|
40
|
+
import type { Plugin } from '@wrongstack/core';
|
|
41
|
+
declare const plugin: Plugin;
|
|
42
|
+
export default plugin;
|
|
43
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notify-hub/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AA2L/C,QAAA,MAAM,MAAM,EAAE,MAsPb,CAAC;eAEa,MAAM"}
|
package/dist/notify-hub.d.ts
CHANGED
|
@@ -1,45 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* notify-hub plugin — pushes session events to a webhook.
|
|
5
|
-
*
|
|
6
|
-
* Long-running autonomous sessions need a way to reach the user when
|
|
7
|
-
* something noteworthy happens and nobody is watching the terminal.
|
|
8
|
-
* notify-hub POSTs compact JSON payloads to a configurable webhook
|
|
9
|
-
* URL (Slack/Discord-compatible via generic JSON, n8n, ntfy, or any
|
|
10
|
-
* HTTP endpoint) for a configurable set of events:
|
|
11
|
-
*
|
|
12
|
-
* - `session.stop` — the agent loop ended (Stop hook)
|
|
13
|
-
* - `tool.error` — a tool invocation failed
|
|
14
|
-
* - `budget.threshold` — a budget threshold event fired on the bus
|
|
15
|
-
*
|
|
16
|
-
* Deliveries are fire-and-forget with a timeout — a dead webhook can
|
|
17
|
-
* never stall the agent. Failures are counted and reported via
|
|
18
|
-
* `notify_hub_status` / `health()`, and delivery stops trying after
|
|
19
|
-
* `maxConsecutiveFailures` (circuit breaker) until setup runs again.
|
|
20
|
-
*
|
|
21
|
-
* The agent can also send an ad-hoc notification with `notify_send`
|
|
22
|
-
* ("tell the user the migration finished").
|
|
23
|
-
*
|
|
24
|
-
* Config (`config.extensions['notify-hub']`):
|
|
25
|
-
*
|
|
26
|
-
* ```jsonc
|
|
27
|
-
* {
|
|
28
|
-
* "enabled": true,
|
|
29
|
-
* "webhookUrl": "", // empty = plugin idles
|
|
30
|
-
* "events": ["session.stop", "tool.error"],
|
|
31
|
-
* "headers": {}, // extra HTTP headers (auth…)
|
|
32
|
-
* "timeoutMs": 5000,
|
|
33
|
-
* "maxConsecutiveFailures": 5
|
|
34
|
-
* }
|
|
35
|
-
* ```
|
|
36
|
-
*
|
|
37
|
-
* Toggle off with `{ "name": "notify-hub", "enabled": false }` in
|
|
38
|
-
* `config.plugins`, or `"enabled": false` in the options above.
|
|
39
|
-
*
|
|
40
|
-
* @public
|
|
41
|
-
*/
|
|
42
|
-
|
|
43
|
-
declare const plugin: Plugin;
|
|
44
|
-
|
|
45
|
-
export { plugin as default };
|
|
1
|
+
export * from './notify-hub/index.js';
|
|
2
|
+
export { default } from './notify-hub/index.js';
|
package/dist/notify-hub.js
CHANGED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* path-guard plugin — blocks (or warns about) writes, edits, and
|
|
3
|
+
* destructive shell commands that touch protected paths.
|
|
4
|
+
*
|
|
5
|
+
* `branch-guard` protects git *branches*; this plugin protects
|
|
6
|
+
* *files and directories*. A `PreToolUse` hook on `write|edit|bash`
|
|
7
|
+
* matches the target path against a configurable glob list:
|
|
8
|
+
*
|
|
9
|
+
* - `write` / `edit` → the `path` / `file_path` input field
|
|
10
|
+
* - `bash` → destructive commands only (`rm`, `rmdir`,
|
|
11
|
+
* `mv`, `del`, output redirection `>` / `>>`, `truncate`) whose
|
|
12
|
+
* arguments mention a protected path
|
|
13
|
+
*
|
|
14
|
+
* Default protected set: lockfiles, `.env*` secrets, `.git/`
|
|
15
|
+
* internals, and production migration folders — files an agent
|
|
16
|
+
* should virtually never rewrite by hand.
|
|
17
|
+
*
|
|
18
|
+
* Config (`config.extensions['path-guard']`):
|
|
19
|
+
*
|
|
20
|
+
* ```jsonc
|
|
21
|
+
* {
|
|
22
|
+
* "enabled": true,
|
|
23
|
+
* "mode": "block", // "block" | "warn"
|
|
24
|
+
* "protect": ["pnpm-lock.yaml", ".env*", ".git/**", "**/migrations/**"],
|
|
25
|
+
* "allow": [] // globs that override protect
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* Toggle off with `{ "name": "path-guard", "enabled": false }` in
|
|
30
|
+
* `config.plugins`, or `"enabled": false` in the options above.
|
|
31
|
+
*
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
34
|
+
import type { Plugin } from '@wrongstack/core';
|
|
35
|
+
/**
|
|
36
|
+
* Compile a glob pattern to a RegExp. Supports `**` (any depth),
|
|
37
|
+
* `*` (within one segment), and `?` (single char). Matching is done
|
|
38
|
+
* against forward-slash-normalized relative-ish paths, and a pattern
|
|
39
|
+
* without a slash matches the basename anywhere in the tree
|
|
40
|
+
* (`.env` matches `sub/dir/.env`).
|
|
41
|
+
*/
|
|
42
|
+
export declare function compilePathGlob(pattern: string): RegExp;
|
|
43
|
+
/**
|
|
44
|
+
* Extract candidate target paths from a shell command, but only when
|
|
45
|
+
* the command looks destructive. Non-destructive commands (cat, ls,
|
|
46
|
+
* grep …) never trigger the guard, even if they mention a protected
|
|
47
|
+
* path.
|
|
48
|
+
*/
|
|
49
|
+
export declare function destructiveTargets(command: string): string[];
|
|
50
|
+
declare const plugin: Plugin;
|
|
51
|
+
export default plugin;
|
|
52
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/path-guard/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAwE/C;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAyBvD;AAWD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAuB5D;AAMD,QAAA,MAAM,MAAM,EAAE,MA8Kb,CAAC;eAEa,MAAM"}
|
package/dist/path-guard.d.ts
CHANGED
|
@@ -1,54 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* path-guard plugin — blocks (or warns about) writes, edits, and
|
|
5
|
-
* destructive shell commands that touch protected paths.
|
|
6
|
-
*
|
|
7
|
-
* `branch-guard` protects git *branches*; this plugin protects
|
|
8
|
-
* *files and directories*. A `PreToolUse` hook on `write|edit|bash`
|
|
9
|
-
* matches the target path against a configurable glob list:
|
|
10
|
-
*
|
|
11
|
-
* - `write` / `edit` → the `path` / `file_path` input field
|
|
12
|
-
* - `bash` → destructive commands only (`rm`, `rmdir`,
|
|
13
|
-
* `mv`, `del`, output redirection `>` / `>>`, `truncate`) whose
|
|
14
|
-
* arguments mention a protected path
|
|
15
|
-
*
|
|
16
|
-
* Default protected set: lockfiles, `.env*` secrets, `.git/`
|
|
17
|
-
* internals, and production migration folders — files an agent
|
|
18
|
-
* should virtually never rewrite by hand.
|
|
19
|
-
*
|
|
20
|
-
* Config (`config.extensions['path-guard']`):
|
|
21
|
-
*
|
|
22
|
-
* ```jsonc
|
|
23
|
-
* {
|
|
24
|
-
* "enabled": true,
|
|
25
|
-
* "mode": "block", // "block" | "warn"
|
|
26
|
-
* "protect": ["pnpm-lock.yaml", ".env*", ".git/**", "**/migrations/**"],
|
|
27
|
-
* "allow": [] // globs that override protect
|
|
28
|
-
* }
|
|
29
|
-
* ```
|
|
30
|
-
*
|
|
31
|
-
* Toggle off with `{ "name": "path-guard", "enabled": false }` in
|
|
32
|
-
* `config.plugins`, or `"enabled": false` in the options above.
|
|
33
|
-
*
|
|
34
|
-
* @public
|
|
35
|
-
*/
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Compile a glob pattern to a RegExp. Supports `**` (any depth),
|
|
39
|
-
* `*` (within one segment), and `?` (single char). Matching is done
|
|
40
|
-
* against forward-slash-normalized relative-ish paths, and a pattern
|
|
41
|
-
* without a slash matches the basename anywhere in the tree
|
|
42
|
-
* (`.env` matches `sub/dir/.env`).
|
|
43
|
-
*/
|
|
44
|
-
declare function compilePathGlob(pattern: string): RegExp;
|
|
45
|
-
/**
|
|
46
|
-
* Extract candidate target paths from a shell command, but only when
|
|
47
|
-
* the command looks destructive. Non-destructive commands (cat, ls,
|
|
48
|
-
* grep …) never trigger the guard, even if they mention a protected
|
|
49
|
-
* path.
|
|
50
|
-
*/
|
|
51
|
-
declare function destructiveTargets(command: string): string[];
|
|
52
|
-
declare const plugin: Plugin;
|
|
53
|
-
|
|
54
|
-
export { compilePathGlob, plugin as default, destructiveTargets };
|
|
1
|
+
export * from './path-guard/index.js';
|
|
2
|
+
export { default } from './path-guard/index.js';
|
package/dist/path-guard.js
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* performance-regression-gate plugin — compares benchmark results to detect
|
|
3
|
+
* performance regressions.
|
|
4
|
+
*
|
|
5
|
+
* Tool registered:
|
|
6
|
+
* - perf_regression_status : Reads `bench-results.json` in the project root
|
|
7
|
+
* (or a supplied path) and reports benchmarks whose execution time (`mean`)
|
|
8
|
+
* increased beyond the configured threshold.
|
|
9
|
+
*
|
|
10
|
+
* The tool supports two comparison modes:
|
|
11
|
+
* 1. Internal pairing: when only `resultsPath` is supplied, benchmarks named
|
|
12
|
+
* with `(old)` and `(new)` suffixes are paired. This matches Vitest bench
|
|
13
|
+
* output comparing an old implementation against a new one.
|
|
14
|
+
* 2. Cross-file comparison: when `baselinePath` is also supplied, benchmarks
|
|
15
|
+
* are matched by name across the two files.
|
|
16
|
+
*
|
|
17
|
+
* Config (`config.extensions['performance-regression-gate']`):
|
|
18
|
+
*
|
|
19
|
+
* ```jsonc
|
|
20
|
+
* {
|
|
21
|
+
* "enabled": true,
|
|
22
|
+
* "thresholdPercent": 10
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
28
|
+
import type { Plugin } from '@wrongstack/core';
|
|
29
|
+
declare const plugin: Plugin;
|
|
30
|
+
export default plugin;
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/performance-regression-gate/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAwO/C,QAAA,MAAM,MAAM,EAAE,MA8Mb,CAAC;eAEa,MAAM"}
|
|
@@ -1,33 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* performance-regression-gate plugin — compares benchmark results to detect
|
|
5
|
-
* performance regressions.
|
|
6
|
-
*
|
|
7
|
-
* Tool registered:
|
|
8
|
-
* - perf_regression_status : Reads `bench-results.json` in the project root
|
|
9
|
-
* (or a supplied path) and reports benchmarks whose execution time (`mean`)
|
|
10
|
-
* increased beyond the configured threshold.
|
|
11
|
-
*
|
|
12
|
-
* The tool supports two comparison modes:
|
|
13
|
-
* 1. Internal pairing: when only `resultsPath` is supplied, benchmarks named
|
|
14
|
-
* with `(old)` and `(new)` suffixes are paired. This matches Vitest bench
|
|
15
|
-
* output comparing an old implementation against a new one.
|
|
16
|
-
* 2. Cross-file comparison: when `baselinePath` is also supplied, benchmarks
|
|
17
|
-
* are matched by name across the two files.
|
|
18
|
-
*
|
|
19
|
-
* Config (`config.extensions['performance-regression-gate']`):
|
|
20
|
-
*
|
|
21
|
-
* ```jsonc
|
|
22
|
-
* {
|
|
23
|
-
* "enabled": true,
|
|
24
|
-
* "thresholdPercent": 10
|
|
25
|
-
* }
|
|
26
|
-
* ```
|
|
27
|
-
*
|
|
28
|
-
* @public
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
declare const plugin: Plugin;
|
|
32
|
-
|
|
33
|
-
export { plugin as default };
|
|
1
|
+
export * from './performance-regression-gate/index.js';
|
|
2
|
+
export { default } from './performance-regression-gate/index.js';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { existsSync, readFileSync } from 'fs';
|
|
2
|
-
import { resolve, isAbsolute, relative } from 'path';
|
|
3
|
-
|
|
4
1
|
// src/performance-regression-gate/index.ts
|
|
2
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
3
|
+
import { isAbsolute, relative, resolve } from "node:path";
|
|
5
4
|
var API_VERSION = "^0.1.10";
|
|
6
5
|
var state = {
|
|
7
6
|
invocationCount: 0,
|
|
@@ -311,5 +310,6 @@ var plugin = {
|
|
|
311
310
|
}
|
|
312
311
|
};
|
|
313
312
|
var performance_regression_gate_default = plugin;
|
|
314
|
-
|
|
315
|
-
|
|
313
|
+
export {
|
|
314
|
+
performance_regression_gate_default as default
|
|
315
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* plugin-stack-observer — observability over the providerRunner wrap stack.
|
|
3
|
+
*
|
|
4
|
+
* Several official plugins (llm-cache, model-router, prompt-firewall,
|
|
5
|
+
* token-throttle) register `AgentExtension.wrapProviderRunner` to
|
|
6
|
+
* intercept every provider call. The runtime composes them in
|
|
7
|
+
* registration order — but until now there was no way for an operator
|
|
8
|
+
* (or the LLM itself) to see WHICH wraps are active in what order.
|
|
9
|
+
*
|
|
10
|
+
* Each wrap plugin emits `customEvent('provider.wrap:loaded', …)` on
|
|
11
|
+
* setup. This plugin subscribes via `onPattern('provider.wrap:loaded')`
|
|
12
|
+
* and:
|
|
13
|
+
*
|
|
14
|
+
* 1. Builds an in-memory stack (preserves emission order)
|
|
15
|
+
* 2. Registers a system-prompt contributor that, when any wraps are
|
|
16
|
+
* present, emits a compact one-line block listing them. The LLM
|
|
17
|
+
* sees who is wrapping what, in registration order — making the
|
|
18
|
+
* stack visible without /diag round-trips.
|
|
19
|
+
*
|
|
20
|
+
* Disabled by default (enabled=false) because not every user wants
|
|
21
|
+
* the LLM to be aware of the wrap stack. The plugin_stack tool is
|
|
22
|
+
* always registered so operators can read the stack at runtime
|
|
23
|
+
* regardless of the contributor setting.
|
|
24
|
+
*
|
|
25
|
+
* Tools registered:
|
|
26
|
+
* - plugin_stack_status : Read the active wrap stack + load order
|
|
27
|
+
*
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
import type { Plugin } from '@wrongstack/core';
|
|
31
|
+
declare const PLUGIN: Plugin;
|
|
32
|
+
export default PLUGIN;
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin-stack-observer/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAqC/C,QAAA,MAAM,MAAM,EAAE,MAyIb,CAAC;eAoBa,MAAM"}
|