@diffexai/diffex 0.2.6 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/dist/core/agent-session.d.ts +5 -0
- package/dist/core/agent-session.js +89 -19
- package/dist/core/compaction/compaction.js +3 -1
- package/dist/core/model-runtime.js +3 -3
- package/dist/core/provider-composer.js +1 -1
- package/dist/core/sdk.d.ts +2 -1
- package/dist/core/sdk.js +18 -6
- package/dist/core/subagents/controller.d.ts +4 -3
- package/dist/core/subagents/controller.js +173 -37
- package/dist/core/subagents/types.d.ts +13 -0
- package/dist/core/tools/bash.d.ts +4 -0
- package/dist/core/tools/bash.js +14 -5
- package/dist/core/tools/subagents.d.ts +12 -10
- package/dist/core/tools/subagents.js +61 -49
- package/dist/node_modules/@diffexai/diffex-agent-core/distribution-components.json +4 -4
- package/dist/node_modules/@diffexai/diffex-agent-core/distribution-files.json +1 -1
- package/dist/node_modules/@diffexai/diffex-agent-core/package.json +1 -1
- package/dist/node_modules/@diffexai/diffex-ai/dist/api/lazy.d.ts +1 -1
- package/dist/node_modules/@diffexai/diffex-ai/dist/api/lazy.js +8 -8
- package/dist/node_modules/@diffexai/diffex-ai/dist/models.js +4 -4
- package/dist/node_modules/@diffexai/diffex-ai/dist/providers/data/.manifest.json +1 -1
- package/dist/node_modules/@diffexai/diffex-ai/dist/providers/data/opencode.json +1 -1
- package/dist/node_modules/@diffexai/diffex-ai/dist/providers/data/openrouter.json +1 -1
- package/dist/node_modules/@diffexai/diffex-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/dist/node_modules/@diffexai/diffex-ai/distribution-components.json +3 -3
- package/dist/node_modules/@diffexai/diffex-ai/distribution-files.json +8 -8
- package/dist/node_modules/@diffexai/diffex-ai/package.json +1 -1
- package/dist/node_modules/@diffexai/diffex-client/distribution-components.json +3 -3
- package/dist/node_modules/@diffexai/diffex-client/distribution-files.json +1 -1
- package/dist/node_modules/@diffexai/diffex-client/package.json +1 -1
- package/dist/node_modules/@diffexai/diffex-harness-state/distribution-components.json +2 -2
- package/dist/node_modules/@diffexai/diffex-harness-state/distribution-files.json +1 -1
- package/dist/node_modules/@diffexai/diffex-harness-state/package.json +1 -1
- package/dist/node_modules/@diffexai/diffex-protocol/distribution-components.json +2 -2
- package/dist/node_modules/@diffexai/diffex-protocol/distribution-files.json +1 -1
- package/dist/node_modules/@diffexai/diffex-protocol/package.json +1 -1
- package/dist/node_modules/@diffexai/diffex-telemetry/distribution-components.json +2 -2
- package/dist/node_modules/@diffexai/diffex-telemetry/distribution-files.json +1 -1
- package/dist/node_modules/@diffexai/diffex-telemetry/package.json +1 -1
- package/dist/node_modules/@diffexai/diffex-tui/distribution-components.json +2 -2
- package/dist/node_modules/@diffexai/diffex-tui/distribution-files.json +1 -1
- package/dist/node_modules/@diffexai/diffex-tui/package.json +1 -1
- package/dist/utils/owned-shell-processes.d.ts +8 -0
- package/dist/utils/owned-shell-processes.js +61 -0
- package/distribution-components.json +11 -11
- package/distribution-files.json +51 -43
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/release/distribution-manifest.json +4 -4
- package/release/install-package-lock.json +5 -5
- package/release/install-package.json +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
3
|
"name": "@diffexai/diffex-ai",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"sourceCommit": "
|
|
4
|
+
"version": "0.3.0",
|
|
5
|
+
"sourceCommit": "c8cec4d3820393131eaae7b43d56ac5f75d8041a",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"portions": "Diffex contributions; Pi-derived portions retain MIT terms in LICENSE",
|
|
8
8
|
"notice": "LICENSE",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
"name": "@diffexai/diffex-telemetry",
|
|
23
|
-
"version": "^0.
|
|
23
|
+
"version": "^0.3.0",
|
|
24
24
|
"distribution": "resolved separately by package manager; not bundled in this npm tarball"
|
|
25
25
|
},
|
|
26
26
|
{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"sourceCommit": "
|
|
2
|
+
"sourceCommit": "c8cec4d3820393131eaae7b43d56ac5f75d8041a",
|
|
3
3
|
"algorithm": "sha256",
|
|
4
4
|
"files": [
|
|
5
5
|
{
|
|
@@ -132,11 +132,11 @@
|
|
|
132
132
|
},
|
|
133
133
|
{
|
|
134
134
|
"path": "dist/api/lazy.d.ts",
|
|
135
|
-
"sha256": "
|
|
135
|
+
"sha256": "c12548afdf7aa50246b2bdd0d53a55e88b711c05475f62481c6c804a4c49fe44"
|
|
136
136
|
},
|
|
137
137
|
{
|
|
138
138
|
"path": "dist/api/lazy.js",
|
|
139
|
-
"sha256": "
|
|
139
|
+
"sha256": "5fec12b8865f1e3c4dd10ccdf538ff6455b537a49d093f123d25612f5f845a04"
|
|
140
140
|
},
|
|
141
141
|
{
|
|
142
142
|
"path": "dist/api/mistral-conversations.d.ts",
|
|
@@ -512,7 +512,7 @@
|
|
|
512
512
|
},
|
|
513
513
|
{
|
|
514
514
|
"path": "dist/models.js",
|
|
515
|
-
"sha256": "
|
|
515
|
+
"sha256": "7d2692bcc1a7babf0aef8569639bcc9ba72ded27926e8998529e6e290d5ac145"
|
|
516
516
|
},
|
|
517
517
|
{
|
|
518
518
|
"path": "dist/oauth.d.ts",
|
|
@@ -676,7 +676,7 @@
|
|
|
676
676
|
},
|
|
677
677
|
{
|
|
678
678
|
"path": "dist/providers/data/.manifest.json",
|
|
679
|
-
"sha256": "
|
|
679
|
+
"sha256": "39c101e7edcc148d18bce82909cded63ab0974a3e730f83d5d3acd11c6ce9201"
|
|
680
680
|
},
|
|
681
681
|
{
|
|
682
682
|
"path": "dist/providers/data/amazon-bedrock.json",
|
|
@@ -780,11 +780,11 @@
|
|
|
780
780
|
},
|
|
781
781
|
{
|
|
782
782
|
"path": "dist/providers/data/opencode.json",
|
|
783
|
-
"sha256": "
|
|
783
|
+
"sha256": "43c5d9cc6fab109411e6ac8eebac4b9fb0b00cff844cf0eb6c1559a08586525f"
|
|
784
784
|
},
|
|
785
785
|
{
|
|
786
786
|
"path": "dist/providers/data/openrouter.json",
|
|
787
|
-
"sha256": "
|
|
787
|
+
"sha256": "a6bb9631baf0a19685c1ad0c847c6ddf848ff5c7881d5bc62cc0ffeff45ec932"
|
|
788
788
|
},
|
|
789
789
|
{
|
|
790
790
|
"path": "dist/providers/data/qwen-token-plan-cn.json",
|
|
@@ -804,7 +804,7 @@
|
|
|
804
804
|
},
|
|
805
805
|
{
|
|
806
806
|
"path": "dist/providers/data/vercel-ai-gateway.json",
|
|
807
|
-
"sha256": "
|
|
807
|
+
"sha256": "03b0830a794af1bc921fb504565534bedec660fcc9482adcf56ec5fb27703e60"
|
|
808
808
|
},
|
|
809
809
|
{
|
|
810
810
|
"path": "dist/providers/data/xai.json",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
3
|
"name": "@diffexai/diffex-client",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"sourceCommit": "
|
|
4
|
+
"version": "0.3.0",
|
|
5
|
+
"sourceCommit": "c8cec4d3820393131eaae7b43d56ac5f75d8041a",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"portions": "Diffex contributions; Pi-derived portions retain MIT terms in LICENSE",
|
|
8
8
|
"notice": "LICENSE",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
12
|
"name": "@diffexai/diffex-protocol",
|
|
13
|
-
"version": "^0.
|
|
13
|
+
"version": "^0.3.0",
|
|
14
14
|
"distribution": "resolved separately by package manager; not bundled in this npm tarball"
|
|
15
15
|
}
|
|
16
16
|
]
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
3
|
"name": "@diffexai/diffex-harness-state",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"sourceCommit": "
|
|
4
|
+
"version": "0.3.0",
|
|
5
|
+
"sourceCommit": "c8cec4d3820393131eaae7b43d56ac5f75d8041a",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"portions": "Diffex contributions; Pi-derived portions retain MIT terms in LICENSE",
|
|
8
8
|
"notice": "LICENSE",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
3
|
"name": "@diffexai/diffex-protocol",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"sourceCommit": "
|
|
4
|
+
"version": "0.3.0",
|
|
5
|
+
"sourceCommit": "c8cec4d3820393131eaae7b43d56ac5f75d8041a",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"portions": "Diffex contributions; Pi-derived portions retain MIT terms in LICENSE",
|
|
8
8
|
"notice": "LICENSE",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
3
|
"name": "@diffexai/diffex-telemetry",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"sourceCommit": "
|
|
4
|
+
"version": "0.3.0",
|
|
5
|
+
"sourceCommit": "c8cec4d3820393131eaae7b43d56ac5f75d8041a",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"portions": "Diffex contributions; Pi-derived portions retain MIT terms in LICENSE",
|
|
8
8
|
"notice": "LICENSE",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
3
|
"name": "@diffexai/diffex-tui",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"sourceCommit": "
|
|
4
|
+
"version": "0.3.0",
|
|
5
|
+
"sourceCommit": "c8cec4d3820393131eaae7b43d56ac5f75d8041a",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"portions": "Diffex contributions; Pi-derived portions retain MIT terms in LICENSE",
|
|
8
8
|
"notice": "LICENSE",
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { setTimeout as delay } from "node:timers/promises";
|
|
3
|
+
import { killProcessTree, trackDetachedChildPid, untrackDetachedChildPid } from "./shell.js";
|
|
4
|
+
function isAlive(pid) {
|
|
5
|
+
try {
|
|
6
|
+
process.kill(process.platform === "win32" ? pid : -pid, 0);
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
catch (error) {
|
|
10
|
+
if (error.code === "ESRCH")
|
|
11
|
+
return false;
|
|
12
|
+
if (error.code === "EPERM")
|
|
13
|
+
return true;
|
|
14
|
+
throw error;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/** A session owns the process groups it launches, including background jobs. */
|
|
18
|
+
export class OwnedShellProcesses {
|
|
19
|
+
#pids = new Set();
|
|
20
|
+
track(pid) {
|
|
21
|
+
this.#pids.add(pid);
|
|
22
|
+
trackDetachedChildPid(pid);
|
|
23
|
+
}
|
|
24
|
+
releaseIfExited(pid) {
|
|
25
|
+
if (!isAlive(pid)) {
|
|
26
|
+
this.#pids.delete(pid);
|
|
27
|
+
untrackDetachedChildPid(pid);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
get count() {
|
|
31
|
+
for (const pid of this.#pids)
|
|
32
|
+
this.releaseIfExited(pid);
|
|
33
|
+
return this.#pids.size;
|
|
34
|
+
}
|
|
35
|
+
async terminateAll() {
|
|
36
|
+
const pids = [...this.#pids];
|
|
37
|
+
for (const pid of pids)
|
|
38
|
+
killProcessTree(pid);
|
|
39
|
+
const deadline = performance.now() + 5_000;
|
|
40
|
+
for (const pid of pids) {
|
|
41
|
+
while (isAlive(pid)) {
|
|
42
|
+
// Linux PID 1 may leave orphaned zombies unreaped. Zombies are terminated,
|
|
43
|
+
// but kill(0) still sees their process group until the parent reaps them.
|
|
44
|
+
if (process.platform !== "win32") {
|
|
45
|
+
const result = spawnSync("ps", ["-eo", "pgid=,stat="], { encoding: "utf8", timeout: 1_000 });
|
|
46
|
+
if (result.status === 0 &&
|
|
47
|
+
!result.stdout.split("\n").some((line) => {
|
|
48
|
+
const [group, state] = line.trim().split(/\s+/);
|
|
49
|
+
return Number(group) === pid && state && !state.startsWith("Z");
|
|
50
|
+
}))
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
if (performance.now() >= deadline)
|
|
54
|
+
throw new Error(`Shell process group ${pid} did not terminate`);
|
|
55
|
+
await delay(25);
|
|
56
|
+
}
|
|
57
|
+
this.#pids.delete(pid);
|
|
58
|
+
untrackDetachedChildPid(pid);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
3
|
"name": "@diffexai/diffex",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"sourceCommit": "
|
|
4
|
+
"version": "0.3.0",
|
|
5
|
+
"sourceCommit": "c8cec4d3820393131eaae7b43d56ac5f75d8041a",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"portions": "Diffex contributions; Pi-derived portions retain MIT terms in LICENSE",
|
|
8
8
|
"notice": "LICENSE",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
12
|
"name": "@diffexai/diffex-evolution",
|
|
13
|
-
"version": "0.
|
|
13
|
+
"version": "0.3.0",
|
|
14
14
|
"license": "Apache-2.0",
|
|
15
15
|
"portions": "dist/vendor/evolution: runtime JavaScript and declarations",
|
|
16
16
|
"notice": "LICENSE",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
20
|
"name": "@diffexai/diffex-harness-trace",
|
|
21
|
-
"version": "0.
|
|
21
|
+
"version": "0.3.0",
|
|
22
22
|
"license": "Apache-2.0",
|
|
23
23
|
"portions": "dist/vendor/harness-trace: runtime JavaScript and declarations",
|
|
24
24
|
"notice": "LICENSE",
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
},
|
|
135
135
|
{
|
|
136
136
|
"name": "@diffexai/diffex-agent-core",
|
|
137
|
-
"version": "0.
|
|
137
|
+
"version": "0.3.0",
|
|
138
138
|
"license": "Apache-2.0",
|
|
139
139
|
"portions": "dist/node_modules/@diffexai/diffex-agent-core: bundled runtime, declarations, approved assets and native prebuilds",
|
|
140
140
|
"notice": "dist/node_modules/@diffexai/diffex-agent-core/LICENSE",
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
},
|
|
143
143
|
{
|
|
144
144
|
"name": "@diffexai/diffex-ai",
|
|
145
|
-
"version": "0.
|
|
145
|
+
"version": "0.3.0",
|
|
146
146
|
"license": "Apache-2.0",
|
|
147
147
|
"portions": "dist/node_modules/@diffexai/diffex-ai: bundled runtime, declarations, approved assets and native prebuilds",
|
|
148
148
|
"notice": "dist/node_modules/@diffexai/diffex-ai/LICENSE",
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
},
|
|
151
151
|
{
|
|
152
152
|
"name": "@diffexai/diffex-client",
|
|
153
|
-
"version": "0.
|
|
153
|
+
"version": "0.3.0",
|
|
154
154
|
"license": "Apache-2.0",
|
|
155
155
|
"portions": "dist/node_modules/@diffexai/diffex-client: bundled runtime, declarations, approved assets and native prebuilds",
|
|
156
156
|
"notice": "dist/node_modules/@diffexai/diffex-client/LICENSE",
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
},
|
|
159
159
|
{
|
|
160
160
|
"name": "@diffexai/diffex-harness-state",
|
|
161
|
-
"version": "0.
|
|
161
|
+
"version": "0.3.0",
|
|
162
162
|
"license": "Apache-2.0",
|
|
163
163
|
"portions": "dist/node_modules/@diffexai/diffex-harness-state: bundled runtime, declarations, approved assets and native prebuilds",
|
|
164
164
|
"notice": "dist/node_modules/@diffexai/diffex-harness-state/LICENSE",
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
},
|
|
167
167
|
{
|
|
168
168
|
"name": "@diffexai/diffex-protocol",
|
|
169
|
-
"version": "0.
|
|
169
|
+
"version": "0.3.0",
|
|
170
170
|
"license": "Apache-2.0",
|
|
171
171
|
"portions": "dist/node_modules/@diffexai/diffex-protocol: bundled runtime, declarations, approved assets and native prebuilds",
|
|
172
172
|
"notice": "dist/node_modules/@diffexai/diffex-protocol/LICENSE",
|
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
},
|
|
175
175
|
{
|
|
176
176
|
"name": "@diffexai/diffex-telemetry",
|
|
177
|
-
"version": "0.
|
|
177
|
+
"version": "0.3.0",
|
|
178
178
|
"license": "Apache-2.0",
|
|
179
179
|
"portions": "dist/node_modules/@diffexai/diffex-telemetry: bundled runtime, declarations, approved assets and native prebuilds",
|
|
180
180
|
"notice": "dist/node_modules/@diffexai/diffex-telemetry/LICENSE",
|
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
},
|
|
183
183
|
{
|
|
184
184
|
"name": "@diffexai/diffex-tui",
|
|
185
|
-
"version": "0.
|
|
185
|
+
"version": "0.3.0",
|
|
186
186
|
"license": "Apache-2.0",
|
|
187
187
|
"portions": "dist/node_modules/@diffexai/diffex-tui: bundled runtime, declarations, approved assets and native prebuilds",
|
|
188
188
|
"notice": "dist/node_modules/@diffexai/diffex-tui/LICENSE",
|