@quantiya/codevibe-claude-plugin 2.0.44 → 2.0.46
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/.claude-plugin/plugin.json +1 -1
- package/node_modules/@quantiya/codevibe-core/dist/appsync/appsync-client.d.ts +124 -3
- package/node_modules/@quantiya/codevibe-core/dist/appsync/queries.d.ts +6 -0
- package/node_modules/@quantiya/codevibe-core/dist/index.js +578 -461
- package/node_modules/@quantiya/codevibe-core/dist/local-executor/class-b-consumer.d.ts +10 -1
- package/node_modules/@quantiya/codevibe-core/dist/local-executor/descendant-reaper.d.ts +81 -0
- package/node_modules/@quantiya/codevibe-core/dist/local-executor/local-executor-impl.d.ts +15 -1
- package/node_modules/@quantiya/codevibe-core/dist/local-executor/process-tree.d.ts +6 -0
- package/node_modules/@quantiya/codevibe-core/dist/local-executor/snapshot-merge.d.ts +10 -0
- package/node_modules/@quantiya/codevibe-core/dist/local-executor/spawn.d.ts +1 -1
- package/node_modules/@quantiya/codevibe-core/dist/local-executor/types.d.ts +16 -0
- package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/cli.js +2291 -824
- package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/components/LiveProgressLine.d.ts +4 -0
- package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/components/OrchestrationApp.d.ts +13 -0
- package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/context-compaction.d.ts +7 -5
- package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/index.d.ts +77 -18
- package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/prompt-reply-router.d.ts +53 -0
- package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/quorum-loop.d.ts +138 -7
- package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/task-lifecycle-lines.d.ts +29 -0
- package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/task-progress.d.ts +1 -0
- package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/types.d.ts +48 -1
- package/node_modules/@quantiya/codevibe-core/dist/substrate/command-runner.d.ts +2 -0
- package/node_modules/@quantiya/codevibe-core/dist/substrate/types.d.ts +5 -0
- package/node_modules/@quantiya/codevibe-core/dist/substrate-launch/engage-substrate.d.ts +2 -0
- package/node_modules/@quantiya/codevibe-core/package.json +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AuthorityScope } from './authority';
|
|
2
2
|
import { ClassAEmitter, ClassAEmitterContext } from './class-a-emit';
|
|
3
3
|
import { EmitShellEventFn } from './hook-bridge';
|
|
4
|
-
import { ClassBInbound, GateDispatchPayload, MergeGateDispatchPayload, ReviewerDispatchPayload, ReviseFeedbackPayload, TaskGroupHaltedPayload, TrackAssignedPayload } from './types';
|
|
4
|
+
import { ClassBInbound, GateDispatchPayload, MergeGateDispatchPayload, QueuedWorkEndedPayload, ReviewerDispatchPayload, ReviseFeedbackPayload, TaskGroupHaltedPayload, TrackAssignedPayload } from './types';
|
|
5
5
|
import type { ContinuationPacketWriter } from '../continuation/packet-writer';
|
|
6
6
|
import type { PacketWriteInput } from '../continuation/types';
|
|
7
7
|
export type ClassBVerificationResult = {
|
|
@@ -75,6 +75,7 @@ export declare function normalizeTrackAssignedWire(raw: unknown): Partial<TrackA
|
|
|
75
75
|
* LOCK #E3-1, so an invalid packet is dropped, never surfaced as an exception.
|
|
76
76
|
*/
|
|
77
77
|
export declare function isValidTrackAssignedPayload(payload: Partial<TrackAssignedPayload> | undefined): payload is TrackAssignedPayload;
|
|
78
|
+
export declare function isValidQueuedWorkEndedPayload(payload: Partial<QueuedWorkEndedPayload> | undefined): payload is QueuedWorkEndedPayload;
|
|
78
79
|
export interface ClassBConsumerState {
|
|
79
80
|
/** Last received PlannerDecisionApproved per taskId; CP-2 reads. */
|
|
80
81
|
plannerDecisionByTask: Map<string, Extract<ClassBInbound, {
|
|
@@ -216,6 +217,13 @@ export interface ClassBConsumerDeps {
|
|
|
216
217
|
* sweeper re-emit after a crash is idempotent.
|
|
217
218
|
*/
|
|
218
219
|
runReviseRound?: (payload: ReviseFeedbackPayload) => Promise<void>;
|
|
220
|
+
/**
|
|
221
|
+
* P46b §3.6 — a single task that never started was halted and its slot ended
|
|
222
|
+
* (`queued_task_expired` / `tier_changed` / `user_cancelled_queued_task`). The
|
|
223
|
+
* shell marks it `cancelled (reason)` on its first change. When OMITTED
|
|
224
|
+
* (non-loop LE / tests) the kind is dropped + logged.
|
|
225
|
+
*/
|
|
226
|
+
queuedWorkEnded?: (payload: QueuedWorkEndedPayload) => Promise<void>;
|
|
219
227
|
}
|
|
220
228
|
/**
|
|
221
229
|
* Class B inbound consumer per design §6.1.
|
|
@@ -253,6 +261,7 @@ export declare class ClassBConsumer {
|
|
|
253
261
|
private handleTaskGroupHalted;
|
|
254
262
|
private handleReviewerDispatch;
|
|
255
263
|
private handleReviseFeedback;
|
|
264
|
+
private handleQueuedWorkEnded;
|
|
256
265
|
/**
|
|
257
266
|
* Constructs an AuthorityRefusal with one of the LOCK #E4-1 widened category
|
|
258
267
|
* literals and emits an EXECUTOR_REFUSAL via the CP-1.c emitter. Audit-only:
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/** The environment key every implementor spawn — and its descendants — carries. */
|
|
2
|
+
export declare const PROCESS_TREE_MARKER_ENV = "CODEVIBE_PROCESS_TREE_ID";
|
|
3
|
+
export interface MarkedProcess {
|
|
4
|
+
pid: number;
|
|
5
|
+
/** Start time reported with the pid; the signal follows the scan immediately. */
|
|
6
|
+
startedAt: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ReapResult {
|
|
9
|
+
killed: number;
|
|
10
|
+
/** Marked processes still present at the deadline (cleanup not proven). */
|
|
11
|
+
remaining: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A task-private working directory (canonical path) and the spawn's start: the
|
|
15
|
+
* reaper also takes this user's processes started no earlier than `notBeforeMs`
|
|
16
|
+
* (at the listing's one-second resolution) whose cwd is inside `workingDir`.
|
|
17
|
+
*/
|
|
18
|
+
export interface WorkingDirScope {
|
|
19
|
+
workingDir: string;
|
|
20
|
+
notBeforeMs: number;
|
|
21
|
+
}
|
|
22
|
+
export interface ReapOptions {
|
|
23
|
+
deadlineMs?: number;
|
|
24
|
+
workingDirScope?: WorkingDirScope;
|
|
25
|
+
}
|
|
26
|
+
export interface ReaperDeps {
|
|
27
|
+
platform?: NodeJS.Platform;
|
|
28
|
+
/** List this user's processes whose environment carries `token`. */
|
|
29
|
+
listMarked?: (token: string) => Promise<MarkedProcess[]>;
|
|
30
|
+
/** List this user's processes started in scope whose cwd is inside the working dir. */
|
|
31
|
+
listInWorkingDir?: (scope: WorkingDirScope) => Promise<MarkedProcess[]>;
|
|
32
|
+
signal?: (pid: number) => void;
|
|
33
|
+
sleep?: (ms: number) => Promise<void>;
|
|
34
|
+
selfPids?: ReadonlySet<number>;
|
|
35
|
+
}
|
|
36
|
+
/** The exact `KEY=value` token a descendant's environment carries. */
|
|
37
|
+
export declare function processTreeMarkerToken(treeId: string): string;
|
|
38
|
+
/**
|
|
39
|
+
* P46b ID-31 — what the POSIX process host sweeps when the desktop that owns it
|
|
40
|
+
* dies before its target (a crash): processes carrying `markerToken`, and — for a
|
|
41
|
+
* task-private working dir — processes started since the target whose cwd is
|
|
42
|
+
* inside `workingDir`. The same target set as `reapMarkedProcessTree`, run by the
|
|
43
|
+
* process that survives the desktop.
|
|
44
|
+
*/
|
|
45
|
+
export interface HostDescendantReap {
|
|
46
|
+
markerToken: string;
|
|
47
|
+
workingDir?: string;
|
|
48
|
+
}
|
|
49
|
+
/** The host descriptor for a spawn, or undefined when the spawn has no tree id. */
|
|
50
|
+
export declare function hostDescendantReap(processTreeId: string | undefined, taskPrivateWorkingDir: string | undefined): HostDescendantReap | undefined;
|
|
51
|
+
/** Exact-token match in a whitespace-separated command+environment line. */
|
|
52
|
+
export declare function lineCarriesToken(line: string, token: string): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* macOS / BSD — `ps -E` appends each same-user process's environment to its
|
|
55
|
+
* command column. Columns: pid, uid, lstart (24 chars), command+environment.
|
|
56
|
+
*/
|
|
57
|
+
export declare function parsePsEnvironmentListing(output: string, token: string, uid: number): MarkedProcess[];
|
|
58
|
+
/** `ps -o lstart` (C locale, local time) → epoch ms; NaN when unparseable. */
|
|
59
|
+
export declare function parseLstart(lstart: string): number;
|
|
60
|
+
/**
|
|
61
|
+
* This user's processes from a `pid uid lstart command` listing that started no
|
|
62
|
+
* earlier than `notBeforeMs`, compared at the listing's one-second resolution
|
|
63
|
+
* (a process started in the spawn's own second is included).
|
|
64
|
+
*/
|
|
65
|
+
export declare function processesStartedSince(output: string, uid: number, notBeforeMs: number): MarkedProcess[];
|
|
66
|
+
/** `lsof -d cwd -Fn` output → pid → cwd. */
|
|
67
|
+
export declare function parseLsofCwd(output: string): Map<number, string>;
|
|
68
|
+
/**
|
|
69
|
+
* True when `candidate` is `dir` or a path inside it (no sibling-prefix match).
|
|
70
|
+
* Fails closed for a relative directory or the filesystem root, which no task
|
|
71
|
+
* owns.
|
|
72
|
+
*/
|
|
73
|
+
export declare function isInsideDir(candidate: string, dir: string): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Reap every process carrying `treeId`'s marker — and, with a working-directory
|
|
76
|
+
* scope on macOS, every process started since the spawn inside that directory.
|
|
77
|
+
* Idempotent (a second call finds nothing). Never throws: a failed scan counts
|
|
78
|
+
* as "cleanup not proven" only when a target was seen and could not be
|
|
79
|
+
* confirmed gone.
|
|
80
|
+
*/
|
|
81
|
+
export declare function reapMarkedProcessTree(treeId: string, opts?: ReapOptions, deps?: ReaperDeps): Promise<ReapResult>;
|
|
@@ -5,7 +5,7 @@ import { type DeviceSigningKey } from './class-a-sign';
|
|
|
5
5
|
import { EmitShellEventFn } from './hook-bridge';
|
|
6
6
|
import { SubmitMergeGateVerdictInput } from './task-group-types';
|
|
7
7
|
import { TrackRegistry } from './track-registry';
|
|
8
|
-
import { AgentKind, AuthorityAction, ClassBInbound, GateDispatchPayload, HookEvent, ImplementorHandle, LocalExecutor, MergeGateDispatchPayload, ProbeHandle, ProcessRole, ReviewerDispatchPayload, ReviseFeedbackPayload, ReviewerHandle, SpawnArgs, TrackAssignedPayload, type DurableSessionResourceDisposeOptions, type WorkspaceDisposeOptions } from './types';
|
|
8
|
+
import { AgentKind, AuthorityAction, ClassBInbound, GateDispatchPayload, HookEvent, ImplementorHandle, LocalExecutor, MergeGateDispatchPayload, ProbeHandle, ProcessRole, ReviewerDispatchPayload, ReviseFeedbackPayload, QueuedWorkEndedPayload, ReviewerHandle, SpawnArgs, TrackAssignedPayload, type DurableSessionResourceDisposeOptions, type WorkspaceDisposeOptions } from './types';
|
|
9
9
|
import { type TeamExecution } from './team-execution-flag';
|
|
10
10
|
import { type SnapshotBundlesView, type SnapshotMergeGateResult } from './snapshot-merge';
|
|
11
11
|
import { type WorkspaceRootAuthority } from './workspace-authority';
|
|
@@ -113,6 +113,8 @@ export type SubstrateEngager = (input: {
|
|
|
113
113
|
*/
|
|
114
114
|
requireConfined?: boolean;
|
|
115
115
|
webBrowsingActive?: boolean;
|
|
116
|
+
/** F-P46a-4 — the spawn's process-tree id, folded into the sandbox environment. */
|
|
117
|
+
processTreeId?: string;
|
|
116
118
|
}) => Promise<SubstrateEngageResult>;
|
|
117
119
|
/** Backend lease is 15 minutes; three renewal opportunities fit inside it. */
|
|
118
120
|
export declare const TEAM_TRACK_HEARTBEAT_INTERVAL_MS: number;
|
|
@@ -282,6 +284,8 @@ export interface LocalExecutorImplDeps {
|
|
|
282
284
|
spawnReviewers?: (payload: ReviewerDispatchPayload) => Promise<void>;
|
|
283
285
|
/** §3.C.23 — re-run the implementor for round N+1 on a REVISE_FEEDBACK packet. */
|
|
284
286
|
runReviseRound?: (payload: ReviseFeedbackPayload) => Promise<void>;
|
|
287
|
+
/** P46b §3.6 — a never-started single task's slot ended (QUEUED_WORK_ENDED). */
|
|
288
|
+
queuedWorkEnded?: (payload: QueuedWorkEndedPayload) => Promise<void>;
|
|
285
289
|
/**
|
|
286
290
|
* CP-1.f execute-first (D5 / #PR-1 / #PR-3) — promote the task's SHADOW onto
|
|
287
291
|
* the real tree on the `TaskAuthorized` Class-B edge. Wired straight through
|
|
@@ -349,6 +353,16 @@ export interface LocalExecutorImplDeps {
|
|
|
349
353
|
} | undefined;
|
|
350
354
|
/** P36 / R2-F2: Callback for aggregate team merge desktop audit summary. */
|
|
351
355
|
onTeamMergeAuditSummary?: (summary: any) => void;
|
|
356
|
+
/**
|
|
357
|
+
* P46b §3.10 — a team's reviewed change could not be applied (paths changed
|
|
358
|
+
* since review, or failed to write) and the user tree was left unchanged.
|
|
359
|
+
* The shell opens the apply-conflict menu and the phone retry prompt.
|
|
360
|
+
*/
|
|
361
|
+
onTeamApplyConflict?: (info: {
|
|
362
|
+
taskGroupId: string;
|
|
363
|
+
conflicts: readonly string[];
|
|
364
|
+
writeErrors: readonly string[];
|
|
365
|
+
}) => void;
|
|
352
366
|
/**
|
|
353
367
|
* Legacy-named TEST SEAM around the merge-gate body. Production defaults to
|
|
354
368
|
* the reviewed-bundle filesystem snapshot implementation.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { spawn as nodeSpawn, type ChildProcess } from 'node:child_process';
|
|
2
2
|
import { type ProcessIdentity } from './process-identity';
|
|
3
3
|
import { type WorkspaceRootAuthority } from './workspace-authority';
|
|
4
|
+
import type { HostDescendantReap } from './descendant-reaper';
|
|
4
5
|
export type ProcessTreeOwnership = 'none' | 'posix-host' | 'posix-group' | 'windows-job';
|
|
5
6
|
/**
|
|
6
7
|
* Spawn through an original-handle POSIX host. The host owns the target's
|
|
@@ -15,6 +16,11 @@ export declare function spawnPosixOwnedProcess(command: string, args: readonly s
|
|
|
15
16
|
workingDirAuthority?: WorkspaceRootAuthority;
|
|
16
17
|
/** Additional exact directories authenticated at final target spawn. */
|
|
17
18
|
launchPathAuthorities?: readonly WorkspaceRootAuthority[];
|
|
19
|
+
/**
|
|
20
|
+
* P46b ID-31 — the descendant sweep this host runs if the desktop dies
|
|
21
|
+
* before the target (the desktop's own reaper cannot run then).
|
|
22
|
+
*/
|
|
23
|
+
descendantReap?: HostDescendantReap;
|
|
18
24
|
/** @internal deterministic directory-durability failure seam. */
|
|
19
25
|
syncOwnerDirectory?: (dir: string, file: string) => Promise<void>;
|
|
20
26
|
}): ChildProcess;
|
|
@@ -91,6 +91,16 @@ export interface RunSnapshotMergeGateArgs {
|
|
|
91
91
|
runGate?: (gateKind: VerificationGateKind, cwd: string, timeoutMs: number, signal?: AbortSignal, workingDirAuthority?: WorkspaceRootAuthority) => Promise<GateRunResult | null>;
|
|
92
92
|
/** @internal swap/race seam immediately before a durable-journal filesystem proof. */
|
|
93
93
|
beforeJournalFileRead?: (path: string) => Promise<void> | void;
|
|
94
|
+
/**
|
|
95
|
+
* P46b §3.10 — the reviewed team change could not be applied to the user tree
|
|
96
|
+
* (paths changed since review, or failed to write) and nothing was left
|
|
97
|
+
* applied. Paths are workspace-relative. Never called for an unresolved
|
|
98
|
+
* promote (its authority is retained for reconciliation).
|
|
99
|
+
*/
|
|
100
|
+
onPromotionConflict?: (info: {
|
|
101
|
+
conflicts: readonly string[];
|
|
102
|
+
writeErrors: readonly string[];
|
|
103
|
+
}) => void;
|
|
94
104
|
}
|
|
95
105
|
/**
|
|
96
106
|
* `UNRESOLVED` is deliberately not a wire-level MergeResult. It means durable
|
|
@@ -14,7 +14,7 @@ import { ImplementorHandle, ProbeHandle, ProcessRole, ReviewerHandle, SpawnArgs,
|
|
|
14
14
|
* the role is always `'implementor'` for the substrate path, but taken as a
|
|
15
15
|
* parameter so the marker value is explicit + testable.
|
|
16
16
|
*/
|
|
17
|
-
export declare function buildSubstrateImplementorEnv(role: ProcessRole, sanitizedBase: Readonly<Record<string, string
|
|
17
|
+
export declare function buildSubstrateImplementorEnv(role: ProcessRole, sanitizedBase: Readonly<Record<string, string>>, processTreeId?: string): Record<string, string>;
|
|
18
18
|
export declare function spawnImplementor(scope: AuthorityScope, args: SpawnArgs): Promise<ImplementorHandle>;
|
|
19
19
|
/**
|
|
20
20
|
* CP-7 §8 (Stage-1-resolved) — LOW-LEVEL legacy reviewer spawn primitive.
|
|
@@ -19,6 +19,8 @@ export interface SpawnArgs {
|
|
|
19
19
|
signal?: AbortSignal;
|
|
20
20
|
taskId?: string;
|
|
21
21
|
webTurnActive?: boolean;
|
|
22
|
+
processTreeId?: string;
|
|
23
|
+
taskPrivateWorkingDir?: boolean;
|
|
22
24
|
lifecycleAudit?: 'active_task' | 'none';
|
|
23
25
|
onProcessSpawned?: ProcessSpawnedHook;
|
|
24
26
|
onProcessExited?: ProcessExitedHook;
|
|
@@ -300,6 +302,16 @@ export interface ReviseFeedbackPayload {
|
|
|
300
302
|
/** DETERMINISTIC dedup key keyed `(parentGateId, nextGateId, nextRound)` — the double-spawn guard. */
|
|
301
303
|
reviseFeedbackId: string;
|
|
302
304
|
}
|
|
305
|
+
/**
|
|
306
|
+
* P46b §3.6 — `QUEUED_WORK_ENDED` Class B payload (engine → desktop). Sent once
|
|
307
|
+
* when the engine ends the slot of a single task that never started and halted
|
|
308
|
+
* it. Ids and a closed reason only. Pinned to
|
|
309
|
+
* `class_b_envelope.rs::QueuedWorkEndedPayload`.
|
|
310
|
+
*/
|
|
311
|
+
export interface QueuedWorkEndedPayload {
|
|
312
|
+
taskId: string;
|
|
313
|
+
reason: 'queued_task_expired' | 'tier_changed' | 'user_cancelled_queued_task';
|
|
314
|
+
}
|
|
303
315
|
export type ClassBInbound = {
|
|
304
316
|
kind: 'PlannerDecisionApproved';
|
|
305
317
|
signedEnvelope: SignedEnvelope;
|
|
@@ -340,6 +352,10 @@ export type ClassBInbound = {
|
|
|
340
352
|
kind: 'ReviseFeedback';
|
|
341
353
|
signedEnvelope: SignedEnvelope;
|
|
342
354
|
payload: unknown;
|
|
355
|
+
} | {
|
|
356
|
+
kind: 'QueuedWorkEnded';
|
|
357
|
+
signedEnvelope: SignedEnvelope;
|
|
358
|
+
payload: unknown;
|
|
343
359
|
};
|
|
344
360
|
export type ExecutorError = {
|
|
345
361
|
kind: 'AuthorityRefusal';
|