@softspark/ai-toolkit 4.15.1 → 4.16.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 +34 -0
- package/README.md +19 -11
- package/app/.claude-plugin/plugin.json +1 -1
- package/app/ARCHITECTURE.md +4 -3
- package/app/hooks/_hook-io.sh +18 -3
- package/app/hooks/ai-toolkit-statusline.sh +30 -5
- package/app/hooks/filter-tool-output.sh +76 -0
- package/app/hooks/governance-capture.sh +1 -1
- package/app/hooks/guard-path.sh +2 -2
- package/app/hooks/post-tool-use.sh +5 -3
- package/app/hooks/pre-compact-save.sh +4 -3
- package/app/hooks/quality-gate.sh +12 -1
- package/app/hooks/revert-guard.sh +5 -2
- package/app/hooks/save-session.sh +4 -2
- package/app/hooks/session-end.sh +36 -4
- package/app/hooks/session-start.sh +11 -5
- package/app/hooks.json +10 -0
- package/app/output-filter-policy.json +15 -0
- package/app/skills/brand-voice/scripts/measure.py +7 -5
- package/benchmarks/ecosystem-doctor-snapshot.json +22 -22
- package/benchmarks/output-filter/README.md +11 -0
- package/benchmarks/output-filter/scenarios.json +25 -0
- package/bin/ai-toolkit.js +2 -0
- package/kb/history/completed/native-tool-output-filter-plan.md +517 -0
- package/kb/procedures/release-preparation-sop.md +6 -5
- package/kb/reference/architecture-overview.md +6 -5
- package/kb/reference/cli-reference.md +19 -2
- package/kb/reference/codex-cli-compatibility.md +1 -0
- package/kb/reference/copilot-compatibility.md +173 -0
- package/kb/reference/enterprise-config-guide.md +28 -2
- package/kb/reference/global-install-model.md +1 -0
- package/kb/reference/hooks-catalog.md +105 -16
- package/kb/reference/opencode-compatibility.md +1 -0
- package/kb/reference/supported-tools-registry.md +10 -5
- package/kb/reference/tool-output-filter.md +288 -0
- package/llms-full.txt +1173 -35
- package/llms.txt +3 -0
- package/manifest.json +9 -6
- package/package.json +3 -2
- package/scripts/benchmark_output_filter.py +343 -0
- package/scripts/check_deps.py +16 -0
- package/scripts/claude_app.py +30 -2
- package/scripts/config_cli.py +4 -4
- package/scripts/config_lock.py +120 -14
- package/scripts/config_merger.py +103 -20
- package/scripts/config_resolver.py +22 -2
- package/scripts/config_validator.py +268 -16
- package/scripts/doctor.py +1 -0
- package/scripts/generate_codex_hooks.py +2 -0
- package/scripts/generate_gemini_hooks.py +33 -10
- package/scripts/generate_opencode_plugin.py +28 -12
- package/scripts/install_steps/ai_tools.py +101 -2
- package/scripts/install_steps/hooks.py +25 -1
- package/scripts/output_filter_cli.py +347 -0
- package/scripts/output_filter_hook.py +23 -0
- package/scripts/plugin_schema.py +27 -1
- package/scripts/schemas/ai-toolkit-config.schema.json +83 -5
- package/scripts/session_state.py +156 -42
- package/scripts/tool_output_filter/__init__.py +33 -0
- package/scripts/tool_output_filter/contracts.py +173 -0
- package/scripts/tool_output_filter/engine.py +260 -0
- package/scripts/tool_output_filter/hook_runtime.py +369 -0
- package/scripts/tool_output_filter/input.py +56 -0
- package/scripts/tool_output_filter/invariants.py +40 -0
- package/scripts/tool_output_filter/policy.py +153 -0
- package/scripts/tool_output_filter/profiles/__init__.py +68 -0
- package/scripts/tool_output_filter/profiles/repeat_lines.py +71 -0
- package/scripts/tool_output_filter/profiles/tap_success.py +154 -0
- package/scripts/tool_output_filter/recovery.py +846 -0
- package/scripts/tool_output_filter/telemetry.py +13 -0
- package/scripts/uninstall.py +96 -3
|
@@ -8,8 +8,9 @@ and aggregate ratios. Asserts:
|
|
|
8
8
|
concise <= CONCISE_BUDGET (default 0.60)
|
|
9
9
|
strict <= STRICT_BUDGET (default 0.40)
|
|
10
10
|
|
|
11
|
-
Also asserts fact preservation: every file path, identifier, line
|
|
12
|
-
|
|
11
|
+
Also asserts fact preservation: every extracted file path, identifier, line
|
|
12
|
+
reference, and number with a unit from default.md must appear in concise.md
|
|
13
|
+
and strict.md. Fenced code bodies are intentionally excluded.
|
|
13
14
|
|
|
14
15
|
Usage:
|
|
15
16
|
python3 app/skills/brand-voice/scripts/measure.py \\
|
|
@@ -36,6 +37,7 @@ LINE_REF_SUFFIX_RE = re.compile(r":\d+$")
|
|
|
36
37
|
CODE_BLOCK_RE = re.compile(r"```[\w]*\n.*?```", re.DOTALL)
|
|
37
38
|
NUMBER_WITH_UNIT_RE = re.compile(r"\b\d+(?:\.\d+)?(?:ms|s|kb|mb|gb|%)\b", re.IGNORECASE)
|
|
38
39
|
IDENT_BACKTICK_RE = re.compile(r"`([^`\n]+)`")
|
|
40
|
+
IDENTIFIER_RE = re.compile(r"^[A-Za-z_$][A-Za-z0-9_$.-]*(?:\(\))?$")
|
|
39
41
|
|
|
40
42
|
|
|
41
43
|
def count_tokens(text: str) -> int:
|
|
@@ -65,7 +67,7 @@ def extract_facts(text: str) -> set[str]:
|
|
|
65
67
|
|
|
66
68
|
for match in IDENT_BACKTICK_RE.findall(text_no_code):
|
|
67
69
|
cleaned = match.strip()
|
|
68
|
-
if len(cleaned) >= 3 and
|
|
70
|
+
if len(cleaned) >= 3 and IDENTIFIER_RE.fullmatch(cleaned):
|
|
69
71
|
facts.add(normalize_path(cleaned))
|
|
70
72
|
|
|
71
73
|
for match in NUMBER_WITH_UNIT_RE.findall(text_no_code):
|
|
@@ -138,8 +140,8 @@ def evaluate_fixture(
|
|
|
138
140
|
|
|
139
141
|
budget_ok_concise = concise_ratio <= concise_budget
|
|
140
142
|
budget_ok_strict = strict_ratio <= strict_budget
|
|
141
|
-
facts_ok_concise = not concise_required_missing
|
|
142
|
-
facts_ok_strict = not strict_required_missing
|
|
143
|
+
facts_ok_concise = not concise_missing and not concise_required_missing
|
|
144
|
+
facts_ok_strict = not strict_missing and not strict_required_missing
|
|
143
145
|
|
|
144
146
|
return {
|
|
145
147
|
"fixture": fixture_dir.name,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"last_run": "2026-07-
|
|
2
|
+
"last_run": "2026-07-24T03:52:58Z",
|
|
3
3
|
"schema_version": 1,
|
|
4
4
|
"tools": {
|
|
5
5
|
"aider": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"augment": {
|
|
27
|
-
"docs_hash": "
|
|
27
|
+
"docs_hash": "388c0b5e25ab4906",
|
|
28
28
|
"headings": [
|
|
29
29
|
"Admin",
|
|
30
30
|
"Auggie CLI",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
"claude-app": {
|
|
69
|
-
"docs_hash": "
|
|
69
|
+
"docs_hash": "3c7ff437aec0ab98",
|
|
70
70
|
"headings": [
|
|
71
71
|
"Add global and folder instructions",
|
|
72
72
|
"Availability",
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
}
|
|
108
108
|
},
|
|
109
109
|
"claude-code": {
|
|
110
|
-
"docs_hash": "
|
|
110
|
+
"docs_hash": "a6ae93657498688c",
|
|
111
111
|
"headings": [
|
|
112
112
|
"Core concepts",
|
|
113
113
|
"Documentation Index",
|
|
@@ -135,15 +135,15 @@
|
|
|
135
135
|
"PermissionRequest": false,
|
|
136
136
|
"PostCompact": false,
|
|
137
137
|
"PostToolBatch": false,
|
|
138
|
-
"PostToolUse":
|
|
138
|
+
"PostToolUse": false,
|
|
139
139
|
"PostToolUseFailure": false,
|
|
140
140
|
"PreCompact": false,
|
|
141
|
-
"PreToolUse":
|
|
142
|
-
"SKILL.md":
|
|
141
|
+
"PreToolUse": false,
|
|
142
|
+
"SKILL.md": false,
|
|
143
143
|
"SessionEnd": false,
|
|
144
144
|
"SessionStart": false,
|
|
145
145
|
"Setup": true,
|
|
146
|
-
"Stop":
|
|
146
|
+
"Stop": false,
|
|
147
147
|
"StopFailure": false,
|
|
148
148
|
"SubagentStart": false,
|
|
149
149
|
"SubagentStop": false,
|
|
@@ -159,14 +159,14 @@
|
|
|
159
159
|
"hook handler: http": false,
|
|
160
160
|
"hook handler: mcp_tool": false,
|
|
161
161
|
"hook handler: prompt": false,
|
|
162
|
-
"output style":
|
|
163
|
-
"slash command":
|
|
162
|
+
"output style": false,
|
|
163
|
+
"slash command": false,
|
|
164
164
|
"sub-agent": true
|
|
165
165
|
},
|
|
166
|
-
"version": "2.1.
|
|
166
|
+
"version": "2.1.218 (Claude Code)"
|
|
167
167
|
},
|
|
168
168
|
"cline": {
|
|
169
|
-
"docs_hash": "
|
|
169
|
+
"docs_hash": "3eaa20e45d385a1f",
|
|
170
170
|
"headings": [
|
|
171
171
|
"API Reference",
|
|
172
172
|
"Best Practices",
|
|
@@ -213,7 +213,7 @@
|
|
|
213
213
|
}
|
|
214
214
|
},
|
|
215
215
|
"codex-cli": {
|
|
216
|
-
"docs_hash": "
|
|
216
|
+
"docs_hash": "87a5a879a39dc62c",
|
|
217
217
|
"headings": [
|
|
218
218
|
"API",
|
|
219
219
|
"API Reference",
|
|
@@ -291,7 +291,7 @@
|
|
|
291
291
|
"Reference",
|
|
292
292
|
"Releases",
|
|
293
293
|
"Resources",
|
|
294
|
-
"Return to a saved
|
|
294
|
+
"Return to a saved chat",
|
|
295
295
|
"Review changes before they ship",
|
|
296
296
|
"Run Codex and sign in",
|
|
297
297
|
"SDKs and CLI",
|
|
@@ -346,10 +346,10 @@
|
|
|
346
346
|
"mcp_servers": false,
|
|
347
347
|
"sandbox": true
|
|
348
348
|
},
|
|
349
|
-
"version": "codex-cli 0.
|
|
349
|
+
"version": "codex-cli 0.145.0"
|
|
350
350
|
},
|
|
351
351
|
"cursor": {
|
|
352
|
-
"docs_hash": "
|
|
352
|
+
"docs_hash": "5387d04443d26da1",
|
|
353
353
|
"headings": [],
|
|
354
354
|
"markers": {
|
|
355
355
|
".cursor/rules": false,
|
|
@@ -365,7 +365,7 @@
|
|
|
365
365
|
}
|
|
366
366
|
},
|
|
367
367
|
"gemini-cli": {
|
|
368
|
-
"docs_hash": "
|
|
368
|
+
"docs_hash": "8db25b552ffbed80",
|
|
369
369
|
"headings": [
|
|
370
370
|
"Breadcrumbs",
|
|
371
371
|
"Directory actions",
|
|
@@ -408,7 +408,7 @@
|
|
|
408
408
|
}
|
|
409
409
|
},
|
|
410
410
|
"github-copilot": {
|
|
411
|
-
"docs_hash": "
|
|
411
|
+
"docs_hash": "5d021df2f3b4d39b",
|
|
412
412
|
"headings": [
|
|
413
413
|
"About Copilot auto model selection",
|
|
414
414
|
"About Copilot automations",
|
|
@@ -445,7 +445,7 @@
|
|
|
445
445
|
}
|
|
446
446
|
},
|
|
447
447
|
"google-antigravity": {
|
|
448
|
-
"docs_hash": "
|
|
448
|
+
"docs_hash": "03145f425dd475d1",
|
|
449
449
|
"headings": [],
|
|
450
450
|
"markers": {
|
|
451
451
|
"AGENTS.md": false,
|
|
@@ -461,7 +461,7 @@
|
|
|
461
461
|
}
|
|
462
462
|
},
|
|
463
463
|
"opencode": {
|
|
464
|
-
"docs_hash": "
|
|
464
|
+
"docs_hash": "f1dd69ffcfb280fa",
|
|
465
465
|
"headings": [
|
|
466
466
|
"Add features",
|
|
467
467
|
"Ask questions",
|
|
@@ -521,7 +521,7 @@
|
|
|
521
521
|
}
|
|
522
522
|
},
|
|
523
523
|
"windsurf": {
|
|
524
|
-
"docs_hash": "
|
|
524
|
+
"docs_hash": "bee6ba0ee1a517dd",
|
|
525
525
|
"headings": [
|
|
526
526
|
"Accounts",
|
|
527
527
|
"Advanced",
|
|
@@ -558,7 +558,7 @@
|
|
|
558
558
|
"AGENTS.md": true,
|
|
559
559
|
"Cascade": true,
|
|
560
560
|
"MCP": true,
|
|
561
|
-
"SKILL.md":
|
|
561
|
+
"SKILL.md": false,
|
|
562
562
|
"always_on": false,
|
|
563
563
|
"glob": true,
|
|
564
564
|
"hooks": true,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Native output-filter benchmark corpus
|
|
2
|
+
|
|
3
|
+
The corpus is deterministic, synthetic, offline, and authored for ai-toolkit.
|
|
4
|
+
It measures pure profile transformation separately from hook process startup.
|
|
5
|
+
|
|
6
|
+
The gates are 20 ms p95 for inputs up to 100 KiB, 150 ms p95 for the 8 MiB
|
|
7
|
+
hard-cap case, at least 30% reduction, and peak traced allocation no greater
|
|
8
|
+
than three input sizes plus 16 MiB. The cold-process gate invokes the production
|
|
9
|
+
Bash wrapper with a fresh Python process for every sample in one native session;
|
|
10
|
+
its p95 limit is 75 ms. The default 100 samples keep the p95 gate stable enough
|
|
11
|
+
for release validation.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"name": "repeat-lines-100k",
|
|
4
|
+
"profile": "repeat-lines",
|
|
5
|
+
"kind": "repeat",
|
|
6
|
+
"targetBytes": 102400,
|
|
7
|
+
"lineWidth": 96,
|
|
8
|
+
"maxP95Ms": 20
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"name": "tap-success-2k",
|
|
12
|
+
"profile": "tap-success",
|
|
13
|
+
"kind": "tap",
|
|
14
|
+
"testCount": 2000,
|
|
15
|
+
"maxP95Ms": 20
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "repeat-lines-8m",
|
|
19
|
+
"profile": "repeat-lines",
|
|
20
|
+
"kind": "repeat",
|
|
21
|
+
"targetBytes": 8388608,
|
|
22
|
+
"lineWidth": 1024,
|
|
23
|
+
"maxP95Ms": 150
|
|
24
|
+
}
|
|
25
|
+
]
|
package/bin/ai-toolkit.js
CHANGED
|
@@ -50,6 +50,7 @@ const SCRIPT_COMMANDS = {
|
|
|
50
50
|
'benchmark-ecosystem': { script: 'benchmark_ecosystem.py', toolkitCwd: true },
|
|
51
51
|
'evaluate': { script: 'evaluate_skills.py', toolkitCwd: true },
|
|
52
52
|
'stats': { script: 'stats.py' },
|
|
53
|
+
'output-filter': { script: 'output_filter_cli.py' },
|
|
53
54
|
'compile-slm': { script: 'compile_slm.py' },
|
|
54
55
|
'pack-codebase': { script: 'pack_codebase.py' },
|
|
55
56
|
'claude-app': { script: 'claude_app.py', toolkitCwd: true },
|
|
@@ -79,6 +80,7 @@ const COMMANDS = {
|
|
|
79
80
|
'benchmark-ecosystem': 'Generate ecosystem benchmark snapshot (GitHub metadata + offline fallback)',
|
|
80
81
|
evaluate: 'Run skill evaluation suite',
|
|
81
82
|
stats: 'Show skill usage statistics (--summary for product telemetry, --reset to clear)',
|
|
83
|
+
'output-filter': 'Manage native tool-output filter (status, inspect, recover, clean)',
|
|
82
84
|
create: 'Scaffold new skill from template (e.g. create skill my-lint --template=linter)',
|
|
83
85
|
mcp: 'Manage MCP templates and install native editor MCP configs',
|
|
84
86
|
config: 'Manage config inheritance (validate, diff, init, create-base, check)',
|