@bitkyc08/opencodex 2.11.1 → 2.12.0

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 (175) hide show
  1. package/README.md +1 -1
  2. package/bin/ocx.mjs +4 -0
  3. package/gui/dist/assets/index-BNVYzdn0.css +1 -0
  4. package/gui/dist/assets/index-Cw1_mxO8.js +70 -0
  5. package/gui/dist/index.html +2 -2
  6. package/package.json +1 -1
  7. package/src/adapters/command-code.ts +94 -5
  8. package/src/adapters/cursor/live-transport.ts +14 -1
  9. package/src/adapters/google-tool-schema.ts +80 -15
  10. package/src/adapters/google.ts +24 -7
  11. package/src/adapters/openai-chat.ts +233 -305
  12. package/src/adapters/openai-responses.ts +62 -0
  13. package/src/adapters/tool-catalog-nudge.ts +2 -11
  14. package/src/claude/outbound.ts +42 -14
  15. package/src/cli/claude.ts +61 -9
  16. package/src/cli/codex-shim-autorestore.ts +2 -0
  17. package/src/cli/codex-shim-readiness.ts +8 -1
  18. package/src/cli/config-command.ts +4 -1
  19. package/src/cli/doctor.ts +10 -0
  20. package/src/cli/help.ts +15 -0
  21. package/src/cli/index.ts +27 -11
  22. package/src/cli/lab.ts +367 -0
  23. package/src/cli/provider.ts +9 -1
  24. package/src/clients/config-export.ts +100 -3
  25. package/src/codex/app-server-processes.ts +11 -8
  26. package/src/codex/auth-api.ts +92 -28
  27. package/src/codex/auth-collision.ts +5 -3
  28. package/src/codex/catalog/metadata.ts +7 -3
  29. package/src/codex/catalog/provider-fetch.ts +191 -47
  30. package/src/codex/catalog.ts +2 -2
  31. package/src/codex/history-job.ts +83 -18
  32. package/src/codex/history-migration-guardian.ts +9 -16
  33. package/src/codex/history-provider.ts +178 -1
  34. package/src/codex/history-transition.ts +5 -5
  35. package/src/codex/history-worker.ts +22 -2
  36. package/src/codex/native-profile-store.ts +1 -1
  37. package/src/codex/plan.ts +15 -0
  38. package/src/codex/quota.ts +6 -6
  39. package/src/codex/routing.ts +3 -3
  40. package/src/codex/subagent-model-fallback.ts +246 -22
  41. package/src/codex/user-identity.ts +63 -12
  42. package/src/config.ts +265 -32
  43. package/src/images/loop.ts +3 -1
  44. package/src/images/plan.ts +23 -13
  45. package/src/integrations/omp-yaml-source.ts +225 -0
  46. package/src/integrations/ownership.ts +5 -5
  47. package/src/integrations/state.ts +45 -6
  48. package/src/integrations/writer.ts +38 -3
  49. package/src/lab/artifacts/sanitize.ts +586 -0
  50. package/src/lab/artifacts/secure-fs.ts +475 -0
  51. package/src/lab/artifacts/store.ts +310 -0
  52. package/src/lab/conformance/assertion.ts +325 -0
  53. package/src/lab/conformance/digest.ts +22 -0
  54. package/src/lab/conformance/executor.ts +741 -0
  55. package/src/lab/conformance/fixture-provider.ts +27 -0
  56. package/src/lab/conformance/fixtures/live-v1-cases.json +175 -0
  57. package/src/lab/conformance/fixtures/protocol-v1-cases.json +461 -0
  58. package/src/lab/conformance/harness-budget.ts +47 -0
  59. package/src/lab/conformance/index.ts +5 -0
  60. package/src/lab/conformance/jcs.ts +24 -0
  61. package/src/lab/conformance/json-pointer.ts +39 -0
  62. package/src/lab/conformance/manifest.ts +180 -0
  63. package/src/lab/conformance/mcp-stub.ts +179 -0
  64. package/src/lab/conformance/negative-controls.ts +160 -0
  65. package/src/lab/conformance/observation.ts +355 -0
  66. package/src/lab/conformance/runner.ts +57 -0
  67. package/src/lab/conformance/sse-normalize.ts +59 -0
  68. package/src/lab/conformance/suite-manifest.ts +78 -0
  69. package/src/lab/conformance/types.ts +191 -0
  70. package/src/lab/constants.ts +126 -0
  71. package/src/lab/digest.ts +64 -0
  72. package/src/lab/events/errors.ts +9 -0
  73. package/src/lab/events/limits.ts +117 -0
  74. package/src/lab/events/types.ts +228 -0
  75. package/src/lab/events/validate.ts +780 -0
  76. package/src/lab/index.ts +36 -0
  77. package/src/lab/ledger/artifact-refs.ts +127 -0
  78. package/src/lab/ledger/invalidation.ts +136 -0
  79. package/src/lab/ledger/purge.ts +241 -0
  80. package/src/lab/ledger/store.ts +263 -0
  81. package/src/lab/live/credential-lease.ts +53 -0
  82. package/src/lab/live/destination.ts +155 -0
  83. package/src/lab/live/executor.ts +311 -0
  84. package/src/lab/live/inert-tools.ts +56 -0
  85. package/src/lab/live/manifest.ts +85 -0
  86. package/src/lab/live/mcp-loopback.ts +57 -0
  87. package/src/lab/live/runner.ts +19 -0
  88. package/src/lab/live/sandbox.ts +61 -0
  89. package/src/lab/live/suite-manifest.ts +41 -0
  90. package/src/lab/live/transport.ts +116 -0
  91. package/src/lab/live/types.ts +197 -0
  92. package/src/lab/observe/from-conformance.ts +344 -0
  93. package/src/lab/observe/from-live.ts +103 -0
  94. package/src/lab/paths.ts +65 -0
  95. package/src/lab/projection/rebuild.ts +477 -0
  96. package/src/lab/projection/schema.ts +122 -0
  97. package/src/lab/projection/verdicts.ts +438 -0
  98. package/src/lab/projection/verification.ts +332 -0
  99. package/src/lab/query/catalog.ts +72 -0
  100. package/src/lab/query/connection.ts +107 -0
  101. package/src/lab/query/constants.ts +4 -0
  102. package/src/lab/query/cursor.ts +132 -0
  103. package/src/lab/query/dto-map.ts +277 -0
  104. package/src/lab/query/errors.ts +22 -0
  105. package/src/lab/query/index.ts +34 -0
  106. package/src/lab/query/queries.ts +444 -0
  107. package/src/lab/query/types.ts +266 -0
  108. package/src/lab/subject/behavior-fingerprint.ts +77 -0
  109. package/src/lab/subject/installation-salt.ts +81 -0
  110. package/src/lab/subject/route-subject.ts +73 -0
  111. package/src/lib/bounded-body.ts +104 -0
  112. package/src/lib/lab-live-execution-authority.ts +13 -0
  113. package/src/lib/lab-live-host.ts +30 -0
  114. package/src/lib/lab-live-pinned-sender.ts +45 -0
  115. package/src/lib/pinned-http.ts +36 -7
  116. package/src/oauth/index.ts +20 -1
  117. package/src/oauth/local-token-detect.ts +11 -2
  118. package/src/oauth/login-cli.ts +38 -4
  119. package/src/providers/alibaba-region-migration.ts +1 -1
  120. package/src/providers/codex-capacity.ts +7 -4
  121. package/src/providers/command-code-efforts.ts +5 -2
  122. package/src/providers/derive.ts +105 -0
  123. package/src/providers/label.ts +1 -1
  124. package/src/providers/openai-tiers.ts +59 -3
  125. package/src/providers/opencode-zen-rate-limit.ts +102 -0
  126. package/src/providers/quota.ts +67 -21
  127. package/src/providers/registry.ts +118 -5
  128. package/src/router.ts +15 -1
  129. package/src/routing/analytics.ts +8 -7
  130. package/src/routing/evaluator.ts +51 -5
  131. package/src/routing/profile.ts +10 -1
  132. package/src/routing/trace.ts +42 -6
  133. package/src/server/auth-cors.ts +15 -0
  134. package/src/server/background-lifecycle.ts +169 -0
  135. package/src/server/chat-completions.ts +18 -3
  136. package/src/server/claude-messages.ts +1 -0
  137. package/src/server/images.ts +78 -11
  138. package/src/server/index.ts +72 -18
  139. package/src/server/lifecycle.ts +6 -0
  140. package/src/server/live.ts +5 -1
  141. package/src/server/management/agent-settings-routes.ts +41 -24
  142. package/src/server/management/body.ts +6 -0
  143. package/src/server/management/config-routes.ts +51 -8
  144. package/src/server/management/lab-routes.ts +388 -0
  145. package/src/server/management/logs-usage-routes.ts +19 -1
  146. package/src/server/management/model-rows.ts +25 -11
  147. package/src/server/management/native-integration-routes.ts +3 -3
  148. package/src/server/management/provider-routes.ts +5 -0
  149. package/src/server/management/shared.ts +8 -1
  150. package/src/server/management/usage-summary-cache.ts +2 -0
  151. package/src/server/management/vision-sidecar-options.ts +125 -0
  152. package/src/server/management-api.ts +2 -0
  153. package/src/server/request-decompress.ts +106 -5
  154. package/src/server/responses/collaboration.ts +4 -1
  155. package/src/server/responses/core.ts +117 -31
  156. package/src/server/responses-json-events.ts +50 -12
  157. package/src/server/search.ts +23 -7
  158. package/src/server/ws-bridge.ts +3 -1
  159. package/src/service.ts +40 -20
  160. package/src/types.ts +74 -0
  161. package/src/update/job.ts +10 -2
  162. package/src/usage/cost.ts +0 -0
  163. package/src/usage/expected-prices.ts +9 -0
  164. package/src/usage/log.ts +9 -9
  165. package/src/usage/user-cost-overlay-reconciler.ts +313 -0
  166. package/src/usage/user-cost-overlays.ts +314 -0
  167. package/src/vision/describe.ts +2 -2
  168. package/src/vision/eligibility.ts +229 -0
  169. package/src/vision/index.ts +20 -2
  170. package/src/web-search/executor.ts +2 -2
  171. package/src/web-search/index.ts +4 -2
  172. package/src/web-search/loop.ts +3 -1
  173. package/src/web-search/parse.ts +72 -3
  174. package/gui/dist/assets/index-BA1dgo4q.css +0 -1
  175. package/gui/dist/assets/index-DDZpgzKk.js +0 -70
@@ -0,0 +1,228 @@
1
+ import type {
2
+ ArtifactClass,
3
+ ClaimPolarity,
4
+ ClaimSourceKind,
5
+ EvidenceLayer,
6
+ ExecutionMode,
7
+ InvalidationReason,
8
+ LabEventKind,
9
+ ObservationOutcome,
10
+ PurgeAction,
11
+ } from "../constants";
12
+
13
+ export interface LabProducer {
14
+ name: string;
15
+ version: string;
16
+ }
17
+
18
+ export interface ProtocolSubjectV1 {
19
+ subjectSchemaVersion: 1;
20
+ subjectKind: "protocol";
21
+ opencodexCompatibilityVersion: string;
22
+ effectiveAdapter: string;
23
+ inboundProtocol: string;
24
+ upstreamProtocol: string;
25
+ surface: string;
26
+ behaviorFingerprint: string;
27
+ }
28
+
29
+ export interface RouteDependencyV1 {
30
+ role: string;
31
+ providerId: string;
32
+ providerInstanceFingerprint: string;
33
+ clientModelId: string;
34
+ upstreamModelId: string;
35
+ effectiveAdapter: string;
36
+ upstreamProtocol: string;
37
+ endpointFingerprint: string;
38
+ behaviorFingerprint: string;
39
+ }
40
+
41
+ export interface RouteSubjectV1 {
42
+ subjectSchemaVersion: 1;
43
+ subjectKind: "route";
44
+ providerId: string;
45
+ providerInstanceFingerprint: string;
46
+ clientModelId: string;
47
+ upstreamModelId: string;
48
+ effectiveAdapter: string;
49
+ inboundProtocol: string;
50
+ upstreamProtocol: string;
51
+ surface: string;
52
+ opencodexCompatibilityVersion: string;
53
+ behaviorFingerprint: string;
54
+ endpointFingerprint: string;
55
+ dependencies: RouteDependencyV1[];
56
+ }
57
+
58
+ export interface TaskSubjectV1 {
59
+ subjectSchemaVersion: 1;
60
+ subjectKind: "task";
61
+ routeSubject: RouteSubjectV1;
62
+ taskClassId: string;
63
+ taskClassVersion: string;
64
+ taskFixtureDigest: string;
65
+ verifierManifestDigest: string;
66
+ fabricCompatibilityVersion: string;
67
+ sandboxProfileDigest: string;
68
+ }
69
+
70
+ export type EvidenceSubjectV1 = ProtocolSubjectV1 | RouteSubjectV1 | TaskSubjectV1;
71
+
72
+ export interface ArtifactRefV1 {
73
+ digest: string;
74
+ mediaType: string;
75
+ byteCount: number;
76
+ redactionPolicy: string;
77
+ /** Digest-derived relative name only (e.g. `<sha256>.bin`). */
78
+ relativePath: string;
79
+ artifactClass: ArtifactClass;
80
+ }
81
+
82
+ export interface AssertionRecordV1 {
83
+ id: string;
84
+ operator: string;
85
+ required: boolean;
86
+ passed: boolean;
87
+ expectedSummary: string;
88
+ observedSummary: string;
89
+ reason?: string;
90
+ }
91
+
92
+ export interface FailureRecordV1 {
93
+ class: string;
94
+ code: string;
95
+ retryable: boolean;
96
+ attribution: "opencodex" | "route" | "environment" | "harness";
97
+ }
98
+
99
+ export interface LabEventBase {
100
+ schemaVersion: number;
101
+ eventId: string;
102
+ eventKind: LabEventKind;
103
+ recordedAt: number;
104
+ producer: string;
105
+ producerVersion: string;
106
+ }
107
+
108
+ export interface ObservationEvent extends LabEventBase {
109
+ eventKind: "observation";
110
+ evidenceLayer: EvidenceLayer;
111
+ scenarioId: string;
112
+ scenarioVersion: string;
113
+ scenarioManifestDigest: string;
114
+ suiteId: string;
115
+ suiteVersion: string;
116
+ suiteManifestDigest: string;
117
+ fixtureDigests: string[];
118
+ subject: EvidenceSubjectV1;
119
+ subjectId: string;
120
+ startedAt: number;
121
+ completedAt: number;
122
+ executionMode: ExecutionMode;
123
+ attempt: number;
124
+ limits: Record<string, number | null>;
125
+ outcome: ObservationOutcome;
126
+ assertions: AssertionRecordV1[];
127
+ failure?: FailureRecordV1;
128
+ expectedFailure?: Record<string, unknown>;
129
+ environment: Record<string, unknown>;
130
+ artifactRefs: ArtifactRefV1[];
131
+ sourceRefs?: string[];
132
+ }
133
+
134
+ export interface ClaimSnapshotEvent extends LabEventBase {
135
+ eventKind: "claim_snapshot";
136
+ evidenceLayer: "live_route_compatibility";
137
+ subject: RouteSubjectV1;
138
+ subjectId: string;
139
+ capability: string;
140
+ polarity: ClaimPolarity;
141
+ sourceManifestDigest: string;
142
+ sourceEventIds: string[];
143
+ supersedes: string[];
144
+ effectiveAt: number;
145
+ }
146
+
147
+ export interface InvalidationEvent extends LabEventBase {
148
+ eventKind: "invalidation";
149
+ targetEventIds: string[];
150
+ reason: InvalidationReason;
151
+ }
152
+
153
+ export interface PurgeTombstoneEvent extends LabEventBase {
154
+ eventKind: "purge_tombstone";
155
+ targetEventIds: string[];
156
+ targetArtifactDigests: string[];
157
+ reason: "sensitive_evidence";
158
+ purgeActions: PurgeAction[];
159
+ }
160
+
161
+ export type LabEvent =
162
+ | ObservationEvent
163
+ | ClaimSnapshotEvent
164
+ | InvalidationEvent
165
+ | PurgeTombstoneEvent;
166
+
167
+ export type ClaimCapabilityFactsV1 = {
168
+ contextWindow?: number;
169
+ inputModalities?: string[];
170
+ reasoningEfforts?: string[];
171
+ catalogCapabilityNames?: string[];
172
+ serviceTier?: string[];
173
+ toolCapable?: boolean;
174
+ parallelToolCalls?: boolean;
175
+ endpointLocality?: "local" | "private" | "unknown";
176
+ canonicalOpenAiForward?: boolean;
177
+ };
178
+
179
+ export interface ClaimSourceV1 {
180
+ kind: ClaimSourceKind;
181
+ revision: string | null;
182
+ facts: ClaimCapabilityFactsV1;
183
+ }
184
+
185
+ export interface RouteCapabilityEvidenceV1 {
186
+ contextWindow?: number;
187
+ tools?: boolean | "unknown";
188
+ image?: boolean | "unknown";
189
+ structuredOutput?: boolean | "unknown";
190
+ reasoningEfforts?: string[];
191
+ serviceTier?: string | "unknown";
192
+ localOnly?: boolean | "unknown";
193
+ remoteAllowed?: boolean | "unknown";
194
+ encryptedCodexTasks?: boolean | "unknown";
195
+ }
196
+
197
+ export interface ClaimSourceManifestV1 {
198
+ schemaVersion: 1;
199
+ subjectId: string;
200
+ providerId: string;
201
+ clientModelId: string;
202
+ capability: string;
203
+ sources: ClaimSourceV1[];
204
+ resolvedEvidence: RouteCapabilityEvidenceV1;
205
+ }
206
+
207
+ export interface LedgerCorruption {
208
+ kind:
209
+ | "malformed_line"
210
+ | "partial_line"
211
+ | "duplicate_event"
212
+ | "invalid_event"
213
+ | "invalid_reference"
214
+ | "missing_artifact"
215
+ | "artifact_mismatch"
216
+ | "claim_corruption"
217
+ | "empty_ledger";
218
+ lineNumber?: number;
219
+ eventId?: string;
220
+ detail: string;
221
+ }
222
+
223
+ export interface ReplayResult {
224
+ events: LabEvent[];
225
+ corruptions: LedgerCorruption[];
226
+ validLineCount: number;
227
+ totalLineCount: number;
228
+ }