@work-shape/catalyst-api-contract 0.8.0-rc.10 → 0.8.0-rc.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -823,7 +823,7 @@ import { z as z49 } from "zod";
823
823
  // package.json
824
824
  var package_default = {
825
825
  name: "@work-shape/catalyst-api-contract",
826
- version: "0.8.0-rc.10",
826
+ version: "0.8.0-rc.11",
827
827
  license: "MIT",
828
828
  repository: {
829
829
  type: "git",
@@ -887,7 +887,7 @@ var appErrorCodeSchema = z7.enum(APP_ERROR_CODES);
887
887
  var API_ERROR_MEANINGS = {
888
888
  BAD_REQUEST: "The request cannot be read.",
889
889
  UNAUTHENTICATED: "No credential was presented, or the credential is not valid.",
890
- FORBIDDEN: "The caller lacks the scope or the right this operation requires.",
890
+ FORBIDDEN: "The caller lacks the scope or the right this operation requires. `details.reason` is `two_factor_setup_required` where the instance requires two-factor sign-in and the person signed in with a password, or the owner of the personal key, has not set it up: every operation but `me.get` is refused until they have.",
891
891
  NOT_FOUND: "The resource does not exist, is not visible to the caller, or the instance runs without this operation.",
892
892
  CONFLICT: "The request conflicts with the current state of the resource.",
893
893
  REVISION_CONFLICT: "An asset the call writes is at another revision than the one the call names, or the name it creates is taken or was deleted. Nothing was written. `details.conflicts` names each such asset, with its current revision and who changed it when for an asset the caller may read.",
@@ -923,6 +923,7 @@ var unknownOperationSchema = z7.object({
923
923
  })
924
924
  });
925
925
  var BODY_TOO_LARGE_REASON = "body_too_large";
926
+ var TWO_FACTOR_SETUP_REQUIRED_REASON = "two_factor_setup_required";
926
927
  var INVALID_JSON_BODY_REASON = "invalid_json_body";
927
928
  function isUnknownOperationResponse(payload) {
928
929
  return unknownOperationSchema.safeParse(payload).success;
@@ -1566,7 +1567,12 @@ var apiUserSchema = z12.object({
1566
1567
  principal: authPrincipalSchema.optional(),
1567
1568
  subjectUserId: z12.string().optional(),
1568
1569
  delegatedActor: delegatedActorSchema.optional(),
1569
- scopes: z12.array(authScopeSchema).optional()
1570
+ scopes: z12.array(authScopeSchema).optional(),
1571
+ /**
1572
+ * Two-factor sign-in of a person signed in with a password (TWO-FACTOR-1): whether the instance
1573
+ * requires it and whether the person has set it up. Left out for every other way in.
1574
+ */
1575
+ twoFactor: z12.object({ required: z12.boolean(), enrolled: z12.boolean() }).optional()
1570
1576
  });
1571
1577
  var issueSessionTokenRequestSchema = z12.object({
1572
1578
  externalUserId: z12.string().min(1),
@@ -1614,7 +1620,9 @@ var administeredUserSchema = z12.object({
1614
1620
  createdAt: timestampSchema,
1615
1621
  updatedAt: timestampSchema,
1616
1622
  lastAuthenticatedAt: timestampSchema.optional(),
1617
- identities: z12.array(administeredUserIdentitySchema)
1623
+ identities: z12.array(administeredUserIdentitySchema),
1624
+ /** Whether the user's password sign-in has a second factor. Left out without a password sign-in. */
1625
+ twoFactorEnabled: z12.boolean().optional()
1618
1626
  });
1619
1627
  var administeredUserPasswordSignInRequestSchema = z12.object({
1620
1628
  password: z12.string().min(8)
@@ -1668,6 +1676,10 @@ var resetAdministeredUserPasswordRequestSchema = z12.object({
1668
1676
  var resetAdministeredUserPasswordResponseSchema = z12.object({
1669
1677
  ok: z12.literal(true)
1670
1678
  });
1679
+ var resetAdministeredUserTwoFactorResponseSchema = z12.object({
1680
+ ok: z12.literal(true),
1681
+ hadFactor: z12.boolean()
1682
+ });
1671
1683
  var requestPasswordResetRequestSchema = z12.object({
1672
1684
  email: z12.string().email()
1673
1685
  });
@@ -2055,7 +2067,9 @@ var configAssetReferencesSchema = z13.object({
2055
2067
  id: z13.string(),
2056
2068
  model: z13.string(),
2057
2069
  /** The name people read, when release config gives one. */
2058
- label: z13.string().optional()
2070
+ label: z13.string().optional(),
2071
+ /** The binding that answers when this one is overloaded or down, where it names one. */
2072
+ fallback: z13.string().optional()
2059
2073
  })
2060
2074
  ),
2061
2075
  fastModeModelBindingIds: z13.array(z13.string()),
@@ -3020,6 +3034,7 @@ import {
3020
3034
  DECIDED_APPROVAL_REQUEST_STATUSES,
3021
3035
  ENDED_APPROVAL_EXECUTIONS,
3022
3036
  MESSAGE_FINISH_STATUSES,
3037
+ MODEL_FALLBACK_REASONS,
3023
3038
  MODEL_USAGE_LIMIT_PERIODS as MODEL_USAGE_LIMIT_PERIODS2,
3024
3039
  MODEL_USAGE_LIMIT_METRICS,
3025
3040
  MODEL_USAGE_LIMIT_SCOPES,
@@ -3066,6 +3081,16 @@ var storedModelContextSnapshotSchema = z18.object({
3066
3081
  compactThresholdTokens: z18.number(),
3067
3082
  compacted: z18.boolean()
3068
3083
  });
3084
+ var storedModelFallbackBindingSchema = z18.object({
3085
+ bindingId: z18.string(),
3086
+ model: z18.string(),
3087
+ label: z18.string().optional()
3088
+ });
3089
+ var storedModelFallbackSchema = z18.object({
3090
+ from: storedModelFallbackBindingSchema,
3091
+ to: storedModelFallbackBindingSchema,
3092
+ reason: z18.enum(MODEL_FALLBACK_REASONS)
3093
+ });
3069
3094
  var storedToolCallSchema = z18.object({
3070
3095
  toolCallId: z18.string(),
3071
3096
  toolName: z18.string(),
@@ -3136,7 +3161,9 @@ var assistantFinalMessageMetadataSchema = z18.object({
3136
3161
  sources: z18.array(webSourceSchema).optional(),
3137
3162
  knowledgeSources: z18.array(knowledgeCitationSourceSchema).optional(),
3138
3163
  citations: z18.array(messageCitationSchema).optional(),
3139
- modelContext: storedModelContextSnapshotSchema.optional()
3164
+ modelContext: storedModelContextSnapshotSchema.optional(),
3165
+ /** The run switched to its binding's fallback, which wrote this answer. */
3166
+ modelFallback: storedModelFallbackSchema.optional()
3140
3167
  });
3141
3168
  var toolResultMessageMetadataSchema = z18.object({
3142
3169
  version: messageMetadataVersionSchema,
@@ -5977,6 +6004,20 @@ var connectionTestResultSchema = z28.object({
5977
6004
  status: z28.enum(CONNECTOR_TEST_STATUSES),
5978
6005
  testedAt: timestampSchema
5979
6006
  });
6007
+ var sourceFolderSchema = z28.object({
6008
+ id: z28.string().min(1).max(500),
6009
+ name: z28.string().min(1).max(1e3)
6010
+ });
6011
+ var connectionSourceFoldersQuerySchema = z28.object({
6012
+ parent: z28.string().min(1).max(500).optional(),
6013
+ pageToken: z28.string().min(1).max(4e3).optional()
6014
+ });
6015
+ var connectionSourceFoldersSchema = z28.object({
6016
+ /** The folder listed, with its path from the top; `/` for the top. */
6017
+ folder: sourceFolderSchema.extend({ path: z28.string().min(1).max(4e3) }),
6018
+ folders: z28.array(sourceFolderSchema),
6019
+ nextPageToken: z28.string().min(1).max(4e3).optional()
6020
+ });
5980
6021
  var connectionToolSchema = z28.object({
5981
6022
  toolName: z28.string(),
5982
6023
  operation: z28.string(),
@@ -6352,6 +6393,21 @@ var connectionOperations = {
6352
6393
  errors: ["NOT_FOUND", "CONFLICT"],
6353
6394
  rateClass: "write"
6354
6395
  }),
6396
+ "connections.source_folders": defineRegisteredOperation({
6397
+ id: "connections.source_folders",
6398
+ method: "GET",
6399
+ path: "/api/v1/connections/:name/source-folders",
6400
+ summary: "List the folders inside one folder of a document source, to choose a Knowledge Base's folders",
6401
+ tag: "Connections",
6402
+ auth: "principal",
6403
+ scope: "config_assets:read",
6404
+ requires: [],
6405
+ effect: "reading",
6406
+ query: connectionSourceFoldersQuerySchema,
6407
+ response: json(connectionSourceFoldersSchema),
6408
+ errors: ["NOT_FOUND", "CONFLICT", "TIMEOUT"],
6409
+ rateClass: "read"
6410
+ }),
6355
6411
  // A path of its own: `agent-tools` would be a valid Connection name under `/connections/`.
6356
6412
  "connections.connector_types": defineRegisteredOperation({
6357
6413
  id: "connections.connector_types",
@@ -9560,6 +9616,20 @@ var userOperations = {
9560
9616
  errors: ["NOT_FOUND"],
9561
9617
  rateClass: "write"
9562
9618
  }),
9619
+ "users.two_factor.reset": defineRegisteredOperation({
9620
+ id: "users.two_factor.reset",
9621
+ method: "POST",
9622
+ path: "/api/v1/instance/users/:userId/two-factor/reset",
9623
+ summary: "Reset a user's two-factor sign-in: delete their second factor and trusted browsers and end their sessions. Needs the right `users.manage`. Only a superadmin resets a superadmin; nobody resets their own.",
9624
+ tag: "Users",
9625
+ auth: "user",
9626
+ scope: "user_admin:write",
9627
+ requires: [],
9628
+ effect: "changing",
9629
+ response: json(resetAdministeredUserTwoFactorResponseSchema),
9630
+ errors: ["NOT_FOUND"],
9631
+ rateClass: "write"
9632
+ }),
9563
9633
  "users.invitation.send": defineRegisteredOperation({
9564
9634
  id: "users.invitation.send",
9565
9635
  method: "POST",
@@ -10214,6 +10284,7 @@ __export(schemas_exports, {
10214
10284
  MAX_LIST_LIMIT: () => MAX_LIST_LIMIT,
10215
10285
  REFUSAL_REASONS: () => REFUSAL_REASONS,
10216
10286
  ROLE_GRANTS_MAX: () => ROLE_GRANTS_MAX,
10287
+ TWO_FACTOR_SETUP_REQUIRED_REASON: () => TWO_FACTOR_SETUP_REQUIRED_REASON,
10217
10288
  UNKNOWN_OPERATION_REASON: () => UNKNOWN_OPERATION_REASON,
10218
10289
  USAGE_BREAKDOWN_MAX_DAYS: () => USAGE_BREAKDOWN_MAX_DAYS,
10219
10290
  VIEW_RUNTIME: () => VIEW_RUNTIME,
@@ -10482,6 +10553,7 @@ __export(schemas_exports, {
10482
10553
  requestPasswordResetResponseSchema: () => requestPasswordResetResponseSchema,
10483
10554
  resetAdministeredUserPasswordRequestSchema: () => resetAdministeredUserPasswordRequestSchema,
10484
10555
  resetAdministeredUserPasswordResponseSchema: () => resetAdministeredUserPasswordResponseSchema,
10556
+ resetAdministeredUserTwoFactorResponseSchema: () => resetAdministeredUserTwoFactorResponseSchema,
10485
10557
  revertAssetRequestSchema: () => revertAssetRequestSchema,
10486
10558
  roleGrantSchema: () => roleGrantSchema,
10487
10559
  rolePendingActionSchema: () => rolePendingActionSchema,
@@ -10514,6 +10586,7 @@ __export(schemas_exports, {
10514
10586
  startConversationRunRequestSchema: () => startConversationRunRequestSchema,
10515
10587
  startConversationRunResponseSchema: () => startConversationRunResponseSchema,
10516
10588
  storedModelContextSnapshotSchema: () => storedModelContextSnapshotSchema,
10589
+ storedModelFallbackSchema: () => storedModelFallbackSchema,
10517
10590
  storedReasoningSummarySchema: () => storedReasoningSummarySchema,
10518
10591
  storedToolCallSchema: () => storedToolCallSchema,
10519
10592
  structuredDataResourceResponseSchema: () => structuredDataResourceResponseSchema,
@@ -11309,6 +11382,7 @@ export {
11309
11382
  REFUSAL_REASONS,
11310
11383
  RELEASE_VERSION,
11311
11384
  ROLE_GRANTS_MAX,
11385
+ TWO_FACTOR_SETUP_REQUIRED_REASON,
11312
11386
  UNKNOWN_OPERATION_REASON,
11313
11387
  USAGE_BREAKDOWN_MAX_DAYS,
11314
11388
  VIEW_RUNTIME,
@@ -11462,6 +11536,8 @@ export {
11462
11536
  connectionPeopleSchema,
11463
11537
  connectionPersonContextSchema,
11464
11538
  connectionSecretStateSchema,
11539
+ connectionSourceFoldersQuerySchema,
11540
+ connectionSourceFoldersSchema,
11465
11541
  connectionTestResultSchema,
11466
11542
  connectionToolSchema,
11467
11543
  connectionToolsSchema,
@@ -11637,6 +11713,7 @@ export {
11637
11713
  requestPasswordResetResponseSchema,
11638
11714
  resetAdministeredUserPasswordRequestSchema,
11639
11715
  resetAdministeredUserPasswordResponseSchema,
11716
+ resetAdministeredUserTwoFactorResponseSchema,
11640
11717
  revertAssetRequestSchema,
11641
11718
  roleGrantSchema,
11642
11719
  rolePendingActionSchema,
@@ -11677,6 +11754,7 @@ export {
11677
11754
  startConversationRunResponseSchema,
11678
11755
  startWorkflowRunRequestSchema,
11679
11756
  storedModelContextSnapshotSchema,
11757
+ storedModelFallbackSchema,
11680
11758
  storedReasoningSummarySchema,
11681
11759
  storedToolCallSchema,
11682
11760
  structuredDataResourceResponseSchema,