@claudexor/cli 3.8.0 → 3.8.2

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 (96) hide show
  1. package/dist/agy-quota-source.d.ts +1 -0
  2. package/dist/agy-quota-source.d.ts.map +1 -1
  3. package/dist/agy-quota-source.js +23 -1
  4. package/dist/agy-quota-source.js.map +1 -1
  5. package/dist/claudexord.d.ts.map +1 -1
  6. package/dist/claudexord.js +9 -12
  7. package/dist/claudexord.js.map +1 -1
  8. package/dist/cli-io.d.ts +1 -0
  9. package/dist/cli-io.d.ts.map +1 -1
  10. package/dist/cli-io.js +14 -0
  11. package/dist/cli-io.js.map +1 -1
  12. package/dist/cli.js +12 -18
  13. package/dist/cli.js.map +1 -1
  14. package/dist/command-flags.d.ts.map +1 -1
  15. package/dist/command-flags.js +4 -2
  16. package/dist/command-flags.js.map +1 -1
  17. package/dist/command-registry.d.ts.map +1 -1
  18. package/dist/command-registry.js +9 -1
  19. package/dist/command-registry.js.map +1 -1
  20. package/dist/control-services.d.ts +782 -778
  21. package/dist/control-services.d.ts.map +1 -1
  22. package/dist/control-services.js +5 -28
  23. package/dist/control-services.js.map +1 -1
  24. package/dist/credential-commands.d.ts +12 -0
  25. package/dist/credential-commands.d.ts.map +1 -1
  26. package/dist/credential-commands.js +62 -2
  27. package/dist/credential-commands.js.map +1 -1
  28. package/dist/credential-profile-mutations.d.ts +2 -0
  29. package/dist/credential-profile-mutations.d.ts.map +1 -1
  30. package/dist/credential-status-invalidation.d.ts +2 -0
  31. package/dist/credential-status-invalidation.d.ts.map +1 -1
  32. package/dist/credential-status-invalidation.js +10 -0
  33. package/dist/credential-status-invalidation.js.map +1 -1
  34. package/dist/daemon-admission-runtime.d.ts.map +1 -1
  35. package/dist/daemon-admission-runtime.js +36 -12
  36. package/dist/daemon-admission-runtime.js.map +1 -1
  37. package/dist/daemon-launch.d.ts +6 -0
  38. package/dist/daemon-launch.d.ts.map +1 -1
  39. package/dist/daemon-launch.js +1 -1
  40. package/dist/daemon-launch.js.map +1 -1
  41. package/dist/harness-install-recipes.d.ts +2 -2
  42. package/dist/harness-install-recipes.d.ts.map +1 -1
  43. package/dist/harness-install-recipes.js +2 -2
  44. package/dist/harness-install-recipes.js.map +1 -1
  45. package/dist/harness-installer.d.ts +1 -1
  46. package/dist/harness-installer.js +1 -1
  47. package/dist/mcp-catalog-query.d.ts +2 -0
  48. package/dist/mcp-catalog-query.d.ts.map +1 -0
  49. package/dist/mcp-catalog-query.js +28 -0
  50. package/dist/mcp-catalog-query.js.map +1 -0
  51. package/dist/mcp-run-projections.d.ts +1 -1
  52. package/dist/mcp-runner.d.ts.map +1 -1
  53. package/dist/mcp-runner.js +2 -21
  54. package/dist/mcp-runner.js.map +1 -1
  55. package/dist/ops-command-specs.d.ts +18 -2
  56. package/dist/ops-command-specs.d.ts.map +1 -1
  57. package/dist/ops-command-specs.js +12 -0
  58. package/dist/ops-command-specs.js.map +1 -1
  59. package/dist/ops-commands.d.ts.map +1 -1
  60. package/dist/ops-commands.js +3 -1
  61. package/dist/ops-commands.js.map +1 -1
  62. package/dist/plugins.d.ts.map +1 -1
  63. package/dist/plugins.js +19 -25
  64. package/dist/plugins.js.map +1 -1
  65. package/dist/profile-registration.js +1 -1
  66. package/dist/request-preflight.d.ts +1 -1
  67. package/dist/request-preflight.d.ts.map +1 -1
  68. package/dist/request-preflight.js +35 -11
  69. package/dist/request-preflight.js.map +1 -1
  70. package/dist/retry-command.d.ts.map +1 -1
  71. package/dist/retry-command.js +4 -0
  72. package/dist/retry-command.js.map +1 -1
  73. package/dist/review-command.d.ts.map +1 -1
  74. package/dist/review-command.js +6 -3
  75. package/dist/review-command.js.map +1 -1
  76. package/dist/reviewer-options.d.ts +7 -1
  77. package/dist/reviewer-options.d.ts.map +1 -1
  78. package/dist/reviewer-options.js +25 -1
  79. package/dist/reviewer-options.js.map +1 -1
  80. package/dist/run-options.d.ts +1 -1
  81. package/dist/run-options.d.ts.map +1 -1
  82. package/dist/run-options.js +12 -2
  83. package/dist/run-options.js.map +1 -1
  84. package/dist/setup-job-control-services.d.ts +2064 -0
  85. package/dist/setup-job-control-services.d.ts.map +1 -0
  86. package/dist/setup-job-control-services.js +33 -0
  87. package/dist/setup-job-control-services.js.map +1 -0
  88. package/dist/setup-login-runner.d.ts +1 -0
  89. package/dist/setup-login-runner.d.ts.map +1 -1
  90. package/dist/setup-login-runner.js +14 -0
  91. package/dist/setup-login-runner.js.map +1 -1
  92. package/dist/thread-execution-workspace.d.ts +11 -6
  93. package/dist/thread-execution-workspace.d.ts.map +1 -1
  94. package/dist/thread-execution-workspace.js +52 -6
  95. package/dist/thread-execution-workspace.js.map +1 -1
  96. package/package.json +24 -24
@@ -175,6 +175,8 @@ resources: () => ResourceStore, quotaRegistry: () => QuotaRegistry, daemonJobs:
175
175
  availability: "available" | "unavailable" | "unknown";
176
176
  verification: "failed" | "not_run" | "passed";
177
177
  verification_source: "local_store" | "vendor";
178
+ stale?: boolean | undefined;
179
+ stale_age_ms?: number | undefined;
178
180
  detail?: string | undefined;
179
181
  last_verified_at: string | null;
180
182
  };
@@ -288,609 +290,6 @@ resources: () => ResourceStore, quotaRegistry: () => QuotaRegistry, daemonJobs:
288
290
  }[];
289
291
  refreshed_at: string | null;
290
292
  }>;
291
- listDirectory?: (path?: string) => Promise<import("@claudexor/schema").ControlDirectoryListing>;
292
- fetchProjectFile?: (projectId: string, path: string) => Promise<import("./remote-filesystem.js").ScopedProjectFile>;
293
- threadDetail: (id: string) => Promise<{
294
- thread: unknown;
295
- sessions: unknown[];
296
- turns: unknown[];
297
- }>;
298
- createThreadTurn: (id: string, prompt: string, options: {
299
- kind?: unknown;
300
- parentRunId?: string | null;
301
- answersPlanRunId?: string | null;
302
- planRunId?: string | null;
303
- planHash?: string | null;
304
- planOverridden?: boolean;
305
- attachments?: ResourceAttachmentRef[];
306
- idempotency?: {
307
- key: string;
308
- client: string;
309
- request: unknown;
310
- };
311
- }) => Promise<{
312
- id: string;
313
- thread_id: string;
314
- run_id: string | null;
315
- parent_run_id: string | null;
316
- answers_plan_run_id: string | null;
317
- plan_run_id: string | null;
318
- plan_hash: string | null;
319
- plan_readiness_overridden: boolean;
320
- kind: "decision" | "followup" | "initial";
321
- prompt: string;
322
- attachments: {
323
- resource_id: string;
324
- kind: "file" | "image";
325
- mime: string;
326
- name: string;
327
- sha256: string;
328
- size_bytes: number;
329
- path: string;
330
- }[];
331
- enqueue_error: {
332
- message: string;
333
- code: string | null;
334
- retryable: boolean;
335
- required_actions: string[];
336
- context: Record<string, unknown>;
337
- failed_at: string;
338
- } | null;
339
- continuity: {
340
- kind: "fresh" | "native_resume" | "packet";
341
- packet_turns: number;
342
- summarized: boolean;
343
- lane_switched_from: {
344
- harness_id: string;
345
- profile_id: string | null;
346
- } | null;
347
- } | null;
348
- created_at: string;
349
- }>;
350
- findThreadTurnByIdempotency: (id: string, idempotency: {
351
- key: string;
352
- client: string;
353
- request: unknown;
354
- }) => Promise<{
355
- id: string;
356
- thread_id: string;
357
- run_id: string | null;
358
- parent_run_id: string | null;
359
- answers_plan_run_id: string | null;
360
- plan_run_id: string | null;
361
- plan_hash: string | null;
362
- plan_readiness_overridden: boolean;
363
- kind: "decision" | "followup" | "initial";
364
- prompt: string;
365
- attachments: {
366
- resource_id: string;
367
- kind: "file" | "image";
368
- mime: string;
369
- name: string;
370
- sha256: string;
371
- size_bytes: number;
372
- path: string;
373
- }[];
374
- enqueue_error: {
375
- message: string;
376
- code: string | null;
377
- retryable: boolean;
378
- required_actions: string[];
379
- context: Record<string, unknown>;
380
- failed_at: string;
381
- } | null;
382
- continuity: {
383
- kind: "fresh" | "native_resume" | "packet";
384
- packet_turns: number;
385
- summarized: boolean;
386
- lane_switched_from: {
387
- harness_id: string;
388
- profile_id: string | null;
389
- } | null;
390
- } | null;
391
- created_at: string;
392
- } | null>;
393
- setTurnEnqueueError: (turnId: string, problem: import("@claudexor/schema").TurnEnqueueProblem) => void;
394
- preflightRunRequirements: (request: ControlRunStartRequest) => Promise<void>;
395
- preflightThreadRunRequirements: (request: ControlRunStartRequest) => Promise<void>;
396
- createUpload: (input: unknown, idempotencyKey: string) => Promise<{
397
- uploadId: string;
398
- state: "cancelled" | "open" | "uploaded" | "uploading";
399
- receivedBytes: number;
400
- expectedBytes: number;
401
- }>;
402
- writeUpload: (uploadId: string, chunks: AsyncIterable<Uint8Array>) => Promise<{
403
- uploadId: string;
404
- state: "cancelled" | "open" | "uploaded" | "uploading";
405
- receivedBytes: number;
406
- expectedBytes: number;
407
- }>;
408
- uploadStatus: (uploadId: string) => Promise<{
409
- uploadId: string;
410
- state: "cancelled" | "open" | "uploaded" | "uploading";
411
- receivedBytes: number;
412
- expectedBytes: number;
413
- }>;
414
- cancelUpload: (uploadId: string) => Promise<{
415
- uploadId: string;
416
- state: "cancelled" | "open" | "uploaded" | "uploading";
417
- receivedBytes: number;
418
- expectedBytes: number;
419
- }>;
420
- finalizeUpload: (uploadId: string, expectedSha256: string | undefined, idempotencyKey: string) => Promise<{
421
- resourceId: string;
422
- kind: "file" | "image";
423
- mime: string;
424
- name: string;
425
- sha256: string;
426
- sizeBytes: number;
427
- createdAt: string;
428
- deduplicated: boolean;
429
- }>;
430
- validateResources: (refs: ResourceAttachmentRef[]) => Promise<void>;
431
- runRetention: import("./retention-service.js").RetentionRunner;
432
- listProjects: () => Promise<{
433
- projects: unknown[];
434
- }>;
435
- registerProject: (input: Parameters<ProjectStore["register"]>[0]) => Promise<{
436
- schema_version: 2;
437
- id: string;
438
- root: string;
439
- created_at: string;
440
- updated_at: string;
441
- nesting: {
442
- relation: "inside" | "contains";
443
- root: string;
444
- projectId: string;
445
- }[];
446
- }>;
447
- relinkProject: (id: string, root: string) => Promise<{
448
- schema_version: 2;
449
- id: string;
450
- root: string;
451
- created_at: string;
452
- updated_at: string;
453
- nesting: {
454
- relation: "inside" | "contains";
455
- root: string;
456
- projectId: string;
457
- }[];
458
- }>;
459
- removeProject: (id: string) => Promise<{
460
- projectId: string;
461
- root: string;
462
- registryRemoved: true;
463
- journalPartitionArchived: boolean;
464
- archivedPartitionPath: string | null;
465
- artifactsRetained: true;
466
- activeRunCheck: "snapshot";
467
- }>;
468
- createThread: (input: unknown) => Promise<{
469
- schema_version: 2;
470
- id: string;
471
- created_at: string;
472
- updated_at: string;
473
- repo: {
474
- root: string;
475
- base_ref: string;
476
- } | null;
477
- title: string | null;
478
- mode: "agent" | "ask" | "plan";
479
- auth_preference: "api_key" | "auto" | "subscription";
480
- access: "external_sandbox_full" | "full" | "inherit_native" | "readonly" | "workspace_write" | null;
481
- credential_profile_id: string | null;
482
- primary_harness: string | null;
483
- eligible_harnesses: string[];
484
- workspace: {
485
- mode: "in_place" | "isolated";
486
- worktree_path: string | null;
487
- base_sha: string | null;
488
- delivered_through_run_id: string | null;
489
- };
490
- run_ids: string[];
491
- head_run_id: string | null;
492
- state: "active" | "closed" | "purged" | "trashed";
493
- trashed_at: string | null;
494
- purge_after: string | null;
495
- pre_trash_state: "active" | "closed" | null;
496
- }>;
497
- listThreads: () => Promise<{
498
- threads: unknown[];
499
- problems: unknown[];
500
- }>;
501
- updateThread: (id: string, patch: {
502
- title?: string;
503
- state?: string;
504
- primaryHarness?: string | null;
505
- credentialProfileId?: string | null;
506
- eligibleHarnesses?: string[];
507
- access?: string | null;
508
- }) => Promise<{
509
- schema_version: 2;
510
- id: string;
511
- created_at: string;
512
- updated_at: string;
513
- repo: {
514
- root: string;
515
- base_ref: string;
516
- } | null;
517
- title: string | null;
518
- mode: "agent" | "ask" | "plan";
519
- auth_preference: "api_key" | "auto" | "subscription";
520
- access: "external_sandbox_full" | "full" | "inherit_native" | "readonly" | "workspace_write" | null;
521
- credential_profile_id: string | null;
522
- primary_harness: string | null;
523
- eligible_harnesses: string[];
524
- workspace: {
525
- mode: "in_place" | "isolated";
526
- worktree_path: string | null;
527
- base_sha: string | null;
528
- delivered_through_run_id: string | null;
529
- };
530
- run_ids: string[];
531
- head_run_id: string | null;
532
- state: "active" | "closed" | "purged" | "trashed";
533
- trashed_at: string | null;
534
- purge_after: string | null;
535
- pre_trash_state: "active" | "closed" | null;
536
- }>;
537
- trashThread: (id: string) => Promise<{
538
- schema_version: 2;
539
- id: string;
540
- created_at: string;
541
- updated_at: string;
542
- repo: {
543
- root: string;
544
- base_ref: string;
545
- } | null;
546
- title: string | null;
547
- mode: "agent" | "ask" | "plan";
548
- auth_preference: "api_key" | "auto" | "subscription";
549
- access: "external_sandbox_full" | "full" | "inherit_native" | "readonly" | "workspace_write" | null;
550
- credential_profile_id: string | null;
551
- primary_harness: string | null;
552
- eligible_harnesses: string[];
553
- workspace: {
554
- mode: "in_place" | "isolated";
555
- worktree_path: string | null;
556
- base_sha: string | null;
557
- delivered_through_run_id: string | null;
558
- };
559
- run_ids: string[];
560
- head_run_id: string | null;
561
- state: "active" | "closed" | "purged" | "trashed";
562
- trashed_at: string | null;
563
- purge_after: string | null;
564
- pre_trash_state: "active" | "closed" | null;
565
- }>;
566
- restoreThread: (id: string) => Promise<{
567
- schema_version: 2;
568
- id: string;
569
- created_at: string;
570
- updated_at: string;
571
- repo: {
572
- root: string;
573
- base_ref: string;
574
- } | null;
575
- title: string | null;
576
- mode: "agent" | "ask" | "plan";
577
- auth_preference: "api_key" | "auto" | "subscription";
578
- access: "external_sandbox_full" | "full" | "inherit_native" | "readonly" | "workspace_write" | null;
579
- credential_profile_id: string | null;
580
- primary_harness: string | null;
581
- eligible_harnesses: string[];
582
- workspace: {
583
- mode: "in_place" | "isolated";
584
- worktree_path: string | null;
585
- base_sha: string | null;
586
- delivered_through_run_id: string | null;
587
- };
588
- run_ids: string[];
589
- head_run_id: string | null;
590
- state: "active" | "closed" | "purged" | "trashed";
591
- trashed_at: string | null;
592
- purge_after: string | null;
593
- pre_trash_state: "active" | "closed" | null;
594
- }>;
595
- purgeThread: (id: string) => Promise<{
596
- schema_version: 2;
597
- id: string;
598
- created_at: string;
599
- updated_at: string;
600
- repo: {
601
- root: string;
602
- base_ref: string;
603
- } | null;
604
- title: string | null;
605
- mode: "agent" | "ask" | "plan";
606
- auth_preference: "api_key" | "auto" | "subscription";
607
- access: "external_sandbox_full" | "full" | "inherit_native" | "readonly" | "workspace_write" | null;
608
- credential_profile_id: string | null;
609
- primary_harness: string | null;
610
- eligible_harnesses: string[];
611
- workspace: {
612
- mode: "in_place" | "isolated";
613
- worktree_path: string | null;
614
- base_sha: string | null;
615
- delivered_through_run_id: string | null;
616
- };
617
- run_ids: string[];
618
- head_run_id: string | null;
619
- state: "active" | "closed" | "purged" | "trashed";
620
- trashed_at: string | null;
621
- purge_after: string | null;
622
- pre_trash_state: "active" | "closed" | null;
623
- }>;
624
- applyThread: (id: string, opts: ThreadApplyOptions) => Promise<{
625
- applied: boolean;
626
- status: string;
627
- headMoved: boolean;
628
- detail: string | null;
629
- delivery: import("@claudexor/schema").ControlDeliveryResponse | null;
630
- }>;
631
- listTrust: typeof listTrustService;
632
- updateTrust: typeof updateTrustService;
633
- pendingInteractions: (runId: string) => {
634
- interactionId: string;
635
- runId: string;
636
- attemptId: string | null;
637
- harnessId: string | null;
638
- sourceTool: string | null;
639
- questions: {
640
- id: string;
641
- question: string;
642
- header: string | null;
643
- options: {
644
- label: string;
645
- description: string | null;
646
- }[];
647
- multi_select: boolean;
648
- }[];
649
- requestedAt: string;
650
- timeoutAt: string | null;
651
- }[];
652
- answerInteraction: (runId: string, interactionId: string, answers: unknown) => {
653
- status: import("@claudexor/daemon").InteractionAnswerStatus;
654
- message?: string;
655
- };
656
- operatorDecision: (runId: string, params: unknown) => OperatorDecisionRecord | null;
657
- findOperatorDecisionByIdempotency: (runId: string, params: unknown, idempotency: {
658
- key: string;
659
- client: string;
660
- request: unknown;
661
- }) => OperatorDecisionRecord | null;
662
- recordOperatorDecision: (runId: string, params: unknown, decision: Omit<OperatorDecisionRecord, "runId">, idempotency?: {
663
- key: string;
664
- client: string;
665
- request: unknown;
666
- }) => import("@claudexor/daemon").RecordedOperatorDecision;
667
- beginDelivery: (params: unknown, input: {
668
- key: string;
669
- client: string;
670
- operation: string;
671
- request: unknown;
672
- }) => Promise<{
673
- id: string;
674
- state: "cancelled" | "failed" | "interrupted" | "queued" | "running" | "succeeded";
675
- params: unknown;
676
- result?: unknown;
677
- error?: string;
678
- errorCode?: string;
679
- errorStatus?: number;
680
- errorRetryable?: boolean;
681
- errorRequiredActions?: string[];
682
- errorContext?: Record<string, unknown>;
683
- createdAt: string;
684
- runId?: string;
685
- taskId?: string;
686
- runDir?: string;
687
- startedAt?: string;
688
- finishedAt?: string;
689
- reused: boolean;
690
- }>;
691
- completeDelivery: (id: string, result: unknown) => Promise<void>;
692
- failDelivery: (id: string, error: unknown) => Promise<void>;
693
- harnesses: (input?: HarnessListInput) => Promise<{
694
- git: {
695
- status: "available" | "developer_tools_stub" | "failed" | "missing";
696
- version: string | null;
697
- detail: string | null;
698
- remediation: string | null;
699
- };
700
- harnesses: {
701
- id: string;
702
- available: boolean;
703
- status: "ok" | "degraded" | "unavailable";
704
- manifest: import("@claudexor/schema").HarnessManifest | null;
705
- enabledIntents: import("@claudexor/schema").Intent[];
706
- routableIntents: import("@claudexor/schema").Intent[];
707
- disabledIntents: import("@claudexor/schema").Intent[];
708
- checks: import("@claudexor/schema").ConformanceCheck[];
709
- reasons: string[];
710
- authSources: import("@claudexor/schema").AuthSourceReadiness[];
711
- configuredModel: string | null;
712
- configuredModelCheck: {
713
- status: "ok" | "rejected";
714
- message?: string | null;
715
- } | null;
716
- delegation: {
717
- available: boolean;
718
- reason: "manifest_unsupported" | "ready" | "runtime_unavailable";
719
- remediation: string | null;
720
- requiresFullAccess: boolean;
721
- };
722
- setupLogin: {
723
- mode: "external_terminal" | "in_app";
724
- } | null;
725
- readiness: {
726
- id: string;
727
- kind: "auth" | "binary" | "model" | "probe" | "smoke";
728
- title: string;
729
- status: "fail" | "pass" | "skip";
730
- detail: string | null;
731
- }[];
732
- }[];
733
- }>;
734
- harnessModels: (input: {
735
- harnessId: string;
736
- route?: "local_session" | "api_key";
737
- }) => Promise<{
738
- harnessId: string;
739
- models: {
740
- id: string;
741
- label: string | null;
742
- context_window: number | null;
743
- routes: ("api_key" | "local_session")[] | null;
744
- }[];
745
- source: "api" | "manifest" | "none";
746
- verifiedAgainst: string | null;
747
- }>;
748
- authReadiness: (input: {
749
- harnessId: string;
750
- request: unknown;
751
- }) => Promise<{
752
- harnessId: string;
753
- authRequest: "api_key" | "auto" | "subscription";
754
- requestedSource: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file";
755
- observedAt: string;
756
- readiness: {
757
- source: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file";
758
- availability: "available" | "unavailable" | "unknown";
759
- verification: "failed" | "not_run" | "passed";
760
- detail?: string | undefined;
761
- };
762
- }>;
763
- agentCapabilities: () => Promise<{
764
- ok: true;
765
- version: string;
766
- generatedAt: string;
767
- git: {
768
- status: "available" | "developer_tools_stub" | "failed" | "missing";
769
- version: string | null;
770
- detail: string | null;
771
- remediation: string | null;
772
- };
773
- harnesses: {
774
- id: string;
775
- enabled: boolean;
776
- displayName: string;
777
- status: "degraded" | "ok" | "unavailable";
778
- providerFamily: "anthropic" | "cursor" | "google" | "local" | "openai" | "opencode" | "unknown" | "xai";
779
- enabledIntents: string[];
780
- disabledIntents: string[];
781
- reasons: string[];
782
- configuredModel: string | null;
783
- configuredModelValid: boolean | null;
784
- models: {
785
- source: "api" | "manifest" | "none";
786
- count: number;
787
- verifiedAgainst: string | null;
788
- };
789
- webPolicy: "native" | "none" | "tools" | "uncontrolled";
790
- attachmentInputs: {
791
- kind: "file" | "image";
792
- mime_types: string[];
793
- max_bytes: number;
794
- max_count: number;
795
- transport: "base64_inline" | "base64_stream" | "file_path" | "text_inline";
796
- }[];
797
- effortLevels: string[];
798
- accessProfilesSupported: ("external_sandbox_full" | "full" | "inherit_native" | "readonly" | "workspace_write")[];
799
- readonlyMechanism: "fs_sandbox" | "none" | "permission_deny" | "tool_allowlist";
800
- delegation: {
801
- available: boolean;
802
- reason: "manifest_unsupported" | "ready" | "runtime_unavailable";
803
- remediation: string | null;
804
- requiresFullAccess: boolean;
805
- };
806
- setupLogin?: {
807
- mode: "external_terminal" | "in_app";
808
- } | null | undefined;
809
- }[];
810
- availableHarnesses: string[];
811
- modes: ("agent" | "ask" | "plan")[];
812
- runControlKeys: string[];
813
- outputSchemaDialects: {
814
- dialect: "draft-07" | "draft-2020-12";
815
- uri: string;
816
- defaultWhenOmitted: boolean;
817
- }[];
818
- mutability: {
819
- readOnlyModes: ("agent" | "ask" | "plan")[];
820
- writeModes: ("agent" | "ask" | "plan")[];
821
- isolationKinds: ("envelope" | "live")[];
822
- workspaceModes: ("in_place" | "isolated")[];
823
- accessProfiles: ("external_sandbox_full" | "full" | "inherit_native" | "readonly" | "workspace_write")[];
824
- applyModes: ("apply" | "branch" | "commit" | "pr")[];
825
- };
826
- cliCommands: {
827
- id: string;
828
- mutability: "delivery" | "ops" | "read" | "write";
829
- stability: "experimental" | "stable";
830
- recovery: boolean;
831
- }[];
832
- mcpTools: string[];
833
- runApplyStates: string[];
834
- }>;
835
- runApplicability: (input: {
836
- repoRoot: string;
837
- }) => Promise<{
838
- repoRoot: string;
839
- git: {
840
- status: "available" | "developer_tools_stub" | "failed" | "missing";
841
- version: string | null;
842
- detail: string | null;
843
- remediation: string | null;
844
- };
845
- matrix: {
846
- in_place: {
847
- read_only: {
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
- agent_convergence: {
855
- applicable: boolean;
856
- requiresGit: boolean;
857
- code: "git_developer_tools_stub" | "git_failed" | "git_missing" | null;
858
- reason: string | null;
859
- remediation: string | null;
860
- };
861
- agent_other: {
862
- applicable: boolean;
863
- requiresGit: boolean;
864
- code: "git_developer_tools_stub" | "git_failed" | "git_missing" | null;
865
- reason: string | null;
866
- remediation: string | null;
867
- };
868
- };
869
- isolated: {
870
- read_only: {
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
- agent_convergence: {
878
- applicable: boolean;
879
- requiresGit: boolean;
880
- code: "git_developer_tools_stub" | "git_failed" | "git_missing" | null;
881
- reason: string | null;
882
- remediation: string | null;
883
- };
884
- agent_other: {
885
- applicable: boolean;
886
- requiresGit: boolean;
887
- code: "git_developer_tools_stub" | "git_failed" | "git_missing" | null;
888
- reason: string | null;
889
- remediation: string | null;
890
- };
891
- };
892
- };
893
- }>;
894
293
  createSetupJob: (input: {
895
294
  request: unknown;
896
295
  idempotencyKey: string;
@@ -2582,7 +1981,190 @@ resources: () => ResourceStore, quotaRegistry: () => QuotaRegistry, daemonJobs:
2582
1981
  observedAt: string;
2583
1982
  } | undefined;
2584
1983
  }>;
2585
- reconcileSetupJob: (input: unknown) => Promise<{
1984
+ reconcileSetupJob: (input: unknown) => Promise<{
1985
+ jobId: string;
1986
+ harness: "agy" | "claude" | "codex" | "cursor";
1987
+ action: "login";
1988
+ transport: "client_pty" | "daemon";
1989
+ profileId: string | null;
1990
+ state: "cancelled" | "failed" | "interrupted_unknown" | "not_supported" | "queued" | "running" | "succeeded" | "timed_out" | "waiting_for_input";
1991
+ phase: "awaiting_user" | "cancelling" | "completed" | "launching" | "preparing" | "verifying";
1992
+ deadlineAt?: string | undefined;
1993
+ deadlineFixed?: boolean | undefined;
1994
+ outcome?: {
1995
+ 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";
1996
+ exitCode?: number | null | undefined;
1997
+ signal?: string | null | undefined;
1998
+ } | undefined;
1999
+ command: string | null;
2000
+ guideUrl: string | null;
2001
+ message: string;
2002
+ createdAt: string;
2003
+ startedAt: string | null;
2004
+ finishedAt: string | null;
2005
+ authCapability?: {
2006
+ attemptId: string;
2007
+ challengeDigest: string;
2008
+ requestDigest: string;
2009
+ disclosure: {
2010
+ schemaVersion: 1;
2011
+ protocolVersion: 1;
2012
+ harness: string;
2013
+ requested: "api_key" | "auto" | "subscription";
2014
+ requiredRoute: "local" | "managed_api_key" | "vendor_native";
2015
+ requiredSource: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file";
2016
+ networkScope: "selected_harness_only";
2017
+ billingKnowledge: "metered" | "proven_zero" | "subscription_entitlement" | "unknown";
2018
+ incrementalCostKnowledge: "estimated" | "exact" | "unknown";
2019
+ mayConsumeQuota: boolean;
2020
+ generatedAt: string;
2021
+ };
2022
+ state: "disclosed";
2023
+ } | {
2024
+ attemptId: string;
2025
+ challengeDigest: string;
2026
+ requestDigest: string;
2027
+ disclosure: {
2028
+ schemaVersion: 1;
2029
+ protocolVersion: 1;
2030
+ harness: string;
2031
+ requested: "api_key" | "auto" | "subscription";
2032
+ requiredRoute: "local" | "managed_api_key" | "vendor_native";
2033
+ requiredSource: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file";
2034
+ networkScope: "selected_harness_only";
2035
+ billingKnowledge: "metered" | "proven_zero" | "subscription_entitlement" | "unknown";
2036
+ incrementalCostKnowledge: "estimated" | "exact" | "unknown";
2037
+ mayConsumeQuota: boolean;
2038
+ generatedAt: string;
2039
+ };
2040
+ state: "running";
2041
+ startedAt: string;
2042
+ } | {
2043
+ attemptId: string;
2044
+ challengeDigest: string;
2045
+ requestDigest: string;
2046
+ disclosure: {
2047
+ schemaVersion: 1;
2048
+ protocolVersion: 1;
2049
+ harness: string;
2050
+ requested: "api_key" | "auto" | "subscription";
2051
+ requiredRoute: "local" | "managed_api_key" | "vendor_native";
2052
+ requiredSource: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file";
2053
+ networkScope: "selected_harness_only";
2054
+ billingKnowledge: "metered" | "proven_zero" | "subscription_entitlement" | "unknown";
2055
+ incrementalCostKnowledge: "estimated" | "exact" | "unknown";
2056
+ mayConsumeQuota: boolean;
2057
+ generatedAt: string;
2058
+ };
2059
+ state: "completed";
2060
+ startedAt: string;
2061
+ completedAt: string;
2062
+ receipt: {
2063
+ receiptId: string;
2064
+ attemptId: string;
2065
+ harness: string;
2066
+ requested: "api_key" | "auto" | "subscription";
2067
+ requiredRoute: "local" | "managed_api_key" | "vendor_native";
2068
+ requiredSource: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file";
2069
+ effective: "local" | "managed_api_key" | "vendor_native" | null;
2070
+ effectiveSource: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file" | null;
2071
+ 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";
2072
+ availability: "available" | "unavailable" | "unknown";
2073
+ verification: "failed" | "not_run" | "passed";
2074
+ billingKnowledge: "metered" | "proven_zero" | "subscription_entitlement" | "unknown";
2075
+ costKnowledge: "estimated" | "exact" | "unknown";
2076
+ costUsd?: number | undefined;
2077
+ startedAt: string;
2078
+ completedAt: string;
2079
+ challengeDigest: string;
2080
+ requestDigest: string;
2081
+ responseDigest: string;
2082
+ streamDigest: string;
2083
+ scratchBeforeDigest: string;
2084
+ scratchAfterDigest: string;
2085
+ stream: {
2086
+ startedEvents: number;
2087
+ completedEvents: number;
2088
+ errorEvents: number;
2089
+ unexpectedToolEvents: number;
2090
+ interactionEvents: number;
2091
+ sessionMismatchEvents: number;
2092
+ eventsAfterCompleted: number;
2093
+ aborted: boolean;
2094
+ };
2095
+ evidenceRefs: string[];
2096
+ };
2097
+ } | {
2098
+ attemptId: string;
2099
+ challengeDigest: string;
2100
+ requestDigest: string;
2101
+ disclosure: {
2102
+ schemaVersion: 1;
2103
+ protocolVersion: 1;
2104
+ harness: string;
2105
+ requested: "api_key" | "auto" | "subscription";
2106
+ requiredRoute: "local" | "managed_api_key" | "vendor_native";
2107
+ requiredSource: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file";
2108
+ networkScope: "selected_harness_only";
2109
+ billingKnowledge: "metered" | "proven_zero" | "subscription_entitlement" | "unknown";
2110
+ incrementalCostKnowledge: "estimated" | "exact" | "unknown";
2111
+ mayConsumeQuota: boolean;
2112
+ generatedAt: string;
2113
+ };
2114
+ state: "interrupted_unknown";
2115
+ startedAt: string;
2116
+ interruptedAt: string;
2117
+ } | undefined;
2118
+ execution?: {
2119
+ executionId: string;
2120
+ commandDigest: string;
2121
+ manifestDigest: string;
2122
+ processGroup: {
2123
+ schemaVersion: 1;
2124
+ pgid: number;
2125
+ leader: {
2126
+ status: "known";
2127
+ pid: number;
2128
+ platform: "darwin" | "linux" | "win32";
2129
+ source: "proc_pidinfo" | "procfs_stat" | "win32_process_times";
2130
+ startToken: string;
2131
+ processGroupId: number;
2132
+ };
2133
+ };
2134
+ observedAt: string;
2135
+ permitIssuedAt?: string | undefined;
2136
+ } | undefined;
2137
+ authorization?: {
2138
+ executionId: string;
2139
+ executable: {
2140
+ realpath: string;
2141
+ sha256: string;
2142
+ size: number;
2143
+ mode: number;
2144
+ device: string;
2145
+ inode: string;
2146
+ };
2147
+ args: string[];
2148
+ commandDigest: string;
2149
+ manifestDigest: string;
2150
+ } | undefined;
2151
+ nativeCommand?: {
2152
+ executionId: string;
2153
+ commandDigest: string;
2154
+ manifestDigest: string;
2155
+ permitIssuedAt: string | null;
2156
+ commandStarted: boolean;
2157
+ exitCode: number | null;
2158
+ signal: string | null;
2159
+ errorCode?: "device_auth_unsupported" | "permit_timeout" | "spawn_failed" | "terminal_transport_failed" | "terminal_transport_probe_failed" | "terminal_transport_unavailable" | "terminal_transport_unsupported" | undefined;
2160
+ finishedAt: string;
2161
+ } | undefined;
2162
+ terminationReconciliation?: {
2163
+ status: "empty";
2164
+ observedAt: string;
2165
+ } | undefined;
2166
+ }>;
2167
+ extendSetupJob: (input: unknown) => Promise<{
2586
2168
  jobId: string;
2587
2169
  harness: "agy" | "claude" | "codex" | "cursor";
2588
2170
  action: "login";
@@ -2765,188 +2347,608 @@ resources: () => ResourceStore, quotaRegistry: () => QuotaRegistry, daemonJobs:
2765
2347
  observedAt: string;
2766
2348
  } | undefined;
2767
2349
  }>;
2768
- extendSetupJob: (input: unknown) => Promise<{
2769
- jobId: string;
2770
- harness: "agy" | "claude" | "codex" | "cursor";
2771
- action: "login";
2772
- transport: "client_pty" | "daemon";
2773
- profileId: string | null;
2774
- state: "cancelled" | "failed" | "interrupted_unknown" | "not_supported" | "queued" | "running" | "succeeded" | "timed_out" | "waiting_for_input";
2775
- phase: "awaiting_user" | "cancelling" | "completed" | "launching" | "preparing" | "verifying";
2776
- deadlineAt?: string | undefined;
2777
- deadlineFixed?: boolean | undefined;
2778
- outcome?: {
2779
- 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";
2780
- exitCode?: number | null | undefined;
2781
- signal?: string | null | undefined;
2782
- } | undefined;
2783
- command: string | null;
2784
- guideUrl: string | null;
2785
- 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>;
2786
2742
  createdAt: string;
2787
- startedAt: string | null;
2788
- finishedAt: string | null;
2789
- authCapability?: {
2790
- attemptId: string;
2791
- challengeDigest: string;
2792
- requestDigest: string;
2793
- disclosure: {
2794
- schemaVersion: 1;
2795
- protocolVersion: 1;
2796
- harness: string;
2797
- requested: "api_key" | "auto" | "subscription";
2798
- requiredRoute: "local" | "managed_api_key" | "vendor_native";
2799
- requiredSource: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file";
2800
- networkScope: "selected_harness_only";
2801
- billingKnowledge: "metered" | "proven_zero" | "subscription_entitlement" | "unknown";
2802
- incrementalCostKnowledge: "estimated" | "exact" | "unknown";
2803
- mayConsumeQuota: boolean;
2804
- 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;
2805
2780
  };
2806
- state: "disclosed";
2807
- } | {
2808
- attemptId: string;
2809
- challengeDigest: string;
2810
- requestDigest: string;
2811
- disclosure: {
2812
- schemaVersion: 1;
2813
- protocolVersion: 1;
2814
- harness: string;
2815
- requested: "api_key" | "auto" | "subscription";
2816
- requiredRoute: "local" | "managed_api_key" | "vendor_native";
2817
- requiredSource: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file";
2818
- networkScope: "selected_harness_only";
2819
- billingKnowledge: "metered" | "proven_zero" | "subscription_entitlement" | "unknown";
2820
- incrementalCostKnowledge: "estimated" | "exact" | "unknown";
2821
- mayConsumeQuota: boolean;
2822
- 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;
2823
2847
  };
2824
- state: "running";
2825
- startedAt: string;
2826
- } | {
2827
- attemptId: string;
2828
- challengeDigest: string;
2829
- requestDigest: string;
2830
- disclosure: {
2831
- schemaVersion: 1;
2832
- protocolVersion: 1;
2833
- harness: string;
2834
- requested: "api_key" | "auto" | "subscription";
2835
- requiredRoute: "local" | "managed_api_key" | "vendor_native";
2836
- requiredSource: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file";
2837
- networkScope: "selected_harness_only";
2838
- billingKnowledge: "metered" | "proven_zero" | "subscription_entitlement" | "unknown";
2839
- incrementalCostKnowledge: "estimated" | "exact" | "unknown";
2840
- mayConsumeQuota: boolean;
2841
- 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;
2842
2864
  };
2843
- state: "completed";
2844
- startedAt: string;
2845
- completedAt: string;
2846
- receipt: {
2847
- receiptId: string;
2848
- attemptId: string;
2849
- harness: string;
2850
- requested: "api_key" | "auto" | "subscription";
2851
- requiredRoute: "local" | "managed_api_key" | "vendor_native";
2852
- requiredSource: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file";
2853
- effective: "local" | "managed_api_key" | "vendor_native" | null;
2854
- effectiveSource: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file" | null;
2855
- 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";
2856
- availability: "available" | "unavailable" | "unknown";
2857
- verification: "failed" | "not_run" | "passed";
2858
- billingKnowledge: "metered" | "proven_zero" | "subscription_entitlement" | "unknown";
2859
- costKnowledge: "estimated" | "exact" | "unknown";
2860
- costUsd?: number | undefined;
2861
- startedAt: string;
2862
- completedAt: string;
2863
- challengeDigest: string;
2864
- requestDigest: string;
2865
- responseDigest: string;
2866
- streamDigest: string;
2867
- scratchBeforeDigest: string;
2868
- scratchAfterDigest: string;
2869
- stream: {
2870
- startedEvents: number;
2871
- completedEvents: number;
2872
- errorEvents: number;
2873
- unexpectedToolEvents: number;
2874
- interactionEvents: number;
2875
- sessionMismatchEvents: number;
2876
- eventsAfterCompleted: number;
2877
- 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;
2878
2912
  };
2879
- evidenceRefs: string[];
2880
- };
2881
- } | {
2882
- attemptId: string;
2883
- challengeDigest: string;
2884
- requestDigest: string;
2885
- disclosure: {
2886
- schemaVersion: 1;
2887
- protocolVersion: 1;
2888
- harness: string;
2889
- requested: "api_key" | "auto" | "subscription";
2890
- requiredRoute: "local" | "managed_api_key" | "vendor_native";
2891
- requiredSource: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file";
2892
- networkScope: "selected_harness_only";
2893
- billingKnowledge: "metered" | "proven_zero" | "subscription_entitlement" | "unknown";
2894
- incrementalCostKnowledge: "estimated" | "exact" | "unknown";
2895
- mayConsumeQuota: boolean;
2896
- generatedAt: string;
2897
- };
2898
- state: "interrupted_unknown";
2899
- startedAt: string;
2900
- interruptedAt: string;
2901
- } | undefined;
2902
- execution?: {
2903
- executionId: string;
2904
- commandDigest: string;
2905
- manifestDigest: string;
2906
- processGroup: {
2907
- schemaVersion: 1;
2908
- pgid: number;
2909
- leader: {
2910
- status: "known";
2911
- pid: number;
2912
- platform: "darwin" | "linux" | "win32";
2913
- source: "proc_pidinfo" | "procfs_stat" | "win32_process_times";
2914
- startToken: string;
2915
- 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;
2916
2926
  };
2917
2927
  };
2918
- observedAt: string;
2919
- permitIssuedAt?: string | undefined;
2920
- } | undefined;
2921
- authorization?: {
2922
- executionId: string;
2923
- executable: {
2924
- realpath: string;
2925
- sha256: string;
2926
- size: number;
2927
- mode: number;
2928
- device: string;
2929
- 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
+ };
2930
2950
  };
2931
- args: string[];
2932
- commandDigest: string;
2933
- manifestDigest: string;
2934
- } | undefined;
2935
- nativeCommand?: {
2936
- executionId: string;
2937
- commandDigest: string;
2938
- manifestDigest: string;
2939
- permitIssuedAt: string | null;
2940
- commandStarted: boolean;
2941
- exitCode: number | null;
2942
- signal: string | null;
2943
- errorCode?: "device_auth_unsupported" | "permit_timeout" | "spawn_failed" | "terminal_transport_failed" | "terminal_transport_probe_failed" | "terminal_transport_unavailable" | "terminal_transport_unsupported" | undefined;
2944
- finishedAt: string;
2945
- } | undefined;
2946
- terminationReconciliation?: {
2947
- status: "empty";
2948
- observedAt: string;
2949
- } | undefined;
2951
+ };
2950
2952
  }>;
2951
2953
  journalEvents: (partition: string, afterCursor?: string) => Promise<{
2952
2954
  schemaVersion: 1;
@@ -3100,6 +3102,8 @@ resources: () => ResourceStore, quotaRegistry: () => QuotaRegistry, daemonJobs:
3100
3102
  availability: "available" | "unavailable" | "unknown";
3101
3103
  verification: "failed" | "not_run" | "passed";
3102
3104
  verification_source: "local_store" | "vendor";
3105
+ stale?: boolean | undefined;
3106
+ stale_age_ms?: number | undefined;
3103
3107
  detail?: string | undefined;
3104
3108
  last_verified_at: string | null;
3105
3109
  };