@quantiya/codevibe-core 2.0.80 → 2.0.82
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/appsync/appsync-client.d.ts +3 -1
- package/dist/credential-broker/index.d.ts +1 -1
- package/dist/credential-broker/oauth-account-lock.d.ts +24 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +496 -487
- package/dist/local-executor/index.d.ts +1 -0
- package/dist/local-executor/spawn-sweep.d.ts +75 -0
- package/dist/orchestration-shell/cli.js +525 -291
- package/dist/orchestration-shell/index.d.ts +17 -0
- package/dist/substrate/bwrap.d.ts +93 -0
- package/dist/substrate/command-runner.d.ts +1 -0
- package/dist/substrate/index.d.ts +4 -0
- package/dist/substrate/pasta.d.ts +36 -0
- package/dist/substrate/types.d.ts +3 -1
- package/dist/substrate-launch/engage-substrate.d.ts +4 -0
- package/package.json +1 -1
|
@@ -55,3 +55,4 @@ export type { AtomicWriteOptions, TeamDeliveryJournalEntry, TeamDeliveryRouting,
|
|
|
55
55
|
export { WorkspaceShadow, type ShadowEnv, type ShadowDiffFile, } from './workspace-shadow';
|
|
56
56
|
export { runSnapshotMergeGate, createSnapshotTrackBundle, type SnapshotTrackBundle, } from './snapshot-merge';
|
|
57
57
|
export { captureWorkspaceRootAuthority, type WorkspaceRootAuthority, } from './workspace-authority';
|
|
58
|
+
export { executeSpawnSweep, encodeSpawnRecord, defaultReadProcStat, type SpawnSweepRecord, type SpawnSweepResult, type SpawnSweepOptions, type HelperProcStat, } from './spawn-sweep';
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import cp from 'node:child_process';
|
|
2
|
+
export interface SpawnSweepRecord {
|
|
3
|
+
version: 1;
|
|
4
|
+
bootId: string;
|
|
5
|
+
folder: string;
|
|
6
|
+
pgid?: number;
|
|
7
|
+
pid?: number;
|
|
8
|
+
sid?: number;
|
|
9
|
+
leaderStarttime?: string;
|
|
10
|
+
sandboxArgv?: readonly string[];
|
|
11
|
+
}
|
|
12
|
+
export interface TargetEndedInfo {
|
|
13
|
+
pid: number;
|
|
14
|
+
basis: string;
|
|
15
|
+
}
|
|
16
|
+
export interface BlockerInfo {
|
|
17
|
+
pid: number;
|
|
18
|
+
reason: string;
|
|
19
|
+
}
|
|
20
|
+
export interface SpawnSweepResult {
|
|
21
|
+
version: number;
|
|
22
|
+
cleanupAllowed: boolean;
|
|
23
|
+
ended: TargetEndedInfo[];
|
|
24
|
+
blockers: BlockerInfo[];
|
|
25
|
+
remaining: number[] | 'incomplete';
|
|
26
|
+
strandedMembers: number[];
|
|
27
|
+
recordSha256: string;
|
|
28
|
+
}
|
|
29
|
+
export type ProcStatOutcome = {
|
|
30
|
+
kind: 'ok';
|
|
31
|
+
ppid: number;
|
|
32
|
+
starttime: string;
|
|
33
|
+
} | {
|
|
34
|
+
kind: 'gone';
|
|
35
|
+
} | {
|
|
36
|
+
kind: 'error';
|
|
37
|
+
reason: string;
|
|
38
|
+
};
|
|
39
|
+
export interface HelperProcStat {
|
|
40
|
+
ppid: number;
|
|
41
|
+
starttime: string;
|
|
42
|
+
}
|
|
43
|
+
export interface SpawnSweepOptions {
|
|
44
|
+
record: SpawnSweepRecord;
|
|
45
|
+
helperBin?: string;
|
|
46
|
+
timeoutMs?: number;
|
|
47
|
+
platform?: NodeJS.Platform;
|
|
48
|
+
/** Injectable `/proc/<pid>/stat` reader for unit tests */
|
|
49
|
+
readProcStat?: (pid: number) => ProcStatOutcome;
|
|
50
|
+
/** Injectable spawner for unit tests */
|
|
51
|
+
spawnHelper?: typeof cp.spawn;
|
|
52
|
+
}
|
|
53
|
+
/** Reset active spawn sweeps map (for test isolation) */
|
|
54
|
+
export declare function _resetActiveSpawnSweeps(): void;
|
|
55
|
+
/**
|
|
56
|
+
* Encodes the spawn record to the line-delimited format specified in §6.2:
|
|
57
|
+
* - version\t1\n
|
|
58
|
+
* - bootId\t<36-char lowercase uuid>\n
|
|
59
|
+
* - folder\t<hex encoded path>\n
|
|
60
|
+
* - [pgid, pid, sid, leaderStarttime]
|
|
61
|
+
* - [sandboxArgv\t<hex element 1>\t<hex element 2>...\n]
|
|
62
|
+
* - end\n
|
|
63
|
+
*/
|
|
64
|
+
export declare function encodeSpawnRecord(rec: SpawnSweepRecord): string;
|
|
65
|
+
/**
|
|
66
|
+
* Reads `/proc/<pid>/stat` to extract ppid (field 4) and starttime (field 22).
|
|
67
|
+
* Distinguishes ENOENT (gone) from read/parse error (§6.2:1738 & §16.1 case 9).
|
|
68
|
+
*/
|
|
69
|
+
export declare function defaultReadProcStat(pid: number): ProcStatOutcome;
|
|
70
|
+
/**
|
|
71
|
+
* Invokes `codevibe-spawn-sweep` to sweep orphaned processes associated with a spawn.
|
|
72
|
+
* On Linux, runs the native musl-linked binary. On macOS, returns immediate clean result
|
|
73
|
+
* since macOS relies on Seatbelt and the POSIX process host (§11).
|
|
74
|
+
*/
|
|
75
|
+
export declare function executeSpawnSweep(opts: SpawnSweepOptions): Promise<SpawnSweepResult>;
|