@smartergpt/lexrunner 1.2.1 → 1.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/dist/cli.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { z } from 'zod';
3
+ import { AXErrorException } from '@smartergpt/lex/errors';
3
4
  import { F as FrameOutcome, a as FrameEmitResult } from './types-CYMIAhy8.js';
4
- export { m as mcpToolError } from './adapters-DciX_uRh.js';
5
+ export { m as mcpToolError } from './adapters-r7_TjMwo.js';
5
6
  import { Octokit } from '@octokit/rest';
6
- import '@smartergpt/lex/errors';
7
7
 
8
8
  /**
9
9
  * Gate execution result
@@ -221,6 +221,56 @@ declare const Plan: z.ZodObject<{
221
221
  }, z.core.$strict>>>;
222
222
  }, z.core.$strict>;
223
223
  type Plan = z.infer<typeof Plan>;
224
+ /**
225
+ * Machine-readable validation error
226
+ */
227
+ interface ValidationError {
228
+ path: string;
229
+ message: string;
230
+ code: string;
231
+ }
232
+ interface PlanValidationFailure {
233
+ contract: "bounded-ax-v1";
234
+ valid: false;
235
+ code: string;
236
+ message: string;
237
+ errorCount: number;
238
+ errors: ValidationError[];
239
+ errorsTruncated: boolean;
240
+ nextActions: string[];
241
+ context: {
242
+ errorCount: number;
243
+ errorsTruncated: boolean;
244
+ };
245
+ }
246
+ /**
247
+ * Schema validation error - thrown when Zod validation fails
248
+ * Now extends AXErrorException to provide structured error with nextActions
249
+ */
250
+ declare class SchemaValidationError extends AXErrorException {
251
+ readonly issues: z.ZodIssue[];
252
+ readonly errors: ValidationError[];
253
+ readonly errorCount: number;
254
+ readonly errorsTruncated: boolean;
255
+ constructor(issues: z.ZodIssue[]);
256
+ /**
257
+ * Get legacy machine-readable error format for backward compatibility
258
+ */
259
+ toLegacyJSON(): {
260
+ valid: false;
261
+ errors: ValidationError[];
262
+ };
263
+ }
264
+ /**
265
+ * Return the stable, bounded validation envelope used by CLI and MCP surfaces.
266
+ *
267
+ * Raw Zod issues are intentionally not returned because they can contain the
268
+ * rejected input. The normalized error list retains only path, message, and
269
+ * code, with deterministic count and byte limits.
270
+ */
271
+ declare function formatPlanValidationFailure(error: SchemaValidationError): PlanValidationFailure;
272
+ declare function asPlanValidationFailure(error: unknown): PlanValidationFailure | undefined;
273
+ declare function formatPlanValidationFailureText(failure: PlanValidationFailure): string;
224
274
  /**
225
275
  * Load and validate a plan.json file
226
276
  */
@@ -578,6 +628,10 @@ declare function executeGatesWithPolicy(plan: Plan, executionState: ExecutionSta
578
628
  runId?: string;
579
629
  baseDir?: string;
580
630
  turnCostTracker?: MergeWeaveTurnCost;
631
+ onlyItem?: string;
632
+ onlyGate?: string;
633
+ emitReceipt?: boolean;
634
+ suppressStdout?: boolean;
581
635
  }): Promise<void>;
582
636
 
583
637
  /**
@@ -1986,15 +2040,15 @@ declare const AttemptStatus: z.ZodEnum<{
1986
2040
  failed: "failed";
1987
2041
  cancelled: "cancelled";
1988
2042
  prepared: "prepared";
2043
+ rejected: "rejected";
2044
+ quarantined: "quarantined";
1989
2045
  leased: "leased";
1990
2046
  launching: "launching";
1991
2047
  running: "running";
1992
2048
  receipt_submitted: "receipt_submitted";
1993
2049
  accepted: "accepted";
1994
- rejected: "rejected";
1995
2050
  inconclusive: "inconclusive";
1996
2051
  launch_failed: "launch_failed";
1997
- quarantined: "quarantined";
1998
2052
  }>;
1999
2053
  type AttemptStatus = z.infer<typeof AttemptStatus>;
2000
2054
  declare function attemptStatusRequiresReceipt(status: AttemptStatus): boolean;
@@ -2022,15 +2076,15 @@ declare const Attempt_v1: z.ZodObject<{
2022
2076
  failed: "failed";
2023
2077
  cancelled: "cancelled";
2024
2078
  prepared: "prepared";
2079
+ rejected: "rejected";
2080
+ quarantined: "quarantined";
2025
2081
  leased: "leased";
2026
2082
  launching: "launching";
2027
2083
  running: "running";
2028
2084
  receipt_submitted: "receipt_submitted";
2029
2085
  accepted: "accepted";
2030
- rejected: "rejected";
2031
2086
  inconclusive: "inconclusive";
2032
2087
  launch_failed: "launch_failed";
2033
- quarantined: "quarantined";
2034
2088
  }>;
2035
2089
  created_at: z.ZodString;
2036
2090
  updated_at: z.ZodString;
@@ -2244,15 +2298,15 @@ declare const AgentWorkFanInDecision_v1: z.ZodPipe<z.ZodObject<{
2244
2298
  failed: "failed";
2245
2299
  cancelled: "cancelled";
2246
2300
  prepared: "prepared";
2301
+ rejected: "rejected";
2302
+ quarantined: "quarantined";
2247
2303
  leased: "leased";
2248
2304
  launching: "launching";
2249
2305
  running: "running";
2250
2306
  receipt_submitted: "receipt_submitted";
2251
2307
  accepted: "accepted";
2252
- rejected: "rejected";
2253
2308
  inconclusive: "inconclusive";
2254
2309
  launch_failed: "launch_failed";
2255
- quarantined: "quarantined";
2256
2310
  }>;
2257
2311
  receipt_id: z.ZodOptional<z.ZodString>;
2258
2312
  receipt_hash: z.ZodOptional<z.ZodString>;
@@ -2287,7 +2341,7 @@ declare const AgentWorkFanInDecision_v1: z.ZodPipe<z.ZodObject<{
2287
2341
  candidates: {
2288
2342
  attempt_id: string;
2289
2343
  premise_id: string;
2290
- attempt_status: "blocked" | "verifying" | "verified" | "failed" | "cancelled" | "prepared" | "leased" | "launching" | "running" | "receipt_submitted" | "accepted" | "rejected" | "inconclusive" | "launch_failed" | "quarantined";
2344
+ attempt_status: "blocked" | "verifying" | "verified" | "failed" | "cancelled" | "prepared" | "rejected" | "quarantined" | "leased" | "launching" | "running" | "receipt_submitted" | "accepted" | "inconclusive" | "launch_failed";
2291
2345
  trust_gap_count: number;
2292
2346
  conclusion: "rejected" | "selected" | "equivalent" | "unselected" | "missing_evidence";
2293
2347
  reason_codes: string[];
@@ -2330,7 +2384,7 @@ declare const AgentWorkFanInDecision_v1: z.ZodPipe<z.ZodObject<{
2330
2384
  candidates: {
2331
2385
  attempt_id: string;
2332
2386
  premise_id: string;
2333
- attempt_status: "blocked" | "verifying" | "verified" | "failed" | "cancelled" | "prepared" | "leased" | "launching" | "running" | "receipt_submitted" | "accepted" | "rejected" | "inconclusive" | "launch_failed" | "quarantined";
2387
+ attempt_status: "blocked" | "verifying" | "verified" | "failed" | "cancelled" | "prepared" | "rejected" | "quarantined" | "leased" | "launching" | "running" | "receipt_submitted" | "accepted" | "inconclusive" | "launch_failed";
2334
2388
  trust_gap_count: number;
2335
2389
  conclusion: "rejected" | "selected" | "equivalent" | "unselected" | "missing_evidence";
2336
2390
  reason_codes: string[];
@@ -2578,12 +2632,97 @@ declare const ExecutionEnvelope_v1: z.ZodObject<{
2578
2632
  paths: z.ZodObject<{
2579
2633
  project_root: z.ZodString;
2580
2634
  execution_root: z.ZodString;
2635
+ allocation_root: z.ZodOptional<z.ZodString>;
2581
2636
  worktree_root: z.ZodString;
2582
2637
  }, z.core.$strict>;
2583
- path_mappings: z.ZodArray<z.ZodObject<{
2584
- runtime: z.ZodString;
2585
- worktree_root: z.ZodString;
2586
- }, z.core.$strict>>;
2638
+ path_mappings: z.ZodArray<z.ZodUnion<readonly [z.ZodPreprocess<z.ZodObject<{
2639
+ mapping_digest: z.ZodString;
2640
+ schema_version: z.ZodLiteral<"1.0.0">;
2641
+ projection_id: z.ZodString;
2642
+ repository_id: z.ZodString;
2643
+ base_sha: z.ZodString;
2644
+ native_host_id: z.ZodString;
2645
+ request_digest: z.ZodString;
2646
+ projection_digest: z.ZodString;
2647
+ projection_mapping_digest: z.ZodString;
2648
+ roots: z.ZodPreprocess<z.ZodObject<{
2649
+ windows_source: z.ZodPreprocess<z.ZodObject<{
2650
+ runtime_id: z.ZodString;
2651
+ path: z.ZodString;
2652
+ verification: z.ZodLiteral<"declared">;
2653
+ }, z.core.$strip>>;
2654
+ wsl_source: z.ZodPreprocess<z.ZodObject<{
2655
+ runtime_id: z.ZodString;
2656
+ path: z.ZodString;
2657
+ verification: z.ZodLiteral<"git_observed">;
2658
+ observation_digest: z.ZodString;
2659
+ }, z.core.$strip>>;
2660
+ native_repository: z.ZodPreprocess<z.ZodObject<{
2661
+ runtime_id: z.ZodString;
2662
+ path: z.ZodString;
2663
+ verification: z.ZodLiteral<"directory_identity">;
2664
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
2665
+ device: z.ZodString;
2666
+ inode: z.ZodString;
2667
+ }, z.core.$strip>>;
2668
+ }, z.core.$strip>>;
2669
+ native_allocation_root: z.ZodPreprocess<z.ZodObject<{
2670
+ runtime_id: z.ZodString;
2671
+ path: z.ZodString;
2672
+ verification: z.ZodLiteral<"directory_identity">;
2673
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
2674
+ device: z.ZodString;
2675
+ inode: z.ZodString;
2676
+ }, z.core.$strip>>;
2677
+ }, z.core.$strip>>;
2678
+ native_worktree: z.ZodPreprocess<z.ZodObject<{
2679
+ runtime_id: z.ZodString;
2680
+ path: z.ZodString;
2681
+ verification: z.ZodLiteral<"directory_identity">;
2682
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
2683
+ device: z.ZodString;
2684
+ inode: z.ZodString;
2685
+ }, z.core.$strip>>;
2686
+ }, z.core.$strip>>;
2687
+ }, z.core.$strip>>;
2688
+ }, z.core.$strip>>, z.ZodPreprocess<z.ZodObject<{
2689
+ mapping_digest: z.ZodString;
2690
+ schema_version: z.ZodLiteral<"1.0.0">;
2691
+ mapping_kind: z.ZodLiteral<"native_linux">;
2692
+ repository_id: z.ZodString;
2693
+ base_sha: z.ZodString;
2694
+ native_host_id: z.ZodString;
2695
+ git_runtime: z.ZodString;
2696
+ roots: z.ZodPreprocess<z.ZodObject<{
2697
+ native_repository: z.ZodPreprocess<z.ZodObject<{
2698
+ runtime_id: z.ZodString;
2699
+ path: z.ZodString;
2700
+ verification: z.ZodLiteral<"directory_identity">;
2701
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
2702
+ device: z.ZodString;
2703
+ inode: z.ZodString;
2704
+ }, z.core.$strip>>;
2705
+ }, z.core.$strip>>;
2706
+ native_allocation_root: z.ZodPreprocess<z.ZodObject<{
2707
+ runtime_id: z.ZodString;
2708
+ path: z.ZodString;
2709
+ verification: z.ZodLiteral<"directory_identity">;
2710
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
2711
+ device: z.ZodString;
2712
+ inode: z.ZodString;
2713
+ }, z.core.$strip>>;
2714
+ }, z.core.$strip>>;
2715
+ native_worktree: z.ZodPreprocess<z.ZodObject<{
2716
+ runtime_id: z.ZodString;
2717
+ path: z.ZodString;
2718
+ verification: z.ZodLiteral<"directory_identity">;
2719
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
2720
+ device: z.ZodString;
2721
+ inode: z.ZodString;
2722
+ }, z.core.$strip>>;
2723
+ }, z.core.$strip>>;
2724
+ }, z.core.$strip>>;
2725
+ }, z.core.$strip>>]>>;
2587
2726
  exposed_environment_keys: z.ZodArray<z.ZodString>;
2588
2727
  created_at: z.ZodString;
2589
2728
  }, z.core.$strict>;
@@ -2615,8 +2754,8 @@ type ControllerLease_v1 = z.infer<typeof ControllerLease_v1>;
2615
2754
  declare const WorkspaceLeaseStatus: z.ZodEnum<{
2616
2755
  verifying: "verifying";
2617
2756
  active: "active";
2618
- receipt_submitted: "receipt_submitted";
2619
2757
  quarantined: "quarantined";
2758
+ receipt_submitted: "receipt_submitted";
2620
2759
  released: "released";
2621
2760
  expired: "expired";
2622
2761
  reserved: "reserved";
@@ -2670,8 +2809,8 @@ declare const WorkspaceLease_v1: z.ZodObject<{
2670
2809
  status: z.ZodEnum<{
2671
2810
  verifying: "verifying";
2672
2811
  active: "active";
2673
- receipt_submitted: "receipt_submitted";
2674
2812
  quarantined: "quarantined";
2813
+ receipt_submitted: "receipt_submitted";
2675
2814
  released: "released";
2676
2815
  expired: "expired";
2677
2816
  reserved: "reserved";
@@ -3543,6 +3682,18 @@ declare const WorkspaceObservation: z.ZodObject<{
3543
3682
  reason: z.ZodOptional<z.ZodString>;
3544
3683
  }, z.core.$strict>;
3545
3684
  type WorkspaceObservation = z.infer<typeof WorkspaceObservation>;
3685
+ declare const HeartbeatWorkerSessionStatus: z.ZodEnum<{
3686
+ awaiting_human: "awaiting_human";
3687
+ running: "running";
3688
+ }>;
3689
+ type HeartbeatWorkerSessionStatus = z.infer<typeof HeartbeatWorkerSessionStatus>;
3690
+ declare const EndWorkerSessionStatus: z.ZodEnum<{
3691
+ completed: "completed";
3692
+ failed: "failed";
3693
+ cancelled: "cancelled";
3694
+ lost: "lost";
3695
+ }>;
3696
+ type EndWorkerSessionStatus = z.infer<typeof EndWorkerSessionStatus>;
3546
3697
 
3547
3698
  /** Durable attempt state. Attempts exist before a workspace is allocated. */
3548
3699
  interface AttemptRecord {
@@ -3694,6 +3845,22 @@ interface WorkerAdapterBindingRecord {
3694
3845
  trustGapDimensions: string[];
3695
3846
  createdAt: string;
3696
3847
  }
3848
+ /** Immutable canonical envelope authorized for one launching Attempt. */
3849
+ interface LaunchEnvelopeBindingRecord {
3850
+ runId: string;
3851
+ attemptId: string;
3852
+ workspaceLeaseId: string;
3853
+ attemptRevision: number;
3854
+ workspaceLeaseRevision: number;
3855
+ authorizationMutationId: string;
3856
+ envelopeId: string;
3857
+ envelopeHash: string;
3858
+ envelopeJson: string;
3859
+ controllerId: string;
3860
+ controllerLeaseId: string;
3861
+ fencingToken: number;
3862
+ createdAt: string;
3863
+ }
3697
3864
  interface WorkerSessionEvent {
3698
3865
  runId: string;
3699
3866
  attemptId: string;
@@ -3717,6 +3884,74 @@ interface AuthenticatedMutationInput {
3717
3884
  mutationId: string;
3718
3885
  now: string;
3719
3886
  }
3887
+ interface AuthenticatedWorkerMutationInput extends AuthenticatedMutationInput {
3888
+ attemptId: string;
3889
+ workspaceLeaseId: string;
3890
+ expectedAttemptRevision: number;
3891
+ expectedWorkspaceLeaseRevision: number;
3892
+ }
3893
+ interface AttachWorkerSessionInput extends AuthenticatedWorkerMutationInput {
3894
+ sessionId: string;
3895
+ packetId: string;
3896
+ packetHash: string;
3897
+ executionEnvelopeId: string;
3898
+ executionEnvelopeHash: string;
3899
+ hostId: string;
3900
+ workerRuntime: string;
3901
+ gitRuntime: string;
3902
+ backend: WorkerSessionBackend;
3903
+ workerId: string;
3904
+ model?: string;
3905
+ startedAt: string;
3906
+ adapter?: {
3907
+ adapterId: string;
3908
+ adapterVersion: string;
3909
+ enforcementSummaryHash: string;
3910
+ trustGapDimensions: string[];
3911
+ };
3912
+ }
3913
+ interface BindLaunchEnvelopeInput {
3914
+ runId: string;
3915
+ attemptId: string;
3916
+ workspaceLeaseId: string;
3917
+ expectedRunRevision: number;
3918
+ expectedAttemptRevision: number;
3919
+ expectedWorkspaceLeaseRevision: number;
3920
+ controller: ControllerLeaseCredential;
3921
+ authorizationMutationId: string;
3922
+ envelopeId: string;
3923
+ envelopeHash: string;
3924
+ envelopeJson: string;
3925
+ /**
3926
+ * Required for every new launch-envelope binding. It remains optional in
3927
+ * the input type solely so callers can exactly replay an already-persisted
3928
+ * legacy envelope-only binding during compatibility migration; it must not
3929
+ * be omitted when creating a binding.
3930
+ */
3931
+ packetJson?: string;
3932
+ createdAt: string;
3933
+ }
3934
+ /**
3935
+ * Fenced fail-closed recovery for an Attempt stranded after launch authorization but before its
3936
+ * immutable envelope and packet were durably bound. No envelope evidence is accepted here.
3937
+ */
3938
+ interface ReconcileIncompleteLaunchInput extends AuthenticatedMutationInput {
3939
+ attemptId: string;
3940
+ workspaceLeaseId: string;
3941
+ expectedAttemptRevision: number;
3942
+ expectedWorkspaceLeaseRevision: number;
3943
+ }
3944
+ type LaunchEnvelopeBindingResult = {
3945
+ bound: true;
3946
+ binding: LaunchEnvelopeBindingRecord;
3947
+ idempotentReplay: boolean;
3948
+ } | {
3949
+ bound: false;
3950
+ reason: WorkspaceMutationFailureReason;
3951
+ currentAttemptRevision?: number;
3952
+ currentWorkspaceLeaseRevision?: number;
3953
+ currentRunRevision?: number;
3954
+ };
3720
3955
  interface AttemptReceiptRecord {
3721
3956
  receiptId: string;
3722
3957
  receiptHash: string;
@@ -3923,6 +4158,19 @@ type AttemptVerificationSubmissionResult = {
3923
4158
  currentSessionRevision?: number;
3924
4159
  currentRunRevision?: number;
3925
4160
  };
4161
+ interface HeartbeatWorkerSessionInput extends AuthenticatedWorkerMutationInput {
4162
+ sessionId: string;
4163
+ expectedSessionRevision: number;
4164
+ status?: HeartbeatWorkerSessionStatus;
4165
+ }
4166
+ interface EndWorkerSessionInput extends AuthenticatedWorkerMutationInput {
4167
+ sessionId: string;
4168
+ expectedSessionRevision: number;
4169
+ status: EndWorkerSessionStatus;
4170
+ exitReason?: string;
4171
+ exitCode?: number;
4172
+ exitSummary?: string;
4173
+ }
3926
4174
  type WorkerSessionMutationResult = {
3927
4175
  updated: true;
3928
4176
  attempt: AttemptRecord;
@@ -4058,6 +4306,22 @@ interface AgentWorkFanoutStore {
4058
4306
  getFanInDecision(decisionId: string): Promise<FanInDecisionRecord | null>;
4059
4307
  getFanInDecisionForFanout(fanoutId: string): Promise<FanInDecisionRecord | null>;
4060
4308
  }
4309
+ /** Additive binding port for Stage 3 launch envelopes. */
4310
+ interface LaunchEnvelopeBindingStore {
4311
+ bindLaunchEnvelope(input: BindLaunchEnvelopeInput): Promise<LaunchEnvelopeBindingResult>;
4312
+ reconcileIncompleteLaunch(input: ReconcileIncompleteLaunchInput): Promise<WorkspaceMutationResult>;
4313
+ getLaunchEnvelopeBinding(attemptId: string): Promise<LaunchEnvelopeBindingRecord | null>;
4314
+ }
4315
+ /** Additive Stage 3 persistence port; kept separate from the Stage 1 workspace contract. */
4316
+ interface WorkerSessionStore {
4317
+ attachWorkerSession(input: AttachWorkerSessionInput): Promise<WorkerSessionMutationResult>;
4318
+ heartbeatWorkerSession(input: HeartbeatWorkerSessionInput): Promise<WorkerSessionMutationResult>;
4319
+ endWorkerSession(input: EndWorkerSessionInput): Promise<WorkerSessionMutationResult>;
4320
+ getWorkerSession(sessionId: string): Promise<WorkerSessionRecord | null>;
4321
+ getWorkerSessionForAttempt(attemptId: string): Promise<WorkerSessionRecord | null>;
4322
+ getWorkerAdapterBinding(sessionId: string): Promise<WorkerAdapterBindingRecord | null>;
4323
+ listWorkerSessionEvents(runId: string): Promise<WorkerSessionEvent[]>;
4324
+ }
4061
4325
  /** Additive immutable AgentTaskReceipt v2 persistence port. */
4062
4326
  interface AttemptReceiptStore {
4063
4327
  submitAttemptReceipt(input: SubmitAttemptReceiptInput): Promise<AttemptReceiptSubmissionResult>;
@@ -4078,6 +4342,63 @@ interface AttemptVerificationStore {
4078
4342
  listAttemptVerificationEvents(runId: string): Promise<AttemptVerificationEvent[]>;
4079
4343
  }
4080
4344
 
4345
+ interface WorktreeTarget extends WorkspaceIdentity {
4346
+ /** Immutable full Git object ID used to create this Attempt workspace. */
4347
+ baseSha: string;
4348
+ }
4349
+ interface BrokerOperationOptions {
4350
+ timeoutMs?: number;
4351
+ signal?: AbortSignal;
4352
+ }
4353
+ type BrokerOperation = "create" | "observe" | "remove";
4354
+ interface BrokerCommandEvidence {
4355
+ executable: string;
4356
+ args: string[];
4357
+ cwd: string;
4358
+ exitCode: number | null;
4359
+ stdoutTail: string;
4360
+ stderrTail: string;
4361
+ }
4362
+ type BrokerFailureReason = "invalid_base_sha" | "invalid_branch" | "invalid_path" | "runtime_mismatch" | "path_conflict" | "branch_conflict" | "containment_violation" | "identity_mismatch" | "dirty_workspace" | "command_failed" | "timeout" | "aborted";
4363
+ interface BrokerFailure {
4364
+ ok: false;
4365
+ operation: BrokerOperation;
4366
+ reason: BrokerFailureReason;
4367
+ message: string;
4368
+ command?: BrokerCommandEvidence;
4369
+ observation?: WorkspaceObservation;
4370
+ }
4371
+ interface CreateWorktreeSuccess {
4372
+ ok: true;
4373
+ outcome: "created" | "reused";
4374
+ observation: WorkspaceObservation;
4375
+ }
4376
+ type CreateWorktreeResult = CreateWorktreeSuccess | BrokerFailure;
4377
+ interface ObserveWorktreeSuccess {
4378
+ ok: true;
4379
+ outcome: "observed";
4380
+ observation: WorkspaceObservation;
4381
+ }
4382
+ type ObserveWorktreeResult = ObserveWorktreeSuccess | BrokerFailure;
4383
+ type WorktreePreservationReason = "dirty" | "missing" | "unregistered" | "wrong_repository" | "wrong_branch" | "identity_ambiguous";
4384
+ interface RemoveWorktreeSuccess {
4385
+ ok: true;
4386
+ outcome: "removed" | "preserved";
4387
+ preservationReason?: WorktreePreservationReason;
4388
+ observation: WorkspaceObservation;
4389
+ }
4390
+ type RemoveWorktreeResult = RemoveWorktreeSuccess | BrokerFailure;
4391
+ /**
4392
+ * Git side-effect port. Durable ownership and fencing remain the
4393
+ * WorkspaceLifecycleStore's responsibility; the broker only observes and
4394
+ * mutates the declared runtime's Git worktree registry.
4395
+ */
4396
+ interface GitWorktreeBroker {
4397
+ create(target: WorktreeTarget, options?: BrokerOperationOptions): Promise<CreateWorktreeResult>;
4398
+ observe(target: WorktreeTarget, options?: BrokerOperationOptions): Promise<ObserveWorktreeResult>;
4399
+ remove(target: WorktreeTarget, options?: BrokerOperationOptions): Promise<RemoveWorktreeResult>;
4400
+ }
4401
+
4081
4402
  type LifecyclePhase = "controller" | "attempt_create" | "workspace_allocate" | "workspace_resume" | "launch_authorize";
4082
4403
  type LifecycleFailureReason = "controller_held" | "store_rejected" | "workspace_rejected" | "identity_mismatch" | "inactive_workspace" | "stale_authority" | "expired_workspace" | "reconciliation_required";
4083
4404
  interface AgentWorkLifecycleSuccess {
@@ -4156,121 +4477,1402 @@ interface BoundedLaunchStatus {
4156
4477
  reconciliationRequired: boolean;
4157
4478
  }
4158
4479
 
4159
- interface WorkerSessionStatusResult {
4160
- workerSession: WorkerSessionRecord | null;
4161
- adapter: BoundedWorkerAdapterStatus | null;
4162
- }
4163
- interface BoundedWorkerAdapterStatus extends WorkerAdapterBindingRecord {
4164
- enforcement: "enforced" | "trust_gap";
4165
- }
4166
-
4167
- interface AttemptLaunchBundleSuccess {
4168
- ok: true;
4169
- outcome: "launch_bundle_ready";
4170
- lifecycle: AgentWorkLifecycleSuccess;
4171
- packet: AgentTaskPacket_v1;
4172
- envelope: ExecutionEnvelope_v1;
4480
+ type DirectoryIdentityBoundarySupport = {
4481
+ readonly supported: true;
4482
+ readonly platform: NodeJS.Platform;
4483
+ readonly pathComparison: "case-sensitive";
4484
+ readonly reasonCode: "native_linux_ready";
4485
+ } | {
4486
+ readonly supported: false;
4487
+ readonly platform: NodeJS.Platform;
4488
+ readonly pathComparison: "case-sensitive" | "case-insensitive";
4489
+ readonly reasonCode: "windows_requires_native_wsl_broker" | "macos_unsupported" | "unsupported_platform" | "case_insensitive_runtime" | "procfs_unavailable";
4490
+ };
4491
+ interface DirectoryIdentityPathProbe {
4492
+ readonly verified: boolean;
4493
+ readonly filesystem: "native_linux" | "wsl_drvfs_9p" | "unknown";
4494
+ readonly reasonCode: "directory_verified" | "wsl_drvfs_9p" | "invalid_native_path" | "path_unavailable" | "filesystem_unverified";
4173
4495
  }
4174
- type AttemptLaunchBundleResult = AttemptLaunchBundleSuccess | AgentWorkLifecycleFailure;
4175
4496
 
4176
- declare const AttemptStartRequestJsonSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
4497
+ declare const AgentWorkContainmentPreflightRequestSchema: z.ZodObject<{
4177
4498
  runtime: z.ZodObject<{
4178
- databasePath: z.ZodString;
4179
4499
  repositoryId: z.ZodString;
4180
4500
  repositoryRoot: z.ZodString;
4181
4501
  worktreeRoot: z.ZodString;
4182
- hostId: z.ZodString;
4183
4502
  gitRuntime: z.ZodString;
4184
4503
  pathComparison: z.ZodEnum<{
4185
4504
  "case-sensitive": "case-sensitive";
4186
4505
  "case-insensitive": "case-insensitive";
4187
4506
  }>;
4188
- gitExecutable: z.ZodOptional<z.ZodString>;
4189
- timeoutMs: z.ZodOptional<z.ZodNumber>;
4190
- maxDirtyPaths: z.ZodOptional<z.ZodNumber>;
4191
4507
  }, z.core.$strict>;
4192
- attempt: z.ZodObject<{
4193
- runId: z.ZodString;
4194
- initialRunState: z.ZodObject<{
4195
- runId: z.ZodString;
4196
- mode: z.ZodString;
4197
- procedure: z.ZodString;
4198
- repo: z.ZodString;
4199
- task: z.ZodOptional<z.ZodString>;
4200
- state: z.ZodString;
4201
- createdAt: z.ZodString;
4202
- updatedAt: z.ZodString;
4203
- completedAt: z.ZodOptional<z.ZodString>;
4204
- completedSteps: z.ZodArray<z.ZodString>;
4205
- currentStep: z.ZodNullable<z.ZodString>;
4206
- params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
4207
- metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
4208
- persona: z.ZodOptional<z.ZodObject<{
4209
- mode: z.ZodString;
4210
- forbidden: z.ZodArray<z.ZodString>;
4211
- completionGates: z.ZodArray<z.ZodString>;
4212
- decisionStyle: z.ZodOptional<z.ZodObject<{
4213
- preferSmallDiffs: z.ZodOptional<z.ZodBoolean>;
4214
- requireRationaleForSkips: z.ZodOptional<z.ZodBoolean>;
4215
- escalateSecurityFindings: z.ZodOptional<z.ZodBoolean>;
4216
- }, z.core.$strip>>;
4217
- outputFormat: z.ZodOptional<z.ZodObject<{
4218
- severityLevels: z.ZodOptional<z.ZodArray<z.ZodString>>;
4219
- requireSeverityOnFindings: z.ZodOptional<z.ZodBoolean>;
4220
- }, z.core.$strip>>;
4221
- }, z.core.$strip>>;
4222
- }, z.core.$strip>;
4223
- controller: z.ZodObject<{
4224
- controllerId: z.ZodString;
4225
- leaseId: z.ZodString;
4226
- now: z.ZodString;
4227
- ttlMs: z.ZodNumber;
4228
- }, z.core.$strict>;
4229
- attempt: z.ZodObject<{
4230
- attemptId: z.ZodString;
4231
- workItemId: z.ZodString;
4232
- workItemRevision: z.ZodNumber;
4233
- packetId: z.ZodString;
4234
- packetHash: z.ZodString;
4235
- baseSha: z.ZodString;
4236
- }, z.core.$strict>;
4237
- workspace: z.ZodObject<{
4238
- workspaceLeaseId: z.ZodString;
4239
- repositoryId: z.ZodString;
4240
- hostId: z.ZodString;
4241
- gitRuntime: z.ZodString;
4242
- projectRoot: z.ZodString;
4243
- branch: z.ZodString;
4244
- worktreePath: z.ZodString;
4245
- ttlMs: z.ZodNumber;
4246
- }, z.core.$strict>;
4247
- mutations: z.ZodObject<{
4248
- createAttempt: z.ZodObject<{
4249
- mutationId: z.ZodString;
4250
- now: z.ZodString;
4251
- }, z.core.$strict>;
4252
- reserveWorkspace: z.ZodObject<{
4253
- mutationId: z.ZodString;
4254
- now: z.ZodString;
4255
- }, z.core.$strict>;
4256
- activateWorkspace: z.ZodObject<{
4257
- mutationId: z.ZodString;
4258
- now: z.ZodString;
4259
- }, z.core.$strict>;
4260
- resumeWorkspace: z.ZodObject<{
4261
- mutationId: z.ZodString;
4262
- now: z.ZodString;
4263
- }, z.core.$strict>;
4264
- quarantineWorkspace: z.ZodObject<{
4265
- mutationId: z.ZodString;
4266
- now: z.ZodString;
4267
- }, z.core.$strict>;
4268
- authorizeLaunch: z.ZodObject<{
4269
- mutationId: z.ZodString;
4270
- now: z.ZodString;
4271
- }, z.core.$strict>;
4272
- }, z.core.$strict>;
4273
- broker: z.ZodOptional<z.ZodObject<{
4508
+ }, z.core.$strict>;
4509
+ declare const AgentWorkContainmentPreflightRequestJsonSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
4510
+ runtime: z.ZodObject<{
4511
+ repositoryId: z.ZodString;
4512
+ repositoryRoot: z.ZodString;
4513
+ worktreeRoot: z.ZodString;
4514
+ gitRuntime: z.ZodString;
4515
+ pathComparison: z.ZodEnum<{
4516
+ "case-sensitive": "case-sensitive";
4517
+ "case-insensitive": "case-insensitive";
4518
+ }>;
4519
+ }, z.core.$strict>;
4520
+ }, z.core.$strict>>;
4521
+ type AgentWorkContainmentPreflightRequest = z.infer<typeof AgentWorkContainmentPreflightRequestSchema>;
4522
+ type AgentWorkContainmentCapabilityState = "native_ready" | "broker_required" | "unsupported";
4523
+ type AgentWorkContainmentReasonCode = "native_linux_ready" | "windows_requires_native_wsl_broker" | "macos_unsupported" | "unsupported_platform" | "case_insensitive_runtime" | "procfs_unavailable" | "repository_root_invalid" | "worktree_root_invalid" | "path_roots_overlap" | "repository_root_wsl_drvfs_9p" | "repository_git_wsl_drvfs_9p" | "worktree_root_wsl_drvfs_9p" | "repository_root_unavailable" | "repository_git_directory_unavailable" | "worktree_root_unavailable" | "repository_root_filesystem_unverified" | "repository_git_filesystem_unverified" | "worktree_root_filesystem_unverified";
4524
+ type AgentWorkContainmentNextAction = "construct_attempt_packet" | "provision_native_wsl_projection" | "select_native_case_sensitive_linux_runtime" | "correct_declared_paths" | "rerun_containment_preflight";
4525
+ interface AgentWorkContainmentPathStatus {
4526
+ readonly inspection: "identity_verified" | "filesystem_verified" | "syntactic_only" | "unverified" | "not_checked";
4527
+ readonly filesystem: "native_linux" | "wsl_drvfs_9p" | "unknown";
4528
+ }
4529
+ interface AgentWorkContainmentPreflightResult {
4530
+ readonly schemaVersion: "1.0.0";
4531
+ readonly operation: "agent-work.containment.preflight";
4532
+ readonly bindingDigest: `sha256:${string}`;
4533
+ readonly state: AgentWorkContainmentCapabilityState;
4534
+ readonly reasonCode: AgentWorkContainmentReasonCode;
4535
+ readonly physicalContainmentAvailable: boolean;
4536
+ readonly projectionRequired: boolean;
4537
+ readonly runtime: {
4538
+ readonly platform: "linux" | "windows" | "macos" | "other";
4539
+ readonly pathComparison: "case-sensitive" | "case-insensitive";
4540
+ };
4541
+ readonly paths: {
4542
+ readonly repositoryRoot: AgentWorkContainmentPathStatus;
4543
+ readonly repositoryGitDirectory: AgentWorkContainmentPathStatus;
4544
+ readonly worktreeRoot: AgentWorkContainmentPathStatus;
4545
+ };
4546
+ readonly nextActions: readonly AgentWorkContainmentNextAction[];
4547
+ }
4548
+ interface AgentWorkContainmentPreflightInputError {
4549
+ readonly code: "invalid_input";
4550
+ readonly message: "Invalid containment preflight input";
4551
+ readonly issues: ReadonlyArray<{
4552
+ readonly path: string;
4553
+ readonly message: string;
4554
+ }>;
4555
+ }
4556
+ type AgentWorkContainmentPreflightHandlerResult = {
4557
+ readonly ok: true;
4558
+ readonly result: AgentWorkContainmentPreflightResult;
4559
+ } | {
4560
+ readonly ok: false;
4561
+ readonly error: AgentWorkContainmentPreflightInputError;
4562
+ };
4563
+ interface AgentWorkContainmentPreflightHandler {
4564
+ preflight(request: unknown): Promise<AgentWorkContainmentPreflightHandlerResult>;
4565
+ }
4566
+ interface AgentWorkContainmentCapabilityDependencies {
4567
+ runtimeProbe?: (pathComparison: "case-sensitive" | "case-insensitive") => DirectoryIdentityBoundarySupport;
4568
+ pathProbe?: (absolutePath: string, label: string) => DirectoryIdentityPathProbe;
4569
+ }
4570
+ /** Stateless, read-only capability owner shared by CLI and MCP adapters. */
4571
+ declare class AgentWorkContainmentCapabilityService {
4572
+ private readonly runtimeProbe;
4573
+ private readonly pathProbe;
4574
+ constructor(dependencies?: AgentWorkContainmentCapabilityDependencies);
4575
+ preflight(request: AgentWorkContainmentPreflightRequest): AgentWorkContainmentPreflightResult;
4576
+ }
4577
+ declare function createAgentWorkContainmentPreflightHandler(service?: AgentWorkContainmentCapabilityService): AgentWorkContainmentPreflightHandler;
4578
+
4579
+ declare const NATIVE_WSL_PROJECTION_CONTRACT_VERSION: "1.0.0";
4580
+ declare const NATIVE_WSL_PROJECTION_HASH_PROFILE: "canonical-json-domain-separated-v1";
4581
+ declare const NativeDirectoryIdentityClaim_v1: z.ZodPreprocess<z.ZodObject<{
4582
+ device: z.ZodString;
4583
+ inode: z.ZodString;
4584
+ }, z.core.$strip>>;
4585
+ type NativeDirectoryIdentityClaim_v1 = z.infer<typeof NativeDirectoryIdentityClaim_v1>;
4586
+ declare const ProjectionRequestShape: {
4587
+ readonly schema_version: z.ZodLiteral<"1.0.0">;
4588
+ readonly request_id: z.ZodString;
4589
+ readonly repository: z.ZodPreprocess<z.ZodObject<{
4590
+ id: z.ZodString;
4591
+ expected_remote_hash: z.ZodString;
4592
+ }, z.core.$strip>>;
4593
+ readonly source: z.ZodPreprocess<z.ZodObject<{
4594
+ windows_runtime: z.ZodString;
4595
+ windows_repository_path: z.ZodString;
4596
+ wsl_distribution: z.ZodString;
4597
+ wsl_git_runtime: z.ZodString;
4598
+ wsl_repository_path: z.ZodString;
4599
+ head_policy: z.ZodEnum<{
4600
+ observe: "observe";
4601
+ require_base: "require_base";
4602
+ }>;
4603
+ dirty_policy: z.ZodEnum<{
4604
+ require_clean: "require_clean";
4605
+ committed_base_only: "committed_base_only";
4606
+ }>;
4607
+ }, z.core.$strip>>;
4608
+ readonly native: z.ZodPreprocess<z.ZodObject<{
4609
+ host_id: z.ZodString;
4610
+ git_runtime: z.ZodString;
4611
+ projection_root: z.ZodString;
4612
+ worktree_root: z.ZodString;
4613
+ }, z.core.$strip>>;
4614
+ readonly base_sha: z.ZodString;
4615
+ };
4616
+ declare const NativeWslProjectionRequest_v1: z.ZodPreprocess<z.ZodObject<{
4617
+ request_digest: z.ZodString;
4618
+ schema_version: z.ZodLiteral<"1.0.0">;
4619
+ request_id: z.ZodString;
4620
+ repository: z.ZodPreprocess<z.ZodObject<{
4621
+ id: z.ZodString;
4622
+ expected_remote_hash: z.ZodString;
4623
+ }, z.core.$strip>>;
4624
+ source: z.ZodPreprocess<z.ZodObject<{
4625
+ windows_runtime: z.ZodString;
4626
+ windows_repository_path: z.ZodString;
4627
+ wsl_distribution: z.ZodString;
4628
+ wsl_git_runtime: z.ZodString;
4629
+ wsl_repository_path: z.ZodString;
4630
+ head_policy: z.ZodEnum<{
4631
+ observe: "observe";
4632
+ require_base: "require_base";
4633
+ }>;
4634
+ dirty_policy: z.ZodEnum<{
4635
+ require_clean: "require_clean";
4636
+ committed_base_only: "committed_base_only";
4637
+ }>;
4638
+ }, z.core.$strip>>;
4639
+ native: z.ZodPreprocess<z.ZodObject<{
4640
+ host_id: z.ZodString;
4641
+ git_runtime: z.ZodString;
4642
+ projection_root: z.ZodString;
4643
+ worktree_root: z.ZodString;
4644
+ }, z.core.$strip>>;
4645
+ base_sha: z.ZodString;
4646
+ }, z.core.$strip>>;
4647
+ type NativeWslProjectionRequest_v1 = z.infer<typeof NativeWslProjectionRequest_v1>;
4648
+ declare const NativeWslProjectionRequestJsonSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodPreprocess<z.ZodObject<{
4649
+ request_digest: z.ZodString;
4650
+ schema_version: z.ZodLiteral<"1.0.0">;
4651
+ request_id: z.ZodString;
4652
+ repository: z.ZodPreprocess<z.ZodObject<{
4653
+ id: z.ZodString;
4654
+ expected_remote_hash: z.ZodString;
4655
+ }, z.core.$strip>>;
4656
+ source: z.ZodPreprocess<z.ZodObject<{
4657
+ windows_runtime: z.ZodString;
4658
+ windows_repository_path: z.ZodString;
4659
+ wsl_distribution: z.ZodString;
4660
+ wsl_git_runtime: z.ZodString;
4661
+ wsl_repository_path: z.ZodString;
4662
+ head_policy: z.ZodEnum<{
4663
+ observe: "observe";
4664
+ require_base: "require_base";
4665
+ }>;
4666
+ dirty_policy: z.ZodEnum<{
4667
+ require_clean: "require_clean";
4668
+ committed_base_only: "committed_base_only";
4669
+ }>;
4670
+ }, z.core.$strip>>;
4671
+ native: z.ZodPreprocess<z.ZodObject<{
4672
+ host_id: z.ZodString;
4673
+ git_runtime: z.ZodString;
4674
+ projection_root: z.ZodString;
4675
+ worktree_root: z.ZodString;
4676
+ }, z.core.$strip>>;
4677
+ base_sha: z.ZodString;
4678
+ }, z.core.$strip>>>;
4679
+ declare function createNativeWslProjectionRequest(input: z.input<z.ZodObject<typeof ProjectionRequestShape>>): NativeWslProjectionRequest_v1;
4680
+ declare const SourceObservationShape: {
4681
+ readonly schema_version: z.ZodLiteral<"1.0.0">;
4682
+ readonly repository_id: z.ZodString;
4683
+ readonly request_digest: z.ZodString;
4684
+ readonly observed_remote_hash: z.ZodString;
4685
+ readonly source_head_sha: z.ZodString;
4686
+ readonly requested_object_sha: z.ZodString;
4687
+ readonly requested_object_type: z.ZodEnum<{
4688
+ commit: "commit";
4689
+ other: "other";
4690
+ missing: "missing";
4691
+ }>;
4692
+ readonly cleanliness: z.ZodEnum<{
4693
+ unknown: "unknown";
4694
+ clean: "clean";
4695
+ dirty: "dirty";
4696
+ }>;
4697
+ readonly observed_at: z.ZodString;
4698
+ };
4699
+ declare const NativeWslSourceObservation_v1: z.ZodPreprocess<z.ZodObject<{
4700
+ observation_digest: z.ZodString;
4701
+ schema_version: z.ZodLiteral<"1.0.0">;
4702
+ repository_id: z.ZodString;
4703
+ request_digest: z.ZodString;
4704
+ observed_remote_hash: z.ZodString;
4705
+ source_head_sha: z.ZodString;
4706
+ requested_object_sha: z.ZodString;
4707
+ requested_object_type: z.ZodEnum<{
4708
+ commit: "commit";
4709
+ other: "other";
4710
+ missing: "missing";
4711
+ }>;
4712
+ cleanliness: z.ZodEnum<{
4713
+ unknown: "unknown";
4714
+ clean: "clean";
4715
+ dirty: "dirty";
4716
+ }>;
4717
+ observed_at: z.ZodString;
4718
+ }, z.core.$strip>>;
4719
+ type NativeWslSourceObservation_v1 = z.infer<typeof NativeWslSourceObservation_v1>;
4720
+ declare function createNativeWslSourceObservation(input: z.input<z.ZodObject<typeof SourceObservationShape>>): NativeWslSourceObservation_v1;
4721
+ declare const ProjectionPathMappingShape: {
4722
+ readonly schema_version: z.ZodLiteral<"1.0.0">;
4723
+ readonly projection_id: z.ZodString;
4724
+ readonly repository_id: z.ZodString;
4725
+ readonly base_sha: z.ZodString;
4726
+ readonly request_digest: z.ZodString;
4727
+ readonly roots: z.ZodPreprocess<z.ZodObject<{
4728
+ windows_source: z.ZodPreprocess<z.ZodObject<{
4729
+ runtime_id: z.ZodString;
4730
+ path: z.ZodString;
4731
+ verification: z.ZodLiteral<"declared">;
4732
+ }, z.core.$strip>>;
4733
+ wsl_source: z.ZodPreprocess<z.ZodObject<{
4734
+ runtime_id: z.ZodString;
4735
+ path: z.ZodString;
4736
+ verification: z.ZodLiteral<"git_observed">;
4737
+ observation_digest: z.ZodString;
4738
+ }, z.core.$strip>>;
4739
+ native_repository: z.ZodPreprocess<z.ZodObject<{
4740
+ runtime_id: z.ZodString;
4741
+ path: z.ZodString;
4742
+ verification: z.ZodLiteral<"directory_identity">;
4743
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
4744
+ device: z.ZodString;
4745
+ inode: z.ZodString;
4746
+ }, z.core.$strip>>;
4747
+ }, z.core.$strip>>;
4748
+ native_worktree_root: z.ZodPreprocess<z.ZodObject<{
4749
+ runtime_id: z.ZodString;
4750
+ path: z.ZodString;
4751
+ verification: z.ZodLiteral<"directory_identity">;
4752
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
4753
+ device: z.ZodString;
4754
+ inode: z.ZodString;
4755
+ }, z.core.$strip>>;
4756
+ }, z.core.$strip>>;
4757
+ }, z.core.$strip>>;
4758
+ };
4759
+ declare const NativeWslProjectionPathMapping_v1: z.ZodPreprocess<z.ZodObject<{
4760
+ mapping_digest: z.ZodString;
4761
+ schema_version: z.ZodLiteral<"1.0.0">;
4762
+ projection_id: z.ZodString;
4763
+ repository_id: z.ZodString;
4764
+ base_sha: z.ZodString;
4765
+ request_digest: z.ZodString;
4766
+ roots: z.ZodPreprocess<z.ZodObject<{
4767
+ windows_source: z.ZodPreprocess<z.ZodObject<{
4768
+ runtime_id: z.ZodString;
4769
+ path: z.ZodString;
4770
+ verification: z.ZodLiteral<"declared">;
4771
+ }, z.core.$strip>>;
4772
+ wsl_source: z.ZodPreprocess<z.ZodObject<{
4773
+ runtime_id: z.ZodString;
4774
+ path: z.ZodString;
4775
+ verification: z.ZodLiteral<"git_observed">;
4776
+ observation_digest: z.ZodString;
4777
+ }, z.core.$strip>>;
4778
+ native_repository: z.ZodPreprocess<z.ZodObject<{
4779
+ runtime_id: z.ZodString;
4780
+ path: z.ZodString;
4781
+ verification: z.ZodLiteral<"directory_identity">;
4782
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
4783
+ device: z.ZodString;
4784
+ inode: z.ZodString;
4785
+ }, z.core.$strip>>;
4786
+ }, z.core.$strip>>;
4787
+ native_worktree_root: z.ZodPreprocess<z.ZodObject<{
4788
+ runtime_id: z.ZodString;
4789
+ path: z.ZodString;
4790
+ verification: z.ZodLiteral<"directory_identity">;
4791
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
4792
+ device: z.ZodString;
4793
+ inode: z.ZodString;
4794
+ }, z.core.$strip>>;
4795
+ }, z.core.$strip>>;
4796
+ }, z.core.$strip>>;
4797
+ }, z.core.$strip>>;
4798
+ type NativeWslProjectionPathMapping_v1 = z.infer<typeof NativeWslProjectionPathMapping_v1>;
4799
+ declare function createNativeWslProjectionPathMapping(input: z.input<z.ZodObject<typeof ProjectionPathMappingShape>>): NativeWslProjectionPathMapping_v1;
4800
+ declare const ProjectionManifestShape: {
4801
+ readonly schema_version: z.ZodLiteral<"1.0.0">;
4802
+ readonly projection_id: z.ZodString;
4803
+ readonly repository_id: z.ZodString;
4804
+ readonly base_sha: z.ZodString;
4805
+ readonly request_digest: z.ZodString;
4806
+ readonly source_observation: z.ZodPreprocess<z.ZodObject<{
4807
+ observation_digest: z.ZodString;
4808
+ schema_version: z.ZodLiteral<"1.0.0">;
4809
+ repository_id: z.ZodString;
4810
+ request_digest: z.ZodString;
4811
+ observed_remote_hash: z.ZodString;
4812
+ source_head_sha: z.ZodString;
4813
+ requested_object_sha: z.ZodString;
4814
+ requested_object_type: z.ZodEnum<{
4815
+ commit: "commit";
4816
+ other: "other";
4817
+ missing: "missing";
4818
+ }>;
4819
+ cleanliness: z.ZodEnum<{
4820
+ unknown: "unknown";
4821
+ clean: "clean";
4822
+ dirty: "dirty";
4823
+ }>;
4824
+ observed_at: z.ZodString;
4825
+ }, z.core.$strip>>;
4826
+ readonly native_host_id: z.ZodString;
4827
+ readonly native_repository: z.ZodPreprocess<z.ZodObject<{
4828
+ path: z.ZodString;
4829
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
4830
+ device: z.ZodString;
4831
+ inode: z.ZodString;
4832
+ }, z.core.$strip>>;
4833
+ git_directory_identity: z.ZodPreprocess<z.ZodObject<{
4834
+ device: z.ZodString;
4835
+ inode: z.ZodString;
4836
+ }, z.core.$strip>>;
4837
+ head_sha: z.ZodString;
4838
+ }, z.core.$strip>>;
4839
+ readonly native_worktree_root: z.ZodPreprocess<z.ZodObject<{
4840
+ path: z.ZodString;
4841
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
4842
+ device: z.ZodString;
4843
+ inode: z.ZodString;
4844
+ }, z.core.$strip>>;
4845
+ }, z.core.$strip>>;
4846
+ readonly path_mapping: z.ZodPreprocess<z.ZodObject<{
4847
+ mapping_digest: z.ZodString;
4848
+ schema_version: z.ZodLiteral<"1.0.0">;
4849
+ projection_id: z.ZodString;
4850
+ repository_id: z.ZodString;
4851
+ base_sha: z.ZodString;
4852
+ request_digest: z.ZodString;
4853
+ roots: z.ZodPreprocess<z.ZodObject<{
4854
+ windows_source: z.ZodPreprocess<z.ZodObject<{
4855
+ runtime_id: z.ZodString;
4856
+ path: z.ZodString;
4857
+ verification: z.ZodLiteral<"declared">;
4858
+ }, z.core.$strip>>;
4859
+ wsl_source: z.ZodPreprocess<z.ZodObject<{
4860
+ runtime_id: z.ZodString;
4861
+ path: z.ZodString;
4862
+ verification: z.ZodLiteral<"git_observed">;
4863
+ observation_digest: z.ZodString;
4864
+ }, z.core.$strip>>;
4865
+ native_repository: z.ZodPreprocess<z.ZodObject<{
4866
+ runtime_id: z.ZodString;
4867
+ path: z.ZodString;
4868
+ verification: z.ZodLiteral<"directory_identity">;
4869
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
4870
+ device: z.ZodString;
4871
+ inode: z.ZodString;
4872
+ }, z.core.$strip>>;
4873
+ }, z.core.$strip>>;
4874
+ native_worktree_root: z.ZodPreprocess<z.ZodObject<{
4875
+ runtime_id: z.ZodString;
4876
+ path: z.ZodString;
4877
+ verification: z.ZodLiteral<"directory_identity">;
4878
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
4879
+ device: z.ZodString;
4880
+ inode: z.ZodString;
4881
+ }, z.core.$strip>>;
4882
+ }, z.core.$strip>>;
4883
+ }, z.core.$strip>>;
4884
+ }, z.core.$strip>>;
4885
+ readonly created_at: z.ZodString;
4886
+ };
4887
+ declare const NativeWslProjectionManifest_v1: z.ZodPreprocess<z.ZodObject<{
4888
+ manifest_digest: z.ZodString;
4889
+ schema_version: z.ZodLiteral<"1.0.0">;
4890
+ projection_id: z.ZodString;
4891
+ repository_id: z.ZodString;
4892
+ base_sha: z.ZodString;
4893
+ request_digest: z.ZodString;
4894
+ source_observation: z.ZodPreprocess<z.ZodObject<{
4895
+ observation_digest: z.ZodString;
4896
+ schema_version: z.ZodLiteral<"1.0.0">;
4897
+ repository_id: z.ZodString;
4898
+ request_digest: z.ZodString;
4899
+ observed_remote_hash: z.ZodString;
4900
+ source_head_sha: z.ZodString;
4901
+ requested_object_sha: z.ZodString;
4902
+ requested_object_type: z.ZodEnum<{
4903
+ commit: "commit";
4904
+ other: "other";
4905
+ missing: "missing";
4906
+ }>;
4907
+ cleanliness: z.ZodEnum<{
4908
+ unknown: "unknown";
4909
+ clean: "clean";
4910
+ dirty: "dirty";
4911
+ }>;
4912
+ observed_at: z.ZodString;
4913
+ }, z.core.$strip>>;
4914
+ native_host_id: z.ZodString;
4915
+ native_repository: z.ZodPreprocess<z.ZodObject<{
4916
+ path: z.ZodString;
4917
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
4918
+ device: z.ZodString;
4919
+ inode: z.ZodString;
4920
+ }, z.core.$strip>>;
4921
+ git_directory_identity: z.ZodPreprocess<z.ZodObject<{
4922
+ device: z.ZodString;
4923
+ inode: z.ZodString;
4924
+ }, z.core.$strip>>;
4925
+ head_sha: z.ZodString;
4926
+ }, z.core.$strip>>;
4927
+ native_worktree_root: z.ZodPreprocess<z.ZodObject<{
4928
+ path: z.ZodString;
4929
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
4930
+ device: z.ZodString;
4931
+ inode: z.ZodString;
4932
+ }, z.core.$strip>>;
4933
+ }, z.core.$strip>>;
4934
+ path_mapping: z.ZodPreprocess<z.ZodObject<{
4935
+ mapping_digest: z.ZodString;
4936
+ schema_version: z.ZodLiteral<"1.0.0">;
4937
+ projection_id: z.ZodString;
4938
+ repository_id: z.ZodString;
4939
+ base_sha: z.ZodString;
4940
+ request_digest: z.ZodString;
4941
+ roots: z.ZodPreprocess<z.ZodObject<{
4942
+ windows_source: z.ZodPreprocess<z.ZodObject<{
4943
+ runtime_id: z.ZodString;
4944
+ path: z.ZodString;
4945
+ verification: z.ZodLiteral<"declared">;
4946
+ }, z.core.$strip>>;
4947
+ wsl_source: z.ZodPreprocess<z.ZodObject<{
4948
+ runtime_id: z.ZodString;
4949
+ path: z.ZodString;
4950
+ verification: z.ZodLiteral<"git_observed">;
4951
+ observation_digest: z.ZodString;
4952
+ }, z.core.$strip>>;
4953
+ native_repository: z.ZodPreprocess<z.ZodObject<{
4954
+ runtime_id: z.ZodString;
4955
+ path: z.ZodString;
4956
+ verification: z.ZodLiteral<"directory_identity">;
4957
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
4958
+ device: z.ZodString;
4959
+ inode: z.ZodString;
4960
+ }, z.core.$strip>>;
4961
+ }, z.core.$strip>>;
4962
+ native_worktree_root: z.ZodPreprocess<z.ZodObject<{
4963
+ runtime_id: z.ZodString;
4964
+ path: z.ZodString;
4965
+ verification: z.ZodLiteral<"directory_identity">;
4966
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
4967
+ device: z.ZodString;
4968
+ inode: z.ZodString;
4969
+ }, z.core.$strip>>;
4970
+ }, z.core.$strip>>;
4971
+ }, z.core.$strip>>;
4972
+ }, z.core.$strip>>;
4973
+ created_at: z.ZodString;
4974
+ }, z.core.$strip>>;
4975
+ type NativeWslProjectionManifest_v1 = z.infer<typeof NativeWslProjectionManifest_v1>;
4976
+ declare function createNativeWslProjectionManifest(input: z.input<z.ZodObject<typeof ProjectionManifestShape>>): NativeWslProjectionManifest_v1;
4977
+ declare const ExecutionPathMappingShape: {
4978
+ readonly schema_version: z.ZodLiteral<"1.0.0">;
4979
+ readonly projection_id: z.ZodString;
4980
+ readonly repository_id: z.ZodString;
4981
+ readonly base_sha: z.ZodString;
4982
+ readonly native_host_id: z.ZodString;
4983
+ readonly request_digest: z.ZodString;
4984
+ readonly projection_digest: z.ZodString;
4985
+ readonly projection_mapping_digest: z.ZodString;
4986
+ readonly roots: z.ZodPreprocess<z.ZodObject<{
4987
+ windows_source: z.ZodPreprocess<z.ZodObject<{
4988
+ runtime_id: z.ZodString;
4989
+ path: z.ZodString;
4990
+ verification: z.ZodLiteral<"declared">;
4991
+ }, z.core.$strip>>;
4992
+ wsl_source: z.ZodPreprocess<z.ZodObject<{
4993
+ runtime_id: z.ZodString;
4994
+ path: z.ZodString;
4995
+ verification: z.ZodLiteral<"git_observed">;
4996
+ observation_digest: z.ZodString;
4997
+ }, z.core.$strip>>;
4998
+ native_repository: z.ZodPreprocess<z.ZodObject<{
4999
+ runtime_id: z.ZodString;
5000
+ path: z.ZodString;
5001
+ verification: z.ZodLiteral<"directory_identity">;
5002
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
5003
+ device: z.ZodString;
5004
+ inode: z.ZodString;
5005
+ }, z.core.$strip>>;
5006
+ }, z.core.$strip>>;
5007
+ native_allocation_root: z.ZodPreprocess<z.ZodObject<{
5008
+ runtime_id: z.ZodString;
5009
+ path: z.ZodString;
5010
+ verification: z.ZodLiteral<"directory_identity">;
5011
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
5012
+ device: z.ZodString;
5013
+ inode: z.ZodString;
5014
+ }, z.core.$strip>>;
5015
+ }, z.core.$strip>>;
5016
+ native_worktree: z.ZodPreprocess<z.ZodObject<{
5017
+ runtime_id: z.ZodString;
5018
+ path: z.ZodString;
5019
+ verification: z.ZodLiteral<"directory_identity">;
5020
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
5021
+ device: z.ZodString;
5022
+ inode: z.ZodString;
5023
+ }, z.core.$strip>>;
5024
+ }, z.core.$strip>>;
5025
+ }, z.core.$strip>>;
5026
+ };
5027
+ declare const NativeWslExecutionPathMapping_v1: z.ZodPreprocess<z.ZodObject<{
5028
+ mapping_digest: z.ZodString;
5029
+ schema_version: z.ZodLiteral<"1.0.0">;
5030
+ projection_id: z.ZodString;
5031
+ repository_id: z.ZodString;
5032
+ base_sha: z.ZodString;
5033
+ native_host_id: z.ZodString;
5034
+ request_digest: z.ZodString;
5035
+ projection_digest: z.ZodString;
5036
+ projection_mapping_digest: z.ZodString;
5037
+ roots: z.ZodPreprocess<z.ZodObject<{
5038
+ windows_source: z.ZodPreprocess<z.ZodObject<{
5039
+ runtime_id: z.ZodString;
5040
+ path: z.ZodString;
5041
+ verification: z.ZodLiteral<"declared">;
5042
+ }, z.core.$strip>>;
5043
+ wsl_source: z.ZodPreprocess<z.ZodObject<{
5044
+ runtime_id: z.ZodString;
5045
+ path: z.ZodString;
5046
+ verification: z.ZodLiteral<"git_observed">;
5047
+ observation_digest: z.ZodString;
5048
+ }, z.core.$strip>>;
5049
+ native_repository: z.ZodPreprocess<z.ZodObject<{
5050
+ runtime_id: z.ZodString;
5051
+ path: z.ZodString;
5052
+ verification: z.ZodLiteral<"directory_identity">;
5053
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
5054
+ device: z.ZodString;
5055
+ inode: z.ZodString;
5056
+ }, z.core.$strip>>;
5057
+ }, z.core.$strip>>;
5058
+ native_allocation_root: z.ZodPreprocess<z.ZodObject<{
5059
+ runtime_id: z.ZodString;
5060
+ path: z.ZodString;
5061
+ verification: z.ZodLiteral<"directory_identity">;
5062
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
5063
+ device: z.ZodString;
5064
+ inode: z.ZodString;
5065
+ }, z.core.$strip>>;
5066
+ }, z.core.$strip>>;
5067
+ native_worktree: z.ZodPreprocess<z.ZodObject<{
5068
+ runtime_id: z.ZodString;
5069
+ path: z.ZodString;
5070
+ verification: z.ZodLiteral<"directory_identity">;
5071
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
5072
+ device: z.ZodString;
5073
+ inode: z.ZodString;
5074
+ }, z.core.$strip>>;
5075
+ }, z.core.$strip>>;
5076
+ }, z.core.$strip>>;
5077
+ }, z.core.$strip>>;
5078
+ type NativeWslExecutionPathMapping_v1 = z.infer<typeof NativeWslExecutionPathMapping_v1>;
5079
+ declare function createNativeWslExecutionPathMapping(input: z.input<z.ZodObject<typeof ExecutionPathMappingShape>>): NativeWslExecutionPathMapping_v1;
5080
+ declare const NativeExecutionPathMappingShape: {
5081
+ readonly schema_version: z.ZodLiteral<"1.0.0">;
5082
+ readonly mapping_kind: z.ZodLiteral<"native_linux">;
5083
+ readonly repository_id: z.ZodString;
5084
+ readonly base_sha: z.ZodString;
5085
+ readonly native_host_id: z.ZodString;
5086
+ readonly git_runtime: z.ZodString;
5087
+ readonly roots: z.ZodPreprocess<z.ZodObject<{
5088
+ native_repository: z.ZodPreprocess<z.ZodObject<{
5089
+ runtime_id: z.ZodString;
5090
+ path: z.ZodString;
5091
+ verification: z.ZodLiteral<"directory_identity">;
5092
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
5093
+ device: z.ZodString;
5094
+ inode: z.ZodString;
5095
+ }, z.core.$strip>>;
5096
+ }, z.core.$strip>>;
5097
+ native_allocation_root: z.ZodPreprocess<z.ZodObject<{
5098
+ runtime_id: z.ZodString;
5099
+ path: z.ZodString;
5100
+ verification: z.ZodLiteral<"directory_identity">;
5101
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
5102
+ device: z.ZodString;
5103
+ inode: z.ZodString;
5104
+ }, z.core.$strip>>;
5105
+ }, z.core.$strip>>;
5106
+ native_worktree: z.ZodPreprocess<z.ZodObject<{
5107
+ runtime_id: z.ZodString;
5108
+ path: z.ZodString;
5109
+ verification: z.ZodLiteral<"directory_identity">;
5110
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
5111
+ device: z.ZodString;
5112
+ inode: z.ZodString;
5113
+ }, z.core.$strip>>;
5114
+ }, z.core.$strip>>;
5115
+ }, z.core.$strip>>;
5116
+ };
5117
+ declare const NativeExecutionPathMapping_v1: z.ZodPreprocess<z.ZodObject<{
5118
+ mapping_digest: z.ZodString;
5119
+ schema_version: z.ZodLiteral<"1.0.0">;
5120
+ mapping_kind: z.ZodLiteral<"native_linux">;
5121
+ repository_id: z.ZodString;
5122
+ base_sha: z.ZodString;
5123
+ native_host_id: z.ZodString;
5124
+ git_runtime: z.ZodString;
5125
+ roots: z.ZodPreprocess<z.ZodObject<{
5126
+ native_repository: z.ZodPreprocess<z.ZodObject<{
5127
+ runtime_id: z.ZodString;
5128
+ path: z.ZodString;
5129
+ verification: z.ZodLiteral<"directory_identity">;
5130
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
5131
+ device: z.ZodString;
5132
+ inode: z.ZodString;
5133
+ }, z.core.$strip>>;
5134
+ }, z.core.$strip>>;
5135
+ native_allocation_root: z.ZodPreprocess<z.ZodObject<{
5136
+ runtime_id: z.ZodString;
5137
+ path: z.ZodString;
5138
+ verification: z.ZodLiteral<"directory_identity">;
5139
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
5140
+ device: z.ZodString;
5141
+ inode: z.ZodString;
5142
+ }, z.core.$strip>>;
5143
+ }, z.core.$strip>>;
5144
+ native_worktree: z.ZodPreprocess<z.ZodObject<{
5145
+ runtime_id: z.ZodString;
5146
+ path: z.ZodString;
5147
+ verification: z.ZodLiteral<"directory_identity">;
5148
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
5149
+ device: z.ZodString;
5150
+ inode: z.ZodString;
5151
+ }, z.core.$strip>>;
5152
+ }, z.core.$strip>>;
5153
+ }, z.core.$strip>>;
5154
+ }, z.core.$strip>>;
5155
+ type NativeExecutionPathMapping_v1 = z.infer<typeof NativeExecutionPathMapping_v1>;
5156
+ declare function createNativeExecutionPathMapping(input: z.input<z.ZodObject<typeof NativeExecutionPathMappingShape>>): NativeExecutionPathMapping_v1;
5157
+ declare const AgentExecutionPathMapping_v1: z.ZodUnion<readonly [z.ZodPreprocess<z.ZodObject<{
5158
+ mapping_digest: z.ZodString;
5159
+ schema_version: z.ZodLiteral<"1.0.0">;
5160
+ projection_id: z.ZodString;
5161
+ repository_id: z.ZodString;
5162
+ base_sha: z.ZodString;
5163
+ native_host_id: z.ZodString;
5164
+ request_digest: z.ZodString;
5165
+ projection_digest: z.ZodString;
5166
+ projection_mapping_digest: z.ZodString;
5167
+ roots: z.ZodPreprocess<z.ZodObject<{
5168
+ windows_source: z.ZodPreprocess<z.ZodObject<{
5169
+ runtime_id: z.ZodString;
5170
+ path: z.ZodString;
5171
+ verification: z.ZodLiteral<"declared">;
5172
+ }, z.core.$strip>>;
5173
+ wsl_source: z.ZodPreprocess<z.ZodObject<{
5174
+ runtime_id: z.ZodString;
5175
+ path: z.ZodString;
5176
+ verification: z.ZodLiteral<"git_observed">;
5177
+ observation_digest: z.ZodString;
5178
+ }, z.core.$strip>>;
5179
+ native_repository: z.ZodPreprocess<z.ZodObject<{
5180
+ runtime_id: z.ZodString;
5181
+ path: z.ZodString;
5182
+ verification: z.ZodLiteral<"directory_identity">;
5183
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
5184
+ device: z.ZodString;
5185
+ inode: z.ZodString;
5186
+ }, z.core.$strip>>;
5187
+ }, z.core.$strip>>;
5188
+ native_allocation_root: z.ZodPreprocess<z.ZodObject<{
5189
+ runtime_id: z.ZodString;
5190
+ path: z.ZodString;
5191
+ verification: z.ZodLiteral<"directory_identity">;
5192
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
5193
+ device: z.ZodString;
5194
+ inode: z.ZodString;
5195
+ }, z.core.$strip>>;
5196
+ }, z.core.$strip>>;
5197
+ native_worktree: z.ZodPreprocess<z.ZodObject<{
5198
+ runtime_id: z.ZodString;
5199
+ path: z.ZodString;
5200
+ verification: z.ZodLiteral<"directory_identity">;
5201
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
5202
+ device: z.ZodString;
5203
+ inode: z.ZodString;
5204
+ }, z.core.$strip>>;
5205
+ }, z.core.$strip>>;
5206
+ }, z.core.$strip>>;
5207
+ }, z.core.$strip>>, z.ZodPreprocess<z.ZodObject<{
5208
+ mapping_digest: z.ZodString;
5209
+ schema_version: z.ZodLiteral<"1.0.0">;
5210
+ mapping_kind: z.ZodLiteral<"native_linux">;
5211
+ repository_id: z.ZodString;
5212
+ base_sha: z.ZodString;
5213
+ native_host_id: z.ZodString;
5214
+ git_runtime: z.ZodString;
5215
+ roots: z.ZodPreprocess<z.ZodObject<{
5216
+ native_repository: z.ZodPreprocess<z.ZodObject<{
5217
+ runtime_id: z.ZodString;
5218
+ path: z.ZodString;
5219
+ verification: z.ZodLiteral<"directory_identity">;
5220
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
5221
+ device: z.ZodString;
5222
+ inode: z.ZodString;
5223
+ }, z.core.$strip>>;
5224
+ }, z.core.$strip>>;
5225
+ native_allocation_root: z.ZodPreprocess<z.ZodObject<{
5226
+ runtime_id: z.ZodString;
5227
+ path: z.ZodString;
5228
+ verification: z.ZodLiteral<"directory_identity">;
5229
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
5230
+ device: z.ZodString;
5231
+ inode: z.ZodString;
5232
+ }, z.core.$strip>>;
5233
+ }, z.core.$strip>>;
5234
+ native_worktree: z.ZodPreprocess<z.ZodObject<{
5235
+ runtime_id: z.ZodString;
5236
+ path: z.ZodString;
5237
+ verification: z.ZodLiteral<"directory_identity">;
5238
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
5239
+ device: z.ZodString;
5240
+ inode: z.ZodString;
5241
+ }, z.core.$strip>>;
5242
+ }, z.core.$strip>>;
5243
+ }, z.core.$strip>>;
5244
+ }, z.core.$strip>>]>;
5245
+ type AgentExecutionPathMapping_v1 = z.infer<typeof AgentExecutionPathMapping_v1>;
5246
+ interface AgentExecutionPathBindingContext {
5247
+ repositoryId: string;
5248
+ baseSha: string;
5249
+ hostId: string;
5250
+ gitRuntime: string;
5251
+ repositoryRoot: string;
5252
+ allocationRoot: string;
5253
+ worktreePath: string;
5254
+ }
5255
+ type AgentExecutionPathBindingValidation = {
5256
+ valid: true;
5257
+ kind: "native_wsl_projection" | "native_linux";
5258
+ mappingDigest: string;
5259
+ } | {
5260
+ valid: false;
5261
+ reason: "mapping_count" | "repository_identity" | "base_identity" | "host_identity" | "runtime_identity" | "repository_path" | "allocation_path" | "worktree_path" | "directory_identity";
5262
+ };
5263
+ /** Pure identity validation shared by durable lifecycle consumers. */
5264
+ declare function validateAgentExecutionPathBinding(mappings: readonly AgentExecutionPathMapping_v1[], context: AgentExecutionPathBindingContext): AgentExecutionPathBindingValidation;
5265
+ declare const NativeWslProjectionOutcome: z.ZodEnum<{
5266
+ reused: "reused";
5267
+ prepared: "prepared";
5268
+ rejected: "rejected";
5269
+ quarantined: "quarantined";
5270
+ }>;
5271
+ type NativeWslProjectionOutcome = z.infer<typeof NativeWslProjectionOutcome>;
5272
+ declare const NativeWslProjectionReasonCode: z.ZodEnum<{
5273
+ operation_failed: "operation_failed";
5274
+ projection_prepared: "projection_prepared";
5275
+ projection_reused: "projection_reused";
5276
+ source_dirty: "source_dirty";
5277
+ source_head_mismatch: "source_head_mismatch";
5278
+ source_object_missing: "source_object_missing";
5279
+ source_object_not_commit: "source_object_not_commit";
5280
+ repository_identity_mismatch: "repository_identity_mismatch";
5281
+ source_replaced: "source_replaced";
5282
+ native_state_stale: "native_state_stale";
5283
+ native_state_conflict: "native_state_conflict";
5284
+ staging_interrupted: "staging_interrupted";
5285
+ concurrent_request: "concurrent_request";
5286
+ cleanup_failed_quarantined: "cleanup_failed_quarantined";
5287
+ unsupported_filesystem: "unsupported_filesystem";
5288
+ containment_unavailable: "containment_unavailable";
5289
+ }>;
5290
+ type NativeWslProjectionReasonCode = z.infer<typeof NativeWslProjectionReasonCode>;
5291
+ declare const ProjectionReceiptShape: {
5292
+ readonly schema_version: z.ZodLiteral<"1.0.0">;
5293
+ readonly request_id: z.ZodString;
5294
+ readonly request_digest: z.ZodString;
5295
+ readonly outcome: z.ZodEnum<{
5296
+ reused: "reused";
5297
+ prepared: "prepared";
5298
+ rejected: "rejected";
5299
+ quarantined: "quarantined";
5300
+ }>;
5301
+ readonly reason_code: z.ZodEnum<{
5302
+ operation_failed: "operation_failed";
5303
+ projection_prepared: "projection_prepared";
5304
+ projection_reused: "projection_reused";
5305
+ source_dirty: "source_dirty";
5306
+ source_head_mismatch: "source_head_mismatch";
5307
+ source_object_missing: "source_object_missing";
5308
+ source_object_not_commit: "source_object_not_commit";
5309
+ repository_identity_mismatch: "repository_identity_mismatch";
5310
+ source_replaced: "source_replaced";
5311
+ native_state_stale: "native_state_stale";
5312
+ native_state_conflict: "native_state_conflict";
5313
+ staging_interrupted: "staging_interrupted";
5314
+ concurrent_request: "concurrent_request";
5315
+ cleanup_failed_quarantined: "cleanup_failed_quarantined";
5316
+ unsupported_filesystem: "unsupported_filesystem";
5317
+ containment_unavailable: "containment_unavailable";
5318
+ }>;
5319
+ readonly source_observation_digest: z.ZodOptional<z.ZodString>;
5320
+ readonly projection_digest: z.ZodOptional<z.ZodString>;
5321
+ readonly mapping_digest: z.ZodOptional<z.ZodString>;
5322
+ readonly completed_at: z.ZodString;
5323
+ };
5324
+ declare const NativeWslProjectionReceipt_v1: z.ZodPreprocess<z.ZodObject<{
5325
+ receipt_digest: z.ZodString;
5326
+ schema_version: z.ZodLiteral<"1.0.0">;
5327
+ request_id: z.ZodString;
5328
+ request_digest: z.ZodString;
5329
+ outcome: z.ZodEnum<{
5330
+ reused: "reused";
5331
+ prepared: "prepared";
5332
+ rejected: "rejected";
5333
+ quarantined: "quarantined";
5334
+ }>;
5335
+ reason_code: z.ZodEnum<{
5336
+ operation_failed: "operation_failed";
5337
+ projection_prepared: "projection_prepared";
5338
+ projection_reused: "projection_reused";
5339
+ source_dirty: "source_dirty";
5340
+ source_head_mismatch: "source_head_mismatch";
5341
+ source_object_missing: "source_object_missing";
5342
+ source_object_not_commit: "source_object_not_commit";
5343
+ repository_identity_mismatch: "repository_identity_mismatch";
5344
+ source_replaced: "source_replaced";
5345
+ native_state_stale: "native_state_stale";
5346
+ native_state_conflict: "native_state_conflict";
5347
+ staging_interrupted: "staging_interrupted";
5348
+ concurrent_request: "concurrent_request";
5349
+ cleanup_failed_quarantined: "cleanup_failed_quarantined";
5350
+ unsupported_filesystem: "unsupported_filesystem";
5351
+ containment_unavailable: "containment_unavailable";
5352
+ }>;
5353
+ source_observation_digest: z.ZodOptional<z.ZodString>;
5354
+ projection_digest: z.ZodOptional<z.ZodString>;
5355
+ mapping_digest: z.ZodOptional<z.ZodString>;
5356
+ completed_at: z.ZodString;
5357
+ }, z.core.$strip>>;
5358
+ type NativeWslProjectionReceipt_v1 = z.infer<typeof NativeWslProjectionReceipt_v1>;
5359
+ declare function createNativeWslProjectionReceipt(input: z.input<z.ZodObject<typeof ProjectionReceiptShape>>): NativeWslProjectionReceipt_v1;
5360
+ declare const ProjectionSelectionShape: {
5361
+ readonly schema_version: z.ZodLiteral<"1.0.0">;
5362
+ readonly manifest_digest: z.ZodString;
5363
+ readonly receipt: z.ZodPreprocess<z.ZodObject<{
5364
+ receipt_digest: z.ZodString;
5365
+ schema_version: z.ZodLiteral<"1.0.0">;
5366
+ request_id: z.ZodString;
5367
+ request_digest: z.ZodString;
5368
+ outcome: z.ZodEnum<{
5369
+ reused: "reused";
5370
+ prepared: "prepared";
5371
+ rejected: "rejected";
5372
+ quarantined: "quarantined";
5373
+ }>;
5374
+ reason_code: z.ZodEnum<{
5375
+ operation_failed: "operation_failed";
5376
+ projection_prepared: "projection_prepared";
5377
+ projection_reused: "projection_reused";
5378
+ source_dirty: "source_dirty";
5379
+ source_head_mismatch: "source_head_mismatch";
5380
+ source_object_missing: "source_object_missing";
5381
+ source_object_not_commit: "source_object_not_commit";
5382
+ repository_identity_mismatch: "repository_identity_mismatch";
5383
+ source_replaced: "source_replaced";
5384
+ native_state_stale: "native_state_stale";
5385
+ native_state_conflict: "native_state_conflict";
5386
+ staging_interrupted: "staging_interrupted";
5387
+ concurrent_request: "concurrent_request";
5388
+ cleanup_failed_quarantined: "cleanup_failed_quarantined";
5389
+ unsupported_filesystem: "unsupported_filesystem";
5390
+ containment_unavailable: "containment_unavailable";
5391
+ }>;
5392
+ source_observation_digest: z.ZodOptional<z.ZodString>;
5393
+ projection_digest: z.ZodOptional<z.ZodString>;
5394
+ mapping_digest: z.ZodOptional<z.ZodString>;
5395
+ completed_at: z.ZodString;
5396
+ }, z.core.$strip>>;
5397
+ readonly source_observation: z.ZodPreprocess<z.ZodObject<{
5398
+ observation_digest: z.ZodString;
5399
+ schema_version: z.ZodLiteral<"1.0.0">;
5400
+ repository_id: z.ZodString;
5401
+ request_digest: z.ZodString;
5402
+ observed_remote_hash: z.ZodString;
5403
+ source_head_sha: z.ZodString;
5404
+ requested_object_sha: z.ZodString;
5405
+ requested_object_type: z.ZodEnum<{
5406
+ commit: "commit";
5407
+ other: "other";
5408
+ missing: "missing";
5409
+ }>;
5410
+ cleanliness: z.ZodEnum<{
5411
+ unknown: "unknown";
5412
+ clean: "clean";
5413
+ dirty: "dirty";
5414
+ }>;
5415
+ observed_at: z.ZodString;
5416
+ }, z.core.$strip>>;
5417
+ };
5418
+ /**
5419
+ * Engine-authored current selection authority. Its public digest is only an
5420
+ * integrity identifier; provenance comes from the identity-anchored engine
5421
+ * record that launch preparation resolves.
5422
+ */
5423
+ declare const NativeWslProjectionSelection_v1: z.ZodPreprocess<z.ZodObject<{
5424
+ selection_digest: z.ZodString;
5425
+ schema_version: z.ZodLiteral<"1.0.0">;
5426
+ manifest_digest: z.ZodString;
5427
+ receipt: z.ZodPreprocess<z.ZodObject<{
5428
+ receipt_digest: z.ZodString;
5429
+ schema_version: z.ZodLiteral<"1.0.0">;
5430
+ request_id: z.ZodString;
5431
+ request_digest: z.ZodString;
5432
+ outcome: z.ZodEnum<{
5433
+ reused: "reused";
5434
+ prepared: "prepared";
5435
+ rejected: "rejected";
5436
+ quarantined: "quarantined";
5437
+ }>;
5438
+ reason_code: z.ZodEnum<{
5439
+ operation_failed: "operation_failed";
5440
+ projection_prepared: "projection_prepared";
5441
+ projection_reused: "projection_reused";
5442
+ source_dirty: "source_dirty";
5443
+ source_head_mismatch: "source_head_mismatch";
5444
+ source_object_missing: "source_object_missing";
5445
+ source_object_not_commit: "source_object_not_commit";
5446
+ repository_identity_mismatch: "repository_identity_mismatch";
5447
+ source_replaced: "source_replaced";
5448
+ native_state_stale: "native_state_stale";
5449
+ native_state_conflict: "native_state_conflict";
5450
+ staging_interrupted: "staging_interrupted";
5451
+ concurrent_request: "concurrent_request";
5452
+ cleanup_failed_quarantined: "cleanup_failed_quarantined";
5453
+ unsupported_filesystem: "unsupported_filesystem";
5454
+ containment_unavailable: "containment_unavailable";
5455
+ }>;
5456
+ source_observation_digest: z.ZodOptional<z.ZodString>;
5457
+ projection_digest: z.ZodOptional<z.ZodString>;
5458
+ mapping_digest: z.ZodOptional<z.ZodString>;
5459
+ completed_at: z.ZodString;
5460
+ }, z.core.$strip>>;
5461
+ source_observation: z.ZodPreprocess<z.ZodObject<{
5462
+ observation_digest: z.ZodString;
5463
+ schema_version: z.ZodLiteral<"1.0.0">;
5464
+ repository_id: z.ZodString;
5465
+ request_digest: z.ZodString;
5466
+ observed_remote_hash: z.ZodString;
5467
+ source_head_sha: z.ZodString;
5468
+ requested_object_sha: z.ZodString;
5469
+ requested_object_type: z.ZodEnum<{
5470
+ commit: "commit";
5471
+ other: "other";
5472
+ missing: "missing";
5473
+ }>;
5474
+ cleanliness: z.ZodEnum<{
5475
+ unknown: "unknown";
5476
+ clean: "clean";
5477
+ dirty: "dirty";
5478
+ }>;
5479
+ observed_at: z.ZodString;
5480
+ }, z.core.$strip>>;
5481
+ }, z.core.$strip>>;
5482
+ type NativeWslProjectionSelection_v1 = z.infer<typeof NativeWslProjectionSelection_v1>;
5483
+ declare function createNativeWslProjectionSelection(input: z.input<z.ZodObject<typeof ProjectionSelectionShape>>): NativeWslProjectionSelection_v1;
5484
+ declare const NativeWslProjectionInventoryState: z.ZodEnum<{
5485
+ ready: "ready";
5486
+ invalid: "invalid";
5487
+ quarantined: "quarantined";
5488
+ absent: "absent";
5489
+ staging: "staging";
5490
+ interrupted: "interrupted";
5491
+ conflicting: "conflicting";
5492
+ }>;
5493
+ type NativeWslProjectionInventoryState = z.infer<typeof NativeWslProjectionInventoryState>;
5494
+ declare const NativeWslProjectionPlanAction: z.ZodEnum<{
5495
+ prepare_staging: "prepare_staging";
5496
+ reuse_ready: "reuse_ready";
5497
+ wait_for_same_request: "wait_for_same_request";
5498
+ quarantine_then_prepare: "quarantine_then_prepare";
5499
+ cleanup_quarantine_then_prepare: "cleanup_quarantine_then_prepare";
5500
+ refuse_conflict: "refuse_conflict";
5501
+ }>;
5502
+ type NativeWslProjectionPlanAction = z.infer<typeof NativeWslProjectionPlanAction>;
5503
+ declare const NativeWslProjectionPlanReason: z.ZodEnum<{
5504
+ projection_absent: "projection_absent";
5505
+ projection_exact_match: "projection_exact_match";
5506
+ projection_staging_same_request: "projection_staging_same_request";
5507
+ projection_staging_conflict: "projection_staging_conflict";
5508
+ projection_stale: "projection_stale";
5509
+ projection_quarantined: "projection_quarantined";
5510
+ projection_invalid: "projection_invalid";
5511
+ projection_interrupted: "projection_interrupted";
5512
+ projection_conflicting: "projection_conflicting";
5513
+ }>;
5514
+ type NativeWslProjectionPlanReason = z.infer<typeof NativeWslProjectionPlanReason>;
5515
+ declare function nativeWslProjectionId(requestDigest: string): string;
5516
+
5517
+ declare const NativeWslProjectionInventoryObservation_v1: z.ZodUnion<readonly [z.ZodPreprocess<z.ZodObject<{
5518
+ state: z.ZodLiteral<"absent">;
5519
+ }, z.core.$strip>>, z.ZodPreprocess<z.ZodObject<{
5520
+ state: z.ZodLiteral<"ready">;
5521
+ manifest: z.ZodPreprocess<z.ZodObject<{
5522
+ manifest_digest: z.ZodString;
5523
+ schema_version: z.ZodLiteral<"1.0.0">;
5524
+ projection_id: z.ZodString;
5525
+ repository_id: z.ZodString;
5526
+ base_sha: z.ZodString;
5527
+ request_digest: z.ZodString;
5528
+ source_observation: z.ZodPreprocess<z.ZodObject<{
5529
+ observation_digest: z.ZodString;
5530
+ schema_version: z.ZodLiteral<"1.0.0">;
5531
+ repository_id: z.ZodString;
5532
+ request_digest: z.ZodString;
5533
+ observed_remote_hash: z.ZodString;
5534
+ source_head_sha: z.ZodString;
5535
+ requested_object_sha: z.ZodString;
5536
+ requested_object_type: z.ZodEnum<{
5537
+ commit: "commit";
5538
+ other: "other";
5539
+ missing: "missing";
5540
+ }>;
5541
+ cleanliness: z.ZodEnum<{
5542
+ unknown: "unknown";
5543
+ clean: "clean";
5544
+ dirty: "dirty";
5545
+ }>;
5546
+ observed_at: z.ZodString;
5547
+ }, z.core.$strip>>;
5548
+ native_host_id: z.ZodString;
5549
+ native_repository: z.ZodPreprocess<z.ZodObject<{
5550
+ path: z.ZodString;
5551
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
5552
+ device: z.ZodString;
5553
+ inode: z.ZodString;
5554
+ }, z.core.$strip>>;
5555
+ git_directory_identity: z.ZodPreprocess<z.ZodObject<{
5556
+ device: z.ZodString;
5557
+ inode: z.ZodString;
5558
+ }, z.core.$strip>>;
5559
+ head_sha: z.ZodString;
5560
+ }, z.core.$strip>>;
5561
+ native_worktree_root: z.ZodPreprocess<z.ZodObject<{
5562
+ path: z.ZodString;
5563
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
5564
+ device: z.ZodString;
5565
+ inode: z.ZodString;
5566
+ }, z.core.$strip>>;
5567
+ }, z.core.$strip>>;
5568
+ path_mapping: z.ZodPreprocess<z.ZodObject<{
5569
+ mapping_digest: z.ZodString;
5570
+ schema_version: z.ZodLiteral<"1.0.0">;
5571
+ projection_id: z.ZodString;
5572
+ repository_id: z.ZodString;
5573
+ base_sha: z.ZodString;
5574
+ request_digest: z.ZodString;
5575
+ roots: z.ZodPreprocess<z.ZodObject<{
5576
+ windows_source: z.ZodPreprocess<z.ZodObject<{
5577
+ runtime_id: z.ZodString;
5578
+ path: z.ZodString;
5579
+ verification: z.ZodLiteral<"declared">;
5580
+ }, z.core.$strip>>;
5581
+ wsl_source: z.ZodPreprocess<z.ZodObject<{
5582
+ runtime_id: z.ZodString;
5583
+ path: z.ZodString;
5584
+ verification: z.ZodLiteral<"git_observed">;
5585
+ observation_digest: z.ZodString;
5586
+ }, z.core.$strip>>;
5587
+ native_repository: z.ZodPreprocess<z.ZodObject<{
5588
+ runtime_id: z.ZodString;
5589
+ path: z.ZodString;
5590
+ verification: z.ZodLiteral<"directory_identity">;
5591
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
5592
+ device: z.ZodString;
5593
+ inode: z.ZodString;
5594
+ }, z.core.$strip>>;
5595
+ }, z.core.$strip>>;
5596
+ native_worktree_root: z.ZodPreprocess<z.ZodObject<{
5597
+ runtime_id: z.ZodString;
5598
+ path: z.ZodString;
5599
+ verification: z.ZodLiteral<"directory_identity">;
5600
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
5601
+ device: z.ZodString;
5602
+ inode: z.ZodString;
5603
+ }, z.core.$strip>>;
5604
+ }, z.core.$strip>>;
5605
+ }, z.core.$strip>>;
5606
+ }, z.core.$strip>>;
5607
+ created_at: z.ZodString;
5608
+ }, z.core.$strip>>;
5609
+ }, z.core.$strip>>, z.ZodPreprocess<z.ZodObject<{
5610
+ state: z.ZodLiteral<"staging">;
5611
+ projection_id: z.ZodString;
5612
+ request_digest: z.ZodString;
5613
+ started_at: z.ZodString;
5614
+ }, z.core.$strip>>, z.ZodPreprocess<z.ZodObject<{
5615
+ state: z.ZodLiteral<"quarantined">;
5616
+ projection_id: z.ZodOptional<z.ZodString>;
5617
+ request_digest: z.ZodOptional<z.ZodString>;
5618
+ quarantined_at: z.ZodString;
5619
+ }, z.core.$strip>>, z.ZodPreprocess<z.ZodObject<{
5620
+ state: z.ZodLiteral<"invalid">;
5621
+ projection_id: z.ZodOptional<z.ZodString>;
5622
+ request_digest: z.ZodOptional<z.ZodString>;
5623
+ }, z.core.$strip>>, z.ZodPreprocess<z.ZodObject<{
5624
+ state: z.ZodLiteral<"interrupted">;
5625
+ projection_id: z.ZodString;
5626
+ request_digest: z.ZodString;
5627
+ started_at: z.ZodString;
5628
+ }, z.core.$strip>>, z.ZodPreprocess<z.ZodObject<{
5629
+ state: z.ZodLiteral<"conflicting">;
5630
+ projection_id: z.ZodString;
5631
+ request_digest: z.ZodOptional<z.ZodString>;
5632
+ observed_at: z.ZodString;
5633
+ }, z.core.$strip>>]>;
5634
+ type NativeWslProjectionInventoryObservation_v1 = z.infer<typeof NativeWslProjectionInventoryObservation_v1>;
5635
+ declare const NativeWslProjectionNextAction: z.ZodEnum<{
5636
+ prepare_projection_staging: "prepare_projection_staging";
5637
+ reuse_projection: "reuse_projection";
5638
+ retry_after_active_request: "retry_after_active_request";
5639
+ quarantine_observed_projection: "quarantine_observed_projection";
5640
+ cleanup_quarantined_projection: "cleanup_quarantined_projection";
5641
+ stop_and_report_conflict: "stop_and_report_conflict";
5642
+ }>;
5643
+ type NativeWslProjectionNextAction = z.infer<typeof NativeWslProjectionNextAction>;
5644
+ declare const NativeWslProjectionPlan_v1: z.ZodPreprocess<z.ZodObject<{
5645
+ schema_version: z.ZodLiteral<"1.0.0">;
5646
+ projection_id: z.ZodString;
5647
+ request_digest: z.ZodString;
5648
+ inventory_state: z.ZodEnum<{
5649
+ ready: "ready";
5650
+ invalid: "invalid";
5651
+ quarantined: "quarantined";
5652
+ absent: "absent";
5653
+ staging: "staging";
5654
+ interrupted: "interrupted";
5655
+ conflicting: "conflicting";
5656
+ }>;
5657
+ action: z.ZodEnum<{
5658
+ prepare_staging: "prepare_staging";
5659
+ reuse_ready: "reuse_ready";
5660
+ wait_for_same_request: "wait_for_same_request";
5661
+ quarantine_then_prepare: "quarantine_then_prepare";
5662
+ cleanup_quarantine_then_prepare: "cleanup_quarantine_then_prepare";
5663
+ refuse_conflict: "refuse_conflict";
5664
+ }>;
5665
+ reason: z.ZodEnum<{
5666
+ projection_absent: "projection_absent";
5667
+ projection_exact_match: "projection_exact_match";
5668
+ projection_staging_same_request: "projection_staging_same_request";
5669
+ projection_staging_conflict: "projection_staging_conflict";
5670
+ projection_stale: "projection_stale";
5671
+ projection_quarantined: "projection_quarantined";
5672
+ projection_invalid: "projection_invalid";
5673
+ projection_interrupted: "projection_interrupted";
5674
+ projection_conflicting: "projection_conflicting";
5675
+ }>;
5676
+ selection_allowed: z.ZodBoolean;
5677
+ mutation_required: z.ZodBoolean;
5678
+ selected_manifest_digest: z.ZodOptional<z.ZodString>;
5679
+ next_actions: z.ZodArray<z.ZodEnum<{
5680
+ prepare_projection_staging: "prepare_projection_staging";
5681
+ reuse_projection: "reuse_projection";
5682
+ retry_after_active_request: "retry_after_active_request";
5683
+ quarantine_observed_projection: "quarantine_observed_projection";
5684
+ cleanup_quarantined_projection: "cleanup_quarantined_projection";
5685
+ stop_and_report_conflict: "stop_and_report_conflict";
5686
+ }>>;
5687
+ }, z.core.$strip>>;
5688
+ type NativeWslProjectionPlan_v1 = z.infer<typeof NativeWslProjectionPlan_v1>;
5689
+ declare function planNativeWslProjection(requestInput: NativeWslProjectionRequest_v1, observationInput: NativeWslProjectionInventoryObservation_v1): NativeWslProjectionPlan_v1;
5690
+
5691
+ type CommandAction = "source_root" | "source_remote" | "source_head" | "source_object_exists" | "source_object_type" | "source_status" | "clone_nonlocal" | "fetch_exact_object" | "verify_projected_object" | "checkout_exact_object" | "remove_projection_remote" | "list_projection_branches" | "remove_projection_branch" | "verify_projection_head" | "verify_projection_status";
5692
+ interface NativeWslProjectionCommandEvidence {
5693
+ action: CommandAction;
5694
+ argvHash: string;
5695
+ outcome: "passed" | "failed";
5696
+ exitCode: number | null;
5697
+ stdoutHash: string;
5698
+ stderrHash: string;
5699
+ durationMs: number;
5700
+ }
5701
+ interface NativeWslProjectionSuccess {
5702
+ ok: true;
5703
+ outcome: "prepared" | "reused";
5704
+ manifest: NativeWslProjectionManifest_v1;
5705
+ receipt: NativeWslProjectionReceipt_v1;
5706
+ sourceObservation: NativeWslSourceObservation_v1;
5707
+ selection: NativeWslProjectionSelection_v1;
5708
+ broker: GitWorktreeBroker;
5709
+ commandEvidence: NativeWslProjectionCommandEvidence[];
5710
+ recoveredReason?: NativeWslProjectionReasonCode;
5711
+ }
5712
+ interface NativeWslProjectionFailure {
5713
+ ok: false;
5714
+ outcome: "rejected" | "quarantined";
5715
+ reasonCode: Exclude<NativeWslProjectionReasonCode, "projection_prepared" | "projection_reused">;
5716
+ receipt: NativeWslProjectionReceipt_v1;
5717
+ sourceObservation?: NativeWslSourceObservation_v1;
5718
+ commandEvidence: NativeWslProjectionCommandEvidence[];
5719
+ }
5720
+ type NativeWslProjectionResult = NativeWslProjectionSuccess | NativeWslProjectionFailure;
5721
+ type NativeWslProjectionLifecycleState = "absent" | "preparing" | "ready" | "ready_unselected" | "stale" | "invalid" | "conflicting";
5722
+ interface NativeWslProjectionQuarantineSummary {
5723
+ count: number;
5724
+ entryDigests: string[];
5725
+ truncated: boolean;
5726
+ }
5727
+ interface NativeWslProjectionInspection {
5728
+ state: NativeWslProjectionLifecycleState;
5729
+ projectionId: string;
5730
+ requestDigest: string;
5731
+ manifestDigest?: string;
5732
+ selectionDigest?: string;
5733
+ mappingDigest?: string;
5734
+ sourceObservationDigest?: string;
5735
+ activeWorktreeCount: number;
5736
+ quarantine: {
5737
+ repository: NativeWslProjectionQuarantineSummary;
5738
+ allocation: NativeWslProjectionQuarantineSummary;
5739
+ };
5740
+ commandEvidence: NativeWslProjectionCommandEvidence[];
5741
+ }
5742
+ type NativeWslProjectionCleanupReason = "cleanup_complete" | "projection_absent" | "active_worktrees" | "concurrent_request" | "state_quarantined" | "cleanup_failed";
5743
+ interface NativeWslProjectionCleanupResult {
5744
+ outcome: "cleaned" | "absent" | "refused" | "quarantined" | "failed";
5745
+ reasonCode: NativeWslProjectionCleanupReason;
5746
+ projectionId: string;
5747
+ requestDigest: string;
5748
+ removed: {
5749
+ repository: boolean;
5750
+ allocation: boolean;
5751
+ quarantineEntries: number;
5752
+ };
5753
+ remainingQuarantine: number;
5754
+ }
5755
+
5756
+ interface WorkerSessionStatusResult {
5757
+ workerSession: WorkerSessionRecord | null;
5758
+ adapter: BoundedWorkerAdapterStatus | null;
5759
+ pathMapping: null | {
5760
+ state: "bound" | "invalid";
5761
+ kind?: "native_wsl_projection" | "native_linux";
5762
+ mappingDigest?: string;
5763
+ };
5764
+ }
5765
+ interface BoundedWorkerAdapterStatus extends WorkerAdapterBindingRecord {
5766
+ enforcement: "enforced" | "trust_gap";
5767
+ }
5768
+
5769
+ interface AttemptLaunchBundleSuccess {
5770
+ ok: true;
5771
+ outcome: "launch_bundle_ready";
5772
+ lifecycle: AgentWorkLifecycleSuccess;
5773
+ packet: AgentTaskPacket_v1;
5774
+ envelope: ExecutionEnvelope_v1;
5775
+ }
5776
+ type AttemptLaunchBundleResult = AttemptLaunchBundleSuccess | AgentWorkLifecycleFailure;
5777
+
5778
+ declare const AttemptStartRequestJsonSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
5779
+ runtime: z.ZodObject<{
5780
+ databasePath: z.ZodString;
5781
+ repositoryId: z.ZodString;
5782
+ repositoryRoot: z.ZodString;
5783
+ worktreeRoot: z.ZodString;
5784
+ hostId: z.ZodString;
5785
+ gitRuntime: z.ZodString;
5786
+ pathComparison: z.ZodEnum<{
5787
+ "case-sensitive": "case-sensitive";
5788
+ "case-insensitive": "case-insensitive";
5789
+ }>;
5790
+ gitExecutable: z.ZodOptional<z.ZodString>;
5791
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
5792
+ maxDirtyPaths: z.ZodOptional<z.ZodNumber>;
5793
+ }, z.core.$strict>;
5794
+ attempt: z.ZodObject<{
5795
+ runId: z.ZodString;
5796
+ initialRunState: z.ZodObject<{
5797
+ runId: z.ZodString;
5798
+ mode: z.ZodString;
5799
+ procedure: z.ZodString;
5800
+ repo: z.ZodString;
5801
+ task: z.ZodOptional<z.ZodString>;
5802
+ state: z.ZodString;
5803
+ createdAt: z.ZodString;
5804
+ updatedAt: z.ZodString;
5805
+ completedAt: z.ZodOptional<z.ZodString>;
5806
+ completedSteps: z.ZodArray<z.ZodString>;
5807
+ currentStep: z.ZodNullable<z.ZodString>;
5808
+ params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
5809
+ metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
5810
+ persona: z.ZodOptional<z.ZodObject<{
5811
+ mode: z.ZodString;
5812
+ forbidden: z.ZodArray<z.ZodString>;
5813
+ completionGates: z.ZodArray<z.ZodString>;
5814
+ decisionStyle: z.ZodOptional<z.ZodObject<{
5815
+ preferSmallDiffs: z.ZodOptional<z.ZodBoolean>;
5816
+ requireRationaleForSkips: z.ZodOptional<z.ZodBoolean>;
5817
+ escalateSecurityFindings: z.ZodOptional<z.ZodBoolean>;
5818
+ }, z.core.$strip>>;
5819
+ outputFormat: z.ZodOptional<z.ZodObject<{
5820
+ severityLevels: z.ZodOptional<z.ZodArray<z.ZodString>>;
5821
+ requireSeverityOnFindings: z.ZodOptional<z.ZodBoolean>;
5822
+ }, z.core.$strip>>;
5823
+ }, z.core.$strip>>;
5824
+ }, z.core.$strip>;
5825
+ controller: z.ZodObject<{
5826
+ controllerId: z.ZodString;
5827
+ leaseId: z.ZodString;
5828
+ now: z.ZodString;
5829
+ ttlMs: z.ZodNumber;
5830
+ }, z.core.$strict>;
5831
+ attempt: z.ZodObject<{
5832
+ attemptId: z.ZodString;
5833
+ workItemId: z.ZodString;
5834
+ workItemRevision: z.ZodNumber;
5835
+ packetId: z.ZodString;
5836
+ packetHash: z.ZodString;
5837
+ baseSha: z.ZodString;
5838
+ }, z.core.$strict>;
5839
+ workspace: z.ZodObject<{
5840
+ workspaceLeaseId: z.ZodString;
5841
+ repositoryId: z.ZodString;
5842
+ hostId: z.ZodString;
5843
+ gitRuntime: z.ZodString;
5844
+ projectRoot: z.ZodString;
5845
+ branch: z.ZodString;
5846
+ worktreePath: z.ZodString;
5847
+ ttlMs: z.ZodNumber;
5848
+ }, z.core.$strict>;
5849
+ mutations: z.ZodObject<{
5850
+ createAttempt: z.ZodObject<{
5851
+ mutationId: z.ZodString;
5852
+ now: z.ZodString;
5853
+ }, z.core.$strict>;
5854
+ reserveWorkspace: z.ZodObject<{
5855
+ mutationId: z.ZodString;
5856
+ now: z.ZodString;
5857
+ }, z.core.$strict>;
5858
+ activateWorkspace: z.ZodObject<{
5859
+ mutationId: z.ZodString;
5860
+ now: z.ZodString;
5861
+ }, z.core.$strict>;
5862
+ resumeWorkspace: z.ZodObject<{
5863
+ mutationId: z.ZodString;
5864
+ now: z.ZodString;
5865
+ }, z.core.$strict>;
5866
+ quarantineWorkspace: z.ZodObject<{
5867
+ mutationId: z.ZodString;
5868
+ now: z.ZodString;
5869
+ }, z.core.$strict>;
5870
+ authorizeLaunch: z.ZodObject<{
5871
+ mutationId: z.ZodString;
5872
+ now: z.ZodString;
5873
+ }, z.core.$strict>;
5874
+ }, z.core.$strict>;
5875
+ broker: z.ZodOptional<z.ZodObject<{
4274
5876
  timeoutMs: z.ZodNumber;
4275
5877
  }, z.core.$strict>>;
4276
5878
  }, z.core.$strict>;
@@ -4373,17 +5975,20 @@ declare const AttemptPrepareRequestJsonSchema: z.core.ZodStandardJSONSchemaPaylo
4373
5975
  executionRoot: z.ZodString;
4374
5976
  exposedEnvironmentKeys: z.ZodArray<z.ZodString>;
4375
5977
  createdAt: z.ZodString;
5978
+ projection: z.ZodOptional<z.ZodObject<{
5979
+ selectionDigest: z.ZodString;
5980
+ }, z.core.$strict>>;
4376
5981
  }, z.core.$strict>;
4377
5982
  attempt: z.ZodObject<{
5983
+ broker: z.ZodOptional<z.ZodObject<{
5984
+ timeoutMs: z.ZodNumber;
5985
+ }, z.core.$strict>>;
4378
5986
  controller: z.ZodObject<{
4379
5987
  controllerId: z.ZodString;
4380
5988
  leaseId: z.ZodString;
4381
5989
  now: z.ZodString;
4382
5990
  ttlMs: z.ZodNumber;
4383
5991
  }, z.core.$strict>;
4384
- broker: z.ZodOptional<z.ZodObject<{
4385
- timeoutMs: z.ZodNumber;
4386
- }, z.core.$strict>>;
4387
5992
  initialRunState: z.ZodObject<{
4388
5993
  runId: z.ZodString;
4389
5994
  mode: z.ZodString;
@@ -4482,6 +6087,308 @@ interface AttemptPreparationHandler {
4482
6087
  /** Top-level lifecycle seam. Every request owns and closes its SQLite connection. */
4483
6088
  declare function createAttemptLifecycleHandlers(): AttemptLifecycleHandlers & AttemptPreparationHandler;
4484
6089
 
6090
+ declare const NativeWslProjectionPrepareRequestSchema: z.ZodObject<{
6091
+ request: z.ZodPreprocess<z.ZodObject<{
6092
+ request_digest: z.ZodString;
6093
+ schema_version: z.ZodLiteral<"1.0.0">;
6094
+ request_id: z.ZodString;
6095
+ repository: z.ZodPreprocess<z.ZodObject<{
6096
+ id: z.ZodString;
6097
+ expected_remote_hash: z.ZodString;
6098
+ }, z.core.$strip>>;
6099
+ source: z.ZodPreprocess<z.ZodObject<{
6100
+ windows_runtime: z.ZodString;
6101
+ windows_repository_path: z.ZodString;
6102
+ wsl_distribution: z.ZodString;
6103
+ wsl_git_runtime: z.ZodString;
6104
+ wsl_repository_path: z.ZodString;
6105
+ head_policy: z.ZodEnum<{
6106
+ observe: "observe";
6107
+ require_base: "require_base";
6108
+ }>;
6109
+ dirty_policy: z.ZodEnum<{
6110
+ require_clean: "require_clean";
6111
+ committed_base_only: "committed_base_only";
6112
+ }>;
6113
+ }, z.core.$strip>>;
6114
+ native: z.ZodPreprocess<z.ZodObject<{
6115
+ host_id: z.ZodString;
6116
+ git_runtime: z.ZodString;
6117
+ projection_root: z.ZodString;
6118
+ worktree_root: z.ZodString;
6119
+ }, z.core.$strip>>;
6120
+ base_sha: z.ZodString;
6121
+ }, z.core.$strip>>;
6122
+ mutation: z.ZodObject<{
6123
+ authorized: z.ZodLiteral<true>;
6124
+ reason: z.ZodOptional<z.ZodString>;
6125
+ }, z.core.$strict>;
6126
+ }, z.core.$strict>;
6127
+ declare const NativeWslProjectionStatusRequestSchema: z.ZodObject<{
6128
+ request: z.ZodPreprocess<z.ZodObject<{
6129
+ request_digest: z.ZodString;
6130
+ schema_version: z.ZodLiteral<"1.0.0">;
6131
+ request_id: z.ZodString;
6132
+ repository: z.ZodPreprocess<z.ZodObject<{
6133
+ id: z.ZodString;
6134
+ expected_remote_hash: z.ZodString;
6135
+ }, z.core.$strip>>;
6136
+ source: z.ZodPreprocess<z.ZodObject<{
6137
+ windows_runtime: z.ZodString;
6138
+ windows_repository_path: z.ZodString;
6139
+ wsl_distribution: z.ZodString;
6140
+ wsl_git_runtime: z.ZodString;
6141
+ wsl_repository_path: z.ZodString;
6142
+ head_policy: z.ZodEnum<{
6143
+ observe: "observe";
6144
+ require_base: "require_base";
6145
+ }>;
6146
+ dirty_policy: z.ZodEnum<{
6147
+ require_clean: "require_clean";
6148
+ committed_base_only: "committed_base_only";
6149
+ }>;
6150
+ }, z.core.$strip>>;
6151
+ native: z.ZodPreprocess<z.ZodObject<{
6152
+ host_id: z.ZodString;
6153
+ git_runtime: z.ZodString;
6154
+ projection_root: z.ZodString;
6155
+ worktree_root: z.ZodString;
6156
+ }, z.core.$strip>>;
6157
+ base_sha: z.ZodString;
6158
+ }, z.core.$strip>>;
6159
+ }, z.core.$strict>;
6160
+ declare const NativeWslProjectionCleanupRequestSchema: z.ZodObject<{
6161
+ request: z.ZodPreprocess<z.ZodObject<{
6162
+ request_digest: z.ZodString;
6163
+ schema_version: z.ZodLiteral<"1.0.0">;
6164
+ request_id: z.ZodString;
6165
+ repository: z.ZodPreprocess<z.ZodObject<{
6166
+ id: z.ZodString;
6167
+ expected_remote_hash: z.ZodString;
6168
+ }, z.core.$strip>>;
6169
+ source: z.ZodPreprocess<z.ZodObject<{
6170
+ windows_runtime: z.ZodString;
6171
+ windows_repository_path: z.ZodString;
6172
+ wsl_distribution: z.ZodString;
6173
+ wsl_git_runtime: z.ZodString;
6174
+ wsl_repository_path: z.ZodString;
6175
+ head_policy: z.ZodEnum<{
6176
+ observe: "observe";
6177
+ require_base: "require_base";
6178
+ }>;
6179
+ dirty_policy: z.ZodEnum<{
6180
+ require_clean: "require_clean";
6181
+ committed_base_only: "committed_base_only";
6182
+ }>;
6183
+ }, z.core.$strip>>;
6184
+ native: z.ZodPreprocess<z.ZodObject<{
6185
+ host_id: z.ZodString;
6186
+ git_runtime: z.ZodString;
6187
+ projection_root: z.ZodString;
6188
+ worktree_root: z.ZodString;
6189
+ }, z.core.$strip>>;
6190
+ base_sha: z.ZodString;
6191
+ }, z.core.$strip>>;
6192
+ mutation: z.ZodObject<{
6193
+ authorized: z.ZodLiteral<true>;
6194
+ reason: z.ZodOptional<z.ZodString>;
6195
+ }, z.core.$strict>;
6196
+ includeQuarantine: z.ZodOptional<z.ZodBoolean>;
6197
+ }, z.core.$strict>;
6198
+ declare const NativeWslProjectionPrepareRequestJsonSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
6199
+ request: z.ZodPreprocess<z.ZodObject<{
6200
+ request_digest: z.ZodString;
6201
+ schema_version: z.ZodLiteral<"1.0.0">;
6202
+ request_id: z.ZodString;
6203
+ repository: z.ZodPreprocess<z.ZodObject<{
6204
+ id: z.ZodString;
6205
+ expected_remote_hash: z.ZodString;
6206
+ }, z.core.$strip>>;
6207
+ source: z.ZodPreprocess<z.ZodObject<{
6208
+ windows_runtime: z.ZodString;
6209
+ windows_repository_path: z.ZodString;
6210
+ wsl_distribution: z.ZodString;
6211
+ wsl_git_runtime: z.ZodString;
6212
+ wsl_repository_path: z.ZodString;
6213
+ head_policy: z.ZodEnum<{
6214
+ observe: "observe";
6215
+ require_base: "require_base";
6216
+ }>;
6217
+ dirty_policy: z.ZodEnum<{
6218
+ require_clean: "require_clean";
6219
+ committed_base_only: "committed_base_only";
6220
+ }>;
6221
+ }, z.core.$strip>>;
6222
+ native: z.ZodPreprocess<z.ZodObject<{
6223
+ host_id: z.ZodString;
6224
+ git_runtime: z.ZodString;
6225
+ projection_root: z.ZodString;
6226
+ worktree_root: z.ZodString;
6227
+ }, z.core.$strip>>;
6228
+ base_sha: z.ZodString;
6229
+ }, z.core.$strip>>;
6230
+ mutation: z.ZodObject<{
6231
+ authorized: z.ZodLiteral<true>;
6232
+ reason: z.ZodOptional<z.ZodString>;
6233
+ }, z.core.$strict>;
6234
+ }, z.core.$strict>>;
6235
+ declare const NativeWslProjectionStatusRequestJsonSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
6236
+ request: z.ZodPreprocess<z.ZodObject<{
6237
+ request_digest: z.ZodString;
6238
+ schema_version: z.ZodLiteral<"1.0.0">;
6239
+ request_id: z.ZodString;
6240
+ repository: z.ZodPreprocess<z.ZodObject<{
6241
+ id: z.ZodString;
6242
+ expected_remote_hash: z.ZodString;
6243
+ }, z.core.$strip>>;
6244
+ source: z.ZodPreprocess<z.ZodObject<{
6245
+ windows_runtime: z.ZodString;
6246
+ windows_repository_path: z.ZodString;
6247
+ wsl_distribution: z.ZodString;
6248
+ wsl_git_runtime: z.ZodString;
6249
+ wsl_repository_path: z.ZodString;
6250
+ head_policy: z.ZodEnum<{
6251
+ observe: "observe";
6252
+ require_base: "require_base";
6253
+ }>;
6254
+ dirty_policy: z.ZodEnum<{
6255
+ require_clean: "require_clean";
6256
+ committed_base_only: "committed_base_only";
6257
+ }>;
6258
+ }, z.core.$strip>>;
6259
+ native: z.ZodPreprocess<z.ZodObject<{
6260
+ host_id: z.ZodString;
6261
+ git_runtime: z.ZodString;
6262
+ projection_root: z.ZodString;
6263
+ worktree_root: z.ZodString;
6264
+ }, z.core.$strip>>;
6265
+ base_sha: z.ZodString;
6266
+ }, z.core.$strip>>;
6267
+ }, z.core.$strict>>;
6268
+ declare const NativeWslProjectionCleanupRequestJsonSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
6269
+ request: z.ZodPreprocess<z.ZodObject<{
6270
+ request_digest: z.ZodString;
6271
+ schema_version: z.ZodLiteral<"1.0.0">;
6272
+ request_id: z.ZodString;
6273
+ repository: z.ZodPreprocess<z.ZodObject<{
6274
+ id: z.ZodString;
6275
+ expected_remote_hash: z.ZodString;
6276
+ }, z.core.$strip>>;
6277
+ source: z.ZodPreprocess<z.ZodObject<{
6278
+ windows_runtime: z.ZodString;
6279
+ windows_repository_path: z.ZodString;
6280
+ wsl_distribution: z.ZodString;
6281
+ wsl_git_runtime: z.ZodString;
6282
+ wsl_repository_path: z.ZodString;
6283
+ head_policy: z.ZodEnum<{
6284
+ observe: "observe";
6285
+ require_base: "require_base";
6286
+ }>;
6287
+ dirty_policy: z.ZodEnum<{
6288
+ require_clean: "require_clean";
6289
+ committed_base_only: "committed_base_only";
6290
+ }>;
6291
+ }, z.core.$strip>>;
6292
+ native: z.ZodPreprocess<z.ZodObject<{
6293
+ host_id: z.ZodString;
6294
+ git_runtime: z.ZodString;
6295
+ projection_root: z.ZodString;
6296
+ worktree_root: z.ZodString;
6297
+ }, z.core.$strip>>;
6298
+ base_sha: z.ZodString;
6299
+ }, z.core.$strip>>;
6300
+ mutation: z.ZodObject<{
6301
+ authorized: z.ZodLiteral<true>;
6302
+ reason: z.ZodOptional<z.ZodString>;
6303
+ }, z.core.$strict>;
6304
+ includeQuarantine: z.ZodOptional<z.ZodBoolean>;
6305
+ }, z.core.$strict>>;
6306
+ declare const NativeWslProjectionQuarantineRequestJsonSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
6307
+ request: z.ZodPreprocess<z.ZodObject<{
6308
+ request_digest: z.ZodString;
6309
+ schema_version: z.ZodLiteral<"1.0.0">;
6310
+ request_id: z.ZodString;
6311
+ repository: z.ZodPreprocess<z.ZodObject<{
6312
+ id: z.ZodString;
6313
+ expected_remote_hash: z.ZodString;
6314
+ }, z.core.$strip>>;
6315
+ source: z.ZodPreprocess<z.ZodObject<{
6316
+ windows_runtime: z.ZodString;
6317
+ windows_repository_path: z.ZodString;
6318
+ wsl_distribution: z.ZodString;
6319
+ wsl_git_runtime: z.ZodString;
6320
+ wsl_repository_path: z.ZodString;
6321
+ head_policy: z.ZodEnum<{
6322
+ observe: "observe";
6323
+ require_base: "require_base";
6324
+ }>;
6325
+ dirty_policy: z.ZodEnum<{
6326
+ require_clean: "require_clean";
6327
+ committed_base_only: "committed_base_only";
6328
+ }>;
6329
+ }, z.core.$strip>>;
6330
+ native: z.ZodPreprocess<z.ZodObject<{
6331
+ host_id: z.ZodString;
6332
+ git_runtime: z.ZodString;
6333
+ projection_root: z.ZodString;
6334
+ worktree_root: z.ZodString;
6335
+ }, z.core.$strip>>;
6336
+ base_sha: z.ZodString;
6337
+ }, z.core.$strip>>;
6338
+ }, z.core.$strict>>;
6339
+ type NativeWslProjectionPrepareRequest = z.infer<typeof NativeWslProjectionPrepareRequestSchema>;
6340
+ type NativeWslProjectionStatusRequest = z.infer<typeof NativeWslProjectionStatusRequestSchema>;
6341
+ type NativeWslProjectionCleanupRequest = z.infer<typeof NativeWslProjectionCleanupRequestSchema>;
6342
+ type NativeWslProjectionPublicNextAction = "prepare_projection" | "retry_projection_status" | "prepare_attempt" | "inspect_quarantine" | "cleanup_projection" | "remove_active_worktrees" | "correct_projection_request";
6343
+ interface NativeWslProjectionPrepareResult {
6344
+ schemaVersion: "1.0.0";
6345
+ operation: "agent-work.projection.prepare";
6346
+ outcome: NativeWslProjectionResult["outcome"];
6347
+ state: "ready" | "rejected" | "quarantined";
6348
+ reasonCode: NativeWslProjectionReasonCode;
6349
+ projectionId: string;
6350
+ requestDigest: string;
6351
+ selectionDigest?: string;
6352
+ manifestDigest?: string;
6353
+ mappingDigest?: string;
6354
+ sourceObservationDigest?: string;
6355
+ commandEvidence: NativeWslProjectionCommandEvidence[];
6356
+ nextActions: NativeWslProjectionPublicNextAction[];
6357
+ }
6358
+ interface NativeWslProjectionStatusResult extends Omit<NativeWslProjectionInspection, "commandEvidence"> {
6359
+ schemaVersion: "1.0.0";
6360
+ operation: "agent-work.projection.status";
6361
+ commandEvidence: NativeWslProjectionCommandEvidence[];
6362
+ nextActions: NativeWslProjectionPublicNextAction[];
6363
+ }
6364
+ interface NativeWslProjectionQuarantineResult {
6365
+ schemaVersion: "1.0.0";
6366
+ operation: "agent-work.projection.quarantine.inspect";
6367
+ projectionId: string;
6368
+ requestDigest: string;
6369
+ state: NativeWslProjectionInspection["state"];
6370
+ quarantine: NativeWslProjectionInspection["quarantine"];
6371
+ nextActions: NativeWslProjectionPublicNextAction[];
6372
+ }
6373
+ interface NativeWslProjectionCleanupPublicResult extends NativeWslProjectionCleanupResult {
6374
+ schemaVersion: "1.0.0";
6375
+ operation: "agent-work.projection.cleanup";
6376
+ nextActions: NativeWslProjectionPublicNextAction[];
6377
+ }
6378
+ interface ProjectionLifecycleEngine {
6379
+ prepare(request: NativeWslProjectionPrepareRequest["request"]): Promise<NativeWslProjectionResult>;
6380
+ inspect(request: NativeWslProjectionStatusRequest["request"]): Promise<NativeWslProjectionInspection>;
6381
+ cleanup(request: NativeWslProjectionCleanupRequest["request"], includeQuarantine?: boolean): Promise<NativeWslProjectionCleanupResult>;
6382
+ }
6383
+ interface NativeWslProjectionLifecycleHandlers {
6384
+ prepare(request: unknown): Promise<AgentWorkHandlerResult<NativeWslProjectionPrepareResult>>;
6385
+ status(request: unknown): Promise<AgentWorkHandlerResult<NativeWslProjectionStatusResult>>;
6386
+ cleanup(request: unknown): Promise<AgentWorkHandlerResult<NativeWslProjectionCleanupPublicResult>>;
6387
+ quarantine(request: unknown): Promise<AgentWorkHandlerResult<NativeWslProjectionQuarantineResult>>;
6388
+ }
6389
+ /** One bounded application seam shared by the projection CLI and MCP adapters. */
6390
+ declare function createNativeWslProjectionLifecycleHandlers(engine?: ProjectionLifecycleEngine): NativeWslProjectionLifecycleHandlers;
6391
+
4485
6392
  declare const AttemptWorkerAttachRequestJsonSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
4486
6393
  runtime: z.ZodObject<{
4487
6394
  databasePath: z.ZodString;
@@ -4525,12 +6432,97 @@ declare const AttemptWorkerAttachRequestJsonSchema: z.core.ZodStandardJSONSchema
4525
6432
  paths: z.ZodObject<{
4526
6433
  project_root: z.ZodString;
4527
6434
  execution_root: z.ZodString;
6435
+ allocation_root: z.ZodOptional<z.ZodString>;
4528
6436
  worktree_root: z.ZodString;
4529
6437
  }, z.core.$strict>;
4530
- path_mappings: z.ZodArray<z.ZodObject<{
4531
- runtime: z.ZodString;
4532
- worktree_root: z.ZodString;
4533
- }, z.core.$strict>>;
6438
+ path_mappings: z.ZodArray<z.ZodUnion<readonly [z.ZodPreprocess<z.ZodObject<{
6439
+ mapping_digest: z.ZodString;
6440
+ schema_version: z.ZodLiteral<"1.0.0">;
6441
+ projection_id: z.ZodString;
6442
+ repository_id: z.ZodString;
6443
+ base_sha: z.ZodString;
6444
+ native_host_id: z.ZodString;
6445
+ request_digest: z.ZodString;
6446
+ projection_digest: z.ZodString;
6447
+ projection_mapping_digest: z.ZodString;
6448
+ roots: z.ZodPreprocess<z.ZodObject<{
6449
+ windows_source: z.ZodPreprocess<z.ZodObject<{
6450
+ runtime_id: z.ZodString;
6451
+ path: z.ZodString;
6452
+ verification: z.ZodLiteral<"declared">;
6453
+ }, z.core.$strip>>;
6454
+ wsl_source: z.ZodPreprocess<z.ZodObject<{
6455
+ runtime_id: z.ZodString;
6456
+ path: z.ZodString;
6457
+ verification: z.ZodLiteral<"git_observed">;
6458
+ observation_digest: z.ZodString;
6459
+ }, z.core.$strip>>;
6460
+ native_repository: z.ZodPreprocess<z.ZodObject<{
6461
+ runtime_id: z.ZodString;
6462
+ path: z.ZodString;
6463
+ verification: z.ZodLiteral<"directory_identity">;
6464
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
6465
+ device: z.ZodString;
6466
+ inode: z.ZodString;
6467
+ }, z.core.$strip>>;
6468
+ }, z.core.$strip>>;
6469
+ native_allocation_root: z.ZodPreprocess<z.ZodObject<{
6470
+ runtime_id: z.ZodString;
6471
+ path: z.ZodString;
6472
+ verification: z.ZodLiteral<"directory_identity">;
6473
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
6474
+ device: z.ZodString;
6475
+ inode: z.ZodString;
6476
+ }, z.core.$strip>>;
6477
+ }, z.core.$strip>>;
6478
+ native_worktree: z.ZodPreprocess<z.ZodObject<{
6479
+ runtime_id: z.ZodString;
6480
+ path: z.ZodString;
6481
+ verification: z.ZodLiteral<"directory_identity">;
6482
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
6483
+ device: z.ZodString;
6484
+ inode: z.ZodString;
6485
+ }, z.core.$strip>>;
6486
+ }, z.core.$strip>>;
6487
+ }, z.core.$strip>>;
6488
+ }, z.core.$strip>>, z.ZodPreprocess<z.ZodObject<{
6489
+ mapping_digest: z.ZodString;
6490
+ schema_version: z.ZodLiteral<"1.0.0">;
6491
+ mapping_kind: z.ZodLiteral<"native_linux">;
6492
+ repository_id: z.ZodString;
6493
+ base_sha: z.ZodString;
6494
+ native_host_id: z.ZodString;
6495
+ git_runtime: z.ZodString;
6496
+ roots: z.ZodPreprocess<z.ZodObject<{
6497
+ native_repository: z.ZodPreprocess<z.ZodObject<{
6498
+ runtime_id: z.ZodString;
6499
+ path: z.ZodString;
6500
+ verification: z.ZodLiteral<"directory_identity">;
6501
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
6502
+ device: z.ZodString;
6503
+ inode: z.ZodString;
6504
+ }, z.core.$strip>>;
6505
+ }, z.core.$strip>>;
6506
+ native_allocation_root: z.ZodPreprocess<z.ZodObject<{
6507
+ runtime_id: z.ZodString;
6508
+ path: z.ZodString;
6509
+ verification: z.ZodLiteral<"directory_identity">;
6510
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
6511
+ device: z.ZodString;
6512
+ inode: z.ZodString;
6513
+ }, z.core.$strip>>;
6514
+ }, z.core.$strip>>;
6515
+ native_worktree: z.ZodPreprocess<z.ZodObject<{
6516
+ runtime_id: z.ZodString;
6517
+ path: z.ZodString;
6518
+ verification: z.ZodLiteral<"directory_identity">;
6519
+ directory_identity: z.ZodPreprocess<z.ZodObject<{
6520
+ device: z.ZodString;
6521
+ inode: z.ZodString;
6522
+ }, z.core.$strip>>;
6523
+ }, z.core.$strip>>;
6524
+ }, z.core.$strip>>;
6525
+ }, z.core.$strip>>]>>;
4534
6526
  exposed_environment_keys: z.ZodArray<z.ZodString>;
4535
6527
  created_at: z.ZodString;
4536
6528
  }, z.core.$strict>;
@@ -4761,7 +6753,7 @@ interface AttemptAcceptanceStatusResult {
4761
6753
  };
4762
6754
  }
4763
6755
 
4764
- type FanoutServiceStore = AgentWorkFanoutStore & WorkspaceLifecycleStore & AttemptReceiptStore & AttemptVerificationStore;
6756
+ type FanoutServiceStore = AgentWorkFanoutStore & WorkspaceLifecycleStore & LaunchEnvelopeBindingStore & WorkerSessionStore & AttemptReceiptStore & AttemptVerificationStore;
4765
6757
  interface CreateAgentWorkFanoutInput {
4766
6758
  runId: string;
4767
6759
  expectedRunRevision: number;
@@ -5868,8 +7860,8 @@ interface GateExecutionServiceResult {
5868
7860
  executionState: ExecutionState;
5869
7861
  }
5870
7862
  declare class GateExecutionServiceError extends Error {
5871
- readonly code: "GATE_EXECUTION_FAILED" | "GATE_RESULT_LIMIT_EXCEEDED";
5872
- constructor(code: "GATE_EXECUTION_FAILED" | "GATE_RESULT_LIMIT_EXCEEDED", message: string);
7863
+ readonly code: "GATE_EXECUTION_FAILED" | "GATE_RESULT_LIMIT_EXCEEDED" | "GATE_SELECTION_NOT_FOUND";
7864
+ constructor(code: "GATE_EXECUTION_FAILED" | "GATE_RESULT_LIMIT_EXCEEDED" | "GATE_SELECTION_NOT_FOUND", message: string);
5873
7865
  }
5874
7866
  /** One bounded transport-neutral owner for canonical CLI and MCP gate execution. */
5875
7867
  declare class GateExecutionService {
@@ -6072,6 +8064,45 @@ declare class MergeApplicationService {
6072
8064
  }>;
6073
8065
  }
6074
8066
 
8067
+ type PlanArtifactSource = "explicit" | "repository-root" | "profile-runner";
8068
+ interface PlanArtifactIdentity {
8069
+ contract: "plan-artifact-identity-v1";
8070
+ kind: "execution-plan";
8071
+ schema: "lexrunner.execution-plan";
8072
+ schemaVersion: string;
8073
+ digest: string;
8074
+ target: string;
8075
+ itemCount: number;
8076
+ }
8077
+ interface ResolvedPlanArtifact {
8078
+ plan: Plan;
8079
+ identity: PlanArtifactIdentity;
8080
+ source: PlanArtifactSource;
8081
+ /** Adapter-only location. It is deliberately excluded from the public identity. */
8082
+ filePath: string;
8083
+ }
8084
+ type PlanArtifactFailureCode = "PLAN_REFERENCE_INVALID" | "PLAN_NOT_FOUND" | "PLAN_UNREADABLE" | "PLAN_ARTIFACT_LIMIT_EXCEEDED";
8085
+ declare class PlanArtifactServiceError extends Error {
8086
+ readonly code: PlanArtifactFailureCode;
8087
+ readonly source?: PlanArtifactSource | undefined;
8088
+ constructor(code: PlanArtifactFailureCode, message: string, source?: PlanArtifactSource | undefined);
8089
+ }
8090
+ interface ResolvePlanArtifactInput {
8091
+ planFile?: string;
8092
+ workingDir?: string;
8093
+ profileDir?: string;
8094
+ }
8095
+ /**
8096
+ * Resolve one immutable integration plan without creating mutable "active plan" state.
8097
+ *
8098
+ * Precedence is explicit reference, repository-root plan.json, then the legacy
8099
+ * profile runner plan. An explicit reference is authoritative: a bad explicit
8100
+ * path never falls through to another plan.
8101
+ */
8102
+ declare class PlanArtifactService {
8103
+ resolve(input?: ResolvePlanArtifactInput): ResolvedPlanArtifact;
8104
+ }
8105
+
6075
8106
  /**
6076
8107
  * Environmental Hostility Scoring
6077
8108
  *
@@ -6461,4 +8492,4 @@ declare function createWorkflowGuide(phase: WorkflowPhase): WorkflowGuide;
6461
8492
  declare function inspectRegisteredCliSurface(): RegisteredCliCommand[];
6462
8493
  declare function main(argv?: string[]): Promise<void>;
6463
8494
 
6464
- export { AGENT_ENGINE_VERIFICATION_V2_VERSION, AGENT_TASK_RECEIPT_PATCH_PROFILE, AGENT_TASK_RECEIPT_V2_VERSION, AGENT_WORK_CONTRACT_VERSION, AgentEngineVerification_v1, AgentEngineVerification_v2, type AgentTaskPacketHashInput, AgentTaskPacketHashInput_v1, AgentTaskPacket_v1, type AgentTaskReceiptBindingContext, AgentTaskReceiptOutcome, type AgentTaskReceiptV2BindingContext, AgentTaskReceipt_v1, AgentTaskReceipt_v2, AgentWorkFanInDecision_v1, type AgentWorkFanInResult, AgentWorkFanoutPlan_v1, AgentWorkFanoutService, type AgentWorkPreparationCommandResult, type AgentWorkPreparationCommandRunner, AgentWorkPreparationReceipt_v1, type AgentWorkPreparationResult, AttemptAcceptanceApplyRequestJsonSchema, AttemptAcceptanceStatusRequestJsonSchema, AttemptPrepareRequestJsonSchema, AttemptReceiptStatusRequestJsonSchema, AttemptReceiptSubmitRequestJsonSchema, AttemptRetryDeltaDimension_v1, AttemptRetryDelta_v1, AttemptStartRequestJsonSchema, AttemptStatus, AttemptStatusInputJsonSchema, AttemptVerificationRunRequestJsonSchema, AttemptVerificationStatusRequestJsonSchema, AttemptWorkerAttachRequestJsonSchema, AttemptWorkerEndRequestJsonSchema, AttemptWorkerHeartbeatRequestJsonSchema, AttemptWorkerStatusRequestJsonSchema, Attempt_v1, AuthorityEnvelope, type BoundedDiscoveryResult, type BoundedGateRunResult, type BoundedIntegrationStatus, type BoundedMergeApplicationResult, type BoundedMergeOrderResult, ClaimedCheckOutcome, ConfigurationQueryService, ControllerLease_v1, type CreateAgentWorkFanoutInput, type DecideAgentWorkFanInInput, DiscoveryQueryService, EngineVerificationCheckSource_v2, EngineVerificationDeterminism_v2, EngineVerificationTrustGapReason_v2, type ExecuteAgentWorkPreparationInput, ExecutionEnvelope_v1, ExecutionEnvironmentOS, ExecutionState, FanInCandidateConclusion_v1, FanoutAttemptBinding_v1, FanoutPremise_v1, FanoutRationale_v1, FanoutSelectionCriterion_v1, GATE_IMPACT_MODEL, GateExecutionService, GateExecutionServiceError, type GateExecutionServiceInput, type GateExecutionServiceResult, GateImpactService, GateImpactServiceError, GitHubAPI, GitObjectId, HumanActionPreconditions, HumanActionReceipt_v1, HumanActionRequest_v1, INTEGRATION_RECORD_REMOVAL_VERSION, INTEGRATION_RECORD_REPLACEMENTS, IntegrationQueryServiceError, IntegrationRecordCompatibilityError, IntegrationRecordCompatibilityService, IntegrationStatusQueryService, type MergeApplicationExecution, type MergeApplicationFailureCode, type MergeApplicationRuntime, MergeApplicationService, MergeApplicationServiceError, MergeEligibilityEvaluator, MergeOrderQueryService, type MultiRepoPlanOptions$1 as MultiRepoPlanOptions, PlanCreationService, type RepoTarget, RunStatus, Run_v1, STRICT_FANOUT_SELECTION_CRITERIA, VerificationOutcome, WorkItem_v1, WorkerSessionBackend, WorkerSessionStatus, WorkerSession_v1, WorkspaceAllocationStatus, WorkspaceAllocation_v1, WorkspaceCleanupDisposition, WorkspaceConfigServiceError, WorkspaceDiagnosticsService, WorkspaceInitializationService, WorkspaceLeaseStatus, WorkspaceLease_v1, applyGateImpactSelection, attemptStatusRequiresReceipt, attemptStatusRequiresVerification, bootstrapWorkspace, canonicalJSONStringify, computeAgentEngineVerificationV2Hash, computeAgentTaskPacketHash, computeFanInEvidenceSetHash, computeMergeOrder, createAgentTaskPacket, createAttemptLifecycleHandlers, createAttemptReceiptHandlers, createAttemptVerificationHandlers, createAttemptWorkerHandlers, createFileAnalyzer, createGitHubAPI, createGitHubClient, createGitOperations, createRunManager, createWorkflowGuide, detectProjectType, executeAgentWorkPreparation, executeGatesWithPolicy, generateGitHubSnapshot, generateMultiRepoPlan, generatePlan, generatePlanFromGitHub, generateSnapshot, getEnvironmentSuggestions, healthChecker, initLocalOverlay, inspectRegisteredCliSurface, isTerminalAttemptStatus, loadInputs, loadPlan, main, orderAgentWorkPreparationSteps, parseAgentEngineVerification, parseAgentEngineVerificationV2, parseAgentTaskPacket, parseAgentTaskReceipt, parseAgentTaskReceiptV2, parseAttempt, parseControllerLease, parseExecutionEnvelope, parseHumanActionReceipt, parseHumanActionRequest, parseRun, parseWorkItem, parseWorkerSession, parseWorkspaceAllocation, parseWorkspaceLease, resolveProfile, validateAgentEngineVerificationV2PacketReferences, validateAgentTaskReceiptBinding, validateAgentTaskReceiptV2Binding, validateAgentTaskReceiptV2PacketReferences, validateHumanActionReceiptBinding, writeGateImpactReceipt };
8495
+ export { AGENT_ENGINE_VERIFICATION_V2_VERSION, AGENT_TASK_RECEIPT_PATCH_PROFILE, AGENT_TASK_RECEIPT_V2_VERSION, AGENT_WORK_CONTRACT_VERSION, AgentEngineVerification_v1, AgentEngineVerification_v2, type AgentExecutionPathBindingContext, type AgentExecutionPathBindingValidation, AgentExecutionPathMapping_v1, type AgentTaskPacketHashInput, AgentTaskPacketHashInput_v1, AgentTaskPacket_v1, type AgentTaskReceiptBindingContext, AgentTaskReceiptOutcome, type AgentTaskReceiptV2BindingContext, AgentTaskReceipt_v1, AgentTaskReceipt_v2, AgentWorkContainmentPreflightRequestJsonSchema, AgentWorkFanInDecision_v1, type AgentWorkFanInResult, AgentWorkFanoutPlan_v1, AgentWorkFanoutService, type AgentWorkPreparationCommandResult, type AgentWorkPreparationCommandRunner, AgentWorkPreparationReceipt_v1, type AgentWorkPreparationResult, AttemptAcceptanceApplyRequestJsonSchema, AttemptAcceptanceStatusRequestJsonSchema, AttemptPrepareRequestJsonSchema, AttemptReceiptStatusRequestJsonSchema, AttemptReceiptSubmitRequestJsonSchema, AttemptRetryDeltaDimension_v1, AttemptRetryDelta_v1, AttemptStartRequestJsonSchema, AttemptStatus, AttemptStatusInputJsonSchema, AttemptVerificationRunRequestJsonSchema, AttemptVerificationStatusRequestJsonSchema, AttemptWorkerAttachRequestJsonSchema, AttemptWorkerEndRequestJsonSchema, AttemptWorkerHeartbeatRequestJsonSchema, AttemptWorkerStatusRequestJsonSchema, Attempt_v1, AuthorityEnvelope, type BoundedDiscoveryResult, type BoundedGateRunResult, type BoundedIntegrationStatus, type BoundedMergeApplicationResult, type BoundedMergeOrderResult, ClaimedCheckOutcome, ConfigurationQueryService, ControllerLease_v1, type CreateAgentWorkFanoutInput, type DecideAgentWorkFanInInput, DiscoveryQueryService, EngineVerificationCheckSource_v2, EngineVerificationDeterminism_v2, EngineVerificationTrustGapReason_v2, type ExecuteAgentWorkPreparationInput, ExecutionEnvelope_v1, ExecutionEnvironmentOS, ExecutionState, FanInCandidateConclusion_v1, FanoutAttemptBinding_v1, FanoutPremise_v1, FanoutRationale_v1, FanoutSelectionCriterion_v1, GATE_IMPACT_MODEL, GateExecutionService, GateExecutionServiceError, type GateExecutionServiceInput, type GateExecutionServiceResult, GateImpactService, GateImpactServiceError, GitHubAPI, GitObjectId, HumanActionPreconditions, HumanActionReceipt_v1, HumanActionRequest_v1, INTEGRATION_RECORD_REMOVAL_VERSION, INTEGRATION_RECORD_REPLACEMENTS, IntegrationQueryServiceError, IntegrationRecordCompatibilityError, IntegrationRecordCompatibilityService, IntegrationStatusQueryService, type MergeApplicationExecution, type MergeApplicationFailureCode, type MergeApplicationRuntime, MergeApplicationService, MergeApplicationServiceError, MergeEligibilityEvaluator, MergeOrderQueryService, type MultiRepoPlanOptions$1 as MultiRepoPlanOptions, NATIVE_WSL_PROJECTION_CONTRACT_VERSION, NATIVE_WSL_PROJECTION_HASH_PROFILE, NativeDirectoryIdentityClaim_v1, NativeExecutionPathMapping_v1, NativeWslExecutionPathMapping_v1, NativeWslProjectionCleanupRequestJsonSchema, NativeWslProjectionInventoryObservation_v1, NativeWslProjectionInventoryState, NativeWslProjectionManifest_v1, NativeWslProjectionNextAction, NativeWslProjectionOutcome, NativeWslProjectionPathMapping_v1, NativeWslProjectionPlanAction, NativeWslProjectionPlanReason, NativeWslProjectionPlan_v1, NativeWslProjectionPrepareRequestJsonSchema, NativeWslProjectionQuarantineRequestJsonSchema, NativeWslProjectionReasonCode, NativeWslProjectionReceipt_v1, NativeWslProjectionRequestJsonSchema, NativeWslProjectionRequest_v1, NativeWslProjectionSelection_v1, NativeWslProjectionStatusRequestJsonSchema, NativeWslSourceObservation_v1, type PlanArtifactFailureCode, type PlanArtifactIdentity, PlanArtifactService, PlanArtifactServiceError, type PlanArtifactSource, PlanCreationService, type RepoTarget, type ResolvePlanArtifactInput, type ResolvedPlanArtifact, RunStatus, Run_v1, STRICT_FANOUT_SELECTION_CRITERIA, VerificationOutcome, WorkItem_v1, WorkerSessionBackend, WorkerSessionStatus, WorkerSession_v1, WorkspaceAllocationStatus, WorkspaceAllocation_v1, WorkspaceCleanupDisposition, WorkspaceConfigServiceError, WorkspaceDiagnosticsService, WorkspaceInitializationService, WorkspaceLeaseStatus, WorkspaceLease_v1, applyGateImpactSelection, asPlanValidationFailure, attemptStatusRequiresReceipt, attemptStatusRequiresVerification, bootstrapWorkspace, canonicalJSONStringify, computeAgentEngineVerificationV2Hash, computeAgentTaskPacketHash, computeFanInEvidenceSetHash, computeMergeOrder, createAgentTaskPacket, createAgentWorkContainmentPreflightHandler, createAttemptLifecycleHandlers, createAttemptReceiptHandlers, createAttemptVerificationHandlers, createAttemptWorkerHandlers, createFileAnalyzer, createGitHubAPI, createGitHubClient, createGitOperations, createNativeExecutionPathMapping, createNativeWslExecutionPathMapping, createNativeWslProjectionLifecycleHandlers, createNativeWslProjectionManifest, createNativeWslProjectionPathMapping, createNativeWslProjectionReceipt, createNativeWslProjectionRequest, createNativeWslProjectionSelection, createNativeWslSourceObservation, createRunManager, createWorkflowGuide, detectProjectType, executeAgentWorkPreparation, executeGatesWithPolicy, formatPlanValidationFailure, formatPlanValidationFailureText, generateGitHubSnapshot, generateMultiRepoPlan, generatePlan, generatePlanFromGitHub, generateSnapshot, getEnvironmentSuggestions, healthChecker, initLocalOverlay, inspectRegisteredCliSurface, isTerminalAttemptStatus, loadInputs, loadPlan, main, nativeWslProjectionId, orderAgentWorkPreparationSteps, parseAgentEngineVerification, parseAgentEngineVerificationV2, parseAgentTaskPacket, parseAgentTaskReceipt, parseAgentTaskReceiptV2, parseAttempt, parseControllerLease, parseExecutionEnvelope, parseHumanActionReceipt, parseHumanActionRequest, parseRun, parseWorkItem, parseWorkerSession, parseWorkspaceAllocation, parseWorkspaceLease, planNativeWslProjection, resolveProfile, validateAgentEngineVerificationV2PacketReferences, validateAgentExecutionPathBinding, validateAgentTaskReceiptBinding, validateAgentTaskReceiptV2Binding, validateAgentTaskReceiptV2PacketReferences, validateHumanActionReceiptBinding, writeGateImpactReceipt };