@sixb/server 0.1.21 → 0.1.22

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 (165) hide show
  1. package/dist/artifacts/frame.d.ts +5 -0
  2. package/dist/artifacts/frame.d.ts.map +1 -1
  3. package/dist/auth/browser-origin.d.ts +5 -1
  4. package/dist/auth/browser-origin.d.ts.map +1 -1
  5. package/dist/auth/experience.d.ts +1 -0
  6. package/dist/auth/experience.d.ts.map +1 -1
  7. package/dist/auth/public-routes.d.ts.map +1 -1
  8. package/dist/auth/responses.d.ts +1 -1
  9. package/dist/auth/responses.d.ts.map +1 -1
  10. package/dist/auth/scope.d.ts +19 -3
  11. package/dist/auth/scope.d.ts.map +1 -1
  12. package/dist/index.js +10093 -7553
  13. package/dist/index.js.map +51 -39
  14. package/dist/models/display.d.ts +27 -0
  15. package/dist/models/display.d.ts.map +1 -1
  16. package/dist/openapi/components.d.ts +14 -0
  17. package/dist/openapi/components.d.ts.map +1 -0
  18. package/dist/openapi/tags.d.ts +14 -2
  19. package/dist/openapi/tags.d.ts.map +1 -1
  20. package/dist/registerRoutes.d.ts.map +1 -1
  21. package/dist/routes/actions.d.ts +5 -5
  22. package/dist/routes/agent-api-gateway.d.ts.map +1 -1
  23. package/dist/routes/agent-approval-gate.d.ts +27 -0
  24. package/dist/routes/agent-approval-gate.d.ts.map +1 -0
  25. package/dist/routes/agent-approvals.d.ts +599 -0
  26. package/dist/routes/agent-approvals.d.ts.map +1 -0
  27. package/dist/routes/agent-children.d.ts +318 -0
  28. package/dist/routes/agent-children.d.ts.map +1 -0
  29. package/dist/routes/agent-memory.d.ts +267 -0
  30. package/dist/routes/agent-memory.d.ts.map +1 -0
  31. package/dist/routes/agents.d.ts +999 -80
  32. package/dist/routes/agents.d.ts.map +1 -1
  33. package/dist/routes/ai-accounting.d.ts.map +1 -1
  34. package/dist/routes/artifact-frames.d.ts +3 -3
  35. package/dist/routes/artifact-frames.d.ts.map +1 -1
  36. package/dist/routes/artifacts.d.ts +790 -134
  37. package/dist/routes/artifacts.d.ts.map +1 -1
  38. package/dist/routes/auth.d.ts +116 -10
  39. package/dist/routes/auth.d.ts.map +1 -1
  40. package/dist/routes/connector-connection-runs.d.ts +50 -50
  41. package/dist/routes/connectors.d.ts +2 -2
  42. package/dist/routes/datasets.d.ts +20 -20
  43. package/dist/routes/events.d.ts +4 -4
  44. package/dist/routes/files.d.ts +14 -14
  45. package/dist/routes/files.d.ts.map +1 -1
  46. package/dist/routes/links.d.ts +2 -2
  47. package/dist/routes/logs.d.ts +5 -5
  48. package/dist/routes/model-calls.d.ts +155 -0
  49. package/dist/routes/model-calls.d.ts.map +1 -0
  50. package/dist/routes/model-generations.d.ts +400 -0
  51. package/dist/routes/model-generations.d.ts.map +1 -0
  52. package/dist/routes/models.d.ts +434 -1
  53. package/dist/routes/models.d.ts.map +1 -1
  54. package/dist/routes/objects.d.ts +71 -40
  55. package/dist/routes/objects.d.ts.map +1 -1
  56. package/dist/routes/observed-agent-threads.d.ts +682 -0
  57. package/dist/routes/observed-agent-threads.d.ts.map +1 -0
  58. package/dist/routes/ontology.d.ts +66 -62
  59. package/dist/routes/ontology.d.ts.map +1 -1
  60. package/dist/routes/pipelines.d.ts +24 -24
  61. package/dist/routes/projections.d.ts +55 -55
  62. package/dist/routes/rules.d.ts +2 -2
  63. package/dist/routes/share-grants.d.ts +9 -9
  64. package/dist/routes/syncs.d.ts +46 -46
  65. package/dist/routes/users.d.ts +117 -0
  66. package/dist/routes/users.d.ts.map +1 -0
  67. package/dist/routes/webhook-runs.d.ts +1 -1
  68. package/dist/routes/workflows.d.ts +118 -52
  69. package/dist/routes/workflows.d.ts.map +1 -1
  70. package/dist/routes/ws/agents.d.ts +7 -2
  71. package/dist/routes/ws/agents.d.ts.map +1 -1
  72. package/dist/routes/ws/events.d.ts +6 -6
  73. package/dist/routes/ws/logs.d.ts +14 -14
  74. package/dist/schemas/actions.d.ts +15 -15
  75. package/dist/schemas/activity.d.ts +48 -28
  76. package/dist/schemas/activity.d.ts.map +1 -1
  77. package/dist/schemas/agent-approvals.d.ts +1091 -0
  78. package/dist/schemas/agent-approvals.d.ts.map +1 -0
  79. package/dist/schemas/agent-memory.d.ts +250 -0
  80. package/dist/schemas/agent-memory.d.ts.map +1 -0
  81. package/dist/schemas/agents.d.ts +5442 -369
  82. package/dist/schemas/agents.d.ts.map +1 -1
  83. package/dist/schemas/ai-accounting.d.ts +1290 -411
  84. package/dist/schemas/ai-accounting.d.ts.map +1 -1
  85. package/dist/schemas/ai-limits.d.ts +10 -10
  86. package/dist/schemas/ai-usage.d.ts +12 -0
  87. package/dist/schemas/ai-usage.d.ts.map +1 -1
  88. package/dist/schemas/artifacts.d.ts +650 -98
  89. package/dist/schemas/artifacts.d.ts.map +1 -1
  90. package/dist/schemas/auth.d.ts +119 -46
  91. package/dist/schemas/auth.d.ts.map +1 -1
  92. package/dist/schemas/connectors.d.ts +22 -22
  93. package/dist/schemas/datasets.d.ts +98 -98
  94. package/dist/schemas/event-payloads.d.ts +6 -6
  95. package/dist/schemas/events.d.ts +26 -26
  96. package/dist/schemas/events.d.ts.map +1 -1
  97. package/dist/schemas/files.d.ts +24 -24
  98. package/dist/schemas/links.d.ts +2 -2
  99. package/dist/schemas/logs.d.ts +32 -32
  100. package/dist/schemas/models.d.ts +8889 -10
  101. package/dist/schemas/models.d.ts.map +1 -1
  102. package/dist/schemas/objects.d.ts +48 -12
  103. package/dist/schemas/objects.d.ts.map +1 -1
  104. package/dist/schemas/ontology.d.ts +127 -104
  105. package/dist/schemas/ontology.d.ts.map +1 -1
  106. package/dist/schemas/pipelines.d.ts +132 -132
  107. package/dist/schemas/projections.d.ts +314 -314
  108. package/dist/schemas/rules.d.ts +4 -4
  109. package/dist/schemas/share-grants.d.ts +30 -30
  110. package/dist/schemas/syncs.d.ts +49 -49
  111. package/dist/schemas/users.d.ts +72 -0
  112. package/dist/schemas/users.d.ts.map +1 -0
  113. package/dist/schemas/webhook-runs.d.ts +6 -6
  114. package/dist/schemas/workflows.d.ts +701 -186
  115. package/dist/schemas/workflows.d.ts.map +1 -1
  116. package/dist/server.d.ts +1 -0
  117. package/dist/server.d.ts.map +1 -1
  118. package/dist/utils/http.d.ts.map +1 -1
  119. package/package.json +7 -7
  120. package/src/artifacts/frame.ts +6 -1
  121. package/src/auth/browser-origin.ts +8 -3
  122. package/src/auth/experience.ts +1 -1
  123. package/src/auth/guard.ts +2 -2
  124. package/src/auth/public-routes.ts +6 -0
  125. package/src/auth/responses.ts +7 -6
  126. package/src/auth/scope.ts +32 -3
  127. package/src/models/display.ts +61 -16
  128. package/src/openapi/components.ts +54 -0
  129. package/src/openapi/tags.ts +12 -0
  130. package/src/registerRoutes.ts +14 -0
  131. package/src/routes/agent-api-gateway.ts +115 -91
  132. package/src/routes/agent-approval-gate.ts +213 -0
  133. package/src/routes/agent-approvals.ts +299 -0
  134. package/src/routes/agent-children.ts +209 -0
  135. package/src/routes/agent-memory.ts +210 -0
  136. package/src/routes/agents.ts +363 -142
  137. package/src/routes/ai-accounting.ts +4 -0
  138. package/src/routes/artifact-frames.ts +14 -8
  139. package/src/routes/artifacts.ts +297 -22
  140. package/src/routes/auth.ts +306 -13
  141. package/src/routes/files.ts +6 -7
  142. package/src/routes/model-calls.ts +120 -0
  143. package/src/routes/model-generations.ts +245 -0
  144. package/src/routes/models.ts +116 -9
  145. package/src/routes/objects.ts +55 -61
  146. package/src/routes/observed-agent-threads.ts +253 -0
  147. package/src/routes/ontology.ts +1 -0
  148. package/src/routes/users.ts +73 -0
  149. package/src/routes/workflows.ts +6 -9
  150. package/src/routes/ws/agents.ts +10 -5
  151. package/src/schemas/activity.ts +2 -0
  152. package/src/schemas/agent-approvals.ts +129 -0
  153. package/src/schemas/agent-memory.ts +96 -0
  154. package/src/schemas/agents.ts +239 -0
  155. package/src/schemas/ai-accounting.ts +40 -4
  156. package/src/schemas/ai-usage.ts +10 -0
  157. package/src/schemas/artifacts.ts +91 -3
  158. package/src/schemas/auth.ts +25 -0
  159. package/src/schemas/models.ts +197 -1
  160. package/src/schemas/objects.ts +181 -0
  161. package/src/schemas/ontology.ts +1 -0
  162. package/src/schemas/users.ts +24 -0
  163. package/src/schemas/workflows.ts +2 -0
  164. package/src/server.ts +9 -10
  165. package/src/utils/http.ts +2 -0
@@ -0,0 +1,1091 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * What the Agent may change without asking: `manual` asks for every action and workflow,
4
+ * `accept-edits` runs the actions that only change Sixb, `auto` runs everything.
5
+ */
6
+ export declare const AgentApprovalModeSchema: z.ZodEnum<["manual", "accept-edits", "auto"]>;
7
+ export declare const AgentApprovalStatusSchema: z.ZodEnum<["pending", "approved", "denied", "cancelled", "superseded", "expired"]>;
8
+ /** Where your mode comes from: your choice in the thread, your default, or none yet. */
9
+ export declare const AgentApprovalModeSourceSchema: z.ZodEnum<["thread", "default", "fallback", "run"]>;
10
+ /** The held call as the Agent asked for it, without its params. */
11
+ export declare const AgentApprovalCallSummarySchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
12
+ kind: z.ZodLiteral<"action">;
13
+ actionId: z.ZodString;
14
+ subject: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
15
+ kind: z.ZodLiteral<"none">;
16
+ }, "strip", z.ZodTypeAny, {
17
+ kind: "none";
18
+ }, {
19
+ kind: "none";
20
+ }>, z.ZodObject<{
21
+ kind: z.ZodLiteral<"object">;
22
+ objectTypeId: z.ZodString;
23
+ primaryId: z.ZodString;
24
+ }, "strip", z.ZodTypeAny, {
25
+ kind: "object";
26
+ objectTypeId: string;
27
+ primaryId: string;
28
+ }, {
29
+ kind: "object";
30
+ objectTypeId: string;
31
+ primaryId: string;
32
+ }>]>;
33
+ }, "strip", z.ZodTypeAny, {
34
+ kind: "action";
35
+ actionId: string;
36
+ subject: {
37
+ kind: "none";
38
+ } | {
39
+ kind: "object";
40
+ objectTypeId: string;
41
+ primaryId: string;
42
+ };
43
+ }, {
44
+ kind: "action";
45
+ actionId: string;
46
+ subject: {
47
+ kind: "none";
48
+ } | {
49
+ kind: "object";
50
+ objectTypeId: string;
51
+ primaryId: string;
52
+ };
53
+ }>, z.ZodObject<{
54
+ kind: z.ZodLiteral<"workflow">;
55
+ workflowId: z.ZodString;
56
+ }, "strip", z.ZodTypeAny, {
57
+ kind: "workflow";
58
+ workflowId: string;
59
+ }, {
60
+ kind: "workflow";
61
+ workflowId: string;
62
+ }>]>;
63
+ /** The held call, as it runs once approved. */
64
+ export declare const AgentApprovalCallSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
65
+ kind: z.ZodLiteral<"action">;
66
+ actionId: z.ZodString;
67
+ subject: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
68
+ kind: z.ZodLiteral<"none">;
69
+ }, "strip", z.ZodTypeAny, {
70
+ kind: "none";
71
+ }, {
72
+ kind: "none";
73
+ }>, z.ZodObject<{
74
+ kind: z.ZodLiteral<"object">;
75
+ objectTypeId: z.ZodString;
76
+ primaryId: z.ZodString;
77
+ }, "strip", z.ZodTypeAny, {
78
+ kind: "object";
79
+ objectTypeId: string;
80
+ primaryId: string;
81
+ }, {
82
+ kind: "object";
83
+ objectTypeId: string;
84
+ primaryId: string;
85
+ }>]>;
86
+ /** Normalized: what runs once approved. */
87
+ params: z.ZodRecord<z.ZodString, z.ZodType<import("./common").JsonValue, z.ZodTypeDef, import("./common").JsonValue>>;
88
+ actionRunId: z.ZodString;
89
+ /** `external` when the action has a writeback or effects. */
90
+ effect: z.ZodEnum<["ontology", "external"]>;
91
+ }, "strip", z.ZodTypeAny, {
92
+ kind: "action";
93
+ params: Record<string, import("./common").JsonValue>;
94
+ actionId: string;
95
+ subject: {
96
+ kind: "none";
97
+ } | {
98
+ kind: "object";
99
+ objectTypeId: string;
100
+ primaryId: string;
101
+ };
102
+ actionRunId: string;
103
+ effect: "ontology" | "external";
104
+ }, {
105
+ kind: "action";
106
+ params: Record<string, import("./common").JsonValue>;
107
+ actionId: string;
108
+ subject: {
109
+ kind: "none";
110
+ } | {
111
+ kind: "object";
112
+ objectTypeId: string;
113
+ primaryId: string;
114
+ };
115
+ actionRunId: string;
116
+ effect: "ontology" | "external";
117
+ }>, z.ZodObject<{
118
+ kind: z.ZodLiteral<"workflow">;
119
+ workflowId: z.ZodString;
120
+ /** As the run stores it. */
121
+ input: z.ZodRecord<z.ZodString, z.ZodType<import("./common").JsonValue, z.ZodTypeDef, import("./common").JsonValue>>;
122
+ workflowRunId: z.ZodString;
123
+ }, "strip", z.ZodTypeAny, {
124
+ kind: "workflow";
125
+ workflowId: string;
126
+ input: Record<string, import("./common").JsonValue>;
127
+ workflowRunId: string;
128
+ }, {
129
+ kind: "workflow";
130
+ workflowId: string;
131
+ input: Record<string, import("./common").JsonValue>;
132
+ workflowRunId: string;
133
+ }>]>;
134
+ /** What the approved call gave when it ran. */
135
+ export declare const AgentApprovalOutcomeSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
136
+ kind: z.ZodLiteral<"action-run">;
137
+ runId: z.ZodString;
138
+ status: z.ZodEnum<["succeeded", "failed"]>;
139
+ error: z.ZodOptional<z.ZodType<import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit">, z.ZodTypeDef, import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit">>>;
140
+ }, "strip", z.ZodTypeAny, {
141
+ status: "succeeded" | "failed";
142
+ kind: "action-run";
143
+ runId: string;
144
+ error?: import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit"> | undefined;
145
+ }, {
146
+ status: "succeeded" | "failed";
147
+ kind: "action-run";
148
+ runId: string;
149
+ error?: import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit"> | undefined;
150
+ }>, z.ZodObject<{
151
+ kind: z.ZodLiteral<"workflow-run">;
152
+ runId: z.ZodString;
153
+ queuedAt: z.ZodString;
154
+ }, "strip", z.ZodTypeAny, {
155
+ kind: "workflow-run";
156
+ runId: string;
157
+ queuedAt: string;
158
+ }, {
159
+ kind: "workflow-run";
160
+ runId: string;
161
+ queuedAt: string;
162
+ }>, z.ZodObject<{
163
+ kind: z.ZodLiteral<"error">;
164
+ error: z.ZodObject<{
165
+ code: z.ZodEnum<["action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed", ...("action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed")[]]>;
166
+ message: z.ZodString;
167
+ retryable: z.ZodBoolean;
168
+ at: z.ZodString;
169
+ details: z.ZodOptional<z.ZodType<import("./common").JsonValue, z.ZodTypeDef, import("./common").JsonValue>>;
170
+ httpStatus: z.ZodOptional<z.ZodNumber>;
171
+ redacted: z.ZodOptional<z.ZodLiteral<true>>;
172
+ truncated: z.ZodOptional<z.ZodLiteral<true>>;
173
+ }, "strip", z.ZodTypeAny, {
174
+ at: string;
175
+ code: "action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed";
176
+ message: string;
177
+ retryable: boolean;
178
+ details?: import("./common").JsonValue | undefined;
179
+ httpStatus?: number | undefined;
180
+ redacted?: true | undefined;
181
+ truncated?: true | undefined;
182
+ }, {
183
+ at: string;
184
+ code: "action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed";
185
+ message: string;
186
+ retryable: boolean;
187
+ details?: import("./common").JsonValue | undefined;
188
+ httpStatus?: number | undefined;
189
+ redacted?: true | undefined;
190
+ truncated?: true | undefined;
191
+ }>;
192
+ }, "strip", z.ZodTypeAny, {
193
+ error: {
194
+ at: string;
195
+ code: "action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed";
196
+ message: string;
197
+ retryable: boolean;
198
+ details?: import("./common").JsonValue | undefined;
199
+ httpStatus?: number | undefined;
200
+ redacted?: true | undefined;
201
+ truncated?: true | undefined;
202
+ };
203
+ kind: "error";
204
+ }, {
205
+ error: {
206
+ at: string;
207
+ code: "action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed";
208
+ message: string;
209
+ retryable: boolean;
210
+ details?: import("./common").JsonValue | undefined;
211
+ httpStatus?: number | undefined;
212
+ redacted?: true | undefined;
213
+ truncated?: true | undefined;
214
+ };
215
+ kind: "error";
216
+ }>]>;
217
+ export declare const AgentApprovalSchema: z.ZodObject<{
218
+ id: z.ZodString;
219
+ threadId: z.ZodString;
220
+ /** The turn that made the call. */
221
+ runId: z.ZodString;
222
+ /** The turn itself, or the child of it that made the call. */
223
+ callerRunId: z.ZodString;
224
+ /** The child that made the call, by the key the turn spawned it with; absent for the turn's own. */
225
+ caller: z.ZodOptional<z.ZodObject<{
226
+ runId: z.ZodString;
227
+ key: z.ZodString;
228
+ }, "strip", z.ZodTypeAny, {
229
+ runId: string;
230
+ key: string;
231
+ }, {
232
+ runId: string;
233
+ key: string;
234
+ }>>;
235
+ /** Who asked for the turn: the only one who decides. */
236
+ requestedBy: z.ZodObject<{
237
+ type: z.ZodEnum<["user", "serviceAccount", "system"]>;
238
+ id: z.ZodString;
239
+ }, "strip", z.ZodTypeAny, {
240
+ id: string;
241
+ type: "user" | "serviceAccount" | "system";
242
+ }, {
243
+ id: string;
244
+ type: "user" | "serviceAccount" | "system";
245
+ }>;
246
+ /** The mode that held the call. */
247
+ mode: z.ZodEnum<["manual", "accept-edits"]>;
248
+ status: z.ZodEnum<["pending", "approved", "denied", "cancelled", "superseded", "expired"]>;
249
+ call: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
250
+ kind: z.ZodLiteral<"action">;
251
+ actionId: z.ZodString;
252
+ subject: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
253
+ kind: z.ZodLiteral<"none">;
254
+ }, "strip", z.ZodTypeAny, {
255
+ kind: "none";
256
+ }, {
257
+ kind: "none";
258
+ }>, z.ZodObject<{
259
+ kind: z.ZodLiteral<"object">;
260
+ objectTypeId: z.ZodString;
261
+ primaryId: z.ZodString;
262
+ }, "strip", z.ZodTypeAny, {
263
+ kind: "object";
264
+ objectTypeId: string;
265
+ primaryId: string;
266
+ }, {
267
+ kind: "object";
268
+ objectTypeId: string;
269
+ primaryId: string;
270
+ }>]>;
271
+ /** Normalized: what runs once approved. */
272
+ params: z.ZodRecord<z.ZodString, z.ZodType<import("./common").JsonValue, z.ZodTypeDef, import("./common").JsonValue>>;
273
+ actionRunId: z.ZodString;
274
+ /** `external` when the action has a writeback or effects. */
275
+ effect: z.ZodEnum<["ontology", "external"]>;
276
+ }, "strip", z.ZodTypeAny, {
277
+ kind: "action";
278
+ params: Record<string, import("./common").JsonValue>;
279
+ actionId: string;
280
+ subject: {
281
+ kind: "none";
282
+ } | {
283
+ kind: "object";
284
+ objectTypeId: string;
285
+ primaryId: string;
286
+ };
287
+ actionRunId: string;
288
+ effect: "ontology" | "external";
289
+ }, {
290
+ kind: "action";
291
+ params: Record<string, import("./common").JsonValue>;
292
+ actionId: string;
293
+ subject: {
294
+ kind: "none";
295
+ } | {
296
+ kind: "object";
297
+ objectTypeId: string;
298
+ primaryId: string;
299
+ };
300
+ actionRunId: string;
301
+ effect: "ontology" | "external";
302
+ }>, z.ZodObject<{
303
+ kind: z.ZodLiteral<"workflow">;
304
+ workflowId: z.ZodString;
305
+ /** As the run stores it. */
306
+ input: z.ZodRecord<z.ZodString, z.ZodType<import("./common").JsonValue, z.ZodTypeDef, import("./common").JsonValue>>;
307
+ workflowRunId: z.ZodString;
308
+ }, "strip", z.ZodTypeAny, {
309
+ kind: "workflow";
310
+ workflowId: string;
311
+ input: Record<string, import("./common").JsonValue>;
312
+ workflowRunId: string;
313
+ }, {
314
+ kind: "workflow";
315
+ workflowId: string;
316
+ input: Record<string, import("./common").JsonValue>;
317
+ workflowRunId: string;
318
+ }>]>;
319
+ createdAt: z.ZodString;
320
+ expiresAt: z.ZodString;
321
+ decidedAt: z.ZodOptional<z.ZodString>;
322
+ decidedBy: z.ZodOptional<z.ZodObject<{
323
+ type: z.ZodEnum<["user", "serviceAccount", "system"]>;
324
+ id: z.ZodString;
325
+ }, "strip", z.ZodTypeAny, {
326
+ id: string;
327
+ type: "user" | "serviceAccount" | "system";
328
+ }, {
329
+ id: string;
330
+ type: "user" | "serviceAccount" | "system";
331
+ }>>;
332
+ outcome: z.ZodOptional<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
333
+ kind: z.ZodLiteral<"action-run">;
334
+ runId: z.ZodString;
335
+ status: z.ZodEnum<["succeeded", "failed"]>;
336
+ error: z.ZodOptional<z.ZodType<import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit">, z.ZodTypeDef, import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit">>>;
337
+ }, "strip", z.ZodTypeAny, {
338
+ status: "succeeded" | "failed";
339
+ kind: "action-run";
340
+ runId: string;
341
+ error?: import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit"> | undefined;
342
+ }, {
343
+ status: "succeeded" | "failed";
344
+ kind: "action-run";
345
+ runId: string;
346
+ error?: import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit"> | undefined;
347
+ }>, z.ZodObject<{
348
+ kind: z.ZodLiteral<"workflow-run">;
349
+ runId: z.ZodString;
350
+ queuedAt: z.ZodString;
351
+ }, "strip", z.ZodTypeAny, {
352
+ kind: "workflow-run";
353
+ runId: string;
354
+ queuedAt: string;
355
+ }, {
356
+ kind: "workflow-run";
357
+ runId: string;
358
+ queuedAt: string;
359
+ }>, z.ZodObject<{
360
+ kind: z.ZodLiteral<"error">;
361
+ error: z.ZodObject<{
362
+ code: z.ZodEnum<["action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed", ...("action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed")[]]>;
363
+ message: z.ZodString;
364
+ retryable: z.ZodBoolean;
365
+ at: z.ZodString;
366
+ details: z.ZodOptional<z.ZodType<import("./common").JsonValue, z.ZodTypeDef, import("./common").JsonValue>>;
367
+ httpStatus: z.ZodOptional<z.ZodNumber>;
368
+ redacted: z.ZodOptional<z.ZodLiteral<true>>;
369
+ truncated: z.ZodOptional<z.ZodLiteral<true>>;
370
+ }, "strip", z.ZodTypeAny, {
371
+ at: string;
372
+ code: "action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed";
373
+ message: string;
374
+ retryable: boolean;
375
+ details?: import("./common").JsonValue | undefined;
376
+ httpStatus?: number | undefined;
377
+ redacted?: true | undefined;
378
+ truncated?: true | undefined;
379
+ }, {
380
+ at: string;
381
+ code: "action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed";
382
+ message: string;
383
+ retryable: boolean;
384
+ details?: import("./common").JsonValue | undefined;
385
+ httpStatus?: number | undefined;
386
+ redacted?: true | undefined;
387
+ truncated?: true | undefined;
388
+ }>;
389
+ }, "strip", z.ZodTypeAny, {
390
+ error: {
391
+ at: string;
392
+ code: "action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed";
393
+ message: string;
394
+ retryable: boolean;
395
+ details?: import("./common").JsonValue | undefined;
396
+ httpStatus?: number | undefined;
397
+ redacted?: true | undefined;
398
+ truncated?: true | undefined;
399
+ };
400
+ kind: "error";
401
+ }, {
402
+ error: {
403
+ at: string;
404
+ code: "action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed";
405
+ message: string;
406
+ retryable: boolean;
407
+ details?: import("./common").JsonValue | undefined;
408
+ httpStatus?: number | undefined;
409
+ redacted?: true | undefined;
410
+ truncated?: true | undefined;
411
+ };
412
+ kind: "error";
413
+ }>]>>;
414
+ /** Whether a later message told the Agent how it ended. */
415
+ reported: z.ZodBoolean;
416
+ }, "strip", z.ZodTypeAny, {
417
+ status: "pending" | "approved" | "denied" | "cancelled" | "superseded" | "expired";
418
+ id: string;
419
+ requestedBy: {
420
+ id: string;
421
+ type: "user" | "serviceAccount" | "system";
422
+ };
423
+ mode: "manual" | "accept-edits";
424
+ runId: string;
425
+ threadId: string;
426
+ callerRunId: string;
427
+ call: {
428
+ kind: "action";
429
+ params: Record<string, import("./common").JsonValue>;
430
+ actionId: string;
431
+ subject: {
432
+ kind: "none";
433
+ } | {
434
+ kind: "object";
435
+ objectTypeId: string;
436
+ primaryId: string;
437
+ };
438
+ actionRunId: string;
439
+ effect: "ontology" | "external";
440
+ } | {
441
+ kind: "workflow";
442
+ workflowId: string;
443
+ input: Record<string, import("./common").JsonValue>;
444
+ workflowRunId: string;
445
+ };
446
+ createdAt: string;
447
+ expiresAt: string;
448
+ reported: boolean;
449
+ caller?: {
450
+ runId: string;
451
+ key: string;
452
+ } | undefined;
453
+ decidedAt?: string | undefined;
454
+ decidedBy?: {
455
+ id: string;
456
+ type: "user" | "serviceAccount" | "system";
457
+ } | undefined;
458
+ outcome?: {
459
+ status: "succeeded" | "failed";
460
+ kind: "action-run";
461
+ runId: string;
462
+ error?: import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit"> | undefined;
463
+ } | {
464
+ kind: "workflow-run";
465
+ runId: string;
466
+ queuedAt: string;
467
+ } | {
468
+ error: {
469
+ at: string;
470
+ code: "action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed";
471
+ message: string;
472
+ retryable: boolean;
473
+ details?: import("./common").JsonValue | undefined;
474
+ httpStatus?: number | undefined;
475
+ redacted?: true | undefined;
476
+ truncated?: true | undefined;
477
+ };
478
+ kind: "error";
479
+ } | undefined;
480
+ }, {
481
+ status: "pending" | "approved" | "denied" | "cancelled" | "superseded" | "expired";
482
+ id: string;
483
+ requestedBy: {
484
+ id: string;
485
+ type: "user" | "serviceAccount" | "system";
486
+ };
487
+ mode: "manual" | "accept-edits";
488
+ runId: string;
489
+ threadId: string;
490
+ callerRunId: string;
491
+ call: {
492
+ kind: "action";
493
+ params: Record<string, import("./common").JsonValue>;
494
+ actionId: string;
495
+ subject: {
496
+ kind: "none";
497
+ } | {
498
+ kind: "object";
499
+ objectTypeId: string;
500
+ primaryId: string;
501
+ };
502
+ actionRunId: string;
503
+ effect: "ontology" | "external";
504
+ } | {
505
+ kind: "workflow";
506
+ workflowId: string;
507
+ input: Record<string, import("./common").JsonValue>;
508
+ workflowRunId: string;
509
+ };
510
+ createdAt: string;
511
+ expiresAt: string;
512
+ reported: boolean;
513
+ caller?: {
514
+ runId: string;
515
+ key: string;
516
+ } | undefined;
517
+ decidedAt?: string | undefined;
518
+ decidedBy?: {
519
+ id: string;
520
+ type: "user" | "serviceAccount" | "system";
521
+ } | undefined;
522
+ outcome?: {
523
+ status: "succeeded" | "failed";
524
+ kind: "action-run";
525
+ runId: string;
526
+ error?: import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit"> | undefined;
527
+ } | {
528
+ kind: "workflow-run";
529
+ runId: string;
530
+ queuedAt: string;
531
+ } | {
532
+ error: {
533
+ at: string;
534
+ code: "action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed";
535
+ message: string;
536
+ retryable: boolean;
537
+ details?: import("./common").JsonValue | undefined;
538
+ httpStatus?: number | undefined;
539
+ redacted?: true | undefined;
540
+ truncated?: true | undefined;
541
+ };
542
+ kind: "error";
543
+ } | undefined;
544
+ }>;
545
+ export declare const AgentApprovalListQuerySchema: z.ZodObject<{
546
+ status: z.ZodOptional<z.ZodEnum<["pending", "approved", "denied", "cancelled", "superseded", "expired"]>>;
547
+ runId: z.ZodOptional<z.ZodString>;
548
+ limit: z.ZodOptional<z.ZodString>;
549
+ offset: z.ZodOptional<z.ZodString>;
550
+ }, "strip", z.ZodTypeAny, {
551
+ status?: "pending" | "approved" | "denied" | "cancelled" | "superseded" | "expired" | undefined;
552
+ runId?: string | undefined;
553
+ limit?: string | undefined;
554
+ offset?: string | undefined;
555
+ }, {
556
+ status?: "pending" | "approved" | "denied" | "cancelled" | "superseded" | "expired" | undefined;
557
+ runId?: string | undefined;
558
+ limit?: string | undefined;
559
+ offset?: string | undefined;
560
+ }>;
561
+ export declare const MyAgentApprovalListQuerySchema: z.ZodObject<Omit<{
562
+ status: z.ZodOptional<z.ZodEnum<["pending", "approved", "denied", "cancelled", "superseded", "expired"]>>;
563
+ runId: z.ZodOptional<z.ZodString>;
564
+ limit: z.ZodOptional<z.ZodString>;
565
+ offset: z.ZodOptional<z.ZodString>;
566
+ }, "runId">, "strip", z.ZodTypeAny, {
567
+ status?: "pending" | "approved" | "denied" | "cancelled" | "superseded" | "expired" | undefined;
568
+ limit?: string | undefined;
569
+ offset?: string | undefined;
570
+ }, {
571
+ status?: "pending" | "approved" | "denied" | "cancelled" | "superseded" | "expired" | undefined;
572
+ limit?: string | undefined;
573
+ offset?: string | undefined;
574
+ }>;
575
+ export declare const AgentApprovalListResponseSchema: z.ZodObject<{
576
+ approvals: z.ZodArray<z.ZodObject<{
577
+ id: z.ZodString;
578
+ threadId: z.ZodString;
579
+ /** The turn that made the call. */
580
+ runId: z.ZodString;
581
+ /** The turn itself, or the child of it that made the call. */
582
+ callerRunId: z.ZodString;
583
+ /** The child that made the call, by the key the turn spawned it with; absent for the turn's own. */
584
+ caller: z.ZodOptional<z.ZodObject<{
585
+ runId: z.ZodString;
586
+ key: z.ZodString;
587
+ }, "strip", z.ZodTypeAny, {
588
+ runId: string;
589
+ key: string;
590
+ }, {
591
+ runId: string;
592
+ key: string;
593
+ }>>;
594
+ /** Who asked for the turn: the only one who decides. */
595
+ requestedBy: z.ZodObject<{
596
+ type: z.ZodEnum<["user", "serviceAccount", "system"]>;
597
+ id: z.ZodString;
598
+ }, "strip", z.ZodTypeAny, {
599
+ id: string;
600
+ type: "user" | "serviceAccount" | "system";
601
+ }, {
602
+ id: string;
603
+ type: "user" | "serviceAccount" | "system";
604
+ }>;
605
+ /** The mode that held the call. */
606
+ mode: z.ZodEnum<["manual", "accept-edits"]>;
607
+ status: z.ZodEnum<["pending", "approved", "denied", "cancelled", "superseded", "expired"]>;
608
+ call: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
609
+ kind: z.ZodLiteral<"action">;
610
+ actionId: z.ZodString;
611
+ subject: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
612
+ kind: z.ZodLiteral<"none">;
613
+ }, "strip", z.ZodTypeAny, {
614
+ kind: "none";
615
+ }, {
616
+ kind: "none";
617
+ }>, z.ZodObject<{
618
+ kind: z.ZodLiteral<"object">;
619
+ objectTypeId: z.ZodString;
620
+ primaryId: z.ZodString;
621
+ }, "strip", z.ZodTypeAny, {
622
+ kind: "object";
623
+ objectTypeId: string;
624
+ primaryId: string;
625
+ }, {
626
+ kind: "object";
627
+ objectTypeId: string;
628
+ primaryId: string;
629
+ }>]>;
630
+ /** Normalized: what runs once approved. */
631
+ params: z.ZodRecord<z.ZodString, z.ZodType<import("./common").JsonValue, z.ZodTypeDef, import("./common").JsonValue>>;
632
+ actionRunId: z.ZodString;
633
+ /** `external` when the action has a writeback or effects. */
634
+ effect: z.ZodEnum<["ontology", "external"]>;
635
+ }, "strip", z.ZodTypeAny, {
636
+ kind: "action";
637
+ params: Record<string, import("./common").JsonValue>;
638
+ actionId: string;
639
+ subject: {
640
+ kind: "none";
641
+ } | {
642
+ kind: "object";
643
+ objectTypeId: string;
644
+ primaryId: string;
645
+ };
646
+ actionRunId: string;
647
+ effect: "ontology" | "external";
648
+ }, {
649
+ kind: "action";
650
+ params: Record<string, import("./common").JsonValue>;
651
+ actionId: string;
652
+ subject: {
653
+ kind: "none";
654
+ } | {
655
+ kind: "object";
656
+ objectTypeId: string;
657
+ primaryId: string;
658
+ };
659
+ actionRunId: string;
660
+ effect: "ontology" | "external";
661
+ }>, z.ZodObject<{
662
+ kind: z.ZodLiteral<"workflow">;
663
+ workflowId: z.ZodString;
664
+ /** As the run stores it. */
665
+ input: z.ZodRecord<z.ZodString, z.ZodType<import("./common").JsonValue, z.ZodTypeDef, import("./common").JsonValue>>;
666
+ workflowRunId: z.ZodString;
667
+ }, "strip", z.ZodTypeAny, {
668
+ kind: "workflow";
669
+ workflowId: string;
670
+ input: Record<string, import("./common").JsonValue>;
671
+ workflowRunId: string;
672
+ }, {
673
+ kind: "workflow";
674
+ workflowId: string;
675
+ input: Record<string, import("./common").JsonValue>;
676
+ workflowRunId: string;
677
+ }>]>;
678
+ createdAt: z.ZodString;
679
+ expiresAt: z.ZodString;
680
+ decidedAt: z.ZodOptional<z.ZodString>;
681
+ decidedBy: z.ZodOptional<z.ZodObject<{
682
+ type: z.ZodEnum<["user", "serviceAccount", "system"]>;
683
+ id: z.ZodString;
684
+ }, "strip", z.ZodTypeAny, {
685
+ id: string;
686
+ type: "user" | "serviceAccount" | "system";
687
+ }, {
688
+ id: string;
689
+ type: "user" | "serviceAccount" | "system";
690
+ }>>;
691
+ outcome: z.ZodOptional<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
692
+ kind: z.ZodLiteral<"action-run">;
693
+ runId: z.ZodString;
694
+ status: z.ZodEnum<["succeeded", "failed"]>;
695
+ error: z.ZodOptional<z.ZodType<import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit">, z.ZodTypeDef, import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit">>>;
696
+ }, "strip", z.ZodTypeAny, {
697
+ status: "succeeded" | "failed";
698
+ kind: "action-run";
699
+ runId: string;
700
+ error?: import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit"> | undefined;
701
+ }, {
702
+ status: "succeeded" | "failed";
703
+ kind: "action-run";
704
+ runId: string;
705
+ error?: import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit"> | undefined;
706
+ }>, z.ZodObject<{
707
+ kind: z.ZodLiteral<"workflow-run">;
708
+ runId: z.ZodString;
709
+ queuedAt: z.ZodString;
710
+ }, "strip", z.ZodTypeAny, {
711
+ kind: "workflow-run";
712
+ runId: string;
713
+ queuedAt: string;
714
+ }, {
715
+ kind: "workflow-run";
716
+ runId: string;
717
+ queuedAt: string;
718
+ }>, z.ZodObject<{
719
+ kind: z.ZodLiteral<"error">;
720
+ error: z.ZodObject<{
721
+ code: z.ZodEnum<["action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed", ...("action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed")[]]>;
722
+ message: z.ZodString;
723
+ retryable: z.ZodBoolean;
724
+ at: z.ZodString;
725
+ details: z.ZodOptional<z.ZodType<import("./common").JsonValue, z.ZodTypeDef, import("./common").JsonValue>>;
726
+ httpStatus: z.ZodOptional<z.ZodNumber>;
727
+ redacted: z.ZodOptional<z.ZodLiteral<true>>;
728
+ truncated: z.ZodOptional<z.ZodLiteral<true>>;
729
+ }, "strip", z.ZodTypeAny, {
730
+ at: string;
731
+ code: "action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed";
732
+ message: string;
733
+ retryable: boolean;
734
+ details?: import("./common").JsonValue | undefined;
735
+ httpStatus?: number | undefined;
736
+ redacted?: true | undefined;
737
+ truncated?: true | undefined;
738
+ }, {
739
+ at: string;
740
+ code: "action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed";
741
+ message: string;
742
+ retryable: boolean;
743
+ details?: import("./common").JsonValue | undefined;
744
+ httpStatus?: number | undefined;
745
+ redacted?: true | undefined;
746
+ truncated?: true | undefined;
747
+ }>;
748
+ }, "strip", z.ZodTypeAny, {
749
+ error: {
750
+ at: string;
751
+ code: "action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed";
752
+ message: string;
753
+ retryable: boolean;
754
+ details?: import("./common").JsonValue | undefined;
755
+ httpStatus?: number | undefined;
756
+ redacted?: true | undefined;
757
+ truncated?: true | undefined;
758
+ };
759
+ kind: "error";
760
+ }, {
761
+ error: {
762
+ at: string;
763
+ code: "action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed";
764
+ message: string;
765
+ retryable: boolean;
766
+ details?: import("./common").JsonValue | undefined;
767
+ httpStatus?: number | undefined;
768
+ redacted?: true | undefined;
769
+ truncated?: true | undefined;
770
+ };
771
+ kind: "error";
772
+ }>]>>;
773
+ /** Whether a later message told the Agent how it ended. */
774
+ reported: z.ZodBoolean;
775
+ }, "strip", z.ZodTypeAny, {
776
+ status: "pending" | "approved" | "denied" | "cancelled" | "superseded" | "expired";
777
+ id: string;
778
+ requestedBy: {
779
+ id: string;
780
+ type: "user" | "serviceAccount" | "system";
781
+ };
782
+ mode: "manual" | "accept-edits";
783
+ runId: string;
784
+ threadId: string;
785
+ callerRunId: string;
786
+ call: {
787
+ kind: "action";
788
+ params: Record<string, import("./common").JsonValue>;
789
+ actionId: string;
790
+ subject: {
791
+ kind: "none";
792
+ } | {
793
+ kind: "object";
794
+ objectTypeId: string;
795
+ primaryId: string;
796
+ };
797
+ actionRunId: string;
798
+ effect: "ontology" | "external";
799
+ } | {
800
+ kind: "workflow";
801
+ workflowId: string;
802
+ input: Record<string, import("./common").JsonValue>;
803
+ workflowRunId: string;
804
+ };
805
+ createdAt: string;
806
+ expiresAt: string;
807
+ reported: boolean;
808
+ caller?: {
809
+ runId: string;
810
+ key: string;
811
+ } | undefined;
812
+ decidedAt?: string | undefined;
813
+ decidedBy?: {
814
+ id: string;
815
+ type: "user" | "serviceAccount" | "system";
816
+ } | undefined;
817
+ outcome?: {
818
+ status: "succeeded" | "failed";
819
+ kind: "action-run";
820
+ runId: string;
821
+ error?: import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit"> | undefined;
822
+ } | {
823
+ kind: "workflow-run";
824
+ runId: string;
825
+ queuedAt: string;
826
+ } | {
827
+ error: {
828
+ at: string;
829
+ code: "action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed";
830
+ message: string;
831
+ retryable: boolean;
832
+ details?: import("./common").JsonValue | undefined;
833
+ httpStatus?: number | undefined;
834
+ redacted?: true | undefined;
835
+ truncated?: true | undefined;
836
+ };
837
+ kind: "error";
838
+ } | undefined;
839
+ }, {
840
+ status: "pending" | "approved" | "denied" | "cancelled" | "superseded" | "expired";
841
+ id: string;
842
+ requestedBy: {
843
+ id: string;
844
+ type: "user" | "serviceAccount" | "system";
845
+ };
846
+ mode: "manual" | "accept-edits";
847
+ runId: string;
848
+ threadId: string;
849
+ callerRunId: string;
850
+ call: {
851
+ kind: "action";
852
+ params: Record<string, import("./common").JsonValue>;
853
+ actionId: string;
854
+ subject: {
855
+ kind: "none";
856
+ } | {
857
+ kind: "object";
858
+ objectTypeId: string;
859
+ primaryId: string;
860
+ };
861
+ actionRunId: string;
862
+ effect: "ontology" | "external";
863
+ } | {
864
+ kind: "workflow";
865
+ workflowId: string;
866
+ input: Record<string, import("./common").JsonValue>;
867
+ workflowRunId: string;
868
+ };
869
+ createdAt: string;
870
+ expiresAt: string;
871
+ reported: boolean;
872
+ caller?: {
873
+ runId: string;
874
+ key: string;
875
+ } | undefined;
876
+ decidedAt?: string | undefined;
877
+ decidedBy?: {
878
+ id: string;
879
+ type: "user" | "serviceAccount" | "system";
880
+ } | undefined;
881
+ outcome?: {
882
+ status: "succeeded" | "failed";
883
+ kind: "action-run";
884
+ runId: string;
885
+ error?: import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit"> | undefined;
886
+ } | {
887
+ kind: "workflow-run";
888
+ runId: string;
889
+ queuedAt: string;
890
+ } | {
891
+ error: {
892
+ at: string;
893
+ code: "action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed";
894
+ message: string;
895
+ retryable: boolean;
896
+ details?: import("./common").JsonValue | undefined;
897
+ httpStatus?: number | undefined;
898
+ redacted?: true | undefined;
899
+ truncated?: true | undefined;
900
+ };
901
+ kind: "error";
902
+ } | undefined;
903
+ }>, "many">;
904
+ hasMore: z.ZodBoolean;
905
+ total: z.ZodNumber;
906
+ }, "strip", z.ZodTypeAny, {
907
+ hasMore: boolean;
908
+ total: number;
909
+ approvals: {
910
+ status: "pending" | "approved" | "denied" | "cancelled" | "superseded" | "expired";
911
+ id: string;
912
+ requestedBy: {
913
+ id: string;
914
+ type: "user" | "serviceAccount" | "system";
915
+ };
916
+ mode: "manual" | "accept-edits";
917
+ runId: string;
918
+ threadId: string;
919
+ callerRunId: string;
920
+ call: {
921
+ kind: "action";
922
+ params: Record<string, import("./common").JsonValue>;
923
+ actionId: string;
924
+ subject: {
925
+ kind: "none";
926
+ } | {
927
+ kind: "object";
928
+ objectTypeId: string;
929
+ primaryId: string;
930
+ };
931
+ actionRunId: string;
932
+ effect: "ontology" | "external";
933
+ } | {
934
+ kind: "workflow";
935
+ workflowId: string;
936
+ input: Record<string, import("./common").JsonValue>;
937
+ workflowRunId: string;
938
+ };
939
+ createdAt: string;
940
+ expiresAt: string;
941
+ reported: boolean;
942
+ caller?: {
943
+ runId: string;
944
+ key: string;
945
+ } | undefined;
946
+ decidedAt?: string | undefined;
947
+ decidedBy?: {
948
+ id: string;
949
+ type: "user" | "serviceAccount" | "system";
950
+ } | undefined;
951
+ outcome?: {
952
+ status: "succeeded" | "failed";
953
+ kind: "action-run";
954
+ runId: string;
955
+ error?: import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit"> | undefined;
956
+ } | {
957
+ kind: "workflow-run";
958
+ runId: string;
959
+ queuedAt: string;
960
+ } | {
961
+ error: {
962
+ at: string;
963
+ code: "action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed";
964
+ message: string;
965
+ retryable: boolean;
966
+ details?: import("./common").JsonValue | undefined;
967
+ httpStatus?: number | undefined;
968
+ redacted?: true | undefined;
969
+ truncated?: true | undefined;
970
+ };
971
+ kind: "error";
972
+ } | undefined;
973
+ }[];
974
+ }, {
975
+ hasMore: boolean;
976
+ total: number;
977
+ approvals: {
978
+ status: "pending" | "approved" | "denied" | "cancelled" | "superseded" | "expired";
979
+ id: string;
980
+ requestedBy: {
981
+ id: string;
982
+ type: "user" | "serviceAccount" | "system";
983
+ };
984
+ mode: "manual" | "accept-edits";
985
+ runId: string;
986
+ threadId: string;
987
+ callerRunId: string;
988
+ call: {
989
+ kind: "action";
990
+ params: Record<string, import("./common").JsonValue>;
991
+ actionId: string;
992
+ subject: {
993
+ kind: "none";
994
+ } | {
995
+ kind: "object";
996
+ objectTypeId: string;
997
+ primaryId: string;
998
+ };
999
+ actionRunId: string;
1000
+ effect: "ontology" | "external";
1001
+ } | {
1002
+ kind: "workflow";
1003
+ workflowId: string;
1004
+ input: Record<string, import("./common").JsonValue>;
1005
+ workflowRunId: string;
1006
+ };
1007
+ createdAt: string;
1008
+ expiresAt: string;
1009
+ reported: boolean;
1010
+ caller?: {
1011
+ runId: string;
1012
+ key: string;
1013
+ } | undefined;
1014
+ decidedAt?: string | undefined;
1015
+ decidedBy?: {
1016
+ id: string;
1017
+ type: "user" | "serviceAccount" | "system";
1018
+ } | undefined;
1019
+ outcome?: {
1020
+ status: "succeeded" | "failed";
1021
+ kind: "action-run";
1022
+ runId: string;
1023
+ error?: import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit"> | undefined;
1024
+ } | {
1025
+ kind: "workflow-run";
1026
+ runId: string;
1027
+ queuedAt: string;
1028
+ } | {
1029
+ error: {
1030
+ at: string;
1031
+ code: "action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed";
1032
+ message: string;
1033
+ retryable: boolean;
1034
+ details?: import("./common").JsonValue | undefined;
1035
+ httpStatus?: number | undefined;
1036
+ redacted?: true | undefined;
1037
+ truncated?: true | undefined;
1038
+ };
1039
+ kind: "error";
1040
+ } | undefined;
1041
+ }[];
1042
+ }>;
1043
+ export declare const AgentApprovalParamsSchema: z.ZodObject<{
1044
+ threadId: z.ZodString;
1045
+ approvalId: z.ZodString;
1046
+ }, "strip", z.ZodTypeAny, {
1047
+ threadId: string;
1048
+ approvalId: string;
1049
+ }, {
1050
+ threadId: string;
1051
+ approvalId: string;
1052
+ }>;
1053
+ export declare const DecideAgentApprovalBodySchema: z.ZodObject<{
1054
+ decision: z.ZodEnum<["approve", "deny"]>;
1055
+ /** With `approve`: also let your turns in this thread run such calls without asking. */
1056
+ always: z.ZodOptional<z.ZodLiteral<true>>;
1057
+ }, "strict", z.ZodTypeAny, {
1058
+ decision: "deny" | "approve";
1059
+ always?: true | undefined;
1060
+ }, {
1061
+ decision: "deny" | "approve";
1062
+ always?: true | undefined;
1063
+ }>;
1064
+ export declare const AgentPreferencesBodySchema: z.ZodObject<{
1065
+ approvalMode: z.ZodEnum<["manual", "accept-edits", "auto"]>;
1066
+ }, "strict", z.ZodTypeAny, {
1067
+ approvalMode: "manual" | "accept-edits" | "auto";
1068
+ }, {
1069
+ approvalMode: "manual" | "accept-edits" | "auto";
1070
+ }>;
1071
+ export declare const AgentThreadApprovalModeBodySchema: z.ZodObject<{
1072
+ /** `null` clears your choice: your turns in the thread follow your default again. */
1073
+ approvalMode: z.ZodNullable<z.ZodEnum<["manual", "accept-edits", "auto"]>>;
1074
+ }, "strict", z.ZodTypeAny, {
1075
+ approvalMode: "manual" | "accept-edits" | "auto" | null;
1076
+ }, {
1077
+ approvalMode: "manual" | "accept-edits" | "auto" | null;
1078
+ }>;
1079
+ export declare const AgentPreferencesSchema: z.ZodObject<{
1080
+ /** The mode of your turns in threads where you chose none. */
1081
+ approvalMode: z.ZodEnum<["manual", "accept-edits", "auto"]>;
1082
+ /** `fallback` until you choose a default. */
1083
+ approvalModeSource: z.ZodEnum<["default", "fallback"]>;
1084
+ }, "strip", z.ZodTypeAny, {
1085
+ approvalMode: "manual" | "accept-edits" | "auto";
1086
+ approvalModeSource: "default" | "fallback";
1087
+ }, {
1088
+ approvalMode: "manual" | "accept-edits" | "auto";
1089
+ approvalModeSource: "default" | "fallback";
1090
+ }>;
1091
+ //# sourceMappingURL=agent-approvals.d.ts.map