@tai42/api-client 20.0.0 → 22.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 +400 -128
- package/dist/schemas/interactions.d.ts.map +1 -1
- package/dist/schemas/interactions.js +202 -131
- 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 +54 -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 +227 -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/fleet.ts
CHANGED
|
@@ -1,37 +1,29 @@
|
|
|
1
1
|
/** Backend identity and worker-bus fleet/fan-out response schemas. */
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import * as openapi from '../generated/openapi-schemas';
|
|
5
5
|
|
|
6
6
|
/** `GET /api/backend` — the execution-backend identity, or the absent sentinel
|
|
7
7
|
* (`present: false`, a 200) when no backend plugin is registered. Backend identity
|
|
8
8
|
* is kept distinct from the fleet: the fleet doors ride the app's worker bus and
|
|
9
9
|
* need no backend at all. */
|
|
10
|
-
export const backendInfo =
|
|
11
|
-
present: z.boolean(),
|
|
12
|
-
backend: z.string().nullable(),
|
|
13
|
-
module: z.string().nullable(),
|
|
14
|
-
});
|
|
10
|
+
export const backendInfo = openapi.backendInfo;
|
|
15
11
|
export type BackendInfo = z.infer<typeof backendInfo>;
|
|
16
12
|
|
|
17
13
|
/** The two worker kinds that join the bus: an ASGI `serve` worker or a
|
|
18
14
|
* `backend` runtime process. A drift throws `ApiSchemaError`. */
|
|
19
|
-
export const workerKind =
|
|
15
|
+
export const workerKind = openapi.workerKind;
|
|
20
16
|
export type WorkerKind = z.infer<typeof workerKind>;
|
|
21
17
|
|
|
22
18
|
/** The lifecycle state a worker advertises in its presence value: `ready` once its
|
|
23
19
|
* resync has converged, `resyncing` while a boot/reconnect resync runs, `recycling`
|
|
24
20
|
* once it has begun a graceful self-exit. A drift throws `ApiSchemaError`. */
|
|
25
|
-
export const workerState =
|
|
21
|
+
export const workerState = openapi.workerState;
|
|
26
22
|
export type WorkerState = z.infer<typeof workerState>;
|
|
27
23
|
|
|
28
24
|
/** The last op a worker applied, stamped onto its presence row after the terminal
|
|
29
25
|
* reply. `outcome` is the free op-outcome string; `at` is the ISO instant it landed. */
|
|
30
|
-
export const workerLastOp =
|
|
31
|
-
op: z.string(),
|
|
32
|
-
outcome: z.string(),
|
|
33
|
-
at: z.string(),
|
|
34
|
-
});
|
|
26
|
+
export const workerLastOp = openapi.lastOp;
|
|
35
27
|
export type WorkerLastOp = z.infer<typeof workerLastOp>;
|
|
36
28
|
|
|
37
29
|
/**
|
|
@@ -45,17 +37,7 @@ export type WorkerLastOp = z.infer<typeof workerLastOp>;
|
|
|
45
37
|
* only freshness signal a client reads, never a client-side threshold; `last_op` is the
|
|
46
38
|
* worker's last applied op, or `null` before it has applied one.
|
|
47
39
|
*/
|
|
48
|
-
export const fleetWorker =
|
|
49
|
-
name: z.string(),
|
|
50
|
-
kind: workerKind,
|
|
51
|
-
pid: z.number(),
|
|
52
|
-
generation: z.number(),
|
|
53
|
-
joined_at: z.string(),
|
|
54
|
-
beat_at: z.string(),
|
|
55
|
-
state: workerState,
|
|
56
|
-
stale: z.boolean(),
|
|
57
|
-
last_op: workerLastOp.nullable(),
|
|
58
|
-
});
|
|
40
|
+
export const fleetWorker = openapi.workerListingRow;
|
|
59
41
|
export type FleetWorker = z.infer<typeof fleetWorker>;
|
|
60
42
|
|
|
61
43
|
/**
|
|
@@ -64,7 +46,7 @@ export type FleetWorker = z.infer<typeof fleetWorker>;
|
|
|
64
46
|
* processes alike), not only backend workers. A census read that fails surfaces as a
|
|
65
47
|
* loud 500, never a fabricated empty fleet.
|
|
66
48
|
*/
|
|
67
|
-
export const fleetWorkers =
|
|
49
|
+
export const fleetWorkers = openapi.workerListing;
|
|
68
50
|
export type FleetWorkers = z.infer<typeof fleetWorkers>;
|
|
69
51
|
|
|
70
52
|
/**
|
|
@@ -76,16 +58,7 @@ export type FleetWorkers = z.infer<typeof fleetWorkers>;
|
|
|
76
58
|
* `recycling` is departing, `stale` is a quiet row past the freshness bound carrying no
|
|
77
59
|
* convergence promise).
|
|
78
60
|
*/
|
|
79
|
-
export const fleetOutcome =
|
|
80
|
-
'applied',
|
|
81
|
-
'failed',
|
|
82
|
-
'missing',
|
|
83
|
-
'departed',
|
|
84
|
-
'timed_out',
|
|
85
|
-
'resyncing',
|
|
86
|
-
'recycling',
|
|
87
|
-
'stale',
|
|
88
|
-
]);
|
|
61
|
+
export const fleetOutcome = openapi.opOutcome;
|
|
89
62
|
export type FleetOutcome = z.infer<typeof fleetOutcome>;
|
|
90
63
|
|
|
91
64
|
/**
|
|
@@ -94,13 +67,7 @@ export type FleetOutcome = z.infer<typeof fleetOutcome>;
|
|
|
94
67
|
* publisher's report text for a computed gap outcome (`missing`/`departed`/`timed_out`/
|
|
95
68
|
* `resyncing`/`recycling`/`stale`). A drift throws `ApiSchemaError`.
|
|
96
69
|
*/
|
|
97
|
-
export const fleetWorkerResult =
|
|
98
|
-
name: z.string(),
|
|
99
|
-
outcome: fleetOutcome,
|
|
100
|
-
payload: jsonValue,
|
|
101
|
-
error: z.string().nullable(),
|
|
102
|
-
detail: z.string().nullable(),
|
|
103
|
-
});
|
|
70
|
+
export const fleetWorkerResult = openapi.workerResult;
|
|
104
71
|
export type FleetWorkerResult = z.infer<typeof fleetWorkerResult>;
|
|
105
72
|
|
|
106
73
|
/**
|
|
@@ -114,13 +81,7 @@ export type FleetWorkerResult = z.infer<typeof fleetWorkerResult>;
|
|
|
114
81
|
* reload; it is also the body the mode-wrapped {@link fleetReportFanout} carries under its
|
|
115
82
|
* `fleet` / `unreachable` modes.
|
|
116
83
|
*/
|
|
117
|
-
export const fleetResult =
|
|
118
|
-
op: z.string(),
|
|
119
|
-
reachable: z.boolean(),
|
|
120
|
-
local_only: z.boolean(),
|
|
121
|
-
results: z.array(fleetWorkerResult),
|
|
122
|
-
error: z.string().nullable(),
|
|
123
|
-
});
|
|
84
|
+
export const fleetResult = openapi.fleetResult;
|
|
124
85
|
export type FleetResult = z.infer<typeof fleetResult>;
|
|
125
86
|
|
|
126
87
|
/**
|
|
@@ -146,9 +107,48 @@ export type FleetReloadResult = z.infer<typeof fleetReloadResult>;
|
|
|
146
107
|
* unknown-key stripping would otherwise silently drop the field, hiding a failed
|
|
147
108
|
* propagation from the shared fleet-report handler. A drift throws `ApiSchemaError`.
|
|
148
109
|
*/
|
|
110
|
+
// Hand-written: the spec publishes a fan-out as one object with optional fields; the client
|
|
111
|
+
// discriminates its three modes.
|
|
112
|
+
const fanoutFleetResult = openapi.fleetResult.omit({ ok: true });
|
|
149
113
|
export const fleetReportFanout = z.discriminatedUnion('mode', [
|
|
150
114
|
z.object({ mode: z.literal('local-only'), note: z.string() }),
|
|
151
|
-
|
|
152
|
-
|
|
115
|
+
fanoutFleetResult.extend({ mode: z.literal('fleet') }),
|
|
116
|
+
fanoutFleetResult.extend({ mode: z.literal('unreachable') }),
|
|
153
117
|
]);
|
|
154
118
|
export type FleetReportFanout = z.infer<typeof fleetReportFanout>;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* One worker line of a fleet recycle roll. `status` is `recycled` (confirmed on
|
|
122
|
+
* reality), `timed-out` or `failed` (the target the roll stopped at — `detail` names
|
|
123
|
+
* why), or `self-deferred` (the worker that took the change recycles itself after
|
|
124
|
+
* replying). `generation_before` is the life that was recycled.
|
|
125
|
+
*/
|
|
126
|
+
export const recycleEntry = openapi.recycleEntry;
|
|
127
|
+
export type RecycleEntry = z.infer<typeof recycleEntry>;
|
|
128
|
+
|
|
129
|
+
/** One newly-ready worker life observed since the change began — capacity evidence. */
|
|
130
|
+
export const freshLife = openapi.freshLife;
|
|
131
|
+
export type FreshLife = z.infer<typeof freshLife>;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Where a recycle roll stopped and why: `name` is the target it stopped at, or `null`
|
|
135
|
+
* when the bus could not be read before a target was reached.
|
|
136
|
+
*/
|
|
137
|
+
export const recycleStop = openapi.recycleStop;
|
|
138
|
+
export type RecycleStop = z.infer<typeof recycleStop>;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* The report of a fleet recycle roll an env change carrying a recycle-class key ran:
|
|
142
|
+
* the worker lines, the fresh lives, and where the roll stopped (`null` when it ran to
|
|
143
|
+
* its end). Names only — never an env value.
|
|
144
|
+
*/
|
|
145
|
+
export const recycleRoll = openapi.recycleRoll;
|
|
146
|
+
export type RecycleRoll = z.infer<typeof recycleRoll>;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* One worker an operation names as still awaiting a respawn: its recycle-class `keys`
|
|
150
|
+
* changed in the stored env since its process bound them (at boot, or when the plugin that
|
|
151
|
+
* declares them was loaded), and nothing in the operation respawns it.
|
|
152
|
+
*/
|
|
153
|
+
export const awaitingWorker = openapi.awaitingWorker;
|
|
154
|
+
export type AwaitingWorker = z.infer<typeof awaitingWorker>;
|
package/src/schemas/hooks.ts
CHANGED
|
@@ -1,57 +1,38 @@
|
|
|
1
1
|
/** Hook listing, registration and topic-verifier response schemas. */
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import * as openapi from '../generated/openapi-schemas';
|
|
5
5
|
|
|
6
|
-
// The
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
// bundle and re-exported at the top of this file, not defined here.
|
|
6
|
+
// The hook response schemas: the fire-door authority enum, the list rows and their
|
|
7
|
+
// wrapper, and the per-topic verifier/trigger metadata. The served hook DOCUMENT schemas
|
|
8
|
+
// (`hookSubject`/`hookParams`/`hookRegister`) are re-exported from `./served`.
|
|
10
9
|
|
|
11
10
|
/** A fire door — who may trigger a path, not what the fire may do. A string enum. */
|
|
12
|
-
export const triggerAuth =
|
|
13
|
-
'public',
|
|
14
|
-
'verifier',
|
|
15
|
-
'token',
|
|
16
|
-
'token+api_key',
|
|
17
|
-
'out-of-service',
|
|
18
|
-
]);
|
|
11
|
+
export const triggerAuth = openapi.hookListView.shape.trigger_auth.valueType;
|
|
19
12
|
export type TriggerAuth = z.infer<typeof triggerAuth>;
|
|
20
13
|
|
|
21
|
-
export const hookList =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
//
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
z.string(),
|
|
30
|
-
z.object({ verifier: z.string(), config: z.record(z.string(), z.unknown()) }),
|
|
31
|
-
)
|
|
32
|
-
.default({}),
|
|
33
|
-
// Per-topic fire door (topic → door). Tolerant of an older response omitting it.
|
|
34
|
-
trigger_auth: z.record(z.string(), triggerAuth).default({}),
|
|
14
|
+
export const hookList = openapi.hookListView.extend({
|
|
15
|
+
// Per-topic verifier bindings: the topic name maps to the verifier bound to it and that
|
|
16
|
+
// verifier's config (which carries a `secret_env` name, never a secret value). Hand-typed:
|
|
17
|
+
// the spec publishes a binding as an open value.
|
|
18
|
+
topic_verifiers: z.record(
|
|
19
|
+
z.string(),
|
|
20
|
+
z.object({ verifier: z.string(), config: z.record(z.string(), z.unknown()) }),
|
|
21
|
+
),
|
|
35
22
|
});
|
|
36
23
|
export type HookList = z.infer<typeof hookList>;
|
|
37
24
|
|
|
38
|
-
export const hookRegistered =
|
|
39
|
-
registered: z.boolean(),
|
|
40
|
-
name: z.string(),
|
|
41
|
-
});
|
|
25
|
+
export const hookRegistered = openapi.hookRegisterResult;
|
|
42
26
|
|
|
43
|
-
export const hookRemoved =
|
|
44
|
-
removed: z.boolean(),
|
|
45
|
-
name: z.string(),
|
|
46
|
-
});
|
|
27
|
+
export const hookRemoved = openapi.removedByName;
|
|
47
28
|
|
|
48
29
|
// The registered webhook-verifier catalog (`GET /api/hooks/verifiers`) — the
|
|
49
30
|
// sorted verifier NAMES only, never any verifier's config. An empty registry is a
|
|
50
31
|
// valid empty array. This is the ONLY source the topic-verifier bind picker reads.
|
|
51
|
-
export const hookVerifiers =
|
|
32
|
+
export const hookVerifiers = openapi.stringListResponse;
|
|
52
33
|
|
|
53
34
|
/** `PUT /api/hooks/topics/{topic}/verifier` — the bound topic + verifier name. */
|
|
54
|
-
export const topicVerifierSet =
|
|
35
|
+
export const topicVerifierSet = openapi.topicVerifierView;
|
|
55
36
|
|
|
56
37
|
/** `DELETE /api/hooks/topics/{topic}/verifier` — the unbound topic. */
|
|
57
|
-
export const topicVerifierRemoved =
|
|
38
|
+
export const topicVerifierRemoved = openapi.removedByTopic;
|
package/src/schemas/index.ts
CHANGED