diff --git a/generated_types.json b/generated_types.json index be5cc0892..3d9798f92 100644 --- a/generated_types.json +++ b/generated_types.json @@ -534,6 +534,20 @@ "additionalProperties": { "$ref": "#/components/schemas/TriggeredFunctionState" } + }, + "last_triggered_xact_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "null" + } + ], + "description": "The xact_id of the last non-score change to this row (excludes scorer score merges)" } }, "required": ["status", "token", "function_ids"] @@ -599,14 +613,7 @@ "enum": ["batched_facet"] }, "preprocessor": { - "allOf": [ - { - "$ref": "#/components/schemas/NullableSavedFunctionId" - }, - { - "description": "The preprocessor function to use for facet extraction. If not provided, the project default preprocessor will be used, falling back to the global 'thread' preprocessor." - } - ] + "$ref": "#/components/schemas/FacetPreprocessorId" }, "facets": { "type": "array", @@ -2428,14 +2435,7 @@ "enum": ["facet"] }, "preprocessor": { - "allOf": [ - { - "$ref": "#/components/schemas/NullableSavedFunctionId" - }, - { - "description": "The preprocessor function to use for facet extraction. If not provided, the project default preprocessor will be used, falling back to the global 'thread' preprocessor." - } - ] + "$ref": "#/components/schemas/FacetPreprocessorId" }, "prompt": { "type": "string", @@ -2457,6 +2457,65 @@ "required": ["type", "prompt"], "title": "facet" }, + "FacetPreprocessorId": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["function"] + }, + "id": { + "type": "string" + }, + "version": { + "type": "string", + "description": "The version of the function" + } + }, + "required": ["type", "id"], + "title": "function" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["global"] + }, + "name": { + "type": "string" + }, + "function_type": { + "$ref": "#/components/schemas/FunctionTypeEnum" + } + }, + "required": ["type", "name"], + "title": "global" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["inline"] + }, + "code": { + "type": "string", + "minLength": 1, + "description": "The complete JavaScript preprocessor implementation, including its handler." + } + }, + "required": ["type", "code"], + "title": "preprocessor_inline" + }, + { + "type": "null" + } + ], + "description": "The saved, global, or inline preprocessor to use for facet extraction. If not provided, the project default preprocessor will be used, falling back to the global 'thread' preprocessor." + }, "Function": { "type": "object", "properties": { @@ -3944,6 +4003,9 @@ "OnlineScoreConfig": { "type": ["object", "null"], "properties": { + "status": { + "$ref": "#/components/schemas/AutomationStatus" + }, "sampling_rate": { "type": "number", "minimum": 0, @@ -4231,6 +4293,9 @@ "enum": ["logs"], "description": "The type of automation." }, + "status": { + "$ref": "#/components/schemas/AutomationStatus" + }, "btql_filter": { "type": "string", "description": "BTQL filter to identify rows for the automation rule" @@ -4254,6 +4319,12 @@ "url": { "type": "string", "description": "The webhook URL to send the request to" + }, + "formatting_prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "Instructions for Loop to format content sent to this destination" } }, "required": ["type", "url"] @@ -4277,6 +4348,12 @@ "message_template": { "type": "string", "description": "Custom message template for the alert" + }, + "formatting_prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "Instructions for Loop to format content sent to this destination" } }, "required": ["type", "workspace_id", "channel"] @@ -4506,6 +4583,9 @@ "enum": ["environment_update"], "description": "The type of automation." }, + "status": { + "$ref": "#/components/schemas/AutomationStatus" + }, "environment_filter": { "type": "array", "items": { @@ -4526,6 +4606,12 @@ "url": { "type": "string", "description": "The webhook URL to send the request to" + }, + "formatting_prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "Instructions for Loop to format content sent to this destination" } }, "required": ["type", "url"] @@ -4549,6 +4635,12 @@ "message_template": { "type": "string", "description": "Custom message template for the alert" + }, + "formatting_prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "Instructions for Loop to format content sent to this destination" } }, "required": ["type", "workspace_id", "channel"] @@ -4574,6 +4666,55 @@ }, "required": ["id", "project_id", "name", "config"] }, + "ProjectGroup": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "Unique identifier for the project group" + }, + "org_id": { + "type": "string", + "format": "uuid", + "description": "Unique id for the organization that the project group belongs under\n\nIt is forbidden to change the org after creating a project group" + }, + "user_id": { + "type": ["string", "null"], + "format": "uuid", + "description": "Identifies the user who created the project group" + }, + "created": { + "type": ["string", "null"], + "format": "date-time", + "description": "Date of project group creation" + }, + "name": { + "type": "string", + "description": "Name of the project group" + }, + "description": { + "type": ["string", "null"], + "description": "Textual description of the project group" + }, + "deleted_at": { + "type": ["string", "null"], + "format": "date-time", + "description": "Date of project group deletion, or null if the project group is still active" + }, + "member_projects": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "maxItems": 10000, + "description": "Sorted ids of active projects in this project group" + } + }, + "required": ["id", "org_id", "name", "member_projects"], + "description": "A project group is a collection of projects which can inherit access from project-group ACLs" + }, "ProjectLogsEvent": { "type": "object", "properties": { @@ -6523,6 +6664,12 @@ "message_template": { "type": "string", "description": "Custom message template for the alert" + }, + "formatting_prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "Instructions for Loop to format content sent to this destination" } }, "required": ["type", "workspace_id", "channel"], @@ -6621,7 +6768,7 @@ "properties": { "algorithm": { "type": "string", - "enum": ["hdbscan", "kmeans"] + "enum": ["hdbscan", "kmeans", "community"] }, "dimension_reduction": { "type": "string", @@ -6820,11 +6967,20 @@ "type": "string", "description": "Name of the view" }, + "description": { + "type": ["string", "null"], + "description": "Textual description of the view" + }, "created": { "type": ["string", "null"], "format": "date-time", "description": "Date of view creation" }, + "updated_at": { + "type": ["string", "null"], + "format": "date-time", + "description": "Date of last view update" + }, "view_data": { "$ref": "#/components/schemas/ViewData" }, @@ -7103,6 +7259,11 @@ "enum": ["windowed"], "description": "The type of automation." }, + "product_origin": { + "type": ["string", "null"], + "enum": ["patterns"], + "description": "The product surface that created and manages the automation" + }, "status": { "$ref": "#/components/schemas/AutomationStatus" }, @@ -7261,6 +7422,58 @@ "evaluation_delay_seconds" ] }, + "loop": { + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "Instructions for the Loop agent" + }, + "include_trigger_input": { + "type": "boolean", + "default": false, + "description": "Whether to include the automation trigger payload as input" + }, + "agent_slug": { + "type": "string", + "minLength": 1, + "description": "The Loop agent to run" + }, + "auto_approve_tools": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + }, + "default": [], + "description": "Write tools that may run without interactive approval" + }, + "harness": { + "type": "string", + "enum": ["native", "codex", "claude-code"] + }, + "model": { + "type": "string", + "minLength": 1 + }, + "reasoning_effort": { + "type": "string", + "enum": [ + "none", + "minimal", + "low", + "medium", + "high", + "xhigh", + "max" + ] + } + }, + "required": ["prompt", "agent_slug"], + "description": "Optional Loop agent to run for each triggered window" + }, "actions": { "type": "array", "items": { @@ -7276,6 +7489,12 @@ "url": { "type": "string", "description": "The webhook URL to send the request to" + }, + "formatting_prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "Instructions for Loop to format content sent to this destination" } }, "required": ["type", "url"] @@ -7299,6 +7518,12 @@ "message_template": { "type": "string", "description": "Custom message template for the alert" + }, + "formatting_prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "Instructions for Loop to format content sent to this destination" } }, "required": ["type", "workspace_id", "channel"] @@ -7306,12 +7531,12 @@ ], "description": "A delivery action available to an automation" }, - "minItems": 1, "maxItems": 20, - "description": "The delivery actions to run on each schedule or threshold lifecycle transition" + "default": [], + "description": "Delivery actions exposed to Loop as tools, or run directly when Loop is not configured" } }, - "required": ["event_type", "window", "actions"] + "required": ["event_type", "window"] } }, "parameters": {} diff --git a/js/src/generated_types.ts b/js/src/generated_types.ts index 797f75d7f..fd807dcc5 100644 --- a/js/src/generated_types.ts +++ b/js/src/generated_types.ts @@ -1,4 +1,4 @@ -// Auto-generated file (content hash 7d0333cc2dc03e50) -- do not modify +// Auto-generated file (content hash 776b6c295e852681) -- do not modify import { z } from "zod/v3"; @@ -172,6 +172,9 @@ export const AsyncScoringState = z.union([ triggered_functions: z .union([z.record(TriggeredFunctionState), z.null()]) .optional(), + last_triggered_xact_id: z + .union([z.string(), z.number(), z.null()]) + .optional(), }), z.object({ status: z.literal("disabled") }), z.null(), @@ -255,7 +258,7 @@ export const FunctionTypeEnum = z.enum([ "sandbox", ]); export type FunctionTypeEnumType = z.infer; -export const NullableSavedFunctionId = z.union([ +export const FacetPreprocessorId = z.union([ z.object({ type: z.literal("function"), id: z.string(), @@ -266,13 +269,12 @@ export const NullableSavedFunctionId = z.union([ name: z.string(), function_type: FunctionTypeEnum.optional().default("scorer"), }), + z.object({ type: z.literal("inline"), code: z.string().min(1) }), z.null(), ]); -export type NullableSavedFunctionIdType = z.infer< - typeof NullableSavedFunctionId ->; +export type FacetPreprocessorIdType = z.infer; export const TopicMapGenerationSettings = z.object({ - algorithm: z.enum(["hdbscan", "kmeans"]), + algorithm: z.enum(["hdbscan", "kmeans", "community"]), dimension_reduction: z.enum(["umap", "pca", "none"]), sample_size: z.number().int().gt(0).optional(), n_clusters: z.number().int().gt(0).optional(), @@ -301,7 +303,7 @@ export const TopicMapData = z.object({ export type TopicMapDataType = z.infer; export const BatchedFacetData = z.object({ type: z.literal("batched_facet"), - preprocessor: NullableSavedFunctionId.and(z.unknown()).optional(), + preprocessor: FacetPreprocessorId.optional(), facets: z.array( z.object({ name: z.string(), @@ -918,7 +920,7 @@ export type ExtendedSavedFunctionIdType = z.infer< >; export const FacetData = z.object({ type: z.literal("facet"), - preprocessor: NullableSavedFunctionId.and(z.unknown()).optional(), + preprocessor: FacetPreprocessorId.optional(), prompt: z.string(), model: z.string().optional(), embedding_model: z.string().optional(), @@ -1517,6 +1519,22 @@ export const MessageRole = z.enum([ "developer", ]); export type MessageRoleType = z.infer; +export const NullableSavedFunctionId = z.union([ + z.object({ + type: z.literal("function"), + id: z.string(), + version: z.string().optional(), + }), + z.object({ + type: z.literal("global"), + name: z.string(), + function_type: FunctionTypeEnum.optional().default("scorer"), + }), + z.null(), +]); +export type NullableSavedFunctionIdType = z.infer< + typeof NullableSavedFunctionId +>; export const ObjectReference = z.object({ object_type: z.enum([ "project_logs", @@ -1541,6 +1559,7 @@ export const TraceScope = z.object({ export type TraceScopeType = z.infer; export const OnlineScoreConfig = z.union([ z.object({ + status: AutomationStatus.optional(), sampling_rate: z.number().gte(0).lte(1), scorers: z.array(SavedFunctionId), btql_filter: z.union([z.string(), z.null()]).optional(), @@ -1633,6 +1652,7 @@ export const Project = z.object({ export type ProjectType = z.infer; export const WindowedAutomationConfig = z.object({ event_type: z.literal("windowed"), + product_origin: z.union([z.literal("patterns"), z.null()]).optional(), status: AutomationStatus.optional(), threshold: z .object({ @@ -1672,20 +1692,39 @@ export const WindowedAutomationConfig = z.object({ ]), evaluation_delay_seconds: z.number().int().gte(0).lte(2592000), }), + loop: z + .object({ + prompt: z.string().min(1).max(10000), + include_trigger_input: z.boolean().optional().default(false), + agent_slug: z.string().min(1), + auto_approve_tools: z.array(z.string().min(1)).optional().default([]), + harness: z.enum(["native", "codex", "claude-code"]).optional(), + model: z.string().min(1).optional(), + reasoning_effort: z + .enum(["none", "minimal", "low", "medium", "high", "xhigh", "max"]) + .optional(), + }) + .optional(), actions: z .array( z.union([ - z.object({ type: z.literal("webhook"), url: z.string() }), + z.object({ + type: z.literal("webhook"), + url: z.string(), + formatting_prompt: z.string().min(1).max(10000).optional(), + }), z.object({ type: z.literal("slack"), workspace_id: z.string(), channel: z.string(), message_template: z.string().optional(), + formatting_prompt: z.string().min(1).max(10000).optional(), }), ]), ) - .min(1) - .max(20), + .max(20) + .optional() + .default([]), }); export type WindowedAutomationConfigType = z.infer< typeof WindowedAutomationConfig @@ -1750,6 +1789,7 @@ export const TopicDigestAutomationConfig = z.object({ workspace_id: z.string(), channel: z.string(), message_template: z.string().optional(), + formatting_prompt: z.string().min(1).max(10000).optional(), }), topic_map_function_ids: z.array(z.string()).max(10).optional(), }); @@ -1766,15 +1806,21 @@ export const ProjectAutomation = z.object({ config: z.union([ z.object({ event_type: z.literal("logs"), + status: AutomationStatus.optional(), btql_filter: z.string(), interval_seconds: z.number().gte(1).lte(2592000), action: z.union([ - z.object({ type: z.literal("webhook"), url: z.string() }), + z.object({ + type: z.literal("webhook"), + url: z.string(), + formatting_prompt: z.string().min(1).max(10000).optional(), + }), z.object({ type: z.literal("slack"), workspace_id: z.string(), channel: z.string(), message_template: z.string().optional(), + formatting_prompt: z.string().min(1).max(10000).optional(), }), ]), }), @@ -1825,14 +1871,20 @@ export const ProjectAutomation = z.object({ }), z.object({ event_type: z.literal("environment_update"), + status: AutomationStatus.optional(), environment_filter: z.array(z.string()).optional(), action: z.union([ - z.object({ type: z.literal("webhook"), url: z.string() }), + z.object({ + type: z.literal("webhook"), + url: z.string(), + formatting_prompt: z.string().min(1).max(10000).optional(), + }), z.object({ type: z.literal("slack"), workspace_id: z.string(), channel: z.string(), message_template: z.string().optional(), + formatting_prompt: z.string().min(1).max(10000).optional(), }), ]), }), @@ -1842,6 +1894,17 @@ export const ProjectAutomation = z.object({ ]), }); export type ProjectAutomationType = z.infer; +export const ProjectGroup = z.object({ + id: z.string().uuid(), + org_id: z.string().uuid(), + user_id: z.union([z.string(), z.null()]).optional(), + created: z.union([z.string(), z.null()]).optional(), + name: z.string(), + description: z.union([z.string(), z.null()]).optional(), + deleted_at: z.union([z.string(), z.null()]).optional(), + member_projects: z.array(z.string().uuid()).max(10000), +}); +export type ProjectGroupType = z.infer; export const ProjectLogsEvent = z.object({ id: z.string(), _xact_id: z.string(), @@ -2329,7 +2392,9 @@ export const View = z.object({ "for_review_datasets", ]), name: z.string(), + description: z.union([z.string(), z.null()]).optional(), created: z.union([z.string(), z.null()]).optional(), + updated_at: z.union([z.string(), z.null()]).optional(), view_data: ViewData.optional(), options: ViewOptions.optional(), user_id: z.union([z.string(), z.null()]).optional(),