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,38 @@
1
+ {
2
+ "id": "make",
3
+ "label": "Make",
4
+ "description": "Strip make directory chatter and empty lines.",
5
+ "category": "build",
6
+ "priority": 78,
7
+ "match": {
8
+ "outputTypes": [],
9
+ "commands": ["^make\\b"],
10
+ "patterns": ["make\\[\\d+\\]: (?:Entering|Leaving) directory"]
11
+ },
12
+ "rules": {
13
+ "stripAnsi": true,
14
+ "dropPatterns": [
15
+ "^make\\[\\d+\\]: (?:Entering|Leaving) directory",
16
+ "^\\s*$",
17
+ "Nothing to be done for"
18
+ ],
19
+ "collapsePatterns": ["^(?:cc|gcc|clang|g\\+\\+)\\b"],
20
+ "deduplicate": true,
21
+ "maxLines": 120,
22
+ "headLines": 30,
23
+ "tailLines": 40,
24
+ "onEmpty": "make: ok"
25
+ },
26
+ "preserve": {
27
+ "errorPatterns": ["error:", "failed", "\\*\\*\\*"],
28
+ "summaryPatterns": ["built", "linking"]
29
+ },
30
+ "tests": [
31
+ {
32
+ "name": "inline sample",
33
+ "command": "make",
34
+ "input": "make[1]: Entering directory '/repo'\ngcc -O2 foo.c\nmake[1]: Leaving directory '/repo'\n",
35
+ "expected": "gcc -O2 foo.c"
36
+ }
37
+ ]
38
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "id": "mypy",
3
+ "label": "mypy",
4
+ "description": "Keep mypy errors grouped by file and final summary.",
5
+ "category": "build",
6
+ "priority": 82,
7
+ "match": {
8
+ "outputTypes": [],
9
+ "commands": ["^mypy\\b", "^python\\s+-m\\s+mypy\\b"],
10
+ "patterns": [": error:", "Found \\d+ errors? in"]
11
+ },
12
+ "rules": {
13
+ "stripAnsi": true,
14
+ "includePatterns": [": error:", ": note:", "Found \\d+ errors?", "Success: no issues found"],
15
+ "dropPatterns": ["^\\s*$"],
16
+ "collapsePatterns": [],
17
+ "deduplicate": true,
18
+ "maxLines": 160,
19
+ "headLines": 40,
20
+ "tailLines": 60
21
+ },
22
+ "preserve": {
23
+ "errorPatterns": [": error:", "Found \\d+ errors?"],
24
+ "summaryPatterns": ["Success:", "Found \\d+"]
25
+ },
26
+ "tests": [
27
+ {
28
+ "name": "inline sample",
29
+ "command": "mypy",
30
+ "input": "app.py:1: error: Incompatible types\nFound 1 error in 1 file\n",
31
+ "expected": "app.py:1: error: Incompatible types\nFound 1 error in 1 file"
32
+ }
33
+ ]
34
+ }
@@ -0,0 +1,43 @@
1
+ {
2
+ "id": "npm-audit",
3
+ "label": "npm audit",
4
+ "description": "Keep vulnerability counts and remediation hints.",
5
+ "category": "package",
6
+ "priority": 84,
7
+ "match": {
8
+ "outputTypes": ["npm-audit"],
9
+ "commands": ["^(?:npm|pnpm|yarn)\\s+audit\\b"],
10
+ "patterns": ["found \\d+ vulnerabilities", "\\bcritical\\b"]
11
+ },
12
+ "rules": {
13
+ "stripAnsi": true,
14
+ "includePatterns": [
15
+ "vulnerabilities",
16
+ "critical",
17
+ "high",
18
+ "moderate",
19
+ "low",
20
+ "fix available",
21
+ "npm audit fix",
22
+ "No vulnerabilities"
23
+ ],
24
+ "dropPatterns": ["^\\s*$", "^# npm audit report"],
25
+ "collapsePatterns": [],
26
+ "deduplicate": true,
27
+ "maxLines": 120,
28
+ "headLines": 30,
29
+ "tailLines": 45
30
+ },
31
+ "preserve": {
32
+ "errorPatterns": ["critical", "high"],
33
+ "summaryPatterns": ["vulnerabilities", "No vulnerabilities"]
34
+ },
35
+ "tests": [
36
+ {
37
+ "name": "inline sample",
38
+ "command": "(?:npm|pnpm|yarn) audit",
39
+ "input": "# npm audit report\ncritical vulnerability in foo\nfound 1 vulnerabilities\nnpm audit fix\n",
40
+ "expected": "critical vulnerability in foo\nfound 1 vulnerabilities\nnpm audit fix"
41
+ }
42
+ ]
43
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "id": "npm-install",
3
+ "label": "Package Install",
4
+ "description": "Keep install summaries, warnings and audit results.",
5
+ "category": "package",
6
+ "priority": 65,
7
+ "match": {
8
+ "outputTypes": ["npm-install"],
9
+ "commands": ["^(?:npm|pnpm|yarn)\\s+(?:install|add|update)\\b"],
10
+ "patterns": ["added \\d+ packages", "packages are looking for funding", "audited \\d+ packages"]
11
+ },
12
+ "rules": {
13
+ "includePatterns": [
14
+ "added \\d+ packages",
15
+ "removed \\d+ packages",
16
+ "changed \\d+ packages",
17
+ "audited \\d+ packages",
18
+ "vulnerabilities",
19
+ "WARN",
20
+ "ERR!"
21
+ ],
22
+ "dropPatterns": ["^\\s*$", "^\\s*\\|", "^Progress:"],
23
+ "collapsePatterns": [],
24
+ "deduplicate": false,
25
+ "maxLines": 80,
26
+ "headLines": 20,
27
+ "tailLines": 30
28
+ },
29
+ "preserve": {
30
+ "errorPatterns": ["WARN", "ERR", "vulnerabilities"],
31
+ "summaryPatterns": []
32
+ },
33
+ "tests": [
34
+ {
35
+ "name": "inline sample",
36
+ "command": "(?:npm|pnpm|yarn) (?:install|add|update)",
37
+ "input": "added 3 packages\npackages are looking for funding\naudited 3 packages\n",
38
+ "expected": "added 3 packages\naudited 3 packages"
39
+ }
40
+ ]
41
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "id": "nx",
3
+ "label": "Nx",
4
+ "description": "Compact Nx task graph and output.",
5
+ "category": "build",
6
+ "priority": 76,
7
+ "match": {
8
+ "outputTypes": [],
9
+ "commands": ["^nx\\b", "^npx\\s+nx\\b"],
10
+ "patterns": ["NX ", "Successfully ran target"]
11
+ },
12
+ "rules": {
13
+ "stripAnsi": true,
14
+ "dropPatterns": ["^\\s*$", "^> nx run"],
15
+ "includePatterns": ["NX ", "ERROR", "Failed", "Successfully ran", "Running target"],
16
+ "collapsePatterns": [],
17
+ "deduplicate": true,
18
+ "maxLines": 120,
19
+ "headLines": 25,
20
+ "tailLines": 50
21
+ },
22
+ "preserve": {
23
+ "errorPatterns": ["ERROR", "Failed"],
24
+ "summaryPatterns": ["Successfully ran"]
25
+ },
26
+ "tests": [
27
+ {
28
+ "name": "inline sample",
29
+ "command": "nx",
30
+ "input": "> nx run app:build\nNX Failed tasks:\nERROR boom\n",
31
+ "expected": "NX Failed tasks:\nERROR boom"
32
+ }
33
+ ]
34
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "id": "pip",
3
+ "label": "pip",
4
+ "description": "Strip pip install progress and keep install/failure summary.",
5
+ "category": "package",
6
+ "priority": 72,
7
+ "match": {
8
+ "outputTypes": [],
9
+ "commands": ["^pip\\s+(?:install|sync|download)\\b", "^python\\s+-m\\s+pip\\s+install\\b"],
10
+ "patterns": ["Successfully installed", "Requirement already satisfied"]
11
+ },
12
+ "rules": {
13
+ "stripAnsi": true,
14
+ "dropPatterns": [
15
+ "^Collecting ",
16
+ "^Downloading ",
17
+ "^Installing collected packages:",
18
+ "^Requirement already satisfied",
19
+ "^\\s*$"
20
+ ],
21
+ "includePatterns": ["Successfully installed", "ERROR:", "WARNING:", "failed", "Could not find"],
22
+ "collapsePatterns": [],
23
+ "deduplicate": true,
24
+ "maxLines": 100,
25
+ "headLines": 25,
26
+ "tailLines": 35,
27
+ "onEmpty": "pip: ok"
28
+ },
29
+ "preserve": {
30
+ "errorPatterns": ["ERROR:", "failed", "Could not find"],
31
+ "summaryPatterns": ["Successfully installed"]
32
+ },
33
+ "tests": [
34
+ {
35
+ "name": "inline sample",
36
+ "command": "pip (?:install|sync|download)",
37
+ "input": "Collecting requests\nDownloading requests.whl\nSuccessfully installed requests-2.0\n",
38
+ "expected": "Successfully installed requests-2.0"
39
+ }
40
+ ]
41
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "id": "playwright",
3
+ "label": "Playwright",
4
+ "description": "Keep failed specs, error context, and summary.",
5
+ "category": "test",
6
+ "priority": 86,
7
+ "match": {
8
+ "outputTypes": [],
9
+ "commands": ["^playwright\\s+test\\b", "^npx\\s+playwright\\s+test\\b"],
10
+ "patterns": ["Running \\d+ tests?", "Error Context:", "failed"]
11
+ },
12
+ "rules": {
13
+ "stripAnsi": true,
14
+ "dropPatterns": ["^\\s*$", "^Running \\d+ tests? using"],
15
+ "includePatterns": [
16
+ "✘",
17
+ "Error:",
18
+ "Error Context:",
19
+ "failed",
20
+ "passed",
21
+ "Slow test file",
22
+ "^\\s*\\d+\\)"
23
+ ],
24
+ "collapsePatterns": ["^\\s+at "],
25
+ "deduplicate": true,
26
+ "maxLines": 160,
27
+ "headLines": 35,
28
+ "tailLines": 60
29
+ },
30
+ "preserve": {
31
+ "errorPatterns": ["Error:", "✘", "failed"],
32
+ "summaryPatterns": ["passed", "failed"]
33
+ },
34
+ "tests": [
35
+ {
36
+ "name": "inline sample",
37
+ "command": "playwright test",
38
+ "input": "Running 2 tests using 1 worker\n ✘ 1 login.spec.ts:3:1 › login\nError: expected visible\n 1 failed\n",
39
+ "expected": " ✘ 1 login.spec.ts:3:1 › login\nError: expected visible\n 1 failed"
40
+ }
41
+ ]
42
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "id": "poetry-install",
3
+ "label": "Poetry Install",
4
+ "description": "Strip Poetry package operation noise.",
5
+ "category": "package",
6
+ "priority": 72,
7
+ "match": {
8
+ "outputTypes": [],
9
+ "commands": ["^poetry\\s+(?:install|update)\\b"],
10
+ "patterns": ["Package operations:", "Installing dependencies"]
11
+ },
12
+ "rules": {
13
+ "stripAnsi": true,
14
+ "dropPatterns": ["^ - Installing ", "^ - Updating ", "^Installing dependencies", "^\\s*$"],
15
+ "includePatterns": ["Package operations:", "Writing lock file", "Error", "failed"],
16
+ "collapsePatterns": [],
17
+ "deduplicate": true,
18
+ "maxLines": 100,
19
+ "headLines": 25,
20
+ "tailLines": 35,
21
+ "onEmpty": "poetry: ok"
22
+ },
23
+ "preserve": {
24
+ "errorPatterns": ["Error", "failed"],
25
+ "summaryPatterns": ["Package operations:", "Writing lock file"]
26
+ },
27
+ "tests": [
28
+ {
29
+ "name": "inline sample",
30
+ "command": "poetry (?:install|update)",
31
+ "input": "Installing dependencies\nPackage operations: 2 installs, 0 updates\n - Installing foo (1.0)\nWriting lock file\n",
32
+ "expected": "Package operations: 2 installs, 0 updates\nWriting lock file"
33
+ }
34
+ ]
35
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "id": "prettier",
3
+ "label": "Prettier",
4
+ "description": "Keep files that would be changed and final summary.",
5
+ "category": "build",
6
+ "priority": 79,
7
+ "match": {
8
+ "outputTypes": [],
9
+ "commands": ["^prettier\\b", "^npx\\s+prettier\\b"],
10
+ "patterns": ["\\[warn\\]", "All matched files use Prettier"]
11
+ },
12
+ "rules": {
13
+ "stripAnsi": true,
14
+ "matchOutput": [
15
+ {
16
+ "pattern": "All matched files use Prettier",
17
+ "message": "prettier: ok"
18
+ }
19
+ ],
20
+ "dropPatterns": ["^\\s*$"],
21
+ "includePatterns": ["\\[warn\\]", "Code style issues", "All matched files"],
22
+ "collapsePatterns": [],
23
+ "deduplicate": true,
24
+ "maxLines": 80,
25
+ "headLines": 20,
26
+ "tailLines": 30
27
+ },
28
+ "preserve": {
29
+ "errorPatterns": ["\\[error\\]", "Code style issues"],
30
+ "summaryPatterns": ["All matched files"]
31
+ },
32
+ "tests": [
33
+ {
34
+ "name": "inline sample",
35
+ "command": "prettier",
36
+ "input": "[warn] src/a.ts\n[warn] Code style issues found in the above file. Forgot to run Prettier?\n",
37
+ "expected": "[warn] src/a.ts\n[warn] Code style issues found in the above file. Forgot to run Prettier?"
38
+ }
39
+ ]
40
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "id": "ps",
3
+ "label": "ps",
4
+ "description": "Keep process table headers and process rows, dropping empty noise.",
5
+ "category": "shell",
6
+ "priority": 68,
7
+ "match": {
8
+ "outputTypes": ["shell-ps"],
9
+ "commands": ["^ps\\b"],
10
+ "patterns": ["^(?:USER\\s+PID|\\s*PID\\s+)"]
11
+ },
12
+ "rules": {
13
+ "stripAnsi": true,
14
+ "dropPatterns": ["^\\s*$"],
15
+ "includePatterns": ["^(?:USER\\s+PID|\\s*PID\\s+)", "^\\S+\\s+\\d+\\s+", "^\\s*\\d+\\s+"],
16
+ "collapsePatterns": [],
17
+ "deduplicate": false,
18
+ "maxLines": 120,
19
+ "headLines": 30,
20
+ "tailLines": 50
21
+ },
22
+ "preserve": {
23
+ "errorPatterns": ["defunct", "Permission denied"],
24
+ "summaryPatterns": ["^(?:USER\\s+PID|\\s*PID\\s+)"]
25
+ },
26
+ "tests": [
27
+ {
28
+ "name": "inline sample",
29
+ "command": "ps aux",
30
+ "input": "USER PID %CPU COMMAND\nroot 1 0.0 init\nnode 1234 5.0 node server.js\n",
31
+ "expected": "USER PID %CPU COMMAND\nroot 1 0.0 init\nnode 1234 5.0 node server.js"
32
+ }
33
+ ]
34
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "id": "rsync",
3
+ "label": "rsync",
4
+ "description": "Drop rsync transfer chatter while preserving copied files and errors.",
5
+ "category": "cloud",
6
+ "priority": 73,
7
+ "match": {
8
+ "outputTypes": ["rsync"],
9
+ "commands": ["^rsync\\b"],
10
+ "patterns": ["^sending incremental file list", "^rsync error:"]
11
+ },
12
+ "rules": {
13
+ "stripAnsi": true,
14
+ "dropPatterns": ["^sending incremental file list", "^sent \\d", "^total size is", "^\\s*$"],
15
+ "collapsePatterns": [],
16
+ "deduplicate": true,
17
+ "maxLines": 140,
18
+ "headLines": 35,
19
+ "tailLines": 50
20
+ },
21
+ "preserve": {
22
+ "errorPatterns": ["^rsync error:", "Permission denied", "No such file"],
23
+ "summaryPatterns": ["^sent \\d", "^total size is"]
24
+ },
25
+ "tests": [
26
+ {
27
+ "name": "inline sample",
28
+ "command": "rsync -av",
29
+ "input": "sending incremental file list\napp.js\nsent 120 bytes received 20 bytes\nrsync error: some files could not be transferred (code 23)\n",
30
+ "expected": "app.js\nrsync error: some files could not be transferred (code 23)"
31
+ }
32
+ ]
33
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "id": "rubocop",
3
+ "label": "RuboCop",
4
+ "description": "Keep RuboCop offenses and final summary.",
5
+ "category": "build",
6
+ "priority": 74,
7
+ "match": {
8
+ "outputTypes": ["rubocop"],
9
+ "commands": ["^rubocop\\b", "^bundle\\s+exec\\s+rubocop\\b"],
10
+ "patterns": ["^Inspecting \\d+ files", "^\\S+\\.rb:\\d+:\\d+: [A-Z]:"]
11
+ },
12
+ "rules": {
13
+ "stripAnsi": true,
14
+ "dropPatterns": ["^Inspecting \\d+ files", "^\\.+$", "^\\s*$"],
15
+ "includePatterns": ["^\\S+\\.rb:\\d+:\\d+: [A-Z]:", "^\\d+ files inspected"],
16
+ "collapsePatterns": [],
17
+ "deduplicate": true,
18
+ "maxLines": 120,
19
+ "headLines": 30,
20
+ "tailLines": 45
21
+ },
22
+ "preserve": {
23
+ "errorPatterns": [" [EF]: ", "Offenses:"],
24
+ "summaryPatterns": ["^\\d+ files inspected"]
25
+ },
26
+ "tests": [
27
+ {
28
+ "name": "inline sample",
29
+ "command": "rubocop",
30
+ "input": "Inspecting 2 files\n.C\napp/models/user.rb:12:3: C: Style/IfUnlessModifier: Favor modifier if usage.\n2 files inspected, 1 offense detected\n",
31
+ "expected": "app/models/user.rb:12:3: C: Style/IfUnlessModifier: Favor modifier if usage.\n2 files inspected, 1 offense detected"
32
+ }
33
+ ]
34
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "id": "ruff",
3
+ "label": "Ruff",
4
+ "description": "Keep Ruff diagnostics and summary.",
5
+ "category": "build",
6
+ "priority": 82,
7
+ "match": {
8
+ "outputTypes": [],
9
+ "commands": ["^ruff\\b", "^uv\\s+run\\s+ruff\\b"],
10
+ "patterns": ["Found \\d+ errors?", "All checks passed"]
11
+ },
12
+ "rules": {
13
+ "stripAnsi": true,
14
+ "matchOutput": [
15
+ {
16
+ "pattern": "All checks passed",
17
+ "message": "ruff: ok"
18
+ }
19
+ ],
20
+ "dropPatterns": ["^\\s*$"],
21
+ "includePatterns": ["^[A-Z]\\d{3}", "Found \\d+", "error:", "warning:", "-->"],
22
+ "collapsePatterns": [],
23
+ "deduplicate": true,
24
+ "maxLines": 120,
25
+ "headLines": 30,
26
+ "tailLines": 40
27
+ },
28
+ "preserve": {
29
+ "errorPatterns": ["^[A-Z]\\d{3}", "error:"],
30
+ "summaryPatterns": ["Found \\d+", "All checks passed"]
31
+ },
32
+ "tests": [
33
+ {
34
+ "name": "inline sample",
35
+ "command": "ruff",
36
+ "input": "F401 app.py:1:1 unused import\nFound 1 error.\n",
37
+ "expected": "F401 app.py:1:1 unused import\nFound 1 error."
38
+ }
39
+ ]
40
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "id": "shell-find",
3
+ "label": "find",
4
+ "description": "Limit large find output while preserving head and tail.",
5
+ "category": "shell",
6
+ "priority": 80,
7
+ "match": {
8
+ "outputTypes": ["shell-find"],
9
+ "commands": ["^find\\b"],
10
+ "patterns": ["^(?:\\./|/|[A-Za-z0-9_.-]+/)"]
11
+ },
12
+ "rules": {
13
+ "stripAnsi": true,
14
+ "dropPatterns": ["^\\s*$"],
15
+ "collapsePatterns": [],
16
+ "deduplicate": true,
17
+ "maxLines": 120,
18
+ "headLines": 40,
19
+ "tailLines": 40
20
+ },
21
+ "preserve": {
22
+ "errorPatterns": ["Permission denied", "No such file"],
23
+ "summaryPatterns": []
24
+ },
25
+ "tests": [
26
+ {
27
+ "name": "inline sample",
28
+ "command": "find",
29
+ "input": "./src/a.ts\n./src/b.ts\n./node_modules/pkg/index.js\n",
30
+ "expected": "./src/a.ts\n./src/b.ts\n./node_modules/pkg/index.js"
31
+ }
32
+ ]
33
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "id": "shell-grep",
3
+ "label": "grep/rg",
4
+ "description": "Deduplicate grep output while preserving matches.",
5
+ "category": "shell",
6
+ "priority": 82,
7
+ "match": {
8
+ "outputTypes": ["shell-grep"],
9
+ "commands": ["^(?:grep|rg|ag)\\b"],
10
+ "patterns": [
11
+ "^[\\w./-]+\\.(?:ts|tsx|js|jsx|py|go|rs|java|rb|md|json|ya?ml|txt):\\d*:",
12
+ "^[\\w./-]+/[\\w./-]+:\\d*:"
13
+ ]
14
+ },
15
+ "rules": {
16
+ "stripAnsi": true,
17
+ "dropPatterns": ["^\\s*$"],
18
+ "includePatterns": ["^[\\w./-]+(?::\\d+)?:"],
19
+ "collapsePatterns": [],
20
+ "deduplicate": true,
21
+ "maxLines": 160,
22
+ "headLines": 40,
23
+ "tailLines": 60
24
+ },
25
+ "preserve": {
26
+ "errorPatterns": ["No such file", "Permission denied"],
27
+ "summaryPatterns": ["^[^:\\n]+(?::\\d+)?:"]
28
+ },
29
+ "tests": [
30
+ {
31
+ "name": "inline sample",
32
+ "command": "(?:grep|rg|ag)",
33
+ "input": "src/a.ts:1:match\nsrc/a.ts:1:match\nsrc/b.ts:2:other\n",
34
+ "expected": "src/a.ts:1:match\nsrc/a.ts:1:match\nsrc/b.ts:2:other"
35
+ }
36
+ ]
37
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "id": "shell-ls",
3
+ "label": "Shell Listing",
4
+ "description": "Keep directory listing boundaries without flooding the prompt.",
5
+ "category": "shell",
6
+ "priority": 50,
7
+ "match": {
8
+ "outputTypes": ["shell-ls"],
9
+ "commands": ["^(?:ls(?:\\s+-[A-Za-z]+)?|find)\\b"],
10
+ "patterns": ["^total \\d+", "^\\S+\\s+\\S+\\s+\\d+\\s+\\w+\\s+\\d{1,2}\\s+"]
11
+ },
12
+ "rules": {
13
+ "includePatterns": [],
14
+ "dropPatterns": ["^\\s*$"],
15
+ "collapsePatterns": [],
16
+ "deduplicate": false,
17
+ "maxLines": 100,
18
+ "headLines": 40,
19
+ "tailLines": 30
20
+ },
21
+ "preserve": {
22
+ "errorPatterns": ["^total \\d+"],
23
+ "summaryPatterns": []
24
+ },
25
+ "tests": [
26
+ {
27
+ "name": "inline sample",
28
+ "command": "(?:ls(?: -[A-Za-z]+)?|find)",
29
+ "input": "total 8\ndrwxr-xr-x 2 user user 4096 May 1 src\n-rw-r--r-- 1 user user 10 May 1 package.json\n",
30
+ "expected": "total 8\ndrwxr-xr-x 2 user user 4096 May 1 src\n-rw-r--r-- 1 user user 10 May 1 package.json"
31
+ }
32
+ ]
33
+ }
@@ -0,0 +1,43 @@
1
+ {
2
+ "id": "ssh",
3
+ "label": "ssh",
4
+ "description": "Compress SSH connection logs while preserving access and host-key failures.",
5
+ "category": "cloud",
6
+ "priority": 72,
7
+ "match": {
8
+ "outputTypes": ["ssh"],
9
+ "commands": ["^ssh\\b"],
10
+ "patterns": [
11
+ "Permission denied \\(",
12
+ "Host key verification failed",
13
+ "Connection (?:closed|timed out)"
14
+ ]
15
+ },
16
+ "rules": {
17
+ "stripAnsi": true,
18
+ "dropPatterns": ["^debug\\d:", "^\\s*$"],
19
+ "includePatterns": [
20
+ "Permission denied",
21
+ "Host key verification failed",
22
+ "Connection (?:closed|timed out)",
23
+ "^Welcome "
24
+ ],
25
+ "collapsePatterns": [],
26
+ "deduplicate": true,
27
+ "maxLines": 100,
28
+ "headLines": 25,
29
+ "tailLines": 40
30
+ },
31
+ "preserve": {
32
+ "errorPatterns": ["Permission denied", "Host key verification failed", "Connection timed out"],
33
+ "summaryPatterns": ["^Welcome "]
34
+ },
35
+ "tests": [
36
+ {
37
+ "name": "inline sample",
38
+ "command": "ssh host",
39
+ "input": "debug1: Connecting to host\nWelcome to Ubuntu\nPermission denied (publickey).\n",
40
+ "expected": "Welcome to Ubuntu\nPermission denied (publickey)."
41
+ }
42
+ ]
43
+ }