@duct-sdk/sdk 0.5.13 → 0.7.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 (166) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/README.md +418 -264
  3. package/TOKEN_SPEC.md +243 -243
  4. package/dist/cli/action-confusion-format.d.ts +17 -0
  5. package/dist/cli/action-confusion-format.js +24 -0
  6. package/dist/cli/add.d.ts +7 -0
  7. package/dist/cli/add.js +152 -0
  8. package/dist/cli/agent-prompt.d.ts +3 -0
  9. package/dist/cli/agent-prompt.js +39 -0
  10. package/dist/cli/api-sources.d.ts +26 -0
  11. package/dist/cli/api-sources.js +222 -0
  12. package/dist/cli/cloud.d.ts +162 -0
  13. package/dist/cli/cloud.js +306 -0
  14. package/dist/cli/config-loader.d.ts +14 -0
  15. package/dist/cli/config-loader.js +56 -7
  16. package/dist/cli/device-login.d.ts +17 -0
  17. package/dist/cli/device-login.js +75 -0
  18. package/dist/cli/drift.js +6 -6
  19. package/dist/cli/generators/any-stack.d.ts +3 -0
  20. package/dist/cli/generators/any-stack.js +97 -0
  21. package/dist/cli/generators/config.js +3 -2
  22. package/dist/cli/generators/receiver.js +7 -7
  23. package/dist/cli/generators/shell.js +12 -12
  24. package/dist/cli/generators/token-route.js +245 -245
  25. package/dist/cli/generators/wiring-snippets.d.ts +0 -14
  26. package/dist/cli/generators/wiring-snippets.js +188 -305
  27. package/dist/cli/index.js +396 -611
  28. package/dist/cli/mcp-core.d.ts +42 -0
  29. package/dist/cli/mcp-core.js +161 -0
  30. package/dist/cli/mcp-setup.d.ts +4 -0
  31. package/dist/cli/mcp-setup.js +352 -0
  32. package/dist/cli/mcp.d.ts +2 -0
  33. package/dist/cli/mcp.js +457 -0
  34. package/dist/cli/migrate-intershell.js +5 -5
  35. package/dist/cli/policy-defaults.d.ts +37 -0
  36. package/dist/cli/policy-defaults.js +127 -0
  37. package/dist/cli/policy-replay-format.d.ts +9 -0
  38. package/dist/cli/policy-replay-format.js +46 -0
  39. package/dist/cli/processors/integration-audit.js +2 -2
  40. package/dist/cli/processors/openapi-parser.d.ts +5 -0
  41. package/dist/cli/processors/openapi-parser.js +8 -3
  42. package/dist/cli/project-loader.d.ts +58 -0
  43. package/dist/cli/project-loader.js +198 -0
  44. package/dist/cli/project-writer.d.ts +23 -0
  45. package/dist/cli/project-writer.js +171 -0
  46. package/dist/cli/push.d.ts +43 -0
  47. package/dist/cli/push.js +308 -0
  48. package/dist/cli/safety-checks.d.ts +9 -0
  49. package/dist/cli/safety-checks.js +29 -0
  50. package/dist/cli/setup.d.ts +20 -0
  51. package/dist/cli/setup.js +349 -0
  52. package/dist/cli/shell-name.d.ts +8 -0
  53. package/dist/cli/shell-name.js +29 -0
  54. package/dist/cli/shells.d.ts +22 -0
  55. package/dist/cli/shells.js +122 -0
  56. package/dist/cli/split.d.ts +7 -0
  57. package/dist/cli/split.js +71 -0
  58. package/dist/cli/sync.d.ts +25 -0
  59. package/dist/cli/sync.js +120 -0
  60. package/dist/cli/test-runner.d.ts +21 -0
  61. package/dist/cli/test-runner.js +281 -0
  62. package/dist/core/compile.d.ts +43 -0
  63. package/dist/core/compile.js +512 -0
  64. package/dist/core/config.d.ts +538 -19
  65. package/dist/core/config.js +22 -14
  66. package/dist/core/login-handoff.d.ts +1 -1
  67. package/dist/core/login-handoff.js +1 -1
  68. package/dist/core/project.d.ts +1864 -0
  69. package/dist/core/project.js +291 -0
  70. package/dist/core/readiness-checks.js +2 -2
  71. package/dist/core/types.d.ts +10 -1
  72. package/dist/index.d.ts +2 -0
  73. package/dist/index.js +1 -0
  74. package/dist/project.d.ts +4 -0
  75. package/dist/project.js +8 -0
  76. package/dist/server.d.ts +2 -0
  77. package/dist/server.js +1 -0
  78. package/package.json +94 -95
  79. package/dist/adapters/react/page-context-guard.test.d.ts +0 -1
  80. package/dist/adapters/react/page-context-guard.test.js +0 -15
  81. package/dist/cli/agents/api-agent.d.ts +0 -22
  82. package/dist/cli/agents/api-agent.js +0 -761
  83. package/dist/cli/agents/auth-agent.d.ts +0 -7
  84. package/dist/cli/agents/auth-agent.js +0 -212
  85. package/dist/cli/agents/deeplink-agent.d.ts +0 -6
  86. package/dist/cli/agents/deeplink-agent.js +0 -285
  87. package/dist/cli/agents/llm.d.ts +0 -33
  88. package/dist/cli/agents/llm.js +0 -309
  89. package/dist/cli/agents/pipeline.d.ts +0 -72
  90. package/dist/cli/agents/pipeline.js +0 -421
  91. package/dist/cli/agents/reviewer-agent.d.ts +0 -13
  92. package/dist/cli/agents/reviewer-agent.js +0 -450
  93. package/dist/cli/agents/route-agent.d.ts +0 -17
  94. package/dist/cli/agents/route-agent.js +0 -383
  95. package/dist/cli/config-loader.test.d.ts +0 -1
  96. package/dist/cli/config-loader.test.js +0 -63
  97. package/dist/cli/detectors/topology.d.ts +0 -46
  98. package/dist/cli/detectors/topology.js +0 -417
  99. package/dist/cli/generators/config.test.d.ts +0 -1
  100. package/dist/cli/generators/config.test.js +0 -222
  101. package/dist/cli/generators/shell.test.d.ts +0 -1
  102. package/dist/cli/generators/shell.test.js +0 -73
  103. package/dist/cli/generators/token-route.test.d.ts +0 -1
  104. package/dist/cli/generators/token-route.test.js +0 -53
  105. package/dist/cli/generators/wiring-snippets.test.d.ts +0 -1
  106. package/dist/cli/generators/wiring-snippets.test.js +0 -80
  107. package/dist/cli/init.d.ts +0 -32
  108. package/dist/cli/init.js +0 -1336
  109. package/dist/cli/manifest-diff.test.d.ts +0 -1
  110. package/dist/cli/manifest-diff.test.js +0 -144
  111. package/dist/cli/processors/curl-parser.test.d.ts +0 -1
  112. package/dist/cli/processors/curl-parser.test.js +0 -24
  113. package/dist/cli/processors/integration-audit.test.d.ts +0 -1
  114. package/dist/cli/processors/integration-audit.test.js +0 -154
  115. package/dist/cli/processors/postprocess.d.ts +0 -22
  116. package/dist/cli/processors/postprocess.js +0 -107
  117. package/dist/cli/processors/prisma-parser.d.ts +0 -35
  118. package/dist/cli/processors/prisma-parser.js +0 -117
  119. package/dist/cli/processors/verify-discovery.d.ts +0 -33
  120. package/dist/cli/processors/verify-discovery.js +0 -193
  121. package/dist/cli/processors/verify-discovery.test.d.ts +0 -1
  122. package/dist/cli/processors/verify-discovery.test.js +0 -153
  123. package/dist/cli/processors/zod-extractor.d.ts +0 -27
  124. package/dist/cli/processors/zod-extractor.js +0 -153
  125. package/dist/cli/prompts/review.d.ts +0 -61
  126. package/dist/cli/prompts/review.js +0 -410
  127. package/dist/cli/selectors/express.d.ts +0 -12
  128. package/dist/cli/selectors/express.js +0 -117
  129. package/dist/cli/selectors/fastapi.d.ts +0 -12
  130. package/dist/cli/selectors/fastapi.js +0 -122
  131. package/dist/cli/selectors/generic.d.ts +0 -10
  132. package/dist/cli/selectors/generic.js +0 -74
  133. package/dist/cli/selectors/index.d.ts +0 -37
  134. package/dist/cli/selectors/index.js +0 -315
  135. package/dist/cli/selectors/next.d.ts +0 -12
  136. package/dist/cli/selectors/next.js +0 -130
  137. package/dist/core/config-policy.test.d.ts +0 -1
  138. package/dist/core/config-policy.test.js +0 -101
  139. package/dist/core/config-roundtrip.test.d.ts +0 -1
  140. package/dist/core/config-roundtrip.test.js +0 -180
  141. package/dist/core/endpoint-guard.test.d.ts +0 -1
  142. package/dist/core/endpoint-guard.test.js +0 -57
  143. package/dist/core/env-diagnostics.test.d.ts +0 -1
  144. package/dist/core/env-diagnostics.test.js +0 -31
  145. package/dist/core/evidence-bundle.conformance.test.d.ts +0 -1
  146. package/dist/core/evidence-bundle.conformance.test.js +0 -110
  147. package/dist/core/evidence-bundle.test.d.ts +0 -1
  148. package/dist/core/evidence-bundle.test.js +0 -58
  149. package/dist/core/invariants.test.d.ts +0 -1
  150. package/dist/core/invariants.test.js +0 -217
  151. package/dist/core/login-handoff.test.d.ts +0 -1
  152. package/dist/core/login-handoff.test.js +0 -31
  153. package/dist/core/profile.test.d.ts +0 -1
  154. package/dist/core/profile.test.js +0 -95
  155. package/dist/core/readiness-checks.test.d.ts +0 -1
  156. package/dist/core/readiness-checks.test.js +0 -106
  157. package/dist/core/receipt.test.d.ts +0 -1
  158. package/dist/core/receipt.test.js +0 -75
  159. package/dist/core/sdk-entrypoint.test.d.ts +0 -1
  160. package/dist/core/sdk-entrypoint.test.js +0 -8
  161. package/dist/core/side-effects-review.test.d.ts +0 -1
  162. package/dist/core/side-effects-review.test.js +0 -28
  163. package/dist/core/token.conformance.test.d.ts +0 -1
  164. package/dist/core/token.conformance.test.js +0 -43
  165. package/dist/core/token.test.d.ts +0 -1
  166. package/dist/core/token.test.js +0 -66
@@ -0,0 +1,1864 @@
1
+ import { z } from "zod";
2
+ export declare const PROJECT_DIR = "duct";
3
+ export declare const PROJECT_FILES: {
4
+ readonly project: "project.ts";
5
+ readonly capabilities: "capabilities.json";
6
+ readonly policy: "policy.ts";
7
+ readonly shell: "shell.ts";
8
+ readonly tests: "tests.ts";
9
+ };
10
+ /** Marker functions the static loader looks for in each .ts file. */
11
+ export declare const PROJECT_MARKERS: {
12
+ readonly project: "defineProject(";
13
+ readonly policy: "definePolicy(";
14
+ readonly shell: "defineShell(";
15
+ readonly tests: "defineTests(";
16
+ };
17
+ /** Action id or glob over action ids, e.g. `get_*`, `*_order`, `*`. */
18
+ export declare const ActionPatternSchema: z.ZodString;
19
+ export declare const ProjectNetworkSchema: z.ZodObject<{
20
+ registry_visibility: z.ZodOptional<z.ZodEnum<["public", "private"]>>;
21
+ intershell_enabled: z.ZodOptional<z.ZodBoolean>;
22
+ allowedCallers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
23
+ allowedCallees: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
24
+ }, "strict", z.ZodTypeAny, {
25
+ allowedCallers?: string[] | undefined;
26
+ allowedCallees?: string[] | undefined;
27
+ registry_visibility?: "public" | "private" | undefined;
28
+ intershell_enabled?: boolean | undefined;
29
+ }, {
30
+ allowedCallers?: string[] | undefined;
31
+ allowedCallees?: string[] | undefined;
32
+ registry_visibility?: "public" | "private" | undefined;
33
+ intershell_enabled?: boolean | undefined;
34
+ }>;
35
+ export declare const ProjectFileSchema: z.ZodObject<{
36
+ shellId: z.ZodString;
37
+ product: z.ZodObject<{
38
+ name: z.ZodString;
39
+ description: z.ZodString;
40
+ baseUrl: z.ZodString;
41
+ apiBaseUrl: z.ZodOptional<z.ZodString>;
42
+ locale: z.ZodOptional<z.ZodString>;
43
+ industry: z.ZodOptional<z.ZodString>;
44
+ logoUrl: z.ZodOptional<z.ZodString>;
45
+ }, "strip", z.ZodTypeAny, {
46
+ name: string;
47
+ description: string;
48
+ baseUrl: string;
49
+ apiBaseUrl?: string | undefined;
50
+ locale?: string | undefined;
51
+ industry?: string | undefined;
52
+ logoUrl?: string | undefined;
53
+ }, {
54
+ name: string;
55
+ description: string;
56
+ baseUrl: string;
57
+ apiBaseUrl?: string | undefined;
58
+ locale?: string | undefined;
59
+ industry?: string | undefined;
60
+ logoUrl?: string | undefined;
61
+ }>;
62
+ /** How your app authenticates users. Only needed for user identity and the chat shell. */
63
+ auth: z.ZodOptional<z.ZodObject<{
64
+ strategy: z.ZodEnum<["nextauth", "clerk", "auth0", "custom-jwt", "session-cookie", "none", "unknown"]>;
65
+ sessionFields: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
66
+ guestAllowed: z.ZodBoolean;
67
+ tokenExpirySeconds: z.ZodDefault<z.ZodNumber>;
68
+ tokenEndpoint: z.ZodOptional<z.ZodString>;
69
+ customClaims: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
70
+ loginDeeplinkId: z.ZodOptional<z.ZodString>;
71
+ loginRoutePath: z.ZodOptional<z.ZodString>;
72
+ confidence: z.ZodOptional<z.ZodNumber>;
73
+ evidence: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
74
+ }, "strip", z.ZodTypeAny, {
75
+ strategy: "none" | "nextauth" | "clerk" | "auth0" | "custom-jwt" | "session-cookie" | "unknown";
76
+ sessionFields: string[];
77
+ guestAllowed: boolean;
78
+ tokenExpirySeconds: number;
79
+ confidence?: number | undefined;
80
+ evidence?: string[] | undefined;
81
+ tokenEndpoint?: string | undefined;
82
+ customClaims?: Record<string, string> | undefined;
83
+ loginDeeplinkId?: string | undefined;
84
+ loginRoutePath?: string | undefined;
85
+ }, {
86
+ strategy: "none" | "nextauth" | "clerk" | "auth0" | "custom-jwt" | "session-cookie" | "unknown";
87
+ guestAllowed: boolean;
88
+ confidence?: number | undefined;
89
+ evidence?: string[] | undefined;
90
+ sessionFields?: string[] | undefined;
91
+ tokenExpirySeconds?: number | undefined;
92
+ tokenEndpoint?: string | undefined;
93
+ customClaims?: Record<string, string> | undefined;
94
+ loginDeeplinkId?: string | undefined;
95
+ loginRoutePath?: string | undefined;
96
+ }>>;
97
+ webhooks: z.ZodOptional<z.ZodObject<{
98
+ consentCallback: z.ZodOptional<z.ZodString>;
99
+ identityUrl: z.ZodOptional<z.ZodString>;
100
+ secret: z.ZodOptional<z.ZodString>;
101
+ deeplinkCallback: z.ZodOptional<z.ZodString>;
102
+ eventStream: z.ZodOptional<z.ZodString>;
103
+ }, "strip", z.ZodTypeAny, {
104
+ consentCallback?: string | undefined;
105
+ identityUrl?: string | undefined;
106
+ secret?: string | undefined;
107
+ deeplinkCallback?: string | undefined;
108
+ eventStream?: string | undefined;
109
+ }, {
110
+ consentCallback?: string | undefined;
111
+ identityUrl?: string | undefined;
112
+ secret?: string | undefined;
113
+ deeplinkCallback?: string | undefined;
114
+ eventStream?: string | undefined;
115
+ }>>;
116
+ /** Cross-shell settings (early access, off by default). */
117
+ network: z.ZodOptional<z.ZodObject<{
118
+ registry_visibility: z.ZodOptional<z.ZodEnum<["public", "private"]>>;
119
+ intershell_enabled: z.ZodOptional<z.ZodBoolean>;
120
+ allowedCallers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
121
+ allowedCallees: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
122
+ }, "strict", z.ZodTypeAny, {
123
+ allowedCallers?: string[] | undefined;
124
+ allowedCallees?: string[] | undefined;
125
+ registry_visibility?: "public" | "private" | undefined;
126
+ intershell_enabled?: boolean | undefined;
127
+ }, {
128
+ allowedCallers?: string[] | undefined;
129
+ allowedCallees?: string[] | undefined;
130
+ registry_visibility?: "public" | "private" | undefined;
131
+ intershell_enabled?: boolean | undefined;
132
+ }>>;
133
+ }, "strict", z.ZodTypeAny, {
134
+ shellId: string;
135
+ product: {
136
+ name: string;
137
+ description: string;
138
+ baseUrl: string;
139
+ apiBaseUrl?: string | undefined;
140
+ locale?: string | undefined;
141
+ industry?: string | undefined;
142
+ logoUrl?: string | undefined;
143
+ };
144
+ auth?: {
145
+ strategy: "none" | "nextauth" | "clerk" | "auth0" | "custom-jwt" | "session-cookie" | "unknown";
146
+ sessionFields: string[];
147
+ guestAllowed: boolean;
148
+ tokenExpirySeconds: number;
149
+ confidence?: number | undefined;
150
+ evidence?: string[] | undefined;
151
+ tokenEndpoint?: string | undefined;
152
+ customClaims?: Record<string, string> | undefined;
153
+ loginDeeplinkId?: string | undefined;
154
+ loginRoutePath?: string | undefined;
155
+ } | undefined;
156
+ webhooks?: {
157
+ consentCallback?: string | undefined;
158
+ identityUrl?: string | undefined;
159
+ secret?: string | undefined;
160
+ deeplinkCallback?: string | undefined;
161
+ eventStream?: string | undefined;
162
+ } | undefined;
163
+ network?: {
164
+ allowedCallers?: string[] | undefined;
165
+ allowedCallees?: string[] | undefined;
166
+ registry_visibility?: "public" | "private" | undefined;
167
+ intershell_enabled?: boolean | undefined;
168
+ } | undefined;
169
+ }, {
170
+ shellId: string;
171
+ product: {
172
+ name: string;
173
+ description: string;
174
+ baseUrl: string;
175
+ apiBaseUrl?: string | undefined;
176
+ locale?: string | undefined;
177
+ industry?: string | undefined;
178
+ logoUrl?: string | undefined;
179
+ };
180
+ auth?: {
181
+ strategy: "none" | "nextauth" | "clerk" | "auth0" | "custom-jwt" | "session-cookie" | "unknown";
182
+ guestAllowed: boolean;
183
+ confidence?: number | undefined;
184
+ evidence?: string[] | undefined;
185
+ sessionFields?: string[] | undefined;
186
+ tokenExpirySeconds?: number | undefined;
187
+ tokenEndpoint?: string | undefined;
188
+ customClaims?: Record<string, string> | undefined;
189
+ loginDeeplinkId?: string | undefined;
190
+ loginRoutePath?: string | undefined;
191
+ } | undefined;
192
+ webhooks?: {
193
+ consentCallback?: string | undefined;
194
+ identityUrl?: string | undefined;
195
+ secret?: string | undefined;
196
+ deeplinkCallback?: string | undefined;
197
+ eventStream?: string | undefined;
198
+ } | undefined;
199
+ network?: {
200
+ allowedCallers?: string[] | undefined;
201
+ allowedCallees?: string[] | undefined;
202
+ registry_visibility?: "public" | "private" | undefined;
203
+ intershell_enabled?: boolean | undefined;
204
+ } | undefined;
205
+ }>;
206
+ export declare const CapabilityActionSchema: z.ZodObject<Pick<{
207
+ id: z.ZodString;
208
+ name: z.ZodString;
209
+ description: z.ZodString;
210
+ method: z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE"]>;
211
+ path: z.ZodString;
212
+ agentAccessible: z.ZodBoolean;
213
+ sideEffects: z.ZodBoolean;
214
+ sideEffectsReviewAck: z.ZodOptional<z.ZodString>;
215
+ sensitivityLevel: z.ZodEnum<["none", "low", "medium", "high", "critical"]>;
216
+ params: z.ZodDefault<z.ZodArray<z.ZodObject<{
217
+ name: z.ZodString;
218
+ type: z.ZodEnum<["string", "number", "boolean", "object", "array"]>;
219
+ required: z.ZodBoolean;
220
+ description: z.ZodOptional<z.ZodString>;
221
+ schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
222
+ }, "strip", z.ZodTypeAny, {
223
+ type: "string" | "number" | "boolean" | "object" | "array";
224
+ name: string;
225
+ required: boolean;
226
+ description?: string | undefined;
227
+ schema?: Record<string, unknown> | undefined;
228
+ }, {
229
+ type: "string" | "number" | "boolean" | "object" | "array";
230
+ name: string;
231
+ required: boolean;
232
+ description?: string | undefined;
233
+ schema?: Record<string, unknown> | undefined;
234
+ }>, "many">>;
235
+ responseSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
236
+ inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
237
+ requiresAuth: z.ZodBoolean;
238
+ rateLimit: z.ZodOptional<z.ZodNumber>;
239
+ searchHint: z.ZodOptional<z.ZodString>;
240
+ alwaysInclude: z.ZodOptional<z.ZodBoolean>;
241
+ interruptBehavior: z.ZodOptional<z.ZodEnum<["cancel", "block"]>>;
242
+ updatedAt: z.ZodOptional<z.ZodString>;
243
+ confidence: z.ZodOptional<z.ZodNumber>;
244
+ evidence: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
245
+ validFrom: z.ZodOptional<z.ZodString>;
246
+ validUntil: z.ZodOptional<z.ZodString>;
247
+ approveIf: z.ZodOptional<z.ZodType<import("@duct-sdk/contracts").ApprovalPredicate, z.ZodTypeDef, import("@duct-sdk/contracts").ApprovalPredicate>>;
248
+ actionLimit: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
249
+ type: z.ZodLiteral<"rate">;
250
+ maxPerWindow: z.ZodNumber;
251
+ windowSeconds: z.ZodNumber;
252
+ }, "strip", z.ZodTypeAny, {
253
+ type: "rate";
254
+ maxPerWindow: number;
255
+ windowSeconds: number;
256
+ }, {
257
+ type: "rate";
258
+ maxPerWindow: number;
259
+ windowSeconds: number;
260
+ }>, z.ZodObject<{
261
+ type: z.ZodLiteral<"count">;
262
+ maxCount: z.ZodNumber;
263
+ }, "strip", z.ZodTypeAny, {
264
+ type: "count";
265
+ maxCount: number;
266
+ }, {
267
+ type: "count";
268
+ maxCount: number;
269
+ }>]>>;
270
+ dependsOn: z.ZodOptional<z.ZodArray<z.ZodObject<{
271
+ actionId: z.ZodString;
272
+ paramMapping: z.ZodRecord<z.ZodString, z.ZodString>;
273
+ }, "strip", z.ZodTypeAny, {
274
+ actionId: string;
275
+ paramMapping: Record<string, string>;
276
+ }, {
277
+ actionId: string;
278
+ paramMapping: Record<string, string>;
279
+ }>, "many">>;
280
+ semanticType: z.ZodOptional<z.ZodEnum<["list", "entity", "status", "comparison", "timeline", "search_results"]>>;
281
+ outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
282
+ paramMappings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
283
+ navigatesTo: z.ZodOptional<z.ZodString>;
284
+ }, "id" | "name" | "params" | "path" | "description" | "updatedAt" | "confidence" | "evidence" | "method" | "sideEffects" | "sideEffectsReviewAck" | "responseSchema" | "inputSchema"> & {
285
+ sensitivityLevel: z.ZodDefault<z.ZodEnum<["none", "low", "medium", "high", "critical"]>>;
286
+ requiresAuth: z.ZodDefault<z.ZodBoolean>;
287
+ }, "strict", z.ZodTypeAny, {
288
+ id: string;
289
+ name: string;
290
+ params: {
291
+ type: "string" | "number" | "boolean" | "object" | "array";
292
+ name: string;
293
+ required: boolean;
294
+ description?: string | undefined;
295
+ schema?: Record<string, unknown> | undefined;
296
+ }[];
297
+ path: string;
298
+ description: string;
299
+ requiresAuth: boolean;
300
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
301
+ sideEffects: boolean;
302
+ sensitivityLevel: "none" | "low" | "medium" | "high" | "critical";
303
+ updatedAt?: string | undefined;
304
+ confidence?: number | undefined;
305
+ evidence?: string[] | undefined;
306
+ sideEffectsReviewAck?: string | undefined;
307
+ responseSchema?: Record<string, unknown> | undefined;
308
+ inputSchema?: Record<string, unknown> | undefined;
309
+ }, {
310
+ id: string;
311
+ name: string;
312
+ path: string;
313
+ description: string;
314
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
315
+ sideEffects: boolean;
316
+ params?: {
317
+ type: "string" | "number" | "boolean" | "object" | "array";
318
+ name: string;
319
+ required: boolean;
320
+ description?: string | undefined;
321
+ schema?: Record<string, unknown> | undefined;
322
+ }[] | undefined;
323
+ requiresAuth?: boolean | undefined;
324
+ updatedAt?: string | undefined;
325
+ confidence?: number | undefined;
326
+ evidence?: string[] | undefined;
327
+ sideEffectsReviewAck?: string | undefined;
328
+ sensitivityLevel?: "none" | "low" | "medium" | "high" | "critical" | undefined;
329
+ responseSchema?: Record<string, unknown> | undefined;
330
+ inputSchema?: Record<string, unknown> | undefined;
331
+ }>;
332
+ export declare const CapabilitySourceSchema: z.ZodObject<{
333
+ kind: z.ZodEnum<["openapi", "postman", "curl", "manual", "imported"]>;
334
+ /** File path (relative to the project root) or URL the actions were generated from. */
335
+ location: z.ZodOptional<z.ZodString>;
336
+ syncedAt: z.ZodOptional<z.ZodString>;
337
+ }, "strict", z.ZodTypeAny, {
338
+ kind: "openapi" | "postman" | "curl" | "manual" | "imported";
339
+ location?: string | undefined;
340
+ syncedAt?: string | undefined;
341
+ }, {
342
+ kind: "openapi" | "postman" | "curl" | "manual" | "imported";
343
+ location?: string | undefined;
344
+ syncedAt?: string | undefined;
345
+ }>;
346
+ export declare const CapabilitiesFileSchema: z.ZodEffects<z.ZodObject<{
347
+ $schema: z.ZodOptional<z.ZodString>;
348
+ version: z.ZodLiteral<1>;
349
+ source: z.ZodObject<{
350
+ kind: z.ZodEnum<["openapi", "postman", "curl", "manual", "imported"]>;
351
+ /** File path (relative to the project root) or URL the actions were generated from. */
352
+ location: z.ZodOptional<z.ZodString>;
353
+ syncedAt: z.ZodOptional<z.ZodString>;
354
+ }, "strict", z.ZodTypeAny, {
355
+ kind: "openapi" | "postman" | "curl" | "manual" | "imported";
356
+ location?: string | undefined;
357
+ syncedAt?: string | undefined;
358
+ }, {
359
+ kind: "openapi" | "postman" | "curl" | "manual" | "imported";
360
+ location?: string | undefined;
361
+ syncedAt?: string | undefined;
362
+ }>;
363
+ actions: z.ZodArray<z.ZodObject<Pick<{
364
+ id: z.ZodString;
365
+ name: z.ZodString;
366
+ description: z.ZodString;
367
+ method: z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE"]>;
368
+ path: z.ZodString;
369
+ agentAccessible: z.ZodBoolean;
370
+ sideEffects: z.ZodBoolean;
371
+ sideEffectsReviewAck: z.ZodOptional<z.ZodString>;
372
+ sensitivityLevel: z.ZodEnum<["none", "low", "medium", "high", "critical"]>;
373
+ params: z.ZodDefault<z.ZodArray<z.ZodObject<{
374
+ name: z.ZodString;
375
+ type: z.ZodEnum<["string", "number", "boolean", "object", "array"]>;
376
+ required: z.ZodBoolean;
377
+ description: z.ZodOptional<z.ZodString>;
378
+ schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
379
+ }, "strip", z.ZodTypeAny, {
380
+ type: "string" | "number" | "boolean" | "object" | "array";
381
+ name: string;
382
+ required: boolean;
383
+ description?: string | undefined;
384
+ schema?: Record<string, unknown> | undefined;
385
+ }, {
386
+ type: "string" | "number" | "boolean" | "object" | "array";
387
+ name: string;
388
+ required: boolean;
389
+ description?: string | undefined;
390
+ schema?: Record<string, unknown> | undefined;
391
+ }>, "many">>;
392
+ responseSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
393
+ inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
394
+ requiresAuth: z.ZodBoolean;
395
+ rateLimit: z.ZodOptional<z.ZodNumber>;
396
+ searchHint: z.ZodOptional<z.ZodString>;
397
+ alwaysInclude: z.ZodOptional<z.ZodBoolean>;
398
+ interruptBehavior: z.ZodOptional<z.ZodEnum<["cancel", "block"]>>;
399
+ updatedAt: z.ZodOptional<z.ZodString>;
400
+ confidence: z.ZodOptional<z.ZodNumber>;
401
+ evidence: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
402
+ validFrom: z.ZodOptional<z.ZodString>;
403
+ validUntil: z.ZodOptional<z.ZodString>;
404
+ approveIf: z.ZodOptional<z.ZodType<import("@duct-sdk/contracts").ApprovalPredicate, z.ZodTypeDef, import("@duct-sdk/contracts").ApprovalPredicate>>;
405
+ actionLimit: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
406
+ type: z.ZodLiteral<"rate">;
407
+ maxPerWindow: z.ZodNumber;
408
+ windowSeconds: z.ZodNumber;
409
+ }, "strip", z.ZodTypeAny, {
410
+ type: "rate";
411
+ maxPerWindow: number;
412
+ windowSeconds: number;
413
+ }, {
414
+ type: "rate";
415
+ maxPerWindow: number;
416
+ windowSeconds: number;
417
+ }>, z.ZodObject<{
418
+ type: z.ZodLiteral<"count">;
419
+ maxCount: z.ZodNumber;
420
+ }, "strip", z.ZodTypeAny, {
421
+ type: "count";
422
+ maxCount: number;
423
+ }, {
424
+ type: "count";
425
+ maxCount: number;
426
+ }>]>>;
427
+ dependsOn: z.ZodOptional<z.ZodArray<z.ZodObject<{
428
+ actionId: z.ZodString;
429
+ paramMapping: z.ZodRecord<z.ZodString, z.ZodString>;
430
+ }, "strip", z.ZodTypeAny, {
431
+ actionId: string;
432
+ paramMapping: Record<string, string>;
433
+ }, {
434
+ actionId: string;
435
+ paramMapping: Record<string, string>;
436
+ }>, "many">>;
437
+ semanticType: z.ZodOptional<z.ZodEnum<["list", "entity", "status", "comparison", "timeline", "search_results"]>>;
438
+ outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
439
+ paramMappings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
440
+ navigatesTo: z.ZodOptional<z.ZodString>;
441
+ }, "id" | "name" | "params" | "path" | "description" | "updatedAt" | "confidence" | "evidence" | "method" | "sideEffects" | "sideEffectsReviewAck" | "responseSchema" | "inputSchema"> & {
442
+ sensitivityLevel: z.ZodDefault<z.ZodEnum<["none", "low", "medium", "high", "critical"]>>;
443
+ requiresAuth: z.ZodDefault<z.ZodBoolean>;
444
+ }, "strict", z.ZodTypeAny, {
445
+ id: string;
446
+ name: string;
447
+ params: {
448
+ type: "string" | "number" | "boolean" | "object" | "array";
449
+ name: string;
450
+ required: boolean;
451
+ description?: string | undefined;
452
+ schema?: Record<string, unknown> | undefined;
453
+ }[];
454
+ path: string;
455
+ description: string;
456
+ requiresAuth: boolean;
457
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
458
+ sideEffects: boolean;
459
+ sensitivityLevel: "none" | "low" | "medium" | "high" | "critical";
460
+ updatedAt?: string | undefined;
461
+ confidence?: number | undefined;
462
+ evidence?: string[] | undefined;
463
+ sideEffectsReviewAck?: string | undefined;
464
+ responseSchema?: Record<string, unknown> | undefined;
465
+ inputSchema?: Record<string, unknown> | undefined;
466
+ }, {
467
+ id: string;
468
+ name: string;
469
+ path: string;
470
+ description: string;
471
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
472
+ sideEffects: boolean;
473
+ params?: {
474
+ type: "string" | "number" | "boolean" | "object" | "array";
475
+ name: string;
476
+ required: boolean;
477
+ description?: string | undefined;
478
+ schema?: Record<string, unknown> | undefined;
479
+ }[] | undefined;
480
+ requiresAuth?: boolean | undefined;
481
+ updatedAt?: string | undefined;
482
+ confidence?: number | undefined;
483
+ evidence?: string[] | undefined;
484
+ sideEffectsReviewAck?: string | undefined;
485
+ sensitivityLevel?: "none" | "low" | "medium" | "high" | "critical" | undefined;
486
+ responseSchema?: Record<string, unknown> | undefined;
487
+ inputSchema?: Record<string, unknown> | undefined;
488
+ }>, "many">;
489
+ }, "strict", z.ZodTypeAny, {
490
+ actions: {
491
+ id: string;
492
+ name: string;
493
+ params: {
494
+ type: "string" | "number" | "boolean" | "object" | "array";
495
+ name: string;
496
+ required: boolean;
497
+ description?: string | undefined;
498
+ schema?: Record<string, unknown> | undefined;
499
+ }[];
500
+ path: string;
501
+ description: string;
502
+ requiresAuth: boolean;
503
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
504
+ sideEffects: boolean;
505
+ sensitivityLevel: "none" | "low" | "medium" | "high" | "critical";
506
+ updatedAt?: string | undefined;
507
+ confidence?: number | undefined;
508
+ evidence?: string[] | undefined;
509
+ sideEffectsReviewAck?: string | undefined;
510
+ responseSchema?: Record<string, unknown> | undefined;
511
+ inputSchema?: Record<string, unknown> | undefined;
512
+ }[];
513
+ version: 1;
514
+ source: {
515
+ kind: "openapi" | "postman" | "curl" | "manual" | "imported";
516
+ location?: string | undefined;
517
+ syncedAt?: string | undefined;
518
+ };
519
+ $schema?: string | undefined;
520
+ }, {
521
+ actions: {
522
+ id: string;
523
+ name: string;
524
+ path: string;
525
+ description: string;
526
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
527
+ sideEffects: boolean;
528
+ params?: {
529
+ type: "string" | "number" | "boolean" | "object" | "array";
530
+ name: string;
531
+ required: boolean;
532
+ description?: string | undefined;
533
+ schema?: Record<string, unknown> | undefined;
534
+ }[] | undefined;
535
+ requiresAuth?: boolean | undefined;
536
+ updatedAt?: string | undefined;
537
+ confidence?: number | undefined;
538
+ evidence?: string[] | undefined;
539
+ sideEffectsReviewAck?: string | undefined;
540
+ sensitivityLevel?: "none" | "low" | "medium" | "high" | "critical" | undefined;
541
+ responseSchema?: Record<string, unknown> | undefined;
542
+ inputSchema?: Record<string, unknown> | undefined;
543
+ }[];
544
+ version: 1;
545
+ source: {
546
+ kind: "openapi" | "postman" | "curl" | "manual" | "imported";
547
+ location?: string | undefined;
548
+ syncedAt?: string | undefined;
549
+ };
550
+ $schema?: string | undefined;
551
+ }>, {
552
+ actions: {
553
+ id: string;
554
+ name: string;
555
+ params: {
556
+ type: "string" | "number" | "boolean" | "object" | "array";
557
+ name: string;
558
+ required: boolean;
559
+ description?: string | undefined;
560
+ schema?: Record<string, unknown> | undefined;
561
+ }[];
562
+ path: string;
563
+ description: string;
564
+ requiresAuth: boolean;
565
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
566
+ sideEffects: boolean;
567
+ sensitivityLevel: "none" | "low" | "medium" | "high" | "critical";
568
+ updatedAt?: string | undefined;
569
+ confidence?: number | undefined;
570
+ evidence?: string[] | undefined;
571
+ sideEffectsReviewAck?: string | undefined;
572
+ responseSchema?: Record<string, unknown> | undefined;
573
+ inputSchema?: Record<string, unknown> | undefined;
574
+ }[];
575
+ version: 1;
576
+ source: {
577
+ kind: "openapi" | "postman" | "curl" | "manual" | "imported";
578
+ location?: string | undefined;
579
+ syncedAt?: string | undefined;
580
+ };
581
+ $schema?: string | undefined;
582
+ }, {
583
+ actions: {
584
+ id: string;
585
+ name: string;
586
+ path: string;
587
+ description: string;
588
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
589
+ sideEffects: boolean;
590
+ params?: {
591
+ type: "string" | "number" | "boolean" | "object" | "array";
592
+ name: string;
593
+ required: boolean;
594
+ description?: string | undefined;
595
+ schema?: Record<string, unknown> | undefined;
596
+ }[] | undefined;
597
+ requiresAuth?: boolean | undefined;
598
+ updatedAt?: string | undefined;
599
+ confidence?: number | undefined;
600
+ evidence?: string[] | undefined;
601
+ sideEffectsReviewAck?: string | undefined;
602
+ sensitivityLevel?: "none" | "low" | "medium" | "high" | "critical" | undefined;
603
+ responseSchema?: Record<string, unknown> | undefined;
604
+ inputSchema?: Record<string, unknown> | undefined;
605
+ }[];
606
+ version: 1;
607
+ source: {
608
+ kind: "openapi" | "postman" | "curl" | "manual" | "imported";
609
+ location?: string | undefined;
610
+ syncedAt?: string | undefined;
611
+ };
612
+ $schema?: string | undefined;
613
+ }>;
614
+ /** One comparison on a param: `{ gt: 500 }`, `{ in: ["USD", "EUR"] }`, or a bare value for equality. */
615
+ export declare const ComparisonSchema: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodEffects<z.ZodObject<{
616
+ gt: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
617
+ gte: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
618
+ lt: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
619
+ lte: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
620
+ eq: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
621
+ neq: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
622
+ in: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, "many">>;
623
+ }, "strict", z.ZodTypeAny, {
624
+ gt?: string | number | boolean | undefined;
625
+ gte?: string | number | boolean | undefined;
626
+ lt?: string | number | boolean | undefined;
627
+ lte?: string | number | boolean | undefined;
628
+ eq?: string | number | boolean | undefined;
629
+ neq?: string | number | boolean | undefined;
630
+ in?: (string | number | boolean)[] | undefined;
631
+ }, {
632
+ gt?: string | number | boolean | undefined;
633
+ gte?: string | number | boolean | undefined;
634
+ lt?: string | number | boolean | undefined;
635
+ lte?: string | number | boolean | undefined;
636
+ eq?: string | number | boolean | undefined;
637
+ neq?: string | number | boolean | undefined;
638
+ in?: (string | number | boolean)[] | undefined;
639
+ }>, {
640
+ gt?: string | number | boolean | undefined;
641
+ gte?: string | number | boolean | undefined;
642
+ lt?: string | number | boolean | undefined;
643
+ lte?: string | number | boolean | undefined;
644
+ eq?: string | number | boolean | undefined;
645
+ neq?: string | number | boolean | undefined;
646
+ in?: (string | number | boolean)[] | undefined;
647
+ }, {
648
+ gt?: string | number | boolean | undefined;
649
+ gte?: string | number | boolean | undefined;
650
+ lt?: string | number | boolean | undefined;
651
+ lte?: string | number | boolean | undefined;
652
+ eq?: string | number | boolean | undefined;
653
+ neq?: string | number | boolean | undefined;
654
+ in?: (string | number | boolean)[] | undefined;
655
+ }>]>;
656
+ export type Comparison = z.infer<typeof ComparisonSchema>;
657
+ /**
658
+ * When a call needs human approval. A plain object ANDs its params:
659
+ * `{ amount: { gt: 500 }, currency: "USD" }`. Use `any` / `all` to combine.
660
+ */
661
+ export type Condition = {
662
+ any: Condition[];
663
+ } | {
664
+ all: Condition[];
665
+ } | {
666
+ [param: string]: Comparison;
667
+ };
668
+ export declare const ConditionSchema: z.ZodType<Condition>;
669
+ export declare const LimitSpecSchema: z.ZodEffects<z.ZodObject<{
670
+ /** Requests per minute for this action (all callers). */
671
+ perMinute: z.ZodOptional<z.ZodNumber>;
672
+ perHour: z.ZodOptional<z.ZodNumber>;
673
+ perDay: z.ZodOptional<z.ZodNumber>;
674
+ /** Lifetime cap on executions. */
675
+ total: z.ZodOptional<z.ZodNumber>;
676
+ /** Custom rolling window. */
677
+ window: z.ZodOptional<z.ZodObject<{
678
+ max: z.ZodNumber;
679
+ seconds: z.ZodNumber;
680
+ }, "strict", z.ZodTypeAny, {
681
+ max: number;
682
+ seconds: number;
683
+ }, {
684
+ max: number;
685
+ seconds: number;
686
+ }>>;
687
+ }, "strict", z.ZodTypeAny, {
688
+ perMinute?: number | undefined;
689
+ perHour?: number | undefined;
690
+ perDay?: number | undefined;
691
+ total?: number | undefined;
692
+ window?: {
693
+ max: number;
694
+ seconds: number;
695
+ } | undefined;
696
+ }, {
697
+ perMinute?: number | undefined;
698
+ perHour?: number | undefined;
699
+ perDay?: number | undefined;
700
+ total?: number | undefined;
701
+ window?: {
702
+ max: number;
703
+ seconds: number;
704
+ } | undefined;
705
+ }>, {
706
+ perMinute?: number | undefined;
707
+ perHour?: number | undefined;
708
+ perDay?: number | undefined;
709
+ total?: number | undefined;
710
+ window?: {
711
+ max: number;
712
+ seconds: number;
713
+ } | undefined;
714
+ }, {
715
+ perMinute?: number | undefined;
716
+ perHour?: number | undefined;
717
+ perDay?: number | undefined;
718
+ total?: number | undefined;
719
+ window?: {
720
+ max: number;
721
+ seconds: number;
722
+ } | undefined;
723
+ }>;
724
+ export type LimitSpec = z.infer<typeof LimitSpecSchema>;
725
+ export declare const AgentAccessSchema: z.ZodEnum<["none", "read", "write"]>;
726
+ export type AgentAccess = z.infer<typeof AgentAccessSchema>;
727
+ export declare const PolicyAgentsSchema: z.ZodObject<{
728
+ /** Default for agents: none = no access, read = read-only actions, write = all exposed actions. */
729
+ access: z.ZodDefault<z.ZodEnum<["none", "read", "write"]>>;
730
+ /** Actions agents may call. Omit to expose every action the access level permits. */
731
+ allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
732
+ /** Actions agents may never call. Deny always wins. */
733
+ deny: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
734
+ /** Per-action access level overrides (advanced). */
735
+ levels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<["none", "read", "write", "admin"]>>>;
736
+ /** Require a user consent token for every agent call that acts for a user. */
737
+ userConsent: z.ZodDefault<z.ZodBoolean>;
738
+ /** Limit which actions a user's consent can cover (exact action ids). */
739
+ consentScope: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
740
+ /**
741
+ * How many hours a person's approval of an agent lasts, by the most sensitive action it
742
+ * covers. Defaults: low 24, medium 8, high 1 (high includes critical). At most 168.
743
+ * Side-effect actions still need a human approval on every call.
744
+ */
745
+ consentHours: z.ZodOptional<z.ZodObject<{
746
+ low: z.ZodOptional<z.ZodNumber>;
747
+ medium: z.ZodOptional<z.ZodNumber>;
748
+ high: z.ZodOptional<z.ZodNumber>;
749
+ }, "strict", z.ZodTypeAny, {
750
+ low?: number | undefined;
751
+ medium?: number | undefined;
752
+ high?: number | undefined;
753
+ }, {
754
+ low?: number | undefined;
755
+ medium?: number | undefined;
756
+ high?: number | undefined;
757
+ }>>;
758
+ validFrom: z.ZodOptional<z.ZodString>;
759
+ validUntil: z.ZodOptional<z.ZodString>;
760
+ }, "strict", z.ZodTypeAny, {
761
+ access: "none" | "read" | "write";
762
+ userConsent: boolean;
763
+ allow?: string[] | undefined;
764
+ deny?: string[] | undefined;
765
+ validFrom?: string | undefined;
766
+ validUntil?: string | undefined;
767
+ levels?: Record<string, "none" | "read" | "write" | "admin"> | undefined;
768
+ consentScope?: string[] | undefined;
769
+ consentHours?: {
770
+ low?: number | undefined;
771
+ medium?: number | undefined;
772
+ high?: number | undefined;
773
+ } | undefined;
774
+ }, {
775
+ allow?: string[] | undefined;
776
+ deny?: string[] | undefined;
777
+ validFrom?: string | undefined;
778
+ validUntil?: string | undefined;
779
+ access?: "none" | "read" | "write" | undefined;
780
+ levels?: Record<string, "none" | "read" | "write" | "admin"> | undefined;
781
+ userConsent?: boolean | undefined;
782
+ consentScope?: string[] | undefined;
783
+ consentHours?: {
784
+ low?: number | undefined;
785
+ medium?: number | undefined;
786
+ high?: number | undefined;
787
+ } | undefined;
788
+ }>;
789
+ export declare const PolicyApproversSchema: z.ZodObject<{
790
+ /** Who gets notified when an agent request is waiting for approval. */
791
+ emails: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
792
+ reminderLeadMinutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
793
+ /** Re-authentication required to approve sensitive requests. */
794
+ stepUp: z.ZodOptional<z.ZodObject<{
795
+ minSensitivity: z.ZodDefault<z.ZodOptional<z.ZodEnum<["none", "low", "medium", "high", "critical"]>>>;
796
+ requireForSideEffects: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
797
+ sideEffectsMinSensitivity: z.ZodDefault<z.ZodOptional<z.ZodEnum<["none", "low", "medium", "high", "critical"]>>>;
798
+ }, "strip", z.ZodTypeAny, {
799
+ minSensitivity: "none" | "low" | "medium" | "high" | "critical";
800
+ requireForSideEffects: boolean;
801
+ sideEffectsMinSensitivity: "none" | "low" | "medium" | "high" | "critical";
802
+ }, {
803
+ minSensitivity?: "none" | "low" | "medium" | "high" | "critical" | undefined;
804
+ requireForSideEffects?: boolean | undefined;
805
+ sideEffectsMinSensitivity?: "none" | "low" | "medium" | "high" | "critical" | undefined;
806
+ }>>;
807
+ }, "strict", z.ZodTypeAny, {
808
+ stepUp?: {
809
+ minSensitivity: "none" | "low" | "medium" | "high" | "critical";
810
+ requireForSideEffects: boolean;
811
+ sideEffectsMinSensitivity: "none" | "low" | "medium" | "high" | "critical";
812
+ } | undefined;
813
+ emails?: string[] | undefined;
814
+ reminderLeadMinutes?: number | null | undefined;
815
+ }, {
816
+ stepUp?: {
817
+ minSensitivity?: "none" | "low" | "medium" | "high" | "critical" | undefined;
818
+ requireForSideEffects?: boolean | undefined;
819
+ sideEffectsMinSensitivity?: "none" | "low" | "medium" | "high" | "critical" | undefined;
820
+ } | undefined;
821
+ emails?: string[] | undefined;
822
+ reminderLeadMinutes?: number | null | undefined;
823
+ }>;
824
+ export declare const PolicyFileSchema: z.ZodObject<{
825
+ agents: z.ZodDefault<z.ZodObject<{
826
+ /** Default for agents: none = no access, read = read-only actions, write = all exposed actions. */
827
+ access: z.ZodDefault<z.ZodEnum<["none", "read", "write"]>>;
828
+ /** Actions agents may call. Omit to expose every action the access level permits. */
829
+ allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
830
+ /** Actions agents may never call. Deny always wins. */
831
+ deny: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
832
+ /** Per-action access level overrides (advanced). */
833
+ levels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<["none", "read", "write", "admin"]>>>;
834
+ /** Require a user consent token for every agent call that acts for a user. */
835
+ userConsent: z.ZodDefault<z.ZodBoolean>;
836
+ /** Limit which actions a user's consent can cover (exact action ids). */
837
+ consentScope: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
838
+ /**
839
+ * How many hours a person's approval of an agent lasts, by the most sensitive action it
840
+ * covers. Defaults: low 24, medium 8, high 1 (high includes critical). At most 168.
841
+ * Side-effect actions still need a human approval on every call.
842
+ */
843
+ consentHours: z.ZodOptional<z.ZodObject<{
844
+ low: z.ZodOptional<z.ZodNumber>;
845
+ medium: z.ZodOptional<z.ZodNumber>;
846
+ high: z.ZodOptional<z.ZodNumber>;
847
+ }, "strict", z.ZodTypeAny, {
848
+ low?: number | undefined;
849
+ medium?: number | undefined;
850
+ high?: number | undefined;
851
+ }, {
852
+ low?: number | undefined;
853
+ medium?: number | undefined;
854
+ high?: number | undefined;
855
+ }>>;
856
+ validFrom: z.ZodOptional<z.ZodString>;
857
+ validUntil: z.ZodOptional<z.ZodString>;
858
+ }, "strict", z.ZodTypeAny, {
859
+ access: "none" | "read" | "write";
860
+ userConsent: boolean;
861
+ allow?: string[] | undefined;
862
+ deny?: string[] | undefined;
863
+ validFrom?: string | undefined;
864
+ validUntil?: string | undefined;
865
+ levels?: Record<string, "none" | "read" | "write" | "admin"> | undefined;
866
+ consentScope?: string[] | undefined;
867
+ consentHours?: {
868
+ low?: number | undefined;
869
+ medium?: number | undefined;
870
+ high?: number | undefined;
871
+ } | undefined;
872
+ }, {
873
+ allow?: string[] | undefined;
874
+ deny?: string[] | undefined;
875
+ validFrom?: string | undefined;
876
+ validUntil?: string | undefined;
877
+ access?: "none" | "read" | "write" | undefined;
878
+ levels?: Record<string, "none" | "read" | "write" | "admin"> | undefined;
879
+ userConsent?: boolean | undefined;
880
+ consentScope?: string[] | undefined;
881
+ consentHours?: {
882
+ low?: number | undefined;
883
+ medium?: number | undefined;
884
+ high?: number | undefined;
885
+ } | undefined;
886
+ }>>;
887
+ /** Require human approval when a call matches the condition. Later entries win. */
888
+ approveWhen: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<Condition, z.ZodTypeDef, Condition>>>;
889
+ /** Rate and count limits. Applied top to bottom; later entries override earlier fields. */
890
+ limits: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
891
+ /** Requests per minute for this action (all callers). */
892
+ perMinute: z.ZodOptional<z.ZodNumber>;
893
+ perHour: z.ZodOptional<z.ZodNumber>;
894
+ perDay: z.ZodOptional<z.ZodNumber>;
895
+ /** Lifetime cap on executions. */
896
+ total: z.ZodOptional<z.ZodNumber>;
897
+ /** Custom rolling window. */
898
+ window: z.ZodOptional<z.ZodObject<{
899
+ max: z.ZodNumber;
900
+ seconds: z.ZodNumber;
901
+ }, "strict", z.ZodTypeAny, {
902
+ max: number;
903
+ seconds: number;
904
+ }, {
905
+ max: number;
906
+ seconds: number;
907
+ }>>;
908
+ }, "strict", z.ZodTypeAny, {
909
+ perMinute?: number | undefined;
910
+ perHour?: number | undefined;
911
+ perDay?: number | undefined;
912
+ total?: number | undefined;
913
+ window?: {
914
+ max: number;
915
+ seconds: number;
916
+ } | undefined;
917
+ }, {
918
+ perMinute?: number | undefined;
919
+ perHour?: number | undefined;
920
+ perDay?: number | undefined;
921
+ total?: number | undefined;
922
+ window?: {
923
+ max: number;
924
+ seconds: number;
925
+ } | undefined;
926
+ }>, {
927
+ perMinute?: number | undefined;
928
+ perHour?: number | undefined;
929
+ perDay?: number | undefined;
930
+ total?: number | undefined;
931
+ window?: {
932
+ max: number;
933
+ seconds: number;
934
+ } | undefined;
935
+ }, {
936
+ perMinute?: number | undefined;
937
+ perHour?: number | undefined;
938
+ perDay?: number | undefined;
939
+ total?: number | undefined;
940
+ window?: {
941
+ max: number;
942
+ seconds: number;
943
+ } | undefined;
944
+ }>>>;
945
+ /** Raise or lower sensitivity for matching actions. Later entries win. */
946
+ sensitivity: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodLazy<z.ZodEnum<["none", "low", "medium", "high", "critical"]>>>>;
947
+ /** Time windows during which matching actions are callable. */
948
+ windows: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
949
+ from: z.ZodOptional<z.ZodString>;
950
+ until: z.ZodOptional<z.ZodString>;
951
+ }, "strict", z.ZodTypeAny, {
952
+ from?: string | undefined;
953
+ until?: string | undefined;
954
+ }, {
955
+ from?: string | undefined;
956
+ until?: string | undefined;
957
+ }>>>;
958
+ approvers: z.ZodOptional<z.ZodObject<{
959
+ /** Who gets notified when an agent request is waiting for approval. */
960
+ emails: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
961
+ reminderLeadMinutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
962
+ /** Re-authentication required to approve sensitive requests. */
963
+ stepUp: z.ZodOptional<z.ZodObject<{
964
+ minSensitivity: z.ZodDefault<z.ZodOptional<z.ZodEnum<["none", "low", "medium", "high", "critical"]>>>;
965
+ requireForSideEffects: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
966
+ sideEffectsMinSensitivity: z.ZodDefault<z.ZodOptional<z.ZodEnum<["none", "low", "medium", "high", "critical"]>>>;
967
+ }, "strip", z.ZodTypeAny, {
968
+ minSensitivity: "none" | "low" | "medium" | "high" | "critical";
969
+ requireForSideEffects: boolean;
970
+ sideEffectsMinSensitivity: "none" | "low" | "medium" | "high" | "critical";
971
+ }, {
972
+ minSensitivity?: "none" | "low" | "medium" | "high" | "critical" | undefined;
973
+ requireForSideEffects?: boolean | undefined;
974
+ sideEffectsMinSensitivity?: "none" | "low" | "medium" | "high" | "critical" | undefined;
975
+ }>>;
976
+ }, "strict", z.ZodTypeAny, {
977
+ stepUp?: {
978
+ minSensitivity: "none" | "low" | "medium" | "high" | "critical";
979
+ requireForSideEffects: boolean;
980
+ sideEffectsMinSensitivity: "none" | "low" | "medium" | "high" | "critical";
981
+ } | undefined;
982
+ emails?: string[] | undefined;
983
+ reminderLeadMinutes?: number | null | undefined;
984
+ }, {
985
+ stepUp?: {
986
+ minSensitivity?: "none" | "low" | "medium" | "high" | "critical" | undefined;
987
+ requireForSideEffects?: boolean | undefined;
988
+ sideEffectsMinSensitivity?: "none" | "low" | "medium" | "high" | "critical" | undefined;
989
+ } | undefined;
990
+ emails?: string[] | undefined;
991
+ reminderLeadMinutes?: number | null | undefined;
992
+ }>>;
993
+ }, "strict", z.ZodTypeAny, {
994
+ agents: {
995
+ access: "none" | "read" | "write";
996
+ userConsent: boolean;
997
+ allow?: string[] | undefined;
998
+ deny?: string[] | undefined;
999
+ validFrom?: string | undefined;
1000
+ validUntil?: string | undefined;
1001
+ levels?: Record<string, "none" | "read" | "write" | "admin"> | undefined;
1002
+ consentScope?: string[] | undefined;
1003
+ consentHours?: {
1004
+ low?: number | undefined;
1005
+ medium?: number | undefined;
1006
+ high?: number | undefined;
1007
+ } | undefined;
1008
+ };
1009
+ approveWhen?: Record<string, Condition> | undefined;
1010
+ limits?: Record<string, {
1011
+ perMinute?: number | undefined;
1012
+ perHour?: number | undefined;
1013
+ perDay?: number | undefined;
1014
+ total?: number | undefined;
1015
+ window?: {
1016
+ max: number;
1017
+ seconds: number;
1018
+ } | undefined;
1019
+ }> | undefined;
1020
+ sensitivity?: Record<string, "none" | "low" | "medium" | "high" | "critical"> | undefined;
1021
+ windows?: Record<string, {
1022
+ from?: string | undefined;
1023
+ until?: string | undefined;
1024
+ }> | undefined;
1025
+ approvers?: {
1026
+ stepUp?: {
1027
+ minSensitivity: "none" | "low" | "medium" | "high" | "critical";
1028
+ requireForSideEffects: boolean;
1029
+ sideEffectsMinSensitivity: "none" | "low" | "medium" | "high" | "critical";
1030
+ } | undefined;
1031
+ emails?: string[] | undefined;
1032
+ reminderLeadMinutes?: number | null | undefined;
1033
+ } | undefined;
1034
+ }, {
1035
+ agents?: {
1036
+ allow?: string[] | undefined;
1037
+ deny?: string[] | undefined;
1038
+ validFrom?: string | undefined;
1039
+ validUntil?: string | undefined;
1040
+ access?: "none" | "read" | "write" | undefined;
1041
+ levels?: Record<string, "none" | "read" | "write" | "admin"> | undefined;
1042
+ userConsent?: boolean | undefined;
1043
+ consentScope?: string[] | undefined;
1044
+ consentHours?: {
1045
+ low?: number | undefined;
1046
+ medium?: number | undefined;
1047
+ high?: number | undefined;
1048
+ } | undefined;
1049
+ } | undefined;
1050
+ approveWhen?: Record<string, Condition> | undefined;
1051
+ limits?: Record<string, {
1052
+ perMinute?: number | undefined;
1053
+ perHour?: number | undefined;
1054
+ perDay?: number | undefined;
1055
+ total?: number | undefined;
1056
+ window?: {
1057
+ max: number;
1058
+ seconds: number;
1059
+ } | undefined;
1060
+ }> | undefined;
1061
+ sensitivity?: Record<string, "none" | "low" | "medium" | "high" | "critical"> | undefined;
1062
+ windows?: Record<string, {
1063
+ from?: string | undefined;
1064
+ until?: string | undefined;
1065
+ }> | undefined;
1066
+ approvers?: {
1067
+ stepUp?: {
1068
+ minSensitivity?: "none" | "low" | "medium" | "high" | "critical" | undefined;
1069
+ requireForSideEffects?: boolean | undefined;
1070
+ sideEffectsMinSensitivity?: "none" | "low" | "medium" | "high" | "critical" | undefined;
1071
+ } | undefined;
1072
+ emails?: string[] | undefined;
1073
+ reminderLeadMinutes?: number | null | undefined;
1074
+ } | undefined;
1075
+ }>;
1076
+ export declare const ShellActionHintsSchema: z.ZodObject<Pick<{
1077
+ id: z.ZodString;
1078
+ name: z.ZodString;
1079
+ description: z.ZodString;
1080
+ method: z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE"]>;
1081
+ path: z.ZodString;
1082
+ agentAccessible: z.ZodBoolean;
1083
+ sideEffects: z.ZodBoolean;
1084
+ sideEffectsReviewAck: z.ZodOptional<z.ZodString>;
1085
+ sensitivityLevel: z.ZodEnum<["none", "low", "medium", "high", "critical"]>;
1086
+ params: z.ZodDefault<z.ZodArray<z.ZodObject<{
1087
+ name: z.ZodString;
1088
+ type: z.ZodEnum<["string", "number", "boolean", "object", "array"]>;
1089
+ required: z.ZodBoolean;
1090
+ description: z.ZodOptional<z.ZodString>;
1091
+ schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1092
+ }, "strip", z.ZodTypeAny, {
1093
+ type: "string" | "number" | "boolean" | "object" | "array";
1094
+ name: string;
1095
+ required: boolean;
1096
+ description?: string | undefined;
1097
+ schema?: Record<string, unknown> | undefined;
1098
+ }, {
1099
+ type: "string" | "number" | "boolean" | "object" | "array";
1100
+ name: string;
1101
+ required: boolean;
1102
+ description?: string | undefined;
1103
+ schema?: Record<string, unknown> | undefined;
1104
+ }>, "many">>;
1105
+ responseSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1106
+ inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1107
+ requiresAuth: z.ZodBoolean;
1108
+ rateLimit: z.ZodOptional<z.ZodNumber>;
1109
+ searchHint: z.ZodOptional<z.ZodString>;
1110
+ alwaysInclude: z.ZodOptional<z.ZodBoolean>;
1111
+ interruptBehavior: z.ZodOptional<z.ZodEnum<["cancel", "block"]>>;
1112
+ updatedAt: z.ZodOptional<z.ZodString>;
1113
+ confidence: z.ZodOptional<z.ZodNumber>;
1114
+ evidence: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1115
+ validFrom: z.ZodOptional<z.ZodString>;
1116
+ validUntil: z.ZodOptional<z.ZodString>;
1117
+ approveIf: z.ZodOptional<z.ZodType<import("@duct-sdk/contracts").ApprovalPredicate, z.ZodTypeDef, import("@duct-sdk/contracts").ApprovalPredicate>>;
1118
+ actionLimit: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1119
+ type: z.ZodLiteral<"rate">;
1120
+ maxPerWindow: z.ZodNumber;
1121
+ windowSeconds: z.ZodNumber;
1122
+ }, "strip", z.ZodTypeAny, {
1123
+ type: "rate";
1124
+ maxPerWindow: number;
1125
+ windowSeconds: number;
1126
+ }, {
1127
+ type: "rate";
1128
+ maxPerWindow: number;
1129
+ windowSeconds: number;
1130
+ }>, z.ZodObject<{
1131
+ type: z.ZodLiteral<"count">;
1132
+ maxCount: z.ZodNumber;
1133
+ }, "strip", z.ZodTypeAny, {
1134
+ type: "count";
1135
+ maxCount: number;
1136
+ }, {
1137
+ type: "count";
1138
+ maxCount: number;
1139
+ }>]>>;
1140
+ dependsOn: z.ZodOptional<z.ZodArray<z.ZodObject<{
1141
+ actionId: z.ZodString;
1142
+ paramMapping: z.ZodRecord<z.ZodString, z.ZodString>;
1143
+ }, "strip", z.ZodTypeAny, {
1144
+ actionId: string;
1145
+ paramMapping: Record<string, string>;
1146
+ }, {
1147
+ actionId: string;
1148
+ paramMapping: Record<string, string>;
1149
+ }>, "many">>;
1150
+ semanticType: z.ZodOptional<z.ZodEnum<["list", "entity", "status", "comparison", "timeline", "search_results"]>>;
1151
+ outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1152
+ paramMappings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1153
+ navigatesTo: z.ZodOptional<z.ZodString>;
1154
+ }, "searchHint" | "alwaysInclude" | "interruptBehavior" | "dependsOn" | "semanticType" | "outputSchema" | "paramMappings" | "navigatesTo">, "strict", z.ZodTypeAny, {
1155
+ searchHint?: string | undefined;
1156
+ alwaysInclude?: boolean | undefined;
1157
+ interruptBehavior?: "cancel" | "block" | undefined;
1158
+ dependsOn?: {
1159
+ actionId: string;
1160
+ paramMapping: Record<string, string>;
1161
+ }[] | undefined;
1162
+ semanticType?: "list" | "entity" | "status" | "comparison" | "timeline" | "search_results" | undefined;
1163
+ outputSchema?: Record<string, unknown> | undefined;
1164
+ paramMappings?: Record<string, string> | undefined;
1165
+ navigatesTo?: string | undefined;
1166
+ }, {
1167
+ searchHint?: string | undefined;
1168
+ alwaysInclude?: boolean | undefined;
1169
+ interruptBehavior?: "cancel" | "block" | undefined;
1170
+ dependsOn?: {
1171
+ actionId: string;
1172
+ paramMapping: Record<string, string>;
1173
+ }[] | undefined;
1174
+ semanticType?: "list" | "entity" | "status" | "comparison" | "timeline" | "search_results" | undefined;
1175
+ outputSchema?: Record<string, unknown> | undefined;
1176
+ paramMappings?: Record<string, string> | undefined;
1177
+ navigatesTo?: string | undefined;
1178
+ }>;
1179
+ export declare const ShellFileSchema: z.ZodObject<{
1180
+ widget: z.ZodOptional<z.ZodObject<{
1181
+ primaryColor: z.ZodOptional<z.ZodString>;
1182
+ position: z.ZodOptional<z.ZodEnum<["bottom-right", "bottom-left", "top-right", "top-left"]>>;
1183
+ defaultOpen: z.ZodOptional<z.ZodBoolean>;
1184
+ launcherText: z.ZodOptional<z.ZodString>;
1185
+ welcomeMessage: z.ZodOptional<z.ZodString>;
1186
+ hideLauncher: z.ZodOptional<z.ZodBoolean>;
1187
+ preset: z.ZodOptional<z.ZodEnum<["tall", "square", "large"]>>;
1188
+ placeholder: z.ZodOptional<z.ZodString>;
1189
+ theme: z.ZodOptional<z.ZodEnum<["light", "dark", "system"]>>;
1190
+ width: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
1191
+ height: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
1192
+ customCSS: z.ZodOptional<z.ZodString>;
1193
+ compactionTurns: z.ZodOptional<z.ZodNumber>;
1194
+ maxToolIterations: z.ZodOptional<z.ZodNumber>;
1195
+ maxPlanSteps: z.ZodOptional<z.ZodNumber>;
1196
+ }, "strip", z.ZodTypeAny, {
1197
+ primaryColor?: string | undefined;
1198
+ position?: "bottom-right" | "bottom-left" | "top-right" | "top-left" | undefined;
1199
+ defaultOpen?: boolean | undefined;
1200
+ launcherText?: string | undefined;
1201
+ welcomeMessage?: string | undefined;
1202
+ hideLauncher?: boolean | undefined;
1203
+ preset?: "tall" | "square" | "large" | undefined;
1204
+ placeholder?: string | undefined;
1205
+ theme?: "light" | "dark" | "system" | undefined;
1206
+ width?: string | number | undefined;
1207
+ height?: string | number | undefined;
1208
+ customCSS?: string | undefined;
1209
+ compactionTurns?: number | undefined;
1210
+ maxToolIterations?: number | undefined;
1211
+ maxPlanSteps?: number | undefined;
1212
+ }, {
1213
+ primaryColor?: string | undefined;
1214
+ position?: "bottom-right" | "bottom-left" | "top-right" | "top-left" | undefined;
1215
+ defaultOpen?: boolean | undefined;
1216
+ launcherText?: string | undefined;
1217
+ welcomeMessage?: string | undefined;
1218
+ hideLauncher?: boolean | undefined;
1219
+ preset?: "tall" | "square" | "large" | undefined;
1220
+ placeholder?: string | undefined;
1221
+ theme?: "light" | "dark" | "system" | undefined;
1222
+ width?: string | number | undefined;
1223
+ height?: string | number | undefined;
1224
+ customCSS?: string | undefined;
1225
+ compactionTurns?: number | undefined;
1226
+ maxToolIterations?: number | undefined;
1227
+ maxPlanSteps?: number | undefined;
1228
+ }>>;
1229
+ routes: z.ZodDefault<z.ZodArray<z.ZodObject<{
1230
+ path: z.ZodString;
1231
+ name: z.ZodString;
1232
+ description: z.ZodString;
1233
+ params: z.ZodDefault<z.ZodArray<z.ZodObject<{
1234
+ name: z.ZodString;
1235
+ type: z.ZodEnum<["string", "number", "uuid", "slug"]>;
1236
+ required: z.ZodBoolean;
1237
+ description: z.ZodOptional<z.ZodString>;
1238
+ }, "strip", z.ZodTypeAny, {
1239
+ type: "string" | "number" | "uuid" | "slug";
1240
+ name: string;
1241
+ required: boolean;
1242
+ description?: string | undefined;
1243
+ }, {
1244
+ type: "string" | "number" | "uuid" | "slug";
1245
+ name: string;
1246
+ required: boolean;
1247
+ description?: string | undefined;
1248
+ }>, "many">>;
1249
+ queryParams: z.ZodDefault<z.ZodArray<z.ZodObject<{
1250
+ name: z.ZodString;
1251
+ type: z.ZodEnum<["string", "number", "boolean", "string[]"]>;
1252
+ required: z.ZodBoolean;
1253
+ description: z.ZodOptional<z.ZodString>;
1254
+ defaultValue: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
1255
+ }, "strip", z.ZodTypeAny, {
1256
+ type: "string" | "number" | "boolean" | "string[]";
1257
+ name: string;
1258
+ required: boolean;
1259
+ description?: string | undefined;
1260
+ defaultValue?: string | number | boolean | undefined;
1261
+ }, {
1262
+ type: "string" | "number" | "boolean" | "string[]";
1263
+ name: string;
1264
+ required: boolean;
1265
+ description?: string | undefined;
1266
+ defaultValue?: string | number | boolean | undefined;
1267
+ }>, "many">>;
1268
+ uiStateHint: z.ZodEnum<["form", "list", "detail", "dashboard", "modal", "wizard", "empty", "error", "auth", "checkout", "profile", "settings", "search"]>;
1269
+ requiresAuth: z.ZodBoolean;
1270
+ deeplinkable: z.ZodBoolean;
1271
+ methods: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1272
+ updatedAt: z.ZodOptional<z.ZodString>;
1273
+ confidence: z.ZodOptional<z.ZodNumber>;
1274
+ evidence: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1275
+ searchAction: z.ZodOptional<z.ZodObject<{
1276
+ actionId: z.ZodString;
1277
+ paramMap: z.ZodRecord<z.ZodString, z.ZodString>;
1278
+ }, "strip", z.ZodTypeAny, {
1279
+ actionId: string;
1280
+ paramMap: Record<string, string>;
1281
+ }, {
1282
+ actionId: string;
1283
+ paramMap: Record<string, string>;
1284
+ }>>;
1285
+ }, "strip", z.ZodTypeAny, {
1286
+ name: string;
1287
+ params: {
1288
+ type: "string" | "number" | "uuid" | "slug";
1289
+ name: string;
1290
+ required: boolean;
1291
+ description?: string | undefined;
1292
+ }[];
1293
+ path: string;
1294
+ description: string;
1295
+ queryParams: {
1296
+ type: "string" | "number" | "boolean" | "string[]";
1297
+ name: string;
1298
+ required: boolean;
1299
+ description?: string | undefined;
1300
+ defaultValue?: string | number | boolean | undefined;
1301
+ }[];
1302
+ uiStateHint: "form" | "list" | "detail" | "dashboard" | "modal" | "wizard" | "empty" | "error" | "auth" | "checkout" | "profile" | "settings" | "search";
1303
+ requiresAuth: boolean;
1304
+ deeplinkable: boolean;
1305
+ methods?: string[] | undefined;
1306
+ updatedAt?: string | undefined;
1307
+ confidence?: number | undefined;
1308
+ evidence?: string[] | undefined;
1309
+ searchAction?: {
1310
+ actionId: string;
1311
+ paramMap: Record<string, string>;
1312
+ } | undefined;
1313
+ }, {
1314
+ name: string;
1315
+ path: string;
1316
+ description: string;
1317
+ uiStateHint: "form" | "list" | "detail" | "dashboard" | "modal" | "wizard" | "empty" | "error" | "auth" | "checkout" | "profile" | "settings" | "search";
1318
+ requiresAuth: boolean;
1319
+ deeplinkable: boolean;
1320
+ params?: {
1321
+ type: "string" | "number" | "uuid" | "slug";
1322
+ name: string;
1323
+ required: boolean;
1324
+ description?: string | undefined;
1325
+ }[] | undefined;
1326
+ queryParams?: {
1327
+ type: "string" | "number" | "boolean" | "string[]";
1328
+ name: string;
1329
+ required: boolean;
1330
+ description?: string | undefined;
1331
+ defaultValue?: string | number | boolean | undefined;
1332
+ }[] | undefined;
1333
+ methods?: string[] | undefined;
1334
+ updatedAt?: string | undefined;
1335
+ confidence?: number | undefined;
1336
+ evidence?: string[] | undefined;
1337
+ searchAction?: {
1338
+ actionId: string;
1339
+ paramMap: Record<string, string>;
1340
+ } | undefined;
1341
+ }>, "many">>;
1342
+ deeplinks: z.ZodDefault<z.ZodArray<z.ZodObject<{
1343
+ id: z.ZodString;
1344
+ name: z.ZodString;
1345
+ description: z.ZodString;
1346
+ targetRoute: z.ZodString;
1347
+ stateFields: z.ZodDefault<z.ZodArray<z.ZodObject<{
1348
+ key: z.ZodString;
1349
+ type: z.ZodEnum<["string", "number", "boolean", "object"]>;
1350
+ required: z.ZodBoolean;
1351
+ description: z.ZodOptional<z.ZodString>;
1352
+ sessionSource: z.ZodOptional<z.ZodString>;
1353
+ }, "strip", z.ZodTypeAny, {
1354
+ type: "string" | "number" | "boolean" | "object";
1355
+ required: boolean;
1356
+ key: string;
1357
+ description?: string | undefined;
1358
+ sessionSource?: string | undefined;
1359
+ }, {
1360
+ type: "string" | "number" | "boolean" | "object";
1361
+ required: boolean;
1362
+ key: string;
1363
+ description?: string | undefined;
1364
+ sessionSource?: string | undefined;
1365
+ }>, "many">>;
1366
+ expirySeconds: z.ZodDefault<z.ZodNumber>;
1367
+ requiresAuth: z.ZodBoolean;
1368
+ openInNewTab: z.ZodOptional<z.ZodBoolean>;
1369
+ intent: z.ZodOptional<z.ZodString>;
1370
+ pageResolver: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
1371
+ actionId: z.ZodString;
1372
+ }, "strip", z.ZodTypeAny, {
1373
+ actionId: string;
1374
+ }, {
1375
+ actionId: string;
1376
+ }>, z.ZodObject<{
1377
+ endpoint: z.ZodString;
1378
+ }, "strip", z.ZodTypeAny, {
1379
+ endpoint: string;
1380
+ }, {
1381
+ endpoint: string;
1382
+ }>]>>;
1383
+ allowFetch: z.ZodOptional<z.ZodBoolean>;
1384
+ contentSelector: z.ZodOptional<z.ZodString>;
1385
+ updatedAt: z.ZodOptional<z.ZodString>;
1386
+ }, "strip", z.ZodTypeAny, {
1387
+ id: string;
1388
+ name: string;
1389
+ description: string;
1390
+ requiresAuth: boolean;
1391
+ targetRoute: string;
1392
+ stateFields: {
1393
+ type: "string" | "number" | "boolean" | "object";
1394
+ required: boolean;
1395
+ key: string;
1396
+ description?: string | undefined;
1397
+ sessionSource?: string | undefined;
1398
+ }[];
1399
+ expirySeconds: number;
1400
+ updatedAt?: string | undefined;
1401
+ openInNewTab?: boolean | undefined;
1402
+ intent?: string | undefined;
1403
+ pageResolver?: {
1404
+ actionId: string;
1405
+ } | {
1406
+ endpoint: string;
1407
+ } | undefined;
1408
+ allowFetch?: boolean | undefined;
1409
+ contentSelector?: string | undefined;
1410
+ }, {
1411
+ id: string;
1412
+ name: string;
1413
+ description: string;
1414
+ requiresAuth: boolean;
1415
+ targetRoute: string;
1416
+ updatedAt?: string | undefined;
1417
+ stateFields?: {
1418
+ type: "string" | "number" | "boolean" | "object";
1419
+ required: boolean;
1420
+ key: string;
1421
+ description?: string | undefined;
1422
+ sessionSource?: string | undefined;
1423
+ }[] | undefined;
1424
+ expirySeconds?: number | undefined;
1425
+ openInNewTab?: boolean | undefined;
1426
+ intent?: string | undefined;
1427
+ pageResolver?: {
1428
+ actionId: string;
1429
+ } | {
1430
+ endpoint: string;
1431
+ } | undefined;
1432
+ allowFetch?: boolean | undefined;
1433
+ contentSelector?: string | undefined;
1434
+ }>, "many">>;
1435
+ dataModel: z.ZodOptional<z.ZodObject<{
1436
+ entities: z.ZodArray<z.ZodObject<{
1437
+ id: z.ZodString;
1438
+ label: z.ZodString;
1439
+ discoveryAction: z.ZodString;
1440
+ fetchAction: z.ZodString;
1441
+ indexKey: z.ZodString;
1442
+ labelKey: z.ZodString;
1443
+ dimensions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1444
+ }, "strip", z.ZodTypeAny, {
1445
+ id: string;
1446
+ label: string;
1447
+ discoveryAction: string;
1448
+ fetchAction: string;
1449
+ indexKey: string;
1450
+ labelKey: string;
1451
+ dimensions?: string[] | undefined;
1452
+ }, {
1453
+ id: string;
1454
+ label: string;
1455
+ discoveryAction: string;
1456
+ fetchAction: string;
1457
+ indexKey: string;
1458
+ labelKey: string;
1459
+ dimensions?: string[] | undefined;
1460
+ }>, "many">;
1461
+ }, "strip", z.ZodTypeAny, {
1462
+ entities: {
1463
+ id: string;
1464
+ label: string;
1465
+ discoveryAction: string;
1466
+ fetchAction: string;
1467
+ indexKey: string;
1468
+ labelKey: string;
1469
+ dimensions?: string[] | undefined;
1470
+ }[];
1471
+ }, {
1472
+ entities: {
1473
+ id: string;
1474
+ label: string;
1475
+ discoveryAction: string;
1476
+ fetchAction: string;
1477
+ indexKey: string;
1478
+ labelKey: string;
1479
+ dimensions?: string[] | undefined;
1480
+ }[];
1481
+ }>>;
1482
+ /** Chat-only hints per action id: search hints, UI shape, chaining. */
1483
+ actionHints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodLazy<z.ZodObject<Pick<{
1484
+ id: z.ZodString;
1485
+ name: z.ZodString;
1486
+ description: z.ZodString;
1487
+ method: z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE"]>;
1488
+ path: z.ZodString;
1489
+ agentAccessible: z.ZodBoolean;
1490
+ sideEffects: z.ZodBoolean;
1491
+ sideEffectsReviewAck: z.ZodOptional<z.ZodString>;
1492
+ sensitivityLevel: z.ZodEnum<["none", "low", "medium", "high", "critical"]>;
1493
+ params: z.ZodDefault<z.ZodArray<z.ZodObject<{
1494
+ name: z.ZodString;
1495
+ type: z.ZodEnum<["string", "number", "boolean", "object", "array"]>;
1496
+ required: z.ZodBoolean;
1497
+ description: z.ZodOptional<z.ZodString>;
1498
+ schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1499
+ }, "strip", z.ZodTypeAny, {
1500
+ type: "string" | "number" | "boolean" | "object" | "array";
1501
+ name: string;
1502
+ required: boolean;
1503
+ description?: string | undefined;
1504
+ schema?: Record<string, unknown> | undefined;
1505
+ }, {
1506
+ type: "string" | "number" | "boolean" | "object" | "array";
1507
+ name: string;
1508
+ required: boolean;
1509
+ description?: string | undefined;
1510
+ schema?: Record<string, unknown> | undefined;
1511
+ }>, "many">>;
1512
+ responseSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1513
+ inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1514
+ requiresAuth: z.ZodBoolean;
1515
+ rateLimit: z.ZodOptional<z.ZodNumber>;
1516
+ searchHint: z.ZodOptional<z.ZodString>;
1517
+ alwaysInclude: z.ZodOptional<z.ZodBoolean>;
1518
+ interruptBehavior: z.ZodOptional<z.ZodEnum<["cancel", "block"]>>;
1519
+ updatedAt: z.ZodOptional<z.ZodString>;
1520
+ confidence: z.ZodOptional<z.ZodNumber>;
1521
+ evidence: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1522
+ validFrom: z.ZodOptional<z.ZodString>;
1523
+ validUntil: z.ZodOptional<z.ZodString>;
1524
+ approveIf: z.ZodOptional<z.ZodType<import("@duct-sdk/contracts").ApprovalPredicate, z.ZodTypeDef, import("@duct-sdk/contracts").ApprovalPredicate>>;
1525
+ actionLimit: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1526
+ type: z.ZodLiteral<"rate">;
1527
+ maxPerWindow: z.ZodNumber;
1528
+ windowSeconds: z.ZodNumber;
1529
+ }, "strip", z.ZodTypeAny, {
1530
+ type: "rate";
1531
+ maxPerWindow: number;
1532
+ windowSeconds: number;
1533
+ }, {
1534
+ type: "rate";
1535
+ maxPerWindow: number;
1536
+ windowSeconds: number;
1537
+ }>, z.ZodObject<{
1538
+ type: z.ZodLiteral<"count">;
1539
+ maxCount: z.ZodNumber;
1540
+ }, "strip", z.ZodTypeAny, {
1541
+ type: "count";
1542
+ maxCount: number;
1543
+ }, {
1544
+ type: "count";
1545
+ maxCount: number;
1546
+ }>]>>;
1547
+ dependsOn: z.ZodOptional<z.ZodArray<z.ZodObject<{
1548
+ actionId: z.ZodString;
1549
+ paramMapping: z.ZodRecord<z.ZodString, z.ZodString>;
1550
+ }, "strip", z.ZodTypeAny, {
1551
+ actionId: string;
1552
+ paramMapping: Record<string, string>;
1553
+ }, {
1554
+ actionId: string;
1555
+ paramMapping: Record<string, string>;
1556
+ }>, "many">>;
1557
+ semanticType: z.ZodOptional<z.ZodEnum<["list", "entity", "status", "comparison", "timeline", "search_results"]>>;
1558
+ outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1559
+ paramMappings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1560
+ navigatesTo: z.ZodOptional<z.ZodString>;
1561
+ }, "searchHint" | "alwaysInclude" | "interruptBehavior" | "dependsOn" | "semanticType" | "outputSchema" | "paramMappings" | "navigatesTo">, "strict", z.ZodTypeAny, {
1562
+ searchHint?: string | undefined;
1563
+ alwaysInclude?: boolean | undefined;
1564
+ interruptBehavior?: "cancel" | "block" | undefined;
1565
+ dependsOn?: {
1566
+ actionId: string;
1567
+ paramMapping: Record<string, string>;
1568
+ }[] | undefined;
1569
+ semanticType?: "list" | "entity" | "status" | "comparison" | "timeline" | "search_results" | undefined;
1570
+ outputSchema?: Record<string, unknown> | undefined;
1571
+ paramMappings?: Record<string, string> | undefined;
1572
+ navigatesTo?: string | undefined;
1573
+ }, {
1574
+ searchHint?: string | undefined;
1575
+ alwaysInclude?: boolean | undefined;
1576
+ interruptBehavior?: "cancel" | "block" | undefined;
1577
+ dependsOn?: {
1578
+ actionId: string;
1579
+ paramMapping: Record<string, string>;
1580
+ }[] | undefined;
1581
+ semanticType?: "list" | "entity" | "status" | "comparison" | "timeline" | "search_results" | undefined;
1582
+ outputSchema?: Record<string, unknown> | undefined;
1583
+ paramMappings?: Record<string, string> | undefined;
1584
+ navigatesTo?: string | undefined;
1585
+ }>>>>;
1586
+ }, "strict", z.ZodTypeAny, {
1587
+ routes: {
1588
+ name: string;
1589
+ params: {
1590
+ type: "string" | "number" | "uuid" | "slug";
1591
+ name: string;
1592
+ required: boolean;
1593
+ description?: string | undefined;
1594
+ }[];
1595
+ path: string;
1596
+ description: string;
1597
+ queryParams: {
1598
+ type: "string" | "number" | "boolean" | "string[]";
1599
+ name: string;
1600
+ required: boolean;
1601
+ description?: string | undefined;
1602
+ defaultValue?: string | number | boolean | undefined;
1603
+ }[];
1604
+ uiStateHint: "form" | "list" | "detail" | "dashboard" | "modal" | "wizard" | "empty" | "error" | "auth" | "checkout" | "profile" | "settings" | "search";
1605
+ requiresAuth: boolean;
1606
+ deeplinkable: boolean;
1607
+ methods?: string[] | undefined;
1608
+ updatedAt?: string | undefined;
1609
+ confidence?: number | undefined;
1610
+ evidence?: string[] | undefined;
1611
+ searchAction?: {
1612
+ actionId: string;
1613
+ paramMap: Record<string, string>;
1614
+ } | undefined;
1615
+ }[];
1616
+ deeplinks: {
1617
+ id: string;
1618
+ name: string;
1619
+ description: string;
1620
+ requiresAuth: boolean;
1621
+ targetRoute: string;
1622
+ stateFields: {
1623
+ type: "string" | "number" | "boolean" | "object";
1624
+ required: boolean;
1625
+ key: string;
1626
+ description?: string | undefined;
1627
+ sessionSource?: string | undefined;
1628
+ }[];
1629
+ expirySeconds: number;
1630
+ updatedAt?: string | undefined;
1631
+ openInNewTab?: boolean | undefined;
1632
+ intent?: string | undefined;
1633
+ pageResolver?: {
1634
+ actionId: string;
1635
+ } | {
1636
+ endpoint: string;
1637
+ } | undefined;
1638
+ allowFetch?: boolean | undefined;
1639
+ contentSelector?: string | undefined;
1640
+ }[];
1641
+ widget?: {
1642
+ primaryColor?: string | undefined;
1643
+ position?: "bottom-right" | "bottom-left" | "top-right" | "top-left" | undefined;
1644
+ defaultOpen?: boolean | undefined;
1645
+ launcherText?: string | undefined;
1646
+ welcomeMessage?: string | undefined;
1647
+ hideLauncher?: boolean | undefined;
1648
+ preset?: "tall" | "square" | "large" | undefined;
1649
+ placeholder?: string | undefined;
1650
+ theme?: "light" | "dark" | "system" | undefined;
1651
+ width?: string | number | undefined;
1652
+ height?: string | number | undefined;
1653
+ customCSS?: string | undefined;
1654
+ compactionTurns?: number | undefined;
1655
+ maxToolIterations?: number | undefined;
1656
+ maxPlanSteps?: number | undefined;
1657
+ } | undefined;
1658
+ dataModel?: {
1659
+ entities: {
1660
+ id: string;
1661
+ label: string;
1662
+ discoveryAction: string;
1663
+ fetchAction: string;
1664
+ indexKey: string;
1665
+ labelKey: string;
1666
+ dimensions?: string[] | undefined;
1667
+ }[];
1668
+ } | undefined;
1669
+ actionHints?: Record<string, {
1670
+ searchHint?: string | undefined;
1671
+ alwaysInclude?: boolean | undefined;
1672
+ interruptBehavior?: "cancel" | "block" | undefined;
1673
+ dependsOn?: {
1674
+ actionId: string;
1675
+ paramMapping: Record<string, string>;
1676
+ }[] | undefined;
1677
+ semanticType?: "list" | "entity" | "status" | "comparison" | "timeline" | "search_results" | undefined;
1678
+ outputSchema?: Record<string, unknown> | undefined;
1679
+ paramMappings?: Record<string, string> | undefined;
1680
+ navigatesTo?: string | undefined;
1681
+ }> | undefined;
1682
+ }, {
1683
+ routes?: {
1684
+ name: string;
1685
+ path: string;
1686
+ description: string;
1687
+ uiStateHint: "form" | "list" | "detail" | "dashboard" | "modal" | "wizard" | "empty" | "error" | "auth" | "checkout" | "profile" | "settings" | "search";
1688
+ requiresAuth: boolean;
1689
+ deeplinkable: boolean;
1690
+ params?: {
1691
+ type: "string" | "number" | "uuid" | "slug";
1692
+ name: string;
1693
+ required: boolean;
1694
+ description?: string | undefined;
1695
+ }[] | undefined;
1696
+ queryParams?: {
1697
+ type: "string" | "number" | "boolean" | "string[]";
1698
+ name: string;
1699
+ required: boolean;
1700
+ description?: string | undefined;
1701
+ defaultValue?: string | number | boolean | undefined;
1702
+ }[] | undefined;
1703
+ methods?: string[] | undefined;
1704
+ updatedAt?: string | undefined;
1705
+ confidence?: number | undefined;
1706
+ evidence?: string[] | undefined;
1707
+ searchAction?: {
1708
+ actionId: string;
1709
+ paramMap: Record<string, string>;
1710
+ } | undefined;
1711
+ }[] | undefined;
1712
+ deeplinks?: {
1713
+ id: string;
1714
+ name: string;
1715
+ description: string;
1716
+ requiresAuth: boolean;
1717
+ targetRoute: string;
1718
+ updatedAt?: string | undefined;
1719
+ stateFields?: {
1720
+ type: "string" | "number" | "boolean" | "object";
1721
+ required: boolean;
1722
+ key: string;
1723
+ description?: string | undefined;
1724
+ sessionSource?: string | undefined;
1725
+ }[] | undefined;
1726
+ expirySeconds?: number | undefined;
1727
+ openInNewTab?: boolean | undefined;
1728
+ intent?: string | undefined;
1729
+ pageResolver?: {
1730
+ actionId: string;
1731
+ } | {
1732
+ endpoint: string;
1733
+ } | undefined;
1734
+ allowFetch?: boolean | undefined;
1735
+ contentSelector?: string | undefined;
1736
+ }[] | undefined;
1737
+ widget?: {
1738
+ primaryColor?: string | undefined;
1739
+ position?: "bottom-right" | "bottom-left" | "top-right" | "top-left" | undefined;
1740
+ defaultOpen?: boolean | undefined;
1741
+ launcherText?: string | undefined;
1742
+ welcomeMessage?: string | undefined;
1743
+ hideLauncher?: boolean | undefined;
1744
+ preset?: "tall" | "square" | "large" | undefined;
1745
+ placeholder?: string | undefined;
1746
+ theme?: "light" | "dark" | "system" | undefined;
1747
+ width?: string | number | undefined;
1748
+ height?: string | number | undefined;
1749
+ customCSS?: string | undefined;
1750
+ compactionTurns?: number | undefined;
1751
+ maxToolIterations?: number | undefined;
1752
+ maxPlanSteps?: number | undefined;
1753
+ } | undefined;
1754
+ dataModel?: {
1755
+ entities: {
1756
+ id: string;
1757
+ label: string;
1758
+ discoveryAction: string;
1759
+ fetchAction: string;
1760
+ indexKey: string;
1761
+ labelKey: string;
1762
+ dimensions?: string[] | undefined;
1763
+ }[];
1764
+ } | undefined;
1765
+ actionHints?: Record<string, {
1766
+ searchHint?: string | undefined;
1767
+ alwaysInclude?: boolean | undefined;
1768
+ interruptBehavior?: "cancel" | "block" | undefined;
1769
+ dependsOn?: {
1770
+ actionId: string;
1771
+ paramMapping: Record<string, string>;
1772
+ }[] | undefined;
1773
+ semanticType?: "list" | "entity" | "status" | "comparison" | "timeline" | "search_results" | undefined;
1774
+ outputSchema?: Record<string, unknown> | undefined;
1775
+ paramMappings?: Record<string, string> | undefined;
1776
+ navigatesTo?: string | undefined;
1777
+ }> | undefined;
1778
+ }>;
1779
+ export declare const PolicyExpectationSchema: z.ZodEnum<["allow", "deny", "approval", "blocked"]>;
1780
+ export declare const PolicyTestCaseSchema: z.ZodObject<{
1781
+ name: z.ZodOptional<z.ZodString>;
1782
+ /** Who is calling: an external agent, a signed-in user in the shell, or a guest. */
1783
+ as: z.ZodEnum<["agent", "user", "guest"]>;
1784
+ action: z.ZodString;
1785
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1786
+ withUserConsent: z.ZodOptional<z.ZodBoolean>;
1787
+ /** `blocked` = must not run without a human (deny or approval). */
1788
+ expect: z.ZodEnum<["allow", "deny", "approval", "blocked"]>;
1789
+ }, "strict", z.ZodTypeAny, {
1790
+ action: string;
1791
+ as: "agent" | "user" | "guest";
1792
+ expect: "allow" | "deny" | "approval" | "blocked";
1793
+ name?: string | undefined;
1794
+ params?: Record<string, unknown> | undefined;
1795
+ withUserConsent?: boolean | undefined;
1796
+ }, {
1797
+ action: string;
1798
+ as: "agent" | "user" | "guest";
1799
+ expect: "allow" | "deny" | "approval" | "blocked";
1800
+ name?: string | undefined;
1801
+ params?: Record<string, unknown> | undefined;
1802
+ withUserConsent?: boolean | undefined;
1803
+ }>;
1804
+ export declare const TestsFileSchema: z.ZodObject<{
1805
+ policy: z.ZodDefault<z.ZodArray<z.ZodObject<{
1806
+ name: z.ZodOptional<z.ZodString>;
1807
+ /** Who is calling: an external agent, a signed-in user in the shell, or a guest. */
1808
+ as: z.ZodEnum<["agent", "user", "guest"]>;
1809
+ action: z.ZodString;
1810
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1811
+ withUserConsent: z.ZodOptional<z.ZodBoolean>;
1812
+ /** `blocked` = must not run without a human (deny or approval). */
1813
+ expect: z.ZodEnum<["allow", "deny", "approval", "blocked"]>;
1814
+ }, "strict", z.ZodTypeAny, {
1815
+ action: string;
1816
+ as: "agent" | "user" | "guest";
1817
+ expect: "allow" | "deny" | "approval" | "blocked";
1818
+ name?: string | undefined;
1819
+ params?: Record<string, unknown> | undefined;
1820
+ withUserConsent?: boolean | undefined;
1821
+ }, {
1822
+ action: string;
1823
+ as: "agent" | "user" | "guest";
1824
+ expect: "allow" | "deny" | "approval" | "blocked";
1825
+ name?: string | undefined;
1826
+ params?: Record<string, unknown> | undefined;
1827
+ withUserConsent?: boolean | undefined;
1828
+ }>, "many">>;
1829
+ }, "strict", z.ZodTypeAny, {
1830
+ policy: {
1831
+ action: string;
1832
+ as: "agent" | "user" | "guest";
1833
+ expect: "allow" | "deny" | "approval" | "blocked";
1834
+ name?: string | undefined;
1835
+ params?: Record<string, unknown> | undefined;
1836
+ withUserConsent?: boolean | undefined;
1837
+ }[];
1838
+ }, {
1839
+ policy?: {
1840
+ action: string;
1841
+ as: "agent" | "user" | "guest";
1842
+ expect: "allow" | "deny" | "approval" | "blocked";
1843
+ name?: string | undefined;
1844
+ params?: Record<string, unknown> | undefined;
1845
+ withUserConsent?: boolean | undefined;
1846
+ }[] | undefined;
1847
+ }>;
1848
+ export type ProjectFile = z.input<typeof ProjectFileSchema>;
1849
+ export type CapabilitiesFile = z.input<typeof CapabilitiesFileSchema>;
1850
+ export type CapabilityAction = z.output<typeof CapabilityActionSchema>;
1851
+ export type PolicyFile = z.input<typeof PolicyFileSchema>;
1852
+ export type ShellFile = z.input<typeof ShellFileSchema>;
1853
+ export type TestsFile = z.input<typeof TestsFileSchema>;
1854
+ export type PolicyTestCase = z.output<typeof PolicyTestCaseSchema>;
1855
+ export type PolicyExpectation = z.infer<typeof PolicyExpectationSchema>;
1856
+ export type ParsedProjectFile = z.output<typeof ProjectFileSchema>;
1857
+ export type ParsedCapabilitiesFile = z.output<typeof CapabilitiesFileSchema>;
1858
+ export type ParsedPolicyFile = z.output<typeof PolicyFileSchema>;
1859
+ export type ParsedShellFile = z.output<typeof ShellFileSchema>;
1860
+ export type ParsedTestsFile = z.output<typeof TestsFileSchema>;
1861
+ export declare function defineProject(project: ProjectFile): ProjectFile;
1862
+ export declare function definePolicy(policy: PolicyFile): PolicyFile;
1863
+ export declare function defineShell(shell: ShellFile): ShellFile;
1864
+ export declare function defineTests(tests: TestsFile): TestsFile;