@tai42/api-client 16.0.1 → 17.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 (213) hide show
  1. package/dist/agents.d.ts.map +1 -1
  2. package/dist/agents.js +1 -1
  3. package/dist/agents.js.map +1 -1
  4. package/dist/client/auth-client.d.ts +44 -2
  5. package/dist/client/auth-client.d.ts.map +1 -1
  6. package/dist/client/auth-client.js +15 -1
  7. package/dist/client/auth-client.js.map +1 -1
  8. package/dist/client/backup-client.js +1 -1
  9. package/dist/client/backup-client.js.map +1 -1
  10. package/dist/client/capabilities-client.d.ts +5 -0
  11. package/dist/client/capabilities-client.d.ts.map +1 -1
  12. package/dist/client/connectors-client.js +1 -1
  13. package/dist/client/connectors-client.js.map +1 -1
  14. package/dist/client/conversations-client.d.ts +0 -1
  15. package/dist/client/conversations-client.d.ts.map +1 -1
  16. package/dist/client/conversations-client.js +1 -1
  17. package/dist/client/conversations-client.js.map +1 -1
  18. package/dist/client/hooks-client.d.ts +1 -2
  19. package/dist/client/hooks-client.d.ts.map +1 -1
  20. package/dist/client/hooks-client.js +1 -1
  21. package/dist/client/hooks-client.js.map +1 -1
  22. package/dist/client/index.d.ts +71 -12
  23. package/dist/client/index.d.ts.map +1 -1
  24. package/dist/client/index.js +1 -1
  25. package/dist/client/index.js.map +1 -1
  26. package/dist/client/interactions-client.js +1 -1
  27. package/dist/client/interactions-client.js.map +1 -1
  28. package/dist/client/login-client.d.ts +15 -2
  29. package/dist/client/login-client.d.ts.map +1 -1
  30. package/dist/client/login-client.js +38 -4
  31. package/dist/client/login-client.js.map +1 -1
  32. package/dist/client/manifest-client.js +1 -1
  33. package/dist/client/manifest-client.js.map +1 -1
  34. package/dist/client/marketplace-client.js +1 -1
  35. package/dist/client/marketplace-client.js.map +1 -1
  36. package/dist/client/observability-client.js +1 -1
  37. package/dist/client/observability-client.js.map +1 -1
  38. package/dist/client/policy-client.js +1 -1
  39. package/dist/client/policy-client.js.map +1 -1
  40. package/dist/client/presets-client.d.ts +0 -1
  41. package/dist/client/presets-client.d.ts.map +1 -1
  42. package/dist/client/presets-client.js +1 -1
  43. package/dist/client/presets-client.js.map +1 -1
  44. package/dist/client/profiles-client.d.ts +0 -1
  45. package/dist/client/profiles-client.d.ts.map +1 -1
  46. package/dist/client/profiles-client.js +1 -1
  47. package/dist/client/profiles-client.js.map +1 -1
  48. package/dist/client/schedules-client.d.ts +0 -1
  49. package/dist/client/schedules-client.d.ts.map +1 -1
  50. package/dist/client/schedules-client.js +1 -1
  51. package/dist/client/schedules-client.js.map +1 -1
  52. package/dist/client/states-client.d.ts +0 -1
  53. package/dist/client/states-client.d.ts.map +1 -1
  54. package/dist/client/states-client.js +1 -1
  55. package/dist/client/states-client.js.map +1 -1
  56. package/dist/client/storage-client.js +1 -1
  57. package/dist/client/storage-client.js.map +1 -1
  58. package/dist/client/sub-mcp-client.js +1 -1
  59. package/dist/client/sub-mcp-client.js.map +1 -1
  60. package/dist/client/system-client.js +1 -1
  61. package/dist/client/system-client.js.map +1 -1
  62. package/dist/client/tool-extensions-client.d.ts +0 -1
  63. package/dist/client/tool-extensions-client.d.ts.map +1 -1
  64. package/dist/client/tool-extensions-client.js +1 -1
  65. package/dist/client/tool-extensions-client.js.map +1 -1
  66. package/dist/client/tool-meta-client.js +1 -1
  67. package/dist/client/tool-meta-client.js.map +1 -1
  68. package/dist/client/tools-client.d.ts +2 -2
  69. package/dist/client/tools-client.js +1 -1
  70. package/dist/client/tools-client.js.map +1 -1
  71. package/dist/client/trigger-links-client.d.ts +1 -1
  72. package/dist/client/trigger-links-client.js +1 -1
  73. package/dist/client/trigger-links-client.js.map +1 -1
  74. package/dist/client/web-entry-gate-client.js +1 -1
  75. package/dist/client/web-entry-gate-client.js.map +1 -1
  76. package/dist/errors.d.ts +11 -0
  77. package/dist/errors.d.ts.map +1 -1
  78. package/dist/errors.js +15 -0
  79. package/dist/errors.js.map +1 -1
  80. package/dist/index.d.ts +12 -12
  81. package/dist/index.d.ts.map +1 -1
  82. package/dist/index.js +6 -13
  83. package/dist/index.js.map +1 -1
  84. package/dist/schemas/api-keys.d.ts +9 -0
  85. package/dist/schemas/api-keys.d.ts.map +1 -1
  86. package/dist/schemas/api-keys.js +7 -0
  87. package/dist/schemas/api-keys.js.map +1 -1
  88. package/dist/schemas/auth-routes.d.ts +3 -3
  89. package/dist/schemas/backup.d.ts.map +1 -1
  90. package/dist/schemas/backup.js.map +1 -1
  91. package/dist/schemas/capabilities.d.ts +14 -4
  92. package/dist/schemas/capabilities.d.ts.map +1 -1
  93. package/dist/schemas/capabilities.js +8 -4
  94. package/dist/schemas/capabilities.js.map +1 -1
  95. package/dist/schemas/connectors.d.ts.map +1 -1
  96. package/dist/schemas/connectors.js.map +1 -1
  97. package/dist/schemas/conversations.d.ts.map +1 -1
  98. package/dist/schemas/conversations.js.map +1 -1
  99. package/dist/schemas/fleet.d.ts.map +1 -1
  100. package/dist/schemas/fleet.js.map +1 -1
  101. package/dist/schemas/hooks.d.ts +2 -2
  102. package/dist/schemas/hooks.d.ts.map +1 -1
  103. package/dist/schemas/hooks.js.map +1 -1
  104. package/dist/schemas/index.d.ts +30 -28
  105. package/dist/schemas/index.d.ts.map +1 -1
  106. package/dist/schemas/index.js +30 -28
  107. package/dist/schemas/index.js.map +1 -1
  108. package/dist/schemas/interactions.d.ts.map +1 -1
  109. package/dist/schemas/interactions.js.map +1 -1
  110. package/dist/schemas/login.d.ts +12 -5
  111. package/dist/schemas/login.d.ts.map +1 -1
  112. package/dist/schemas/login.js +11 -4
  113. package/dist/schemas/login.js.map +1 -1
  114. package/dist/schemas/manifest-mcp.d.ts.map +1 -1
  115. package/dist/schemas/manifest-mcp.js.map +1 -1
  116. package/dist/schemas/notifications.d.ts.map +1 -1
  117. package/dist/schemas/notifications.js.map +1 -1
  118. package/dist/schemas/observability.d.ts.map +1 -1
  119. package/dist/schemas/observability.js.map +1 -1
  120. package/dist/schemas/policy.d.ts.map +1 -1
  121. package/dist/schemas/policy.js.map +1 -1
  122. package/dist/schemas/presets.d.ts.map +1 -1
  123. package/dist/schemas/presets.js.map +1 -1
  124. package/dist/schemas/principals.d.ts +54 -0
  125. package/dist/schemas/principals.d.ts.map +1 -0
  126. package/dist/schemas/principals.js +34 -0
  127. package/dist/schemas/principals.js.map +1 -0
  128. package/dist/schemas/profiles.d.ts.map +1 -1
  129. package/dist/schemas/profiles.js.map +1 -1
  130. package/dist/schemas/roles.d.ts.map +1 -1
  131. package/dist/schemas/roles.js.map +1 -1
  132. package/dist/schemas/schedules.d.ts.map +1 -1
  133. package/dist/schemas/schedules.js.map +1 -1
  134. package/dist/schemas/served.d.ts +1 -1
  135. package/dist/schemas/served.d.ts.map +1 -1
  136. package/dist/schemas/served.js +1 -1
  137. package/dist/schemas/served.js.map +1 -1
  138. package/dist/schemas/settings-schema.d.ts.map +1 -1
  139. package/dist/schemas/settings-schema.js.map +1 -1
  140. package/dist/schemas/setup.d.ts +43 -0
  141. package/dist/schemas/setup.d.ts.map +1 -0
  142. package/dist/schemas/setup.js +19 -0
  143. package/dist/schemas/setup.js.map +1 -0
  144. package/dist/schemas/states.d.ts.map +1 -1
  145. package/dist/schemas/states.js.map +1 -1
  146. package/dist/schemas/system-kinds.d.ts.map +1 -1
  147. package/dist/schemas/system-kinds.js.map +1 -1
  148. package/dist/schemas/templates.d.ts.map +1 -1
  149. package/dist/schemas/templates.js.map +1 -1
  150. package/dist/schemas/tools.d.ts.map +1 -1
  151. package/dist/schemas/tools.js.map +1 -1
  152. package/dist/schemas/trigger-links.d.ts +2 -2
  153. package/dist/schemas/trigger-links.d.ts.map +1 -1
  154. package/dist/schemas/trigger-links.js.map +1 -1
  155. package/dist/tool-runs.d.ts +4 -4
  156. package/dist/tool-runs.d.ts.map +1 -1
  157. package/dist/tool-runs.js.map +1 -1
  158. package/package.json +1 -1
  159. package/src/agents.ts +2 -2
  160. package/src/client/auth-client.ts +27 -1
  161. package/src/client/backup-client.ts +1 -1
  162. package/src/client/connectors-client.ts +1 -1
  163. package/src/client/conversations-client.ts +1 -1
  164. package/src/client/hooks-client.ts +1 -1
  165. package/src/client/index.ts +10 -10
  166. package/src/client/interactions-client.ts +1 -1
  167. package/src/client/login-client.ts +45 -4
  168. package/src/client/manifest-client.ts +1 -1
  169. package/src/client/marketplace-client.ts +1 -1
  170. package/src/client/observability-client.ts +1 -1
  171. package/src/client/policy-client.ts +1 -1
  172. package/src/client/presets-client.ts +1 -1
  173. package/src/client/profiles-client.ts +1 -1
  174. package/src/client/schedules-client.ts +1 -1
  175. package/src/client/states-client.ts +1 -1
  176. package/src/client/storage-client.ts +1 -1
  177. package/src/client/sub-mcp-client.ts +1 -1
  178. package/src/client/system-client.ts +1 -1
  179. package/src/client/tool-extensions-client.ts +1 -1
  180. package/src/client/tool-meta-client.ts +1 -1
  181. package/src/client/tools-client.ts +1 -1
  182. package/src/client/trigger-links-client.ts +1 -1
  183. package/src/client/web-entry-gate-client.ts +1 -1
  184. package/src/errors.ts +16 -0
  185. package/src/index.ts +231 -226
  186. package/src/schemas/api-keys.ts +8 -0
  187. package/src/schemas/backup.ts +1 -0
  188. package/src/schemas/capabilities.ts +9 -4
  189. package/src/schemas/connectors.ts +1 -0
  190. package/src/schemas/conversations.ts +1 -0
  191. package/src/schemas/fleet.ts +1 -0
  192. package/src/schemas/hooks.ts +1 -0
  193. package/src/schemas/index.ts +30 -28
  194. package/src/schemas/interactions.ts +1 -0
  195. package/src/schemas/login.ts +11 -4
  196. package/src/schemas/manifest-mcp.ts +1 -0
  197. package/src/schemas/notifications.ts +1 -0
  198. package/src/schemas/observability.ts +1 -0
  199. package/src/schemas/policy.ts +1 -0
  200. package/src/schemas/presets.ts +1 -0
  201. package/src/schemas/principals.ts +41 -0
  202. package/src/schemas/profiles.ts +1 -0
  203. package/src/schemas/roles.ts +1 -0
  204. package/src/schemas/schedules.ts +1 -0
  205. package/src/schemas/served.ts +2 -1
  206. package/src/schemas/settings-schema.ts +1 -0
  207. package/src/schemas/setup.ts +39 -0
  208. package/src/schemas/states.ts +1 -0
  209. package/src/schemas/system-kinds.ts +1 -0
  210. package/src/schemas/templates.ts +1 -0
  211. package/src/schemas/tools.ts +1 -0
  212. package/src/schemas/trigger-links.ts +1 -0
  213. package/src/tool-runs.ts +1 -1
@@ -1,6 +1,6 @@
1
1
  /** Web-channel entry-gate sub-client. */
2
- import * as s from '../schemas';
3
2
  import { encodeSegment } from '../http';
3
+ import * as s from '../schemas';
4
4
  import type { Transport } from './transport';
5
5
 
6
6
  /**
package/src/errors.ts CHANGED
@@ -71,6 +71,22 @@ export class ApiLoginFailedError extends Error {
71
71
  }
72
72
  }
73
73
 
74
+ /**
75
+ * A setup attempt was REJECTED — a bad or throttled token (403/429), an
76
+ * already-initialized deployment (409), an unsupported setup door (501), or an
77
+ * invalid body (400/422). Like {@link ApiLoginFailedError} it is NOT an
78
+ * ApiUnauthorizedError: it renders inline on the setup entry, keyed on `status`
79
+ * so the page shows the right copy, never a global unauthorized redirect.
80
+ */
81
+ export class ApiSetupFailedError extends Error {
82
+ readonly status: number;
83
+ constructor(message: string, status: number) {
84
+ super(message);
85
+ this.name = 'ApiSetupFailedError';
86
+ this.status = status;
87
+ }
88
+ }
89
+
74
90
  /**
75
91
  * The response body did not match its declared zod schema. This is a contract
76
92
  * drift between the Studio and the skeleton — a loud, visible error, never a
package/src/index.ts CHANGED
@@ -5,279 +5,284 @@
5
5
  * validated and every failure throws. No caching of its own — server state
6
6
  * lives in TanStack Query in the feature packages.
7
7
  */
8
- export { createApiClient, isSafeApiPath } from './client';
8
+ export type { AgentEvent, AgentSummary, ParsedAgentEvent, UnknownAgentEvent } from './agents';
9
+ export { agentEventSchema, parseAgentFrame, parseAgentTranscript } from './agents';
9
10
  export type {
11
+ AddUrlToScopeBody,
10
12
  ApiClient,
11
- RunToolArgs,
12
- ToolAdminArgs,
13
- ApiToolsListsBody,
14
- StartConnectArgs,
15
13
  ApiKeyBody,
14
+ ApiToolsListsBody,
16
15
  ClaimLinkBody,
17
- ValidateConditionBody,
18
- TopicVerifierBody,
19
- TriggerLinkCreateBody,
20
- WebEntryCodeMintBody,
21
- AddUrlToScopeBody,
16
+ ConversationMessageSearchQuery,
17
+ ConversationThreadFilters,
18
+ ConversationThreadMessageBody,
19
+ ConversationTranscriptQuery,
20
+ CreatePresetBody,
21
+ MarketplaceInstallBody,
22
+ MarketplaceInstallPreviewBody,
23
+ MarketplaceSearchQuery,
24
+ MarketplaceUninstallBody,
25
+ MetricsQuery,
26
+ PinRoutePublicBody,
22
27
  RoleCreateBody,
23
28
  RoleUpdateBody,
24
- PinRoutePublicBody,
25
- CreatePresetBody,
29
+ RunsQuery,
30
+ RunToolArgs,
26
31
  SavePresetVersionBody,
27
- ValidatePresetBody,
28
- StateDeclarationBody,
29
- StateTemplateBody,
32
+ StartConnectArgs,
30
33
  StateAttachmentBody,
31
- StateSubjectRef,
34
+ StateDeclarationBody,
32
35
  StatePageQuery,
33
- ToolMetaPatch,
36
+ StateSubjectRef,
37
+ StateTemplateBody,
34
38
  StorageUploadBody,
35
- ConversationThreadFilters,
36
- ConversationTranscriptQuery,
37
- ConversationMessageSearchQuery,
38
- ConversationThreadMessageBody,
39
- MetricsQuery,
40
- RunsQuery,
41
- MarketplaceSearchQuery,
42
- MarketplaceInstallBody,
43
- MarketplaceInstallPreviewBody,
44
- MarketplaceUninstallBody,
39
+ ToolAdminArgs,
40
+ ToolMetaPatch,
41
+ TopicVerifierBody,
42
+ TriggerLinkCreateBody,
43
+ ValidateConditionBody,
44
+ ValidatePresetBody,
45
+ WebEntryCodeMintBody,
45
46
  } from './client';
46
- export type { ApiConfig, RequestOptions } from './http';
47
- export { apiRequest, apiText, apiDownload } from './http';
47
+ export { createApiClient, isSafeApiPath } from './client';
48
48
  export {
49
- ApiError,
50
- ApiUnauthorizedError,
51
49
  ApiConflictError,
50
+ ApiError,
52
51
  ApiLoginFailedError,
53
52
  ApiSchemaError,
53
+ ApiSetupFailedError,
54
+ ApiUnauthorizedError,
54
55
  } from './errors';
55
- export { SseFrameParser, readSseFrames } from './sse';
56
- export type { SseFrame } from './sse';
57
- export { parseAgentFrame, parseAgentTranscript, agentEventSchema } from './agents';
58
- export type { AgentSummary, AgentEvent, UnknownAgentEvent, ParsedAgentEvent } from './agents';
59
- export {
60
- toolRunStatus,
61
- toolRunSubmitResult,
62
- toolRunRecord,
63
- toolRunListItem,
64
- toolRunList,
65
- isTerminalRunStatus,
66
- } from './tool-runs';
67
- export type {
68
- ToolRunStatus,
69
- ToolRunSubmitResult,
70
- ToolRunRecord,
71
- ToolRunListItem,
72
- SubmitToolRunArgs,
73
- } from './tool-runs';
74
- export {
75
- summarizeFleetResult,
76
- summarizeFleetFanout,
77
- isFleetReportFailure,
78
- failedMcpsFromReport,
79
- } from './fleet-report';
80
56
  export type {
81
- FleetReportSummary,
57
+ FailedMcpEntry,
58
+ FleetFailureOutcome,
82
59
  FleetReportStatus,
60
+ FleetReportSummary,
83
61
  FleetWorkerFailure,
84
- FleetFailureOutcome,
85
- FailedMcpEntry,
86
62
  } from './fleet-report';
87
- export * as schemas from './schemas';
63
+ export {
64
+ failedMcpsFromReport,
65
+ isFleetReportFailure,
66
+ summarizeFleetFanout,
67
+ summarizeFleetResult,
68
+ } from './fleet-report';
69
+ export type { ApiConfig, RequestOptions } from './http';
70
+ export { apiDownload, apiRequest, apiText } from './http';
88
71
  export type {
89
- TemplatedText,
90
- ToolSchema,
91
- ToolMediaResult,
92
- ToolTagEntry,
93
- AuthRoute,
94
- RouteAction,
95
- GrantLevel,
96
- RoleGrants,
97
- RoleBody,
98
- RoleVersion,
99
- RoleAuditEvent,
100
- RoleVersions,
101
- PresetRecord,
102
- PresetDetail,
103
- PresetBody,
104
- PresetVersion,
105
- PresetRenamed,
106
- PresetReferees,
107
- PresetValidation,
108
- PresetVersionTags,
109
- PresetExtensionElement,
110
- StateSubject,
111
- StateDeclaration,
112
- StateListItem,
113
- StateAttachment,
114
- StateDetail,
115
- StateStats,
116
- TemplateJq,
117
- TemplateReconcile,
118
- TemplateDeclarations,
119
- StateTemplateDocument,
120
- StateTemplateListItem,
121
- StateInjection,
122
- StateUpdate,
123
- StateAttach,
124
- StateBinding,
125
- StateRecord,
72
+ AnswerFormat,
126
73
  ApplyResult,
127
- TemplateJqResult,
128
- TemplateJqApplyResult,
129
- SubjectRow,
130
- SubjectPage,
131
- RecordSearchPage,
74
+ AuthCapabilities,
75
+ AuthRoute,
76
+ BackendInfo,
77
+ BackupDocument,
78
+ BackupImportReport,
79
+ Channels,
80
+ ChannelTemplate,
81
+ ClaimLinkCreated,
132
82
  CompletedOrigin,
133
- WriteEntry,
134
- WritesPage,
135
- ConsumerLink,
136
- ConsumerRow,
137
- StateConsumers,
138
- StateAttached,
139
- StateAttachmentUpdated,
140
- StateDetached,
141
- StateFoldReport,
142
- StateRetentionPruned,
143
- FolderRecord,
144
- ToolMetaRecord,
145
- ToolMetaOverlay,
146
- PolicyBody,
147
- PolicyVersion,
148
- ValidateConditionResult,
149
- Extension,
150
- ToolExtensions,
151
- ToolExtensionsApplyResult,
152
- ProviderView,
83
+ ConnectionView,
153
84
  ConnectorCategoryView,
154
- ProviderCatalogResponse,
155
85
  ConnectorRef,
156
- ManifestMcpEntry,
157
- McpEnvRef,
158
- McpEnvRefs,
159
- ConnectionView,
160
- OAuthCompleteResult,
161
- StudioPluginManifest,
162
- Interaction,
163
- InteractionAnswered,
164
- InteractionCancelled,
165
- InteractionsPage,
166
- InteractionMediaItem,
167
- FormOption,
168
- FormData,
169
- FormPage,
170
- FormPages,
171
- MediaKind,
172
- AnswerFormat,
173
- Channels,
86
+ ConsumerLink,
87
+ ConsumerRow,
88
+ ConversationAnswerStatus,
89
+ ConversationConfigDeleted,
90
+ ConversationConfigs,
91
+ ConversationConfigWritten,
92
+ ConversationDeliveryStatus,
174
93
  ConversationDoor,
175
- ConversationTargetKind,
94
+ ConversationFailedMessages,
95
+ ConversationMessage,
96
+ ConversationMessageSearchPage,
176
97
  ConversationMode,
177
- ConversationDeliveryStatus,
178
- ConversationAnswerStatus,
98
+ ConversationPersonDeleted,
99
+ ConversationRecordOrigin,
179
100
  ConversationRoute,
180
- ConversationRoutes,
181
101
  ConversationRouteCreate,
182
- ConversationRouteWritten,
183
102
  ConversationRouteDeleted,
103
+ ConversationRoutes,
104
+ ConversationRouteWritten,
105
+ ConversationTargetKind,
184
106
  ConversationThread,
185
- ConversationThreadsPage,
186
- ConversationMessage,
187
- ConversationRecordOrigin,
188
- TranscriptOrder,
189
- ConversationTranscriptPage,
190
- ConversationMessageSearchPage,
107
+ ConversationThreadDeleted,
108
+ ConversationThreadMessageSent,
191
109
  ConversationThreadMode,
192
110
  ConversationThreadModeState,
193
- ConversationThreadMessageSent,
194
- TargetConversationConfig,
195
- ConversationConfigs,
196
- ConversationConfigWritten,
197
- ConversationConfigDeleted,
198
- ConversationFailedMessages,
199
- ConversationThreadDeleted,
200
- ConversationPersonDeleted,
201
- WebEntryCode,
202
- WebEntryGate,
203
- WebEntryGateState,
204
- WebEntryCodeMinted,
205
- WebEntryCodeRevoked,
206
- Notification,
207
- Notifications,
208
- ChannelTemplate,
111
+ ConversationThreadsPage,
112
+ ConversationTranscriptPage,
113
+ DashboardMetrics,
114
+ Extension,
115
+ FleetOutcome,
116
+ FleetReloadResult,
117
+ FleetReportFanout,
118
+ FleetResult,
119
+ FleetWorker,
120
+ FleetWorkerResult,
121
+ FleetWorkers,
122
+ FolderRecord,
123
+ FormData,
124
+ FormOption,
125
+ FormPage,
126
+ FormPages,
127
+ GrantLevel,
128
+ HookList,
209
129
  HookParams,
210
130
  HookRegister,
211
131
  HookSubject,
212
- HookList,
213
- TriggerAuth,
214
- SettingsSchema,
215
- TokensPayload,
132
+ Interaction,
133
+ InteractionAnswered,
134
+ InteractionCancelled,
135
+ InteractionMediaItem,
136
+ InteractionsPage,
137
+ KindStatus,
216
138
  LoginFormField,
217
139
  LoginMethod,
218
140
  LoginMethods,
219
141
  LoginResult,
220
- MeProjection,
221
- RouteEntry,
222
- PatternEntry,
223
- SubMcpEntry,
224
- SubMcpMount,
225
- ClaimLinkCreated,
226
- TriggerLinkCreated,
227
- TriggerLinkRecord,
228
- TriggerLinkList,
229
- TriggerLinkDeleted,
230
142
  LogoutResult,
231
- AuthCapabilities,
232
- BackupDocument,
233
- BackupImportReport,
234
- ScheduleItem,
235
- StorageInfo,
236
- StorageResourceStat,
237
- BackendInfo,
238
- WorkerKind,
239
- WorkerState,
240
- WorkerLastOp,
241
- FleetWorker,
242
- FleetWorkers,
243
- FleetOutcome,
244
- FleetWorkerResult,
245
- FleetResult,
246
- FleetReloadResult,
247
- FleetReportFanout,
248
- ReloadConfigResult,
249
- McpReloadResult,
250
- KindStatus,
251
- DashboardMetrics,
252
- Run,
253
- RunSpan,
254
- RunTrace,
255
- MarketplaceItem,
256
- MarketplaceDelivery,
257
- MarketplaceSource,
258
- MarketplaceRequiredEnvVar,
259
- MarketplaceRouteDecl,
260
- MarketplaceRoutesDecl,
261
- MarketplaceSearchKind,
262
- MarketplaceSearchGroup,
263
- MarketplaceSearchRow,
264
- MarketplaceSearchPage,
265
- MarketplaceVersion,
266
- MarketplaceLatestVersion,
143
+ ManifestMcpEntry,
267
144
  MarketplaceAdvisory,
268
- MarketplacePluginDetail,
145
+ MarketplaceDelivery,
146
+ MarketplaceInstalled,
269
147
  MarketplaceInstalledCompat,
270
148
  MarketplaceInstalledPlugin,
271
- MarketplaceQuarantinedPlugin,
272
- MarketplaceInstalled,
273
- MarketplaceUpgradeAllRow,
274
- MarketplaceUpgradeAllResult,
149
+ MarketplaceInstallPreview,
275
150
  MarketplaceInstallResult,
151
+ MarketplaceItem,
152
+ MarketplaceLatestVersion,
276
153
  MarketplaceMountedRoute,
277
- MarketplacePreviewRoute,
278
- MarketplacePreviewItem,
154
+ MarketplacePluginDetail,
279
155
  MarketplacePreviewCollision,
156
+ MarketplacePreviewItem,
280
157
  MarketplacePreviewPublicRoute,
281
- MarketplaceInstallPreview,
158
+ MarketplacePreviewRoute,
159
+ MarketplaceQuarantinedPlugin,
160
+ MarketplaceRequiredEnvVar,
161
+ MarketplaceRouteDecl,
162
+ MarketplaceRoutesDecl,
163
+ MarketplaceSearchGroup,
164
+ MarketplaceSearchKind,
165
+ MarketplaceSearchPage,
166
+ MarketplaceSearchRow,
167
+ MarketplaceSource,
282
168
  MarketplaceUninstallResult,
169
+ MarketplaceUpgradeAllResult,
170
+ MarketplaceUpgradeAllRow,
171
+ MarketplaceVersion,
172
+ McpEnvRef,
173
+ McpEnvRefs,
174
+ McpReloadResult,
175
+ MediaKind,
176
+ MeProjection,
177
+ Notification,
178
+ Notifications,
179
+ OAuthCompleteResult,
180
+ PatternEntry,
181
+ PolicyBody,
182
+ PolicyVersion,
183
+ PresetBody,
184
+ PresetDetail,
185
+ PresetExtensionElement,
186
+ PresetRecord,
187
+ PresetReferees,
188
+ PresetRenamed,
189
+ PresetValidation,
190
+ PresetVersion,
191
+ PresetVersionTags,
192
+ Principal,
193
+ PrincipalRef,
194
+ ProviderCatalogResponse,
195
+ ProviderView,
196
+ RecordSearchPage,
197
+ ReloadConfigResult,
198
+ RoleAuditEvent,
199
+ RoleBody,
200
+ RoleGrants,
201
+ RoleVersion,
202
+ RoleVersions,
203
+ RouteAction,
204
+ RouteEntry,
205
+ Run,
206
+ RunSpan,
207
+ RunTrace,
208
+ ScheduleItem,
209
+ SettingsSchema,
210
+ SetupBody,
211
+ SetupResult,
212
+ StateAttach,
213
+ StateAttached,
214
+ StateAttachment,
215
+ StateAttachmentUpdated,
216
+ StateBinding,
217
+ StateConsumers,
218
+ StateDeclaration,
219
+ StateDetached,
220
+ StateDetail,
221
+ StateFoldReport,
222
+ StateInjection,
223
+ StateListItem,
224
+ StateRecord,
225
+ StateRetentionPruned,
226
+ StateStats,
227
+ StateSubject,
228
+ StateTemplateDocument,
229
+ StateTemplateListItem,
230
+ StateUpdate,
231
+ StorageInfo,
232
+ StorageResourceStat,
233
+ StudioPluginManifest,
234
+ SubjectPage,
235
+ SubjectRow,
236
+ SubMcpEntry,
237
+ SubMcpMount,
238
+ TargetConversationConfig,
239
+ TemplateDeclarations,
240
+ TemplatedText,
241
+ TemplateJq,
242
+ TemplateJqApplyResult,
243
+ TemplateJqResult,
244
+ TemplateReconcile,
245
+ TokensPayload,
246
+ ToolExtensions,
247
+ ToolExtensionsApplyResult,
248
+ ToolMediaResult,
249
+ ToolMetaOverlay,
250
+ ToolMetaRecord,
251
+ ToolSchema,
252
+ ToolTagEntry,
253
+ TranscriptOrder,
254
+ TriggerAuth,
255
+ TriggerLinkCreated,
256
+ TriggerLinkDeleted,
257
+ TriggerLinkList,
258
+ TriggerLinkRecord,
259
+ ValidateConditionResult,
260
+ WebEntryCode,
261
+ WebEntryCodeMinted,
262
+ WebEntryCodeRevoked,
263
+ WebEntryGate,
264
+ WebEntryGateState,
265
+ WorkerKind,
266
+ WorkerLastOp,
267
+ WorkerState,
268
+ WriteEntry,
269
+ WritesPage,
283
270
  } from './schemas';
271
+ export * as schemas from './schemas';
272
+ export type { SseFrame } from './sse';
273
+ export { readSseFrames, SseFrameParser } from './sse';
274
+ export type {
275
+ SubmitToolRunArgs,
276
+ ToolRunListItem,
277
+ ToolRunRecord,
278
+ ToolRunStatus,
279
+ ToolRunSubmitResult,
280
+ } from './tool-runs';
281
+ export {
282
+ isTerminalRunStatus,
283
+ toolRunList,
284
+ toolRunListItem,
285
+ toolRunRecord,
286
+ toolRunStatus,
287
+ toolRunSubmitResult,
288
+ } from './tool-runs';
@@ -1,5 +1,7 @@
1
1
  /** API-key payload and mint/edit/revoke response schemas. */
2
2
  import { z } from 'zod';
3
+
4
+ import { principalRef } from './principals';
3
5
  import { templatedText } from './served';
4
6
  import { jsonValue } from './shared';
5
7
 
@@ -13,6 +15,12 @@ export const tokensPayload = z.array(
13
15
  scopes: z.array(z.string()),
14
16
  policy_data: jsonValue,
15
17
  condition: templatedText.nullable().optional(),
18
+ // The key's OWNER principal (kind + display name); `null` for a key whose
19
+ // principal row is absent (an orphaned restore state).
20
+ principal: principalRef.nullable().optional(),
21
+ // `true` for a key whose owning principal row is gone (an orphaned key that a
22
+ // backup restore left without its principal).
23
+ orphaned: z.boolean().optional(),
16
24
  }),
17
25
  );
18
26
  export type TokensPayload = z.infer<typeof tokensPayload>;
@@ -1,5 +1,6 @@
1
1
  /** Backup section, document and import-report response schemas. */
2
2
  import { z } from 'zod';
3
+
3
4
  import { fleetReportFanout } from './fleet';
4
5
 
5
6
  export const backupSections = z.array(z.object({ name: z.string(), secret: z.boolean() }));
@@ -1,5 +1,7 @@
1
1
  /** Caller capability projection and auth-capabilities schemas. */
2
2
  import { z } from 'zod';
3
+
4
+ import { principalRef } from './principals';
3
5
  import { subMcpMount } from './sub-mcp';
4
6
 
5
7
  /** A concrete route the caller can reach, with the methods that pass its jq fence. */
@@ -31,15 +33,18 @@ export type SubMcpEntry = z.infer<typeof subMcpEntry>;
31
33
  * `GET /api/auth/me` — the caller's derived capability projection: the concrete
32
34
  * (path, method) surface, dynamic patterns, sub-MCP mounts, tools, and agents it
33
35
  * can reach RIGHT NOW (derived server-side, never stored). `admin` is the
34
- * condition-free ownerless `"*"` discriminator (a TOTAL projection); a scoped
36
+ * condition-free `"*"` discriminator (a TOTAL projection); a scoped
35
37
  * session carries `admin: false` and a jq-exact `routes` list. `owner_user_id` is
36
- * the key's owner claim, `null` for an ownerless key. The invariant is
37
- * projection ⊆ gate: every projected surface is one the server would admit, so
38
- * the UI can filter on it without ever advertising a door the gate denies.
38
+ * the key's owner claim, `null` for a key with no owner claim. `principal` is the
39
+ * caller's principal (kind + display name), `null` when no principal row backs the
40
+ * credential. The invariant is projection ⊆ gate: every projected surface is one
41
+ * the server would admit, so the UI can filter on it without ever advertising a
42
+ * door the gate denies.
39
43
  */
40
44
  export const meProjection = z.object({
41
45
  user_id: z.string(),
42
46
  owner_user_id: z.string().nullable(),
47
+ principal: principalRef.nullable().optional(),
43
48
  admin: z.boolean(),
44
49
  scopes: z.array(z.string()),
45
50
  routes: z.array(routeEntry),
@@ -1,5 +1,6 @@
1
1
  /** Connector provider catalog and connection lifecycle schemas. */
2
2
  import { z } from 'zod';
3
+
3
4
  import { fleetReportFanout } from './fleet';
4
5
 
5
6
  export const subServiceView = z.object({
@@ -1,5 +1,6 @@
1
1
  /** Conversation route, thread, transcript and config schemas. */
2
2
  import { z } from 'zod';
3
+
3
4
  import { conversationRoute, targetConversationConfig } from './served';
4
5
  import { pageWindow } from './shared';
5
6
 
@@ -1,5 +1,6 @@
1
1
  /** Backend identity and worker-bus fleet/fan-out response schemas. */
2
2
  import { z } from 'zod';
3
+
3
4
  import { jsonValue } from './shared';
4
5
 
5
6
  /** `GET /api/backend` — the execution-backend identity, or the absent sentinel
@@ -1,5 +1,6 @@
1
1
  /** Hook listing, registration and topic-verifier response schemas. */
2
2
  import { z } from 'zod';
3
+
3
4
  import { hookParams } from './served';
4
5
 
5
6
  // The hand-written hook response DTOs: the fire-door authority enum, the list rows and