@aria-cli/tools 1.0.2 → 1.0.3

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 (157) hide show
  1. package/dist/.aria-build-stamp.json +1 -1
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/definitions/code-intelligence.d.ts +9 -0
  4. package/dist/definitions/code-intelligence.d.ts.map +1 -0
  5. package/dist/definitions/code-intelligence.js +471 -0
  6. package/dist/definitions/code-intelligence.js.map +1 -0
  7. package/dist/definitions/core.d.ts +3 -0
  8. package/dist/definitions/core.d.ts.map +1 -1
  9. package/dist/definitions/core.js +13 -1
  10. package/dist/definitions/core.js.map +1 -1
  11. package/dist/definitions/filesystem.d.ts +3 -2
  12. package/dist/definitions/filesystem.d.ts.map +1 -1
  13. package/dist/definitions/filesystem.js +4 -38
  14. package/dist/definitions/filesystem.js.map +1 -1
  15. package/dist/definitions/frg.d.ts +4 -0
  16. package/dist/definitions/frg.d.ts.map +1 -0
  17. package/dist/definitions/frg.js +64 -0
  18. package/dist/definitions/frg.js.map +1 -0
  19. package/dist/definitions/index.d.ts +3 -0
  20. package/dist/definitions/index.d.ts.map +1 -1
  21. package/dist/definitions/index.js +3 -0
  22. package/dist/definitions/index.js.map +1 -1
  23. package/dist/definitions/search.d.ts +10 -0
  24. package/dist/definitions/search.d.ts.map +1 -0
  25. package/dist/definitions/search.js +61 -0
  26. package/dist/definitions/search.js.map +1 -0
  27. package/dist/executors/apply-patch.d.ts.map +1 -1
  28. package/dist/executors/apply-patch.js +18 -0
  29. package/dist/executors/apply-patch.js.map +1 -1
  30. package/dist/executors/code-intelligence.d.ts +139 -0
  31. package/dist/executors/code-intelligence.d.ts.map +1 -0
  32. package/dist/executors/code-intelligence.js +883 -0
  33. package/dist/executors/code-intelligence.js.map +1 -0
  34. package/dist/executors/filesystem.d.ts.map +1 -1
  35. package/dist/executors/filesystem.js +14 -8
  36. package/dist/executors/filesystem.js.map +1 -1
  37. package/dist/executors/frg-freshness.d.ts +94 -0
  38. package/dist/executors/frg-freshness.d.ts.map +1 -0
  39. package/dist/executors/frg-freshness.js +577 -0
  40. package/dist/executors/frg-freshness.js.map +1 -0
  41. package/dist/executors/frg.d.ts +28 -0
  42. package/dist/executors/frg.d.ts.map +1 -0
  43. package/dist/executors/frg.js +299 -0
  44. package/dist/executors/frg.js.map +1 -0
  45. package/dist/executors/index.d.ts +6 -0
  46. package/dist/executors/index.d.ts.map +1 -1
  47. package/dist/executors/index.js +5 -0
  48. package/dist/executors/index.js.map +1 -1
  49. package/dist/executors/lsp-client.d.ts +39 -0
  50. package/dist/executors/lsp-client.d.ts.map +1 -0
  51. package/dist/executors/lsp-client.js +297 -0
  52. package/dist/executors/lsp-client.js.map +1 -0
  53. package/dist/executors/restart.d.ts +4 -9
  54. package/dist/executors/restart.d.ts.map +1 -1
  55. package/dist/executors/restart.js +20 -51
  56. package/dist/executors/restart.js.map +1 -1
  57. package/dist/executors/search-freshness.d.ts +51 -0
  58. package/dist/executors/search-freshness.d.ts.map +1 -0
  59. package/dist/executors/search-freshness.js +196 -0
  60. package/dist/executors/search-freshness.js.map +1 -0
  61. package/dist/executors/search.d.ts +12 -0
  62. package/dist/executors/search.d.ts.map +1 -0
  63. package/dist/executors/search.js +67 -0
  64. package/dist/executors/search.js.map +1 -0
  65. package/dist/headless-control-contract.d.ts +4 -0
  66. package/dist/headless-control-contract.d.ts.map +1 -1
  67. package/dist/index.d.ts +2 -2
  68. package/dist/index.d.ts.map +1 -1
  69. package/dist/index.js +1 -1
  70. package/dist/index.js.map +1 -1
  71. package/dist/network-runtime/local-control-contract.d.ts +2 -0
  72. package/dist/network-runtime/local-control-contract.d.ts.map +1 -1
  73. package/dist/network-runtime/local-control-contract.js +2 -0
  74. package/dist/network-runtime/local-control-contract.js.map +1 -1
  75. package/dist-cjs/.tsbuildinfo +1 -1
  76. package/dist-cjs/definitions/code-intelligence.d.ts +8 -0
  77. package/dist-cjs/definitions/code-intelligence.js +474 -0
  78. package/dist-cjs/definitions/code-intelligence.js.map +1 -0
  79. package/dist-cjs/definitions/core.d.ts +3 -0
  80. package/dist-cjs/definitions/core.js +17 -2
  81. package/dist-cjs/definitions/core.js.map +1 -1
  82. package/dist-cjs/definitions/filesystem.d.ts +3 -2
  83. package/dist-cjs/definitions/filesystem.js +3 -37
  84. package/dist-cjs/definitions/filesystem.js.map +1 -1
  85. package/dist-cjs/definitions/frg.d.ts +3 -0
  86. package/dist-cjs/definitions/frg.js +67 -0
  87. package/dist-cjs/definitions/frg.js.map +1 -0
  88. package/dist-cjs/definitions/index.d.ts +3 -0
  89. package/dist-cjs/definitions/index.js +7 -1
  90. package/dist-cjs/definitions/index.js.map +1 -1
  91. package/dist-cjs/definitions/search.d.ts +9 -0
  92. package/dist-cjs/definitions/search.js +64 -0
  93. package/dist-cjs/definitions/search.js.map +1 -0
  94. package/dist-cjs/executors/apply-patch.js +18 -0
  95. package/dist-cjs/executors/apply-patch.js.map +1 -1
  96. package/dist-cjs/executors/code-intelligence.d.ts +138 -0
  97. package/dist-cjs/executors/code-intelligence.js +926 -0
  98. package/dist-cjs/executors/code-intelligence.js.map +1 -0
  99. package/dist-cjs/executors/filesystem.js +17 -8
  100. package/dist-cjs/executors/filesystem.js.map +1 -1
  101. package/dist-cjs/executors/frg-freshness.d.ts +93 -0
  102. package/dist-cjs/executors/frg-freshness.js +628 -0
  103. package/dist-cjs/executors/frg-freshness.js.map +1 -0
  104. package/dist-cjs/executors/frg.d.ts +27 -0
  105. package/dist-cjs/executors/frg.js +335 -0
  106. package/dist-cjs/executors/frg.js.map +1 -0
  107. package/dist-cjs/executors/index.d.ts +6 -0
  108. package/dist-cjs/executors/index.js +34 -2
  109. package/dist-cjs/executors/index.js.map +1 -1
  110. package/dist-cjs/executors/lsp-client.d.ts +38 -0
  111. package/dist-cjs/executors/lsp-client.js +311 -0
  112. package/dist-cjs/executors/lsp-client.js.map +1 -0
  113. package/dist-cjs/executors/restart.d.ts +4 -9
  114. package/dist-cjs/executors/restart.js +19 -50
  115. package/dist-cjs/executors/restart.js.map +1 -1
  116. package/dist-cjs/executors/search-freshness.d.ts +50 -0
  117. package/dist-cjs/executors/search-freshness.js +235 -0
  118. package/dist-cjs/executors/search-freshness.js.map +1 -0
  119. package/dist-cjs/executors/search.d.ts +11 -0
  120. package/dist-cjs/executors/search.js +103 -0
  121. package/dist-cjs/executors/search.js.map +1 -0
  122. package/dist-cjs/headless-control-contract.d.ts +15 -11
  123. package/dist-cjs/index.d.ts +2 -2
  124. package/dist-cjs/index.js +22 -2
  125. package/dist-cjs/index.js.map +1 -1
  126. package/dist-cjs/network-runtime/local-control-contract.d.ts +2 -0
  127. package/dist-cjs/network-runtime/local-control-contract.js +2 -0
  128. package/dist-cjs/network-runtime/local-control-contract.js.map +1 -1
  129. package/package.json +9 -5
  130. package/src/definitions/code-intelligence.ts +526 -0
  131. package/src/definitions/core.ts +13 -1
  132. package/src/definitions/filesystem.ts +3 -39
  133. package/src/definitions/frg.ts +67 -0
  134. package/src/definitions/index.ts +3 -0
  135. package/src/definitions/search.ts +67 -0
  136. package/src/executors/apply-patch.ts +20 -0
  137. package/src/executors/code-intelligence.ts +1179 -0
  138. package/src/executors/filesystem.ts +15 -8
  139. package/src/executors/frg-freshness.ts +743 -0
  140. package/src/executors/frg.ts +394 -0
  141. package/src/executors/index.ts +58 -0
  142. package/src/executors/lsp-client.ts +355 -0
  143. package/src/executors/restart.ts +21 -56
  144. package/src/executors/search-freshness.ts +249 -0
  145. package/src/executors/search.ts +89 -0
  146. package/src/index.ts +25 -0
  147. package/src/network-runtime/local-control-contract.ts +2 -0
  148. package/tests/definitions/tool-inventory.test.ts +17 -6
  149. package/tests/executors/frg-freshness.test.ts +136 -0
  150. package/tests/executors/frg-merge.test.ts +70 -0
  151. package/tests/executors/frg-session-content.test.ts +40 -0
  152. package/tests/executors/frg.test.ts +56 -0
  153. package/tests/integration/headless-control-contract.integration.test.ts +2 -0
  154. package/tests/loading-tier.test.ts +6 -6
  155. package/tests/test-lane-manifest.ts +4 -0
  156. package/tsconfig.cjs.json +9 -1
  157. package/tsconfig.json +1 -1
@@ -0,0 +1,40 @@
1
+ import { beforeEach, describe, expect, it } from "vitest";
2
+ import * as fs from "node:fs/promises";
3
+ import * as path from "node:path";
4
+ import * as os from "node:os";
5
+ import {
6
+ clearPendingFrgMutations,
7
+ recordFrgMutation,
8
+ searchPendingFrgMutations,
9
+ } from "../../src/executors/frg-freshness.js";
10
+
11
+ describe("frg session content cache", () => {
12
+ let repoDir: string;
13
+ let filePath: string;
14
+
15
+ beforeEach(async () => {
16
+ repoDir = await fs.mkdtemp(path.join(os.tmpdir(), "aria-frg-session-content-"));
17
+ await fs.mkdir(path.join(repoDir, ".git"));
18
+ filePath = path.join(repoDir, "a.ts");
19
+ await fs.writeFile(filePath, 'export const value = "old";\n', "utf8");
20
+ clearPendingFrgMutations(repoDir);
21
+ });
22
+
23
+ it("uses cached mutation content even if on-disk content changes before flush", async () => {
24
+ const sessionContent = 'export const value = "session";\n';
25
+ await fs.writeFile(filePath, sessionContent, "utf8");
26
+ recordFrgMutation(filePath, "write", sessionContent);
27
+
28
+ await fs.writeFile(filePath, 'export const value = "disk";\n', "utf8");
29
+
30
+ const result = await searchPendingFrgMutations(repoDir, {
31
+ pattern: "session",
32
+ literal: true,
33
+ });
34
+
35
+ expect(result?.mode).toBe("matches");
36
+ const matches = result && result.mode === "matches" ? (result.matches ?? []) : [];
37
+ expect(matches).toHaveLength(1);
38
+ expect(matches[0]?.content).toContain("session");
39
+ });
40
+ });
@@ -0,0 +1,56 @@
1
+ import { describe, it, expect, beforeEach, afterEach } from "vitest";
2
+ import * as fs from "node:fs/promises";
3
+ import * as path from "node:path";
4
+ import * as os from "node:os";
5
+ import type { ToolContext } from "../../src/types.js";
6
+ import { SpawnedProcessRegistry } from "../../src/executors/process-registry.js";
7
+ import { executeFrg } from "../../src/executors/frg.js";
8
+
9
+ const sleep = (ms: number): Promise<void> => new Promise((resolve) => setTimeout(resolve, ms));
10
+
11
+ describe("frg executor", () => {
12
+ let tempDir: string;
13
+ let ctx: ToolContext;
14
+ let registry: SpawnedProcessRegistry;
15
+ const pidsToCleanup: number[] = [];
16
+
17
+ beforeEach(async () => {
18
+ tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "aria-frg-test-"));
19
+ registry = new SpawnedProcessRegistry();
20
+ ctx = {
21
+ workingDir: tempDir,
22
+ env: {},
23
+ confirm: async () => true,
24
+ processRegistry: registry,
25
+ };
26
+ });
27
+
28
+ afterEach(async () => {
29
+ for (const pid of pidsToCleanup) {
30
+ try {
31
+ process.kill(pid, "SIGKILL");
32
+ } catch {
33
+ // ignore
34
+ }
35
+ }
36
+ await fs.rm(tempDir, { recursive: true, force: true });
37
+ });
38
+
39
+ it("spawns a tracked background process for watch mode", async () => {
40
+ const result = await executeFrg({ command: "watch", path: tempDir }, ctx);
41
+ if (!result.success) {
42
+ expect(String(result.error ?? result.message ?? "")).toContain("binary not found");
43
+ return;
44
+ }
45
+
46
+ const data = result.data as { pid?: number; watched?: boolean };
47
+ expect(data.watched).toBe(true);
48
+ expect(typeof data.pid).toBe("number");
49
+ if (typeof data.pid === "number") {
50
+ pidsToCleanup.push(data.pid);
51
+ expect(registry.has(data.pid)).toBe(true);
52
+ }
53
+
54
+ await sleep(100);
55
+ }, 20000);
56
+ });
@@ -34,6 +34,7 @@ describe("headless control contract", () => {
34
34
  HEADLESS_OPERATION_SCHEMAS["run.start"].input.safeParse({
35
35
  task: "hello",
36
36
  sessionId: "session-1",
37
+ requestedModel: "opus-4.6",
37
38
  }).success,
38
39
  ).toBe(true);
39
40
  expect(RunRequestSchema.safeParse({ task: "hello", sessionId: "session-1" }).success).toBe(
@@ -44,6 +45,7 @@ describe("headless control contract", () => {
44
45
  expect(
45
46
  HEADLESS_OPERATION_SCHEMAS["run.resume"].input.safeParse({
46
47
  sessionId: "session-1",
48
+ requestedModel: "opus-4.6",
47
49
  state: {
48
50
  input: "resume",
49
51
  messages: [],
@@ -33,7 +33,7 @@ describe("loadingTier", () => {
33
33
  });
34
34
 
35
35
  describe("All built-in tools are always-on or explicitly deferred", () => {
36
- const ALLOWED_DEFERRED = new Set(["session_history", "self_diagnose"]);
36
+ const ALLOWED_DEFERRED = new Set(["session_history", "frg"]);
37
37
  it("every core tool has loadingTier === 'always' except explicitly deferred tools", () => {
38
38
  for (const t of CORE_TOOL_DEFINITIONS) {
39
39
  if (ALLOWED_DEFERRED.has(t.name)) {
@@ -107,9 +107,9 @@ describe("loadingTier", () => {
107
107
  });
108
108
 
109
109
  describe("Total core tools split", () => {
110
- it("62 always + 2 deferred = 64 total core tools", () => {
111
- // Verify total count
112
- expect(CORE_TOOL_DEFINITIONS.length).toBe(64);
110
+ it("72 always + 2 deferred = 74 total core tools", () => {
111
+ // 64 original + 4 frg + 8 code-intel (rg,ug,probe,sg,cbm,lsp,serena,fff) - 3 removed + 1 code_search = 74
112
+ expect(CORE_TOOL_DEFINITIONS.length).toBe(74);
113
113
 
114
114
  const alwaysTools = CORE_TOOL_DEFINITIONS.filter(
115
115
  (t) => (t as Record<string, unknown>).loadingTier === "always",
@@ -118,9 +118,9 @@ describe("loadingTier", () => {
118
118
  (t) => (t as Record<string, unknown>).loadingTier === "deferred",
119
119
  );
120
120
 
121
- expect(alwaysTools.length).toBe(62);
121
+ expect(alwaysTools.length).toBe(72);
122
122
  expect(deferredTools.length).toBe(2);
123
- expect(alwaysTools.length + deferredTools.length).toBe(64);
123
+ expect(alwaysTools.length + deferredTools.length).toBe(74);
124
124
  });
125
125
  });
126
126
  });
@@ -46,6 +46,10 @@ const UNIT_ALLOWLIST = new Set([
46
46
  "tests/executors/conversation-primitives.test.ts",
47
47
  "tests/executors/deploy.test.ts",
48
48
  "tests/executors/filesystem-tools.test.ts",
49
+ "tests/executors/frg.test.ts",
50
+ "tests/executors/frg-freshness.test.ts",
51
+ "tests/executors/frg-merge.test.ts",
52
+ "tests/executors/frg-session-content.test.ts",
49
53
  "tests/executors/filesystem.test.ts",
50
54
  "tests/executors/memory-bugfixes.test.ts",
51
55
  "tests/executors/memory.test.ts",
package/tsconfig.cjs.json CHANGED
@@ -11,6 +11,14 @@
11
11
  "tsBuildInfoFile": "./dist-cjs/.tsbuildinfo"
12
12
  },
13
13
  "include": ["src/**/*"],
14
- "exclude": ["node_modules", "dist", "dist-cjs", "tests", "**/*.test.ts", "**/*.test.tsx"],
14
+ "exclude": [
15
+ "node_modules",
16
+ "dist",
17
+ "dist-cjs",
18
+ "tests",
19
+ "**/*.test.ts",
20
+ "**/*.test.tsx",
21
+ "src/executors/lsp-client.ts"
22
+ ],
15
23
  "references": [{ "path": "../types" }]
16
24
  }
package/tsconfig.json CHANGED
@@ -8,5 +8,5 @@
8
8
  },
9
9
  "include": ["src/**/*"],
10
10
  "exclude": ["node_modules", "dist", "tests", "**/*.test.ts", "**/*.test.tsx"],
11
- "references": [{ "path": "../types" }]
11
+ "references": [{ "path": "../types" }, { "path": "../fastripgrep" }]
12
12
  }