terse-types 0.0.52 → 0.0.54
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 +11 -0
- package/dist/ApiRoutes.json +11 -0
- package/dist/AttioRecordFlatten.d.ts +19 -0
- package/dist/AttioRecordFlatten.js +71 -0
- package/dist/Configs.d.ts +30 -0
- package/dist/Configs.js +32 -0
- package/dist/ModelEvents.d.ts +6 -6
- package/dist/OrganizationMetadata.d.ts +6 -0
- package/dist/OrganizationMetadata.js +10 -0
- package/dist/RunHistoryTypes.d.ts +3 -0
- package/dist/RunHistoryTypes.js +2 -1
- package/dist/ToolDisplayUtils.js +31 -0
- package/dist/Tools.d.ts +230 -0
- package/dist/Tools.js +52 -1
- package/dist/json-schema/terse-types.schema.json +15994 -0
- package/dist/types.d.ts +2338 -67
- package/dist/types.js +87 -3
- package/package.json +7 -4
- package/dist/Events.d.ts +0 -112
- package/dist/Events.js +0 -32
|
@@ -148,10 +148,21 @@ export declare const ApiRoutes: {
|
|
|
148
148
|
TOOL_EXECUTE: string;
|
|
149
149
|
TOOL_DEFINITIONS: string;
|
|
150
150
|
RUN_TRIGGER_EVENT: string;
|
|
151
|
+
TEST_RUN: string;
|
|
152
|
+
TEST_RUN_FINALIZE: string;
|
|
151
153
|
AGENT_RUN: string;
|
|
154
|
+
MEMORY_LIST: string;
|
|
155
|
+
MEMORY_GET: string;
|
|
156
|
+
MEMORY_PUT: string;
|
|
157
|
+
MEMORY_DELETE: string;
|
|
158
|
+
STATE_GET: string;
|
|
159
|
+
STATE_PUT: string;
|
|
152
160
|
APPROVAL_DECISION: string;
|
|
153
161
|
SESSION_EVENTS: string;
|
|
154
162
|
LISTEN: string;
|
|
163
|
+
SUSPEND: string;
|
|
164
|
+
RESUME: string;
|
|
165
|
+
INPUT_REQUEST: string;
|
|
155
166
|
CREATE_PROJECT: string;
|
|
156
167
|
DEPLOY: string;
|
|
157
168
|
IDENTIFY: string;
|
package/dist/ApiRoutes.json
CHANGED
|
@@ -148,10 +148,21 @@
|
|
|
148
148
|
"TOOL_EXECUTE": "/sdk/tool-execute",
|
|
149
149
|
"TOOL_DEFINITIONS": "/sdk/tool-definitions",
|
|
150
150
|
"RUN_TRIGGER_EVENT": "/sdk/runs/:runId/trigger-event",
|
|
151
|
+
"TEST_RUN": "/sdk/test-run",
|
|
152
|
+
"TEST_RUN_FINALIZE": "/sdk/test-run/:runId/finalize",
|
|
151
153
|
"AGENT_RUN": "/sdk/agent-run",
|
|
154
|
+
"MEMORY_LIST": "/sdk/memory/list",
|
|
155
|
+
"MEMORY_GET": "/sdk/memory/get",
|
|
156
|
+
"MEMORY_PUT": "/sdk/memory/put",
|
|
157
|
+
"MEMORY_DELETE": "/sdk/memory/delete",
|
|
158
|
+
"STATE_GET": "/sdk/state/get",
|
|
159
|
+
"STATE_PUT": "/sdk/state/put",
|
|
152
160
|
"APPROVAL_DECISION": "/sdk/approval-decision",
|
|
153
161
|
"SESSION_EVENTS": "/sdk/session-events",
|
|
154
162
|
"LISTEN": "/sdk/listen",
|
|
163
|
+
"SUSPEND": "/sdk/suspend",
|
|
164
|
+
"RESUME": "/sdk/resume",
|
|
165
|
+
"INPUT_REQUEST": "/sdk/input-request",
|
|
155
166
|
"CREATE_PROJECT": "/sdk/projects",
|
|
156
167
|
"DEPLOY": "/sdk/deploy",
|
|
157
168
|
"IDENTIFY": "/sdk/auth/identify",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collapses a single Attio value entry (or nested structure) toward primitives /
|
|
3
|
+
* simple objects, matching the shape produced for generated Attio tool outputs.
|
|
4
|
+
*/
|
|
5
|
+
export declare function flattenAttioLeafValue(value: unknown): unknown;
|
|
6
|
+
/**
|
|
7
|
+
* Flattens one attribute’s raw value (often an array of interaction rows from the REST API).
|
|
8
|
+
* @param preferArray When true, keep all entries as an array; when false, use the first entry only.
|
|
9
|
+
*/
|
|
10
|
+
export declare function flattenAttioAttributeValue(rawValue: unknown, preferArray: boolean): unknown;
|
|
11
|
+
/**
|
|
12
|
+
* Flattens `record.values` from Attio’s GET record / webhook enrichment payload.
|
|
13
|
+
*/
|
|
14
|
+
export declare function flattenAttioRecordValues(values: Record<string, unknown>, isMultiValueAttribute: (attributeSlug: string) => boolean): Record<string, unknown>;
|
|
15
|
+
/**
|
|
16
|
+
* Slug-only heuristic when object attribute metadata is unavailable (e.g. Attio webhook triggers).
|
|
17
|
+
* Prefer {@link flattenAttioRecordValues} with object-aware multi-value info from codegen when possible.
|
|
18
|
+
*/
|
|
19
|
+
export declare function isProbablyAttioMultiValueAttributeSlug(attributeSlug: string): boolean;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/** Keys Attio nests on attribute timeline entries (not the semantic payload). */
|
|
2
|
+
const ATTIO_VALUE_METADATA_KEYS = new Set([
|
|
3
|
+
"active_from",
|
|
4
|
+
"active_until",
|
|
5
|
+
"attribute_type",
|
|
6
|
+
"created_by_actor"
|
|
7
|
+
]);
|
|
8
|
+
/**
|
|
9
|
+
* Collapses a single Attio value entry (or nested structure) toward primitives /
|
|
10
|
+
* simple objects, matching the shape produced for generated Attio tool outputs.
|
|
11
|
+
*/
|
|
12
|
+
export function flattenAttioLeafValue(value) {
|
|
13
|
+
if (value === null || value === undefined)
|
|
14
|
+
return value;
|
|
15
|
+
if (Array.isArray(value))
|
|
16
|
+
return value.map(entry => flattenAttioLeafValue(entry));
|
|
17
|
+
if (typeof value !== "object")
|
|
18
|
+
return value;
|
|
19
|
+
const rawObject = value;
|
|
20
|
+
if (typeof rawObject.full_name === "string")
|
|
21
|
+
return rawObject.full_name;
|
|
22
|
+
if (typeof rawObject.email_address === "string")
|
|
23
|
+
return rawObject.email_address;
|
|
24
|
+
if (typeof rawObject.domain === "string")
|
|
25
|
+
return rawObject.domain;
|
|
26
|
+
if (typeof rawObject.phone_number === "string")
|
|
27
|
+
return rawObject.phone_number;
|
|
28
|
+
if ("value" in rawObject)
|
|
29
|
+
return flattenAttioLeafValue(rawObject.value);
|
|
30
|
+
const dataEntries = Object.entries(rawObject).filter(([key]) => !ATTIO_VALUE_METADATA_KEYS.has(key));
|
|
31
|
+
if (dataEntries.length === 0)
|
|
32
|
+
return rawObject;
|
|
33
|
+
if (dataEntries.length === 1)
|
|
34
|
+
return flattenAttioLeafValue(dataEntries[0][1]);
|
|
35
|
+
return Object.fromEntries(dataEntries.map(([key, entryValue]) => [key, flattenAttioLeafValue(entryValue)]));
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Flattens one attribute’s raw value (often an array of interaction rows from the REST API).
|
|
39
|
+
* @param preferArray When true, keep all entries as an array; when false, use the first entry only.
|
|
40
|
+
*/
|
|
41
|
+
export function flattenAttioAttributeValue(rawValue, preferArray) {
|
|
42
|
+
if (!Array.isArray(rawValue))
|
|
43
|
+
return flattenAttioLeafValue(rawValue);
|
|
44
|
+
const flattened = rawValue.map(entry => flattenAttioLeafValue(entry)).filter(entry => entry !== undefined);
|
|
45
|
+
return preferArray ? flattened : flattened[0];
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Flattens `record.values` from Attio’s GET record / webhook enrichment payload.
|
|
49
|
+
*/
|
|
50
|
+
export function flattenAttioRecordValues(values, isMultiValueAttribute) {
|
|
51
|
+
const flattenedValues = {};
|
|
52
|
+
for (const [attributeSlug, rawValue] of Object.entries(values)) {
|
|
53
|
+
flattenedValues[attributeSlug] = flattenAttioAttributeValue(rawValue, isMultiValueAttribute(attributeSlug));
|
|
54
|
+
}
|
|
55
|
+
return flattenedValues;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Slug-only heuristic when object attribute metadata is unavailable (e.g. Attio webhook triggers).
|
|
59
|
+
* Prefer {@link flattenAttioRecordValues} with object-aware multi-value info from codegen when possible.
|
|
60
|
+
*/
|
|
61
|
+
export function isProbablyAttioMultiValueAttributeSlug(attributeSlug) {
|
|
62
|
+
const slug = attributeSlug.toLowerCase();
|
|
63
|
+
return (slug === "email_addresses" ||
|
|
64
|
+
slug === "domains" ||
|
|
65
|
+
slug === "phone_numbers" ||
|
|
66
|
+
slug === "social_profiles" ||
|
|
67
|
+
slug === "links" ||
|
|
68
|
+
slug === "tags" ||
|
|
69
|
+
slug.endsWith("_addresses") ||
|
|
70
|
+
slug.endsWith("_ids"));
|
|
71
|
+
}
|
package/dist/Configs.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export declare enum ConfigType {
|
|
|
16
16
|
LAUNCHDARKLY = "launchdarkly",
|
|
17
17
|
WEB = "web",
|
|
18
18
|
IMAGE_EDIT = "image_edit",
|
|
19
|
+
MEMORY = "memory",
|
|
19
20
|
WORKOS_INPUT = "workos_input",
|
|
20
21
|
WORKOS_OUTPUT = "workos_output",
|
|
21
22
|
ATTIO_INPUT = "attio_input",
|
|
@@ -160,6 +161,14 @@ export declare const ImageEditConfigMetadata: {
|
|
|
160
161
|
readonly isInput: false;
|
|
161
162
|
readonly isOutput: true;
|
|
162
163
|
};
|
|
164
|
+
export declare const MemoryConfigMetadata: {
|
|
165
|
+
readonly configType: ConfigType.MEMORY;
|
|
166
|
+
readonly name: "Memory";
|
|
167
|
+
readonly description: "Built-in persistent memory the agent can read and write across runs";
|
|
168
|
+
readonly integrationType: IntegrationType.TERSE;
|
|
169
|
+
readonly isInput: false;
|
|
170
|
+
readonly isOutput: true;
|
|
171
|
+
};
|
|
163
172
|
export declare const WorkOSInputConfigMetadata: {
|
|
164
173
|
readonly configType: ConfigType.WORKOS_INPUT;
|
|
165
174
|
readonly name: "WorkOS";
|
|
@@ -702,6 +711,18 @@ export declare class ImageEditConfig extends BaseConfigInstance<IntegrationType.
|
|
|
702
711
|
isComplete(): boolean;
|
|
703
712
|
formatForAgent(): string;
|
|
704
713
|
}
|
|
714
|
+
export declare const MemoryConfigSchema: z.ZodObject<{
|
|
715
|
+
integrationId: z.ZodLiteral<"system">;
|
|
716
|
+
integrationType: z.ZodLiteral<IntegrationType.TERSE>;
|
|
717
|
+
configType: z.ZodLiteral<ConfigType.MEMORY>;
|
|
718
|
+
}, z.core.$strip>;
|
|
719
|
+
export type MemoryConfigData = z.infer<typeof MemoryConfigSchema>;
|
|
720
|
+
export type MemoryConfigInstance = MemoryConfigData & ConfigBehavior;
|
|
721
|
+
export declare class MemoryConfig extends BaseConfigInstance<IntegrationType.TERSE, ConfigType.MEMORY, "system"> implements MemoryConfigInstance {
|
|
722
|
+
constructor();
|
|
723
|
+
isComplete(): boolean;
|
|
724
|
+
formatForAgent(): string;
|
|
725
|
+
}
|
|
705
726
|
export declare const WorkOSInputConfigSchema: z.ZodObject<{
|
|
706
727
|
integrationId: z.ZodString;
|
|
707
728
|
integrationType: z.ZodLiteral<IntegrationType.WORKOS>;
|
|
@@ -1086,6 +1107,10 @@ export declare const configDataSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
1086
1107
|
integrationId: z.ZodLiteral<"system">;
|
|
1087
1108
|
integrationType: z.ZodLiteral<IntegrationType.TERSE>;
|
|
1088
1109
|
configType: z.ZodLiteral<ConfigType.IMAGE_EDIT>;
|
|
1110
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1111
|
+
integrationId: z.ZodLiteral<"system">;
|
|
1112
|
+
integrationType: z.ZodLiteral<IntegrationType.TERSE>;
|
|
1113
|
+
configType: z.ZodLiteral<ConfigType.MEMORY>;
|
|
1089
1114
|
}, z.core.$strip>, z.ZodObject<{
|
|
1090
1115
|
integrationId: z.ZodString;
|
|
1091
1116
|
integrationType: z.ZodLiteral<IntegrationType.WORKOS>;
|
|
@@ -1443,6 +1468,10 @@ export declare const skillConfigDataSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
1443
1468
|
integrationId: z.ZodLiteral<"system">;
|
|
1444
1469
|
integrationType: z.ZodLiteral<IntegrationType.TERSE>;
|
|
1445
1470
|
configType: z.ZodLiteral<ConfigType.IMAGE_EDIT>;
|
|
1471
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1472
|
+
integrationId: z.ZodLiteral<"system">;
|
|
1473
|
+
integrationType: z.ZodLiteral<IntegrationType.TERSE>;
|
|
1474
|
+
configType: z.ZodLiteral<ConfigType.MEMORY>;
|
|
1446
1475
|
}, z.core.$strip>, z.ZodObject<{
|
|
1447
1476
|
integrationId: z.ZodString;
|
|
1448
1477
|
integrationType: z.ZodLiteral<IntegrationType.WORKOS>;
|
|
@@ -1477,6 +1506,7 @@ export type ConfigMetadataMap = EnsureExhaustiveMetadata<{
|
|
|
1477
1506
|
[ConfigType.LAUNCHDARKLY]: typeof LaunchDarklyConfig;
|
|
1478
1507
|
[ConfigType.WEB]: typeof WebConfig;
|
|
1479
1508
|
[ConfigType.IMAGE_EDIT]: typeof ImageEditConfig;
|
|
1509
|
+
[ConfigType.MEMORY]: typeof MemoryConfig;
|
|
1480
1510
|
[ConfigType.WORKOS_INPUT]: typeof WorkOSInputConfig;
|
|
1481
1511
|
[ConfigType.WORKOS_OUTPUT]: typeof WorkOSOutputConfig;
|
|
1482
1512
|
[ConfigType.ATTIO_INPUT]: typeof AttioInputConfig;
|
package/dist/Configs.js
CHANGED
|
@@ -17,6 +17,7 @@ export var ConfigType;
|
|
|
17
17
|
ConfigType["LAUNCHDARKLY"] = "launchdarkly";
|
|
18
18
|
ConfigType["WEB"] = "web";
|
|
19
19
|
ConfigType["IMAGE_EDIT"] = "image_edit";
|
|
20
|
+
ConfigType["MEMORY"] = "memory";
|
|
20
21
|
ConfigType["WORKOS_INPUT"] = "workos_input";
|
|
21
22
|
ConfigType["WORKOS_OUTPUT"] = "workos_output";
|
|
22
23
|
ConfigType["ATTIO_INPUT"] = "attio_input";
|
|
@@ -149,6 +150,14 @@ export const ImageEditConfigMetadata = {
|
|
|
149
150
|
isInput: false,
|
|
150
151
|
isOutput: true
|
|
151
152
|
};
|
|
153
|
+
export const MemoryConfigMetadata = {
|
|
154
|
+
configType: ConfigType.MEMORY,
|
|
155
|
+
name: "Memory",
|
|
156
|
+
description: "Built-in persistent memory the agent can read and write across runs",
|
|
157
|
+
integrationType: IntegrationType.TERSE,
|
|
158
|
+
isInput: false,
|
|
159
|
+
isOutput: true
|
|
160
|
+
};
|
|
152
161
|
export const WorkOSInputConfigMetadata = {
|
|
153
162
|
configType: ConfigType.WORKOS_INPUT,
|
|
154
163
|
name: "WorkOS",
|
|
@@ -229,6 +238,7 @@ export const CONFIG_DETAILS = {
|
|
|
229
238
|
[ConfigType.LAUNCHDARKLY]: LaunchDarklyConfigMetadata,
|
|
230
239
|
[ConfigType.WEB]: WebConfigMetadata,
|
|
231
240
|
[ConfigType.IMAGE_EDIT]: ImageEditConfigMetadata,
|
|
241
|
+
[ConfigType.MEMORY]: MemoryConfigMetadata,
|
|
232
242
|
[ConfigType.WORKOS_INPUT]: WorkOSInputConfigMetadata,
|
|
233
243
|
[ConfigType.WORKOS_OUTPUT]: WorkOSOutputConfigMetadata,
|
|
234
244
|
[ConfigType.ATTIO_INPUT]: AttioInputConfigMetadata,
|
|
@@ -783,6 +793,22 @@ export class ImageEditConfig extends BaseConfigInstance {
|
|
|
783
793
|
return "Type: Image Edit";
|
|
784
794
|
}
|
|
785
795
|
}
|
|
796
|
+
export const MemoryConfigSchema = ConfigInstanceSchema.extend({
|
|
797
|
+
integrationId: z.literal("system"),
|
|
798
|
+
integrationType: z.literal(IntegrationType.TERSE),
|
|
799
|
+
configType: z.literal(ConfigType.MEMORY)
|
|
800
|
+
});
|
|
801
|
+
export class MemoryConfig extends BaseConfigInstance {
|
|
802
|
+
constructor() {
|
|
803
|
+
super("system", IntegrationType.TERSE, ConfigType.MEMORY);
|
|
804
|
+
}
|
|
805
|
+
isComplete() {
|
|
806
|
+
return true;
|
|
807
|
+
}
|
|
808
|
+
formatForAgent() {
|
|
809
|
+
return "Type: Memory (persistent across runs)";
|
|
810
|
+
}
|
|
811
|
+
}
|
|
786
812
|
export const WorkOSInputConfigSchema = ConfigInstanceSchema.extend({
|
|
787
813
|
integrationType: z.literal(IntegrationType.WORKOS),
|
|
788
814
|
configType: z.literal(ConfigType.WORKOS_INPUT),
|
|
@@ -998,6 +1024,7 @@ export const configDataSchema = z.union([
|
|
|
998
1024
|
LaunchDarklyConfigSchema,
|
|
999
1025
|
WebConfigSchema,
|
|
1000
1026
|
ImageEditConfigSchema,
|
|
1027
|
+
MemoryConfigSchema,
|
|
1001
1028
|
WorkOSInputConfigSchema,
|
|
1002
1029
|
WorkOSOutputConfigSchema,
|
|
1003
1030
|
AttioInputConfigSchema,
|
|
@@ -1033,6 +1060,7 @@ export const skillConfigDataSchema = z.union([
|
|
|
1033
1060
|
LaunchDarklyConfigSchema,
|
|
1034
1061
|
WebConfigSchema,
|
|
1035
1062
|
ImageEditConfigSchema,
|
|
1063
|
+
MemoryConfigSchema,
|
|
1036
1064
|
WorkOSOutputConfigSchema,
|
|
1037
1065
|
AttioOutputConfigSchema,
|
|
1038
1066
|
SnowflakeOutputConfigSchema
|
|
@@ -1049,6 +1077,7 @@ export function isConfigComplete(config) {
|
|
|
1049
1077
|
case ConfigType.LINEAR_INPUT:
|
|
1050
1078
|
case ConfigType.WEB:
|
|
1051
1079
|
case ConfigType.IMAGE_EDIT:
|
|
1080
|
+
case ConfigType.MEMORY:
|
|
1052
1081
|
case ConfigType.WEBHOOK_INPUT:
|
|
1053
1082
|
return true;
|
|
1054
1083
|
case ConfigType.SLACK:
|
|
@@ -1198,6 +1227,8 @@ export function formatConfigForAgent(config) {
|
|
|
1198
1227
|
return "Type: Web (search, extract, research)";
|
|
1199
1228
|
case ConfigType.IMAGE_EDIT:
|
|
1200
1229
|
return "Type: Image Edit";
|
|
1230
|
+
case ConfigType.MEMORY:
|
|
1231
|
+
return "Type: Memory (persistent across runs)";
|
|
1201
1232
|
case ConfigType.WORKOS_INPUT:
|
|
1202
1233
|
return `Type: WorkOS Events\nListening for: ${config.eventTypes.join(", ")}`;
|
|
1203
1234
|
case ConfigType.HEY_REACH_INPUT: {
|
|
@@ -1254,6 +1285,7 @@ export const CONFIG_METADATA = {
|
|
|
1254
1285
|
[ConfigType.LAUNCHDARKLY]: LaunchDarklyConfig,
|
|
1255
1286
|
[ConfigType.WEB]: WebConfig,
|
|
1256
1287
|
[ConfigType.IMAGE_EDIT]: ImageEditConfig,
|
|
1288
|
+
[ConfigType.MEMORY]: MemoryConfig,
|
|
1257
1289
|
[ConfigType.WORKOS_INPUT]: WorkOSInputConfig,
|
|
1258
1290
|
[ConfigType.WORKOS_OUTPUT]: WorkOSOutputConfig,
|
|
1259
1291
|
[ConfigType.ATTIO_INPUT]: AttioInputConfig,
|
package/dist/ModelEvents.d.ts
CHANGED
|
@@ -177,8 +177,8 @@ export declare const imageSchema: z.ZodObject<{
|
|
|
177
177
|
url: z.ZodString;
|
|
178
178
|
}, z.core.$strip>;
|
|
179
179
|
export declare const webhookFailureStageSchema: z.ZodEnum<{
|
|
180
|
-
handshake: "handshake";
|
|
181
180
|
delivery: "delivery";
|
|
181
|
+
handshake: "handshake";
|
|
182
182
|
}>;
|
|
183
183
|
export type WebhookFailureStage = z.infer<typeof webhookFailureStageSchema>;
|
|
184
184
|
/**
|
|
@@ -189,8 +189,8 @@ export type WebhookFailureStage = z.infer<typeof webhookFailureStageSchema>;
|
|
|
189
189
|
export declare const webhookFailureSchema: z.ZodObject<{
|
|
190
190
|
type: z.ZodLiteral<"webhook_failure">;
|
|
191
191
|
stage: z.ZodEnum<{
|
|
192
|
-
handshake: "handshake";
|
|
193
192
|
delivery: "delivery";
|
|
193
|
+
handshake: "handshake";
|
|
194
194
|
}>;
|
|
195
195
|
message: z.ZodString;
|
|
196
196
|
triggerUrl: z.ZodString;
|
|
@@ -231,8 +231,8 @@ export declare const snippetVariantSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
|
|
|
231
231
|
}, z.core.$strip>, z.ZodObject<{
|
|
232
232
|
type: z.ZodLiteral<"webhook_failure">;
|
|
233
233
|
stage: z.ZodEnum<{
|
|
234
|
-
handshake: "handshake";
|
|
235
234
|
delivery: "delivery";
|
|
235
|
+
handshake: "handshake";
|
|
236
236
|
}>;
|
|
237
237
|
message: z.ZodString;
|
|
238
238
|
triggerUrl: z.ZodString;
|
|
@@ -284,8 +284,8 @@ export declare const chatSnippetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
284
284
|
}, z.core.$strip>, z.ZodObject<{
|
|
285
285
|
type: z.ZodLiteral<"webhook_failure">;
|
|
286
286
|
stage: z.ZodEnum<{
|
|
287
|
-
handshake: "handshake";
|
|
288
287
|
delivery: "delivery";
|
|
288
|
+
handshake: "handshake";
|
|
289
289
|
}>;
|
|
290
290
|
message: z.ZodString;
|
|
291
291
|
triggerUrl: z.ZodString;
|
|
@@ -344,8 +344,8 @@ export declare const modelEventChatSnippetSchema: z.ZodObject<{
|
|
|
344
344
|
}, z.core.$strip>, z.ZodObject<{
|
|
345
345
|
type: z.ZodLiteral<"webhook_failure">;
|
|
346
346
|
stage: z.ZodEnum<{
|
|
347
|
-
handshake: "handshake";
|
|
348
347
|
delivery: "delivery";
|
|
348
|
+
handshake: "handshake";
|
|
349
349
|
}>;
|
|
350
350
|
message: z.ZodString;
|
|
351
351
|
triggerUrl: z.ZodString;
|
|
@@ -480,8 +480,8 @@ export declare const modelEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
480
480
|
}, z.core.$strip>, z.ZodObject<{
|
|
481
481
|
type: z.ZodLiteral<"webhook_failure">;
|
|
482
482
|
stage: z.ZodEnum<{
|
|
483
|
-
handshake: "handshake";
|
|
484
483
|
delivery: "delivery";
|
|
484
|
+
handshake: "handshake";
|
|
485
485
|
}>;
|
|
486
486
|
message: z.ZodString;
|
|
487
487
|
triggerUrl: z.ZodString;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const organizationMetadataSchema: z.ZodObject<{
|
|
3
|
+
stripeCustomerId: z.ZodString;
|
|
4
|
+
runExecutionBlocked: z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>, z.ZodTransform<boolean, string | boolean | undefined>>;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export type OrganizationMetadata = z.infer<typeof organizationMetadataSchema>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// Can be serialized a string, supports deserialization
|
|
3
|
+
const booleanMetadataSchema = z
|
|
4
|
+
.union([z.boolean(), z.string()])
|
|
5
|
+
.optional()
|
|
6
|
+
.transform(value => value === true || value === "true");
|
|
7
|
+
export const organizationMetadataSchema = z.object({
|
|
8
|
+
stripeCustomerId: z.string(),
|
|
9
|
+
runExecutionBlocked: booleanMetadataSchema
|
|
10
|
+
});
|
|
@@ -8,6 +8,7 @@ export declare const RunHistoryStatus: {
|
|
|
8
8
|
readonly SKIPPED: "skipped";
|
|
9
9
|
readonly IN_PROGRESS: "in_progress";
|
|
10
10
|
readonly AWAITING_APPROVAL: "awaiting_approval";
|
|
11
|
+
readonly SUSPENDED: "suspended";
|
|
11
12
|
};
|
|
12
13
|
export declare const runHistoryStatusSchema: z.ZodEnum<{
|
|
13
14
|
readonly SUCCESS: "success";
|
|
@@ -16,6 +17,7 @@ export declare const runHistoryStatusSchema: z.ZodEnum<{
|
|
|
16
17
|
readonly SKIPPED: "skipped";
|
|
17
18
|
readonly IN_PROGRESS: "in_progress";
|
|
18
19
|
readonly AWAITING_APPROVAL: "awaiting_approval";
|
|
20
|
+
readonly SUSPENDED: "suspended";
|
|
19
21
|
}>;
|
|
20
22
|
export type RunHistoryStatus = z.infer<typeof runHistoryStatusSchema>;
|
|
21
23
|
export declare const runHistoryDecisionActionSchema: z.ZodEnum<{
|
|
@@ -74,6 +76,7 @@ export type GetRunHistoryParams = {
|
|
|
74
76
|
status?: RunHistoryStatus[];
|
|
75
77
|
page?: number;
|
|
76
78
|
pageSize?: number;
|
|
79
|
+
includeTest?: boolean;
|
|
77
80
|
};
|
|
78
81
|
export type GetRunHistoryResponse = {
|
|
79
82
|
items: RunHistoryRecord[];
|
package/dist/RunHistoryTypes.js
CHANGED
|
@@ -7,7 +7,8 @@ export const RunHistoryStatus = {
|
|
|
7
7
|
CANCELLED: "cancelled",
|
|
8
8
|
SKIPPED: "skipped",
|
|
9
9
|
IN_PROGRESS: "in_progress",
|
|
10
|
-
AWAITING_APPROVAL: "awaiting_approval"
|
|
10
|
+
AWAITING_APPROVAL: "awaiting_approval",
|
|
11
|
+
SUSPENDED: "suspended"
|
|
11
12
|
};
|
|
12
13
|
export const runHistoryStatusSchema = z.enum(RunHistoryStatus);
|
|
13
14
|
export const runHistoryDecisionActionSchema = z.enum(["processed", "skipped"]);
|
package/dist/ToolDisplayUtils.js
CHANGED
|
@@ -14,6 +14,32 @@ function safeParseResult(result) {
|
|
|
14
14
|
return undefined;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
+
function memoryCommand(params) {
|
|
18
|
+
const command = params?.command;
|
|
19
|
+
return command && typeof command === "object" && "op" in command ? command : undefined;
|
|
20
|
+
}
|
|
21
|
+
function memoryTarget(command) {
|
|
22
|
+
return command.op === "rename" ? command.old_path : (command.path ?? undefined);
|
|
23
|
+
}
|
|
24
|
+
function memoryLabel(command, done) {
|
|
25
|
+
if (!command)
|
|
26
|
+
return done ? "Updated memory" : "Accessing memory";
|
|
27
|
+
const target = memoryTarget(command);
|
|
28
|
+
const suffix = target ? ` ${truncate(target, 40)}` : "";
|
|
29
|
+
switch (command.op) {
|
|
30
|
+
case "view":
|
|
31
|
+
return (done ? "Read memory" : "Reading memory") + suffix;
|
|
32
|
+
case "create":
|
|
33
|
+
return (done ? "Saved memory" : "Saving memory") + suffix;
|
|
34
|
+
case "str_replace":
|
|
35
|
+
case "insert":
|
|
36
|
+
return (done ? "Updated memory" : "Updating memory") + suffix;
|
|
37
|
+
case "delete":
|
|
38
|
+
return (done ? "Deleted memory" : "Deleting memory") + suffix;
|
|
39
|
+
case "rename":
|
|
40
|
+
return done ? "Renamed memory file" : "Reorganizing memory";
|
|
41
|
+
}
|
|
42
|
+
}
|
|
17
43
|
/**
|
|
18
44
|
* Display configurations for all tools.
|
|
19
45
|
* Each tool defines how it should be displayed in preparing, executing, and complete phases.
|
|
@@ -780,6 +806,11 @@ const TOOL_DISPLAY_CONFIG = {
|
|
|
780
806
|
return prompt ? `Image edited: "${truncate(prompt)}"` : "Image edited";
|
|
781
807
|
}
|
|
782
808
|
},
|
|
809
|
+
memory: {
|
|
810
|
+
preparing: "Checking memory",
|
|
811
|
+
executing: params => memoryLabel(memoryCommand(params), false),
|
|
812
|
+
complete: params => memoryLabel(memoryCommand(params), true)
|
|
813
|
+
},
|
|
783
814
|
// ===================
|
|
784
815
|
// Snowflake Tools
|
|
785
816
|
// ===================
|