@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
@@ -206,6 +206,43 @@
206
206
  "description": "Auth route the attempt actually ran under (local_session subscription vs api_key), disclosed by the adapter's typed started payload; null when never disclosed (treated as unknown, never guessed).",
207
207
  "default": null
208
208
  },
209
+ "auth_source": {
210
+ "anyOf": [
211
+ {
212
+ "type": "string",
213
+ "enum": [
214
+ "native_session",
215
+ "oauth_token_env",
216
+ "api_key_env",
217
+ "api_key_flag",
218
+ "provider_auth_file",
219
+ "none"
220
+ ],
221
+ "description": "Concrete credential source used or probed by a harness."
222
+ },
223
+ {
224
+ "type": "null"
225
+ }
226
+ ],
227
+ "description": "Concrete credential source the attempt disclosed (native_session/api_key_env/...); null when never disclosed.",
228
+ "default": null
229
+ },
230
+ "profile_id": {
231
+ "type": [
232
+ "string",
233
+ "null"
234
+ ],
235
+ "default": null,
236
+ "description": "Credential profile the attempt actually ran under (adapter-stamped); null = engine default or undisclosed."
237
+ },
238
+ "requested_model": {
239
+ "type": [
240
+ "string",
241
+ "null"
242
+ ],
243
+ "default": null,
244
+ "description": "Model hint the engine sent the attempt; null when the route ran on its default."
245
+ },
209
246
  "request_requirements": {
210
247
  "type": "array",
211
248
  "items": {
@@ -213,7 +250,10 @@
213
250
  "properties": {
214
251
  "capability": {
215
252
  "type": "string",
216
- "const": "browser"
253
+ "enum": [
254
+ "browser",
255
+ "path_deny"
256
+ ]
217
257
  },
218
258
  "harness_id": {
219
259
  "type": "string",
@@ -235,7 +275,8 @@
235
275
  "effective",
236
276
  "manifest_unsupported",
237
277
  "web_policy_off",
238
- "access_profile_incompatible"
278
+ "access_profile_incompatible",
279
+ "postdiff_only"
239
280
  ]
240
281
  },
241
282
  "evidence_refs": {
@@ -460,6 +501,50 @@
460
501
  "additionalProperties": false,
461
502
  "description": "Contract/outcome truth for one attempt; tool errors are tracked separately from deliverable production.",
462
503
  "default": {}
504
+ },
505
+ "usage": {
506
+ "type": "object",
507
+ "properties": {
508
+ "input_tokens": {
509
+ "anyOf": [
510
+ {
511
+ "type": "integer",
512
+ "minimum": 0
513
+ },
514
+ {
515
+ "type": "null"
516
+ }
517
+ ],
518
+ "default": null
519
+ },
520
+ "output_tokens": {
521
+ "anyOf": [
522
+ {
523
+ "type": "integer",
524
+ "minimum": 0
525
+ },
526
+ {
527
+ "type": "null"
528
+ }
529
+ ],
530
+ "default": null
531
+ },
532
+ "cached_input_tokens": {
533
+ "anyOf": [
534
+ {
535
+ "type": "integer",
536
+ "minimum": 0
537
+ },
538
+ {
539
+ "type": "null"
540
+ }
541
+ ],
542
+ "default": null
543
+ }
544
+ },
545
+ "additionalProperties": false,
546
+ "description": "Token usage summed from harness usage events; money is tracked separately in the budget ledger, not here. Each field is null until a harness reports it (cursor reports cost only; raw-api has no cached), so unreported never reads as 0. Do NOT sum into a grand total: codex cached is a subset of input while claude cached is disjoint from input.",
547
+ "default": {}
463
548
  }
464
549
  },
465
550
  "required": [
@@ -487,6 +572,121 @@
487
572
  "default": 0,
488
573
  "description": "Sum of attempt tool warnings; rendered separately from terminal state."
489
574
  },
575
+ "usage_totals": {
576
+ "$ref": "#/definitions/RunTelemetry/properties/attempts/items/properties/usage",
577
+ "default": {},
578
+ "description": "Token usage summed from harness usage events; money is tracked separately in the budget ledger, not here. Each field is null until a harness reports it (cursor reports cost only; raw-api has no cached), so unreported never reads as 0. Do NOT sum into a grand total: codex cached is a subset of input while claude cached is disjoint from input."
579
+ },
580
+ "auth_route": {
581
+ "anyOf": [
582
+ {
583
+ "type": "object",
584
+ "properties": {
585
+ "requested": {
586
+ "type": "string",
587
+ "enum": [
588
+ "subscription",
589
+ "api_key",
590
+ "auto"
591
+ ],
592
+ "description": "Preferred auth route: subscription (native/OAuth session), api_key (a stored API key), or auto (engine picks subscription-first with policy fallback). A preference, not a secret."
593
+ },
594
+ "effective": {
595
+ "anyOf": [
596
+ {
597
+ "$ref": "#/definitions/RunTelemetry/properties/attempts/items/properties/auth_mode/anyOf/0"
598
+ },
599
+ {
600
+ "type": "null"
601
+ }
602
+ ],
603
+ "description": "Auth mode a route runs under: a native local session, an API key, or unknown.",
604
+ "default": null
605
+ },
606
+ "source": {
607
+ "anyOf": [
608
+ {
609
+ "$ref": "#/definitions/RunTelemetry/properties/attempts/items/properties/auth_source/anyOf/0"
610
+ },
611
+ {
612
+ "type": "null"
613
+ }
614
+ ],
615
+ "description": "Concrete credential source used or probed by a harness.",
616
+ "default": null
617
+ },
618
+ "reason": {
619
+ "type": "string",
620
+ "enum": [
621
+ "as_requested",
622
+ "native_first",
623
+ "no_native_session_fallback",
624
+ "requested_route_unavailable",
625
+ "undisclosed"
626
+ ],
627
+ "description": "Deterministic reason for the effective auth route: as_requested, native_first (auto, INV-061), no_native_session_fallback (auto downgraded to api_key), requested_route_unavailable (explicit preference contradicted), or undisclosed."
628
+ },
629
+ "harness_id": {
630
+ "type": [
631
+ "string",
632
+ "null"
633
+ ],
634
+ "default": null
635
+ },
636
+ "attempt_id": {
637
+ "type": [
638
+ "string",
639
+ "null"
640
+ ],
641
+ "default": null
642
+ },
643
+ "profile_id": {
644
+ "type": [
645
+ "string",
646
+ "null"
647
+ ],
648
+ "default": null,
649
+ "description": "Credential profile the deciding attempt ran under; null = engine-default credentials."
650
+ },
651
+ "model_mismatch": {
652
+ "anyOf": [
653
+ {
654
+ "type": "object",
655
+ "properties": {
656
+ "requested": {
657
+ "type": "string"
658
+ },
659
+ "observed": {
660
+ "type": "string"
661
+ }
662
+ },
663
+ "required": [
664
+ "requested",
665
+ "observed"
666
+ ],
667
+ "additionalProperties": false
668
+ },
669
+ {
670
+ "type": "null"
671
+ }
672
+ ],
673
+ "default": null,
674
+ "description": "Requested-vs-observed model mismatch on the deciding attempt; null when they match or either side is unknown."
675
+ }
676
+ },
677
+ "required": [
678
+ "requested",
679
+ "reason"
680
+ ],
681
+ "additionalProperties": false
682
+ },
683
+ {
684
+ "type": "null"
685
+ }
686
+ ],
687
+ "default": null,
688
+ "description": "Auth route receipt: requested preference, disclosed effective route/source, deterministic reason, and the disclosing attempt; surfaces project it verbatim."
689
+ },
490
690
  "generated_at": {
491
691
  "type": "string",
492
692
  "minLength": 1,
@@ -36,6 +36,20 @@
36
36
  "description": "How the session can be continued on its native CLI: resume_by_id when a native session id exists, none otherwise.",
37
37
  "default": "none"
38
38
  },
39
+ "profile_id": {
40
+ "anyOf": [
41
+ {
42
+ "type": "string",
43
+ "minLength": 1,
44
+ "description": "Non-empty identifier string."
45
+ },
46
+ {
47
+ "type": "null"
48
+ }
49
+ ],
50
+ "description": "Credential profile the vendor session was created under; resume never crosses profiles (null = engine-default credentials).",
51
+ "default": null
52
+ },
39
53
  "last_observed_model": {
40
54
  "type": [
41
55
  "string",
@@ -90,12 +90,65 @@
90
90
  "additionalProperties": false,
91
91
  "description": "The user's request this run is held to."
92
92
  },
93
+ "instructions": {
94
+ "type": "string",
95
+ "description": "Caller-supplied per-run system-level instructions for task-producing lanes."
96
+ },
97
+ "output_schema": {
98
+ "anyOf": [
99
+ {
100
+ "type": "object",
101
+ "additionalProperties": {}
102
+ },
103
+ {
104
+ "type": "null"
105
+ }
106
+ ],
107
+ "default": null,
108
+ "description": "Normalized caller-supplied JSON Schema for the final answer; null when the run has no structured-output contract."
109
+ },
110
+ "auth_preference": {
111
+ "type": "string",
112
+ "enum": [
113
+ "subscription",
114
+ "api_key",
115
+ "auto"
116
+ ],
117
+ "description": "Requested auth route for the run (subscription/api_key/auto); the telemetry auth_route receipt carries the effective truth.",
118
+ "default": "auto"
119
+ },
120
+ "credential_profile_id": {
121
+ "anyOf": [
122
+ {
123
+ "type": "string",
124
+ "minLength": 1,
125
+ "description": "Non-empty identifier string."
126
+ },
127
+ {
128
+ "type": "null"
129
+ }
130
+ ],
131
+ "description": "Requested credential profile for the run; null = engine-default credentials (INV-135 route evidence).",
132
+ "default": null
133
+ },
134
+ "max_turns": {
135
+ "anyOf": [
136
+ {
137
+ "type": "integer",
138
+ "exclusiveMinimum": 0
139
+ },
140
+ {
141
+ "type": "null"
142
+ }
143
+ ],
144
+ "default": null,
145
+ "description": "Per-run turn cap (beats per-harness settings); null when the caller set none."
146
+ },
93
147
  "spec": {
94
148
  "type": "object",
95
149
  "properties": {
96
150
  "id": {
97
- "type": "string",
98
- "minLength": 1,
151
+ "$ref": "#/definitions/TaskContract/properties/credential_profile_id/anyOf/0",
99
152
  "description": "SpecPack id."
100
153
  },
101
154
  "hash": {
@@ -187,7 +240,7 @@
187
240
  "depends_on": {
188
241
  "type": "array",
189
242
  "items": {
190
- "$ref": "#/definitions/TaskContract/properties/spec/properties/id"
243
+ "$ref": "#/definitions/TaskContract/properties/credential_profile_id/anyOf/0"
191
244
  },
192
245
  "default": [],
193
246
  "description": "Ids of tasks this node depends on (graph edges)."
@@ -205,7 +258,7 @@
205
258
  "order": {
206
259
  "type": "array",
207
260
  "items": {
208
- "$ref": "#/definitions/TaskContract/properties/spec/properties/id"
261
+ "$ref": "#/definitions/TaskContract/properties/credential_profile_id/anyOf/0"
209
262
  },
210
263
  "default": [],
211
264
  "description": "Topological execution order (node ids); empty when there are no tasks."
@@ -232,6 +285,14 @@
232
285
  "default": [],
233
286
  "description": "Spec/config-owned globs whose changes escalate risk to a human-approval gate; cannot be suppressed by per-run protected-path approvals."
234
287
  },
288
+ "deny_paths": {
289
+ "type": "array",
290
+ "items": {
291
+ "type": "string"
292
+ },
293
+ "default": [],
294
+ "description": "Per-run globs no candidate may touch at all; enforced by the engine post-diff gate on envelope runs (in-place runs with deny_paths are refused). accept_risk may still deliver (INV-111)."
295
+ },
235
296
  "auto_protected_paths": {
236
297
  "type": "array",
237
298
  "items": {
@@ -81,6 +81,20 @@
81
81
  "description": "Preferred auth route: subscription (native/OAuth session), api_key (a stored API key), or auto (engine picks subscription-first with policy fallback). A preference, not a secret.",
82
82
  "default": "auto"
83
83
  },
84
+ "credential_profile_id": {
85
+ "anyOf": [
86
+ {
87
+ "type": "string",
88
+ "minLength": 1,
89
+ "description": "Non-empty identifier string."
90
+ },
91
+ {
92
+ "type": "null"
93
+ }
94
+ ],
95
+ "description": "Sticky credential profile for the thread; per-turn selection wins, null = engine-default credentials.",
96
+ "default": null
97
+ },
84
98
  "primary_harness": {
85
99
  "type": [
86
100
  "string",
@@ -128,9 +142,7 @@
128
142
  "delivered_through_run_id": {
129
143
  "anyOf": [
130
144
  {
131
- "type": "string",
132
- "minLength": 1,
133
- "description": "Non-empty identifier string."
145
+ "$ref": "#/definitions/Thread/properties/credential_profile_id/anyOf/0"
134
146
  },
135
147
  {
136
148
  "type": "null"
@@ -147,7 +159,7 @@
147
159
  "run_ids": {
148
160
  "type": "array",
149
161
  "items": {
150
- "$ref": "#/definitions/Thread/properties/workspace/properties/delivered_through_run_id/anyOf/0"
162
+ "$ref": "#/definitions/Thread/properties/credential_profile_id/anyOf/0"
151
163
  },
152
164
  "default": [],
153
165
  "description": "Ordered run lineage (each run is a turn move)."
@@ -155,7 +167,7 @@
155
167
  "head_run_id": {
156
168
  "anyOf": [
157
169
  {
158
- "$ref": "#/definitions/Thread/properties/workspace/properties/delivered_through_run_id/anyOf/0"
170
+ "$ref": "#/definitions/Thread/properties/credential_profile_id/anyOf/0"
159
171
  },
160
172
  {
161
173
  "type": "null"
@@ -0,0 +1,40 @@
1
+ {
2
+ "$ref": "#/definitions/ThreadHeadPing",
3
+ "definitions": {
4
+ "ThreadHeadPing": {
5
+ "type": "object",
6
+ "properties": {
7
+ "thread_id": {
8
+ "type": "string",
9
+ "minLength": 1,
10
+ "description": "Non-empty identifier string."
11
+ },
12
+ "project_id": {
13
+ "anyOf": [
14
+ {
15
+ "type": "string",
16
+ "minLength": 1
17
+ },
18
+ {
19
+ "type": "null"
20
+ }
21
+ ],
22
+ "description": "Owning project id, or null for a no-project (global-partition) thread."
23
+ },
24
+ "revision": {
25
+ "type": "integer",
26
+ "exclusiveMinimum": 0,
27
+ "description": "Monotonic per-thread mutation counter; consumers drop stale/duplicate pings."
28
+ }
29
+ },
30
+ "required": [
31
+ "thread_id",
32
+ "project_id",
33
+ "revision"
34
+ ],
35
+ "additionalProperties": false,
36
+ "description": "Payload of the `thread.head.updated` GLOBAL-partition journal event: a content-free sidebar invalidation ping emitted on every thread mutation (create / rename / archive / turn-add / run-terminal, from any surface). It carries identity only — consumers refetch the authoritative thread summary instead of trusting event content."
37
+ }
38
+ },
39
+ "$schema": "http://json-schema.org/draft-07/schema#"
40
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claudexor/schema",
3
- "version": "2.0.0",
3
+ "version": "2.1.2",
4
4
  "license": "MIT",
5
5
  "description": "Single source of truth for all Claudexor data shapes (Zod + generated JSON Schema).",
6
6
  "type": "module",
@@ -19,7 +19,8 @@
19
19
  ],
20
20
  "dependencies": {
21
21
  "zod": "^3.24.1",
22
- "zod-to-json-schema": "^3.24.1"
22
+ "zod-to-json-schema": "^3.24.1",
23
+ "@claudexor/util": "2.1.2"
23
24
  },
24
25
  "repository": {
25
26
  "type": "git",