@aria-cli/tools 1.0.1 → 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.
- package/dist/.aria-build-stamp.json +1 -1
- package/dist/.tsbuildinfo +1 -1
- package/dist/definitions/code-intelligence.d.ts +9 -0
- package/dist/definitions/code-intelligence.d.ts.map +1 -0
- package/dist/definitions/code-intelligence.js +471 -0
- package/dist/definitions/code-intelligence.js.map +1 -0
- package/dist/definitions/core.d.ts +3 -0
- package/dist/definitions/core.d.ts.map +1 -1
- package/dist/definitions/core.js +13 -1
- package/dist/definitions/core.js.map +1 -1
- package/dist/definitions/filesystem.d.ts +3 -2
- package/dist/definitions/filesystem.d.ts.map +1 -1
- package/dist/definitions/filesystem.js +4 -38
- package/dist/definitions/filesystem.js.map +1 -1
- package/dist/definitions/frg.d.ts +4 -0
- package/dist/definitions/frg.d.ts.map +1 -0
- package/dist/definitions/frg.js +64 -0
- package/dist/definitions/frg.js.map +1 -0
- package/dist/definitions/index.d.ts +3 -0
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/index.js +3 -0
- package/dist/definitions/index.js.map +1 -1
- package/dist/definitions/search.d.ts +10 -0
- package/dist/definitions/search.d.ts.map +1 -0
- package/dist/definitions/search.js +61 -0
- package/dist/definitions/search.js.map +1 -0
- package/dist/executors/apply-patch.d.ts.map +1 -1
- package/dist/executors/apply-patch.js +18 -0
- package/dist/executors/apply-patch.js.map +1 -1
- package/dist/executors/code-intelligence.d.ts +139 -0
- package/dist/executors/code-intelligence.d.ts.map +1 -0
- package/dist/executors/code-intelligence.js +883 -0
- package/dist/executors/code-intelligence.js.map +1 -0
- package/dist/executors/filesystem.d.ts.map +1 -1
- package/dist/executors/filesystem.js +14 -8
- package/dist/executors/filesystem.js.map +1 -1
- package/dist/executors/frg-freshness.d.ts +94 -0
- package/dist/executors/frg-freshness.d.ts.map +1 -0
- package/dist/executors/frg-freshness.js +577 -0
- package/dist/executors/frg-freshness.js.map +1 -0
- package/dist/executors/frg.d.ts +28 -0
- package/dist/executors/frg.d.ts.map +1 -0
- package/dist/executors/frg.js +299 -0
- package/dist/executors/frg.js.map +1 -0
- package/dist/executors/index.d.ts +6 -0
- package/dist/executors/index.d.ts.map +1 -1
- package/dist/executors/index.js +5 -0
- package/dist/executors/index.js.map +1 -1
- package/dist/executors/lsp-client.d.ts +39 -0
- package/dist/executors/lsp-client.d.ts.map +1 -0
- package/dist/executors/lsp-client.js +297 -0
- package/dist/executors/lsp-client.js.map +1 -0
- package/dist/executors/restart.d.ts +4 -9
- package/dist/executors/restart.d.ts.map +1 -1
- package/dist/executors/restart.js +20 -51
- package/dist/executors/restart.js.map +1 -1
- package/dist/executors/search-freshness.d.ts +51 -0
- package/dist/executors/search-freshness.d.ts.map +1 -0
- package/dist/executors/search-freshness.js +196 -0
- package/dist/executors/search-freshness.js.map +1 -0
- package/dist/executors/search.d.ts +12 -0
- package/dist/executors/search.d.ts.map +1 -0
- package/dist/executors/search.js +67 -0
- package/dist/executors/search.js.map +1 -0
- package/dist/headless-control-contract.d.ts +4 -0
- package/dist/headless-control-contract.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/network-runtime/local-control-contract.d.ts +2 -0
- package/dist/network-runtime/local-control-contract.d.ts.map +1 -1
- package/dist/network-runtime/local-control-contract.js +2 -0
- package/dist/network-runtime/local-control-contract.js.map +1 -1
- package/dist-cjs/.tsbuildinfo +1 -1
- package/dist-cjs/definitions/code-intelligence.d.ts +8 -0
- package/dist-cjs/definitions/code-intelligence.js +474 -0
- package/dist-cjs/definitions/code-intelligence.js.map +1 -0
- package/dist-cjs/definitions/core.d.ts +3 -0
- package/dist-cjs/definitions/core.js +17 -2
- package/dist-cjs/definitions/core.js.map +1 -1
- package/dist-cjs/definitions/filesystem.d.ts +3 -2
- package/dist-cjs/definitions/filesystem.js +3 -37
- package/dist-cjs/definitions/filesystem.js.map +1 -1
- package/dist-cjs/definitions/frg.d.ts +3 -0
- package/dist-cjs/definitions/frg.js +67 -0
- package/dist-cjs/definitions/frg.js.map +1 -0
- package/dist-cjs/definitions/index.d.ts +3 -0
- package/dist-cjs/definitions/index.js +7 -1
- package/dist-cjs/definitions/index.js.map +1 -1
- package/dist-cjs/definitions/search.d.ts +9 -0
- package/dist-cjs/definitions/search.js +64 -0
- package/dist-cjs/definitions/search.js.map +1 -0
- package/dist-cjs/executors/apply-patch.js +18 -0
- package/dist-cjs/executors/apply-patch.js.map +1 -1
- package/dist-cjs/executors/code-intelligence.d.ts +138 -0
- package/dist-cjs/executors/code-intelligence.js +926 -0
- package/dist-cjs/executors/code-intelligence.js.map +1 -0
- package/dist-cjs/executors/filesystem.js +17 -8
- package/dist-cjs/executors/filesystem.js.map +1 -1
- package/dist-cjs/executors/frg-freshness.d.ts +93 -0
- package/dist-cjs/executors/frg-freshness.js +628 -0
- package/dist-cjs/executors/frg-freshness.js.map +1 -0
- package/dist-cjs/executors/frg.d.ts +27 -0
- package/dist-cjs/executors/frg.js +335 -0
- package/dist-cjs/executors/frg.js.map +1 -0
- package/dist-cjs/executors/index.d.ts +6 -0
- package/dist-cjs/executors/index.js +34 -2
- package/dist-cjs/executors/index.js.map +1 -1
- package/dist-cjs/executors/lsp-client.d.ts +38 -0
- package/dist-cjs/executors/lsp-client.js +311 -0
- package/dist-cjs/executors/lsp-client.js.map +1 -0
- package/dist-cjs/executors/restart.d.ts +4 -9
- package/dist-cjs/executors/restart.js +19 -50
- package/dist-cjs/executors/restart.js.map +1 -1
- package/dist-cjs/executors/search-freshness.d.ts +50 -0
- package/dist-cjs/executors/search-freshness.js +235 -0
- package/dist-cjs/executors/search-freshness.js.map +1 -0
- package/dist-cjs/executors/search.d.ts +11 -0
- package/dist-cjs/executors/search.js +103 -0
- package/dist-cjs/executors/search.js.map +1 -0
- package/dist-cjs/headless-control-contract.d.ts +15 -11
- package/dist-cjs/index.d.ts +2 -2
- package/dist-cjs/index.js +22 -2
- package/dist-cjs/index.js.map +1 -1
- package/dist-cjs/network-runtime/local-control-contract.d.ts +2 -0
- package/dist-cjs/network-runtime/local-control-contract.js +2 -0
- package/dist-cjs/network-runtime/local-control-contract.js.map +1 -1
- package/package.json +22 -18
- package/src/definitions/code-intelligence.ts +526 -0
- package/src/definitions/core.ts +13 -1
- package/src/definitions/filesystem.ts +3 -39
- package/src/definitions/frg.ts +67 -0
- package/src/definitions/index.ts +3 -0
- package/src/definitions/search.ts +67 -0
- package/src/executors/apply-patch.ts +20 -0
- package/src/executors/code-intelligence.ts +1179 -0
- package/src/executors/filesystem.ts +15 -8
- package/src/executors/frg-freshness.ts +743 -0
- package/src/executors/frg.ts +394 -0
- package/src/executors/index.ts +58 -0
- package/src/executors/lsp-client.ts +355 -0
- package/src/executors/restart.ts +21 -56
- package/src/executors/search-freshness.ts +249 -0
- package/src/executors/search.ts +89 -0
- package/src/index.ts +25 -0
- package/src/network-runtime/local-control-contract.ts +2 -0
- package/tests/definitions/tool-inventory.test.ts +17 -6
- package/tests/executors/frg-freshness.test.ts +136 -0
- package/tests/executors/frg-merge.test.ts +70 -0
- package/tests/executors/frg-session-content.test.ts +40 -0
- package/tests/executors/frg.test.ts +56 -0
- package/tests/integration/headless-control-contract.integration.test.ts +2 -0
- package/tests/loading-tier.test.ts +6 -6
- package/tests/test-lane-manifest.ts +4 -0
- package/tsconfig.cjs.json +9 -1
- 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", "
|
|
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("
|
|
111
|
-
//
|
|
112
|
-
expect(CORE_TOOL_DEFINITIONS.length).toBe(
|
|
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(
|
|
121
|
+
expect(alwaysTools.length).toBe(72);
|
|
122
122
|
expect(deferredTools.length).toBe(2);
|
|
123
|
-
expect(alwaysTools.length + deferredTools.length).toBe(
|
|
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": [
|
|
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