@claudexor/schema 1.0.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/LICENSE +21 -0
  2. package/README.md +16 -0
  3. package/dist/agent-capabilities.d.ts +366 -0
  4. package/dist/agent-capabilities.d.ts.map +1 -0
  5. package/dist/agent-capabilities.js +125 -0
  6. package/dist/agent-capabilities.js.map +1 -0
  7. package/dist/apply-eligibility.d.ts +76 -0
  8. package/dist/apply-eligibility.d.ts.map +1 -0
  9. package/dist/apply-eligibility.js +37 -0
  10. package/dist/apply-eligibility.js.map +1 -0
  11. package/dist/attachment.d.ts +69 -0
  12. package/dist/attachment.d.ts.map +1 -0
  13. package/dist/attachment.js +54 -0
  14. package/dist/attachment.js.map +1 -0
  15. package/dist/budget.d.ts +75 -0
  16. package/dist/budget.d.ts.map +1 -0
  17. package/dist/budget.js +54 -0
  18. package/dist/budget.js.map +1 -0
  19. package/dist/config.d.ts +743 -0
  20. package/dist/config.d.ts.map +1 -0
  21. package/dist/config.js +194 -0
  22. package/dist/config.js.map +1 -0
  23. package/dist/context.d.ts +222 -0
  24. package/dist/context.d.ts.map +1 -0
  25. package/dist/context.js +70 -0
  26. package/dist/context.js.map +1 -0
  27. package/dist/control-run-detail.d.ts +1686 -0
  28. package/dist/control-run-detail.d.ts.map +1 -0
  29. package/dist/control-run-detail.js +107 -0
  30. package/dist/control-run-detail.js.map +1 -0
  31. package/dist/control-trust.d.ts +79 -0
  32. package/dist/control-trust.d.ts.map +1 -0
  33. package/dist/control-trust.js +39 -0
  34. package/dist/control-trust.js.map +1 -0
  35. package/dist/control.d.ts +4226 -0
  36. package/dist/control.d.ts.map +1 -0
  37. package/dist/control.js +1022 -0
  38. package/dist/control.js.map +1 -0
  39. package/dist/decision.d.ts +208 -0
  40. package/dist/decision.d.ts.map +1 -0
  41. package/dist/decision.js +98 -0
  42. package/dist/decision.js.map +1 -0
  43. package/dist/events.d.ts +70 -0
  44. package/dist/events.d.ts.map +1 -0
  45. package/dist/events.js +105 -0
  46. package/dist/events.js.map +1 -0
  47. package/dist/gate.d.ts +37 -0
  48. package/dist/gate.d.ts.map +1 -0
  49. package/dist/gate.js +20 -0
  50. package/dist/gate.js.map +1 -0
  51. package/dist/harness.d.ts +1418 -0
  52. package/dist/harness.d.ts.map +1 -0
  53. package/dist/harness.js +552 -0
  54. package/dist/harness.js.map +1 -0
  55. package/dist/index.d.ts +32 -0
  56. package/dist/index.d.ts.map +1 -0
  57. package/dist/index.js +32 -0
  58. package/dist/index.js.map +1 -0
  59. package/dist/orchestrate.d.ts +428 -0
  60. package/dist/orchestrate.d.ts.map +1 -0
  61. package/dist/orchestrate.js +246 -0
  62. package/dist/orchestrate.js.map +1 -0
  63. package/dist/primitives.d.ts +71 -0
  64. package/dist/primitives.d.ts.map +1 -0
  65. package/dist/primitives.js +114 -0
  66. package/dist/primitives.js.map +1 -0
  67. package/dist/review.d.ts +220 -0
  68. package/dist/review.d.ts.map +1 -0
  69. package/dist/review.js +91 -0
  70. package/dist/review.js.map +1 -0
  71. package/dist/route.d.ts +67 -0
  72. package/dist/route.d.ts.map +1 -0
  73. package/dist/route.js +33 -0
  74. package/dist/route.js.map +1 -0
  75. package/dist/spec.d.ts +561 -0
  76. package/dist/spec.d.ts.map +1 -0
  77. package/dist/spec.js +133 -0
  78. package/dist/spec.js.map +1 -0
  79. package/dist/surface-run-controls.d.ts +14 -0
  80. package/dist/surface-run-controls.d.ts.map +1 -0
  81. package/dist/surface-run-controls.js +142 -0
  82. package/dist/surface-run-controls.js.map +1 -0
  83. package/dist/task.d.ts +565 -0
  84. package/dist/task.d.ts.map +1 -0
  85. package/dist/task.js +186 -0
  86. package/dist/task.js.map +1 -0
  87. package/dist/telemetry.d.ts +660 -0
  88. package/dist/telemetry.d.ts.map +1 -0
  89. package/dist/telemetry.js +140 -0
  90. package/dist/telemetry.js.map +1 -0
  91. package/dist/thread.d.ts +348 -0
  92. package/dist/thread.d.ts.map +1 -0
  93. package/dist/thread.js +194 -0
  94. package/dist/thread.js.map +1 -0
  95. package/dist/workproduct.d.ts +31 -0
  96. package/dist/workproduct.d.ts.map +1 -0
  97. package/dist/workproduct.js +25 -0
  98. package/dist/workproduct.js.map +1 -0
  99. package/dist/workspace.d.ts +53 -0
  100. package/dist/workspace.d.ts.map +1 -0
  101. package/dist/workspace.js +30 -0
  102. package/dist/workspace.js.map +1 -0
  103. package/generated/AgentCapabilityCatalog.schema.json +389 -0
  104. package/generated/ApplyEligibility.schema.json +44 -0
  105. package/generated/BudgetLease.schema.json +95 -0
  106. package/generated/BudgetObservation.schema.json +76 -0
  107. package/generated/ConformanceReport.schema.json +107 -0
  108. package/generated/ContextPack.schema.json +186 -0
  109. package/generated/ControlApplyCheckRequest.schema.json +54 -0
  110. package/generated/ControlApplyRequest.schema.json +74 -0
  111. package/generated/ControlHarnessListResponse.schema.json +498 -0
  112. package/generated/ControlHarnessModelsResponse.schema.json +78 -0
  113. package/generated/ControlHarnessSettingsPatch.schema.json +130 -0
  114. package/generated/ControlInteractionAnswerRequest.schema.json +48 -0
  115. package/generated/ControlInteractionAnswerResponse.schema.json +35 -0
  116. package/generated/ControlPendingInteraction.schema.json +129 -0
  117. package/generated/ControlQueuedRunInfo.schema.json +44 -0
  118. package/generated/ControlRunControlRequest.schema.json +61 -0
  119. package/generated/ControlRunControlResponse.schema.json +40 -0
  120. package/generated/ControlRunDecisionRequest.schema.json +98 -0
  121. package/generated/ControlRunDecisionResponse.schema.json +40 -0
  122. package/generated/ControlRunDetail.schema.json +1925 -0
  123. package/generated/ControlRunStartInfo.schema.json +33 -0
  124. package/generated/ControlRunStartRequest.schema.json +429 -0
  125. package/generated/ControlRunSummary.schema.json +666 -0
  126. package/generated/ControlSecretListResponse.schema.json +57 -0
  127. package/generated/ControlSettingsSnapshot.schema.json +281 -0
  128. package/generated/ControlSettingsUpdateRequest.schema.json +212 -0
  129. package/generated/ControlSetupJob.schema.json +148 -0
  130. package/generated/ControlSetupJobConfirmRequest.schema.json +18 -0
  131. package/generated/ControlSetupJobCreateRequest.schema.json +38 -0
  132. package/generated/ControlSetupJobEvent.schema.json +58 -0
  133. package/generated/ControlSetupJobListResponse.schema.json +162 -0
  134. package/generated/ControlSpecFreezeRequest.schema.json +83 -0
  135. package/generated/ControlSpecQuestionsRequest.schema.json +80 -0
  136. package/generated/ControlThread.schema.json +129 -0
  137. package/generated/ControlThreadApplyRequest.schema.json +32 -0
  138. package/generated/ControlThreadApplyResponse.schema.json +47 -0
  139. package/generated/ControlThreadCreateRequest.schema.json +107 -0
  140. package/generated/ControlThreadDetail.schema.json +515 -0
  141. package/generated/ControlThreadListResponse.schema.json +141 -0
  142. package/generated/ControlThreadUpdateRequest.schema.json +46 -0
  143. package/generated/ControlTrustListResponse.schema.json +59 -0
  144. package/generated/ControlTrustState.schema.json +45 -0
  145. package/generated/ControlTrustUpdateRequest.schema.json +26 -0
  146. package/generated/DecisionRecord.schema.json +232 -0
  147. package/generated/GateResult.schema.json +81 -0
  148. package/generated/GlobalConfig.schema.json +313 -0
  149. package/generated/HarnessEvent.schema.json +360 -0
  150. package/generated/HarnessManifest.schema.json +350 -0
  151. package/generated/HarnessModel.schema.json +41 -0
  152. package/generated/HarnessStatusDto.schema.json +486 -0
  153. package/generated/McpRunToolResult.schema.json +91 -0
  154. package/generated/OrchestrateContract.schema.json +93 -0
  155. package/generated/OrchestratePlan.schema.json +244 -0
  156. package/generated/OrchestratePlanProgress.schema.json +103 -0
  157. package/generated/ProjectConfig.schema.json +95 -0
  158. package/generated/ReviewFinding.schema.json +226 -0
  159. package/generated/RouteFallbackPayload.schema.json +79 -0
  160. package/generated/RouteProof.schema.json +111 -0
  161. package/generated/RunControl.schema.json +51 -0
  162. package/generated/RunEvent.schema.json +103 -0
  163. package/generated/RunFailure.schema.json +98 -0
  164. package/generated/RunTelemetry.schema.json +433 -0
  165. package/generated/SecretMetadata.schema.json +34 -0
  166. package/generated/Session.schema.json +80 -0
  167. package/generated/SessionReboundLineage.schema.json +73 -0
  168. package/generated/SpecPack.schema.json +372 -0
  169. package/generated/TaskContract.schema.json +501 -0
  170. package/generated/Thread.schema.json +176 -0
  171. package/generated/ThreadTurn.schema.json +172 -0
  172. package/generated/TrustConfig.schema.json +44 -0
  173. package/generated/WorkProduct.schema.json +60 -0
  174. package/generated/WorkspaceEnvelope.schema.json +94 -0
  175. package/package.json +43 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 joi-lab
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,16 @@
1
+ # @claudexor/schema
2
+
3
+ The data-shape single source of truth of
4
+ [Claudexor](https://github.com/razzant/claudexor): Zod schemas, TypeScript
5
+ types, and the generated draft-07 JSON Schemas under `generated/`.
6
+
7
+ Unlike the engine-internal packages, the SHAPES here are part of Claudexor's
8
+ stable 1.0 contract: the control API DTOs and the generated
9
+ `generated/<Name>.schema.json` files evolve add-only within a major version
10
+ (see "Stability at 1.0" in the repository README). The generated files carry
11
+ field-level `description`s and are referenced by name from
12
+ `docs/reference/endpoints.json`.
13
+
14
+ The package follows the monorepo's lockstep version. Use the `claudexor` CLI
15
+ as the supported entry point for driving runs; consume this package when you
16
+ need the typed shapes or the JSON Schemas themselves.
@@ -0,0 +1,366 @@
1
+ import { z } from "zod";
2
+ import { ModeKind } from "./primitives.js";
3
+ /**
4
+ * AgentCapabilityCatalog — the machine-readable answer to "what can this
5
+ * Claudexor install do RIGHT NOW", for external agents (MCP hosts, scripts,
6
+ * other CLIs). It is a DERIVED projection over existing truth sources —
7
+ * harness manifests + doctor status (gateway.statusAll), the model-truth
8
+ * service, the CLI command registry, and the schema's own closed vocabularies.
9
+ * Nothing in it is hand-maintained; a catalog field without a live producer
10
+ * must not exist (staged-field rule).
11
+ */
12
+ /**
13
+ * ControlRunStartRequest keys a DIRECT client may NOT send to POST /runs —
14
+ * they belong to the daemon-internal thread-turn pipeline (POST
15
+ * /threads/:id/turns pre-creates the turn and wires plan lineage). The
16
+ * daemon-server 400-guards these; the capability catalog must exclude them
17
+ * from the advertised run-control keys, or the catalog would lie to agents.
18
+ * ONE list, two consumers — keep them in lockstep here.
19
+ */
20
+ export declare const RUN_START_CLIENT_REJECTED_KEYS: readonly ["turnId", "planRunId"];
21
+ /**
22
+ * Mode -> tree mutability. ask/plan/audit are read-only BY CONSTRUCTION
23
+ * (Bible invariant); agent writes; orchestrate may write above suggest
24
+ * autonomy. The catalog derives its readOnlyModes/writeModes split from this
25
+ * single map instead of re-encoding the split at each consumer.
26
+ */
27
+ export declare const MODE_MUTABILITY: Record<z.infer<typeof ModeKind>, "read" | "write">;
28
+ export declare const CatalogModelSummary: z.ZodObject<{
29
+ source: z.ZodEnum<["api", "manifest", "none"]>;
30
+ count: z.ZodNumber;
31
+ verifiedAgainst: z.ZodNullable<z.ZodString>;
32
+ }, "strip", z.ZodTypeAny, {
33
+ source: "none" | "api" | "manifest";
34
+ count: number;
35
+ verifiedAgainst: string | null;
36
+ }, {
37
+ source: "none" | "api" | "manifest";
38
+ count: number;
39
+ verifiedAgainst: string | null;
40
+ }>;
41
+ export type CatalogModelSummary = z.infer<typeof CatalogModelSummary>;
42
+ export declare const CatalogHarness: z.ZodObject<{
43
+ id: z.ZodString;
44
+ enabled: z.ZodBoolean;
45
+ displayName: z.ZodString;
46
+ status: z.ZodEnum<["ok", "degraded", "unavailable"]>;
47
+ providerFamily: z.ZodEnum<["openai", "anthropic", "google", "cursor", "opencode", "xai", "local", "unknown"]>;
48
+ enabledIntents: z.ZodArray<z.ZodString, "many">;
49
+ disabledIntents: z.ZodArray<z.ZodString, "many">;
50
+ reasons: z.ZodArray<z.ZodString, "many">;
51
+ configuredModel: z.ZodNullable<z.ZodString>;
52
+ configuredModelValid: z.ZodNullable<z.ZodBoolean>;
53
+ models: z.ZodObject<{
54
+ source: z.ZodEnum<["api", "manifest", "none"]>;
55
+ count: z.ZodNumber;
56
+ verifiedAgainst: z.ZodNullable<z.ZodString>;
57
+ }, "strip", z.ZodTypeAny, {
58
+ source: "none" | "api" | "manifest";
59
+ count: number;
60
+ verifiedAgainst: string | null;
61
+ }, {
62
+ source: "none" | "api" | "manifest";
63
+ count: number;
64
+ verifiedAgainst: string | null;
65
+ }>;
66
+ webPolicy: z.ZodEnum<["native", "tools", "uncontrolled", "none"]>;
67
+ imageInput: z.ZodEnum<["file_path", "base64_stream", "base64_inline", "none"]>;
68
+ effortLevels: z.ZodArray<z.ZodEnum<["low", "medium", "high", "xhigh", "max"]>, "many">;
69
+ accessProfilesSupported: z.ZodArray<z.ZodEnum<["readonly", "workspace_write", "full", "external_sandbox_full", "inherit_native"]>, "many">;
70
+ readonlyMechanism: z.ZodEnum<["fs_sandbox", "permission_deny", "tool_allowlist", "none"]>;
71
+ }, "strip", z.ZodTypeAny, {
72
+ status: "ok" | "degraded" | "unavailable";
73
+ id: string;
74
+ reasons: string[];
75
+ enabled: boolean;
76
+ displayName: string;
77
+ providerFamily: "openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown";
78
+ enabledIntents: string[];
79
+ disabledIntents: string[];
80
+ configuredModel: string | null;
81
+ configuredModelValid: boolean | null;
82
+ models: {
83
+ source: "none" | "api" | "manifest";
84
+ count: number;
85
+ verifiedAgainst: string | null;
86
+ };
87
+ webPolicy: "none" | "native" | "tools" | "uncontrolled";
88
+ imageInput: "file_path" | "base64_stream" | "base64_inline" | "none";
89
+ effortLevels: ("low" | "medium" | "high" | "xhigh" | "max")[];
90
+ accessProfilesSupported: ("readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native")[];
91
+ readonlyMechanism: "none" | "fs_sandbox" | "permission_deny" | "tool_allowlist";
92
+ }, {
93
+ status: "ok" | "degraded" | "unavailable";
94
+ id: string;
95
+ reasons: string[];
96
+ enabled: boolean;
97
+ displayName: string;
98
+ providerFamily: "openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown";
99
+ enabledIntents: string[];
100
+ disabledIntents: string[];
101
+ configuredModel: string | null;
102
+ configuredModelValid: boolean | null;
103
+ models: {
104
+ source: "none" | "api" | "manifest";
105
+ count: number;
106
+ verifiedAgainst: string | null;
107
+ };
108
+ webPolicy: "none" | "native" | "tools" | "uncontrolled";
109
+ imageInput: "file_path" | "base64_stream" | "base64_inline" | "none";
110
+ effortLevels: ("low" | "medium" | "high" | "xhigh" | "max")[];
111
+ accessProfilesSupported: ("readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native")[];
112
+ readonlyMechanism: "none" | "fs_sandbox" | "permission_deny" | "tool_allowlist";
113
+ }>;
114
+ export type CatalogHarness = z.infer<typeof CatalogHarness>;
115
+ export declare const CatalogCliCommand: z.ZodObject<{
116
+ id: z.ZodString;
117
+ mutability: z.ZodEnum<["read", "write", "delivery", "ops"]>;
118
+ stability: z.ZodEnum<["stable", "experimental"]>;
119
+ recovery: z.ZodBoolean;
120
+ }, "strip", z.ZodTypeAny, {
121
+ id: string;
122
+ mutability: "read" | "write" | "delivery" | "ops";
123
+ stability: "stable" | "experimental";
124
+ recovery: boolean;
125
+ }, {
126
+ id: string;
127
+ mutability: "read" | "write" | "delivery" | "ops";
128
+ stability: "stable" | "experimental";
129
+ recovery: boolean;
130
+ }>;
131
+ export type CatalogCliCommand = z.infer<typeof CatalogCliCommand>;
132
+ export declare const CatalogMutabilityMatrix: z.ZodObject<{
133
+ readOnlyModes: z.ZodArray<z.ZodEnum<["ask", "plan", "audit", "agent", "orchestrate"]>, "many">;
134
+ writeModes: z.ZodArray<z.ZodEnum<["ask", "plan", "audit", "agent", "orchestrate"]>, "many">;
135
+ isolationKinds: z.ZodArray<z.ZodEnum<["envelope", "live"]>, "many">;
136
+ workspaceModes: z.ZodArray<z.ZodEnum<["in_place", "isolated"]>, "many">;
137
+ accessProfiles: z.ZodArray<z.ZodEnum<["readonly", "workspace_write", "full", "external_sandbox_full", "inherit_native"]>, "many">;
138
+ applyModes: z.ZodArray<z.ZodEnum<["apply", "commit", "branch", "pr"]>, "many">;
139
+ }, "strip", z.ZodTypeAny, {
140
+ readOnlyModes: ("ask" | "plan" | "audit" | "agent" | "orchestrate")[];
141
+ writeModes: ("ask" | "plan" | "audit" | "agent" | "orchestrate")[];
142
+ isolationKinds: ("live" | "envelope")[];
143
+ workspaceModes: ("in_place" | "isolated")[];
144
+ accessProfiles: ("readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native")[];
145
+ applyModes: ("apply" | "commit" | "branch" | "pr")[];
146
+ }, {
147
+ readOnlyModes: ("ask" | "plan" | "audit" | "agent" | "orchestrate")[];
148
+ writeModes: ("ask" | "plan" | "audit" | "agent" | "orchestrate")[];
149
+ isolationKinds: ("live" | "envelope")[];
150
+ workspaceModes: ("in_place" | "isolated")[];
151
+ accessProfiles: ("readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native")[];
152
+ applyModes: ("apply" | "commit" | "branch" | "pr")[];
153
+ }>;
154
+ export type CatalogMutabilityMatrix = z.infer<typeof CatalogMutabilityMatrix>;
155
+ export declare const AgentCapabilityCatalog: z.ZodObject<{
156
+ ok: z.ZodLiteral<true>;
157
+ version: z.ZodString;
158
+ generatedAt: z.ZodString;
159
+ harnesses: z.ZodArray<z.ZodObject<{
160
+ id: z.ZodString;
161
+ enabled: z.ZodBoolean;
162
+ displayName: z.ZodString;
163
+ status: z.ZodEnum<["ok", "degraded", "unavailable"]>;
164
+ providerFamily: z.ZodEnum<["openai", "anthropic", "google", "cursor", "opencode", "xai", "local", "unknown"]>;
165
+ enabledIntents: z.ZodArray<z.ZodString, "many">;
166
+ disabledIntents: z.ZodArray<z.ZodString, "many">;
167
+ reasons: z.ZodArray<z.ZodString, "many">;
168
+ configuredModel: z.ZodNullable<z.ZodString>;
169
+ configuredModelValid: z.ZodNullable<z.ZodBoolean>;
170
+ models: z.ZodObject<{
171
+ source: z.ZodEnum<["api", "manifest", "none"]>;
172
+ count: z.ZodNumber;
173
+ verifiedAgainst: z.ZodNullable<z.ZodString>;
174
+ }, "strip", z.ZodTypeAny, {
175
+ source: "none" | "api" | "manifest";
176
+ count: number;
177
+ verifiedAgainst: string | null;
178
+ }, {
179
+ source: "none" | "api" | "manifest";
180
+ count: number;
181
+ verifiedAgainst: string | null;
182
+ }>;
183
+ webPolicy: z.ZodEnum<["native", "tools", "uncontrolled", "none"]>;
184
+ imageInput: z.ZodEnum<["file_path", "base64_stream", "base64_inline", "none"]>;
185
+ effortLevels: z.ZodArray<z.ZodEnum<["low", "medium", "high", "xhigh", "max"]>, "many">;
186
+ accessProfilesSupported: z.ZodArray<z.ZodEnum<["readonly", "workspace_write", "full", "external_sandbox_full", "inherit_native"]>, "many">;
187
+ readonlyMechanism: z.ZodEnum<["fs_sandbox", "permission_deny", "tool_allowlist", "none"]>;
188
+ }, "strip", z.ZodTypeAny, {
189
+ status: "ok" | "degraded" | "unavailable";
190
+ id: string;
191
+ reasons: string[];
192
+ enabled: boolean;
193
+ displayName: string;
194
+ providerFamily: "openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown";
195
+ enabledIntents: string[];
196
+ disabledIntents: string[];
197
+ configuredModel: string | null;
198
+ configuredModelValid: boolean | null;
199
+ models: {
200
+ source: "none" | "api" | "manifest";
201
+ count: number;
202
+ verifiedAgainst: string | null;
203
+ };
204
+ webPolicy: "none" | "native" | "tools" | "uncontrolled";
205
+ imageInput: "file_path" | "base64_stream" | "base64_inline" | "none";
206
+ effortLevels: ("low" | "medium" | "high" | "xhigh" | "max")[];
207
+ accessProfilesSupported: ("readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native")[];
208
+ readonlyMechanism: "none" | "fs_sandbox" | "permission_deny" | "tool_allowlist";
209
+ }, {
210
+ status: "ok" | "degraded" | "unavailable";
211
+ id: string;
212
+ reasons: string[];
213
+ enabled: boolean;
214
+ displayName: string;
215
+ providerFamily: "openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown";
216
+ enabledIntents: string[];
217
+ disabledIntents: string[];
218
+ configuredModel: string | null;
219
+ configuredModelValid: boolean | null;
220
+ models: {
221
+ source: "none" | "api" | "manifest";
222
+ count: number;
223
+ verifiedAgainst: string | null;
224
+ };
225
+ webPolicy: "none" | "native" | "tools" | "uncontrolled";
226
+ imageInput: "file_path" | "base64_stream" | "base64_inline" | "none";
227
+ effortLevels: ("low" | "medium" | "high" | "xhigh" | "max")[];
228
+ accessProfilesSupported: ("readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native")[];
229
+ readonlyMechanism: "none" | "fs_sandbox" | "permission_deny" | "tool_allowlist";
230
+ }>, "many">;
231
+ availableHarnesses: z.ZodArray<z.ZodString, "many">;
232
+ modes: z.ZodArray<z.ZodEnum<["ask", "plan", "audit", "agent", "orchestrate"]>, "many">;
233
+ runControlKeys: z.ZodArray<z.ZodString, "many">;
234
+ mutability: z.ZodObject<{
235
+ readOnlyModes: z.ZodArray<z.ZodEnum<["ask", "plan", "audit", "agent", "orchestrate"]>, "many">;
236
+ writeModes: z.ZodArray<z.ZodEnum<["ask", "plan", "audit", "agent", "orchestrate"]>, "many">;
237
+ isolationKinds: z.ZodArray<z.ZodEnum<["envelope", "live"]>, "many">;
238
+ workspaceModes: z.ZodArray<z.ZodEnum<["in_place", "isolated"]>, "many">;
239
+ accessProfiles: z.ZodArray<z.ZodEnum<["readonly", "workspace_write", "full", "external_sandbox_full", "inherit_native"]>, "many">;
240
+ applyModes: z.ZodArray<z.ZodEnum<["apply", "commit", "branch", "pr"]>, "many">;
241
+ }, "strip", z.ZodTypeAny, {
242
+ readOnlyModes: ("ask" | "plan" | "audit" | "agent" | "orchestrate")[];
243
+ writeModes: ("ask" | "plan" | "audit" | "agent" | "orchestrate")[];
244
+ isolationKinds: ("live" | "envelope")[];
245
+ workspaceModes: ("in_place" | "isolated")[];
246
+ accessProfiles: ("readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native")[];
247
+ applyModes: ("apply" | "commit" | "branch" | "pr")[];
248
+ }, {
249
+ readOnlyModes: ("ask" | "plan" | "audit" | "agent" | "orchestrate")[];
250
+ writeModes: ("ask" | "plan" | "audit" | "agent" | "orchestrate")[];
251
+ isolationKinds: ("live" | "envelope")[];
252
+ workspaceModes: ("in_place" | "isolated")[];
253
+ accessProfiles: ("readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native")[];
254
+ applyModes: ("apply" | "commit" | "branch" | "pr")[];
255
+ }>;
256
+ cliCommands: z.ZodArray<z.ZodObject<{
257
+ id: z.ZodString;
258
+ mutability: z.ZodEnum<["read", "write", "delivery", "ops"]>;
259
+ stability: z.ZodEnum<["stable", "experimental"]>;
260
+ recovery: z.ZodBoolean;
261
+ }, "strip", z.ZodTypeAny, {
262
+ id: string;
263
+ mutability: "read" | "write" | "delivery" | "ops";
264
+ stability: "stable" | "experimental";
265
+ recovery: boolean;
266
+ }, {
267
+ id: string;
268
+ mutability: "read" | "write" | "delivery" | "ops";
269
+ stability: "stable" | "experimental";
270
+ recovery: boolean;
271
+ }>, "many">;
272
+ mcpTools: z.ZodArray<z.ZodString, "many">;
273
+ runApplyStates: z.ZodArray<z.ZodString, "many">;
274
+ }, "strip", z.ZodTypeAny, {
275
+ version: string;
276
+ ok: true;
277
+ mutability: {
278
+ readOnlyModes: ("ask" | "plan" | "audit" | "agent" | "orchestrate")[];
279
+ writeModes: ("ask" | "plan" | "audit" | "agent" | "orchestrate")[];
280
+ isolationKinds: ("live" | "envelope")[];
281
+ workspaceModes: ("in_place" | "isolated")[];
282
+ accessProfiles: ("readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native")[];
283
+ applyModes: ("apply" | "commit" | "branch" | "pr")[];
284
+ };
285
+ generatedAt: string;
286
+ harnesses: {
287
+ status: "ok" | "degraded" | "unavailable";
288
+ id: string;
289
+ reasons: string[];
290
+ enabled: boolean;
291
+ displayName: string;
292
+ providerFamily: "openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown";
293
+ enabledIntents: string[];
294
+ disabledIntents: string[];
295
+ configuredModel: string | null;
296
+ configuredModelValid: boolean | null;
297
+ models: {
298
+ source: "none" | "api" | "manifest";
299
+ count: number;
300
+ verifiedAgainst: string | null;
301
+ };
302
+ webPolicy: "none" | "native" | "tools" | "uncontrolled";
303
+ imageInput: "file_path" | "base64_stream" | "base64_inline" | "none";
304
+ effortLevels: ("low" | "medium" | "high" | "xhigh" | "max")[];
305
+ accessProfilesSupported: ("readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native")[];
306
+ readonlyMechanism: "none" | "fs_sandbox" | "permission_deny" | "tool_allowlist";
307
+ }[];
308
+ availableHarnesses: string[];
309
+ modes: ("ask" | "plan" | "audit" | "agent" | "orchestrate")[];
310
+ runControlKeys: string[];
311
+ cliCommands: {
312
+ id: string;
313
+ mutability: "read" | "write" | "delivery" | "ops";
314
+ stability: "stable" | "experimental";
315
+ recovery: boolean;
316
+ }[];
317
+ mcpTools: string[];
318
+ runApplyStates: string[];
319
+ }, {
320
+ version: string;
321
+ ok: true;
322
+ mutability: {
323
+ readOnlyModes: ("ask" | "plan" | "audit" | "agent" | "orchestrate")[];
324
+ writeModes: ("ask" | "plan" | "audit" | "agent" | "orchestrate")[];
325
+ isolationKinds: ("live" | "envelope")[];
326
+ workspaceModes: ("in_place" | "isolated")[];
327
+ accessProfiles: ("readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native")[];
328
+ applyModes: ("apply" | "commit" | "branch" | "pr")[];
329
+ };
330
+ generatedAt: string;
331
+ harnesses: {
332
+ status: "ok" | "degraded" | "unavailable";
333
+ id: string;
334
+ reasons: string[];
335
+ enabled: boolean;
336
+ displayName: string;
337
+ providerFamily: "openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown";
338
+ enabledIntents: string[];
339
+ disabledIntents: string[];
340
+ configuredModel: string | null;
341
+ configuredModelValid: boolean | null;
342
+ models: {
343
+ source: "none" | "api" | "manifest";
344
+ count: number;
345
+ verifiedAgainst: string | null;
346
+ };
347
+ webPolicy: "none" | "native" | "tools" | "uncontrolled";
348
+ imageInput: "file_path" | "base64_stream" | "base64_inline" | "none";
349
+ effortLevels: ("low" | "medium" | "high" | "xhigh" | "max")[];
350
+ accessProfilesSupported: ("readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native")[];
351
+ readonlyMechanism: "none" | "fs_sandbox" | "permission_deny" | "tool_allowlist";
352
+ }[];
353
+ availableHarnesses: string[];
354
+ modes: ("ask" | "plan" | "audit" | "agent" | "orchestrate")[];
355
+ runControlKeys: string[];
356
+ cliCommands: {
357
+ id: string;
358
+ mutability: "read" | "write" | "delivery" | "ops";
359
+ stability: "stable" | "experimental";
360
+ recovery: boolean;
361
+ }[];
362
+ mcpTools: string[];
363
+ runApplyStates: string[];
364
+ }>;
365
+ export type AgentCapabilityCatalog = z.infer<typeof AgentCapabilityCatalog>;
366
+ //# sourceMappingURL=agent-cap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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBqE,CAAC;AACzG,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -0,0 +1,125 @@
1
+ import { z } from "zod";
2
+ import { AccessProfile, ModeKind, ProviderFamily } from "./primitives.js";
3
+ import { AdapterStatus, EffortHint, ReadonlyMechanism } from "./harness.js";
4
+ import { WorkspaceMode } from "./thread.js";
5
+ /**
6
+ * AgentCapabilityCatalog — the machine-readable answer to "what can this
7
+ * Claudexor install do RIGHT NOW", for external agents (MCP hosts, scripts,
8
+ * other CLIs). It is a DERIVED projection over existing truth sources —
9
+ * harness manifests + doctor status (gateway.statusAll), the model-truth
10
+ * service, the CLI command registry, and the schema's own closed vocabularies.
11
+ * Nothing in it is hand-maintained; a catalog field without a live producer
12
+ * must not exist (staged-field rule).
13
+ */
14
+ /**
15
+ * ControlRunStartRequest keys a DIRECT client may NOT send to POST /runs —
16
+ * they belong to the daemon-internal thread-turn pipeline (POST
17
+ * /threads/:id/turns pre-creates the turn and wires plan lineage). The
18
+ * daemon-server 400-guards these; the capability catalog must exclude them
19
+ * from the advertised run-control keys, or the catalog would lie to agents.
20
+ * ONE list, two consumers — keep them in lockstep here.
21
+ */
22
+ export const RUN_START_CLIENT_REJECTED_KEYS = ["turnId", "planRunId"];
23
+ /**
24
+ * Mode -> tree mutability. ask/plan/audit are read-only BY CONSTRUCTION
25
+ * (Bible invariant); agent writes; orchestrate may write above suggest
26
+ * autonomy. The catalog derives its readOnlyModes/writeModes split from this
27
+ * single map instead of re-encoding the split at each consumer.
28
+ */
29
+ export const MODE_MUTABILITY = {
30
+ ask: "read",
31
+ plan: "read",
32
+ audit: "read",
33
+ agent: "write",
34
+ orchestrate: "write",
35
+ };
36
+ export const CatalogModelSummary = z
37
+ .object({
38
+ source: z.enum(["api", "manifest", "none"]).describe("Where the model list comes from: a live vendor API enumeration, the adapter manifest's curated hints, or nothing (model overrides are refused for source=none)."),
39
+ count: z.number().int().min(0).describe("Number of enumerable models (GET /harnesses/:id/models has the full list)."),
40
+ verifiedAgainst: z
41
+ .string()
42
+ .nullable()
43
+ .describe("Vendor CLI version the manifest hints were last verified against (null for api/none sources)."),
44
+ })
45
+ .describe("Summary of a harness's model truth source (full list via the models endpoint/verb).");
46
+ export const CatalogHarness = z
47
+ .object({
48
+ id: z.string().describe("Harness id (codex, claude, cursor, opencode, raw-api, openrouter, ...)."),
49
+ enabled: z.boolean().describe("False when settings disable this harness (harnesses.<id>.enabled=false) — routing excludes it regardless of doctor status."),
50
+ displayName: z.string().describe("Human display name from the manifest."),
51
+ status: AdapterStatus.describe("Doctor verdict: ok | degraded | unavailable (doctor-backed, cached ~90s)."),
52
+ providerFamily: ProviderFamily.describe("Vendor family the harness routes to."),
53
+ enabledIntents: z.array(z.string()).describe("Intents the gateway will route to this harness right now."),
54
+ disabledIntents: z.array(z.string()).describe("Intents the doctor disabled (with reasons in `reasons`)."),
55
+ reasons: z.array(z.string()).describe("Human-readable doctor/discovery reasons for degraded or unavailable status."),
56
+ configuredModel: z
57
+ .string()
58
+ .nullable()
59
+ .describe("The user's configured per-harness default model, if any (null = engine default routing)."),
60
+ configuredModelValid: z
61
+ .boolean()
62
+ .nullable()
63
+ .describe("Strict truth-source check of configuredModel (null when no model is configured)."),
64
+ models: CatalogModelSummary,
65
+ webPolicy: z
66
+ .enum(["native", "tools", "uncontrolled", "none"])
67
+ .describe("How external web/search is controlled for this harness."),
68
+ imageInput: z
69
+ .enum(["file_path", "base64_stream", "base64_inline", "none"])
70
+ .describe("Attachment/vision delivery mechanism the adapter supports."),
71
+ effortLevels: z.array(EffortHint).describe("Reasoning-effort ladder the adapter declares (normalized by the engine)."),
72
+ accessProfilesSupported: z.array(AccessProfile).describe("Access profiles the adapter can enforce."),
73
+ readonlyMechanism: ReadonlyMechanism.describe("HOW read-only is enforced (fs_sandbox | permission_deny | tool_allowlist | none) — none means read-only intent is advisory for this harness."),
74
+ })
75
+ .describe("Per-harness live capability row (manifest + doctor + model truth).");
76
+ export const CatalogCliCommand = z
77
+ .object({
78
+ id: z.string().describe("CLI verb."),
79
+ mutability: z
80
+ .enum(["read", "write", "delivery", "ops"])
81
+ .describe("read = never mutates the tree; write = produces tree changes (envelope or live); delivery = moves an existing WorkProduct into the tree/VCS; ops = local config/daemon plumbing."),
82
+ stability: z.enum(["stable", "experimental"]).describe("Contract stability of the verb."),
83
+ recovery: z.boolean().describe("True for post-run recovery verbs (inspect/follow/apply/decision)."),
84
+ })
85
+ .describe("CLI verb projection from the command registry (same data `claudexor help --json` serves).");
86
+ export const CatalogMutabilityMatrix = z
87
+ .object({
88
+ readOnlyModes: z
89
+ .array(ModeKind)
90
+ .describe("Canonical modes that never mutate the project tree (ask/plan/audit; orchestrate in suggest autonomy is also read-only)."),
91
+ writeModes: z
92
+ .array(ModeKind)
93
+ .describe("Canonical modes that may mutate a tree (agent always; orchestrate only above suggest autonomy)."),
94
+ isolationKinds: z
95
+ .array(z.enum(["envelope", "live"]))
96
+ .describe("Run isolation: envelope = isolated worktree under .claudexor/workspaces (default), live = the project tree itself."),
97
+ workspaceModes: z.array(WorkspaceMode).describe("Thread workspace modes (in_place | isolated)."),
98
+ accessProfiles: z
99
+ .array(AccessProfile)
100
+ .describe("Access vocabulary; `full` additionally requires the per-repo trust allow (claudexor trust --allow-full-access)."),
101
+ applyModes: z
102
+ .array(z.enum(["apply", "commit", "branch", "pr"]))
103
+ .describe("Delivery modes for applying a run's WorkProduct to the project."),
104
+ })
105
+ .describe("The mutability matrix: every way a Claudexor run can (or cannot) touch a tree, from the schema's closed vocabularies.");
106
+ export const AgentCapabilityCatalog = z
107
+ .object({
108
+ ok: z.literal(true).describe("Envelope marker (matches the CLI JSON convention)."),
109
+ version: z.string().describe("Claudexor version serving this catalog (compare with CLAUDEXOR_PLUGIN_VERSION to detect plugin skew)."),
110
+ generatedAt: z.string().describe("ISO timestamp when the catalog was composed."),
111
+ harnesses: z.array(CatalogHarness).describe("Live per-harness capabilities (doctor-backed)."),
112
+ availableHarnesses: z.array(z.string()).describe("Convenience: ids with doctor status ok."),
113
+ modes: z.array(ModeKind).describe("Canonical run modes (strategies like --n/--until-clean/--swarm are flags, not modes)."),
114
+ runControlKeys: z
115
+ .array(z.string())
116
+ .describe("Accepted POST /runs request keys (derived from the ControlRunStartRequest schema; the CLI/MCP/ACP surfaces project subsets of these)."),
117
+ mutability: CatalogMutabilityMatrix,
118
+ cliCommands: z.array(CatalogCliCommand).describe("CLI verbs with mutability/stability (full flag detail via `claudexor help --json`)."),
119
+ mcpTools: z.array(z.string()).describe("MCP tool names `claudexor mcp serve` exposes."),
120
+ runApplyStates: z
121
+ .array(z.string())
122
+ .describe("RunApplyState vocabulary an agent can encounter on run results (not_applied | applied | applied_review_blocked | reverted) — distinct from the ApplyEligibility verdict object on run details."),
123
+ })
124
+ .describe("Machine-readable capability catalog for external agents — derived, never hand-maintained.");
125
+ //# sourceMappingURL=agent-capabilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-capabilities.js","sourceRoot":"","sources":["../src/agent-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C;;;;;;;;GAQG;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAU,CAAC;AAE/E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAuD;IACjF,GAAG,EAAE,MAAM;IACX,IAAI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AAC,QAAQ,CAAC,gDAAgD,CAAC;IAC7F,kBAAkB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,yCAAyC,CAAC;IAC3F,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,uFAAuF,CAAC;IAC1H,cAAc,EAAE,CAAC;SACd,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACjB,QAAQ,CAAC,uIAAuI,CAAC;IACpJ,UAAU,EAAE,uBAAuB;IACnC,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,qFAAqF,CAAC;IACvI,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,+CAA+C,CAAC;IACvF,cAAc,EAAE,CAAC;SACd,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACjB,QAAQ,CAAC,gMAAgM,CAAC;CAC9M,CAAC;KACD,QAAQ,CAAC,2FAA2F,CAAC,CAAC"}
@@ -0,0 +1,76 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * ApplyEligibility — the derived "can this run's WorkProduct be applied RIGHT
4
+ * NOW, and if not, what unblocks it" verdict. ONE producer (the delivery
5
+ * gate's deriveApplyEligibility over validateApplyGate + the apply hint);
6
+ * projected on GET /runs/:id, MCP structured results, and CLI --json output
7
+ * so every surface answers identically instead of re-implying eligibility
8
+ * from raw state fields.
9
+ */
10
+ export declare const ApplyEligibility: z.ZodObject<{
11
+ eligible: z.ZodBoolean;
12
+ state: z.ZodNullable<z.ZodString>;
13
+ reason: z.ZodNullable<z.ZodString>;
14
+ requiredAction: z.ZodNullable<z.ZodString>;
15
+ }, "strip", z.ZodTypeAny, {
16
+ state: string | null;
17
+ reason: string | null;
18
+ eligible: boolean;
19
+ requiredAction: string | null;
20
+ }, {
21
+ state: string | null;
22
+ reason: string | null;
23
+ eligible: boolean;
24
+ requiredAction: string | null;
25
+ }>;
26
+ export type ApplyEligibility = z.infer<typeof ApplyEligibility>;
27
+ /**
28
+ * The structured result shape MCP run tools return (structuredContent).
29
+ * Text content mirrors it for hosts without structured-output support.
30
+ */
31
+ export declare const McpRunToolResult: z.ZodObject<{
32
+ summary: z.ZodString;
33
+ runId: z.ZodNullable<z.ZodString>;
34
+ runDir: z.ZodNullable<z.ZodString>;
35
+ status: z.ZodNullable<z.ZodString>;
36
+ applyEligibility: z.ZodNullable<z.ZodObject<{
37
+ eligible: z.ZodBoolean;
38
+ state: z.ZodNullable<z.ZodString>;
39
+ reason: z.ZodNullable<z.ZodString>;
40
+ requiredAction: z.ZodNullable<z.ZodString>;
41
+ }, "strip", z.ZodTypeAny, {
42
+ state: string | null;
43
+ reason: string | null;
44
+ eligible: boolean;
45
+ requiredAction: string | null;
46
+ }, {
47
+ state: string | null;
48
+ reason: string | null;
49
+ eligible: boolean;
50
+ requiredAction: string | null;
51
+ }>>;
52
+ }, "strip", z.ZodTypeAny, {
53
+ status: string | null;
54
+ summary: string;
55
+ runId: string | null;
56
+ runDir: string | null;
57
+ applyEligibility: {
58
+ state: string | null;
59
+ reason: string | null;
60
+ eligible: boolean;
61
+ requiredAction: string | null;
62
+ } | null;
63
+ }, {
64
+ status: string | null;
65
+ summary: string;
66
+ runId: string | null;
67
+ runDir: string | null;
68
+ applyEligibility: {
69
+ state: string | null;
70
+ reason: string | null;
71
+ eligible: boolean;
72
+ requiredAction: string | null;
73
+ } | null;
74
+ }>;
75
+ export type McpRunToolResult = z.infer<typeof McpRunToolResult>;
76
+ //# sourceMappingURL=apply-eligibility.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply-eligibility.d.ts","sourceRoot":"","sources":["../src/apply-eligibility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;EAa4E,CAAC;AAC1G,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQqC,CAAC;AACnE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}