@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
|
@@ -1,58 +1,30 @@
|
|
|
1
1
|
/** Interaction question, answer and media response schemas. */
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import
|
|
3
|
+
import * as openapi from '../generated/openapi-schemas';
|
|
4
|
+
import * as served from '../generated/served-schemas';
|
|
4
5
|
// Shapes match the skeleton's interactions SSE contract: the SSE
|
|
5
6
|
// `interaction.add` frame carries the question and its answer format; the answer
|
|
6
7
|
// door returns { interaction_id, status }. `answered` is not a wire field — it
|
|
7
8
|
// is a client-side flag the stream hook flips on an `interaction.answered` event.
|
|
8
|
-
export const answerFormat =
|
|
9
|
-
/** The kind of a
|
|
10
|
-
export const mediaKind =
|
|
9
|
+
export const answerFormat = openapi.answerFormat;
|
|
10
|
+
/** The kind of a display-only media item: an image, a link, or a document, video or audio file. */
|
|
11
|
+
export const mediaKind = openapi.mediaKind;
|
|
11
12
|
/**
|
|
12
|
-
* One item of a question's display-only media.
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* so one malformed/hostile item is a loud per-item notice, not a whole-frame parse
|
|
16
|
-
* failure that would silently vanish an answerable question.
|
|
17
|
-
*
|
|
18
|
-
* `caption` is `.nullish()` (absent OR `null` both parse to a caption-less item):
|
|
19
|
-
* a caption-less item may arrive with the key omitted OR with an explicit `null`, so
|
|
20
|
-
* `.optional()` here would false-fail the explicit `null` and render a good image as
|
|
21
|
-
* malformed. `url` and `kind` are the only load-bearing fields; the image
|
|
22
|
-
* src scheme gate and the link neutralization are enforced by the renderer.
|
|
23
|
-
*/
|
|
24
|
-
export const interactionMediaItem = z.object({
|
|
25
|
-
kind: mediaKind,
|
|
26
|
-
url: z.string(),
|
|
27
|
-
caption: z.string().nullish(),
|
|
28
|
-
});
|
|
29
|
-
/**
|
|
30
|
-
* The kind of a byte-backed inbound attachment carried on a transcript record. A
|
|
31
|
-
* fetchable file — `image`/`document`/`audio`/`video` — never a `link`: a labelled
|
|
32
|
-
* anchor is question CONTEXT (see {@link mediaKind}), not a participant's sent file.
|
|
13
|
+
* One item of a question's display-only media. The renderer resolves `url` (the image src
|
|
14
|
+
* scheme gate and the link neutralization are enforced there); `caption` and `filename`
|
|
15
|
+
* are `null` when absent.
|
|
33
16
|
*/
|
|
34
|
-
export const
|
|
17
|
+
export const interactionMediaItem = openapi.mediaItem;
|
|
18
|
+
/** The kind of an inbound attachment carried on a transcript record. */
|
|
19
|
+
export const attachmentMediaKind = openapi.mediaKind;
|
|
35
20
|
/**
|
|
36
21
|
* One inbound attachment a participant sent, projected onto a transcript record's
|
|
37
|
-
* `inbound_attachments`.
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* `url` is the served-media reference the renderer resolves to the API origin (the
|
|
43
|
-
* same served-url discipline the ask-media renderer uses); the image src scheme gate
|
|
44
|
-
* and the per-item load-failure notice are enforced there. `caption` and `filename`
|
|
45
|
-
* are `.nullish()` (absent OR explicit `null` both parse to absent): the projection
|
|
46
|
-
* may omit the key OR emit `null`, so `.optional()` alone would false-fail an explicit
|
|
47
|
-
* `null`. `filename` is meaningful only for a `document`; the renderer shows it as the
|
|
48
|
-
* download label.
|
|
22
|
+
* `inbound_attachments`. `url` is the served-media reference the renderer resolves to the
|
|
23
|
+
* API origin (the same served-url discipline the ask-media renderer uses); the image src
|
|
24
|
+
* scheme gate and the per-item load-failure notice are enforced there. `filename` is
|
|
25
|
+
* meaningful only for a `document`; the renderer shows it as the download label.
|
|
49
26
|
*/
|
|
50
|
-
export const attachmentMediaItem =
|
|
51
|
-
kind: attachmentMediaKind,
|
|
52
|
-
url: z.string(),
|
|
53
|
-
caption: z.string().nullish(),
|
|
54
|
-
filename: z.string().nullish(),
|
|
55
|
-
});
|
|
27
|
+
export const attachmentMediaItem = openapi.mediaItem;
|
|
56
28
|
/**
|
|
57
29
|
* One per-send choice for a `form` property whose schema is a string (or array of
|
|
58
30
|
* strings). `value` is what the answer carries; `label` (absent OR null both parse
|
|
@@ -60,22 +32,16 @@ export const attachmentMediaItem = z.object({
|
|
|
60
32
|
* `enum` this way for one ask without republishing the form. Applied per property by
|
|
61
33
|
* the form preview (safeParsed), so a malformed entry is a loud notice, never silent.
|
|
62
34
|
*/
|
|
63
|
-
export const formOption =
|
|
64
|
-
value: z.string(),
|
|
65
|
-
label: z.string().nullish(),
|
|
66
|
-
});
|
|
35
|
+
export const formOption = openapi.formOption;
|
|
67
36
|
/**
|
|
68
37
|
* Per-send `form` data: `values` prefills top-level properties (keyed by property
|
|
69
38
|
* name), `options` supplies per-send choice lists (keyed by property name). Both
|
|
70
39
|
* default to empty. The form preview safeParses this off `format_payload.data`, so a
|
|
71
40
|
* malformed block is a loud notice rather than a whole-frame parse failure.
|
|
72
41
|
*/
|
|
73
|
-
export const formData =
|
|
74
|
-
values: z.record(z.string(), z.unknown()).default({}),
|
|
75
|
-
options: z.record(z.string(), z.array(formOption)).default({}),
|
|
76
|
-
});
|
|
42
|
+
export const formData = openapi.formData;
|
|
77
43
|
/** The kind of an ordered display block a page may carry alongside its input fields. */
|
|
78
|
-
export const displayBlockKind =
|
|
44
|
+
export const displayBlockKind = openapi.displayBlock.shape.kind;
|
|
79
45
|
/**
|
|
80
46
|
* One ordered, display-only block on a form page (never an input): a `heading` or
|
|
81
47
|
* `body` text block, or an `image`. `text` carries a heading/body's words; `src`/`alt`
|
|
@@ -87,15 +53,9 @@ export const displayBlockKind = z.enum(['heading', 'body', 'image']);
|
|
|
87
53
|
* whole-page parse failure. Applied per block by the preview (safeParsed via its page),
|
|
88
54
|
* so a malformed block is a loud notice, never silent.
|
|
89
55
|
*/
|
|
90
|
-
export const displayBlock =
|
|
91
|
-
kind: displayBlockKind,
|
|
92
|
-
text: z.string().nullish(),
|
|
93
|
-
src: z.string().nullish(),
|
|
94
|
-
alt: z.string().nullish(),
|
|
95
|
-
slot: z.string().nullish(),
|
|
96
|
-
});
|
|
56
|
+
export const displayBlock = openapi.displayBlock;
|
|
97
57
|
/** A page's role: an ordinary `input` page (default) or a terminal `review` summary. */
|
|
98
|
-
export const formPageKind =
|
|
58
|
+
export const formPageKind = openapi.formPage.shape.kind.unwrap();
|
|
99
59
|
/**
|
|
100
60
|
* One page of a stepped `form`: a `title` and the ordered top-level property names it
|
|
101
61
|
* groups. `format_payload.pages` is the ordered list of these; absent = one page. The
|
|
@@ -108,14 +68,11 @@ export const formPageKind = z.enum(['input', 'review']);
|
|
|
108
68
|
* and carries no new input fields; it defaults to `input`. Both are additive: an older
|
|
109
69
|
* payload ({title, fields}) parses unchanged.
|
|
110
70
|
*/
|
|
111
|
-
export const formPage =
|
|
112
|
-
title: z.string(),
|
|
113
|
-
fields: z.array(z.string()),
|
|
114
|
-
display: z.array(displayBlock).default([]),
|
|
115
|
-
kind: formPageKind.default('input'),
|
|
116
|
-
});
|
|
71
|
+
export const formPage = openapi.formPage;
|
|
117
72
|
/** The `form` pages list (`format_payload.pages`), safeParsed as a whole by the preview. */
|
|
118
73
|
export const formPages = z.array(formPage);
|
|
74
|
+
// The form reactions and the form update are hand-written: the spec carries them inside an
|
|
75
|
+
// open `format_payload` and an open reaction `update`.
|
|
119
76
|
/**
|
|
120
77
|
* When a `form` reacts while it is open (`format_payload.reactions`): the plain,
|
|
121
78
|
* renderer-readable description of WHEN the form calls its reaction handler. Absent ⇒ a
|
|
@@ -134,12 +91,12 @@ export const formReactions = z.object({
|
|
|
134
91
|
choices: z.array(z.string()).default([]),
|
|
135
92
|
});
|
|
136
93
|
/**
|
|
137
|
-
* The form update a reaction door returns (`POST /api/interactions/{id}/react
|
|
138
|
-
* same kind of data a form is sent with, applied to the open form. `values`
|
|
139
|
-
* values; `options` replaces the per-send choice list of option-bearing fields;
|
|
140
|
-
* shows per-field messages (keyed by field name); `display` fills display slots
|
|
141
|
-
* slot name) — a computed total among them. Every member defaults to empty, so a
|
|
142
|
-
* that touches only one of them returns only that one. The door response is safeParsed, so
|
|
94
|
+
* The form update a reaction door returns (`POST /api/interactions/{id}/react`, its
|
|
95
|
+
* `update`): the same kind of data a form is sent with, applied to the open form. `values`
|
|
96
|
+
* sets field values; `options` replaces the per-send choice list of option-bearing fields;
|
|
97
|
+
* `errors` shows per-field messages (keyed by field name); `display` fills display slots
|
|
98
|
+
* (keyed by slot name) — a computed total among them. Every member defaults to empty, so a
|
|
99
|
+
* reaction that touches only one of them returns only that one. The door response is safeParsed, so
|
|
143
100
|
* a malformed update surfaces loudly rather than applying a half-understood change.
|
|
144
101
|
*/
|
|
145
102
|
export const formUpdate = z.object({
|
|
@@ -149,79 +106,37 @@ export const formUpdate = z.object({
|
|
|
149
106
|
display: z.record(z.string(), z.unknown()).default({}),
|
|
150
107
|
});
|
|
151
108
|
/**
|
|
152
|
-
* The event a reaction round-trip reports to the door
|
|
153
|
-
* declared events fired, `field` names the changed
|
|
154
|
-
* `page` names the advanced-from page (by title) for a
|
|
155
|
-
* `submitted` event carries neither. The body also carries the
|
|
156
|
-
* far (see {@link interactionsClient}'s `reactInteraction`).
|
|
109
|
+
* The event a reaction round-trip reports to the door (the contract's `FormReactionEvent`
|
|
110
|
+
* document): `kind` is which of the three declared events fired, `field` names the changed
|
|
111
|
+
* field for a `field_changed` event, and `page` names the advanced-from page (by title) for a
|
|
112
|
+
* `page_advanced` event. A `submitted` event carries neither. The body also carries the
|
|
113
|
+
* partial `values` filled so far (see {@link interactionsClient}'s `reactInteraction`).
|
|
157
114
|
*/
|
|
158
|
-
export const
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
export const interaction = z.object({
|
|
165
|
-
interaction_id: z.string(),
|
|
166
|
-
group_id: z.string(),
|
|
167
|
-
question: z.string().default(''),
|
|
168
|
-
answer_format: answerFormat,
|
|
169
|
-
// Format-specific payload: select options, form JSON schema (with optional per-send
|
|
170
|
-
// `data` and `pages`), external url. The wire sends `null` for formats that carry
|
|
115
|
+
export const reactionEvent = served.formReactionEvent;
|
|
116
|
+
/** The reaction door's reply: the interaction id and the form `update` to apply. */
|
|
117
|
+
export const interactionReaction = openapi.interactionReactionResult.extend({ update: formUpdate });
|
|
118
|
+
export const interaction = openapi.interactionFrame.extend({
|
|
119
|
+
// Hand-written: the format-specific payload (select options, form JSON schema with
|
|
120
|
+
// optional per-send `data` and `pages`, external url) is `null` for formats that carry
|
|
171
121
|
// none (text/confirm); it is normalized to `{}` so consumers always see an object.
|
|
172
122
|
format_payload: z
|
|
173
123
|
.record(z.string(), z.unknown())
|
|
174
124
|
.nullish()
|
|
175
125
|
.transform((value) => value ?? {}),
|
|
176
|
-
created_at: z.string(),
|
|
177
|
-
timeout_at: z.string(),
|
|
178
|
-
// Whether the answer body is sensitive and never persisted server-side. Rides
|
|
179
|
-
// every add frame; an absent value (older frame) normalizes to false.
|
|
180
|
-
sensitive: z.boolean().default(false),
|
|
181
|
-
// True only for an external question answered by a signed server-to-server
|
|
182
|
-
// callback (never by a human); the frame never carries the verifier object.
|
|
183
|
-
// Absent/undefined for every other question.
|
|
184
|
-
server_verified: z.boolean().optional(),
|
|
185
|
-
// Name of the channel plugin the question was also delivered through (e.g.
|
|
186
|
-
// "telegram"); absent when the question lives only in this inbox.
|
|
187
|
-
channel: z.string().optional(),
|
|
188
|
-
// Interaction attribution, each additive and absent when unset. `recipient` is
|
|
189
|
-
// the channel delivery address the question went to; `origin` is the run id of
|
|
190
|
-
// the background tool run that asked; `audience` is the user_id the question is
|
|
191
|
-
// addressed to. Display/binding data only, never an authorization axis; a
|
|
192
|
-
// present non-string is malformed.
|
|
193
|
-
recipient: z.string().optional(),
|
|
194
|
-
origin: z.string().optional(),
|
|
195
|
-
audience: z.string().optional(),
|
|
196
|
-
// Display-only media shown WITH the question (images and/or links). Absent when
|
|
197
|
-
// the question carries none. Deliberately LOOSE (`z.array(z.unknown())`): each
|
|
198
|
-
// item is `safeParse`d per item by the renderer against `interactionMediaItem`,
|
|
199
|
-
// so one malformed/hostile item can never fail the whole frame parse and hide an
|
|
200
|
-
// answerable question. A present non-array value is still malformed.
|
|
201
|
-
media: z.array(z.unknown()).optional(),
|
|
202
126
|
});
|
|
203
127
|
/** The answer door's response — the blocked caller was woken. */
|
|
204
|
-
export const interactionAnswered =
|
|
205
|
-
interaction_id: z.string(),
|
|
206
|
-
status: z.string(),
|
|
207
|
-
});
|
|
128
|
+
export const interactionAnswered = openapi.interactionActionResult;
|
|
208
129
|
/**
|
|
209
130
|
* The cancel door's response — a pending ask was WITHDRAWN without an answer (the
|
|
210
131
|
* asking flow does not resume). `status` is `"cancelled"`; the shape mirrors the
|
|
211
132
|
* answer door's terminal reply, but the door is distinct so it carries its own
|
|
212
133
|
* schema.
|
|
213
134
|
*/
|
|
214
|
-
export const interactionCancelled =
|
|
215
|
-
interaction_id: z.string(),
|
|
216
|
-
status: z.string(),
|
|
217
|
-
});
|
|
135
|
+
export const interactionCancelled = openapi.interactionActionResult;
|
|
218
136
|
/**
|
|
219
137
|
* A page of pending interactions from `GET /api/interactions?page=&pageSize=`. Each
|
|
220
138
|
* item is the same record the stream's `interaction.add` frame carries. The pending
|
|
221
139
|
* set is the paged base the tail-only stream applies live deltas over.
|
|
222
140
|
*/
|
|
223
|
-
export const interactionsPage = z.
|
|
224
|
-
items: z.array(interaction),
|
|
225
|
-
...pageWindow,
|
|
226
|
-
});
|
|
141
|
+
export const interactionsPage = openapi.interactionWindow.extend({ items: z.array(interaction) });
|
|
227
142
|
//# sourceMappingURL=interactions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactions.js","sourceRoot":"","sources":["../../src/schemas/interactions.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,
|
|
1
|
+
{"version":3,"file":"interactions.js","sourceRoot":"","sources":["../../src/schemas/interactions.ts"],"names":[],"mappings":"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"}
|
package/dist/schemas/login.d.ts
CHANGED
|
@@ -1,77 +1,76 @@
|
|
|
1
1
|
/** Public login-method aggregator and login-result schemas. */
|
|
2
|
-
import { z } from 'zod';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
3
|
/**
|
|
4
4
|
* One field of a `form` login method. `secret` fields render as password
|
|
5
5
|
* inputs; `autocomplete` passes through to the input (e.g. "email",
|
|
6
6
|
* "current-password", "new-password").
|
|
7
7
|
*/
|
|
8
8
|
export declare const loginFormField: z.ZodObject<{
|
|
9
|
-
|
|
9
|
+
autocomplete: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
10
10
|
label: z.ZodString;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}, z.core.$
|
|
11
|
+
name: z.ZodString;
|
|
12
|
+
secret: z.ZodDefault<z.ZodBoolean>;
|
|
13
|
+
}, z.core.$strict>;
|
|
14
14
|
/**
|
|
15
15
|
* The two — and only two — login-method shapes. Discriminated on `shape`; an
|
|
16
16
|
* unknown shape fails validation loudly (contract drift, not a soft skip).
|
|
17
|
-
* Optional fields are `.optional()` (absent), never `.nullable()`: the server
|
|
18
|
-
* serializes with `exclude_none`, so an absent field is OMITTED, never `null`.
|
|
19
17
|
*/
|
|
20
18
|
export declare const loginMethod: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
21
|
-
|
|
19
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
20
|
+
autocomplete: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
21
|
+
label: z.ZodString;
|
|
22
|
+
name: z.ZodString;
|
|
23
|
+
secret: z.ZodDefault<z.ZodBoolean>;
|
|
24
|
+
}, z.core.$strict>>;
|
|
22
25
|
id: z.ZodString;
|
|
23
|
-
title: z.ZodString;
|
|
24
26
|
purpose: z.ZodDefault<z.ZodEnum<{
|
|
25
27
|
login: "login";
|
|
26
28
|
invite: "invite";
|
|
27
29
|
}>>;
|
|
28
|
-
|
|
29
|
-
name: z.ZodString;
|
|
30
|
-
label: z.ZodString;
|
|
31
|
-
secret: z.ZodBoolean;
|
|
32
|
-
autocomplete: z.ZodOptional<z.ZodString>;
|
|
33
|
-
}, z.core.$strip>>;
|
|
30
|
+
shape: z.ZodDefault<z.ZodLiteral<"form">>;
|
|
34
31
|
submit_path: z.ZodString;
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
title: z.ZodString;
|
|
33
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
34
|
+
href: z.ZodString;
|
|
35
|
+
icon: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
37
36
|
id: z.ZodString;
|
|
38
37
|
label: z.ZodString;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}, z.core.$strip>], "shape">;
|
|
38
|
+
shape: z.ZodDefault<z.ZodLiteral<"button">>;
|
|
39
|
+
}, z.core.$strict>], "shape">;
|
|
42
40
|
/**
|
|
43
41
|
* `GET /api/login/methods` (PUBLIC). `needs_setup: true` ⇒ no principal exists
|
|
44
42
|
* yet, so the deployment must be initialized through the setup door before anyone
|
|
45
43
|
* can sign in. `setup_login` names the login-credential kinds the setup door can
|
|
46
|
-
* attach the owner's login with; it is `null
|
|
47
|
-
*
|
|
48
|
-
*
|
|
44
|
+
* attach the owner's login with; it is `null` when no login-attaching accounts
|
|
45
|
+
* provider is configured (a keys-only deployment). `claim_fragment_key` names the
|
|
46
|
+
* URL-fragment key a claim link carries its token under.
|
|
49
47
|
*/
|
|
50
48
|
export declare const loginMethods: z.ZodObject<{
|
|
49
|
+
claim_fragment_key: z.ZodString;
|
|
51
50
|
methods: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
52
|
-
|
|
51
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
52
|
+
autocomplete: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
53
|
+
label: z.ZodString;
|
|
54
|
+
name: z.ZodString;
|
|
55
|
+
secret: z.ZodDefault<z.ZodBoolean>;
|
|
56
|
+
}, z.core.$strict>>;
|
|
53
57
|
id: z.ZodString;
|
|
54
|
-
title: z.ZodString;
|
|
55
58
|
purpose: z.ZodDefault<z.ZodEnum<{
|
|
56
59
|
login: "login";
|
|
57
60
|
invite: "invite";
|
|
58
61
|
}>>;
|
|
59
|
-
|
|
60
|
-
name: z.ZodString;
|
|
61
|
-
label: z.ZodString;
|
|
62
|
-
secret: z.ZodBoolean;
|
|
63
|
-
autocomplete: z.ZodOptional<z.ZodString>;
|
|
64
|
-
}, z.core.$strip>>;
|
|
62
|
+
shape: z.ZodDefault<z.ZodLiteral<"form">>;
|
|
65
63
|
submit_path: z.ZodString;
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
title: z.ZodString;
|
|
65
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
66
|
+
href: z.ZodString;
|
|
67
|
+
icon: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
68
68
|
id: z.ZodString;
|
|
69
69
|
label: z.ZodString;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}, z.core.$strip>], "shape">>;
|
|
70
|
+
shape: z.ZodDefault<z.ZodLiteral<"button">>;
|
|
71
|
+
}, z.core.$strict>], "shape">>;
|
|
73
72
|
needs_setup: z.ZodBoolean;
|
|
74
|
-
setup_login: z.
|
|
73
|
+
setup_login: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
75
74
|
kinds: z.ZodArray<z.ZodEnum<{
|
|
76
75
|
invite: "invite";
|
|
77
76
|
password: "password";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/schemas/login.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/schemas/login.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAI7B;;;;GAIG;AACH,eAAO,MAAM,cAAc;;;;;kBAAoB,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;6BAAoD,CAAC;AAE7E;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAA8B,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,WAAW;;;iBAA8B,CAAC;AAEvD,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC5D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AACtD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AACxD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
|
package/dist/schemas/login.js
CHANGED
|
@@ -1,61 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
import { z } from 'zod';
|
|
1
|
+
import * as openapi from '../generated/openapi-schemas';
|
|
3
2
|
/**
|
|
4
3
|
* One field of a `form` login method. `secret` fields render as password
|
|
5
4
|
* inputs; `autocomplete` passes through to the input (e.g. "email",
|
|
6
5
|
* "current-password", "new-password").
|
|
7
6
|
*/
|
|
8
|
-
export const loginFormField =
|
|
9
|
-
name: z.string().min(1),
|
|
10
|
-
label: z.string().min(1),
|
|
11
|
-
secret: z.boolean(),
|
|
12
|
-
autocomplete: z.string().optional(),
|
|
13
|
-
});
|
|
7
|
+
export const loginFormField = openapi.formField;
|
|
14
8
|
/**
|
|
15
9
|
* The two — and only two — login-method shapes. Discriminated on `shape`; an
|
|
16
10
|
* unknown shape fails validation loudly (contract drift, not a soft skip).
|
|
17
|
-
* Optional fields are `.optional()` (absent), never `.nullable()`: the server
|
|
18
|
-
* serializes with `exclude_none`, so an absent field is OMITTED, never `null`.
|
|
19
11
|
*/
|
|
20
|
-
export const loginMethod =
|
|
21
|
-
z.object({
|
|
22
|
-
shape: z.literal('form'),
|
|
23
|
-
id: z.string().min(1),
|
|
24
|
-
title: z.string().min(1),
|
|
25
|
-
purpose: z.enum(['login', 'invite']).default('login'),
|
|
26
|
-
fields: z.array(loginFormField).min(1),
|
|
27
|
-
submit_path: z.string().min(1),
|
|
28
|
-
}),
|
|
29
|
-
z.object({
|
|
30
|
-
shape: z.literal('button'),
|
|
31
|
-
id: z.string().min(1),
|
|
32
|
-
label: z.string().min(1),
|
|
33
|
-
icon: z.string().optional(),
|
|
34
|
-
href: z.string().min(1),
|
|
35
|
-
}),
|
|
36
|
-
]);
|
|
12
|
+
export const loginMethod = openapi.loginMethodsListing.shape.methods.element;
|
|
37
13
|
/**
|
|
38
14
|
* `GET /api/login/methods` (PUBLIC). `needs_setup: true` ⇒ no principal exists
|
|
39
15
|
* yet, so the deployment must be initialized through the setup door before anyone
|
|
40
16
|
* can sign in. `setup_login` names the login-credential kinds the setup door can
|
|
41
|
-
* attach the owner's login with; it is `null
|
|
42
|
-
*
|
|
43
|
-
*
|
|
17
|
+
* attach the owner's login with; it is `null` when no login-attaching accounts
|
|
18
|
+
* provider is configured (a keys-only deployment). `claim_fragment_key` names the
|
|
19
|
+
* URL-fragment key a claim link carries its token under.
|
|
44
20
|
*/
|
|
45
|
-
export const loginMethods =
|
|
46
|
-
methods: z.array(loginMethod),
|
|
47
|
-
needs_setup: z.boolean(),
|
|
48
|
-
setup_login: z
|
|
49
|
-
.object({ kinds: z.array(z.enum(['password', 'invite'])) })
|
|
50
|
-
.nullable()
|
|
51
|
-
.optional(),
|
|
52
|
-
});
|
|
21
|
+
export const loginMethods = openapi.loginMethodsListing;
|
|
53
22
|
/**
|
|
54
23
|
* A successful login/exchange: the minted session token (opaque, `tai-sess-`
|
|
55
24
|
* prefixed — the client treats it as an opaque string) + its user.
|
|
56
25
|
*/
|
|
57
|
-
export const loginResult =
|
|
58
|
-
token: z.string().min(1),
|
|
59
|
-
user_id: z.string().min(1),
|
|
60
|
-
});
|
|
26
|
+
export const loginResult = openapi.claimExchangeResult;
|
|
61
27
|
//# sourceMappingURL=login.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/schemas/login.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/schemas/login.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC;AAExD;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC,SAAS,CAAC;AAEhD;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC,mBAAmB,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;AAE7E;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC,mBAAmB,CAAC;AAExD;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC,mBAAmB,CAAC"}
|
|
@@ -12,7 +12,8 @@ export declare const connectorRef: z.ZodObject<{
|
|
|
12
12
|
}, z.core.$strip>;
|
|
13
13
|
export type ConnectorRef = z.infer<typeof connectorRef>;
|
|
14
14
|
/**
|
|
15
|
-
* One entry of the live manifest's MCP section
|
|
15
|
+
* One entry of the live manifest's MCP section, hand-typed: the spec publishes an entry as
|
|
16
|
+
* an open object. Only the `managed` provenance
|
|
16
17
|
* marker is typed — the connect/disconnect flows write it server-side to point a
|
|
17
18
|
* connector-owned entry back at its connection, and the editor renders such
|
|
18
19
|
* entries read-only. `.nullish()` because a hand-authored entry carries `null`
|
|
@@ -29,6 +30,7 @@ export declare const manifestMcpEntry: z.ZodObject<{
|
|
|
29
30
|
}, z.core.$loose>;
|
|
30
31
|
export type ManifestMcpEntry = z.infer<typeof manifestMcpEntry>;
|
|
31
32
|
export declare const manifestView: z.ZodObject<{
|
|
33
|
+
user_tools: z.ZodArray<z.ZodString>;
|
|
32
34
|
mcp: z.ZodArray<z.ZodObject<{
|
|
33
35
|
managed: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
34
36
|
connection_id: z.ZodString;
|
|
@@ -36,7 +38,6 @@ export declare const manifestView: z.ZodObject<{
|
|
|
36
38
|
sub_service: z.ZodString;
|
|
37
39
|
}, z.core.$strip>>>;
|
|
38
40
|
}, z.core.$loose>>;
|
|
39
|
-
user_tools: z.ZodArray<z.ZodString>;
|
|
40
41
|
}, z.core.$strip>;
|
|
41
42
|
/**
|
|
42
43
|
* One `!ENV ${VAR[:default]}` marker the manifest's MCP section carries
|
|
@@ -48,76 +49,101 @@ export declare const manifestView: z.ZodObject<{
|
|
|
48
49
|
* a false red. The checklist derives from THIS alone — no env value is ever fetched.
|
|
49
50
|
*/
|
|
50
51
|
export declare const mcpEnvRef: z.ZodObject<{
|
|
51
|
-
var: z.ZodString;
|
|
52
|
-
pointer: z.ZodString;
|
|
53
52
|
has_default: z.ZodBoolean;
|
|
53
|
+
pointer: z.ZodString;
|
|
54
54
|
set: z.ZodBoolean;
|
|
55
|
+
var: z.ZodString;
|
|
55
56
|
}, z.core.$strip>;
|
|
56
57
|
export type McpEnvRef = z.infer<typeof mcpEnvRef>;
|
|
57
58
|
export declare const mcpEnvRefs: z.ZodArray<z.ZodObject<{
|
|
58
|
-
var: z.ZodString;
|
|
59
|
-
pointer: z.ZodString;
|
|
60
59
|
has_default: z.ZodBoolean;
|
|
60
|
+
pointer: z.ZodString;
|
|
61
61
|
set: z.ZodBoolean;
|
|
62
|
+
var: z.ZodString;
|
|
62
63
|
}, z.core.$strip>>;
|
|
63
64
|
export type McpEnvRefs = z.infer<typeof mcpEnvRefs>;
|
|
64
65
|
/**
|
|
65
66
|
* The apply result every config-writer mutation returns (`POST /api/mcp-config`,
|
|
66
67
|
* `POST /api/config/env`): the serving worker's local reload result (`status` +
|
|
67
|
-
* `env_keys`)
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
68
|
+
* `env_keys`), the mode-wrapped fleet fan-out of the reload it broadcast, `recycle` — the
|
|
69
|
+
* fleet recycle roll an env change carrying a recycle-class key ran (`null` when it carried
|
|
70
|
+
* none) — and `awaiting_respawn`, the workers (name + keys) still awaiting a respawn after
|
|
71
|
+
* it, empty when its roll converged. The `fanout` is hand-typed (the spec publishes it as
|
|
72
|
+
* one object with optional fields) so the shared fleet-report handler can surface a failed
|
|
73
|
+
* propagation. A drift throws `ApiSchemaError`.
|
|
71
74
|
*/
|
|
72
75
|
export declare const reloadConfigResult: z.ZodObject<{
|
|
73
|
-
|
|
76
|
+
awaiting_respawn: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
77
|
+
keys: z.ZodArray<z.ZodString>;
|
|
78
|
+
name: z.ZodString;
|
|
79
|
+
}, z.core.$strip>>>;
|
|
74
80
|
env_keys: z.ZodNumber;
|
|
81
|
+
recycle: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
82
|
+
fresh: z.ZodArray<z.ZodObject<{
|
|
83
|
+
generation: z.ZodNumber;
|
|
84
|
+
kind: z.ZodString;
|
|
85
|
+
name: z.ZodString;
|
|
86
|
+
}, z.core.$strip>>;
|
|
87
|
+
recycle: z.ZodArray<z.ZodObject<{
|
|
88
|
+
detail: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
89
|
+
generation_before: z.ZodNumber;
|
|
90
|
+
kind: z.ZodString;
|
|
91
|
+
name: z.ZodString;
|
|
92
|
+
status: z.ZodString;
|
|
93
|
+
}, z.core.$strip>>;
|
|
94
|
+
recycle_stopped: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
95
|
+
detail: z.ZodString;
|
|
96
|
+
kind: z.ZodString;
|
|
97
|
+
name: z.ZodNullable<z.ZodString>;
|
|
98
|
+
}, z.core.$strip>>>;
|
|
99
|
+
}, z.core.$strip>>>;
|
|
100
|
+
status: z.ZodString;
|
|
75
101
|
fanout: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
76
102
|
mode: z.ZodLiteral<"local-only">;
|
|
77
103
|
note: z.ZodString;
|
|
78
104
|
}, z.core.$strip>, z.ZodObject<{
|
|
105
|
+
error: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
106
|
+
local_only: z.ZodDefault<z.ZodBoolean>;
|
|
79
107
|
op: z.ZodString;
|
|
80
|
-
reachable: z.ZodBoolean
|
|
81
|
-
|
|
82
|
-
|
|
108
|
+
reachable: z.ZodDefault<z.ZodBoolean>;
|
|
109
|
+
results: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
110
|
+
detail: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
111
|
+
error: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
83
112
|
name: z.ZodString;
|
|
84
113
|
outcome: z.ZodEnum<{
|
|
85
|
-
failed: "failed";
|
|
86
114
|
applied: "applied";
|
|
87
|
-
|
|
88
|
-
recycling: "recycling";
|
|
89
|
-
stale: "stale";
|
|
115
|
+
failed: "failed";
|
|
90
116
|
missing: "missing";
|
|
91
117
|
departed: "departed";
|
|
92
118
|
timed_out: "timed_out";
|
|
119
|
+
resyncing: "resyncing";
|
|
120
|
+
recycling: "recycling";
|
|
121
|
+
stale: "stale";
|
|
93
122
|
}>;
|
|
94
|
-
payload: z.
|
|
95
|
-
|
|
96
|
-
detail: z.ZodNullable<z.ZodString>;
|
|
97
|
-
}, z.core.$strip>>;
|
|
98
|
-
error: z.ZodNullable<z.ZodString>;
|
|
123
|
+
payload: z.ZodDefault<z.ZodNullable<z.ZodUnknown>>;
|
|
124
|
+
}, z.core.$strip>>>;
|
|
99
125
|
mode: z.ZodLiteral<"fleet">;
|
|
100
126
|
}, z.core.$strip>, z.ZodObject<{
|
|
127
|
+
error: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
128
|
+
local_only: z.ZodDefault<z.ZodBoolean>;
|
|
101
129
|
op: z.ZodString;
|
|
102
|
-
reachable: z.ZodBoolean
|
|
103
|
-
|
|
104
|
-
|
|
130
|
+
reachable: z.ZodDefault<z.ZodBoolean>;
|
|
131
|
+
results: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
132
|
+
detail: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
133
|
+
error: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
105
134
|
name: z.ZodString;
|
|
106
135
|
outcome: z.ZodEnum<{
|
|
107
|
-
failed: "failed";
|
|
108
136
|
applied: "applied";
|
|
109
|
-
|
|
110
|
-
recycling: "recycling";
|
|
111
|
-
stale: "stale";
|
|
137
|
+
failed: "failed";
|
|
112
138
|
missing: "missing";
|
|
113
139
|
departed: "departed";
|
|
114
140
|
timed_out: "timed_out";
|
|
141
|
+
resyncing: "resyncing";
|
|
142
|
+
recycling: "recycling";
|
|
143
|
+
stale: "stale";
|
|
115
144
|
}>;
|
|
116
|
-
payload: z.
|
|
117
|
-
|
|
118
|
-
detail: z.ZodNullable<z.ZodString>;
|
|
119
|
-
}, z.core.$strip>>;
|
|
120
|
-
error: z.ZodNullable<z.ZodString>;
|
|
145
|
+
payload: z.ZodDefault<z.ZodNullable<z.ZodUnknown>>;
|
|
146
|
+
}, z.core.$strip>>>;
|
|
121
147
|
mode: z.ZodLiteral<"unreachable">;
|
|
122
148
|
}, z.core.$strip>], "mode">;
|
|
123
149
|
}, z.core.$strip>;
|