agentsys 5.5.0 → 5.7.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/.claude-plugin/marketplace.json +6 -17
- package/.claude-plugin/plugin.json +1 -1
- package/.kiro/agents/exploration-agent.json +1 -1
- package/.kiro/agents/implementation-agent.json +1 -1
- package/.kiro/agents/map-validator.json +2 -2
- package/.kiro/agents/perf-orchestrator.json +1 -1
- package/.kiro/agents/planning-agent.json +1 -1
- package/.kiro/skills/perf-code-paths/SKILL.md +1 -1
- package/.kiro/skills/perf-theory-gatherer/SKILL.md +1 -1
- package/.kiro/skills/repo-intel/SKILL.md +63 -0
- package/AGENTS.md +3 -3
- package/CHANGELOG.md +31 -0
- package/README.md +95 -68
- package/lib/binary/version.js +1 -1
- package/lib/repo-map/converter.js +130 -0
- package/lib/repo-map/index.js +117 -74
- package/lib/repo-map/installer.js +38 -172
- package/lib/repo-map/updater.js +16 -474
- package/meta/skills/maintain-cross-platform/SKILL.md +5 -5
- package/package.json +3 -3
- package/scripts/fix-graduated-repos.js +2 -2
- package/scripts/generate-docs.js +39 -20
- package/scripts/graduate-plugin.js +1 -1
- package/scripts/preflight.js +4 -4
- package/scripts/validate-counts.js +1 -1
- package/scripts/validate-cross-platform-docs.js +2 -2
- package/site/content.json +76 -58
- package/site/index.html +44 -12
- package/site/ux-spec.md +1 -1
- package/.kiro/skills/repo-mapping/SKILL.md +0 -83
- package/lib/repo-map/concurrency.js +0 -29
- package/lib/repo-map/queries/go.js +0 -27
- package/lib/repo-map/queries/index.js +0 -100
- package/lib/repo-map/queries/java.js +0 -38
- package/lib/repo-map/queries/javascript.js +0 -55
- package/lib/repo-map/queries/python.js +0 -24
- package/lib/repo-map/queries/rust.js +0 -73
- package/lib/repo-map/queries/typescript.js +0 -38
- package/lib/repo-map/runner.js +0 -1364
- package/lib/repo-map/usage-analyzer.js +0 -407
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: repo-mapping
|
|
3
|
-
description: "Use when user asks to \"create repo map\", \"generate repo map\", \"update repo map\", \"repo map status\", or \"map symbols/imports\". Builds and validates an AST-based repo map using ast-grep."
|
|
4
|
-
argument-hint: "[action] [--force]"
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Repo Mapping Skill
|
|
8
|
-
|
|
9
|
-
Build and maintain a cached AST-based map of repository symbols and imports using ast-grep.
|
|
10
|
-
|
|
11
|
-
## Parse Arguments
|
|
12
|
-
|
|
13
|
-
```javascript
|
|
14
|
-
const args = '$ARGUMENTS'.split(' ').filter(Boolean);
|
|
15
|
-
const action = args.find(a => !a.startsWith('--')) || 'status';
|
|
16
|
-
const force = args.includes('--force');
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Primary Responsibilities
|
|
20
|
-
|
|
21
|
-
1. **Generate map** on demand (`/repo-map init`)
|
|
22
|
-
2. **Update map** incrementally (`/repo-map update`)
|
|
23
|
-
3. **Check status** and staleness (`/repo-map status`)
|
|
24
|
-
4. **Validate output** with the map-validator agent
|
|
25
|
-
|
|
26
|
-
## Core Data Contract
|
|
27
|
-
|
|
28
|
-
Repo map is stored in the platform state directory:
|
|
29
|
-
|
|
30
|
-
- Claude Code: `.claude/repo-map.json`
|
|
31
|
-
- OpenCode: `.opencode/repo-map.json`
|
|
32
|
-
- Codex CLI: `.codex/repo-map.json`
|
|
33
|
-
|
|
34
|
-
Minimal structure:
|
|
35
|
-
|
|
36
|
-
```json
|
|
37
|
-
{
|
|
38
|
-
"version": "1.0.0",
|
|
39
|
-
"generated": "2026-01-25T12:00:00Z",
|
|
40
|
-
"updated": "2026-01-25T12:05:00Z",
|
|
41
|
-
"git": { "commit": "abc123", "branch": "main" },
|
|
42
|
-
"project": { "languages": ["typescript", "python"] },
|
|
43
|
-
"stats": { "totalFiles": 142, "totalSymbols": 847 },
|
|
44
|
-
"files": {
|
|
45
|
-
"src/auth/login.ts": {
|
|
46
|
-
"hash": "deadbeef1234abcd",
|
|
47
|
-
"language": "typescript",
|
|
48
|
-
"symbols": { "exports": [], "functions": [], "classes": [] },
|
|
49
|
-
"imports": [ { "source": "./utils", "kind": "named" } ]
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
## Behavior Rules
|
|
56
|
-
|
|
57
|
-
- **Never** run ast-grep without user approval if it is not installed
|
|
58
|
-
- **Never** install dependencies without explicit user consent
|
|
59
|
-
- **Always** validate map output with `map-validator` after init/update
|
|
60
|
-
- **Prefer** incremental update unless map is stale or history rewritten
|
|
61
|
-
|
|
62
|
-
## When to Suggest Repo Map
|
|
63
|
-
|
|
64
|
-
If a user asks for drift detection, documentation alignment, or repo analysis and repo-map is missing:
|
|
65
|
-
|
|
66
|
-
```
|
|
67
|
-
Repo map not found. For better analysis, run:
|
|
68
|
-
/repo-map init
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## Staleness Signals
|
|
72
|
-
|
|
73
|
-
- Map commit not found (rebased)
|
|
74
|
-
- Branch changed
|
|
75
|
-
- Git hooks marked stale
|
|
76
|
-
- Commits behind HEAD
|
|
77
|
-
|
|
78
|
-
## Output Expectations
|
|
79
|
-
|
|
80
|
-
Keep outputs concise:
|
|
81
|
-
|
|
82
|
-
- **init/update**: file count, symbol count, commit, warnings
|
|
83
|
-
- **status**: staleness, commits behind, last updated
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
async function runWithConcurrency(items, limit, worker) {
|
|
4
|
-
if (!Array.isArray(items) || items.length === 0) {
|
|
5
|
-
return [];
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
const maxConcurrency = Math.max(1, Math.min(items.length, Math.floor(limit) || 1));
|
|
9
|
-
const results = new Array(items.length);
|
|
10
|
-
let cursor = 0;
|
|
11
|
-
|
|
12
|
-
async function runWorker() {
|
|
13
|
-
while (true) {
|
|
14
|
-
const index = cursor;
|
|
15
|
-
cursor += 1;
|
|
16
|
-
if (index >= items.length) {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
results[index] = await worker(items[index], index);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
await Promise.all(Array.from({ length: maxConcurrency }, () => runWorker()));
|
|
24
|
-
return results;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
module.exports = {
|
|
28
|
-
runWithConcurrency
|
|
29
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Go query patterns for ast-grep
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
'use strict';
|
|
6
|
-
|
|
7
|
-
module.exports = {
|
|
8
|
-
exports: [],
|
|
9
|
-
functions: [
|
|
10
|
-
{ pattern: 'func $NAME($$$) { $$$ }', nameVar: 'NAME' },
|
|
11
|
-
{ pattern: 'func ($$$) $NAME($$$) { $$$ }', nameVar: 'NAME' }
|
|
12
|
-
],
|
|
13
|
-
classes: [],
|
|
14
|
-
types: [
|
|
15
|
-
{ pattern: 'type $NAME struct { $$$ }', nameVar: 'NAME' },
|
|
16
|
-
{ pattern: 'type $NAME interface { $$$ }', nameVar: 'NAME' },
|
|
17
|
-
{ pattern: 'type $NAME = $$$', nameVar: 'NAME' }
|
|
18
|
-
],
|
|
19
|
-
constants: [
|
|
20
|
-
{ pattern: 'const $NAME = $$$', nameVar: 'NAME' },
|
|
21
|
-
{ pattern: 'const $NAME $TYPE = $$$', nameVar: 'NAME' }
|
|
22
|
-
],
|
|
23
|
-
imports: [
|
|
24
|
-
{ pattern: 'import $SOURCE', sourceVar: 'SOURCE', kind: 'import' },
|
|
25
|
-
{ pattern: 'import $NAME $SOURCE', sourceVar: 'SOURCE', kind: 'import' }
|
|
26
|
-
]
|
|
27
|
-
};
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Language-specific query patterns for ast-grep
|
|
3
|
-
*
|
|
4
|
-
* @module lib/repo-map/queries
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
'use strict';
|
|
8
|
-
|
|
9
|
-
const path = require('path');
|
|
10
|
-
|
|
11
|
-
const javascript = require('./javascript');
|
|
12
|
-
const typescript = require('./typescript');
|
|
13
|
-
const python = require('./python');
|
|
14
|
-
const rust = require('./rust');
|
|
15
|
-
const go = require('./go');
|
|
16
|
-
const java = require('./java');
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Get query patterns for a language
|
|
20
|
-
* @param {string} language - Language name
|
|
21
|
-
* @returns {Object|null}
|
|
22
|
-
*/
|
|
23
|
-
function getQueriesForLanguage(language) {
|
|
24
|
-
switch (language) {
|
|
25
|
-
case 'javascript':
|
|
26
|
-
case 'js':
|
|
27
|
-
case 'node':
|
|
28
|
-
return javascript;
|
|
29
|
-
case 'typescript':
|
|
30
|
-
case 'ts':
|
|
31
|
-
return typescript;
|
|
32
|
-
case 'python':
|
|
33
|
-
case 'py':
|
|
34
|
-
return python;
|
|
35
|
-
case 'rust':
|
|
36
|
-
return rust;
|
|
37
|
-
case 'go':
|
|
38
|
-
return go;
|
|
39
|
-
case 'java':
|
|
40
|
-
return java;
|
|
41
|
-
default:
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Get base ast-grep language identifier
|
|
48
|
-
* @param {string} language - Language name
|
|
49
|
-
* @returns {string}
|
|
50
|
-
*/
|
|
51
|
-
function getSgLanguage(language) {
|
|
52
|
-
switch (language) {
|
|
53
|
-
case 'javascript':
|
|
54
|
-
case 'js':
|
|
55
|
-
case 'node':
|
|
56
|
-
return 'javascript';
|
|
57
|
-
case 'typescript':
|
|
58
|
-
case 'ts':
|
|
59
|
-
return 'typescript';
|
|
60
|
-
case 'python':
|
|
61
|
-
case 'py':
|
|
62
|
-
return 'python';
|
|
63
|
-
case 'rust':
|
|
64
|
-
return 'rust';
|
|
65
|
-
case 'go':
|
|
66
|
-
return 'go';
|
|
67
|
-
case 'java':
|
|
68
|
-
return 'java';
|
|
69
|
-
default:
|
|
70
|
-
return 'javascript';
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Get ast-grep language identifier based on file extension
|
|
76
|
-
* @param {string} filePath - File path
|
|
77
|
-
* @param {string} language - Language name
|
|
78
|
-
* @returns {string}
|
|
79
|
-
*/
|
|
80
|
-
function getSgLanguageForFile(filePath, language) {
|
|
81
|
-
const ext = path.extname(filePath).toLowerCase();
|
|
82
|
-
|
|
83
|
-
if (language === 'javascript') {
|
|
84
|
-
if (ext === '.jsx') return 'jsx';
|
|
85
|
-
return 'javascript';
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (language === 'typescript') {
|
|
89
|
-
if (ext === '.tsx') return 'tsx';
|
|
90
|
-
return 'typescript';
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
return getSgLanguage(language);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
module.exports = {
|
|
97
|
-
getQueriesForLanguage,
|
|
98
|
-
getSgLanguage,
|
|
99
|
-
getSgLanguageForFile
|
|
100
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Java query patterns for ast-grep
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
'use strict';
|
|
6
|
-
|
|
7
|
-
module.exports = {
|
|
8
|
-
exports: [
|
|
9
|
-
{ pattern: 'public class $NAME { $$$ }', kind: 'class', nameVar: 'NAME' },
|
|
10
|
-
{ pattern: 'public interface $NAME { $$$ }', kind: 'class', nameVar: 'NAME' },
|
|
11
|
-
{ pattern: 'public enum $NAME { $$$ }', kind: 'class', nameVar: 'NAME' },
|
|
12
|
-
{ pattern: 'public record $NAME($$$) { $$$ }', kind: 'class', nameVar: 'NAME' },
|
|
13
|
-
{ pattern: 'public $RET $NAME($$$) { $$$ }', kind: 'function', nameVar: 'NAME' },
|
|
14
|
-
{ pattern: 'public static $RET $NAME($$$) { $$$ }', kind: 'function', nameVar: 'NAME' },
|
|
15
|
-
{ pattern: 'public $RET $NAME($$$);', kind: 'function', nameVar: 'NAME' }
|
|
16
|
-
],
|
|
17
|
-
functions: [
|
|
18
|
-
{ pattern: 'public $RET $NAME($$$) { $$$ }', nameVar: 'NAME' },
|
|
19
|
-
{ pattern: 'public static $RET $NAME($$$) { $$$ }', nameVar: 'NAME' },
|
|
20
|
-
{ pattern: 'protected $RET $NAME($$$) { $$$ }', nameVar: 'NAME' },
|
|
21
|
-
{ pattern: 'private $RET $NAME($$$) { $$$ }', nameVar: 'NAME' }
|
|
22
|
-
],
|
|
23
|
-
classes: [
|
|
24
|
-
{ pattern: 'class $NAME { $$$ }', nameVar: 'NAME' },
|
|
25
|
-
{ pattern: 'interface $NAME { $$$ }', nameVar: 'NAME' },
|
|
26
|
-
{ pattern: 'enum $NAME { $$$ }', nameVar: 'NAME' },
|
|
27
|
-
{ pattern: 'record $NAME($$$) { $$$ }', nameVar: 'NAME' }
|
|
28
|
-
],
|
|
29
|
-
types: [],
|
|
30
|
-
constants: [
|
|
31
|
-
{ pattern: 'public static final $TYPE $NAME = $$$;', nameVar: 'NAME' },
|
|
32
|
-
{ pattern: 'static final $TYPE $NAME = $$$;', nameVar: 'NAME' }
|
|
33
|
-
],
|
|
34
|
-
imports: [
|
|
35
|
-
{ pattern: 'import $SOURCE;', sourceVar: 'SOURCE', kind: 'import' },
|
|
36
|
-
{ pattern: 'import static $SOURCE;', sourceVar: 'SOURCE', kind: 'import' }
|
|
37
|
-
]
|
|
38
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* JavaScript query patterns for ast-grep
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
'use strict';
|
|
6
|
-
|
|
7
|
-
module.exports = {
|
|
8
|
-
exports: [
|
|
9
|
-
{ pattern: 'export function $NAME($$$) { $$$ }', kind: 'function', nameVar: 'NAME' },
|
|
10
|
-
{ pattern: 'export async function $NAME($$$) { $$$ }', kind: 'function', nameVar: 'NAME' },
|
|
11
|
-
{ pattern: 'export class $NAME { $$$ }', kind: 'class', nameVar: 'NAME' },
|
|
12
|
-
{ pattern: 'export const $NAME = $$$', kind: 'constant', nameVar: 'NAME' },
|
|
13
|
-
{ pattern: 'export let $NAME = $$$', kind: 'variable', nameVar: 'NAME' },
|
|
14
|
-
{ pattern: 'export var $NAME = $$$', kind: 'variable', nameVar: 'NAME' },
|
|
15
|
-
{ pattern: 'export default function $NAME($$$) { $$$ }', kind: 'function', nameVar: 'NAME' },
|
|
16
|
-
{ pattern: 'export default class $NAME { $$$ }', kind: 'class', nameVar: 'NAME' },
|
|
17
|
-
{ pattern: 'export default function ($$$) { $$$ }', kind: 'function', fallbackName: 'default' },
|
|
18
|
-
{ pattern: 'export default class { $$$ }', kind: 'class', fallbackName: 'default' },
|
|
19
|
-
{ pattern: 'export default $NAME', kind: 'value', nameVar: 'NAME' },
|
|
20
|
-
{ pattern: 'export { $$$ }', kind: 'value', multi: 'exportList' },
|
|
21
|
-
{ pattern: 'export { $$$ } from $SOURCE', kind: 're-export', multi: 'exportList', sourceVar: 'SOURCE' },
|
|
22
|
-
{ pattern: 'export * from $SOURCE', kind: 're-export', fallbackName: '*', sourceVar: 'SOURCE' },
|
|
23
|
-
{ pattern: 'module.exports = $NAME', kind: 'value', nameVar: 'NAME' },
|
|
24
|
-
{ pattern: 'module.exports = { $$$ }', kind: 'value', multi: 'objectLiteral' },
|
|
25
|
-
{ pattern: 'exports.$NAME = $$$', kind: 'value', nameVar: 'NAME' }
|
|
26
|
-
],
|
|
27
|
-
functions: [
|
|
28
|
-
{ pattern: 'function $NAME($$$) { $$$ }', nameVar: 'NAME' },
|
|
29
|
-
{ pattern: 'async function $NAME($$$) { $$$ }', nameVar: 'NAME' },
|
|
30
|
-
{ pattern: 'function* $NAME($$$) { $$$ }', nameVar: 'NAME' },
|
|
31
|
-
{ pattern: 'async function* $NAME($$$) { $$$ }', nameVar: 'NAME' },
|
|
32
|
-
{ pattern: 'const $NAME = ($$$) => $$$', nameVar: 'NAME' },
|
|
33
|
-
{ pattern: 'const $NAME = async ($$$) => $$$', nameVar: 'NAME' },
|
|
34
|
-
{ pattern: 'const $NAME = function ($$$) { $$$ }', nameVar: 'NAME' },
|
|
35
|
-
{ pattern: 'const $NAME = async function ($$$) { $$$ }', nameVar: 'NAME' },
|
|
36
|
-
{ pattern: 'let $NAME = ($$$) => $$$', nameVar: 'NAME' },
|
|
37
|
-
{ pattern: 'var $NAME = ($$$) => $$$', nameVar: 'NAME' }
|
|
38
|
-
],
|
|
39
|
-
classes: [
|
|
40
|
-
{ pattern: 'class $NAME { $$$ }', nameVar: 'NAME' },
|
|
41
|
-
{ pattern: 'const $NAME = class { $$$ }', nameVar: 'NAME' },
|
|
42
|
-
{ pattern: 'const $NAME = class $CLASS { $$$ }', nameVar: 'NAME' }
|
|
43
|
-
],
|
|
44
|
-
types: [],
|
|
45
|
-
constants: [],
|
|
46
|
-
imports: [
|
|
47
|
-
{ pattern: 'import $NAME from $SOURCE', sourceVar: 'SOURCE', kind: 'default' },
|
|
48
|
-
{ pattern: 'import * as $NAME from $SOURCE', sourceVar: 'SOURCE', kind: 'namespace' },
|
|
49
|
-
{ pattern: 'import { $$$ } from $SOURCE', sourceVar: 'SOURCE', kind: 'named' },
|
|
50
|
-
{ pattern: 'import $SOURCE', sourceVar: 'SOURCE', kind: 'side-effect' },
|
|
51
|
-
{ pattern: 'const $NAME = require($SOURCE)', sourceVar: 'SOURCE', kind: 'require' },
|
|
52
|
-
{ pattern: 'const { $$$ } = require($SOURCE)', sourceVar: 'SOURCE', kind: 'require' },
|
|
53
|
-
{ pattern: 'require($SOURCE)', sourceVar: 'SOURCE', kind: 'require' }
|
|
54
|
-
]
|
|
55
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Python query patterns for ast-grep
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
'use strict';
|
|
6
|
-
|
|
7
|
-
module.exports = {
|
|
8
|
-
exports: [],
|
|
9
|
-
functions: [
|
|
10
|
-
{ pattern: 'def $NAME($$$): $$$', nameVar: 'NAME' },
|
|
11
|
-
{ pattern: 'async def $NAME($$$): $$$', nameVar: 'NAME' }
|
|
12
|
-
],
|
|
13
|
-
classes: [
|
|
14
|
-
{ pattern: 'class $NAME($$$): $$$', nameVar: 'NAME' },
|
|
15
|
-
{ pattern: 'class $NAME: $$$', nameVar: 'NAME' }
|
|
16
|
-
],
|
|
17
|
-
types: [],
|
|
18
|
-
constants: [],
|
|
19
|
-
imports: [
|
|
20
|
-
{ pattern: 'import $SOURCE', sourceVar: 'SOURCE', kind: 'import', multiSource: true },
|
|
21
|
-
{ pattern: 'from $SOURCE import $NAME', sourceVar: 'SOURCE', kind: 'from' },
|
|
22
|
-
{ pattern: 'from $SOURCE import ($$$)', sourceVar: 'SOURCE', kind: 'from' }
|
|
23
|
-
]
|
|
24
|
-
};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Rust query patterns for ast-grep
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
'use strict';
|
|
6
|
-
|
|
7
|
-
module.exports = {
|
|
8
|
-
exports: [
|
|
9
|
-
{ pattern: 'pub fn $NAME($$$) { $$$ }', kind: 'function', nameVar: 'NAME' },
|
|
10
|
-
{ pattern: 'pub(crate) fn $NAME($$$) { $$$ }', kind: 'function', nameVar: 'NAME' },
|
|
11
|
-
{ pattern: 'pub(super) fn $NAME($$$) { $$$ }', kind: 'function', nameVar: 'NAME' },
|
|
12
|
-
{ pattern: 'pub(in $PATH) fn $NAME($$$) { $$$ }', kind: 'function', nameVar: 'NAME' },
|
|
13
|
-
{ pattern: 'pub struct $NAME { $$$ }', kind: 'type', nameVar: 'NAME' },
|
|
14
|
-
{ pattern: 'pub(crate) struct $NAME { $$$ }', kind: 'type', nameVar: 'NAME' },
|
|
15
|
-
{ pattern: 'pub(super) struct $NAME { $$$ }', kind: 'type', nameVar: 'NAME' },
|
|
16
|
-
{ pattern: 'pub(in $PATH) struct $NAME { $$$ }', kind: 'type', nameVar: 'NAME' },
|
|
17
|
-
{ pattern: 'pub enum $NAME { $$$ }', kind: 'type', nameVar: 'NAME' },
|
|
18
|
-
{ pattern: 'pub(crate) enum $NAME { $$$ }', kind: 'type', nameVar: 'NAME' },
|
|
19
|
-
{ pattern: 'pub(super) enum $NAME { $$$ }', kind: 'type', nameVar: 'NAME' },
|
|
20
|
-
{ pattern: 'pub(in $PATH) enum $NAME { $$$ }', kind: 'type', nameVar: 'NAME' },
|
|
21
|
-
{ pattern: 'pub trait $NAME { $$$ }', kind: 'type', nameVar: 'NAME' },
|
|
22
|
-
{ pattern: 'pub(crate) trait $NAME { $$$ }', kind: 'type', nameVar: 'NAME' },
|
|
23
|
-
{ pattern: 'pub(super) trait $NAME { $$$ }', kind: 'type', nameVar: 'NAME' },
|
|
24
|
-
{ pattern: 'pub(in $PATH) trait $NAME { $$$ }', kind: 'type', nameVar: 'NAME' },
|
|
25
|
-
{ pattern: 'pub type $NAME = $$$', kind: 'type', nameVar: 'NAME' },
|
|
26
|
-
{ pattern: 'pub(crate) type $NAME = $$$', kind: 'type', nameVar: 'NAME' },
|
|
27
|
-
{ pattern: 'pub(super) type $NAME = $$$', kind: 'type', nameVar: 'NAME' },
|
|
28
|
-
{ pattern: 'pub(in $PATH) type $NAME = $$$', kind: 'type', nameVar: 'NAME' },
|
|
29
|
-
{ pattern: 'pub const $NAME: $TYPE = $$$', kind: 'constant', nameVar: 'NAME' },
|
|
30
|
-
{ pattern: 'pub(crate) const $NAME: $TYPE = $$$', kind: 'constant', nameVar: 'NAME' },
|
|
31
|
-
{ pattern: 'pub(super) const $NAME: $TYPE = $$$', kind: 'constant', nameVar: 'NAME' },
|
|
32
|
-
{ pattern: 'pub(in $PATH) const $NAME: $TYPE = $$$', kind: 'constant', nameVar: 'NAME' },
|
|
33
|
-
{ pattern: 'pub static $NAME: $TYPE = $$$', kind: 'constant', nameVar: 'NAME' },
|
|
34
|
-
{ pattern: 'pub(crate) static $NAME: $TYPE = $$$', kind: 'constant', nameVar: 'NAME' },
|
|
35
|
-
{ pattern: 'pub(super) static $NAME: $TYPE = $$$', kind: 'constant', nameVar: 'NAME' },
|
|
36
|
-
{ pattern: 'pub(in $PATH) static $NAME: $TYPE = $$$', kind: 'constant', nameVar: 'NAME' },
|
|
37
|
-
{ pattern: 'pub mod $NAME { $$$ }', kind: 'module', nameVar: 'NAME' },
|
|
38
|
-
{ pattern: 'pub(crate) mod $NAME { $$$ }', kind: 'module', nameVar: 'NAME' },
|
|
39
|
-
{ pattern: 'pub(super) mod $NAME { $$$ }', kind: 'module', nameVar: 'NAME' },
|
|
40
|
-
{ pattern: 'pub(in $PATH) mod $NAME { $$$ }', kind: 'module', nameVar: 'NAME' },
|
|
41
|
-
{ pattern: 'pub mod $NAME;', kind: 'module', nameVar: 'NAME' }
|
|
42
|
-
],
|
|
43
|
-
functions: [
|
|
44
|
-
{ pattern: 'fn $NAME($$$) { $$$ }', nameVar: 'NAME' },
|
|
45
|
-
{ pattern: 'async fn $NAME($$$) { $$$ }', nameVar: 'NAME' },
|
|
46
|
-
{ pattern: 'pub fn $NAME($$$) { $$$ }', nameVar: 'NAME' },
|
|
47
|
-
{ pattern: 'pub(crate) fn $NAME($$$) { $$$ }', nameVar: 'NAME' },
|
|
48
|
-
{ pattern: 'pub(super) fn $NAME($$$) { $$$ }', nameVar: 'NAME' },
|
|
49
|
-
{ pattern: 'pub(in $PATH) fn $NAME($$$) { $$$ }', nameVar: 'NAME' },
|
|
50
|
-
{ pattern: 'pub async fn $NAME($$$) { $$$ }', nameVar: 'NAME' },
|
|
51
|
-
{ pattern: 'pub(crate) async fn $NAME($$$) { $$$ }', nameVar: 'NAME' }
|
|
52
|
-
],
|
|
53
|
-
classes: [],
|
|
54
|
-
types: [
|
|
55
|
-
{ pattern: 'struct $NAME { $$$ }', nameVar: 'NAME' },
|
|
56
|
-
{ pattern: 'enum $NAME { $$$ }', nameVar: 'NAME' },
|
|
57
|
-
{ pattern: 'trait $NAME { $$$ }', nameVar: 'NAME' },
|
|
58
|
-
{ pattern: 'type $NAME = $$$', nameVar: 'NAME' },
|
|
59
|
-
{ pattern: 'pub struct $NAME { $$$ }', nameVar: 'NAME' },
|
|
60
|
-
{ pattern: 'pub enum $NAME { $$$ }', nameVar: 'NAME' },
|
|
61
|
-
{ pattern: 'pub trait $NAME { $$$ }', nameVar: 'NAME' },
|
|
62
|
-
{ pattern: 'pub type $NAME = $$$', nameVar: 'NAME' }
|
|
63
|
-
],
|
|
64
|
-
constants: [
|
|
65
|
-
{ pattern: 'const $NAME: $TYPE = $$$', nameVar: 'NAME' },
|
|
66
|
-
{ pattern: 'static $NAME: $TYPE = $$$', nameVar: 'NAME' }
|
|
67
|
-
],
|
|
68
|
-
imports: [
|
|
69
|
-
{ pattern: 'use $SOURCE;', sourceVar: 'SOURCE', kind: 'use' },
|
|
70
|
-
{ pattern: 'use $SOURCE::{ $$$ };', sourceVar: 'SOURCE', kind: 'use' },
|
|
71
|
-
{ pattern: 'use $SOURCE::*;', sourceVar: 'SOURCE', kind: 'use' }
|
|
72
|
-
]
|
|
73
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TypeScript query patterns for ast-grep
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
'use strict';
|
|
6
|
-
|
|
7
|
-
const javascript = require('./javascript');
|
|
8
|
-
|
|
9
|
-
module.exports = {
|
|
10
|
-
exports: [
|
|
11
|
-
...javascript.exports,
|
|
12
|
-
{ pattern: 'export interface $NAME { $$$ }', kind: 'type', nameVar: 'NAME' },
|
|
13
|
-
{ pattern: 'export type $NAME = $$$', kind: 'type', nameVar: 'NAME' },
|
|
14
|
-
{ pattern: 'export enum $NAME { $$$ }', kind: 'type', nameVar: 'NAME' },
|
|
15
|
-
{ pattern: 'export namespace $NAME { $$$ }', kind: 'type', nameVar: 'NAME' },
|
|
16
|
-
{ pattern: 'export const enum $NAME { $$$ }', kind: 'type', nameVar: 'NAME' },
|
|
17
|
-
{ pattern: 'export = $NAME', kind: 'value', nameVar: 'NAME' },
|
|
18
|
-
{ pattern: 'export as namespace $NAME', kind: 'namespace', nameVar: 'NAME' }
|
|
19
|
-
],
|
|
20
|
-
functions: javascript.functions,
|
|
21
|
-
classes: [
|
|
22
|
-
...javascript.classes,
|
|
23
|
-
{ pattern: 'abstract class $NAME { $$$ }', nameVar: 'NAME' }
|
|
24
|
-
],
|
|
25
|
-
types: [
|
|
26
|
-
{ pattern: 'interface $NAME { $$$ }', nameVar: 'NAME' },
|
|
27
|
-
{ pattern: 'type $NAME = $$$', nameVar: 'NAME' },
|
|
28
|
-
{ pattern: 'enum $NAME { $$$ }', nameVar: 'NAME' },
|
|
29
|
-
{ pattern: 'namespace $NAME { $$$ }', nameVar: 'NAME' },
|
|
30
|
-
{ pattern: 'const enum $NAME { $$$ }', nameVar: 'NAME' }
|
|
31
|
-
],
|
|
32
|
-
constants: javascript.constants,
|
|
33
|
-
imports: [
|
|
34
|
-
...javascript.imports,
|
|
35
|
-
{ pattern: 'import type { $$$ } from $SOURCE', sourceVar: 'SOURCE', kind: 'type' },
|
|
36
|
-
{ pattern: 'import type $NAME from $SOURCE', sourceVar: 'SOURCE', kind: 'type' }
|
|
37
|
-
]
|
|
38
|
-
};
|