tuxevil-rotator 3.0.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 (142) hide show
  1. package/CHANGELOG.md +773 -0
  2. package/LICENSE +21 -0
  3. package/README.md +341 -0
  4. package/bin/pi-antigravity-rotator.js +27 -0
  5. package/bin/tuxevil-rotator.js +5 -0
  6. package/package.json +63 -0
  7. package/src/account-store.ts +542 -0
  8. package/src/admin-auth.ts +126 -0
  9. package/src/body-limit.ts +52 -0
  10. package/src/cli.ts +293 -0
  11. package/src/compat/cache.ts +38 -0
  12. package/src/compat/model-specs.ts +82 -0
  13. package/src/compat/schema-sanitizer.ts +284 -0
  14. package/src/compat.ts +2357 -0
  15. package/src/compression/index.ts +92 -0
  16. package/src/compression/lite.ts +210 -0
  17. package/src/compression/preservation.ts +183 -0
  18. package/src/compression/rtk/command-detector.ts +170 -0
  19. package/src/compression/rtk/deduplicator.ts +39 -0
  20. package/src/compression/rtk/filter-loader.ts +84 -0
  21. package/src/compression/rtk/filter-types.ts +25 -0
  22. package/src/compression/rtk/filters/aws.json +34 -0
  23. package/src/compression/rtk/filters/biome.json +35 -0
  24. package/src/compression/rtk/filters/build-eslint.json +37 -0
  25. package/src/compression/rtk/filters/build-typescript.json +33 -0
  26. package/src/compression/rtk/filters/build-vite.json +41 -0
  27. package/src/compression/rtk/filters/build-webpack.json +34 -0
  28. package/src/compression/rtk/filters/bundle-install.json +35 -0
  29. package/src/compression/rtk/filters/composer.json +81 -0
  30. package/src/compression/rtk/filters/curl.json +34 -0
  31. package/src/compression/rtk/filters/df.json +34 -0
  32. package/src/compression/rtk/filters/docker-build.json +78 -0
  33. package/src/compression/rtk/filters/docker-logs.json +42 -0
  34. package/src/compression/rtk/filters/docker-ps.json +33 -0
  35. package/src/compression/rtk/filters/dotnet.json +47 -0
  36. package/src/compression/rtk/filters/du.json +33 -0
  37. package/src/compression/rtk/filters/error-stacktrace.json +41 -0
  38. package/src/compression/rtk/filters/gcloud.json +34 -0
  39. package/src/compression/rtk/filters/generic-output.json +32 -0
  40. package/src/compression/rtk/filters/gh.json +98 -0
  41. package/src/compression/rtk/filters/git-branch.json +45 -0
  42. package/src/compression/rtk/filters/git-diff.json +33 -0
  43. package/src/compression/rtk/filters/git-log.json +33 -0
  44. package/src/compression/rtk/filters/git-status.json +40 -0
  45. package/src/compression/rtk/filters/golangci-lint.json +34 -0
  46. package/src/compression/rtk/filters/gradle.json +47 -0
  47. package/src/compression/rtk/filters/json-output.json +40 -0
  48. package/src/compression/rtk/filters/kubectl.json +99 -0
  49. package/src/compression/rtk/filters/make.json +38 -0
  50. package/src/compression/rtk/filters/mypy.json +34 -0
  51. package/src/compression/rtk/filters/npm-audit.json +43 -0
  52. package/src/compression/rtk/filters/npm-install.json +41 -0
  53. package/src/compression/rtk/filters/nx.json +34 -0
  54. package/src/compression/rtk/filters/pip.json +41 -0
  55. package/src/compression/rtk/filters/playwright.json +42 -0
  56. package/src/compression/rtk/filters/poetry-install.json +35 -0
  57. package/src/compression/rtk/filters/prettier.json +40 -0
  58. package/src/compression/rtk/filters/ps.json +34 -0
  59. package/src/compression/rtk/filters/rsync.json +33 -0
  60. package/src/compression/rtk/filters/rubocop.json +34 -0
  61. package/src/compression/rtk/filters/ruff.json +40 -0
  62. package/src/compression/rtk/filters/shell-find.json +33 -0
  63. package/src/compression/rtk/filters/shell-grep.json +37 -0
  64. package/src/compression/rtk/filters/shell-ls.json +33 -0
  65. package/src/compression/rtk/filters/ssh.json +43 -0
  66. package/src/compression/rtk/filters/systemctl-status.json +43 -0
  67. package/src/compression/rtk/filters/terraform-plan.json +34 -0
  68. package/src/compression/rtk/filters/test-cargo.json +42 -0
  69. package/src/compression/rtk/filters/test-go.json +41 -0
  70. package/src/compression/rtk/filters/test-jest.json +43 -0
  71. package/src/compression/rtk/filters/test-pytest.json +41 -0
  72. package/src/compression/rtk/filters/test-vitest.json +43 -0
  73. package/src/compression/rtk/filters/tofu-plan.json +34 -0
  74. package/src/compression/rtk/filters/turbo.json +34 -0
  75. package/src/compression/rtk/filters/uv-sync.json +35 -0
  76. package/src/compression/rtk/filters/wget.json +34 -0
  77. package/src/compression/rtk/index.ts +103 -0
  78. package/src/compression/rtk/line-filter.ts +124 -0
  79. package/src/compression/rtk/smart-truncate.ts +71 -0
  80. package/src/config-defaults.ts +93 -0
  81. package/src/config-normalize.ts +48 -0
  82. package/src/config-storage.ts +21 -0
  83. package/src/dashboard.ts +1169 -0
  84. package/src/db-store.ts +188 -0
  85. package/src/doctor.ts +115 -0
  86. package/src/env.ts +15 -0
  87. package/src/exposure.ts +17 -0
  88. package/src/fetch-with-retry.ts +93 -0
  89. package/src/idempotency.ts +137 -0
  90. package/src/index.ts +267 -0
  91. package/src/key-auth.ts +159 -0
  92. package/src/key-migrations.ts +84 -0
  93. package/src/logger.ts +92 -0
  94. package/src/login.ts +48 -0
  95. package/src/notification-poller.ts +155 -0
  96. package/src/onboarding.ts +754 -0
  97. package/src/paths.ts +153 -0
  98. package/src/providers/adapter.ts +131 -0
  99. package/src/providers/credential-helpers.ts +72 -0
  100. package/src/providers/google-antigravity/code-assist.ts +161 -0
  101. package/src/providers/google-antigravity/credentials.ts +24 -0
  102. package/src/providers/google-antigravity/forward.ts +424 -0
  103. package/src/providers/google-antigravity/index.ts +168 -0
  104. package/src/providers/google-antigravity/login.ts +285 -0
  105. package/src/providers/google-antigravity/oauth.ts +314 -0
  106. package/src/providers/google-antigravity/quota.ts +152 -0
  107. package/src/providers/google-antigravity/translators.ts +1663 -0
  108. package/src/providers/ollama/api-key-validation.ts +59 -0
  109. package/src/providers/ollama/credentials.ts +28 -0
  110. package/src/providers/ollama/forward.ts +306 -0
  111. package/src/providers/ollama/index.ts +85 -0
  112. package/src/providers/ollama/login.ts +55 -0
  113. package/src/providers/ollama/prediction.ts +188 -0
  114. package/src/providers/ollama/quota-poll-store.ts +160 -0
  115. package/src/providers/ollama/quota.ts +189 -0
  116. package/src/providers/ollama/translators.ts +256 -0
  117. package/src/providers/ollama/usage-windows.ts +48 -0
  118. package/src/providers/proxy-dispatcher.ts +269 -0
  119. package/src/providers/registry.ts +70 -0
  120. package/src/proxy.ts +2446 -0
  121. package/src/rate-limit-parser.ts +126 -0
  122. package/src/response-headers.ts +98 -0
  123. package/src/responses-store.ts +159 -0
  124. package/src/rotator.ts +3614 -0
  125. package/src/settings-repository.ts +327 -0
  126. package/src/spend-logger.ts +696 -0
  127. package/src/static/dashboard-keys.js +384 -0
  128. package/src/static/dashboard-logs.js +797 -0
  129. package/src/static/dashboard.css +2740 -0
  130. package/src/static/dashboard.js +3177 -0
  131. package/src/storage.ts +105 -0
  132. package/src/systemd-env.ts +214 -0
  133. package/src/telemetry.ts +384 -0
  134. package/src/token-encryption.ts +199 -0
  135. package/src/types.ts +897 -0
  136. package/src/validators.ts +218 -0
  137. package/src/version-check.ts +225 -0
  138. package/src/virtual-keys.ts +312 -0
  139. package/tools/telemetry-receiver/README.md +147 -0
  140. package/tools/telemetry-receiver/package.json +13 -0
  141. package/tools/telemetry-receiver/receiver.js +2334 -0
  142. package/tuxevil-rotator_logo.png +0 -0
@@ -0,0 +1,47 @@
1
+ {
2
+ "id": "dotnet",
3
+ "label": ".NET CLI",
4
+ "description": "Strip the .NET build banner and restore chatter; keep build/test status, warnings (CS####), and errors.",
5
+ "category": "build",
6
+ "priority": 78,
7
+ "match": {
8
+ "outputTypes": ["dotnet"],
9
+ "commands": ["^dotnet\\b"],
10
+ "patterns": ["^Build (?:succeeded|FAILED)\\b", "\\b(?:error|warning) CS\\d+\\b"]
11
+ },
12
+ "rules": {
13
+ "stripAnsi": true,
14
+ "dropPatterns": [
15
+ "^Microsoft \\(R\\)",
16
+ "^Copyright \\(C\\) Microsoft",
17
+ "Determining projects to restore",
18
+ "^\\s*Restored ",
19
+ "^\\s*$",
20
+ "^Time Elapsed "
21
+ ],
22
+ "collapsePatterns": ["^\\s*Restored "],
23
+ "deduplicate": true,
24
+ "maxLines": 160,
25
+ "headLines": 40,
26
+ "tailLines": 60,
27
+ "onEmpty": "dotnet: ok"
28
+ },
29
+ "preserve": {
30
+ "errorPatterns": [
31
+ "Build FAILED",
32
+ "FAILED",
33
+ "\\berror CS\\d+\\b",
34
+ "\\bwarning CS\\d+\\b",
35
+ "Failed!"
36
+ ],
37
+ "summaryPatterns": ["Build succeeded", "Passed!", "Total tests:"]
38
+ },
39
+ "tests": [
40
+ {
41
+ "name": "drops build banner + restore chatter, keeps status",
42
+ "command": "dotnet build",
43
+ "input": "Microsoft (R) Build Engine version 17.8\n Determining projects to restore...\nBuild succeeded.\n",
44
+ "expected": "Build succeeded."
45
+ }
46
+ ]
47
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "id": "du",
3
+ "label": "du",
4
+ "description": "Summarize disk-usage listings while preserving largest entries.",
5
+ "category": "shell",
6
+ "priority": 66,
7
+ "match": {
8
+ "outputTypes": ["shell-du"],
9
+ "commands": ["^du\\b"],
10
+ "patterns": ["^\\d+(?:\\.\\d+)?[KMGTP]?\\s+\\S+"]
11
+ },
12
+ "rules": {
13
+ "stripAnsi": true,
14
+ "dropPatterns": ["^\\s*$"],
15
+ "collapsePatterns": [],
16
+ "deduplicate": true,
17
+ "maxLines": 80,
18
+ "headLines": 20,
19
+ "tailLines": 30
20
+ },
21
+ "preserve": {
22
+ "errorPatterns": ["Permission denied", "No such file"],
23
+ "summaryPatterns": ["\\s+\\.$", "\\s+total$"]
24
+ },
25
+ "tests": [
26
+ {
27
+ "name": "inline sample",
28
+ "command": "du -sh *",
29
+ "input": "4.0K package.json\n120M node_modules\n120M node_modules\n",
30
+ "expected": "4.0K package.json\n120M node_modules\n120M node_modules"
31
+ }
32
+ ]
33
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "id": "error-stacktrace",
3
+ "label": "Error Stacktrace",
4
+ "description": "Collapse stack traces while preserving error text and top frames.",
5
+ "category": "generic",
6
+ "priority": 70,
7
+ "match": {
8
+ "outputTypes": ["error-stacktrace"],
9
+ "commands": [],
10
+ "patterns": ["Traceback \\(most recent call last\\):", "^\\s+at\\s+", "^panic: "]
11
+ },
12
+ "rules": {
13
+ "stripAnsi": true,
14
+ "includePatterns": [
15
+ "Error:",
16
+ "Exception:",
17
+ "Traceback",
18
+ "^\\s+at ",
19
+ "^panic:",
20
+ "^thread ",
21
+ "^Caused by:"
22
+ ],
23
+ "dropPatterns": ["^\\s*$"],
24
+ "collapsePatterns": ["^\\s+at "],
25
+ "deduplicate": true,
26
+ "maxLines": 80,
27
+ "headLines": 25,
28
+ "tailLines": 30
29
+ },
30
+ "preserve": {
31
+ "errorPatterns": ["Error:", "Exception:", "^panic:", "Traceback"],
32
+ "summaryPatterns": ["Caused by:"]
33
+ },
34
+ "tests": [
35
+ {
36
+ "name": "inline sample",
37
+ "input": "Error: boom\n at fn (/repo/a.ts:1:1)\n at fn (/repo/a.ts:1:1)\nCaused by: bad\n",
38
+ "expected": "Error: boom\n at fn (/repo/a.ts:1:1)\nCaused by: bad"
39
+ }
40
+ ]
41
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "id": "gcloud",
3
+ "label": "gcloud",
4
+ "description": "Compress Google Cloud CLI output and preserve actionable errors.",
5
+ "category": "cloud",
6
+ "priority": 75,
7
+ "match": {
8
+ "outputTypes": ["gcloud"],
9
+ "commands": ["^gcloud\\b"],
10
+ "patterns": ["^ERROR: \\(gcloud\\.", "^Updated property \\["]
11
+ },
12
+ "rules": {
13
+ "stripAnsi": true,
14
+ "dropPatterns": ["^Waiting for operation", "^\\s*$"],
15
+ "includePatterns": ["^ERROR: \\(gcloud\\.", "^Updated property \\[", "^Created \\["],
16
+ "collapsePatterns": [],
17
+ "deduplicate": true,
18
+ "maxLines": 120,
19
+ "headLines": 30,
20
+ "tailLines": 40
21
+ },
22
+ "preserve": {
23
+ "errorPatterns": ["^ERROR: \\(gcloud\\.", "PERMISSION_DENIED", "NOT_FOUND"],
24
+ "summaryPatterns": ["^Updated property \\[", "^Created \\["]
25
+ },
26
+ "tests": [
27
+ {
28
+ "name": "inline sample",
29
+ "command": "gcloud run deploy",
30
+ "input": "Waiting for operation [deploy]\nUpdated property [core/project].\nERROR: (gcloud.run.deploy) PERMISSION_DENIED: denied\n",
31
+ "expected": "Updated property [core/project].\nERROR: (gcloud.run.deploy) PERMISSION_DENIED: denied"
32
+ }
33
+ ]
34
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "id": "generic-output",
3
+ "label": "Generic Output",
4
+ "description": "Fallback filter for unknown command output.",
5
+ "category": "generic",
6
+ "priority": 10,
7
+ "match": {
8
+ "outputTypes": ["generic-output", "generic-error"],
9
+ "commands": [],
10
+ "patterns": ["Error:", "Exception:", "Traceback \\(most recent call last\\):"]
11
+ },
12
+ "rules": {
13
+ "includePatterns": [],
14
+ "dropPatterns": ["^\\s*$"],
15
+ "collapsePatterns": [],
16
+ "deduplicate": false,
17
+ "maxLines": 120,
18
+ "headLines": 35,
19
+ "tailLines": 45
20
+ },
21
+ "preserve": {
22
+ "errorPatterns": ["error", "failed", "exception", "traceback"],
23
+ "summaryPatterns": []
24
+ },
25
+ "tests": [
26
+ {
27
+ "name": "inline sample",
28
+ "input": "\nError: boom\n\nTraceback (most recent call last):\n file.py:1\n",
29
+ "expected": "Error: boom\nTraceback (most recent call last):\n file.py:1"
30
+ }
31
+ ]
32
+ }
@@ -0,0 +1,98 @@
1
+ {
2
+ "id": "gh",
3
+ "label": "GitHub CLI",
4
+ "description": "Keep GitHub CLI command results, errors, and PR/issue summaries while stripping pagination noise. Skips `gh api` and `--json` invocations (structured output that would be corrupted by line filtering).",
5
+ "category": "cloud",
6
+ "priority": 70,
7
+ "match": {
8
+ "outputTypes": ["gh"],
9
+ "commands": [
10
+ "^gh\\s+(?:pr|issue|repo|run|workflow|release|auth|browse|gist|secret|label|search|status)(?!.*--json)\\b"
11
+ ],
12
+ "patterns": [
13
+ "^https?://github\\.com/",
14
+ "Created pull request",
15
+ "Created issue",
16
+ "✓\\s+Logged in",
17
+ "X\\s+\\S+",
18
+ "GraphQL error",
19
+ "HTTP \\d{3}:"
20
+ ]
21
+ },
22
+ "rules": {
23
+ "stripAnsi": true,
24
+ "includePatterns": [
25
+ "^https?://github\\.com/",
26
+ "Creat(?:ed|ing) pull request",
27
+ "Creat(?:ed|ing) issue",
28
+ "Merged pull request",
29
+ "Closed (?:pull request|issue)",
30
+ "Reopened",
31
+ "✓\\s+",
32
+ "X\\s+\\S+",
33
+ "FAIL",
34
+ "GraphQL error",
35
+ "HTTP \\d{3}:",
36
+ "error:",
37
+ "not found",
38
+ "must be authenticated",
39
+ "rate limit",
40
+ "completed\\s+\\w+",
41
+ "queued\\s+\\w+",
42
+ "in_progress\\s+\\w+",
43
+ "#\\d+\\s+\\S"
44
+ ],
45
+ "dropPatterns": [
46
+ "^\\s*$",
47
+ "^Showing \\d+ of \\d+",
48
+ "^For more information on output formatting"
49
+ ],
50
+ "collapsePatterns": [],
51
+ "deduplicate": false,
52
+ "maxLines": 80,
53
+ "headLines": 20,
54
+ "tailLines": 40
55
+ },
56
+ "preserve": {
57
+ "errorPatterns": [
58
+ "GraphQL error",
59
+ "HTTP \\d{3}:",
60
+ "error:",
61
+ "not found",
62
+ "must be authenticated",
63
+ "rate limit"
64
+ ],
65
+ "summaryPatterns": [
66
+ "Creat(?:ed|ing) pull request",
67
+ "Creat(?:ed|ing) issue",
68
+ "Merged pull request",
69
+ "^https?://github\\.com/"
70
+ ]
71
+ },
72
+ "tests": [
73
+ {
74
+ "name": "pr create",
75
+ "command": "gh pr create",
76
+ "input": "\nCreating pull request for feat/foo into main in owner/repo\n\nhttps://github.com/owner/repo/pull/123\n",
77
+ "expected": "Creating pull request for feat/foo into main in owner/repo\nhttps://github.com/owner/repo/pull/123"
78
+ },
79
+ {
80
+ "name": "auth error",
81
+ "command": "gh pr list",
82
+ "input": "error: must be authenticated to use this command\n",
83
+ "expected": "error: must be authenticated to use this command"
84
+ },
85
+ {
86
+ "name": "skips gh api (structured JSON output)",
87
+ "command": "gh api repos/owner/repo/pulls/1",
88
+ "input": "{\n \"number\": 1,\n \"title\": \"feat: x\",\n \"user\": { \"login\": \"alice\" }\n}\n",
89
+ "expected": "{\n \"number\": 1,\n \"title\": \"feat: x\",\n \"user\": { \"login\": \"alice\" }\n}"
90
+ },
91
+ {
92
+ "name": "skips --json output (would corrupt structured data)",
93
+ "command": "gh pr list --json number,title",
94
+ "input": "[\n { \"number\": 1, \"title\": \"feat: x\" },\n { \"number\": 2, \"title\": \"fix: y\" }\n]\n",
95
+ "expected": "[\n { \"number\": 1, \"title\": \"feat: x\" },\n { \"number\": 2, \"title\": \"fix: y\" }\n]"
96
+ }
97
+ ]
98
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "id": "git-branch",
3
+ "label": "Git Branch",
4
+ "description": "Compact git branch/switch output.",
5
+ "category": "git",
6
+ "priority": 94,
7
+ "match": {
8
+ "outputTypes": ["git-branch"],
9
+ "commands": ["^git\\s+(?:branch|checkout|switch)\\b"],
10
+ "patterns": ["^\\*\\s+\\S+", "Switched to (?:a new )?branch", "Already on"]
11
+ },
12
+ "rules": {
13
+ "stripAnsi": true,
14
+ "matchOutput": [
15
+ {
16
+ "pattern": "Switched to (?:a new )?branch",
17
+ "message": "git: switched branch",
18
+ "unless": "error|failed"
19
+ },
20
+ {
21
+ "pattern": "Already on",
22
+ "message": "git: already on branch"
23
+ }
24
+ ],
25
+ "includePatterns": ["^\\*\\s+\\S+", "^\\s{2}\\S+", "Switched to", "Already on"],
26
+ "dropPatterns": ["^\\s*$"],
27
+ "collapsePatterns": [],
28
+ "deduplicate": false,
29
+ "maxLines": 60,
30
+ "headLines": 20,
31
+ "tailLines": 20
32
+ },
33
+ "preserve": {
34
+ "errorPatterns": ["error", "failed"],
35
+ "summaryPatterns": ["Switched to", "Already on"]
36
+ },
37
+ "tests": [
38
+ {
39
+ "name": "inline sample",
40
+ "command": "git (?:branch|checkout|switch)",
41
+ "input": " main\n* feature/rtk\n release\n",
42
+ "expected": " main\n* feature/rtk\n release"
43
+ }
44
+ ]
45
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "id": "git-diff",
3
+ "label": "Git Diff",
4
+ "description": "Drop low-signal diff metadata while preserving files, hunks, and changed lines.",
5
+ "category": "git",
6
+ "priority": 94,
7
+ "match": {
8
+ "outputTypes": ["git-diff"],
9
+ "commands": ["^git\\s+(?:diff|show)\\b"],
10
+ "patterns": ["^diff --git ", "^@@\\s+-\\d+,\\d+\\s+\\+\\d+,\\d+\\s+@@"]
11
+ },
12
+ "rules": {
13
+ "includePatterns": [],
14
+ "dropPatterns": ["^index [0-9a-f]+\\.\\.[0-9a-f]+.*$", "^--- a/", "^\\+\\+\\+ b/"],
15
+ "collapsePatterns": ["^\\s*$"],
16
+ "deduplicate": true,
17
+ "maxLines": 180,
18
+ "headLines": 40,
19
+ "tailLines": 50
20
+ },
21
+ "preserve": {
22
+ "errorPatterns": ["^diff --git ", "^@@ ", "^[+-](?![+-]{2})"],
23
+ "summaryPatterns": []
24
+ },
25
+ "tests": [
26
+ {
27
+ "name": "inline sample",
28
+ "command": "git (?:diff|show)",
29
+ "input": "diff --git a/a.ts b/a.ts\n@@ -1,2 +1,2 @@\n-console.log(\"old\")\n+console.log(\"new\")\n",
30
+ "expected": "diff --git a/a.ts b/a.ts\n@@ -1,2 +1,2 @@\n-console.log(\"old\")\n+console.log(\"new\")\n"
31
+ }
32
+ ]
33
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "id": "git-log",
3
+ "label": "Git Log",
4
+ "description": "Keep commit identifiers and subjects from verbose logs.",
5
+ "category": "git",
6
+ "priority": 70,
7
+ "match": {
8
+ "outputTypes": ["git-log"],
9
+ "commands": ["^git\\s+log\\b"],
10
+ "patterns": ["^commit [0-9a-f]{7,40}", "^Author: "]
11
+ },
12
+ "rules": {
13
+ "includePatterns": ["^commit [0-9a-f]{7,40}", "^\\s{4}\\S"],
14
+ "dropPatterns": ["^Author: ", "^Date: ", "^\\s*$"],
15
+ "collapsePatterns": [],
16
+ "deduplicate": false,
17
+ "maxLines": 120,
18
+ "headLines": 40,
19
+ "tailLines": 20
20
+ },
21
+ "preserve": {
22
+ "errorPatterns": ["^commit "],
23
+ "summaryPatterns": []
24
+ },
25
+ "tests": [
26
+ {
27
+ "name": "inline sample",
28
+ "command": "git log",
29
+ "input": "commit abcdef1234567890\nAuthor: Dev <dev@example.com>\nDate: today\n\n feat: add rtk\n",
30
+ "expected": "commit abcdef1234567890\n feat: add rtk"
31
+ }
32
+ ]
33
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "id": "git-status",
3
+ "label": "Git Status",
4
+ "description": "Keep branch, staged/unstaged headings, and changed file lines.",
5
+ "category": "git",
6
+ "priority": 95,
7
+ "match": {
8
+ "outputTypes": ["git-status"],
9
+ "commands": ["^git\\s+status\\b"],
10
+ "patterns": ["^On branch ", "^Changes (?:not staged|to be committed)", "^Untracked files:"]
11
+ },
12
+ "rules": {
13
+ "includePatterns": [
14
+ "^On branch ",
15
+ "^Your branch ",
16
+ "^Changes ",
17
+ "^Untracked files:",
18
+ "^\\s*(modified|new file|deleted|renamed|both modified):",
19
+ "^\\s*[MADRCU?!]{1,2}\\s+"
20
+ ],
21
+ "dropPatterns": ["^\\s*$", "^\\s*\\(use .*\\)$"],
22
+ "collapsePatterns": [],
23
+ "deduplicate": false,
24
+ "maxLines": 80,
25
+ "headLines": 12,
26
+ "tailLines": 20
27
+ },
28
+ "preserve": {
29
+ "errorPatterns": ["^Changes ", "^Untracked files:"],
30
+ "summaryPatterns": []
31
+ },
32
+ "tests": [
33
+ {
34
+ "name": "inline sample",
35
+ "command": "git status",
36
+ "input": "On branch main\nChanges not staged for commit:\n (use \"git add\" to update)\n\tmodified: src/app.ts\nnothing added to commit\n",
37
+ "expected": "On branch main\nChanges not staged for commit:\n\tmodified: src/app.ts"
38
+ }
39
+ ]
40
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "id": "golangci-lint",
3
+ "label": "golangci-lint",
4
+ "description": "Keep golangci-lint findings and summary.",
5
+ "category": "build",
6
+ "priority": 82,
7
+ "match": {
8
+ "outputTypes": [],
9
+ "commands": ["^golangci-lint\\b"],
10
+ "patterns": ["issues:", "level=error", ":\\d+:\\d+:"]
11
+ },
12
+ "rules": {
13
+ "stripAnsi": true,
14
+ "includePatterns": [":\\d+:\\d+:", "level=error", "issues:", "Error:"],
15
+ "dropPatterns": ["^\\s*$"],
16
+ "collapsePatterns": [],
17
+ "deduplicate": true,
18
+ "maxLines": 140,
19
+ "headLines": 35,
20
+ "tailLines": 50
21
+ },
22
+ "preserve": {
23
+ "errorPatterns": ["level=error", "Error:"],
24
+ "summaryPatterns": ["issues:"]
25
+ },
26
+ "tests": [
27
+ {
28
+ "name": "inline sample",
29
+ "command": "golangci-lint",
30
+ "input": "main.go:1:1: issue text\nlevel=error msg=\"runner failed\"\nissues: 1\n",
31
+ "expected": "main.go:1:1: issue text\nlevel=error msg=\"runner failed\"\nissues: 1"
32
+ }
33
+ ]
34
+ }
@@ -0,0 +1,47 @@
1
+ {
2
+ "id": "gradle",
3
+ "label": "Gradle",
4
+ "description": "Strip Gradle daemon/welcome chatter and no-op tasks; keep build status, failures, and warnings.",
5
+ "category": "build",
6
+ "priority": 78,
7
+ "match": {
8
+ "outputTypes": ["gradle"],
9
+ "commands": ["^(?:gradle|gradlew|\\./gradlew)\\b"],
10
+ "patterns": ["^> Task :", "^BUILD (?:SUCCESSFUL|FAILED)\\b"]
11
+ },
12
+ "rules": {
13
+ "stripAnsi": true,
14
+ "dropPatterns": [
15
+ "^Welcome to Gradle",
16
+ "^Starting a Gradle Daemon",
17
+ "^> Task :\\S+ (?:UP-TO-DATE|SKIPPED|NO-SOURCE|FROM-CACHE)$",
18
+ "^Download https?://",
19
+ "^\\s*$"
20
+ ],
21
+ "collapsePatterns": ["^> Task :\\S+$"],
22
+ "deduplicate": true,
23
+ "maxLines": 160,
24
+ "headLines": 40,
25
+ "tailLines": 60,
26
+ "onEmpty": "gradle: ok"
27
+ },
28
+ "preserve": {
29
+ "errorPatterns": [
30
+ "BUILD FAILED",
31
+ "FAILED",
32
+ "What went wrong",
33
+ "Caused by:",
34
+ "error:",
35
+ "> Task :\\S+ FAILED"
36
+ ],
37
+ "summaryPatterns": ["BUILD SUCCESSFUL", "actionable task"]
38
+ },
39
+ "tests": [
40
+ {
41
+ "name": "drops welcome + up-to-date tasks, keeps build status",
42
+ "command": "gradle build",
43
+ "input": "Welcome to Gradle 8.5!\n> Task :app:compileJava UP-TO-DATE\nBUILD SUCCESSFUL in 3s\n",
44
+ "expected": "BUILD SUCCESSFUL in 3s"
45
+ }
46
+ ]
47
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "id": "json-output",
3
+ "label": "JSON Output",
4
+ "description": "Keep actionable JSON status, error and message fields while preserving structure.",
5
+ "category": "generic",
6
+ "priority": 70,
7
+ "match": {
8
+ "outputTypes": ["json-output"],
9
+ "commands": ["^(?:jq\\b|cat\\s+.*\\.json\\b)"],
10
+ "patterns": ["^\\s*[\\[{][\\s\\S]*[\\]}]\\s*$"]
11
+ },
12
+ "rules": {
13
+ "includePatterns": [
14
+ "\"status\"\\s*:",
15
+ "\"error\"\\s*:",
16
+ "\"errors\"\\s*:",
17
+ "\"code\"\\s*:",
18
+ "\"message\"\\s*:",
19
+ "[{}\\[\\],]"
20
+ ],
21
+ "dropPatterns": ["^\\s*$"],
22
+ "collapsePatterns": [],
23
+ "deduplicate": false,
24
+ "maxLines": 120,
25
+ "headLines": 20,
26
+ "tailLines": 30
27
+ },
28
+ "preserve": {
29
+ "errorPatterns": ["\"error\"", "\"errors\"", "\"message\""],
30
+ "summaryPatterns": []
31
+ },
32
+ "tests": [
33
+ {
34
+ "name": "inline sample",
35
+ "command": "(?:jq\\b|cat .*\\.json\\b)",
36
+ "input": "{\n \"status\": \"ok\",\n \"items\": [1,2,3]\n}\n",
37
+ "expected": "{\n \"status\": \"ok\",\n \"items\": [1,2,3]\n}"
38
+ }
39
+ ]
40
+ }
@@ -0,0 +1,99 @@
1
+ {
2
+ "id": "kubectl",
3
+ "label": "kubectl",
4
+ "description": "Keep kubectl status, rollout and error output. Skips logs/exec/top (arbitrary content) and structured -o json/yaml output.",
5
+ "category": "cloud",
6
+ "priority": 78,
7
+ "match": {
8
+ "outputTypes": ["kubectl"],
9
+ "commands": [
10
+ "^kubectl\\s+(?:get|describe|apply|delete|rollout|events?)(?!.*(?:-o|--output)(?:\\s+|=)(?:json|yaml|go-template|jsonpath|template|name))\\b"
11
+ ],
12
+ "patterns": [
13
+ "NAME\\s+READY\\s+STATUS",
14
+ "NAME\\s+TYPE\\s+CLUSTER-IP",
15
+ "CrashLoopBackOff",
16
+ "ImagePullBackOff",
17
+ "ErrImagePull",
18
+ "FailedScheduling",
19
+ "OOMKilled",
20
+ "Error from server"
21
+ ]
22
+ },
23
+ "rules": {
24
+ "stripAnsi": true,
25
+ "includePatterns": [
26
+ "Error from server",
27
+ "CrashLoopBackOff",
28
+ "ImagePullBackOff",
29
+ "ErrImagePull",
30
+ "FailedScheduling",
31
+ "OOMKilled",
32
+ "Evicted",
33
+ "ContainerCannotRun",
34
+ "BackOff",
35
+ "Unhealthy",
36
+ "Killing",
37
+ "Restarting",
38
+ "NAME\\s+READY\\s+STATUS",
39
+ "NAME\\s+TYPE\\s+CLUSTER-IP",
40
+ "Warning\\s+",
41
+ "deployment\\.apps/\\S+\\s+(?:created|configured|unchanged)",
42
+ "service/\\S+\\s+(?:created|configured)",
43
+ "pod/\\S+\\s+(?:created|deleted)",
44
+ "rollout (?:status|history)",
45
+ "successfully rolled out"
46
+ ],
47
+ "dropPatterns": [
48
+ "^\\s*$",
49
+ "^\\s*creationTimestamp:",
50
+ "^\\s*resourceVersion:",
51
+ "^\\s*uid:",
52
+ "^\\s*managedFields:",
53
+ "^\\s*selfLink:",
54
+ "^\\s*generation:"
55
+ ],
56
+ "collapsePatterns": ["Normal\\s+", "^\\s*-\\s+lastTransitionTime:"],
57
+ "deduplicate": true,
58
+ "maxLines": 120,
59
+ "headLines": 20,
60
+ "tailLines": 60
61
+ },
62
+ "preserve": {
63
+ "errorPatterns": [
64
+ "Error from server",
65
+ "CrashLoopBackOff",
66
+ "ImagePullBackOff",
67
+ "OOMKilled",
68
+ "FailedScheduling",
69
+ "Evicted"
70
+ ],
71
+ "summaryPatterns": ["successfully rolled out", "deployment\\.apps/\\S+\\s+\\w+"]
72
+ },
73
+ "tests": [
74
+ {
75
+ "name": "pod listing with failure",
76
+ "command": "kubectl get",
77
+ "input": "NAME READY STATUS RESTARTS AGE\napi-7d8 1/1 Running 0 2h\nweb-2c4 0/1 CrashLoopBackOff 5 12m\ndb-9f1 1/1 Running 0 2h\n",
78
+ "expected": "NAME READY STATUS RESTARTS AGE\nweb-2c4 0/1 CrashLoopBackOff 5 12m"
79
+ },
80
+ {
81
+ "name": "rollout success",
82
+ "command": "kubectl rollout status",
83
+ "input": "Waiting for deployment \"api\" rollout to finish: 0 of 3 updated replicas are available...\nWaiting for deployment \"api\" rollout to finish: 1 of 3 updated replicas are available...\ndeployment \"api\" successfully rolled out\n",
84
+ "expected": "deployment \"api\" successfully rolled out"
85
+ },
86
+ {
87
+ "name": "skips kubectl logs (arbitrary application output)",
88
+ "command": "kubectl logs api-pod",
89
+ "input": "2026-05-28T10:00:00 INFO request handled\n2026-05-28T10:00:01 INFO request handled\n",
90
+ "expected": "2026-05-28T10:00:00 INFO request handled\n2026-05-28T10:00:01 INFO request handled"
91
+ },
92
+ {
93
+ "name": "skips json output (would corrupt structured data)",
94
+ "command": "kubectl get pods -o json",
95
+ "input": "{\n \"apiVersion\": \"v1\",\n \"items\": [\n { \"metadata\": { \"name\": \"api\" } }\n ]\n}\n",
96
+ "expected": "{\n \"apiVersion\": \"v1\",\n \"items\": [\n { \"metadata\": { \"name\": \"api\" } }\n ]\n}"
97
+ }
98
+ ]
99
+ }