@claudexor/schema 1.0.1 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (278) hide show
  1. package/dist/agent-capabilities.d.ts +102 -30
  2. package/dist/agent-capabilities.d.ts.map +1 -1
  3. package/dist/agent-capabilities.js +49 -18
  4. package/dist/agent-capabilities.js.map +1 -1
  5. package/dist/apply-eligibility.d.ts.map +1 -1
  6. package/dist/apply-eligibility.js +22 -6
  7. package/dist/apply-eligibility.js.map +1 -1
  8. package/dist/attachment.d.ts +117 -52
  9. package/dist/attachment.d.ts.map +1 -1
  10. package/dist/attachment.js +60 -45
  11. package/dist/attachment.js.map +1 -1
  12. package/dist/auth.d.ts +1444 -0
  13. package/dist/auth.d.ts.map +1 -0
  14. package/dist/auth.js +371 -0
  15. package/dist/auth.js.map +1 -0
  16. package/dist/budget.d.ts +147 -18
  17. package/dist/budget.d.ts.map +1 -1
  18. package/dist/budget.js +80 -22
  19. package/dist/budget.js.map +1 -1
  20. package/dist/config.d.ts +829 -135
  21. package/dist/config.d.ts.map +1 -1
  22. package/dist/config.js +195 -41
  23. package/dist/config.js.map +1 -1
  24. package/dist/context.d.ts +6 -6
  25. package/dist/context.d.ts.map +1 -1
  26. package/dist/context.js +31 -7
  27. package/dist/context.js.map +1 -1
  28. package/dist/control-gc.d.ts +185 -0
  29. package/dist/control-gc.d.ts.map +1 -0
  30. package/dist/control-gc.js +81 -0
  31. package/dist/control-gc.js.map +1 -0
  32. package/dist/control-operation-responses.d.ts +1298 -0
  33. package/dist/control-operation-responses.d.ts.map +1 -0
  34. package/dist/control-operation-responses.js +35 -0
  35. package/dist/control-operation-responses.js.map +1 -0
  36. package/dist/control-run-detail.d.ts +556 -247
  37. package/dist/control-run-detail.d.ts.map +1 -1
  38. package/dist/control-run-detail.js +72 -17
  39. package/dist/control-run-detail.js.map +1 -1
  40. package/dist/control-run-retry.d.ts +88 -0
  41. package/dist/control-run-retry.d.ts.map +1 -0
  42. package/dist/control-run-retry.js +40 -0
  43. package/dist/control-run-retry.js.map +1 -0
  44. package/dist/control-run-scope.d.ts +25 -0
  45. package/dist/control-run-scope.d.ts.map +1 -0
  46. package/dist/control-run-scope.js +22 -0
  47. package/dist/control-run-scope.js.map +1 -0
  48. package/dist/control-secret.d.ts +90 -0
  49. package/dist/control-secret.d.ts.map +1 -0
  50. package/dist/control-secret.js +35 -0
  51. package/dist/control-secret.js.map +1 -0
  52. package/dist/control-spec.d.ts +592 -0
  53. package/dist/control-spec.d.ts.map +1 -0
  54. package/dist/control-spec.js +85 -0
  55. package/dist/control-spec.js.map +1 -0
  56. package/dist/control-thread-apply.d.ts +175 -0
  57. package/dist/control-thread-apply.d.ts.map +1 -0
  58. package/dist/control-thread-apply.js +31 -0
  59. package/dist/control-thread-apply.js.map +1 -0
  60. package/dist/control-trust.d.ts +74 -10
  61. package/dist/control-trust.d.ts.map +1 -1
  62. package/dist/control-trust.js +31 -11
  63. package/dist/control-trust.js.map +1 -1
  64. package/dist/control.d.ts +1688 -1334
  65. package/dist/control.d.ts.map +1 -1
  66. package/dist/control.js +592 -333
  67. package/dist/control.js.map +1 -1
  68. package/dist/credential-profile.d.ts +454 -0
  69. package/dist/credential-profile.d.ts.map +1 -0
  70. package/dist/credential-profile.js +140 -0
  71. package/dist/credential-profile.js.map +1 -0
  72. package/dist/decision.d.ts +10 -10
  73. package/dist/decision.d.ts.map +1 -1
  74. package/dist/decision.js +62 -15
  75. package/dist/decision.js.map +1 -1
  76. package/dist/delivery.d.ts +99 -0
  77. package/dist/delivery.d.ts.map +1 -0
  78. package/dist/delivery.js +19 -0
  79. package/dist/delivery.js.map +1 -0
  80. package/dist/events.d.ts +41 -4
  81. package/dist/events.d.ts.map +1 -1
  82. package/dist/events.js +47 -4
  83. package/dist/events.js.map +1 -1
  84. package/dist/gate.d.ts +5 -5
  85. package/dist/gate.d.ts.map +1 -1
  86. package/dist/gate.js +25 -5
  87. package/dist/gate.js.map +1 -1
  88. package/dist/harness.d.ts +775 -237
  89. package/dist/harness.d.ts.map +1 -1
  90. package/dist/harness.js +314 -111
  91. package/dist/harness.js.map +1 -1
  92. package/dist/index.d.ts +19 -0
  93. package/dist/index.d.ts.map +1 -1
  94. package/dist/index.js +19 -0
  95. package/dist/index.js.map +1 -1
  96. package/dist/operation.d.ts +185 -0
  97. package/dist/operation.d.ts.map +1 -0
  98. package/dist/operation.js +50 -0
  99. package/dist/operation.js.map +1 -0
  100. package/dist/orchestrate.d.ts +150 -22
  101. package/dist/orchestrate.d.ts.map +1 -1
  102. package/dist/orchestrate.js +117 -7
  103. package/dist/orchestrate.js.map +1 -1
  104. package/dist/primitives.d.ts.map +1 -1
  105. package/dist/primitives.js +4 -1
  106. package/dist/primitives.js.map +1 -1
  107. package/dist/problem.d.ts +29 -0
  108. package/dist/problem.d.ts.map +1 -0
  109. package/dist/problem.js +17 -0
  110. package/dist/problem.js.map +1 -0
  111. package/dist/project.d.ts +97 -0
  112. package/dist/project.d.ts.map +1 -0
  113. package/dist/project.js +27 -0
  114. package/dist/project.js.map +1 -0
  115. package/dist/quota.d.ts +269 -0
  116. package/dist/quota.d.ts.map +1 -0
  117. package/dist/quota.js +58 -0
  118. package/dist/quota.js.map +1 -0
  119. package/dist/raw.d.ts +195 -0
  120. package/dist/raw.d.ts.map +1 -0
  121. package/dist/raw.js +58 -0
  122. package/dist/raw.js.map +1 -0
  123. package/dist/readiness.d.ts +596 -0
  124. package/dist/readiness.d.ts.map +1 -0
  125. package/dist/readiness.js +87 -0
  126. package/dist/readiness.js.map +1 -0
  127. package/dist/recovery.d.ts +515 -0
  128. package/dist/recovery.d.ts.map +1 -0
  129. package/dist/recovery.js +93 -0
  130. package/dist/recovery.js.map +1 -0
  131. package/dist/request-requirements.d.ts +36 -0
  132. package/dist/request-requirements.d.ts.map +1 -0
  133. package/dist/request-requirements.js +29 -0
  134. package/dist/request-requirements.js.map +1 -0
  135. package/dist/review.d.ts +26 -26
  136. package/dist/review.d.ts.map +1 -1
  137. package/dist/review.js +50 -10
  138. package/dist/review.js.map +1 -1
  139. package/dist/route.d.ts +13 -13
  140. package/dist/route.d.ts.map +1 -1
  141. package/dist/route.js +19 -4
  142. package/dist/route.js.map +1 -1
  143. package/dist/setup.d.ts +9811 -0
  144. package/dist/setup.d.ts.map +1 -0
  145. package/dist/setup.js +475 -0
  146. package/dist/setup.js.map +1 -0
  147. package/dist/spec.d.ts +178 -61
  148. package/dist/spec.d.ts.map +1 -1
  149. package/dist/spec.js +69 -16
  150. package/dist/spec.js.map +1 -1
  151. package/dist/surface-run-controls.d.ts.map +1 -1
  152. package/dist/surface-run-controls.js +25 -21
  153. package/dist/surface-run-controls.js.map +1 -1
  154. package/dist/task.d.ts +1657 -60
  155. package/dist/task.d.ts.map +1 -1
  156. package/dist/task.js +144 -18
  157. package/dist/task.js.map +1 -1
  158. package/dist/telemetry.d.ts +487 -72
  159. package/dist/telemetry.d.ts.map +1 -1
  160. package/dist/telemetry.js +194 -16
  161. package/dist/telemetry.js.map +1 -1
  162. package/dist/thread.d.ts +89 -51
  163. package/dist/thread.d.ts.map +1 -1
  164. package/dist/thread.js +56 -11
  165. package/dist/thread.js.map +1 -1
  166. package/dist/tool-ref.d.ts +45 -0
  167. package/dist/tool-ref.d.ts.map +1 -0
  168. package/dist/tool-ref.js +45 -0
  169. package/dist/tool-ref.js.map +1 -0
  170. package/dist/workproduct.d.ts +3 -3
  171. package/dist/workproduct.d.ts.map +1 -1
  172. package/dist/workproduct.js.map +1 -1
  173. package/dist/workspace.d.ts +3 -3
  174. package/dist/workspace.d.ts.map +1 -1
  175. package/dist/workspace.js +12 -3
  176. package/dist/workspace.js.map +1 -1
  177. package/generated/AgentCapabilityCatalog.schema.json +53 -11
  178. package/generated/BudgetLease.schema.json +55 -6
  179. package/generated/BudgetObservation.schema.json +44 -7
  180. package/generated/ConformanceReport.schema.json +49 -0
  181. package/generated/ControlApplyCheckResponse.schema.json +34 -0
  182. package/generated/ControlArtifactListResponse.schema.json +57 -0
  183. package/generated/ControlAuthReadinessRefreshRequest.schema.json +38 -0
  184. package/generated/ControlAuthReadinessRefreshResponse.schema.json +85 -0
  185. package/generated/ControlCredentialProfileCreateRequest.schema.json +32 -0
  186. package/generated/ControlCredentialProfileCreateResponse.schema.json +142 -0
  187. package/generated/ControlCredentialProfileDeleteResponse.schema.json +107 -0
  188. package/generated/ControlCredentialProfilesResponse.schema.json +155 -0
  189. package/generated/ControlDeliveryResponse.schema.json +136 -0
  190. package/generated/ControlGcReceipt.schema.json +170 -0
  191. package/generated/ControlGcRequest.schema.json +18 -0
  192. package/generated/ControlHandshakeRequest.schema.json +26 -0
  193. package/generated/ControlHandshakeResponse.schema.json +30 -0
  194. package/generated/ControlHarnessListResponse.schema.json +198 -14
  195. package/generated/ControlHarnessModelsResponse.schema.json +19 -0
  196. package/generated/ControlHarnessSettingsPatch.schema.json +9 -12
  197. package/generated/ControlJournalEvent.schema.json +42 -0
  198. package/generated/ControlJournalExportReceipt.schema.json +49 -0
  199. package/generated/ControlJournalInspection.schema.json +149 -0
  200. package/generated/ControlJournalQuarantineReceipt.schema.json +55 -0
  201. package/generated/ControlJournalQuarantineRequest.schema.json +24 -0
  202. package/generated/ControlJournalValidation.schema.json +181 -0
  203. package/generated/ControlOperationCatalog.schema.json +128 -0
  204. package/generated/ControlOperationDescriptor.schema.json +110 -0
  205. package/generated/ControlProblem.schema.json +59 -0
  206. package/generated/ControlProject.schema.json +42 -0
  207. package/generated/ControlProjectListResponse.schema.json +54 -0
  208. package/generated/ControlProjectRegisterRequest.schema.json +19 -0
  209. package/generated/ControlProjectRelinkRequest.schema.json +19 -0
  210. package/generated/ControlQueuedRunInfo.schema.json +4 -2
  211. package/generated/ControlQuotaResponse.schema.json +177 -0
  212. package/generated/ControlResource.schema.json +59 -0
  213. package/generated/ControlRunAgainDraft.schema.json +539 -0
  214. package/generated/ControlRunDetail.schema.json +373 -34
  215. package/generated/ControlRunListResponse.schema.json +968 -0
  216. package/generated/ControlRunRetryResponse.schema.json +54 -0
  217. package/generated/ControlRunStartRequest.schema.json +123 -55
  218. package/generated/ControlRunStartResponse.schema.json +78 -0
  219. package/generated/ControlRunSummary.schema.json +312 -21
  220. package/generated/ControlSecretListResponse.schema.json +8 -14
  221. package/generated/ControlSecretMutationResponse.schema.json +32 -0
  222. package/generated/ControlSecretSetRequest.schema.json +27 -0
  223. package/generated/ControlSettingsSnapshot.schema.json +128 -44
  224. package/generated/ControlSettingsUpdateRequest.schema.json +119 -40
  225. package/generated/ControlSetupJob.schema.json +770 -64
  226. package/generated/ControlSetupJobCreateRequest.schema.json +16 -13
  227. package/generated/ControlSetupJobEvent.schema.json +869 -5
  228. package/generated/ControlSetupJobListFilter.schema.json +35 -0
  229. package/generated/ControlSetupJobListResponse.schema.json +770 -64
  230. package/generated/ControlSetupJobSnapshot.schema.json +878 -0
  231. package/generated/ControlSpecAnswersRequest.schema.json +74 -0
  232. package/generated/ControlSpecQuestionsRequest.schema.json +128 -2
  233. package/generated/ControlSpecSession.schema.json +249 -0
  234. package/generated/ControlSpecSessionListResponse.schema.json +261 -0
  235. package/generated/ControlThread.schema.json +36 -6
  236. package/generated/ControlThreadApplyResponse.schema.json +139 -0
  237. package/generated/ControlThreadCreateRequest.schema.json +6 -2
  238. package/generated/ControlThreadDetail.schema.json +64 -12
  239. package/generated/ControlThreadListResponse.schema.json +36 -6
  240. package/generated/ControlThreadTurnRequest.schema.json +413 -0
  241. package/generated/ControlThreadTurnResponse.schema.json +73 -0
  242. package/generated/ControlThreadUpdateRequest.schema.json +12 -1
  243. package/generated/ControlTrustListResponse.schema.json +6 -0
  244. package/generated/ControlTrustState.schema.json +6 -0
  245. package/generated/ControlTrustUpdateRequest.schema.json +65 -3
  246. package/generated/ControlUploadCreateRequest.schema.json +37 -0
  247. package/generated/ControlUploadFinalizeRequest.schema.json +17 -0
  248. package/generated/ControlUploadStatus.schema.json +40 -0
  249. package/generated/CredentialProfile.schema.json +78 -0
  250. package/generated/CredentialProfileStatus.schema.json +61 -0
  251. package/generated/DecisionRecord.schema.json +6 -3
  252. package/generated/GlobalConfig.schema.json +238 -55
  253. package/generated/HarnessEvent.schema.json +259 -11
  254. package/generated/HarnessManifest.schema.json +96 -14
  255. package/generated/HarnessModel.schema.json +19 -0
  256. package/generated/HarnessStatusDto.schema.json +198 -14
  257. package/generated/OrchestrateContract.schema.json +32 -6
  258. package/generated/OrchestratePlan.schema.json +20 -0
  259. package/generated/OrchestratePlanProgress.schema.json +61 -0
  260. package/generated/PaidBudget.schema.json +42 -0
  261. package/generated/Project.schema.json +45 -0
  262. package/generated/ProjectConfig.schema.json +45 -18
  263. package/generated/RawContextPacket.schema.json +184 -0
  264. package/generated/RawGitPatchEnvelope.schema.json +70 -0
  265. package/generated/RunEvent.schema.json +3 -0
  266. package/generated/RunTelemetry.schema.json +280 -0
  267. package/generated/SecretMetadata.schema.json +4 -7
  268. package/generated/Session.schema.json +14 -0
  269. package/generated/SpecPack.schema.json +118 -7
  270. package/generated/TaskContract.schema.json +224 -30
  271. package/generated/TestCommandInvocation.schema.json +45 -0
  272. package/generated/Thread.schema.json +74 -6
  273. package/generated/ThreadHeadPing.schema.json +40 -0
  274. package/generated/ThreadTurn.schema.json +24 -11
  275. package/generated/TrustConfig.schema.json +77 -0
  276. package/package.json +3 -2
  277. package/generated/ControlSetupJobConfirmRequest.schema.json +0 -18
  278. package/generated/ControlSpecFreezeRequest.schema.json +0 -83
package/dist/harness.js CHANGED
@@ -1,6 +1,11 @@
1
1
  import { z } from "zod";
2
- import { AccessProfile, AuthPreference, ExternalContextPolicy, Id, Intent, ProviderFamily } from "./primitives.js";
3
- import { Attachment, ImageInputMode } from "./attachment.js";
2
+ import { AuthSourceKind, AuthSourceReadiness, CredentialRoute } from "./auth.js";
3
+ import { CredentialProfile } from "./credential-profile.js";
4
+ import { ToolRef } from "./tool-ref.js";
5
+ import { AccessProfile, AuthPreference, ExternalContextPolicy, Id, Intent, ProviderFamily, } from "./primitives.js";
6
+ import { Attachment, AttachmentInputClass } from "./attachment.js";
7
+ import { ImplementationTransport, RawContextPacket, RawGitPatchEnvelope, RawPatchRefusalCode, } from "./raw.js";
8
+ import { QuotaConstraint, QuotaSource } from "./quota.js";
4
9
  /** Quality of a usage/quota signal a harness can emit. */
5
10
  export const SignalQuality = z
6
11
  .enum(["exact", "native", "observed", "manual", "unknown"])
@@ -46,12 +51,28 @@ export const WebPolicySupport = z
46
51
  export const HarnessCapabilities = z
47
52
  .object({
48
53
  plan: z.boolean().default(false).describe("The harness can produce plans (plan intent)."),
49
- implement: z.boolean().default(false).describe("The harness can implement code changes (implement intent)."),
50
- create_from_scratch: z.boolean().default(false).describe("The harness can scaffold new projects (create_from_scratch intent)."),
51
- review: z.boolean().default(false).describe("The harness can act as a reviewer (review intent)."),
54
+ implement: z
55
+ .boolean()
56
+ .default(false)
57
+ .describe("The harness can implement code changes (implement intent)."),
58
+ implementation_transport: ImplementationTransport.default("workspace").describe("Typed producer/consumer transport used when implement=true."),
59
+ create_from_scratch: z
60
+ .boolean()
61
+ .default(false)
62
+ .describe("The harness can scaffold new projects (create_from_scratch intent)."),
63
+ review: z
64
+ .boolean()
65
+ .default(false)
66
+ .describe("The harness can act as a reviewer (review intent)."),
52
67
  /** Consumed by the Phase-3 FinalVerifier routing (gating pushes `verify`). */
53
- verify: z.boolean().default(false).describe("The harness can act as the FinalVerifier (verify intent)."),
54
- synthesize: z.boolean().default(false).describe("The harness can synthesize across candidate outputs (synthesize intent)."),
68
+ verify: z
69
+ .boolean()
70
+ .default(false)
71
+ .describe("The harness can act as the FinalVerifier (verify intent)."),
72
+ synthesize: z
73
+ .boolean()
74
+ .default(false)
75
+ .describe("The harness can synthesize across candidate outputs (synthesize intent)."),
55
76
  read_files: z.boolean().default(false).describe("The harness can read project files."),
56
77
  /**
57
78
  * The adapter can inject a browser-automation MCP server (Playwright MCP) that
@@ -64,9 +85,15 @@ export const HarnessCapabilities = z
64
85
  .describe("The adapter can inject a browser-automation MCP server (Playwright MCP) the harness drives as browser_* tools; never injected when web policy is off."),
65
86
  web_policy: WebPolicySupport.default("none"),
66
87
  /** Honors HarnessRunSpec.max_turns (e.g. claude --max-turns). */
67
- max_turns: z.boolean().default(false).describe("Honors HarnessRunSpec.max_turns (e.g. a native --max-turns flag)."),
88
+ max_turns: z
89
+ .boolean()
90
+ .default(false)
91
+ .describe("Honors HarnessRunSpec.max_turns (e.g. a native --max-turns flag)."),
68
92
  /** Honors tool_permission_policy allow/deny lists (e.g. claude --allowedTools). */
69
- tool_lists: z.boolean().default(false).describe("Honors tool_permission_policy allow/deny lists (e.g. a native --allowedTools flag)."),
93
+ tool_lists: z
94
+ .boolean()
95
+ .default(false)
96
+ .describe("Honors tool_permission_policy allow/deny lists (e.g. a native --allowedTools flag)."),
70
97
  /**
71
98
  * The adapter can surface interactive user questions (interaction_requested
72
99
  * events) and deliver typed answers back into the live session. Claude's
@@ -114,9 +141,22 @@ export const HarnessCapabilities = z
114
141
  * routing logic.
115
142
  */
116
143
  known_models: z
117
- .array(z.string())
144
+ .array(z.union([
145
+ z.string(),
146
+ z
147
+ .object({
148
+ id: z.string().min(1).describe("Model id/alias."),
149
+ /** Credential routes this model is available on. A bare string
150
+ * entry means ALL routes (backward shape). */
151
+ routes: z
152
+ .array(z.enum(["local_session", "api_key"]))
153
+ .min(1)
154
+ .describe("Credential routes this model is available on."),
155
+ })
156
+ .strict(),
157
+ ]))
118
158
  .default([])
119
- .describe("Manifest-declared model ids/aliases this harness accepts, used as the model truth source when the adapter has no live inventory; explicit models outside the truth source are refused."),
159
+ .describe("Manifest-declared model ids/aliases this harness accepts (bare string = every credential route; object form scopes a model to specific routes), used as the model truth source when the adapter has no live inventory; explicit models outside the truth source are refused."),
120
160
  /**
121
161
  * Vendor CLI version this `known_models` hint set was last verified against
122
162
  * (freshness note, surfaced with manifest-sourced model lists and checked by
@@ -129,9 +169,15 @@ export const HarnessCapabilities = z
129
169
  .describe("Vendor CLI version the known_models hints were last verified against; null = never verified / not applicable."),
130
170
  })
131
171
  .describe("Declared harness capabilities the engine actually consumes for intent gating, routing, knob support, and disclosure.");
132
- export const AuthSourceKind = z
133
- .enum(["native_session", "api_key_env", "api_key_flag", "provider_auth_file", "none"])
134
- .describe("Where a harness's credentials can come from: a native login session, an API key via env var or CLI flag, a provider auth file, or none.");
172
+ /** Model ids from a known_models list that are valid on `route`. ONE owner for
173
+ * the route filter (INV-122): a bare string entry is valid on every route;
174
+ * `route: null` (undecidable pre-spawn) returns only the route-UNRESTRICTED
175
+ * ids — fail-closed, a route-scoped model never leaks past an unknown route. */
176
+ export function knownModelIdsForRoute(entries, route) {
177
+ return entries
178
+ .filter((entry) => typeof entry === "string" ? true : route !== null && entry.routes.includes(route))
179
+ .map((entry) => (typeof entry === "string" ? entry : entry.id));
180
+ }
135
181
  export const CredentialTransportKind = z
136
182
  .enum(["config_file", "env_var", "oauth_token_env", "os_keychain", "http_header", "none"])
137
183
  .describe("Mechanism that carries a credential to the harness process (config file, env var, OAuth token env, OS keychain, HTTP header, or none).");
@@ -142,19 +188,36 @@ export const CredentialTransport = z
142
188
  .object({
143
189
  source: AuthSourceKind,
144
190
  kind: CredentialTransportKind,
145
- relocatable_by: z.array(CredentialRelocation).default([]).describe("Relocation levers that can move this transport into a scoped environment."),
191
+ relocatable_by: z
192
+ .array(CredentialRelocation)
193
+ .default([])
194
+ .describe("Relocation levers that can move this transport into a scoped environment."),
146
195
  })
147
196
  .describe("How a credential from one auth source physically reaches the harness process.");
148
197
  export const AuthCapabilities = z
149
198
  .object({
150
- supported_sources: z.array(AuthSourceKind).default([]).describe("Auth sources this harness supports."),
151
- preferred_source: AuthSourceKind.nullable().default(null).describe("Auth source the adapter prefers; null when it has no preference."),
152
- credential_transports: z.array(CredentialTransport).default([]).describe("Declared credential transports per auth source."),
199
+ supported_sources: z
200
+ .array(AuthSourceKind)
201
+ .default([])
202
+ .describe("Auth sources this harness supports."),
203
+ preferred_source: AuthSourceKind.nullable()
204
+ .default(null)
205
+ .describe("Auth source the adapter prefers; null when it has no preference."),
206
+ credential_transports: z
207
+ .array(CredentialTransport)
208
+ .default([])
209
+ .describe("Declared credential transports per auth source."),
153
210
  })
154
211
  .default({})
155
212
  .describe("Declared auth routing facts for a harness.");
156
213
  export const ContainmentKind = z
157
- .enum(["env_or_file_injection", "scoped_home_keychain_bridge", "host_user_context", "process_sandbox", "container"])
214
+ .enum([
215
+ "env_or_file_injection",
216
+ "scoped_home_keychain_bridge",
217
+ "host_user_context",
218
+ "process_sandbox",
219
+ "container",
220
+ ])
158
221
  .describe("Isolation containment level an adapter supports for run environments, from env/file injection through scoped-HOME keychain bridging to process sandboxes and containers.");
159
222
  export const IsolationCapabilities = z
160
223
  .object({
@@ -187,12 +250,11 @@ export const HarnessCapabilityProfile = z
187
250
  auth: AuthCapabilities,
188
251
  access_control: AccessControlCapabilities,
189
252
  isolation: IsolationCapabilities,
190
- /** How the harness accepts image input (drives honest attach gating + the
191
- * per-adapter serializer). `none` = no vision input on this route. */
192
- image_input: ImageInputMode.default("none"),
253
+ /** Every accepted media class has a finite MIME/size/count/transport declaration. */
254
+ attachment_inputs: z.array(AttachmentInputClass).default([]),
193
255
  })
194
256
  .default({})
195
- .describe("Structured per-harness facts the engine consumes: auth routing, isolation containment, readonly mechanism, and vision input.");
257
+ .describe("Structured per-harness facts the engine consumes: auth routing, isolation containment, readonly mechanism, and finite attachment inputs.");
196
258
  /**
197
259
  * One enumerable model offered by a harness. Deliberately small: only the
198
260
  * fields a real enumeration source (an OpenAI-compatible `GET /v1/models`)
@@ -202,7 +264,11 @@ export const HarnessCapabilityProfile = z
202
264
  export const HarnessModel = z
203
265
  .object({
204
266
  id: z.string().describe("Model id as the vendor enumerates it."),
205
- label: z.string().nullable().default(null).describe("Human-readable model label; null when the enumeration source has none."),
267
+ label: z
268
+ .string()
269
+ .nullable()
270
+ .default(null)
271
+ .describe("Human-readable model label; null when the enumeration source has none."),
206
272
  context_window: z
207
273
  .number()
208
274
  .int()
@@ -210,6 +276,13 @@ export const HarnessModel = z
210
276
  .nullable()
211
277
  .default(null)
212
278
  .describe("Context window in tokens; null when the enumeration source does not report it."),
279
+ /** Credential routes the model is scoped to per the manifest annotation;
280
+ * null = unannotated (available on every route). */
281
+ routes: z
282
+ .array(z.enum(["local_session", "api_key"]))
283
+ .nullable()
284
+ .default(null)
285
+ .describe("Credential routes the model is scoped to; null = every route."),
213
286
  })
214
287
  .describe("One enumerable model offered by a harness, limited to fields a real enumeration source can honestly populate.");
215
288
  export const HarnessManifest = z
@@ -227,7 +300,10 @@ export const HarnessManifest = z
227
300
  .array(z.enum(["local_session", "api_key", "none"]))
228
301
  .default([])
229
302
  .describe("Auth modes the harness supports (availability only, not readiness)."),
230
- access_profiles_supported: z.array(AccessProfile).default([]).describe("Access profiles the adapter can enforce."),
303
+ access_profiles_supported: z
304
+ .array(AccessProfile)
305
+ .default([])
306
+ .describe("Access profiles the adapter can enforce."),
231
307
  })
232
308
  .describe("Static manifest an adapter declares for its harness: identity, kind, capabilities, auth modes, and access profiles.");
233
309
  /** Result of a conformance probe for one capability check. */
@@ -236,7 +312,12 @@ export const ConformanceCheck = z
236
312
  id: z.string().describe("Check id."),
237
313
  status: z.enum(["pass", "fail", "skip"]).describe("Outcome of the check: pass, fail, or skip."),
238
314
  detail: z.string().optional().describe("Human-readable detail for the outcome."),
239
- duration_ms: z.number().int().nonnegative().optional().describe("How long the check took, in milliseconds."),
315
+ duration_ms: z
316
+ .number()
317
+ .int()
318
+ .nonnegative()
319
+ .optional()
320
+ .describe("How long the check took, in milliseconds."),
240
321
  })
241
322
  .describe("Result of a conformance probe for one capability check.");
242
323
  export const AdapterStatus = z
@@ -247,35 +328,28 @@ export const ConformanceReport = z
247
328
  harness_id: Id.describe("Harness the report is about."),
248
329
  status: AdapterStatus,
249
330
  checks: z.array(ConformanceCheck).default([]).describe("Individual probe results."),
250
- enabled_intents: z.array(Intent).default([]).describe("Intents the gateway will route to this harness."),
331
+ enabled_intents: z
332
+ .array(Intent)
333
+ .default([])
334
+ .describe("Intents the gateway will route to this harness."),
251
335
  disabled_intents: z.array(Intent).default([]).describe("Intents the doctor disabled."),
252
- reasons: z.array(z.string()).default([]).describe("Human-readable reasons for degraded/unavailable status or disabled intents."),
336
+ reasons: z
337
+ .array(z.string())
338
+ .default([])
339
+ .describe("Human-readable reasons for degraded/unavailable status or disabled intents."),
340
+ auth_sources: z
341
+ .array(AuthSourceReadiness)
342
+ .default([])
343
+ .describe("Doctor-backed readiness by authentication source; an empty array means the adapter did not report source readiness."),
253
344
  })
254
345
  .describe("Doctor/conformance report for one harness: status, probe results, and the intents enabled or disabled by it.");
255
- /**
256
- * Per-run browser-tool wiring. Present (non-null) on a HarnessRunSpec ONLY when
257
- * the orchestrator has decided this run gets the agent-driven browser: the run
258
- * opted in, the harness has the `browser_tool` capability, AND web policy is not
259
- * `off`. The adapter injects Playwright MCP accordingly.
260
- */
261
346
  export const BrowserToolSpec = z
262
347
  .object({
263
- /**
264
- * `--output-dir` for the browser MCP. Captures the per-navigation accessibility
265
- * SNAPSHOTS (Playwright MCP writes screenshot image files to the agent's cwd,
266
- * not here) into the run artifact tree as a browsing record the Canvas gallery
267
- * lists. The live view is the headed window itself. Null = MCP's own temp dir.
268
- */
269
348
  output_dir: z
270
349
  .string()
271
350
  .nullable()
272
351
  .default(null)
273
352
  .describe("Output directory for the browser MCP's per-navigation accessibility snapshots, kept in the run artifact tree; null = the MCP's own temp dir."),
274
- /**
275
- * Run the browser headless (no visible window). Default false — a headed
276
- * Chromium so the user can watch the agent browse directly (the chosen mirror:
277
- * a real visible window, not an embedded screencast).
278
- */
279
353
  headless: z
280
354
  .boolean()
281
355
  .default(false)
@@ -288,6 +362,17 @@ export const HarnessRunSpec = z
288
362
  session_id: Id.describe("Session id this run belongs to."),
289
363
  intent: Intent,
290
364
  prompt: z.string().describe("Prompt text delivered to the harness."),
365
+ /**
366
+ * Optional caller-supplied system-level instructions layered on top of the
367
+ * prompt for TASK-PRODUCING lanes (primary, candidate, planner, explorer,
368
+ * orchestrate-planner) — never reviewers, synthesis, or the auth smoke.
369
+ * Adapters deliver it natively (claude `--append-system-prompt`, codex
370
+ * `developer_instructions`) or as a delimited prompt prefix.
371
+ */
372
+ instructions: z
373
+ .string()
374
+ .optional()
375
+ .describe("Caller-supplied system-level instructions for task-producing lanes; delivered natively (append-system-prompt / developer_instructions) or as a delimited prompt prefix."),
291
376
  cwd: z.string().describe("Working directory the harness process runs in."),
292
377
  access: AccessProfile.default("workspace_write"),
293
378
  external_context_policy: ExternalContextPolicy.default("auto"),
@@ -299,15 +384,36 @@ export const HarnessRunSpec = z
299
384
  })
300
385
  .default({ web: "auto", allow: [], deny: [] })
301
386
  .describe("Tool allow/deny policy for harnesses that support tool lists."),
302
- model_hint: z.string().nullable().default(null).describe("Requested model id; null = the harness's default."),
303
- effort_hint: EffortHint.nullable().default(null).describe("Requested reasoning effort; null = the harness's default."),
304
- max_usd: z.number().nullable().default(null).describe("USD spend cap for the attempt; null = no cap."),
305
- max_turns: z.number().int().nullable().default(null).describe("Maximum agent turns, for harnesses that honor it; null = no limit."),
387
+ model_hint: z
388
+ .string()
389
+ .nullable()
390
+ .default(null)
391
+ .describe("Requested model id; null = the harness's default."),
392
+ effort_hint: EffortHint.nullable()
393
+ .default(null)
394
+ .describe("Requested reasoning effort; null = the harness's default."),
395
+ max_turns: z
396
+ .number()
397
+ .int()
398
+ .nullable()
399
+ .default(null)
400
+ .describe("Maximum agent turns, for harnesses that honor it; null = no limit."),
306
401
  /**
307
402
  * Which auth route the attempt should use. `auto` = subscription-first with
308
403
  * api_key fallback; adapters seed native session vs inject the key accordingly.
309
404
  */
310
405
  auth_preference: AuthPreference.default("auto"),
406
+ /**
407
+ * The RESOLVED credential profile for this attempt (INV-135), stamped by
408
+ * the orchestrator (the one resolve owner) from the durable registry —
409
+ * adapters consume the typed transport and never read config. Null = the
410
+ * engine-default credential ladder. An explicit profile is STRICT: the
411
+ * adapter uses exactly its transport or refuses with a typed error, never
412
+ * a silent fallback to default credentials.
413
+ */
414
+ credential_profile: CredentialProfile.nullable()
415
+ .default(null)
416
+ .describe("Resolved credential profile for this attempt; null = engine-default credentials. Explicit profiles are strict: exact transport or typed refusal."),
311
417
  /**
312
418
  * Native CLI session id to resume into (codex `exec resume`, claude `--resume`,
313
419
  * cursor `agent --resume`, opencode `run --session`). Null starts a fresh session.
@@ -326,16 +432,33 @@ export const HarnessRunSpec = z
326
432
  .enum(["mirror_native", "clean"])
327
433
  .default("mirror_native")
328
434
  .describe("How the child harness env is composed: mirror_native inherits the parent env (minus provider-secret scrub); clean spawns from a minimal allowlist."),
329
- env: z.record(z.string(), z.string()).default({}).describe("Extra environment variables injected into the harness process."),
435
+ evidence_policy: z
436
+ .enum(["stream_only", "allow_vendor_session_artifacts"])
437
+ .default("allow_vendor_session_artifacts")
438
+ .describe("Whether route evidence may read vendor session artifacts; auth capability smokes require stream_only."),
439
+ /**
440
+ * Opt-in live text deltas (F2.5 W-C4): adapters that support partial
441
+ * output add their native flag (claude --include-partial-messages,
442
+ * cursor --stream-partial-output; codex exec has no deltas). Set ONLY on
443
+ * single-candidate chat lanes — racing lanes stay delta-free (noise × N).
444
+ * Delta messages carry payload.delta=true and never enter answers.
445
+ */
446
+ stream_deltas: z
447
+ .boolean()
448
+ .default(false)
449
+ .describe("Opt-in live text deltas on supporting adapters; single-candidate chat lanes only."),
450
+ env: z
451
+ .record(z.string(), z.string())
452
+ .default({})
453
+ .describe("Extra environment variables injected into the harness process."),
330
454
  /**
331
- * User/agent attachments (images, files) forwarded to the harness in its
332
- * native shape per `capability_profile.image_input`. Empty for non-vision
333
- * harnesses — the orchestrator drops + discloses rather than silently ignore.
455
+ * Immutable user/agent resources forwarded only after the selected adapter's
456
+ * finite `capability_profile.attachment_inputs` declaration admits them.
334
457
  */
335
458
  attachments: z
336
459
  .array(Attachment)
337
460
  .default([])
338
- .describe("Attachments forwarded to the harness in its native shape; empty for non-vision harnesses (dropped and disclosed)."),
461
+ .describe("Digest-bound resources forwarded to the harness in its declared native attachment transport."),
339
462
  /**
340
463
  * Agent-driven browser wiring. Null = no browser tool this run (the common
341
464
  * case). Set by the orchestrator only when the run opted in, the harness has
@@ -354,46 +477,26 @@ export const HarnessRunSpec = z
354
477
  .unknown()
355
478
  .optional()
356
479
  .describe("JSON Schema constraining the harness's final message; passed only to routes declaring json_schema_output."),
357
- extra: z.record(z.string(), z.unknown()).default({}).describe("Adapter-specific extras (no cross-adapter meaning)."),
358
- })
359
- .describe("Spec passed to a harness adapter's run(): prompt, working directory, access, policies, routing hints, and wiring.");
360
- /**
361
- * Coarse tool classification used for typed governance (no tool-name string
362
- * matching outside adapters). Adapters map native tool names to a kind.
363
- */
364
- export const ToolKind = z
365
- .enum(["web", "file", "command", "mcp", "search", "other"])
366
- .describe("Coarse tool classification used for typed governance; adapters map native tool names to a kind.");
367
- /**
368
- * Typed tool reference attached to `tool_call` / `tool_result` events.
369
- * `status` is REQUIRED on `tool_result` events (adapter conformance enforces it);
370
- * a missing status on a result is treated as a dropped/diagnostic event, never as ok.
371
- */
372
- export const ToolRef = z
373
- .object({
374
- name: z.string().describe("Native tool name as the harness reports it."),
375
- kind: ToolKind.default("other"),
376
- use_id: z.string().optional().describe("Correlates a tool_result with its tool_call."),
377
- /** Redacted, bounded human-readable target (query/url/path/command). */
378
- target: z.string().optional().describe("Redacted, bounded human-readable target (query/url/path/command)."),
379
- status: z
380
- .enum(["ok", "error", "cancelled", "denied"])
480
+ raw_context_packet: RawContextPacket.nullable()
381
481
  .optional()
382
- .describe("Outcome of the tool use; required on tool_result events (a missing status is never treated as ok)."),
383
- /** Redacted, bounded error detail for status=error results. */
384
- error_summary: z.string().optional().describe("Redacted, bounded error detail for status=error results."),
385
- /** Redacted, bounded content detail for results (success or failure). */
386
- content_summary: z.string().optional().describe("Redacted, bounded content detail for results (success or failure)."),
387
- exit_code: z.number().int().optional().describe("Process exit code for command tools, when known."),
482
+ .describe("Hash-bound context packet supplied only to git-patch-envelope producers."),
483
+ extra: z
484
+ .record(z.string(), z.unknown())
485
+ .default({})
486
+ .describe("Adapter-specific extras (no cross-adapter meaning)."),
388
487
  })
389
- .describe("Typed tool reference attached to tool_call/tool_result events.");
488
+ .describe("Spec passed to a harness adapter's run(): prompt, working directory, access, policies, routing hints, and wiring.");
390
489
  /**
391
490
  * One multiple-choice option of an interactive question (AskUserQuestion-style).
392
491
  */
393
492
  export const InteractionOption = z
394
493
  .object({
395
494
  label: z.string().describe("Option label shown to the user."),
396
- description: z.string().nullable().default(null).describe("Optional longer explanation of the option."),
495
+ description: z
496
+ .string()
497
+ .nullable()
498
+ .default(null)
499
+ .describe("Optional longer explanation of the option."),
397
500
  })
398
501
  .describe("One multiple-choice option of an interactive question.");
399
502
  export const InteractionQuestion = z
@@ -401,8 +504,15 @@ export const InteractionQuestion = z
401
504
  id: Id.describe("Question id."),
402
505
  question: z.string().describe("The question text."),
403
506
  /** Short chip/header text some harnesses attach to a question. */
404
- header: z.string().nullable().default(null).describe("Short chip/header text some harnesses attach to a question."),
405
- options: z.array(InteractionOption).default([]).describe("Selectable options; empty for free-text-only questions."),
507
+ header: z
508
+ .string()
509
+ .nullable()
510
+ .default(null)
511
+ .describe("Short chip/header text some harnesses attach to a question."),
512
+ options: z
513
+ .array(InteractionOption)
514
+ .default([])
515
+ .describe("Selectable options; empty for free-text-only questions."),
406
516
  multi_select: z.boolean().default(false).describe("Whether multiple options may be selected."),
407
517
  })
408
518
  .describe("One question of an interactive user-input request.");
@@ -414,16 +524,27 @@ export const InteractionQuestion = z
414
524
  export const InteractionRequest = z
415
525
  .object({
416
526
  interaction_id: Id.describe("Interaction id used to correlate the answer set."),
417
- questions: z.array(InteractionQuestion).default([]).describe("Questions the harness wants answered."),
527
+ questions: z
528
+ .array(InteractionQuestion)
529
+ .default([])
530
+ .describe("Questions the harness wants answered."),
418
531
  /** Native tool that raised the request (e.g. "AskUserQuestion"). */
419
- source_tool: z.string().nullable().default(null).describe('Native tool that raised the request (e.g. "AskUserQuestion").'),
532
+ source_tool: z
533
+ .string()
534
+ .nullable()
535
+ .default(null)
536
+ .describe('Native tool that raised the request (e.g. "AskUserQuestion").'),
420
537
  })
421
538
  .describe("A live request for user input raised by an interactive harness session.");
422
539
  export const InteractionAnswer = z
423
540
  .object({
424
541
  question_id: Id.describe("Id of the question being answered."),
425
542
  selected_labels: z.array(z.string()).default([]).describe("Labels of the selected options."),
426
- free_text: z.string().nullable().default(null).describe("Free-text answer; null when only options were selected."),
543
+ free_text: z
544
+ .string()
545
+ .nullable()
546
+ .default(null)
547
+ .describe("Free-text answer; null when only options were selected."),
427
548
  })
428
549
  .describe("The user's answer to one interactive question.");
429
550
  export const InteractionAnswerSet = z
@@ -444,47 +565,74 @@ export const HarnessEvent = z
444
565
  "tool_result",
445
566
  "interaction_requested",
446
567
  "file_change",
568
+ "patch_produced",
447
569
  "usage",
448
570
  "error",
571
+ "status",
449
572
  "completed",
450
573
  ])
451
- .describe("Normalized event type covering session lifecycle, output, tool use, interaction, file changes, usage, and errors."),
574
+ .describe("Normalized event type covering session lifecycle, output, tool use, interaction, file changes, usage, transient status, and errors."),
452
575
  session_id: Id.describe("Session the event belongs to."),
453
576
  ts: z.string().describe("Event timestamp."),
454
577
  text: z.string().optional().describe("Text content for thinking/message/error events."),
578
+ /**
579
+ * True on the harness's TYPED final answer message — claude/cursor's
580
+ * terminal `result` event, codex's last agent message finalized at
581
+ * `turn.completed`. Narration (mid-run) messages never set it; consumers
582
+ * take a final message VERBATIM as the answer instead of joining prose.
583
+ */
584
+ final: z
585
+ .boolean()
586
+ .optional()
587
+ .describe("True on the harness's typed final-answer message (vendor terminal result); mid-run narration never sets it."),
455
588
  /** Typed tool info; set on `tool_call` and `tool_result` events. */
456
589
  tool: ToolRef.optional().describe("Typed tool info; set on tool_call and tool_result events."),
457
590
  /** Set on `interaction_requested` events. */
458
591
  interaction: InteractionRequest.optional().describe("Set on interaction_requested events."),
592
+ patch_envelope: RawGitPatchEnvelope.optional().describe("Typed hash-bound patch produced by a git-patch-envelope harness."),
593
+ refusal_code: RawPatchRefusalCode.optional().describe("Typed refusal code for a rejected raw patch contract."),
459
594
  usage: z
460
595
  .object({
461
596
  input_tokens: z.number().int().nonnegative().optional().describe("Input tokens consumed."),
462
- output_tokens: z.number().int().nonnegative().optional().describe("Output tokens produced."),
463
- cached_input_tokens: z.number().int().nonnegative().optional().describe("Input tokens served from cache."),
597
+ output_tokens: z
598
+ .number()
599
+ .int()
600
+ .nonnegative()
601
+ .optional()
602
+ .describe("Output tokens produced."),
603
+ cached_input_tokens: z
604
+ .number()
605
+ .int()
606
+ .nonnegative()
607
+ .optional()
608
+ .describe("Input tokens served from cache."),
464
609
  cost_usd: z.number().nonnegative().optional().describe("Cost in USD."),
465
610
  /** True when cost_usd is derived from token pricing (not natively reported). */
466
- estimated: z.boolean().optional().describe("True when cost_usd is derived from token pricing (not natively reported)."),
611
+ estimated: z
612
+ .boolean()
613
+ .optional()
614
+ .describe("True when cost_usd is derived from token pricing (not natively reported)."),
467
615
  })
468
616
  .optional()
469
617
  .describe("Token/cost usage reported by the harness."),
470
618
  observed_model: z.string().optional().describe("Model the harness actually reported using."),
471
- /**
472
- * Typed quota/usage-window signal: the harness CLI's OWN record of how
473
- * much of its subscription/rate window is consumed. Producers read native
474
- * machine-readable surfaces only (codex rollout `token_count.rate_limits`);
475
- * a harness with no native surface emits nothing (fail-honest, never
476
- * scraped from prose). The budget layer maps this to a `used_percent`
477
- * observation; `headroom()` and pool ordering consume it.
478
- */
619
+ credential_route: CredentialRoute.optional().describe("Concrete credential route selected before spawn; first-class route evidence, never inferred from free-form payload text."),
620
+ credential_source: AuthSourceKind.optional().describe("Concrete credential source selected before spawn; exact native subscription requires native_session, never an OAuth token or API key."),
621
+ /** Credential profile the attempt runs under (INV-135); stamped by the
622
+ * adapter alongside credential_route so quota/api_retry records stay
623
+ * independently attributable to the profile. Absent = engine default. */
624
+ credential_profile_id: Id.optional().describe("Credential profile the attempt runs under; absent = engine-default credentials (INV-135 attribution)."),
625
+ /** Vendor-owned quota windows. All reported windows remain independent. */
479
626
  quota: z
480
627
  .object({
481
- /** 0-100: consumed share of the binding rate window. */
482
- used_percent: z.number().min(0).max(100).describe("Consumed share of the binding rate window, 0-100."),
483
- /** Native reset moment for the window, when the CLI reports one. */
484
- resets_at: z.string().nullable().default(null).describe("Native reset moment for the window, when the CLI reports one."),
628
+ source: QuotaSource,
629
+ plan_label: z.string().nullable().default(null),
630
+ subject_id: z.string().nullable().default(null),
631
+ constraints: z.array(QuotaConstraint),
485
632
  })
633
+ .strict()
486
634
  .optional()
487
- .describe("Typed quota/usage-window signal from the harness CLI's own native machine-readable surface, never scraped from prose."),
635
+ .describe("All quota windows from a vendor-owned machine-readable source; never scraped from prose or collapsed into a fake aggregate."),
488
636
  /**
489
637
  * Typed live plan/todo progress: adapters map their native plan tools
490
638
  * (codex `todo_list` items, claude `TodoWrite` todos) into this shape in
@@ -498,7 +646,9 @@ export const HarnessEvent = z
498
646
  .array(z.object({
499
647
  id: z.string().describe("Plan item id."),
500
648
  title: z.string().describe("Plan item title."),
501
- status: z.enum(["pending", "in_progress", "completed"]).describe("Progress state of the item."),
649
+ status: z
650
+ .enum(["pending", "in_progress", "completed"])
651
+ .describe("Progress state of the item."),
502
652
  }))
503
653
  .default([])
504
654
  .describe("Last-wins list of plan/todo items."),
@@ -513,7 +663,11 @@ export const HarnessEvent = z
513
663
  */
514
664
  rate_limit: z
515
665
  .object({
516
- resets_at: z.string().nullable().default(null).describe("When the rate window resets, when reported."),
666
+ resets_at: z
667
+ .string()
668
+ .nullable()
669
+ .default(null)
670
+ .describe("When the rate window resets, when reported."),
517
671
  retry_delay_ms: z
518
672
  .number()
519
673
  .int()
@@ -524,6 +678,48 @@ export const HarnessEvent = z
524
678
  })
525
679
  .optional()
526
680
  .describe("Typed rate-limit/quota signal set by the adapter when the native CLI reports a 429/quota/overload."),
681
+ /**
682
+ * Typed transient-status detail; set on `status` events. Today's only kind
683
+ * is claude's native `api_retry` (the CLI is retrying an API call by
684
+ * itself): the adapter maps the official fields through instead of
685
+ * fabricating a thinking block, so retries land in the activity feed —
686
+ * never in the reasoning disclosure. `error_category` passes the vendor's
687
+ * own label (e.g. rate_limit, overloaded) verbatim as disclosed evidence.
688
+ */
689
+ status: z
690
+ .object({
691
+ kind: z.enum(["api_retry"]).describe("Kind of transient status."),
692
+ attempt: z.number().int().nonnegative().optional().describe("Retry attempt number."),
693
+ max_retries: z
694
+ .number()
695
+ .int()
696
+ .nonnegative()
697
+ .optional()
698
+ .describe("Vendor's configured retry ceiling."),
699
+ retry_delay_ms: z
700
+ .number()
701
+ .int()
702
+ .nonnegative()
703
+ .optional()
704
+ .describe("Delay before the retry, when reported."),
705
+ error_category: z
706
+ .enum([
707
+ "authentication_failed",
708
+ "oauth_org_not_allowed",
709
+ "billing_error",
710
+ "rate_limit",
711
+ "overloaded",
712
+ "invalid_request",
713
+ "model_not_found",
714
+ "server_error",
715
+ "max_output_tokens",
716
+ "unknown",
717
+ ])
718
+ .optional()
719
+ .describe("Vendor's error category mapped onto the documented enum; unrecognized values collapse to 'unknown' (never free-form prose)."),
720
+ })
721
+ .optional()
722
+ .describe("Typed transient-status detail set by the adapter on status events."),
527
723
  /**
528
724
  * Typed transient-failure signal. Adapters set this from native CLI/API error
529
725
  * shapes in their parse layer; the orchestrator consumes it for bounded retry
@@ -546,7 +742,14 @@ export const HarnessEvent = z
546
742
  .optional()
547
743
  .describe("Typed transient-failure signal set by the adapter from native CLI/API error shapes, consumed for bounded retry policy."),
548
744
  error: z.string().optional().describe("Error text for error events."),
549
- payload: z.record(z.string(), z.unknown()).optional().describe("Raw adapter-specific payload for diagnostics."),
745
+ aborted: z
746
+ .boolean()
747
+ .optional()
748
+ .describe("Typed terminal cancellation marker, set on completed events when the run was aborted."),
749
+ payload: z
750
+ .record(z.string(), z.unknown())
751
+ .optional()
752
+ .describe("Raw adapter-specific payload for diagnostics."),
550
753
  })
551
754
  .describe("Normalized event emitted by every adapter (the SSOT of adapter output).");
552
755
  //# sourceMappingURL=harness.js.map