@sixb/server 0.1.3 → 0.1.5

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 (52) hide show
  1. package/README.md +1 -1
  2. package/dist/index.js +1127 -937
  3. package/dist/index.js.map +17 -15
  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/actions.d.ts +2 -1
  8. package/dist/routes/actions.d.ts.map +1 -1
  9. package/dist/routes/agents.d.ts +15 -0
  10. package/dist/routes/agents.d.ts.map +1 -1
  11. package/dist/routes/links.d.ts +0 -51
  12. package/dist/routes/links.d.ts.map +1 -1
  13. package/dist/routes/logs.d.ts +1 -1
  14. package/dist/routes/models.d.ts +60 -0
  15. package/dist/routes/models.d.ts.map +1 -0
  16. package/dist/routes/objects.d.ts +48 -0
  17. package/dist/routes/objects.d.ts.map +1 -1
  18. package/dist/routes/projections.d.ts +88 -86
  19. package/dist/routes/projections.d.ts.map +1 -1
  20. package/dist/routes/syncs.d.ts +32 -32
  21. package/dist/schemas/actions.d.ts +92 -0
  22. package/dist/schemas/actions.d.ts.map +1 -1
  23. package/dist/schemas/agents.d.ts +127 -0
  24. package/dist/schemas/agents.d.ts.map +1 -1
  25. package/dist/schemas/ai-accounting.d.ts +26 -26
  26. package/dist/schemas/connectors.d.ts +11 -1
  27. package/dist/schemas/connectors.d.ts.map +1 -1
  28. package/dist/schemas/links.d.ts +0 -41
  29. package/dist/schemas/links.d.ts.map +1 -1
  30. package/dist/schemas/logs.d.ts +4 -4
  31. package/dist/schemas/models.d.ts +50 -0
  32. package/dist/schemas/models.d.ts.map +1 -0
  33. package/dist/schemas/objects.d.ts +22 -0
  34. package/dist/schemas/objects.d.ts.map +1 -1
  35. package/dist/schemas/projections.d.ts +542 -513
  36. package/dist/schemas/projections.d.ts.map +1 -1
  37. package/dist/schemas/syncs.d.ts +23 -23
  38. package/package.json +4 -4
  39. package/src/openapi/tags.ts +4 -0
  40. package/src/registerRoutes.ts +2 -0
  41. package/src/routes/actions.ts +18 -3
  42. package/src/routes/agents.ts +21 -3
  43. package/src/routes/links.ts +2 -53
  44. package/src/routes/models.ts +31 -0
  45. package/src/routes/objects.ts +103 -0
  46. package/src/schemas/actions.ts +5 -0
  47. package/src/schemas/agents.ts +15 -0
  48. package/src/schemas/connectors.ts +13 -3
  49. package/src/schemas/links.ts +0 -17
  50. package/src/schemas/models.ts +15 -0
  51. package/src/schemas/objects.ts +104 -0
  52. 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"
@@ -1208,6 +1212,9 @@ var ActionCatalogItemSchema = z3.object({
1208
1212
  effects: z3.boolean()
1209
1213
  })
1210
1214
  });
1215
+ var ActionDetailSchema = ActionCatalogItemSchema.extend({
1216
+ inputSchema: z3.record(z3.unknown())
1217
+ });
1211
1218
  var ActionRunStatusSchema = z3.enum([
1212
1219
  "queued",
1213
1220
  "running",
@@ -1667,6 +1674,7 @@ function registerActionRunRoutes(app, host) {
1667
1674
  }
1668
1675
 
1669
1676
  // src/routes/actions.ts
1677
+ import { schemaFieldsToJsonSchema } from "@sixb/core/internal/ontology";
1670
1678
  function serializeAction(action) {
1671
1679
  return ActionCatalogItemSchema.parse({
1672
1680
  id: action.id,
@@ -1690,7 +1698,16 @@ function serializeAction(action) {
1690
1698
  }
1691
1699
  });
1692
1700
  }
1693
- function registerActionRoutes(app, _host) {
1701
+ function serializeActionDetail(action, host) {
1702
+ return ActionDetailSchema.parse({
1703
+ ...serializeAction(action),
1704
+ inputSchema: schemaFieldsToJsonSchema({
1705
+ fields: action.params,
1706
+ valueTypesById: host.definitions.ontology.getValueTypesById()
1707
+ })
1708
+ });
1709
+ }
1710
+ function registerActionRoutes(app, host) {
1694
1711
  return app.get("/api/actions", async (context) => {
1695
1712
  const actions = requireRequestSixb(context).actions.list();
1696
1713
  return actions.map(serializeAction);
@@ -1709,10 +1726,10 @@ function registerActionRoutes(app, _host) {
1709
1726
  set.status = 404;
1710
1727
  return { error: "Action not found" };
1711
1728
  }
1712
- return serializeAction(action);
1729
+ return serializeActionDetail(action, host);
1713
1730
  }, {
1714
1731
  params: ActionIdParamsSchema,
1715
- response: { 200: ActionCatalogItemSchema, 404: ErrorResponseSchema },
1732
+ response: { 200: ActionDetailSchema, 404: ErrorResponseSchema },
1716
1733
  detail: {
1717
1734
  summary: "Get action metadata",
1718
1735
  tags: [OPENAPI_TAGS.actions.name],
@@ -2693,6 +2710,11 @@ var AgentContextPartSchema = AgentContextEntryInputSchema.extend({
2693
2710
  var AgentLoopConfigSchema = z8.object({
2694
2711
  stopWhen: z8.object({
2695
2712
  maxSteps: z8.number().int().positive().optional()
2713
+ }).optional(),
2714
+ context: z8.object({
2715
+ windowTokens: z8.number().int().positive().optional(),
2716
+ reserveTokens: z8.number().int().positive().optional(),
2717
+ keepRecentTokens: z8.number().int().positive().optional()
2696
2718
  }).optional()
2697
2719
  });
2698
2720
  var AgentReasoningLevelSchema = z8.enum(AGENT_REASONING_LEVELS);
@@ -2791,6 +2813,11 @@ var AgentRunDiagnosticSchema = z8.object({
2791
2813
  path: z8.string().optional(),
2792
2814
  message: z8.string()
2793
2815
  });
2816
+ var AgentMessageCompactionSchema = z8.object({
2817
+ checkpointId: z8.string(),
2818
+ summary: z8.string(),
2819
+ createdAt: z8.string()
2820
+ });
2794
2821
  var AgentMessageSchema = z8.object({
2795
2822
  id: z8.string(),
2796
2823
  projectId: z8.string(),
@@ -2801,6 +2828,7 @@ var AgentMessageSchema = z8.object({
2801
2828
  seq: z8.number(),
2802
2829
  parts: z8.array(AgentMessagePartSchema),
2803
2830
  annotations: z8.array(AgentRunDiagnosticSchema),
2831
+ compaction: AgentMessageCompactionSchema.optional(),
2804
2832
  metadata: JsonValueSchema.optional(),
2805
2833
  contentVersion: z8.number(),
2806
2834
  createdAt: z8.string(),
@@ -2905,7 +2933,7 @@ function serializeThread(thread) {
2905
2933
  updatedAt: toIsoString(thread.updatedAt)
2906
2934
  });
2907
2935
  }
2908
- function serializeMessage(message, annotations = []) {
2936
+ function serializeMessage(message, annotations = [], checkpoint) {
2909
2937
  return AgentMessageSchema.parse({
2910
2938
  id: message.id,
2911
2939
  projectId: message.projectId,
@@ -2916,6 +2944,11 @@ function serializeMessage(message, annotations = []) {
2916
2944
  seq: message.seq,
2917
2945
  parts: message.parts,
2918
2946
  annotations,
2947
+ compaction: checkpoint ? {
2948
+ checkpointId: checkpoint.id,
2949
+ summary: checkpoint.summary,
2950
+ createdAt: toIsoString(checkpoint.createdAt)
2951
+ } : undefined,
2919
2952
  metadata: message.metadata,
2920
2953
  contentVersion: message.contentVersion,
2921
2954
  createdAt: toIsoString(message.createdAt),
@@ -3200,10 +3233,14 @@ function registerAgentRoutes(app, host) {
3200
3233
  order: parsed.order
3201
3234
  });
3202
3235
  const runIds = result.messages.flatMap((message) => message.runId === null ? [] : [message.runId]);
3203
- const runs = await storage.runs.getByIds({ projectId: host.id, ids: runIds });
3236
+ const [runs, checkpoints] = await Promise.all([
3237
+ storage.runs.getByIds({ projectId: host.id, ids: runIds }),
3238
+ storage.checkpoints.getByRunIds({ projectId: host.id, runIds })
3239
+ ]);
3204
3240
  const diagnosticsByRunId = new Map(runs.filter((run) => run.threadId === thread.id).map((run) => [run.id, run.diagnostics ?? []]));
3241
+ const checkpointsByRunId = new Map(checkpoints.filter((checkpoint) => checkpoint.threadId === thread.id).map((checkpoint) => [checkpoint.createdByRunId, checkpoint]));
3205
3242
  return AgentMessageListResponseSchema.parse({
3206
- messages: result.messages.map((message) => serializeMessage(message, message.runId === null ? [] : diagnosticsByRunId.get(message.runId) ?? [])),
3243
+ messages: result.messages.map((message) => serializeMessage(message, message.runId === null ? [] : diagnosticsByRunId.get(message.runId) ?? [], message.runId === null ? undefined : checkpointsByRunId.get(message.runId))),
3207
3244
  hasMore: result.hasMore,
3208
3245
  total: result.total
3209
3246
  });
@@ -3846,9 +3883,11 @@ var ConnectorOAuthCallbackQuerySchema = z10.object({
3846
3883
  code: z10.string().min(1).optional(),
3847
3884
  auth_code: z10.string().min(1).optional(),
3848
3885
  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 }));
3886
+ }).refine((query) => {
3887
+ const hasAuthorizationCode = query.code !== undefined || query.auth_code !== undefined;
3888
+ const hasProviderError = query.error !== undefined;
3889
+ return hasAuthorizationCode !== hasProviderError;
3890
+ }, { 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
3891
  function connectorRouteErrorResponseSchema(codes) {
3853
3892
  return ErrorResponseSchema.extend({
3854
3893
  code: z10.enum(codes).optional().describe("Stable machine-readable failure code for programmatic handling.")
@@ -4878,10 +4917,6 @@ var LinkSourceParamsSchema = z14.object({
4878
4917
  var LinkParamsSchema = LinkSourceParamsSchema.extend({
4879
4918
  linkId: z14.string().min(1)
4880
4919
  });
4881
- var LinkQuerySchema = z14.object({
4882
- linkId: z14.string().optional(),
4883
- direction: z14.enum(["outgoing", "incoming", "both"]).default("outgoing")
4884
- });
4885
4920
  var RemoveLinkQuerySchema = z14.object({
4886
4921
  targetTypeId: z14.string().min(1),
4887
4922
  targetId: z14.string().min(1)
@@ -4891,59 +4926,10 @@ var UpsertLinkBodySchema = z14.object({
4891
4926
  targetId: z14.string().min(1),
4892
4927
  properties: z14.record(z14.unknown()).optional()
4893
4928
  });
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
4929
 
4906
4930
  // src/routes/links.ts
4907
4931
  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) => {
4932
+ return app.put("/api/objects/:objectTypeId/:objectId/links/:linkId", async (context) => {
4947
4933
  const { params, body, set } = context;
4948
4934
  try {
4949
4935
  const parsedBody = UpsertLinkBodySchema.parse(body);
@@ -5114,6 +5100,37 @@ function registerLogRoutes(app, _host) {
5114
5100
  });
5115
5101
  }
5116
5102
 
5103
+ // src/schemas/models.ts
5104
+ import { z as z16 } from "zod";
5105
+ var LanguageModelSchema = z16.object({
5106
+ provider: z16.string(),
5107
+ modelId: z16.string(),
5108
+ isDefault: z16.boolean()
5109
+ });
5110
+ var ModelCatalogSchema = z16.object({
5111
+ language: z16.array(LanguageModelSchema)
5112
+ });
5113
+
5114
+ // src/routes/models.ts
5115
+ function serializeLanguageModel(entry, defaultRef) {
5116
+ return { provider: entry.provider, modelId: entry.modelId, isDefault: entry.ref === defaultRef };
5117
+ }
5118
+ function registerModelRoutes(app, host) {
5119
+ return app.get("/api/models", () => {
5120
+ const language = host.definitions.models?.language;
5121
+ return ModelCatalogSchema.parse({
5122
+ language: language === undefined ? [] : language.list().map((entry) => serializeLanguageModel(entry, language.default.ref))
5123
+ });
5124
+ }, {
5125
+ response: { 200: ModelCatalogSchema },
5126
+ detail: {
5127
+ summary: "List the project model catalog",
5128
+ tags: [OPENAPI_TAGS.models.name],
5129
+ operationId: "listModels"
5130
+ }
5131
+ });
5132
+ }
5133
+
5117
5134
  // src/routes/objects.ts
5118
5135
  import {
5119
5136
  AuthorizationError as AuthorizationError3,
@@ -5121,35 +5138,35 @@ import {
5121
5138
  ObjectQueryPlanningError,
5122
5139
  ObjectQueryValidationError
5123
5140
  } from "@sixb/core";
5124
- import { ZodError as ZodError3, z as z17 } from "zod";
5141
+ import { ZodError as ZodError3, z as z18 } from "zod";
5125
5142
 
5126
5143
  // 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()
5144
+ import { z as z17 } from "zod";
5145
+ var ObjectParamsSchema = z17.object({
5146
+ objectTypeId: z17.string().min(1),
5147
+ objectId: z17.string().min(1)
5148
+ });
5149
+ var ObjectSearchQuerySchema = z17.object({
5150
+ q: z17.string().trim().min(1).max(200),
5151
+ limit: z17.string().regex(/^\d+$/).optional()
5152
+ });
5153
+ var ObjectSearchResponseSchema = z17.object({
5154
+ items: z17.array(z17.object({
5155
+ ref: z17.object({
5156
+ objectTypeId: z17.string(),
5157
+ primaryId: z17.string()
5141
5158
  }),
5142
- label: z16.string()
5159
+ label: z17.string()
5143
5160
  }))
5144
5161
  });
5145
5162
  var OBJECT_LIST_MAX_LIMIT = 1000;
5146
- var Rfc3339DateSchema = z16.string().datetime({ offset: true });
5163
+ var Rfc3339DateSchema = z17.string().datetime({ offset: true });
5147
5164
  function objectListDateSchema(parameter) {
5148
- return z16.string().refine((value) => Rfc3339DateSchema.safeParse(value).success, {
5165
+ return z17.string().refine((value) => Rfc3339DateSchema.safeParse(value).success, {
5149
5166
  message: `Invalid query parameter '${parameter}': expected an RFC 3339 timestamp.`
5150
5167
  }).transform((value) => new Date(value));
5151
5168
  }
5152
- var ObjectListLimitSchema = z16.string().refine((value) => {
5169
+ var ObjectListLimitSchema = z17.string().refine((value) => {
5153
5170
  if (!/^\d+$/.test(value))
5154
5171
  return false;
5155
5172
  const parsed = Number(value);
@@ -5157,25 +5174,25 @@ var ObjectListLimitSchema = z16.string().refine((value) => {
5157
5174
  }, {
5158
5175
  message: `Invalid query parameter 'limit': expected an integer between 0 and ${OBJECT_LIST_MAX_LIMIT}.`
5159
5176
  }).transform(Number);
5160
- var ObjectListOffsetSchema = z16.string().refine((value) => /^\d+$/.test(value) && Number.isSafeInteger(Number(value)), {
5177
+ var ObjectListOffsetSchema = z17.string().refine((value) => /^\d+$/.test(value) && Number.isSafeInteger(Number(value)), {
5161
5178
  message: "Invalid query parameter 'offset': expected a non-negative safe integer."
5162
5179
  }).transform(Number);
5163
- var ObjectsQuerySchema = z16.object({
5164
- objectTypeId: z16.string().optional(),
5165
- idPrefix: z16.string().optional(),
5166
- idSuffix: z16.string().optional(),
5180
+ var ObjectsQuerySchema = z17.object({
5181
+ objectTypeId: z17.string().optional(),
5182
+ idPrefix: z17.string().optional(),
5183
+ idSuffix: z17.string().optional(),
5167
5184
  updatedAfter: objectListDateSchema("updatedAfter").optional(),
5168
5185
  updatedBefore: objectListDateSchema("updatedBefore").optional(),
5169
5186
  createdAfter: objectListDateSchema("createdAfter").optional(),
5170
5187
  createdBefore: objectListDateSchema("createdBefore").optional(),
5171
5188
  limit: ObjectListLimitSchema.optional(),
5172
5189
  offset: ObjectListOffsetSchema.optional(),
5173
- orderBy: z16.enum(["createdAt", "updatedAt", "primaryId"], {
5190
+ orderBy: z17.enum(["createdAt", "updatedAt", "primaryId"], {
5174
5191
  errorMap: () => ({
5175
5192
  message: "Invalid query parameter 'orderBy': expected one of createdAt, updatedAt, or primaryId."
5176
5193
  })
5177
5194
  }).optional(),
5178
- order: z16.enum(["asc", "desc"], {
5195
+ order: z17.enum(["asc", "desc"], {
5179
5196
  errorMap: () => ({
5180
5197
  message: "Invalid query parameter 'order': expected 'asc' or 'desc'."
5181
5198
  })
@@ -5183,163 +5200,178 @@ var ObjectsQuerySchema = z16.object({
5183
5200
  }).superRefine((query, context) => {
5184
5201
  if (query.updatedAfter && query.updatedBefore && query.updatedAfter > query.updatedBefore) {
5185
5202
  context.addIssue({
5186
- code: z16.ZodIssueCode.custom,
5203
+ code: z17.ZodIssueCode.custom,
5187
5204
  path: ["updatedAfter"],
5188
5205
  message: "Invalid query parameter range: 'updatedAfter' must be before or equal to 'updatedBefore'."
5189
5206
  });
5190
5207
  }
5191
5208
  if (query.createdAfter && query.createdBefore && query.createdAfter > query.createdBefore) {
5192
5209
  context.addIssue({
5193
- code: z16.ZodIssueCode.custom,
5210
+ code: z17.ZodIssueCode.custom,
5194
5211
  path: ["createdAfter"],
5195
5212
  message: "Invalid query parameter range: 'createdAfter' must be before or equal to 'createdBefore'."
5196
5213
  });
5197
5214
  }
5198
5215
  });
5199
- var UpsertObjectBodySchema = z16.object({
5200
- properties: z16.record(z16.unknown())
5216
+ var UpsertObjectBodySchema = z17.object({
5217
+ properties: z17.record(z17.unknown())
5201
5218
  });
5202
- var ObjectQueryPredicateSchema = z16.lazy(() => z16.union([
5203
- z16.object({
5204
- op: z16.enum(["and", "or"]),
5205
- items: z16.array(ObjectQueryPredicateSchema)
5219
+ var ObjectQueryPredicateSchema = z17.lazy(() => z17.union([
5220
+ z17.object({
5221
+ op: z17.enum(["and", "or"]),
5222
+ items: z17.array(ObjectQueryPredicateSchema)
5206
5223
  }).strict(),
5207
- z16.object({
5208
- op: z16.literal("not"),
5224
+ z17.object({
5225
+ op: z17.literal("not"),
5209
5226
  item: ObjectQueryPredicateSchema
5210
5227
  }).strict(),
5211
- z16.object({
5212
- op: z16.enum(["eq", "neq", "lt", "lte", "gt", "gte"]),
5213
- propertyId: z16.string().min(1),
5228
+ z17.object({
5229
+ op: z17.enum(["eq", "neq", "lt", "lte", "gt", "gte"]),
5230
+ propertyId: z17.string().min(1),
5214
5231
  value: JsonValueSchema
5215
5232
  }).strict(),
5216
- z16.object({
5217
- op: z16.literal("in"),
5218
- propertyId: z16.string().min(1),
5219
- values: z16.array(JsonValueSchema)
5233
+ z17.object({
5234
+ op: z17.literal("in"),
5235
+ propertyId: z17.string().min(1),
5236
+ values: z17.array(JsonValueSchema)
5220
5237
  }).strict(),
5221
- z16.object({
5222
- op: z16.literal("exists"),
5223
- propertyId: z16.string().min(1),
5224
- value: z16.boolean()
5238
+ z17.object({
5239
+ op: z17.literal("exists"),
5240
+ propertyId: z17.string().min(1),
5241
+ value: z17.boolean()
5225
5242
  }).strict(),
5226
- z16.object({
5227
- op: z16.literal("contains"),
5228
- propertyId: z16.string().min(1),
5243
+ z17.object({
5244
+ op: z17.literal("contains"),
5245
+ propertyId: z17.string().min(1),
5229
5246
  value: JsonValueSchema
5230
5247
  }).strict()
5231
5248
  ]));
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()
5249
+ var ObjectQuerySortFieldSchema = z17.union([
5250
+ z17.object({
5251
+ kind: z17.literal("property"),
5252
+ propertyId: z17.string().min(1),
5253
+ direction: z17.enum(["asc", "desc"]).optional()
5237
5254
  }).strict(),
5238
- z16.object({
5239
- kind: z16.literal("relevance"),
5240
- direction: z16.enum(["asc", "desc"]).optional()
5255
+ z17.object({
5256
+ kind: z17.literal("relevance"),
5257
+ direction: z17.enum(["asc", "desc"]).optional()
5241
5258
  }).strict()
5242
5259
  ]);
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()
5260
+ var ObjectExpansionSchema = z17.lazy(() => z17.object({
5261
+ linkId: z17.string().min(1),
5262
+ direction: z17.enum(["outgoing", "incoming"]),
5263
+ sourceObjectTypeId: z17.string().min(1).optional(),
5264
+ limit: z17.number().int().nonnegative().optional(),
5265
+ orderBy: z17.array(ObjectQuerySortFieldSchema).optional(),
5266
+ expand: z17.array(ObjectExpansionSchema).optional()
5250
5267
  }).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()
5268
+ var ObjectQuerySchema = z17.lazy(() => z17.discriminatedUnion("kind", [
5269
+ z17.object({
5270
+ kind: z17.literal("start"),
5271
+ objectTypeId: z17.string().min(1),
5272
+ includeSubtypes: z17.boolean().optional()
5273
+ }).strict(),
5274
+ z17.object({
5275
+ kind: z17.literal("refs"),
5276
+ refs: z17.array(z17.object({
5277
+ objectTypeId: z17.string().min(1),
5278
+ primaryId: z17.string().min(1)
5279
+ }).strict())
5256
5280
  }).strict(),
5257
- z16.object({
5258
- kind: z16.literal("filter"),
5281
+ z17.object({
5282
+ kind: z17.literal("filter"),
5259
5283
  input: ObjectQuerySchema,
5260
5284
  predicate: ObjectQueryPredicateSchema
5261
5285
  }).strict(),
5262
- z16.object({
5263
- kind: z16.literal("text"),
5286
+ z17.object({
5287
+ kind: z17.literal("text"),
5264
5288
  input: ObjectQuerySchema,
5265
- query: z16.string(),
5266
- fields: z16.array(z16.string().min(1)).optional()
5289
+ query: z17.string(),
5290
+ fields: z17.array(z17.string().min(1)).optional()
5267
5291
  }).strict(),
5268
- z16.object({
5269
- kind: z16.literal("vector"),
5292
+ z17.object({
5293
+ kind: z17.literal("vector"),
5270
5294
  input: ObjectQuerySchema,
5271
- vector: z16.array(z16.number().finite()),
5272
- propertyId: z16.string().min(1),
5273
- k: z16.number().int().positive()
5295
+ vector: z17.array(z17.number().finite()),
5296
+ propertyId: z17.string().min(1),
5297
+ k: z17.number().int().positive()
5274
5298
  }).strict(),
5275
- z16.object({
5276
- kind: z16.literal("traverse"),
5299
+ z17.object({
5300
+ kind: z17.literal("traverse"),
5277
5301
  input: ObjectQuerySchema,
5278
- linkId: z16.string().min(1),
5279
- direction: z16.enum(["outgoing", "incoming"]),
5280
- sourceObjectTypeId: z16.string().min(1).optional()
5302
+ linkId: z17.string().min(1),
5303
+ direction: z17.enum(["outgoing", "incoming"]),
5304
+ sourceObjectTypeId: z17.string().min(1).optional()
5281
5305
  }).strict(),
5282
- z16.object({
5283
- kind: z16.literal("set"),
5284
- op: z16.enum(["union", "intersect", "subtract"]),
5285
- inputs: z16.array(ObjectQuerySchema)
5306
+ z17.object({
5307
+ kind: z17.literal("set"),
5308
+ op: z17.enum(["union", "intersect", "subtract"]),
5309
+ inputs: z17.array(ObjectQuerySchema)
5286
5310
  }).strict(),
5287
- z16.object({
5288
- kind: z16.literal("sort"),
5311
+ z17.object({
5312
+ kind: z17.literal("sort"),
5289
5313
  input: ObjectQuerySchema,
5290
- fields: z16.array(ObjectQuerySortFieldSchema)
5314
+ fields: z17.array(ObjectQuerySortFieldSchema)
5291
5315
  }).strict(),
5292
- z16.object({
5293
- kind: z16.literal("limit"),
5316
+ z17.object({
5317
+ kind: z17.literal("limit"),
5294
5318
  input: ObjectQuerySchema,
5295
- limit: z16.number().int().nonnegative()
5319
+ limit: z17.number().int().nonnegative()
5296
5320
  }).strict(),
5297
- z16.object({
5298
- kind: z16.literal("page"),
5321
+ z17.object({
5322
+ kind: z17.literal("page"),
5299
5323
  input: ObjectQuerySchema,
5300
- pageSize: z16.number().int().positive(),
5301
- pageToken: z16.string().optional()
5324
+ pageSize: z17.number().int().positive(),
5325
+ pageToken: z17.string().optional()
5302
5326
  }).strict(),
5303
- z16.object({
5304
- kind: z16.literal("project"),
5327
+ z17.object({
5328
+ kind: z17.literal("project"),
5305
5329
  input: ObjectQuerySchema,
5306
- properties: z16.array(z16.string().min(1)).optional()
5330
+ properties: z17.array(z17.string().min(1)).optional()
5307
5331
  }).strict(),
5308
- z16.object({
5309
- kind: z16.literal("expand"),
5332
+ z17.object({
5333
+ kind: z17.literal("expand"),
5310
5334
  input: ObjectQuerySchema,
5311
- expansions: z16.array(ObjectExpansionSchema)
5335
+ expansions: z17.array(ObjectExpansionSchema)
5312
5336
  }).strict()
5313
5337
  ]));
5314
- var ObjectQueryRequestSchema = z16.object({
5338
+ var ObjectQueryRequestSchema = z17.object({
5315
5339
  query: ObjectQuerySchema,
5316
- includeTotal: z16.boolean().optional()
5340
+ includeTotal: z17.boolean().optional()
5317
5341
  }).strict();
5318
- var ObjectQueryCountRequestSchema = z16.object({
5342
+ var ObjectQueryCountRequestSchema = z17.object({
5319
5343
  query: ObjectQuerySchema
5320
5344
  }).strict();
5321
- var ObjectQueryExistsRequestSchema = z16.object({
5345
+ var ObjectQueryExistsRequestSchema = z17.object({
5322
5346
  query: ObjectQuerySchema
5323
5347
  }).strict();
5324
- var ObjectQueryFacetRequestSchema = z16.object({
5325
- propertyId: z16.string().min(1),
5326
- limit: z16.number().int().positive()
5348
+ var ObjectQueryFacetRequestSchema = z17.object({
5349
+ propertyId: z17.string().min(1),
5350
+ limit: z17.number().int().positive()
5327
5351
  }).strict();
5328
- var ObjectQueryFacetsRequestSchema = z16.object({
5352
+ var ObjectQueryFacetsRequestSchema = z17.object({
5329
5353
  query: ObjectQuerySchema,
5330
- facets: z16.array(ObjectQueryFacetRequestSchema).min(1)
5354
+ facets: z17.array(ObjectQueryFacetRequestSchema).min(1)
5331
5355
  }).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()
5356
+ var ObjectQueryLinksRequestSchema = z17.object({
5357
+ query: ObjectQuerySchema,
5358
+ direction: z17.enum(["outgoing", "incoming", "both"]).default("both"),
5359
+ linkId: z17.string().min(1).optional(),
5360
+ includeObjects: z17.boolean().default(false),
5361
+ pageSize: z17.number().int().positive().max(1000).default(100),
5362
+ pageToken: z17.string().min(1).optional()
5363
+ }).strict();
5364
+ var TwinObjectSchema = z17.object({
5365
+ primaryId: z17.string(),
5366
+ objectTypeId: z17.string(),
5367
+ properties: z17.record(z17.unknown()),
5368
+ createdAt: z17.string(),
5369
+ updatedAt: z17.string()
5370
+ });
5371
+ var ObjectListResponseSchema = z17.object({
5372
+ objects: z17.array(TwinObjectSchema),
5373
+ hasMore: z17.boolean(),
5374
+ total: z17.number()
5343
5375
  });
5344
5376
  var anyJsonValueSchema = {};
5345
5377
  var stringArraySchema = { type: "array", items: { type: "string", minLength: 1 } };
@@ -5347,6 +5379,7 @@ var objectQueryRef = { $ref: "#/components/schemas/ObjectQuery" };
5347
5379
  var objectQueryPredicateRef = { $ref: "#/components/schemas/ObjectQueryPredicate" };
5348
5380
  var objectQuerySortFieldRef = { $ref: "#/components/schemas/ObjectQuerySortField" };
5349
5381
  var objectExpansionRef = { $ref: "#/components/schemas/ObjectExpansion" };
5382
+ var objectRefSchemaRef = { $ref: "#/components/schemas/ObjectRef" };
5350
5383
  var ObjectQueryOpenApiSchemas = {
5351
5384
  ErrorResponse: {
5352
5385
  type: "object",
@@ -5485,6 +5518,38 @@ var ObjectQueryOpenApiSchemas = {
5485
5518
  plan: { $ref: "#/components/schemas/ObjectQueryPlanSummary" }
5486
5519
  }
5487
5520
  },
5521
+ ObjectQueryLink: {
5522
+ type: "object",
5523
+ required: ["source", "linkId", "target", "createdAt", "updatedAt"],
5524
+ additionalProperties: false,
5525
+ properties: {
5526
+ source: objectRefSchemaRef,
5527
+ linkId: { type: "string" },
5528
+ target: objectRefSchemaRef,
5529
+ properties: { type: "object", additionalProperties: true },
5530
+ createdAt: { type: "string" },
5531
+ updatedAt: { type: "string" }
5532
+ }
5533
+ },
5534
+ ObjectQueryLinksResponse: {
5535
+ type: "object",
5536
+ required: ["objects", "links", "hasMore"],
5537
+ additionalProperties: false,
5538
+ properties: {
5539
+ objects: {
5540
+ type: "array",
5541
+ description: "Selected objects followed by visible endpoint objects from this link page, de-duplicated. Empty unless includeObjects is true.",
5542
+ items: { $ref: "#/components/schemas/ObjectQueryObject" }
5543
+ },
5544
+ links: {
5545
+ type: "array",
5546
+ description: "Visible physical links in deterministic identity order.",
5547
+ items: { $ref: "#/components/schemas/ObjectQueryLink" }
5548
+ },
5549
+ hasMore: { type: "boolean" },
5550
+ nextPageToken: { type: "string" }
5551
+ }
5552
+ },
5488
5553
  ObjectQueryErrorResponse: {
5489
5554
  type: "object",
5490
5555
  required: ["error"],
@@ -5544,6 +5609,36 @@ var ObjectQueryOpenApiSchemas = {
5544
5609
  }
5545
5610
  }
5546
5611
  },
5612
+ ObjectQueryLinksRequest: {
5613
+ type: "object",
5614
+ required: ["query"],
5615
+ additionalProperties: false,
5616
+ properties: {
5617
+ query: objectQueryRef,
5618
+ direction: { type: "string", enum: ["outgoing", "incoming", "both"], default: "both" },
5619
+ linkId: { type: "string", minLength: 1 },
5620
+ includeObjects: {
5621
+ type: "boolean",
5622
+ default: false,
5623
+ description: "Include selected objects and visible endpoints from the current link page."
5624
+ },
5625
+ pageSize: { type: "integer", minimum: 1, maximum: 1000, default: 100 },
5626
+ pageToken: {
5627
+ type: "string",
5628
+ minLength: 1,
5629
+ description: "Opaque token from the previous page. The project, normalized query, direction, and linkId must remain unchanged."
5630
+ }
5631
+ }
5632
+ },
5633
+ ObjectRef: {
5634
+ type: "object",
5635
+ required: ["objectTypeId", "primaryId"],
5636
+ additionalProperties: false,
5637
+ properties: {
5638
+ objectTypeId: { type: "string", minLength: 1 },
5639
+ primaryId: { type: "string", minLength: 1 }
5640
+ }
5641
+ },
5547
5642
  ObjectQuery: {
5548
5643
  oneOf: [
5549
5644
  {
@@ -5556,6 +5651,20 @@ var ObjectQueryOpenApiSchemas = {
5556
5651
  includeSubtypes: { type: "boolean" }
5557
5652
  }
5558
5653
  },
5654
+ {
5655
+ type: "object",
5656
+ required: ["kind", "refs"],
5657
+ additionalProperties: false,
5658
+ properties: {
5659
+ kind: { type: "string", enum: ["refs"] },
5660
+ refs: {
5661
+ type: "array",
5662
+ minItems: 1,
5663
+ description: "One to 1,000 unique identities after normalization; duplicate entries are accepted and removed.",
5664
+ items: objectRefSchemaRef
5665
+ }
5666
+ }
5667
+ },
5559
5668
  {
5560
5669
  type: "object",
5561
5670
  required: ["kind", "input", "predicate"],
@@ -5769,7 +5878,7 @@ var ObjectQueryOpenApiSchemas = {
5769
5878
 
5770
5879
  // src/routes/objects.ts
5771
5880
  var ObjectFileContentQuerySchema = FileContentQuerySchema.extend({
5772
- path: z17.string().min(1).regex(/^\/properties(?:\/|$)/, "Object file content paths must start with /properties/")
5881
+ path: z18.string().min(1).regex(/^\/properties(?:\/|$)/, "Object file content paths must start with /properties/")
5773
5882
  });
5774
5883
  function serializeObject(row) {
5775
5884
  return {
@@ -5780,6 +5889,22 @@ function serializeObject(row) {
5780
5889
  updatedAt: toIsoString(row.updatedAt)
5781
5890
  };
5782
5891
  }
5892
+ function serializeObjectLink(link) {
5893
+ return {
5894
+ source: {
5895
+ objectTypeId: link.sourceTypeId,
5896
+ primaryId: link.sourceId
5897
+ },
5898
+ linkId: link.linkId,
5899
+ target: {
5900
+ objectTypeId: link.targetTypeId,
5901
+ primaryId: link.targetId
5902
+ },
5903
+ ...link.properties === undefined ? {} : { properties: link.properties },
5904
+ createdAt: toIsoString(link.createdAt),
5905
+ updatedAt: toIsoString(link.updatedAt)
5906
+ };
5907
+ }
5783
5908
  function serializeExpandedObject(row) {
5784
5909
  const serialized = serializeObject(row);
5785
5910
  if (row.links)
@@ -6066,6 +6191,69 @@ function registerObjectRoutes(app, host) {
6066
6191
  }
6067
6192
  }
6068
6193
  }
6194
+ }).post("/api/objects/query/links", async (context) => {
6195
+ const { body, set } = context;
6196
+ try {
6197
+ const parsed = ObjectQueryLinksRequestSchema.parse(body);
6198
+ const result = await requireRequestSixb(context).objects.queryLinks(parsed);
6199
+ return {
6200
+ objects: result.objects.map(serializeObject),
6201
+ links: result.links.map(serializeObjectLink),
6202
+ hasMore: result.hasMore,
6203
+ ...result.nextPageToken === undefined ? {} : { nextPageToken: result.nextPageToken }
6204
+ };
6205
+ } catch (error) {
6206
+ return handleObjectQueryError(error, set);
6207
+ }
6208
+ }, {
6209
+ detail: {
6210
+ summary: "Query object links",
6211
+ tags: [OPENAPI_TAGS.links.name],
6212
+ operationId: "queryObjectLinks",
6213
+ security: bearerSecurityRequirement("queryObjectLinks"),
6214
+ requestBody: {
6215
+ required: true,
6216
+ content: {
6217
+ "application/json": {
6218
+ schema: { $ref: "#/components/schemas/ObjectQueryLinksRequest" }
6219
+ }
6220
+ }
6221
+ },
6222
+ responses: {
6223
+ 200: {
6224
+ description: "Response for status 200",
6225
+ content: {
6226
+ "application/json": {
6227
+ schema: { $ref: "#/components/schemas/ObjectQueryLinksResponse" }
6228
+ }
6229
+ }
6230
+ },
6231
+ 400: {
6232
+ description: "Response for status 400",
6233
+ content: {
6234
+ "application/json": {
6235
+ schema: { $ref: "#/components/schemas/ObjectQueryErrorResponse" }
6236
+ }
6237
+ }
6238
+ },
6239
+ 403: {
6240
+ description: "Response for status 403",
6241
+ content: {
6242
+ "application/json": {
6243
+ schema: { $ref: "#/components/schemas/ErrorResponse" }
6244
+ }
6245
+ }
6246
+ },
6247
+ 500: {
6248
+ description: "Response for status 500",
6249
+ content: {
6250
+ "application/json": {
6251
+ schema: { $ref: "#/components/schemas/ErrorResponse" }
6252
+ }
6253
+ }
6254
+ }
6255
+ }
6256
+ }
6069
6257
  }).post("/api/objects/query/count", async (context) => {
6070
6258
  const { body, set } = context;
6071
6259
  try {
@@ -6426,111 +6614,111 @@ function registerOntologyRoutes(app, _host) {
6426
6614
  import {
6427
6615
  PIPELINE_RUN_FAILURE_CODES
6428
6616
  } from "@sixb/core/storage";
6429
- import { z as z18 } from "zod";
6617
+ import { z as z19 } from "zod";
6430
6618
  var PipelineRunFailureSchema = sixbFailureSchema(PIPELINE_RUN_FAILURE_CODES);
6431
- var PipelineParamsSchema = z18.object({
6432
- pipelineId: z18.string().min(1)
6619
+ var PipelineParamsSchema = z19.object({
6620
+ pipelineId: z19.string().min(1)
6433
6621
  });
6434
- var PipelineRunParamsSchema = z18.object({
6435
- runId: z18.string().min(1)
6622
+ var PipelineRunParamsSchema = z19.object({
6623
+ runId: z19.string().min(1)
6436
6624
  });
6437
- var PipelineRunStatusSchema = z18.enum([
6625
+ var PipelineRunStatusSchema = z19.enum([
6438
6626
  "queued",
6439
6627
  "running",
6440
6628
  "succeeded",
6441
6629
  "failed",
6442
6630
  "cancelled"
6443
6631
  ]);
6444
- var PipelineStepRunStatusSchema = z18.enum(["running", "succeeded", "failed", "cancelled"]);
6445
- var PipelineRunsQuerySchema = z18.object({
6446
- pipelineId: z18.string().optional(),
6632
+ var PipelineStepRunStatusSchema = z19.enum(["running", "succeeded", "failed", "cancelled"]);
6633
+ var PipelineRunsQuerySchema = z19.object({
6634
+ pipelineId: z19.string().optional(),
6447
6635
  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")
6636
+ startedAfter: z19.string().optional(),
6637
+ startedBefore: z19.string().optional(),
6638
+ limit: z19.string().optional(),
6639
+ offset: z19.string().optional(),
6640
+ order: z19.enum(["asc", "desc"]).optional()
6641
+ });
6642
+ var DatasetVersionRefSchema2 = z19.object({
6643
+ datasetId: z19.string(),
6644
+ versionId: z19.string()
6645
+ });
6646
+ var PipelineTriggerSchema = z19.object({
6647
+ type: z19.literal("schedule"),
6648
+ scheduleId: z19.string()
6649
+ });
6650
+ var PipelineStepExecutorSchema = z19.union([
6651
+ z19.object({
6652
+ kind: z19.literal("sql"),
6653
+ dialect: z19.literal("duckdb")
6466
6654
  }),
6467
- z18.object({
6468
- kind: z18.literal("run")
6655
+ z19.object({
6656
+ kind: z19.literal("run")
6469
6657
  })
6470
6658
  ]);
6471
- var PipelineRunSchema = z18.object({
6472
- id: z18.string(),
6473
- projectId: z18.string(),
6474
- pipelineId: z18.string(),
6659
+ var PipelineRunSchema = z19.object({
6660
+ id: z19.string(),
6661
+ projectId: z19.string(),
6662
+ pipelineId: z19.string(),
6475
6663
  status: PipelineRunStatusSchema,
6476
- queuedAt: z18.string(),
6477
- startedAt: z18.string().optional(),
6478
- finishedAt: z18.string().optional(),
6664
+ queuedAt: z19.string(),
6665
+ startedAt: z19.string().optional(),
6666
+ finishedAt: z19.string().optional(),
6479
6667
  output: DatasetVersionRefSchema2.optional(),
6480
6668
  error: PipelineRunFailureSchema.optional()
6481
6669
  });
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"]),
6670
+ var PipelineStepRunSchema = z19.object({
6671
+ id: z19.string(),
6672
+ projectId: z19.string(),
6673
+ pipelineRunId: z19.string(),
6674
+ pipelineId: z19.string(),
6675
+ stepId: z19.string(),
6676
+ datasetId: z19.string(),
6677
+ mode: z19.enum(["snapshot", "append"]),
6490
6678
  status: PipelineStepRunStatusSchema,
6491
- startedAt: z18.string(),
6492
- finishedAt: z18.string().optional(),
6493
- inputs: z18.array(DatasetVersionRefSchema2),
6679
+ startedAt: z19.string(),
6680
+ finishedAt: z19.string().optional(),
6681
+ inputs: z19.array(DatasetVersionRefSchema2),
6494
6682
  output: DatasetVersionRefSchema2.optional(),
6495
- rowsWritten: z18.number().optional(),
6683
+ rowsWritten: z19.number().optional(),
6496
6684
  error: PipelineRunFailureSchema.optional()
6497
6685
  });
6498
- var PipelineStepSchema = z18.object({
6499
- id: z18.string(),
6500
- mode: z18.enum(["snapshot", "append"]),
6686
+ var PipelineStepSchema = z19.object({
6687
+ id: z19.string(),
6688
+ mode: z19.enum(["snapshot", "append"]),
6501
6689
  executor: PipelineStepExecutorSchema,
6502
- inputs: z18.array(z18.object({
6503
- name: z18.string(),
6690
+ inputs: z19.array(z19.object({
6691
+ name: z19.string(),
6504
6692
  dataset: DatasetDefinitionSchema
6505
6693
  })),
6506
6694
  output: DatasetDefinitionSchema
6507
6695
  });
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"),
6696
+ var PipelineSchema = z19.object({
6697
+ id: z19.string(),
6698
+ triggers: z19.array(PipelineTriggerSchema),
6699
+ graph: z19.object({
6700
+ kind: z19.literal("sequence"),
6701
+ nodes: z19.array(z19.object({
6702
+ kind: z19.literal("step"),
6515
6703
  step: PipelineStepSchema
6516
6704
  }))
6517
6705
  }),
6518
6706
  latestRun: PipelineRunSchema.nullable()
6519
6707
  });
6520
- var PipelineRunListResponseSchema = z18.object({
6521
- runs: z18.array(PipelineRunSchema),
6522
- hasMore: z18.boolean(),
6523
- total: z18.number()
6708
+ var PipelineRunListResponseSchema = z19.object({
6709
+ runs: z19.array(PipelineRunSchema),
6710
+ hasMore: z19.boolean(),
6711
+ total: z19.number()
6524
6712
  });
6525
- var PipelineRunDetailResponseSchema = z18.object({
6713
+ var PipelineRunDetailResponseSchema = z19.object({
6526
6714
  run: PipelineRunSchema,
6527
- steps: z18.array(PipelineStepRunSchema)
6715
+ steps: z19.array(PipelineStepRunSchema)
6528
6716
  });
6529
- var RequestPipelineRunResponseSchema = z18.object({
6530
- runId: z18.string(),
6531
- jobId: z18.string(),
6532
- pipelineId: z18.string(),
6533
- queuedAt: z18.string()
6717
+ var RequestPipelineRunResponseSchema = z19.object({
6718
+ runId: z19.string(),
6719
+ jobId: z19.string(),
6720
+ pipelineId: z19.string(),
6721
+ queuedAt: z19.string()
6534
6722
  });
6535
6723
 
6536
6724
  // src/routes/pipelines.ts
@@ -6752,9 +6940,9 @@ function registerPipelineRoutes(app, host) {
6752
6940
  }
6753
6941
 
6754
6942
  // src/schemas/project.ts
6755
- import { z as z19 } from "zod";
6756
- var ProjectInfoResponseSchema = z19.object({
6757
- id: z19.string()
6943
+ import { z as z20 } from "zod";
6944
+ var ProjectInfoResponseSchema = z20.object({
6945
+ id: z20.string()
6758
6946
  });
6759
6947
 
6760
6948
  // src/routes/project.ts
@@ -6772,146 +6960,147 @@ function registerProjectRoutes(app, host) {
6772
6960
 
6773
6961
  // src/schemas/projections.ts
6774
6962
  import { PROJECTION_RUN_FAILURE_CODES } from "@sixb/core/storage";
6775
- import { z as z20 } from "zod";
6963
+ import { z as z21 } from "zod";
6776
6964
  var ProjectionRunFailureSchema = sixbFailureSchema(PROJECTION_RUN_FAILURE_CODES);
6777
- var ProjectionKindSchema = z20.enum(["object", "link", "telemetry"]);
6778
- var ProjectionRunStatusSchema = z20.enum([
6965
+ var ProjectionKindSchema = z21.enum(["object", "link", "telemetry"]);
6966
+ var ProjectionRunStatusSchema = z21.enum([
6779
6967
  "queued",
6780
6968
  "running",
6781
6969
  "succeeded",
6782
6970
  "failed",
6783
6971
  "cancelled"
6784
6972
  ]);
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()
6973
+ var ProjectionRunIdentityBaseSchema = z21.object({
6974
+ projectionId: z21.string(),
6975
+ datasetVersion: z21.object({
6976
+ datasetId: z21.string(),
6977
+ versionId: z21.string(),
6978
+ createdAt: z21.string()
6791
6979
  }),
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(),
6980
+ ontologyRevision: z21.string(),
6981
+ projectionRevision: z21.string(),
6982
+ ownershipHash: z21.string()
6983
+ });
6984
+ var ProjectionRunBaseSchema = z21.object({
6985
+ id: z21.string(),
6986
+ projectId: z21.string(),
6987
+ executionId: z21.string(),
6800
6988
  status: ProjectionRunStatusSchema,
6801
- attempt: z20.number(),
6802
- progress: z20.object({
6803
- sourceRowsRead: z20.number(),
6804
- sourceRowsSkipped: z20.number()
6989
+ attempt: z21.number(),
6990
+ progress: z21.object({
6991
+ sourceRowsRead: z21.number(),
6992
+ sourceRowsSkipped: z21.number()
6805
6993
  }),
6806
- queuedAt: z20.string(),
6807
- startedAt: z20.string().optional(),
6808
- finishedAt: z20.string().optional(),
6994
+ queuedAt: z21.string(),
6995
+ startedAt: z21.string().optional(),
6996
+ finishedAt: z21.string().optional(),
6809
6997
  error: ProjectionRunFailureSchema.optional()
6810
6998
  });
6811
6999
  var ObjectProjectionRunSchema = ProjectionRunBaseSchema.extend({
6812
7000
  identity: ProjectionRunIdentityBaseSchema.extend({
6813
- projectionKind: z20.literal("object"),
6814
- protocol: z20.literal("replacement")
7001
+ projectionKind: z21.literal("object"),
7002
+ protocol: z21.literal("replacement")
6815
7003
  }),
6816
- target: z20.object({ objectTypeId: z20.string() })
7004
+ target: z21.object({ objectTypeId: z21.string() })
6817
7005
  });
6818
7006
  var LinkProjectionRunSchema = ProjectionRunBaseSchema.extend({
6819
7007
  identity: ProjectionRunIdentityBaseSchema.extend({
6820
- projectionKind: z20.literal("link"),
6821
- protocol: z20.literal("replacement")
7008
+ projectionKind: z21.literal("link"),
7009
+ protocol: z21.literal("replacement")
6822
7010
  }),
6823
- target: z20.object({
6824
- sourceObjectTypeId: z20.string(),
6825
- targetObjectTypeId: z20.string()
7011
+ target: z21.object({
7012
+ sourceObjectTypeId: z21.string(),
7013
+ targetObjectTypeId: z21.string()
6826
7014
  })
6827
7015
  });
6828
7016
  var TelemetryProjectionRunSchema = ProjectionRunBaseSchema.extend({
6829
7017
  identity: ProjectionRunIdentityBaseSchema.extend({
6830
- projectionKind: z20.literal("telemetry"),
6831
- protocol: z20.literal("telemetry")
7018
+ projectionKind: z21.literal("telemetry"),
7019
+ protocol: z21.literal("telemetry")
6832
7020
  }),
6833
- target: z20.object({ objectTypeId: z20.string() })
7021
+ target: z21.object({ objectTypeId: z21.string() })
6834
7022
  });
6835
- var ProjectionRunSchema = z20.union([
7023
+ var ProjectionRunSchema = z21.union([
6836
7024
  ObjectProjectionRunSchema,
6837
7025
  LinkProjectionRunSchema,
6838
7026
  TelemetryProjectionRunSchema
6839
7027
  ]);
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() })
7028
+ var ForeignKeyDescriptorSchema = z21.object({
7029
+ linkId: z21.string(),
7030
+ sourcePropertyId: z21.string().optional(),
7031
+ sourceField: z21.string().optional(),
7032
+ targetObjectTypeId: z21.string()
7033
+ });
7034
+ var SourceEditConflictResolutionSchema = z21.union([
7035
+ z21.object({ strategy: z21.literal("editsWin") }),
7036
+ z21.object({ strategy: z21.literal("mostRecent"), sourceTimestamp: z21.string() })
6849
7037
  ]);
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),
7038
+ var ObjectProjectionSchema = z21.object({
7039
+ _tag: z21.literal("ObjectProjectionDefinition"),
7040
+ id: z21.string(),
7041
+ objectTypeId: z21.string(),
7042
+ datasetId: z21.string(),
7043
+ properties: z21.record(z21.string()),
7044
+ links: z21.record(ForeignKeyDescriptorSchema),
6857
7045
  conflictResolution: SourceEditConflictResolutionSchema,
6858
7046
  latestRun: ProjectionRunSchema.nullable()
6859
7047
  });
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(),
7048
+ var LinkProjectionSchema = z21.object({
7049
+ _tag: z21.literal("LinkProjectionDefinition"),
7050
+ id: z21.string(),
7051
+ linkId: z21.string(),
7052
+ sourceObjectTypeId: z21.string(),
7053
+ targetObjectTypeId: z21.string(),
7054
+ datasetId: z21.string(),
7055
+ sourceField: z21.string(),
7056
+ targetField: z21.string(),
6869
7057
  latestRun: ProjectionRunSchema.nullable()
6870
7058
  });
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(),
7059
+ var TelemetryProjectionSchema = z21.object({
7060
+ _tag: z21.literal("TelemetryProjectionDefinition"),
7061
+ id: z21.string(),
7062
+ objectTypeId: z21.string(),
7063
+ datasetId: z21.string(),
7064
+ objectIdField: z21.string(),
7065
+ atField: z21.string(),
7066
+ properties: z21.record(z21.object({
7067
+ valueField: z21.string(),
7068
+ unitField: z21.string().optional()
7069
+ })),
6881
7070
  latestRun: ProjectionRunSchema.nullable()
6882
7071
  });
6883
- var ProjectionListResponseSchema = z20.object({
6884
- objectProjections: z20.array(ObjectProjectionSchema),
6885
- linkProjections: z20.array(LinkProjectionSchema),
6886
- telemetryProjections: z20.array(TelemetryProjectionSchema)
7072
+ var ProjectionListResponseSchema = z21.object({
7073
+ objectProjections: z21.array(ObjectProjectionSchema),
7074
+ linkProjections: z21.array(LinkProjectionSchema),
7075
+ telemetryProjections: z21.array(TelemetryProjectionSchema)
6887
7076
  });
6888
- var ProjectionParamsSchema = z20.object({
6889
- projectionId: z20.string().min(1)
7077
+ var ProjectionParamsSchema = z21.object({
7078
+ projectionId: z21.string().min(1)
6890
7079
  });
6891
- var ProjectionResponseSchema = z20.union([
7080
+ var ProjectionResponseSchema = z21.union([
6892
7081
  ObjectProjectionSchema,
6893
7082
  LinkProjectionSchema,
6894
7083
  TelemetryProjectionSchema
6895
7084
  ]);
6896
- var ProjectionRunParamsSchema = z20.object({
6897
- runId: z20.string().min(1)
7085
+ var ProjectionRunParamsSchema = z21.object({
7086
+ runId: z21.string().min(1)
6898
7087
  });
6899
- var ProjectionRunsQuerySchema = z20.object({
6900
- projectionId: z20.string().optional(),
7088
+ var ProjectionRunsQuerySchema = z21.object({
7089
+ projectionId: z21.string().optional(),
6901
7090
  projectionKind: ProjectionKindSchema.optional(),
6902
- datasetId: z20.string().optional(),
6903
- datasetVersionId: z20.string().optional(),
7091
+ datasetId: z21.string().optional(),
7092
+ datasetVersionId: z21.string().optional(),
6904
7093
  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()
7094
+ startedAfter: z21.string().optional(),
7095
+ startedBefore: z21.string().optional(),
7096
+ limit: z21.string().optional(),
7097
+ offset: z21.string().optional(),
7098
+ order: z21.enum(["asc", "desc"]).optional()
6910
7099
  });
6911
- var ProjectionRunListResponseSchema = z20.object({
6912
- runs: z20.array(ProjectionRunSchema),
6913
- hasMore: z20.boolean(),
6914
- total: z20.number()
7100
+ var ProjectionRunListResponseSchema = z21.object({
7101
+ runs: z21.array(ProjectionRunSchema),
7102
+ hasMore: z21.boolean(),
7103
+ total: z21.number()
6915
7104
  });
6916
7105
 
6917
7106
  // src/routes/projections.ts
@@ -7079,88 +7268,88 @@ function registerProjectionRoutes(app, host) {
7079
7268
  import { deriveRuleEventDependencies } from "@sixb/core/internal/rules";
7080
7269
 
7081
7270
  // 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"]),
7271
+ import { z as z22 } from "zod";
7272
+ var RuleParamsSchema = z22.object({
7273
+ ruleId: z22.string().min(1)
7274
+ });
7275
+ var RuleStatesQuerySchema = z22.object({
7276
+ ruleId: z22.string().optional(),
7277
+ objectTypeId: z22.string().optional(),
7278
+ primaryId: z22.string().optional(),
7279
+ limit: z22.string().optional(),
7280
+ offset: z22.string().optional(),
7281
+ order: z22.enum(["asc", "desc"]).optional()
7282
+ });
7283
+ var RuleValueSchema = z22.union([z22.string(), z22.number(), z22.boolean()]).nullable();
7284
+ var RuleSubjectSchema = z22.object({
7285
+ kind: z22.literal("object"),
7286
+ objectTypeId: z22.string()
7287
+ });
7288
+ var RuleEventSubjectSchema = z22.object({
7289
+ kind: z22.literal("object"),
7290
+ objectTypeId: z22.string(),
7291
+ primaryId: z22.string()
7292
+ });
7293
+ var RulePropertyPredicateSchema = z22.object({
7294
+ kind: z22.literal("property"),
7295
+ propertyId: z22.string(),
7296
+ op: z22.enum(["eq", "notEq", "gt", "gte", "lt", "lte", "isPresent", "isMissing"]),
7108
7297
  value: RuleValueSchema.optional()
7109
7298
  });
7110
- var RuleLinkPredicateSchema = z21.object({
7111
- kind: z21.literal("link"),
7112
- linkId: z21.string(),
7113
- op: z21.enum(["exists", "isMissing"])
7299
+ var RuleLinkPredicateSchema = z22.object({
7300
+ kind: z22.literal("link"),
7301
+ linkId: z22.string(),
7302
+ op: z22.enum(["exists", "isMissing"])
7114
7303
  });
7115
7304
  function createRulePredicateSchema(childPredicateSchema) {
7116
- return z21.union([
7117
- z21.object({
7118
- kind: z21.literal("all"),
7119
- predicates: z21.array(childPredicateSchema)
7305
+ return z22.union([
7306
+ z22.object({
7307
+ kind: z22.literal("all"),
7308
+ predicates: z22.array(childPredicateSchema)
7120
7309
  }),
7121
- z21.object({
7122
- kind: z21.literal("any"),
7123
- predicates: z21.array(childPredicateSchema)
7310
+ z22.object({
7311
+ kind: z22.literal("any"),
7312
+ predicates: z22.array(childPredicateSchema)
7124
7313
  }),
7125
- z21.object({
7126
- kind: z21.literal("not"),
7314
+ z22.object({
7315
+ kind: z22.literal("not"),
7127
7316
  predicate: childPredicateSchema
7128
7317
  }),
7129
7318
  RulePropertyPredicateSchema,
7130
7319
  RuleLinkPredicateSchema
7131
7320
  ]);
7132
7321
  }
7133
- var DeepRulePredicateSchema = createRulePredicateSchema(z21.unknown());
7322
+ var DeepRulePredicateSchema = createRulePredicateSchema(z22.unknown());
7134
7323
  var NestedRulePredicateSchema = createRulePredicateSchema(DeepRulePredicateSchema);
7135
7324
  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()
7325
+ var RuleEventDependencySchema = z22.union([
7326
+ z22.object({
7327
+ type: z22.enum(["object.created", "object.updated", "object.deleted"]),
7328
+ objectTypeId: z22.string()
7140
7329
  }),
7141
- z21.object({
7142
- type: z21.enum(["link.created", "link.updated", "link.deleted"]),
7143
- sourceTypeId: z21.string(),
7144
- linkId: z21.string()
7330
+ z22.object({
7331
+ type: z22.enum(["link.created", "link.updated", "link.deleted"]),
7332
+ sourceTypeId: z22.string(),
7333
+ linkId: z22.string()
7145
7334
  })
7146
7335
  ]);
7147
- var RuleSchema = z21.object({
7148
- kind: z21.literal("rule"),
7149
- id: z21.string(),
7336
+ var RuleSchema = z22.object({
7337
+ kind: z22.literal("rule"),
7338
+ id: z22.string(),
7150
7339
  subject: RuleSubjectSchema,
7151
7340
  predicate: RulePredicateSchema,
7152
- dependencies: z21.array(RuleEventDependencySchema)
7341
+ dependencies: z22.array(RuleEventDependencySchema)
7153
7342
  });
7154
- var RuleStateSchema = z21.object({
7155
- projectId: z21.string(),
7156
- ruleId: z21.string(),
7343
+ var RuleStateSchema = z22.object({
7344
+ projectId: z22.string(),
7345
+ ruleId: z22.string(),
7157
7346
  subject: RuleEventSubjectSchema,
7158
- triggeredAt: z21.string()
7347
+ triggeredAt: z22.string()
7159
7348
  });
7160
- var RuleStateListResponseSchema = z21.object({
7161
- states: z21.array(RuleStateSchema),
7162
- hasMore: z21.boolean(),
7163
- total: z21.number()
7349
+ var RuleStateListResponseSchema = z22.object({
7350
+ states: z22.array(RuleStateSchema),
7351
+ hasMore: z22.boolean(),
7352
+ total: z22.number()
7164
7353
  });
7165
7354
 
7166
7355
  // src/routes/rules.ts
@@ -7240,44 +7429,44 @@ function registerRuleRoutes(app, host) {
7240
7429
  }
7241
7430
 
7242
7431
  // 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()
7432
+ import { z as z23 } from "zod";
7433
+ var HealthResponseSchema = z23.object({ status: z23.literal("ok") });
7434
+ var StorageReadinessSchema = z23.object({
7435
+ reachable: z23.boolean(),
7436
+ schemaValid: z23.boolean()
7248
7437
  });
7249
- var ReadinessResponseSchema = z22.object({
7250
- status: z22.enum(["ready", "unready"]),
7438
+ var ReadinessResponseSchema = z23.object({
7439
+ status: z23.enum(["ready", "unready"]),
7251
7440
  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()
7441
+ reason: z23.string().optional()
7442
+ });
7443
+ var MaintenanceSummarySchema = z23.object({
7444
+ running: z23.boolean(),
7445
+ intervalMs: z23.number().int().positive(),
7446
+ lastStartedAt: z23.string().nullable(),
7447
+ lastCompletedAt: z23.string().nullable(),
7448
+ lastDurationMs: z23.number().nonnegative().nullable(),
7449
+ consecutiveFailures: z23.number().int().nonnegative(),
7450
+ lastError: z23.string().nullable(),
7451
+ outbox: z23.object({
7452
+ pendingCount: z23.number().int().nonnegative(),
7453
+ oldestPendingAt: z23.string().nullable(),
7454
+ retryingCount: z23.number().int().nonnegative(),
7455
+ maxAttempts: z23.number().int().nonnegative()
7267
7456
  }).nullable(),
7268
- terminalSources: z22.object({
7269
- count: z22.number().int().nonnegative(),
7270
- oldestTerminalAt: z22.string().nullable()
7457
+ terminalSources: z23.object({
7458
+ count: z23.number().int().nonnegative(),
7459
+ oldestTerminalAt: z23.string().nullable()
7271
7460
  }).nullable(),
7272
- cleanup: z22.object({
7273
- publishedOutboxRowsDeleted: z22.number().int().nonnegative(),
7274
- terminalSourceRowsDeleted: z22.number().int().nonnegative(),
7275
- terminalSourceMaterializationsDeleted: z22.number().int().nonnegative()
7461
+ cleanup: z23.object({
7462
+ publishedOutboxRowsDeleted: z23.number().int().nonnegative(),
7463
+ terminalSourceRowsDeleted: z23.number().int().nonnegative(),
7464
+ terminalSourceMaterializationsDeleted: z23.number().int().nonnegative()
7276
7465
  }).nullable()
7277
7466
  });
7278
- var StatusResponseSchema = z22.object({
7279
- status: z22.enum(["ok", "degraded"]),
7280
- objectTypes: z22.number().int().nonnegative(),
7467
+ var StatusResponseSchema = z23.object({
7468
+ status: z23.enum(["ok", "degraded"]),
7469
+ objectTypes: z23.number().int().nonnegative(),
7281
7470
  maintenance: MaintenanceSummarySchema
7282
7471
  });
7283
7472
 
@@ -7323,74 +7512,74 @@ function registerStatusRoutes(app, host) {
7323
7512
  import {
7324
7513
  SYNC_RUN_FAILURE_CODES
7325
7514
  } from "@sixb/core/storage";
7326
- import { z as z23 } from "zod";
7515
+ import { z as z24 } from "zod";
7327
7516
  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(),
7517
+ var SyncParamsSchema = z24.object({
7518
+ syncId: z24.string().min(1)
7519
+ });
7520
+ var SyncRunStatusSchema = z24.enum(["queued", "running", "succeeded", "failed", "cancelled"]);
7521
+ var SyncModeSchema = z24.enum(["snapshot", "append", "merge"]);
7522
+ var SyncRunsQuerySchema = z24.object({
7523
+ syncId: z24.string().optional(),
7524
+ datasetId: z24.string().optional(),
7336
7525
  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(),
7526
+ startedAfter: z24.string().optional(),
7527
+ startedBefore: z24.string().optional(),
7528
+ limit: z24.string().optional(),
7529
+ offset: z24.string().optional(),
7530
+ order: z24.enum(["asc", "desc"]).optional()
7531
+ });
7532
+ var RequestSyncRunBodySchema = z24.object({
7533
+ expectedLatestVersionId: z24.string().optional(),
7534
+ commitMessage: z24.string().optional()
7535
+ });
7536
+ var SyncTriggerSchema = z24.object({
7537
+ type: z24.literal("schedule"),
7538
+ scheduleId: z24.string()
7539
+ });
7540
+ var SyncRunSchema = z24.object({
7541
+ id: z24.string(),
7542
+ projectId: z24.string(),
7543
+ syncId: z24.string(),
7544
+ datasetId: z24.string(),
7356
7545
  mode: SyncModeSchema,
7357
7546
  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()
7547
+ queuedAt: z24.string(),
7548
+ startedAt: z24.string().optional(),
7549
+ finishedAt: z24.string().optional(),
7550
+ rowsRead: z24.number().optional(),
7551
+ output: z24.object({
7552
+ datasetId: z24.string(),
7553
+ versionId: z24.string()
7365
7554
  }).optional(),
7366
- expectedLatestVersionId: z23.string().optional(),
7367
- commitMessage: z23.string().optional(),
7555
+ expectedLatestVersionId: z24.string().optional(),
7556
+ commitMessage: z24.string().optional(),
7368
7557
  error: SyncRunFailureSchema.optional()
7369
7558
  });
7370
- var SyncSchema = z23.object({
7371
- id: z23.string(),
7559
+ var SyncSchema = z24.object({
7560
+ id: z24.string(),
7372
7561
  mode: SyncModeSchema,
7373
- connector: z23.object({
7374
- id: z23.string(),
7375
- type: z23.string()
7562
+ connector: z24.object({
7563
+ id: z24.string(),
7564
+ type: z24.string()
7376
7565
  }),
7377
- target: z23.object({
7378
- kind: z23.literal("dataset"),
7566
+ target: z24.object({
7567
+ kind: z24.literal("dataset"),
7379
7568
  dataset: DatasetDefinitionSchema
7380
7569
  }),
7381
- triggers: z23.array(SyncTriggerSchema),
7570
+ triggers: z24.array(SyncTriggerSchema),
7382
7571
  latestRun: SyncRunSchema.nullable()
7383
7572
  });
7384
- var SyncRunListResponseSchema = z23.object({
7385
- runs: z23.array(SyncRunSchema),
7386
- hasMore: z23.boolean(),
7387
- total: z23.number()
7573
+ var SyncRunListResponseSchema = z24.object({
7574
+ runs: z24.array(SyncRunSchema),
7575
+ hasMore: z24.boolean(),
7576
+ total: z24.number()
7388
7577
  });
7389
- var RequestSyncRunResponseSchema = z23.object({
7390
- runId: z23.string(),
7391
- jobId: z23.string(),
7392
- syncId: z23.string(),
7393
- queuedAt: z23.string()
7578
+ var RequestSyncRunResponseSchema = z24.object({
7579
+ runId: z24.string(),
7580
+ jobId: z24.string(),
7581
+ syncId: z24.string(),
7582
+ queuedAt: z24.string()
7394
7583
  });
7395
7584
 
7396
7585
  // src/routes/syncs.ts
@@ -7544,52 +7733,52 @@ function registerSyncRoutes(app, host) {
7544
7733
  }
7545
7734
 
7546
7735
  // 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()
7736
+ import { z as z25 } from "zod";
7737
+ var TelemetryParamsSchema = z25.object({
7738
+ objectTypeId: z25.string().min(1),
7739
+ objectId: z25.string().min(1),
7740
+ propertyId: z25.string().min(1)
7741
+ });
7742
+ var TelemetryHistoryQuerySchema = z25.object({
7743
+ from: z25.string().optional(),
7744
+ to: z25.string().optional(),
7745
+ limit: z25.string().optional(),
7746
+ order: z25.enum(["asc", "desc"]).optional()
7558
7747
  });
7559
- var BulkTelemetryHistorySeriesInputSchema = z24.object({
7560
- objectTypeId: z24.string().min(1),
7561
- objectId: z24.string().min(1),
7562
- propertyId: z24.string().min(1)
7748
+ var BulkTelemetryHistorySeriesInputSchema = z25.object({
7749
+ objectTypeId: z25.string().min(1),
7750
+ objectId: z25.string().min(1),
7751
+ propertyId: z25.string().min(1)
7563
7752
  }).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()
7753
+ var BulkTelemetryHistoryBodySchema = z25.object({
7754
+ series: z25.array(BulkTelemetryHistorySeriesInputSchema).min(1),
7755
+ from: z25.string().optional(),
7756
+ to: z25.string().optional(),
7757
+ limitPerSeries: z25.number().int().nonnegative().optional(),
7758
+ order: z25.enum(["asc", "desc"]).optional()
7570
7759
  }).strict();
7571
- var AppendTelemetryBodySchema = z24.object({
7572
- value: z24.unknown(),
7573
- unit: z24.string().optional(),
7574
- at: z24.string().optional()
7760
+ var AppendTelemetryBodySchema = z25.object({
7761
+ value: z25.unknown(),
7762
+ unit: z25.string().optional(),
7763
+ at: z25.string().optional()
7575
7764
  });
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)
7765
+ var TelemetryPointSchema = z25.object({
7766
+ projectId: z25.string(),
7767
+ objectTypeId: z25.string(),
7768
+ objectId: z25.string(),
7769
+ propertyId: z25.string(),
7770
+ value: z25.unknown(),
7771
+ unit: z25.string().optional(),
7772
+ at: z25.string()
7773
+ });
7774
+ var BulkTelemetryHistorySeriesSchema = z25.object({
7775
+ objectTypeId: z25.string(),
7776
+ objectId: z25.string(),
7777
+ propertyId: z25.string(),
7778
+ points: z25.array(TelemetryPointSchema)
7779
+ });
7780
+ var BulkTelemetryHistoryResponseSchema = z25.object({
7781
+ series: z25.array(BulkTelemetryHistorySeriesSchema)
7593
7782
  });
7594
7783
 
7595
7784
  // src/routes/telemetry.ts
@@ -7747,40 +7936,40 @@ function registerTelemetryRoutes(app, _host) {
7747
7936
 
7748
7937
  // src/schemas/webhook-runs.ts
7749
7938
  import { WEBHOOK_RUN_FAILURE_CODES } from "@sixb/core/storage";
7750
- import { z as z25 } from "zod";
7939
+ import { z as z26 } from "zod";
7751
7940
  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(),
7941
+ var WebhookRunStatusSchema = z26.enum(["running", "succeeded", "failed"]);
7942
+ var WebhookRunsQuerySchema = z26.object({
7943
+ connectorId: z26.string().optional(),
7944
+ webhookId: z26.string().optional(),
7756
7945
  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()
7946
+ idempotencyKey: z26.string().optional(),
7947
+ startedAfter: z26.string().optional(),
7948
+ startedBefore: z26.string().optional(),
7949
+ limit: z26.string().optional(),
7950
+ offset: z26.string().optional(),
7951
+ order: z26.enum(["asc", "desc"]).optional()
7763
7952
  });
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(),
7953
+ var WebhookRunSchema = z26.object({
7954
+ id: z26.string(),
7955
+ projectId: z26.string(),
7956
+ executionId: z26.string(),
7957
+ connectorId: z26.string(),
7958
+ webhookId: z26.string(),
7770
7959
  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(),
7960
+ method: z26.string(),
7961
+ route: z26.string(),
7962
+ startedAt: z26.string(),
7963
+ finishedAt: z26.string().optional(),
7964
+ requestBodyBytes: z26.number(),
7965
+ responseStatus: z26.number().optional(),
7966
+ idempotencyKey: z26.string().optional(),
7778
7967
  error: WebhookRunFailureSchema.optional()
7779
7968
  });
7780
- var WebhookRunListResponseSchema = z25.object({
7781
- runs: z25.array(WebhookRunSchema),
7782
- hasMore: z25.boolean(),
7783
- total: z25.number()
7969
+ var WebhookRunListResponseSchema = z26.object({
7970
+ runs: z26.array(WebhookRunSchema),
7971
+ hasMore: z26.boolean(),
7972
+ total: z26.number()
7784
7973
  });
7785
7974
 
7786
7975
  // src/routes/webhook-runs.ts
@@ -7855,25 +8044,25 @@ import {
7855
8044
  snapshotWorkflowInterventionResponse
7856
8045
  } from "@sixb/core/internal/workflows";
7857
8046
  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";
8047
+ import { z as z28 } from "zod";
7859
8048
 
7860
8049
  // src/schemas/workflows.ts
7861
8050
  import {
7862
8051
  WORKFLOW_RUN_FAILURE_CODES
7863
8052
  } from "@sixb/core/storage";
7864
- import { z as z26 } from "zod";
7865
- var WorkflowIOSnapshotSchema = z26.record(JsonValueSchema);
8053
+ import { z as z27 } from "zod";
8054
+ var WorkflowIOSnapshotSchema = z27.record(JsonValueSchema);
7866
8055
  var WorkflowRunFailureSchema = sixbFailureSchema(WORKFLOW_RUN_FAILURE_CODES);
7867
- var WorkflowParamsSchema = z26.object({
7868
- workflowId: z26.string().min(1)
8056
+ var WorkflowParamsSchema = z27.object({
8057
+ workflowId: z27.string().min(1)
7869
8058
  });
7870
- var WorkflowRunParamsSchema = z26.object({
7871
- runId: z26.string().min(1)
8059
+ var WorkflowRunParamsSchema = z27.object({
8060
+ runId: z27.string().min(1)
7872
8061
  });
7873
- var WorkflowInterventionParamsSchema = z26.object({
7874
- interventionId: z26.string().min(1)
8062
+ var WorkflowInterventionParamsSchema = z27.object({
8063
+ interventionId: z27.string().min(1)
7875
8064
  });
7876
- var WorkflowRunStatusSchema = z26.enum([
8065
+ var WorkflowRunStatusSchema = z27.enum([
7877
8066
  "queued",
7878
8067
  "running",
7879
8068
  "waiting",
@@ -7881,91 +8070,91 @@ var WorkflowRunStatusSchema = z26.enum([
7881
8070
  "failed",
7882
8071
  "cancelled"
7883
8072
  ]);
7884
- var WorkflowInterventionStatusSchema = z26.enum([
8073
+ var WorkflowInterventionStatusSchema = z27.enum([
7885
8074
  "pending",
7886
8075
  "submitted",
7887
8076
  "cancelled",
7888
8077
  "expired"
7889
8078
  ]);
7890
- var WorkflowRunsQuerySchema = z26.object({
7891
- workflowId: z26.string().optional(),
8079
+ var WorkflowRunsQuerySchema = z27.object({
8080
+ workflowId: z27.string().optional(),
7892
8081
  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(),
8082
+ startedAfter: z27.string().optional(),
8083
+ startedBefore: z27.string().optional(),
8084
+ limit: z27.string().optional(),
8085
+ offset: z27.string().optional(),
8086
+ order: z27.enum(["asc", "desc"]).optional()
8087
+ });
8088
+ var WorkflowInterventionsQuerySchema = z27.object({
8089
+ workflowId: z27.string().optional(),
8090
+ workflowRunId: z27.string().optional(),
8091
+ nodeRunId: z27.string().optional(),
8092
+ nodeId: z27.string().optional(),
8093
+ nodeKey: z27.string().optional(),
8094
+ interventionId: z27.string().optional(),
7906
8095
  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()
8096
+ requestedAfter: z27.string().optional(),
8097
+ requestedBefore: z27.string().optional(),
8098
+ limit: z27.string().optional(),
8099
+ offset: z27.string().optional(),
8100
+ order: z27.enum(["asc", "desc"]).optional()
7912
8101
  });
7913
- var RequestWorkflowRunBodySchema = z26.object({
8102
+ var RequestWorkflowRunBodySchema = z27.object({
7914
8103
  input: WorkflowIOSnapshotSchema.optional()
7915
8104
  }).default({});
7916
- var WorkflowInterventionActorSchema = z26.object({
7917
- principalType: z26.enum(["user", "serviceAccount", "system"]),
7918
- principalId: z26.string().min(1)
8105
+ var WorkflowInterventionActorSchema = z27.object({
8106
+ principalType: z27.enum(["user", "serviceAccount", "system"]),
8107
+ principalId: z27.string().min(1)
7919
8108
  });
7920
- var CancelWorkflowRunBodySchema = z26.object({}).default({});
7921
- var SubmitWorkflowInterventionBodySchema = z26.object({
8109
+ var CancelWorkflowRunBodySchema = z27.object({}).default({});
8110
+ var SubmitWorkflowInterventionBodySchema = z27.object({
7922
8111
  response: WorkflowIOSnapshotSchema
7923
8112
  });
7924
- var CancelWorkflowInterventionBodySchema = z26.object({}).default({});
7925
- var WorkflowTriggerSchema = z26.object({
7926
- type: z26.literal("schedule"),
7927
- scheduleId: z26.string()
8113
+ var CancelWorkflowInterventionBodySchema = z27.object({}).default({});
8114
+ var WorkflowTriggerSchema = z27.object({
8115
+ type: z27.literal("schedule"),
8116
+ scheduleId: z27.string()
7928
8117
  });
7929
- var WorkflowNodeSchema = z26.union([
7930
- z26.object({
7931
- type: z26.literal("step"),
7932
- id: z26.string(),
7933
- key: z26.string(),
8118
+ var WorkflowNodeSchema = z27.union([
8119
+ z27.object({
8120
+ type: z27.literal("step"),
8121
+ id: z27.string(),
8122
+ key: z27.string(),
7934
8123
  input: WorkflowIOSnapshotSchema,
7935
8124
  output: WorkflowIOSnapshotSchema
7936
8125
  }),
7937
- z26.object({
7938
- type: z26.literal("action"),
7939
- id: z26.string(),
7940
- key: z26.string(),
7941
- objectTypeId: z26.string().optional(),
8126
+ z27.object({
8127
+ type: z27.literal("action"),
8128
+ id: z27.string(),
8129
+ key: z27.string(),
8130
+ objectTypeId: z27.string().optional(),
7942
8131
  params: WorkflowIOSnapshotSchema
7943
8132
  }),
7944
- z26.object({
7945
- type: z26.literal("intervention"),
7946
- id: z26.string(),
7947
- key: z26.string(),
8133
+ z27.object({
8134
+ type: z27.literal("intervention"),
8135
+ id: z27.string(),
8136
+ key: z27.string(),
7948
8137
  input: WorkflowIOSnapshotSchema,
7949
8138
  response: WorkflowIOSnapshotSchema,
7950
- description: z26.string().optional()
8139
+ description: z27.string().optional()
7951
8140
  }),
7952
- z26.object({
7953
- type: z26.literal("agent"),
7954
- id: z26.string(),
7955
- key: z26.string(),
7956
- agentId: z26.string(),
8141
+ z27.object({
8142
+ type: z27.literal("agent"),
8143
+ id: z27.string(),
8144
+ key: z27.string(),
8145
+ agentId: z27.string(),
7957
8146
  input: WorkflowIOSnapshotSchema,
7958
8147
  output: WorkflowIOSnapshotSchema
7959
8148
  })
7960
8149
  ]);
7961
- var WorkflowRunSummarySchema = z26.object({
7962
- id: z26.string(),
7963
- projectId: z26.string(),
7964
- workflowId: z26.string(),
8150
+ var WorkflowRunSummarySchema = z27.object({
8151
+ id: z27.string(),
8152
+ projectId: z27.string(),
8153
+ workflowId: z27.string(),
7965
8154
  status: WorkflowRunStatusSchema,
7966
- queuedAt: z26.string().optional(),
7967
- startedAt: z26.string(),
7968
- finishedAt: z26.string().optional(),
8155
+ queuedAt: z27.string().optional(),
8156
+ startedAt: z27.string(),
8157
+ finishedAt: z27.string().optional(),
7969
8158
  error: WorkflowRunFailureSchema.optional(),
7970
8159
  requestedBy: WorkflowInterventionActorSchema
7971
8160
  });
@@ -7973,111 +8162,111 @@ var WorkflowRunDetailSchema = WorkflowRunSummarySchema.extend({
7973
8162
  input: WorkflowIOSnapshotSchema,
7974
8163
  output: WorkflowIOSnapshotSchema.optional()
7975
8164
  });
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(),
8165
+ var WorkflowAgentNodeExecutionSummarySchema = z27.object({
8166
+ agentId: z27.string(),
8167
+ status: z27.enum(["queued", "running", "succeeded", "failed", "cancelled"]),
8168
+ attempt: z27.number().int().nonnegative(),
8169
+ modelId: z27.string().optional(),
8170
+ finishReason: z27.string().optional(),
7982
8171
  usage: AiUsageSummarySchema.optional(),
7983
8172
  cost: AiCostSummarySchema.optional(),
7984
- startedAt: z26.string().optional(),
7985
- completedAt: z26.string().optional()
8173
+ startedAt: z27.string().optional(),
8174
+ completedAt: z27.string().optional()
7986
8175
  });
7987
- var WorkflowAgentFailurePhaseSchema = z26.enum(["agent-loop", "structured-finalizer"]);
8176
+ var WorkflowAgentFailurePhaseSchema = z27.enum(["agent-loop", "structured-finalizer"]);
7988
8177
  var WorkflowAgentNodeExecutionSchema = WorkflowAgentNodeExecutionSummarySchema.extend({
7989
- nodeRunId: z26.string(),
7990
- prompt: z26.string(),
7991
- trace: z26.array(AgentMessagePartSchema).optional(),
7992
- diagnostics: z26.array(JsonValueSchema).optional(),
8178
+ nodeRunId: z27.string(),
8179
+ prompt: z27.string(),
8180
+ trace: z27.array(AgentMessagePartSchema).optional(),
8181
+ diagnostics: z27.array(JsonValueSchema).optional(),
7993
8182
  failurePhase: WorkflowAgentFailurePhaseSchema.optional(),
7994
8183
  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"]),
8184
+ createdAt: z27.string()
8185
+ });
8186
+ var WorkflowNodeRunSchema = z27.object({
8187
+ id: z27.string(),
8188
+ projectId: z27.string(),
8189
+ workflowRunId: z27.string(),
8190
+ workflowId: z27.string(),
8191
+ nodeIndex: z27.number(),
8192
+ nodeType: z27.enum(["step", "action", "intervention", "agent"]),
8193
+ nodeId: z27.string(),
8194
+ nodeKey: z27.string(),
8195
+ status: z27.enum(["running", "waiting", "succeeded", "failed", "cancelled"]),
8007
8196
  input: WorkflowIOSnapshotSchema,
8008
- startedAt: z26.string(),
8009
- finishedAt: z26.string().optional(),
8197
+ startedAt: z27.string(),
8198
+ finishedAt: z27.string().optional(),
8010
8199
  output: WorkflowIOSnapshotSchema.optional(),
8011
8200
  error: WorkflowRunFailureSchema.optional(),
8012
8201
  agentExecution: WorkflowAgentNodeExecutionSummarySchema.optional()
8013
8202
  });
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(),
8203
+ var WorkflowInterventionSchema = z27.object({
8204
+ id: z27.string(),
8205
+ projectId: z27.string(),
8206
+ workflowId: z27.string(),
8207
+ workflowRunId: z27.string(),
8208
+ nodeRunId: z27.string(),
8209
+ nodeIndex: z27.number(),
8210
+ nodeId: z27.string(),
8211
+ nodeKey: z27.string(),
8212
+ interventionId: z27.string(),
8024
8213
  input: WorkflowIOSnapshotSchema,
8025
8214
  defaultResponse: WorkflowIOSnapshotSchema,
8026
8215
  status: WorkflowInterventionStatusSchema,
8027
- requestedAt: z26.string(),
8028
- expiresAt: z26.string().optional(),
8029
- submittedAt: z26.string().optional(),
8216
+ requestedAt: z27.string(),
8217
+ expiresAt: z27.string().optional(),
8218
+ submittedAt: z27.string().optional(),
8030
8219
  submittedBy: WorkflowInterventionActorSchema.optional(),
8031
8220
  response: WorkflowIOSnapshotSchema.optional(),
8032
- cancelledAt: z26.string().optional(),
8221
+ cancelledAt: z27.string().optional(),
8033
8222
  cancelledBy: WorkflowInterventionActorSchema.optional(),
8034
- expiredAt: z26.string().optional()
8223
+ expiredAt: z27.string().optional()
8035
8224
  });
8036
- var WorkflowSchema = z26.object({
8037
- id: z26.string(),
8225
+ var WorkflowSchema = z27.object({
8226
+ id: z27.string(),
8038
8227
  input: WorkflowIOSnapshotSchema,
8039
- triggers: z26.array(WorkflowTriggerSchema),
8040
- nodes: z26.array(WorkflowNodeSchema),
8228
+ triggers: z27.array(WorkflowTriggerSchema),
8229
+ nodes: z27.array(WorkflowNodeSchema),
8041
8230
  latestRun: WorkflowRunSummarySchema.nullable()
8042
8231
  });
8043
- var WorkflowRunListResponseSchema = z26.object({
8044
- runs: z26.array(WorkflowRunSummarySchema),
8045
- hasMore: z26.boolean(),
8046
- total: z26.number()
8232
+ var WorkflowRunListResponseSchema = z27.object({
8233
+ runs: z27.array(WorkflowRunSummarySchema),
8234
+ hasMore: z27.boolean(),
8235
+ total: z27.number()
8047
8236
  });
8048
- var WorkflowRunDetailResponseSchema = z26.object({
8237
+ var WorkflowRunDetailResponseSchema = z27.object({
8049
8238
  run: WorkflowRunDetailSchema,
8050
- nodes: z26.array(WorkflowNodeRunSchema)
8239
+ nodes: z27.array(WorkflowNodeRunSchema)
8051
8240
  });
8052
8241
  var CancelWorkflowRunResponseSchema = WorkflowRunDetailResponseSchema;
8053
- var WorkflowInterventionListResponseSchema = z26.object({
8054
- interventions: z26.array(WorkflowInterventionSchema),
8055
- hasMore: z26.boolean(),
8056
- total: z26.number()
8242
+ var WorkflowInterventionListResponseSchema = z27.object({
8243
+ interventions: z27.array(WorkflowInterventionSchema),
8244
+ hasMore: z27.boolean(),
8245
+ total: z27.number()
8057
8246
  });
8058
- var SubmitWorkflowInterventionResponseSchema = z26.object({
8247
+ var SubmitWorkflowInterventionResponseSchema = z27.object({
8059
8248
  intervention: WorkflowInterventionSchema,
8060
- jobId: z26.string()
8249
+ jobId: z27.string()
8061
8250
  });
8062
- var CancelWorkflowInterventionResponseSchema = z26.object({
8251
+ var CancelWorkflowInterventionResponseSchema = z27.object({
8063
8252
  intervention: WorkflowInterventionSchema
8064
8253
  });
8065
- var RequestWorkflowRunResponseSchema = z26.object({
8066
- runId: z26.string(),
8067
- jobId: z26.string(),
8068
- workflowId: z26.string(),
8069
- queuedAt: z26.string()
8254
+ var RequestWorkflowRunResponseSchema = z27.object({
8255
+ runId: z27.string(),
8256
+ jobId: z27.string(),
8257
+ workflowId: z27.string(),
8258
+ queuedAt: z27.string()
8070
8259
  });
8071
8260
 
8072
8261
  // src/routes/workflows.ts
8073
8262
  var WorkflowRunFileContentQuerySchema = FileContentQuerySchema.extend({
8074
- path: z27.string().min(1).regex(/^\/(?:input|output)(?:\/|$)/, "Workflow run file content paths must start with /input/ or /output/")
8263
+ path: z28.string().min(1).regex(/^\/(?:input|output)(?:\/|$)/, "Workflow run file content paths must start with /input/ or /output/")
8075
8264
  });
8076
8265
  var WorkflowNodeFileContentQuerySchema = FileContentQuerySchema.extend({
8077
- path: z27.string().min(1).regex(/^\/(?:input|output)(?:\/|$)/, "Workflow node file content paths must start with /input/ or /output/")
8266
+ path: z28.string().min(1).regex(/^\/(?:input|output)(?:\/|$)/, "Workflow node file content paths must start with /input/ or /output/")
8078
8267
  });
8079
8268
  var WorkflowNodeFileContentParamsSchema = WorkflowRunParamsSchema.extend({
8080
- nodeKey: z27.string().min(1)
8269
+ nodeKey: z28.string().min(1)
8081
8270
  });
8082
8271
  function serializeWorkflowRunSummary(run) {
8083
8272
  return {
@@ -9119,6 +9308,7 @@ function registerHttpRoutes(app, host, options) {
9119
9308
  registerFileRoutes(app, host);
9120
9309
  registerActionRunRoutes(app, host);
9121
9310
  registerAgentRoutes(app, host);
9311
+ registerModelRoutes(app, host);
9122
9312
  registerLinkRoutes(app, host);
9123
9313
  registerTelemetryRoutes(app, host);
9124
9314
  registerEventRoutes(app, host);
@@ -9280,269 +9470,269 @@ function notFoundResponse() {
9280
9470
  }
9281
9471
 
9282
9472
  // 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()),
9473
+ import { z as z29 } from "zod";
9474
+ var AuthInvitationStatusSchema = z29.enum(["pending", "accepted", "revoked"]);
9475
+ var AuthGroupOptionSchema = z29.object({
9476
+ id: z29.string(),
9477
+ label: z29.string().optional(),
9478
+ description: z29.string().optional()
9479
+ });
9480
+ var AuthInvitationSchema = z29.object({
9481
+ id: z29.string(),
9482
+ email: z29.string(),
9483
+ groupIds: z29.array(z29.string()),
9294
9484
  status: AuthInvitationStatusSchema,
9295
- createdAt: z28.string(),
9296
- updatedAt: z28.string(),
9297
- expiresAt: z28.string(),
9298
- acceptedAt: z28.string().optional(),
9299
- revokedAt: z28.string().optional()
9485
+ createdAt: z29.string(),
9486
+ updatedAt: z29.string(),
9487
+ expiresAt: z29.string(),
9488
+ acceptedAt: z29.string().optional(),
9489
+ revokedAt: z29.string().optional()
9300
9490
  });
9301
- var AuthInvitationDeliverySchema = z28.object({
9302
- status: z28.enum(["sent", "skipped", "rate_limited", "not_supported"])
9491
+ var AuthInvitationDeliverySchema = z29.object({
9492
+ status: z29.enum(["sent", "skipped", "rate_limited", "not_supported"])
9303
9493
  });
9304
9494
  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(),
9495
+ var AuthAccessTokenKindSchema = z29.enum(["personal", "serviceAccount"]);
9496
+ var AuthAccessTokenSubjectTypeSchema = z29.enum(["user", "serviceAccount"]);
9497
+ var AuthAccessTokenStatusSchema = z29.enum(["active", "expired", "revoked"]);
9498
+ var AuthServiceAccountStatusSchema = z29.enum(["active", "suspended"]);
9499
+ var AuthUserStatusSchema = z29.enum(["active", "suspended"]);
9500
+ var AuthAccessTokenSchema = z29.object({
9501
+ id: z29.string(),
9502
+ name: z29.string(),
9313
9503
  kind: AuthAccessTokenKindSchema,
9314
9504
  status: AuthAccessTokenStatusSchema,
9315
9505
  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(),
9506
+ subjectId: z29.string(),
9507
+ subjectLabel: z29.string().optional(),
9508
+ groupIds: z29.array(z29.string()).optional(),
9509
+ createdAt: z29.string(),
9510
+ expiresAt: z29.string(),
9511
+ revokedAt: z29.string().optional(),
9512
+ lastUsedAt: z29.string().optional(),
9513
+ lastUsedUserAgent: z29.string().optional(),
9514
+ lastUsedIpAddress: z29.string().optional()
9515
+ });
9516
+ var AuthServiceAccountSchema = z29.object({
9517
+ id: z29.string(),
9518
+ name: z29.string(),
9519
+ description: z29.string().optional(),
9330
9520
  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(),
9521
+ groupIds: z29.array(z29.string()),
9522
+ createdAt: z29.string(),
9523
+ updatedAt: z29.string()
9524
+ });
9525
+ var AuthMemberUserSchema = z29.object({
9526
+ id: z29.string(),
9527
+ email: z29.string(),
9528
+ displayName: z29.string().optional(),
9529
+ avatarUrl: z29.string().optional(),
9340
9530
  status: AuthUserStatusSchema,
9341
- createdAt: z28.string(),
9342
- updatedAt: z28.string()
9531
+ createdAt: z29.string(),
9532
+ updatedAt: z29.string()
9343
9533
  });
9344
- var AuthManagedMemberSchema = z28.object({
9534
+ var AuthManagedMemberSchema = z29.object({
9345
9535
  user: AuthMemberUserSchema,
9346
- groupIds: z28.array(z28.string())
9536
+ groupIds: z29.array(z29.string())
9347
9537
  });
9348
- var AuthMemberCapabilitiesSchema = z28.object({
9349
- assignGroups: z28.boolean(),
9350
- suspend: z28.boolean(),
9351
- reactivate: z28.boolean()
9538
+ var AuthMemberCapabilitiesSchema = z29.object({
9539
+ assignGroups: z29.boolean(),
9540
+ suspend: z29.boolean(),
9541
+ reactivate: z29.boolean()
9352
9542
  });
9353
9543
  var AuthMemberSchema = AuthManagedMemberSchema.extend({
9354
9544
  capabilities: AuthMemberCapabilitiesSchema
9355
9545
  });
9356
- var GetAuthAccessManagementOptionsResponseSchema = z28.object({
9357
- groups: z28.array(AuthGroupOptionSchema)
9546
+ var GetAuthAccessManagementOptionsResponseSchema = z29.object({
9547
+ groups: z29.array(AuthGroupOptionSchema)
9358
9548
  });
9359
- var ListAuthAccessTokensResponseSchema = z28.object({
9360
- accessTokens: z28.array(AuthAccessTokenSchema)
9549
+ var ListAuthAccessTokensResponseSchema = z29.object({
9550
+ accessTokens: z29.array(AuthAccessTokenSchema)
9361
9551
  });
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()
9552
+ var CreateAuthPersonalAccessTokenBodySchema = z29.object({
9553
+ name: z29.string().trim().min(1),
9554
+ expiresAt: z29.string().min(1),
9555
+ groupIds: z29.array(z29.string().min(1)).optional()
9366
9556
  });
9367
- var CreateAuthPersonalAccessTokenResponseSchema = z28.object({
9557
+ var CreateAuthPersonalAccessTokenResponseSchema = z29.object({
9368
9558
  accessToken: AuthAccessTokenSchema,
9369
- tokenValue: z28.string()
9559
+ tokenValue: z29.string()
9370
9560
  });
9371
- var RevokeAuthAccessTokenParamsSchema = z28.object({
9372
- tokenId: z28.string().min(1)
9561
+ var RevokeAuthAccessTokenParamsSchema = z29.object({
9562
+ tokenId: z29.string().min(1)
9373
9563
  });
9374
- var RevokeAuthAccessTokenResponseSchema = z28.object({
9564
+ var RevokeAuthAccessTokenResponseSchema = z29.object({
9375
9565
  accessToken: AuthAccessTokenSchema
9376
9566
  });
9377
- var ListAuthServiceAccountsResponseSchema = z28.object({
9378
- serviceAccounts: z28.array(AuthServiceAccountSchema)
9567
+ var ListAuthServiceAccountsResponseSchema = z29.object({
9568
+ serviceAccounts: z29.array(AuthServiceAccountSchema)
9379
9569
  });
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()
9570
+ var CreateAuthServiceAccountBodySchema = z29.object({
9571
+ id: z29.string().trim().min(1).optional(),
9572
+ name: z29.string().trim().min(1),
9573
+ description: z29.string().trim().optional(),
9574
+ groupIds: z29.array(z29.string().min(1)).optional()
9385
9575
  });
9386
- var CreateAuthServiceAccountResponseSchema = z28.object({
9576
+ var CreateAuthServiceAccountResponseSchema = z29.object({
9387
9577
  serviceAccount: AuthServiceAccountSchema
9388
9578
  });
9389
- var AuthServiceAccountParamsSchema = z28.object({
9390
- serviceAccountId: z28.string().min(1)
9579
+ var AuthServiceAccountParamsSchema = z29.object({
9580
+ serviceAccountId: z29.string().min(1)
9391
9581
  });
9392
- var DisableAuthServiceAccountResponseSchema = z28.object({
9582
+ var DisableAuthServiceAccountResponseSchema = z29.object({
9393
9583
  serviceAccount: AuthServiceAccountSchema
9394
9584
  });
9395
- var ListAuthServiceAccountAccessTokensResponseSchema = z28.object({
9396
- accessTokens: z28.array(AuthAccessTokenSchema)
9585
+ var ListAuthServiceAccountAccessTokensResponseSchema = z29.object({
9586
+ accessTokens: z29.array(AuthAccessTokenSchema)
9397
9587
  });
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()
9588
+ var CreateAuthServiceAccountAccessTokenBodySchema = z29.object({
9589
+ name: z29.string().trim().min(1),
9590
+ expiresAt: z29.string().min(1),
9591
+ groupIds: z29.array(z29.string().min(1)).optional()
9402
9592
  });
9403
- var CreateAuthServiceAccountAccessTokenResponseSchema = z28.object({
9593
+ var CreateAuthServiceAccountAccessTokenResponseSchema = z29.object({
9404
9594
  accessToken: AuthAccessTokenSchema,
9405
- tokenValue: z28.string()
9595
+ tokenValue: z29.string()
9406
9596
  });
9407
9597
  var RevokeAuthServiceAccountAccessTokenParamsSchema = AuthServiceAccountParamsSchema.extend({
9408
- tokenId: z28.string().min(1)
9598
+ tokenId: z29.string().min(1)
9409
9599
  });
9410
- var RevokeAuthServiceAccountAccessTokenResponseSchema = z28.object({
9600
+ var RevokeAuthServiceAccountAccessTokenResponseSchema = z29.object({
9411
9601
  accessToken: AuthAccessTokenSchema
9412
9602
  });
9413
- var AuthCreateInvitationCapabilitySchema = z28.union([
9414
- z28.object({
9415
- state: z28.literal("enabled")
9603
+ var AuthCreateInvitationCapabilitySchema = z29.union([
9604
+ z29.object({
9605
+ state: z29.literal("enabled")
9416
9606
  }),
9417
- z28.object({
9418
- state: z28.literal("disabled"),
9419
- reason: z28.enum(["missing_membership_policy", "invitation_delivery_not_supported"])
9607
+ z29.object({
9608
+ state: z29.literal("disabled"),
9609
+ reason: z29.enum(["missing_membership_policy", "invitation_delivery_not_supported"])
9420
9610
  })
9421
9611
  ]);
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({
9612
+ var AuthInvitationDestinationSchema = z29.object({
9613
+ id: z29.enum(["atlas", "app"]),
9614
+ label: z29.string()
9615
+ });
9616
+ var GetAuthInvitationOptionsResponseSchema = z29.object({
9617
+ groups: z29.array(AuthInvitationGroupOptionSchema),
9618
+ destinations: z29.array(AuthInvitationDestinationSchema),
9619
+ defaultDestinationId: z29.enum(["atlas", "app"]).optional(),
9620
+ canInviteWithoutGroups: z29.boolean(),
9621
+ capabilities: z29.object({
9432
9622
  createInvitation: AuthCreateInvitationCapabilitySchema
9433
9623
  })
9434
9624
  });
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()
9625
+ var GetAuthMembershipOptionsResponseSchema = z29.object({
9626
+ groups: z29.array(AuthGroupOptionSchema),
9627
+ capabilities: z29.object({
9628
+ invite: z29.boolean(),
9629
+ assignGroups: z29.boolean(),
9630
+ suspend: z29.boolean()
9441
9631
  })
9442
9632
  });
9443
- var ListAuthMembersQuerySchema = z28.object({
9444
- limit: z28.string().optional(),
9445
- offset: z28.string().optional(),
9446
- order: z28.enum(["asc", "desc"]).optional()
9633
+ var ListAuthMembersQuerySchema = z29.object({
9634
+ limit: z29.string().optional(),
9635
+ offset: z29.string().optional(),
9636
+ order: z29.enum(["asc", "desc"]).optional()
9447
9637
  });
9448
- var ListAuthMembersResponseSchema = z28.object({
9449
- members: z28.array(AuthMemberSchema),
9450
- hasMore: z28.boolean(),
9451
- total: z28.number()
9638
+ var ListAuthMembersResponseSchema = z29.object({
9639
+ members: z29.array(AuthMemberSchema),
9640
+ hasMore: z29.boolean(),
9641
+ total: z29.number()
9452
9642
  });
9453
- var AuthMemberParamsSchema = z28.object({
9454
- userId: z28.string().min(1)
9643
+ var AuthMemberParamsSchema = z29.object({
9644
+ userId: z29.string().min(1)
9455
9645
  });
9456
- var UpdateAuthMemberGroupsBodySchema = z28.object({
9457
- groupIds: z28.array(z28.string().min(1))
9646
+ var UpdateAuthMemberGroupsBodySchema = z29.object({
9647
+ groupIds: z29.array(z29.string().min(1))
9458
9648
  });
9459
- var UpdateAuthMemberGroupsResponseSchema = z28.object({
9649
+ var UpdateAuthMemberGroupsResponseSchema = z29.object({
9460
9650
  member: AuthManagedMemberSchema
9461
9651
  });
9462
- var SuspendAuthMemberResponseSchema = z28.object({
9652
+ var SuspendAuthMemberResponseSchema = z29.object({
9463
9653
  member: AuthManagedMemberSchema
9464
9654
  });
9465
- var ReactivateAuthMemberResponseSchema = z28.object({
9655
+ var ReactivateAuthMemberResponseSchema = z29.object({
9466
9656
  member: AuthManagedMemberSchema
9467
9657
  });
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()
9658
+ var CreateAuthInvitationBodySchema = z29.object({
9659
+ email: z29.string().min(1),
9660
+ groupIds: z29.array(z29.string().min(1)).optional(),
9661
+ destinationId: z29.enum(["atlas", "app"]).optional(),
9662
+ expiresAt: z29.string().optional(),
9663
+ returnTo: z29.string().optional()
9474
9664
  });
9475
- var CreateAuthInvitationResponseSchema = z28.object({
9665
+ var CreateAuthInvitationResponseSchema = z29.object({
9476
9666
  invitation: AuthInvitationSchema,
9477
9667
  delivery: AuthInvitationDeliverySchema
9478
9668
  });
9479
- var ListAuthInvitationsQuerySchema = z28.object({
9480
- email: z28.string().optional(),
9669
+ var ListAuthInvitationsQuerySchema = z29.object({
9670
+ email: z29.string().optional(),
9481
9671
  status: AuthInvitationStatusSchema.optional(),
9482
- limit: z28.string().optional(),
9483
- offset: z28.string().optional(),
9484
- order: z28.enum(["asc", "desc"]).optional()
9672
+ limit: z29.string().optional(),
9673
+ offset: z29.string().optional(),
9674
+ order: z29.enum(["asc", "desc"]).optional()
9485
9675
  });
9486
- var ListAuthInvitationsResponseSchema = z28.object({
9487
- invitations: z28.array(AuthInvitationSchema),
9488
- hasMore: z28.boolean(),
9489
- total: z28.number()
9676
+ var ListAuthInvitationsResponseSchema = z29.object({
9677
+ invitations: z29.array(AuthInvitationSchema),
9678
+ hasMore: z29.boolean(),
9679
+ total: z29.number()
9490
9680
  });
9491
- var RevokeAuthInvitationParamsSchema = z28.object({
9492
- invitationId: z28.string().min(1)
9681
+ var RevokeAuthInvitationParamsSchema = z29.object({
9682
+ invitationId: z29.string().min(1)
9493
9683
  });
9494
- var RevokeAuthInvitationResponseSchema = z28.object({
9684
+ var RevokeAuthInvitationResponseSchema = z29.object({
9495
9685
  invitation: AuthInvitationSchema
9496
9686
  });
9497
- var AuthSessionResponseSchema = z28.union([
9498
- z28.object({
9499
- authenticated: z28.literal(false)
9687
+ var AuthSessionResponseSchema = z29.union([
9688
+ z29.object({
9689
+ authenticated: z29.literal(false)
9500
9690
  }),
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"])
9691
+ z29.object({
9692
+ authenticated: z29.literal(true),
9693
+ csrfToken: z29.string(),
9694
+ applicationAccess: z29.object({
9695
+ allowed: z29.boolean(),
9696
+ audience: z29.enum(["atlas", "app"])
9507
9697
  }),
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())
9698
+ user: z29.object({
9699
+ id: z29.string(),
9700
+ email: z29.string(),
9701
+ displayName: z29.string().optional(),
9702
+ avatarUrl: z29.string().optional(),
9703
+ groupIds: z29.array(z29.string())
9514
9704
  }),
9515
- session: z28.object({
9516
- id: z28.string(),
9517
- expiresAt: z28.string()
9705
+ session: z29.object({
9706
+ id: z29.string(),
9707
+ expiresAt: z29.string()
9518
9708
  })
9519
9709
  })
9520
9710
  ]);
9521
- var AuthSignOutResponseSchema = z28.object({
9522
- success: z28.boolean()
9711
+ var AuthSignOutResponseSchema = z29.object({
9712
+ success: z29.boolean()
9523
9713
  });
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()
9714
+ var AuthSessionSummarySchema = z29.object({
9715
+ id: z29.string(),
9716
+ audience: z29.enum(["atlas", "app"]),
9717
+ current: z29.boolean(),
9718
+ createdAt: z29.string(),
9719
+ expiresAt: z29.string(),
9720
+ lastSeenAt: z29.string().optional(),
9721
+ userAgent: z29.string().optional(),
9722
+ ipAddress: z29.string().optional()
9533
9723
  });
9534
- var ListAuthSessionsResponseSchema = z28.object({
9535
- sessions: z28.array(AuthSessionSummarySchema)
9724
+ var ListAuthSessionsResponseSchema = z29.object({
9725
+ sessions: z29.array(AuthSessionSummarySchema)
9536
9726
  });
9537
- var RevokeAuthSessionParamsSchema = z28.object({
9538
- sessionId: z28.string().min(1)
9727
+ var RevokeAuthSessionParamsSchema = z29.object({
9728
+ sessionId: z29.string().min(1)
9539
9729
  });
9540
- var RevokeAuthSessionResponseSchema = z28.object({
9541
- success: z28.boolean()
9730
+ var RevokeAuthSessionResponseSchema = z29.object({
9731
+ success: z29.boolean()
9542
9732
  });
9543
- var SignOutAllResponseSchema = z28.object({
9544
- success: z28.boolean(),
9545
- revokedCount: z28.number()
9733
+ var SignOutAllResponseSchema = z29.object({
9734
+ success: z29.boolean(),
9735
+ revokedCount: z29.number()
9546
9736
  });
9547
9737
 
9548
9738
  // src/routes/auth.ts
@@ -11424,7 +11614,7 @@ import {
11424
11614
  isAgentRunActivityEvent
11425
11615
  } from "@sixb/core/agents/streams";
11426
11616
  import { BrokerCursorExpiredError } from "@sixb/core/broker";
11427
- import { z as z29 } from "zod";
11617
+ import { z as z30 } from "zod";
11428
11618
 
11429
11619
  // src/utils/ws.ts
11430
11620
  function safeSend(target, payload) {
@@ -11472,25 +11662,25 @@ async function decodeWsMessage(message) {
11472
11662
  }
11473
11663
 
11474
11664
  // 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()
11665
+ var SubscribeSchema = z30.object({
11666
+ type: z30.literal("subscribe"),
11667
+ runId: z30.string().min(1),
11668
+ afterCursor: z30.string().min(1).optional()
11479
11669
  });
11480
- var SubscribeActivitySchema = z29.object({
11481
- type: z29.literal("subscribe.activity")
11670
+ var SubscribeActivitySchema = z30.object({
11671
+ type: z30.literal("subscribe.activity")
11482
11672
  });
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()
11673
+ var ReplaySchema = z30.object({
11674
+ type: z30.literal("replay"),
11675
+ runId: z30.string().min(1),
11676
+ afterCursor: z30.string().min(1).optional(),
11677
+ limit: z30.number().int().positive().max(500).optional()
11488
11678
  });
11489
- var UnsubscribeSchema = z29.object({
11490
- type: z29.literal("unsubscribe"),
11491
- runId: z29.string().min(1).optional()
11679
+ var UnsubscribeSchema = z30.object({
11680
+ type: z30.literal("unsubscribe"),
11681
+ runId: z30.string().min(1).optional()
11492
11682
  });
11493
- var AgentStreamMessageSchema = z29.union([
11683
+ var AgentStreamMessageSchema = z30.union([
11494
11684
  SubscribeSchema,
11495
11685
  SubscribeActivitySchema,
11496
11686
  ReplaySchema,
@@ -11776,22 +11966,22 @@ function errorMessage(error) {
11776
11966
 
11777
11967
  // src/routes/ws/events.ts
11778
11968
  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]);
11969
+ import { z as z31 } from "zod";
11970
+ var SubscribeSchema2 = z31.object({
11971
+ type: z31.literal("subscribe"),
11972
+ topic: z31.enum(EVENT_TOPICS).optional(),
11973
+ types: z31.array(z31.enum(EVENT_TYPES)).optional(),
11974
+ objectTypeId: z31.string().optional(),
11975
+ primaryId: z31.string().optional(),
11976
+ actionId: z31.string().optional(),
11977
+ runId: z31.string().optional(),
11978
+ afterCursor: z31.string().optional(),
11979
+ limit: z31.number().int().positive().max(500).optional()
11980
+ });
11981
+ var UnsubscribeSchema2 = z31.object({
11982
+ type: z31.literal("unsubscribe")
11983
+ });
11984
+ var SubscriptionMessageSchema = z31.union([SubscribeSchema2, UnsubscribeSchema2]);
11795
11985
  function parseSubscriptionMessage(payload) {
11796
11986
  if (!payload || typeof payload !== "object") {
11797
11987
  return { ok: false, error: "Message must be a JSON object." };
@@ -11981,7 +12171,7 @@ function eventMatchesScope(event, filter) {
11981
12171
  }
11982
12172
 
11983
12173
  // src/routes/ws/logs.ts
11984
- import { z as z31 } from "zod";
12174
+ import { z as z32 } from "zod";
11985
12175
 
11986
12176
  // src/routes/ws/log-subscription-hub.ts
11987
12177
  import { BrokerCursorExpiredError as BrokerCursorExpiredError2 } from "@sixb/core/broker";
@@ -12294,26 +12484,26 @@ function socketBufferedAmount(ws) {
12294
12484
  }
12295
12485
 
12296
12486
  // 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),
12487
+ var SubscribeSchema3 = z32.object({
12488
+ type: z32.literal("subscribe"),
12489
+ kinds: z32.array(z32.enum(SIXB_RUN_KINDS)).min(1).optional(),
12490
+ levels: z32.array(z32.enum(LOG_LEVELS)).min(1).optional(),
12491
+ run: z32.object({
12492
+ kind: z32.enum(SIXB_RUN_KINDS),
12303
12493
  id: LogRunIdSchema
12304
12494
  }).optional(),
12305
- afterCursor: z31.string().optional()
12495
+ afterCursor: z32.string().optional()
12306
12496
  }).superRefine((value, context) => {
12307
12497
  if (value.run && value.kinds && !value.kinds.includes(value.run.kind)) {
12308
12498
  context.addIssue({
12309
- code: z31.ZodIssueCode.custom,
12499
+ code: z32.ZodIssueCode.custom,
12310
12500
  path: ["run"],
12311
12501
  message: "run.kind must be included in kinds"
12312
12502
  });
12313
12503
  }
12314
12504
  });
12315
- var UnsubscribeSchema3 = z31.object({ type: z31.literal("unsubscribe") });
12316
- var SubscriptionMessageSchema2 = z31.union([SubscribeSchema3, UnsubscribeSchema3]);
12505
+ var UnsubscribeSchema3 = z32.object({ type: z32.literal("unsubscribe") });
12506
+ var SubscriptionMessageSchema2 = z32.union([SubscribeSchema3, UnsubscribeSchema3]);
12317
12507
  function parseLogSubscriptionMessage(payload) {
12318
12508
  if (!payload || typeof payload !== "object") {
12319
12509
  return { ok: false, error: "Message must be a JSON object." };
@@ -12696,4 +12886,4 @@ export {
12696
12886
  SixbServer
12697
12887
  };
12698
12888
 
12699
- //# debugId=16E192D0EFF3C5F064756E2164756E21
12889
+ //# debugId=D4859E1909D00F4164756E2164756E21