@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,882 +0,0 @@
1
- /**
2
- * @aria/tools - Code intelligence executors
3
- *
4
- * 7 native tools wrapping external CLI binaries:
5
- * rg (ripgrep), ug (ugrep), probe, sg (ast-grep),
6
- * cbm (codebase-memory-mcp), serena, fff
7
- */
8
- import { execFile, spawn as cpSpawn } from "node:child_process";
9
- import { promisify } from "node:util";
10
- import { existsSync, readdirSync, statSync } from "node:fs";
11
- import { resolve as pathResolve, dirname, join as pathJoin } from "node:path";
12
- import { createConnection } from "node:net";
13
- import { success, fail } from "./utils.js";
14
- const execFileAsync = promisify(execFile);
15
- // ---------------------------------------------------------------------------
16
- // Shared helpers
17
- // ---------------------------------------------------------------------------
18
- const binaryCache = new Map();
19
- async function hasBinary(name) {
20
- if (binaryCache.has(name))
21
- return binaryCache.get(name);
22
- try {
23
- await execFileAsync("which", [name]);
24
- binaryCache.set(name, true);
25
- }
26
- catch {
27
- binaryCache.set(name, false);
28
- }
29
- return binaryCache.get(name);
30
- }
31
- async function shellExec(cmd, args, opts) {
32
- return execFileAsync(cmd, args, {
33
- cwd: opts.cwd,
34
- timeout: opts.timeout ?? 30_000,
35
- signal: opts.signal,
36
- maxBuffer: 10 * 1024 * 1024, // 10MB
37
- });
38
- }
39
- function pushIf(args, condition, ...flags) {
40
- if (condition)
41
- args.push(...flags);
42
- }
43
- function mergeExtraArgs(args, extra) {
44
- if (extra?.length)
45
- args.push(...extra);
46
- }
47
- function escapeRegex(str) {
48
- return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
49
- }
50
- function asExecError(err) {
51
- if (err && typeof err === "object")
52
- return err;
53
- return { message: String(err) };
54
- }
55
- // ---------------------------------------------------------------------------
56
- // 1. rg — ripgrep
57
- // ---------------------------------------------------------------------------
58
- export async function executeRg(input, ctx) {
59
- if (ctx.abortSignal?.aborted)
60
- return fail("Operation cancelled");
61
- if (!(await hasBinary("rg")))
62
- return fail("ripgrep (rg) not installed. Install: brew install ripgrep");
63
- // When count mode is active, rg -c outputs plain text (file:count) even with --json.
64
- // We omit --json and parse the plain-text output instead.
65
- const rgCountMode = !!input.count;
66
- const args = rgCountMode
67
- ? ["--line-number", "--color", "never"]
68
- : ["--json", "--line-number", "--color", "never"];
69
- pushIf(args, input.ignore_case, "-i");
70
- pushIf(args, input.smart_case, "-S");
71
- pushIf(args, input.fixed_strings, "-F");
72
- pushIf(args, input.word_regexp, "-w");
73
- pushIf(args, input.invert, "-v");
74
- pushIf(args, input.files_only, "-l");
75
- pushIf(args, input.count, "-c");
76
- if (input.file_type)
77
- args.push("-t", input.file_type);
78
- if (input.glob)
79
- args.push("-g", input.glob);
80
- if (input.context != null)
81
- args.push("-C", String(input.context));
82
- if (input.max_count != null)
83
- args.push("-m", String(input.max_count));
84
- mergeExtraArgs(args, input.extra_args);
85
- args.push("--", input.pattern);
86
- args.push(input.path ?? ctx.workingDir);
87
- try {
88
- const { stdout } = await shellExec("rg", args, {
89
- cwd: ctx.workingDir,
90
- signal: ctx.abortSignal,
91
- });
92
- if (rgCountMode) {
93
- const counts = parseRipgrepCount(stdout);
94
- const total = counts.reduce((s, c) => s + c.count, 0);
95
- return success(`Found ${total} matches across ${counts.length} files for "${input.pattern}"`, { counts, total });
96
- }
97
- const matches = parseRipgrepJson(stdout);
98
- return success(`Found ${matches.length} matches for "${input.pattern}"`, { matches });
99
- }
100
- catch (err) {
101
- const e = asExecError(err);
102
- if (e.code === 1)
103
- return success("No matches found", { matches: [] });
104
- return fail(`rg failed: ${e.stderr || e.message}`);
105
- }
106
- }
107
- function parseRipgrepJson(stdout) {
108
- const matches = [];
109
- for (const line of stdout.split("\n")) {
110
- if (!line.trim())
111
- continue;
112
- try {
113
- const obj = JSON.parse(line);
114
- if (obj.type === "match") {
115
- matches.push({
116
- file: obj.data.path.text,
117
- line: obj.data.line_number,
118
- text: obj.data.lines.text.trimEnd(),
119
- submatches: obj.data.submatches?.map((s) => s.match?.text) ?? [],
120
- });
121
- }
122
- }
123
- catch {
124
- // Skip malformed lines
125
- }
126
- }
127
- return matches;
128
- }
129
- /** Parse rg/ug plain-text count output: `file:count` per line.
130
- * Filters out files with 0 matches (ug -c outputs 0-count lines, rg doesn't). */
131
- function parseRipgrepCount(stdout) {
132
- const counts = [];
133
- for (const line of stdout.split("\n")) {
134
- if (!line.trim())
135
- continue;
136
- const lastColon = line.lastIndexOf(":");
137
- if (lastColon === -1)
138
- continue;
139
- const file = line.slice(0, lastColon);
140
- const count = parseInt(line.slice(lastColon + 1), 10);
141
- if (!isNaN(count) && count > 0)
142
- counts.push({ file, count });
143
- }
144
- return counts;
145
- }
146
- // ---------------------------------------------------------------------------
147
- // 2. ug — ugrep
148
- // ---------------------------------------------------------------------------
149
- export async function executeUg(input, ctx) {
150
- if (ctx.abortSignal?.aborted)
151
- return fail("Operation cancelled");
152
- if (!(await hasBinary("ug")))
153
- return fail("ugrep (ug) not installed. Install: brew install ugrep");
154
- // --ignore-files: respect .gitignore / .ignore (parity with rg default behaviour).
155
- // --ignore-binary: skip binary files (tar, images, etc.) — rg skips them by default.
156
- // Without these flags ug searches dist/, node_modules/, .tar archives, etc.
157
- const ugCountMode = !!input.count;
158
- const args = ugCountMode
159
- ? ["--line-number", "--color=never", "-r", "--ignore-files", "--ignore-binary"]
160
- : ["--json", "--line-number", "--color=never", "-r", "--ignore-files", "--ignore-binary"];
161
- pushIf(args, input.ignore_case, "-i");
162
- pushIf(args, input.smart_case, "-j");
163
- pushIf(args, input.fixed_strings, "-F");
164
- pushIf(args, input.word_regexp, "-w");
165
- pushIf(args, input.files_only, "-l");
166
- pushIf(args, input.count, "-c");
167
- pushIf(args, input.decompress, "-z");
168
- if (input.file_type)
169
- args.push("-t", input.file_type);
170
- if (input.glob)
171
- args.push("-g", input.glob);
172
- if (input.context != null)
173
- args.push("-C", String(input.context));
174
- if (input.max_count != null)
175
- args.push("-m", String(input.max_count));
176
- if (input.neg_pattern)
177
- args.push("-N", input.neg_pattern);
178
- // Fuzzy matching
179
- if (input.fuzzy === true) {
180
- args.push("-Z");
181
- }
182
- else if (typeof input.fuzzy === "number") {
183
- args.push(`-Z${input.fuzzy}`);
184
- }
185
- // Boolean query mode
186
- if (input.bool)
187
- args.push("-%%");
188
- mergeExtraArgs(args, input.extra_args);
189
- args.push("--", input.pattern);
190
- args.push(input.path ?? ctx.workingDir);
191
- try {
192
- const { stdout } = await shellExec("ug", args, {
193
- cwd: ctx.workingDir,
194
- signal: ctx.abortSignal,
195
- });
196
- if (ugCountMode) {
197
- const counts = parseRipgrepCount(stdout); // same file:count format
198
- const total = counts.reduce((s, c) => s + c.count, 0);
199
- return success(`Found ${total} matches across ${counts.length} files for "${input.pattern}"`, { counts, total });
200
- }
201
- const matches = parseUgrepJson(stdout);
202
- return success(`Found ${matches.length} matches for "${input.pattern}"`, { matches });
203
- }
204
- catch (err) {
205
- const e = asExecError(err);
206
- if (e.code === 1)
207
- return success("No matches found", { matches: [] });
208
- return fail(`ug failed: ${e.stderr || e.message}`);
209
- }
210
- }
211
- function parseUgrepJson(stdout) {
212
- // ugrep --json outputs: [{ file, matches: [{ line, match }] }]
213
- // This is a JSON array, NOT NDJSON like ripgrep
214
- const results = [];
215
- try {
216
- const parsed = JSON.parse(stdout);
217
- for (const fileGroup of parsed) {
218
- for (const m of fileGroup.matches) {
219
- results.push({
220
- file: fileGroup.file,
221
- line: m.line,
222
- text: m.match.trimEnd(),
223
- submatches: [],
224
- });
225
- }
226
- }
227
- }
228
- catch {
229
- // Fallback: try NDJSON parsing in case format varies
230
- for (const line of stdout.split("\n")) {
231
- if (!line.trim())
232
- continue;
233
- try {
234
- const obj = JSON.parse(line);
235
- if (obj.file && obj.matches) {
236
- for (const m of obj.matches) {
237
- results.push({
238
- file: obj.file,
239
- line: m.line,
240
- text: m.match?.trimEnd() ?? "",
241
- submatches: [],
242
- });
243
- }
244
- }
245
- }
246
- catch {
247
- // Skip
248
- }
249
- }
250
- }
251
- return results;
252
- }
253
- // ---------------------------------------------------------------------------
254
- // 3. probe
255
- // ---------------------------------------------------------------------------
256
- export async function executeProbe(input, ctx) {
257
- if (ctx.abortSignal?.aborted)
258
- return fail("Operation cancelled");
259
- if (!(await hasBinary("probe")))
260
- return fail("probe not installed. Install: npm install -g @probelabs/probe");
261
- const cmd = input.command ?? "search";
262
- const args = [cmd];
263
- switch (cmd) {
264
- case "search": {
265
- if (!input.query)
266
- return fail("query required for search");
267
- pushIf(args, input.exact, "--exact");
268
- pushIf(args, input.allow_tests, "--allow-tests");
269
- if (input.max_tokens != null)
270
- args.push("--max-tokens", String(input.max_tokens));
271
- if (input.max_results != null)
272
- args.push("--max-results", String(input.max_results));
273
- if (input.session)
274
- args.push("--session", input.session);
275
- if (input.language)
276
- args.push("--language", input.language);
277
- if (input.reranker)
278
- args.push("--reranker", input.reranker);
279
- args.push("--format", "json");
280
- mergeExtraArgs(args, input.extra_args);
281
- args.push("--", input.query);
282
- if (input.path)
283
- args.push(input.path);
284
- break;
285
- }
286
- case "extract": {
287
- if (!input.files?.length)
288
- return fail("files required for extract");
289
- args.push("--format", "json");
290
- mergeExtraArgs(args, input.extra_args);
291
- args.push(...input.files);
292
- break;
293
- }
294
- case "symbols": {
295
- // Accept files via `files` array or fall back to `query` as a file path
296
- const symbolFiles = input.files?.length ? input.files : input.query ? [input.query] : [];
297
- if (!symbolFiles.length)
298
- return fail("files required for symbols (pass via 'files' or 'query')");
299
- args.push("--format", "json");
300
- mergeExtraArgs(args, input.extra_args);
301
- args.push(...symbolFiles);
302
- break;
303
- }
304
- case "query": {
305
- if (!input.query)
306
- return fail("query (AST pattern) required for query command");
307
- if (input.language)
308
- args.push("--language", input.language);
309
- if (input.max_results != null)
310
- args.push("--max-results", String(input.max_results));
311
- pushIf(args, input.allow_tests, "--allow-tests");
312
- args.push("--format", "json");
313
- mergeExtraArgs(args, input.extra_args);
314
- args.push("--", input.query);
315
- if (input.path)
316
- args.push(input.path);
317
- break;
318
- }
319
- }
320
- try {
321
- const { stdout } = await shellExec("probe", args, {
322
- cwd: ctx.workingDir,
323
- signal: ctx.abortSignal,
324
- timeout: 60_000,
325
- });
326
- try {
327
- const data = JSON.parse(stdout);
328
- return success(`probe ${cmd} completed`, data);
329
- }
330
- catch {
331
- // If not valid JSON, return raw output
332
- return success(`probe ${cmd} completed`, { raw: stdout });
333
- }
334
- }
335
- catch (err) {
336
- const e = asExecError(err);
337
- return fail(`probe ${cmd} failed: ${e.stderr || e.message}`);
338
- }
339
- }
340
- // ---------------------------------------------------------------------------
341
- // 4. sg — ast-grep
342
- // ---------------------------------------------------------------------------
343
- export async function executeSg(input, ctx) {
344
- if (ctx.abortSignal?.aborted)
345
- return fail("Operation cancelled");
346
- if (!(await hasBinary("sg")))
347
- return fail("ast-grep (sg) not installed. Install: cargo install ast-grep --locked");
348
- const cmd = input.command ?? "run";
349
- const isMutation = !!(input.rewrite || input.update_all);
350
- // Require confirmation for mutations
351
- if (isMutation && !input.update_all && ctx.confirm) {
352
- const approved = await ctx.confirm(`Rewrite code matching \`${input.pattern}\` to \`${input.rewrite}\` in ${input.language || "auto-detected"} files?`);
353
- if (!approved)
354
- return fail("Rewrite cancelled by user");
355
- }
356
- const args = [cmd];
357
- if (cmd === "run") {
358
- if (!input.pattern)
359
- return fail("pattern required for sg run");
360
- args.push("--pattern", input.pattern);
361
- if (input.language)
362
- args.push("--lang", input.language);
363
- if (input.rewrite)
364
- args.push("--rewrite", input.rewrite);
365
- if (input.strictness)
366
- args.push("--strictness", input.strictness);
367
- pushIf(args, input.update_all, "-U");
368
- }
369
- else if (cmd === "scan") {
370
- if (input.rule)
371
- args.push("--rule", input.rule);
372
- if (input.inline_rules)
373
- args.push("--inline-rules", input.inline_rules);
374
- }
375
- // Shared flags
376
- if (input.globs)
377
- args.push("--globs", input.globs);
378
- if (input.context != null)
379
- args.push("-C", String(input.context));
380
- // Always JSON for machine parsing, skip color
381
- if (!isMutation) {
382
- args.push("--json=compact");
383
- }
384
- args.push("--color", "never");
385
- mergeExtraArgs(args, input.extra_args);
386
- args.push(input.path ?? ctx.workingDir);
387
- try {
388
- const { stdout } = await shellExec("sg", args, {
389
- cwd: ctx.workingDir,
390
- signal: ctx.abortSignal,
391
- });
392
- if (isMutation) {
393
- return success(`sg ${cmd}: rewrites applied`, { raw: stdout });
394
- }
395
- try {
396
- const data = JSON.parse(stdout);
397
- const count = Array.isArray(data) ? data.length : 0;
398
- return success(`Found ${count} matches`, { matches: data });
399
- }
400
- catch {
401
- return success(`sg ${cmd} completed`, { raw: stdout });
402
- }
403
- }
404
- catch (err) {
405
- // Exit code 1 = no matches for run
406
- const e = asExecError(err);
407
- if (e.code === 1 && cmd === "run")
408
- return success("No matches found", { matches: [] });
409
- return fail(`sg ${cmd} failed: ${e.stderr || e.message}`);
410
- }
411
- }
412
- // ---------------------------------------------------------------------------
413
- // 5. cbm — codebase-memory-mcp
414
- // ---------------------------------------------------------------------------
415
- // Internal helper to call cbm CLI
416
- async function cbmCall(tool, params, ctx, timeout) {
417
- // Remove undefined/null values from params
418
- const clean = {};
419
- for (const [k, v] of Object.entries(params)) {
420
- if (v !== undefined && v !== null)
421
- clean[k] = v;
422
- }
423
- const { stdout } = await shellExec("codebase-memory-mcp", ["cli", tool, JSON.stringify(clean)], {
424
- cwd: ctx.workingDir,
425
- signal: ctx.abortSignal,
426
- timeout: timeout ?? 30_000,
427
- });
428
- // cbm cli returns MCP content format: { content: [{ type: "text", text: "..." }] }
429
- // Filter log lines (level=info ...) and parse
430
- const jsonLines = stdout.split("\n").filter((l) => l.trim() && !l.startsWith("level="));
431
- const parsed = JSON.parse(jsonLines.join("\n"));
432
- if (Array.isArray(parsed.content)) {
433
- const textBlocks = parsed.content
434
- .filter((c) => c.type === "text")
435
- .map((c) => c.text);
436
- const combined = textBlocks.join("\n");
437
- try {
438
- return JSON.parse(combined);
439
- }
440
- catch {
441
- return { text: combined };
442
- }
443
- }
444
- return parsed;
445
- }
446
- export async function executeCbm(input, ctx) {
447
- if (ctx.abortSignal?.aborted)
448
- return fail("Operation cancelled");
449
- if (!(await hasBinary("codebase-memory-mcp")))
450
- return fail("codebase-memory-mcp not installed. Install:\ncurl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/scripts/setup.sh | bash");
451
- // Auto-detect project name: cbm slugifies repo_path by replacing / with -
452
- // and stripping the leading separator: /Users/hole/aria → Users-hole-aria
453
- const p = input.project ?? (input.path ?? ctx.workingDir).replace(/^\//, "").replace(/\//g, "-");
454
- // Auto-index: if the action requires an indexed project and no project exists,
455
- // transparently run a fast index first so queries don't silently return empty.
456
- const queryActions = new Set([
457
- "search",
458
- "trace",
459
- "impact",
460
- "context",
461
- "snippet",
462
- "code_search",
463
- "architecture",
464
- "schema",
465
- "cypher",
466
- ]);
467
- if (queryActions.has(input.action)) {
468
- let needsIndex = false;
469
- try {
470
- const statusResult = (await cbmCall("index_status", { project: p }, ctx));
471
- // If status indicates no project or empty graph, auto-index
472
- if (statusResult?.status === "no_project" ||
473
- statusResult?.node_count === 0 ||
474
- statusResult?.error) {
475
- needsIndex = true;
476
- }
477
- }
478
- catch {
479
- // index_status failed — likely no project
480
- needsIndex = true;
481
- }
482
- if (needsIndex) {
483
- try {
484
- await cbmCall("index_repository", { repo_path: input.path ?? ctx.workingDir, mode: "full" }, ctx, 300_000);
485
- }
486
- catch {
487
- // If auto-index fails, continue — let the actual action produce the error
488
- }
489
- }
490
- }
491
- switch (input.action) {
492
- case "index":
493
- return success("Indexed", await cbmCall("index_repository", { repo_path: input.path ?? ctx.workingDir, mode: input.mode ?? "full" }, ctx, 300_000));
494
- case "search":
495
- return success("Search results", await cbmCall("search_graph", {
496
- project: p,
497
- name_pattern: input.name,
498
- label: input.label,
499
- file_pattern: input.file,
500
- limit: input.limit ?? 20,
501
- }, ctx));
502
- case "trace": {
503
- if (!input.name)
504
- return fail("name required for trace");
505
- return success(`Call chain: ${input.name}`, await cbmCall("trace_call_path", {
506
- project: p,
507
- function_name: input.name,
508
- direction: input.direction ?? "both",
509
- depth: input.depth ?? 3,
510
- edge_types: input.edge_types,
511
- }, ctx));
512
- }
513
- case "impact":
514
- return success("Impact analysis", await cbmCall("detect_changes", {
515
- project: p,
516
- scope: input.scope,
517
- depth: input.depth ?? 2,
518
- base_branch: input.base_branch ?? "main",
519
- }, ctx));
520
- case "context": {
521
- if (!input.name)
522
- return fail("name required for context");
523
- const [sym, callers, callees] = await Promise.all([
524
- cbmCall("search_graph", { project: p, name_pattern: `^${escapeRegex(input.name)}$`, limit: 1 }, ctx),
525
- cbmCall("trace_call_path", { project: p, function_name: input.name, direction: "inbound", depth: 2 }, ctx),
526
- cbmCall("trace_call_path", { project: p, function_name: input.name, direction: "outbound", depth: 2 }, ctx),
527
- ]);
528
- return success(`360° context: ${input.name}`, {
529
- definition: sym.results?.[0],
530
- callers,
531
- callees,
532
- });
533
- }
534
- case "snippet": {
535
- if (!input.qualified_name)
536
- return fail("qualified_name required for snippet");
537
- return success("Code snippet", await cbmCall("get_code_snippet", {
538
- project: p,
539
- qualified_name: input.qualified_name,
540
- include_neighbors: input.include_neighbors,
541
- }, ctx));
542
- }
543
- case "code_search":
544
- return success("Code search", await cbmCall("search_code", {
545
- project: p,
546
- pattern: input.code_pattern,
547
- mode: input.code_mode ?? "compact",
548
- regex: input.regex,
549
- limit: input.limit ?? 10,
550
- file_pattern: input.file,
551
- context: input.context,
552
- }, ctx));
553
- case "architecture":
554
- return success("Architecture", await cbmCall("get_architecture", { project: p }, ctx));
555
- case "schema":
556
- return success("Schema", await cbmCall("get_graph_schema", { project: p }, ctx));
557
- case "cypher": {
558
- if (!input.query)
559
- return fail("query required for cypher");
560
- return success("Cypher result", await cbmCall("query_graph", { project: p, query: input.query, max_rows: input.max_rows }, ctx));
561
- }
562
- case "list_projects":
563
- return success("Projects", await cbmCall("list_projects", {}, ctx));
564
- case "delete_project": {
565
- if (!input.project)
566
- return fail("project required for delete_project");
567
- if (ctx.confirm) {
568
- const ok = await ctx.confirm(`Delete project "${input.project}" from cbm index?`);
569
- if (!ok)
570
- return fail("Cancelled");
571
- }
572
- return success("Deleted", await cbmCall("delete_project", { project: p }, ctx));
573
- }
574
- case "status":
575
- return success("Status", await cbmCall("index_status", { project: p }, ctx));
576
- default:
577
- return fail(`Unknown cbm action: ${input.action}`);
578
- }
579
- }
580
- let _lspClient;
581
- async function getLspClient() {
582
- if (!_lspClient) {
583
- // Use variable to prevent TypeScript from following the import in CJS build
584
- const modulePath = "./lsp-client.js";
585
- _lspClient = (await import(/* webpackIgnore: true */ modulePath));
586
- }
587
- return _lspClient;
588
- }
589
- export async function executeLsp(input, ctx) {
590
- if (ctx.abortSignal?.aborted)
591
- return fail("Operation cancelled");
592
- if (!input.file)
593
- return fail("file required");
594
- const { getServerForFile, getOrCreateServer, LSP_SERVERS } = await getLspClient();
595
- const serverName = getServerForFile(input.file);
596
- if (!serverName) {
597
- const ext = input.file.slice(input.file.lastIndexOf("."));
598
- const supported = Object.entries(LSP_SERVERS)
599
- .map(([name, cfg]) => `${name}: ${Object.keys(cfg.extensionToLanguage).join(", ")}`)
600
- .join("\n ");
601
- return fail(`No language server for extension "${ext}". Supported:\n ${supported}`);
602
- }
603
- // Rename requires confirmation
604
- if (input.action === "rename" && ctx.confirm) {
605
- const ok = await ctx.confirm(`Rename symbol at ${input.file}:${input.line}:${input.character} to "${input.new_name}"?`);
606
- if (!ok)
607
- return fail("Cancelled by user");
608
- }
609
- const server = getOrCreateServer(serverName, ctx.workingDir);
610
- try {
611
- await server.start();
612
- switch (input.action) {
613
- case "definition": {
614
- if (input.line == null || input.character == null)
615
- return fail("line and character required for definition");
616
- const result = await server.definition(input.file, input.line, input.character);
617
- return success(`lsp definition`, result);
618
- }
619
- case "references": {
620
- if (input.line == null || input.character == null)
621
- return fail("line and character required for references");
622
- const result = await server.references(input.file, input.line, input.character);
623
- return success(`lsp references`, result);
624
- }
625
- case "hover": {
626
- if (input.line == null || input.character == null)
627
- return fail("line and character required for hover");
628
- const result = await server.hover(input.file, input.line, input.character);
629
- return success(`lsp hover`, result);
630
- }
631
- case "symbols": {
632
- const result = await server.documentSymbols(input.file);
633
- return success(`lsp symbols`, result);
634
- }
635
- case "rename": {
636
- if (input.line == null || input.character == null || !input.new_name)
637
- return fail("line, character, and new_name required for rename");
638
- const result = await server.rename(input.file, input.line, input.character, input.new_name);
639
- return success(`lsp rename`, result);
640
- }
641
- default:
642
- return fail(`Unknown lsp action: ${input.action}. Use: definition, references, hover, symbols, rename`);
643
- }
644
- }
645
- catch (err) {
646
- const e = asExecError(err);
647
- return fail(`lsp ${input.action} failed: ${e.message}`);
648
- }
649
- }
650
- // ---------------------------------------------------------------------------
651
- // 7. serena — HTTP project server (kept alongside native LSP for full Serena API)
652
- // ---------------------------------------------------------------------------
653
- const SERENA_PORT = 9750;
654
- const SERENA_BASE = `http://127.0.0.1:${SERENA_PORT}`;
655
- const SERENA_PROJECT = "aria";
656
- const SERENA_TOOL_MAP = {
657
- find_symbol: "find_symbol",
658
- find_references: "find_referencing_symbols",
659
- overview: "get_symbols_overview",
660
- replace_body: "replace_symbol_body",
661
- insert_after: "insert_after_symbol",
662
- insert_before: "insert_before_symbol",
663
- rename: "rename_symbol",
664
- search: "search_for_pattern",
665
- };
666
- // ---------------------------------------------------------------------------
667
- // Serena auto-start: spawn the HTTP project server on demand
668
- // ---------------------------------------------------------------------------
669
- let serenaStarting = null;
670
- async function isSerenaAlive() {
671
- // Lightweight TCP probe — just check if something is listening on the port.
672
- // A full HTTP request is too heavy during startup (Serena takes seconds to load projects).
673
- return new Promise((resolve) => {
674
- const sock = createConnection({ host: "127.0.0.1", port: SERENA_PORT }, () => {
675
- sock.destroy();
676
- resolve(true);
677
- });
678
- sock.setTimeout(2_000);
679
- sock.on("error", () => resolve(false));
680
- sock.on("timeout", () => {
681
- sock.destroy();
682
- resolve(false);
683
- });
684
- });
685
- }
686
- function findSerenaProjectRoot() {
687
- // Walk up from cwd looking for .serena/project.yml
688
- let dir = pathResolve(process.cwd());
689
- while (dir !== dirname(dir)) {
690
- if (existsSync(pathJoin(dir, ".serena", "project.yml")))
691
- return dir;
692
- dir = dirname(dir);
693
- }
694
- // Fallback: walk up from this file's directory
695
- // (compiled JS lives in packages/tools/dist/executors/)
696
- // __dirname is available since the build target is CJS
697
- dir = typeof __dirname === "string" ? pathResolve(__dirname) : pathResolve(".");
698
- while (dir !== dirname(dir)) {
699
- if (existsSync(pathJoin(dir, ".serena", "project.yml")))
700
- return dir;
701
- dir = dirname(dir);
702
- }
703
- return process.cwd();
704
- }
705
- let cachedSerenaBin;
706
- function resolveSerenaBin() {
707
- if (cachedSerenaBin !== undefined)
708
- return cachedSerenaBin;
709
- // Find the serena binary from uv's cache directory.
710
- // We avoid `uvx --from git+... which serena` because it triggers a blocking
711
- // git fetch that hangs inside a detached spawn context.
712
- const cacheBase = pathJoin(process.env.HOME ?? "/tmp", ".cache", "uv", "archive-v0");
713
- try {
714
- const entries = readdirSync(cacheBase)
715
- .map((d) => pathJoin(cacheBase, d, "bin", "serena"))
716
- .filter((p) => existsSync(p))
717
- .sort((a, b) => statSync(b).mtimeMs - statSync(a).mtimeMs);
718
- cachedSerenaBin = entries.length > 0 ? entries[0] : null;
719
- }
720
- catch {
721
- cachedSerenaBin = null;
722
- }
723
- return cachedSerenaBin ?? null;
724
- }
725
- function spawnSerenaServer() {
726
- const projectRoot = findSerenaProjectRoot();
727
- const serenaBin = resolveSerenaBin();
728
- if (!serenaBin)
729
- return;
730
- // Spawn the cached Python binary directly with stdio:'ignore' + detached.
731
- // Using 'uvx --from git+...' does NOT work because uvx triggers a blocking
732
- // git fetch that hangs/dies with closed file descriptors.
733
- const child = cpSpawn(serenaBin, ["start-project-server", "--port", String(SERENA_PORT)], {
734
- cwd: projectRoot,
735
- detached: true,
736
- stdio: "ignore",
737
- env: { ...process.env },
738
- });
739
- child.unref();
740
- }
741
- async function ensureSerenaServer() {
742
- if (await isSerenaAlive())
743
- return true;
744
- // Deduplicate concurrent start attempts
745
- if (serenaStarting)
746
- return serenaStarting;
747
- serenaStarting = (async () => {
748
- spawnSerenaServer();
749
- // Poll for readiness (serena can take a few seconds to initialize)
750
- const deadline = Date.now() + 30_000;
751
- const interval = 500;
752
- while (Date.now() < deadline) {
753
- await new Promise((r) => setTimeout(r, interval));
754
- if (await isSerenaAlive()) {
755
- serenaStarting = null;
756
- return true;
757
- }
758
- }
759
- serenaStarting = null;
760
- return false;
761
- })();
762
- return serenaStarting;
763
- }
764
- export async function executeSerena(input, ctx) {
765
- if (ctx.abortSignal?.aborted)
766
- return fail("Operation cancelled");
767
- const toolName = SERENA_TOOL_MAP[input.action];
768
- if (!toolName)
769
- return fail(`Unknown serena action: ${input.action}`);
770
- const isMutation = ["replace_body", "insert_after", "insert_before", "rename"].includes(input.action);
771
- if (isMutation && ctx.confirm) {
772
- const desc = input.action === "rename"
773
- ? `Rename "${input.name_path}" to "${input.new_name}"?`
774
- : `${input.action} on "${input.name_path}"?`;
775
- const ok = await ctx.confirm(desc);
776
- if (!ok)
777
- return fail("Cancelled by user");
778
- }
779
- // Auto-start the Serena project server if not running
780
- const alive = await ensureSerenaServer();
781
- if (!alive) {
782
- return fail("Failed to auto-start Serena project server after 30s. " +
783
- "Check logs or start manually:\n" +
784
- `uvx --from "git+https://github.com/oraios/serena" serena start-project-server --port ${SERENA_PORT}`);
785
- }
786
- const params = { ...input.extra_args };
787
- if (input.name_path) {
788
- if (input.action === "find_symbol") {
789
- params.name_path_pattern = input.name_path;
790
- }
791
- else {
792
- params.name_path = input.name_path;
793
- }
794
- }
795
- if (input.relative_path)
796
- params.relative_path = input.relative_path;
797
- if (input.include_body != null)
798
- params.include_body = input.include_body;
799
- if (input.include_info != null)
800
- params.include_info = input.include_info;
801
- if (input.depth != null)
802
- params.depth = input.depth;
803
- if (input.body)
804
- params.body = input.body;
805
- if (input.new_name)
806
- params.new_name = input.new_name;
807
- if (input.pattern)
808
- params.substring_pattern = input.pattern;
809
- if (input.context_before != null)
810
- params.context_lines_before = input.context_before;
811
- if (input.context_after != null)
812
- params.context_lines_after = input.context_after;
813
- if (input.paths_include)
814
- params.paths_include_glob = input.paths_include;
815
- if (input.paths_exclude)
816
- params.paths_exclude_glob = input.paths_exclude;
817
- try {
818
- const body = JSON.stringify({
819
- project_name: SERENA_PROJECT,
820
- tool_name: toolName,
821
- tool_params_json: JSON.stringify(params),
822
- });
823
- const response = await fetch(`${SERENA_BASE}/query_project`, {
824
- method: "POST",
825
- headers: { "Content-Type": "application/json" },
826
- body,
827
- signal: ctx.abortSignal,
828
- });
829
- if (!response.ok) {
830
- const text = await response.text();
831
- return fail(`serena ${input.action}: HTTP ${response.status} — ${text.slice(0, 200)}`);
832
- }
833
- const text = await response.text();
834
- try {
835
- return success(`serena ${input.action} completed`, JSON.parse(text));
836
- }
837
- catch {
838
- return success(`serena ${input.action} completed`, { raw: text });
839
- }
840
- }
841
- catch (err) {
842
- const e = asExecError(err);
843
- return fail(`serena ${input.action} failed: ${e.message}`);
844
- }
845
- }
846
- // ---------------------------------------------------------------------------
847
- // 8. fff — native CLI (fff-cli binary, zero MCP)
848
- // ---------------------------------------------------------------------------
849
- export async function executeFff(input, ctx) {
850
- if (ctx.abortSignal?.aborted)
851
- return fail("Operation cancelled");
852
- if (!(await hasBinary("fff-cli")))
853
- return fail("fff-cli not installed. Build: cd vendor/fff-cli && cargo build --release && cp target/release/fff-cli ~/.local/bin/");
854
- const args = [input.action];
855
- // Query or patterns. Native fff-cli supports positional query terms; constraints are
856
- // appended as additional terms for grep/find_files and patterns for multi_grep.
857
- if (input.action === "multi_grep" && input.patterns?.length) {
858
- args.push(...input.patterns);
859
- if (input.constraints)
860
- args.push(input.constraints);
861
- }
862
- else {
863
- if (input.query)
864
- args.push(input.query);
865
- if (input.constraints)
866
- args.push(input.constraints);
867
- }
868
- // Path
869
- args.push("--path", input.path ?? ctx.workingDir);
870
- try {
871
- const { stdout } = await shellExec("fff-cli", args, {
872
- cwd: ctx.workingDir,
873
- signal: ctx.abortSignal,
874
- timeout: 30_000,
875
- });
876
- return success(`fff ${input.action} completed`, JSON.parse(stdout));
877
- }
878
- catch (err) {
879
- const e = asExecError(err);
880
- return fail(`fff ${input.action} failed: ${e.stderr || e.message}`);
881
- }
882
- }