@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/schemas/states.ts
CHANGED
|
@@ -1,28 +1,20 @@
|
|
|
1
1
|
/** State declaration, record, template and consumer response schemas. */
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import * as openapi from '../generated/openapi-schemas';
|
|
5
|
+
import * as served from '../generated/served-schemas';
|
|
5
6
|
import { stateDeclaration, stateTemplateDocument } from './served';
|
|
6
7
|
|
|
7
|
-
// The
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
// sub-shapes) are generated from the contract bundle and re-exported at the top of this
|
|
11
|
-
// file. The composed `effective_schema` and write `regimes` stay permissive JSON records
|
|
12
|
-
// (the auto-form and JsonTree interpret them at runtime) and are server-computed, so they
|
|
13
|
-
// are modelled optional and a response that omits them still parses.
|
|
8
|
+
// The state response schemas — list rows and detail, attachments, per-subject records and
|
|
9
|
+
// subjects, stats and consumers. The served DOCUMENT schemas (`stateDeclaration`/
|
|
10
|
+
// `stateTemplateDocument` and the template sub-shapes) are re-exported from `./served`.
|
|
14
11
|
|
|
15
12
|
/** One addressed subject: the conversation-target scope plus the (kind, key) within it. */
|
|
16
|
-
export const stateSubject =
|
|
17
|
-
target_kind: conversationTargetKind,
|
|
18
|
-
target_name: z.string(),
|
|
19
|
-
kind: z.string(),
|
|
20
|
-
key: z.string(),
|
|
21
|
-
});
|
|
13
|
+
export const stateSubject = openapi.stateSubject;
|
|
22
14
|
export type StateSubject = z.infer<typeof stateSubject>;
|
|
23
15
|
|
|
24
|
-
/** One absolute write-regime rule composed over the attachments: `{path, regime}
|
|
25
|
-
export const stateRegime =
|
|
16
|
+
/** One absolute write-regime rule composed over the attachments: `{path, regime}`. */
|
|
17
|
+
export const stateRegime = served.stateRegimeRule;
|
|
26
18
|
|
|
27
19
|
/**
|
|
28
20
|
* One row of `GET /api/states` — a served declaration (`list_states` dumps every
|
|
@@ -30,40 +22,44 @@ export const stateRegime = z.record(z.string(), z.unknown());
|
|
|
30
22
|
* `null`). The list carries no record count; the `Records` column reads
|
|
31
23
|
* `getStateStats` lazily per row.
|
|
32
24
|
*/
|
|
33
|
-
export const stateListItem = stateDeclaration
|
|
34
|
-
updated_at: z.string().nullable().default(null),
|
|
35
|
-
});
|
|
25
|
+
export const stateListItem = stateDeclaration;
|
|
36
26
|
export type StateListItem = z.infer<typeof stateListItem>;
|
|
37
|
-
export const stateList =
|
|
27
|
+
export const stateList = openapi.stateDeclarationList;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* One save held by a failed pending save: `save_id` names it, `held_by` the failed save holding it
|
|
31
|
+
* (equal to `save_id` for the failed save itself), `subjects` the subjects it writes. A scan or
|
|
32
|
+
* a re-declare that read past it names it in its `held` list.
|
|
33
|
+
*/
|
|
34
|
+
export const heldPendingSave = openapi.heldPendingSave;
|
|
35
|
+
export type HeldPendingSave = z.infer<typeof heldPendingSave>;
|
|
38
36
|
|
|
39
37
|
/** One template attachment on a state: where the fragment lands + its param/declaration values. */
|
|
40
|
-
export const stateAttachment =
|
|
41
|
-
template: z.string(),
|
|
42
|
-
path: z.array(z.string()),
|
|
43
|
-
parameters: z.record(z.string(), z.unknown()).default({}),
|
|
44
|
-
declarations: z.record(z.string(), z.unknown()).default({}),
|
|
45
|
-
});
|
|
38
|
+
export const stateAttachment = openapi.stateAttachmentView;
|
|
46
39
|
export type StateAttachment = z.infer<typeof stateAttachment>;
|
|
47
|
-
export const stateAttachmentList =
|
|
40
|
+
export const stateAttachmentList = openapi.stateAttachmentList;
|
|
48
41
|
|
|
49
42
|
/** `GET /api/states/{name}` — the declaration (with effective schema + regimes) plus attachments. */
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
});
|
|
43
|
+
// Built on the declaration document: the spec publishes the served view's `schema` and
|
|
44
|
+
// `regimes` as open objects, the document types them.
|
|
45
|
+
export const stateDetail = stateDeclaration.extend({ attachments: z.array(stateAttachment) });
|
|
53
46
|
export type StateDetail = z.infer<typeof stateDetail>;
|
|
54
47
|
|
|
48
|
+
/**
|
|
49
|
+
* `PUT /api/states/{name}` — a create or re-declare's answer: the stored declaration's fields
|
|
50
|
+
* plus `held`, the held pending saves an accepted re-declare names (absent when none). The
|
|
51
|
+
* answer carries no attachments; a caller that needs them reads `getState`.
|
|
52
|
+
*/
|
|
53
|
+
export const stateDeclarationSaved = openapi.stateDeclarationPutResponse;
|
|
54
|
+
export type StateDeclarationSaved = z.infer<typeof stateDeclarationSaved>;
|
|
55
|
+
|
|
55
56
|
/**
|
|
56
57
|
* `GET /api/states/{name}/stats` — `records` (total documents), `per_field` (the count
|
|
57
58
|
* of records carrying each base-schema property), `per_kind` (records per subject kind)
|
|
58
59
|
* and `consumers` (the count of listable consumers). The Records tab shows `records`;
|
|
59
60
|
* the states list reads it lazily for its Records column.
|
|
60
61
|
*/
|
|
61
|
-
export const stateStats =
|
|
62
|
-
records: z.number(),
|
|
63
|
-
per_field: z.record(z.string(), z.number()).default({}),
|
|
64
|
-
per_kind: z.record(z.string(), z.number()).default({}),
|
|
65
|
-
consumers: z.number().default(0),
|
|
66
|
-
});
|
|
62
|
+
export const stateStats = openapi.stateStats;
|
|
67
63
|
export type StateStats = z.infer<typeof stateStats>;
|
|
68
64
|
|
|
69
65
|
/**
|
|
@@ -72,31 +68,21 @@ export type StateStats = z.infer<typeof stateStats>;
|
|
|
72
68
|
* while > 0) and `shipped_default` (a platform-shipped template). Both are server-derived
|
|
73
69
|
* columns; the document fields are verbatim.
|
|
74
70
|
*/
|
|
71
|
+
// Built on the template document: the spec publishes a served template's jq programs as open
|
|
72
|
+
// objects, the document types them.
|
|
75
73
|
export const stateTemplateListItem = stateTemplateDocument.extend({
|
|
76
|
-
attached_to:
|
|
77
|
-
shipped_default:
|
|
74
|
+
attached_to: openapi.stateTemplateCatalogEntry.shape.attached_to,
|
|
75
|
+
shipped_default: openapi.stateTemplateCatalogEntry.shape.shipped_default,
|
|
78
76
|
});
|
|
79
77
|
export type StateTemplateListItem = z.infer<typeof stateTemplateListItem>;
|
|
80
78
|
export const stateTemplateList = z.array(stateTemplateListItem);
|
|
81
79
|
|
|
82
80
|
/** A read record: the state, its subject, the document + monotonic seq, and any fold. */
|
|
83
|
-
export const stateRecord =
|
|
84
|
-
state: z.string(),
|
|
85
|
-
subject: stateSubject,
|
|
86
|
-
data: z.record(z.string(), z.unknown()).default({}),
|
|
87
|
-
seq: z.number(),
|
|
88
|
-
canonical_subject: stateSubject,
|
|
89
|
-
folded_from: z.array(stateSubject).default([]),
|
|
90
|
-
});
|
|
81
|
+
export const stateRecord = openapi.stateRecord;
|
|
91
82
|
export type StateRecord = z.infer<typeof stateRecord>;
|
|
92
83
|
|
|
93
84
|
/** The outcome of an `apply` (a delta batch): whether it applied + the resulting doc. */
|
|
94
|
-
export const applyResult =
|
|
95
|
-
applied: z.boolean(),
|
|
96
|
-
data: z.record(z.string(), z.unknown()).nullable().default(null),
|
|
97
|
-
seq: z.number().nullable().default(null),
|
|
98
|
-
skipped: z.array(z.record(z.string(), z.unknown())).default([]),
|
|
99
|
-
});
|
|
85
|
+
export const applyResult = openapi.applyResult;
|
|
100
86
|
export type ApplyResult = z.infer<typeof applyResult>;
|
|
101
87
|
|
|
102
88
|
/**
|
|
@@ -105,11 +91,7 @@ export type ApplyResult = z.infer<typeof applyResult>;
|
|
|
105
91
|
* on an `update`-purpose name is refused with 422, so the result's purpose is always
|
|
106
92
|
* `input`.
|
|
107
93
|
*/
|
|
108
|
-
export const templateJqResult =
|
|
109
|
-
name: z.string(),
|
|
110
|
-
purpose: z.literal('input'),
|
|
111
|
-
value: z.unknown(),
|
|
112
|
-
});
|
|
94
|
+
export const templateJqResult = openapi.templateJqResult;
|
|
113
95
|
export type TemplateJqResult = z.infer<typeof templateJqResult>;
|
|
114
96
|
|
|
115
97
|
/**
|
|
@@ -117,13 +99,7 @@ export type TemplateJqResult = z.infer<typeof templateJqResult>;
|
|
|
117
99
|
* batch through the same `apply` chokepoint as a delta, so `applied`/`data`/`seq`/`skipped`
|
|
118
100
|
* carry that outcome.
|
|
119
101
|
*/
|
|
120
|
-
export const templateJqApplyResult =
|
|
121
|
-
name: z.string(),
|
|
122
|
-
applied: z.boolean(),
|
|
123
|
-
data: z.record(z.string(), z.unknown()).nullable().default(null),
|
|
124
|
-
seq: z.number().nullable().default(null),
|
|
125
|
-
skipped: z.array(z.record(z.string(), z.unknown())).default([]),
|
|
126
|
-
});
|
|
102
|
+
export const templateJqApplyResult = openapi.templateJqApplyResult;
|
|
127
103
|
export type TemplateJqApplyResult = z.infer<typeof templateJqApplyResult>;
|
|
128
104
|
|
|
129
105
|
/**
|
|
@@ -131,10 +107,7 @@ export type TemplateJqApplyResult = z.infer<typeof templateJqApplyResult>;
|
|
|
131
107
|
* `updated_at` — epoch seconds (the store's `extract(epoch FROM updated_at)`), served
|
|
132
108
|
* raw (no `mode="json"` dump), and `NOT NULL` on every record, so a plain number.
|
|
133
109
|
*/
|
|
134
|
-
export const subjectRow =
|
|
135
|
-
subject: stateSubject,
|
|
136
|
-
updated_at: z.number(),
|
|
137
|
-
});
|
|
110
|
+
export const subjectRow = openapi.stateSubjectEntry;
|
|
138
111
|
export type SubjectRow = z.infer<typeof subjectRow>;
|
|
139
112
|
|
|
140
113
|
/**
|
|
@@ -142,10 +115,7 @@ export type SubjectRow = z.infer<typeof subjectRow>;
|
|
|
142
115
|
* `kind`): the matched `subjects` plus the `next_cursor` a "Load more" carries back
|
|
143
116
|
* (`null` at the end).
|
|
144
117
|
*/
|
|
145
|
-
export const subjectPage =
|
|
146
|
-
subjects: z.array(subjectRow),
|
|
147
|
-
next_cursor: z.string().nullable().default(null),
|
|
148
|
-
});
|
|
118
|
+
export const subjectPage = openapi.stateSubjectsPage;
|
|
149
119
|
export type SubjectPage = z.infer<typeof subjectPage>;
|
|
150
120
|
|
|
151
121
|
/**
|
|
@@ -153,48 +123,23 @@ export type SubjectPage = z.infer<typeof subjectPage>;
|
|
|
153
123
|
* document contains the filters (a JSONB containment match). Each hit's `subject` opens
|
|
154
124
|
* the record page; `next_cursor` pages the rest.
|
|
155
125
|
*/
|
|
156
|
-
export const recordSearchPage =
|
|
157
|
-
matches: z.array(subjectRow),
|
|
158
|
-
next_cursor: z.string().nullable().default(null),
|
|
159
|
-
});
|
|
126
|
+
export const recordSearchPage = openapi.stateSearchPage;
|
|
160
127
|
export type RecordSearchPage = z.infer<typeof recordSearchPage>;
|
|
161
128
|
|
|
162
129
|
/** A WriteEntry's origin completed by the platform chokepoint (mirrors CompletedOrigin). */
|
|
163
|
-
export const completedOrigin =
|
|
164
|
-
consumer: z.string().nullable().default(null),
|
|
165
|
-
// Opaque consumer-supplied provenance JSON the platform stores as is.
|
|
166
|
-
meta: z.record(z.string(), z.unknown()).nullable().default(null),
|
|
167
|
-
run_id: z.string().nullable().default(null),
|
|
168
|
-
op_id: z.string().nullable().default(null),
|
|
169
|
-
door: z.string(),
|
|
170
|
-
actor: z.string().nullable().default(null),
|
|
171
|
-
turn_id: z.string().nullable().default(null),
|
|
172
|
-
inbound_id: z.string().nullable().default(null),
|
|
173
|
-
});
|
|
130
|
+
export const completedOrigin = openapi.completedOrigin;
|
|
174
131
|
export type CompletedOrigin = z.infer<typeof completedOrigin>;
|
|
175
132
|
|
|
176
133
|
/** One row of a subject's audit trail (mirrors WriteEntry). `paths` are absolute. */
|
|
177
|
-
export const writeEntry =
|
|
178
|
-
seq: z.number(),
|
|
179
|
-
at: z.string(),
|
|
180
|
-
origin: completedOrigin,
|
|
181
|
-
paths: z.array(z.array(z.union([z.string(), z.number()]))).default([]),
|
|
182
|
-
});
|
|
134
|
+
export const writeEntry = openapi.writeEntry;
|
|
183
135
|
export type WriteEntry = z.infer<typeof writeEntry>;
|
|
184
136
|
|
|
185
137
|
/** `GET /api/states/{name}/records/.../writes` — a keyset page of the audit trail. */
|
|
186
|
-
export const writesPage =
|
|
187
|
-
items: z.array(writeEntry),
|
|
188
|
-
next_cursor: z.string().nullable().default(null),
|
|
189
|
-
});
|
|
138
|
+
export const writesPage = openapi.writesPage;
|
|
190
139
|
export type WritesPage = z.infer<typeof writesPage>;
|
|
191
140
|
|
|
192
141
|
/** Where the Studio opens a consumer (mirrors ConsumerLink): a token+search OR plugin path. */
|
|
193
|
-
export const consumerLink =
|
|
194
|
-
token: z.string().nullable().default(null),
|
|
195
|
-
plugin_path: z.string().nullable().default(null),
|
|
196
|
-
search: z.record(z.string(), z.unknown()).nullable().default(null),
|
|
197
|
-
});
|
|
142
|
+
export const consumerLink = openapi.consumerLink;
|
|
198
143
|
export type ConsumerLink = z.infer<typeof consumerLink>;
|
|
199
144
|
|
|
200
145
|
/**
|
|
@@ -203,71 +148,75 @@ export type ConsumerLink = z.infer<typeof consumerLink>;
|
|
|
203
148
|
* family that cannot be listed on this deployment (e.g. no scheduling backend), surfaced
|
|
204
149
|
* as a muted line — never swallowed.
|
|
205
150
|
*/
|
|
206
|
-
export const consumerRow =
|
|
207
|
-
kind: z.string(),
|
|
208
|
-
name: z.string().nullable().default(null),
|
|
209
|
-
detail: z.string().nullable().default(null),
|
|
210
|
-
link: consumerLink.nullable().default(null),
|
|
211
|
-
unavailable: z.string().nullable().default(null),
|
|
212
|
-
});
|
|
151
|
+
export const consumerRow = openapi.consumerRow;
|
|
213
152
|
export type ConsumerRow = z.infer<typeof consumerRow>;
|
|
214
153
|
|
|
215
154
|
/** `GET /api/states/{name}/consumers` — the union of every registered lister's rows. */
|
|
216
|
-
export const stateConsumers =
|
|
155
|
+
export const stateConsumers = openapi.stateConsumerList;
|
|
217
156
|
export type StateConsumers = z.infer<typeof stateConsumers>;
|
|
218
157
|
|
|
219
158
|
/** `DELETE /api/states/{name}` — the removed state. */
|
|
220
|
-
export const stateDeleted =
|
|
159
|
+
export const stateDeleted = openapi.stateDeleteResult;
|
|
221
160
|
|
|
222
161
|
/** `PUT /api/states/{name}/attachments/{template}` — the template now attached to the state. */
|
|
223
|
-
export const stateAttached =
|
|
224
|
-
attached: z.literal(true),
|
|
225
|
-
state: z.string(),
|
|
226
|
-
template: z.string(),
|
|
227
|
-
});
|
|
162
|
+
export const stateAttached = openapi.attachAck;
|
|
228
163
|
export type StateAttached = z.infer<typeof stateAttached>;
|
|
229
164
|
|
|
230
165
|
/** `PATCH /api/states/{name}/attachments/{template}` — the attachment whose declarations were rewritten. */
|
|
231
|
-
export const stateAttachmentUpdated =
|
|
232
|
-
updated: z.literal(true),
|
|
233
|
-
state: z.string(),
|
|
234
|
-
template: z.string(),
|
|
235
|
-
});
|
|
166
|
+
export const stateAttachmentUpdated = openapi.attachUpdateAck;
|
|
236
167
|
export type StateAttachmentUpdated = z.infer<typeof stateAttachmentUpdated>;
|
|
237
168
|
|
|
238
169
|
/** `DELETE /api/states/{name}/attachments/{template}` — the template detached from the state. */
|
|
239
|
-
export const stateDetached =
|
|
240
|
-
detached: z.literal(true),
|
|
241
|
-
state: z.string(),
|
|
242
|
-
template: z.string(),
|
|
243
|
-
});
|
|
170
|
+
export const stateDetached = openapi.detachAck;
|
|
244
171
|
export type StateDetached = z.infer<typeof stateDetached>;
|
|
245
172
|
|
|
246
173
|
/**
|
|
247
174
|
* `POST /api/states/{name}/records/.../fold` — the fold report: the `mode`, the
|
|
248
175
|
* `{kind, key}` of the folded `from` and surviving `into` subjects, whether the fold
|
|
249
|
-
* was `already` in place,
|
|
176
|
+
* was `already` in place, how many records were `flattened` into the survivor, and
|
|
177
|
+
* (a `merge` fold only) the survivor's newly-filled `merged_members`.
|
|
250
178
|
*/
|
|
251
|
-
export const stateFoldReport =
|
|
252
|
-
mode: z.enum(['switch', 'merge']),
|
|
253
|
-
from: z.object({ kind: z.string(), key: z.string() }),
|
|
254
|
-
into: z.object({ kind: z.string(), key: z.string() }),
|
|
255
|
-
already: z.boolean(),
|
|
256
|
-
flattened: z.number().default(0),
|
|
257
|
-
});
|
|
179
|
+
export const stateFoldReport = openapi.foldReport;
|
|
258
180
|
export type StateFoldReport = z.infer<typeof stateFoldReport>;
|
|
259
181
|
|
|
260
182
|
/** `DELETE /api/state-templates/{name}` — the removed template document. */
|
|
261
|
-
export const stateTemplateDeleted =
|
|
183
|
+
export const stateTemplateDeleted = openapi.stateDeleteResult;
|
|
262
184
|
|
|
263
185
|
/** `DELETE /api/states/{name}/records/...` — the erased record marker. */
|
|
264
|
-
export const recordErased =
|
|
186
|
+
export const recordErased = openapi.eraseAck;
|
|
265
187
|
|
|
266
188
|
/**
|
|
267
189
|
* `POST /api/state-retention/prune` — the retention sweep's per-state deleted counts
|
|
268
190
|
* (`{}` when nothing expired); the UI sums the values for its total.
|
|
269
191
|
*/
|
|
270
|
-
export const stateRetentionPruned =
|
|
271
|
-
pruned: z.record(z.string(), z.number()).default({}),
|
|
272
|
-
});
|
|
192
|
+
export const stateRetentionPruned = openapi.pruneResult;
|
|
273
193
|
export type StateRetentionPruned = z.infer<typeof stateRetentionPruned>;
|
|
194
|
+
|
|
195
|
+
/** A pending save's lifecycle: records waiting, calls queued, a call running, or failed (held). */
|
|
196
|
+
export const pendingSaveStatus = openapi.statePendingSave.shape.status;
|
|
197
|
+
export type PendingSaveStatus = z.infer<typeof pendingSaveStatus>;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* One outstanding pending state save (`GET /api/state-pending-saves`): what it writes and calls,
|
|
201
|
+
* never the record data or call arguments. `failed_phase` says which part failed.
|
|
202
|
+
*/
|
|
203
|
+
export const pendingSave = openapi.statePendingSave;
|
|
204
|
+
export type PendingSave = z.infer<typeof pendingSave>;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* A page of pending saves, newest first, with the totals of every `outstanding` and every
|
|
208
|
+
* `failed` save; `next_cursor` continues the page (`null` at the end).
|
|
209
|
+
*/
|
|
210
|
+
export const pendingSavesPage = openapi.statePendingSavesPage;
|
|
211
|
+
export type PendingSavesPage = z.infer<typeof pendingSavesPage>;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* `POST /api/state-pending-saves/{id}/retry` — the save's status after its records phase:
|
|
215
|
+
* `applied` (it landed whole), `pending`/`calls`/`running` (queued again), or `failed` again
|
|
216
|
+
* with its `last_error`.
|
|
217
|
+
*/
|
|
218
|
+
export const pendingSaveRetried = openapi.statePendingSaveRetried;
|
|
219
|
+
export type PendingSaveRetried = z.infer<typeof pendingSaveRetried>;
|
|
220
|
+
|
|
221
|
+
/** `DELETE /api/state-pending-saves/{id}` — the discarded save's id. */
|
|
222
|
+
export const pendingSaveDiscarded = openapi.statePendingSaveDiscarded;
|
package/src/schemas/storage.ts
CHANGED
|
@@ -1,31 +1,25 @@
|
|
|
1
1
|
/** Storage-provider info and resource CRUD response schemas. */
|
|
2
|
-
import { z } from 'zod';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
import * as openapi from '../generated/openapi-schemas';
|
|
3
5
|
|
|
4
6
|
/** `GET /api/storage` — the storage-provider identity, or the absent sentinel
|
|
5
7
|
* (`present: false`, a 200) when no storage-provider plugin is installed. */
|
|
6
|
-
export const storageInfo =
|
|
7
|
-
present: z.boolean(),
|
|
8
|
-
provider: z.string().nullable(),
|
|
9
|
-
module: z.string().nullable(),
|
|
10
|
-
});
|
|
8
|
+
export const storageInfo = openapi.storageInfo;
|
|
11
9
|
export type StorageInfo = z.infer<typeof storageInfo>;
|
|
12
10
|
|
|
13
11
|
/** `GET /api/storage/resources` — the full sorted resource-id list. */
|
|
14
|
-
export const storageResourceList =
|
|
12
|
+
export const storageResourceList = openapi.resourceList;
|
|
15
13
|
|
|
16
|
-
/** `GET /api/storage/resources/{id}/stat` — an object's inferred content type
|
|
17
|
-
|
|
18
|
-
export const storageResourceStat = z.object({
|
|
19
|
-
id: z.string(),
|
|
20
|
-
content_type: z.string().nullable(),
|
|
21
|
-
});
|
|
14
|
+
/** `GET /api/storage/resources/{id}/stat` — an object's inferred content type. */
|
|
15
|
+
export const storageResourceStat = openapi.resourceStat;
|
|
22
16
|
export type StorageResourceStat = z.infer<typeof storageResourceStat>;
|
|
23
17
|
|
|
24
18
|
/** `POST /api/storage/resources` — the stored object's id. */
|
|
25
|
-
export const storageResourceStored =
|
|
19
|
+
export const storageResourceStored = openapi.resourceStored;
|
|
26
20
|
|
|
27
21
|
/** `DELETE /api/storage/resources/{id}` — the removed object's id. */
|
|
28
|
-
export const storageResourceDeleted =
|
|
22
|
+
export const storageResourceDeleted = openapi.resourceDeleted;
|
|
29
23
|
|
|
30
24
|
/** `DELETE /api/storage/dirs/{path}` — the removed directory subtree. */
|
|
31
|
-
export const storageDirDeleted =
|
|
25
|
+
export const storageDirDeleted = openapi.dirDeleted;
|
|
@@ -1,21 +1,10 @@
|
|
|
1
1
|
/** Studio front-end plugin registry response schemas. */
|
|
2
|
-
import { z } from 'zod';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
tool_panels: z.record(z.string(), z.string()).default({}),
|
|
12
|
-
pages: z.array(z.string()).default([]),
|
|
13
|
-
settings_tabs: z.array(z.string()).default([]),
|
|
14
|
-
// Optional with a default so a manifest without the field still parses; the
|
|
15
|
-
// non-strict object would otherwise SILENTLY STRIP an undeclared field, so a
|
|
16
|
-
// server that serves `nav_entries` would never reach the UI.
|
|
17
|
-
nav_entries: z.array(z.string()).default([]),
|
|
18
|
-
}),
|
|
19
|
-
});
|
|
20
|
-
export const studioPluginRegistry = z.array(studioPluginManifest);
|
|
21
|
-
export type StudioPluginManifest = z.infer<typeof studioPluginManifest>;
|
|
4
|
+
import * as openapi from '../generated/openapi-schemas';
|
|
5
|
+
|
|
6
|
+
/** One installed plugin's manifest plus `mounts`: its own route items and the absolute
|
|
7
|
+
* base each is served under on this deployment (`{item: "/api/<base>"}`). */
|
|
8
|
+
export const studioPluginListingEntry = openapi.studioPluginListingEntry;
|
|
9
|
+
export const studioPluginRegistry = openapi.studioPluginListing;
|
|
10
|
+
export type StudioPluginListingEntry = z.infer<typeof studioPluginListingEntry>;
|
package/src/schemas/sub-mcp.ts
CHANGED
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
/** Sub-MCP mount registry response schemas. */
|
|
2
|
-
import { z } from 'zod';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
import * as openapi from '../generated/openapi-schemas';
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
|
-
* One registered sub-MCP mount as it rides the registry list
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* `http`), so it is required — its absence is a drift, not a legal shape.
|
|
7
|
+
* One registered sub-MCP mount as it rides the registry list: the tools it exposes, the
|
|
8
|
+
* transport it serves on, the served `mount_url` (the URL the mount is served at and its
|
|
9
|
+
* route-table key) and the served `access_pattern` (the dynamic route pattern mapping every
|
|
10
|
+
* sub-path of the mount to that key). In `GET /api/sub-mcp` the slug is the map key, so the
|
|
11
|
+
* mount value carries no slug.
|
|
11
12
|
*/
|
|
12
|
-
export const subMcpMount =
|
|
13
|
-
tools: z.array(z.string()),
|
|
14
|
-
transport: z.string(),
|
|
15
|
-
});
|
|
13
|
+
export const subMcpMount = openapi.subMcpListingEntry;
|
|
16
14
|
export type SubMcpMount = z.infer<typeof subMcpMount>;
|
|
17
15
|
|
|
18
|
-
export const subMcpList =
|
|
19
|
-
export const subMcpCreated =
|
|
20
|
-
|
|
21
|
-
tools: z.array(z.string()),
|
|
22
|
-
transport: z.string(),
|
|
23
|
-
});
|
|
24
|
-
export const subMcpRemoved = z.object({ slug: z.string(), removed: z.literal(true) });
|
|
16
|
+
export const subMcpList = openapi.subMcpMapListing;
|
|
17
|
+
export const subMcpCreated = openapi.subMcpRegistrationResult;
|
|
18
|
+
export const subMcpRemoved = openapi.subMcpRemovalResult;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** Pluggable-kind status and MCP status/reload response schemas. */
|
|
2
|
-
import { z } from 'zod';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
3
|
|
|
4
|
+
import * as openapi from '../generated/openapi-schemas';
|
|
4
5
|
import { fleetResult } from './fleet';
|
|
5
6
|
import { reloadConfigResult } from './manifest-mcp';
|
|
6
7
|
|
|
@@ -9,16 +10,10 @@ import { reloadConfigResult } from './manifest-mcp';
|
|
|
9
10
|
// studio_plugins). `state` is the kind's active/default/off status: `active` = a
|
|
10
11
|
// real plugin serves it, `default` = a built-in fallback serves it, `off` =
|
|
11
12
|
// nothing is registered (a legal state, reported not "fixed"). `plugin` is the
|
|
12
|
-
// provider/module name when known, else null.
|
|
13
|
-
// server that adds a field to the row still parses.
|
|
13
|
+
// provider/module name when known, else null.
|
|
14
14
|
|
|
15
|
-
export const kindStatus =
|
|
16
|
-
|
|
17
|
-
state: z.enum(['active', 'default', 'off']),
|
|
18
|
-
plugin: z.string().nullable(),
|
|
19
|
-
detail: z.string(),
|
|
20
|
-
});
|
|
21
|
-
export const kindStatusList = z.array(kindStatus);
|
|
15
|
+
export const kindStatus = openapi.kindStatus;
|
|
16
|
+
export const kindStatusList = openapi.systemKindsListing;
|
|
22
17
|
export type KindStatus = z.infer<typeof kindStatus>;
|
|
23
18
|
|
|
24
19
|
/**
|
|
@@ -32,25 +27,13 @@ export type KindStatus = z.infer<typeof kindStatus>;
|
|
|
32
27
|
*/
|
|
33
28
|
export const toolExtensionsApplyResult = reloadConfigResult;
|
|
34
29
|
export type ToolExtensionsApplyResult = z.infer<typeof toolExtensionsApplyResult>;
|
|
35
|
-
// `GET /api/mcp-status` — the bound-server map
|
|
36
|
-
// skipped. Each failed entry
|
|
37
|
-
// platform records: `category` (`auth` for a 401/403,
|
|
38
|
-
// error or timeout, `error` otherwise), the redacted
|
|
39
|
-
// the failure carried (`null` for a pure transport
|
|
40
|
-
//
|
|
41
|
-
|
|
42
|
-
export const mcpStatus = z.object({
|
|
43
|
-
bound: z.record(z.string(), z.array(z.string())),
|
|
44
|
-
failed: z.array(
|
|
45
|
-
z.object({
|
|
46
|
-
title: z.string(),
|
|
47
|
-
status: z.string(),
|
|
48
|
-
category: z.string().optional(),
|
|
49
|
-
message: z.string().optional(),
|
|
50
|
-
http_status: z.number().nullable().optional(),
|
|
51
|
-
}),
|
|
52
|
-
),
|
|
53
|
-
});
|
|
30
|
+
// `GET /api/mcp-status` — the bound-server map, the servers the viability check
|
|
31
|
+
// skipped, and each server's health record. Each failed entry carries the coarse,
|
|
32
|
+
// credential-free failure detail the platform records: `category` (`auth` for a 401/403,
|
|
33
|
+
// `unreachable` for a transport error or timeout, `error` otherwise), the redacted
|
|
34
|
+
// `message`, and the `http_status` the failure carried (`null` for a pure transport
|
|
35
|
+
// failure).
|
|
36
|
+
export const mcpStatus = openapi.mcpStatusSnapshot;
|
|
54
37
|
|
|
55
38
|
/**
|
|
56
39
|
* `POST /api/mcp-status/{title}/reload` — re-probe a single MCP server and broadcast
|
package/src/schemas/templates.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
/** Prompt-template listing, render and mutation ack schemas. */
|
|
2
|
-
import
|
|
2
|
+
import * as openapi from '../generated/openapi-schemas';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export const
|
|
7
|
-
export const
|
|
8
|
-
export const
|
|
9
|
-
export const
|
|
10
|
-
export const
|
|
11
|
-
export const templateRendered = z.object({ rendered: z.string() });
|
|
12
|
-
export const templateCacheCleared = z.object({ cleared: z.literal(true) });
|
|
4
|
+
export const templateNames = openapi.stringListResponse;
|
|
5
|
+
export const templateDetail = openapi.templateFetchView;
|
|
6
|
+
export const templateUploaded = openapi.templateUploadResult;
|
|
7
|
+
export const templateDeleted = openapi.templateDeleteResult;
|
|
8
|
+
export const templateDirDeleted = openapi.templateDeleteResult;
|
|
9
|
+
export const templateRendered = openapi.renderedTemplate;
|
|
10
|
+
export const templateCacheCleared = openapi.cacheClearResult;
|
package/src/schemas/tool-meta.ts
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
/** Tool-organization overlay (folders and per-tool meta) schemas. */
|
|
2
|
-
import { z } from 'zod';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
import * as openapi from '../generated/openapi-schemas';
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* One folder in the tool-organization tree (`tool_folders`). `parent_id` is `null`
|
|
6
8
|
* for a root folder and otherwise the containing folder's `id`; nesting is endless
|
|
7
9
|
* via the parent chain. Ids are UUID strings. A drift throws `ApiSchemaError`.
|
|
8
10
|
*/
|
|
9
|
-
export const folderRecord =
|
|
10
|
-
id: z.string(),
|
|
11
|
-
name: z.string(),
|
|
12
|
-
parent_id: z.string().nullable(),
|
|
13
|
-
});
|
|
11
|
+
export const folderRecord = openapi.folderRecord;
|
|
14
12
|
export type FolderRecord = z.infer<typeof folderRecord>;
|
|
15
13
|
|
|
16
14
|
/**
|
|
@@ -23,14 +21,7 @@ export type FolderRecord = z.infer<typeof folderRecord>;
|
|
|
23
21
|
* `null` = defer to the plugin declaration, `true` = force hidden, `false` = force
|
|
24
22
|
* visible. A drift throws `ApiSchemaError`.
|
|
25
23
|
*/
|
|
26
|
-
export const toolMetaRecord =
|
|
27
|
-
tool_name: z.string(),
|
|
28
|
-
display_name: z.string().nullable(),
|
|
29
|
-
folder_id: z.string().nullable(),
|
|
30
|
-
tags: z.array(z.string()),
|
|
31
|
-
badges: z.array(z.string()),
|
|
32
|
-
hidden: z.boolean().nullable(),
|
|
33
|
-
});
|
|
24
|
+
export const toolMetaRecord = openapi.toolMetaRecord;
|
|
34
25
|
export type ToolMetaRecord = z.infer<typeof toolMetaRecord>;
|
|
35
26
|
|
|
36
27
|
/**
|
|
@@ -38,14 +29,11 @@ export type ToolMetaRecord = z.infer<typeof toolMetaRecord>;
|
|
|
38
29
|
* every per-tool row. The UI builds the tree and merges the rows against the live
|
|
39
30
|
* tool list client-side. A drift throws `ApiSchemaError`.
|
|
40
31
|
*/
|
|
41
|
-
export const toolMetaOverlay =
|
|
42
|
-
folders: z.array(folderRecord),
|
|
43
|
-
meta: z.array(toolMetaRecord),
|
|
44
|
-
});
|
|
32
|
+
export const toolMetaOverlay = openapi.toolMetaListView;
|
|
45
33
|
export type ToolMetaOverlay = z.infer<typeof toolMetaOverlay>;
|
|
46
34
|
|
|
47
35
|
/** `DELETE /api/tool-meta/tools/{tool_name}` — the dropped overlay row (idempotent). */
|
|
48
|
-
export const toolMetaDeleted =
|
|
36
|
+
export const toolMetaDeleted = openapi.toolMetaDeleted;
|
|
49
37
|
|
|
50
38
|
/** `DELETE /api/tool-meta/folders/{folder_id}` — the removed empty folder. */
|
|
51
|
-
export const folderDeleted =
|
|
39
|
+
export const folderDeleted = openapi.folderDeleted;
|