@tai42/api-client 16.0.1 → 17.1.1
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/dist/agents.d.ts.map +1 -1
- package/dist/agents.js +1 -1
- package/dist/agents.js.map +1 -1
- package/dist/client/auth-client.d.ts +44 -2
- package/dist/client/auth-client.d.ts.map +1 -1
- package/dist/client/auth-client.js +15 -1
- package/dist/client/auth-client.js.map +1 -1
- package/dist/client/backup-client.js +1 -1
- package/dist/client/backup-client.js.map +1 -1
- package/dist/client/capabilities-client.d.ts +5 -0
- package/dist/client/capabilities-client.d.ts.map +1 -1
- package/dist/client/connectors-client.js +1 -1
- package/dist/client/connectors-client.js.map +1 -1
- package/dist/client/conversations-client.d.ts +20 -8
- package/dist/client/conversations-client.d.ts.map +1 -1
- package/dist/client/conversations-client.js +1 -1
- package/dist/client/conversations-client.js.map +1 -1
- package/dist/client/hooks-client.d.ts +1 -2
- package/dist/client/hooks-client.d.ts.map +1 -1
- package/dist/client/hooks-client.js +1 -1
- package/dist/client/hooks-client.js.map +1 -1
- package/dist/client/index.d.ts +91 -19
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/interactions-client.js +1 -1
- package/dist/client/interactions-client.js.map +1 -1
- package/dist/client/login-client.d.ts +15 -2
- package/dist/client/login-client.d.ts.map +1 -1
- package/dist/client/login-client.js +38 -4
- package/dist/client/login-client.js.map +1 -1
- package/dist/client/manifest-client.js +1 -1
- package/dist/client/manifest-client.js.map +1 -1
- package/dist/client/marketplace-client.js +1 -1
- package/dist/client/marketplace-client.js.map +1 -1
- package/dist/client/observability-client.js +1 -1
- package/dist/client/observability-client.js.map +1 -1
- package/dist/client/policy-client.js +1 -1
- package/dist/client/policy-client.js.map +1 -1
- package/dist/client/presets-client.d.ts +0 -1
- package/dist/client/presets-client.d.ts.map +1 -1
- package/dist/client/presets-client.js +1 -1
- package/dist/client/presets-client.js.map +1 -1
- package/dist/client/profiles-client.d.ts +0 -1
- package/dist/client/profiles-client.d.ts.map +1 -1
- package/dist/client/profiles-client.js +1 -1
- package/dist/client/profiles-client.js.map +1 -1
- package/dist/client/schedules-client.d.ts +0 -1
- package/dist/client/schedules-client.d.ts.map +1 -1
- package/dist/client/schedules-client.js +1 -1
- package/dist/client/schedules-client.js.map +1 -1
- package/dist/client/states-client.d.ts +0 -1
- package/dist/client/states-client.d.ts.map +1 -1
- package/dist/client/states-client.js +1 -1
- package/dist/client/states-client.js.map +1 -1
- package/dist/client/storage-client.js +1 -1
- package/dist/client/storage-client.js.map +1 -1
- package/dist/client/sub-mcp-client.js +1 -1
- package/dist/client/sub-mcp-client.js.map +1 -1
- package/dist/client/system-client.js +1 -1
- package/dist/client/system-client.js.map +1 -1
- package/dist/client/tool-extensions-client.d.ts +0 -1
- package/dist/client/tool-extensions-client.d.ts.map +1 -1
- package/dist/client/tool-extensions-client.js +1 -1
- package/dist/client/tool-extensions-client.js.map +1 -1
- package/dist/client/tool-meta-client.js +1 -1
- package/dist/client/tool-meta-client.js.map +1 -1
- package/dist/client/tools-client.d.ts +2 -2
- package/dist/client/tools-client.js +1 -1
- package/dist/client/tools-client.js.map +1 -1
- package/dist/client/trigger-links-client.d.ts +1 -1
- package/dist/client/trigger-links-client.js +1 -1
- package/dist/client/trigger-links-client.js.map +1 -1
- package/dist/client/web-entry-gate-client.js +1 -1
- package/dist/client/web-entry-gate-client.js.map +1 -1
- package/dist/errors.d.ts +11 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +15 -0
- package/dist/errors.js.map +1 -1
- package/dist/generated/served-schemas.d.ts +34 -0
- package/dist/generated/served-schemas.d.ts.map +1 -1
- package/dist/generated/served-schemas.js +3 -2
- package/dist/generated/served-schemas.js.map +1 -1
- package/dist/index.d.ts +12 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -13
- package/dist/index.js.map +1 -1
- package/dist/schemas/api-keys.d.ts +9 -0
- package/dist/schemas/api-keys.d.ts.map +1 -1
- package/dist/schemas/api-keys.js +7 -0
- package/dist/schemas/api-keys.js.map +1 -1
- package/dist/schemas/auth-routes.d.ts +3 -3
- package/dist/schemas/backup.d.ts.map +1 -1
- package/dist/schemas/backup.js.map +1 -1
- package/dist/schemas/capabilities.d.ts +14 -4
- package/dist/schemas/capabilities.d.ts.map +1 -1
- package/dist/schemas/capabilities.js +8 -4
- package/dist/schemas/capabilities.js.map +1 -1
- package/dist/schemas/connectors.d.ts.map +1 -1
- package/dist/schemas/connectors.js.map +1 -1
- package/dist/schemas/conversations.d.ts +58 -4
- package/dist/schemas/conversations.d.ts.map +1 -1
- package/dist/schemas/conversations.js +18 -5
- package/dist/schemas/conversations.js.map +1 -1
- package/dist/schemas/fleet.d.ts.map +1 -1
- package/dist/schemas/fleet.js.map +1 -1
- package/dist/schemas/hooks.d.ts +2 -2
- package/dist/schemas/hooks.d.ts.map +1 -1
- package/dist/schemas/hooks.js.map +1 -1
- package/dist/schemas/index.d.ts +30 -28
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +30 -28
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/interactions.d.ts.map +1 -1
- package/dist/schemas/interactions.js.map +1 -1
- package/dist/schemas/login.d.ts +12 -5
- package/dist/schemas/login.d.ts.map +1 -1
- package/dist/schemas/login.js +11 -4
- package/dist/schemas/login.js.map +1 -1
- package/dist/schemas/manifest-mcp.d.ts.map +1 -1
- package/dist/schemas/manifest-mcp.js.map +1 -1
- package/dist/schemas/notifications.d.ts.map +1 -1
- package/dist/schemas/notifications.js.map +1 -1
- package/dist/schemas/observability.d.ts.map +1 -1
- package/dist/schemas/observability.js.map +1 -1
- package/dist/schemas/policy.d.ts.map +1 -1
- package/dist/schemas/policy.js.map +1 -1
- package/dist/schemas/presets.d.ts.map +1 -1
- package/dist/schemas/presets.js.map +1 -1
- package/dist/schemas/principals.d.ts +54 -0
- package/dist/schemas/principals.d.ts.map +1 -0
- package/dist/schemas/principals.js +34 -0
- package/dist/schemas/principals.js.map +1 -0
- package/dist/schemas/profiles.d.ts.map +1 -1
- package/dist/schemas/profiles.js.map +1 -1
- package/dist/schemas/roles.d.ts.map +1 -1
- package/dist/schemas/roles.js.map +1 -1
- package/dist/schemas/schedules.d.ts.map +1 -1
- package/dist/schemas/schedules.js.map +1 -1
- package/dist/schemas/served.d.ts +23 -1
- package/dist/schemas/served.d.ts.map +1 -1
- package/dist/schemas/served.js +1 -1
- package/dist/schemas/served.js.map +1 -1
- package/dist/schemas/settings-schema.d.ts.map +1 -1
- package/dist/schemas/settings-schema.js.map +1 -1
- package/dist/schemas/setup.d.ts +43 -0
- package/dist/schemas/setup.d.ts.map +1 -0
- package/dist/schemas/setup.js +19 -0
- package/dist/schemas/setup.js.map +1 -0
- package/dist/schemas/states.d.ts.map +1 -1
- package/dist/schemas/states.js.map +1 -1
- package/dist/schemas/system-kinds.d.ts.map +1 -1
- package/dist/schemas/system-kinds.js.map +1 -1
- package/dist/schemas/templates.d.ts.map +1 -1
- package/dist/schemas/templates.js.map +1 -1
- package/dist/schemas/tools.d.ts.map +1 -1
- package/dist/schemas/tools.js.map +1 -1
- package/dist/schemas/trigger-links.d.ts +2 -2
- package/dist/schemas/trigger-links.d.ts.map +1 -1
- package/dist/schemas/trigger-links.js.map +1 -1
- package/dist/tool-runs.d.ts +4 -4
- package/dist/tool-runs.d.ts.map +1 -1
- package/dist/tool-runs.js.map +1 -1
- package/package.json +1 -1
- package/src/agents.ts +2 -2
- package/src/client/auth-client.ts +27 -1
- package/src/client/backup-client.ts +1 -1
- package/src/client/connectors-client.ts +1 -1
- package/src/client/conversations-client.ts +1 -1
- package/src/client/hooks-client.ts +1 -1
- package/src/client/index.ts +10 -10
- package/src/client/interactions-client.ts +1 -1
- package/src/client/login-client.ts +45 -4
- package/src/client/manifest-client.ts +1 -1
- package/src/client/marketplace-client.ts +1 -1
- package/src/client/observability-client.ts +1 -1
- package/src/client/policy-client.ts +1 -1
- package/src/client/presets-client.ts +1 -1
- package/src/client/profiles-client.ts +1 -1
- package/src/client/schedules-client.ts +1 -1
- package/src/client/states-client.ts +1 -1
- package/src/client/storage-client.ts +1 -1
- package/src/client/sub-mcp-client.ts +1 -1
- package/src/client/system-client.ts +1 -1
- package/src/client/tool-extensions-client.ts +1 -1
- package/src/client/tool-meta-client.ts +1 -1
- package/src/client/tools-client.ts +1 -1
- package/src/client/trigger-links-client.ts +1 -1
- package/src/client/web-entry-gate-client.ts +1 -1
- package/src/errors.ts +16 -0
- package/src/generated/served-schemas.ts +5 -2
- package/src/index.ts +231 -226
- package/src/schemas/api-keys.ts +8 -0
- package/src/schemas/backup.ts +1 -0
- package/src/schemas/capabilities.ts +9 -4
- package/src/schemas/connectors.ts +1 -0
- package/src/schemas/conversations.ts +19 -5
- package/src/schemas/fleet.ts +1 -0
- package/src/schemas/hooks.ts +1 -0
- package/src/schemas/index.ts +30 -28
- package/src/schemas/interactions.ts +1 -0
- package/src/schemas/login.ts +11 -4
- package/src/schemas/manifest-mcp.ts +1 -0
- package/src/schemas/notifications.ts +1 -0
- package/src/schemas/observability.ts +1 -0
- package/src/schemas/policy.ts +1 -0
- package/src/schemas/presets.ts +1 -0
- package/src/schemas/principals.ts +41 -0
- package/src/schemas/profiles.ts +1 -0
- package/src/schemas/roles.ts +1 -0
- package/src/schemas/schedules.ts +1 -0
- package/src/schemas/served.ts +2 -1
- package/src/schemas/settings-schema.ts +1 -0
- package/src/schemas/setup.ts +39 -0
- package/src/schemas/states.ts +1 -0
- package/src/schemas/system-kinds.ts +1 -0
- package/src/schemas/templates.ts +1 -0
- package/src/schemas/tools.ts +1 -0
- package/src/schemas/trigger-links.ts +1 -0
- package/src/tool-runs.ts +1 -1
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
/** Public sign-in aggregator and session-logout sub-clients. */
|
|
2
|
+
import {
|
|
3
|
+
ApiError,
|
|
4
|
+
ApiLoginFailedError,
|
|
5
|
+
ApiSetupFailedError,
|
|
6
|
+
ApiUnauthorizedError,
|
|
7
|
+
} from '../errors';
|
|
2
8
|
import * as s from '../schemas';
|
|
3
|
-
import { ApiError, ApiLoginFailedError, ApiUnauthorizedError } from '../errors';
|
|
4
9
|
import type { Transport } from './transport';
|
|
5
10
|
|
|
6
11
|
/**
|
|
@@ -22,9 +27,9 @@ export function isSafeApiPath(path: string): boolean {
|
|
|
22
27
|
*
|
|
23
28
|
* A transport 401 arrives as `ApiUnauthorizedError` before any body is read, so
|
|
24
29
|
* its message is generic by construction; the domain 4xx statuses carry the
|
|
25
|
-
* server's informative envelope text (rate-limit,
|
|
26
|
-
*
|
|
27
|
-
*
|
|
30
|
+
* server's informative envelope text (rate-limit, password-policy, or the claim
|
|
31
|
+
* exchange's uniform "unknown or already used" 404) straight through to the
|
|
32
|
+
* inline surface.
|
|
28
33
|
*/
|
|
29
34
|
function asLoginError(error: unknown): never {
|
|
30
35
|
if (error instanceof ApiUnauthorizedError) {
|
|
@@ -44,6 +49,29 @@ function asLoginError(error: unknown): never {
|
|
|
44
49
|
throw error;
|
|
45
50
|
}
|
|
46
51
|
|
|
52
|
+
/**
|
|
53
|
+
* Map a transport error from the setup submission onto an `ApiSetupFailedError`
|
|
54
|
+
* (rendered inline on the setup entry, keyed on `status`) or rethrow it unchanged
|
|
55
|
+
* (schema drift, network, any other status — the generic failure branch surfaces
|
|
56
|
+
* it loudly). The mapped statuses are the setup door's own: 403/429 (a bad or
|
|
57
|
+
* throttled token — no oracle), 409 (already initialized), 501 (setup
|
|
58
|
+
* unsupported), and 400/422 (an invalid body).
|
|
59
|
+
*/
|
|
60
|
+
function asSetupError(error: unknown): never {
|
|
61
|
+
if (
|
|
62
|
+
error instanceof ApiError &&
|
|
63
|
+
(error.status === 400 ||
|
|
64
|
+
error.status === 403 ||
|
|
65
|
+
error.status === 409 ||
|
|
66
|
+
error.status === 422 ||
|
|
67
|
+
error.status === 429 ||
|
|
68
|
+
error.status === 501)
|
|
69
|
+
) {
|
|
70
|
+
throw new ApiSetupFailedError(error.message, error.status);
|
|
71
|
+
}
|
|
72
|
+
throw error;
|
|
73
|
+
}
|
|
74
|
+
|
|
47
75
|
export function loginClient(t: Transport) {
|
|
48
76
|
const { req } = t;
|
|
49
77
|
return {
|
|
@@ -93,6 +121,19 @@ export function loginClient(t: Transport) {
|
|
|
93
121
|
return asLoginError(error);
|
|
94
122
|
}
|
|
95
123
|
},
|
|
124
|
+
// Initialize the deployment: create the owner principal, mint the owner's
|
|
125
|
+
// first key (returned once), and optionally attach the owner's login. PUBLIC
|
|
126
|
+
// (anonymous — no credential exists yet). A refused/throttled token, an
|
|
127
|
+
// already-initialized deployment, an unsupported setup door, or an invalid
|
|
128
|
+
// body becomes an inline `ApiSetupFailedError`; any other failure rethrows
|
|
129
|
+
// loudly.
|
|
130
|
+
submitSetup: async (body: s.SetupBody) => {
|
|
131
|
+
try {
|
|
132
|
+
return await req('/api/setup', s.setupResult, { method: 'POST', body });
|
|
133
|
+
} catch (error) {
|
|
134
|
+
return asSetupError(error);
|
|
135
|
+
}
|
|
136
|
+
},
|
|
96
137
|
};
|
|
97
138
|
}
|
|
98
139
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Run metrics, listing, trace and export sub-client. */
|
|
2
|
-
import * as s from '../schemas';
|
|
3
2
|
import { apiDownload, encodeSegment, type RequestOptions } from '../http';
|
|
3
|
+
import * as s from '../schemas';
|
|
4
4
|
import type { Transport } from './transport';
|
|
5
5
|
|
|
6
6
|
/** The observability-metrics window + bucket size (GET query params). */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Settings-profile CRUD, versioning and apply sub-client. */
|
|
2
|
-
import * as s from '../schemas';
|
|
3
2
|
import { encodeSegment } from '../http';
|
|
3
|
+
import * as s from '../schemas';
|
|
4
4
|
import type { Transport } from './transport';
|
|
5
5
|
|
|
6
6
|
export function profilesClient(t: Transport) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Tool extension listing and authoring sub-client. */
|
|
2
|
-
import * as s from '../schemas';
|
|
3
2
|
import { encodeSegment } from '../http';
|
|
3
|
+
import * as s from '../schemas';
|
|
4
4
|
import type { Transport } from './transport';
|
|
5
5
|
|
|
6
6
|
export function toolExtensionsClient(t: Transport) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Tool catalog, run, live-registry admin and tag sub-client. */
|
|
2
|
-
import * as s from '../schemas';
|
|
3
2
|
import { encodeSegment } from '../http';
|
|
3
|
+
import * as s from '../schemas';
|
|
4
4
|
import { getToolRun, listToolRuns, submitToolRun, type SubmitToolRunArgs } from '../tool-runs';
|
|
5
5
|
import type { Transport } from './transport';
|
|
6
6
|
|
package/src/errors.ts
CHANGED
|
@@ -71,6 +71,22 @@ export class ApiLoginFailedError extends Error {
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
/**
|
|
75
|
+
* A setup attempt was REJECTED — a bad or throttled token (403/429), an
|
|
76
|
+
* already-initialized deployment (409), an unsupported setup door (501), or an
|
|
77
|
+
* invalid body (400/422). Like {@link ApiLoginFailedError} it is NOT an
|
|
78
|
+
* ApiUnauthorizedError: it renders inline on the setup entry, keyed on `status`
|
|
79
|
+
* so the page shows the right copy, never a global unauthorized redirect.
|
|
80
|
+
*/
|
|
81
|
+
export class ApiSetupFailedError extends Error {
|
|
82
|
+
readonly status: number;
|
|
83
|
+
constructor(message: string, status: number) {
|
|
84
|
+
super(message);
|
|
85
|
+
this.name = 'ApiSetupFailedError';
|
|
86
|
+
this.status = status;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
74
90
|
/**
|
|
75
91
|
* The response body did not match its declared zod schema. This is a contract
|
|
76
92
|
* drift between the Studio and the skeleton — a loud, visible error, never a
|
|
@@ -18,6 +18,9 @@ export type MediaKind = z.infer<typeof mediaKind>;
|
|
|
18
18
|
export const mediaItem = z.object({ "caption": z.union([z.string(), z.null()]).default(null), "filename": z.union([z.string(), z.null()]).default(null), "kind": mediaKind, "url": z.string() });
|
|
19
19
|
export type MediaItem = z.infer<typeof mediaItem>;
|
|
20
20
|
|
|
21
|
+
export const overlapPolicy = z.object({ "deliver": z.enum(["one","all"]).default("one"), "running": z.enum(["continue","cancel"]).default("continue"), "settle_seconds": z.number().int().gte(0).lte(30).default(0) });
|
|
22
|
+
export type OverlapPolicy = z.infer<typeof overlapPolicy>;
|
|
23
|
+
|
|
21
24
|
export const presetSeedToolMeta = z.object({ "display_name": z.union([z.string(), z.null()]).default(null), "folder_path": z.union([z.string(), z.null()]).default(null), "tags": z.union([z.array(z.string()), z.null()]).default(null) });
|
|
22
25
|
export type PresetSeedToolMeta = z.infer<typeof presetSeedToolMeta>;
|
|
23
26
|
|
|
@@ -95,10 +98,10 @@ export const channelTemplate = z.object({ "body_parameters": z.array(z.string())
|
|
|
95
98
|
})).default([]), "header_media": z.union([mediaItem, z.null()]).default(null), "language": z.string(), "name": z.string() });
|
|
96
99
|
export type ChannelTemplate = z.infer<typeof channelTemplate>;
|
|
97
100
|
|
|
98
|
-
export const conversationRoute = z.object({ "callback_secret": z.union([z.string(), z.null()]).default(null), "callback_url": z.union([z.string(), z.null()]).default(null), "channel": z.union([z.string(), z.null()]).default(null), "door": z.enum(["api","channel"]), "error_reply_text": z.union([z.string().min(1).max(2000), z.null()]).default(null), "execution_key": z.string().min(1), "execution_key_fingerprint": z.string().min(1), "initial_mode": z.enum(["agent","manual"]).default("agent"), "locale": z.union([z.string(), z.null()]).default(null), "our_identity": z.union([z.string(), z.null()]).default(null), "payload_expr": z.union([templatedText, z.null()]).default(null), "reply_expr": z.union([templatedText, z.null()]).default(null), "route_name": z.string(), "target_kind": z.enum(["agent","tool"]), "target_name": z.string().min(1), "turns_per_hour_override": z.union([z.number().int().gt(0), z.null()]).default(null) });
|
|
101
|
+
export const conversationRoute = z.object({ "callback_secret": z.union([z.string(), z.null()]).default(null), "callback_url": z.union([z.string(), z.null()]).default(null), "channel": z.union([z.string(), z.null()]).default(null), "door": z.enum(["api","channel"]), "error_reply_text": z.union([z.string().min(1).max(2000), z.null()]).default(null), "execution_key": z.string().min(1), "execution_key_fingerprint": z.string().min(1), "initial_mode": z.enum(["agent","manual"]).default("agent"), "locale": z.union([z.string(), z.null()]).default(null), "our_identity": z.union([z.string(), z.null()]).default(null), "overlap": overlapPolicy.default({"deliver":"one","running":"continue","settle_seconds":0}), "payload_expr": z.union([templatedText, z.null()]).default(null), "reply_expr": z.union([templatedText, z.null()]).default(null), "route_name": z.string(), "target_kind": z.enum(["agent","tool"]), "target_name": z.string().min(1), "turns_per_hour_override": z.union([z.number().int().gt(0), z.null()]).default(null) });
|
|
99
102
|
export type ConversationRoute = z.infer<typeof conversationRoute>;
|
|
100
103
|
|
|
101
|
-
export const conversationRouteCreate = z.object({ "callback_url": z.union([z.string(), z.null()]).default(null), "channel": z.union([z.string(), z.null()]).default(null), "door": z.enum(["api","channel"]), "error_reply_text": z.union([z.string().min(1).max(2000), z.null()]).default(null), "execution_key": z.string().min(1), "initial_mode": z.enum(["agent","manual"]).default("agent"), "locale": z.union([z.string(), z.null()]).default(null), "our_identity": z.union([z.string(), z.null()]).default(null), "payload_expr": z.union([templatedText, z.null()]).default(null), "reply_expr": z.union([templatedText, z.null()]).default(null), "route_name": z.string(), "target_kind": z.enum(["agent","tool"]), "target_name": z.string().min(1), "turns_per_hour_override": z.union([z.number().int().gt(0), z.null()]).default(null) });
|
|
104
|
+
export const conversationRouteCreate = z.object({ "callback_url": z.union([z.string(), z.null()]).default(null), "channel": z.union([z.string(), z.null()]).default(null), "door": z.enum(["api","channel"]), "error_reply_text": z.union([z.string().min(1).max(2000), z.null()]).default(null), "execution_key": z.string().min(1), "initial_mode": z.enum(["agent","manual"]).default("agent"), "locale": z.union([z.string(), z.null()]).default(null), "our_identity": z.union([z.string(), z.null()]).default(null), "overlap": overlapPolicy.default({"deliver":"one","running":"continue","settle_seconds":0}), "payload_expr": z.union([templatedText, z.null()]).default(null), "reply_expr": z.union([templatedText, z.null()]).default(null), "route_name": z.string(), "target_kind": z.enum(["agent","tool"]), "target_name": z.string().min(1), "turns_per_hour_override": z.union([z.number().int().gt(0), z.null()]).default(null) });
|
|
102
105
|
export type ConversationRouteCreate = z.infer<typeof conversationRouteCreate>;
|
|
103
106
|
|
|
104
107
|
export const hookParams = z.object({ "condition": z.union([templatedText, z.null()]).default(null), "execution_key": z.string().min(1), "execution_key_fingerprint": z.string().min(1), "expr": z.union([templatedText, z.null()]).default(null), "name": z.string().min(1), "state_binding": z.union([stateBinding, z.null()]).default(null), "subject": z.union([hookSubject, z.null()]).default(null), "tool": z.string().min(1), "tool_kwargs": z.record(z.string(), z.unknown()).default({}), "topic": z.string().min(1) });
|