terse-types 0.0.46 → 0.0.47

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.
@@ -134,14 +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 enum SandboxStage {
138
- BOOTING = "booting",
139
- INSTALLING_DEPENDENCIES = "installing_dependencies",
140
- INSTALLING_CLI = "installing_cli",
141
- RUNNING = "running"
142
- }
143
- export declare const sandboxStageSchema: z.ZodEnum<typeof SandboxStage>;
144
- export declare const SANDBOX_STAGE_LABELS: Record<SandboxStage, string>;
145
137
  export declare const userMessageSchema: z.ZodObject<{
146
138
  id: z.ZodString;
147
139
  timestamp: z.ZodNumber;
@@ -90,20 +90,6 @@ export const toolCallCompleteSchema = modelEventBaseSchema.extend({
90
90
  result: z.string().optional(),
91
91
  errorContext: sharedErrorContextSchema.optional()
92
92
  });
93
- export var SandboxStage;
94
- (function (SandboxStage) {
95
- SandboxStage["BOOTING"] = "booting";
96
- SandboxStage["INSTALLING_DEPENDENCIES"] = "installing_dependencies";
97
- SandboxStage["INSTALLING_CLI"] = "installing_cli";
98
- SandboxStage["RUNNING"] = "running";
99
- })(SandboxStage || (SandboxStage = {}));
100
- export const sandboxStageSchema = z.enum(SandboxStage);
101
- export const SANDBOX_STAGE_LABELS = {
102
- [SandboxStage.BOOTING]: "Booting sandbox",
103
- [SandboxStage.INSTALLING_DEPENDENCIES]: "Installing dependencies",
104
- [SandboxStage.INSTALLING_CLI]: "Installing CLI",
105
- [SandboxStage.RUNNING]: "Running agent"
106
- };
107
93
  export const userMessageSchema = modelEventBaseSchema.extend({
108
94
  type: z.literal("UserMessage"),
109
95
  message: z.string(),
@@ -817,14 +817,6 @@ const TOOL_DISPLAY_CONFIG = {
817
817
  return `Query plan retrieved (${rowCount} step${rowCount !== 1 ? "s" : ""})`;
818
818
  return "Query plan retrieved";
819
819
  }
820
- },
821
- // ===================
822
- // Sandbox Lifecycle
823
- // ===================
824
- "Running agent": {
825
- preparing: "Running agent",
826
- executing: () => "Running agent",
827
- complete: (_params, result) => `Agent finished${result ? ` (${result})` : ""}`
828
820
  }
829
821
  };
830
822
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "terse-types",
3
- "version": "0.0.46",
3
+ "version": "0.0.47",
4
4
  "type": "module",
5
5
  "description": "Shared Terse TypeScript types, enums, constants, and helpers.",
6
6
  "main": "./dist/index.js",
@@ -1,19 +0,0 @@
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;
@@ -1,71 +0,0 @@
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
- }
@@ -1,6 +0,0 @@
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>;
@@ -1,10 +0,0 @@
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
- });