peaks-loop-internal-runtime 0.0.2 → 0.0.4
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/dispatch.d.ts +2 -0
- package/dist/dispatch.d.ts.map +1 -1
- package/dist/dispatch.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/vendor/claude-adapter.d.ts.map +1 -1
- package/dist/vendor/claude-adapter.js +2 -10
- package/dist/vendor/codex-adapter.d.ts.map +1 -1
- package/dist/vendor/codex-adapter.js +2 -10
- package/dist/vendor/copilot-adapter.d.ts.map +1 -1
- package/dist/vendor/copilot-adapter.js +2 -10
- package/dist/vendor/detect-binary.d.ts +3 -0
- package/dist/vendor/detect-binary.d.ts.map +1 -0
- package/dist/vendor/detect-binary.js +11 -0
- package/package.json +2 -2
- package/src/dispatch.ts +3 -2
- package/src/index.ts +2 -2
- package/src/vendor/claude-adapter.ts +2 -8
- package/src/vendor/codex-adapter.ts +2 -5
- package/src/vendor/copilot-adapter.ts +2 -5
- package/src/vendor/detect-binary.ts +14 -0
package/dist/dispatch.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ChildProcess } from 'node:child_process';
|
|
1
2
|
export interface DispatchInput {
|
|
2
3
|
sid: string;
|
|
3
4
|
rid: string;
|
|
@@ -13,6 +14,7 @@ export interface DispatchInput {
|
|
|
13
14
|
export interface DispatchResult {
|
|
14
15
|
pid: number;
|
|
15
16
|
dispatchRecordPath: string;
|
|
17
|
+
child?: ChildProcess;
|
|
16
18
|
}
|
|
17
19
|
export declare function dispatchDetached(i: DispatchInput): Promise<DispatchResult>;
|
|
18
20
|
//# sourceMappingURL=dispatch.d.ts.map
|
package/dist/dispatch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../src/dispatch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../src/dispatch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAYvD,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,IAAI,GAAC,IAAI,GAAC,IAAI,GAAC,KAAK,GAAC,iBAAiB,CAAC;IACvE,MAAM,EAAE,QAAQ,GAAC,OAAO,GAAC,SAAS,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAC;IAClD,UAAU,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IACzC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AACD,MAAM,WAAW,cAAc;IAAG,GAAG,EAAE,MAAM,CAAC;IAAC,kBAAkB,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,YAAY,CAAC;CAAE;AAElG,wBAAsB,gBAAgB,CAAC,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,CAkChF"}
|
package/dist/dispatch.js
CHANGED
|
@@ -36,5 +36,5 @@ export async function dispatchDetached(i) {
|
|
|
36
36
|
rid: i.rid, mode: 'detached', vendor: i.vendor,
|
|
37
37
|
status: 'running', heartbeats: [], at: Date.now(),
|
|
38
38
|
}, null, 2));
|
|
39
|
-
return { pid: handle.pid, dispatchRecordPath: recPath };
|
|
39
|
+
return { pid: handle.pid, dispatchRecordPath: recPath, child: handle.child };
|
|
40
40
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const RUNTIME_VERSION = "4.0.
|
|
2
|
-
export declare const RUNTIME_NPM_VERSION = "0.0.
|
|
1
|
+
export declare const RUNTIME_VERSION = "4.0.22";
|
|
2
|
+
export declare const RUNTIME_NPM_VERSION = "0.0.3";
|
|
3
3
|
export { ClaudeAdapter } from './vendor/claude-adapter.js';
|
|
4
4
|
export { CodexAdapter } from './vendor/codex-adapter.js';
|
|
5
5
|
export { CopilotAdapter } from './vendor/copilot-adapter.js';
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// API contract: RUNTIME_VERSION tracks peaks-loop root version (4.0.x).
|
|
2
2
|
// This is what consumers (sub-agents dispatched by peaks-code) check at
|
|
3
3
|
// runtime to verify protocol compatibility.
|
|
4
|
-
export const RUNTIME_VERSION = '4.0.
|
|
4
|
+
export const RUNTIME_VERSION = '4.0.22';
|
|
5
5
|
// npm version: independent 0.0.x SemVer. Runtime is its own package
|
|
6
6
|
// (peaks-loop-internal-runtime@NPM_VERSION) on the registry; bumps
|
|
7
7
|
// per peaks release notes when its public surface actually changes
|
|
8
8
|
// (not per root version bump).
|
|
9
|
-
export const RUNTIME_NPM_VERSION = '0.0.
|
|
9
|
+
export const RUNTIME_NPM_VERSION = '0.0.3';
|
|
10
10
|
export { ClaudeAdapter } from './vendor/claude-adapter.js';
|
|
11
11
|
export { CodexAdapter } from './vendor/codex-adapter.js';
|
|
12
12
|
export { CopilotAdapter } from './vendor/copilot-adapter.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-adapter.d.ts","sourceRoot":"","sources":["../../src/vendor/claude-adapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"claude-adapter.d.ts","sourceRoot":"","sources":["../../src/vendor/claude-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C,qBAAa,aAAc,YAAW,aAAa;IACjD,QAAQ,CAAC,EAAE,EAAG,QAAQ,CAAU;IAChC,QAAQ,CAAC,MAAM,YAAY;IAC3B,QAAQ,CAAC,cAAc,SAAY;IAEnC,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,iBAAiB,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,EAAE;IAO7E,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI;IAe7C,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC;CAG1C"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { promisify } from 'node:util';
|
|
3
|
-
const pExecFile = promisify(execFile);
|
|
1
|
+
import { detectBinaryInstalled } from './detect-binary.js';
|
|
4
2
|
export class ClaudeAdapter {
|
|
5
3
|
id = 'claude';
|
|
6
4
|
binary = 'claude';
|
|
@@ -30,12 +28,6 @@ export class ClaudeAdapter {
|
|
|
30
28
|
}
|
|
31
29
|
}
|
|
32
30
|
async detectInstalled() {
|
|
33
|
-
|
|
34
|
-
const { stdout } = await pExecFile(this.binary, ['--version'], { timeout: 3000 });
|
|
35
|
-
return stdout.length > 0;
|
|
36
|
-
}
|
|
37
|
-
catch {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
31
|
+
return detectBinaryInstalled(this.binary);
|
|
40
32
|
}
|
|
41
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-adapter.d.ts","sourceRoot":"","sources":["../../src/vendor/codex-adapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"codex-adapter.d.ts","sourceRoot":"","sources":["../../src/vendor/codex-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C,qBAAa,YAAa,YAAW,aAAa;IAChD,QAAQ,CAAC,EAAE,EAAG,OAAO,CAAU;IAC/B,QAAQ,CAAC,MAAM,WAAW;IAC1B,QAAQ,CAAC,cAAc,SAAY;IACnC,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE;IAGtC,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI;IAO7C,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC;CAG1C"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { promisify } from 'node:util';
|
|
3
|
-
const pExecFile = promisify(execFile);
|
|
1
|
+
import { detectBinaryInstalled } from './detect-binary.js';
|
|
4
2
|
export class CodexAdapter {
|
|
5
3
|
id = 'codex';
|
|
6
4
|
binary = 'codex';
|
|
@@ -20,12 +18,6 @@ export class CodexAdapter {
|
|
|
20
18
|
}
|
|
21
19
|
}
|
|
22
20
|
async detectInstalled() {
|
|
23
|
-
|
|
24
|
-
const { stdout } = await pExecFile(this.binary, ['--version'], { timeout: 3000 });
|
|
25
|
-
return stdout.length > 0;
|
|
26
|
-
}
|
|
27
|
-
catch {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
21
|
+
return detectBinaryInstalled(this.binary);
|
|
30
22
|
}
|
|
31
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copilot-adapter.d.ts","sourceRoot":"","sources":["../../src/vendor/copilot-adapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"copilot-adapter.d.ts","sourceRoot":"","sources":["../../src/vendor/copilot-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C,qBAAa,cAAe,YAAW,aAAa;IAClD,QAAQ,CAAC,EAAE,EAAG,SAAS,CAAU;IACjC,QAAQ,CAAC,MAAM,aAAa;IAC5B,QAAQ,CAAC,cAAc,SAAY;IACnC,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE;IACtC,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI;IAO7C,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC;CAG1C"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { promisify } from 'node:util';
|
|
3
|
-
const pExecFile = promisify(execFile);
|
|
1
|
+
import { detectBinaryInstalled } from './detect-binary.js';
|
|
4
2
|
export class CopilotAdapter {
|
|
5
3
|
id = 'copilot';
|
|
6
4
|
binary = 'copilot';
|
|
@@ -18,12 +16,6 @@ export class CopilotAdapter {
|
|
|
18
16
|
}
|
|
19
17
|
}
|
|
20
18
|
async detectInstalled() {
|
|
21
|
-
|
|
22
|
-
const { stdout } = await pExecFile(this.binary, ['--version'], { timeout: 3000 });
|
|
23
|
-
return stdout.length > 0;
|
|
24
|
-
}
|
|
25
|
-
catch {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
19
|
+
return detectBinaryInstalled(this.binary);
|
|
28
20
|
}
|
|
29
21
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect-binary.d.ts","sourceRoot":"","sources":["../../src/vendor/detect-binary.ts"],"names":[],"mappings":"AAIA,oFAAoF;AACpF,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAQtE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process';
|
|
2
|
+
const DETECT_TIMEOUT_MS = 3000;
|
|
3
|
+
/** Resolve a binary through the platform's PATH lookup without invoking a shell. */
|
|
4
|
+
export function detectBinaryInstalled(binary) {
|
|
5
|
+
const locator = process.platform === 'win32' ? 'where.exe' : 'which';
|
|
6
|
+
return new Promise((resolve) => {
|
|
7
|
+
execFile(locator, [binary], { timeout: DETECT_TIMEOUT_MS }, (error, stdout) => {
|
|
8
|
+
resolve(error === null && stdout.trim().length > 0);
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "peaks-loop-internal-runtime",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "Detached sub-agent runtime: ProcessSupervisor + LifecycleOwner + VendorAdapter (claude/codex/copilot) + G8 infinite-context auto-compact. Slice 2026-08-10.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"peaks-loop-shared": "0.0.
|
|
19
|
+
"peaks-loop-shared": "0.0.53"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"typescript": "^5.4.0",
|
package/src/dispatch.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { writeFileSync, mkdirSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
|
+
import type { ChildProcess } from 'node:child_process';
|
|
3
4
|
import { ProcessSupervisor } from './process-supervisor.js';
|
|
4
5
|
import { LifecycleOwner } from './lifecycle.js';
|
|
5
6
|
import { VendorAdapterRegistry } from './vendor/registry.js';
|
|
@@ -18,7 +19,7 @@ export interface DispatchInput {
|
|
|
18
19
|
runtimeDir: string; subAgentsDir: string;
|
|
19
20
|
verbatimBlocks?: string[];
|
|
20
21
|
}
|
|
21
|
-
export interface DispatchResult { pid: number; dispatchRecordPath: string; }
|
|
22
|
+
export interface DispatchResult { pid: number; dispatchRecordPath: string; child?: ChildProcess; }
|
|
22
23
|
|
|
23
24
|
export async function dispatchDetached(i: DispatchInput): Promise<DispatchResult> {
|
|
24
25
|
const registry = new VendorAdapterRegistry([new ClaudeAdapter(), new CodexAdapter(), new CopilotAdapter()]);
|
|
@@ -53,5 +54,5 @@ export async function dispatchDetached(i: DispatchInput): Promise<DispatchResult
|
|
|
53
54
|
status: 'running', heartbeats: [], at: Date.now(),
|
|
54
55
|
}, null, 2));
|
|
55
56
|
|
|
56
|
-
return { pid: handle.pid, dispatchRecordPath: recPath };
|
|
57
|
+
return { pid: handle.pid, dispatchRecordPath: recPath, child: handle.child };
|
|
57
58
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// API contract: RUNTIME_VERSION tracks peaks-loop root version (4.0.x).
|
|
2
2
|
// This is what consumers (sub-agents dispatched by peaks-code) check at
|
|
3
3
|
// runtime to verify protocol compatibility.
|
|
4
|
-
export const RUNTIME_VERSION = '4.0.
|
|
4
|
+
export const RUNTIME_VERSION = '4.0.22';
|
|
5
5
|
|
|
6
6
|
// npm version: independent 0.0.x SemVer. Runtime is its own package
|
|
7
7
|
// (peaks-loop-internal-runtime@NPM_VERSION) on the registry; bumps
|
|
8
8
|
// per peaks release notes when its public surface actually changes
|
|
9
9
|
// (not per root version bump).
|
|
10
|
-
export const RUNTIME_NPM_VERSION = '0.0.
|
|
10
|
+
export const RUNTIME_NPM_VERSION = '0.0.3';
|
|
11
11
|
export { ClaudeAdapter } from './vendor/claude-adapter.js';
|
|
12
12
|
export { CodexAdapter } from './vendor/codex-adapter.js';
|
|
13
13
|
export { CopilotAdapter } from './vendor/copilot-adapter.js';
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { execFile } from 'node:child_process';
|
|
2
|
-
import { promisify } from 'node:util';
|
|
3
1
|
import type { VendorAdapter } from './adapter.js';
|
|
4
2
|
import type { ChildStatus } from '../types.js';
|
|
5
|
-
|
|
6
|
-
const pExecFile = promisify(execFile);
|
|
3
|
+
import { detectBinaryInstalled } from './detect-binary.js';
|
|
7
4
|
|
|
8
5
|
export class ClaudeAdapter implements VendorAdapter {
|
|
9
6
|
readonly id = 'claude' as const;
|
|
@@ -33,9 +30,6 @@ export class ClaudeAdapter implements VendorAdapter {
|
|
|
33
30
|
}
|
|
34
31
|
|
|
35
32
|
async detectInstalled(): Promise<boolean> {
|
|
36
|
-
|
|
37
|
-
const { stdout } = await pExecFile(this.binary, ['--version'], { timeout: 3000 });
|
|
38
|
-
return stdout.length > 0;
|
|
39
|
-
} catch { return false; }
|
|
33
|
+
return detectBinaryInstalled(this.binary);
|
|
40
34
|
}
|
|
41
35
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { execFile } from 'node:child_process';
|
|
2
|
-
import { promisify } from 'node:util';
|
|
3
1
|
import type { VendorAdapter } from './adapter.js';
|
|
4
2
|
import type { ChildStatus } from '../types.js';
|
|
5
|
-
|
|
3
|
+
import { detectBinaryInstalled } from './detect-binary.js';
|
|
6
4
|
|
|
7
5
|
export class CodexAdapter implements VendorAdapter {
|
|
8
6
|
readonly id = 'codex' as const;
|
|
@@ -19,7 +17,6 @@ export class CodexAdapter implements VendorAdapter {
|
|
|
19
17
|
} catch { return null; }
|
|
20
18
|
}
|
|
21
19
|
async detectInstalled(): Promise<boolean> {
|
|
22
|
-
|
|
23
|
-
catch { return false; }
|
|
20
|
+
return detectBinaryInstalled(this.binary);
|
|
24
21
|
}
|
|
25
22
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { execFile } from 'node:child_process';
|
|
2
|
-
import { promisify } from 'node:util';
|
|
3
1
|
import type { VendorAdapter } from './adapter.js';
|
|
4
2
|
import type { ChildStatus } from '../types.js';
|
|
5
|
-
|
|
3
|
+
import { detectBinaryInstalled } from './detect-binary.js';
|
|
6
4
|
|
|
7
5
|
export class CopilotAdapter implements VendorAdapter {
|
|
8
6
|
readonly id = 'copilot' as const;
|
|
@@ -17,7 +15,6 @@ export class CopilotAdapter implements VendorAdapter {
|
|
|
17
15
|
} catch { return null; }
|
|
18
16
|
}
|
|
19
17
|
async detectInstalled(): Promise<boolean> {
|
|
20
|
-
|
|
21
|
-
catch { return false; }
|
|
18
|
+
return detectBinaryInstalled(this.binary);
|
|
22
19
|
}
|
|
23
20
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process';
|
|
2
|
+
|
|
3
|
+
const DETECT_TIMEOUT_MS = 3000;
|
|
4
|
+
|
|
5
|
+
/** Resolve a binary through the platform's PATH lookup without invoking a shell. */
|
|
6
|
+
export function detectBinaryInstalled(binary: string): Promise<boolean> {
|
|
7
|
+
const locator = process.platform === 'win32' ? 'where.exe' : 'which';
|
|
8
|
+
|
|
9
|
+
return new Promise((resolve) => {
|
|
10
|
+
execFile(locator, [binary], { timeout: DETECT_TIMEOUT_MS }, (error, stdout) => {
|
|
11
|
+
resolve(error === null && stdout.trim().length > 0);
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
}
|