@aria-cli/tools 1.0.12 → 1.0.14

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 (233) hide show
  1. package/dist/index.js +378 -70
  2. package/dist/network-runtime/index.js +8 -12
  3. package/dist-cjs/index.js +400 -435
  4. package/dist-cjs/network-runtime/index.js +8 -172
  5. package/package.json +8 -6
  6. package/dist/.tsbuildinfo +0 -1
  7. package/dist/ask-user-interaction.js +0 -22
  8. package/dist/cache/web-cache.js +0 -66
  9. package/dist/definitions/arion.js +0 -104
  10. package/dist/definitions/browser/browser.js +0 -418
  11. package/dist/definitions/browser/index.js +0 -4
  12. package/dist/definitions/browser/pw-downloads.js +0 -114
  13. package/dist/definitions/browser/pw-interactions.js +0 -199
  14. package/dist/definitions/browser/pw-responses.js +0 -76
  15. package/dist/definitions/browser/pw-session.js +0 -310
  16. package/dist/definitions/browser/pw-shared.js +0 -66
  17. package/dist/definitions/browser/pw-snapshot.js +0 -301
  18. package/dist/definitions/browser/pw-state.js +0 -62
  19. package/dist/definitions/browser/types.js +0 -4
  20. package/dist/definitions/code-intelligence.js +0 -470
  21. package/dist/definitions/core.js +0 -109
  22. package/dist/definitions/delegation.js +0 -512
  23. package/dist/definitions/deploy.js +0 -65
  24. package/dist/definitions/filesystem.js +0 -196
  25. package/dist/definitions/frg.js +0 -63
  26. package/dist/definitions/index.js +0 -20
  27. package/dist/definitions/memory.js +0 -123
  28. package/dist/definitions/messaging.js +0 -625
  29. package/dist/definitions/meta.js +0 -349
  30. package/dist/definitions/network.js +0 -159
  31. package/dist/definitions/outlook.js +0 -277
  32. package/dist/definitions/patch/apply-patch.js +0 -184
  33. package/dist/definitions/patch/fuzzy-match.js +0 -166
  34. package/dist/definitions/patch/index.js +0 -1
  35. package/dist/definitions/patch/patch-parser.js +0 -207
  36. package/dist/definitions/patch/sandbox-paths.js +0 -105
  37. package/dist/definitions/process/index.js +0 -4
  38. package/dist/definitions/process/process-registry.js +0 -213
  39. package/dist/definitions/process/process.js +0 -386
  40. package/dist/definitions/process/pty-keys.js +0 -254
  41. package/dist/definitions/process/session-slug.js +0 -142
  42. package/dist/definitions/quip.js +0 -195
  43. package/dist/definitions/search.js +0 -60
  44. package/dist/definitions/session-history.js +0 -69
  45. package/dist/definitions/shell.js +0 -181
  46. package/dist/definitions/slack.js +0 -180
  47. package/dist/definitions/web.js +0 -109
  48. package/dist/executors/apply-patch.js +0 -901
  49. package/dist/executors/arion.js +0 -119
  50. package/dist/executors/code-intelligence.js +0 -882
  51. package/dist/executors/deploy.js +0 -848
  52. package/dist/executors/filesystem.js +0 -1122
  53. package/dist/executors/frg-freshness.js +0 -576
  54. package/dist/executors/frg.js +0 -298
  55. package/dist/executors/index.js +0 -46
  56. package/dist/executors/learning-meta.js +0 -1146
  57. package/dist/executors/lsp-client.js +0 -296
  58. package/dist/executors/memory.js +0 -750
  59. package/dist/executors/meta.js +0 -220
  60. package/dist/executors/process-registry.js +0 -465
  61. package/dist/executors/pty-session-store.js +0 -30
  62. package/dist/executors/pty.js +0 -271
  63. package/dist/executors/restart.js +0 -119
  64. package/dist/executors/search-freshness.js +0 -195
  65. package/dist/executors/search-types.js +0 -52
  66. package/dist/executors/search.js +0 -66
  67. package/dist/executors/self-diagnose.js +0 -398
  68. package/dist/executors/session-history.js +0 -283
  69. package/dist/executors/shell-safety.js +0 -473
  70. package/dist/executors/shell.js +0 -954
  71. package/dist/executors/utils.js +0 -33
  72. package/dist/executors/web.js +0 -542
  73. package/dist/extraction/content-extraction.js +0 -235
  74. package/dist/extraction/index.js +0 -4
  75. package/dist/headless-control-contract.js +0 -967
  76. package/dist/local-control-http-auth.js +0 -2
  77. package/dist/mcp/client.js +0 -181
  78. package/dist/mcp/connection.js +0 -480
  79. package/dist/mcp/index.js +0 -10
  80. package/dist/mcp/jsonrpc.js +0 -144
  81. package/dist/mcp/types.js +0 -7
  82. package/dist/network-control-adapter.js +0 -72
  83. package/dist/network-runtime/address-types.js +0 -165
  84. package/dist/network-runtime/db-owner-fencing.js +0 -69
  85. package/dist/network-runtime/delivery-receipts.js +0 -267
  86. package/dist/network-runtime/direct-endpoint-authority.js +0 -25
  87. package/dist/network-runtime/local-control-contract.js +0 -627
  88. package/dist/network-runtime/node-store-contract.js +0 -34
  89. package/dist/network-runtime/pair-route-contract.js +0 -77
  90. package/dist/network-runtime/peer-capabilities.js +0 -28
  91. package/dist/network-runtime/peer-principal-ref.js +0 -12
  92. package/dist/network-runtime/peer-state-machine.js +0 -121
  93. package/dist/network-runtime/protocol-schemas.js +0 -205
  94. package/dist/network-runtime/runtime-bootstrap-contract.js +0 -60
  95. package/dist/outlook/desktop-session.js +0 -279
  96. package/dist/policy.js +0 -149
  97. package/dist/providers/brave.js +0 -62
  98. package/dist/providers/duckduckgo.js +0 -176
  99. package/dist/providers/exa.js +0 -63
  100. package/dist/providers/firecrawl.js +0 -55
  101. package/dist/providers/index.js +0 -7
  102. package/dist/providers/jina.js +0 -49
  103. package/dist/providers/router.js +0 -96
  104. package/dist/providers/search-provider.js +0 -32
  105. package/dist/providers/tavily.js +0 -54
  106. package/dist/quip/desktop-session.js +0 -317
  107. package/dist/registry/index.js +0 -1
  108. package/dist/registry/registry.js +0 -756
  109. package/dist/runtime-socket-local-control-client.js +0 -330
  110. package/dist/security/dns-normalization.js +0 -19
  111. package/dist/security/dns-pinning.js +0 -123
  112. package/dist/security/external-content.js +0 -91
  113. package/dist/security/ssrf.js +0 -181
  114. package/dist/slack/desktop-session.js +0 -324
  115. package/dist/tool-factory.js +0 -47
  116. package/dist/types.js +0 -7
  117. package/dist/utils/retry.js +0 -132
  118. package/dist/utils/safe-parse-json.js +0 -160
  119. package/dist/utils/url.js +0 -19
  120. package/dist-cjs/.tsbuildinfo +0 -1
  121. package/dist-cjs/ask-user-interaction.js +0 -27
  122. package/dist-cjs/cache/web-cache.js +0 -70
  123. package/dist-cjs/definitions/arion.js +0 -107
  124. package/dist-cjs/definitions/browser/browser.js +0 -421
  125. package/dist-cjs/definitions/browser/index.js +0 -8
  126. package/dist-cjs/definitions/browser/pw-downloads.js +0 -117
  127. package/dist-cjs/definitions/browser/pw-interactions.js +0 -213
  128. package/dist-cjs/definitions/browser/pw-responses.js +0 -84
  129. package/dist-cjs/definitions/browser/pw-session.js +0 -326
  130. package/dist-cjs/definitions/browser/pw-shared.js +0 -72
  131. package/dist-cjs/definitions/browser/pw-snapshot.js +0 -307
  132. package/dist-cjs/definitions/browser/pw-state.js +0 -70
  133. package/dist-cjs/definitions/browser/types.js +0 -5
  134. package/dist-cjs/definitions/code-intelligence.js +0 -473
  135. package/dist-cjs/definitions/core.js +0 -133
  136. package/dist-cjs/definitions/delegation.js +0 -515
  137. package/dist-cjs/definitions/deploy.js +0 -68
  138. package/dist-cjs/definitions/filesystem.js +0 -199
  139. package/dist-cjs/definitions/frg.js +0 -66
  140. package/dist-cjs/definitions/index.js +0 -43
  141. package/dist-cjs/definitions/memory.js +0 -126
  142. package/dist-cjs/definitions/messaging.js +0 -631
  143. package/dist-cjs/definitions/meta.js +0 -352
  144. package/dist-cjs/definitions/network.js +0 -162
  145. package/dist-cjs/definitions/outlook.js +0 -280
  146. package/dist-cjs/definitions/patch/apply-patch.js +0 -191
  147. package/dist-cjs/definitions/patch/fuzzy-match.js +0 -172
  148. package/dist-cjs/definitions/patch/index.js +0 -5
  149. package/dist-cjs/definitions/patch/patch-parser.js +0 -215
  150. package/dist-cjs/definitions/patch/sandbox-paths.js +0 -113
  151. package/dist-cjs/definitions/process/index.js +0 -8
  152. package/dist-cjs/definitions/process/process-registry.js +0 -231
  153. package/dist-cjs/definitions/process/process.js +0 -389
  154. package/dist-cjs/definitions/process/pty-keys.js +0 -259
  155. package/dist-cjs/definitions/process/session-slug.js +0 -145
  156. package/dist-cjs/definitions/quip.js +0 -198
  157. package/dist-cjs/definitions/search.js +0 -63
  158. package/dist-cjs/definitions/session-history.js +0 -72
  159. package/dist-cjs/definitions/shell.js +0 -184
  160. package/dist-cjs/definitions/slack.js +0 -183
  161. package/dist-cjs/definitions/web.js +0 -112
  162. package/dist-cjs/executors/apply-patch.js +0 -938
  163. package/dist-cjs/executors/arion.js +0 -125
  164. package/dist-cjs/executors/code-intelligence.js +0 -925
  165. package/dist-cjs/executors/deploy.js +0 -869
  166. package/dist-cjs/executors/filesystem.js +0 -1167
  167. package/dist-cjs/executors/frg-freshness.js +0 -627
  168. package/dist-cjs/executors/frg.js +0 -334
  169. package/dist-cjs/executors/index.js +0 -143
  170. package/dist-cjs/executors/learning-meta.js +0 -1165
  171. package/dist-cjs/executors/lsp-client.js +0 -310
  172. package/dist-cjs/executors/memory.js +0 -796
  173. package/dist-cjs/executors/meta.js +0 -226
  174. package/dist-cjs/executors/process-registry.js +0 -469
  175. package/dist-cjs/executors/pty-session-store.js +0 -34
  176. package/dist-cjs/executors/pty.js +0 -312
  177. package/dist-cjs/executors/restart.js +0 -155
  178. package/dist-cjs/executors/search-freshness.js +0 -234
  179. package/dist-cjs/executors/search-types.js +0 -56
  180. package/dist-cjs/executors/search.js +0 -102
  181. package/dist-cjs/executors/self-diagnose.js +0 -434
  182. package/dist-cjs/executors/session-history.js +0 -320
  183. package/dist-cjs/executors/shell-safety.js +0 -478
  184. package/dist-cjs/executors/shell.js +0 -1001
  185. package/dist-cjs/executors/utils.js +0 -73
  186. package/dist-cjs/executors/web.js +0 -547
  187. package/dist-cjs/extraction/content-extraction.js +0 -243
  188. package/dist-cjs/extraction/index.js +0 -8
  189. package/dist-cjs/headless-control-contract.js +0 -972
  190. package/dist-cjs/local-control-http-auth.js +0 -5
  191. package/dist-cjs/mcp/client.js +0 -185
  192. package/dist-cjs/mcp/connection.js +0 -484
  193. package/dist-cjs/mcp/index.js +0 -30
  194. package/dist-cjs/mcp/jsonrpc.js +0 -148
  195. package/dist-cjs/mcp/types.js +0 -8
  196. package/dist-cjs/network-control-adapter.js +0 -77
  197. package/dist-cjs/network-runtime/address-types.js +0 -168
  198. package/dist-cjs/network-runtime/db-owner-fencing.js +0 -76
  199. package/dist-cjs/network-runtime/delivery-receipts.js +0 -276
  200. package/dist-cjs/network-runtime/direct-endpoint-authority.js +0 -29
  201. package/dist-cjs/network-runtime/local-control-contract.js +0 -633
  202. package/dist-cjs/network-runtime/node-store-contract.js +0 -38
  203. package/dist-cjs/network-runtime/pair-route-contract.js +0 -80
  204. package/dist-cjs/network-runtime/peer-capabilities.js +0 -37
  205. package/dist-cjs/network-runtime/peer-principal-ref.js +0 -15
  206. package/dist-cjs/network-runtime/peer-state-machine.js +0 -129
  207. package/dist-cjs/network-runtime/protocol-schemas.js +0 -212
  208. package/dist-cjs/network-runtime/runtime-bootstrap-contract.js +0 -63
  209. package/dist-cjs/outlook/desktop-session.js +0 -318
  210. package/dist-cjs/policy.js +0 -155
  211. package/dist-cjs/providers/brave.js +0 -66
  212. package/dist-cjs/providers/duckduckgo.js +0 -180
  213. package/dist-cjs/providers/exa.js +0 -67
  214. package/dist-cjs/providers/firecrawl.js +0 -59
  215. package/dist-cjs/providers/index.js +0 -17
  216. package/dist-cjs/providers/jina.js +0 -53
  217. package/dist-cjs/providers/router.js +0 -100
  218. package/dist-cjs/providers/search-provider.js +0 -36
  219. package/dist-cjs/providers/tavily.js +0 -58
  220. package/dist-cjs/quip/desktop-session.js +0 -353
  221. package/dist-cjs/registry/index.js +0 -6
  222. package/dist-cjs/registry/registry.js +0 -761
  223. package/dist-cjs/runtime-socket-local-control-client.js +0 -367
  224. package/dist-cjs/security/dns-normalization.js +0 -22
  225. package/dist-cjs/security/dns-pinning.js +0 -160
  226. package/dist-cjs/security/external-content.js +0 -95
  227. package/dist-cjs/security/ssrf.js +0 -221
  228. package/dist-cjs/slack/desktop-session.js +0 -366
  229. package/dist-cjs/tool-factory.js +0 -50
  230. package/dist-cjs/types.js +0 -8
  231. package/dist-cjs/utils/retry.js +0 -169
  232. package/dist-cjs/utils/safe-parse-json.js +0 -164
  233. package/dist-cjs/utils/url.js +0 -23
@@ -1,470 +0,0 @@
1
- /**
2
- * Code intelligence tool definitions
3
- *
4
- * 7 native tools wrapping external CLI binaries for code search, structural
5
- * analysis, knowledge graphs, LSP intelligence, and file discovery.
6
- */
7
- import { executeRg, executeUg, executeProbe, executeSg, executeCbm, executeLsp, executeSerena, executeFff, } from "../executors/code-intelligence.js";
8
- // ---------------------------------------------------------------------------
9
- // rg — ripgrep
10
- // ---------------------------------------------------------------------------
11
- const rg = {
12
- name: "rg",
13
- description: "Fast text/regex search (ripgrep). SIMD-accelerated, .gitignore-aware. " +
14
- "Returns structured JSON matches with file, line, and text. " +
15
- "Use for finding strings, patterns, identifiers. Fastest grep available.",
16
- category: "code",
17
- parameters: {
18
- type: "object",
19
- properties: {
20
- pattern: { type: "string", description: "Search pattern (regex by default)" },
21
- path: { type: "string", description: "File or directory to search (default: working dir)" },
22
- ignore_case: { type: "boolean", description: "Case-insensitive search (-i)" },
23
- smart_case: {
24
- type: "boolean",
25
- description: "Case-insensitive unless pattern has uppercase (-S)",
26
- },
27
- fixed_strings: {
28
- type: "boolean",
29
- description: "Treat pattern as literal string, not regex (-F)",
30
- },
31
- word_regexp: { type: "boolean", description: "Match whole words only (-w)" },
32
- file_type: {
33
- type: "string",
34
- description: "File type filter: ts, py, rs, go, java, etc. (-t TYPE)",
35
- },
36
- glob: { type: "string", description: "Glob filter, prefix ! to exclude (-g GLOB)" },
37
- context: { type: "number", description: "Context lines around matches (-C NUM)" },
38
- max_count: { type: "number", description: "Max matches per file (-m NUM)", default: 100 },
39
- invert: { type: "boolean", description: "Show lines NOT matching (-v)" },
40
- files_only: { type: "boolean", description: "Only print file names with matches (-l)" },
41
- count: { type: "boolean", description: "Only print match count per file (-c)" },
42
- extra_args: {
43
- type: "array",
44
- items: { type: "string" },
45
- description: "Additional rg flags: ['--pcre2','-U','--max-depth=3','--hidden','--no-ignore','--type-not=test']",
46
- },
47
- },
48
- required: ["pattern"],
49
- },
50
- riskLevel: "safe",
51
- isReadOnly: true,
52
- loadingTier: "always",
53
- execute: executeRg,
54
- };
55
- // ---------------------------------------------------------------------------
56
- // ug — ugrep
57
- // ---------------------------------------------------------------------------
58
- const ug = {
59
- name: "ug",
60
- description: "Text search with fuzzy matching, boolean queries, and archive search (ugrep). " +
61
- "Superset of ripgrep features. Use fuzzy for approximate matching (typos), " +
62
- "bool for AND/OR/NOT queries, decompress for searching inside zip/tar/gz.",
63
- category: "code",
64
- parameters: {
65
- type: "object",
66
- properties: {
67
- pattern: { type: "string", description: "Search pattern (regex by default)" },
68
- path: { type: "string", description: "File or directory to search (default: working dir)" },
69
- ignore_case: { type: "boolean", description: "Case-insensitive (-i)" },
70
- smart_case: {
71
- type: "boolean",
72
- description: "Smart case: insensitive unless uppercase present (-j)",
73
- },
74
- fixed_strings: { type: "boolean", description: "Literal string matching (-F)" },
75
- word_regexp: { type: "boolean", description: "Match whole words only (-w)" },
76
- file_type: { type: "string", description: "File type filter (-t TYPE)" },
77
- glob: { type: "string", description: "Glob filter (-g GLOB)" },
78
- context: { type: "number", description: "Context lines around matches (-C NUM)" },
79
- max_count: { type: "number", description: "Max matches per file (-m NUM)", default: 100 },
80
- fuzzy: {
81
- oneOf: [{ type: "boolean" }, { type: "number" }],
82
- description: "Fuzzy matching (-Z). true=default distance, number=max Levenshtein distance",
83
- },
84
- bool: {
85
- type: "boolean",
86
- description: "Boolean query mode (-%%). Pattern uses AND/OR/NOT: 'auth AND NOT test'",
87
- },
88
- neg_pattern: {
89
- type: "string",
90
- description: "Negative pattern — reject matching lines (-N PATTERN)",
91
- },
92
- files_only: { type: "boolean", description: "Only print file names (-l)" },
93
- count: { type: "boolean", description: "Only print match count per file (-c)" },
94
- decompress: {
95
- type: "boolean",
96
- description: "Search inside compressed files and archives (-z)",
97
- },
98
- extra_args: {
99
- type: "array",
100
- items: { type: "string" },
101
- description: "Additional ug flags: ['--depth=3','-O=ts,js','--min-size=1K','--format=%f:%n:%o']",
102
- },
103
- },
104
- required: ["pattern"],
105
- },
106
- riskLevel: "safe",
107
- isReadOnly: true,
108
- loadingTier: "always",
109
- execute: executeUg,
110
- };
111
- // ---------------------------------------------------------------------------
112
- // probe
113
- // ---------------------------------------------------------------------------
114
- const probe = {
115
- name: "probe",
116
- description: "Ranked semantic code search with token budgeting (Probe). Returns complete functions/classes, " +
117
- "not line fragments. 4 commands: search (ES-style boolean queries with BM25 ranking), " +
118
- "extract (get code by file:line or file#symbol), symbols (list symbols in file), " +
119
- "query (AST pattern matching). Use max_tokens for LLM context budgeting, session for pagination.",
120
- category: "code",
121
- parameters: {
122
- type: "object",
123
- properties: {
124
- command: {
125
- type: "string",
126
- enum: ["search", "extract", "symbols", "query"],
127
- default: "search",
128
- description: "search=semantic search, extract=get code by line/symbol, symbols=list symbols, query=AST pattern",
129
- },
130
- query: {
131
- type: "string",
132
- description: "Search query (ES syntax: AND/OR/NOT, ext:rs, file:path, dir:tests) or AST pattern for query command",
133
- },
134
- path: { type: "string", description: "Directory to search (default: working dir)" },
135
- exact: {
136
- type: "boolean",
137
- description: "Exact match (true) vs stemmed search (false). 'getUserData' exact vs 'get','user','data'",
138
- },
139
- max_tokens: {
140
- type: "number",
141
- description: "Token budget — limit total output tokens for LLM context",
142
- },
143
- max_results: { type: "number", description: "Maximum number of results" },
144
- session: {
145
- type: "string",
146
- description: "Session ID for pagination. Reuse to get next page (dedup previous results)",
147
- },
148
- language: {
149
- type: "string",
150
- description: "Language filter: rust, typescript, python, go, java, etc.",
151
- },
152
- reranker: {
153
- type: "string",
154
- description: "Ranking algorithm: bm25 (default), tfidf, hybrid, hybrid2",
155
- },
156
- allow_tests: { type: "boolean", description: "Include test files in results" },
157
- files: {
158
- type: "array",
159
- items: { type: "string" },
160
- description: "File specs for extract and symbols commands: ['src/auth.ts:42', 'src/auth.ts#handleAuth', 'src/auth.ts:10-50']",
161
- },
162
- extra_args: {
163
- type: "array",
164
- items: { type: "string" },
165
- description: "Additional probe flags: ['--files-only','--no-merge','--lsp','--timeout=60']",
166
- },
167
- },
168
- required: [],
169
- },
170
- riskLevel: "safe",
171
- isReadOnly: true,
172
- loadingTier: "always",
173
- execute: executeProbe,
174
- };
175
- // ---------------------------------------------------------------------------
176
- // sg — ast-grep
177
- // ---------------------------------------------------------------------------
178
- const sg = {
179
- name: "sg",
180
- description: "AST structural pattern matching and rewriting (ast-grep). Patterns look like real code. " +
181
- "$NAME matches single node, $$$ARGS matches variadic, $_ is wildcard. " +
182
- "Examples: 'console.log($MSG)', 'async function $NAME($$$PARAMS) { $$$BODY }'. " +
183
- "Set rewrite for search-and-replace refactoring. Use command='scan' with inline_rules for YAML rules.",
184
- category: "code",
185
- parameters: {
186
- type: "object",
187
- properties: {
188
- command: {
189
- type: "string",
190
- enum: ["run", "scan"],
191
- default: "run",
192
- description: "run=pattern match/rewrite, scan=rule-based scanning",
193
- },
194
- pattern: {
195
- type: "string",
196
- description: "AST pattern. $NAME=single node, $$$ARGS=variadic, $_=wildcard. " +
197
- "Examples: 'console.log($MSG)', 'async function $NAME($$$PARAMS) { $$$BODY }'",
198
- },
199
- language: {
200
- type: "string",
201
- description: "Language: typescript, python, rust, go, java, javascript, c, cpp, ruby, php, swift, kotlin",
202
- },
203
- rewrite: {
204
- type: "string",
205
- description: "Replacement pattern with same metavariables. Example: pattern='console.log($MSG)' rewrite='logger.info($MSG)'",
206
- },
207
- strictness: {
208
- type: "string",
209
- enum: ["cst", "smart", "ast", "relaxed", "signature"],
210
- description: "Matching strictness. smart=default, ast=ignore punctuation, relaxed=ignore comments",
211
- },
212
- globs: { type: "string", description: "File glob filter, prefix ! to exclude" },
213
- rule: { type: "string", description: "Path to a YAML rule file (for scan)" },
214
- inline_rules: {
215
- type: "string",
216
- description: "Inline YAML rule text (for scan). Example: 'id: no-console\\nlanguage: TypeScript\\nrule:\\n pattern: console.log($$$)'",
217
- },
218
- path: { type: "string", description: "Directory to search (default: working dir)" },
219
- update_all: { type: "boolean", description: "Apply all rewrites without confirmation (-U)" },
220
- context: { type: "number", description: "Context lines around matches (-C NUM)" },
221
- extra_args: {
222
- type: "array",
223
- items: { type: "string" },
224
- description: "Additional sg flags: ['--selector=function_declaration','--threads=4','--no-ignore=hidden']",
225
- },
226
- },
227
- required: [],
228
- },
229
- riskLevel: "safe",
230
- isReadOnly: true,
231
- loadingTier: "always",
232
- execute: executeSg,
233
- };
234
- // ---------------------------------------------------------------------------
235
- // cbm — codebase-memory-mcp
236
- // ---------------------------------------------------------------------------
237
- const cbm = {
238
- name: "cbm",
239
- description: "Code knowledge graph (codebase-memory-mcp). Index codebases, search symbols, trace call chains, " +
240
- "analyze blast radius. Run action='index' once per project. Then: search (symbols by name/type/file), " +
241
- "trace (who calls this? what does it call?), impact (what breaks if I change this?), " +
242
- "context (360° view: definition + callers + callees in one call), architecture (project overview), " +
243
- "snippet (read source by qualified name), code_search (graph-augmented grep), cypher (raw Cypher query).",
244
- category: "code",
245
- parameters: {
246
- type: "object",
247
- properties: {
248
- action: {
249
- type: "string",
250
- enum: [
251
- "index",
252
- "search",
253
- "trace",
254
- "impact",
255
- "context",
256
- "snippet",
257
- "code_search",
258
- "architecture",
259
- "schema",
260
- "cypher",
261
- "list_projects",
262
- "delete_project",
263
- "status",
264
- ],
265
- description: "Action to perform",
266
- },
267
- path: { type: "string", description: "Repository path to index" },
268
- mode: {
269
- type: "string",
270
- enum: ["full", "fast"],
271
- description: "full=with git history, fast=skip git",
272
- },
273
- name: { type: "string", description: "Symbol name or regex pattern" },
274
- label: {
275
- type: "string",
276
- description: "Node type: Function, Class, Method, Interface, Enum, Type, Module, File, Route, Package",
277
- },
278
- file: { type: "string", description: "File path filter" },
279
- direction: {
280
- type: "string",
281
- enum: ["inbound", "outbound", "both"],
282
- default: "both",
283
- description: "inbound=callers, outbound=callees",
284
- },
285
- depth: { type: "number", description: "Traversal depth (1-5)", default: 3 },
286
- edge_types: {
287
- type: "array",
288
- items: { type: "string" },
289
- description: "Filter edges: CALLS, IMPORTS, INHERITS, IMPLEMENTS, USES_TYPE, TESTS, HTTP_CALLS",
290
- },
291
- scope: { type: "string", description: "Git diff scope: 'staged', 'HEAD~1', branch name" },
292
- base_branch: { type: "string", description: "Git branch for comparison", default: "main" },
293
- qualified_name: {
294
- type: "string",
295
- description: "Full qualified name from search results (for snippet)",
296
- },
297
- include_neighbors: {
298
- type: "boolean",
299
- description: "Include caller/callee names (for snippet)",
300
- },
301
- code_pattern: { type: "string", description: "Text search pattern (for code_search)" },
302
- regex: { type: "boolean", description: "Use regex for code_search" },
303
- code_mode: {
304
- type: "string",
305
- enum: ["compact", "full", "files"],
306
- description: "Output mode for code_search",
307
- },
308
- query: { type: "string", description: "Cypher query string (for cypher action)" },
309
- max_rows: { type: "number", description: "Max rows for cypher query" },
310
- project: {
311
- type: "string",
312
- description: "Project name (auto-detected if one project indexed)",
313
- },
314
- limit: { type: "number", description: "Max results", default: 20 },
315
- context: { type: "number", description: "Context lines for code_search" },
316
- },
317
- required: ["action"],
318
- },
319
- riskLevel: "safe",
320
- isReadOnly: true,
321
- loadingTier: "always",
322
- execute: executeCbm,
323
- };
324
- // ---------------------------------------------------------------------------
325
- // lsp — native LSP client (direct JSON-RPC to language servers)
326
- // ---------------------------------------------------------------------------
327
- const lsp = {
328
- name: "lsp",
329
- description: "Compiler-accurate code intelligence via native LSP (Language Server Protocol). " +
330
- "Spawns real language servers directly — same as VS Code and Claude Code. " +
331
- "No Serena, no MCP, no HTTP. Supports: TypeScript, Python, Go, Rust, C/C++, Swift, Java, Kotlin, Lua, PHP, Ruby, C#. " +
332
- "Actions: definition (go-to-definition), references (find all references), " +
333
- "hover (type info + docs), symbols (document symbol list), rename (safe cross-file rename). " +
334
- "Line and character are 0-based. Server starts on first use and stays warm.",
335
- category: "code",
336
- parameters: {
337
- type: "object",
338
- properties: {
339
- action: {
340
- type: "string",
341
- enum: ["definition", "references", "hover", "symbols", "rename"],
342
- description: "definition=go to definition, references=find all references, " +
343
- "hover=type info and docs, symbols=list all symbols in file, " +
344
- "rename=rename symbol across codebase",
345
- },
346
- file: {
347
- type: "string",
348
- description: "File path (relative or absolute). Language server auto-detected from extension.",
349
- },
350
- line: {
351
- type: "number",
352
- description: "0-based line number (for definition, references, hover, rename)",
353
- },
354
- character: {
355
- type: "number",
356
- description: "0-based column/character offset (for definition, references, hover, rename)",
357
- },
358
- new_name: {
359
- type: "string",
360
- description: "New symbol name (for rename action only)",
361
- },
362
- },
363
- required: ["action", "file"],
364
- },
365
- riskLevel: "safe",
366
- isReadOnly: true,
367
- loadingTier: "always",
368
- execute: executeLsp,
369
- };
370
- // ---------------------------------------------------------------------------
371
- // serena — LSP intelligence via HTTP project server
372
- // ---------------------------------------------------------------------------
373
- const serena = {
374
- name: "serena",
375
- description: "Compiler-accurate LSP symbol navigation and editing via Serena HTTP project server. " +
376
- "Use for symbol-level operations by name path (not line/column). " +
377
- "Actions: find_symbol, find_references, overview, replace_body, insert_after, insert_before, rename, search. " +
378
- "Requires: uvx --from 'git+https://github.com/oraios/serena' serena start-project-server --port 9750",
379
- category: "code",
380
- parameters: {
381
- type: "object",
382
- properties: {
383
- action: {
384
- type: "string",
385
- enum: [
386
- "find_symbol",
387
- "find_references",
388
- "overview",
389
- "replace_body",
390
- "insert_after",
391
- "insert_before",
392
- "rename",
393
- "search",
394
- ],
395
- description: "Serena action",
396
- },
397
- name_path: {
398
- type: "string",
399
- description: "Symbol name path: 'handleAuth', 'MyClass/myMethod', '/TopLevel/Nested'",
400
- },
401
- relative_path: { type: "string", description: "Restrict to file or directory" },
402
- include_body: { type: "boolean", description: "Include source code of the symbol" },
403
- include_info: { type: "boolean", description: "Include hover info (docstring, signature)" },
404
- depth: { type: "number", description: "Descendants depth (1=immediate children)" },
405
- body: { type: "string", description: "New code content (for replace_body/insert)" },
406
- new_name: { type: "string", description: "New symbol name (for rename)" },
407
- pattern: { type: "string", description: "Regex pattern (for search action)" },
408
- context_before: { type: "number", description: "Context lines before match" },
409
- context_after: { type: "number", description: "Context lines after match" },
410
- paths_include: { type: "string", description: "Glob to include files" },
411
- paths_exclude: { type: "string", description: "Glob to exclude files" },
412
- extra_args: { type: "object", description: "Additional Serena API params" },
413
- },
414
- required: ["action"],
415
- },
416
- riskLevel: "safe",
417
- isReadOnly: true,
418
- loadingTier: "always",
419
- execute: executeSerena,
420
- };
421
- // ---------------------------------------------------------------------------
422
- // fff — frecency-aware file finder
423
- // ---------------------------------------------------------------------------
424
- const fff = {
425
- name: "fff",
426
- description: "Frecency-aware fuzzy file finder and grep (fff). Files you access often rank higher. " +
427
- "3 actions: grep (search file contents), find_files (fuzzy file search by topic), " +
428
- "multi_grep (OR-search across multiple patterns). Use constraints for filtering: " +
429
- "'*.rs' (type), 'src/' (dir), 'schema.rs' (file), '!test/' (exclude).",
430
- category: "code",
431
- parameters: {
432
- type: "object",
433
- properties: {
434
- action: {
435
- type: "string",
436
- enum: ["grep", "find_files", "multi_grep"],
437
- description: "grep=search contents, find_files=fuzzy file search, multi_grep=OR-search multiple patterns",
438
- },
439
- query: { type: "string", description: "Search text or topic description" },
440
- patterns: {
441
- type: "array",
442
- items: { type: "string" },
443
- description: "Multiple patterns for OR-search (multi_grep only)",
444
- },
445
- constraints: {
446
- type: "string",
447
- description: "Inline constraints: '*.rs' (type), 'src/' (dir), 'schema.rs' (file), '!test/' (exclude)",
448
- },
449
- path: { type: "string", description: "Directory to search (default: working dir)" },
450
- },
451
- required: ["action"],
452
- },
453
- riskLevel: "safe",
454
- isReadOnly: true,
455
- loadingTier: "always",
456
- execute: executeFff,
457
- };
458
- // ---------------------------------------------------------------------------
459
- // Export
460
- // ---------------------------------------------------------------------------
461
- export const CODE_INTELLIGENCE_TOOL_DEFINITIONS = [
462
- rg,
463
- ug,
464
- probe,
465
- sg,
466
- cbm,
467
- lsp,
468
- serena,
469
- fff,
470
- ];
@@ -1,109 +0,0 @@
1
- /**
2
- * Core tool definitions for ARIA
3
- * Core tools across 10 definition groups:
4
- * memory (5), web (3+1), filesystem (8), shell (7+1), arion (4), delegation (3), messaging (4+2), network (2), deploy (1), meta (11)
5
- *
6
- * Individual category definitions are in their respective files.
7
- * This module assembles them into the unified CORE_TOOL_DEFINITIONS array.
8
- * browser and process are forked from OpenClaw (MIT) and added directly here.
9
- */
10
- import { MEMORY_TOOL_DEFINITIONS } from "./memory.js";
11
- import { WEB_TOOL_DEFINITIONS } from "./web.js";
12
- import { FILESYSTEM_TOOL_DEFINITIONS } from "./filesystem.js";
13
- import { SHELL_TOOL_DEFINITIONS } from "./shell.js";
14
- import { ARION_TOOL_DEFINITIONS } from "./arion.js";
15
- import { DELEGATION_TOOL_DEFINITIONS } from "./delegation.js";
16
- import { MESSAGING_TOOL_DEFINITIONS } from "./messaging.js";
17
- import { SLACK_TOOL_DEFINITIONS } from "./slack.js";
18
- import { OUTLOOK_TOOL_DEFINITIONS } from "./outlook.js";
19
- import { QUIP_TOOL_DEFINITIONS } from "./quip.js";
20
- import { NETWORK_TOOL_DEFINITIONS } from "./network.js";
21
- import { DEPLOY_TOOL_DEFINITIONS } from "./deploy.js";
22
- import { META_TOOL_DEFINITIONS } from "./meta.js";
23
- import { SESSION_HISTORY_TOOL_DEFINITIONS } from "./session-history.js";
24
- import { FRG_TOOL_DEFINITIONS } from "./frg.js";
25
- import { CODE_INTELLIGENCE_TOOL_DEFINITIONS } from "./code-intelligence.js";
26
- import { SEARCH_TOOL_DEFINITIONS } from "./search.js";
27
- // OpenClaw forks (MIT) — Playwright browser automation and background process management
28
- import { browserTool } from "./browser/index.js";
29
- import { processTool } from "./process/index.js";
30
- // Re-export category arrays for direct access
31
- export { MEMORY_TOOL_DEFINITIONS } from "./memory.js";
32
- export { WEB_TOOL_DEFINITIONS } from "./web.js";
33
- export { FILESYSTEM_TOOL_DEFINITIONS } from "./filesystem.js";
34
- export { SHELL_TOOL_DEFINITIONS } from "./shell.js";
35
- export { ARION_TOOL_DEFINITIONS } from "./arion.js";
36
- export { DELEGATION_TOOL_DEFINITIONS } from "./delegation.js";
37
- export { MESSAGING_TOOL_DEFINITIONS } from "./messaging.js";
38
- export { SLACK_TOOL_DEFINITIONS } from "./slack.js";
39
- export { OUTLOOK_TOOL_DEFINITIONS } from "./outlook.js";
40
- export { QUIP_TOOL_DEFINITIONS } from "./quip.js";
41
- export { NETWORK_TOOL_DEFINITIONS } from "./network.js";
42
- export { DEPLOY_TOOL_DEFINITIONS } from "./deploy.js";
43
- export { META_TOOL_DEFINITIONS } from "./meta.js";
44
- export { SESSION_HISTORY_TOOL_DEFINITIONS } from "./session-history.js";
45
- export { FRG_TOOL_DEFINITIONS } from "./frg.js";
46
- export { CODE_INTELLIGENCE_TOOL_DEFINITIONS } from "./code-intelligence.js";
47
- export { SEARCH_TOOL_DEFINITIONS } from "./search.js";
48
- /**
49
- * All core tool definitions
50
- */
51
- export const CORE_TOOL_DEFINITIONS = [
52
- // Memory tools (5)
53
- ...MEMORY_TOOL_DEFINITIONS,
54
- // Web tools (3 + browser)
55
- ...WEB_TOOL_DEFINITIONS,
56
- browserTool,
57
- // Filesystem tools (6: read_file, write_file, edit_file, glob, ls, apply_patch)
58
- ...FILESYSTEM_TOOL_DEFINITIONS,
59
- // Shell tools (7 + process)
60
- ...SHELL_TOOL_DEFINITIONS,
61
- processTool,
62
- // Arion tools (4)
63
- ...ARION_TOOL_DEFINITIONS,
64
- // Delegation tools (7): delegate_arion, spawn_worker, check_delegation, pause_delegation, resume_delegation, delegate_remote, quest_report
65
- ...DELEGATION_TOOL_DEFINITIONS,
66
- // Messaging tools (6): send_message, check_messages, search_messages, get_thread, check_slack_messages, send_slack_message
67
- ...MESSAGING_TOOL_DEFINITIONS,
68
- ...SLACK_TOOL_DEFINITIONS,
69
- ...OUTLOOK_TOOL_DEFINITIONS,
70
- ...QUIP_TOOL_DEFINITIONS,
71
- // Network tools (2): manage_network + list_clients
72
- ...NETWORK_TOOL_DEFINITIONS,
73
- // Deploy tools (1): deploy (SSH remote deployment)
74
- ...DEPLOY_TOOL_DEFINITIONS,
75
- // Meta tools (10): ask_user/quest plus learning/meta capability tools
76
- ...META_TOOL_DEFINITIONS,
77
- // Session History tools (1): session_history (list/search/get/current/stats/delete/set_title)
78
- ...SESSION_HISTORY_TOOL_DEFINITIONS,
79
- // Fast regex native tool (1): frg (index/search/status/update/replace)
80
- ...FRG_TOOL_DEFINITIONS,
81
- // Code Intelligence tools (7): rg, ug, probe, sg, cbm, serena, fff
82
- ...CODE_INTELLIGENCE_TOOL_DEFINITIONS,
83
- // Native indexed grep (1): grep (replaces TS grep with n-gram indexed Rust NAPI)
84
- ...SEARCH_TOOL_DEFINITIONS,
85
- ];
86
- /**
87
- * Get all core tools
88
- */
89
- export function getCoreTools() {
90
- return CORE_TOOL_DEFINITIONS;
91
- }
92
- /**
93
- * Get a core tool by name
94
- */
95
- export function getCoreTool(name) {
96
- return CORE_TOOL_DEFINITIONS.find((tool) => tool.name === name);
97
- }
98
- /**
99
- * Get all tools in a category
100
- */
101
- export function getCoreToolsByCategory(category) {
102
- return CORE_TOOL_DEFINITIONS.filter((tool) => tool.category === category);
103
- }
104
- /**
105
- * Get all tools by risk level
106
- */
107
- export function getCoreToolsByRiskLevel(riskLevel) {
108
- return CORE_TOOL_DEFINITIONS.filter((tool) => tool.riskLevel === riskLevel);
109
- }