lex-detect 0.2.4 → 0.2.6
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.
- checksums.yaml +4 -4
- data/.github/workflows/detect-scan.yml +82 -0
- data/CHANGELOG.md +10 -0
- data/lib/legion/extensions/detect/catalog.rb +3 -3
- data/lib/legion/extensions/detect/local_migrations/20260528000001_add_detect_results_indexes.rb +17 -0
- data/lib/legion/extensions/detect/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a8a36182d6a38d538dc011ea20a9ffdf14a8a03383e517fe84e91c4f9c5c0edc
|
|
4
|
+
data.tar.gz: 9aa4ac8b023d4bf59400efd129df5aad76a12051a55e5b0397d1f64e538891d0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4f2fe352dd37a952b82616c26dc846efae40e8e13b699e8d783f4ccd1e124f16693a67d58d23725905fe705fda5deb4ff1616cffb1472697f379d7213aa229db
|
|
7
|
+
data.tar.gz: 0be04548f70e841bbb5d825234733dc502430833fe4c92b814a3c2db97a0a845c8e6a024e3e611a43e947b571b3acb761ccf90c7c1608ad15fafc02b8d101db5
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
name: Extension Detection Scan
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
security-events: write
|
|
11
|
+
pull-requests: write
|
|
12
|
+
issues: write
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
detect:
|
|
16
|
+
name: Scan environment for missing extensions
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- uses: ruby/setup-ruby@v1
|
|
22
|
+
with:
|
|
23
|
+
ruby-version: '3.4'
|
|
24
|
+
bundler-cache: true
|
|
25
|
+
|
|
26
|
+
- name: Run detection scan (SARIF)
|
|
27
|
+
run: |
|
|
28
|
+
bundle exec ruby -e '
|
|
29
|
+
require "legion/extensions/detect"
|
|
30
|
+
File.write("detect-results.sarif", Legion::Extensions::Detect.format_results(format: :sarif))
|
|
31
|
+
'
|
|
32
|
+
|
|
33
|
+
- name: Upload SARIF to GitHub Code Scanning
|
|
34
|
+
if: hashFiles('detect-results.sarif') != '' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
|
|
35
|
+
uses: github/codeql-action/upload-sarif@v3
|
|
36
|
+
with:
|
|
37
|
+
sarif_file: detect-results.sarif
|
|
38
|
+
category: legion-detect
|
|
39
|
+
|
|
40
|
+
- name: Post PR comment (markdown)
|
|
41
|
+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
|
|
42
|
+
uses: actions/github-script@v9
|
|
43
|
+
with:
|
|
44
|
+
script: |
|
|
45
|
+
const { execSync } = require('child_process');
|
|
46
|
+
|
|
47
|
+
const md = execSync(
|
|
48
|
+
`bundle exec ruby -e 'require "legion/extensions/detect"; puts Legion::Extensions::Detect.format_results(format: :markdown)'`,
|
|
49
|
+
{ encoding: 'utf-8' }
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
if (!md.trim()) return;
|
|
53
|
+
|
|
54
|
+
// <!-- legion-detect-bot --> is a stable marker for locating our comment
|
|
55
|
+
const MARKER = '<!-- legion-detect-bot -->';
|
|
56
|
+
const body = `${MARKER}\n## Legion Extension Detection\n\n${md}`;
|
|
57
|
+
|
|
58
|
+
const comments = await github.paginate(github.rest.issues.listComments, {
|
|
59
|
+
owner: context.repo.owner,
|
|
60
|
+
repo: context.repo.repo,
|
|
61
|
+
issue_number: context.issue.number,
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const existing = comments.find(c =>
|
|
65
|
+
c.user.type === 'Bot' && c.body.includes(MARKER)
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
if (existing) {
|
|
69
|
+
await github.rest.issues.updateComment({
|
|
70
|
+
owner: context.repo.owner,
|
|
71
|
+
repo: context.repo.repo,
|
|
72
|
+
comment_id: existing.id,
|
|
73
|
+
body,
|
|
74
|
+
});
|
|
75
|
+
} else {
|
|
76
|
+
await github.rest.issues.createComment({
|
|
77
|
+
owner: context.repo.owner,
|
|
78
|
+
repo: context.repo.repo,
|
|
79
|
+
issue_number: context.issue.number,
|
|
80
|
+
body,
|
|
81
|
+
});
|
|
82
|
+
}
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.2.6] - 2026-05-29
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- Migration to add indexes on `name` and `scanned_at` columns of the `detect_results` local SQLite table, eliminating full table scans on filtered lookups
|
|
7
|
+
|
|
8
|
+
## [0.2.5] - 2026-05-07
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- Updated detection catalog to recommend `lex-llm-anthropic`, `lex-llm-openai`, and `lex-llm-ollama` in place of the deprecated `lex-claude`, `lex-openai`, and `lex-ollama` extensions.
|
|
12
|
+
|
|
3
13
|
## [0.2.4] - 2026-03-30
|
|
4
14
|
|
|
5
15
|
### Changed
|
|
@@ -7,7 +7,7 @@ module Legion
|
|
|
7
7
|
# AI Providers
|
|
8
8
|
{
|
|
9
9
|
name: 'Claude',
|
|
10
|
-
extensions: ['lex-
|
|
10
|
+
extensions: ['lex-llm-anthropic'],
|
|
11
11
|
signals: [
|
|
12
12
|
{ type: :app, match: 'Claude.app' },
|
|
13
13
|
{ type: :brew_cask, match: 'claude' },
|
|
@@ -18,7 +18,7 @@ module Legion
|
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
20
|
name: 'OpenAI',
|
|
21
|
-
extensions: ['lex-openai'],
|
|
21
|
+
extensions: ['lex-llm-openai'],
|
|
22
22
|
signals: [
|
|
23
23
|
{ type: :app, match: 'ChatGPT.app' },
|
|
24
24
|
{ type: :brew_cask, match: 'chatgpt' },
|
|
@@ -28,7 +28,7 @@ module Legion
|
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
name: 'Ollama',
|
|
31
|
-
extensions: ['lex-
|
|
31
|
+
extensions: ['lex-llm-ollama'],
|
|
32
32
|
signals: [
|
|
33
33
|
{ type: :brew_formula, match: 'ollama' },
|
|
34
34
|
{ type: :port, match: 11_434 }
|
data/lib/legion/extensions/detect/local_migrations/20260528000001_add_detect_results_indexes.rb
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
Sequel.migration do
|
|
4
|
+
up do
|
|
5
|
+
alter_table(:detect_results) do
|
|
6
|
+
add_index :name, name: :idx_detect_results_name
|
|
7
|
+
add_index :scanned_at, name: :idx_detect_results_scanned_at
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
down do
|
|
12
|
+
alter_table(:detect_results) do
|
|
13
|
+
drop_index :scanned_at, name: :idx_detect_results_scanned_at
|
|
14
|
+
drop_index :name, name: :idx_detect_results_name
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lex-detect
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Esity
|
|
@@ -117,6 +117,7 @@ files:
|
|
|
117
117
|
- ".github/CODEOWNERS"
|
|
118
118
|
- ".github/dependabot.yml"
|
|
119
119
|
- ".github/workflows/ci.yml"
|
|
120
|
+
- ".github/workflows/detect-scan.yml"
|
|
120
121
|
- ".gitignore"
|
|
121
122
|
- ".rspec"
|
|
122
123
|
- ".rubocop.yml"
|
|
@@ -138,6 +139,7 @@ files:
|
|
|
138
139
|
- lib/legion/extensions/detect/installer.rb
|
|
139
140
|
- lib/legion/extensions/detect/local_migrations/20260319000001_create_detect_results.rb
|
|
140
141
|
- lib/legion/extensions/detect/local_migrations/20260320000001_create_observer_events.rb
|
|
142
|
+
- lib/legion/extensions/detect/local_migrations/20260528000001_add_detect_results_indexes.rb
|
|
141
143
|
- lib/legion/extensions/detect/runners/cancel_task.rb
|
|
142
144
|
- lib/legion/extensions/detect/runners/task_observer.rb
|
|
143
145
|
- lib/legion/extensions/detect/scanner.rb
|