@fragno-dev/backoffice-api 0.0.0-stage → 0.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 (135) hide show
  1. package/LICENSE.md +16 -0
  2. package/README.md +90 -2
  3. package/dist/api.d.ts +35 -0
  4. package/dist/api.d.ts.map +1 -0
  5. package/dist/api.js +10 -0
  6. package/dist/api.js.map +1 -0
  7. package/dist/errors.d.ts +45 -0
  8. package/dist/errors.d.ts.map +1 -0
  9. package/dist/errors.js +35 -0
  10. package/dist/errors.js.map +1 -0
  11. package/dist/openapi.d.ts +46 -0
  12. package/dist/openapi.d.ts.map +1 -0
  13. package/dist/openapi.js +205 -0
  14. package/dist/openapi.js.map +1 -0
  15. package/dist/v0/account.d.ts +171 -0
  16. package/dist/v0/account.d.ts.map +1 -0
  17. package/dist/v0/account.js +78 -0
  18. package/dist/v0/account.js.map +1 -0
  19. package/dist/v0/api.d.ts +3437 -0
  20. package/dist/v0/api.d.ts.map +1 -0
  21. package/dist/v0/api.js +52 -0
  22. package/dist/v0/api.js.map +1 -0
  23. package/dist/v0/app-actions.d.ts +105 -0
  24. package/dist/v0/app-actions.d.ts.map +1 -0
  25. package/dist/v0/app-actions.js +100 -0
  26. package/dist/v0/app-actions.js.map +1 -0
  27. package/dist/v0/apps.d.ts +417 -0
  28. package/dist/v0/apps.d.ts.map +1 -0
  29. package/dist/v0/apps.js +163 -0
  30. package/dist/v0/apps.js.map +1 -0
  31. package/dist/v0/automation.d.ts +730 -0
  32. package/dist/v0/automation.d.ts.map +1 -0
  33. package/dist/v0/automation.js +355 -0
  34. package/dist/v0/automation.js.map +1 -0
  35. package/dist/v0/capabilities.d.ts +97 -0
  36. package/dist/v0/capabilities.d.ts.map +1 -0
  37. package/dist/v0/capabilities.js +41 -0
  38. package/dist/v0/capabilities.js.map +1 -0
  39. package/dist/v0/client.d.ts +39 -0
  40. package/dist/v0/client.d.ts.map +1 -0
  41. package/dist/v0/client.js +61 -0
  42. package/dist/v0/client.js.map +1 -0
  43. package/dist/v0/events.d.ts +789 -0
  44. package/dist/v0/events.d.ts.map +1 -0
  45. package/dist/v0/events.js +153 -0
  46. package/dist/v0/events.js.map +1 -0
  47. package/dist/v0/forms.d.ts +172 -0
  48. package/dist/v0/forms.d.ts.map +1 -0
  49. package/dist/v0/forms.js +88 -0
  50. package/dist/v0/forms.js.map +1 -0
  51. package/dist/v0/hooks.d.ts +61 -0
  52. package/dist/v0/hooks.d.ts.map +1 -0
  53. package/dist/v0/hooks.js +49 -0
  54. package/dist/v0/hooks.js.map +1 -0
  55. package/dist/v0/identity.d.ts +73 -0
  56. package/dist/v0/identity.d.ts.map +1 -0
  57. package/dist/v0/identity.js +46 -0
  58. package/dist/v0/identity.js.map +1 -0
  59. package/dist/v0/integrations.d.ts +847 -0
  60. package/dist/v0/integrations.d.ts.map +1 -0
  61. package/dist/v0/integrations.js +255 -0
  62. package/dist/v0/integrations.js.map +1 -0
  63. package/dist/v0/javascript.d.ts +160 -0
  64. package/dist/v0/javascript.d.ts.map +1 -0
  65. package/dist/v0/javascript.js +123 -0
  66. package/dist/v0/javascript.js.map +1 -0
  67. package/dist/v0/marketplace.d.ts +825 -0
  68. package/dist/v0/marketplace.d.ts.map +1 -0
  69. package/dist/v0/marketplace.js +284 -0
  70. package/dist/v0/marketplace.js.map +1 -0
  71. package/dist/v0/organization.d.ts +182 -0
  72. package/dist/v0/organization.d.ts.map +1 -0
  73. package/dist/v0/organization.js +88 -0
  74. package/dist/v0/organization.js.map +1 -0
  75. package/dist/v0/otp.d.ts +37 -0
  76. package/dist/v0/otp.d.ts.map +1 -0
  77. package/dist/v0/otp.js +29 -0
  78. package/dist/v0/otp.js.map +1 -0
  79. package/dist/v0/pi.d.ts +322 -0
  80. package/dist/v0/pi.d.ts.map +1 -0
  81. package/dist/v0/pi.js +146 -0
  82. package/dist/v0/pi.js.map +1 -0
  83. package/dist/v0/sandbox.d.ts +173 -0
  84. package/dist/v0/sandbox.d.ts.map +1 -0
  85. package/dist/v0/sandbox.js +97 -0
  86. package/dist/v0/sandbox.js.map +1 -0
  87. package/dist/v0/shared/bytes.d.ts +12 -0
  88. package/dist/v0/shared/bytes.d.ts.map +1 -0
  89. package/dist/v0/shared/bytes.js +16 -0
  90. package/dist/v0/shared/bytes.js.map +1 -0
  91. package/dist/v0/shared/datetime.d.ts +10 -0
  92. package/dist/v0/shared/datetime.d.ts.map +1 -0
  93. package/dist/v0/shared/datetime.js +14 -0
  94. package/dist/v0/shared/datetime.js.map +1 -0
  95. package/dist/v0/shared/json.d.ts +9 -0
  96. package/dist/v0/shared/json.d.ts.map +1 -0
  97. package/dist/v0/shared/json.js +14 -0
  98. package/dist/v0/shared/json.js.map +1 -0
  99. package/dist/v0/shared/pagination.d.ts +11 -0
  100. package/dist/v0/shared/pagination.d.ts.map +1 -0
  101. package/dist/v0/shared/pagination.js +11 -0
  102. package/dist/v0/shared/pagination.js.map +1 -0
  103. package/dist/v0/shared/permissions.d.ts +279 -0
  104. package/dist/v0/shared/permissions.d.ts.map +1 -0
  105. package/dist/v0/shared/permissions.js +285 -0
  106. package/dist/v0/shared/permissions.js.map +1 -0
  107. package/dist/v0/shared/pi-agent-name.d.ts +10 -0
  108. package/dist/v0/shared/pi-agent-name.d.ts.map +1 -0
  109. package/dist/v0/shared/pi-agent-name.js +11 -0
  110. package/dist/v0/shared/pi-agent-name.js.map +1 -0
  111. package/dist/v0/shared/scope.d.ts +305 -0
  112. package/dist/v0/shared/scope.d.ts.map +1 -0
  113. package/dist/v0/shared/scope.js +279 -0
  114. package/dist/v0/shared/scope.js.map +1 -0
  115. package/dist/v0/state.d.ts +512 -0
  116. package/dist/v0/state.d.ts.map +1 -0
  117. package/dist/v0/state.js +267 -0
  118. package/dist/v0/state.js.map +1 -0
  119. package/dist/v0/store.d.ts +138 -0
  120. package/dist/v0/store.d.ts.map +1 -0
  121. package/dist/v0/store.js +83 -0
  122. package/dist/v0/store.js.map +1 -0
  123. package/dist/v0/upload.d.ts +568 -0
  124. package/dist/v0/upload.d.ts.map +1 -0
  125. package/dist/v0/upload.js +109 -0
  126. package/dist/v0/upload.js.map +1 -0
  127. package/dist/v0/web.d.ts +47 -0
  128. package/dist/v0/web.d.ts.map +1 -0
  129. package/dist/v0/web.js +31 -0
  130. package/dist/v0/web.js.map +1 -0
  131. package/dist/v0/workflow.d.ts +267 -0
  132. package/dist/v0/workflow.d.ts.map +1 -0
  133. package/dist/v0/workflow.js +116 -0
  134. package/dist/v0/workflow.js.map +1 -0
  135. package/package.json +64 -3
@@ -0,0 +1,730 @@
1
+ import { BackofficePermissionRequirement } from "./shared/permissions.js";
2
+ import { z } from "zod";
3
+ //#region src/v0/automation.d.ts
4
+ type AutomationExternalEntityRef<TSource extends string = string, TType extends string = string> = {
5
+ scope: "external";
6
+ source: TSource;
7
+ type: TType;
8
+ id: string;
9
+ };
10
+ type AutomationEntityRef<TType extends string = string> = {
11
+ scope: "internal";
12
+ type: TType;
13
+ id: string;
14
+ } | AutomationExternalEntityRef<string, TType>;
15
+ type AutomationActorRole = "initiator" | "principal" | "delegate" | "assistant";
16
+ type AutomationActor<TRole extends AutomationActorRole = AutomationActorRole> = AutomationEntityRef & {
17
+ role: TRole;
18
+ };
19
+ type AutomationActors = Readonly<{
20
+ initiator: AutomationActor<"initiator">;
21
+ principal: AutomationActor<"principal"> | null;
22
+ delegation: readonly (AutomationActor<"delegate"> | AutomationActor<"assistant">)[];
23
+ }>;
24
+ declare const automationEntityRefsEqual: (left: AutomationEntityRef, right: AutomationEntityRef) => boolean;
25
+ declare const automationDelegatedActorSchema: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
26
+ scope: z.ZodLiteral<"internal">;
27
+ type: z.ZodString;
28
+ id: z.ZodString;
29
+ role: z.ZodLiteral<"delegate">;
30
+ }, z.core.$strict>, z.ZodObject<{
31
+ scope: z.ZodLiteral<"external">;
32
+ source: z.ZodString;
33
+ type: z.ZodString;
34
+ id: z.ZodString;
35
+ role: z.ZodLiteral<"delegate">;
36
+ }, z.core.$strict>], "scope">>, z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
37
+ scope: z.ZodLiteral<"internal">;
38
+ type: z.ZodString;
39
+ id: z.ZodString;
40
+ role: z.ZodLiteral<"assistant">;
41
+ }, z.core.$strict>, z.ZodObject<{
42
+ scope: z.ZodLiteral<"external">;
43
+ source: z.ZodString;
44
+ type: z.ZodString;
45
+ id: z.ZodString;
46
+ role: z.ZodLiteral<"assistant">;
47
+ }, z.core.$strict>], "scope">>], "role">>;
48
+ declare const automationActorsSchema: z.ZodType<AutomationActors>;
49
+ /**
50
+ * Explicit grants narrow the user's authority. `inherit` leaves the user's current permissions
51
+ * unrestricted by the route delegate.
52
+ */
53
+ type AutomationUserRouteGrants = readonly BackofficePermissionRequirement[] | "inherit";
54
+ /**
55
+ * Selects whose current permissions authorize protected work started by an automation route.
56
+ *
57
+ * A delegate is an additional capability boundary, not an impersonated principal. The kernel
58
+ * requires both the principal and every delegate to grant an operation, so delegation can narrow
59
+ * authority but can never give the principal permissions they do not already have.
60
+ */
61
+ type AutomationAuthorityMode = {
62
+ /**
63
+ * Run on behalf of the internal user principal carried by the triggering event.
64
+ *
65
+ * The user remains the principal and the stable route automation identity is appended as a
66
+ * delegate. For each protected operation, the authority resolver looks up the user's current
67
+ * role, status, and organization membership, then resolves the internal automation delegate
68
+ * from the owning route's current grants. The kernel requires both resulting grant sets to
69
+ * contain the operation. Missing, disabled, or changed routes and missing, invalid, banned,
70
+ * or no-longer-authorized users therefore fail closed. The delegate can restrict but never
71
+ * elevate the user.
72
+ */
73
+ kind: "delegated-user";
74
+ grants: AutomationUserRouteGrants;
75
+ } | {
76
+ /**
77
+ * Resolve the external initiator's active identity binding before starting the workflow.
78
+ *
79
+ * The linked internal user becomes the principal and the stable route automation identity is
80
+ * appended as a delegate. Events without an active binding do not start the workflow.
81
+ */
82
+ kind: "linked-user";
83
+ grants: AutomationUserRouteGrants;
84
+ } | {
85
+ /**
86
+ * Run as an organization-owned automation independently of the triggering user's authority.
87
+ *
88
+ * The stable `automation-route:<routeId>` identity becomes the principal while the original
89
+ * initiator remains provenance and supplies no authority. For each protected operation, the
90
+ * authority resolver reads the owning route's current grants. The stable route ID provides
91
+ * identity for persistence and auditing while making grant changes and route disablement
92
+ * visible to already-running workflows. The route can therefore continue after its creator or
93
+ * triggering user loses organization access, while remaining limited to its current explicit
94
+ * grants.
95
+ */
96
+ kind: "organization-automation";
97
+ grants: readonly BackofficePermissionRequirement[];
98
+ };
99
+ declare const automationScheduleCadenceSchema: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
100
+ kind: z.ZodLiteral<"once">;
101
+ at: z.ZodISODateTime;
102
+ }, z.core.$strip>, z.ZodObject<{
103
+ kind: z.ZodLiteral<"cron">;
104
+ expression: z.ZodString;
105
+ timeZone: z.ZodDefault<z.ZodString>;
106
+ }, z.core.$strip>], "kind">>;
107
+ type AutomationScheduleCadence = z.infer<typeof automationScheduleCadenceSchema>;
108
+ type AutomationActorIdentityMatcher = {
109
+ scope: "internal";
110
+ source?: never;
111
+ type?: string;
112
+ id?: string;
113
+ } | {
114
+ scope: "external";
115
+ source?: string;
116
+ type?: string;
117
+ id?: string;
118
+ };
119
+ type AutomationActorMatcher = (AutomationActorIdentityMatcher & {
120
+ participation: "initiator";
121
+ }) | (AutomationActorIdentityMatcher & {
122
+ participation: "principal";
123
+ }) | (AutomationActorIdentityMatcher & {
124
+ participation: "delegation";
125
+ role?: Extract<AutomationActorRole, "delegate" | "assistant">;
126
+ });
127
+ type AutomationEventMatcher = {
128
+ actor: AutomationActorMatcher;
129
+ } | {
130
+ path: string;
131
+ op: "exists";
132
+ } | {
133
+ path: string;
134
+ op: "eq" | "neq" | "startsWith" | "includes";
135
+ value: unknown;
136
+ } | {
137
+ all: AutomationEventMatcher[];
138
+ } | {
139
+ any: AutomationEventMatcher[];
140
+ } | {
141
+ not: AutomationEventMatcher;
142
+ };
143
+ type AutomationRouteRootOwnerTemplate = {
144
+ kind: "org";
145
+ orgIdTemplate: string;
146
+ } | {
147
+ kind: "user";
148
+ userIdTemplate: string;
149
+ };
150
+ type AutomationRouteAppScopeTemplate = {
151
+ kind: "app";
152
+ owner: AutomationRouteRootOwnerTemplate;
153
+ appIdTemplate: string;
154
+ };
155
+ /** Renders to a target scope; app and project scopes name their owner as a scope template too. */
156
+ type AutomationRouteScopeTemplate = {
157
+ kind: "system";
158
+ } | AutomationRouteRootOwnerTemplate | AutomationRouteAppScopeTemplate | {
159
+ kind: "project";
160
+ owner: AutomationRouteRootOwnerTemplate | AutomationRouteAppScopeTemplate;
161
+ projectIdTemplate: string;
162
+ };
163
+ type AutomationStartWorkflowAction = {
164
+ kind: "start_workflow";
165
+ authority: AutomationAuthorityMode;
166
+ workflowScriptPath: string;
167
+ instanceIdTemplate: string;
168
+ };
169
+ type AutomationWorkflowEventTarget = {
170
+ kind: "instance_id";
171
+ template: string;
172
+ } | {
173
+ kind: "stored_instance_id";
174
+ keyTemplate: string;
175
+ };
176
+ type AutomationSendWorkflowEventAction = {
177
+ kind: "send_workflow_event";
178
+ target: AutomationWorkflowEventTarget;
179
+ eventType: string;
180
+ payload?: unknown;
181
+ };
182
+ type AutomationForwardEventAction = {
183
+ kind: "forward_event";
184
+ targetScope: AutomationRouteScopeTemplate;
185
+ idTemplate?: string;
186
+ };
187
+ type AutomationEventPayloadProjection = {
188
+ kind: "projection";
189
+ fields: Record<string, string>;
190
+ };
191
+ type AutomationReclassifyEventAction = {
192
+ kind: "reclassify_event";
193
+ source: string;
194
+ eventType: string;
195
+ payload: AutomationEventPayloadProjection;
196
+ };
197
+ /** Delivers the event to an agent in the route's scope as a turn run with the route's authority. */
198
+ type AutomationNotifyAgentAction = {
199
+ kind: "notify_agent";
200
+ agentName: string;
201
+ authority: AutomationAuthorityMode;
202
+ };
203
+ type AutomationRouteAction = AutomationStartWorkflowAction | AutomationSendWorkflowEventAction | AutomationForwardEventAction | AutomationReclassifyEventAction | AutomationNotifyAgentAction;
204
+ /** The authority an action runs its work with, or null for actions that only move events. */
205
+ declare function automationRouteActionAuthority(action: AutomationRouteAction): AutomationAuthorityMode | null;
206
+ type AutomationRouteEventTrigger = {
207
+ kind: "event";
208
+ source: string;
209
+ eventType: string;
210
+ matcher: AutomationEventMatcher | null;
211
+ };
212
+ type AutomationRouteScheduleTrigger = {
213
+ kind: "schedule";
214
+ cadence: AutomationScheduleCadence;
215
+ };
216
+ type AutomationRouteTrigger = AutomationRouteEventTrigger | AutomationRouteScheduleTrigger;
217
+ type AutomationRouteManagedBy = {
218
+ kind: "marketplace";
219
+ listingId: string;
220
+ resourceKey: string;
221
+ version: string;
222
+ };
223
+ type AutomationRouteMetadata = {
224
+ createdByActors: AutomationActors;
225
+ updatedByActors: AutomationActors;
226
+ managedBy: AutomationRouteManagedBy | null;
227
+ };
228
+ /** Persisted routes may predate the authority rules enforced on create and activation. */
229
+ type AutomationRouteDefinition = {
230
+ trigger: AutomationRouteTrigger;
231
+ action: AutomationRouteAction;
232
+ id: string;
233
+ name: string;
234
+ enabled: boolean;
235
+ priority: number;
236
+ description?: string | null;
237
+ metadata?: AutomationRouteMetadata | null;
238
+ nextOccurrenceAt: string | null;
239
+ };
240
+ declare const isAutomationActorProvenancePath: (path: string) => boolean;
241
+ /** Scheduled routes have no triggering user, so only organization authority can start workflows. */
242
+ declare const AUTOMATION_ROUTE_AUTHORITY_ERROR_MESSAGE = "Scheduled workflows and agent notifications require organization-automation authority. Linked-user authority requires an external sender; delegated-user authority requires a user principal.";
243
+ declare const automationRouteActionSchema: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
244
+ kind: z.ZodLiteral<"start_workflow">;
245
+ authority: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
246
+ kind: z.ZodLiteral<"delegated-user">;
247
+ grants: z.ZodUnion<readonly [z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>, z.ZodLiteral<"inherit">]>;
248
+ }, z.core.$strict>, z.ZodObject<{
249
+ kind: z.ZodLiteral<"linked-user">;
250
+ grants: z.ZodUnion<readonly [z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>, z.ZodLiteral<"inherit">]>;
251
+ }, z.core.$strict>, z.ZodLazy<z.ZodObject<{
252
+ kind: z.ZodLiteral<"organization-automation">;
253
+ grants: z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>;
254
+ }, z.core.$strict>>], "kind">>;
255
+ workflowScriptPath: z.ZodString;
256
+ instanceIdTemplate: z.ZodString;
257
+ }, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
258
+ kind: z.ZodLiteral<"send_workflow_event">;
259
+ target: z.ZodType<AutomationWorkflowEventTarget, unknown, z.core.$ZodTypeInternals<AutomationWorkflowEventTarget, unknown>>;
260
+ eventType: z.ZodString;
261
+ payload: z.ZodOptional<z.ZodUnknown>;
262
+ }, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
263
+ kind: z.ZodLiteral<"forward_event">;
264
+ targetScope: z.ZodType<AutomationRouteScopeTemplate, unknown, z.core.$ZodTypeInternals<AutomationRouteScopeTemplate, unknown>>;
265
+ idTemplate: z.ZodOptional<z.ZodString>;
266
+ }, z.core.$strip>>, z.ZodLazy<z.ZodObject<{
267
+ kind: z.ZodLiteral<"reclassify_event">;
268
+ source: z.ZodString;
269
+ eventType: z.ZodString;
270
+ payload: z.ZodLazy<z.ZodObject<{
271
+ kind: z.ZodLiteral<"projection">;
272
+ fields: z.ZodRecord<z.ZodString, z.ZodString>;
273
+ }, z.core.$strict>>;
274
+ }, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
275
+ kind: z.ZodLiteral<"notify_agent">;
276
+ agentName: z.ZodLazy<z.ZodString>;
277
+ authority: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
278
+ kind: z.ZodLiteral<"delegated-user">;
279
+ grants: z.ZodUnion<readonly [z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>, z.ZodLiteral<"inherit">]>;
280
+ }, z.core.$strict>, z.ZodObject<{
281
+ kind: z.ZodLiteral<"linked-user">;
282
+ grants: z.ZodUnion<readonly [z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>, z.ZodLiteral<"inherit">]>;
283
+ }, z.core.$strict>, z.ZodLazy<z.ZodObject<{
284
+ kind: z.ZodLiteral<"organization-automation">;
285
+ grants: z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>;
286
+ }, z.core.$strict>>], "kind">>;
287
+ }, z.core.$strict>>], "kind">>;
288
+ declare const automationRouteManagedBySchema: z.ZodType<AutomationRouteManagedBy>;
289
+ declare const automationRouteSchema: z.ZodType<AutomationRouteDefinition>;
290
+ declare const automationRouteCreateInputSchema: z.ZodLazy<z.ZodIntersection<z.ZodObject<{
291
+ id: z.ZodString;
292
+ name: z.ZodString;
293
+ enabled: z.ZodDefault<z.ZodBoolean>;
294
+ priority: z.ZodDefault<z.ZodNumber>;
295
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
296
+ managedBy: z.ZodOptional<z.ZodNullable<z.ZodType<AutomationRouteManagedBy, unknown, z.core.$ZodTypeInternals<AutomationRouteManagedBy, unknown>>>>;
297
+ }, z.core.$strip>, z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
298
+ trigger: z.ZodLazy<z.ZodObject<{
299
+ kind: z.ZodLiteral<"event">;
300
+ source: z.ZodString;
301
+ eventType: z.ZodString;
302
+ matcher: z.ZodDefault<z.ZodNullable<z.ZodType<AutomationEventMatcher, unknown, z.core.$ZodTypeInternals<AutomationEventMatcher, unknown>>>>;
303
+ }, z.core.$strip>>;
304
+ action: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
305
+ kind: z.ZodLiteral<"start_workflow">;
306
+ authority: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
307
+ kind: z.ZodLiteral<"delegated-user">;
308
+ grants: z.ZodUnion<readonly [z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>, z.ZodLiteral<"inherit">]>;
309
+ }, z.core.$strict>, z.ZodObject<{
310
+ kind: z.ZodLiteral<"linked-user">;
311
+ grants: z.ZodUnion<readonly [z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>, z.ZodLiteral<"inherit">]>;
312
+ }, z.core.$strict>, z.ZodLazy<z.ZodObject<{
313
+ kind: z.ZodLiteral<"organization-automation">;
314
+ grants: z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>;
315
+ }, z.core.$strict>>], "kind">>;
316
+ workflowScriptPath: z.ZodString;
317
+ instanceIdTemplate: z.ZodString;
318
+ }, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
319
+ kind: z.ZodLiteral<"send_workflow_event">;
320
+ target: z.ZodType<AutomationWorkflowEventTarget, unknown, z.core.$ZodTypeInternals<AutomationWorkflowEventTarget, unknown>>;
321
+ eventType: z.ZodString;
322
+ payload: z.ZodOptional<z.ZodUnknown>;
323
+ }, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
324
+ kind: z.ZodLiteral<"forward_event">;
325
+ targetScope: z.ZodType<AutomationRouteScopeTemplate, unknown, z.core.$ZodTypeInternals<AutomationRouteScopeTemplate, unknown>>;
326
+ idTemplate: z.ZodOptional<z.ZodString>;
327
+ }, z.core.$strip>>, z.ZodLazy<z.ZodObject<{
328
+ kind: z.ZodLiteral<"reclassify_event">;
329
+ source: z.ZodString;
330
+ eventType: z.ZodString;
331
+ payload: z.ZodLazy<z.ZodObject<{
332
+ kind: z.ZodLiteral<"projection">;
333
+ fields: z.ZodRecord<z.ZodString, z.ZodString>;
334
+ }, z.core.$strict>>;
335
+ }, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
336
+ kind: z.ZodLiteral<"notify_agent">;
337
+ agentName: z.ZodLazy<z.ZodString>;
338
+ authority: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
339
+ kind: z.ZodLiteral<"delegated-user">;
340
+ grants: z.ZodUnion<readonly [z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>, z.ZodLiteral<"inherit">]>;
341
+ }, z.core.$strict>, z.ZodObject<{
342
+ kind: z.ZodLiteral<"linked-user">;
343
+ grants: z.ZodUnion<readonly [z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>, z.ZodLiteral<"inherit">]>;
344
+ }, z.core.$strict>, z.ZodLazy<z.ZodObject<{
345
+ kind: z.ZodLiteral<"organization-automation">;
346
+ grants: z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>;
347
+ }, z.core.$strict>>], "kind">>;
348
+ }, z.core.$strict>>], "kind">>;
349
+ }, z.core.$strip>, z.ZodObject<{
350
+ trigger: z.ZodLazy<z.ZodObject<{
351
+ kind: z.ZodLiteral<"schedule">;
352
+ cadence: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
353
+ kind: z.ZodLiteral<"once">;
354
+ at: z.ZodISODateTime;
355
+ }, z.core.$strip>, z.ZodObject<{
356
+ kind: z.ZodLiteral<"cron">;
357
+ expression: z.ZodString;
358
+ timeZone: z.ZodDefault<z.ZodString>;
359
+ }, z.core.$strip>], "kind">>;
360
+ }, z.core.$strip>>;
361
+ action: z.ZodUnion<readonly [z.ZodObject<{
362
+ kind: z.ZodLiteral<"start_workflow">;
363
+ workflowScriptPath: z.ZodString;
364
+ instanceIdTemplate: z.ZodString;
365
+ authority: z.ZodLazy<z.ZodObject<{
366
+ kind: z.ZodLiteral<"organization-automation">;
367
+ grants: z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>;
368
+ }, z.core.$strict>>;
369
+ }, z.core.$strict>, z.ZodLazy<z.ZodObject<{
370
+ kind: z.ZodLiteral<"send_workflow_event">;
371
+ target: z.ZodType<AutomationWorkflowEventTarget, unknown, z.core.$ZodTypeInternals<AutomationWorkflowEventTarget, unknown>>;
372
+ eventType: z.ZodString;
373
+ payload: z.ZodOptional<z.ZodUnknown>;
374
+ }, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
375
+ kind: z.ZodLiteral<"forward_event">;
376
+ targetScope: z.ZodType<AutomationRouteScopeTemplate, unknown, z.core.$ZodTypeInternals<AutomationRouteScopeTemplate, unknown>>;
377
+ idTemplate: z.ZodOptional<z.ZodString>;
378
+ }, z.core.$strip>>, z.ZodLazy<z.ZodObject<{
379
+ kind: z.ZodLiteral<"reclassify_event">;
380
+ source: z.ZodString;
381
+ eventType: z.ZodString;
382
+ payload: z.ZodLazy<z.ZodObject<{
383
+ kind: z.ZodLiteral<"projection">;
384
+ fields: z.ZodRecord<z.ZodString, z.ZodString>;
385
+ }, z.core.$strict>>;
386
+ }, z.core.$strict>>, z.ZodObject<{
387
+ kind: z.ZodLiteral<"notify_agent">;
388
+ agentName: z.ZodLazy<z.ZodString>;
389
+ authority: z.ZodLazy<z.ZodObject<{
390
+ kind: z.ZodLiteral<"organization-automation">;
391
+ grants: z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>;
392
+ }, z.core.$strict>>;
393
+ }, z.core.$strict>]>;
394
+ }, z.core.$strip>]>>>>;
395
+ declare const automationRouteUpdatePayloadSchema: z.ZodLazy<z.ZodObject<{
396
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
397
+ name: z.ZodOptional<z.ZodString>;
398
+ enabled: z.ZodOptional<z.ZodBoolean>;
399
+ priority: z.ZodOptional<z.ZodNumber>;
400
+ managedBy: z.ZodOptional<z.ZodNullable<z.ZodType<AutomationRouteManagedBy, unknown, z.core.$ZodTypeInternals<AutomationRouteManagedBy, unknown>>>>;
401
+ trigger: z.ZodOptional<z.ZodType<AutomationRouteTrigger, unknown, z.core.$ZodTypeInternals<AutomationRouteTrigger, unknown>>>;
402
+ action: z.ZodOptional<z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
403
+ kind: z.ZodLiteral<"start_workflow">;
404
+ authority: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
405
+ kind: z.ZodLiteral<"delegated-user">;
406
+ grants: z.ZodUnion<readonly [z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>, z.ZodLiteral<"inherit">]>;
407
+ }, z.core.$strict>, z.ZodObject<{
408
+ kind: z.ZodLiteral<"linked-user">;
409
+ grants: z.ZodUnion<readonly [z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>, z.ZodLiteral<"inherit">]>;
410
+ }, z.core.$strict>, z.ZodLazy<z.ZodObject<{
411
+ kind: z.ZodLiteral<"organization-automation">;
412
+ grants: z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>;
413
+ }, z.core.$strict>>], "kind">>;
414
+ workflowScriptPath: z.ZodString;
415
+ instanceIdTemplate: z.ZodString;
416
+ }, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
417
+ kind: z.ZodLiteral<"send_workflow_event">;
418
+ target: z.ZodType<AutomationWorkflowEventTarget, unknown, z.core.$ZodTypeInternals<AutomationWorkflowEventTarget, unknown>>;
419
+ eventType: z.ZodString;
420
+ payload: z.ZodOptional<z.ZodUnknown>;
421
+ }, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
422
+ kind: z.ZodLiteral<"forward_event">;
423
+ targetScope: z.ZodType<AutomationRouteScopeTemplate, unknown, z.core.$ZodTypeInternals<AutomationRouteScopeTemplate, unknown>>;
424
+ idTemplate: z.ZodOptional<z.ZodString>;
425
+ }, z.core.$strip>>, z.ZodLazy<z.ZodObject<{
426
+ kind: z.ZodLiteral<"reclassify_event">;
427
+ source: z.ZodString;
428
+ eventType: z.ZodString;
429
+ payload: z.ZodLazy<z.ZodObject<{
430
+ kind: z.ZodLiteral<"projection">;
431
+ fields: z.ZodRecord<z.ZodString, z.ZodString>;
432
+ }, z.core.$strict>>;
433
+ }, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
434
+ kind: z.ZodLiteral<"notify_agent">;
435
+ agentName: z.ZodLazy<z.ZodString>;
436
+ authority: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
437
+ kind: z.ZodLiteral<"delegated-user">;
438
+ grants: z.ZodUnion<readonly [z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>, z.ZodLiteral<"inherit">]>;
439
+ }, z.core.$strict>, z.ZodObject<{
440
+ kind: z.ZodLiteral<"linked-user">;
441
+ grants: z.ZodUnion<readonly [z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>, z.ZodLiteral<"inherit">]>;
442
+ }, z.core.$strict>, z.ZodLazy<z.ZodObject<{
443
+ kind: z.ZodLiteral<"organization-automation">;
444
+ grants: z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>;
445
+ }, z.core.$strict>>], "kind">>;
446
+ }, z.core.$strict>>], "kind">>>;
447
+ }, z.core.$strip>>;
448
+ declare const automationRouteUpdateInputSchema: z.ZodLazy<z.ZodLazy<z.ZodObject<{
449
+ id: z.ZodString;
450
+ name: z.ZodOptional<z.ZodString>;
451
+ enabled: z.ZodOptional<z.ZodBoolean>;
452
+ priority: z.ZodOptional<z.ZodNumber>;
453
+ trigger: z.ZodOptional<z.ZodType<AutomationRouteTrigger, unknown, z.core.$ZodTypeInternals<AutomationRouteTrigger, unknown>>>;
454
+ action: z.ZodOptional<z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
455
+ kind: z.ZodLiteral<"start_workflow">;
456
+ authority: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
457
+ kind: z.ZodLiteral<"delegated-user">;
458
+ grants: z.ZodUnion<readonly [z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>, z.ZodLiteral<"inherit">]>;
459
+ }, z.core.$strict>, z.ZodObject<{
460
+ kind: z.ZodLiteral<"linked-user">;
461
+ grants: z.ZodUnion<readonly [z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>, z.ZodLiteral<"inherit">]>;
462
+ }, z.core.$strict>, z.ZodLazy<z.ZodObject<{
463
+ kind: z.ZodLiteral<"organization-automation">;
464
+ grants: z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>;
465
+ }, z.core.$strict>>], "kind">>;
466
+ workflowScriptPath: z.ZodString;
467
+ instanceIdTemplate: z.ZodString;
468
+ }, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
469
+ kind: z.ZodLiteral<"send_workflow_event">;
470
+ target: z.ZodType<AutomationWorkflowEventTarget, unknown, z.core.$ZodTypeInternals<AutomationWorkflowEventTarget, unknown>>;
471
+ eventType: z.ZodString;
472
+ payload: z.ZodOptional<z.ZodUnknown>;
473
+ }, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
474
+ kind: z.ZodLiteral<"forward_event">;
475
+ targetScope: z.ZodType<AutomationRouteScopeTemplate, unknown, z.core.$ZodTypeInternals<AutomationRouteScopeTemplate, unknown>>;
476
+ idTemplate: z.ZodOptional<z.ZodString>;
477
+ }, z.core.$strip>>, z.ZodLazy<z.ZodObject<{
478
+ kind: z.ZodLiteral<"reclassify_event">;
479
+ source: z.ZodString;
480
+ eventType: z.ZodString;
481
+ payload: z.ZodLazy<z.ZodObject<{
482
+ kind: z.ZodLiteral<"projection">;
483
+ fields: z.ZodRecord<z.ZodString, z.ZodString>;
484
+ }, z.core.$strict>>;
485
+ }, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
486
+ kind: z.ZodLiteral<"notify_agent">;
487
+ agentName: z.ZodLazy<z.ZodString>;
488
+ authority: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
489
+ kind: z.ZodLiteral<"delegated-user">;
490
+ grants: z.ZodUnion<readonly [z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>, z.ZodLiteral<"inherit">]>;
491
+ }, z.core.$strict>, z.ZodObject<{
492
+ kind: z.ZodLiteral<"linked-user">;
493
+ grants: z.ZodUnion<readonly [z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>, z.ZodLiteral<"inherit">]>;
494
+ }, z.core.$strict>, z.ZodLazy<z.ZodObject<{
495
+ kind: z.ZodLiteral<"organization-automation">;
496
+ grants: z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>;
497
+ }, z.core.$strict>>], "kind">>;
498
+ }, z.core.$strict>>], "kind">>>;
499
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
500
+ managedBy: z.ZodOptional<z.ZodNullable<z.ZodType<AutomationRouteManagedBy, unknown, z.core.$ZodTypeInternals<AutomationRouteManagedBy, unknown>>>>;
501
+ }, z.core.$strip>>>;
502
+ type AutomationRouteCreateInput = z.infer<typeof automationRouteCreateInputSchema>;
503
+ type AutomationRouteUpdateInput = z.infer<typeof automationRouteUpdateInputSchema>;
504
+ declare const automationRouterOperations: {
505
+ "router.list": {
506
+ description: string;
507
+ permissions: {
508
+ readonly namespace: "router";
509
+ readonly permission: "read";
510
+ }[];
511
+ input: z.ZodVoid;
512
+ output: z.ZodLazy<z.ZodArray<z.ZodType<AutomationRouteDefinition, unknown, z.core.$ZodTypeInternals<AutomationRouteDefinition, unknown>>>>;
513
+ };
514
+ "router.get": {
515
+ description: string;
516
+ permissions: {
517
+ readonly namespace: "router";
518
+ readonly permission: "read";
519
+ }[];
520
+ input: z.ZodLazy<z.ZodObject<{
521
+ id: z.ZodString;
522
+ }, z.core.$strip>>;
523
+ output: z.ZodLazy<z.ZodNullable<z.ZodType<AutomationRouteDefinition, unknown, z.core.$ZodTypeInternals<AutomationRouteDefinition, unknown>>>>;
524
+ };
525
+ "router.create": {
526
+ description: string;
527
+ permissions: {
528
+ readonly namespace: "router";
529
+ readonly permission: "modify";
530
+ }[];
531
+ input: z.ZodLazy<z.ZodIntersection<z.ZodObject<{
532
+ id: z.ZodString;
533
+ name: z.ZodString;
534
+ enabled: z.ZodDefault<z.ZodBoolean>;
535
+ priority: z.ZodDefault<z.ZodNumber>;
536
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
537
+ managedBy: z.ZodOptional<z.ZodNullable<z.ZodType<AutomationRouteManagedBy, unknown, z.core.$ZodTypeInternals<AutomationRouteManagedBy, unknown>>>>;
538
+ }, z.core.$strip>, z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
539
+ trigger: z.ZodLazy<z.ZodObject<{
540
+ kind: z.ZodLiteral<"event">;
541
+ source: z.ZodString;
542
+ eventType: z.ZodString;
543
+ matcher: z.ZodDefault<z.ZodNullable<z.ZodType<AutomationEventMatcher, unknown, z.core.$ZodTypeInternals<AutomationEventMatcher, unknown>>>>;
544
+ }, z.core.$strip>>;
545
+ action: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
546
+ kind: z.ZodLiteral<"start_workflow">;
547
+ authority: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
548
+ kind: z.ZodLiteral<"delegated-user">;
549
+ grants: z.ZodUnion<readonly [z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>, z.ZodLiteral<"inherit">]>;
550
+ }, z.core.$strict>, z.ZodObject<{
551
+ kind: z.ZodLiteral<"linked-user">;
552
+ grants: z.ZodUnion<readonly [z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>, z.ZodLiteral<"inherit">]>;
553
+ }, z.core.$strict>, z.ZodLazy<z.ZodObject<{
554
+ kind: z.ZodLiteral<"organization-automation">;
555
+ grants: z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>;
556
+ }, z.core.$strict>>], "kind">>;
557
+ workflowScriptPath: z.ZodString;
558
+ instanceIdTemplate: z.ZodString;
559
+ }, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
560
+ kind: z.ZodLiteral<"send_workflow_event">;
561
+ target: z.ZodType<AutomationWorkflowEventTarget, unknown, z.core.$ZodTypeInternals<AutomationWorkflowEventTarget, unknown>>;
562
+ eventType: z.ZodString;
563
+ payload: z.ZodOptional<z.ZodUnknown>;
564
+ }, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
565
+ kind: z.ZodLiteral<"forward_event">;
566
+ targetScope: z.ZodType<AutomationRouteScopeTemplate, unknown, z.core.$ZodTypeInternals<AutomationRouteScopeTemplate, unknown>>;
567
+ idTemplate: z.ZodOptional<z.ZodString>;
568
+ }, z.core.$strip>>, z.ZodLazy<z.ZodObject<{
569
+ kind: z.ZodLiteral<"reclassify_event">;
570
+ source: z.ZodString;
571
+ eventType: z.ZodString;
572
+ payload: z.ZodLazy<z.ZodObject<{
573
+ kind: z.ZodLiteral<"projection">;
574
+ fields: z.ZodRecord<z.ZodString, z.ZodString>;
575
+ }, z.core.$strict>>;
576
+ }, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
577
+ kind: z.ZodLiteral<"notify_agent">;
578
+ agentName: z.ZodLazy<z.ZodString>;
579
+ authority: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
580
+ kind: z.ZodLiteral<"delegated-user">;
581
+ grants: z.ZodUnion<readonly [z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>, z.ZodLiteral<"inherit">]>;
582
+ }, z.core.$strict>, z.ZodObject<{
583
+ kind: z.ZodLiteral<"linked-user">;
584
+ grants: z.ZodUnion<readonly [z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>, z.ZodLiteral<"inherit">]>;
585
+ }, z.core.$strict>, z.ZodLazy<z.ZodObject<{
586
+ kind: z.ZodLiteral<"organization-automation">;
587
+ grants: z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>;
588
+ }, z.core.$strict>>], "kind">>;
589
+ }, z.core.$strict>>], "kind">>;
590
+ }, z.core.$strip>, z.ZodObject<{
591
+ trigger: z.ZodLazy<z.ZodObject<{
592
+ kind: z.ZodLiteral<"schedule">;
593
+ cadence: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
594
+ kind: z.ZodLiteral<"once">;
595
+ at: z.ZodISODateTime;
596
+ }, z.core.$strip>, z.ZodObject<{
597
+ kind: z.ZodLiteral<"cron">;
598
+ expression: z.ZodString;
599
+ timeZone: z.ZodDefault<z.ZodString>;
600
+ }, z.core.$strip>], "kind">>;
601
+ }, z.core.$strip>>;
602
+ action: z.ZodUnion<readonly [z.ZodObject<{
603
+ kind: z.ZodLiteral<"start_workflow">;
604
+ workflowScriptPath: z.ZodString;
605
+ instanceIdTemplate: z.ZodString;
606
+ authority: z.ZodLazy<z.ZodObject<{
607
+ kind: z.ZodLiteral<"organization-automation">;
608
+ grants: z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>;
609
+ }, z.core.$strict>>;
610
+ }, z.core.$strict>, z.ZodLazy<z.ZodObject<{
611
+ kind: z.ZodLiteral<"send_workflow_event">;
612
+ target: z.ZodType<AutomationWorkflowEventTarget, unknown, z.core.$ZodTypeInternals<AutomationWorkflowEventTarget, unknown>>;
613
+ eventType: z.ZodString;
614
+ payload: z.ZodOptional<z.ZodUnknown>;
615
+ }, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
616
+ kind: z.ZodLiteral<"forward_event">;
617
+ targetScope: z.ZodType<AutomationRouteScopeTemplate, unknown, z.core.$ZodTypeInternals<AutomationRouteScopeTemplate, unknown>>;
618
+ idTemplate: z.ZodOptional<z.ZodString>;
619
+ }, z.core.$strip>>, z.ZodLazy<z.ZodObject<{
620
+ kind: z.ZodLiteral<"reclassify_event">;
621
+ source: z.ZodString;
622
+ eventType: z.ZodString;
623
+ payload: z.ZodLazy<z.ZodObject<{
624
+ kind: z.ZodLiteral<"projection">;
625
+ fields: z.ZodRecord<z.ZodString, z.ZodString>;
626
+ }, z.core.$strict>>;
627
+ }, z.core.$strict>>, z.ZodObject<{
628
+ kind: z.ZodLiteral<"notify_agent">;
629
+ agentName: z.ZodLazy<z.ZodString>;
630
+ authority: z.ZodLazy<z.ZodObject<{
631
+ kind: z.ZodLiteral<"organization-automation">;
632
+ grants: z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>;
633
+ }, z.core.$strict>>;
634
+ }, z.core.$strict>]>;
635
+ }, z.core.$strip>]>>>>;
636
+ output: z.ZodType<AutomationRouteDefinition, unknown, z.core.$ZodTypeInternals<AutomationRouteDefinition, unknown>>;
637
+ };
638
+ "router.update": {
639
+ description: string;
640
+ permissions: {
641
+ readonly namespace: "router";
642
+ readonly permission: "modify";
643
+ }[];
644
+ input: z.ZodLazy<z.ZodLazy<z.ZodObject<{
645
+ id: z.ZodString;
646
+ name: z.ZodOptional<z.ZodString>;
647
+ enabled: z.ZodOptional<z.ZodBoolean>;
648
+ priority: z.ZodOptional<z.ZodNumber>;
649
+ trigger: z.ZodOptional<z.ZodType<AutomationRouteTrigger, unknown, z.core.$ZodTypeInternals<AutomationRouteTrigger, unknown>>>;
650
+ action: z.ZodOptional<z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
651
+ kind: z.ZodLiteral<"start_workflow">;
652
+ authority: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
653
+ kind: z.ZodLiteral<"delegated-user">;
654
+ grants: z.ZodUnion<readonly [z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>, z.ZodLiteral<"inherit">]>;
655
+ }, z.core.$strict>, z.ZodObject<{
656
+ kind: z.ZodLiteral<"linked-user">;
657
+ grants: z.ZodUnion<readonly [z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>, z.ZodLiteral<"inherit">]>;
658
+ }, z.core.$strict>, z.ZodLazy<z.ZodObject<{
659
+ kind: z.ZodLiteral<"organization-automation">;
660
+ grants: z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>;
661
+ }, z.core.$strict>>], "kind">>;
662
+ workflowScriptPath: z.ZodString;
663
+ instanceIdTemplate: z.ZodString;
664
+ }, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
665
+ kind: z.ZodLiteral<"send_workflow_event">;
666
+ target: z.ZodType<AutomationWorkflowEventTarget, unknown, z.core.$ZodTypeInternals<AutomationWorkflowEventTarget, unknown>>;
667
+ eventType: z.ZodString;
668
+ payload: z.ZodOptional<z.ZodUnknown>;
669
+ }, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
670
+ kind: z.ZodLiteral<"forward_event">;
671
+ targetScope: z.ZodType<AutomationRouteScopeTemplate, unknown, z.core.$ZodTypeInternals<AutomationRouteScopeTemplate, unknown>>;
672
+ idTemplate: z.ZodOptional<z.ZodString>;
673
+ }, z.core.$strip>>, z.ZodLazy<z.ZodObject<{
674
+ kind: z.ZodLiteral<"reclassify_event">;
675
+ source: z.ZodString;
676
+ eventType: z.ZodString;
677
+ payload: z.ZodLazy<z.ZodObject<{
678
+ kind: z.ZodLiteral<"projection">;
679
+ fields: z.ZodRecord<z.ZodString, z.ZodString>;
680
+ }, z.core.$strict>>;
681
+ }, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
682
+ kind: z.ZodLiteral<"notify_agent">;
683
+ agentName: z.ZodLazy<z.ZodString>;
684
+ authority: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
685
+ kind: z.ZodLiteral<"delegated-user">;
686
+ grants: z.ZodUnion<readonly [z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>, z.ZodLiteral<"inherit">]>;
687
+ }, z.core.$strict>, z.ZodObject<{
688
+ kind: z.ZodLiteral<"linked-user">;
689
+ grants: z.ZodUnion<readonly [z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>, z.ZodLiteral<"inherit">]>;
690
+ }, z.core.$strict>, z.ZodLazy<z.ZodObject<{
691
+ kind: z.ZodLiteral<"organization-automation">;
692
+ grants: z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>;
693
+ }, z.core.$strict>>], "kind">>;
694
+ }, z.core.$strict>>], "kind">>>;
695
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
696
+ managedBy: z.ZodOptional<z.ZodNullable<z.ZodType<AutomationRouteManagedBy, unknown, z.core.$ZodTypeInternals<AutomationRouteManagedBy, unknown>>>>;
697
+ }, z.core.$strip>>>;
698
+ output: z.ZodLazy<z.ZodNullable<z.ZodType<AutomationRouteDefinition, unknown, z.core.$ZodTypeInternals<AutomationRouteDefinition, unknown>>>>;
699
+ };
700
+ "router.delete": {
701
+ description: string;
702
+ permissions: {
703
+ readonly namespace: "router";
704
+ readonly permission: "modify";
705
+ }[];
706
+ input: z.ZodLazy<z.ZodObject<{
707
+ id: z.ZodString;
708
+ }, z.core.$strip>>;
709
+ output: z.ZodLazy<z.ZodObject<{
710
+ deleted: z.ZodLiteral<true>;
711
+ }, z.core.$strip>>;
712
+ };
713
+ "router.trigger-now": {
714
+ description: string;
715
+ permissions: {
716
+ readonly namespace: "router";
717
+ readonly permission: "modify";
718
+ }[];
719
+ input: z.ZodLazy<z.ZodObject<{
720
+ id: z.ZodString;
721
+ }, z.core.$strip>>;
722
+ output: z.ZodLazy<z.ZodNullable<z.ZodObject<{
723
+ accepted: z.ZodLiteral<true>;
724
+ eventId: z.ZodString;
725
+ }, z.core.$strip>>>;
726
+ };
727
+ };
728
+ //#endregion
729
+ export { AUTOMATION_ROUTE_AUTHORITY_ERROR_MESSAGE, AutomationActor, AutomationActorIdentityMatcher, AutomationActorMatcher, AutomationActors, AutomationAuthorityMode, AutomationEntityRef, AutomationEventMatcher, AutomationEventPayloadProjection, AutomationExternalEntityRef, AutomationForwardEventAction, AutomationNotifyAgentAction, AutomationReclassifyEventAction, AutomationRouteAction, AutomationRouteCreateInput, AutomationRouteDefinition, AutomationRouteEventTrigger, AutomationRouteManagedBy, AutomationRouteMetadata, AutomationRouteScheduleTrigger, AutomationRouteScopeTemplate, AutomationRouteTrigger, AutomationRouteUpdateInput, AutomationScheduleCadence, AutomationSendWorkflowEventAction, AutomationStartWorkflowAction, AutomationWorkflowEventTarget, automationActorsSchema, automationDelegatedActorSchema, automationEntityRefsEqual, automationRouteActionAuthority, automationRouteActionSchema, automationRouteCreateInputSchema, automationRouteManagedBySchema, automationRouteSchema, automationRouteUpdateInputSchema, automationRouteUpdatePayloadSchema, automationRouterOperations, automationScheduleCadenceSchema, isAutomationActorProvenancePath };
730
+ //# sourceMappingURL=automation.d.ts.map