@tai42/api-client 19.3.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 +143 -90
- package/dist/client/auth-client.d.ts.map +1 -1
- package/dist/client/auth-client.js +81 -25
- 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 +2252 -864
- 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 +44 -14
- 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 +6697 -392
- package/dist/generated/served-schemas.d.ts.map +1 -1
- package/dist/generated/served-schemas.js +7061 -46
- 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 +970 -241
- 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 +1 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +1 -1
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/interactions.d.ts +146 -123
- 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 +161 -0
- package/dist/schemas/members.d.ts.map +1 -0
- package/dist/schemas/members.js +73 -0
- package/dist/schemas/members.js.map +1 -0
- package/dist/schemas/notifications.d.ts +113 -41
- 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 -194
- 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 +134 -34
- 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 +7118 -82
- package/src/headers.ts +4 -0
- package/src/http.ts +4 -3
- package/src/index.ts +52 -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 +1 -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 +91 -0
- 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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** Live-manifest MCP section, env-ref and config-reload 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
7
|
/**
|
|
@@ -16,7 +17,8 @@ export const connectorRef = z.object({
|
|
|
16
17
|
export type ConnectorRef = z.infer<typeof connectorRef>;
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
|
-
* One entry of the live manifest's MCP section
|
|
20
|
+
* One entry of the live manifest's MCP section, hand-typed: the spec publishes an entry as
|
|
21
|
+
* an open object. Only the `managed` provenance
|
|
20
22
|
* marker is typed — the connect/disconnect flows write it server-side to point a
|
|
21
23
|
* connector-owned entry back at its connection, and the editor renders such
|
|
22
24
|
* entries read-only. `.nullish()` because a hand-authored entry carries `null`
|
|
@@ -31,9 +33,8 @@ export const manifestMcpEntry = z
|
|
|
31
33
|
.loose();
|
|
32
34
|
export type ManifestMcpEntry = z.infer<typeof manifestMcpEntry>;
|
|
33
35
|
|
|
34
|
-
export const manifestView =
|
|
36
|
+
export const manifestView = openapi.preservedManifestView.extend({
|
|
35
37
|
mcp: z.array(manifestMcpEntry),
|
|
36
|
-
user_tools: z.array(z.string()),
|
|
37
38
|
});
|
|
38
39
|
|
|
39
40
|
/**
|
|
@@ -45,26 +46,19 @@ export const manifestView = z.object({
|
|
|
45
46
|
* dangling refusal reads), so a var supplied by the deployment shows green, never
|
|
46
47
|
* a false red. The checklist derives from THIS alone — no env value is ever fetched.
|
|
47
48
|
*/
|
|
48
|
-
export const mcpEnvRef =
|
|
49
|
-
var: z.string(),
|
|
50
|
-
pointer: z.string(),
|
|
51
|
-
has_default: z.boolean(),
|
|
52
|
-
set: z.boolean(),
|
|
53
|
-
});
|
|
49
|
+
export const mcpEnvRef = openapi.mcpEnvRef;
|
|
54
50
|
export type McpEnvRef = z.infer<typeof mcpEnvRef>;
|
|
55
|
-
export const mcpEnvRefs =
|
|
51
|
+
export const mcpEnvRefs = openapi.mcpEnvRefList;
|
|
56
52
|
export type McpEnvRefs = z.infer<typeof mcpEnvRefs>;
|
|
57
53
|
/**
|
|
58
54
|
* The apply result every config-writer mutation returns (`POST /api/mcp-config`,
|
|
59
55
|
* `POST /api/config/env`): the serving worker's local reload result (`status` +
|
|
60
|
-
* `env_keys`)
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
56
|
+
* `env_keys`), the mode-wrapped fleet fan-out of the reload it broadcast, `recycle` — the
|
|
57
|
+
* fleet recycle roll an env change carrying a recycle-class key ran (`null` when it carried
|
|
58
|
+
* none) — and `awaiting_respawn`, the workers (name + keys) still awaiting a respawn after
|
|
59
|
+
* it, empty when its roll converged. The `fanout` is hand-typed (the spec publishes it as
|
|
60
|
+
* one object with optional fields) so the shared fleet-report handler can surface a failed
|
|
61
|
+
* propagation. A drift throws `ApiSchemaError`.
|
|
64
62
|
*/
|
|
65
|
-
export const reloadConfigResult =
|
|
66
|
-
status: z.string(),
|
|
67
|
-
env_keys: z.number(),
|
|
68
|
-
fanout: fleetReportFanout,
|
|
69
|
-
});
|
|
63
|
+
export const reloadConfigResult = openapi.applyResponse.extend({ fanout: fleetReportFanout });
|
|
70
64
|
export type ReloadConfigResult = z.infer<typeof reloadConfigResult>;
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
/** Marketplace listing, version, install and advisory schemas. */
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
|
+
import * as openapi from '../generated/openapi-schemas';
|
|
5
|
+
|
|
6
|
+
// The registry's listing, search, version, detail and advisory shapes are hand-written: the
|
|
7
|
+
// skeleton passes the upstream registry's bodies through as opaque values. The installed,
|
|
8
|
+
// upgrade, install, preview and uninstall shapes are the skeleton's own.
|
|
9
|
+
|
|
4
10
|
/**
|
|
5
11
|
* The CLOSED HTTP-method enum fixed by the contract's RouteMethod, the one source
|
|
6
12
|
* for every route-method field (declaration and install/preview responses alike):
|
|
7
13
|
* a wire method the contract does not define fails loudly as drift rather than
|
|
8
14
|
* passing through silently.
|
|
9
15
|
*/
|
|
10
|
-
export const routeMethod =
|
|
16
|
+
export const routeMethod = openapi.mountedRoute.shape.methods.element;
|
|
11
17
|
export type RouteMethod = z.infer<typeof routeMethod>;
|
|
12
18
|
|
|
13
19
|
/**
|
|
@@ -16,7 +22,7 @@ export type RouteMethod = z.infer<typeof routeMethod>;
|
|
|
16
22
|
* installs nothing but the manifest entry. A CLOSED enum, so a wire value the
|
|
17
23
|
* server does not derive fails loudly as drift.
|
|
18
24
|
*/
|
|
19
|
-
export const marketplaceDelivery =
|
|
25
|
+
export const marketplaceDelivery = openapi.installedRow.shape.delivery;
|
|
20
26
|
export type MarketplaceDelivery = z.infer<typeof marketplaceDelivery>;
|
|
21
27
|
|
|
22
28
|
/**
|
|
@@ -32,7 +38,7 @@ export type MarketplaceSource = z.infer<typeof marketplaceSource>;
|
|
|
32
38
|
* a `secret` (an OAuth client secret is; a client id or a plain marker var is not).
|
|
33
39
|
* The install dialog seeds each toggle from `secret` and collects the missing ones.
|
|
34
40
|
*/
|
|
35
|
-
export const marketplaceRequiredEnvVar =
|
|
41
|
+
export const marketplaceRequiredEnvVar = openapi.requiredEnvVar;
|
|
36
42
|
export type MarketplaceRequiredEnvVar = z.infer<typeof marketplaceRequiredEnvVar>;
|
|
37
43
|
|
|
38
44
|
/**
|
|
@@ -230,16 +236,9 @@ export type MarketplacePluginDetail = z.infer<typeof marketplacePluginDetail>;
|
|
|
230
236
|
* One installed plugin's compat verdict against the RUNNING tai42-contract:
|
|
231
237
|
* `compatible` / `incompatible` per its declared contract range, `unknown` when
|
|
232
238
|
* no verdict could be computed. `reason` is the human-readable explanation of a
|
|
233
|
-
* non-`compatible` verdict, `null` when compatible.
|
|
234
|
-
* server is built against exactly this shape, so an unknown key is drift and
|
|
235
|
-
* throws instead of being stripped.
|
|
239
|
+
* non-`compatible` verdict, `null` when compatible.
|
|
236
240
|
*/
|
|
237
|
-
export const marketplaceInstalledCompat =
|
|
238
|
-
.object({
|
|
239
|
-
status: z.enum(['compatible', 'incompatible', 'unknown']),
|
|
240
|
-
reason: z.string().nullable(),
|
|
241
|
-
})
|
|
242
|
-
.strict();
|
|
241
|
+
export const marketplaceInstalledCompat = openapi.compatStatus;
|
|
243
242
|
export type MarketplaceInstalledCompat = z.infer<typeof marketplaceInstalledCompat>;
|
|
244
243
|
|
|
245
244
|
/**
|
|
@@ -249,92 +248,51 @@ export type MarketplaceInstalledCompat = z.infer<typeof marketplaceInstalledComp
|
|
|
249
248
|
* `incompatible_newer` names the newest version blocked by the running
|
|
250
249
|
* contract (`null` when none), so "an update exists but needs a newer core" is
|
|
251
250
|
* visible. `missing_upstream` flags a plugin the registry no longer lists.
|
|
252
|
-
* `compat` is the row's verdict against the running contract.
|
|
253
|
-
*
|
|
251
|
+
* `compat` is the row's verdict against the running contract. `delivery` is `package`
|
|
252
|
+
* for a pip-installed plugin, `descriptor` for a descriptor-only plugin whose stored spec
|
|
253
|
+
* names no package. `items` is the `{kind, name}` of every item this plugin's stored spec
|
|
254
|
+
* provides (local truth); `route_mounts` is the persisted `{item_name: base}` mount this
|
|
255
|
+
* plugin is installed at (`{}` means every item at its declared base).
|
|
254
256
|
*/
|
|
255
|
-
export const marketplaceInstalledPlugin =
|
|
256
|
-
.object({
|
|
257
|
-
ref: z.string(),
|
|
258
|
-
version: z.string(),
|
|
259
|
-
source: z.string(),
|
|
260
|
-
// How the row was delivered: `package` for a pip-installed plugin, `descriptor`
|
|
261
|
-
// for a descriptor-only plugin whose stored spec names no package.
|
|
262
|
-
delivery: marketplaceDelivery,
|
|
263
|
-
installed_at: z.string(),
|
|
264
|
-
latest: z.string().nullable(),
|
|
265
|
-
update_available: z.boolean(),
|
|
266
|
-
incompatible_newer: z.string().nullable(),
|
|
267
|
-
missing_upstream: z.boolean(),
|
|
268
|
-
compat: marketplaceInstalledCompat,
|
|
269
|
-
// The `{kind, name}` of every item this plugin's stored spec provides
|
|
270
|
-
// (local truth). The connectors page's McpServersSection joins the mcp-server
|
|
271
|
-
// item names against the manifest's mcp-entry titles to render an
|
|
272
|
-
// installer-written entry read-only.
|
|
273
|
-
items: z.array(marketplaceItem.pick({ kind: true, name: true })),
|
|
274
|
-
// The persisted `{item_name: base}` mount this plugin is installed at (local
|
|
275
|
-
// truth; `{}` means every item at its declared base). Studio seeds the update
|
|
276
|
-
// flow and renders routes at the ACTUAL mounted base from this.
|
|
277
|
-
route_mounts: z.record(z.string(), z.string()),
|
|
278
|
-
})
|
|
279
|
-
.strict();
|
|
257
|
+
export const marketplaceInstalledPlugin = openapi.installedRow;
|
|
280
258
|
export type MarketplaceInstalledPlugin = z.infer<typeof marketplaceInstalledPlugin>;
|
|
281
259
|
|
|
282
260
|
/**
|
|
283
261
|
* The installed inventory (`GET /api/marketplace/installed`): the attributed
|
|
284
|
-
* rows, each with its per-row compat verdict and update picture.
|
|
262
|
+
* rows, each with its per-row compat verdict and update picture.
|
|
285
263
|
*/
|
|
286
|
-
export const marketplaceInstalled =
|
|
287
|
-
.object({
|
|
288
|
-
installed: z.array(marketplaceInstalledPlugin),
|
|
289
|
-
})
|
|
290
|
-
.strict();
|
|
264
|
+
export const marketplaceInstalled = openapi.installedInventory;
|
|
291
265
|
export type MarketplaceInstalled = z.infer<typeof marketplaceInstalled>;
|
|
292
266
|
|
|
293
267
|
/**
|
|
294
268
|
* One per-plugin outcome of `POST /api/marketplace/upgrade-all`: `upgraded`,
|
|
295
269
|
* already `up-to-date`, `no-compatible-version` in the registry, or `failed`;
|
|
296
|
-
* `detail` always carries the human-readable specifics.
|
|
270
|
+
* `detail` always carries the human-readable specifics.
|
|
297
271
|
*/
|
|
298
|
-
export const marketplaceUpgradeAllRow =
|
|
299
|
-
.object({
|
|
300
|
-
ref: z.string(),
|
|
301
|
-
outcome: z.enum(['upgraded', 'up-to-date', 'no-compatible-version', 'failed']),
|
|
302
|
-
detail: z.string(),
|
|
303
|
-
})
|
|
304
|
-
.strict();
|
|
272
|
+
export const marketplaceUpgradeAllRow = openapi.upgradeRow;
|
|
305
273
|
export type MarketplaceUpgradeAllRow = z.infer<typeof marketplaceUpgradeAllRow>;
|
|
306
274
|
|
|
307
|
-
/** The whole upgrade-all readout: one outcome row per installed plugin.
|
|
308
|
-
export const marketplaceUpgradeAllResult =
|
|
309
|
-
.object({
|
|
310
|
-
results: z.array(marketplaceUpgradeAllRow),
|
|
311
|
-
})
|
|
312
|
-
.strict();
|
|
275
|
+
/** The whole upgrade-all readout: one outcome row per installed plugin. */
|
|
276
|
+
export const marketplaceUpgradeAllResult = openapi.upgradeAllResult;
|
|
313
277
|
export type MarketplaceUpgradeAllResult = z.infer<typeof marketplaceUpgradeAllResult>;
|
|
314
278
|
|
|
315
279
|
/** The advisory state for installed plugins, with when it was last fetched. */
|
|
316
|
-
export const marketplaceAdvisories =
|
|
280
|
+
export const marketplaceAdvisories = openapi.advisorySnapshot.extend({
|
|
317
281
|
advisories: z.array(marketplaceAdvisory),
|
|
318
|
-
fetched_at: z.string(),
|
|
319
282
|
});
|
|
320
283
|
|
|
321
284
|
/** The registry's controlled category list, proxied through the skeleton. */
|
|
322
|
-
export const marketplaceCategories =
|
|
285
|
+
export const marketplaceCategories = openapi.stringList;
|
|
323
286
|
|
|
324
287
|
/** The registry's controlled item-kind list, proxied through the skeleton. */
|
|
325
|
-
export const marketplaceKinds =
|
|
288
|
+
export const marketplaceKinds = openapi.stringList;
|
|
326
289
|
|
|
327
290
|
/**
|
|
328
291
|
* One route the install / update actually mounted: the item that owns it, the
|
|
329
292
|
* absolute `full_path` it now answers, the `methods`, and whether it is served
|
|
330
293
|
* `public`. The receipt lists these so the operator sees what was opened where.
|
|
331
294
|
*/
|
|
332
|
-
export const marketplaceMountedRoute =
|
|
333
|
-
item: z.string(),
|
|
334
|
-
full_path: z.string(),
|
|
335
|
-
methods: z.array(routeMethod),
|
|
336
|
-
public: z.boolean(),
|
|
337
|
-
});
|
|
295
|
+
export const marketplaceMountedRoute = openapi.mountedRoute;
|
|
338
296
|
export type MarketplaceMountedRoute = z.infer<typeof marketplaceMountedRoute>;
|
|
339
297
|
|
|
340
298
|
/**
|
|
@@ -342,60 +300,34 @@ export type MarketplaceMountedRoute = z.infer<typeof marketplaceMountedRoute>;
|
|
|
342
300
|
* `notes` (env-selected items naming their activating env var) and any
|
|
343
301
|
* non-critical `advisories` ride BOTH the install and update receipts.
|
|
344
302
|
* `routes` is the mounted-route list — empty for a plugin that registers none.
|
|
345
|
-
*
|
|
346
|
-
*
|
|
347
|
-
* not the raw install log.
|
|
303
|
+
* `package`, `reload` and `pip_output` carry the installed package, the config reload
|
|
304
|
+
* and the raw install log.
|
|
348
305
|
*/
|
|
349
|
-
export const marketplaceInstallResult =
|
|
350
|
-
ref: z.string(),
|
|
351
|
-
version: z.string(),
|
|
352
|
-
notes: z.array(z.string()),
|
|
306
|
+
export const marketplaceInstallResult = openapi.installResult.extend({
|
|
353
307
|
advisories: z.array(marketplaceAdvisory),
|
|
354
|
-
routes: z.array(marketplaceMountedRoute),
|
|
355
308
|
});
|
|
356
309
|
export type MarketplaceInstallResult = z.infer<typeof marketplaceInstallResult>;
|
|
357
310
|
|
|
358
311
|
/** One resolved route in an install preview: the declared `path`, its resolved
|
|
359
312
|
* absolute `full_path`, the `methods`, and whether it is `public`. */
|
|
360
|
-
export const marketplacePreviewRoute =
|
|
361
|
-
path: z.string(),
|
|
362
|
-
full_path: z.string(),
|
|
363
|
-
methods: z.array(routeMethod),
|
|
364
|
-
public: z.boolean(),
|
|
365
|
-
});
|
|
313
|
+
export const marketplacePreviewRoute = openapi.previewItemRoute;
|
|
366
314
|
export type MarketplacePreviewRoute = z.infer<typeof marketplacePreviewRoute>;
|
|
367
315
|
|
|
368
316
|
/** One route-carrying item in an install preview: its resolved `base` (the
|
|
369
317
|
* override or the default), the `default_base` it declares, and the routes that
|
|
370
318
|
* mount under it. */
|
|
371
|
-
export const marketplacePreviewItem =
|
|
372
|
-
item: z.string(),
|
|
373
|
-
kind: z.string(),
|
|
374
|
-
base: z.string(),
|
|
375
|
-
default_base: z.string(),
|
|
376
|
-
routes: z.array(marketplacePreviewRoute),
|
|
377
|
-
});
|
|
319
|
+
export const marketplacePreviewItem = openapi.previewItem;
|
|
378
320
|
export type MarketplacePreviewItem = z.infer<typeof marketplacePreviewItem>;
|
|
379
321
|
|
|
380
322
|
/** One collision the preview found: a route whose resolved shape+method clashes
|
|
381
323
|
* with an already-owned route. `conflict_owner` is `core` or `plugin:<ref>`; the
|
|
382
324
|
* remedy is to remap the item's base. */
|
|
383
|
-
export const marketplacePreviewCollision =
|
|
384
|
-
item: z.string(),
|
|
385
|
-
full_path: z.string(),
|
|
386
|
-
methods: z.array(routeMethod),
|
|
387
|
-
conflict_owner: z.string(),
|
|
388
|
-
conflict_path: z.string(),
|
|
389
|
-
});
|
|
325
|
+
export const marketplacePreviewCollision = openapi.routeCollision;
|
|
390
326
|
export type MarketplacePreviewCollision = z.infer<typeof marketplacePreviewCollision>;
|
|
391
327
|
|
|
392
328
|
/** One public route the operator is asked to accept: served WITHOUT
|
|
393
329
|
* authentication once installed. */
|
|
394
|
-
export const marketplacePreviewPublicRoute =
|
|
395
|
-
item: z.string(),
|
|
396
|
-
full_path: z.string(),
|
|
397
|
-
methods: z.array(routeMethod),
|
|
398
|
-
});
|
|
330
|
+
export const marketplacePreviewPublicRoute = openapi.publicRouteRow;
|
|
399
331
|
export type MarketplacePreviewPublicRoute = z.infer<typeof marketplacePreviewPublicRoute>;
|
|
400
332
|
|
|
401
333
|
/**
|
|
@@ -410,28 +342,13 @@ export type MarketplacePreviewPublicRoute = z.infer<typeof marketplacePreviewPub
|
|
|
410
342
|
* process env (server-computed — the ONE authority the dialog collects), and
|
|
411
343
|
* `delivery` is the one word the surface shows (`package` / `descriptor`).
|
|
412
344
|
*/
|
|
413
|
-
export const marketplaceInstallPreview =
|
|
414
|
-
ref: z.string(),
|
|
415
|
-
version: z.string(),
|
|
416
|
-
items: z.array(marketplacePreviewItem),
|
|
417
|
-
collisions: z.array(marketplacePreviewCollision),
|
|
418
|
-
public_routes: z.array(marketplacePreviewPublicRoute),
|
|
419
|
-
new_public_routes: z.array(marketplacePreviewPublicRoute),
|
|
420
|
-
requires_public_acceptance: z.boolean(),
|
|
421
|
-
required_env: z.array(marketplaceRequiredEnvVar),
|
|
422
|
-
missing_env: z.array(z.string()),
|
|
423
|
-
delivery: marketplaceDelivery,
|
|
424
|
-
});
|
|
345
|
+
export const marketplaceInstallPreview = openapi.installPreview;
|
|
425
346
|
export type MarketplaceInstallPreview = z.infer<typeof marketplaceInstallPreview>;
|
|
426
347
|
|
|
427
348
|
/**
|
|
428
349
|
* The receipt of an uninstall. `notes` carries operator warnings (e.g. a config
|
|
429
350
|
* provider still selected by its env var); render them like the install
|
|
430
|
-
* receipt's notes.
|
|
351
|
+
* receipt's notes. `reload` is `null` when the plugin wrote no manifest entry to remove.
|
|
431
352
|
*/
|
|
432
|
-
export const marketplaceUninstallResult =
|
|
433
|
-
ref: z.string(),
|
|
434
|
-
uninstalled: z.literal(true),
|
|
435
|
-
notes: z.array(z.string()),
|
|
436
|
-
});
|
|
353
|
+
export const marketplaceUninstallResult = openapi.uninstallResult;
|
|
437
354
|
export type MarketplaceUninstallResult = z.infer<typeof marketplaceUninstallResult>;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/** Member, invite, directory and member-action schemas for the generic Members view. */
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
import * as openapi from '../generated/openapi-schemas';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Where a declared member action renders: a page-level button, a member-row menu
|
|
8
|
+
* item, or an invite-row menu item. A provider classifies each of its own actions
|
|
9
|
+
* into one of these three places; Studio only joins by `scope`, never reads the
|
|
10
|
+
* provider's meaning behind it.
|
|
11
|
+
*/
|
|
12
|
+
export const memberActionScope = openapi.memberActionDescriptor.shape.scope;
|
|
13
|
+
export type MemberActionScope = z.infer<typeof memberActionScope>;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* One platform principal a member holds (`GET /api/auth/members` →
|
|
17
|
+
* `members[].principals[]`). `user_id` is the platform principal id; `disabled` is
|
|
18
|
+
* taken from that principal's own record (the store the principals listing reads) and
|
|
19
|
+
* `role` is the role it holds, joined from its own policy record — both never from a
|
|
20
|
+
* provider. `role` is `null` when the principal's policy was not written from a role
|
|
21
|
+
* template.
|
|
22
|
+
*/
|
|
23
|
+
export const memberPrincipalState = openapi.memberPrincipalState;
|
|
24
|
+
export type MemberPrincipalState = z.infer<typeof memberPrincipalState>;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* One person an accounts provider owns, as the directory door returns them
|
|
28
|
+
* (`GET /api/auth/members` → `members[]`). `id` is the provider's stable handle for
|
|
29
|
+
* the person (a list key, not shown). `email` is the sign-in identity; `role` is the
|
|
30
|
+
* one role name every principal holds (the NAME only — the role definition is read
|
|
31
|
+
* from the role listing), or `null` when there is no single name: every principal's
|
|
32
|
+
* access was set directly, or the principals hold different roles
|
|
33
|
+
* (`principals[].role` carries each one's own). `principals` carries each principal's
|
|
34
|
+
* platform-joined state; `disabled` is derived True only when EVERY principal is disabled, so a
|
|
35
|
+
* person with any enabled principal still reads active while the per-principal truth
|
|
36
|
+
* stays visible. `handle` routes an invoke back to the producing provider and pins
|
|
37
|
+
* this row; `action_keys` are the opaque catalog keys of the actions applicable to
|
|
38
|
+
* it — Studio joins and echoes both, never parses them. `created_at` is an ISO-8601
|
|
39
|
+
* instant.
|
|
40
|
+
*/
|
|
41
|
+
export const memberRow = openapi.memberRow;
|
|
42
|
+
export type MemberRow = z.infer<typeof memberRow>;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* One outstanding invitation an accounts provider holds, as the directory door
|
|
46
|
+
* returns them (`GET /api/auth/members` → `invites[]`). `id` is the provider's
|
|
47
|
+
* stable handle for the invited person; `email` is the invited address; `role` names
|
|
48
|
+
* the platform role they will hold (name only, or `null` when not from a role template). An
|
|
49
|
+
* invitation holds no principal, so it carries no principal state. `handle` and
|
|
50
|
+
* `action_keys` are the opaque routing tokens (see {@link memberRow}). `created_at`
|
|
51
|
+
* and `expires_at` are ISO-8601 instants.
|
|
52
|
+
*/
|
|
53
|
+
export const inviteRow = openapi.inviteRow;
|
|
54
|
+
export type InviteRow = z.infer<typeof inviteRow>;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The deployment-wide membership (`GET /api/auth/members`): every accounts
|
|
58
|
+
* provider's people and outstanding invitations, aggregated and platform-joined by
|
|
59
|
+
* the backend into one view so a generic Members screen renders without naming any
|
|
60
|
+
* provider.
|
|
61
|
+
*/
|
|
62
|
+
export const memberDirectory = openapi.memberDirectory;
|
|
63
|
+
export type MemberDirectory = z.infer<typeof memberDirectory>;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* One declared member action, serialized for the catalog (`GET
|
|
67
|
+
* /api/auth/member-actions` → `actions[]`). `key` is the opaque catalog key a caller
|
|
68
|
+
* joins and echoes, never parses. `label` is the resolved wording. `scope` places
|
|
69
|
+
* the action; `destructive` asks for a confirm before invoking. `input_schema` and
|
|
70
|
+
* `result_schema` are the declared models' JSON Schema — a caller renders an input
|
|
71
|
+
* form and a read-only result view from them generically, with no provider field
|
|
72
|
+
* name known to Studio.
|
|
73
|
+
*/
|
|
74
|
+
export const memberActionDescriptor = openapi.memberActionDescriptor;
|
|
75
|
+
export type MemberActionDescriptor = z.infer<typeof memberActionDescriptor>;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Every declared member action across the registered accounts providers (`GET
|
|
79
|
+
* /api/auth/member-actions`). ADMIN-ONLY (`secret`) — a non-admin projection never
|
|
80
|
+
* reaches the route, exactly as the members listing.
|
|
81
|
+
*/
|
|
82
|
+
export const memberActionCatalog = openapi.memberActionCatalog;
|
|
83
|
+
export type MemberActionCatalog = z.infer<typeof memberActionCatalog>;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* The invoke-door result (`POST /api/auth/member-actions/invoke`): the provider's
|
|
87
|
+
* result-model dump, carried opaquely. `result` is rendered through the action's
|
|
88
|
+
* `result_schema`; Studio reads no field of it by name.
|
|
89
|
+
*/
|
|
90
|
+
export const invokeMemberActionResult = openapi.invokeMemberActionResult;
|
|
91
|
+
export type InvokeMemberActionResult = z.infer<typeof invokeMemberActionResult>;
|
|
@@ -1,43 +1,19 @@
|
|
|
1
1
|
/** Notification-sink record response schemas. */
|
|
2
|
-
import { z } from 'zod';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import * as openapi from '../generated/openapi-schemas';
|
|
5
5
|
|
|
6
6
|
// The internal notifications sink: the messages the `notify_user` operation records
|
|
7
7
|
// with no channel, so they land only in the Studio inbox. Each record carries the
|
|
8
|
-
// server-minted id + timestamp; `recipient` is
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
8
|
+
// server-minted id + timestamp; `recipient` is the channel DELIVERY address the message
|
|
9
|
+
// went to (null when the send named none) and `audience` the IDENTITY (a user_id) whose
|
|
10
|
+
// in-app inbox the record is addressed to. The sink also stores the richer-send forms a
|
|
11
|
+
// notify carried — `media` (images/links shown WITH the message), `template` (a
|
|
12
|
+
// pre-approved out-of-window send), `options`/`sections` (tappable options), `header`,
|
|
13
|
+
// `footer`, `location` and `schema` — and the inbox renders them.
|
|
13
14
|
|
|
14
|
-
export const notification =
|
|
15
|
-
id: z.string(),
|
|
16
|
-
message: z.string(),
|
|
17
|
-
// A channel DELIVERY address the message went to; null when the send named none.
|
|
18
|
-
recipient: z.string().nullable(),
|
|
19
|
-
// The IDENTITY (a user_id) whose in-app inbox the record is addressed to, distinct
|
|
20
|
-
// from `recipient`. `.nullish()` accepts both an older record that predates the
|
|
21
|
-
// field (key omitted) and a broadcast send (explicit null) — both parse to "none".
|
|
22
|
-
audience: z.string().nullish(),
|
|
23
|
-
// Display-only media stored WITH the message (images and/or links). Deliberately
|
|
24
|
-
// LOOSE (`z.array(z.unknown())`), like the interactions frame: each item is
|
|
25
|
-
// `safeParse`d per item by the renderer against `interactionMediaItem`, so one
|
|
26
|
-
// malformed/hostile item is a loud per-item notice, never a whole-feed parse
|
|
27
|
-
// failure that would silently vanish every other notification. `.nullish()` covers
|
|
28
|
-
// an older record (key omitted) and a plain send (explicit null).
|
|
29
|
-
media: z.array(z.unknown()).nullish(),
|
|
30
|
-
// A pre-approved template the notify carried, parsed strictly: a drifting one is a
|
|
31
|
-
// loud feed-level `ApiSchemaError`, consistent with the record contract.
|
|
32
|
-
template: channelTemplate.nullish(),
|
|
33
|
-
// Tappable option labels the notify offered; display-only in the operator inbox
|
|
34
|
-
// (there is no conversation for the sink to enter). Strictly a string list.
|
|
35
|
-
options: z.array(z.string()).nullish(),
|
|
36
|
-
created_at: z.string(),
|
|
37
|
-
});
|
|
15
|
+
export const notification = openapi.notificationRecord;
|
|
38
16
|
export type Notification = z.infer<typeof notification>;
|
|
39
17
|
|
|
40
|
-
export const notifications =
|
|
41
|
-
notifications: z.array(notification),
|
|
42
|
-
});
|
|
18
|
+
export const notifications = openapi.notificationListing;
|
|
43
19
|
export type Notifications = z.infer<typeof notifications>;
|
|
@@ -1,90 +1,45 @@
|
|
|
1
1
|
/** Run metrics, listing, span and trace response schemas. */
|
|
2
|
-
import { z } from 'zod';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import * as openapi from '../generated/openapi-schemas';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
totalCost: z.number(),
|
|
10
|
-
totalTokens: z.number(),
|
|
11
|
-
averageLatencyMs: z.number(),
|
|
12
|
-
avgCostPerRun: z.number(),
|
|
13
|
-
avgTokensPerRun: z.number(),
|
|
14
|
-
timeToFirstTokenMs: z.number().nullable(),
|
|
15
|
-
}),
|
|
16
|
-
timeSeries: z.array(
|
|
17
|
-
z.object({
|
|
18
|
-
bucket: z.string().nullable(),
|
|
19
|
-
runs: z.number(),
|
|
20
|
-
cost: z.number(),
|
|
21
|
-
avgLatencyMs: z.number(),
|
|
22
|
-
totalTokens: z.number(),
|
|
23
|
-
}),
|
|
24
|
-
),
|
|
25
|
-
byModel: z.array(
|
|
26
|
-
z.object({
|
|
27
|
-
model: z.string(),
|
|
28
|
-
calls: z.number(),
|
|
29
|
-
cost: z.number(),
|
|
30
|
-
totalTokens: z.number(),
|
|
31
|
-
avgLatencyMs: z.number(),
|
|
32
|
-
}),
|
|
33
|
-
),
|
|
34
|
-
// `false` when the by-model sub-query faulted, so an empty breakdown is
|
|
35
|
-
// distinguishable from an unavailable one.
|
|
36
|
-
byModelAvailable: z.boolean(),
|
|
37
|
-
granularity: z.enum(['hour', 'day', 'week']),
|
|
38
|
-
});
|
|
6
|
+
// `byModelAvailable` is `false` when the by-model sub-query faulted, so an empty breakdown is
|
|
7
|
+
// distinguishable from an unavailable one.
|
|
8
|
+
export const dashboardMetrics = openapi.metricsResult;
|
|
39
9
|
export type DashboardMetrics = z.infer<typeof dashboardMetrics>;
|
|
40
10
|
|
|
41
|
-
export const run =
|
|
42
|
-
id: z.string(),
|
|
43
|
-
traceId: z.string(),
|
|
44
|
-
createdAt: z.string().nullable(),
|
|
45
|
-
tags: z.array(z.string()),
|
|
46
|
-
status: z.enum(['error', 'success']),
|
|
47
|
-
cost: z.number().nullable(),
|
|
48
|
-
latencyMs: z.number().nullable(),
|
|
49
|
-
totalTokens: z.number().nullable(),
|
|
50
|
-
inputPreview: jsonValue,
|
|
51
|
-
outputPreview: jsonValue,
|
|
52
|
-
});
|
|
11
|
+
export const run = openapi.observabilityRunView;
|
|
53
12
|
export type Run = z.infer<typeof run>;
|
|
54
13
|
|
|
55
|
-
export const runsPage =
|
|
56
|
-
items: z.array(run),
|
|
57
|
-
page: z.number(),
|
|
58
|
-
nextPage: z.number().nullable(),
|
|
59
|
-
});
|
|
14
|
+
export const runsPage = openapi.observabilityRunsPage;
|
|
60
15
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
end: z.string().nullable(),
|
|
71
|
-
model: z.string().nullable(),
|
|
72
|
-
usage: jsonValue.nullable(),
|
|
73
|
-
metadata: jsonValue.nullable(),
|
|
74
|
-
input: jsonValue,
|
|
75
|
-
output: jsonValue,
|
|
76
|
-
nodeId: z.string().nullable(),
|
|
77
|
-
});
|
|
16
|
+
/** The neutral span kinds the monitoring backend maps its own observation types onto. */
|
|
17
|
+
export const spanKind = openapi.spanOutlineView.shape.kind.unwrap().unwrap();
|
|
18
|
+
export type SpanKind = z.infer<typeof spanKind>;
|
|
19
|
+
|
|
20
|
+
/** One span of a run without its input and output: the light span-tree row. */
|
|
21
|
+
export const runSpanOutline = openapi.spanOutlineView;
|
|
22
|
+
export type RunSpanOutline = z.infer<typeof runSpanOutline>;
|
|
23
|
+
|
|
24
|
+
export const runSpan = openapi.spanView;
|
|
78
25
|
export type RunSpan = z.infer<typeof runSpan>;
|
|
79
26
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
input: jsonValue,
|
|
86
|
-
output: jsonValue,
|
|
87
|
-
metadata: jsonValue.nullable(),
|
|
88
|
-
spans: z.array(runSpan),
|
|
89
|
-
});
|
|
27
|
+
/** A run's span tree (`GET /api/observability/runs/{trace}/trace/outline`). */
|
|
28
|
+
export const runTraceOutline = openapi.runTraceOutlineView;
|
|
29
|
+
export type RunTraceOutline = z.infer<typeof runTraceOutline>;
|
|
30
|
+
|
|
31
|
+
export const runTrace = openapi.runTraceView;
|
|
90
32
|
export type RunTrace = z.infer<typeof runTrace>;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* What the monitoring backend serves, in the run list's wire names
|
|
36
|
+
* (`GET /api/observability/capabilities`): the largest run-list page, the sort keys
|
|
37
|
+
* it serves, the filter params each sort cannot be combined with, and the metrics
|
|
38
|
+
* measures and dimensions.
|
|
39
|
+
*/
|
|
40
|
+
export const observabilityCapabilities = openapi.observabilityCapabilities;
|
|
41
|
+
export type ObservabilityCapabilities = z.infer<typeof observabilityCapabilities>;
|
|
42
|
+
|
|
43
|
+
/** One span field's value with every record reference resolved. */
|
|
44
|
+
export const resolvedSpanValue = openapi.resolvedSpanValue;
|
|
45
|
+
export type ResolvedSpanValue = z.infer<typeof resolvedSpanValue>;
|
package/src/schemas/policy.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** Access-policy validation, version and rollback response schemas. */
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
|
+
import * as openapi from '../generated/openapi-schemas';
|
|
4
5
|
import { policyBody } from './served';
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -11,10 +12,7 @@ import { policyBody } from './served';
|
|
|
11
12
|
* syntactically-broken condition can be caught before it locks a key out. A drift
|
|
12
13
|
* throws `ApiSchemaError`.
|
|
13
14
|
*/
|
|
14
|
-
export const validateConditionResult =
|
|
15
|
-
ok: z.boolean(),
|
|
16
|
-
result: z.boolean().nullable(),
|
|
17
|
-
});
|
|
15
|
+
export const validateConditionResult = openapi.conditionCheckResult;
|
|
18
16
|
export type ValidateConditionResult = z.infer<typeof validateConditionResult>;
|
|
19
17
|
|
|
20
18
|
/**
|
|
@@ -23,16 +21,11 @@ export type ValidateConditionResult = z.infer<typeof validateConditionResult>;
|
|
|
23
21
|
* active pointer; `tags` is the generic per-version label list (kind-agnostic),
|
|
24
22
|
* mirroring the preset version shape.
|
|
25
23
|
*/
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
body: policyBody,
|
|
29
|
-
tags: z.array(z.string()),
|
|
30
|
-
created_at: z.string(),
|
|
31
|
-
is_current: z.boolean(),
|
|
32
|
-
});
|
|
24
|
+
// The body is hand-typed: the spec publishes a version body as an open object.
|
|
25
|
+
export const policyVersion = openapi.documentVersion.extend({ body: policyBody });
|
|
33
26
|
export type PolicyVersion = z.infer<typeof policyVersion>;
|
|
34
27
|
|
|
35
28
|
export const policyVersionList = z.array(policyVersion);
|
|
36
29
|
|
|
37
30
|
/** `POST /api/auth/api-keys/{user_id}/policy/rollback` — the re-pointed version. */
|
|
38
|
-
export const policyRollback =
|
|
31
|
+
export const policyRollback = openapi.policyRollbackResult;
|