terse-types 0.0.37 → 0.0.39
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 +6 -1
- package/dist/ApiRoutes.json +6 -1
- package/dist/AttioRecordFlatten.d.ts +19 -0
- package/dist/AttioRecordFlatten.js +71 -0
- package/dist/FrontendRoutes.json +0 -5
- package/dist/FrontendRoutesBuilder.d.ts +0 -5
- package/dist/InvalidationKeys.d.ts +1 -0
- package/dist/InvalidationKeys.js +1 -0
- package/dist/ModelEvents.d.ts +0 -18
- package/dist/ModelEvents.js +0 -7
- package/dist/Triggers.d.ts +313 -313
- package/dist/Triggers.js +27 -26
- package/dist/json-schema/terse-types.schema.json +15994 -0
- package/dist/types.d.ts +572 -1573
- package/dist/types.js +34 -11
- package/package.json +10 -1
- package/dist/ACL.d.ts +0 -375
- package/dist/ACL.js +0 -105
- package/dist/ACLPolicy.d.ts +0 -17
- package/dist/ACLPolicy.js +0 -18
- package/dist/getConfigACLRules.d.ts +0 -10
- package/dist/getConfigACLRules.js +0 -0
|
@@ -32,7 +32,6 @@ export declare const ApiRoutes: {
|
|
|
32
32
|
};
|
|
33
33
|
GITHUB: {
|
|
34
34
|
INTEGRATIONS: string;
|
|
35
|
-
INSTALLATION_URL: string;
|
|
36
35
|
GET_REPOSITORIES_FOR_INTEGRATION: string;
|
|
37
36
|
INSTALLATION_CALLBACK: string;
|
|
38
37
|
INSTALLATION_DELETED: string;
|
|
@@ -138,6 +137,12 @@ export declare const ApiRoutes: {
|
|
|
138
137
|
ROTATE_SIGNING_SECRET: string;
|
|
139
138
|
ROTATE_API_KEY: string;
|
|
140
139
|
};
|
|
140
|
+
PROJECT_SECRETS: {
|
|
141
|
+
LIST: string;
|
|
142
|
+
UPSERT: string;
|
|
143
|
+
DELETE: string;
|
|
144
|
+
IMPORT: string;
|
|
145
|
+
};
|
|
141
146
|
SDK: {
|
|
142
147
|
ME: string;
|
|
143
148
|
ME_ORGANIZATIONS: string;
|
package/dist/ApiRoutes.json
CHANGED
|
@@ -32,7 +32,6 @@
|
|
|
32
32
|
},
|
|
33
33
|
"GITHUB": {
|
|
34
34
|
"INTEGRATIONS": "/github/integrations",
|
|
35
|
-
"INSTALLATION_URL": "/github/installation-url",
|
|
36
35
|
"GET_REPOSITORIES_FOR_INTEGRATION": "/github/get-repositories-for-integration",
|
|
37
36
|
"INSTALLATION_CALLBACK": "/github/installation-callback",
|
|
38
37
|
"INSTALLATION_DELETED": "/github/installation-deleted",
|
|
@@ -138,6 +137,12 @@
|
|
|
138
137
|
"ROTATE_SIGNING_SECRET": "/projects/:id/rotate-signing-secret",
|
|
139
138
|
"ROTATE_API_KEY": "/projects/:id/rotate-api-key"
|
|
140
139
|
},
|
|
140
|
+
"PROJECT_SECRETS": {
|
|
141
|
+
"LIST": "/projects/:id/secrets",
|
|
142
|
+
"UPSERT": "/projects/:id/secrets",
|
|
143
|
+
"DELETE": "/projects/:id/secrets/:name",
|
|
144
|
+
"IMPORT": "/projects/:id/secrets/import"
|
|
145
|
+
},
|
|
141
146
|
"SDK": {
|
|
142
147
|
"ME": "/sdk/me",
|
|
143
148
|
"ME_ORGANIZATIONS": "/sdk/me/organizations",
|
|
@@ -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/FrontendRoutes.json
CHANGED
|
@@ -7,12 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"ONBOARD": "/onboard",
|
|
9
9
|
"AGENTS": {
|
|
10
|
-
"LIST": "/app/agents",
|
|
11
|
-
"SETUP": "/app/agents/setup",
|
|
12
|
-
"NEW": "/app/agents/new",
|
|
13
|
-
"NEW_WITH_TEMPLATE": "/app/agents/new/template/:templateId",
|
|
14
10
|
"BY_ID": "/app/agents/:id",
|
|
15
|
-
"HISTORY": "/app/agents/:id?tab=history",
|
|
16
11
|
"IMPROVEMENTS": "/app/agents/:id?tab=improvements",
|
|
17
12
|
"ALERTS": "/app/agents/:id?tab=setup§ion=alerts",
|
|
18
13
|
"RUN_HISTORY": "/app/agents/:id?tab=history&runId=:runId"
|
|
@@ -9,12 +9,7 @@ export declare const FrontendRoutes: {
|
|
|
9
9
|
};
|
|
10
10
|
ONBOARD: string;
|
|
11
11
|
AGENTS: {
|
|
12
|
-
LIST: string;
|
|
13
|
-
SETUP: string;
|
|
14
|
-
NEW: string;
|
|
15
|
-
NEW_WITH_TEMPLATE: string;
|
|
16
12
|
BY_ID: string;
|
|
17
|
-
HISTORY: string;
|
|
18
13
|
IMPROVEMENTS: string;
|
|
19
14
|
ALERTS: string;
|
|
20
15
|
RUN_HISTORY: string;
|
|
@@ -49,6 +49,7 @@ export declare const userByIdKey: (userId: string | null | undefined) => readonl
|
|
|
49
49
|
export declare const agentFilesKey: (agentId: string) => readonly [string, string];
|
|
50
50
|
export declare const agentFileContentKey: (agentId: string, fileId: string) => readonly [string, string, string];
|
|
51
51
|
export declare const projectDeploysKey: (projectId: string) => readonly [string, string];
|
|
52
|
+
export declare const projectSecretsKey: (projectId: string) => readonly [string, string];
|
|
52
53
|
export declare const projectSourceFilesKey: (projectId: string) => readonly [string, string];
|
|
53
54
|
export declare const projectSourceFileContentKey: (projectId: string, fileId: string) => readonly [string, string, string];
|
|
54
55
|
export declare const billingContextKey: (params?: Partial<BillingContextQuery>) => readonly [string, string, string, string];
|
package/dist/InvalidationKeys.js
CHANGED
|
@@ -143,6 +143,7 @@ export const userByIdKey = (userId) => {
|
|
|
143
143
|
export const agentFilesKey = (agentId) => ["agentFiles", agentId];
|
|
144
144
|
export const agentFileContentKey = (agentId, fileId) => ["agentFileContent", agentId, fileId];
|
|
145
145
|
export const projectDeploysKey = (projectId) => ["projectDeploys", projectId];
|
|
146
|
+
export const projectSecretsKey = (projectId) => ["projectSecrets", projectId];
|
|
146
147
|
export const projectSourceFilesKey = (projectId) => ["projectSourceFiles", projectId];
|
|
147
148
|
export const projectSourceFileContentKey = (projectId, fileId) => ["projectSourceFileContent", projectId, fileId];
|
|
148
149
|
export const billingContextKey = (params) => [
|
package/dist/ModelEvents.d.ts
CHANGED
|
@@ -134,16 +134,6 @@ export declare const toolCallCompleteSchema: z.ZodObject<{
|
|
|
134
134
|
}, z.core.$strip>>;
|
|
135
135
|
}, z.core.$strip>;
|
|
136
136
|
export type ToolCallComplete = z.infer<typeof toolCallCompleteSchema>;
|
|
137
|
-
export declare const filterResultSchema: z.ZodObject<{
|
|
138
|
-
id: z.ZodString;
|
|
139
|
-
timestamp: z.ZodNumber;
|
|
140
|
-
response_id: z.ZodString;
|
|
141
|
-
isRelevant: z.ZodBoolean;
|
|
142
|
-
reason: z.ZodString;
|
|
143
|
-
confidence: z.ZodNumber;
|
|
144
|
-
type: z.ZodLiteral<"FilterResult">;
|
|
145
|
-
}, z.core.$strip>;
|
|
146
|
-
export type FilterResult = z.infer<typeof filterResultSchema>;
|
|
147
137
|
export declare enum SandboxStage {
|
|
148
138
|
DOWNLOADING_SOURCE = "downloading_source",
|
|
149
139
|
BOOTING = "booting",
|
|
@@ -445,14 +435,6 @@ export declare const modelEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
445
435
|
timestamp: z.ZodNumber;
|
|
446
436
|
response_id: z.ZodString;
|
|
447
437
|
type: z.ZodLiteral<"NaturalStop">;
|
|
448
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
449
|
-
id: z.ZodString;
|
|
450
|
-
timestamp: z.ZodNumber;
|
|
451
|
-
response_id: z.ZodString;
|
|
452
|
-
isRelevant: z.ZodBoolean;
|
|
453
|
-
reason: z.ZodString;
|
|
454
|
-
confidence: z.ZodNumber;
|
|
455
|
-
type: z.ZodLiteral<"FilterResult">;
|
|
456
438
|
}, z.core.$strip>, z.ZodObject<{
|
|
457
439
|
id: z.ZodString;
|
|
458
440
|
timestamp: z.ZodNumber;
|
package/dist/ModelEvents.js
CHANGED
|
@@ -90,12 +90,6 @@ export const toolCallCompleteSchema = modelEventBaseSchema.extend({
|
|
|
90
90
|
result: z.string().optional(),
|
|
91
91
|
errorContext: sharedErrorContextSchema.optional()
|
|
92
92
|
});
|
|
93
|
-
export const filterResultSchema = modelEventBaseSchema.extend({
|
|
94
|
-
isRelevant: z.boolean(),
|
|
95
|
-
reason: z.string(),
|
|
96
|
-
confidence: z.number(),
|
|
97
|
-
type: z.literal("FilterResult")
|
|
98
|
-
});
|
|
99
93
|
export var SandboxStage;
|
|
100
94
|
(function (SandboxStage) {
|
|
101
95
|
SandboxStage["DOWNLOADING_SOURCE"] = "downloading_source";
|
|
@@ -188,7 +182,6 @@ export const modelEventSchema = z.discriminatedUnion("type", [
|
|
|
188
182
|
runErrorSchema,
|
|
189
183
|
cancelledSchema,
|
|
190
184
|
naturalStopSchema,
|
|
191
|
-
filterResultSchema,
|
|
192
185
|
userMessageSchema,
|
|
193
186
|
thinkingSchema,
|
|
194
187
|
modelEventChatSnippetSchema,
|