@tai42/api-client 20.0.0 → 21.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.
- package/README.md +29 -0
- package/dist/agents.d.ts.map +1 -1
- package/dist/agents.js +6 -4
- package/dist/agents.js.map +1 -1
- package/dist/client/agents-client.d.ts.map +1 -1
- package/dist/client/agents-client.js +3 -2
- package/dist/client/agents-client.js.map +1 -1
- package/dist/client/auth-client.d.ts +129 -127
- package/dist/client/auth-client.d.ts.map +1 -1
- package/dist/client/auth-client.js +68 -28
- package/dist/client/auth-client.js.map +1 -1
- package/dist/client/backend-client.d.ts +14 -13
- package/dist/client/backend-client.d.ts.map +1 -1
- package/dist/client/backend-client.js +7 -3
- package/dist/client/backend-client.js.map +1 -1
- package/dist/client/backup-client.d.ts +45 -19
- package/dist/client/backup-client.d.ts.map +1 -1
- package/dist/client/backup-client.js +8 -3
- package/dist/client/backup-client.js.map +1 -1
- package/dist/client/capabilities-client.d.ts +20 -16
- package/dist/client/capabilities-client.d.ts.map +1 -1
- package/dist/client/capabilities-client.js +3 -2
- package/dist/client/capabilities-client.js.map +1 -1
- package/dist/client/channels-client.d.ts.map +1 -1
- package/dist/client/channels-client.js +2 -1
- package/dist/client/channels-client.js.map +1 -1
- package/dist/client/config-client.d.ts +44 -17
- package/dist/client/config-client.d.ts.map +1 -1
- package/dist/client/config-client.js +10 -4
- package/dist/client/config-client.js.map +1 -1
- package/dist/client/connectors-client.d.ts +270 -81
- package/dist/client/connectors-client.d.ts.map +1 -1
- package/dist/client/connectors-client.js +38 -10
- package/dist/client/connectors-client.js.map +1 -1
- package/dist/client/conversations-client.d.ts +440 -86
- package/dist/client/conversations-client.d.ts.map +1 -1
- package/dist/client/conversations-client.js +46 -17
- package/dist/client/conversations-client.js.map +1 -1
- package/dist/client/hooks-client.d.ts +3 -3
- package/dist/client/hooks-client.d.ts.map +1 -1
- package/dist/client/hooks-client.js +12 -7
- package/dist/client/hooks-client.js.map +1 -1
- package/dist/client/index.d.ts +2272 -914
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +10 -2
- package/dist/client/index.js.map +1 -1
- package/dist/client/interactions-client.d.ts +19 -14
- package/dist/client/interactions-client.d.ts.map +1 -1
- package/dist/client/interactions-client.js +21 -9
- package/dist/client/interactions-client.js.map +1 -1
- package/dist/client/login-client.d.ts +18 -17
- package/dist/client/login-client.d.ts.map +1 -1
- package/dist/client/login-client.js +8 -4
- package/dist/client/login-client.js.map +1 -1
- package/dist/client/manifest-client.d.ts +276 -105
- package/dist/client/manifest-client.d.ts.map +1 -1
- package/dist/client/manifest-client.js +22 -16
- package/dist/client/manifest-client.js.map +1 -1
- package/dist/client/marketplace-client.d.ts +181 -51
- package/dist/client/marketplace-client.d.ts.map +1 -1
- package/dist/client/marketplace-client.js +23 -12
- package/dist/client/marketplace-client.js.map +1 -1
- package/dist/client/mcp-config-schema-client.d.ts.map +1 -1
- package/dist/client/mcp-config-schema-client.js +2 -1
- package/dist/client/mcp-config-schema-client.js.map +1 -1
- package/dist/client/notifications-client.d.ts +43 -6
- package/dist/client/notifications-client.d.ts.map +1 -1
- package/dist/client/notifications-client.js +2 -1
- package/dist/client/notifications-client.js.map +1 -1
- package/dist/client/observability-client.d.ts +78 -38
- package/dist/client/observability-client.d.ts.map +1 -1
- package/dist/client/observability-client.js +29 -6
- package/dist/client/observability-client.js.map +1 -1
- package/dist/client/plugins-client.d.ts +8 -6
- package/dist/client/plugins-client.d.ts.map +1 -1
- package/dist/client/plugins-client.js +2 -1
- package/dist/client/plugins-client.js.map +1 -1
- package/dist/client/policy-client.d.ts +4 -4
- package/dist/client/policy-client.d.ts.map +1 -1
- package/dist/client/policy-client.js +11 -4
- package/dist/client/policy-client.js.map +1 -1
- package/dist/client/presets-client.d.ts +84 -39
- package/dist/client/presets-client.d.ts.map +1 -1
- package/dist/client/presets-client.js +25 -13
- package/dist/client/presets-client.js.map +1 -1
- package/dist/client/profiles-client.d.ts +40 -33
- package/dist/client/profiles-client.d.ts.map +1 -1
- package/dist/client/profiles-client.js +15 -10
- package/dist/client/profiles-client.js.map +1 -1
- package/dist/client/schedules-client.d.ts +21 -17
- package/dist/client/schedules-client.d.ts.map +1 -1
- package/dist/client/schedules-client.js +8 -5
- package/dist/client/schedules-client.js.map +1 -1
- package/dist/client/settings-schema-client.d.ts +1 -1
- package/dist/client/settings-schema-client.d.ts.map +1 -1
- package/dist/client/settings-schema-client.js +2 -1
- package/dist/client/settings-schema-client.js.map +1 -1
- package/dist/client/states-client.d.ts +215 -87
- package/dist/client/states-client.d.ts.map +1 -1
- package/dist/client/states-client.js +98 -37
- package/dist/client/states-client.js.map +1 -1
- package/dist/client/storage-client.d.ts +5 -5
- package/dist/client/storage-client.d.ts.map +1 -1
- package/dist/client/storage-client.js +24 -12
- package/dist/client/storage-client.js.map +1 -1
- package/dist/client/sub-mcp-client.d.ts +3 -1
- package/dist/client/sub-mcp-client.d.ts.map +1 -1
- package/dist/client/sub-mcp-client.js +9 -4
- package/dist/client/sub-mcp-client.js.map +1 -1
- package/dist/client/system-client.d.ts +2 -2
- package/dist/client/system-client.d.ts.map +1 -1
- package/dist/client/system-client.js +2 -1
- package/dist/client/system-client.js.map +1 -1
- package/dist/client/templates-client.d.ts +65 -6
- package/dist/client/templates-client.d.ts.map +1 -1
- package/dist/client/templates-client.js +25 -7
- package/dist/client/templates-client.js.map +1 -1
- package/dist/client/tool-extensions-client.d.ts +41 -16
- package/dist/client/tool-extensions-client.d.ts.map +1 -1
- package/dist/client/tool-extensions-client.js +6 -4
- package/dist/client/tool-extensions-client.js.map +1 -1
- package/dist/client/tool-meta-client.d.ts +8 -8
- package/dist/client/tool-meta-client.d.ts.map +1 -1
- package/dist/client/tool-meta-client.js +12 -8
- package/dist/client/tool-meta-client.js.map +1 -1
- package/dist/client/tools-client.d.ts +150 -23
- package/dist/client/tools-client.d.ts.map +1 -1
- package/dist/client/tools-client.js +8 -8
- package/dist/client/tools-client.js.map +1 -1
- package/dist/client/trigger-links-client.d.ts +11 -9
- package/dist/client/trigger-links-client.d.ts.map +1 -1
- package/dist/client/trigger-links-client.js +4 -4
- package/dist/client/trigger-links-client.js.map +1 -1
- package/dist/fleet-report.d.ts +21 -5
- package/dist/fleet-report.d.ts.map +1 -1
- package/dist/fleet-report.js +31 -6
- package/dist/fleet-report.js.map +1 -1
- package/dist/generated/api-routes.d.ts +1014 -0
- package/dist/generated/api-routes.d.ts.map +1 -0
- package/dist/generated/api-routes.js +322 -0
- package/dist/generated/api-routes.js.map +1 -0
- package/dist/generated/openapi-schemas.d.ts +12425 -0
- package/dist/generated/openapi-schemas.d.ts.map +1 -0
- package/dist/generated/openapi-schemas.js +671 -0
- package/dist/generated/openapi-schemas.js.map +1 -0
- package/dist/generated/served-schemas.d.ts +6698 -349
- package/dist/generated/served-schemas.d.ts.map +1 -1
- package/dist/generated/served-schemas.js +7062 -21
- package/dist/generated/served-schemas.js.map +1 -1
- package/dist/headers.d.ts +4 -0
- package/dist/headers.d.ts.map +1 -0
- package/dist/headers.js +4 -0
- package/dist/headers.js.map +1 -0
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +4 -3
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/schemas/api-keys.d.ts +14 -12
- package/dist/schemas/api-keys.d.ts.map +1 -1
- package/dist/schemas/api-keys.js +9 -23
- package/dist/schemas/api-keys.js.map +1 -1
- package/dist/schemas/auth-routes.d.ts +34 -29
- package/dist/schemas/auth-routes.d.ts.map +1 -1
- package/dist/schemas/auth-routes.js +22 -27
- package/dist/schemas/auth-routes.js.map +1 -1
- package/dist/schemas/backup.d.ts +157 -36
- package/dist/schemas/backup.d.ts.map +1 -1
- package/dist/schemas/backup.js +27 -26
- package/dist/schemas/backup.js.map +1 -1
- package/dist/schemas/capabilities.d.ts +32 -22
- package/dist/schemas/capabilities.d.ts.map +1 -1
- package/dist/schemas/capabilities.js +15 -40
- package/dist/schemas/capabilities.js.map +1 -1
- package/dist/schemas/channels.d.ts +1 -1
- package/dist/schemas/channels.d.ts.map +1 -1
- package/dist/schemas/channels.js +2 -5
- package/dist/schemas/channels.js.map +1 -1
- package/dist/schemas/config.d.ts.map +1 -1
- package/dist/schemas/config.js +4 -6
- package/dist/schemas/config.js.map +1 -1
- package/dist/schemas/connectors.d.ts +381 -185
- package/dist/schemas/connectors.d.ts.map +1 -1
- package/dist/schemas/connectors.js +54 -101
- package/dist/schemas/connectors.js.map +1 -1
- package/dist/schemas/conversations.d.ts +977 -248
- package/dist/schemas/conversations.d.ts.map +1 -1
- package/dist/schemas/conversations.js +40 -134
- package/dist/schemas/conversations.js.map +1 -1
- package/dist/schemas/extensions.d.ts +9 -6
- package/dist/schemas/extensions.d.ts.map +1 -1
- package/dist/schemas/extensions.js +6 -4
- package/dist/schemas/extensions.js.map +1 -1
- package/dist/schemas/fleet.d.ts +153 -99
- package/dist/schemas/fleet.d.ts.map +1 -1
- package/dist/schemas/fleet.js +41 -51
- package/dist/schemas/fleet.js.map +1 -1
- package/dist/schemas/hooks.d.ts +34 -34
- package/dist/schemas/hooks.d.ts.map +1 -1
- package/dist/schemas/hooks.js +15 -34
- package/dist/schemas/hooks.js.map +1 -1
- package/dist/schemas/index.d.ts +0 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +0 -1
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/interactions.d.ts +150 -127
- package/dist/schemas/interactions.d.ts.map +1 -1
- package/dist/schemas/interactions.js +44 -129
- package/dist/schemas/interactions.js.map +1 -1
- package/dist/schemas/login.d.ts +36 -37
- package/dist/schemas/login.d.ts.map +1 -1
- package/dist/schemas/login.js +8 -42
- package/dist/schemas/login.js.map +1 -1
- package/dist/schemas/manifest-mcp.d.ts +61 -35
- package/dist/schemas/manifest-mcp.d.ts.map +1 -1
- package/dist/schemas/manifest-mcp.js +13 -19
- package/dist/schemas/manifest-mcp.js.map +1 -1
- package/dist/schemas/marketplace.d.ts +219 -133
- package/dist/schemas/marketplace.d.ts.map +1 -1
- package/dist/schemas/marketplace.js +35 -120
- package/dist/schemas/marketplace.js.map +1 -1
- package/dist/schemas/members.d.ts +59 -52
- package/dist/schemas/members.d.ts.map +1 -1
- package/dist/schemas/members.js +20 -52
- package/dist/schemas/members.js.map +1 -1
- package/dist/schemas/notifications.d.ts +115 -17
- package/dist/schemas/notifications.d.ts.map +1 -1
- package/dist/schemas/notifications.js +9 -35
- package/dist/schemas/notifications.js.map +1 -1
- package/dist/schemas/observability.d.ts +174 -72
- package/dist/schemas/observability.d.ts.map +1 -1
- package/dist/schemas/observability.js +23 -76
- package/dist/schemas/observability.js.map +1 -1
- package/dist/schemas/policy.d.ts +11 -11
- package/dist/schemas/policy.d.ts.map +1 -1
- package/dist/schemas/policy.js +5 -12
- package/dist/schemas/policy.js.map +1 -1
- package/dist/schemas/presets.d.ts +109 -64
- package/dist/schemas/presets.d.ts.map +1 -1
- package/dist/schemas/presets.js +12 -48
- package/dist/schemas/presets.js.map +1 -1
- package/dist/schemas/principals.d.ts +28 -21
- package/dist/schemas/principals.d.ts.map +1 -1
- package/dist/schemas/principals.js +13 -25
- package/dist/schemas/principals.js.map +1 -1
- package/dist/schemas/profiles.d.ts +75 -63
- package/dist/schemas/profiles.d.ts.map +1 -1
- package/dist/schemas/profiles.js +24 -54
- package/dist/schemas/profiles.js.map +1 -1
- package/dist/schemas/roles.d.ts +22 -22
- package/dist/schemas/roles.d.ts.map +1 -1
- package/dist/schemas/roles.js +10 -17
- package/dist/schemas/roles.js.map +1 -1
- package/dist/schemas/schedules.d.ts +21 -15
- package/dist/schemas/schedules.d.ts.map +1 -1
- package/dist/schemas/schedules.js +4 -13
- package/dist/schemas/schedules.js.map +1 -1
- package/dist/schemas/served.d.ts +6373 -181
- package/dist/schemas/served.d.ts.map +1 -1
- package/dist/schemas/served.js +21 -0
- package/dist/schemas/served.js.map +1 -1
- package/dist/schemas/settings-schema.d.ts +1 -1
- package/dist/schemas/settings-schema.d.ts.map +1 -1
- package/dist/schemas/settings-schema.js +17 -19
- package/dist/schemas/settings-schema.js.map +1 -1
- package/dist/schemas/setup.d.ts +6 -6
- package/dist/schemas/setup.d.ts.map +1 -1
- package/dist/schemas/setup.js +2 -11
- package/dist/schemas/setup.js.map +1 -1
- package/dist/schemas/states.d.ts +450 -135
- package/dist/schemas/states.d.ts.map +1 -1
- package/dist/schemas/states.js +76 -140
- package/dist/schemas/states.js.map +1 -1
- package/dist/schemas/storage.d.ts +7 -8
- package/dist/schemas/storage.d.ts.map +1 -1
- package/dist/schemas/storage.js +8 -17
- package/dist/schemas/storage.js.map +1 -1
- package/dist/schemas/studio-plugins.d.ts +24 -18
- package/dist/schemas/studio-plugins.d.ts.map +1 -1
- package/dist/schemas/studio-plugins.js +5 -19
- package/dist/schemas/studio-plugins.js.map +1 -1
- package/dist/schemas/sub-mcp.d.ts +11 -8
- package/dist/schemas/sub-mcp.d.ts.map +1 -1
- package/dist/schemas/sub-mcp.js +10 -19
- package/dist/schemas/sub-mcp.js.map +1 -1
- package/dist/schemas/system-kinds.d.ts +76 -46
- package/dist/schemas/system-kinds.d.ts.map +1 -1
- package/dist/schemas/system-kinds.js +11 -28
- package/dist/schemas/system-kinds.js.map +1 -1
- package/dist/schemas/templates.d.ts +83 -25
- package/dist/schemas/templates.d.ts.map +1 -1
- package/dist/schemas/templates.js +8 -9
- package/dist/schemas/templates.js.map +1 -1
- package/dist/schemas/tool-meta.d.ts +15 -15
- package/dist/schemas/tool-meta.d.ts.map +1 -1
- package/dist/schemas/tool-meta.js +6 -21
- package/dist/schemas/tool-meta.js.map +1 -1
- package/dist/schemas/tools.d.ts +177 -56
- package/dist/schemas/tools.d.ts.map +1 -1
- package/dist/schemas/tools.js +20 -41
- package/dist/schemas/tools.js.map +1 -1
- package/dist/schemas/trigger-links.d.ts +22 -17
- package/dist/schemas/trigger-links.d.ts.map +1 -1
- package/dist/schemas/trigger-links.js +7 -27
- package/dist/schemas/trigger-links.js.map +1 -1
- package/dist/tool-runs.d.ts +175 -54
- package/dist/tool-runs.d.ts.map +1 -1
- package/dist/tool-runs.js +33 -34
- package/dist/tool-runs.js.map +1 -1
- package/package.json +4 -3
- package/src/agents.ts +16 -4
- package/src/client/agents-client.ts +3 -2
- package/src/client/auth-client.ts +102 -37
- package/src/client/backend-client.ts +8 -3
- package/src/client/backup-client.ts +8 -3
- package/src/client/capabilities-client.ts +4 -2
- package/src/client/channels-client.ts +3 -1
- package/src/client/config-client.ts +13 -5
- package/src/client/connectors-client.ts +91 -16
- package/src/client/conversations-client.ts +79 -30
- package/src/client/hooks-client.ts +25 -12
- package/src/client/index.ts +16 -4
- package/src/client/interactions-client.ts +40 -16
- package/src/client/login-client.ts +8 -4
- package/src/client/manifest-client.ts +48 -24
- package/src/client/marketplace-client.ts +23 -12
- package/src/client/mcp-config-schema-client.ts +2 -1
- package/src/client/notifications-client.ts +2 -1
- package/src/client/observability-client.ts +60 -8
- package/src/client/plugins-client.ts +2 -1
- package/src/client/policy-client.ts +24 -9
- package/src/client/presets-client.ts +26 -13
- package/src/client/profiles-client.ts +53 -24
- package/src/client/schedules-client.ts +14 -20
- package/src/client/settings-schema-client.ts +2 -1
- package/src/client/states-client.ts +151 -49
- package/src/client/storage-client.ts +43 -14
- package/src/client/sub-mcp-client.ts +10 -4
- package/src/client/system-client.ts +2 -1
- package/src/client/templates-client.ts +26 -7
- package/src/client/tool-extensions-client.ts +14 -7
- package/src/client/tool-meta-client.ts +46 -21
- package/src/client/tools-client.ts +13 -8
- package/src/client/trigger-links-client.ts +10 -6
- package/src/fleet-report.ts +48 -7
- package/src/generated/api-routes.ts +327 -0
- package/src/generated/openapi-schemas.ts +1508 -0
- package/src/generated/served-schemas.ts +7120 -40
- package/src/headers.ts +4 -0
- package/src/http.ts +4 -3
- package/src/index.ts +44 -10
- package/src/schemas/api-keys.ts +9 -25
- package/src/schemas/auth-routes.ts +27 -28
- package/src/schemas/backup.ts +33 -31
- package/src/schemas/capabilities.ts +16 -39
- package/src/schemas/channels.ts +4 -4
- package/src/schemas/config.ts +6 -6
- package/src/schemas/connectors.ts +61 -102
- package/src/schemas/conversations.ts +43 -133
- package/src/schemas/extensions.ts +7 -4
- package/src/schemas/fleet.ts +51 -51
- package/src/schemas/hooks.ts +18 -37
- package/src/schemas/index.ts +0 -1
- package/src/schemas/interactions.ts +48 -131
- package/src/schemas/login.ts +10 -41
- package/src/schemas/manifest-mcp.ts +13 -19
- package/src/schemas/marketplace.ts +37 -120
- package/src/schemas/members.ts +21 -51
- package/src/schemas/notifications.ts +10 -34
- package/src/schemas/observability.ts +34 -79
- package/src/schemas/policy.ts +5 -12
- package/src/schemas/presets.ts +13 -48
- package/src/schemas/principals.ts +17 -24
- package/src/schemas/profiles.ts +25 -55
- package/src/schemas/roles.ts +11 -17
- package/src/schemas/schedules.ts +4 -15
- package/src/schemas/served.ts +33 -0
- package/src/schemas/settings-schema.ts +18 -23
- package/src/schemas/setup.ts +4 -10
- package/src/schemas/states.ts +88 -139
- package/src/schemas/storage.ts +10 -16
- package/src/schemas/studio-plugins.ts +8 -19
- package/src/schemas/sub-mcp.ts +12 -18
- package/src/schemas/system-kinds.ts +12 -29
- package/src/schemas/templates.ts +8 -10
- package/src/schemas/tool-meta.ts +8 -20
- package/src/schemas/tools.ts +22 -45
- package/src/schemas/trigger-links.ts +8 -26
- package/src/tool-runs.ts +47 -38
- package/dist/client/web-entry-gate-client.d.ts +0 -34
- package/dist/client/web-entry-gate-client.d.ts.map +0 -1
- package/dist/client/web-entry-gate-client.js +0 -25
- package/dist/client/web-entry-gate-client.js.map +0 -1
- package/dist/schemas/web-entry.d.ts +0 -45
- package/dist/schemas/web-entry.d.ts.map +0 -1
- package/dist/schemas/web-entry.js +0 -36
- package/dist/schemas/web-entry.js.map +0 -1
- package/src/client/web-entry-gate-client.ts +0 -45
- package/src/schemas/web-entry.ts +0 -46
package/src/headers.ts
ADDED
package/src/http.ts
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
import type { z } from 'zod';
|
|
11
11
|
|
|
12
12
|
import { ApiConflictError, ApiError, ApiSchemaError, ApiUnauthorizedError } from './errors';
|
|
13
|
+
import { API_KEY_HEADER } from './headers';
|
|
13
14
|
|
|
14
15
|
/** Supplies the current API key (in-memory or sessionStorage-backed) + base URL. */
|
|
15
16
|
export interface ApiConfig {
|
|
@@ -153,7 +154,7 @@ export async function apiRequest<S extends z.ZodType>(
|
|
|
153
154
|
const doFetch = config.fetch ?? globalThis.fetch;
|
|
154
155
|
const token = config.getToken();
|
|
155
156
|
const headers: Record<string, string> = { ...JSON_HEADERS };
|
|
156
|
-
if (token) headers[
|
|
157
|
+
if (token) headers[API_KEY_HEADER] = token;
|
|
157
158
|
|
|
158
159
|
const response = await doFetch(buildUrl(config.baseUrl ?? '', path, options.query), {
|
|
159
160
|
method: options.method ?? 'GET',
|
|
@@ -183,7 +184,7 @@ export async function apiText(
|
|
|
183
184
|
const doFetch = config.fetch ?? globalThis.fetch;
|
|
184
185
|
const token = config.getToken();
|
|
185
186
|
const headers: Record<string, string> = {};
|
|
186
|
-
if (token) headers[
|
|
187
|
+
if (token) headers[API_KEY_HEADER] = token;
|
|
187
188
|
|
|
188
189
|
const response = await doFetch(buildUrl(config.baseUrl ?? '', path, options.query), {
|
|
189
190
|
method: options.method ?? 'GET',
|
|
@@ -211,7 +212,7 @@ export async function apiDownload(
|
|
|
211
212
|
const token = config.getToken();
|
|
212
213
|
const headers: Record<string, string> = {};
|
|
213
214
|
if (options.body !== undefined) Object.assign(headers, JSON_HEADERS);
|
|
214
|
-
if (token) headers[
|
|
215
|
+
if (token) headers[API_KEY_HEADER] = token;
|
|
215
216
|
|
|
216
217
|
const response = await doFetch(buildUrl(config.baseUrl ?? '', path, options.query), {
|
|
217
218
|
method: options.method ?? 'GET',
|
package/src/index.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
export type { AgentEvent, AgentSummary, ParsedAgentEvent, UnknownAgentEvent } from './agents';
|
|
9
9
|
export { agentEventSchema, parseAgentFrame, parseAgentTranscript } from './agents';
|
|
10
10
|
export type {
|
|
11
|
+
AddServerArgs,
|
|
11
12
|
AddUrlToScopeBody,
|
|
12
13
|
ApiClient,
|
|
13
14
|
ApiKeyBody,
|
|
@@ -18,6 +19,7 @@ export type {
|
|
|
18
19
|
ConversationThreadMessageBody,
|
|
19
20
|
ConversationTranscriptQuery,
|
|
20
21
|
CreatePresetBody,
|
|
22
|
+
DiscoverServerTarget,
|
|
21
23
|
MarketplaceInstallBody,
|
|
22
24
|
MarketplaceInstallPreviewBody,
|
|
23
25
|
MarketplaceSearchQuery,
|
|
@@ -29,6 +31,7 @@ export type {
|
|
|
29
31
|
RunsQuery,
|
|
30
32
|
RunToolArgs,
|
|
31
33
|
SavePresetVersionBody,
|
|
34
|
+
SetProviderClientArgs,
|
|
32
35
|
StartConnectArgs,
|
|
33
36
|
StateAttachmentBody,
|
|
34
37
|
StateDeclarationBody,
|
|
@@ -42,7 +45,6 @@ export type {
|
|
|
42
45
|
TriggerLinkCreateBody,
|
|
43
46
|
ValidateConditionBody,
|
|
44
47
|
ValidatePresetBody,
|
|
45
|
-
WebEntryCodeMintBody,
|
|
46
48
|
} from './client';
|
|
47
49
|
export { createApiClient, isSafeApiPath } from './client';
|
|
48
50
|
export {
|
|
@@ -58,6 +60,7 @@ export type {
|
|
|
58
60
|
FleetFailureOutcome,
|
|
59
61
|
FleetReportStatus,
|
|
60
62
|
FleetReportSummary,
|
|
63
|
+
FleetWorkerAwaitingRespawn,
|
|
61
64
|
FleetWorkerFailure,
|
|
62
65
|
} from './fleet-report';
|
|
63
66
|
export {
|
|
@@ -66,10 +69,14 @@ export {
|
|
|
66
69
|
summarizeFleetFanout,
|
|
67
70
|
summarizeFleetResult,
|
|
68
71
|
} from './fleet-report';
|
|
72
|
+
export type { ApiOperationId, ApiPathPrefix, ApiPathTemplate } from './generated/api-routes';
|
|
73
|
+
export { apiPathPrefixes, apiRoutes, buildPath } from './generated/api-routes';
|
|
74
|
+
export { API_KEY_HEADER } from './headers';
|
|
69
75
|
export type { ApiConfig, RequestOptions } from './http';
|
|
70
76
|
export { apiDownload, apiRequest, apiText } from './http';
|
|
71
77
|
export type {
|
|
72
78
|
AnswerFormat,
|
|
79
|
+
ApiConversationRouteCreate,
|
|
73
80
|
ApplyResult,
|
|
74
81
|
AttachmentMediaItem,
|
|
75
82
|
AttachmentMediaKind,
|
|
@@ -78,7 +85,9 @@ export type {
|
|
|
78
85
|
BackendInfo,
|
|
79
86
|
BackupDocument,
|
|
80
87
|
BackupImportReport,
|
|
81
|
-
|
|
88
|
+
BackupNewApiKeys,
|
|
89
|
+
BackupSectionReport,
|
|
90
|
+
ChannelConversationRouteCreate,
|
|
82
91
|
Channels,
|
|
83
92
|
ChannelTemplate,
|
|
84
93
|
ClaimLinkCreated,
|
|
@@ -104,6 +113,7 @@ export type {
|
|
|
104
113
|
ConversationRouteCreate,
|
|
105
114
|
ConversationRouteDeleted,
|
|
106
115
|
ConversationRoutes,
|
|
116
|
+
ConversationRouteView,
|
|
107
117
|
ConversationRouteWritten,
|
|
108
118
|
ConversationTargetKind,
|
|
109
119
|
ConversationThread,
|
|
@@ -114,6 +124,7 @@ export type {
|
|
|
114
124
|
ConversationThreadsPage,
|
|
115
125
|
ConversationTranscriptPage,
|
|
116
126
|
DashboardMetrics,
|
|
127
|
+
DiscoveredServer,
|
|
117
128
|
DisplayBlock,
|
|
118
129
|
DisplayBlockKind,
|
|
119
130
|
Extension,
|
|
@@ -132,7 +143,9 @@ export type {
|
|
|
132
143
|
FormPages,
|
|
133
144
|
FormReactions,
|
|
134
145
|
FormUpdate,
|
|
146
|
+
FreshLife,
|
|
135
147
|
GrantLevel,
|
|
148
|
+
HeldPendingSave,
|
|
136
149
|
HookList,
|
|
137
150
|
HookParams,
|
|
138
151
|
HookRegister,
|
|
@@ -141,6 +154,7 @@ export type {
|
|
|
141
154
|
InteractionAnswered,
|
|
142
155
|
InteractionCancelled,
|
|
143
156
|
InteractionMediaItem,
|
|
157
|
+
InteractionReaction,
|
|
144
158
|
InteractionsPage,
|
|
145
159
|
InviteRow,
|
|
146
160
|
InvokeMemberActionResult,
|
|
@@ -192,9 +206,14 @@ export type {
|
|
|
192
206
|
Notification,
|
|
193
207
|
Notifications,
|
|
194
208
|
OAuthCompleteResult,
|
|
209
|
+
ObservabilityCapabilities,
|
|
195
210
|
ParkedCallerAsk,
|
|
196
211
|
ParkedStatus,
|
|
197
212
|
PatternEntry,
|
|
213
|
+
PendingSave,
|
|
214
|
+
PendingSaveRetried,
|
|
215
|
+
PendingSavesPage,
|
|
216
|
+
PendingSaveStatus,
|
|
198
217
|
PolicyBody,
|
|
199
218
|
PolicyVersion,
|
|
200
219
|
PresetBody,
|
|
@@ -206,14 +225,22 @@ export type {
|
|
|
206
225
|
PresetValidation,
|
|
207
226
|
PresetVersion,
|
|
208
227
|
PresetVersionTags,
|
|
228
|
+
PreviousProfileName,
|
|
209
229
|
Principal,
|
|
230
|
+
PrincipalKind,
|
|
210
231
|
PrincipalRef,
|
|
211
232
|
ProviderCatalogResponse,
|
|
233
|
+
ProviderMutationResult,
|
|
212
234
|
ProviderView,
|
|
213
235
|
ReactionEvent,
|
|
214
236
|
ReactionEventKind,
|
|
215
237
|
RecordSearchPage,
|
|
238
|
+
RecycleEntry,
|
|
239
|
+
RecycleRoll,
|
|
240
|
+
RecycleStop,
|
|
216
241
|
ReloadConfigResult,
|
|
242
|
+
RemoveProviderResult,
|
|
243
|
+
ResolvedSpanValue,
|
|
217
244
|
RoleAuditEvent,
|
|
218
245
|
RoleBody,
|
|
219
246
|
RoleGrants,
|
|
@@ -222,12 +249,20 @@ export type {
|
|
|
222
249
|
RouteAction,
|
|
223
250
|
RouteEntry,
|
|
224
251
|
Run,
|
|
252
|
+
RunAnswer,
|
|
225
253
|
RunSpan,
|
|
254
|
+
RunSpanOutline,
|
|
226
255
|
RunTrace,
|
|
227
|
-
|
|
256
|
+
RunTraceOutline,
|
|
257
|
+
ScheduleCreate,
|
|
258
|
+
ScheduleListRow,
|
|
259
|
+
ScheduleRecord,
|
|
260
|
+
ServedConstants,
|
|
261
|
+
SettingsProfileName,
|
|
228
262
|
SettingsSchema,
|
|
229
263
|
SetupBody,
|
|
230
264
|
SetupResult,
|
|
265
|
+
SpanKind,
|
|
231
266
|
StateAttach,
|
|
232
267
|
StateAttached,
|
|
233
268
|
StateAttachment,
|
|
@@ -235,26 +270,29 @@ export type {
|
|
|
235
270
|
StateBinding,
|
|
236
271
|
StateConsumers,
|
|
237
272
|
StateDeclaration,
|
|
273
|
+
StateDeclarationSaved,
|
|
238
274
|
StateDetached,
|
|
239
275
|
StateDetail,
|
|
240
276
|
StateFoldReport,
|
|
241
277
|
StateInjection,
|
|
242
278
|
StateListItem,
|
|
243
279
|
StateRecord,
|
|
280
|
+
StateRegimeRule,
|
|
244
281
|
StateRetentionPruned,
|
|
245
282
|
StateStats,
|
|
246
283
|
StateSubject,
|
|
247
284
|
StateTemplateDocument,
|
|
248
285
|
StateTemplateListItem,
|
|
286
|
+
StateTemplateParameter,
|
|
287
|
+
StateTemplateTrace,
|
|
249
288
|
StateUpdate,
|
|
250
289
|
StorageInfo,
|
|
251
290
|
StorageResourceStat,
|
|
252
|
-
|
|
291
|
+
StudioPluginListingEntry,
|
|
253
292
|
SubjectPage,
|
|
254
293
|
SubjectRow,
|
|
255
294
|
SubMcpEntry,
|
|
256
295
|
SubMcpMount,
|
|
257
|
-
SuspendedRunReceipt,
|
|
258
296
|
TargetConversationConfig,
|
|
259
297
|
TemplateDeclarations,
|
|
260
298
|
TemplatedText,
|
|
@@ -278,17 +316,13 @@ export type {
|
|
|
278
316
|
TriggerLinkRecord,
|
|
279
317
|
ValidateConditionResult,
|
|
280
318
|
VisitOutcome,
|
|
281
|
-
WebEntryCode,
|
|
282
|
-
WebEntryCodeMinted,
|
|
283
|
-
WebEntryCodeRevoked,
|
|
284
|
-
WebEntryGate,
|
|
285
|
-
WebEntryGateState,
|
|
286
319
|
WorkerKind,
|
|
287
320
|
WorkerLastOp,
|
|
288
321
|
WorkerState,
|
|
289
322
|
WriteEntry,
|
|
290
323
|
WritesPage,
|
|
291
324
|
} from './schemas';
|
|
325
|
+
export { runAnswer, servedConstants, servedDocumentsJson, servedVectors } from './schemas';
|
|
292
326
|
export * as schemas from './schemas';
|
|
293
327
|
export type { SseFrame } from './sse';
|
|
294
328
|
export { readSseFrames, SseFrameParser } from './sse';
|
package/src/schemas/api-keys.ts
CHANGED
|
@@ -1,34 +1,18 @@
|
|
|
1
1
|
/** API-key payload and mint/edit/revoke response schemas. */
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
|
-
import
|
|
5
|
-
import { templatedText } from './served';
|
|
6
|
-
import { jsonValue } from './shared';
|
|
4
|
+
import * as openapi from '../generated/openapi-schemas';
|
|
7
5
|
|
|
8
6
|
/** The per-key payloads (`GET /api/auth/tokens-payload`). The stable per-mint
|
|
9
|
-
* `key_fingerprint` is nested under `policy_data`; the picker reads it there.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
user_id: z.string().min(1),
|
|
14
|
-
description: z.string(),
|
|
15
|
-
scopes: z.array(z.string()),
|
|
16
|
-
policy_data: jsonValue,
|
|
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(),
|
|
24
|
-
}),
|
|
25
|
-
);
|
|
7
|
+
* `key_fingerprint` is nested under `policy_data`; the picker reads it there. `principal`
|
|
8
|
+
* is the key's OWNER (`null` for a key whose principal row is absent), `orphaned` is `true`
|
|
9
|
+
* for a key whose owning principal row is gone. */
|
|
10
|
+
export const tokensPayload = openapi.tokenPayloadList;
|
|
26
11
|
export type TokensPayload = z.infer<typeof tokensPayload>;
|
|
27
12
|
|
|
13
|
+
// Hand-written: the client narrows the mint reply to the raw key it shows once.
|
|
28
14
|
/** Mint reply `{ api_key, key_fingerprint }` narrowed to the raw `sk-…` key,
|
|
29
15
|
* returned once at creation and never again. */
|
|
30
|
-
export const createdApiKey =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
export const editApiKeyResult = z.object({ user_id: z.string(), updated: z.boolean() });
|
|
34
|
-
export const revokeApiKeyResult = z.object({ user_id: z.string(), revoked: z.boolean() });
|
|
16
|
+
export const createdApiKey = openapi.apiKeyCreateResult.transform((minted) => minted.api_key);
|
|
17
|
+
export const editApiKeyResult = openapi.userUpdateAck;
|
|
18
|
+
export const revokeApiKeyResult = openapi.revokeAck;
|
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
/** Route catalog, scope mapping and public-route response schemas. */
|
|
2
|
-
import { z } from 'zod';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
export const authScopes = z.record(z.string(), z.string());
|
|
4
|
+
import * as openapi from '../generated/openapi-schemas';
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
export const
|
|
9
|
-
export const removeScopeResult = z.object({ scope_id: z.string(), deleted_keys: z.number() });
|
|
6
|
+
/** `{ url: scope_id }` — every URL currently mapped to a scope. */
|
|
7
|
+
export const authScopes = openapi.scopeUrlMap;
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
* them; `fenced`/`secret` routes are ADMIN-ONLY and never grantable (no per-tag
|
|
15
|
-
* level reaches them). `null` marks a path the registry carries no metadata for
|
|
16
|
-
* (an unregistered/ungated path — no feature tags, no action).
|
|
17
|
-
*/
|
|
18
|
-
export const routeAction = z.enum(['read', 'write', 'fenced', 'secret']);
|
|
19
|
-
export type RouteAction = z.infer<typeof routeAction>;
|
|
9
|
+
export const addUrlToScopeResult = openapi.scopeUrlAck;
|
|
10
|
+
export const removeUrlFromScopeResult = openapi.urlAck;
|
|
11
|
+
export const removeScopeResult = openapi.scopeDeleteResult;
|
|
20
12
|
|
|
21
13
|
/**
|
|
22
14
|
* One row of the route catalog (`GET /api/auth/routes`) — a plain HTTP route with
|
|
@@ -27,22 +19,29 @@ export type RouteAction = z.infer<typeof routeAction>;
|
|
|
27
19
|
* description, and `action` its authorization class — the join fields the Roles
|
|
28
20
|
* grant editor reads to derive grantable feature groups and mark the admin-only
|
|
29
21
|
* (fenced/secret) routes it must never offer a grant for. An unregistered path
|
|
30
|
-
* carries `tags: []`, `summary: ''`, `action: null`.
|
|
22
|
+
* carries `tags: []`, `summary: ''`, `action: null`. `declared_public` is `true` for
|
|
23
|
+
* a route its registration declares public: it is served without authentication
|
|
24
|
+
* and no scope mapping or public pin changes that, so the mapper never offers it
|
|
25
|
+
* for a scope.
|
|
31
26
|
*/
|
|
32
|
-
export const authRoute =
|
|
33
|
-
path: z.string(),
|
|
34
|
-
methods: z.array(z.string()),
|
|
35
|
-
mapped: z.string().nullable(),
|
|
36
|
-
tags: z.array(z.string()),
|
|
37
|
-
summary: z.string(),
|
|
38
|
-
action: routeAction.nullable(),
|
|
39
|
-
});
|
|
27
|
+
export const authRoute = openapi.routeMappingRow;
|
|
40
28
|
export type AuthRoute = z.infer<typeof authRoute>;
|
|
41
|
-
export const authRoutes =
|
|
29
|
+
export const authRoutes = openapi.routeMappingList;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* A route's authorization ACTION class, joined onto the catalog from the route
|
|
33
|
+
* registry. `read`/`write` routes are GRANTABLE — a role's per-tag level opens
|
|
34
|
+
* them; `fenced`/`secret` routes are ADMIN-ONLY and never grantable (no per-tag
|
|
35
|
+
* level reaches them). `null` on a row marks a path the registry carries no metadata
|
|
36
|
+
* for (an unregistered/ungated path — no feature tags, no action).
|
|
37
|
+
*/
|
|
38
|
+
export const routeAction = openapi.routeMappingRow.shape.action.unwrap();
|
|
39
|
+
export type RouteAction = z.infer<typeof routeAction>;
|
|
40
|
+
|
|
42
41
|
/** `GET /api/auth/public-routes` — the sorted urls pinned to the public marker. */
|
|
43
|
-
export const publicRoutes =
|
|
42
|
+
export const publicRoutes = openapi.stringList;
|
|
44
43
|
|
|
45
44
|
/** `POST /api/auth/public-routes` — the pinned url. */
|
|
46
|
-
export const pinPublicResult =
|
|
45
|
+
export const pinPublicResult = openapi.urlAck;
|
|
47
46
|
/** `DELETE /api/auth/public-routes` — the unpinned url (404 when not pinned). */
|
|
48
|
-
export const unpinPublicResult =
|
|
47
|
+
export const unpinPublicResult = openapi.urlAck;
|
package/src/schemas/backup.ts
CHANGED
|
@@ -1,43 +1,45 @@
|
|
|
1
1
|
/** Backup section, document and import-report response schemas. */
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
|
+
import * as openapi from '../generated/openapi-schemas';
|
|
4
5
|
import { fleetReportFanout } from './fleet';
|
|
5
6
|
|
|
6
|
-
export const backupSections =
|
|
7
|
+
export const backupSections = openapi.backupSectionListing;
|
|
7
8
|
|
|
8
|
-
/**
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* A backup document as the import door accepts it — validated when the UI reads a picked
|
|
11
|
+
* file. Hand-written over the export's document: the import door takes `version` 1 and a
|
|
12
|
+
* `sections` object, and the export's `errors` map is optional there.
|
|
13
|
+
*/
|
|
14
|
+
export const backupDocument = openapi.backupExportDocument.extend({
|
|
10
15
|
version: z.literal(1),
|
|
11
|
-
|
|
12
|
-
sections: z.record(z.string(), z.unknown()),
|
|
13
|
-
errors: z.record(z.string(), z.string()).optional(),
|
|
16
|
+
errors: openapi.backupExportDocument.shape.errors.optional(),
|
|
14
17
|
});
|
|
15
18
|
export type BackupDocument = z.infer<typeof backupDocument>;
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
),
|
|
20
|
+
// Hand-written: the spec publishes a section's fan-out as one object with optional fields
|
|
21
|
+
// and its `details` as an open map; the client discriminates the fan-out's modes and reads
|
|
22
|
+
// the keys a restore minted.
|
|
23
|
+
/** The api keys a restore minted, shown once: carried in a section report's `details`. */
|
|
24
|
+
export const backupNewApiKeys = z.array(
|
|
25
|
+
z.object({ user_id: z.string(), description: z.string(), api_key: z.string() }),
|
|
26
|
+
);
|
|
27
|
+
export type BackupNewApiKeys = z.infer<typeof backupNewApiKeys>;
|
|
28
|
+
|
|
29
|
+
export const backupSectionReport = openapi.backupSectionReport.extend({
|
|
30
|
+
// The `manifest` and `env` sections apply through the config pipeline, so their
|
|
31
|
+
// report carries the mode-wrapped fleet `fanout` of the restore's reload; other
|
|
32
|
+
// sections carry `null`. Parsed EXPLICITLY so the shared fleet-report handler can
|
|
33
|
+
// surface a failed restore propagation.
|
|
34
|
+
fanout: fleetReportFanout.nullable().default(null),
|
|
35
|
+
details: z
|
|
36
|
+
.object({ new_api_keys: backupNewApiKeys.optional() })
|
|
37
|
+
.catchall(z.unknown())
|
|
38
|
+
.default({}),
|
|
39
|
+
});
|
|
40
|
+
export type BackupSectionReport = z.infer<typeof backupSectionReport>;
|
|
41
|
+
|
|
42
|
+
export const backupImportReport = openapi.backupImportResult.extend({
|
|
43
|
+
sections: z.record(z.string(), backupSectionReport),
|
|
42
44
|
});
|
|
43
45
|
export type BackupImportReport = z.infer<typeof backupImportReport>;
|
|
@@ -1,32 +1,27 @@
|
|
|
1
1
|
/** Caller capability projection and auth-capabilities schemas. */
|
|
2
|
-
import { z } from 'zod';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
3
|
|
|
4
|
-
import
|
|
5
|
-
import { subMcpMount } from './sub-mcp';
|
|
4
|
+
import * as openapi from '../generated/openapi-schemas';
|
|
6
5
|
|
|
7
6
|
/** A concrete route the caller can reach, with the methods that pass its jq fence. */
|
|
8
|
-
export const routeEntry =
|
|
9
|
-
path: z.string(),
|
|
10
|
-
methods: z.array(z.string()),
|
|
11
|
-
});
|
|
7
|
+
export const routeEntry = openapi.routeEntry;
|
|
12
8
|
export type RouteEntry = z.infer<typeof routeEntry>;
|
|
13
9
|
|
|
14
10
|
/**
|
|
15
11
|
* A dynamic route pattern the caller can reach — a mount/pattern surface not
|
|
16
12
|
* enumerable into concrete paths, projected only when its scope AND jq admit it.
|
|
13
|
+
* `open_prefix` is the literal path prefix the pattern opens, or `null` when the pattern
|
|
14
|
+
* opens none a prefix test can read.
|
|
17
15
|
*/
|
|
18
|
-
export const patternEntry =
|
|
19
|
-
pattern: z.string(),
|
|
20
|
-
scope_id: z.string(),
|
|
21
|
-
});
|
|
16
|
+
export const patternEntry = openapi.patternEntry;
|
|
22
17
|
export type PatternEntry = z.infer<typeof patternEntry>;
|
|
23
18
|
|
|
24
19
|
/**
|
|
25
|
-
* A sub-MCP mount the caller can reach, with the tools it exposes and
|
|
26
|
-
*
|
|
27
|
-
* the
|
|
20
|
+
* A sub-MCP mount the caller can reach, with the tools it exposes, its transport and
|
|
21
|
+
* its served mount URL and access pattern, and the `slug` the projection carries inline
|
|
22
|
+
* (the registry list keys mounts by slug instead).
|
|
28
23
|
*/
|
|
29
|
-
export const subMcpEntry =
|
|
24
|
+
export const subMcpEntry = openapi.subMcpEntry;
|
|
30
25
|
export type SubMcpEntry = z.infer<typeof subMcpEntry>;
|
|
31
26
|
|
|
32
27
|
/**
|
|
@@ -37,23 +32,12 @@ export type SubMcpEntry = z.infer<typeof subMcpEntry>;
|
|
|
37
32
|
* session carries `admin: false` and a jq-exact `routes` list. `owner_user_id` is
|
|
38
33
|
* the key's owner claim, `null` for a key with no owner claim. `principal` is the
|
|
39
34
|
* caller's principal (kind + display name), `null` when no principal row backs the
|
|
40
|
-
* credential.
|
|
35
|
+
* credential. `public_resource_id` is the deployment's reserved public marker (the
|
|
36
|
+
* route-table id a public route maps to — never a scope). The invariant is projection ⊆ gate: every projected surface is one
|
|
41
37
|
* the server would admit, so the UI can filter on it without ever advertising a
|
|
42
38
|
* door the gate denies.
|
|
43
39
|
*/
|
|
44
|
-
export const meProjection =
|
|
45
|
-
user_id: z.string(),
|
|
46
|
-
owner_user_id: z.string().nullable(),
|
|
47
|
-
principal: principalRef.nullable().optional(),
|
|
48
|
-
admin: z.boolean(),
|
|
49
|
-
scopes: z.array(z.string()),
|
|
50
|
-
routes: z.array(routeEntry),
|
|
51
|
-
route_patterns: z.array(patternEntry),
|
|
52
|
-
sub_mcp: z.array(subMcpEntry),
|
|
53
|
-
tools: z.array(z.string()),
|
|
54
|
-
agents: z.array(z.string()),
|
|
55
|
-
mintable: z.boolean(),
|
|
56
|
-
});
|
|
40
|
+
export const meProjection = openapi.projectionResult;
|
|
57
41
|
export type MeProjection = z.infer<typeof meProjection>;
|
|
58
42
|
|
|
59
43
|
/**
|
|
@@ -62,11 +46,7 @@ export type MeProjection = z.infer<typeof meProjection>;
|
|
|
62
46
|
* absolute URL — the Studio composes the origin); `token` is the raw claim token
|
|
63
47
|
* returned exactly ONCE; `expires_at` is an ISO-8601 instant.
|
|
64
48
|
*/
|
|
65
|
-
export const claimLinkCreated =
|
|
66
|
-
claim_path: z.string(),
|
|
67
|
-
token: z.string(),
|
|
68
|
-
expires_at: z.string(),
|
|
69
|
-
});
|
|
49
|
+
export const claimLinkCreated = openapi.claimLinkResult;
|
|
70
50
|
export type ClaimLinkCreated = z.infer<typeof claimLinkCreated>;
|
|
71
51
|
|
|
72
52
|
/**
|
|
@@ -76,7 +56,7 @@ export type ClaimLinkCreated = z.infer<typeof claimLinkCreated>;
|
|
|
76
56
|
* `revoked: false` body. Non-strict, so a SUCCESSFUL logout never throws
|
|
77
57
|
* `ApiSchemaError` on an additive field.
|
|
78
58
|
*/
|
|
79
|
-
export const logoutResult =
|
|
59
|
+
export const logoutResult = openapi.logoutResult;
|
|
80
60
|
export type LogoutResult = z.infer<typeof logoutResult>;
|
|
81
61
|
|
|
82
62
|
/**
|
|
@@ -85,8 +65,5 @@ export type LogoutResult = z.infer<typeof logoutResult>;
|
|
|
85
65
|
* validator-only (keys are issued at an external issuer), so the key-creation
|
|
86
66
|
* UI disables up front instead of surfacing a raw mint failure. Non-strict.
|
|
87
67
|
*/
|
|
88
|
-
export const authCapabilities =
|
|
89
|
-
mintable: z.boolean(),
|
|
90
|
-
providers: z.array(z.object({ name: z.string(), mintable: z.boolean() })),
|
|
91
|
-
});
|
|
68
|
+
export const authCapabilities = openapi.mintCapabilities;
|
|
92
69
|
export type AuthCapabilities = z.infer<typeof authCapabilities>;
|
package/src/schemas/channels.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/** Installed channel-plugin catalog response schema. */
|
|
2
|
-
import { z } from 'zod';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
import * as openapi from '../generated/openapi-schemas';
|
|
3
5
|
|
|
4
6
|
// The installed channel-plugin catalog: names registered via the manifest's
|
|
5
7
|
// channel modules. A deployment with none bound answers questions only in this
|
|
6
8
|
// inbox (the Studio default).
|
|
7
9
|
|
|
8
|
-
export const channels =
|
|
9
|
-
channels: z.array(z.string()),
|
|
10
|
-
});
|
|
10
|
+
export const channels = openapi.channelListing;
|
|
11
11
|
export type Channels = z.infer<typeof channels>;
|
package/src/schemas/config.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/** Environment-config and config-mode response schemas. */
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import * as openapi from '../generated/openapi-schemas';
|
|
5
|
+
|
|
6
|
+
export const envConfig = openapi.envView;
|
|
7
|
+
|
|
8
|
+
// `read_only` is hand-written: a UI-side gate the server does not publish.
|
|
8
9
|
/**
|
|
9
10
|
* `GET /api/config/mode` — the active config backend mode: `file`, or an installed
|
|
10
11
|
* provider's mode name such as `kubernetes`. The skeleton emits only `config_mode`;
|
|
@@ -12,7 +13,6 @@ export const envConfig = z.object({
|
|
|
12
13
|
* so a normal response never drifts, while a genuinely read-only deployment can opt in
|
|
13
14
|
* by emitting `read_only: true`.
|
|
14
15
|
*/
|
|
15
|
-
export const configMode =
|
|
16
|
-
config_mode: z.string(),
|
|
16
|
+
export const configMode = openapi.configModeView.extend({
|
|
17
17
|
read_only: z.boolean().default(false),
|
|
18
18
|
});
|