@tai42/api-client 19.3.0 → 21.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -0
- package/dist/agents.d.ts.map +1 -1
- package/dist/agents.js +6 -4
- package/dist/agents.js.map +1 -1
- package/dist/client/agents-client.d.ts.map +1 -1
- package/dist/client/agents-client.js +3 -2
- package/dist/client/agents-client.js.map +1 -1
- package/dist/client/auth-client.d.ts +143 -90
- package/dist/client/auth-client.d.ts.map +1 -1
- package/dist/client/auth-client.js +81 -25
- package/dist/client/auth-client.js.map +1 -1
- package/dist/client/backend-client.d.ts +14 -13
- package/dist/client/backend-client.d.ts.map +1 -1
- package/dist/client/backend-client.js +7 -3
- package/dist/client/backend-client.js.map +1 -1
- package/dist/client/backup-client.d.ts +45 -19
- package/dist/client/backup-client.d.ts.map +1 -1
- package/dist/client/backup-client.js +8 -3
- package/dist/client/backup-client.js.map +1 -1
- package/dist/client/capabilities-client.d.ts +20 -16
- package/dist/client/capabilities-client.d.ts.map +1 -1
- package/dist/client/capabilities-client.js +3 -2
- package/dist/client/capabilities-client.js.map +1 -1
- package/dist/client/channels-client.d.ts.map +1 -1
- package/dist/client/channels-client.js +2 -1
- package/dist/client/channels-client.js.map +1 -1
- package/dist/client/config-client.d.ts +44 -17
- package/dist/client/config-client.d.ts.map +1 -1
- package/dist/client/config-client.js +10 -4
- package/dist/client/config-client.js.map +1 -1
- package/dist/client/connectors-client.d.ts +270 -81
- package/dist/client/connectors-client.d.ts.map +1 -1
- package/dist/client/connectors-client.js +38 -10
- package/dist/client/connectors-client.js.map +1 -1
- package/dist/client/conversations-client.d.ts +440 -86
- package/dist/client/conversations-client.d.ts.map +1 -1
- package/dist/client/conversations-client.js +46 -17
- package/dist/client/conversations-client.js.map +1 -1
- package/dist/client/hooks-client.d.ts +3 -3
- package/dist/client/hooks-client.d.ts.map +1 -1
- package/dist/client/hooks-client.js +12 -7
- package/dist/client/hooks-client.js.map +1 -1
- package/dist/client/index.d.ts +2252 -864
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +10 -2
- package/dist/client/index.js.map +1 -1
- package/dist/client/interactions-client.d.ts +19 -14
- package/dist/client/interactions-client.d.ts.map +1 -1
- package/dist/client/interactions-client.js +21 -9
- package/dist/client/interactions-client.js.map +1 -1
- package/dist/client/login-client.d.ts +18 -17
- package/dist/client/login-client.d.ts.map +1 -1
- package/dist/client/login-client.js +8 -4
- package/dist/client/login-client.js.map +1 -1
- package/dist/client/manifest-client.d.ts +276 -105
- package/dist/client/manifest-client.d.ts.map +1 -1
- package/dist/client/manifest-client.js +22 -16
- package/dist/client/manifest-client.js.map +1 -1
- package/dist/client/marketplace-client.d.ts +181 -51
- package/dist/client/marketplace-client.d.ts.map +1 -1
- package/dist/client/marketplace-client.js +23 -12
- package/dist/client/marketplace-client.js.map +1 -1
- package/dist/client/mcp-config-schema-client.d.ts.map +1 -1
- package/dist/client/mcp-config-schema-client.js +2 -1
- package/dist/client/mcp-config-schema-client.js.map +1 -1
- package/dist/client/notifications-client.d.ts +44 -14
- package/dist/client/notifications-client.d.ts.map +1 -1
- package/dist/client/notifications-client.js +2 -1
- package/dist/client/notifications-client.js.map +1 -1
- package/dist/client/observability-client.d.ts +78 -38
- package/dist/client/observability-client.d.ts.map +1 -1
- package/dist/client/observability-client.js +29 -6
- package/dist/client/observability-client.js.map +1 -1
- package/dist/client/plugins-client.d.ts +8 -6
- package/dist/client/plugins-client.d.ts.map +1 -1
- package/dist/client/plugins-client.js +2 -1
- package/dist/client/plugins-client.js.map +1 -1
- package/dist/client/policy-client.d.ts +4 -4
- package/dist/client/policy-client.d.ts.map +1 -1
- package/dist/client/policy-client.js +11 -4
- package/dist/client/policy-client.js.map +1 -1
- package/dist/client/presets-client.d.ts +84 -39
- package/dist/client/presets-client.d.ts.map +1 -1
- package/dist/client/presets-client.js +25 -13
- package/dist/client/presets-client.js.map +1 -1
- package/dist/client/profiles-client.d.ts +40 -33
- package/dist/client/profiles-client.d.ts.map +1 -1
- package/dist/client/profiles-client.js +15 -10
- package/dist/client/profiles-client.js.map +1 -1
- package/dist/client/schedules-client.d.ts +21 -17
- package/dist/client/schedules-client.d.ts.map +1 -1
- package/dist/client/schedules-client.js +8 -5
- package/dist/client/schedules-client.js.map +1 -1
- package/dist/client/settings-schema-client.d.ts +1 -1
- package/dist/client/settings-schema-client.d.ts.map +1 -1
- package/dist/client/settings-schema-client.js +2 -1
- package/dist/client/settings-schema-client.js.map +1 -1
- package/dist/client/states-client.d.ts +215 -87
- package/dist/client/states-client.d.ts.map +1 -1
- package/dist/client/states-client.js +98 -37
- package/dist/client/states-client.js.map +1 -1
- package/dist/client/storage-client.d.ts +5 -5
- package/dist/client/storage-client.d.ts.map +1 -1
- package/dist/client/storage-client.js +24 -12
- package/dist/client/storage-client.js.map +1 -1
- package/dist/client/sub-mcp-client.d.ts +3 -1
- package/dist/client/sub-mcp-client.d.ts.map +1 -1
- package/dist/client/sub-mcp-client.js +9 -4
- package/dist/client/sub-mcp-client.js.map +1 -1
- package/dist/client/system-client.d.ts +2 -2
- package/dist/client/system-client.d.ts.map +1 -1
- package/dist/client/system-client.js +2 -1
- package/dist/client/system-client.js.map +1 -1
- package/dist/client/templates-client.d.ts +65 -6
- package/dist/client/templates-client.d.ts.map +1 -1
- package/dist/client/templates-client.js +25 -7
- package/dist/client/templates-client.js.map +1 -1
- package/dist/client/tool-extensions-client.d.ts +41 -16
- package/dist/client/tool-extensions-client.d.ts.map +1 -1
- package/dist/client/tool-extensions-client.js +6 -4
- package/dist/client/tool-extensions-client.js.map +1 -1
- package/dist/client/tool-meta-client.d.ts +8 -8
- package/dist/client/tool-meta-client.d.ts.map +1 -1
- package/dist/client/tool-meta-client.js +12 -8
- package/dist/client/tool-meta-client.js.map +1 -1
- package/dist/client/tools-client.d.ts +150 -23
- package/dist/client/tools-client.d.ts.map +1 -1
- package/dist/client/tools-client.js +8 -8
- package/dist/client/tools-client.js.map +1 -1
- package/dist/client/trigger-links-client.d.ts +11 -9
- package/dist/client/trigger-links-client.d.ts.map +1 -1
- package/dist/client/trigger-links-client.js +4 -4
- package/dist/client/trigger-links-client.js.map +1 -1
- package/dist/fleet-report.d.ts +21 -5
- package/dist/fleet-report.d.ts.map +1 -1
- package/dist/fleet-report.js +31 -6
- package/dist/fleet-report.js.map +1 -1
- package/dist/generated/api-routes.d.ts +1014 -0
- package/dist/generated/api-routes.d.ts.map +1 -0
- package/dist/generated/api-routes.js +322 -0
- package/dist/generated/api-routes.js.map +1 -0
- package/dist/generated/openapi-schemas.d.ts +12425 -0
- package/dist/generated/openapi-schemas.d.ts.map +1 -0
- package/dist/generated/openapi-schemas.js +671 -0
- package/dist/generated/openapi-schemas.js.map +1 -0
- package/dist/generated/served-schemas.d.ts +6697 -392
- package/dist/generated/served-schemas.d.ts.map +1 -1
- package/dist/generated/served-schemas.js +7061 -46
- package/dist/generated/served-schemas.js.map +1 -1
- package/dist/headers.d.ts +4 -0
- package/dist/headers.d.ts.map +1 -0
- package/dist/headers.js +4 -0
- package/dist/headers.js.map +1 -0
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +4 -3
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/schemas/api-keys.d.ts +14 -12
- package/dist/schemas/api-keys.d.ts.map +1 -1
- package/dist/schemas/api-keys.js +9 -23
- package/dist/schemas/api-keys.js.map +1 -1
- package/dist/schemas/auth-routes.d.ts +34 -29
- package/dist/schemas/auth-routes.d.ts.map +1 -1
- package/dist/schemas/auth-routes.js +22 -27
- package/dist/schemas/auth-routes.js.map +1 -1
- package/dist/schemas/backup.d.ts +157 -36
- package/dist/schemas/backup.d.ts.map +1 -1
- package/dist/schemas/backup.js +27 -26
- package/dist/schemas/backup.js.map +1 -1
- package/dist/schemas/capabilities.d.ts +32 -22
- package/dist/schemas/capabilities.d.ts.map +1 -1
- package/dist/schemas/capabilities.js +15 -40
- package/dist/schemas/capabilities.js.map +1 -1
- package/dist/schemas/channels.d.ts +1 -1
- package/dist/schemas/channels.d.ts.map +1 -1
- package/dist/schemas/channels.js +2 -5
- package/dist/schemas/channels.js.map +1 -1
- package/dist/schemas/config.d.ts.map +1 -1
- package/dist/schemas/config.js +4 -6
- package/dist/schemas/config.js.map +1 -1
- package/dist/schemas/connectors.d.ts +381 -185
- package/dist/schemas/connectors.d.ts.map +1 -1
- package/dist/schemas/connectors.js +54 -101
- package/dist/schemas/connectors.js.map +1 -1
- package/dist/schemas/conversations.d.ts +970 -241
- package/dist/schemas/conversations.d.ts.map +1 -1
- package/dist/schemas/conversations.js +40 -134
- package/dist/schemas/conversations.js.map +1 -1
- package/dist/schemas/extensions.d.ts +9 -6
- package/dist/schemas/extensions.d.ts.map +1 -1
- package/dist/schemas/extensions.js +6 -4
- package/dist/schemas/extensions.js.map +1 -1
- package/dist/schemas/fleet.d.ts +153 -99
- package/dist/schemas/fleet.d.ts.map +1 -1
- package/dist/schemas/fleet.js +41 -51
- package/dist/schemas/fleet.js.map +1 -1
- package/dist/schemas/hooks.d.ts +34 -34
- package/dist/schemas/hooks.d.ts.map +1 -1
- package/dist/schemas/hooks.js +15 -34
- package/dist/schemas/hooks.js.map +1 -1
- package/dist/schemas/index.d.ts +1 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +1 -1
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/interactions.d.ts +146 -123
- package/dist/schemas/interactions.d.ts.map +1 -1
- package/dist/schemas/interactions.js +44 -129
- package/dist/schemas/interactions.js.map +1 -1
- package/dist/schemas/login.d.ts +36 -37
- package/dist/schemas/login.d.ts.map +1 -1
- package/dist/schemas/login.js +8 -42
- package/dist/schemas/login.js.map +1 -1
- package/dist/schemas/manifest-mcp.d.ts +61 -35
- package/dist/schemas/manifest-mcp.d.ts.map +1 -1
- package/dist/schemas/manifest-mcp.js +13 -19
- package/dist/schemas/manifest-mcp.js.map +1 -1
- package/dist/schemas/marketplace.d.ts +219 -133
- package/dist/schemas/marketplace.d.ts.map +1 -1
- package/dist/schemas/marketplace.js +35 -120
- package/dist/schemas/marketplace.js.map +1 -1
- package/dist/schemas/members.d.ts +161 -0
- package/dist/schemas/members.d.ts.map +1 -0
- package/dist/schemas/members.js +73 -0
- package/dist/schemas/members.js.map +1 -0
- package/dist/schemas/notifications.d.ts +113 -41
- package/dist/schemas/notifications.d.ts.map +1 -1
- package/dist/schemas/notifications.js +9 -35
- package/dist/schemas/notifications.js.map +1 -1
- package/dist/schemas/observability.d.ts +174 -72
- package/dist/schemas/observability.d.ts.map +1 -1
- package/dist/schemas/observability.js +23 -76
- package/dist/schemas/observability.js.map +1 -1
- package/dist/schemas/policy.d.ts +11 -11
- package/dist/schemas/policy.d.ts.map +1 -1
- package/dist/schemas/policy.js +5 -12
- package/dist/schemas/policy.js.map +1 -1
- package/dist/schemas/presets.d.ts +109 -64
- package/dist/schemas/presets.d.ts.map +1 -1
- package/dist/schemas/presets.js +12 -48
- package/dist/schemas/presets.js.map +1 -1
- package/dist/schemas/principals.d.ts +28 -21
- package/dist/schemas/principals.d.ts.map +1 -1
- package/dist/schemas/principals.js +13 -25
- package/dist/schemas/principals.js.map +1 -1
- package/dist/schemas/profiles.d.ts +75 -63
- package/dist/schemas/profiles.d.ts.map +1 -1
- package/dist/schemas/profiles.js +24 -54
- package/dist/schemas/profiles.js.map +1 -1
- package/dist/schemas/roles.d.ts +22 -22
- package/dist/schemas/roles.d.ts.map +1 -1
- package/dist/schemas/roles.js +10 -17
- package/dist/schemas/roles.js.map +1 -1
- package/dist/schemas/schedules.d.ts +21 -15
- package/dist/schemas/schedules.d.ts.map +1 -1
- package/dist/schemas/schedules.js +4 -13
- package/dist/schemas/schedules.js.map +1 -1
- package/dist/schemas/served.d.ts +6373 -194
- package/dist/schemas/served.d.ts.map +1 -1
- package/dist/schemas/served.js +21 -0
- package/dist/schemas/served.js.map +1 -1
- package/dist/schemas/settings-schema.d.ts +1 -1
- package/dist/schemas/settings-schema.d.ts.map +1 -1
- package/dist/schemas/settings-schema.js +17 -19
- package/dist/schemas/settings-schema.js.map +1 -1
- package/dist/schemas/setup.d.ts +6 -6
- package/dist/schemas/setup.d.ts.map +1 -1
- package/dist/schemas/setup.js +2 -11
- package/dist/schemas/setup.js.map +1 -1
- package/dist/schemas/states.d.ts +450 -135
- package/dist/schemas/states.d.ts.map +1 -1
- package/dist/schemas/states.js +76 -140
- package/dist/schemas/states.js.map +1 -1
- package/dist/schemas/storage.d.ts +7 -8
- package/dist/schemas/storage.d.ts.map +1 -1
- package/dist/schemas/storage.js +8 -17
- package/dist/schemas/storage.js.map +1 -1
- package/dist/schemas/studio-plugins.d.ts +24 -18
- package/dist/schemas/studio-plugins.d.ts.map +1 -1
- package/dist/schemas/studio-plugins.js +5 -19
- package/dist/schemas/studio-plugins.js.map +1 -1
- package/dist/schemas/sub-mcp.d.ts +11 -8
- package/dist/schemas/sub-mcp.d.ts.map +1 -1
- package/dist/schemas/sub-mcp.js +10 -19
- package/dist/schemas/sub-mcp.js.map +1 -1
- package/dist/schemas/system-kinds.d.ts +76 -46
- package/dist/schemas/system-kinds.d.ts.map +1 -1
- package/dist/schemas/system-kinds.js +11 -28
- package/dist/schemas/system-kinds.js.map +1 -1
- package/dist/schemas/templates.d.ts +83 -25
- package/dist/schemas/templates.d.ts.map +1 -1
- package/dist/schemas/templates.js +8 -9
- package/dist/schemas/templates.js.map +1 -1
- package/dist/schemas/tool-meta.d.ts +15 -15
- package/dist/schemas/tool-meta.d.ts.map +1 -1
- package/dist/schemas/tool-meta.js +6 -21
- package/dist/schemas/tool-meta.js.map +1 -1
- package/dist/schemas/tools.d.ts +177 -56
- package/dist/schemas/tools.d.ts.map +1 -1
- package/dist/schemas/tools.js +20 -41
- package/dist/schemas/tools.js.map +1 -1
- package/dist/schemas/trigger-links.d.ts +22 -17
- package/dist/schemas/trigger-links.d.ts.map +1 -1
- package/dist/schemas/trigger-links.js +7 -27
- package/dist/schemas/trigger-links.js.map +1 -1
- package/dist/tool-runs.d.ts +175 -54
- package/dist/tool-runs.d.ts.map +1 -1
- package/dist/tool-runs.js +33 -34
- package/dist/tool-runs.js.map +1 -1
- package/package.json +4 -3
- package/src/agents.ts +16 -4
- package/src/client/agents-client.ts +3 -2
- package/src/client/auth-client.ts +134 -34
- package/src/client/backend-client.ts +8 -3
- package/src/client/backup-client.ts +8 -3
- package/src/client/capabilities-client.ts +4 -2
- package/src/client/channels-client.ts +3 -1
- package/src/client/config-client.ts +13 -5
- package/src/client/connectors-client.ts +91 -16
- package/src/client/conversations-client.ts +79 -30
- package/src/client/hooks-client.ts +25 -12
- package/src/client/index.ts +16 -4
- package/src/client/interactions-client.ts +40 -16
- package/src/client/login-client.ts +8 -4
- package/src/client/manifest-client.ts +48 -24
- package/src/client/marketplace-client.ts +23 -12
- package/src/client/mcp-config-schema-client.ts +2 -1
- package/src/client/notifications-client.ts +2 -1
- package/src/client/observability-client.ts +60 -8
- package/src/client/plugins-client.ts +2 -1
- package/src/client/policy-client.ts +24 -9
- package/src/client/presets-client.ts +26 -13
- package/src/client/profiles-client.ts +53 -24
- package/src/client/schedules-client.ts +14 -20
- package/src/client/settings-schema-client.ts +2 -1
- package/src/client/states-client.ts +151 -49
- package/src/client/storage-client.ts +43 -14
- package/src/client/sub-mcp-client.ts +10 -4
- package/src/client/system-client.ts +2 -1
- package/src/client/templates-client.ts +26 -7
- package/src/client/tool-extensions-client.ts +14 -7
- package/src/client/tool-meta-client.ts +46 -21
- package/src/client/tools-client.ts +13 -8
- package/src/client/trigger-links-client.ts +10 -6
- package/src/fleet-report.ts +48 -7
- package/src/generated/api-routes.ts +327 -0
- package/src/generated/openapi-schemas.ts +1508 -0
- package/src/generated/served-schemas.ts +7118 -82
- package/src/headers.ts +4 -0
- package/src/http.ts +4 -3
- package/src/index.ts +52 -10
- package/src/schemas/api-keys.ts +9 -25
- package/src/schemas/auth-routes.ts +27 -28
- package/src/schemas/backup.ts +33 -31
- package/src/schemas/capabilities.ts +16 -39
- package/src/schemas/channels.ts +4 -4
- package/src/schemas/config.ts +6 -6
- package/src/schemas/connectors.ts +61 -102
- package/src/schemas/conversations.ts +43 -133
- package/src/schemas/extensions.ts +7 -4
- package/src/schemas/fleet.ts +51 -51
- package/src/schemas/hooks.ts +18 -37
- package/src/schemas/index.ts +1 -1
- package/src/schemas/interactions.ts +48 -131
- package/src/schemas/login.ts +10 -41
- package/src/schemas/manifest-mcp.ts +13 -19
- package/src/schemas/marketplace.ts +37 -120
- package/src/schemas/members.ts +91 -0
- package/src/schemas/notifications.ts +10 -34
- package/src/schemas/observability.ts +34 -79
- package/src/schemas/policy.ts +5 -12
- package/src/schemas/presets.ts +13 -48
- package/src/schemas/principals.ts +17 -24
- package/src/schemas/profiles.ts +25 -55
- package/src/schemas/roles.ts +11 -17
- package/src/schemas/schedules.ts +4 -15
- package/src/schemas/served.ts +33 -0
- package/src/schemas/settings-schema.ts +18 -23
- package/src/schemas/setup.ts +4 -10
- package/src/schemas/states.ts +88 -139
- package/src/schemas/storage.ts +10 -16
- package/src/schemas/studio-plugins.ts +8 -19
- package/src/schemas/sub-mcp.ts +12 -18
- package/src/schemas/system-kinds.ts +12 -29
- package/src/schemas/templates.ts +8 -10
- package/src/schemas/tool-meta.ts +8 -20
- package/src/schemas/tools.ts +22 -45
- package/src/schemas/trigger-links.ts +8 -26
- package/src/tool-runs.ts +47 -38
- package/dist/client/web-entry-gate-client.d.ts +0 -34
- package/dist/client/web-entry-gate-client.d.ts.map +0 -1
- package/dist/client/web-entry-gate-client.js +0 -25
- package/dist/client/web-entry-gate-client.js.map +0 -1
- package/dist/schemas/web-entry.d.ts +0 -45
- package/dist/schemas/web-entry.d.ts.map +0 -1
- package/dist/schemas/web-entry.js +0 -36
- package/dist/schemas/web-entry.js.map +0 -1
- package/src/client/web-entry-gate-client.ts +0 -45
- package/src/schemas/web-entry.ts +0 -46
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Tool catalog, run, live-registry admin and tag sub-client. */
|
|
2
|
-
import {
|
|
2
|
+
import { apiRoutes, buildPath } from '../generated/api-routes';
|
|
3
3
|
import * as s from '../schemas';
|
|
4
4
|
import type { StateSubject } from '../schemas/states';
|
|
5
5
|
import { getToolRun, listToolRuns, submitToolRun, type SubmitToolRunArgs } from '../tool-runs';
|
|
@@ -28,13 +28,17 @@ export interface ToolAdminArgs {
|
|
|
28
28
|
export function toolsClient(t: Transport) {
|
|
29
29
|
const { config, req } = t;
|
|
30
30
|
return {
|
|
31
|
-
listTools: (signal?: AbortSignal) => req(
|
|
31
|
+
listTools: (signal?: AbortSignal) => req(apiRoutes.get_api_tools.path, s.toolNames, { signal }),
|
|
32
32
|
getToolSchema: (name: string, signal?: AbortSignal) =>
|
|
33
|
-
req(
|
|
33
|
+
req(
|
|
34
|
+
buildPath(apiRoutes.get_api_tools_tool_name_schema.path, { tool_name: name }),
|
|
35
|
+
s.toolSchema,
|
|
36
|
+
{ signal },
|
|
37
|
+
),
|
|
34
38
|
getAllToolSchemas: (signal?: AbortSignal) =>
|
|
35
|
-
req(
|
|
39
|
+
req(apiRoutes.get_api_tools_schema.path, s.allToolSchemas, { signal }),
|
|
36
40
|
runTool: (args: RunToolArgs, signal?: AbortSignal) =>
|
|
37
|
-
req(
|
|
41
|
+
req(apiRoutes.post_api_run_tool.path, s.runToolResult, {
|
|
38
42
|
method: 'POST',
|
|
39
43
|
// The backend's `/api/run-tool` door reads `{tool_name, arguments, subject}`
|
|
40
44
|
// (the shape `read_tool_call` enforces and the background `/api/tool-runs`
|
|
@@ -54,12 +58,12 @@ export function toolsClient(t: Transport) {
|
|
|
54
58
|
// per-worker `fleetResult` the shared fleet-report handler renders. Both are
|
|
55
59
|
// fenced + destructive server-side, so a refusal surfaces as a loud error.
|
|
56
60
|
reloadTool: (args: ToolAdminArgs) =>
|
|
57
|
-
req(
|
|
61
|
+
req(apiRoutes.post_api_tools_reload.path, s.fleetResult, {
|
|
58
62
|
method: 'POST',
|
|
59
63
|
body: { kind: args.kind, name: args.name, targets: args.targets ?? null },
|
|
60
64
|
}),
|
|
61
65
|
removeTool: (args: ToolAdminArgs) =>
|
|
62
|
-
req(
|
|
66
|
+
req(apiRoutes.post_api_tools_remove.path, s.fleetResult, {
|
|
63
67
|
method: 'POST',
|
|
64
68
|
body: { kind: args.kind, name: args.name, targets: args.targets ?? null },
|
|
65
69
|
}),
|
|
@@ -70,6 +74,7 @@ export function toolsClient(t: Transport) {
|
|
|
70
74
|
listToolRuns: (toolName: string, signal?: AbortSignal) =>
|
|
71
75
|
listToolRuns(config, toolName, signal),
|
|
72
76
|
|
|
73
|
-
listToolTags: (signal?: AbortSignal) =>
|
|
77
|
+
listToolTags: (signal?: AbortSignal) =>
|
|
78
|
+
req(apiRoutes.get_api_tools_tags.path, s.toolTags, { signal }),
|
|
74
79
|
};
|
|
75
80
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Trigger-link mint, listing and revoke sub-client. */
|
|
2
|
-
import {
|
|
2
|
+
import { apiRoutes, buildPath } from '../generated/api-routes';
|
|
3
3
|
import * as s from '../schemas';
|
|
4
4
|
import type { Transport } from './transport';
|
|
5
5
|
|
|
@@ -28,7 +28,7 @@ export function triggerLinksClient(t: Transport) {
|
|
|
28
28
|
// and 400s a dropped one; `tool_kwargs` is omitted when undefined. The raw
|
|
29
29
|
// `token` rides the response ONCE (composed into the QR URL client-side).
|
|
30
30
|
createTriggerLink: (body: TriggerLinkCreateBody) =>
|
|
31
|
-
req(
|
|
31
|
+
req(apiRoutes.post_api_hooks_trigger_links.path, s.triggerLinkCreated, {
|
|
32
32
|
method: 'POST',
|
|
33
33
|
body: {
|
|
34
34
|
topic: body.topic,
|
|
@@ -41,11 +41,15 @@ export function triggerLinksClient(t: Transport) {
|
|
|
41
41
|
}),
|
|
42
42
|
// Every live trigger-link record (hash prefix only — never a raw token).
|
|
43
43
|
listTriggerLinks: (signal?: AbortSignal) =>
|
|
44
|
-
req(
|
|
44
|
+
req(apiRoutes.get_api_hooks_trigger_links.path, s.triggerLinkList, { signal }),
|
|
45
45
|
// Revoke a link by name (immediate + durable). 404 when the name is unknown.
|
|
46
46
|
deleteTriggerLink: (name: string) =>
|
|
47
|
-
req(
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
req(
|
|
48
|
+
buildPath(apiRoutes.delete_api_hooks_trigger_links_name.path, { name }),
|
|
49
|
+
s.triggerLinkDeleted,
|
|
50
|
+
{
|
|
51
|
+
method: 'DELETE',
|
|
52
|
+
},
|
|
53
|
+
),
|
|
50
54
|
};
|
|
51
55
|
}
|
package/src/fleet-report.ts
CHANGED
|
@@ -38,6 +38,16 @@ export interface FleetWorkerFailure {
|
|
|
38
38
|
*/
|
|
39
39
|
export type FleetReportStatus = 'converged' | 'degraded' | 'unreachable';
|
|
40
40
|
|
|
41
|
+
/**
|
|
42
|
+
* One worker whose reload named recycle-class keys awaiting a respawn: their value
|
|
43
|
+
* changed since the worker bound it (at boot, or when the plugin that declares them was
|
|
44
|
+
* loaded), and they take effect only when it is respawned.
|
|
45
|
+
*/
|
|
46
|
+
export interface FleetWorkerAwaitingRespawn {
|
|
47
|
+
readonly name: string;
|
|
48
|
+
readonly keys: readonly string[];
|
|
49
|
+
}
|
|
50
|
+
|
|
41
51
|
export interface FleetReportSummary {
|
|
42
52
|
readonly status: FleetReportStatus;
|
|
43
53
|
/** The single-worker `local-only` note, when the broadcast reached no sibling. */
|
|
@@ -46,6 +56,20 @@ export interface FleetReportSummary {
|
|
|
46
56
|
readonly failures: readonly FleetWorkerFailure[];
|
|
47
57
|
/** The bus-unreachable transport error — non-null only when `unreachable`. */
|
|
48
58
|
readonly error: string | null;
|
|
59
|
+
/** The workers whose reload named recycle-class keys awaiting a respawn. */
|
|
60
|
+
readonly awaiting: readonly FleetWorkerAwaitingRespawn[];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* The recycle-class keys a worker's reload payload names under `awaiting_respawn`.
|
|
65
|
+
* The per-worker payload is opaque on the wire, so it is read defensively: a payload
|
|
66
|
+
* that is not a reload result names nothing.
|
|
67
|
+
*/
|
|
68
|
+
function awaitingKeys(payload: unknown): string[] {
|
|
69
|
+
if (typeof payload !== 'object' || payload === null || Array.isArray(payload)) return [];
|
|
70
|
+
const keys = (payload as Record<string, unknown>).awaiting_respawn;
|
|
71
|
+
if (!Array.isArray(keys)) return [];
|
|
72
|
+
return keys.filter((key): key is string => typeof key === 'string');
|
|
49
73
|
}
|
|
50
74
|
|
|
51
75
|
/** True when a summary describes a propagation the operator must be shown. */
|
|
@@ -56,11 +80,23 @@ export function isFleetReportFailure(summary: FleetReportSummary | null): boolea
|
|
|
56
80
|
/**
|
|
57
81
|
* Interpret a bare {@link FleetResult} (the fleet-reload / single-MCP-reload body).
|
|
58
82
|
* An unreachable bus is `unreachable`; a reachable report with any non-`applied`
|
|
59
|
-
* worker is `degraded` (those workers named); otherwise `converged`.
|
|
83
|
+
* worker is `degraded` (those workers named); otherwise `converged`. Every worker whose
|
|
84
|
+
* reload payload names `awaiting_respawn` keys is listed under `awaiting`, whatever the
|
|
85
|
+
* status.
|
|
60
86
|
*/
|
|
61
|
-
export function summarizeFleetResult(result: FleetResult): FleetReportSummary {
|
|
87
|
+
export function summarizeFleetResult(result: Omit<FleetResult, 'ok'>): FleetReportSummary {
|
|
88
|
+
const awaiting: FleetWorkerAwaitingRespawn[] = result.results
|
|
89
|
+
.map((entry) => ({ name: entry.name, keys: awaitingKeys(entry.payload) }))
|
|
90
|
+
.filter((entry) => entry.keys.length > 0);
|
|
91
|
+
return summarizeWith(result, awaiting);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function summarizeWith(
|
|
95
|
+
result: Omit<FleetResult, 'ok'>,
|
|
96
|
+
awaiting: readonly FleetWorkerAwaitingRespawn[],
|
|
97
|
+
): FleetReportSummary {
|
|
62
98
|
if (!result.reachable) {
|
|
63
|
-
return { status: 'unreachable', note: null, failures: [], error: result.error };
|
|
99
|
+
return { status: 'unreachable', note: null, failures: [], error: result.error, awaiting };
|
|
64
100
|
}
|
|
65
101
|
const failures: FleetWorkerFailure[] = result.results
|
|
66
102
|
.filter((entry) => entry.outcome !== 'applied')
|
|
@@ -74,6 +110,7 @@ export function summarizeFleetResult(result: FleetResult): FleetReportSummary {
|
|
|
74
110
|
note: null,
|
|
75
111
|
failures,
|
|
76
112
|
error: null,
|
|
113
|
+
awaiting,
|
|
77
114
|
};
|
|
78
115
|
}
|
|
79
116
|
|
|
@@ -81,16 +118,20 @@ export function summarizeFleetResult(result: FleetResult): FleetReportSummary {
|
|
|
81
118
|
* Interpret a mutation's mode-wrapped {@link FleetReportFanout}. `null`/`undefined`
|
|
82
119
|
* (the response path mutated no manifest) yields `null` — there is nothing to report.
|
|
83
120
|
* A `local-only` fan-out is `converged` with its note; `fleet`/`unreachable` carry a
|
|
84
|
-
* bare {@link FleetResult}
|
|
121
|
+
* bare {@link FleetResult} judged as {@link summarizeFleetResult} judges its failures.
|
|
122
|
+
* `awaiting` is the mutation's own verdict (its response's `awaiting_respawn`, or `[]`
|
|
123
|
+
* for a mutation that states none): the operation knows whether its recycle roll
|
|
124
|
+
* carried a worker's moved env, so its per-worker rows are never re-read for it.
|
|
85
125
|
*/
|
|
86
126
|
export function summarizeFleetFanout(
|
|
87
127
|
fanout: FleetReportFanout | null | undefined,
|
|
128
|
+
awaiting: readonly FleetWorkerAwaitingRespawn[],
|
|
88
129
|
): FleetReportSummary | null {
|
|
89
130
|
if (fanout === null || fanout === undefined) return null;
|
|
90
131
|
if (fanout.mode === 'local-only') {
|
|
91
|
-
return { status: 'converged', note: fanout.note, failures: [], error: null };
|
|
132
|
+
return { status: 'converged', note: fanout.note, failures: [], error: null, awaiting };
|
|
92
133
|
}
|
|
93
|
-
return
|
|
134
|
+
return summarizeWith(fanout, awaiting);
|
|
94
135
|
}
|
|
95
136
|
|
|
96
137
|
/** One MCP server skipped by the viability check — its title, a coarse status, and the
|
|
@@ -115,7 +156,7 @@ export interface FailedMcpEntry {
|
|
|
115
156
|
* name-sorts the result, tolerating a worker whose payload is absent or malformed
|
|
116
157
|
* (skipped, never a throw: a partial fleet report still yields the roster it can).
|
|
117
158
|
*/
|
|
118
|
-
export function failedMcpsFromReport(result: FleetResult): FailedMcpEntry[] {
|
|
159
|
+
export function failedMcpsFromReport(result: Omit<FleetResult, 'ok'>): FailedMcpEntry[] {
|
|
119
160
|
const byTitle = new Map<string, FailedMcpEntry>();
|
|
120
161
|
for (const worker of result.results) {
|
|
121
162
|
const payload: unknown = worker.payload;
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
// DO NOT EDIT — generated from the skeleton OpenAPI artifact.
|
|
2
|
+
// Source: packages/api-client/contract-schema/openapi.json
|
|
3
|
+
// Regenerate with: pnpm --filter @tai42/api-client run schema:generate
|
|
4
|
+
//
|
|
5
|
+
// The platform's core routes by operationId. A placeholder written `{name:path}` matches
|
|
6
|
+
// across `/` separators (the server names its converter on the parameter).
|
|
7
|
+
import { encodeSegment } from '../http';
|
|
8
|
+
|
|
9
|
+
export const apiRoutes = {
|
|
10
|
+
delete_api_agents_config_entries_title: { method: "DELETE", path: "/api/agents-config/entries/{title}" },
|
|
11
|
+
delete_api_auth_api_keys_user_id: { method: "DELETE", path: "/api/auth/api-keys/{user_id}" },
|
|
12
|
+
delete_api_auth_principals_user_id: { method: "DELETE", path: "/api/auth/principals/{user_id}" },
|
|
13
|
+
delete_api_auth_public_routes: { method: "DELETE", path: "/api/auth/public-routes" },
|
|
14
|
+
delete_api_auth_roles_name: { method: "DELETE", path: "/api/auth/roles/{name}" },
|
|
15
|
+
delete_api_auth_scopes_scope_id: { method: "DELETE", path: "/api/auth/scopes/{scope_id}" },
|
|
16
|
+
delete_api_auth_scopes_urls: { method: "DELETE", path: "/api/auth/scopes/urls" },
|
|
17
|
+
delete_api_config_profiles_name: { method: "DELETE", path: "/api/config/profiles/{name}" },
|
|
18
|
+
delete_api_connectors_connections_connection_id: { method: "DELETE", path: "/api/connectors/connections/{connection_id}" },
|
|
19
|
+
delete_api_connectors_providers_provider_id: { method: "DELETE", path: "/api/connectors/providers/{provider_id}" },
|
|
20
|
+
delete_api_conversation_configs_target_kind_target_name: { method: "DELETE", path: "/api/conversation-configs/{target_kind}/{target_name}" },
|
|
21
|
+
delete_api_conversations_persons_person_id: { method: "DELETE", path: "/api/conversations/persons/{person_id}" },
|
|
22
|
+
delete_api_conversations_route_name: { method: "DELETE", path: "/api/conversations/{route_name}" },
|
|
23
|
+
delete_api_conversations_route_name_thread: { method: "DELETE", path: "/api/conversations/{route_name}/thread" },
|
|
24
|
+
delete_api_hooks_name: { method: "DELETE", path: "/api/hooks/{name}" },
|
|
25
|
+
delete_api_hooks_topics_topic_verifier: { method: "DELETE", path: "/api/hooks/topics/{topic}/verifier" },
|
|
26
|
+
delete_api_hooks_trigger_links_name: { method: "DELETE", path: "/api/hooks/trigger-links/{name}" },
|
|
27
|
+
delete_api_mcp_config_entries_title: { method: "DELETE", path: "/api/mcp-config/entries/{title}" },
|
|
28
|
+
delete_api_presets_name: { method: "DELETE", path: "/api/presets/{name}" },
|
|
29
|
+
delete_api_schedules_schedule_name: { method: "DELETE", path: "/api/schedules/{schedule_name}" },
|
|
30
|
+
delete_api_state_pending_saves_id: { method: "DELETE", path: "/api/state-pending-saves/{id}" },
|
|
31
|
+
delete_api_state_templates_name: { method: "DELETE", path: "/api/state-templates/{name}" },
|
|
32
|
+
delete_api_states_name: { method: "DELETE", path: "/api/states/{name}" },
|
|
33
|
+
delete_api_states_name_attachments_template: { method: "DELETE", path: "/api/states/{name}/attachments/{template}" },
|
|
34
|
+
delete_api_states_name_records_target_kind_target_name_kind_key: { method: "DELETE", path: "/api/states/{name}/records/{target_kind}/{target_name}/{kind}/{key}" },
|
|
35
|
+
delete_api_storage_dirs_dir_path: { method: "DELETE", path: "/api/storage/dirs/{dir_path:path}" },
|
|
36
|
+
delete_api_storage_resources_resource_id: { method: "DELETE", path: "/api/storage/resources/{resource_id:path}" },
|
|
37
|
+
delete_api_sub_mcp_slug: { method: "DELETE", path: "/api/sub-mcp/{slug}" },
|
|
38
|
+
delete_api_tool_meta_folders_folder_id: { method: "DELETE", path: "/api/tool-meta/folders/{folder_id}" },
|
|
39
|
+
delete_api_tool_meta_tools_tool_name: { method: "DELETE", path: "/api/tool-meta/tools/{tool_name}" },
|
|
40
|
+
delete_api_tools_config_entries_title: { method: "DELETE", path: "/api/tools-config/entries/{title}" },
|
|
41
|
+
get_api_agents: { method: "GET", path: "/api/agents" },
|
|
42
|
+
get_api_agents_spec_runnable: { method: "GET", path: "/api/agents/spec-runnable" },
|
|
43
|
+
get_api_auth_api_keys_user_id_policy_versions: { method: "GET", path: "/api/auth/api-keys/{user_id}/policy/versions" },
|
|
44
|
+
get_api_auth_capabilities: { method: "GET", path: "/api/auth/capabilities" },
|
|
45
|
+
get_api_auth_me: { method: "GET", path: "/api/auth/me" },
|
|
46
|
+
get_api_auth_member_actions: { method: "GET", path: "/api/auth/member-actions" },
|
|
47
|
+
get_api_auth_members: { method: "GET", path: "/api/auth/members" },
|
|
48
|
+
get_api_auth_principals: { method: "GET", path: "/api/auth/principals" },
|
|
49
|
+
get_api_auth_public_routes: { method: "GET", path: "/api/auth/public-routes" },
|
|
50
|
+
get_api_auth_roles: { method: "GET", path: "/api/auth/roles" },
|
|
51
|
+
get_api_auth_roles_name_versions: { method: "GET", path: "/api/auth/roles/{name}/versions" },
|
|
52
|
+
get_api_auth_routes: { method: "GET", path: "/api/auth/routes" },
|
|
53
|
+
get_api_auth_scopes: { method: "GET", path: "/api/auth/scopes" },
|
|
54
|
+
get_api_auth_tokens_payload: { method: "GET", path: "/api/auth/tokens-payload" },
|
|
55
|
+
get_api_backend: { method: "GET", path: "/api/backend" },
|
|
56
|
+
get_api_backup_sections: { method: "GET", path: "/api/backup/sections" },
|
|
57
|
+
get_api_channels: { method: "GET", path: "/api/channels" },
|
|
58
|
+
get_api_config_env: { method: "GET", path: "/api/config/env" },
|
|
59
|
+
get_api_config_mode: { method: "GET", path: "/api/config/mode" },
|
|
60
|
+
get_api_config_profiles: { method: "GET", path: "/api/config/profiles" },
|
|
61
|
+
get_api_config_profiles_name: { method: "GET", path: "/api/config/profiles/{name}" },
|
|
62
|
+
get_api_config_profiles_name_versions: { method: "GET", path: "/api/config/profiles/{name}/versions" },
|
|
63
|
+
get_api_config_profiles_name_versions_version: { method: "GET", path: "/api/config/profiles/{name}/versions/{version}" },
|
|
64
|
+
get_api_config_settings_schema: { method: "GET", path: "/api/config/settings-schema" },
|
|
65
|
+
get_api_connectors_connections: { method: "GET", path: "/api/connectors/connections" },
|
|
66
|
+
get_api_connectors_connections_connection_id: { method: "GET", path: "/api/connectors/connections/{connection_id}" },
|
|
67
|
+
get_api_connectors_providers: { method: "GET", path: "/api/connectors/providers" },
|
|
68
|
+
get_api_conversation_configs: { method: "GET", path: "/api/conversation-configs" },
|
|
69
|
+
get_api_conversation_configs_target_kind_target_name: { method: "GET", path: "/api/conversation-configs/{target_kind}/{target_name}" },
|
|
70
|
+
get_api_conversations: { method: "GET", path: "/api/conversations" },
|
|
71
|
+
get_api_conversations_messages_failed: { method: "GET", path: "/api/conversations/messages/failed" },
|
|
72
|
+
get_api_conversations_persons_person_id: { method: "GET", path: "/api/conversations/persons/{person_id}" },
|
|
73
|
+
get_api_conversations_route_name: { method: "GET", path: "/api/conversations/{route_name}" },
|
|
74
|
+
get_api_conversations_route_name_messages_message_id: { method: "GET", path: "/api/conversations/{route_name}/messages/{message_id}" },
|
|
75
|
+
get_api_conversations_route_name_messages_search: { method: "GET", path: "/api/conversations/{route_name}/messages/search" },
|
|
76
|
+
get_api_conversations_route_name_thread_mode: { method: "GET", path: "/api/conversations/{route_name}/thread/mode" },
|
|
77
|
+
get_api_conversations_route_name_threads: { method: "GET", path: "/api/conversations/{route_name}/threads" },
|
|
78
|
+
get_api_conversations_route_name_transcript: { method: "GET", path: "/api/conversations/{route_name}/transcript" },
|
|
79
|
+
get_api_extensions: { method: "GET", path: "/api/extensions" },
|
|
80
|
+
get_api_fleet_workers: { method: "GET", path: "/api/fleet/workers" },
|
|
81
|
+
get_api_hooks: { method: "GET", path: "/api/hooks" },
|
|
82
|
+
get_api_hooks_trigger_links: { method: "GET", path: "/api/hooks/trigger-links" },
|
|
83
|
+
get_api_hooks_verifiers: { method: "GET", path: "/api/hooks/verifiers" },
|
|
84
|
+
get_api_interactions: { method: "GET", path: "/api/interactions" },
|
|
85
|
+
get_api_interactions_callback_ticket: { method: "GET", path: "/api/interactions/callback/{ticket}" },
|
|
86
|
+
get_api_interactions_media_media_id: { method: "GET", path: "/api/interactions/media/{media_id}" },
|
|
87
|
+
get_api_interactions_pending: { method: "GET", path: "/api/interactions/pending" },
|
|
88
|
+
get_api_interactions_stream: { method: "GET", path: "/api/interactions/stream" },
|
|
89
|
+
get_api_login_methods: { method: "GET", path: "/api/login/methods" },
|
|
90
|
+
get_api_manifest: { method: "GET", path: "/api/manifest" },
|
|
91
|
+
get_api_manifest_mcp_env_refs: { method: "GET", path: "/api/manifest/mcp-env-refs" },
|
|
92
|
+
get_api_manifest_preserved: { method: "GET", path: "/api/manifest/preserved" },
|
|
93
|
+
get_api_marketplace_advisories: { method: "GET", path: "/api/marketplace/advisories" },
|
|
94
|
+
get_api_marketplace_categories: { method: "GET", path: "/api/marketplace/categories" },
|
|
95
|
+
get_api_marketplace_installed: { method: "GET", path: "/api/marketplace/installed" },
|
|
96
|
+
get_api_marketplace_kinds: { method: "GET", path: "/api/marketplace/kinds" },
|
|
97
|
+
get_api_marketplace_plugins_ns_name: { method: "GET", path: "/api/marketplace/plugins/{ns}/{name}" },
|
|
98
|
+
get_api_marketplace_search: { method: "GET", path: "/api/marketplace/search" },
|
|
99
|
+
get_api_mcp_config_schema: { method: "GET", path: "/api/mcp-config/schema" },
|
|
100
|
+
get_api_mcp_status: { method: "GET", path: "/api/mcp-status" },
|
|
101
|
+
get_api_mcp_status_failed: { method: "GET", path: "/api/mcp-status/failed" },
|
|
102
|
+
get_api_notifications: { method: "GET", path: "/api/notifications" },
|
|
103
|
+
get_api_observability_capabilities: { method: "GET", path: "/api/observability/capabilities" },
|
|
104
|
+
get_api_observability_metrics: { method: "GET", path: "/api/observability/metrics" },
|
|
105
|
+
get_api_observability_runs: { method: "GET", path: "/api/observability/runs" },
|
|
106
|
+
get_api_observability_runs_export: { method: "GET", path: "/api/observability/runs/export" },
|
|
107
|
+
get_api_observability_runs_trace_id_spans_span_id_resolved: { method: "GET", path: "/api/observability/runs/{trace_id}/spans/{span_id}/resolved" },
|
|
108
|
+
get_api_observability_runs_trace_id_trace: { method: "GET", path: "/api/observability/runs/{trace_id}/trace" },
|
|
109
|
+
get_api_observability_runs_trace_id_trace_export: { method: "GET", path: "/api/observability/runs/{trace_id}/trace/export" },
|
|
110
|
+
get_api_observability_runs_trace_id_trace_outline: { method: "GET", path: "/api/observability/runs/{trace_id}/trace/outline" },
|
|
111
|
+
get_api_plugins: { method: "GET", path: "/api/plugins" },
|
|
112
|
+
get_api_plugins_name_studio_path: { method: "GET", path: "/api/plugins/{name}/studio/{path:path}" },
|
|
113
|
+
get_api_presets: { method: "GET", path: "/api/presets" },
|
|
114
|
+
get_api_presets_name: { method: "GET", path: "/api/presets/{name}" },
|
|
115
|
+
get_api_presets_name_referees: { method: "GET", path: "/api/presets/{name}/referees" },
|
|
116
|
+
get_api_presets_name_versions: { method: "GET", path: "/api/presets/{name}/versions" },
|
|
117
|
+
get_api_presets_name_versions_version: { method: "GET", path: "/api/presets/{name}/versions/{version}" },
|
|
118
|
+
get_api_resources_get: { method: "GET", path: "/api/resources/get" },
|
|
119
|
+
get_api_runs: { method: "GET", path: "/api/runs" },
|
|
120
|
+
get_api_sandbox: { method: "GET", path: "/api/sandbox" },
|
|
121
|
+
get_api_schedules: { method: "GET", path: "/api/schedules" },
|
|
122
|
+
get_api_schedules_server_datetime: { method: "GET", path: "/api/schedules/server-datetime" },
|
|
123
|
+
get_api_state_pending_saves: { method: "GET", path: "/api/state-pending-saves" },
|
|
124
|
+
get_api_state_templates: { method: "GET", path: "/api/state-templates" },
|
|
125
|
+
get_api_state_templates_name: { method: "GET", path: "/api/state-templates/{name}" },
|
|
126
|
+
get_api_states: { method: "GET", path: "/api/states" },
|
|
127
|
+
get_api_states_name: { method: "GET", path: "/api/states/{name}" },
|
|
128
|
+
get_api_states_name_attachments: { method: "GET", path: "/api/states/{name}/attachments" },
|
|
129
|
+
get_api_states_name_attachments_template: { method: "GET", path: "/api/states/{name}/attachments/{template}" },
|
|
130
|
+
get_api_states_name_consumers: { method: "GET", path: "/api/states/{name}/consumers" },
|
|
131
|
+
get_api_states_name_records_target_kind_target_name_kind_key: { method: "GET", path: "/api/states/{name}/records/{target_kind}/{target_name}/{kind}/{key}" },
|
|
132
|
+
get_api_states_name_records_target_kind_target_name_kind_key_template_jq_program: { method: "GET", path: "/api/states/{name}/records/{target_kind}/{target_name}/{kind}/{key}/template-jq/{program}" },
|
|
133
|
+
get_api_states_name_records_target_kind_target_name_kind_key_writes: { method: "GET", path: "/api/states/{name}/records/{target_kind}/{target_name}/{kind}/{key}/writes" },
|
|
134
|
+
get_api_states_name_stats: { method: "GET", path: "/api/states/{name}/stats" },
|
|
135
|
+
get_api_states_name_subjects: { method: "GET", path: "/api/states/{name}/subjects" },
|
|
136
|
+
get_api_storage: { method: "GET", path: "/api/storage" },
|
|
137
|
+
get_api_storage_resources: { method: "GET", path: "/api/storage/resources" },
|
|
138
|
+
get_api_storage_resources_resource_id_content: { method: "GET", path: "/api/storage/resources/{resource_id:path}/content" },
|
|
139
|
+
get_api_storage_resources_resource_id_stat: { method: "GET", path: "/api/storage/resources/{resource_id:path}/stat" },
|
|
140
|
+
get_api_sub_mcp: { method: "GET", path: "/api/sub-mcp" },
|
|
141
|
+
get_api_system_kinds: { method: "GET", path: "/api/system/kinds" },
|
|
142
|
+
get_api_templates: { method: "GET", path: "/api/templates" },
|
|
143
|
+
get_api_tool_meta: { method: "GET", path: "/api/tool-meta" },
|
|
144
|
+
get_api_tool_runs: { method: "GET", path: "/api/tool-runs" },
|
|
145
|
+
get_api_tool_runs_run_id: { method: "GET", path: "/api/tool-runs/{run_id}" },
|
|
146
|
+
get_api_tools: { method: "GET", path: "/api/tools" },
|
|
147
|
+
get_api_tools_name_extensions: { method: "GET", path: "/api/tools/{name}/extensions" },
|
|
148
|
+
get_api_tools_schema: { method: "GET", path: "/api/tools-schema" },
|
|
149
|
+
get_api_tools_tags: { method: "GET", path: "/api/tools/tags" },
|
|
150
|
+
get_api_tools_tool_name_schema: { method: "GET", path: "/api/tools/{tool_name}/schema" },
|
|
151
|
+
head_api_interactions_media_media_id: { method: "HEAD", path: "/api/interactions/media/{media_id}" },
|
|
152
|
+
patch_api_connectors_connections_connection_id_sub_services: { method: "PATCH", path: "/api/connectors/connections/{connection_id}/sub-services" },
|
|
153
|
+
patch_api_states_name_attachments_template: { method: "PATCH", path: "/api/states/{name}/attachments/{template}" },
|
|
154
|
+
patch_api_states_name_records_target_kind_target_name_kind_key: { method: "PATCH", path: "/api/states/{name}/records/{target_kind}/{target_name}/{kind}/{key}" },
|
|
155
|
+
patch_api_tool_meta_tools_tool_name: { method: "PATCH", path: "/api/tool-meta/tools/{tool_name}" },
|
|
156
|
+
post_api_agents_authored_name_runs: { method: "POST", path: "/api/agents/authored/{name}/runs" },
|
|
157
|
+
post_api_agents_config_entries: { method: "POST", path: "/api/agents-config/entries" },
|
|
158
|
+
post_api_agents_name_runs: { method: "POST", path: "/api/agents/{name}/runs" },
|
|
159
|
+
post_api_api_tools: { method: "POST", path: "/api/api-tools" },
|
|
160
|
+
post_api_auth_api_keys: { method: "POST", path: "/api/auth/api-keys" },
|
|
161
|
+
post_api_auth_api_keys_user_id_policy_rollback: { method: "POST", path: "/api/auth/api-keys/{user_id}/policy/rollback" },
|
|
162
|
+
post_api_auth_api_keys_user_id_scopes: { method: "POST", path: "/api/auth/api-keys/{user_id}/scopes" },
|
|
163
|
+
post_api_auth_claim_links: { method: "POST", path: "/api/auth/claim-links" },
|
|
164
|
+
post_api_auth_logout: { method: "POST", path: "/api/auth/logout" },
|
|
165
|
+
post_api_auth_member_actions_invoke: { method: "POST", path: "/api/auth/member-actions/invoke" },
|
|
166
|
+
post_api_auth_principals: { method: "POST", path: "/api/auth/principals" },
|
|
167
|
+
post_api_auth_public_routes: { method: "POST", path: "/api/auth/public-routes" },
|
|
168
|
+
post_api_auth_roles: { method: "POST", path: "/api/auth/roles" },
|
|
169
|
+
post_api_auth_roles_name_grants: { method: "POST", path: "/api/auth/roles/{name}/grants" },
|
|
170
|
+
post_api_auth_roles_name_rollback: { method: "POST", path: "/api/auth/roles/{name}/rollback" },
|
|
171
|
+
post_api_auth_scopes: { method: "POST", path: "/api/auth/scopes" },
|
|
172
|
+
post_api_auth_validate_condition: { method: "POST", path: "/api/auth/validate-condition" },
|
|
173
|
+
post_api_backup_export: { method: "POST", path: "/api/backup/export" },
|
|
174
|
+
post_api_backup_import: { method: "POST", path: "/api/backup/import" },
|
|
175
|
+
post_api_checkpoints_sweep: { method: "POST", path: "/api/checkpoints/sweep" },
|
|
176
|
+
post_api_clear_templates_cache: { method: "POST", path: "/api/clear-templates-cache" },
|
|
177
|
+
post_api_config_env: { method: "POST", path: "/api/config/env" },
|
|
178
|
+
post_api_config_profiles_name_apply: { method: "POST", path: "/api/config/profiles/{name}/apply" },
|
|
179
|
+
post_api_config_profiles_name_diff: { method: "POST", path: "/api/config/profiles/{name}/diff" },
|
|
180
|
+
post_api_config_profiles_name_rollback: { method: "POST", path: "/api/config/profiles/{name}/rollback" },
|
|
181
|
+
post_api_config_reload: { method: "POST", path: "/api/config/reload" },
|
|
182
|
+
post_api_connectors_connections_connection_id_reconnect: { method: "POST", path: "/api/connectors/connections/{connection_id}/reconnect" },
|
|
183
|
+
post_api_connectors_connections_start: { method: "POST", path: "/api/connectors/connections/start" },
|
|
184
|
+
post_api_connectors_oauth_complete: { method: "POST", path: "/api/connectors/oauth/complete" },
|
|
185
|
+
post_api_connectors_providers: { method: "POST", path: "/api/connectors/providers" },
|
|
186
|
+
post_api_connectors_providers_discover: { method: "POST", path: "/api/connectors/providers/discover" },
|
|
187
|
+
post_api_connectors_tokens_reencrypt: { method: "POST", path: "/api/connectors/tokens/reencrypt" },
|
|
188
|
+
post_api_conversations_route_name: { method: "POST", path: "/api/conversations/{route_name}" },
|
|
189
|
+
post_api_conversations_route_name_events: { method: "POST", path: "/api/conversations/{route_name}/events" },
|
|
190
|
+
post_api_conversations_route_name_messages: { method: "POST", path: "/api/conversations/{route_name}/messages" },
|
|
191
|
+
post_api_conversations_route_name_thread_messages: { method: "POST", path: "/api/conversations/{route_name}/thread/messages" },
|
|
192
|
+
post_api_delete_template: { method: "POST", path: "/api/delete-template" },
|
|
193
|
+
post_api_delete_template_dir: { method: "POST", path: "/api/delete-template-dir" },
|
|
194
|
+
post_api_fleet_reload_config: { method: "POST", path: "/api/fleet/reload-config" },
|
|
195
|
+
post_api_hooks: { method: "POST", path: "/api/hooks" },
|
|
196
|
+
post_api_hooks_trigger_links: { method: "POST", path: "/api/hooks/trigger-links" },
|
|
197
|
+
post_api_interactions_callback_ticket: { method: "POST", path: "/api/interactions/callback/{ticket}" },
|
|
198
|
+
post_api_interactions_callback_ticket_react: { method: "POST", path: "/api/interactions/callback/{ticket}/react" },
|
|
199
|
+
post_api_interactions_interaction_id_answer: { method: "POST", path: "/api/interactions/{interaction_id}/answer" },
|
|
200
|
+
post_api_interactions_interaction_id_cancel: { method: "POST", path: "/api/interactions/{interaction_id}/cancel" },
|
|
201
|
+
post_api_interactions_interaction_id_react: { method: "POST", path: "/api/interactions/{interaction_id}/react" },
|
|
202
|
+
post_api_login_claim: { method: "POST", path: "/api/login/claim" },
|
|
203
|
+
post_api_manifest_replace: { method: "POST", path: "/api/manifest/replace" },
|
|
204
|
+
post_api_marketplace_install: { method: "POST", path: "/api/marketplace/install" },
|
|
205
|
+
post_api_marketplace_install_preview: { method: "POST", path: "/api/marketplace/install/preview" },
|
|
206
|
+
post_api_marketplace_uninstall: { method: "POST", path: "/api/marketplace/uninstall" },
|
|
207
|
+
post_api_marketplace_update: { method: "POST", path: "/api/marketplace/update" },
|
|
208
|
+
post_api_marketplace_upgrade_all: { method: "POST", path: "/api/marketplace/upgrade-all" },
|
|
209
|
+
post_api_mcp_config: { method: "POST", path: "/api/mcp-config" },
|
|
210
|
+
post_api_mcp_config_entries: { method: "POST", path: "/api/mcp-config/entries" },
|
|
211
|
+
post_api_mcp_config_secret_env: { method: "POST", path: "/api/mcp-config/secret-env" },
|
|
212
|
+
post_api_mcp_status_reload_failed: { method: "POST", path: "/api/mcp-status/reload-failed" },
|
|
213
|
+
post_api_mcp_status_title_deregister: { method: "POST", path: "/api/mcp-status/{title}/deregister" },
|
|
214
|
+
post_api_mcp_status_title_reload: { method: "POST", path: "/api/mcp-status/{title}/reload" },
|
|
215
|
+
post_api_notifications: { method: "POST", path: "/api/notifications" },
|
|
216
|
+
post_api_presets: { method: "POST", path: "/api/presets" },
|
|
217
|
+
post_api_presets_name_rename: { method: "POST", path: "/api/presets/{name}/rename" },
|
|
218
|
+
post_api_presets_name_rollback: { method: "POST", path: "/api/presets/{name}/rollback" },
|
|
219
|
+
post_api_presets_name_versions: { method: "POST", path: "/api/presets/{name}/versions" },
|
|
220
|
+
post_api_presets_validate: { method: "POST", path: "/api/presets/validate" },
|
|
221
|
+
post_api_render_template: { method: "POST", path: "/api/render-template" },
|
|
222
|
+
post_api_resources_get: { method: "POST", path: "/api/resources/get" },
|
|
223
|
+
post_api_run_tool: { method: "POST", path: "/api/run-tool" },
|
|
224
|
+
post_api_runs_prune: { method: "POST", path: "/api/runs/prune" },
|
|
225
|
+
post_api_schedules: { method: "POST", path: "/api/schedules" },
|
|
226
|
+
post_api_setup: { method: "POST", path: "/api/setup" },
|
|
227
|
+
post_api_state_pending_saves_id_retry: { method: "POST", path: "/api/state-pending-saves/{id}/retry" },
|
|
228
|
+
post_api_state_retention_prune: { method: "POST", path: "/api/state-retention/prune" },
|
|
229
|
+
post_api_states_name_records_search: { method: "POST", path: "/api/states/{name}/records/search" },
|
|
230
|
+
post_api_states_name_records_target_kind_target_name_kind_key_deltas: { method: "POST", path: "/api/states/{name}/records/{target_kind}/{target_name}/{kind}/{key}/deltas" },
|
|
231
|
+
post_api_states_name_records_target_kind_target_name_kind_key_fold: { method: "POST", path: "/api/states/{name}/records/{target_kind}/{target_name}/{kind}/{key}/fold" },
|
|
232
|
+
post_api_states_name_records_target_kind_target_name_kind_key_template_jq_program: { method: "POST", path: "/api/states/{name}/records/{target_kind}/{target_name}/{kind}/{key}/template-jq/{program}" },
|
|
233
|
+
post_api_storage_resources: { method: "POST", path: "/api/storage/resources" },
|
|
234
|
+
post_api_sub_mcp: { method: "POST", path: "/api/sub-mcp" },
|
|
235
|
+
post_api_template: { method: "POST", path: "/api/template" },
|
|
236
|
+
post_api_tool_meta_folders: { method: "POST", path: "/api/tool-meta/folders" },
|
|
237
|
+
post_api_tool_meta_folders_folder_id_move: { method: "POST", path: "/api/tool-meta/folders/{folder_id}/move" },
|
|
238
|
+
post_api_tool_meta_folders_folder_id_rename: { method: "POST", path: "/api/tool-meta/folders/{folder_id}/rename" },
|
|
239
|
+
post_api_tool_runs: { method: "POST", path: "/api/tool-runs" },
|
|
240
|
+
post_api_tools_config_entries: { method: "POST", path: "/api/tools-config/entries" },
|
|
241
|
+
post_api_tools_name_extensions: { method: "POST", path: "/api/tools/{name}/extensions" },
|
|
242
|
+
post_api_tools_name_extensions_combos: { method: "POST", path: "/api/tools/{name}/extensions/combos" },
|
|
243
|
+
post_api_tools_reload: { method: "POST", path: "/api/tools/reload" },
|
|
244
|
+
post_api_tools_remove: { method: "POST", path: "/api/tools/remove" },
|
|
245
|
+
post_api_upload_template: { method: "POST", path: "/api/upload-template" },
|
|
246
|
+
put_api_auth_api_keys_user_id: { method: "PUT", path: "/api/auth/api-keys/{user_id}" },
|
|
247
|
+
put_api_auth_principals_user_id: { method: "PUT", path: "/api/auth/principals/{user_id}" },
|
|
248
|
+
put_api_auth_roles_name: { method: "PUT", path: "/api/auth/roles/{name}" },
|
|
249
|
+
put_api_config_profiles_name: { method: "PUT", path: "/api/config/profiles/{name}" },
|
|
250
|
+
put_api_connectors_providers_provider_id_client: { method: "PUT", path: "/api/connectors/providers/{provider_id}/client" },
|
|
251
|
+
put_api_conversation_configs_target_kind_target_name: { method: "PUT", path: "/api/conversation-configs/{target_kind}/{target_name}" },
|
|
252
|
+
put_api_conversations_persons_person_id_locale: { method: "PUT", path: "/api/conversations/persons/{person_id}/locale" },
|
|
253
|
+
put_api_conversations_route_name_thread_mode: { method: "PUT", path: "/api/conversations/{route_name}/thread/mode" },
|
|
254
|
+
put_api_hooks_topics_topic_verifier: { method: "PUT", path: "/api/hooks/topics/{topic}/verifier" },
|
|
255
|
+
put_api_presets_name_versions_version_tags: { method: "PUT", path: "/api/presets/{name}/versions/{version}/tags" },
|
|
256
|
+
put_api_state_templates_name: { method: "PUT", path: "/api/state-templates/{name}" },
|
|
257
|
+
put_api_states_name: { method: "PUT", path: "/api/states/{name}" },
|
|
258
|
+
put_api_states_name_attachments_template: { method: "PUT", path: "/api/states/{name}/attachments/{template}" },
|
|
259
|
+
put_api_states_name_records_target_kind_target_name_kind_key: { method: "PUT", path: "/api/states/{name}/records/{target_kind}/{target_name}/{kind}/{key}" },
|
|
260
|
+
} as const;
|
|
261
|
+
|
|
262
|
+
export type ApiOperationId = keyof typeof apiRoutes;
|
|
263
|
+
export type ApiPathTemplate = (typeof apiRoutes)[ApiOperationId]['path'];
|
|
264
|
+
|
|
265
|
+
/** Every `/`-boundary proper prefix of a route template that is not itself a template. */
|
|
266
|
+
export const apiPathPrefixes = [
|
|
267
|
+
"/api",
|
|
268
|
+
"/api/agents-config",
|
|
269
|
+
"/api/agents/authored",
|
|
270
|
+
"/api/agents/authored/{name}",
|
|
271
|
+
"/api/agents/{name}",
|
|
272
|
+
"/api/auth",
|
|
273
|
+
"/api/auth/api-keys/{user_id}/policy",
|
|
274
|
+
"/api/backup",
|
|
275
|
+
"/api/checkpoints",
|
|
276
|
+
"/api/config",
|
|
277
|
+
"/api/connectors",
|
|
278
|
+
"/api/connectors/oauth",
|
|
279
|
+
"/api/connectors/tokens",
|
|
280
|
+
"/api/conversation-configs/{target_kind}",
|
|
281
|
+
"/api/conversations/messages",
|
|
282
|
+
"/api/conversations/persons",
|
|
283
|
+
"/api/fleet",
|
|
284
|
+
"/api/hooks/topics",
|
|
285
|
+
"/api/hooks/topics/{topic}",
|
|
286
|
+
"/api/interactions/callback",
|
|
287
|
+
"/api/interactions/media",
|
|
288
|
+
"/api/interactions/{interaction_id}",
|
|
289
|
+
"/api/login",
|
|
290
|
+
"/api/marketplace",
|
|
291
|
+
"/api/marketplace/plugins",
|
|
292
|
+
"/api/marketplace/plugins/{ns}",
|
|
293
|
+
"/api/mcp-status/{title}",
|
|
294
|
+
"/api/observability",
|
|
295
|
+
"/api/observability/runs/{trace_id}",
|
|
296
|
+
"/api/observability/runs/{trace_id}/spans",
|
|
297
|
+
"/api/observability/runs/{trace_id}/spans/{span_id}",
|
|
298
|
+
"/api/plugins/{name}",
|
|
299
|
+
"/api/plugins/{name}/studio",
|
|
300
|
+
"/api/resources",
|
|
301
|
+
"/api/state-retention",
|
|
302
|
+
"/api/states/{name}/records",
|
|
303
|
+
"/api/states/{name}/records/{target_kind}",
|
|
304
|
+
"/api/states/{name}/records/{target_kind}/{target_name}",
|
|
305
|
+
"/api/states/{name}/records/{target_kind}/{target_name}/{kind}",
|
|
306
|
+
"/api/states/{name}/records/{target_kind}/{target_name}/{kind}/{key}/template-jq",
|
|
307
|
+
"/api/storage/dirs",
|
|
308
|
+
"/api/system",
|
|
309
|
+
"/api/tool-meta/tools",
|
|
310
|
+
"/api/tools-config",
|
|
311
|
+
"/api/tools/{name}",
|
|
312
|
+
"/api/tools/{tool_name}"
|
|
313
|
+
] as const;
|
|
314
|
+
export type ApiPathPrefix = (typeof apiPathPrefixes)[number];
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* `template` with each `{name}` replaced by the encoded `params[name]`. A `{name:path}`
|
|
318
|
+
* placeholder keeps the `/` separators of its value, each part encoded. A missing
|
|
319
|
+
* parameter throws.
|
|
320
|
+
*/
|
|
321
|
+
export function buildPath(template: ApiPathTemplate, params: Record<string, string>): string {
|
|
322
|
+
return template.replace(/\{([^}:]+)(:path)?\}/g, (_match, name: string, multi?: string) => {
|
|
323
|
+
const value = params[name];
|
|
324
|
+
if (value === undefined) throw new Error(`buildPath: missing param ${name} for ${template}`);
|
|
325
|
+
return multi ? value.split('/').map(encodeSegment).join('/') : encodeSegment(value);
|
|
326
|
+
});
|
|
327
|
+
}
|