@claudexor/cli 3.6.0 → 3.8.1

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.
Files changed (141) hide show
  1. package/dist/accounts-projection.d.ts +4 -2
  2. package/dist/accounts-projection.d.ts.map +1 -1
  3. package/dist/accounts-projection.js +49 -2
  4. package/dist/accounts-projection.js.map +1 -1
  5. package/dist/accounts-services.d.ts +7 -1
  6. package/dist/accounts-services.d.ts.map +1 -1
  7. package/dist/accounts-services.js +7 -2
  8. package/dist/accounts-services.js.map +1 -1
  9. package/dist/agy-quota-source.d.ts +2 -0
  10. package/dist/agy-quota-source.d.ts.map +1 -1
  11. package/dist/agy-quota-source.js +83 -108
  12. package/dist/agy-quota-source.js.map +1 -1
  13. package/dist/capabilities.d.ts.map +1 -1
  14. package/dist/capabilities.js +6 -1
  15. package/dist/capabilities.js.map +1 -1
  16. package/dist/claudexord-entry.d.ts +7 -2
  17. package/dist/claudexord-entry.d.ts.map +1 -1
  18. package/dist/claudexord-entry.js +33 -11
  19. package/dist/claudexord-entry.js.map +1 -1
  20. package/dist/claudexord.d.ts.map +1 -1
  21. package/dist/claudexord.js +9 -12
  22. package/dist/claudexord.js.map +1 -1
  23. package/dist/cli-io.d.ts +1 -0
  24. package/dist/cli-io.d.ts.map +1 -1
  25. package/dist/cli-io.js +14 -0
  26. package/dist/cli-io.js.map +1 -1
  27. package/dist/cli.js +12 -18
  28. package/dist/cli.js.map +1 -1
  29. package/dist/command-flags.d.ts.map +1 -1
  30. package/dist/command-flags.js +3 -2
  31. package/dist/command-flags.js.map +1 -1
  32. package/dist/control-services.d.ts +824 -806
  33. package/dist/control-services.d.ts.map +1 -1
  34. package/dist/control-services.js +4 -16
  35. package/dist/control-services.js.map +1 -1
  36. package/dist/credential-commands.d.ts +17 -0
  37. package/dist/credential-commands.d.ts.map +1 -1
  38. package/dist/credential-commands.js +62 -14
  39. package/dist/credential-commands.js.map +1 -1
  40. package/dist/credential-profile-mutations.d.ts +9 -0
  41. package/dist/credential-profile-mutations.d.ts.map +1 -1
  42. package/dist/credential-profile-mutations.js +63 -31
  43. package/dist/credential-profile-mutations.js.map +1 -1
  44. package/dist/credential-status-invalidation.d.ts +2 -0
  45. package/dist/credential-status-invalidation.d.ts.map +1 -1
  46. package/dist/credential-status-invalidation.js +10 -0
  47. package/dist/credential-status-invalidation.js.map +1 -1
  48. package/dist/delegation-belt-descriptor.d.ts +2 -1
  49. package/dist/delegation-belt-descriptor.d.ts.map +1 -1
  50. package/dist/delegation-belt-descriptor.js +2 -1
  51. package/dist/delegation-belt-descriptor.js.map +1 -1
  52. package/dist/harness-command-specs.d.ts.map +1 -1
  53. package/dist/harness-command-specs.js +4 -4
  54. package/dist/harness-command-specs.js.map +1 -1
  55. package/dist/harness-command.d.ts +5 -3
  56. package/dist/harness-command.d.ts.map +1 -1
  57. package/dist/harness-command.js +5 -3
  58. package/dist/harness-command.js.map +1 -1
  59. package/dist/harness-install-lease.d.ts +11 -0
  60. package/dist/harness-install-lease.d.ts.map +1 -0
  61. package/dist/harness-install-lease.js +98 -0
  62. package/dist/harness-install-lease.js.map +1 -0
  63. package/dist/harness-install-proof.d.ts +36 -0
  64. package/dist/harness-install-proof.d.ts.map +1 -0
  65. package/dist/harness-install-proof.js +148 -0
  66. package/dist/harness-install-proof.js.map +1 -0
  67. package/dist/harness-install-recipes.d.ts +80 -0
  68. package/dist/harness-install-recipes.d.ts.map +1 -0
  69. package/dist/harness-install-recipes.js +130 -0
  70. package/dist/harness-install-recipes.js.map +1 -0
  71. package/dist/harness-installer.d.ts +45 -46
  72. package/dist/harness-installer.d.ts.map +1 -1
  73. package/dist/harness-installer.js +248 -156
  74. package/dist/harness-installer.js.map +1 -1
  75. package/dist/mcp-run-projections.d.ts +1 -1
  76. package/dist/native-login.d.ts +7 -0
  77. package/dist/native-login.d.ts.map +1 -1
  78. package/dist/native-login.js +29 -13
  79. package/dist/native-login.js.map +1 -1
  80. package/dist/profile-registration.d.ts +2 -0
  81. package/dist/profile-registration.d.ts.map +1 -1
  82. package/dist/profile-registration.js +49 -6
  83. package/dist/profile-registration.js.map +1 -1
  84. package/dist/quota-services.d.ts +2 -2
  85. package/dist/remote-command.d.ts +0 -2
  86. package/dist/remote-command.d.ts.map +1 -1
  87. package/dist/remote-command.js +3 -74
  88. package/dist/remote-command.js.map +1 -1
  89. package/dist/request-preflight.d.ts +1 -1
  90. package/dist/request-preflight.d.ts.map +1 -1
  91. package/dist/request-preflight.js +35 -11
  92. package/dist/request-preflight.js.map +1 -1
  93. package/dist/retry-command.d.ts.map +1 -1
  94. package/dist/retry-command.js +4 -0
  95. package/dist/retry-command.js.map +1 -1
  96. package/dist/setup-attach-command.d.ts +30 -0
  97. package/dist/setup-attach-command.d.ts.map +1 -0
  98. package/dist/setup-attach-command.js +118 -0
  99. package/dist/setup-attach-command.js.map +1 -0
  100. package/dist/setup-job-control-services.d.ts +2064 -0
  101. package/dist/setup-job-control-services.d.ts.map +1 -0
  102. package/dist/setup-job-control-services.js +33 -0
  103. package/dist/setup-job-control-services.js.map +1 -0
  104. package/dist/setup-job-store.d.ts +2 -2
  105. package/dist/setup-job-support.d.ts +23 -13
  106. package/dist/setup-job-support.d.ts.map +1 -1
  107. package/dist/setup-job-support.js +55 -13
  108. package/dist/setup-job-support.js.map +1 -1
  109. package/dist/setup-jobs.d.ts +4 -4
  110. package/dist/setup-jobs.d.ts.map +1 -1
  111. package/dist/setup-jobs.js +50 -47
  112. package/dist/setup-jobs.js.map +1 -1
  113. package/dist/setup-login-capability.d.ts +37 -0
  114. package/dist/setup-login-capability.d.ts.map +1 -0
  115. package/dist/setup-login-capability.js +96 -0
  116. package/dist/setup-login-capability.js.map +1 -0
  117. package/dist/setup-login-io.d.ts +4 -1
  118. package/dist/setup-login-io.d.ts.map +1 -1
  119. package/dist/setup-login-io.js +22 -3
  120. package/dist/setup-login-io.js.map +1 -1
  121. package/dist/setup-login-pty.d.ts +64 -22
  122. package/dist/setup-login-pty.d.ts.map +1 -1
  123. package/dist/setup-login-pty.js +289 -48
  124. package/dist/setup-login-pty.js.map +1 -1
  125. package/dist/setup-login-runner-support.d.ts +12 -0
  126. package/dist/setup-login-runner-support.d.ts.map +1 -0
  127. package/dist/setup-login-runner-support.js +65 -0
  128. package/dist/setup-login-runner-support.js.map +1 -0
  129. package/dist/setup-login-runner.d.ts +3 -0
  130. package/dist/setup-login-runner.d.ts.map +1 -1
  131. package/dist/setup-login-runner.js +133 -116
  132. package/dist/setup-login-runner.js.map +1 -1
  133. package/dist/setup-runner-outcome.d.ts +10 -0
  134. package/dist/setup-runner-outcome.d.ts.map +1 -0
  135. package/dist/setup-runner-outcome.js +49 -0
  136. package/dist/setup-runner-outcome.js.map +1 -0
  137. package/dist/thread-execution-workspace.d.ts +11 -6
  138. package/dist/thread-execution-workspace.d.ts.map +1 -1
  139. package/dist/thread-execution-workspace.js +52 -6
  140. package/dist/thread-execution-workspace.js.map +1 -1
  141. package/package.json +24 -24
@@ -80,6 +80,9 @@ resources: () => ResourceStore, quotaRegistry: () => QuotaRegistry, daemonJobs:
80
80
  remediation: string | null;
81
81
  requiresFullAccess: boolean;
82
82
  };
83
+ setupLogin: {
84
+ mode: "external_terminal" | "in_app";
85
+ } | null;
83
86
  readiness: {
84
87
  id: string;
85
88
  kind: "auth" | "binary" | "model" | "probe" | "smoke";
@@ -133,7 +136,7 @@ resources: () => ResourceStore, quotaRegistry: () => QuotaRegistry, daemonJobs:
133
136
  plan_label: string | null;
134
137
  subject_id: string | null;
135
138
  };
136
- reason: "auth_revoked" | "no_source" | "not_logged_in" | "platform_unsupported" | "refresh_failed" | "transport_unavailable";
139
+ reason: "auth_revoked" | "credential_profile_ambiguous" | "no_source" | "not_logged_in" | "platform_unsupported" | "refresh_failed" | "transport_unavailable";
137
140
  detail: string | null;
138
141
  observed_at: string;
139
142
  }[];
@@ -172,6 +175,8 @@ resources: () => ResourceStore, quotaRegistry: () => QuotaRegistry, daemonJobs:
172
175
  availability: "available" | "unavailable" | "unknown";
173
176
  verification: "failed" | "not_run" | "passed";
174
177
  verification_source: "local_store" | "vendor";
178
+ stale?: boolean | undefined;
179
+ stale_age_ms?: number | undefined;
175
180
  detail?: string | undefined;
176
181
  last_verified_at: string | null;
177
182
  };
@@ -189,6 +194,11 @@ resources: () => ResourceStore, quotaRegistry: () => QuotaRegistry, daemonJobs:
189
194
  };
190
195
  removed: boolean;
191
196
  credentialCleanup: "config_dir_removed" | "none" | "secret_deleted";
197
+ vendorCredentialDisposition?: {
198
+ owner: "vendor";
199
+ state: "left_unchanged";
200
+ scope: "os_user" | "profile";
201
+ } | undefined;
192
202
  }>;
193
203
  quota: () => Promise<{
194
204
  snapshots: {
@@ -229,7 +239,7 @@ resources: () => ResourceStore, quotaRegistry: () => QuotaRegistry, daemonJobs:
229
239
  plan_label: string | null;
230
240
  subject_id: string | null;
231
241
  };
232
- reason: "auth_revoked" | "no_source" | "not_logged_in" | "platform_unsupported" | "refresh_failed" | "transport_unavailable";
242
+ reason: "auth_revoked" | "credential_profile_ambiguous" | "no_source" | "not_logged_in" | "platform_unsupported" | "refresh_failed" | "transport_unavailable";
233
243
  detail: string | null;
234
244
  observed_at: string;
235
245
  }[];
@@ -274,631 +284,34 @@ resources: () => ResourceStore, quotaRegistry: () => QuotaRegistry, daemonJobs:
274
284
  plan_label: string | null;
275
285
  subject_id: string | null;
276
286
  };
277
- reason: "auth_revoked" | "no_source" | "not_logged_in" | "platform_unsupported" | "refresh_failed" | "transport_unavailable";
287
+ reason: "auth_revoked" | "credential_profile_ambiguous" | "no_source" | "not_logged_in" | "platform_unsupported" | "refresh_failed" | "transport_unavailable";
278
288
  detail: string | null;
279
289
  observed_at: string;
280
290
  }[];
281
291
  refreshed_at: string | null;
282
292
  }>;
283
- listDirectory?: (path?: string) => Promise<import("@claudexor/schema").ControlDirectoryListing>;
284
- fetchProjectFile?: (projectId: string, path: string) => Promise<import("./remote-filesystem.js").ScopedProjectFile>;
285
- threadDetail: (id: string) => Promise<{
286
- thread: unknown;
287
- sessions: unknown[];
288
- turns: unknown[];
289
- }>;
290
- createThreadTurn: (id: string, prompt: string, options: {
291
- kind?: unknown;
292
- parentRunId?: string | null;
293
- answersPlanRunId?: string | null;
294
- planRunId?: string | null;
295
- planHash?: string | null;
296
- planOverridden?: boolean;
297
- attachments?: ResourceAttachmentRef[];
298
- idempotency?: {
299
- key: string;
300
- client: string;
301
- request: unknown;
302
- };
303
- }) => Promise<{
304
- id: string;
305
- thread_id: string;
306
- run_id: string | null;
307
- parent_run_id: string | null;
308
- answers_plan_run_id: string | null;
309
- plan_run_id: string | null;
310
- plan_hash: string | null;
311
- plan_readiness_overridden: boolean;
312
- kind: "decision" | "followup" | "initial";
313
- prompt: string;
314
- attachments: {
315
- resource_id: string;
316
- kind: "file" | "image";
317
- mime: string;
318
- name: string;
319
- sha256: string;
320
- size_bytes: number;
321
- path: string;
322
- }[];
323
- enqueue_error: {
324
- message: string;
325
- code: string | null;
326
- retryable: boolean;
327
- required_actions: string[];
328
- context: Record<string, unknown>;
329
- failed_at: string;
330
- } | null;
331
- continuity: {
332
- kind: "fresh" | "native_resume" | "packet";
333
- packet_turns: number;
334
- summarized: boolean;
335
- lane_switched_from: {
336
- harness_id: string;
337
- profile_id: string | null;
338
- } | null;
339
- } | null;
340
- created_at: string;
341
- }>;
342
- findThreadTurnByIdempotency: (id: string, idempotency: {
343
- key: string;
344
- client: string;
293
+ createSetupJob: (input: {
345
294
  request: unknown;
295
+ idempotencyKey: string;
296
+ clientId: string;
346
297
  }) => Promise<{
347
- id: string;
348
- thread_id: string;
349
- run_id: string | null;
350
- parent_run_id: string | null;
351
- answers_plan_run_id: string | null;
352
- plan_run_id: string | null;
353
- plan_hash: string | null;
354
- plan_readiness_overridden: boolean;
355
- kind: "decision" | "followup" | "initial";
356
- prompt: string;
357
- attachments: {
358
- resource_id: string;
359
- kind: "file" | "image";
360
- mime: string;
361
- name: string;
362
- sha256: string;
363
- size_bytes: number;
364
- path: string;
365
- }[];
366
- enqueue_error: {
367
- message: string;
368
- code: string | null;
369
- retryable: boolean;
370
- required_actions: string[];
371
- context: Record<string, unknown>;
372
- failed_at: string;
373
- } | null;
374
- continuity: {
375
- kind: "fresh" | "native_resume" | "packet";
376
- packet_turns: number;
377
- summarized: boolean;
378
- lane_switched_from: {
379
- harness_id: string;
380
- profile_id: string | null;
381
- } | null;
382
- } | null;
383
- created_at: string;
384
- } | null>;
385
- setTurnEnqueueError: (turnId: string, problem: import("@claudexor/schema").TurnEnqueueProblem) => void;
386
- preflightRunRequirements: (request: ControlRunStartRequest) => Promise<void>;
387
- preflightThreadRunRequirements: (request: ControlRunStartRequest) => Promise<void>;
388
- createUpload: (input: unknown, idempotencyKey: string) => Promise<{
389
- uploadId: string;
390
- state: "cancelled" | "open" | "uploaded" | "uploading";
391
- receivedBytes: number;
392
- expectedBytes: number;
393
- }>;
394
- writeUpload: (uploadId: string, chunks: AsyncIterable<Uint8Array>) => Promise<{
395
- uploadId: string;
396
- state: "cancelled" | "open" | "uploaded" | "uploading";
397
- receivedBytes: number;
398
- expectedBytes: number;
399
- }>;
400
- uploadStatus: (uploadId: string) => Promise<{
401
- uploadId: string;
402
- state: "cancelled" | "open" | "uploaded" | "uploading";
403
- receivedBytes: number;
404
- expectedBytes: number;
405
- }>;
406
- cancelUpload: (uploadId: string) => Promise<{
407
- uploadId: string;
408
- state: "cancelled" | "open" | "uploaded" | "uploading";
409
- receivedBytes: number;
410
- expectedBytes: number;
411
- }>;
412
- finalizeUpload: (uploadId: string, expectedSha256: string | undefined, idempotencyKey: string) => Promise<{
413
- resourceId: string;
414
- kind: "file" | "image";
415
- mime: string;
416
- name: string;
417
- sha256: string;
418
- sizeBytes: number;
419
- createdAt: string;
420
- deduplicated: boolean;
421
- }>;
422
- validateResources: (refs: ResourceAttachmentRef[]) => Promise<void>;
423
- runRetention: import("./retention-service.js").RetentionRunner;
424
- listProjects: () => Promise<{
425
- projects: unknown[];
426
- }>;
427
- registerProject: (input: Parameters<ProjectStore["register"]>[0]) => Promise<{
428
- schema_version: 2;
429
- id: string;
430
- root: string;
431
- created_at: string;
432
- updated_at: string;
433
- nesting: {
434
- relation: "inside" | "contains";
435
- root: string;
436
- projectId: string;
437
- }[];
438
- }>;
439
- relinkProject: (id: string, root: string) => Promise<{
440
- schema_version: 2;
441
- id: string;
442
- root: string;
443
- created_at: string;
444
- updated_at: string;
445
- nesting: {
446
- relation: "inside" | "contains";
447
- root: string;
448
- projectId: string;
449
- }[];
450
- }>;
451
- removeProject: (id: string) => Promise<{
452
- projectId: string;
453
- root: string;
454
- registryRemoved: true;
455
- journalPartitionArchived: boolean;
456
- archivedPartitionPath: string | null;
457
- artifactsRetained: true;
458
- activeRunCheck: "snapshot";
459
- }>;
460
- createThread: (input: unknown) => Promise<{
461
- schema_version: 2;
462
- id: string;
463
- created_at: string;
464
- updated_at: string;
465
- repo: {
466
- root: string;
467
- base_ref: string;
468
- } | null;
469
- title: string | null;
470
- mode: "agent" | "ask" | "plan";
471
- auth_preference: "api_key" | "auto" | "subscription";
472
- access: "external_sandbox_full" | "full" | "inherit_native" | "readonly" | "workspace_write" | null;
473
- credential_profile_id: string | null;
474
- primary_harness: string | null;
475
- eligible_harnesses: string[];
476
- workspace: {
477
- mode: "in_place" | "isolated";
478
- worktree_path: string | null;
479
- base_sha: string | null;
480
- delivered_through_run_id: string | null;
481
- };
482
- run_ids: string[];
483
- head_run_id: string | null;
484
- state: "active" | "closed" | "purged" | "trashed";
485
- trashed_at: string | null;
486
- purge_after: string | null;
487
- pre_trash_state: "active" | "closed" | null;
488
- }>;
489
- listThreads: () => Promise<{
490
- threads: unknown[];
491
- problems: unknown[];
492
- }>;
493
- updateThread: (id: string, patch: {
494
- title?: string;
495
- state?: string;
496
- primaryHarness?: string | null;
497
- credentialProfileId?: string | null;
498
- eligibleHarnesses?: string[];
499
- access?: string | null;
500
- }) => Promise<{
501
- schema_version: 2;
502
- id: string;
503
- created_at: string;
504
- updated_at: string;
505
- repo: {
506
- root: string;
507
- base_ref: string;
508
- } | null;
509
- title: string | null;
510
- mode: "agent" | "ask" | "plan";
511
- auth_preference: "api_key" | "auto" | "subscription";
512
- access: "external_sandbox_full" | "full" | "inherit_native" | "readonly" | "workspace_write" | null;
513
- credential_profile_id: string | null;
514
- primary_harness: string | null;
515
- eligible_harnesses: string[];
516
- workspace: {
517
- mode: "in_place" | "isolated";
518
- worktree_path: string | null;
519
- base_sha: string | null;
520
- delivered_through_run_id: string | null;
521
- };
522
- run_ids: string[];
523
- head_run_id: string | null;
524
- state: "active" | "closed" | "purged" | "trashed";
525
- trashed_at: string | null;
526
- purge_after: string | null;
527
- pre_trash_state: "active" | "closed" | null;
528
- }>;
529
- trashThread: (id: string) => Promise<{
530
- schema_version: 2;
531
- id: string;
532
- created_at: string;
533
- updated_at: string;
534
- repo: {
535
- root: string;
536
- base_ref: string;
537
- } | null;
538
- title: string | null;
539
- mode: "agent" | "ask" | "plan";
540
- auth_preference: "api_key" | "auto" | "subscription";
541
- access: "external_sandbox_full" | "full" | "inherit_native" | "readonly" | "workspace_write" | null;
542
- credential_profile_id: string | null;
543
- primary_harness: string | null;
544
- eligible_harnesses: string[];
545
- workspace: {
546
- mode: "in_place" | "isolated";
547
- worktree_path: string | null;
548
- base_sha: string | null;
549
- delivered_through_run_id: string | null;
550
- };
551
- run_ids: string[];
552
- head_run_id: string | null;
553
- state: "active" | "closed" | "purged" | "trashed";
554
- trashed_at: string | null;
555
- purge_after: string | null;
556
- pre_trash_state: "active" | "closed" | null;
557
- }>;
558
- restoreThread: (id: string) => Promise<{
559
- schema_version: 2;
560
- id: string;
561
- created_at: string;
562
- updated_at: string;
563
- repo: {
564
- root: string;
565
- base_ref: string;
566
- } | null;
567
- title: string | null;
568
- mode: "agent" | "ask" | "plan";
569
- auth_preference: "api_key" | "auto" | "subscription";
570
- access: "external_sandbox_full" | "full" | "inherit_native" | "readonly" | "workspace_write" | null;
571
- credential_profile_id: string | null;
572
- primary_harness: string | null;
573
- eligible_harnesses: string[];
574
- workspace: {
575
- mode: "in_place" | "isolated";
576
- worktree_path: string | null;
577
- base_sha: string | null;
578
- delivered_through_run_id: string | null;
579
- };
580
- run_ids: string[];
581
- head_run_id: string | null;
582
- state: "active" | "closed" | "purged" | "trashed";
583
- trashed_at: string | null;
584
- purge_after: string | null;
585
- pre_trash_state: "active" | "closed" | null;
586
- }>;
587
- purgeThread: (id: string) => Promise<{
588
- schema_version: 2;
589
- id: string;
590
- created_at: string;
591
- updated_at: string;
592
- repo: {
593
- root: string;
594
- base_ref: string;
595
- } | null;
596
- title: string | null;
597
- mode: "agent" | "ask" | "plan";
598
- auth_preference: "api_key" | "auto" | "subscription";
599
- access: "external_sandbox_full" | "full" | "inherit_native" | "readonly" | "workspace_write" | null;
600
- credential_profile_id: string | null;
601
- primary_harness: string | null;
602
- eligible_harnesses: string[];
603
- workspace: {
604
- mode: "in_place" | "isolated";
605
- worktree_path: string | null;
606
- base_sha: string | null;
607
- delivered_through_run_id: string | null;
608
- };
609
- run_ids: string[];
610
- head_run_id: string | null;
611
- state: "active" | "closed" | "purged" | "trashed";
612
- trashed_at: string | null;
613
- purge_after: string | null;
614
- pre_trash_state: "active" | "closed" | null;
615
- }>;
616
- applyThread: (id: string, opts: ThreadApplyOptions) => Promise<{
617
- applied: boolean;
618
- status: string;
619
- headMoved: boolean;
620
- detail: string | null;
621
- delivery: import("@claudexor/schema").ControlDeliveryResponse | null;
622
- }>;
623
- listTrust: typeof listTrustService;
624
- updateTrust: typeof updateTrustService;
625
- pendingInteractions: (runId: string) => {
626
- interactionId: string;
627
- runId: string;
628
- attemptId: string | null;
629
- harnessId: string | null;
630
- sourceTool: string | null;
631
- questions: {
632
- id: string;
633
- question: string;
634
- header: string | null;
635
- options: {
636
- label: string;
637
- description: string | null;
638
- }[];
639
- multi_select: boolean;
640
- }[];
641
- requestedAt: string;
642
- timeoutAt: string | null;
643
- }[];
644
- answerInteraction: (runId: string, interactionId: string, answers: unknown) => {
645
- status: import("@claudexor/daemon").InteractionAnswerStatus;
646
- message?: string;
647
- };
648
- operatorDecision: (runId: string, params: unknown) => OperatorDecisionRecord | null;
649
- findOperatorDecisionByIdempotency: (runId: string, params: unknown, idempotency: {
650
- key: string;
651
- client: string;
652
- request: unknown;
653
- }) => OperatorDecisionRecord | null;
654
- recordOperatorDecision: (runId: string, params: unknown, decision: Omit<OperatorDecisionRecord, "runId">, idempotency?: {
655
- key: string;
656
- client: string;
657
- request: unknown;
658
- }) => import("@claudexor/daemon").RecordedOperatorDecision;
659
- beginDelivery: (params: unknown, input: {
660
- key: string;
661
- client: string;
662
- operation: string;
663
- request: unknown;
664
- }) => Promise<{
665
- id: string;
666
- state: "cancelled" | "failed" | "interrupted" | "queued" | "running" | "succeeded";
667
- params: unknown;
668
- result?: unknown;
669
- error?: string;
670
- errorCode?: string;
671
- errorStatus?: number;
672
- errorRetryable?: boolean;
673
- errorRequiredActions?: string[];
674
- errorContext?: Record<string, unknown>;
675
- createdAt: string;
676
- runId?: string;
677
- taskId?: string;
678
- runDir?: string;
679
- startedAt?: string;
680
- finishedAt?: string;
681
- reused: boolean;
682
- }>;
683
- completeDelivery: (id: string, result: unknown) => Promise<void>;
684
- failDelivery: (id: string, error: unknown) => Promise<void>;
685
- harnesses: (input?: HarnessListInput) => Promise<{
686
- git: {
687
- status: "available" | "developer_tools_stub" | "failed" | "missing";
688
- version: string | null;
689
- detail: string | null;
690
- remediation: string | null;
691
- };
692
- harnesses: {
693
- id: string;
694
- available: boolean;
695
- status: "ok" | "degraded" | "unavailable";
696
- manifest: import("@claudexor/schema").HarnessManifest | null;
697
- enabledIntents: import("@claudexor/schema").Intent[];
698
- routableIntents: import("@claudexor/schema").Intent[];
699
- disabledIntents: import("@claudexor/schema").Intent[];
700
- checks: import("@claudexor/schema").ConformanceCheck[];
701
- reasons: string[];
702
- authSources: import("@claudexor/schema").AuthSourceReadiness[];
703
- configuredModel: string | null;
704
- configuredModelCheck: {
705
- status: "ok" | "rejected";
706
- message?: string | null;
707
- } | null;
708
- delegation: {
709
- available: boolean;
710
- reason: "manifest_unsupported" | "ready" | "runtime_unavailable";
711
- remediation: string | null;
712
- requiresFullAccess: boolean;
713
- };
714
- readiness: {
715
- id: string;
716
- kind: "auth" | "binary" | "model" | "probe" | "smoke";
717
- title: string;
718
- status: "fail" | "pass" | "skip";
719
- detail: string | null;
720
- }[];
721
- }[];
722
- }>;
723
- harnessModels: (input: {
724
- harnessId: string;
725
- route?: "local_session" | "api_key";
726
- }) => Promise<{
727
- harnessId: string;
728
- models: {
729
- id: string;
730
- label: string | null;
731
- context_window: number | null;
732
- routes: ("api_key" | "local_session")[] | null;
733
- }[];
734
- source: "api" | "manifest" | "none";
735
- verifiedAgainst: string | null;
736
- }>;
737
- authReadiness: (input: {
738
- harnessId: string;
739
- request: unknown;
740
- }) => Promise<{
741
- harnessId: string;
742
- authRequest: "api_key" | "auto" | "subscription";
743
- requestedSource: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file";
744
- observedAt: string;
745
- readiness: {
746
- source: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file";
747
- availability: "available" | "unavailable" | "unknown";
748
- verification: "failed" | "not_run" | "passed";
749
- detail?: string | undefined;
750
- };
751
- }>;
752
- agentCapabilities: () => Promise<{
753
- ok: true;
754
- version: string;
755
- generatedAt: string;
756
- git: {
757
- status: "available" | "developer_tools_stub" | "failed" | "missing";
758
- version: string | null;
759
- detail: string | null;
760
- remediation: string | null;
761
- };
762
- harnesses: {
763
- id: string;
764
- enabled: boolean;
765
- displayName: string;
766
- status: "degraded" | "ok" | "unavailable";
767
- providerFamily: "anthropic" | "cursor" | "google" | "local" | "openai" | "opencode" | "unknown" | "xai";
768
- enabledIntents: string[];
769
- disabledIntents: string[];
770
- reasons: string[];
771
- configuredModel: string | null;
772
- configuredModelValid: boolean | null;
773
- models: {
774
- source: "api" | "manifest" | "none";
775
- count: number;
776
- verifiedAgainst: string | null;
777
- };
778
- webPolicy: "native" | "none" | "tools" | "uncontrolled";
779
- attachmentInputs: {
780
- kind: "file" | "image";
781
- mime_types: string[];
782
- max_bytes: number;
783
- max_count: number;
784
- transport: "base64_inline" | "base64_stream" | "file_path" | "text_inline";
785
- }[];
786
- effortLevels: string[];
787
- accessProfilesSupported: ("external_sandbox_full" | "full" | "inherit_native" | "readonly" | "workspace_write")[];
788
- readonlyMechanism: "fs_sandbox" | "none" | "permission_deny" | "tool_allowlist";
789
- delegation: {
790
- available: boolean;
791
- reason: "manifest_unsupported" | "ready" | "runtime_unavailable";
792
- remediation: string | null;
793
- requiresFullAccess: boolean;
794
- };
795
- }[];
796
- availableHarnesses: string[];
797
- modes: ("agent" | "ask" | "plan")[];
798
- runControlKeys: string[];
799
- outputSchemaDialects: {
800
- dialect: "draft-07" | "draft-2020-12";
801
- uri: string;
802
- defaultWhenOmitted: boolean;
803
- }[];
804
- mutability: {
805
- readOnlyModes: ("agent" | "ask" | "plan")[];
806
- writeModes: ("agent" | "ask" | "plan")[];
807
- isolationKinds: ("envelope" | "live")[];
808
- workspaceModes: ("in_place" | "isolated")[];
809
- accessProfiles: ("external_sandbox_full" | "full" | "inherit_native" | "readonly" | "workspace_write")[];
810
- applyModes: ("apply" | "branch" | "commit" | "pr")[];
811
- };
812
- cliCommands: {
813
- id: string;
814
- mutability: "delivery" | "ops" | "read" | "write";
815
- stability: "experimental" | "stable";
816
- recovery: boolean;
817
- }[];
818
- mcpTools: string[];
819
- runApplyStates: string[];
820
- }>;
821
- runApplicability: (input: {
822
- repoRoot: string;
823
- }) => Promise<{
824
- repoRoot: string;
825
- git: {
826
- status: "available" | "developer_tools_stub" | "failed" | "missing";
827
- version: string | null;
828
- detail: string | null;
829
- remediation: string | null;
830
- };
831
- matrix: {
832
- in_place: {
833
- read_only: {
834
- applicable: boolean;
835
- requiresGit: boolean;
836
- code: "git_developer_tools_stub" | "git_failed" | "git_missing" | null;
837
- reason: string | null;
838
- remediation: string | null;
839
- };
840
- agent_convergence: {
841
- applicable: boolean;
842
- requiresGit: boolean;
843
- code: "git_developer_tools_stub" | "git_failed" | "git_missing" | null;
844
- reason: string | null;
845
- remediation: string | null;
846
- };
847
- agent_other: {
848
- applicable: boolean;
849
- requiresGit: boolean;
850
- code: "git_developer_tools_stub" | "git_failed" | "git_missing" | null;
851
- reason: string | null;
852
- remediation: string | null;
853
- };
854
- };
855
- isolated: {
856
- read_only: {
857
- applicable: boolean;
858
- requiresGit: boolean;
859
- code: "git_developer_tools_stub" | "git_failed" | "git_missing" | null;
860
- reason: string | null;
861
- remediation: string | null;
862
- };
863
- agent_convergence: {
864
- applicable: boolean;
865
- requiresGit: boolean;
866
- code: "git_developer_tools_stub" | "git_failed" | "git_missing" | null;
867
- reason: string | null;
868
- remediation: string | null;
869
- };
870
- agent_other: {
871
- applicable: boolean;
872
- requiresGit: boolean;
873
- code: "git_developer_tools_stub" | "git_failed" | "git_missing" | null;
874
- reason: string | null;
875
- remediation: string | null;
876
- };
877
- };
878
- };
879
- }>;
880
- createSetupJob: (input: {
881
- request: unknown;
882
- idempotencyKey: string;
883
- clientId: string;
884
- }) => Promise<{
885
- jobId: string;
886
- harness: "agy" | "claude" | "codex" | "cursor";
887
- action: "login";
888
- transport: "client_pty" | "daemon";
889
- profileId: string | null;
890
- state: "cancelled" | "failed" | "interrupted_unknown" | "not_supported" | "queued" | "running" | "succeeded" | "timed_out" | "waiting_for_input";
891
- phase: "awaiting_user" | "cancelling" | "completed" | "launching" | "preparing" | "verifying";
892
- deadlineAt?: string | undefined;
893
- deadlineFixed?: boolean | undefined;
894
- outcome?: {
895
- reason: "auth_not_ready" | "cancelled_by_user" | "cancelled_on_restart" | "capability_verification_failed" | "command_failed" | "completed" | "credential_route_mismatch" | "interrupted" | "interrupted_unknown" | "launch_failed" | "not_supported" | "termination_unconfirmed" | "timed_out";
896
- exitCode?: number | null | undefined;
897
- signal?: string | null | undefined;
898
- } | undefined;
899
- command: string | null;
900
- guideUrl: string | null;
901
- message: string;
298
+ jobId: string;
299
+ harness: "agy" | "claude" | "codex" | "cursor";
300
+ action: "login";
301
+ transport: "client_pty" | "daemon";
302
+ profileId: string | null;
303
+ state: "cancelled" | "failed" | "interrupted_unknown" | "not_supported" | "queued" | "running" | "succeeded" | "timed_out" | "waiting_for_input";
304
+ phase: "awaiting_user" | "cancelling" | "completed" | "launching" | "preparing" | "verifying";
305
+ deadlineAt?: string | undefined;
306
+ deadlineFixed?: boolean | undefined;
307
+ outcome?: {
308
+ reason: "auth_not_ready" | "cancelled_by_user" | "cancelled_on_restart" | "capability_verification_failed" | "command_failed" | "completed" | "credential_route_mismatch" | "interrupted" | "interrupted_unknown" | "launch_failed" | "not_supported" | "termination_unconfirmed" | "timed_out";
309
+ exitCode?: number | null | undefined;
310
+ signal?: string | null | undefined;
311
+ } | undefined;
312
+ command: string | null;
313
+ guideUrl: string | null;
314
+ message: string;
902
315
  createdAt: string;
903
316
  startedAt: string | null;
904
317
  finishedAt: string | null;
@@ -1056,7 +469,7 @@ resources: () => ResourceStore, quotaRegistry: () => QuotaRegistry, daemonJobs:
1056
469
  commandStarted: boolean;
1057
470
  exitCode: number | null;
1058
471
  signal: string | null;
1059
- errorCode?: "device_auth_unsupported" | "permit_timeout" | "spawn_failed" | undefined;
472
+ errorCode?: "device_auth_unsupported" | "permit_timeout" | "spawn_failed" | "terminal_transport_failed" | "terminal_transport_probe_failed" | "terminal_transport_unavailable" | "terminal_transport_unsupported" | undefined;
1060
473
  finishedAt: string;
1061
474
  } | undefined;
1062
475
  terminationReconciliation?: {
@@ -1240,7 +653,7 @@ resources: () => ResourceStore, quotaRegistry: () => QuotaRegistry, daemonJobs:
1240
653
  commandStarted: boolean;
1241
654
  exitCode: number | null;
1242
655
  signal: string | null;
1243
- errorCode?: "device_auth_unsupported" | "permit_timeout" | "spawn_failed" | undefined;
656
+ errorCode?: "device_auth_unsupported" | "permit_timeout" | "spawn_failed" | "terminal_transport_failed" | "terminal_transport_probe_failed" | "terminal_transport_unavailable" | "terminal_transport_unsupported" | undefined;
1244
657
  finishedAt: string;
1245
658
  } | undefined;
1246
659
  terminationReconciliation?: {
@@ -1424,7 +837,7 @@ resources: () => ResourceStore, quotaRegistry: () => QuotaRegistry, daemonJobs:
1424
837
  commandStarted: boolean;
1425
838
  exitCode: number | null;
1426
839
  signal: string | null;
1427
- errorCode?: "device_auth_unsupported" | "permit_timeout" | "spawn_failed" | undefined;
840
+ errorCode?: "device_auth_unsupported" | "permit_timeout" | "spawn_failed" | "terminal_transport_failed" | "terminal_transport_probe_failed" | "terminal_transport_unavailable" | "terminal_transport_unsupported" | undefined;
1428
841
  finishedAt: string;
1429
842
  } | undefined;
1430
843
  terminationReconciliation?: {
@@ -1609,7 +1022,7 @@ resources: () => ResourceStore, quotaRegistry: () => QuotaRegistry, daemonJobs:
1609
1022
  commandStarted: boolean;
1610
1023
  exitCode: number | null;
1611
1024
  signal: string | null;
1612
- errorCode?: "device_auth_unsupported" | "permit_timeout" | "spawn_failed" | undefined;
1025
+ errorCode?: "device_auth_unsupported" | "permit_timeout" | "spawn_failed" | "terminal_transport_failed" | "terminal_transport_probe_failed" | "terminal_transport_unavailable" | "terminal_transport_unsupported" | undefined;
1613
1026
  finishedAt: string;
1614
1027
  } | undefined;
1615
1028
  terminationReconciliation?: {
@@ -1795,7 +1208,7 @@ resources: () => ResourceStore, quotaRegistry: () => QuotaRegistry, daemonJobs:
1795
1208
  commandStarted: boolean;
1796
1209
  exitCode: number | null;
1797
1210
  signal: string | null;
1798
- errorCode?: "device_auth_unsupported" | "permit_timeout" | "spawn_failed" | undefined;
1211
+ errorCode?: "device_auth_unsupported" | "permit_timeout" | "spawn_failed" | "terminal_transport_failed" | "terminal_transport_probe_failed" | "terminal_transport_unavailable" | "terminal_transport_unsupported" | undefined;
1799
1212
  finishedAt: string;
1800
1213
  } | undefined;
1801
1214
  terminationReconciliation?: {
@@ -1996,7 +1409,7 @@ resources: () => ResourceStore, quotaRegistry: () => QuotaRegistry, daemonJobs:
1996
1409
  commandStarted: boolean;
1997
1410
  exitCode: number | null;
1998
1411
  signal: string | null;
1999
- errorCode?: "device_auth_unsupported" | "permit_timeout" | "spawn_failed" | undefined;
1412
+ errorCode?: "device_auth_unsupported" | "permit_timeout" | "spawn_failed" | "terminal_transport_failed" | "terminal_transport_probe_failed" | "terminal_transport_unavailable" | "terminal_transport_unsupported" | undefined;
2000
1413
  finishedAt: string;
2001
1414
  } | undefined;
2002
1415
  terminationReconciliation?: {
@@ -2188,7 +1601,7 @@ resources: () => ResourceStore, quotaRegistry: () => QuotaRegistry, daemonJobs:
2188
1601
  commandStarted: boolean;
2189
1602
  exitCode: number | null;
2190
1603
  signal: string | null;
2191
- errorCode?: "device_auth_unsupported" | "permit_timeout" | "spawn_failed" | undefined;
1604
+ errorCode?: "device_auth_unsupported" | "permit_timeout" | "spawn_failed" | "terminal_transport_failed" | "terminal_transport_probe_failed" | "terminal_transport_unavailable" | "terminal_transport_unsupported" | undefined;
2192
1605
  finishedAt: string;
2193
1606
  } | undefined;
2194
1607
  terminationReconciliation?: {
@@ -2377,7 +1790,190 @@ resources: () => ResourceStore, quotaRegistry: () => QuotaRegistry, daemonJobs:
2377
1790
  commandStarted: boolean;
2378
1791
  exitCode: number | null;
2379
1792
  signal: string | null;
2380
- errorCode?: "device_auth_unsupported" | "permit_timeout" | "spawn_failed" | undefined;
1793
+ errorCode?: "device_auth_unsupported" | "permit_timeout" | "spawn_failed" | "terminal_transport_failed" | "terminal_transport_probe_failed" | "terminal_transport_unavailable" | "terminal_transport_unsupported" | undefined;
1794
+ finishedAt: string;
1795
+ } | undefined;
1796
+ terminationReconciliation?: {
1797
+ status: "empty";
1798
+ observedAt: string;
1799
+ } | undefined;
1800
+ }>;
1801
+ setupJobInput: (input: unknown) => Promise<{
1802
+ jobId: string;
1803
+ harness: "agy" | "claude" | "codex" | "cursor";
1804
+ action: "login";
1805
+ transport: "client_pty" | "daemon";
1806
+ profileId: string | null;
1807
+ state: "cancelled" | "failed" | "interrupted_unknown" | "not_supported" | "queued" | "running" | "succeeded" | "timed_out" | "waiting_for_input";
1808
+ phase: "awaiting_user" | "cancelling" | "completed" | "launching" | "preparing" | "verifying";
1809
+ deadlineAt?: string | undefined;
1810
+ deadlineFixed?: boolean | undefined;
1811
+ outcome?: {
1812
+ reason: "auth_not_ready" | "cancelled_by_user" | "cancelled_on_restart" | "capability_verification_failed" | "command_failed" | "completed" | "credential_route_mismatch" | "interrupted" | "interrupted_unknown" | "launch_failed" | "not_supported" | "termination_unconfirmed" | "timed_out";
1813
+ exitCode?: number | null | undefined;
1814
+ signal?: string | null | undefined;
1815
+ } | undefined;
1816
+ command: string | null;
1817
+ guideUrl: string | null;
1818
+ message: string;
1819
+ createdAt: string;
1820
+ startedAt: string | null;
1821
+ finishedAt: string | null;
1822
+ authCapability?: {
1823
+ attemptId: string;
1824
+ challengeDigest: string;
1825
+ requestDigest: string;
1826
+ disclosure: {
1827
+ schemaVersion: 1;
1828
+ protocolVersion: 1;
1829
+ harness: string;
1830
+ requested: "api_key" | "auto" | "subscription";
1831
+ requiredRoute: "local" | "managed_api_key" | "vendor_native";
1832
+ requiredSource: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file";
1833
+ networkScope: "selected_harness_only";
1834
+ billingKnowledge: "metered" | "proven_zero" | "subscription_entitlement" | "unknown";
1835
+ incrementalCostKnowledge: "estimated" | "exact" | "unknown";
1836
+ mayConsumeQuota: boolean;
1837
+ generatedAt: string;
1838
+ };
1839
+ state: "disclosed";
1840
+ } | {
1841
+ attemptId: string;
1842
+ challengeDigest: string;
1843
+ requestDigest: string;
1844
+ disclosure: {
1845
+ schemaVersion: 1;
1846
+ protocolVersion: 1;
1847
+ harness: string;
1848
+ requested: "api_key" | "auto" | "subscription";
1849
+ requiredRoute: "local" | "managed_api_key" | "vendor_native";
1850
+ requiredSource: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file";
1851
+ networkScope: "selected_harness_only";
1852
+ billingKnowledge: "metered" | "proven_zero" | "subscription_entitlement" | "unknown";
1853
+ incrementalCostKnowledge: "estimated" | "exact" | "unknown";
1854
+ mayConsumeQuota: boolean;
1855
+ generatedAt: string;
1856
+ };
1857
+ state: "running";
1858
+ startedAt: string;
1859
+ } | {
1860
+ attemptId: string;
1861
+ challengeDigest: string;
1862
+ requestDigest: string;
1863
+ disclosure: {
1864
+ schemaVersion: 1;
1865
+ protocolVersion: 1;
1866
+ harness: string;
1867
+ requested: "api_key" | "auto" | "subscription";
1868
+ requiredRoute: "local" | "managed_api_key" | "vendor_native";
1869
+ requiredSource: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file";
1870
+ networkScope: "selected_harness_only";
1871
+ billingKnowledge: "metered" | "proven_zero" | "subscription_entitlement" | "unknown";
1872
+ incrementalCostKnowledge: "estimated" | "exact" | "unknown";
1873
+ mayConsumeQuota: boolean;
1874
+ generatedAt: string;
1875
+ };
1876
+ state: "completed";
1877
+ startedAt: string;
1878
+ completedAt: string;
1879
+ receipt: {
1880
+ receiptId: string;
1881
+ attemptId: string;
1882
+ harness: string;
1883
+ requested: "api_key" | "auto" | "subscription";
1884
+ requiredRoute: "local" | "managed_api_key" | "vendor_native";
1885
+ requiredSource: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file";
1886
+ effective: "local" | "managed_api_key" | "vendor_native" | null;
1887
+ effectiveSource: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file" | null;
1888
+ selectionReason: "adapter_error" | "adapter_identity_mismatch" | "adapter_unavailable" | "cancelled" | "exact_requested_route" | "harness_error" | "missing_completion" | "protocol_violation" | "request_mismatch" | "response_mismatch" | "route_mismatch" | "route_missing" | "scratch_mutated" | "source_mismatch" | "source_missing";
1889
+ availability: "available" | "unavailable" | "unknown";
1890
+ verification: "failed" | "not_run" | "passed";
1891
+ billingKnowledge: "metered" | "proven_zero" | "subscription_entitlement" | "unknown";
1892
+ costKnowledge: "estimated" | "exact" | "unknown";
1893
+ costUsd?: number | undefined;
1894
+ startedAt: string;
1895
+ completedAt: string;
1896
+ challengeDigest: string;
1897
+ requestDigest: string;
1898
+ responseDigest: string;
1899
+ streamDigest: string;
1900
+ scratchBeforeDigest: string;
1901
+ scratchAfterDigest: string;
1902
+ stream: {
1903
+ startedEvents: number;
1904
+ completedEvents: number;
1905
+ errorEvents: number;
1906
+ unexpectedToolEvents: number;
1907
+ interactionEvents: number;
1908
+ sessionMismatchEvents: number;
1909
+ eventsAfterCompleted: number;
1910
+ aborted: boolean;
1911
+ };
1912
+ evidenceRefs: string[];
1913
+ };
1914
+ } | {
1915
+ attemptId: string;
1916
+ challengeDigest: string;
1917
+ requestDigest: string;
1918
+ disclosure: {
1919
+ schemaVersion: 1;
1920
+ protocolVersion: 1;
1921
+ harness: string;
1922
+ requested: "api_key" | "auto" | "subscription";
1923
+ requiredRoute: "local" | "managed_api_key" | "vendor_native";
1924
+ requiredSource: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file";
1925
+ networkScope: "selected_harness_only";
1926
+ billingKnowledge: "metered" | "proven_zero" | "subscription_entitlement" | "unknown";
1927
+ incrementalCostKnowledge: "estimated" | "exact" | "unknown";
1928
+ mayConsumeQuota: boolean;
1929
+ generatedAt: string;
1930
+ };
1931
+ state: "interrupted_unknown";
1932
+ startedAt: string;
1933
+ interruptedAt: string;
1934
+ } | undefined;
1935
+ execution?: {
1936
+ executionId: string;
1937
+ commandDigest: string;
1938
+ manifestDigest: string;
1939
+ processGroup: {
1940
+ schemaVersion: 1;
1941
+ pgid: number;
1942
+ leader: {
1943
+ status: "known";
1944
+ pid: number;
1945
+ platform: "darwin" | "linux" | "win32";
1946
+ source: "proc_pidinfo" | "procfs_stat" | "win32_process_times";
1947
+ startToken: string;
1948
+ processGroupId: number;
1949
+ };
1950
+ };
1951
+ observedAt: string;
1952
+ permitIssuedAt?: string | undefined;
1953
+ } | undefined;
1954
+ authorization?: {
1955
+ executionId: string;
1956
+ executable: {
1957
+ realpath: string;
1958
+ sha256: string;
1959
+ size: number;
1960
+ mode: number;
1961
+ device: string;
1962
+ inode: string;
1963
+ };
1964
+ args: string[];
1965
+ commandDigest: string;
1966
+ manifestDigest: string;
1967
+ } | undefined;
1968
+ nativeCommand?: {
1969
+ executionId: string;
1970
+ commandDigest: string;
1971
+ manifestDigest: string;
1972
+ permitIssuedAt: string | null;
1973
+ commandStarted: boolean;
1974
+ exitCode: number | null;
1975
+ signal: string | null;
1976
+ errorCode?: "device_auth_unsupported" | "permit_timeout" | "spawn_failed" | "terminal_transport_failed" | "terminal_transport_probe_failed" | "terminal_transport_unavailable" | "terminal_transport_unsupported" | undefined;
2381
1977
  finishedAt: string;
2382
1978
  } | undefined;
2383
1979
  terminationReconciliation?: {
@@ -2385,7 +1981,7 @@ resources: () => ResourceStore, quotaRegistry: () => QuotaRegistry, daemonJobs:
2385
1981
  observedAt: string;
2386
1982
  } | undefined;
2387
1983
  }>;
2388
- setupJobInput: (input: unknown) => Promise<{
1984
+ reconcileSetupJob: (input: unknown) => Promise<{
2389
1985
  jobId: string;
2390
1986
  harness: "agy" | "claude" | "codex" | "cursor";
2391
1987
  action: "login";
@@ -2560,7 +2156,7 @@ resources: () => ResourceStore, quotaRegistry: () => QuotaRegistry, daemonJobs:
2560
2156
  commandStarted: boolean;
2561
2157
  exitCode: number | null;
2562
2158
  signal: string | null;
2563
- errorCode?: "device_auth_unsupported" | "permit_timeout" | "spawn_failed" | undefined;
2159
+ errorCode?: "device_auth_unsupported" | "permit_timeout" | "spawn_failed" | "terminal_transport_failed" | "terminal_transport_probe_failed" | "terminal_transport_unavailable" | "terminal_transport_unsupported" | undefined;
2564
2160
  finishedAt: string;
2565
2161
  } | undefined;
2566
2162
  terminationReconciliation?: {
@@ -2568,7 +2164,7 @@ resources: () => ResourceStore, quotaRegistry: () => QuotaRegistry, daemonJobs:
2568
2164
  observedAt: string;
2569
2165
  } | undefined;
2570
2166
  }>;
2571
- reconcileSetupJob: (input: unknown) => Promise<{
2167
+ extendSetupJob: (input: unknown) => Promise<{
2572
2168
  jobId: string;
2573
2169
  harness: "agy" | "claude" | "codex" | "cursor";
2574
2170
  action: "login";
@@ -2743,7 +2339,7 @@ resources: () => ResourceStore, quotaRegistry: () => QuotaRegistry, daemonJobs:
2743
2339
  commandStarted: boolean;
2744
2340
  exitCode: number | null;
2745
2341
  signal: string | null;
2746
- errorCode?: "device_auth_unsupported" | "permit_timeout" | "spawn_failed" | undefined;
2342
+ errorCode?: "device_auth_unsupported" | "permit_timeout" | "spawn_failed" | "terminal_transport_failed" | "terminal_transport_probe_failed" | "terminal_transport_unavailable" | "terminal_transport_unsupported" | undefined;
2747
2343
  finishedAt: string;
2748
2344
  } | undefined;
2749
2345
  terminationReconciliation?: {
@@ -2751,188 +2347,608 @@ resources: () => ResourceStore, quotaRegistry: () => QuotaRegistry, daemonJobs:
2751
2347
  observedAt: string;
2752
2348
  } | undefined;
2753
2349
  }>;
2754
- extendSetupJob: (input: unknown) => Promise<{
2755
- jobId: string;
2756
- harness: "agy" | "claude" | "codex" | "cursor";
2757
- action: "login";
2758
- transport: "client_pty" | "daemon";
2759
- profileId: string | null;
2760
- state: "cancelled" | "failed" | "interrupted_unknown" | "not_supported" | "queued" | "running" | "succeeded" | "timed_out" | "waiting_for_input";
2761
- phase: "awaiting_user" | "cancelling" | "completed" | "launching" | "preparing" | "verifying";
2762
- deadlineAt?: string | undefined;
2763
- deadlineFixed?: boolean | undefined;
2764
- outcome?: {
2765
- reason: "auth_not_ready" | "cancelled_by_user" | "cancelled_on_restart" | "capability_verification_failed" | "command_failed" | "completed" | "credential_route_mismatch" | "interrupted" | "interrupted_unknown" | "launch_failed" | "not_supported" | "termination_unconfirmed" | "timed_out";
2766
- exitCode?: number | null | undefined;
2767
- signal?: string | null | undefined;
2768
- } | undefined;
2769
- command: string | null;
2770
- guideUrl: string | null;
2771
- message: string;
2350
+ listDirectory?: (path?: string) => Promise<import("@claudexor/schema").ControlDirectoryListing>;
2351
+ fetchProjectFile?: (projectId: string, path: string) => Promise<import("./remote-filesystem.js").ScopedProjectFile>;
2352
+ threadDetail: (id: string) => Promise<{
2353
+ thread: unknown;
2354
+ sessions: unknown[];
2355
+ turns: unknown[];
2356
+ }>;
2357
+ createThreadTurn: (id: string, prompt: string, options: {
2358
+ kind?: unknown;
2359
+ parentRunId?: string | null;
2360
+ answersPlanRunId?: string | null;
2361
+ planRunId?: string | null;
2362
+ planHash?: string | null;
2363
+ planOverridden?: boolean;
2364
+ attachments?: ResourceAttachmentRef[];
2365
+ idempotency?: {
2366
+ key: string;
2367
+ client: string;
2368
+ request: unknown;
2369
+ };
2370
+ }) => Promise<{
2371
+ id: string;
2372
+ thread_id: string;
2373
+ run_id: string | null;
2374
+ parent_run_id: string | null;
2375
+ answers_plan_run_id: string | null;
2376
+ plan_run_id: string | null;
2377
+ plan_hash: string | null;
2378
+ plan_readiness_overridden: boolean;
2379
+ kind: "decision" | "followup" | "initial";
2380
+ prompt: string;
2381
+ attachments: {
2382
+ resource_id: string;
2383
+ kind: "file" | "image";
2384
+ mime: string;
2385
+ name: string;
2386
+ sha256: string;
2387
+ size_bytes: number;
2388
+ path: string;
2389
+ }[];
2390
+ enqueue_error: {
2391
+ message: string;
2392
+ code: string | null;
2393
+ retryable: boolean;
2394
+ required_actions: string[];
2395
+ context: Record<string, unknown>;
2396
+ failed_at: string;
2397
+ } | null;
2398
+ continuity: {
2399
+ kind: "fresh" | "native_resume" | "packet";
2400
+ packet_turns: number;
2401
+ summarized: boolean;
2402
+ lane_switched_from: {
2403
+ harness_id: string;
2404
+ profile_id: string | null;
2405
+ } | null;
2406
+ } | null;
2407
+ created_at: string;
2408
+ }>;
2409
+ findThreadTurnByIdempotency: (id: string, idempotency: {
2410
+ key: string;
2411
+ client: string;
2412
+ request: unknown;
2413
+ }) => Promise<{
2414
+ id: string;
2415
+ thread_id: string;
2416
+ run_id: string | null;
2417
+ parent_run_id: string | null;
2418
+ answers_plan_run_id: string | null;
2419
+ plan_run_id: string | null;
2420
+ plan_hash: string | null;
2421
+ plan_readiness_overridden: boolean;
2422
+ kind: "decision" | "followup" | "initial";
2423
+ prompt: string;
2424
+ attachments: {
2425
+ resource_id: string;
2426
+ kind: "file" | "image";
2427
+ mime: string;
2428
+ name: string;
2429
+ sha256: string;
2430
+ size_bytes: number;
2431
+ path: string;
2432
+ }[];
2433
+ enqueue_error: {
2434
+ message: string;
2435
+ code: string | null;
2436
+ retryable: boolean;
2437
+ required_actions: string[];
2438
+ context: Record<string, unknown>;
2439
+ failed_at: string;
2440
+ } | null;
2441
+ continuity: {
2442
+ kind: "fresh" | "native_resume" | "packet";
2443
+ packet_turns: number;
2444
+ summarized: boolean;
2445
+ lane_switched_from: {
2446
+ harness_id: string;
2447
+ profile_id: string | null;
2448
+ } | null;
2449
+ } | null;
2450
+ created_at: string;
2451
+ } | null>;
2452
+ setTurnEnqueueError: (turnId: string, problem: import("@claudexor/schema").TurnEnqueueProblem) => void;
2453
+ preflightRunRequirements: (request: ControlRunStartRequest) => Promise<void>;
2454
+ preflightThreadRunRequirements: (request: ControlRunStartRequest) => Promise<void>;
2455
+ createUpload: (input: unknown, idempotencyKey: string) => Promise<{
2456
+ uploadId: string;
2457
+ state: "cancelled" | "open" | "uploaded" | "uploading";
2458
+ receivedBytes: number;
2459
+ expectedBytes: number;
2460
+ }>;
2461
+ writeUpload: (uploadId: string, chunks: AsyncIterable<Uint8Array>) => Promise<{
2462
+ uploadId: string;
2463
+ state: "cancelled" | "open" | "uploaded" | "uploading";
2464
+ receivedBytes: number;
2465
+ expectedBytes: number;
2466
+ }>;
2467
+ uploadStatus: (uploadId: string) => Promise<{
2468
+ uploadId: string;
2469
+ state: "cancelled" | "open" | "uploaded" | "uploading";
2470
+ receivedBytes: number;
2471
+ expectedBytes: number;
2472
+ }>;
2473
+ cancelUpload: (uploadId: string) => Promise<{
2474
+ uploadId: string;
2475
+ state: "cancelled" | "open" | "uploaded" | "uploading";
2476
+ receivedBytes: number;
2477
+ expectedBytes: number;
2478
+ }>;
2479
+ finalizeUpload: (uploadId: string, expectedSha256: string | undefined, idempotencyKey: string) => Promise<{
2480
+ resourceId: string;
2481
+ kind: "file" | "image";
2482
+ mime: string;
2483
+ name: string;
2484
+ sha256: string;
2485
+ sizeBytes: number;
2486
+ createdAt: string;
2487
+ deduplicated: boolean;
2488
+ }>;
2489
+ validateResources: (refs: ResourceAttachmentRef[]) => Promise<void>;
2490
+ runRetention: import("./retention-service.js").RetentionRunner;
2491
+ listProjects: () => Promise<{
2492
+ projects: unknown[];
2493
+ }>;
2494
+ registerProject: (input: Parameters<ProjectStore["register"]>[0]) => Promise<{
2495
+ schema_version: 2;
2496
+ id: string;
2497
+ root: string;
2498
+ created_at: string;
2499
+ updated_at: string;
2500
+ nesting: {
2501
+ relation: "inside" | "contains";
2502
+ root: string;
2503
+ projectId: string;
2504
+ }[];
2505
+ }>;
2506
+ relinkProject: (id: string, root: string) => Promise<{
2507
+ schema_version: 2;
2508
+ id: string;
2509
+ root: string;
2510
+ created_at: string;
2511
+ updated_at: string;
2512
+ nesting: {
2513
+ relation: "inside" | "contains";
2514
+ root: string;
2515
+ projectId: string;
2516
+ }[];
2517
+ }>;
2518
+ removeProject: (id: string) => Promise<{
2519
+ projectId: string;
2520
+ root: string;
2521
+ registryRemoved: true;
2522
+ journalPartitionArchived: boolean;
2523
+ archivedPartitionPath: string | null;
2524
+ artifactsRetained: true;
2525
+ activeRunCheck: "snapshot";
2526
+ }>;
2527
+ createThread: (input: unknown) => Promise<{
2528
+ schema_version: 2;
2529
+ id: string;
2530
+ created_at: string;
2531
+ updated_at: string;
2532
+ repo: {
2533
+ root: string;
2534
+ base_ref: string;
2535
+ } | null;
2536
+ title: string | null;
2537
+ mode: "agent" | "ask" | "plan";
2538
+ auth_preference: "api_key" | "auto" | "subscription";
2539
+ access: "external_sandbox_full" | "full" | "inherit_native" | "readonly" | "workspace_write" | null;
2540
+ credential_profile_id: string | null;
2541
+ primary_harness: string | null;
2542
+ eligible_harnesses: string[];
2543
+ workspace: {
2544
+ mode: "in_place" | "isolated";
2545
+ worktree_path: string | null;
2546
+ base_sha: string | null;
2547
+ delivered_through_run_id: string | null;
2548
+ };
2549
+ run_ids: string[];
2550
+ head_run_id: string | null;
2551
+ state: "active" | "closed" | "purged" | "trashed";
2552
+ trashed_at: string | null;
2553
+ purge_after: string | null;
2554
+ pre_trash_state: "active" | "closed" | null;
2555
+ }>;
2556
+ listThreads: () => Promise<{
2557
+ threads: unknown[];
2558
+ problems: unknown[];
2559
+ }>;
2560
+ updateThread: (id: string, patch: {
2561
+ title?: string;
2562
+ state?: string;
2563
+ primaryHarness?: string | null;
2564
+ credentialProfileId?: string | null;
2565
+ eligibleHarnesses?: string[];
2566
+ access?: string | null;
2567
+ }) => Promise<{
2568
+ schema_version: 2;
2569
+ id: string;
2570
+ created_at: string;
2571
+ updated_at: string;
2572
+ repo: {
2573
+ root: string;
2574
+ base_ref: string;
2575
+ } | null;
2576
+ title: string | null;
2577
+ mode: "agent" | "ask" | "plan";
2578
+ auth_preference: "api_key" | "auto" | "subscription";
2579
+ access: "external_sandbox_full" | "full" | "inherit_native" | "readonly" | "workspace_write" | null;
2580
+ credential_profile_id: string | null;
2581
+ primary_harness: string | null;
2582
+ eligible_harnesses: string[];
2583
+ workspace: {
2584
+ mode: "in_place" | "isolated";
2585
+ worktree_path: string | null;
2586
+ base_sha: string | null;
2587
+ delivered_through_run_id: string | null;
2588
+ };
2589
+ run_ids: string[];
2590
+ head_run_id: string | null;
2591
+ state: "active" | "closed" | "purged" | "trashed";
2592
+ trashed_at: string | null;
2593
+ purge_after: string | null;
2594
+ pre_trash_state: "active" | "closed" | null;
2595
+ }>;
2596
+ trashThread: (id: string) => Promise<{
2597
+ schema_version: 2;
2598
+ id: string;
2599
+ created_at: string;
2600
+ updated_at: string;
2601
+ repo: {
2602
+ root: string;
2603
+ base_ref: string;
2604
+ } | null;
2605
+ title: string | null;
2606
+ mode: "agent" | "ask" | "plan";
2607
+ auth_preference: "api_key" | "auto" | "subscription";
2608
+ access: "external_sandbox_full" | "full" | "inherit_native" | "readonly" | "workspace_write" | null;
2609
+ credential_profile_id: string | null;
2610
+ primary_harness: string | null;
2611
+ eligible_harnesses: string[];
2612
+ workspace: {
2613
+ mode: "in_place" | "isolated";
2614
+ worktree_path: string | null;
2615
+ base_sha: string | null;
2616
+ delivered_through_run_id: string | null;
2617
+ };
2618
+ run_ids: string[];
2619
+ head_run_id: string | null;
2620
+ state: "active" | "closed" | "purged" | "trashed";
2621
+ trashed_at: string | null;
2622
+ purge_after: string | null;
2623
+ pre_trash_state: "active" | "closed" | null;
2624
+ }>;
2625
+ restoreThread: (id: string) => Promise<{
2626
+ schema_version: 2;
2627
+ id: string;
2628
+ created_at: string;
2629
+ updated_at: string;
2630
+ repo: {
2631
+ root: string;
2632
+ base_ref: string;
2633
+ } | null;
2634
+ title: string | null;
2635
+ mode: "agent" | "ask" | "plan";
2636
+ auth_preference: "api_key" | "auto" | "subscription";
2637
+ access: "external_sandbox_full" | "full" | "inherit_native" | "readonly" | "workspace_write" | null;
2638
+ credential_profile_id: string | null;
2639
+ primary_harness: string | null;
2640
+ eligible_harnesses: string[];
2641
+ workspace: {
2642
+ mode: "in_place" | "isolated";
2643
+ worktree_path: string | null;
2644
+ base_sha: string | null;
2645
+ delivered_through_run_id: string | null;
2646
+ };
2647
+ run_ids: string[];
2648
+ head_run_id: string | null;
2649
+ state: "active" | "closed" | "purged" | "trashed";
2650
+ trashed_at: string | null;
2651
+ purge_after: string | null;
2652
+ pre_trash_state: "active" | "closed" | null;
2653
+ }>;
2654
+ purgeThread: (id: string) => Promise<{
2655
+ schema_version: 2;
2656
+ id: string;
2657
+ created_at: string;
2658
+ updated_at: string;
2659
+ repo: {
2660
+ root: string;
2661
+ base_ref: string;
2662
+ } | null;
2663
+ title: string | null;
2664
+ mode: "agent" | "ask" | "plan";
2665
+ auth_preference: "api_key" | "auto" | "subscription";
2666
+ access: "external_sandbox_full" | "full" | "inherit_native" | "readonly" | "workspace_write" | null;
2667
+ credential_profile_id: string | null;
2668
+ primary_harness: string | null;
2669
+ eligible_harnesses: string[];
2670
+ workspace: {
2671
+ mode: "in_place" | "isolated";
2672
+ worktree_path: string | null;
2673
+ base_sha: string | null;
2674
+ delivered_through_run_id: string | null;
2675
+ };
2676
+ run_ids: string[];
2677
+ head_run_id: string | null;
2678
+ state: "active" | "closed" | "purged" | "trashed";
2679
+ trashed_at: string | null;
2680
+ purge_after: string | null;
2681
+ pre_trash_state: "active" | "closed" | null;
2682
+ }>;
2683
+ applyThread: (id: string, opts: ThreadApplyOptions) => Promise<{
2684
+ applied: boolean;
2685
+ status: string;
2686
+ headMoved: boolean;
2687
+ detail: string | null;
2688
+ delivery: import("@claudexor/schema").ControlDeliveryResponse | null;
2689
+ }>;
2690
+ listTrust: typeof listTrustService;
2691
+ updateTrust: typeof updateTrustService;
2692
+ pendingInteractions: (runId: string) => {
2693
+ interactionId: string;
2694
+ runId: string;
2695
+ attemptId: string | null;
2696
+ harnessId: string | null;
2697
+ sourceTool: string | null;
2698
+ questions: {
2699
+ id: string;
2700
+ question: string;
2701
+ header: string | null;
2702
+ options: {
2703
+ label: string;
2704
+ description: string | null;
2705
+ }[];
2706
+ multi_select: boolean;
2707
+ }[];
2708
+ requestedAt: string;
2709
+ timeoutAt: string | null;
2710
+ }[];
2711
+ answerInteraction: (runId: string, interactionId: string, answers: unknown) => {
2712
+ status: import("@claudexor/daemon").InteractionAnswerStatus;
2713
+ message?: string;
2714
+ };
2715
+ operatorDecision: (runId: string, params: unknown) => OperatorDecisionRecord | null;
2716
+ findOperatorDecisionByIdempotency: (runId: string, params: unknown, idempotency: {
2717
+ key: string;
2718
+ client: string;
2719
+ request: unknown;
2720
+ }) => OperatorDecisionRecord | null;
2721
+ recordOperatorDecision: (runId: string, params: unknown, decision: Omit<OperatorDecisionRecord, "runId">, idempotency?: {
2722
+ key: string;
2723
+ client: string;
2724
+ request: unknown;
2725
+ }) => import("@claudexor/daemon").RecordedOperatorDecision;
2726
+ beginDelivery: (params: unknown, input: {
2727
+ key: string;
2728
+ client: string;
2729
+ operation: string;
2730
+ request: unknown;
2731
+ }) => Promise<{
2732
+ id: string;
2733
+ state: "cancelled" | "failed" | "interrupted" | "queued" | "running" | "succeeded";
2734
+ params: unknown;
2735
+ result?: unknown;
2736
+ error?: string;
2737
+ errorCode?: string;
2738
+ errorStatus?: number;
2739
+ errorRetryable?: boolean;
2740
+ errorRequiredActions?: string[];
2741
+ errorContext?: Record<string, unknown>;
2772
2742
  createdAt: string;
2773
- startedAt: string | null;
2774
- finishedAt: string | null;
2775
- authCapability?: {
2776
- attemptId: string;
2777
- challengeDigest: string;
2778
- requestDigest: string;
2779
- disclosure: {
2780
- schemaVersion: 1;
2781
- protocolVersion: 1;
2782
- harness: string;
2783
- requested: "api_key" | "auto" | "subscription";
2784
- requiredRoute: "local" | "managed_api_key" | "vendor_native";
2785
- requiredSource: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file";
2786
- networkScope: "selected_harness_only";
2787
- billingKnowledge: "metered" | "proven_zero" | "subscription_entitlement" | "unknown";
2788
- incrementalCostKnowledge: "estimated" | "exact" | "unknown";
2789
- mayConsumeQuota: boolean;
2790
- generatedAt: string;
2743
+ runId?: string;
2744
+ taskId?: string;
2745
+ runDir?: string;
2746
+ startedAt?: string;
2747
+ finishedAt?: string;
2748
+ reused: boolean;
2749
+ }>;
2750
+ completeDelivery: (id: string, result: unknown) => Promise<void>;
2751
+ failDelivery: (id: string, error: unknown) => Promise<void>;
2752
+ harnesses: (input?: HarnessListInput) => Promise<{
2753
+ git: {
2754
+ status: "available" | "developer_tools_stub" | "failed" | "missing";
2755
+ version: string | null;
2756
+ detail: string | null;
2757
+ remediation: string | null;
2758
+ };
2759
+ harnesses: {
2760
+ id: string;
2761
+ available: boolean;
2762
+ status: "ok" | "degraded" | "unavailable";
2763
+ manifest: import("@claudexor/schema").HarnessManifest | null;
2764
+ enabledIntents: import("@claudexor/schema").Intent[];
2765
+ routableIntents: import("@claudexor/schema").Intent[];
2766
+ disabledIntents: import("@claudexor/schema").Intent[];
2767
+ checks: import("@claudexor/schema").ConformanceCheck[];
2768
+ reasons: string[];
2769
+ authSources: import("@claudexor/schema").AuthSourceReadiness[];
2770
+ configuredModel: string | null;
2771
+ configuredModelCheck: {
2772
+ status: "ok" | "rejected";
2773
+ message?: string | null;
2774
+ } | null;
2775
+ delegation: {
2776
+ available: boolean;
2777
+ reason: "manifest_unsupported" | "ready" | "runtime_unavailable";
2778
+ remediation: string | null;
2779
+ requiresFullAccess: boolean;
2791
2780
  };
2792
- state: "disclosed";
2793
- } | {
2794
- attemptId: string;
2795
- challengeDigest: string;
2796
- requestDigest: string;
2797
- disclosure: {
2798
- schemaVersion: 1;
2799
- protocolVersion: 1;
2800
- harness: string;
2801
- requested: "api_key" | "auto" | "subscription";
2802
- requiredRoute: "local" | "managed_api_key" | "vendor_native";
2803
- requiredSource: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file";
2804
- networkScope: "selected_harness_only";
2805
- billingKnowledge: "metered" | "proven_zero" | "subscription_entitlement" | "unknown";
2806
- incrementalCostKnowledge: "estimated" | "exact" | "unknown";
2807
- mayConsumeQuota: boolean;
2808
- generatedAt: string;
2781
+ setupLogin: {
2782
+ mode: "external_terminal" | "in_app";
2783
+ } | null;
2784
+ readiness: {
2785
+ id: string;
2786
+ kind: "auth" | "binary" | "model" | "probe" | "smoke";
2787
+ title: string;
2788
+ status: "fail" | "pass" | "skip";
2789
+ detail: string | null;
2790
+ }[];
2791
+ }[];
2792
+ }>;
2793
+ harnessModels: (input: {
2794
+ harnessId: string;
2795
+ route?: "local_session" | "api_key";
2796
+ }) => Promise<{
2797
+ harnessId: string;
2798
+ models: {
2799
+ id: string;
2800
+ label: string | null;
2801
+ context_window: number | null;
2802
+ routes: ("api_key" | "local_session")[] | null;
2803
+ }[];
2804
+ source: "api" | "manifest" | "none";
2805
+ verifiedAgainst: string | null;
2806
+ }>;
2807
+ authReadiness: (input: {
2808
+ harnessId: string;
2809
+ request: unknown;
2810
+ }) => Promise<{
2811
+ harnessId: string;
2812
+ authRequest: "api_key" | "auto" | "subscription";
2813
+ requestedSource: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file";
2814
+ observedAt: string;
2815
+ readiness: {
2816
+ source: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file";
2817
+ availability: "available" | "unavailable" | "unknown";
2818
+ verification: "failed" | "not_run" | "passed";
2819
+ detail?: string | undefined;
2820
+ };
2821
+ }>;
2822
+ agentCapabilities: () => Promise<{
2823
+ ok: true;
2824
+ version: string;
2825
+ generatedAt: string;
2826
+ git: {
2827
+ status: "available" | "developer_tools_stub" | "failed" | "missing";
2828
+ version: string | null;
2829
+ detail: string | null;
2830
+ remediation: string | null;
2831
+ };
2832
+ harnesses: {
2833
+ id: string;
2834
+ enabled: boolean;
2835
+ displayName: string;
2836
+ status: "degraded" | "ok" | "unavailable";
2837
+ providerFamily: "anthropic" | "cursor" | "google" | "local" | "openai" | "opencode" | "unknown" | "xai";
2838
+ enabledIntents: string[];
2839
+ disabledIntents: string[];
2840
+ reasons: string[];
2841
+ configuredModel: string | null;
2842
+ configuredModelValid: boolean | null;
2843
+ models: {
2844
+ source: "api" | "manifest" | "none";
2845
+ count: number;
2846
+ verifiedAgainst: string | null;
2809
2847
  };
2810
- state: "running";
2811
- startedAt: string;
2812
- } | {
2813
- attemptId: string;
2814
- challengeDigest: string;
2815
- requestDigest: string;
2816
- disclosure: {
2817
- schemaVersion: 1;
2818
- protocolVersion: 1;
2819
- harness: string;
2820
- requested: "api_key" | "auto" | "subscription";
2821
- requiredRoute: "local" | "managed_api_key" | "vendor_native";
2822
- requiredSource: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file";
2823
- networkScope: "selected_harness_only";
2824
- billingKnowledge: "metered" | "proven_zero" | "subscription_entitlement" | "unknown";
2825
- incrementalCostKnowledge: "estimated" | "exact" | "unknown";
2826
- mayConsumeQuota: boolean;
2827
- generatedAt: string;
2848
+ webPolicy: "native" | "none" | "tools" | "uncontrolled";
2849
+ attachmentInputs: {
2850
+ kind: "file" | "image";
2851
+ mime_types: string[];
2852
+ max_bytes: number;
2853
+ max_count: number;
2854
+ transport: "base64_inline" | "base64_stream" | "file_path" | "text_inline";
2855
+ }[];
2856
+ effortLevels: string[];
2857
+ accessProfilesSupported: ("full" | "inherit_native" | "readonly" | "workspace_write")[];
2858
+ readonlyMechanism: "fs_sandbox" | "none" | "permission_deny" | "tool_allowlist";
2859
+ delegation: {
2860
+ available: boolean;
2861
+ reason: "manifest_unsupported" | "ready" | "runtime_unavailable";
2862
+ remediation: string | null;
2863
+ requiresFullAccess: boolean;
2828
2864
  };
2829
- state: "completed";
2830
- startedAt: string;
2831
- completedAt: string;
2832
- receipt: {
2833
- receiptId: string;
2834
- attemptId: string;
2835
- harness: string;
2836
- requested: "api_key" | "auto" | "subscription";
2837
- requiredRoute: "local" | "managed_api_key" | "vendor_native";
2838
- requiredSource: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file";
2839
- effective: "local" | "managed_api_key" | "vendor_native" | null;
2840
- effectiveSource: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file" | null;
2841
- selectionReason: "adapter_error" | "adapter_identity_mismatch" | "adapter_unavailable" | "cancelled" | "exact_requested_route" | "harness_error" | "missing_completion" | "protocol_violation" | "request_mismatch" | "response_mismatch" | "route_mismatch" | "route_missing" | "scratch_mutated" | "source_mismatch" | "source_missing";
2842
- availability: "available" | "unavailable" | "unknown";
2843
- verification: "failed" | "not_run" | "passed";
2844
- billingKnowledge: "metered" | "proven_zero" | "subscription_entitlement" | "unknown";
2845
- costKnowledge: "estimated" | "exact" | "unknown";
2846
- costUsd?: number | undefined;
2847
- startedAt: string;
2848
- completedAt: string;
2849
- challengeDigest: string;
2850
- requestDigest: string;
2851
- responseDigest: string;
2852
- streamDigest: string;
2853
- scratchBeforeDigest: string;
2854
- scratchAfterDigest: string;
2855
- stream: {
2856
- startedEvents: number;
2857
- completedEvents: number;
2858
- errorEvents: number;
2859
- unexpectedToolEvents: number;
2860
- interactionEvents: number;
2861
- sessionMismatchEvents: number;
2862
- eventsAfterCompleted: number;
2863
- aborted: boolean;
2865
+ setupLogin?: {
2866
+ mode: "external_terminal" | "in_app";
2867
+ } | null | undefined;
2868
+ }[];
2869
+ availableHarnesses: string[];
2870
+ modes: ("agent" | "ask" | "plan")[];
2871
+ runControlKeys: string[];
2872
+ outputSchemaDialects: {
2873
+ dialect: "draft-07" | "draft-2020-12";
2874
+ uri: string;
2875
+ defaultWhenOmitted: boolean;
2876
+ }[];
2877
+ mutability: {
2878
+ readOnlyModes: ("agent" | "ask" | "plan")[];
2879
+ writeModes: ("agent" | "ask" | "plan")[];
2880
+ isolationKinds: ("envelope" | "live")[];
2881
+ workspaceModes: ("in_place" | "isolated")[];
2882
+ accessProfiles: ("full" | "inherit_native" | "readonly" | "workspace_write")[];
2883
+ applyModes: ("apply" | "branch" | "commit" | "pr")[];
2884
+ };
2885
+ cliCommands: {
2886
+ id: string;
2887
+ mutability: "delivery" | "ops" | "read" | "write";
2888
+ stability: "experimental" | "stable";
2889
+ recovery: boolean;
2890
+ }[];
2891
+ mcpTools: string[];
2892
+ runApplyStates: string[];
2893
+ }>;
2894
+ runApplicability: (input: {
2895
+ repoRoot: string;
2896
+ }) => Promise<{
2897
+ repoRoot: string;
2898
+ git: {
2899
+ status: "available" | "developer_tools_stub" | "failed" | "missing";
2900
+ version: string | null;
2901
+ detail: string | null;
2902
+ remediation: string | null;
2903
+ };
2904
+ matrix: {
2905
+ in_place: {
2906
+ read_only: {
2907
+ applicable: boolean;
2908
+ requiresGit: boolean;
2909
+ code: "git_developer_tools_stub" | "git_failed" | "git_missing" | null;
2910
+ reason: string | null;
2911
+ remediation: string | null;
2864
2912
  };
2865
- evidenceRefs: string[];
2866
- };
2867
- } | {
2868
- attemptId: string;
2869
- challengeDigest: string;
2870
- requestDigest: string;
2871
- disclosure: {
2872
- schemaVersion: 1;
2873
- protocolVersion: 1;
2874
- harness: string;
2875
- requested: "api_key" | "auto" | "subscription";
2876
- requiredRoute: "local" | "managed_api_key" | "vendor_native";
2877
- requiredSource: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file";
2878
- networkScope: "selected_harness_only";
2879
- billingKnowledge: "metered" | "proven_zero" | "subscription_entitlement" | "unknown";
2880
- incrementalCostKnowledge: "estimated" | "exact" | "unknown";
2881
- mayConsumeQuota: boolean;
2882
- generatedAt: string;
2883
- };
2884
- state: "interrupted_unknown";
2885
- startedAt: string;
2886
- interruptedAt: string;
2887
- } | undefined;
2888
- execution?: {
2889
- executionId: string;
2890
- commandDigest: string;
2891
- manifestDigest: string;
2892
- processGroup: {
2893
- schemaVersion: 1;
2894
- pgid: number;
2895
- leader: {
2896
- status: "known";
2897
- pid: number;
2898
- platform: "darwin" | "linux" | "win32";
2899
- source: "proc_pidinfo" | "procfs_stat" | "win32_process_times";
2900
- startToken: string;
2901
- processGroupId: number;
2913
+ agent_convergence: {
2914
+ applicable: boolean;
2915
+ requiresGit: boolean;
2916
+ code: "git_developer_tools_stub" | "git_failed" | "git_missing" | null;
2917
+ reason: string | null;
2918
+ remediation: string | null;
2919
+ };
2920
+ agent_other: {
2921
+ applicable: boolean;
2922
+ requiresGit: boolean;
2923
+ code: "git_developer_tools_stub" | "git_failed" | "git_missing" | null;
2924
+ reason: string | null;
2925
+ remediation: string | null;
2902
2926
  };
2903
2927
  };
2904
- observedAt: string;
2905
- permitIssuedAt?: string | undefined;
2906
- } | undefined;
2907
- authorization?: {
2908
- executionId: string;
2909
- executable: {
2910
- realpath: string;
2911
- sha256: string;
2912
- size: number;
2913
- mode: number;
2914
- device: string;
2915
- inode: string;
2928
+ isolated: {
2929
+ read_only: {
2930
+ applicable: boolean;
2931
+ requiresGit: boolean;
2932
+ code: "git_developer_tools_stub" | "git_failed" | "git_missing" | null;
2933
+ reason: string | null;
2934
+ remediation: string | null;
2935
+ };
2936
+ agent_convergence: {
2937
+ applicable: boolean;
2938
+ requiresGit: boolean;
2939
+ code: "git_developer_tools_stub" | "git_failed" | "git_missing" | null;
2940
+ reason: string | null;
2941
+ remediation: string | null;
2942
+ };
2943
+ agent_other: {
2944
+ applicable: boolean;
2945
+ requiresGit: boolean;
2946
+ code: "git_developer_tools_stub" | "git_failed" | "git_missing" | null;
2947
+ reason: string | null;
2948
+ remediation: string | null;
2949
+ };
2916
2950
  };
2917
- args: string[];
2918
- commandDigest: string;
2919
- manifestDigest: string;
2920
- } | undefined;
2921
- nativeCommand?: {
2922
- executionId: string;
2923
- commandDigest: string;
2924
- manifestDigest: string;
2925
- permitIssuedAt: string | null;
2926
- commandStarted: boolean;
2927
- exitCode: number | null;
2928
- signal: string | null;
2929
- errorCode?: "device_auth_unsupported" | "permit_timeout" | "spawn_failed" | undefined;
2930
- finishedAt: string;
2931
- } | undefined;
2932
- terminationReconciliation?: {
2933
- status: "empty";
2934
- observedAt: string;
2935
- } | undefined;
2951
+ };
2936
2952
  }>;
2937
2953
  journalEvents: (partition: string, afterCursor?: string) => Promise<{
2938
2954
  schemaVersion: 1;
@@ -3086,6 +3102,8 @@ resources: () => ResourceStore, quotaRegistry: () => QuotaRegistry, daemonJobs:
3086
3102
  availability: "available" | "unavailable" | "unknown";
3087
3103
  verification: "failed" | "not_run" | "passed";
3088
3104
  verification_source: "local_store" | "vendor";
3105
+ stale?: boolean | undefined;
3106
+ stale_age_ms?: number | undefined;
3089
3107
  detail?: string | undefined;
3090
3108
  last_verified_at: string | null;
3091
3109
  };