terse-types 0.0.24 → 0.0.25
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/ApiRouteBuilder.d.ts +3 -0
- package/dist/ApiRoutes.json +4 -1
- package/dist/Billing.d.ts +403 -0
- package/dist/Billing.js +227 -0
- package/dist/BillingRoutes.json +13 -0
- package/dist/FrontendRoutes.json +2 -1
- package/dist/FrontendRoutesBuilder.d.ts +1 -0
- package/dist/ModelEvents.d.ts +102 -0
- package/dist/ModelEvents.js +19 -2
- package/dist/ModelRegistry.d.ts +16 -0
- package/dist/ModelRegistry.js +18 -0
- package/dist/OrganizationMetadata.d.ts +10 -0
- package/dist/OrganizationMetadata.js +6 -0
- package/dist/types.d.ts +1500 -1
- package/dist/types.js +39 -2
- package/package.json +1 -1
package/dist/ModelEvents.d.ts
CHANGED
|
@@ -195,6 +195,34 @@ export declare const imageSchema: z.ZodObject<{
|
|
|
195
195
|
type: z.ZodLiteral<"image">;
|
|
196
196
|
url: z.ZodString;
|
|
197
197
|
}, z.core.$strip>;
|
|
198
|
+
export declare const webhookFailureStageSchema: z.ZodEnum<{
|
|
199
|
+
handshake: "handshake";
|
|
200
|
+
delivery: "delivery";
|
|
201
|
+
}>;
|
|
202
|
+
export type WebhookFailureStage = z.infer<typeof webhookFailureStageSchema>;
|
|
203
|
+
/**
|
|
204
|
+
* Surfaced in the run history drawer when a self-hosted SDK job fails to reach (or be accepted by)
|
|
205
|
+
* the customer's webhook server. Persisted as a snippet so the failure is visible in the timeline
|
|
206
|
+
* alongside other run events; the run row itself is still marked FAILED.
|
|
207
|
+
*/
|
|
208
|
+
export declare const webhookFailureSchema: z.ZodObject<{
|
|
209
|
+
type: z.ZodLiteral<"webhook_failure">;
|
|
210
|
+
stage: z.ZodEnum<{
|
|
211
|
+
handshake: "handshake";
|
|
212
|
+
delivery: "delivery";
|
|
213
|
+
}>;
|
|
214
|
+
message: z.ZodString;
|
|
215
|
+
triggerUrl: z.ZodString;
|
|
216
|
+
step: z.ZodOptional<z.ZodEnum<{
|
|
217
|
+
json: "json";
|
|
218
|
+
http: "http";
|
|
219
|
+
response_schema: "response_schema";
|
|
220
|
+
challenge_echo: "challenge_echo";
|
|
221
|
+
challenge_signature: "challenge_signature";
|
|
222
|
+
}>>;
|
|
223
|
+
httpStatus: z.ZodOptional<z.ZodNumber>;
|
|
224
|
+
bodySnippet: z.ZodOptional<z.ZodString>;
|
|
225
|
+
}, z.core.$strip>;
|
|
198
226
|
export declare const snippetVariantSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
199
227
|
type: z.ZodLiteral<"button">;
|
|
200
228
|
label: z.ZodString;
|
|
@@ -219,6 +247,23 @@ export declare const snippetVariantSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
|
|
|
219
247
|
}, z.core.$strip>, z.ZodObject<{
|
|
220
248
|
type: z.ZodLiteral<"image">;
|
|
221
249
|
url: z.ZodString;
|
|
250
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
251
|
+
type: z.ZodLiteral<"webhook_failure">;
|
|
252
|
+
stage: z.ZodEnum<{
|
|
253
|
+
handshake: "handshake";
|
|
254
|
+
delivery: "delivery";
|
|
255
|
+
}>;
|
|
256
|
+
message: z.ZodString;
|
|
257
|
+
triggerUrl: z.ZodString;
|
|
258
|
+
step: z.ZodOptional<z.ZodEnum<{
|
|
259
|
+
json: "json";
|
|
260
|
+
http: "http";
|
|
261
|
+
response_schema: "response_schema";
|
|
262
|
+
challenge_echo: "challenge_echo";
|
|
263
|
+
challenge_signature: "challenge_signature";
|
|
264
|
+
}>>;
|
|
265
|
+
httpStatus: z.ZodOptional<z.ZodNumber>;
|
|
266
|
+
bodySnippet: z.ZodOptional<z.ZodString>;
|
|
222
267
|
}, z.core.$strip>], "type">;
|
|
223
268
|
export type SnippetVariant = z.infer<typeof snippetVariantSchema>;
|
|
224
269
|
export declare const chatSnippetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -255,6 +300,25 @@ export declare const chatSnippetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
255
300
|
url: z.ZodString;
|
|
256
301
|
id: z.ZodOptional<z.ZodString>;
|
|
257
302
|
selectedValue: z.ZodOptional<z.ZodString>;
|
|
303
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
304
|
+
type: z.ZodLiteral<"webhook_failure">;
|
|
305
|
+
stage: z.ZodEnum<{
|
|
306
|
+
handshake: "handshake";
|
|
307
|
+
delivery: "delivery";
|
|
308
|
+
}>;
|
|
309
|
+
message: z.ZodString;
|
|
310
|
+
triggerUrl: z.ZodString;
|
|
311
|
+
step: z.ZodOptional<z.ZodEnum<{
|
|
312
|
+
json: "json";
|
|
313
|
+
http: "http";
|
|
314
|
+
response_schema: "response_schema";
|
|
315
|
+
challenge_echo: "challenge_echo";
|
|
316
|
+
challenge_signature: "challenge_signature";
|
|
317
|
+
}>>;
|
|
318
|
+
httpStatus: z.ZodOptional<z.ZodNumber>;
|
|
319
|
+
bodySnippet: z.ZodOptional<z.ZodString>;
|
|
320
|
+
id: z.ZodOptional<z.ZodString>;
|
|
321
|
+
selectedValue: z.ZodOptional<z.ZodString>;
|
|
258
322
|
}, z.core.$strip>], "type">;
|
|
259
323
|
export type ChatSnippet = z.infer<typeof chatSnippetSchema>;
|
|
260
324
|
export declare const modelEventChatSnippetSchema: z.ZodObject<{
|
|
@@ -296,6 +360,25 @@ export declare const modelEventChatSnippetSchema: z.ZodObject<{
|
|
|
296
360
|
url: z.ZodString;
|
|
297
361
|
id: z.ZodOptional<z.ZodString>;
|
|
298
362
|
selectedValue: z.ZodOptional<z.ZodString>;
|
|
363
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
364
|
+
type: z.ZodLiteral<"webhook_failure">;
|
|
365
|
+
stage: z.ZodEnum<{
|
|
366
|
+
handshake: "handshake";
|
|
367
|
+
delivery: "delivery";
|
|
368
|
+
}>;
|
|
369
|
+
message: z.ZodString;
|
|
370
|
+
triggerUrl: z.ZodString;
|
|
371
|
+
step: z.ZodOptional<z.ZodEnum<{
|
|
372
|
+
json: "json";
|
|
373
|
+
http: "http";
|
|
374
|
+
response_schema: "response_schema";
|
|
375
|
+
challenge_echo: "challenge_echo";
|
|
376
|
+
challenge_signature: "challenge_signature";
|
|
377
|
+
}>>;
|
|
378
|
+
httpStatus: z.ZodOptional<z.ZodNumber>;
|
|
379
|
+
bodySnippet: z.ZodOptional<z.ZodString>;
|
|
380
|
+
id: z.ZodOptional<z.ZodString>;
|
|
381
|
+
selectedValue: z.ZodOptional<z.ZodString>;
|
|
299
382
|
}, z.core.$strip>], "type">;
|
|
300
383
|
}, z.core.$strip>;
|
|
301
384
|
export declare const modelEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -421,6 +504,25 @@ export declare const modelEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
421
504
|
url: z.ZodString;
|
|
422
505
|
id: z.ZodOptional<z.ZodString>;
|
|
423
506
|
selectedValue: z.ZodOptional<z.ZodString>;
|
|
507
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
508
|
+
type: z.ZodLiteral<"webhook_failure">;
|
|
509
|
+
stage: z.ZodEnum<{
|
|
510
|
+
handshake: "handshake";
|
|
511
|
+
delivery: "delivery";
|
|
512
|
+
}>;
|
|
513
|
+
message: z.ZodString;
|
|
514
|
+
triggerUrl: z.ZodString;
|
|
515
|
+
step: z.ZodOptional<z.ZodEnum<{
|
|
516
|
+
json: "json";
|
|
517
|
+
http: "http";
|
|
518
|
+
response_schema: "response_schema";
|
|
519
|
+
challenge_echo: "challenge_echo";
|
|
520
|
+
challenge_signature: "challenge_signature";
|
|
521
|
+
}>>;
|
|
522
|
+
httpStatus: z.ZodOptional<z.ZodNumber>;
|
|
523
|
+
bodySnippet: z.ZodOptional<z.ZodString>;
|
|
524
|
+
id: z.ZodOptional<z.ZodString>;
|
|
525
|
+
selectedValue: z.ZodOptional<z.ZodString>;
|
|
424
526
|
}, z.core.$strip>], "type">;
|
|
425
527
|
}, z.core.$strip>, z.ZodObject<{
|
|
426
528
|
id: z.ZodString;
|
package/dist/ModelEvents.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
2
|
import { EntityType } from "./Entities.js";
|
|
3
|
+
import { sdkJobServerCheckStepSchema } from "./types.js";
|
|
3
4
|
export const entityTypeSchema = z.enum(EntityType);
|
|
4
5
|
export var ChangeEventType;
|
|
5
6
|
(function (ChangeEventType) {
|
|
@@ -146,7 +147,22 @@ export const imageSchema = z.object({
|
|
|
146
147
|
type: z.literal("image"),
|
|
147
148
|
url: z.string()
|
|
148
149
|
});
|
|
149
|
-
export const
|
|
150
|
+
export const webhookFailureStageSchema = z.enum(["handshake", "delivery"]);
|
|
151
|
+
/**
|
|
152
|
+
* Surfaced in the run history drawer when a self-hosted SDK job fails to reach (or be accepted by)
|
|
153
|
+
* the customer's webhook server. Persisted as a snippet so the failure is visible in the timeline
|
|
154
|
+
* alongside other run events; the run row itself is still marked FAILED.
|
|
155
|
+
*/
|
|
156
|
+
export const webhookFailureSchema = z.object({
|
|
157
|
+
type: z.literal("webhook_failure"),
|
|
158
|
+
stage: webhookFailureStageSchema,
|
|
159
|
+
message: z.string(),
|
|
160
|
+
triggerUrl: z.string(),
|
|
161
|
+
step: sdkJobServerCheckStepSchema.optional(),
|
|
162
|
+
httpStatus: z.number().optional(),
|
|
163
|
+
bodySnippet: z.string().optional()
|
|
164
|
+
});
|
|
165
|
+
export const snippetVariantSchema = z.discriminatedUnion("type", [buttonSchema, integrationPromptSchema, navigateSchema, multipleChoiceSchema, imageSchema, webhookFailureSchema]);
|
|
150
166
|
const chatSnippetMetadataSchema = {
|
|
151
167
|
id: z.string().optional(),
|
|
152
168
|
selectedValue: z.string().optional()
|
|
@@ -156,7 +172,8 @@ export const chatSnippetSchema = z.discriminatedUnion("type", [
|
|
|
156
172
|
integrationPromptSchema.extend(chatSnippetMetadataSchema),
|
|
157
173
|
navigateSchema.extend(chatSnippetMetadataSchema),
|
|
158
174
|
multipleChoiceSchema.extend(chatSnippetMetadataSchema),
|
|
159
|
-
imageSchema.extend(chatSnippetMetadataSchema)
|
|
175
|
+
imageSchema.extend(chatSnippetMetadataSchema),
|
|
176
|
+
webhookFailureSchema.extend(chatSnippetMetadataSchema)
|
|
160
177
|
]);
|
|
161
178
|
export const modelEventChatSnippetSchema = modelEventBaseSchema.extend({
|
|
162
179
|
type: z.literal("Snippet"),
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const SUPPORTED_PROVIDERS: readonly ["anthropic", "openai"];
|
|
3
|
+
export declare const supportedProviderSchema: z.ZodEnum<{
|
|
4
|
+
anthropic: "anthropic";
|
|
5
|
+
openai: "openai";
|
|
6
|
+
}>;
|
|
7
|
+
export type SupportedProvider = z.infer<typeof supportedProviderSchema>;
|
|
8
|
+
export declare const modelReferenceSchema: z.ZodObject<{
|
|
9
|
+
providerId: z.ZodEnum<{
|
|
10
|
+
anthropic: "anthropic";
|
|
11
|
+
openai: "openai";
|
|
12
|
+
}>;
|
|
13
|
+
modelId: z.ZodString;
|
|
14
|
+
value: z.ZodString;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
export type ModelReference = z.infer<typeof modelReferenceSchema>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const SUPPORTED_PROVIDERS = ["anthropic", "openai"];
|
|
3
|
+
export const supportedProviderSchema = z.enum(SUPPORTED_PROVIDERS);
|
|
4
|
+
export const modelReferenceSchema = z
|
|
5
|
+
.object({
|
|
6
|
+
providerId: supportedProviderSchema,
|
|
7
|
+
modelId: z.string().min(1),
|
|
8
|
+
value: z.string().min(1)
|
|
9
|
+
})
|
|
10
|
+
.superRefine((data, ctx) => {
|
|
11
|
+
const prefix = `${data.providerId}:`;
|
|
12
|
+
if (!data.value.startsWith(prefix)) {
|
|
13
|
+
ctx.addIssue({
|
|
14
|
+
code: z.ZodIssueCode.custom,
|
|
15
|
+
message: `model.value must start with "${prefix}"`
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
export declare const organizationMetadataSchema: z.ZodObject<{
|
|
3
|
+
stripeCustomerId: z.ZodString;
|
|
4
|
+
overageMode: z.ZodEnum<{
|
|
5
|
+
soft: "soft";
|
|
6
|
+
strict: "strict";
|
|
7
|
+
}>;
|
|
8
|
+
overageCapMultiplier: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type OrganizationMetadata = z.infer<typeof organizationMetadataSchema>;
|