@sixb/server 0.1.3 → 0.1.4

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.
Files changed (46) hide show
  1. package/README.md +1 -1
  2. package/dist/index.js +1111 -934
  3. package/dist/index.js.map +15 -13
  4. package/dist/openapi/tags.d.ts +6 -2
  5. package/dist/openapi/tags.d.ts.map +1 -1
  6. package/dist/registerRoutes.d.ts.map +1 -1
  7. package/dist/routes/agents.d.ts +15 -0
  8. package/dist/routes/agents.d.ts.map +1 -1
  9. package/dist/routes/links.d.ts +0 -51
  10. package/dist/routes/links.d.ts.map +1 -1
  11. package/dist/routes/logs.d.ts +1 -1
  12. package/dist/routes/models.d.ts +60 -0
  13. package/dist/routes/models.d.ts.map +1 -0
  14. package/dist/routes/objects.d.ts +48 -0
  15. package/dist/routes/objects.d.ts.map +1 -1
  16. package/dist/routes/projections.d.ts +88 -86
  17. package/dist/routes/projections.d.ts.map +1 -1
  18. package/dist/routes/syncs.d.ts +32 -32
  19. package/dist/schemas/agents.d.ts +127 -0
  20. package/dist/schemas/agents.d.ts.map +1 -1
  21. package/dist/schemas/ai-accounting.d.ts +26 -26
  22. package/dist/schemas/connectors.d.ts +11 -1
  23. package/dist/schemas/connectors.d.ts.map +1 -1
  24. package/dist/schemas/links.d.ts +0 -41
  25. package/dist/schemas/links.d.ts.map +1 -1
  26. package/dist/schemas/logs.d.ts +4 -4
  27. package/dist/schemas/models.d.ts +50 -0
  28. package/dist/schemas/models.d.ts.map +1 -0
  29. package/dist/schemas/objects.d.ts +22 -0
  30. package/dist/schemas/objects.d.ts.map +1 -1
  31. package/dist/schemas/projections.d.ts +542 -513
  32. package/dist/schemas/projections.d.ts.map +1 -1
  33. package/dist/schemas/syncs.d.ts +23 -23
  34. package/package.json +4 -4
  35. package/src/openapi/tags.ts +4 -0
  36. package/src/registerRoutes.ts +2 -0
  37. package/src/routes/agents.ts +21 -3
  38. package/src/routes/links.ts +2 -53
  39. package/src/routes/models.ts +31 -0
  40. package/src/routes/objects.ts +103 -0
  41. package/src/schemas/agents.ts +15 -0
  42. package/src/schemas/connectors.ts +13 -3
  43. package/src/schemas/links.ts +0 -17
  44. package/src/schemas/models.ts +15 -0
  45. package/src/schemas/objects.ts +104 -0
  46. package/src/schemas/projections.ts +6 -3
package/dist/index.js CHANGED
@@ -687,6 +687,10 @@ var OPENAPI_TAGS = {
687
687
  name: "Agents",
688
688
  description: "Agent catalog"
689
689
  },
690
+ models: {
691
+ name: "Models",
692
+ description: "Project model catalog"
693
+ },
690
694
  agentThreads: {
691
695
  name: "Agent Threads",
692
696
  description: "Agent conversation threads and messages"
@@ -2693,6 +2697,11 @@ var AgentContextPartSchema = AgentContextEntryInputSchema.extend({
2693
2697
  var AgentLoopConfigSchema = z8.object({
2694
2698
  stopWhen: z8.object({
2695
2699
  maxSteps: z8.number().int().positive().optional()
2700
+ }).optional(),
2701
+ context: z8.object({
2702
+ windowTokens: z8.number().int().positive().optional(),
2703
+ reserveTokens: z8.number().int().positive().optional(),
2704
+ keepRecentTokens: z8.number().int().positive().optional()
2696
2705
  }).optional()
2697
2706
  });
2698
2707
  var AgentReasoningLevelSchema = z8.enum(AGENT_REASONING_LEVELS);
@@ -2791,6 +2800,11 @@ var AgentRunDiagnosticSchema = z8.object({
2791
2800
  path: z8.string().optional(),
2792
2801
  message: z8.string()
2793
2802
  });
2803
+ var AgentMessageCompactionSchema = z8.object({
2804
+ checkpointId: z8.string(),
2805
+ summary: z8.string(),
2806
+ createdAt: z8.string()
2807
+ });
2794
2808
  var AgentMessageSchema = z8.object({
2795
2809
  id: z8.string(),
2796
2810
  projectId: z8.string(),
@@ -2801,6 +2815,7 @@ var AgentMessageSchema = z8.object({
2801
2815
  seq: z8.number(),
2802
2816
  parts: z8.array(AgentMessagePartSchema),
2803
2817
  annotations: z8.array(AgentRunDiagnosticSchema),
2818
+ compaction: AgentMessageCompactionSchema.optional(),
2804
2819
  metadata: JsonValueSchema.optional(),
2805
2820
  contentVersion: z8.number(),
2806
2821
  createdAt: z8.string(),
@@ -2905,7 +2920,7 @@ function serializeThread(thread) {
2905
2920
  updatedAt: toIsoString(thread.updatedAt)
2906
2921
  });
2907
2922
  }
2908
- function serializeMessage(message, annotations = []) {
2923
+ function serializeMessage(message, annotations = [], checkpoint) {
2909
2924
  return AgentMessageSchema.parse({
2910
2925
  id: message.id,
2911
2926
  projectId: message.projectId,
@@ -2916,6 +2931,11 @@ function serializeMessage(message, annotations = []) {
2916
2931
  seq: message.seq,
2917
2932
  parts: message.parts,
2918
2933
  annotations,
2934
+ compaction: checkpoint ? {
2935
+ checkpointId: checkpoint.id,
2936
+ summary: checkpoint.summary,
2937
+ createdAt: toIsoString(checkpoint.createdAt)
2938
+ } : undefined,
2919
2939
  metadata: message.metadata,
2920
2940
  contentVersion: message.contentVersion,
2921
2941
  createdAt: toIsoString(message.createdAt),
@@ -3200,10 +3220,14 @@ function registerAgentRoutes(app, host) {
3200
3220
  order: parsed.order
3201
3221
  });
3202
3222
  const runIds = result.messages.flatMap((message) => message.runId === null ? [] : [message.runId]);
3203
- const runs = await storage.runs.getByIds({ projectId: host.id, ids: runIds });
3223
+ const [runs, checkpoints] = await Promise.all([
3224
+ storage.runs.getByIds({ projectId: host.id, ids: runIds }),
3225
+ storage.checkpoints.getByRunIds({ projectId: host.id, runIds })
3226
+ ]);
3204
3227
  const diagnosticsByRunId = new Map(runs.filter((run) => run.threadId === thread.id).map((run) => [run.id, run.diagnostics ?? []]));
3228
+ const checkpointsByRunId = new Map(checkpoints.filter((checkpoint) => checkpoint.threadId === thread.id).map((checkpoint) => [checkpoint.createdByRunId, checkpoint]));
3205
3229
  return AgentMessageListResponseSchema.parse({
3206
- messages: result.messages.map((message) => serializeMessage(message, message.runId === null ? [] : diagnosticsByRunId.get(message.runId) ?? [])),
3230
+ messages: result.messages.map((message) => serializeMessage(message, message.runId === null ? [] : diagnosticsByRunId.get(message.runId) ?? [], message.runId === null ? undefined : checkpointsByRunId.get(message.runId))),
3207
3231
  hasMore: result.hasMore,
3208
3232
  total: result.total
3209
3233
  });
@@ -3846,9 +3870,11 @@ var ConnectorOAuthCallbackQuerySchema = z10.object({
3846
3870
  code: z10.string().min(1).optional(),
3847
3871
  auth_code: z10.string().min(1).optional(),
3848
3872
  error: z10.string().min(1).optional()
3849
- }).refine((query) => [query.code, query.auth_code, query.error].filter(Boolean).length === 1, {
3850
- message: "OAuth callback must contain exactly one of code, auth_code, or error."
3851
- }).transform(({ auth_code, ...query }) => ({ ...query, code: query.code ?? auth_code }));
3873
+ }).refine((query) => {
3874
+ const hasAuthorizationCode = query.code !== undefined || query.auth_code !== undefined;
3875
+ const hasProviderError = query.error !== undefined;
3876
+ return hasAuthorizationCode !== hasProviderError;
3877
+ }, { message: "OAuth callback must contain exactly one of an authorization code or error." }).refine((query) => query.code === undefined || query.auth_code === undefined || query.code === query.auth_code, { message: "OAuth callback code and auth_code must match when both are present." }).transform(({ auth_code, ...query }) => ({ ...query, code: query.code ?? auth_code }));
3852
3878
  function connectorRouteErrorResponseSchema(codes) {
3853
3879
  return ErrorResponseSchema.extend({
3854
3880
  code: z10.enum(codes).optional().describe("Stable machine-readable failure code for programmatic handling.")
@@ -4878,10 +4904,6 @@ var LinkSourceParamsSchema = z14.object({
4878
4904
  var LinkParamsSchema = LinkSourceParamsSchema.extend({
4879
4905
  linkId: z14.string().min(1)
4880
4906
  });
4881
- var LinkQuerySchema = z14.object({
4882
- linkId: z14.string().optional(),
4883
- direction: z14.enum(["outgoing", "incoming", "both"]).default("outgoing")
4884
- });
4885
4907
  var RemoveLinkQuerySchema = z14.object({
4886
4908
  targetTypeId: z14.string().min(1),
4887
4909
  targetId: z14.string().min(1)
@@ -4891,59 +4913,10 @@ var UpsertLinkBodySchema = z14.object({
4891
4913
  targetId: z14.string().min(1),
4892
4914
  properties: z14.record(z14.unknown()).optional()
4893
4915
  });
4894
- var ObjectLinkSchema = z14.object({
4895
- projectId: z14.string(),
4896
- sourceTypeId: z14.string(),
4897
- sourceId: z14.string(),
4898
- linkId: z14.string(),
4899
- targetTypeId: z14.string(),
4900
- targetId: z14.string(),
4901
- properties: z14.record(z14.unknown()).optional(),
4902
- createdAt: z14.string(),
4903
- updatedAt: z14.string()
4904
- });
4905
4916
 
4906
4917
  // src/routes/links.ts
4907
4918
  function registerLinkRoutes(app, _host) {
4908
- return app.get("/api/objects/:objectTypeId/:objectId/links", async (context) => {
4909
- const { params, query, set } = context;
4910
- try {
4911
- const sixb = requireRequestSixb(context);
4912
- if (!sixb.objects.getTypeById(params.objectTypeId)) {
4913
- set.status = 404;
4914
- return { error: "Object not found" };
4915
- }
4916
- const parsedQuery = LinkQuerySchema.parse(query);
4917
- const links = await sixb.objects.listLinks({
4918
- objectTypeId: params.objectTypeId,
4919
- objectId: params.objectId,
4920
- linkId: parsedQuery.linkId,
4921
- direction: parsedQuery.direction
4922
- });
4923
- return links.map((link) => ({
4924
- ...link,
4925
- createdAt: toIsoString(link.createdAt),
4926
- updatedAt: toIsoString(link.updatedAt)
4927
- }));
4928
- } catch (error) {
4929
- set.status = 400;
4930
- return { error: error instanceof Error ? error.message : String(error) };
4931
- }
4932
- }, {
4933
- params: LinkSourceParamsSchema,
4934
- query: LinkQuerySchema,
4935
- response: {
4936
- 200: ObjectLinkSchema.array(),
4937
- 400: ErrorResponseSchema,
4938
- 404: ErrorResponseSchema
4939
- },
4940
- detail: {
4941
- summary: "List object links",
4942
- tags: [OPENAPI_TAGS.links.name],
4943
- operationId: "listObjectLinks",
4944
- security: bearerSecurityRequirement("listObjectLinks")
4945
- }
4946
- }).put("/api/objects/:objectTypeId/:objectId/links/:linkId", async (context) => {
4919
+ return app.put("/api/objects/:objectTypeId/:objectId/links/:linkId", async (context) => {
4947
4920
  const { params, body, set } = context;
4948
4921
  try {
4949
4922
  const parsedBody = UpsertLinkBodySchema.parse(body);
@@ -5114,6 +5087,37 @@ function registerLogRoutes(app, _host) {
5114
5087
  });
5115
5088
  }
5116
5089
 
5090
+ // src/schemas/models.ts
5091
+ import { z as z16 } from "zod";
5092
+ var LanguageModelSchema = z16.object({
5093
+ provider: z16.string(),
5094
+ modelId: z16.string(),
5095
+ isDefault: z16.boolean()
5096
+ });
5097
+ var ModelCatalogSchema = z16.object({
5098
+ language: z16.array(LanguageModelSchema)
5099
+ });
5100
+
5101
+ // src/routes/models.ts
5102
+ function serializeLanguageModel(entry, defaultRef) {
5103
+ return { provider: entry.provider, modelId: entry.modelId, isDefault: entry.ref === defaultRef };
5104
+ }
5105
+ function registerModelRoutes(app, host) {
5106
+ return app.get("/api/models", () => {
5107
+ const language = host.definitions.models?.language;
5108
+ return ModelCatalogSchema.parse({
5109
+ language: language === undefined ? [] : language.list().map((entry) => serializeLanguageModel(entry, language.default.ref))
5110
+ });
5111
+ }, {
5112
+ response: { 200: ModelCatalogSchema },
5113
+ detail: {
5114
+ summary: "List the project model catalog",
5115
+ tags: [OPENAPI_TAGS.models.name],
5116
+ operationId: "listModels"
5117
+ }
5118
+ });
5119
+ }
5120
+
5117
5121
  // src/routes/objects.ts
5118
5122
  import {
5119
5123
  AuthorizationError as AuthorizationError3,
@@ -5121,35 +5125,35 @@ import {
5121
5125
  ObjectQueryPlanningError,
5122
5126
  ObjectQueryValidationError
5123
5127
  } from "@sixb/core";
5124
- import { ZodError as ZodError3, z as z17 } from "zod";
5128
+ import { ZodError as ZodError3, z as z18 } from "zod";
5125
5129
 
5126
5130
  // src/schemas/objects.ts
5127
- import { z as z16 } from "zod";
5128
- var ObjectParamsSchema = z16.object({
5129
- objectTypeId: z16.string().min(1),
5130
- objectId: z16.string().min(1)
5131
- });
5132
- var ObjectSearchQuerySchema = z16.object({
5133
- q: z16.string().trim().min(1).max(200),
5134
- limit: z16.string().regex(/^\d+$/).optional()
5135
- });
5136
- var ObjectSearchResponseSchema = z16.object({
5137
- items: z16.array(z16.object({
5138
- ref: z16.object({
5139
- objectTypeId: z16.string(),
5140
- primaryId: z16.string()
5131
+ import { z as z17 } from "zod";
5132
+ var ObjectParamsSchema = z17.object({
5133
+ objectTypeId: z17.string().min(1),
5134
+ objectId: z17.string().min(1)
5135
+ });
5136
+ var ObjectSearchQuerySchema = z17.object({
5137
+ q: z17.string().trim().min(1).max(200),
5138
+ limit: z17.string().regex(/^\d+$/).optional()
5139
+ });
5140
+ var ObjectSearchResponseSchema = z17.object({
5141
+ items: z17.array(z17.object({
5142
+ ref: z17.object({
5143
+ objectTypeId: z17.string(),
5144
+ primaryId: z17.string()
5141
5145
  }),
5142
- label: z16.string()
5146
+ label: z17.string()
5143
5147
  }))
5144
5148
  });
5145
5149
  var OBJECT_LIST_MAX_LIMIT = 1000;
5146
- var Rfc3339DateSchema = z16.string().datetime({ offset: true });
5150
+ var Rfc3339DateSchema = z17.string().datetime({ offset: true });
5147
5151
  function objectListDateSchema(parameter) {
5148
- return z16.string().refine((value) => Rfc3339DateSchema.safeParse(value).success, {
5152
+ return z17.string().refine((value) => Rfc3339DateSchema.safeParse(value).success, {
5149
5153
  message: `Invalid query parameter '${parameter}': expected an RFC 3339 timestamp.`
5150
5154
  }).transform((value) => new Date(value));
5151
5155
  }
5152
- var ObjectListLimitSchema = z16.string().refine((value) => {
5156
+ var ObjectListLimitSchema = z17.string().refine((value) => {
5153
5157
  if (!/^\d+$/.test(value))
5154
5158
  return false;
5155
5159
  const parsed = Number(value);
@@ -5157,25 +5161,25 @@ var ObjectListLimitSchema = z16.string().refine((value) => {
5157
5161
  }, {
5158
5162
  message: `Invalid query parameter 'limit': expected an integer between 0 and ${OBJECT_LIST_MAX_LIMIT}.`
5159
5163
  }).transform(Number);
5160
- var ObjectListOffsetSchema = z16.string().refine((value) => /^\d+$/.test(value) && Number.isSafeInteger(Number(value)), {
5164
+ var ObjectListOffsetSchema = z17.string().refine((value) => /^\d+$/.test(value) && Number.isSafeInteger(Number(value)), {
5161
5165
  message: "Invalid query parameter 'offset': expected a non-negative safe integer."
5162
5166
  }).transform(Number);
5163
- var ObjectsQuerySchema = z16.object({
5164
- objectTypeId: z16.string().optional(),
5165
- idPrefix: z16.string().optional(),
5166
- idSuffix: z16.string().optional(),
5167
+ var ObjectsQuerySchema = z17.object({
5168
+ objectTypeId: z17.string().optional(),
5169
+ idPrefix: z17.string().optional(),
5170
+ idSuffix: z17.string().optional(),
5167
5171
  updatedAfter: objectListDateSchema("updatedAfter").optional(),
5168
5172
  updatedBefore: objectListDateSchema("updatedBefore").optional(),
5169
5173
  createdAfter: objectListDateSchema("createdAfter").optional(),
5170
5174
  createdBefore: objectListDateSchema("createdBefore").optional(),
5171
5175
  limit: ObjectListLimitSchema.optional(),
5172
5176
  offset: ObjectListOffsetSchema.optional(),
5173
- orderBy: z16.enum(["createdAt", "updatedAt", "primaryId"], {
5177
+ orderBy: z17.enum(["createdAt", "updatedAt", "primaryId"], {
5174
5178
  errorMap: () => ({
5175
5179
  message: "Invalid query parameter 'orderBy': expected one of createdAt, updatedAt, or primaryId."
5176
5180
  })
5177
5181
  }).optional(),
5178
- order: z16.enum(["asc", "desc"], {
5182
+ order: z17.enum(["asc", "desc"], {
5179
5183
  errorMap: () => ({
5180
5184
  message: "Invalid query parameter 'order': expected 'asc' or 'desc'."
5181
5185
  })
@@ -5183,163 +5187,178 @@ var ObjectsQuerySchema = z16.object({
5183
5187
  }).superRefine((query, context) => {
5184
5188
  if (query.updatedAfter && query.updatedBefore && query.updatedAfter > query.updatedBefore) {
5185
5189
  context.addIssue({
5186
- code: z16.ZodIssueCode.custom,
5190
+ code: z17.ZodIssueCode.custom,
5187
5191
  path: ["updatedAfter"],
5188
5192
  message: "Invalid query parameter range: 'updatedAfter' must be before or equal to 'updatedBefore'."
5189
5193
  });
5190
5194
  }
5191
5195
  if (query.createdAfter && query.createdBefore && query.createdAfter > query.createdBefore) {
5192
5196
  context.addIssue({
5193
- code: z16.ZodIssueCode.custom,
5197
+ code: z17.ZodIssueCode.custom,
5194
5198
  path: ["createdAfter"],
5195
5199
  message: "Invalid query parameter range: 'createdAfter' must be before or equal to 'createdBefore'."
5196
5200
  });
5197
5201
  }
5198
5202
  });
5199
- var UpsertObjectBodySchema = z16.object({
5200
- properties: z16.record(z16.unknown())
5203
+ var UpsertObjectBodySchema = z17.object({
5204
+ properties: z17.record(z17.unknown())
5201
5205
  });
5202
- var ObjectQueryPredicateSchema = z16.lazy(() => z16.union([
5203
- z16.object({
5204
- op: z16.enum(["and", "or"]),
5205
- items: z16.array(ObjectQueryPredicateSchema)
5206
+ var ObjectQueryPredicateSchema = z17.lazy(() => z17.union([
5207
+ z17.object({
5208
+ op: z17.enum(["and", "or"]),
5209
+ items: z17.array(ObjectQueryPredicateSchema)
5206
5210
  }).strict(),
5207
- z16.object({
5208
- op: z16.literal("not"),
5211
+ z17.object({
5212
+ op: z17.literal("not"),
5209
5213
  item: ObjectQueryPredicateSchema
5210
5214
  }).strict(),
5211
- z16.object({
5212
- op: z16.enum(["eq", "neq", "lt", "lte", "gt", "gte"]),
5213
- propertyId: z16.string().min(1),
5215
+ z17.object({
5216
+ op: z17.enum(["eq", "neq", "lt", "lte", "gt", "gte"]),
5217
+ propertyId: z17.string().min(1),
5214
5218
  value: JsonValueSchema
5215
5219
  }).strict(),
5216
- z16.object({
5217
- op: z16.literal("in"),
5218
- propertyId: z16.string().min(1),
5219
- values: z16.array(JsonValueSchema)
5220
+ z17.object({
5221
+ op: z17.literal("in"),
5222
+ propertyId: z17.string().min(1),
5223
+ values: z17.array(JsonValueSchema)
5220
5224
  }).strict(),
5221
- z16.object({
5222
- op: z16.literal("exists"),
5223
- propertyId: z16.string().min(1),
5224
- value: z16.boolean()
5225
+ z17.object({
5226
+ op: z17.literal("exists"),
5227
+ propertyId: z17.string().min(1),
5228
+ value: z17.boolean()
5225
5229
  }).strict(),
5226
- z16.object({
5227
- op: z16.literal("contains"),
5228
- propertyId: z16.string().min(1),
5230
+ z17.object({
5231
+ op: z17.literal("contains"),
5232
+ propertyId: z17.string().min(1),
5229
5233
  value: JsonValueSchema
5230
5234
  }).strict()
5231
5235
  ]));
5232
- var ObjectQuerySortFieldSchema = z16.union([
5233
- z16.object({
5234
- kind: z16.literal("property"),
5235
- propertyId: z16.string().min(1),
5236
- direction: z16.enum(["asc", "desc"]).optional()
5236
+ var ObjectQuerySortFieldSchema = z17.union([
5237
+ z17.object({
5238
+ kind: z17.literal("property"),
5239
+ propertyId: z17.string().min(1),
5240
+ direction: z17.enum(["asc", "desc"]).optional()
5237
5241
  }).strict(),
5238
- z16.object({
5239
- kind: z16.literal("relevance"),
5240
- direction: z16.enum(["asc", "desc"]).optional()
5242
+ z17.object({
5243
+ kind: z17.literal("relevance"),
5244
+ direction: z17.enum(["asc", "desc"]).optional()
5241
5245
  }).strict()
5242
5246
  ]);
5243
- var ObjectExpansionSchema = z16.lazy(() => z16.object({
5244
- linkId: z16.string().min(1),
5245
- direction: z16.enum(["outgoing", "incoming"]),
5246
- sourceObjectTypeId: z16.string().min(1).optional(),
5247
- limit: z16.number().int().nonnegative().optional(),
5248
- orderBy: z16.array(ObjectQuerySortFieldSchema).optional(),
5249
- expand: z16.array(ObjectExpansionSchema).optional()
5247
+ var ObjectExpansionSchema = z17.lazy(() => z17.object({
5248
+ linkId: z17.string().min(1),
5249
+ direction: z17.enum(["outgoing", "incoming"]),
5250
+ sourceObjectTypeId: z17.string().min(1).optional(),
5251
+ limit: z17.number().int().nonnegative().optional(),
5252
+ orderBy: z17.array(ObjectQuerySortFieldSchema).optional(),
5253
+ expand: z17.array(ObjectExpansionSchema).optional()
5250
5254
  }).strict());
5251
- var ObjectQuerySchema = z16.lazy(() => z16.discriminatedUnion("kind", [
5252
- z16.object({
5253
- kind: z16.literal("start"),
5254
- objectTypeId: z16.string().min(1),
5255
- includeSubtypes: z16.boolean().optional()
5255
+ var ObjectQuerySchema = z17.lazy(() => z17.discriminatedUnion("kind", [
5256
+ z17.object({
5257
+ kind: z17.literal("start"),
5258
+ objectTypeId: z17.string().min(1),
5259
+ includeSubtypes: z17.boolean().optional()
5256
5260
  }).strict(),
5257
- z16.object({
5258
- kind: z16.literal("filter"),
5261
+ z17.object({
5262
+ kind: z17.literal("refs"),
5263
+ refs: z17.array(z17.object({
5264
+ objectTypeId: z17.string().min(1),
5265
+ primaryId: z17.string().min(1)
5266
+ }).strict())
5267
+ }).strict(),
5268
+ z17.object({
5269
+ kind: z17.literal("filter"),
5259
5270
  input: ObjectQuerySchema,
5260
5271
  predicate: ObjectQueryPredicateSchema
5261
5272
  }).strict(),
5262
- z16.object({
5263
- kind: z16.literal("text"),
5273
+ z17.object({
5274
+ kind: z17.literal("text"),
5264
5275
  input: ObjectQuerySchema,
5265
- query: z16.string(),
5266
- fields: z16.array(z16.string().min(1)).optional()
5276
+ query: z17.string(),
5277
+ fields: z17.array(z17.string().min(1)).optional()
5267
5278
  }).strict(),
5268
- z16.object({
5269
- kind: z16.literal("vector"),
5279
+ z17.object({
5280
+ kind: z17.literal("vector"),
5270
5281
  input: ObjectQuerySchema,
5271
- vector: z16.array(z16.number().finite()),
5272
- propertyId: z16.string().min(1),
5273
- k: z16.number().int().positive()
5282
+ vector: z17.array(z17.number().finite()),
5283
+ propertyId: z17.string().min(1),
5284
+ k: z17.number().int().positive()
5274
5285
  }).strict(),
5275
- z16.object({
5276
- kind: z16.literal("traverse"),
5286
+ z17.object({
5287
+ kind: z17.literal("traverse"),
5277
5288
  input: ObjectQuerySchema,
5278
- linkId: z16.string().min(1),
5279
- direction: z16.enum(["outgoing", "incoming"]),
5280
- sourceObjectTypeId: z16.string().min(1).optional()
5289
+ linkId: z17.string().min(1),
5290
+ direction: z17.enum(["outgoing", "incoming"]),
5291
+ sourceObjectTypeId: z17.string().min(1).optional()
5281
5292
  }).strict(),
5282
- z16.object({
5283
- kind: z16.literal("set"),
5284
- op: z16.enum(["union", "intersect", "subtract"]),
5285
- inputs: z16.array(ObjectQuerySchema)
5293
+ z17.object({
5294
+ kind: z17.literal("set"),
5295
+ op: z17.enum(["union", "intersect", "subtract"]),
5296
+ inputs: z17.array(ObjectQuerySchema)
5286
5297
  }).strict(),
5287
- z16.object({
5288
- kind: z16.literal("sort"),
5298
+ z17.object({
5299
+ kind: z17.literal("sort"),
5289
5300
  input: ObjectQuerySchema,
5290
- fields: z16.array(ObjectQuerySortFieldSchema)
5301
+ fields: z17.array(ObjectQuerySortFieldSchema)
5291
5302
  }).strict(),
5292
- z16.object({
5293
- kind: z16.literal("limit"),
5303
+ z17.object({
5304
+ kind: z17.literal("limit"),
5294
5305
  input: ObjectQuerySchema,
5295
- limit: z16.number().int().nonnegative()
5306
+ limit: z17.number().int().nonnegative()
5296
5307
  }).strict(),
5297
- z16.object({
5298
- kind: z16.literal("page"),
5308
+ z17.object({
5309
+ kind: z17.literal("page"),
5299
5310
  input: ObjectQuerySchema,
5300
- pageSize: z16.number().int().positive(),
5301
- pageToken: z16.string().optional()
5311
+ pageSize: z17.number().int().positive(),
5312
+ pageToken: z17.string().optional()
5302
5313
  }).strict(),
5303
- z16.object({
5304
- kind: z16.literal("project"),
5314
+ z17.object({
5315
+ kind: z17.literal("project"),
5305
5316
  input: ObjectQuerySchema,
5306
- properties: z16.array(z16.string().min(1)).optional()
5317
+ properties: z17.array(z17.string().min(1)).optional()
5307
5318
  }).strict(),
5308
- z16.object({
5309
- kind: z16.literal("expand"),
5319
+ z17.object({
5320
+ kind: z17.literal("expand"),
5310
5321
  input: ObjectQuerySchema,
5311
- expansions: z16.array(ObjectExpansionSchema)
5322
+ expansions: z17.array(ObjectExpansionSchema)
5312
5323
  }).strict()
5313
5324
  ]));
5314
- var ObjectQueryRequestSchema = z16.object({
5325
+ var ObjectQueryRequestSchema = z17.object({
5315
5326
  query: ObjectQuerySchema,
5316
- includeTotal: z16.boolean().optional()
5327
+ includeTotal: z17.boolean().optional()
5317
5328
  }).strict();
5318
- var ObjectQueryCountRequestSchema = z16.object({
5329
+ var ObjectQueryCountRequestSchema = z17.object({
5319
5330
  query: ObjectQuerySchema
5320
5331
  }).strict();
5321
- var ObjectQueryExistsRequestSchema = z16.object({
5332
+ var ObjectQueryExistsRequestSchema = z17.object({
5322
5333
  query: ObjectQuerySchema
5323
5334
  }).strict();
5324
- var ObjectQueryFacetRequestSchema = z16.object({
5325
- propertyId: z16.string().min(1),
5326
- limit: z16.number().int().positive()
5335
+ var ObjectQueryFacetRequestSchema = z17.object({
5336
+ propertyId: z17.string().min(1),
5337
+ limit: z17.number().int().positive()
5338
+ }).strict();
5339
+ var ObjectQueryFacetsRequestSchema = z17.object({
5340
+ query: ObjectQuerySchema,
5341
+ facets: z17.array(ObjectQueryFacetRequestSchema).min(1)
5327
5342
  }).strict();
5328
- var ObjectQueryFacetsRequestSchema = z16.object({
5343
+ var ObjectQueryLinksRequestSchema = z17.object({
5329
5344
  query: ObjectQuerySchema,
5330
- facets: z16.array(ObjectQueryFacetRequestSchema).min(1)
5345
+ direction: z17.enum(["outgoing", "incoming", "both"]).default("both"),
5346
+ linkId: z17.string().min(1).optional(),
5347
+ includeObjects: z17.boolean().default(false),
5348
+ pageSize: z17.number().int().positive().max(1000).default(100),
5349
+ pageToken: z17.string().min(1).optional()
5331
5350
  }).strict();
5332
- var TwinObjectSchema = z16.object({
5333
- primaryId: z16.string(),
5334
- objectTypeId: z16.string(),
5335
- properties: z16.record(z16.unknown()),
5336
- createdAt: z16.string(),
5337
- updatedAt: z16.string()
5338
- });
5339
- var ObjectListResponseSchema = z16.object({
5340
- objects: z16.array(TwinObjectSchema),
5341
- hasMore: z16.boolean(),
5342
- total: z16.number()
5351
+ var TwinObjectSchema = z17.object({
5352
+ primaryId: z17.string(),
5353
+ objectTypeId: z17.string(),
5354
+ properties: z17.record(z17.unknown()),
5355
+ createdAt: z17.string(),
5356
+ updatedAt: z17.string()
5357
+ });
5358
+ var ObjectListResponseSchema = z17.object({
5359
+ objects: z17.array(TwinObjectSchema),
5360
+ hasMore: z17.boolean(),
5361
+ total: z17.number()
5343
5362
  });
5344
5363
  var anyJsonValueSchema = {};
5345
5364
  var stringArraySchema = { type: "array", items: { type: "string", minLength: 1 } };
@@ -5347,6 +5366,7 @@ var objectQueryRef = { $ref: "#/components/schemas/ObjectQuery" };
5347
5366
  var objectQueryPredicateRef = { $ref: "#/components/schemas/ObjectQueryPredicate" };
5348
5367
  var objectQuerySortFieldRef = { $ref: "#/components/schemas/ObjectQuerySortField" };
5349
5368
  var objectExpansionRef = { $ref: "#/components/schemas/ObjectExpansion" };
5369
+ var objectRefSchemaRef = { $ref: "#/components/schemas/ObjectRef" };
5350
5370
  var ObjectQueryOpenApiSchemas = {
5351
5371
  ErrorResponse: {
5352
5372
  type: "object",
@@ -5485,6 +5505,38 @@ var ObjectQueryOpenApiSchemas = {
5485
5505
  plan: { $ref: "#/components/schemas/ObjectQueryPlanSummary" }
5486
5506
  }
5487
5507
  },
5508
+ ObjectQueryLink: {
5509
+ type: "object",
5510
+ required: ["source", "linkId", "target", "createdAt", "updatedAt"],
5511
+ additionalProperties: false,
5512
+ properties: {
5513
+ source: objectRefSchemaRef,
5514
+ linkId: { type: "string" },
5515
+ target: objectRefSchemaRef,
5516
+ properties: { type: "object", additionalProperties: true },
5517
+ createdAt: { type: "string" },
5518
+ updatedAt: { type: "string" }
5519
+ }
5520
+ },
5521
+ ObjectQueryLinksResponse: {
5522
+ type: "object",
5523
+ required: ["objects", "links", "hasMore"],
5524
+ additionalProperties: false,
5525
+ properties: {
5526
+ objects: {
5527
+ type: "array",
5528
+ description: "Selected objects followed by visible endpoint objects from this link page, de-duplicated. Empty unless includeObjects is true.",
5529
+ items: { $ref: "#/components/schemas/ObjectQueryObject" }
5530
+ },
5531
+ links: {
5532
+ type: "array",
5533
+ description: "Visible physical links in deterministic identity order.",
5534
+ items: { $ref: "#/components/schemas/ObjectQueryLink" }
5535
+ },
5536
+ hasMore: { type: "boolean" },
5537
+ nextPageToken: { type: "string" }
5538
+ }
5539
+ },
5488
5540
  ObjectQueryErrorResponse: {
5489
5541
  type: "object",
5490
5542
  required: ["error"],
@@ -5544,6 +5596,36 @@ var ObjectQueryOpenApiSchemas = {
5544
5596
  }
5545
5597
  }
5546
5598
  },
5599
+ ObjectQueryLinksRequest: {
5600
+ type: "object",
5601
+ required: ["query"],
5602
+ additionalProperties: false,
5603
+ properties: {
5604
+ query: objectQueryRef,
5605
+ direction: { type: "string", enum: ["outgoing", "incoming", "both"], default: "both" },
5606
+ linkId: { type: "string", minLength: 1 },
5607
+ includeObjects: {
5608
+ type: "boolean",
5609
+ default: false,
5610
+ description: "Include selected objects and visible endpoints from the current link page."
5611
+ },
5612
+ pageSize: { type: "integer", minimum: 1, maximum: 1000, default: 100 },
5613
+ pageToken: {
5614
+ type: "string",
5615
+ minLength: 1,
5616
+ description: "Opaque token from the previous page. The project, normalized query, direction, and linkId must remain unchanged."
5617
+ }
5618
+ }
5619
+ },
5620
+ ObjectRef: {
5621
+ type: "object",
5622
+ required: ["objectTypeId", "primaryId"],
5623
+ additionalProperties: false,
5624
+ properties: {
5625
+ objectTypeId: { type: "string", minLength: 1 },
5626
+ primaryId: { type: "string", minLength: 1 }
5627
+ }
5628
+ },
5547
5629
  ObjectQuery: {
5548
5630
  oneOf: [
5549
5631
  {
@@ -5556,6 +5638,20 @@ var ObjectQueryOpenApiSchemas = {
5556
5638
  includeSubtypes: { type: "boolean" }
5557
5639
  }
5558
5640
  },
5641
+ {
5642
+ type: "object",
5643
+ required: ["kind", "refs"],
5644
+ additionalProperties: false,
5645
+ properties: {
5646
+ kind: { type: "string", enum: ["refs"] },
5647
+ refs: {
5648
+ type: "array",
5649
+ minItems: 1,
5650
+ description: "One to 1,000 unique identities after normalization; duplicate entries are accepted and removed.",
5651
+ items: objectRefSchemaRef
5652
+ }
5653
+ }
5654
+ },
5559
5655
  {
5560
5656
  type: "object",
5561
5657
  required: ["kind", "input", "predicate"],
@@ -5769,7 +5865,7 @@ var ObjectQueryOpenApiSchemas = {
5769
5865
 
5770
5866
  // src/routes/objects.ts
5771
5867
  var ObjectFileContentQuerySchema = FileContentQuerySchema.extend({
5772
- path: z17.string().min(1).regex(/^\/properties(?:\/|$)/, "Object file content paths must start with /properties/")
5868
+ path: z18.string().min(1).regex(/^\/properties(?:\/|$)/, "Object file content paths must start with /properties/")
5773
5869
  });
5774
5870
  function serializeObject(row) {
5775
5871
  return {
@@ -5780,6 +5876,22 @@ function serializeObject(row) {
5780
5876
  updatedAt: toIsoString(row.updatedAt)
5781
5877
  };
5782
5878
  }
5879
+ function serializeObjectLink(link) {
5880
+ return {
5881
+ source: {
5882
+ objectTypeId: link.sourceTypeId,
5883
+ primaryId: link.sourceId
5884
+ },
5885
+ linkId: link.linkId,
5886
+ target: {
5887
+ objectTypeId: link.targetTypeId,
5888
+ primaryId: link.targetId
5889
+ },
5890
+ ...link.properties === undefined ? {} : { properties: link.properties },
5891
+ createdAt: toIsoString(link.createdAt),
5892
+ updatedAt: toIsoString(link.updatedAt)
5893
+ };
5894
+ }
5783
5895
  function serializeExpandedObject(row) {
5784
5896
  const serialized = serializeObject(row);
5785
5897
  if (row.links)
@@ -6066,6 +6178,69 @@ function registerObjectRoutes(app, host) {
6066
6178
  }
6067
6179
  }
6068
6180
  }
6181
+ }).post("/api/objects/query/links", async (context) => {
6182
+ const { body, set } = context;
6183
+ try {
6184
+ const parsed = ObjectQueryLinksRequestSchema.parse(body);
6185
+ const result = await requireRequestSixb(context).objects.queryLinks(parsed);
6186
+ return {
6187
+ objects: result.objects.map(serializeObject),
6188
+ links: result.links.map(serializeObjectLink),
6189
+ hasMore: result.hasMore,
6190
+ ...result.nextPageToken === undefined ? {} : { nextPageToken: result.nextPageToken }
6191
+ };
6192
+ } catch (error) {
6193
+ return handleObjectQueryError(error, set);
6194
+ }
6195
+ }, {
6196
+ detail: {
6197
+ summary: "Query object links",
6198
+ tags: [OPENAPI_TAGS.links.name],
6199
+ operationId: "queryObjectLinks",
6200
+ security: bearerSecurityRequirement("queryObjectLinks"),
6201
+ requestBody: {
6202
+ required: true,
6203
+ content: {
6204
+ "application/json": {
6205
+ schema: { $ref: "#/components/schemas/ObjectQueryLinksRequest" }
6206
+ }
6207
+ }
6208
+ },
6209
+ responses: {
6210
+ 200: {
6211
+ description: "Response for status 200",
6212
+ content: {
6213
+ "application/json": {
6214
+ schema: { $ref: "#/components/schemas/ObjectQueryLinksResponse" }
6215
+ }
6216
+ }
6217
+ },
6218
+ 400: {
6219
+ description: "Response for status 400",
6220
+ content: {
6221
+ "application/json": {
6222
+ schema: { $ref: "#/components/schemas/ObjectQueryErrorResponse" }
6223
+ }
6224
+ }
6225
+ },
6226
+ 403: {
6227
+ description: "Response for status 403",
6228
+ content: {
6229
+ "application/json": {
6230
+ schema: { $ref: "#/components/schemas/ErrorResponse" }
6231
+ }
6232
+ }
6233
+ },
6234
+ 500: {
6235
+ description: "Response for status 500",
6236
+ content: {
6237
+ "application/json": {
6238
+ schema: { $ref: "#/components/schemas/ErrorResponse" }
6239
+ }
6240
+ }
6241
+ }
6242
+ }
6243
+ }
6069
6244
  }).post("/api/objects/query/count", async (context) => {
6070
6245
  const { body, set } = context;
6071
6246
  try {
@@ -6426,111 +6601,111 @@ function registerOntologyRoutes(app, _host) {
6426
6601
  import {
6427
6602
  PIPELINE_RUN_FAILURE_CODES
6428
6603
  } from "@sixb/core/storage";
6429
- import { z as z18 } from "zod";
6604
+ import { z as z19 } from "zod";
6430
6605
  var PipelineRunFailureSchema = sixbFailureSchema(PIPELINE_RUN_FAILURE_CODES);
6431
- var PipelineParamsSchema = z18.object({
6432
- pipelineId: z18.string().min(1)
6606
+ var PipelineParamsSchema = z19.object({
6607
+ pipelineId: z19.string().min(1)
6433
6608
  });
6434
- var PipelineRunParamsSchema = z18.object({
6435
- runId: z18.string().min(1)
6609
+ var PipelineRunParamsSchema = z19.object({
6610
+ runId: z19.string().min(1)
6436
6611
  });
6437
- var PipelineRunStatusSchema = z18.enum([
6612
+ var PipelineRunStatusSchema = z19.enum([
6438
6613
  "queued",
6439
6614
  "running",
6440
6615
  "succeeded",
6441
6616
  "failed",
6442
6617
  "cancelled"
6443
6618
  ]);
6444
- var PipelineStepRunStatusSchema = z18.enum(["running", "succeeded", "failed", "cancelled"]);
6445
- var PipelineRunsQuerySchema = z18.object({
6446
- pipelineId: z18.string().optional(),
6619
+ var PipelineStepRunStatusSchema = z19.enum(["running", "succeeded", "failed", "cancelled"]);
6620
+ var PipelineRunsQuerySchema = z19.object({
6621
+ pipelineId: z19.string().optional(),
6447
6622
  status: PipelineRunStatusSchema.optional(),
6448
- startedAfter: z18.string().optional(),
6449
- startedBefore: z18.string().optional(),
6450
- limit: z18.string().optional(),
6451
- offset: z18.string().optional(),
6452
- order: z18.enum(["asc", "desc"]).optional()
6453
- });
6454
- var DatasetVersionRefSchema2 = z18.object({
6455
- datasetId: z18.string(),
6456
- versionId: z18.string()
6457
- });
6458
- var PipelineTriggerSchema = z18.object({
6459
- type: z18.literal("schedule"),
6460
- scheduleId: z18.string()
6461
- });
6462
- var PipelineStepExecutorSchema = z18.union([
6463
- z18.object({
6464
- kind: z18.literal("sql"),
6465
- dialect: z18.literal("duckdb")
6623
+ startedAfter: z19.string().optional(),
6624
+ startedBefore: z19.string().optional(),
6625
+ limit: z19.string().optional(),
6626
+ offset: z19.string().optional(),
6627
+ order: z19.enum(["asc", "desc"]).optional()
6628
+ });
6629
+ var DatasetVersionRefSchema2 = z19.object({
6630
+ datasetId: z19.string(),
6631
+ versionId: z19.string()
6632
+ });
6633
+ var PipelineTriggerSchema = z19.object({
6634
+ type: z19.literal("schedule"),
6635
+ scheduleId: z19.string()
6636
+ });
6637
+ var PipelineStepExecutorSchema = z19.union([
6638
+ z19.object({
6639
+ kind: z19.literal("sql"),
6640
+ dialect: z19.literal("duckdb")
6466
6641
  }),
6467
- z18.object({
6468
- kind: z18.literal("run")
6642
+ z19.object({
6643
+ kind: z19.literal("run")
6469
6644
  })
6470
6645
  ]);
6471
- var PipelineRunSchema = z18.object({
6472
- id: z18.string(),
6473
- projectId: z18.string(),
6474
- pipelineId: z18.string(),
6646
+ var PipelineRunSchema = z19.object({
6647
+ id: z19.string(),
6648
+ projectId: z19.string(),
6649
+ pipelineId: z19.string(),
6475
6650
  status: PipelineRunStatusSchema,
6476
- queuedAt: z18.string(),
6477
- startedAt: z18.string().optional(),
6478
- finishedAt: z18.string().optional(),
6651
+ queuedAt: z19.string(),
6652
+ startedAt: z19.string().optional(),
6653
+ finishedAt: z19.string().optional(),
6479
6654
  output: DatasetVersionRefSchema2.optional(),
6480
6655
  error: PipelineRunFailureSchema.optional()
6481
6656
  });
6482
- var PipelineStepRunSchema = z18.object({
6483
- id: z18.string(),
6484
- projectId: z18.string(),
6485
- pipelineRunId: z18.string(),
6486
- pipelineId: z18.string(),
6487
- stepId: z18.string(),
6488
- datasetId: z18.string(),
6489
- mode: z18.enum(["snapshot", "append"]),
6657
+ var PipelineStepRunSchema = z19.object({
6658
+ id: z19.string(),
6659
+ projectId: z19.string(),
6660
+ pipelineRunId: z19.string(),
6661
+ pipelineId: z19.string(),
6662
+ stepId: z19.string(),
6663
+ datasetId: z19.string(),
6664
+ mode: z19.enum(["snapshot", "append"]),
6490
6665
  status: PipelineStepRunStatusSchema,
6491
- startedAt: z18.string(),
6492
- finishedAt: z18.string().optional(),
6493
- inputs: z18.array(DatasetVersionRefSchema2),
6666
+ startedAt: z19.string(),
6667
+ finishedAt: z19.string().optional(),
6668
+ inputs: z19.array(DatasetVersionRefSchema2),
6494
6669
  output: DatasetVersionRefSchema2.optional(),
6495
- rowsWritten: z18.number().optional(),
6670
+ rowsWritten: z19.number().optional(),
6496
6671
  error: PipelineRunFailureSchema.optional()
6497
6672
  });
6498
- var PipelineStepSchema = z18.object({
6499
- id: z18.string(),
6500
- mode: z18.enum(["snapshot", "append"]),
6673
+ var PipelineStepSchema = z19.object({
6674
+ id: z19.string(),
6675
+ mode: z19.enum(["snapshot", "append"]),
6501
6676
  executor: PipelineStepExecutorSchema,
6502
- inputs: z18.array(z18.object({
6503
- name: z18.string(),
6677
+ inputs: z19.array(z19.object({
6678
+ name: z19.string(),
6504
6679
  dataset: DatasetDefinitionSchema
6505
6680
  })),
6506
6681
  output: DatasetDefinitionSchema
6507
6682
  });
6508
- var PipelineSchema = z18.object({
6509
- id: z18.string(),
6510
- triggers: z18.array(PipelineTriggerSchema),
6511
- graph: z18.object({
6512
- kind: z18.literal("sequence"),
6513
- nodes: z18.array(z18.object({
6514
- kind: z18.literal("step"),
6683
+ var PipelineSchema = z19.object({
6684
+ id: z19.string(),
6685
+ triggers: z19.array(PipelineTriggerSchema),
6686
+ graph: z19.object({
6687
+ kind: z19.literal("sequence"),
6688
+ nodes: z19.array(z19.object({
6689
+ kind: z19.literal("step"),
6515
6690
  step: PipelineStepSchema
6516
6691
  }))
6517
6692
  }),
6518
6693
  latestRun: PipelineRunSchema.nullable()
6519
6694
  });
6520
- var PipelineRunListResponseSchema = z18.object({
6521
- runs: z18.array(PipelineRunSchema),
6522
- hasMore: z18.boolean(),
6523
- total: z18.number()
6695
+ var PipelineRunListResponseSchema = z19.object({
6696
+ runs: z19.array(PipelineRunSchema),
6697
+ hasMore: z19.boolean(),
6698
+ total: z19.number()
6524
6699
  });
6525
- var PipelineRunDetailResponseSchema = z18.object({
6700
+ var PipelineRunDetailResponseSchema = z19.object({
6526
6701
  run: PipelineRunSchema,
6527
- steps: z18.array(PipelineStepRunSchema)
6702
+ steps: z19.array(PipelineStepRunSchema)
6528
6703
  });
6529
- var RequestPipelineRunResponseSchema = z18.object({
6530
- runId: z18.string(),
6531
- jobId: z18.string(),
6532
- pipelineId: z18.string(),
6533
- queuedAt: z18.string()
6704
+ var RequestPipelineRunResponseSchema = z19.object({
6705
+ runId: z19.string(),
6706
+ jobId: z19.string(),
6707
+ pipelineId: z19.string(),
6708
+ queuedAt: z19.string()
6534
6709
  });
6535
6710
 
6536
6711
  // src/routes/pipelines.ts
@@ -6752,9 +6927,9 @@ function registerPipelineRoutes(app, host) {
6752
6927
  }
6753
6928
 
6754
6929
  // src/schemas/project.ts
6755
- import { z as z19 } from "zod";
6756
- var ProjectInfoResponseSchema = z19.object({
6757
- id: z19.string()
6930
+ import { z as z20 } from "zod";
6931
+ var ProjectInfoResponseSchema = z20.object({
6932
+ id: z20.string()
6758
6933
  });
6759
6934
 
6760
6935
  // src/routes/project.ts
@@ -6772,146 +6947,147 @@ function registerProjectRoutes(app, host) {
6772
6947
 
6773
6948
  // src/schemas/projections.ts
6774
6949
  import { PROJECTION_RUN_FAILURE_CODES } from "@sixb/core/storage";
6775
- import { z as z20 } from "zod";
6950
+ import { z as z21 } from "zod";
6776
6951
  var ProjectionRunFailureSchema = sixbFailureSchema(PROJECTION_RUN_FAILURE_CODES);
6777
- var ProjectionKindSchema = z20.enum(["object", "link", "telemetry"]);
6778
- var ProjectionRunStatusSchema = z20.enum([
6952
+ var ProjectionKindSchema = z21.enum(["object", "link", "telemetry"]);
6953
+ var ProjectionRunStatusSchema = z21.enum([
6779
6954
  "queued",
6780
6955
  "running",
6781
6956
  "succeeded",
6782
6957
  "failed",
6783
6958
  "cancelled"
6784
6959
  ]);
6785
- var ProjectionRunIdentityBaseSchema = z20.object({
6786
- projectionId: z20.string(),
6787
- datasetVersion: z20.object({
6788
- datasetId: z20.string(),
6789
- versionId: z20.string(),
6790
- createdAt: z20.string()
6960
+ var ProjectionRunIdentityBaseSchema = z21.object({
6961
+ projectionId: z21.string(),
6962
+ datasetVersion: z21.object({
6963
+ datasetId: z21.string(),
6964
+ versionId: z21.string(),
6965
+ createdAt: z21.string()
6791
6966
  }),
6792
- ontologyRevision: z20.string(),
6793
- projectionRevision: z20.string(),
6794
- ownershipHash: z20.string()
6795
- });
6796
- var ProjectionRunBaseSchema = z20.object({
6797
- id: z20.string(),
6798
- projectId: z20.string(),
6799
- executionId: z20.string(),
6967
+ ontologyRevision: z21.string(),
6968
+ projectionRevision: z21.string(),
6969
+ ownershipHash: z21.string()
6970
+ });
6971
+ var ProjectionRunBaseSchema = z21.object({
6972
+ id: z21.string(),
6973
+ projectId: z21.string(),
6974
+ executionId: z21.string(),
6800
6975
  status: ProjectionRunStatusSchema,
6801
- attempt: z20.number(),
6802
- progress: z20.object({
6803
- sourceRowsRead: z20.number(),
6804
- sourceRowsSkipped: z20.number()
6976
+ attempt: z21.number(),
6977
+ progress: z21.object({
6978
+ sourceRowsRead: z21.number(),
6979
+ sourceRowsSkipped: z21.number()
6805
6980
  }),
6806
- queuedAt: z20.string(),
6807
- startedAt: z20.string().optional(),
6808
- finishedAt: z20.string().optional(),
6981
+ queuedAt: z21.string(),
6982
+ startedAt: z21.string().optional(),
6983
+ finishedAt: z21.string().optional(),
6809
6984
  error: ProjectionRunFailureSchema.optional()
6810
6985
  });
6811
6986
  var ObjectProjectionRunSchema = ProjectionRunBaseSchema.extend({
6812
6987
  identity: ProjectionRunIdentityBaseSchema.extend({
6813
- projectionKind: z20.literal("object"),
6814
- protocol: z20.literal("replacement")
6988
+ projectionKind: z21.literal("object"),
6989
+ protocol: z21.literal("replacement")
6815
6990
  }),
6816
- target: z20.object({ objectTypeId: z20.string() })
6991
+ target: z21.object({ objectTypeId: z21.string() })
6817
6992
  });
6818
6993
  var LinkProjectionRunSchema = ProjectionRunBaseSchema.extend({
6819
6994
  identity: ProjectionRunIdentityBaseSchema.extend({
6820
- projectionKind: z20.literal("link"),
6821
- protocol: z20.literal("replacement")
6995
+ projectionKind: z21.literal("link"),
6996
+ protocol: z21.literal("replacement")
6822
6997
  }),
6823
- target: z20.object({
6824
- sourceObjectTypeId: z20.string(),
6825
- targetObjectTypeId: z20.string()
6998
+ target: z21.object({
6999
+ sourceObjectTypeId: z21.string(),
7000
+ targetObjectTypeId: z21.string()
6826
7001
  })
6827
7002
  });
6828
7003
  var TelemetryProjectionRunSchema = ProjectionRunBaseSchema.extend({
6829
7004
  identity: ProjectionRunIdentityBaseSchema.extend({
6830
- projectionKind: z20.literal("telemetry"),
6831
- protocol: z20.literal("telemetry")
7005
+ projectionKind: z21.literal("telemetry"),
7006
+ protocol: z21.literal("telemetry")
6832
7007
  }),
6833
- target: z20.object({ objectTypeId: z20.string() })
7008
+ target: z21.object({ objectTypeId: z21.string() })
6834
7009
  });
6835
- var ProjectionRunSchema = z20.union([
7010
+ var ProjectionRunSchema = z21.union([
6836
7011
  ObjectProjectionRunSchema,
6837
7012
  LinkProjectionRunSchema,
6838
7013
  TelemetryProjectionRunSchema
6839
7014
  ]);
6840
- var ForeignKeyDescriptorSchema = z20.object({
6841
- linkId: z20.string(),
6842
- sourcePropertyId: z20.string().optional(),
6843
- sourceField: z20.string().optional(),
6844
- targetObjectTypeId: z20.string()
6845
- });
6846
- var SourceEditConflictResolutionSchema = z20.union([
6847
- z20.object({ strategy: z20.literal("editsWin") }),
6848
- z20.object({ strategy: z20.literal("mostRecent"), sourceTimestamp: z20.string() })
7015
+ var ForeignKeyDescriptorSchema = z21.object({
7016
+ linkId: z21.string(),
7017
+ sourcePropertyId: z21.string().optional(),
7018
+ sourceField: z21.string().optional(),
7019
+ targetObjectTypeId: z21.string()
7020
+ });
7021
+ var SourceEditConflictResolutionSchema = z21.union([
7022
+ z21.object({ strategy: z21.literal("editsWin") }),
7023
+ z21.object({ strategy: z21.literal("mostRecent"), sourceTimestamp: z21.string() })
6849
7024
  ]);
6850
- var ObjectProjectionSchema = z20.object({
6851
- _tag: z20.literal("ObjectProjectionDefinition"),
6852
- id: z20.string(),
6853
- objectTypeId: z20.string(),
6854
- datasetId: z20.string(),
6855
- properties: z20.record(z20.string()),
6856
- links: z20.record(ForeignKeyDescriptorSchema),
7025
+ var ObjectProjectionSchema = z21.object({
7026
+ _tag: z21.literal("ObjectProjectionDefinition"),
7027
+ id: z21.string(),
7028
+ objectTypeId: z21.string(),
7029
+ datasetId: z21.string(),
7030
+ properties: z21.record(z21.string()),
7031
+ links: z21.record(ForeignKeyDescriptorSchema),
6857
7032
  conflictResolution: SourceEditConflictResolutionSchema,
6858
7033
  latestRun: ProjectionRunSchema.nullable()
6859
7034
  });
6860
- var LinkProjectionSchema = z20.object({
6861
- _tag: z20.literal("LinkProjectionDefinition"),
6862
- id: z20.string(),
6863
- linkId: z20.string(),
6864
- sourceObjectTypeId: z20.string(),
6865
- targetObjectTypeId: z20.string(),
6866
- datasetId: z20.string(),
6867
- sourceField: z20.string(),
6868
- targetField: z20.string(),
7035
+ var LinkProjectionSchema = z21.object({
7036
+ _tag: z21.literal("LinkProjectionDefinition"),
7037
+ id: z21.string(),
7038
+ linkId: z21.string(),
7039
+ sourceObjectTypeId: z21.string(),
7040
+ targetObjectTypeId: z21.string(),
7041
+ datasetId: z21.string(),
7042
+ sourceField: z21.string(),
7043
+ targetField: z21.string(),
6869
7044
  latestRun: ProjectionRunSchema.nullable()
6870
7045
  });
6871
- var TelemetryProjectionSchema = z20.object({
6872
- _tag: z20.literal("TelemetryProjectionDefinition"),
6873
- id: z20.string(),
6874
- objectTypeId: z20.string(),
6875
- propertyId: z20.string(),
6876
- datasetId: z20.string(),
6877
- objectIdField: z20.string(),
6878
- atField: z20.string(),
6879
- valueField: z20.string(),
6880
- unitField: z20.string().optional(),
7046
+ var TelemetryProjectionSchema = z21.object({
7047
+ _tag: z21.literal("TelemetryProjectionDefinition"),
7048
+ id: z21.string(),
7049
+ objectTypeId: z21.string(),
7050
+ datasetId: z21.string(),
7051
+ objectIdField: z21.string(),
7052
+ atField: z21.string(),
7053
+ properties: z21.record(z21.object({
7054
+ valueField: z21.string(),
7055
+ unitField: z21.string().optional()
7056
+ })),
6881
7057
  latestRun: ProjectionRunSchema.nullable()
6882
7058
  });
6883
- var ProjectionListResponseSchema = z20.object({
6884
- objectProjections: z20.array(ObjectProjectionSchema),
6885
- linkProjections: z20.array(LinkProjectionSchema),
6886
- telemetryProjections: z20.array(TelemetryProjectionSchema)
7059
+ var ProjectionListResponseSchema = z21.object({
7060
+ objectProjections: z21.array(ObjectProjectionSchema),
7061
+ linkProjections: z21.array(LinkProjectionSchema),
7062
+ telemetryProjections: z21.array(TelemetryProjectionSchema)
6887
7063
  });
6888
- var ProjectionParamsSchema = z20.object({
6889
- projectionId: z20.string().min(1)
7064
+ var ProjectionParamsSchema = z21.object({
7065
+ projectionId: z21.string().min(1)
6890
7066
  });
6891
- var ProjectionResponseSchema = z20.union([
7067
+ var ProjectionResponseSchema = z21.union([
6892
7068
  ObjectProjectionSchema,
6893
7069
  LinkProjectionSchema,
6894
7070
  TelemetryProjectionSchema
6895
7071
  ]);
6896
- var ProjectionRunParamsSchema = z20.object({
6897
- runId: z20.string().min(1)
7072
+ var ProjectionRunParamsSchema = z21.object({
7073
+ runId: z21.string().min(1)
6898
7074
  });
6899
- var ProjectionRunsQuerySchema = z20.object({
6900
- projectionId: z20.string().optional(),
7075
+ var ProjectionRunsQuerySchema = z21.object({
7076
+ projectionId: z21.string().optional(),
6901
7077
  projectionKind: ProjectionKindSchema.optional(),
6902
- datasetId: z20.string().optional(),
6903
- datasetVersionId: z20.string().optional(),
7078
+ datasetId: z21.string().optional(),
7079
+ datasetVersionId: z21.string().optional(),
6904
7080
  status: ProjectionRunStatusSchema.optional(),
6905
- startedAfter: z20.string().optional(),
6906
- startedBefore: z20.string().optional(),
6907
- limit: z20.string().optional(),
6908
- offset: z20.string().optional(),
6909
- order: z20.enum(["asc", "desc"]).optional()
7081
+ startedAfter: z21.string().optional(),
7082
+ startedBefore: z21.string().optional(),
7083
+ limit: z21.string().optional(),
7084
+ offset: z21.string().optional(),
7085
+ order: z21.enum(["asc", "desc"]).optional()
6910
7086
  });
6911
- var ProjectionRunListResponseSchema = z20.object({
6912
- runs: z20.array(ProjectionRunSchema),
6913
- hasMore: z20.boolean(),
6914
- total: z20.number()
7087
+ var ProjectionRunListResponseSchema = z21.object({
7088
+ runs: z21.array(ProjectionRunSchema),
7089
+ hasMore: z21.boolean(),
7090
+ total: z21.number()
6915
7091
  });
6916
7092
 
6917
7093
  // src/routes/projections.ts
@@ -7079,88 +7255,88 @@ function registerProjectionRoutes(app, host) {
7079
7255
  import { deriveRuleEventDependencies } from "@sixb/core/internal/rules";
7080
7256
 
7081
7257
  // src/schemas/rules.ts
7082
- import { z as z21 } from "zod";
7083
- var RuleParamsSchema = z21.object({
7084
- ruleId: z21.string().min(1)
7085
- });
7086
- var RuleStatesQuerySchema = z21.object({
7087
- ruleId: z21.string().optional(),
7088
- objectTypeId: z21.string().optional(),
7089
- primaryId: z21.string().optional(),
7090
- limit: z21.string().optional(),
7091
- offset: z21.string().optional(),
7092
- order: z21.enum(["asc", "desc"]).optional()
7093
- });
7094
- var RuleValueSchema = z21.union([z21.string(), z21.number(), z21.boolean()]).nullable();
7095
- var RuleSubjectSchema = z21.object({
7096
- kind: z21.literal("object"),
7097
- objectTypeId: z21.string()
7098
- });
7099
- var RuleEventSubjectSchema = z21.object({
7100
- kind: z21.literal("object"),
7101
- objectTypeId: z21.string(),
7102
- primaryId: z21.string()
7103
- });
7104
- var RulePropertyPredicateSchema = z21.object({
7105
- kind: z21.literal("property"),
7106
- propertyId: z21.string(),
7107
- op: z21.enum(["eq", "notEq", "gt", "gte", "lt", "lte", "isPresent", "isMissing"]),
7258
+ import { z as z22 } from "zod";
7259
+ var RuleParamsSchema = z22.object({
7260
+ ruleId: z22.string().min(1)
7261
+ });
7262
+ var RuleStatesQuerySchema = z22.object({
7263
+ ruleId: z22.string().optional(),
7264
+ objectTypeId: z22.string().optional(),
7265
+ primaryId: z22.string().optional(),
7266
+ limit: z22.string().optional(),
7267
+ offset: z22.string().optional(),
7268
+ order: z22.enum(["asc", "desc"]).optional()
7269
+ });
7270
+ var RuleValueSchema = z22.union([z22.string(), z22.number(), z22.boolean()]).nullable();
7271
+ var RuleSubjectSchema = z22.object({
7272
+ kind: z22.literal("object"),
7273
+ objectTypeId: z22.string()
7274
+ });
7275
+ var RuleEventSubjectSchema = z22.object({
7276
+ kind: z22.literal("object"),
7277
+ objectTypeId: z22.string(),
7278
+ primaryId: z22.string()
7279
+ });
7280
+ var RulePropertyPredicateSchema = z22.object({
7281
+ kind: z22.literal("property"),
7282
+ propertyId: z22.string(),
7283
+ op: z22.enum(["eq", "notEq", "gt", "gte", "lt", "lte", "isPresent", "isMissing"]),
7108
7284
  value: RuleValueSchema.optional()
7109
7285
  });
7110
- var RuleLinkPredicateSchema = z21.object({
7111
- kind: z21.literal("link"),
7112
- linkId: z21.string(),
7113
- op: z21.enum(["exists", "isMissing"])
7286
+ var RuleLinkPredicateSchema = z22.object({
7287
+ kind: z22.literal("link"),
7288
+ linkId: z22.string(),
7289
+ op: z22.enum(["exists", "isMissing"])
7114
7290
  });
7115
7291
  function createRulePredicateSchema(childPredicateSchema) {
7116
- return z21.union([
7117
- z21.object({
7118
- kind: z21.literal("all"),
7119
- predicates: z21.array(childPredicateSchema)
7292
+ return z22.union([
7293
+ z22.object({
7294
+ kind: z22.literal("all"),
7295
+ predicates: z22.array(childPredicateSchema)
7120
7296
  }),
7121
- z21.object({
7122
- kind: z21.literal("any"),
7123
- predicates: z21.array(childPredicateSchema)
7297
+ z22.object({
7298
+ kind: z22.literal("any"),
7299
+ predicates: z22.array(childPredicateSchema)
7124
7300
  }),
7125
- z21.object({
7126
- kind: z21.literal("not"),
7301
+ z22.object({
7302
+ kind: z22.literal("not"),
7127
7303
  predicate: childPredicateSchema
7128
7304
  }),
7129
7305
  RulePropertyPredicateSchema,
7130
7306
  RuleLinkPredicateSchema
7131
7307
  ]);
7132
7308
  }
7133
- var DeepRulePredicateSchema = createRulePredicateSchema(z21.unknown());
7309
+ var DeepRulePredicateSchema = createRulePredicateSchema(z22.unknown());
7134
7310
  var NestedRulePredicateSchema = createRulePredicateSchema(DeepRulePredicateSchema);
7135
7311
  var RulePredicateSchema = NestedRulePredicateSchema;
7136
- var RuleEventDependencySchema = z21.union([
7137
- z21.object({
7138
- type: z21.enum(["object.created", "object.updated", "object.deleted"]),
7139
- objectTypeId: z21.string()
7312
+ var RuleEventDependencySchema = z22.union([
7313
+ z22.object({
7314
+ type: z22.enum(["object.created", "object.updated", "object.deleted"]),
7315
+ objectTypeId: z22.string()
7140
7316
  }),
7141
- z21.object({
7142
- type: z21.enum(["link.created", "link.updated", "link.deleted"]),
7143
- sourceTypeId: z21.string(),
7144
- linkId: z21.string()
7317
+ z22.object({
7318
+ type: z22.enum(["link.created", "link.updated", "link.deleted"]),
7319
+ sourceTypeId: z22.string(),
7320
+ linkId: z22.string()
7145
7321
  })
7146
7322
  ]);
7147
- var RuleSchema = z21.object({
7148
- kind: z21.literal("rule"),
7149
- id: z21.string(),
7323
+ var RuleSchema = z22.object({
7324
+ kind: z22.literal("rule"),
7325
+ id: z22.string(),
7150
7326
  subject: RuleSubjectSchema,
7151
7327
  predicate: RulePredicateSchema,
7152
- dependencies: z21.array(RuleEventDependencySchema)
7328
+ dependencies: z22.array(RuleEventDependencySchema)
7153
7329
  });
7154
- var RuleStateSchema = z21.object({
7155
- projectId: z21.string(),
7156
- ruleId: z21.string(),
7330
+ var RuleStateSchema = z22.object({
7331
+ projectId: z22.string(),
7332
+ ruleId: z22.string(),
7157
7333
  subject: RuleEventSubjectSchema,
7158
- triggeredAt: z21.string()
7334
+ triggeredAt: z22.string()
7159
7335
  });
7160
- var RuleStateListResponseSchema = z21.object({
7161
- states: z21.array(RuleStateSchema),
7162
- hasMore: z21.boolean(),
7163
- total: z21.number()
7336
+ var RuleStateListResponseSchema = z22.object({
7337
+ states: z22.array(RuleStateSchema),
7338
+ hasMore: z22.boolean(),
7339
+ total: z22.number()
7164
7340
  });
7165
7341
 
7166
7342
  // src/routes/rules.ts
@@ -7240,44 +7416,44 @@ function registerRuleRoutes(app, host) {
7240
7416
  }
7241
7417
 
7242
7418
  // src/schemas/status.ts
7243
- import { z as z22 } from "zod";
7244
- var HealthResponseSchema = z22.object({ status: z22.literal("ok") });
7245
- var StorageReadinessSchema = z22.object({
7246
- reachable: z22.boolean(),
7247
- schemaValid: z22.boolean()
7419
+ import { z as z23 } from "zod";
7420
+ var HealthResponseSchema = z23.object({ status: z23.literal("ok") });
7421
+ var StorageReadinessSchema = z23.object({
7422
+ reachable: z23.boolean(),
7423
+ schemaValid: z23.boolean()
7248
7424
  });
7249
- var ReadinessResponseSchema = z22.object({
7250
- status: z22.enum(["ready", "unready"]),
7425
+ var ReadinessResponseSchema = z23.object({
7426
+ status: z23.enum(["ready", "unready"]),
7251
7427
  storage: StorageReadinessSchema,
7252
- reason: z22.string().optional()
7253
- });
7254
- var MaintenanceSummarySchema = z22.object({
7255
- running: z22.boolean(),
7256
- intervalMs: z22.number().int().positive(),
7257
- lastStartedAt: z22.string().nullable(),
7258
- lastCompletedAt: z22.string().nullable(),
7259
- lastDurationMs: z22.number().nonnegative().nullable(),
7260
- consecutiveFailures: z22.number().int().nonnegative(),
7261
- lastError: z22.string().nullable(),
7262
- outbox: z22.object({
7263
- pendingCount: z22.number().int().nonnegative(),
7264
- oldestPendingAt: z22.string().nullable(),
7265
- retryingCount: z22.number().int().nonnegative(),
7266
- maxAttempts: z22.number().int().nonnegative()
7428
+ reason: z23.string().optional()
7429
+ });
7430
+ var MaintenanceSummarySchema = z23.object({
7431
+ running: z23.boolean(),
7432
+ intervalMs: z23.number().int().positive(),
7433
+ lastStartedAt: z23.string().nullable(),
7434
+ lastCompletedAt: z23.string().nullable(),
7435
+ lastDurationMs: z23.number().nonnegative().nullable(),
7436
+ consecutiveFailures: z23.number().int().nonnegative(),
7437
+ lastError: z23.string().nullable(),
7438
+ outbox: z23.object({
7439
+ pendingCount: z23.number().int().nonnegative(),
7440
+ oldestPendingAt: z23.string().nullable(),
7441
+ retryingCount: z23.number().int().nonnegative(),
7442
+ maxAttempts: z23.number().int().nonnegative()
7267
7443
  }).nullable(),
7268
- terminalSources: z22.object({
7269
- count: z22.number().int().nonnegative(),
7270
- oldestTerminalAt: z22.string().nullable()
7444
+ terminalSources: z23.object({
7445
+ count: z23.number().int().nonnegative(),
7446
+ oldestTerminalAt: z23.string().nullable()
7271
7447
  }).nullable(),
7272
- cleanup: z22.object({
7273
- publishedOutboxRowsDeleted: z22.number().int().nonnegative(),
7274
- terminalSourceRowsDeleted: z22.number().int().nonnegative(),
7275
- terminalSourceMaterializationsDeleted: z22.number().int().nonnegative()
7448
+ cleanup: z23.object({
7449
+ publishedOutboxRowsDeleted: z23.number().int().nonnegative(),
7450
+ terminalSourceRowsDeleted: z23.number().int().nonnegative(),
7451
+ terminalSourceMaterializationsDeleted: z23.number().int().nonnegative()
7276
7452
  }).nullable()
7277
7453
  });
7278
- var StatusResponseSchema = z22.object({
7279
- status: z22.enum(["ok", "degraded"]),
7280
- objectTypes: z22.number().int().nonnegative(),
7454
+ var StatusResponseSchema = z23.object({
7455
+ status: z23.enum(["ok", "degraded"]),
7456
+ objectTypes: z23.number().int().nonnegative(),
7281
7457
  maintenance: MaintenanceSummarySchema
7282
7458
  });
7283
7459
 
@@ -7323,74 +7499,74 @@ function registerStatusRoutes(app, host) {
7323
7499
  import {
7324
7500
  SYNC_RUN_FAILURE_CODES
7325
7501
  } from "@sixb/core/storage";
7326
- import { z as z23 } from "zod";
7502
+ import { z as z24 } from "zod";
7327
7503
  var SyncRunFailureSchema = sixbFailureSchema(SYNC_RUN_FAILURE_CODES);
7328
- var SyncParamsSchema = z23.object({
7329
- syncId: z23.string().min(1)
7330
- });
7331
- var SyncRunStatusSchema = z23.enum(["queued", "running", "succeeded", "failed", "cancelled"]);
7332
- var SyncModeSchema = z23.enum(["snapshot", "append", "merge"]);
7333
- var SyncRunsQuerySchema = z23.object({
7334
- syncId: z23.string().optional(),
7335
- datasetId: z23.string().optional(),
7504
+ var SyncParamsSchema = z24.object({
7505
+ syncId: z24.string().min(1)
7506
+ });
7507
+ var SyncRunStatusSchema = z24.enum(["queued", "running", "succeeded", "failed", "cancelled"]);
7508
+ var SyncModeSchema = z24.enum(["snapshot", "append", "merge"]);
7509
+ var SyncRunsQuerySchema = z24.object({
7510
+ syncId: z24.string().optional(),
7511
+ datasetId: z24.string().optional(),
7336
7512
  status: SyncRunStatusSchema.optional(),
7337
- startedAfter: z23.string().optional(),
7338
- startedBefore: z23.string().optional(),
7339
- limit: z23.string().optional(),
7340
- offset: z23.string().optional(),
7341
- order: z23.enum(["asc", "desc"]).optional()
7342
- });
7343
- var RequestSyncRunBodySchema = z23.object({
7344
- expectedLatestVersionId: z23.string().optional(),
7345
- commitMessage: z23.string().optional()
7346
- });
7347
- var SyncTriggerSchema = z23.object({
7348
- type: z23.literal("schedule"),
7349
- scheduleId: z23.string()
7350
- });
7351
- var SyncRunSchema = z23.object({
7352
- id: z23.string(),
7353
- projectId: z23.string(),
7354
- syncId: z23.string(),
7355
- datasetId: z23.string(),
7513
+ startedAfter: z24.string().optional(),
7514
+ startedBefore: z24.string().optional(),
7515
+ limit: z24.string().optional(),
7516
+ offset: z24.string().optional(),
7517
+ order: z24.enum(["asc", "desc"]).optional()
7518
+ });
7519
+ var RequestSyncRunBodySchema = z24.object({
7520
+ expectedLatestVersionId: z24.string().optional(),
7521
+ commitMessage: z24.string().optional()
7522
+ });
7523
+ var SyncTriggerSchema = z24.object({
7524
+ type: z24.literal("schedule"),
7525
+ scheduleId: z24.string()
7526
+ });
7527
+ var SyncRunSchema = z24.object({
7528
+ id: z24.string(),
7529
+ projectId: z24.string(),
7530
+ syncId: z24.string(),
7531
+ datasetId: z24.string(),
7356
7532
  mode: SyncModeSchema,
7357
7533
  status: SyncRunStatusSchema,
7358
- queuedAt: z23.string(),
7359
- startedAt: z23.string().optional(),
7360
- finishedAt: z23.string().optional(),
7361
- rowsRead: z23.number().optional(),
7362
- output: z23.object({
7363
- datasetId: z23.string(),
7364
- versionId: z23.string()
7534
+ queuedAt: z24.string(),
7535
+ startedAt: z24.string().optional(),
7536
+ finishedAt: z24.string().optional(),
7537
+ rowsRead: z24.number().optional(),
7538
+ output: z24.object({
7539
+ datasetId: z24.string(),
7540
+ versionId: z24.string()
7365
7541
  }).optional(),
7366
- expectedLatestVersionId: z23.string().optional(),
7367
- commitMessage: z23.string().optional(),
7542
+ expectedLatestVersionId: z24.string().optional(),
7543
+ commitMessage: z24.string().optional(),
7368
7544
  error: SyncRunFailureSchema.optional()
7369
7545
  });
7370
- var SyncSchema = z23.object({
7371
- id: z23.string(),
7546
+ var SyncSchema = z24.object({
7547
+ id: z24.string(),
7372
7548
  mode: SyncModeSchema,
7373
- connector: z23.object({
7374
- id: z23.string(),
7375
- type: z23.string()
7549
+ connector: z24.object({
7550
+ id: z24.string(),
7551
+ type: z24.string()
7376
7552
  }),
7377
- target: z23.object({
7378
- kind: z23.literal("dataset"),
7553
+ target: z24.object({
7554
+ kind: z24.literal("dataset"),
7379
7555
  dataset: DatasetDefinitionSchema
7380
7556
  }),
7381
- triggers: z23.array(SyncTriggerSchema),
7557
+ triggers: z24.array(SyncTriggerSchema),
7382
7558
  latestRun: SyncRunSchema.nullable()
7383
7559
  });
7384
- var SyncRunListResponseSchema = z23.object({
7385
- runs: z23.array(SyncRunSchema),
7386
- hasMore: z23.boolean(),
7387
- total: z23.number()
7560
+ var SyncRunListResponseSchema = z24.object({
7561
+ runs: z24.array(SyncRunSchema),
7562
+ hasMore: z24.boolean(),
7563
+ total: z24.number()
7388
7564
  });
7389
- var RequestSyncRunResponseSchema = z23.object({
7390
- runId: z23.string(),
7391
- jobId: z23.string(),
7392
- syncId: z23.string(),
7393
- queuedAt: z23.string()
7565
+ var RequestSyncRunResponseSchema = z24.object({
7566
+ runId: z24.string(),
7567
+ jobId: z24.string(),
7568
+ syncId: z24.string(),
7569
+ queuedAt: z24.string()
7394
7570
  });
7395
7571
 
7396
7572
  // src/routes/syncs.ts
@@ -7544,52 +7720,52 @@ function registerSyncRoutes(app, host) {
7544
7720
  }
7545
7721
 
7546
7722
  // src/schemas/telemetry.ts
7547
- import { z as z24 } from "zod";
7548
- var TelemetryParamsSchema = z24.object({
7549
- objectTypeId: z24.string().min(1),
7550
- objectId: z24.string().min(1),
7551
- propertyId: z24.string().min(1)
7552
- });
7553
- var TelemetryHistoryQuerySchema = z24.object({
7554
- from: z24.string().optional(),
7555
- to: z24.string().optional(),
7556
- limit: z24.string().optional(),
7557
- order: z24.enum(["asc", "desc"]).optional()
7723
+ import { z as z25 } from "zod";
7724
+ var TelemetryParamsSchema = z25.object({
7725
+ objectTypeId: z25.string().min(1),
7726
+ objectId: z25.string().min(1),
7727
+ propertyId: z25.string().min(1)
7728
+ });
7729
+ var TelemetryHistoryQuerySchema = z25.object({
7730
+ from: z25.string().optional(),
7731
+ to: z25.string().optional(),
7732
+ limit: z25.string().optional(),
7733
+ order: z25.enum(["asc", "desc"]).optional()
7558
7734
  });
7559
- var BulkTelemetryHistorySeriesInputSchema = z24.object({
7560
- objectTypeId: z24.string().min(1),
7561
- objectId: z24.string().min(1),
7562
- propertyId: z24.string().min(1)
7735
+ var BulkTelemetryHistorySeriesInputSchema = z25.object({
7736
+ objectTypeId: z25.string().min(1),
7737
+ objectId: z25.string().min(1),
7738
+ propertyId: z25.string().min(1)
7563
7739
  }).strict();
7564
- var BulkTelemetryHistoryBodySchema = z24.object({
7565
- series: z24.array(BulkTelemetryHistorySeriesInputSchema).min(1),
7566
- from: z24.string().optional(),
7567
- to: z24.string().optional(),
7568
- limitPerSeries: z24.number().int().nonnegative().optional(),
7569
- order: z24.enum(["asc", "desc"]).optional()
7740
+ var BulkTelemetryHistoryBodySchema = z25.object({
7741
+ series: z25.array(BulkTelemetryHistorySeriesInputSchema).min(1),
7742
+ from: z25.string().optional(),
7743
+ to: z25.string().optional(),
7744
+ limitPerSeries: z25.number().int().nonnegative().optional(),
7745
+ order: z25.enum(["asc", "desc"]).optional()
7570
7746
  }).strict();
7571
- var AppendTelemetryBodySchema = z24.object({
7572
- value: z24.unknown(),
7573
- unit: z24.string().optional(),
7574
- at: z24.string().optional()
7747
+ var AppendTelemetryBodySchema = z25.object({
7748
+ value: z25.unknown(),
7749
+ unit: z25.string().optional(),
7750
+ at: z25.string().optional()
7575
7751
  });
7576
- var TelemetryPointSchema = z24.object({
7577
- projectId: z24.string(),
7578
- objectTypeId: z24.string(),
7579
- objectId: z24.string(),
7580
- propertyId: z24.string(),
7581
- value: z24.unknown(),
7582
- unit: z24.string().optional(),
7583
- at: z24.string()
7584
- });
7585
- var BulkTelemetryHistorySeriesSchema = z24.object({
7586
- objectTypeId: z24.string(),
7587
- objectId: z24.string(),
7588
- propertyId: z24.string(),
7589
- points: z24.array(TelemetryPointSchema)
7590
- });
7591
- var BulkTelemetryHistoryResponseSchema = z24.object({
7592
- series: z24.array(BulkTelemetryHistorySeriesSchema)
7752
+ var TelemetryPointSchema = z25.object({
7753
+ projectId: z25.string(),
7754
+ objectTypeId: z25.string(),
7755
+ objectId: z25.string(),
7756
+ propertyId: z25.string(),
7757
+ value: z25.unknown(),
7758
+ unit: z25.string().optional(),
7759
+ at: z25.string()
7760
+ });
7761
+ var BulkTelemetryHistorySeriesSchema = z25.object({
7762
+ objectTypeId: z25.string(),
7763
+ objectId: z25.string(),
7764
+ propertyId: z25.string(),
7765
+ points: z25.array(TelemetryPointSchema)
7766
+ });
7767
+ var BulkTelemetryHistoryResponseSchema = z25.object({
7768
+ series: z25.array(BulkTelemetryHistorySeriesSchema)
7593
7769
  });
7594
7770
 
7595
7771
  // src/routes/telemetry.ts
@@ -7747,40 +7923,40 @@ function registerTelemetryRoutes(app, _host) {
7747
7923
 
7748
7924
  // src/schemas/webhook-runs.ts
7749
7925
  import { WEBHOOK_RUN_FAILURE_CODES } from "@sixb/core/storage";
7750
- import { z as z25 } from "zod";
7926
+ import { z as z26 } from "zod";
7751
7927
  var WebhookRunFailureSchema = sixbFailureSchema(WEBHOOK_RUN_FAILURE_CODES);
7752
- var WebhookRunStatusSchema = z25.enum(["running", "succeeded", "failed"]);
7753
- var WebhookRunsQuerySchema = z25.object({
7754
- connectorId: z25.string().optional(),
7755
- webhookId: z25.string().optional(),
7928
+ var WebhookRunStatusSchema = z26.enum(["running", "succeeded", "failed"]);
7929
+ var WebhookRunsQuerySchema = z26.object({
7930
+ connectorId: z26.string().optional(),
7931
+ webhookId: z26.string().optional(),
7756
7932
  status: WebhookRunStatusSchema.optional(),
7757
- idempotencyKey: z25.string().optional(),
7758
- startedAfter: z25.string().optional(),
7759
- startedBefore: z25.string().optional(),
7760
- limit: z25.string().optional(),
7761
- offset: z25.string().optional(),
7762
- order: z25.enum(["asc", "desc"]).optional()
7933
+ idempotencyKey: z26.string().optional(),
7934
+ startedAfter: z26.string().optional(),
7935
+ startedBefore: z26.string().optional(),
7936
+ limit: z26.string().optional(),
7937
+ offset: z26.string().optional(),
7938
+ order: z26.enum(["asc", "desc"]).optional()
7763
7939
  });
7764
- var WebhookRunSchema = z25.object({
7765
- id: z25.string(),
7766
- projectId: z25.string(),
7767
- executionId: z25.string(),
7768
- connectorId: z25.string(),
7769
- webhookId: z25.string(),
7940
+ var WebhookRunSchema = z26.object({
7941
+ id: z26.string(),
7942
+ projectId: z26.string(),
7943
+ executionId: z26.string(),
7944
+ connectorId: z26.string(),
7945
+ webhookId: z26.string(),
7770
7946
  status: WebhookRunStatusSchema,
7771
- method: z25.string(),
7772
- route: z25.string(),
7773
- startedAt: z25.string(),
7774
- finishedAt: z25.string().optional(),
7775
- requestBodyBytes: z25.number(),
7776
- responseStatus: z25.number().optional(),
7777
- idempotencyKey: z25.string().optional(),
7947
+ method: z26.string(),
7948
+ route: z26.string(),
7949
+ startedAt: z26.string(),
7950
+ finishedAt: z26.string().optional(),
7951
+ requestBodyBytes: z26.number(),
7952
+ responseStatus: z26.number().optional(),
7953
+ idempotencyKey: z26.string().optional(),
7778
7954
  error: WebhookRunFailureSchema.optional()
7779
7955
  });
7780
- var WebhookRunListResponseSchema = z25.object({
7781
- runs: z25.array(WebhookRunSchema),
7782
- hasMore: z25.boolean(),
7783
- total: z25.number()
7956
+ var WebhookRunListResponseSchema = z26.object({
7957
+ runs: z26.array(WebhookRunSchema),
7958
+ hasMore: z26.boolean(),
7959
+ total: z26.number()
7784
7960
  });
7785
7961
 
7786
7962
  // src/routes/webhook-runs.ts
@@ -7855,25 +8031,25 @@ import {
7855
8031
  snapshotWorkflowInterventionResponse
7856
8032
  } from "@sixb/core/internal/workflows";
7857
8033
  import { AGENT_RUN_FAILURE_CODES as AGENT_RUN_FAILURE_CODES2, WORKFLOW_RUN_FAILURE_CODES as WORKFLOW_RUN_FAILURE_CODES2 } from "@sixb/core/storage";
7858
- import { z as z27 } from "zod";
8034
+ import { z as z28 } from "zod";
7859
8035
 
7860
8036
  // src/schemas/workflows.ts
7861
8037
  import {
7862
8038
  WORKFLOW_RUN_FAILURE_CODES
7863
8039
  } from "@sixb/core/storage";
7864
- import { z as z26 } from "zod";
7865
- var WorkflowIOSnapshotSchema = z26.record(JsonValueSchema);
8040
+ import { z as z27 } from "zod";
8041
+ var WorkflowIOSnapshotSchema = z27.record(JsonValueSchema);
7866
8042
  var WorkflowRunFailureSchema = sixbFailureSchema(WORKFLOW_RUN_FAILURE_CODES);
7867
- var WorkflowParamsSchema = z26.object({
7868
- workflowId: z26.string().min(1)
8043
+ var WorkflowParamsSchema = z27.object({
8044
+ workflowId: z27.string().min(1)
7869
8045
  });
7870
- var WorkflowRunParamsSchema = z26.object({
7871
- runId: z26.string().min(1)
8046
+ var WorkflowRunParamsSchema = z27.object({
8047
+ runId: z27.string().min(1)
7872
8048
  });
7873
- var WorkflowInterventionParamsSchema = z26.object({
7874
- interventionId: z26.string().min(1)
8049
+ var WorkflowInterventionParamsSchema = z27.object({
8050
+ interventionId: z27.string().min(1)
7875
8051
  });
7876
- var WorkflowRunStatusSchema = z26.enum([
8052
+ var WorkflowRunStatusSchema = z27.enum([
7877
8053
  "queued",
7878
8054
  "running",
7879
8055
  "waiting",
@@ -7881,91 +8057,91 @@ var WorkflowRunStatusSchema = z26.enum([
7881
8057
  "failed",
7882
8058
  "cancelled"
7883
8059
  ]);
7884
- var WorkflowInterventionStatusSchema = z26.enum([
8060
+ var WorkflowInterventionStatusSchema = z27.enum([
7885
8061
  "pending",
7886
8062
  "submitted",
7887
8063
  "cancelled",
7888
8064
  "expired"
7889
8065
  ]);
7890
- var WorkflowRunsQuerySchema = z26.object({
7891
- workflowId: z26.string().optional(),
8066
+ var WorkflowRunsQuerySchema = z27.object({
8067
+ workflowId: z27.string().optional(),
7892
8068
  status: WorkflowRunStatusSchema.optional(),
7893
- startedAfter: z26.string().optional(),
7894
- startedBefore: z26.string().optional(),
7895
- limit: z26.string().optional(),
7896
- offset: z26.string().optional(),
7897
- order: z26.enum(["asc", "desc"]).optional()
7898
- });
7899
- var WorkflowInterventionsQuerySchema = z26.object({
7900
- workflowId: z26.string().optional(),
7901
- workflowRunId: z26.string().optional(),
7902
- nodeRunId: z26.string().optional(),
7903
- nodeId: z26.string().optional(),
7904
- nodeKey: z26.string().optional(),
7905
- interventionId: z26.string().optional(),
8069
+ startedAfter: z27.string().optional(),
8070
+ startedBefore: z27.string().optional(),
8071
+ limit: z27.string().optional(),
8072
+ offset: z27.string().optional(),
8073
+ order: z27.enum(["asc", "desc"]).optional()
8074
+ });
8075
+ var WorkflowInterventionsQuerySchema = z27.object({
8076
+ workflowId: z27.string().optional(),
8077
+ workflowRunId: z27.string().optional(),
8078
+ nodeRunId: z27.string().optional(),
8079
+ nodeId: z27.string().optional(),
8080
+ nodeKey: z27.string().optional(),
8081
+ interventionId: z27.string().optional(),
7906
8082
  status: WorkflowInterventionStatusSchema.optional(),
7907
- requestedAfter: z26.string().optional(),
7908
- requestedBefore: z26.string().optional(),
7909
- limit: z26.string().optional(),
7910
- offset: z26.string().optional(),
7911
- order: z26.enum(["asc", "desc"]).optional()
8083
+ requestedAfter: z27.string().optional(),
8084
+ requestedBefore: z27.string().optional(),
8085
+ limit: z27.string().optional(),
8086
+ offset: z27.string().optional(),
8087
+ order: z27.enum(["asc", "desc"]).optional()
7912
8088
  });
7913
- var RequestWorkflowRunBodySchema = z26.object({
8089
+ var RequestWorkflowRunBodySchema = z27.object({
7914
8090
  input: WorkflowIOSnapshotSchema.optional()
7915
8091
  }).default({});
7916
- var WorkflowInterventionActorSchema = z26.object({
7917
- principalType: z26.enum(["user", "serviceAccount", "system"]),
7918
- principalId: z26.string().min(1)
8092
+ var WorkflowInterventionActorSchema = z27.object({
8093
+ principalType: z27.enum(["user", "serviceAccount", "system"]),
8094
+ principalId: z27.string().min(1)
7919
8095
  });
7920
- var CancelWorkflowRunBodySchema = z26.object({}).default({});
7921
- var SubmitWorkflowInterventionBodySchema = z26.object({
8096
+ var CancelWorkflowRunBodySchema = z27.object({}).default({});
8097
+ var SubmitWorkflowInterventionBodySchema = z27.object({
7922
8098
  response: WorkflowIOSnapshotSchema
7923
8099
  });
7924
- var CancelWorkflowInterventionBodySchema = z26.object({}).default({});
7925
- var WorkflowTriggerSchema = z26.object({
7926
- type: z26.literal("schedule"),
7927
- scheduleId: z26.string()
8100
+ var CancelWorkflowInterventionBodySchema = z27.object({}).default({});
8101
+ var WorkflowTriggerSchema = z27.object({
8102
+ type: z27.literal("schedule"),
8103
+ scheduleId: z27.string()
7928
8104
  });
7929
- var WorkflowNodeSchema = z26.union([
7930
- z26.object({
7931
- type: z26.literal("step"),
7932
- id: z26.string(),
7933
- key: z26.string(),
8105
+ var WorkflowNodeSchema = z27.union([
8106
+ z27.object({
8107
+ type: z27.literal("step"),
8108
+ id: z27.string(),
8109
+ key: z27.string(),
7934
8110
  input: WorkflowIOSnapshotSchema,
7935
8111
  output: WorkflowIOSnapshotSchema
7936
8112
  }),
7937
- z26.object({
7938
- type: z26.literal("action"),
7939
- id: z26.string(),
7940
- key: z26.string(),
7941
- objectTypeId: z26.string().optional(),
8113
+ z27.object({
8114
+ type: z27.literal("action"),
8115
+ id: z27.string(),
8116
+ key: z27.string(),
8117
+ objectTypeId: z27.string().optional(),
7942
8118
  params: WorkflowIOSnapshotSchema
7943
8119
  }),
7944
- z26.object({
7945
- type: z26.literal("intervention"),
7946
- id: z26.string(),
7947
- key: z26.string(),
8120
+ z27.object({
8121
+ type: z27.literal("intervention"),
8122
+ id: z27.string(),
8123
+ key: z27.string(),
7948
8124
  input: WorkflowIOSnapshotSchema,
7949
8125
  response: WorkflowIOSnapshotSchema,
7950
- description: z26.string().optional()
8126
+ description: z27.string().optional()
7951
8127
  }),
7952
- z26.object({
7953
- type: z26.literal("agent"),
7954
- id: z26.string(),
7955
- key: z26.string(),
7956
- agentId: z26.string(),
8128
+ z27.object({
8129
+ type: z27.literal("agent"),
8130
+ id: z27.string(),
8131
+ key: z27.string(),
8132
+ agentId: z27.string(),
7957
8133
  input: WorkflowIOSnapshotSchema,
7958
8134
  output: WorkflowIOSnapshotSchema
7959
8135
  })
7960
8136
  ]);
7961
- var WorkflowRunSummarySchema = z26.object({
7962
- id: z26.string(),
7963
- projectId: z26.string(),
7964
- workflowId: z26.string(),
8137
+ var WorkflowRunSummarySchema = z27.object({
8138
+ id: z27.string(),
8139
+ projectId: z27.string(),
8140
+ workflowId: z27.string(),
7965
8141
  status: WorkflowRunStatusSchema,
7966
- queuedAt: z26.string().optional(),
7967
- startedAt: z26.string(),
7968
- finishedAt: z26.string().optional(),
8142
+ queuedAt: z27.string().optional(),
8143
+ startedAt: z27.string(),
8144
+ finishedAt: z27.string().optional(),
7969
8145
  error: WorkflowRunFailureSchema.optional(),
7970
8146
  requestedBy: WorkflowInterventionActorSchema
7971
8147
  });
@@ -7973,111 +8149,111 @@ var WorkflowRunDetailSchema = WorkflowRunSummarySchema.extend({
7973
8149
  input: WorkflowIOSnapshotSchema,
7974
8150
  output: WorkflowIOSnapshotSchema.optional()
7975
8151
  });
7976
- var WorkflowAgentNodeExecutionSummarySchema = z26.object({
7977
- agentId: z26.string(),
7978
- status: z26.enum(["queued", "running", "succeeded", "failed", "cancelled"]),
7979
- attempt: z26.number().int().nonnegative(),
7980
- modelId: z26.string().optional(),
7981
- finishReason: z26.string().optional(),
8152
+ var WorkflowAgentNodeExecutionSummarySchema = z27.object({
8153
+ agentId: z27.string(),
8154
+ status: z27.enum(["queued", "running", "succeeded", "failed", "cancelled"]),
8155
+ attempt: z27.number().int().nonnegative(),
8156
+ modelId: z27.string().optional(),
8157
+ finishReason: z27.string().optional(),
7982
8158
  usage: AiUsageSummarySchema.optional(),
7983
8159
  cost: AiCostSummarySchema.optional(),
7984
- startedAt: z26.string().optional(),
7985
- completedAt: z26.string().optional()
8160
+ startedAt: z27.string().optional(),
8161
+ completedAt: z27.string().optional()
7986
8162
  });
7987
- var WorkflowAgentFailurePhaseSchema = z26.enum(["agent-loop", "structured-finalizer"]);
8163
+ var WorkflowAgentFailurePhaseSchema = z27.enum(["agent-loop", "structured-finalizer"]);
7988
8164
  var WorkflowAgentNodeExecutionSchema = WorkflowAgentNodeExecutionSummarySchema.extend({
7989
- nodeRunId: z26.string(),
7990
- prompt: z26.string(),
7991
- trace: z26.array(AgentMessagePartSchema).optional(),
7992
- diagnostics: z26.array(JsonValueSchema).optional(),
8165
+ nodeRunId: z27.string(),
8166
+ prompt: z27.string(),
8167
+ trace: z27.array(AgentMessagePartSchema).optional(),
8168
+ diagnostics: z27.array(JsonValueSchema).optional(),
7993
8169
  failurePhase: WorkflowAgentFailurePhaseSchema.optional(),
7994
8170
  error: AgentRunFailureSchema.optional(),
7995
- createdAt: z26.string()
7996
- });
7997
- var WorkflowNodeRunSchema = z26.object({
7998
- id: z26.string(),
7999
- projectId: z26.string(),
8000
- workflowRunId: z26.string(),
8001
- workflowId: z26.string(),
8002
- nodeIndex: z26.number(),
8003
- nodeType: z26.enum(["step", "action", "intervention", "agent"]),
8004
- nodeId: z26.string(),
8005
- nodeKey: z26.string(),
8006
- status: z26.enum(["running", "waiting", "succeeded", "failed", "cancelled"]),
8171
+ createdAt: z27.string()
8172
+ });
8173
+ var WorkflowNodeRunSchema = z27.object({
8174
+ id: z27.string(),
8175
+ projectId: z27.string(),
8176
+ workflowRunId: z27.string(),
8177
+ workflowId: z27.string(),
8178
+ nodeIndex: z27.number(),
8179
+ nodeType: z27.enum(["step", "action", "intervention", "agent"]),
8180
+ nodeId: z27.string(),
8181
+ nodeKey: z27.string(),
8182
+ status: z27.enum(["running", "waiting", "succeeded", "failed", "cancelled"]),
8007
8183
  input: WorkflowIOSnapshotSchema,
8008
- startedAt: z26.string(),
8009
- finishedAt: z26.string().optional(),
8184
+ startedAt: z27.string(),
8185
+ finishedAt: z27.string().optional(),
8010
8186
  output: WorkflowIOSnapshotSchema.optional(),
8011
8187
  error: WorkflowRunFailureSchema.optional(),
8012
8188
  agentExecution: WorkflowAgentNodeExecutionSummarySchema.optional()
8013
8189
  });
8014
- var WorkflowInterventionSchema = z26.object({
8015
- id: z26.string(),
8016
- projectId: z26.string(),
8017
- workflowId: z26.string(),
8018
- workflowRunId: z26.string(),
8019
- nodeRunId: z26.string(),
8020
- nodeIndex: z26.number(),
8021
- nodeId: z26.string(),
8022
- nodeKey: z26.string(),
8023
- interventionId: z26.string(),
8190
+ var WorkflowInterventionSchema = z27.object({
8191
+ id: z27.string(),
8192
+ projectId: z27.string(),
8193
+ workflowId: z27.string(),
8194
+ workflowRunId: z27.string(),
8195
+ nodeRunId: z27.string(),
8196
+ nodeIndex: z27.number(),
8197
+ nodeId: z27.string(),
8198
+ nodeKey: z27.string(),
8199
+ interventionId: z27.string(),
8024
8200
  input: WorkflowIOSnapshotSchema,
8025
8201
  defaultResponse: WorkflowIOSnapshotSchema,
8026
8202
  status: WorkflowInterventionStatusSchema,
8027
- requestedAt: z26.string(),
8028
- expiresAt: z26.string().optional(),
8029
- submittedAt: z26.string().optional(),
8203
+ requestedAt: z27.string(),
8204
+ expiresAt: z27.string().optional(),
8205
+ submittedAt: z27.string().optional(),
8030
8206
  submittedBy: WorkflowInterventionActorSchema.optional(),
8031
8207
  response: WorkflowIOSnapshotSchema.optional(),
8032
- cancelledAt: z26.string().optional(),
8208
+ cancelledAt: z27.string().optional(),
8033
8209
  cancelledBy: WorkflowInterventionActorSchema.optional(),
8034
- expiredAt: z26.string().optional()
8210
+ expiredAt: z27.string().optional()
8035
8211
  });
8036
- var WorkflowSchema = z26.object({
8037
- id: z26.string(),
8212
+ var WorkflowSchema = z27.object({
8213
+ id: z27.string(),
8038
8214
  input: WorkflowIOSnapshotSchema,
8039
- triggers: z26.array(WorkflowTriggerSchema),
8040
- nodes: z26.array(WorkflowNodeSchema),
8215
+ triggers: z27.array(WorkflowTriggerSchema),
8216
+ nodes: z27.array(WorkflowNodeSchema),
8041
8217
  latestRun: WorkflowRunSummarySchema.nullable()
8042
8218
  });
8043
- var WorkflowRunListResponseSchema = z26.object({
8044
- runs: z26.array(WorkflowRunSummarySchema),
8045
- hasMore: z26.boolean(),
8046
- total: z26.number()
8219
+ var WorkflowRunListResponseSchema = z27.object({
8220
+ runs: z27.array(WorkflowRunSummarySchema),
8221
+ hasMore: z27.boolean(),
8222
+ total: z27.number()
8047
8223
  });
8048
- var WorkflowRunDetailResponseSchema = z26.object({
8224
+ var WorkflowRunDetailResponseSchema = z27.object({
8049
8225
  run: WorkflowRunDetailSchema,
8050
- nodes: z26.array(WorkflowNodeRunSchema)
8226
+ nodes: z27.array(WorkflowNodeRunSchema)
8051
8227
  });
8052
8228
  var CancelWorkflowRunResponseSchema = WorkflowRunDetailResponseSchema;
8053
- var WorkflowInterventionListResponseSchema = z26.object({
8054
- interventions: z26.array(WorkflowInterventionSchema),
8055
- hasMore: z26.boolean(),
8056
- total: z26.number()
8229
+ var WorkflowInterventionListResponseSchema = z27.object({
8230
+ interventions: z27.array(WorkflowInterventionSchema),
8231
+ hasMore: z27.boolean(),
8232
+ total: z27.number()
8057
8233
  });
8058
- var SubmitWorkflowInterventionResponseSchema = z26.object({
8234
+ var SubmitWorkflowInterventionResponseSchema = z27.object({
8059
8235
  intervention: WorkflowInterventionSchema,
8060
- jobId: z26.string()
8236
+ jobId: z27.string()
8061
8237
  });
8062
- var CancelWorkflowInterventionResponseSchema = z26.object({
8238
+ var CancelWorkflowInterventionResponseSchema = z27.object({
8063
8239
  intervention: WorkflowInterventionSchema
8064
8240
  });
8065
- var RequestWorkflowRunResponseSchema = z26.object({
8066
- runId: z26.string(),
8067
- jobId: z26.string(),
8068
- workflowId: z26.string(),
8069
- queuedAt: z26.string()
8241
+ var RequestWorkflowRunResponseSchema = z27.object({
8242
+ runId: z27.string(),
8243
+ jobId: z27.string(),
8244
+ workflowId: z27.string(),
8245
+ queuedAt: z27.string()
8070
8246
  });
8071
8247
 
8072
8248
  // src/routes/workflows.ts
8073
8249
  var WorkflowRunFileContentQuerySchema = FileContentQuerySchema.extend({
8074
- path: z27.string().min(1).regex(/^\/(?:input|output)(?:\/|$)/, "Workflow run file content paths must start with /input/ or /output/")
8250
+ path: z28.string().min(1).regex(/^\/(?:input|output)(?:\/|$)/, "Workflow run file content paths must start with /input/ or /output/")
8075
8251
  });
8076
8252
  var WorkflowNodeFileContentQuerySchema = FileContentQuerySchema.extend({
8077
- path: z27.string().min(1).regex(/^\/(?:input|output)(?:\/|$)/, "Workflow node file content paths must start with /input/ or /output/")
8253
+ path: z28.string().min(1).regex(/^\/(?:input|output)(?:\/|$)/, "Workflow node file content paths must start with /input/ or /output/")
8078
8254
  });
8079
8255
  var WorkflowNodeFileContentParamsSchema = WorkflowRunParamsSchema.extend({
8080
- nodeKey: z27.string().min(1)
8256
+ nodeKey: z28.string().min(1)
8081
8257
  });
8082
8258
  function serializeWorkflowRunSummary(run) {
8083
8259
  return {
@@ -9119,6 +9295,7 @@ function registerHttpRoutes(app, host, options) {
9119
9295
  registerFileRoutes(app, host);
9120
9296
  registerActionRunRoutes(app, host);
9121
9297
  registerAgentRoutes(app, host);
9298
+ registerModelRoutes(app, host);
9122
9299
  registerLinkRoutes(app, host);
9123
9300
  registerTelemetryRoutes(app, host);
9124
9301
  registerEventRoutes(app, host);
@@ -9280,269 +9457,269 @@ function notFoundResponse() {
9280
9457
  }
9281
9458
 
9282
9459
  // src/schemas/auth.ts
9283
- import { z as z28 } from "zod";
9284
- var AuthInvitationStatusSchema = z28.enum(["pending", "accepted", "revoked"]);
9285
- var AuthGroupOptionSchema = z28.object({
9286
- id: z28.string(),
9287
- label: z28.string().optional(),
9288
- description: z28.string().optional()
9289
- });
9290
- var AuthInvitationSchema = z28.object({
9291
- id: z28.string(),
9292
- email: z28.string(),
9293
- groupIds: z28.array(z28.string()),
9460
+ import { z as z29 } from "zod";
9461
+ var AuthInvitationStatusSchema = z29.enum(["pending", "accepted", "revoked"]);
9462
+ var AuthGroupOptionSchema = z29.object({
9463
+ id: z29.string(),
9464
+ label: z29.string().optional(),
9465
+ description: z29.string().optional()
9466
+ });
9467
+ var AuthInvitationSchema = z29.object({
9468
+ id: z29.string(),
9469
+ email: z29.string(),
9470
+ groupIds: z29.array(z29.string()),
9294
9471
  status: AuthInvitationStatusSchema,
9295
- createdAt: z28.string(),
9296
- updatedAt: z28.string(),
9297
- expiresAt: z28.string(),
9298
- acceptedAt: z28.string().optional(),
9299
- revokedAt: z28.string().optional()
9472
+ createdAt: z29.string(),
9473
+ updatedAt: z29.string(),
9474
+ expiresAt: z29.string(),
9475
+ acceptedAt: z29.string().optional(),
9476
+ revokedAt: z29.string().optional()
9300
9477
  });
9301
- var AuthInvitationDeliverySchema = z28.object({
9302
- status: z28.enum(["sent", "skipped", "rate_limited", "not_supported"])
9478
+ var AuthInvitationDeliverySchema = z29.object({
9479
+ status: z29.enum(["sent", "skipped", "rate_limited", "not_supported"])
9303
9480
  });
9304
9481
  var AuthInvitationGroupOptionSchema = AuthGroupOptionSchema;
9305
- var AuthAccessTokenKindSchema = z28.enum(["personal", "serviceAccount"]);
9306
- var AuthAccessTokenSubjectTypeSchema = z28.enum(["user", "serviceAccount"]);
9307
- var AuthAccessTokenStatusSchema = z28.enum(["active", "expired", "revoked"]);
9308
- var AuthServiceAccountStatusSchema = z28.enum(["active", "suspended"]);
9309
- var AuthUserStatusSchema = z28.enum(["active", "suspended"]);
9310
- var AuthAccessTokenSchema = z28.object({
9311
- id: z28.string(),
9312
- name: z28.string(),
9482
+ var AuthAccessTokenKindSchema = z29.enum(["personal", "serviceAccount"]);
9483
+ var AuthAccessTokenSubjectTypeSchema = z29.enum(["user", "serviceAccount"]);
9484
+ var AuthAccessTokenStatusSchema = z29.enum(["active", "expired", "revoked"]);
9485
+ var AuthServiceAccountStatusSchema = z29.enum(["active", "suspended"]);
9486
+ var AuthUserStatusSchema = z29.enum(["active", "suspended"]);
9487
+ var AuthAccessTokenSchema = z29.object({
9488
+ id: z29.string(),
9489
+ name: z29.string(),
9313
9490
  kind: AuthAccessTokenKindSchema,
9314
9491
  status: AuthAccessTokenStatusSchema,
9315
9492
  subjectType: AuthAccessTokenSubjectTypeSchema,
9316
- subjectId: z28.string(),
9317
- subjectLabel: z28.string().optional(),
9318
- groupIds: z28.array(z28.string()).optional(),
9319
- createdAt: z28.string(),
9320
- expiresAt: z28.string(),
9321
- revokedAt: z28.string().optional(),
9322
- lastUsedAt: z28.string().optional(),
9323
- lastUsedUserAgent: z28.string().optional(),
9324
- lastUsedIpAddress: z28.string().optional()
9325
- });
9326
- var AuthServiceAccountSchema = z28.object({
9327
- id: z28.string(),
9328
- name: z28.string(),
9329
- description: z28.string().optional(),
9493
+ subjectId: z29.string(),
9494
+ subjectLabel: z29.string().optional(),
9495
+ groupIds: z29.array(z29.string()).optional(),
9496
+ createdAt: z29.string(),
9497
+ expiresAt: z29.string(),
9498
+ revokedAt: z29.string().optional(),
9499
+ lastUsedAt: z29.string().optional(),
9500
+ lastUsedUserAgent: z29.string().optional(),
9501
+ lastUsedIpAddress: z29.string().optional()
9502
+ });
9503
+ var AuthServiceAccountSchema = z29.object({
9504
+ id: z29.string(),
9505
+ name: z29.string(),
9506
+ description: z29.string().optional(),
9330
9507
  status: AuthServiceAccountStatusSchema,
9331
- groupIds: z28.array(z28.string()),
9332
- createdAt: z28.string(),
9333
- updatedAt: z28.string()
9334
- });
9335
- var AuthMemberUserSchema = z28.object({
9336
- id: z28.string(),
9337
- email: z28.string(),
9338
- displayName: z28.string().optional(),
9339
- avatarUrl: z28.string().optional(),
9508
+ groupIds: z29.array(z29.string()),
9509
+ createdAt: z29.string(),
9510
+ updatedAt: z29.string()
9511
+ });
9512
+ var AuthMemberUserSchema = z29.object({
9513
+ id: z29.string(),
9514
+ email: z29.string(),
9515
+ displayName: z29.string().optional(),
9516
+ avatarUrl: z29.string().optional(),
9340
9517
  status: AuthUserStatusSchema,
9341
- createdAt: z28.string(),
9342
- updatedAt: z28.string()
9518
+ createdAt: z29.string(),
9519
+ updatedAt: z29.string()
9343
9520
  });
9344
- var AuthManagedMemberSchema = z28.object({
9521
+ var AuthManagedMemberSchema = z29.object({
9345
9522
  user: AuthMemberUserSchema,
9346
- groupIds: z28.array(z28.string())
9523
+ groupIds: z29.array(z29.string())
9347
9524
  });
9348
- var AuthMemberCapabilitiesSchema = z28.object({
9349
- assignGroups: z28.boolean(),
9350
- suspend: z28.boolean(),
9351
- reactivate: z28.boolean()
9525
+ var AuthMemberCapabilitiesSchema = z29.object({
9526
+ assignGroups: z29.boolean(),
9527
+ suspend: z29.boolean(),
9528
+ reactivate: z29.boolean()
9352
9529
  });
9353
9530
  var AuthMemberSchema = AuthManagedMemberSchema.extend({
9354
9531
  capabilities: AuthMemberCapabilitiesSchema
9355
9532
  });
9356
- var GetAuthAccessManagementOptionsResponseSchema = z28.object({
9357
- groups: z28.array(AuthGroupOptionSchema)
9533
+ var GetAuthAccessManagementOptionsResponseSchema = z29.object({
9534
+ groups: z29.array(AuthGroupOptionSchema)
9358
9535
  });
9359
- var ListAuthAccessTokensResponseSchema = z28.object({
9360
- accessTokens: z28.array(AuthAccessTokenSchema)
9536
+ var ListAuthAccessTokensResponseSchema = z29.object({
9537
+ accessTokens: z29.array(AuthAccessTokenSchema)
9361
9538
  });
9362
- var CreateAuthPersonalAccessTokenBodySchema = z28.object({
9363
- name: z28.string().trim().min(1),
9364
- expiresAt: z28.string().min(1),
9365
- groupIds: z28.array(z28.string().min(1)).optional()
9539
+ var CreateAuthPersonalAccessTokenBodySchema = z29.object({
9540
+ name: z29.string().trim().min(1),
9541
+ expiresAt: z29.string().min(1),
9542
+ groupIds: z29.array(z29.string().min(1)).optional()
9366
9543
  });
9367
- var CreateAuthPersonalAccessTokenResponseSchema = z28.object({
9544
+ var CreateAuthPersonalAccessTokenResponseSchema = z29.object({
9368
9545
  accessToken: AuthAccessTokenSchema,
9369
- tokenValue: z28.string()
9546
+ tokenValue: z29.string()
9370
9547
  });
9371
- var RevokeAuthAccessTokenParamsSchema = z28.object({
9372
- tokenId: z28.string().min(1)
9548
+ var RevokeAuthAccessTokenParamsSchema = z29.object({
9549
+ tokenId: z29.string().min(1)
9373
9550
  });
9374
- var RevokeAuthAccessTokenResponseSchema = z28.object({
9551
+ var RevokeAuthAccessTokenResponseSchema = z29.object({
9375
9552
  accessToken: AuthAccessTokenSchema
9376
9553
  });
9377
- var ListAuthServiceAccountsResponseSchema = z28.object({
9378
- serviceAccounts: z28.array(AuthServiceAccountSchema)
9554
+ var ListAuthServiceAccountsResponseSchema = z29.object({
9555
+ serviceAccounts: z29.array(AuthServiceAccountSchema)
9379
9556
  });
9380
- var CreateAuthServiceAccountBodySchema = z28.object({
9381
- id: z28.string().trim().min(1).optional(),
9382
- name: z28.string().trim().min(1),
9383
- description: z28.string().trim().optional(),
9384
- groupIds: z28.array(z28.string().min(1)).optional()
9557
+ var CreateAuthServiceAccountBodySchema = z29.object({
9558
+ id: z29.string().trim().min(1).optional(),
9559
+ name: z29.string().trim().min(1),
9560
+ description: z29.string().trim().optional(),
9561
+ groupIds: z29.array(z29.string().min(1)).optional()
9385
9562
  });
9386
- var CreateAuthServiceAccountResponseSchema = z28.object({
9563
+ var CreateAuthServiceAccountResponseSchema = z29.object({
9387
9564
  serviceAccount: AuthServiceAccountSchema
9388
9565
  });
9389
- var AuthServiceAccountParamsSchema = z28.object({
9390
- serviceAccountId: z28.string().min(1)
9566
+ var AuthServiceAccountParamsSchema = z29.object({
9567
+ serviceAccountId: z29.string().min(1)
9391
9568
  });
9392
- var DisableAuthServiceAccountResponseSchema = z28.object({
9569
+ var DisableAuthServiceAccountResponseSchema = z29.object({
9393
9570
  serviceAccount: AuthServiceAccountSchema
9394
9571
  });
9395
- var ListAuthServiceAccountAccessTokensResponseSchema = z28.object({
9396
- accessTokens: z28.array(AuthAccessTokenSchema)
9572
+ var ListAuthServiceAccountAccessTokensResponseSchema = z29.object({
9573
+ accessTokens: z29.array(AuthAccessTokenSchema)
9397
9574
  });
9398
- var CreateAuthServiceAccountAccessTokenBodySchema = z28.object({
9399
- name: z28.string().trim().min(1),
9400
- expiresAt: z28.string().min(1),
9401
- groupIds: z28.array(z28.string().min(1)).optional()
9575
+ var CreateAuthServiceAccountAccessTokenBodySchema = z29.object({
9576
+ name: z29.string().trim().min(1),
9577
+ expiresAt: z29.string().min(1),
9578
+ groupIds: z29.array(z29.string().min(1)).optional()
9402
9579
  });
9403
- var CreateAuthServiceAccountAccessTokenResponseSchema = z28.object({
9580
+ var CreateAuthServiceAccountAccessTokenResponseSchema = z29.object({
9404
9581
  accessToken: AuthAccessTokenSchema,
9405
- tokenValue: z28.string()
9582
+ tokenValue: z29.string()
9406
9583
  });
9407
9584
  var RevokeAuthServiceAccountAccessTokenParamsSchema = AuthServiceAccountParamsSchema.extend({
9408
- tokenId: z28.string().min(1)
9585
+ tokenId: z29.string().min(1)
9409
9586
  });
9410
- var RevokeAuthServiceAccountAccessTokenResponseSchema = z28.object({
9587
+ var RevokeAuthServiceAccountAccessTokenResponseSchema = z29.object({
9411
9588
  accessToken: AuthAccessTokenSchema
9412
9589
  });
9413
- var AuthCreateInvitationCapabilitySchema = z28.union([
9414
- z28.object({
9415
- state: z28.literal("enabled")
9590
+ var AuthCreateInvitationCapabilitySchema = z29.union([
9591
+ z29.object({
9592
+ state: z29.literal("enabled")
9416
9593
  }),
9417
- z28.object({
9418
- state: z28.literal("disabled"),
9419
- reason: z28.enum(["missing_membership_policy", "invitation_delivery_not_supported"])
9594
+ z29.object({
9595
+ state: z29.literal("disabled"),
9596
+ reason: z29.enum(["missing_membership_policy", "invitation_delivery_not_supported"])
9420
9597
  })
9421
9598
  ]);
9422
- var AuthInvitationDestinationSchema = z28.object({
9423
- id: z28.enum(["atlas", "app"]),
9424
- label: z28.string()
9425
- });
9426
- var GetAuthInvitationOptionsResponseSchema = z28.object({
9427
- groups: z28.array(AuthInvitationGroupOptionSchema),
9428
- destinations: z28.array(AuthInvitationDestinationSchema),
9429
- defaultDestinationId: z28.enum(["atlas", "app"]).optional(),
9430
- canInviteWithoutGroups: z28.boolean(),
9431
- capabilities: z28.object({
9599
+ var AuthInvitationDestinationSchema = z29.object({
9600
+ id: z29.enum(["atlas", "app"]),
9601
+ label: z29.string()
9602
+ });
9603
+ var GetAuthInvitationOptionsResponseSchema = z29.object({
9604
+ groups: z29.array(AuthInvitationGroupOptionSchema),
9605
+ destinations: z29.array(AuthInvitationDestinationSchema),
9606
+ defaultDestinationId: z29.enum(["atlas", "app"]).optional(),
9607
+ canInviteWithoutGroups: z29.boolean(),
9608
+ capabilities: z29.object({
9432
9609
  createInvitation: AuthCreateInvitationCapabilitySchema
9433
9610
  })
9434
9611
  });
9435
- var GetAuthMembershipOptionsResponseSchema = z28.object({
9436
- groups: z28.array(AuthGroupOptionSchema),
9437
- capabilities: z28.object({
9438
- invite: z28.boolean(),
9439
- assignGroups: z28.boolean(),
9440
- suspend: z28.boolean()
9612
+ var GetAuthMembershipOptionsResponseSchema = z29.object({
9613
+ groups: z29.array(AuthGroupOptionSchema),
9614
+ capabilities: z29.object({
9615
+ invite: z29.boolean(),
9616
+ assignGroups: z29.boolean(),
9617
+ suspend: z29.boolean()
9441
9618
  })
9442
9619
  });
9443
- var ListAuthMembersQuerySchema = z28.object({
9444
- limit: z28.string().optional(),
9445
- offset: z28.string().optional(),
9446
- order: z28.enum(["asc", "desc"]).optional()
9620
+ var ListAuthMembersQuerySchema = z29.object({
9621
+ limit: z29.string().optional(),
9622
+ offset: z29.string().optional(),
9623
+ order: z29.enum(["asc", "desc"]).optional()
9447
9624
  });
9448
- var ListAuthMembersResponseSchema = z28.object({
9449
- members: z28.array(AuthMemberSchema),
9450
- hasMore: z28.boolean(),
9451
- total: z28.number()
9625
+ var ListAuthMembersResponseSchema = z29.object({
9626
+ members: z29.array(AuthMemberSchema),
9627
+ hasMore: z29.boolean(),
9628
+ total: z29.number()
9452
9629
  });
9453
- var AuthMemberParamsSchema = z28.object({
9454
- userId: z28.string().min(1)
9630
+ var AuthMemberParamsSchema = z29.object({
9631
+ userId: z29.string().min(1)
9455
9632
  });
9456
- var UpdateAuthMemberGroupsBodySchema = z28.object({
9457
- groupIds: z28.array(z28.string().min(1))
9633
+ var UpdateAuthMemberGroupsBodySchema = z29.object({
9634
+ groupIds: z29.array(z29.string().min(1))
9458
9635
  });
9459
- var UpdateAuthMemberGroupsResponseSchema = z28.object({
9636
+ var UpdateAuthMemberGroupsResponseSchema = z29.object({
9460
9637
  member: AuthManagedMemberSchema
9461
9638
  });
9462
- var SuspendAuthMemberResponseSchema = z28.object({
9639
+ var SuspendAuthMemberResponseSchema = z29.object({
9463
9640
  member: AuthManagedMemberSchema
9464
9641
  });
9465
- var ReactivateAuthMemberResponseSchema = z28.object({
9642
+ var ReactivateAuthMemberResponseSchema = z29.object({
9466
9643
  member: AuthManagedMemberSchema
9467
9644
  });
9468
- var CreateAuthInvitationBodySchema = z28.object({
9469
- email: z28.string().min(1),
9470
- groupIds: z28.array(z28.string().min(1)).optional(),
9471
- destinationId: z28.enum(["atlas", "app"]).optional(),
9472
- expiresAt: z28.string().optional(),
9473
- returnTo: z28.string().optional()
9645
+ var CreateAuthInvitationBodySchema = z29.object({
9646
+ email: z29.string().min(1),
9647
+ groupIds: z29.array(z29.string().min(1)).optional(),
9648
+ destinationId: z29.enum(["atlas", "app"]).optional(),
9649
+ expiresAt: z29.string().optional(),
9650
+ returnTo: z29.string().optional()
9474
9651
  });
9475
- var CreateAuthInvitationResponseSchema = z28.object({
9652
+ var CreateAuthInvitationResponseSchema = z29.object({
9476
9653
  invitation: AuthInvitationSchema,
9477
9654
  delivery: AuthInvitationDeliverySchema
9478
9655
  });
9479
- var ListAuthInvitationsQuerySchema = z28.object({
9480
- email: z28.string().optional(),
9656
+ var ListAuthInvitationsQuerySchema = z29.object({
9657
+ email: z29.string().optional(),
9481
9658
  status: AuthInvitationStatusSchema.optional(),
9482
- limit: z28.string().optional(),
9483
- offset: z28.string().optional(),
9484
- order: z28.enum(["asc", "desc"]).optional()
9659
+ limit: z29.string().optional(),
9660
+ offset: z29.string().optional(),
9661
+ order: z29.enum(["asc", "desc"]).optional()
9485
9662
  });
9486
- var ListAuthInvitationsResponseSchema = z28.object({
9487
- invitations: z28.array(AuthInvitationSchema),
9488
- hasMore: z28.boolean(),
9489
- total: z28.number()
9663
+ var ListAuthInvitationsResponseSchema = z29.object({
9664
+ invitations: z29.array(AuthInvitationSchema),
9665
+ hasMore: z29.boolean(),
9666
+ total: z29.number()
9490
9667
  });
9491
- var RevokeAuthInvitationParamsSchema = z28.object({
9492
- invitationId: z28.string().min(1)
9668
+ var RevokeAuthInvitationParamsSchema = z29.object({
9669
+ invitationId: z29.string().min(1)
9493
9670
  });
9494
- var RevokeAuthInvitationResponseSchema = z28.object({
9671
+ var RevokeAuthInvitationResponseSchema = z29.object({
9495
9672
  invitation: AuthInvitationSchema
9496
9673
  });
9497
- var AuthSessionResponseSchema = z28.union([
9498
- z28.object({
9499
- authenticated: z28.literal(false)
9674
+ var AuthSessionResponseSchema = z29.union([
9675
+ z29.object({
9676
+ authenticated: z29.literal(false)
9500
9677
  }),
9501
- z28.object({
9502
- authenticated: z28.literal(true),
9503
- csrfToken: z28.string(),
9504
- applicationAccess: z28.object({
9505
- allowed: z28.boolean(),
9506
- audience: z28.enum(["atlas", "app"])
9678
+ z29.object({
9679
+ authenticated: z29.literal(true),
9680
+ csrfToken: z29.string(),
9681
+ applicationAccess: z29.object({
9682
+ allowed: z29.boolean(),
9683
+ audience: z29.enum(["atlas", "app"])
9507
9684
  }),
9508
- user: z28.object({
9509
- id: z28.string(),
9510
- email: z28.string(),
9511
- displayName: z28.string().optional(),
9512
- avatarUrl: z28.string().optional(),
9513
- groupIds: z28.array(z28.string())
9685
+ user: z29.object({
9686
+ id: z29.string(),
9687
+ email: z29.string(),
9688
+ displayName: z29.string().optional(),
9689
+ avatarUrl: z29.string().optional(),
9690
+ groupIds: z29.array(z29.string())
9514
9691
  }),
9515
- session: z28.object({
9516
- id: z28.string(),
9517
- expiresAt: z28.string()
9692
+ session: z29.object({
9693
+ id: z29.string(),
9694
+ expiresAt: z29.string()
9518
9695
  })
9519
9696
  })
9520
9697
  ]);
9521
- var AuthSignOutResponseSchema = z28.object({
9522
- success: z28.boolean()
9698
+ var AuthSignOutResponseSchema = z29.object({
9699
+ success: z29.boolean()
9523
9700
  });
9524
- var AuthSessionSummarySchema = z28.object({
9525
- id: z28.string(),
9526
- audience: z28.enum(["atlas", "app"]),
9527
- current: z28.boolean(),
9528
- createdAt: z28.string(),
9529
- expiresAt: z28.string(),
9530
- lastSeenAt: z28.string().optional(),
9531
- userAgent: z28.string().optional(),
9532
- ipAddress: z28.string().optional()
9701
+ var AuthSessionSummarySchema = z29.object({
9702
+ id: z29.string(),
9703
+ audience: z29.enum(["atlas", "app"]),
9704
+ current: z29.boolean(),
9705
+ createdAt: z29.string(),
9706
+ expiresAt: z29.string(),
9707
+ lastSeenAt: z29.string().optional(),
9708
+ userAgent: z29.string().optional(),
9709
+ ipAddress: z29.string().optional()
9533
9710
  });
9534
- var ListAuthSessionsResponseSchema = z28.object({
9535
- sessions: z28.array(AuthSessionSummarySchema)
9711
+ var ListAuthSessionsResponseSchema = z29.object({
9712
+ sessions: z29.array(AuthSessionSummarySchema)
9536
9713
  });
9537
- var RevokeAuthSessionParamsSchema = z28.object({
9538
- sessionId: z28.string().min(1)
9714
+ var RevokeAuthSessionParamsSchema = z29.object({
9715
+ sessionId: z29.string().min(1)
9539
9716
  });
9540
- var RevokeAuthSessionResponseSchema = z28.object({
9541
- success: z28.boolean()
9717
+ var RevokeAuthSessionResponseSchema = z29.object({
9718
+ success: z29.boolean()
9542
9719
  });
9543
- var SignOutAllResponseSchema = z28.object({
9544
- success: z28.boolean(),
9545
- revokedCount: z28.number()
9720
+ var SignOutAllResponseSchema = z29.object({
9721
+ success: z29.boolean(),
9722
+ revokedCount: z29.number()
9546
9723
  });
9547
9724
 
9548
9725
  // src/routes/auth.ts
@@ -11424,7 +11601,7 @@ import {
11424
11601
  isAgentRunActivityEvent
11425
11602
  } from "@sixb/core/agents/streams";
11426
11603
  import { BrokerCursorExpiredError } from "@sixb/core/broker";
11427
- import { z as z29 } from "zod";
11604
+ import { z as z30 } from "zod";
11428
11605
 
11429
11606
  // src/utils/ws.ts
11430
11607
  function safeSend(target, payload) {
@@ -11472,25 +11649,25 @@ async function decodeWsMessage(message) {
11472
11649
  }
11473
11650
 
11474
11651
  // src/routes/ws/agents.ts
11475
- var SubscribeSchema = z29.object({
11476
- type: z29.literal("subscribe"),
11477
- runId: z29.string().min(1),
11478
- afterCursor: z29.string().min(1).optional()
11652
+ var SubscribeSchema = z30.object({
11653
+ type: z30.literal("subscribe"),
11654
+ runId: z30.string().min(1),
11655
+ afterCursor: z30.string().min(1).optional()
11479
11656
  });
11480
- var SubscribeActivitySchema = z29.object({
11481
- type: z29.literal("subscribe.activity")
11657
+ var SubscribeActivitySchema = z30.object({
11658
+ type: z30.literal("subscribe.activity")
11482
11659
  });
11483
- var ReplaySchema = z29.object({
11484
- type: z29.literal("replay"),
11485
- runId: z29.string().min(1),
11486
- afterCursor: z29.string().min(1).optional(),
11487
- limit: z29.number().int().positive().max(500).optional()
11660
+ var ReplaySchema = z30.object({
11661
+ type: z30.literal("replay"),
11662
+ runId: z30.string().min(1),
11663
+ afterCursor: z30.string().min(1).optional(),
11664
+ limit: z30.number().int().positive().max(500).optional()
11488
11665
  });
11489
- var UnsubscribeSchema = z29.object({
11490
- type: z29.literal("unsubscribe"),
11491
- runId: z29.string().min(1).optional()
11666
+ var UnsubscribeSchema = z30.object({
11667
+ type: z30.literal("unsubscribe"),
11668
+ runId: z30.string().min(1).optional()
11492
11669
  });
11493
- var AgentStreamMessageSchema = z29.union([
11670
+ var AgentStreamMessageSchema = z30.union([
11494
11671
  SubscribeSchema,
11495
11672
  SubscribeActivitySchema,
11496
11673
  ReplaySchema,
@@ -11776,22 +11953,22 @@ function errorMessage(error) {
11776
11953
 
11777
11954
  // src/routes/ws/events.ts
11778
11955
  import { scopeKeysForEvent } from "@sixb/core/events/scope";
11779
- import { z as z30 } from "zod";
11780
- var SubscribeSchema2 = z30.object({
11781
- type: z30.literal("subscribe"),
11782
- topic: z30.enum(EVENT_TOPICS).optional(),
11783
- types: z30.array(z30.enum(EVENT_TYPES)).optional(),
11784
- objectTypeId: z30.string().optional(),
11785
- primaryId: z30.string().optional(),
11786
- actionId: z30.string().optional(),
11787
- runId: z30.string().optional(),
11788
- afterCursor: z30.string().optional(),
11789
- limit: z30.number().int().positive().max(500).optional()
11790
- });
11791
- var UnsubscribeSchema2 = z30.object({
11792
- type: z30.literal("unsubscribe")
11793
- });
11794
- var SubscriptionMessageSchema = z30.union([SubscribeSchema2, UnsubscribeSchema2]);
11956
+ import { z as z31 } from "zod";
11957
+ var SubscribeSchema2 = z31.object({
11958
+ type: z31.literal("subscribe"),
11959
+ topic: z31.enum(EVENT_TOPICS).optional(),
11960
+ types: z31.array(z31.enum(EVENT_TYPES)).optional(),
11961
+ objectTypeId: z31.string().optional(),
11962
+ primaryId: z31.string().optional(),
11963
+ actionId: z31.string().optional(),
11964
+ runId: z31.string().optional(),
11965
+ afterCursor: z31.string().optional(),
11966
+ limit: z31.number().int().positive().max(500).optional()
11967
+ });
11968
+ var UnsubscribeSchema2 = z31.object({
11969
+ type: z31.literal("unsubscribe")
11970
+ });
11971
+ var SubscriptionMessageSchema = z31.union([SubscribeSchema2, UnsubscribeSchema2]);
11795
11972
  function parseSubscriptionMessage(payload) {
11796
11973
  if (!payload || typeof payload !== "object") {
11797
11974
  return { ok: false, error: "Message must be a JSON object." };
@@ -11981,7 +12158,7 @@ function eventMatchesScope(event, filter) {
11981
12158
  }
11982
12159
 
11983
12160
  // src/routes/ws/logs.ts
11984
- import { z as z31 } from "zod";
12161
+ import { z as z32 } from "zod";
11985
12162
 
11986
12163
  // src/routes/ws/log-subscription-hub.ts
11987
12164
  import { BrokerCursorExpiredError as BrokerCursorExpiredError2 } from "@sixb/core/broker";
@@ -12294,26 +12471,26 @@ function socketBufferedAmount(ws) {
12294
12471
  }
12295
12472
 
12296
12473
  // src/routes/ws/logs.ts
12297
- var SubscribeSchema3 = z31.object({
12298
- type: z31.literal("subscribe"),
12299
- kinds: z31.array(z31.enum(SIXB_RUN_KINDS)).min(1).optional(),
12300
- levels: z31.array(z31.enum(LOG_LEVELS)).min(1).optional(),
12301
- run: z31.object({
12302
- kind: z31.enum(SIXB_RUN_KINDS),
12474
+ var SubscribeSchema3 = z32.object({
12475
+ type: z32.literal("subscribe"),
12476
+ kinds: z32.array(z32.enum(SIXB_RUN_KINDS)).min(1).optional(),
12477
+ levels: z32.array(z32.enum(LOG_LEVELS)).min(1).optional(),
12478
+ run: z32.object({
12479
+ kind: z32.enum(SIXB_RUN_KINDS),
12303
12480
  id: LogRunIdSchema
12304
12481
  }).optional(),
12305
- afterCursor: z31.string().optional()
12482
+ afterCursor: z32.string().optional()
12306
12483
  }).superRefine((value, context) => {
12307
12484
  if (value.run && value.kinds && !value.kinds.includes(value.run.kind)) {
12308
12485
  context.addIssue({
12309
- code: z31.ZodIssueCode.custom,
12486
+ code: z32.ZodIssueCode.custom,
12310
12487
  path: ["run"],
12311
12488
  message: "run.kind must be included in kinds"
12312
12489
  });
12313
12490
  }
12314
12491
  });
12315
- var UnsubscribeSchema3 = z31.object({ type: z31.literal("unsubscribe") });
12316
- var SubscriptionMessageSchema2 = z31.union([SubscribeSchema3, UnsubscribeSchema3]);
12492
+ var UnsubscribeSchema3 = z32.object({ type: z32.literal("unsubscribe") });
12493
+ var SubscriptionMessageSchema2 = z32.union([SubscribeSchema3, UnsubscribeSchema3]);
12317
12494
  function parseLogSubscriptionMessage(payload) {
12318
12495
  if (!payload || typeof payload !== "object") {
12319
12496
  return { ok: false, error: "Message must be a JSON object." };
@@ -12696,4 +12873,4 @@ export {
12696
12873
  SixbServer
12697
12874
  };
12698
12875
 
12699
- //# debugId=16E192D0EFF3C5F064756E2164756E21
12876
+ //# debugId=7EBA739DF50836F764756E2164756E21