@claudexor/schema 2.0.0 → 2.1.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 (128) hide show
  1. package/dist/agent-capabilities.d.ts +24 -24
  2. package/dist/attachment.d.ts +13 -13
  3. package/dist/auth.d.ts +21 -0
  4. package/dist/auth.d.ts.map +1 -1
  5. package/dist/auth.js +54 -0
  6. package/dist/auth.js.map +1 -1
  7. package/dist/budget.d.ts +17 -5
  8. package/dist/budget.d.ts.map +1 -1
  9. package/dist/budget.js +15 -0
  10. package/dist/budget.js.map +1 -1
  11. package/dist/config.d.ts +380 -20
  12. package/dist/config.d.ts.map +1 -1
  13. package/dist/config.js +81 -0
  14. package/dist/config.js.map +1 -1
  15. package/dist/control-gc.d.ts +185 -0
  16. package/dist/control-gc.d.ts.map +1 -0
  17. package/dist/control-gc.js +81 -0
  18. package/dist/control-gc.js.map +1 -0
  19. package/dist/control-operation-responses.d.ts +155 -29
  20. package/dist/control-operation-responses.d.ts.map +1 -1
  21. package/dist/control-run-detail.d.ts +140 -32
  22. package/dist/control-run-detail.d.ts.map +1 -1
  23. package/dist/control-spec.d.ts +6 -6
  24. package/dist/control-thread-apply.d.ts +2 -2
  25. package/dist/control.d.ts +427 -586
  26. package/dist/control.d.ts.map +1 -1
  27. package/dist/control.js +155 -54
  28. package/dist/control.js.map +1 -1
  29. package/dist/credential-profile.d.ts +454 -0
  30. package/dist/credential-profile.d.ts.map +1 -0
  31. package/dist/credential-profile.js +140 -0
  32. package/dist/credential-profile.js.map +1 -0
  33. package/dist/events.d.ts +20 -6
  34. package/dist/events.d.ts.map +1 -1
  35. package/dist/events.js +22 -0
  36. package/dist/events.js.map +1 -1
  37. package/dist/gate.d.ts +3 -3
  38. package/dist/harness.d.ts +243 -88
  39. package/dist/harness.d.ts.map +1 -1
  40. package/dist/harness.js +124 -46
  41. package/dist/harness.js.map +1 -1
  42. package/dist/index.d.ts +4 -0
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +4 -0
  45. package/dist/index.js.map +1 -1
  46. package/dist/orchestrate.d.ts +23 -0
  47. package/dist/orchestrate.d.ts.map +1 -1
  48. package/dist/orchestrate.js +56 -0
  49. package/dist/orchestrate.js.map +1 -1
  50. package/dist/project.d.ts +2 -2
  51. package/dist/quota.d.ts +27 -9
  52. package/dist/quota.d.ts.map +1 -1
  53. package/dist/quota.js +14 -2
  54. package/dist/quota.js.map +1 -1
  55. package/dist/readiness.d.ts +596 -0
  56. package/dist/readiness.d.ts.map +1 -0
  57. package/dist/readiness.js +87 -0
  58. package/dist/readiness.js.map +1 -0
  59. package/dist/request-requirements.d.ts +8 -8
  60. package/dist/request-requirements.d.ts.map +1 -1
  61. package/dist/request-requirements.js +4 -1
  62. package/dist/request-requirements.js.map +1 -1
  63. package/dist/route.d.ts +4 -4
  64. package/dist/setup.d.ts +69 -24
  65. package/dist/setup.d.ts.map +1 -1
  66. package/dist/setup.js +25 -0
  67. package/dist/setup.js.map +1 -1
  68. package/dist/spec.d.ts +4 -4
  69. package/dist/task.d.ts +99 -4
  70. package/dist/task.d.ts.map +1 -1
  71. package/dist/task.js +48 -1
  72. package/dist/task.js.map +1 -1
  73. package/dist/telemetry.d.ts +309 -67
  74. package/dist/telemetry.d.ts.map +1 -1
  75. package/dist/telemetry.js +97 -1
  76. package/dist/telemetry.js.map +1 -1
  77. package/dist/thread.d.ts +26 -15
  78. package/dist/thread.d.ts.map +1 -1
  79. package/dist/thread.js +11 -0
  80. package/dist/thread.js.map +1 -1
  81. package/dist/tool-ref.d.ts +45 -0
  82. package/dist/tool-ref.d.ts.map +1 -0
  83. package/dist/tool-ref.js +45 -0
  84. package/dist/tool-ref.js.map +1 -0
  85. package/dist/workspace.d.ts +2 -2
  86. package/generated/BudgetObservation.schema.json +16 -0
  87. package/generated/ControlCredentialProfileCreateRequest.schema.json +32 -0
  88. package/generated/ControlCredentialProfileCreateResponse.schema.json +142 -0
  89. package/generated/ControlCredentialProfileDeleteResponse.schema.json +107 -0
  90. package/generated/ControlCredentialProfilesResponse.schema.json +155 -0
  91. package/generated/ControlGcReceipt.schema.json +170 -0
  92. package/generated/ControlGcRequest.schema.json +18 -0
  93. package/generated/ControlHarnessListResponse.schema.json +95 -2
  94. package/generated/ControlHarnessModelsResponse.schema.json +19 -0
  95. package/generated/ControlHarnessSettingsPatch.schema.json +9 -0
  96. package/generated/ControlQuotaResponse.schema.json +3 -2
  97. package/generated/ControlRunAgainDraft.schema.json +40 -0
  98. package/generated/ControlRunDetail.schema.json +178 -6
  99. package/generated/ControlRunListResponse.schema.json +174 -3
  100. package/generated/ControlRunStartRequest.schema.json +40 -0
  101. package/generated/ControlRunSummary.schema.json +174 -3
  102. package/generated/ControlSettingsSnapshot.schema.json +10 -0
  103. package/generated/ControlSettingsUpdateRequest.schema.json +9 -0
  104. package/generated/ControlSetupJob.schema.json +8 -0
  105. package/generated/ControlSetupJobCreateRequest.schema.json +5 -0
  106. package/generated/ControlSetupJobEvent.schema.json +8 -0
  107. package/generated/ControlSetupJobListResponse.schema.json +8 -0
  108. package/generated/ControlSetupJobSnapshot.schema.json +8 -0
  109. package/generated/ControlThread.schema.json +16 -4
  110. package/generated/ControlThreadCreateRequest.schema.json +6 -2
  111. package/generated/ControlThreadDetail.schema.json +32 -8
  112. package/generated/ControlThreadListResponse.schema.json +16 -4
  113. package/generated/ControlThreadTurnRequest.schema.json +40 -0
  114. package/generated/ControlThreadUpdateRequest.schema.json +11 -0
  115. package/generated/CredentialProfile.schema.json +78 -0
  116. package/generated/CredentialProfileStatus.schema.json +61 -0
  117. package/generated/GlobalConfig.schema.json +136 -0
  118. package/generated/HarnessEvent.schema.json +62 -5
  119. package/generated/HarnessManifest.schema.json +33 -2
  120. package/generated/HarnessModel.schema.json +19 -0
  121. package/generated/HarnessStatusDto.schema.json +95 -2
  122. package/generated/RunEvent.schema.json +3 -0
  123. package/generated/RunTelemetry.schema.json +202 -2
  124. package/generated/Session.schema.json +14 -0
  125. package/generated/TaskContract.schema.json +65 -4
  126. package/generated/Thread.schema.json +17 -5
  127. package/generated/ThreadHeadPing.schema.json +40 -0
  128. package/package.json +3 -2
package/dist/harness.d.ts CHANGED
@@ -89,7 +89,18 @@ export declare const HarnessCapabilities: z.ZodObject<{
89
89
  * model. Data-driven like `effort_levels` — no model id is hardcoded in
90
90
  * routing logic.
91
91
  */
92
- known_models: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
92
+ known_models: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
93
+ id: z.ZodString;
94
+ /** Credential routes this model is available on. A bare string
95
+ * entry means ALL routes (backward shape). */
96
+ routes: z.ZodArray<z.ZodEnum<["local_session", "api_key"]>, "many">;
97
+ }, "strict", z.ZodTypeAny, {
98
+ id: string;
99
+ routes: ("api_key" | "local_session")[];
100
+ }, {
101
+ id: string;
102
+ routes: ("api_key" | "local_session")[];
103
+ }>]>, "many">>;
93
104
  /**
94
105
  * Vendor CLI version this `known_models` hint set was last verified against
95
106
  * (freshness note, surfaced with manifest-sourced model lists and checked by
@@ -113,7 +124,10 @@ export declare const HarnessCapabilities: z.ZodObject<{
113
124
  interactive: boolean;
114
125
  json_schema_output: boolean;
115
126
  effort_levels: ("low" | "medium" | "high" | "xhigh" | "max")[];
116
- known_models: string[];
127
+ known_models: (string | {
128
+ id: string;
129
+ routes: ("api_key" | "local_session")[];
130
+ })[];
117
131
  known_models_verified_against: string | null;
118
132
  }, {
119
133
  plan?: boolean | undefined;
@@ -132,10 +146,19 @@ export declare const HarnessCapabilities: z.ZodObject<{
132
146
  interactive?: boolean | undefined;
133
147
  json_schema_output?: boolean | undefined;
134
148
  effort_levels?: ("low" | "medium" | "high" | "xhigh" | "max")[] | undefined;
135
- known_models?: string[] | undefined;
149
+ known_models?: (string | {
150
+ id: string;
151
+ routes: ("api_key" | "local_session")[];
152
+ })[] | undefined;
136
153
  known_models_verified_against?: string | null | undefined;
137
154
  }>;
138
155
  export type HarnessCapabilities = z.infer<typeof HarnessCapabilities>;
156
+ export type KnownModelEntry = HarnessCapabilities["known_models"][number];
157
+ /** Model ids from a known_models list that are valid on `route`. ONE owner for
158
+ * the route filter (INV-122): a bare string entry is valid on every route;
159
+ * `route: null` (undecidable pre-spawn) returns only the route-UNRESTRICTED
160
+ * ids — fail-closed, a route-scoped model never leaks past an unknown route. */
161
+ export declare function knownModelIdsForRoute(entries: readonly KnownModelEntry[], route: "local_session" | "api_key" | null): string[];
139
162
  export declare const CredentialTransportKind: z.ZodEnum<["config_file", "env_var", "oauth_token_env", "os_keychain", "http_header", "none"]>;
140
163
  export type CredentialTransportKind = z.infer<typeof CredentialTransportKind>;
141
164
  export declare const CredentialRelocation: z.ZodEnum<["HOME", "CONFIG_DIR", "ENV", "none"]>;
@@ -272,13 +295,13 @@ export declare const HarnessCapabilityProfile: z.ZodDefault<z.ZodObject<{
272
295
  max_count: z.ZodNumber;
273
296
  transport: z.ZodEnum<["file_path", "base64_stream", "base64_inline", "text_inline"]>;
274
297
  }, "strict", z.ZodTypeAny, {
275
- kind: "image" | "file";
298
+ kind: "file" | "image";
276
299
  mime_types: string[];
277
300
  max_bytes: number;
278
301
  max_count: number;
279
302
  transport: "file_path" | "base64_stream" | "base64_inline" | "text_inline";
280
303
  }, {
281
- kind: "image" | "file";
304
+ kind: "file" | "image";
282
305
  mime_types: string[];
283
306
  max_bytes: number;
284
307
  max_count: number;
@@ -301,7 +324,7 @@ export declare const HarnessCapabilityProfile: z.ZodDefault<z.ZodObject<{
301
324
  supported_containment: ("env_or_file_injection" | "scoped_home_keychain_bridge" | "host_user_context" | "process_sandbox" | "container")[];
302
325
  };
303
326
  attachment_inputs: {
304
- kind: "image" | "file";
327
+ kind: "file" | "image";
305
328
  mime_types: string[];
306
329
  max_bytes: number;
307
330
  max_count: number;
@@ -324,7 +347,7 @@ export declare const HarnessCapabilityProfile: z.ZodDefault<z.ZodObject<{
324
347
  supported_containment?: ("env_or_file_injection" | "scoped_home_keychain_bridge" | "host_user_context" | "process_sandbox" | "container")[] | undefined;
325
348
  } | undefined;
326
349
  attachment_inputs?: {
327
- kind: "image" | "file";
350
+ kind: "file" | "image";
328
351
  mime_types: string[];
329
352
  max_bytes: number;
330
353
  max_count: number;
@@ -342,13 +365,18 @@ export declare const HarnessModel: z.ZodObject<{
342
365
  id: z.ZodString;
343
366
  label: z.ZodDefault<z.ZodNullable<z.ZodString>>;
344
367
  context_window: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
368
+ /** Credential routes the model is scoped to per the manifest annotation;
369
+ * null = unannotated (available on every route). */
370
+ routes: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodEnum<["local_session", "api_key"]>, "many">>>;
345
371
  }, "strip", z.ZodTypeAny, {
346
372
  id: string;
347
373
  label: string | null;
374
+ routes: ("api_key" | "local_session")[] | null;
348
375
  context_window: number | null;
349
376
  }, {
350
377
  id: string;
351
378
  label?: string | null | undefined;
379
+ routes?: ("api_key" | "local_session")[] | null | undefined;
352
380
  context_window?: number | null | undefined;
353
381
  }>;
354
382
  export type HarnessModel = z.infer<typeof HarnessModel>;
@@ -415,13 +443,13 @@ export declare const HarnessManifest: z.ZodObject<{
415
443
  max_count: z.ZodNumber;
416
444
  transport: z.ZodEnum<["file_path", "base64_stream", "base64_inline", "text_inline"]>;
417
445
  }, "strict", z.ZodTypeAny, {
418
- kind: "image" | "file";
446
+ kind: "file" | "image";
419
447
  mime_types: string[];
420
448
  max_bytes: number;
421
449
  max_count: number;
422
450
  transport: "file_path" | "base64_stream" | "base64_inline" | "text_inline";
423
451
  }, {
424
- kind: "image" | "file";
452
+ kind: "file" | "image";
425
453
  mime_types: string[];
426
454
  max_bytes: number;
427
455
  max_count: number;
@@ -444,7 +472,7 @@ export declare const HarnessManifest: z.ZodObject<{
444
472
  supported_containment: ("env_or_file_injection" | "scoped_home_keychain_bridge" | "host_user_context" | "process_sandbox" | "container")[];
445
473
  };
446
474
  attachment_inputs: {
447
- kind: "image" | "file";
475
+ kind: "file" | "image";
448
476
  mime_types: string[];
449
477
  max_bytes: number;
450
478
  max_count: number;
@@ -467,7 +495,7 @@ export declare const HarnessManifest: z.ZodObject<{
467
495
  supported_containment?: ("env_or_file_injection" | "scoped_home_keychain_bridge" | "host_user_context" | "process_sandbox" | "container")[] | undefined;
468
496
  } | undefined;
469
497
  attachment_inputs?: {
470
- kind: "image" | "file";
498
+ kind: "file" | "image";
471
499
  mime_types: string[];
472
500
  max_bytes: number;
473
501
  max_count: number;
@@ -530,7 +558,18 @@ export declare const HarnessManifest: z.ZodObject<{
530
558
  * model. Data-driven like `effort_levels` — no model id is hardcoded in
531
559
  * routing logic.
532
560
  */
533
- known_models: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
561
+ known_models: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
562
+ id: z.ZodString;
563
+ /** Credential routes this model is available on. A bare string
564
+ * entry means ALL routes (backward shape). */
565
+ routes: z.ZodArray<z.ZodEnum<["local_session", "api_key"]>, "many">;
566
+ }, "strict", z.ZodTypeAny, {
567
+ id: string;
568
+ routes: ("api_key" | "local_session")[];
569
+ }, {
570
+ id: string;
571
+ routes: ("api_key" | "local_session")[];
572
+ }>]>, "many">>;
534
573
  /**
535
574
  * Vendor CLI version this `known_models` hint set was last verified against
536
575
  * (freshness note, surfaced with manifest-sourced model lists and checked by
@@ -554,7 +593,10 @@ export declare const HarnessManifest: z.ZodObject<{
554
593
  interactive: boolean;
555
594
  json_schema_output: boolean;
556
595
  effort_levels: ("low" | "medium" | "high" | "xhigh" | "max")[];
557
- known_models: string[];
596
+ known_models: (string | {
597
+ id: string;
598
+ routes: ("api_key" | "local_session")[];
599
+ })[];
558
600
  known_models_verified_against: string | null;
559
601
  }, {
560
602
  plan?: boolean | undefined;
@@ -573,15 +615,18 @@ export declare const HarnessManifest: z.ZodObject<{
573
615
  interactive?: boolean | undefined;
574
616
  json_schema_output?: boolean | undefined;
575
617
  effort_levels?: ("low" | "medium" | "high" | "xhigh" | "max")[] | undefined;
576
- known_models?: string[] | undefined;
618
+ known_models?: (string | {
619
+ id: string;
620
+ routes: ("api_key" | "local_session")[];
621
+ })[] | undefined;
577
622
  known_models_verified_against?: string | null | undefined;
578
623
  }>;
579
624
  auth_modes: z.ZodDefault<z.ZodArray<z.ZodEnum<["local_session", "api_key", "none"]>, "many">>;
580
625
  access_profiles_supported: z.ZodDefault<z.ZodArray<z.ZodEnum<["readonly", "workspace_write", "full", "external_sandbox_full", "inherit_native"]>, "many">>;
581
626
  }, "strip", z.ZodTypeAny, {
627
+ display_name: string;
582
628
  kind: "local_cli" | "remote_api" | "fake";
583
629
  id: string;
584
- display_name: string;
585
630
  provider_family: "openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown";
586
631
  capability_profile: {
587
632
  auth: {
@@ -600,7 +645,7 @@ export declare const HarnessManifest: z.ZodObject<{
600
645
  supported_containment: ("env_or_file_injection" | "scoped_home_keychain_bridge" | "host_user_context" | "process_sandbox" | "container")[];
601
646
  };
602
647
  attachment_inputs: {
603
- kind: "image" | "file";
648
+ kind: "file" | "image";
604
649
  mime_types: string[];
605
650
  max_bytes: number;
606
651
  max_count: number;
@@ -624,7 +669,10 @@ export declare const HarnessManifest: z.ZodObject<{
624
669
  interactive: boolean;
625
670
  json_schema_output: boolean;
626
671
  effort_levels: ("low" | "medium" | "high" | "xhigh" | "max")[];
627
- known_models: string[];
672
+ known_models: (string | {
673
+ id: string;
674
+ routes: ("api_key" | "local_session")[];
675
+ })[];
628
676
  known_models_verified_against: string | null;
629
677
  };
630
678
  auth_modes: ("api_key" | "none" | "local_session")[];
@@ -632,9 +680,9 @@ export declare const HarnessManifest: z.ZodObject<{
632
680
  version?: string | undefined;
633
681
  adapter_version?: string | undefined;
634
682
  }, {
683
+ display_name: string;
635
684
  kind: "local_cli" | "remote_api" | "fake";
636
685
  id: string;
637
- display_name: string;
638
686
  capabilities: {
639
687
  plan?: boolean | undefined;
640
688
  orchestrate?: boolean | undefined;
@@ -652,7 +700,10 @@ export declare const HarnessManifest: z.ZodObject<{
652
700
  interactive?: boolean | undefined;
653
701
  json_schema_output?: boolean | undefined;
654
702
  effort_levels?: ("low" | "medium" | "high" | "xhigh" | "max")[] | undefined;
655
- known_models?: string[] | undefined;
703
+ known_models?: (string | {
704
+ id: string;
705
+ routes: ("api_key" | "local_session")[];
706
+ })[] | undefined;
656
707
  known_models_verified_against?: string | null | undefined;
657
708
  };
658
709
  version?: string | undefined;
@@ -675,7 +726,7 @@ export declare const HarnessManifest: z.ZodObject<{
675
726
  supported_containment?: ("env_or_file_injection" | "scoped_home_keychain_bridge" | "host_user_context" | "process_sandbox" | "container")[] | undefined;
676
727
  } | undefined;
677
728
  attachment_inputs?: {
678
- kind: "image" | "file";
729
+ kind: "file" | "image";
679
730
  mime_types: string[];
680
731
  max_bytes: number;
681
732
  max_count: number;
@@ -798,6 +849,14 @@ export declare const HarnessRunSpec: z.ZodObject<{
798
849
  session_id: z.ZodString;
799
850
  intent: z.ZodEnum<["plan", "spec", "implement", "create_from_scratch", "repair", "review", "verify", "synthesize", "explain", "audit", "orchestrate"]>;
800
851
  prompt: z.ZodString;
852
+ /**
853
+ * Optional caller-supplied system-level instructions layered on top of the
854
+ * prompt for TASK-PRODUCING lanes (primary, candidate, planner, explorer,
855
+ * orchestrate-planner) — never reviewers, synthesis, or the auth smoke.
856
+ * Adapters deliver it natively (claude `--append-system-prompt`, codex
857
+ * `developer_instructions`) or as a delimited prompt prefix.
858
+ */
859
+ instructions: z.ZodOptional<z.ZodString>;
801
860
  cwd: z.ZodString;
802
861
  access: z.ZodDefault<z.ZodEnum<["readonly", "workspace_write", "full", "external_sandbox_full", "inherit_native"]>>;
803
862
  external_context_policy: z.ZodDefault<z.ZodEnum<["off", "auto", "cached", "live"]>>;
@@ -822,6 +881,60 @@ export declare const HarnessRunSpec: z.ZodObject<{
822
881
  * api_key fallback; adapters seed native session vs inject the key accordingly.
823
882
  */
824
883
  auth_preference: z.ZodDefault<z.ZodEnum<["subscription", "api_key", "auto"]>>;
884
+ /**
885
+ * The RESOLVED credential profile for this attempt (INV-135), stamped by
886
+ * the orchestrator (the one resolve owner) from the durable registry —
887
+ * adapters consume the typed transport and never read config. Null = the
888
+ * engine-default credential ladder. An explicit profile is STRICT: the
889
+ * adapter uses exactly its transport or refuses with a typed error, never
890
+ * a silent fallback to default credentials.
891
+ */
892
+ credential_profile: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodObject<{
893
+ profile_id: z.ZodString;
894
+ harness_id: z.ZodString;
895
+ display_name: z.ZodString;
896
+ credential_kind: z.ZodEnum<["config_dir_login", "oauth_token", "api_key"]>;
897
+ isolation_locator: z.ZodDefault<z.ZodNullable<z.ZodString>>;
898
+ secret_ref: z.ZodDefault<z.ZodNullable<z.ZodString>>;
899
+ enabled: z.ZodDefault<z.ZodBoolean>;
900
+ created_at: z.ZodDefault<z.ZodNullable<z.ZodString>>;
901
+ }, "strict", z.ZodTypeAny, {
902
+ profile_id: string;
903
+ harness_id: string;
904
+ display_name: string;
905
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
906
+ isolation_locator: string | null;
907
+ secret_ref: string | null;
908
+ enabled: boolean;
909
+ created_at: string | null;
910
+ }, {
911
+ profile_id: string;
912
+ harness_id: string;
913
+ display_name: string;
914
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
915
+ isolation_locator?: string | null | undefined;
916
+ secret_ref?: string | null | undefined;
917
+ enabled?: boolean | undefined;
918
+ created_at?: string | null | undefined;
919
+ }>, {
920
+ profile_id: string;
921
+ harness_id: string;
922
+ display_name: string;
923
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
924
+ isolation_locator: string | null;
925
+ secret_ref: string | null;
926
+ enabled: boolean;
927
+ created_at: string | null;
928
+ }, {
929
+ profile_id: string;
930
+ harness_id: string;
931
+ display_name: string;
932
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
933
+ isolation_locator?: string | null | undefined;
934
+ secret_ref?: string | null | undefined;
935
+ enabled?: boolean | undefined;
936
+ created_at?: string | null | undefined;
937
+ }>>>;
825
938
  /**
826
939
  * Native CLI session id to resume into (codex `exec resume`, claude `--resume`,
827
940
  * cursor `agent --resume`, opencode `run --session`). Null starts a fresh session.
@@ -834,6 +947,14 @@ export declare const HarnessRunSpec: z.ZodObject<{
834
947
  */
835
948
  env_inheritance: z.ZodDefault<z.ZodEnum<["mirror_native", "clean"]>>;
836
949
  evidence_policy: z.ZodDefault<z.ZodEnum<["stream_only", "allow_vendor_session_artifacts"]>>;
950
+ /**
951
+ * Opt-in live text deltas (F2.5 W-C4): adapters that support partial
952
+ * output add their native flag (claude --include-partial-messages,
953
+ * cursor --stream-partial-output; codex exec has no deltas). Set ONLY on
954
+ * single-candidate chat lanes — racing lanes stay delta-free (noise × N).
955
+ * Delta messages carry payload.delta=true and never enter answers.
956
+ */
957
+ stream_deltas: z.ZodDefault<z.ZodBoolean>;
837
958
  env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
838
959
  /**
839
960
  * Immutable user/agent resources forwarded only after the selected adapter's
@@ -849,18 +970,18 @@ export declare const HarnessRunSpec: z.ZodObject<{
849
970
  path: z.ZodString;
850
971
  }, "strict", z.ZodTypeAny, {
851
972
  path: string;
973
+ name: string;
974
+ kind: "file" | "image";
852
975
  resource_id: string;
853
- kind: "image" | "file";
854
976
  mime: string;
855
- name: string;
856
977
  sha256: string;
857
978
  size_bytes: number;
858
979
  }, {
859
980
  path: string;
981
+ name: string;
982
+ kind: "file" | "image";
860
983
  resource_id: string;
861
- kind: "image" | "file";
862
984
  mime: string;
863
- name: string;
864
985
  sha256: string;
865
986
  size_bytes: number;
866
987
  }>, "many">>;
@@ -1022,16 +1143,27 @@ export declare const HarnessRunSpec: z.ZodObject<{
1022
1143
  model_hint: string | null;
1023
1144
  effort_hint: "low" | "medium" | "high" | "xhigh" | "max" | null;
1024
1145
  auth_preference: "auto" | "subscription" | "api_key";
1146
+ credential_profile: {
1147
+ profile_id: string;
1148
+ harness_id: string;
1149
+ display_name: string;
1150
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
1151
+ isolation_locator: string | null;
1152
+ secret_ref: string | null;
1153
+ enabled: boolean;
1154
+ created_at: string | null;
1155
+ } | null;
1025
1156
  resume_session_id: string | null;
1026
1157
  env_inheritance: "mirror_native" | "clean";
1027
1158
  evidence_policy: "stream_only" | "allow_vendor_session_artifacts";
1159
+ stream_deltas: boolean;
1028
1160
  env: Record<string, string>;
1029
1161
  attachments: {
1030
1162
  path: string;
1163
+ name: string;
1164
+ kind: "file" | "image";
1031
1165
  resource_id: string;
1032
- kind: "image" | "file";
1033
1166
  mime: string;
1034
- name: string;
1035
1167
  sha256: string;
1036
1168
  size_bytes: number;
1037
1169
  }[];
@@ -1040,6 +1172,7 @@ export declare const HarnessRunSpec: z.ZodObject<{
1040
1172
  headless: boolean;
1041
1173
  } | null;
1042
1174
  extra: Record<string, unknown>;
1175
+ instructions?: string | undefined;
1043
1176
  output_schema?: unknown;
1044
1177
  raw_context_packet?: {
1045
1178
  schema_version: 1;
@@ -1075,6 +1208,7 @@ export declare const HarnessRunSpec: z.ZodObject<{
1075
1208
  intent: "plan" | "audit" | "orchestrate" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain";
1076
1209
  prompt: string;
1077
1210
  cwd: string;
1211
+ instructions?: string | undefined;
1078
1212
  max_turns?: number | null | undefined;
1079
1213
  access?: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native" | undefined;
1080
1214
  external_context_policy?: "off" | "auto" | "cached" | "live" | undefined;
@@ -1086,16 +1220,27 @@ export declare const HarnessRunSpec: z.ZodObject<{
1086
1220
  model_hint?: string | null | undefined;
1087
1221
  effort_hint?: "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
1088
1222
  auth_preference?: "auto" | "subscription" | "api_key" | undefined;
1223
+ credential_profile?: {
1224
+ profile_id: string;
1225
+ harness_id: string;
1226
+ display_name: string;
1227
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
1228
+ isolation_locator?: string | null | undefined;
1229
+ secret_ref?: string | null | undefined;
1230
+ enabled?: boolean | undefined;
1231
+ created_at?: string | null | undefined;
1232
+ } | null | undefined;
1089
1233
  resume_session_id?: string | null | undefined;
1090
1234
  env_inheritance?: "mirror_native" | "clean" | undefined;
1091
1235
  evidence_policy?: "stream_only" | "allow_vendor_session_artifacts" | undefined;
1236
+ stream_deltas?: boolean | undefined;
1092
1237
  env?: Record<string, string> | undefined;
1093
1238
  attachments?: {
1094
1239
  path: string;
1240
+ name: string;
1241
+ kind: "file" | "image";
1095
1242
  resource_id: string;
1096
- kind: "image" | "file";
1097
1243
  mime: string;
1098
- name: string;
1099
1244
  sha256: string;
1100
1245
  size_bytes: number;
1101
1246
  }[] | undefined;
@@ -1136,49 +1281,6 @@ export declare const HarnessRunSpec: z.ZodObject<{
1136
1281
  extra?: Record<string, unknown> | undefined;
1137
1282
  }>;
1138
1283
  export type HarnessRunSpec = z.infer<typeof HarnessRunSpec>;
1139
- /**
1140
- * Coarse tool classification used for typed governance (no tool-name string
1141
- * matching outside adapters). Adapters map native tool names to a kind.
1142
- */
1143
- export declare const ToolKind: z.ZodEnum<["web", "file", "command", "mcp", "search", "other"]>;
1144
- export type ToolKind = z.infer<typeof ToolKind>;
1145
- /**
1146
- * Typed tool reference attached to `tool_call` / `tool_result` events.
1147
- * `status` is REQUIRED on `tool_result` events (adapter conformance enforces it);
1148
- * a missing status on a result is treated as a dropped/diagnostic event, never as ok.
1149
- */
1150
- export declare const ToolRef: z.ZodObject<{
1151
- name: z.ZodString;
1152
- kind: z.ZodDefault<z.ZodEnum<["web", "file", "command", "mcp", "search", "other"]>>;
1153
- use_id: z.ZodOptional<z.ZodString>;
1154
- /** Redacted, bounded human-readable target (query/url/path/command). */
1155
- target: z.ZodOptional<z.ZodString>;
1156
- status: z.ZodOptional<z.ZodEnum<["ok", "error", "cancelled", "denied"]>>;
1157
- /** Redacted, bounded error detail for status=error results. */
1158
- error_summary: z.ZodOptional<z.ZodString>;
1159
- /** Redacted, bounded content detail for results (success or failure). */
1160
- content_summary: z.ZodOptional<z.ZodString>;
1161
- exit_code: z.ZodOptional<z.ZodNumber>;
1162
- }, "strip", z.ZodTypeAny, {
1163
- kind: "file" | "web" | "command" | "mcp" | "search" | "other";
1164
- name: string;
1165
- status?: "cancelled" | "ok" | "error" | "denied" | undefined;
1166
- use_id?: string | undefined;
1167
- target?: string | undefined;
1168
- error_summary?: string | undefined;
1169
- content_summary?: string | undefined;
1170
- exit_code?: number | undefined;
1171
- }, {
1172
- name: string;
1173
- status?: "cancelled" | "ok" | "error" | "denied" | undefined;
1174
- kind?: "file" | "web" | "command" | "mcp" | "search" | "other" | undefined;
1175
- use_id?: string | undefined;
1176
- target?: string | undefined;
1177
- error_summary?: string | undefined;
1178
- content_summary?: string | undefined;
1179
- exit_code?: number | undefined;
1180
- }>;
1181
- export type ToolRef = z.infer<typeof ToolRef>;
1182
1284
  /**
1183
1285
  * One multiple-choice option of an interactive question (AskUserQuestion-style).
1184
1286
  */
@@ -1348,26 +1450,30 @@ export declare const InteractionAnswerSet: z.ZodObject<{
1348
1450
  export type InteractionAnswerSet = z.infer<typeof InteractionAnswerSet>;
1349
1451
  /** Normalized event emitted by every adapter (the SSOT of adapter output). */
1350
1452
  export declare const HarnessEvent: z.ZodObject<{
1351
- type: z.ZodEnum<["started", "thinking", "message", "tool_call", "tool_result", "interaction_requested", "file_change", "patch_produced", "usage", "error", "completed"]>;
1453
+ type: z.ZodEnum<["started", "thinking", "message", "tool_call", "tool_result", "interaction_requested", "file_change", "patch_produced", "usage", "error", "status", "completed"]>;
1352
1454
  session_id: z.ZodString;
1353
1455
  ts: z.ZodString;
1354
1456
  text: z.ZodOptional<z.ZodString>;
1457
+ /**
1458
+ * True on the harness's TYPED final answer message — claude/cursor's
1459
+ * terminal `result` event, codex's last agent message finalized at
1460
+ * `turn.completed`. Narration (mid-run) messages never set it; consumers
1461
+ * take a final message VERBATIM as the answer instead of joining prose.
1462
+ */
1463
+ final: z.ZodOptional<z.ZodBoolean>;
1355
1464
  /** Typed tool info; set on `tool_call` and `tool_result` events. */
1356
1465
  tool: z.ZodOptional<z.ZodObject<{
1357
1466
  name: z.ZodString;
1358
1467
  kind: z.ZodDefault<z.ZodEnum<["web", "file", "command", "mcp", "search", "other"]>>;
1359
1468
  use_id: z.ZodOptional<z.ZodString>;
1360
- /** Redacted, bounded human-readable target (query/url/path/command). */
1361
1469
  target: z.ZodOptional<z.ZodString>;
1362
1470
  status: z.ZodOptional<z.ZodEnum<["ok", "error", "cancelled", "denied"]>>;
1363
- /** Redacted, bounded error detail for status=error results. */
1364
1471
  error_summary: z.ZodOptional<z.ZodString>;
1365
- /** Redacted, bounded content detail for results (success or failure). */
1366
1472
  content_summary: z.ZodOptional<z.ZodString>;
1367
1473
  exit_code: z.ZodOptional<z.ZodNumber>;
1368
1474
  }, "strip", z.ZodTypeAny, {
1369
- kind: "file" | "web" | "command" | "mcp" | "search" | "other";
1370
1475
  name: string;
1476
+ kind: "web" | "file" | "command" | "mcp" | "search" | "other";
1371
1477
  status?: "cancelled" | "ok" | "error" | "denied" | undefined;
1372
1478
  use_id?: string | undefined;
1373
1479
  target?: string | undefined;
@@ -1377,7 +1483,7 @@ export declare const HarnessEvent: z.ZodObject<{
1377
1483
  }, {
1378
1484
  name: string;
1379
1485
  status?: "cancelled" | "ok" | "error" | "denied" | undefined;
1380
- kind?: "file" | "web" | "command" | "mcp" | "search" | "other" | undefined;
1486
+ kind?: "web" | "file" | "command" | "mcp" | "search" | "other" | undefined;
1381
1487
  use_id?: string | undefined;
1382
1488
  target?: string | undefined;
1383
1489
  error_summary?: string | undefined;
@@ -1512,9 +1618,13 @@ export declare const HarnessEvent: z.ZodObject<{
1512
1618
  observed_model: z.ZodOptional<z.ZodString>;
1513
1619
  credential_route: z.ZodOptional<z.ZodEnum<["vendor_native", "managed_api_key", "local"]>>;
1514
1620
  credential_source: z.ZodOptional<z.ZodEnum<["native_session", "oauth_token_env", "api_key_env", "api_key_flag", "provider_auth_file", "none"]>>;
1621
+ /** Credential profile the attempt runs under (INV-135); stamped by the
1622
+ * adapter alongside credential_route so quota/api_retry records stay
1623
+ * independently attributable to the profile. Absent = engine default. */
1624
+ credential_profile_id: z.ZodOptional<z.ZodString>;
1515
1625
  /** Vendor-owned quota windows. All reported windows remain independent. */
1516
1626
  quota: z.ZodOptional<z.ZodObject<{
1517
- source: z.ZodEnum<["codex_app_server", "codex_rollout", "claude_statusline", "claude_api_retry"]>;
1627
+ source: z.ZodEnum<["codex_app_server", "codex_rollout", "claude_statusline", "claude_api_retry", "claude_oauth_usage"]>;
1518
1628
  plan_label: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1519
1629
  subject_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1520
1630
  constraints: z.ZodArray<z.ZodObject<{
@@ -1540,7 +1650,7 @@ export declare const HarnessEvent: z.ZodObject<{
1540
1650
  cooldown_until?: string | null | undefined;
1541
1651
  }>, "many">;
1542
1652
  }, "strict", z.ZodTypeAny, {
1543
- source: "codex_app_server" | "codex_rollout" | "claude_statusline" | "claude_api_retry";
1653
+ source: "codex_app_server" | "codex_rollout" | "claude_statusline" | "claude_api_retry" | "claude_oauth_usage";
1544
1654
  plan_label: string | null;
1545
1655
  subject_id: string | null;
1546
1656
  constraints: {
@@ -1552,7 +1662,7 @@ export declare const HarnessEvent: z.ZodObject<{
1552
1662
  cooldown_until: string | null;
1553
1663
  }[];
1554
1664
  }, {
1555
- source: "codex_app_server" | "codex_rollout" | "claude_statusline" | "claude_api_retry";
1665
+ source: "codex_app_server" | "codex_rollout" | "claude_statusline" | "claude_api_retry" | "claude_oauth_usage";
1556
1666
  constraints: {
1557
1667
  id: string;
1558
1668
  label: string;
@@ -1614,6 +1724,33 @@ export declare const HarnessEvent: z.ZodObject<{
1614
1724
  resets_at?: string | null | undefined;
1615
1725
  retry_delay_ms?: number | null | undefined;
1616
1726
  }>>;
1727
+ /**
1728
+ * Typed transient-status detail; set on `status` events. Today's only kind
1729
+ * is claude's native `api_retry` (the CLI is retrying an API call by
1730
+ * itself): the adapter maps the official fields through instead of
1731
+ * fabricating a thinking block, so retries land in the activity feed —
1732
+ * never in the reasoning disclosure. `error_category` passes the vendor's
1733
+ * own label (e.g. rate_limit, overloaded) verbatim as disclosed evidence.
1734
+ */
1735
+ status: z.ZodOptional<z.ZodObject<{
1736
+ kind: z.ZodEnum<["api_retry"]>;
1737
+ attempt: z.ZodOptional<z.ZodNumber>;
1738
+ max_retries: z.ZodOptional<z.ZodNumber>;
1739
+ retry_delay_ms: z.ZodOptional<z.ZodNumber>;
1740
+ error_category: z.ZodOptional<z.ZodEnum<["authentication_failed", "oauth_org_not_allowed", "billing_error", "rate_limit", "overloaded", "invalid_request", "model_not_found", "server_error", "max_output_tokens", "unknown"]>>;
1741
+ }, "strip", z.ZodTypeAny, {
1742
+ kind: "api_retry";
1743
+ retry_delay_ms?: number | undefined;
1744
+ attempt?: number | undefined;
1745
+ max_retries?: number | undefined;
1746
+ error_category?: "unknown" | "rate_limit" | "authentication_failed" | "oauth_org_not_allowed" | "billing_error" | "overloaded" | "invalid_request" | "model_not_found" | "server_error" | "max_output_tokens" | undefined;
1747
+ }, {
1748
+ kind: "api_retry";
1749
+ retry_delay_ms?: number | undefined;
1750
+ attempt?: number | undefined;
1751
+ max_retries?: number | undefined;
1752
+ error_category?: "unknown" | "rate_limit" | "authentication_failed" | "oauth_org_not_allowed" | "billing_error" | "overloaded" | "invalid_request" | "model_not_found" | "server_error" | "max_output_tokens" | undefined;
1753
+ }>>;
1617
1754
  /**
1618
1755
  * Typed transient-failure signal. Adapters set this from native CLI/API error
1619
1756
  * shapes in their parse layer; the orchestrator consumes it for bounded retry
@@ -1633,12 +1770,19 @@ export declare const HarnessEvent: z.ZodObject<{
1633
1770
  aborted: z.ZodOptional<z.ZodBoolean>;
1634
1771
  payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1635
1772
  }, "strip", z.ZodTypeAny, {
1636
- type: "message" | "completed" | "error" | "started" | "thinking" | "tool_call" | "tool_result" | "interaction_requested" | "file_change" | "patch_produced" | "usage";
1773
+ type: "message" | "status" | "completed" | "error" | "started" | "thinking" | "tool_call" | "tool_result" | "interaction_requested" | "file_change" | "patch_produced" | "usage";
1637
1774
  session_id: string;
1638
1775
  ts: string;
1639
1776
  aborted?: boolean | undefined;
1640
- credential_route?: "local" | "vendor_native" | "managed_api_key" | undefined;
1777
+ status?: {
1778
+ kind: "api_retry";
1779
+ retry_delay_ms?: number | undefined;
1780
+ attempt?: number | undefined;
1781
+ max_retries?: number | undefined;
1782
+ error_category?: "unknown" | "rate_limit" | "authentication_failed" | "oauth_org_not_allowed" | "billing_error" | "overloaded" | "invalid_request" | "model_not_found" | "server_error" | "max_output_tokens" | undefined;
1783
+ } | undefined;
1641
1784
  error?: string | undefined;
1785
+ credential_route?: "local" | "vendor_native" | "managed_api_key" | undefined;
1642
1786
  usage?: {
1643
1787
  estimated?: boolean | undefined;
1644
1788
  input_tokens?: number | undefined;
@@ -1647,9 +1791,10 @@ export declare const HarnessEvent: z.ZodObject<{
1647
1791
  cost_usd?: number | undefined;
1648
1792
  } | undefined;
1649
1793
  text?: string | undefined;
1794
+ final?: boolean | undefined;
1650
1795
  tool?: {
1651
- kind: "file" | "web" | "command" | "mcp" | "search" | "other";
1652
1796
  name: string;
1797
+ kind: "web" | "file" | "command" | "mcp" | "search" | "other";
1653
1798
  status?: "cancelled" | "ok" | "error" | "denied" | undefined;
1654
1799
  use_id?: string | undefined;
1655
1800
  target?: string | undefined;
@@ -1685,8 +1830,9 @@ export declare const HarnessEvent: z.ZodObject<{
1685
1830
  refusal_code?: "raw_patch_requires_isolation" | "raw_patch_missing_evidence" | "raw_patch_digest_mismatch" | "raw_patch_base_mismatch" | "raw_patch_path_traversal" | "raw_patch_outside_scope" | "raw_patch_stale_preimage" | "raw_patch_binary_unsupported" | "raw_patch_sensitive_content" | "raw_patch_truncated" | "raw_patch_apply_failed" | undefined;
1686
1831
  observed_model?: string | undefined;
1687
1832
  credential_source?: "native_session" | "oauth_token_env" | "api_key_env" | "api_key_flag" | "provider_auth_file" | "none" | undefined;
1833
+ credential_profile_id?: string | undefined;
1688
1834
  quota?: {
1689
- source: "codex_app_server" | "codex_rollout" | "claude_statusline" | "claude_api_retry";
1835
+ source: "codex_app_server" | "codex_rollout" | "claude_statusline" | "claude_api_retry" | "claude_oauth_usage";
1690
1836
  plan_label: string | null;
1691
1837
  subject_id: string | null;
1692
1838
  constraints: {
@@ -1715,12 +1861,19 @@ export declare const HarnessEvent: z.ZodObject<{
1715
1861
  } | undefined;
1716
1862
  payload?: Record<string, unknown> | undefined;
1717
1863
  }, {
1718
- type: "message" | "completed" | "error" | "started" | "thinking" | "tool_call" | "tool_result" | "interaction_requested" | "file_change" | "patch_produced" | "usage";
1864
+ type: "message" | "status" | "completed" | "error" | "started" | "thinking" | "tool_call" | "tool_result" | "interaction_requested" | "file_change" | "patch_produced" | "usage";
1719
1865
  session_id: string;
1720
1866
  ts: string;
1721
1867
  aborted?: boolean | undefined;
1722
- credential_route?: "local" | "vendor_native" | "managed_api_key" | undefined;
1868
+ status?: {
1869
+ kind: "api_retry";
1870
+ retry_delay_ms?: number | undefined;
1871
+ attempt?: number | undefined;
1872
+ max_retries?: number | undefined;
1873
+ error_category?: "unknown" | "rate_limit" | "authentication_failed" | "oauth_org_not_allowed" | "billing_error" | "overloaded" | "invalid_request" | "model_not_found" | "server_error" | "max_output_tokens" | undefined;
1874
+ } | undefined;
1723
1875
  error?: string | undefined;
1876
+ credential_route?: "local" | "vendor_native" | "managed_api_key" | undefined;
1724
1877
  usage?: {
1725
1878
  estimated?: boolean | undefined;
1726
1879
  input_tokens?: number | undefined;
@@ -1729,10 +1882,11 @@ export declare const HarnessEvent: z.ZodObject<{
1729
1882
  cost_usd?: number | undefined;
1730
1883
  } | undefined;
1731
1884
  text?: string | undefined;
1885
+ final?: boolean | undefined;
1732
1886
  tool?: {
1733
1887
  name: string;
1734
1888
  status?: "cancelled" | "ok" | "error" | "denied" | undefined;
1735
- kind?: "file" | "web" | "command" | "mcp" | "search" | "other" | undefined;
1889
+ kind?: "web" | "file" | "command" | "mcp" | "search" | "other" | undefined;
1736
1890
  use_id?: string | undefined;
1737
1891
  target?: string | undefined;
1738
1892
  error_summary?: string | undefined;
@@ -1767,8 +1921,9 @@ export declare const HarnessEvent: z.ZodObject<{
1767
1921
  refusal_code?: "raw_patch_requires_isolation" | "raw_patch_missing_evidence" | "raw_patch_digest_mismatch" | "raw_patch_base_mismatch" | "raw_patch_path_traversal" | "raw_patch_outside_scope" | "raw_patch_stale_preimage" | "raw_patch_binary_unsupported" | "raw_patch_sensitive_content" | "raw_patch_truncated" | "raw_patch_apply_failed" | undefined;
1768
1922
  observed_model?: string | undefined;
1769
1923
  credential_source?: "native_session" | "oauth_token_env" | "api_key_env" | "api_key_flag" | "provider_auth_file" | "none" | undefined;
1924
+ credential_profile_id?: string | undefined;
1770
1925
  quota?: {
1771
- source: "codex_app_server" | "codex_rollout" | "claude_statusline" | "claude_api_retry";
1926
+ source: "codex_app_server" | "codex_rollout" | "claude_statusline" | "claude_api_retry" | "claude_oauth_usage";
1772
1927
  constraints: {
1773
1928
  id: string;
1774
1929
  label: string;