@wrongstack/plugins 1.0.8 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accessibility-auditor/index.d.ts +1 -1
- package/dist/accessibility-auditor.js +15 -3
- package/dist/agent-handoff.js +6 -6
- package/dist/auto-doc/index.d.ts +1 -1
- package/dist/auto-doc.js +31 -20
- package/dist/auto-i18n-extractor/index.d.ts +1 -1
- package/dist/auto-i18n-extractor.js +12 -8
- package/dist/branch-guard.js +3 -3
- package/dist/changelog-writer/index.d.ts +1 -1
- package/dist/changelog-writer.js +19 -10
- package/dist/checkpoint/index.d.ts +1 -1
- package/dist/checkpoint.js +38 -24
- package/dist/code-metrics/index.d.ts +1 -1
- package/dist/code-metrics.js +12 -4
- package/dist/commit-validator.js +5 -5
- package/dist/context-pins/index.d.ts +1 -1
- package/dist/context-pins.js +12 -9
- package/dist/cost-tracker.js +21 -9
- package/dist/cron/index.d.ts +1 -1
- package/dist/cron.js +18 -5
- package/dist/dead-code-detector/index.d.ts +1 -1
- package/dist/dead-code-detector.js +14 -12
- package/dist/duplicate-code-detector/index.d.ts +1 -1
- package/dist/duplicate-code-detector.js +11 -3
- package/dist/feature-flag-tracker/index.d.ts +1 -1
- package/dist/feature-flag-tracker.js +12 -4
- package/dist/file-watcher/index.d.ts +1 -1
- package/dist/file-watcher.js +37 -38
- package/dist/git-autocommit/index.d.ts +1 -1
- package/dist/git-autocommit.js +44 -39
- package/dist/gitignore-guard/index.d.ts +1 -1
- package/dist/gitignore-guard.js +12 -6
- package/dist/index.js +1553 -1086
- package/dist/interface-contract-guard/index.d.ts +1 -1
- package/dist/interface-contract-guard.js +12 -4
- package/dist/knowledge-graph/index.d.ts +1 -1
- package/dist/knowledge-graph.js +11 -9
- package/dist/loop-breaker.js +11 -4
- package/dist/migration-planner/index.d.ts +1 -1
- package/dist/migration-planner.js +6 -2
- package/dist/notify-hub/index.d.ts +1 -1
- package/dist/notify-hub.js +19 -12
- package/dist/performance-regression-gate/index.d.ts +1 -1
- package/dist/performance-regression-gate.js +33 -13
- package/dist/pr-drafter/index.d.ts +10 -1
- package/dist/pr-drafter.js +57 -26
- package/dist/refactor-suggester/index.d.ts +1 -1
- package/dist/refactor-suggester.js +17 -4
- package/dist/release-notes-generator.js +2 -2
- package/dist/secret-scanner/index.d.ts +1 -1
- package/dist/secret-scanner.js +11 -3
- package/dist/security-hotspot-scanner/index.d.ts +1 -1
- package/dist/security-hotspot-scanner.js +6 -2
- package/dist/semantic-search-indexer/index.d.ts +1 -1
- package/dist/semantic-search-indexer.js +19 -3
- package/dist/semver-bump/index.d.ts +1 -1
- package/dist/semver-bump.js +57 -37
- package/dist/session-recap.js +4 -2
- package/dist/shell-check/index.d.ts +1 -1
- package/dist/shell-check.js +30 -39
- package/dist/smart-rename/index.d.ts +1 -1
- package/dist/smart-rename.js +23 -10
- package/dist/template-engine/index.d.ts +1 -1
- package/dist/template-engine.js +51 -38
- package/dist/test-flake-detector/index.d.ts +1 -1
- package/dist/test-flake-detector.js +11 -5
- package/dist/test-generator/index.d.ts +1 -1
- package/dist/test-generator.js +12 -8
- package/dist/todo-tracker/index.d.ts +68 -1
- package/dist/todo-tracker.js +579 -395
- package/dist/token-budget.js +7 -4
- package/dist/token-throttle.js +6 -3
- package/package.json +7 -7
package/dist/token-budget.js
CHANGED
|
@@ -126,8 +126,10 @@ var plugin = {
|
|
|
126
126
|
if (!modelMatches(cfg.model, modelName)) return;
|
|
127
127
|
}
|
|
128
128
|
const rawUsage = usage;
|
|
129
|
-
const
|
|
130
|
-
const
|
|
129
|
+
const promptTokensRaw = (typeof rawUsage["input"] === "number" ? rawUsage["input"] : void 0) ?? (typeof rawUsage["prompt_tokens"] === "number" ? rawUsage["prompt_tokens"] : void 0) ?? (typeof rawUsage["input_tokens"] === "number" ? rawUsage["input_tokens"] : void 0) ?? (typeof rawUsage["promptTokens"] === "number" ? rawUsage["promptTokens"] : 0);
|
|
130
|
+
const promptTokens = Number.isFinite(promptTokensRaw) ? promptTokensRaw : 0;
|
|
131
|
+
const completionTokensRaw = (typeof rawUsage["output"] === "number" ? rawUsage["output"] : void 0) ?? (typeof rawUsage["completion_tokens"] === "number" ? rawUsage["completion_tokens"] : void 0) ?? (typeof rawUsage["output_tokens"] === "number" ? rawUsage["output_tokens"] : void 0) ?? (typeof rawUsage["completionTokens"] === "number" ? rawUsage["completionTokens"] : 0);
|
|
132
|
+
const completionTokens = Number.isFinite(completionTokensRaw) ? completionTokensRaw : 0;
|
|
131
133
|
const total = promptTokens + completionTokens;
|
|
132
134
|
state.totalPromptTokens += promptTokens;
|
|
133
135
|
state.totalCompletionTokens += completionTokens;
|
|
@@ -141,9 +143,9 @@ var plugin = {
|
|
|
141
143
|
};
|
|
142
144
|
if (cfg.limit <= 0) return;
|
|
143
145
|
const percent = state.totalTokens / cfg.limit * 100;
|
|
144
|
-
if (!state.warningFired && percent >= cfg.warnPercent
|
|
146
|
+
if (!state.warningFired && percent >= cfg.warnPercent) {
|
|
145
147
|
state.warningFired = true;
|
|
146
|
-
const remaining = cfg.limit - state.totalTokens;
|
|
148
|
+
const remaining = Math.max(cfg.limit - state.totalTokens, 0);
|
|
147
149
|
api.log.info("token-budget: warning threshold reached", {
|
|
148
150
|
percent: Math.round(percent),
|
|
149
151
|
remaining
|
|
@@ -180,6 +182,7 @@ var plugin = {
|
|
|
180
182
|
const remaining = Math.max(cfg.limit - state.totalTokens, 0);
|
|
181
183
|
if (state.stopFired && !state.stopContextInjected) {
|
|
182
184
|
state.stopContextInjected = true;
|
|
185
|
+
state.warnContextInjected = true;
|
|
183
186
|
return {
|
|
184
187
|
additionalContext: `
|
|
185
188
|
\u{1F6D1} token-budget: HARD LIMIT REACHED \u2014 ${state.totalTokens.toLocaleString()} / ${cfg.limit.toLocaleString()} tokens (${percent}%). You must stop here. Do NOT start any new task. Summarize what was accomplished and list any remaining work.`
|
package/dist/token-throttle.js
CHANGED
|
@@ -152,9 +152,12 @@ var plugin = {
|
|
|
152
152
|
}
|
|
153
153
|
const response = await inner(_ctx, request);
|
|
154
154
|
const rawUsage = response?.usage;
|
|
155
|
-
const
|
|
156
|
-
const
|
|
157
|
-
const
|
|
155
|
+
const inputTokensRaw = (typeof rawUsage?.["input"] === "number" ? rawUsage["input"] : void 0) ?? (typeof rawUsage?.["prompt_tokens"] === "number" ? rawUsage["prompt_tokens"] : void 0) ?? (typeof rawUsage?.["input_tokens"] === "number" ? rawUsage["input_tokens"] : void 0) ?? (typeof rawUsage?.["promptTokens"] === "number" ? rawUsage["promptTokens"] : void 0) ?? (typeof rawUsage?.["inputTokens"] === "number" ? rawUsage["inputTokens"] : 0);
|
|
156
|
+
const inputTokens = Number.isFinite(inputTokensRaw) ? inputTokensRaw : 0;
|
|
157
|
+
const outputTokensRaw = (typeof rawUsage?.["output"] === "number" ? rawUsage["output"] : void 0) ?? (typeof rawUsage?.["completion_tokens"] === "number" ? rawUsage["completion_tokens"] : void 0) ?? (typeof rawUsage?.["output_tokens"] === "number" ? rawUsage["output_tokens"] : void 0) ?? (typeof rawUsage?.["completionTokens"] === "number" ? rawUsage["completionTokens"] : void 0) ?? (typeof rawUsage?.["outputTokens"] === "number" ? rawUsage["outputTokens"] : 0);
|
|
158
|
+
const outputTokens = Number.isFinite(outputTokensRaw) ? outputTokensRaw : 0;
|
|
159
|
+
const totalTokensRaw = (typeof rawUsage?.["total_tokens"] === "number" ? rawUsage["total_tokens"] : void 0) ?? (typeof rawUsage?.["totalTokens"] === "number" ? rawUsage["totalTokens"] : void 0) ?? (typeof rawUsage?.["total"] === "number" ? rawUsage["total"] : void 0) ?? inputTokens + outputTokens;
|
|
160
|
+
const totalTokens = Number.isFinite(totalTokensRaw) ? totalTokensRaw : 0;
|
|
158
161
|
const used = totalTokens > 0 ? totalTokens : projected;
|
|
159
162
|
state.window.push({ at: Date.now(), tokens: used });
|
|
160
163
|
return response;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wrongstack/plugins",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"description": "Official WrongStack collection of focused plugins for code quality, security, observability, planning, and agent coordination",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ECOSTACK TECHNOLOGY OÜ",
|
|
@@ -298,15 +298,15 @@
|
|
|
298
298
|
"!dist/**/*.map"
|
|
299
299
|
],
|
|
300
300
|
"devDependencies": {
|
|
301
|
-
"@types/node": "^26.
|
|
301
|
+
"@types/node": "^26.5.1",
|
|
302
302
|
"typescript": "^7.0.2",
|
|
303
|
-
"vitest": "^
|
|
303
|
+
"vitest": "^5.0.0"
|
|
304
304
|
},
|
|
305
305
|
"dependencies": {
|
|
306
|
-
"@wrongstack/core": "1.0.
|
|
307
|
-
"@wrongstack/
|
|
308
|
-
"@wrongstack/
|
|
309
|
-
"@wrongstack/tools": "1.0.
|
|
306
|
+
"@wrongstack/core": "1.0.11",
|
|
307
|
+
"@wrongstack/plugin-sdk": "1.0.11",
|
|
308
|
+
"@wrongstack/primitives": "1.0.11",
|
|
309
|
+
"@wrongstack/tools": "1.0.11"
|
|
310
310
|
},
|
|
311
311
|
"scripts": {
|
|
312
312
|
"build": "node ../../scripts/build-package.mjs",
|