@opengeni/contracts 0.32.0 → 0.35.0

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.
@@ -937,6 +937,7 @@ var revisionIdentityShape = {
937
937
  var WorkspaceInstructionPolicyRevisionIdentity = z2.object(revisionIdentityShape);
938
938
  var WorkspaceInstructionPolicyRevision = z2.object({
939
939
  ...revisionIdentityShape,
940
+ operationId: z2.string().uuid(),
940
941
  accountId: z2.string().uuid(),
941
942
  workspaceId: z2.string().uuid(),
942
943
  ...targetShape,
@@ -993,6 +994,7 @@ var ResolvedWorkspaceInstructionPolicySnapshot = WorkspaceInstructionPolicySnaps
993
994
  );
994
995
  var WorkspaceInstructionPolicyActivationEvent = z2.object({
995
996
  id: z2.string().uuid(),
997
+ operationId: z2.string().uuid(),
996
998
  accountId: z2.string().uuid(),
997
999
  workspaceId: z2.string().uuid(),
998
1000
  ...targetShape,
@@ -1005,6 +1007,7 @@ var WorkspaceInstructionPolicyActivationEvent = z2.object({
1005
1007
  createdAt: z2.string().datetime()
1006
1008
  });
1007
1009
  var CreateWorkspaceInstructionPolicyDraftRequest = z2.object({
1010
+ operationId: z2.string().uuid().optional(),
1008
1011
  kind: WorkspaceInstructionPolicyKind,
1009
1012
  scope: WorkspaceInstructionPolicyScope,
1010
1013
  roleKey: WorkspaceInstructionPolicyRoleKeyInput.nullable().default(null),
@@ -1014,6 +1017,7 @@ var CreateWorkspaceInstructionPolicyDraftRequest = z2.object({
1014
1017
  supersedesRevisionId: z2.string().uuid().nullable().default(null)
1015
1018
  }).superRefine(validateTarget);
1016
1019
  var ImportLegacyWorkspaceInstructionPolicyDraftRequest = z2.object({
1020
+ operationId: z2.string().uuid().optional(),
1017
1021
  supersedesRevisionId: z2.string().uuid().nullable().default(null)
1018
1022
  }).strict();
1019
1023
  var WorkspaceInstructionPolicyListQuery = z2.object({
@@ -1043,12 +1047,16 @@ var WorkspaceInstructionPolicyDiffResponse = z2.object({
1043
1047
  diff: z2.string()
1044
1048
  });
1045
1049
  var ActivateWorkspaceInstructionPolicyRequest = z2.object({
1050
+ operationId: z2.string().uuid().optional(),
1046
1051
  expectedCurrentRevisionId: z2.string().uuid().nullable(),
1052
+ expectedActivationVersion: z2.number().int().nonnegative().optional(),
1047
1053
  reason: z2.string().trim().min(1).max(WORKSPACE_INSTRUCTION_POLICY_REASON_MAX_CHARS)
1048
1054
  });
1049
1055
  var RollbackWorkspaceInstructionPolicyRequest = z2.object({
1056
+ operationId: z2.string().uuid().optional(),
1050
1057
  targetRevisionId: z2.string().uuid(),
1051
1058
  expectedCurrentRevisionId: z2.string().uuid(),
1059
+ expectedActivationVersion: z2.number().int().positive().optional(),
1052
1060
  reason: z2.string().trim().min(1).max(WORKSPACE_INSTRUCTION_POLICY_REASON_MAX_CHARS)
1053
1061
  });
1054
1062
  var WorkspaceInstructionPolicyActivationResponse = z2.object({
@@ -1060,6 +1068,10 @@ var WorkspaceInstructionPolicyConflictResponse = z2.object({
1060
1068
  message: z2.string(),
1061
1069
  currentHead: WorkspaceInstructionPolicyHead.nullable()
1062
1070
  });
1071
+ var WorkspaceInstructionPolicyOperationReuseResponse = z2.object({
1072
+ code: z2.literal("WORKSPACE_INSTRUCTION_POLICY_OPERATION_REUSED"),
1073
+ message: z2.string()
1074
+ });
1063
1075
 
1064
1076
  // src/artifacts.ts
1065
1077
  import { z as z3 } from "zod";
@@ -2422,6 +2434,7 @@ var WORKSPACE_STATE_BASE_NAME_MAX_CHARS = 160;
2422
2434
  var WORKSPACE_STATE_TOPIC_MAX_CHARS = 96;
2423
2435
  var WORKSPACE_STATE_MEMORY_SAMPLE_LIMIT = 100;
2424
2436
  var Count = z4.number().int().nonnegative();
2437
+ var WorkspaceStateQuery = z4.object({ attemptId: z4.string().uuid().optional() }).strict();
2425
2438
  var WorkspaceStateDocumentStatusCounts = z4.object({
2426
2439
  queued: Count,
2427
2440
  indexing: Count,
@@ -2548,6 +2561,75 @@ var WorkspaceStateKnowledge = z4.discriminatedUnion("availability", [
2548
2561
  WorkspaceStateKnowledgeAvailable,
2549
2562
  WorkspaceStateKnowledgeUnavailable
2550
2563
  ]);
2564
+ var WorkspaceStateGovernanceDriftStatus = z4.enum([
2565
+ "identical",
2566
+ "changed",
2567
+ "superseded",
2568
+ "missing",
2569
+ "unavailable",
2570
+ "truncated"
2571
+ ]);
2572
+ var WorkspaceStatePolicySnapshotAvailable = z4.object({
2573
+ status: z4.literal("available"),
2574
+ id: z4.string().uuid(),
2575
+ createdAt: z4.string().datetime(),
2576
+ entryHash: z4.string().regex(/^[0-9a-f]{64}$/),
2577
+ policyRole: WorkspaceInstructionPolicyRoleKey.nullable(),
2578
+ roleSource: WorkspaceInstructionPolicyRoleSource,
2579
+ entries: z4.array(WorkspaceInstructionPolicySnapshotEntry).max(3)
2580
+ }).strict();
2581
+ var WorkspaceStatePolicySnapshotMissing = z4.object({ status: z4.literal("missing") }).strict();
2582
+ var WorkspaceStatePreferenceSnapshotAvailable = z4.object({
2583
+ status: z4.literal("available"),
2584
+ id: z4.string().uuid(),
2585
+ createdAt: z4.string().datetime(),
2586
+ descriptorHash: z4.string().regex(/^[0-9a-f]{64}$/),
2587
+ descriptorCount: Count.max(64),
2588
+ truncated: z4.boolean()
2589
+ }).strict();
2590
+ var WorkspaceStatePreferenceSnapshotMissing = z4.object({ status: z4.literal("missing") }).strict();
2591
+ var WorkspaceStateGovernanceDrift = z4.object({
2592
+ overall: WorkspaceStateGovernanceDriftStatus,
2593
+ policy: z4.object({
2594
+ status: WorkspaceStateGovernanceDriftStatus,
2595
+ snapshotHash: z4.string().regex(/^[0-9a-f]{64}$/).nullable(),
2596
+ currentHash: z4.string().regex(/^[0-9a-f]{64}$/).nullable(),
2597
+ snapshotTargetCount: Count,
2598
+ currentTargetCount: Count
2599
+ }).strict(),
2600
+ preferences: z4.object({
2601
+ status: WorkspaceStateGovernanceDriftStatus,
2602
+ snapshotHash: z4.string().regex(/^[0-9a-f]{64}$/).nullable(),
2603
+ currentHash: z4.string().regex(/^[0-9a-f]{64}$/).nullable(),
2604
+ snapshotDescriptorCount: Count,
2605
+ currentDescriptorCount: Count,
2606
+ snapshotTruncated: z4.boolean(),
2607
+ currentTruncated: z4.boolean()
2608
+ }).strict()
2609
+ }).strict();
2610
+ var WorkspaceStateAttemptGovernance = z4.discriminatedUnion("status", [
2611
+ z4.object({ status: z4.literal("not_requested") }).strict(),
2612
+ z4.object({
2613
+ status: z4.literal("unavailable"),
2614
+ reason: z4.literal("attempt_not_found_or_not_authorized"),
2615
+ driftStatus: z4.literal("unavailable")
2616
+ }).strict(),
2617
+ z4.object({
2618
+ status: z4.literal("available"),
2619
+ attemptId: z4.string().uuid(),
2620
+ executionGeneration: z4.number().int().positive(),
2621
+ acceptedAt: z4.string().datetime(),
2622
+ policySnapshot: z4.discriminatedUnion("status", [
2623
+ WorkspaceStatePolicySnapshotAvailable,
2624
+ WorkspaceStatePolicySnapshotMissing
2625
+ ]),
2626
+ preferenceSnapshot: z4.discriminatedUnion("status", [
2627
+ WorkspaceStatePreferenceSnapshotAvailable,
2628
+ WorkspaceStatePreferenceSnapshotMissing
2629
+ ]),
2630
+ drift: WorkspaceStateGovernanceDrift
2631
+ }).strict()
2632
+ ]);
2551
2633
  var WorkspaceStateResponse = z4.object({
2552
2634
  workspaceId: z4.string().uuid(),
2553
2635
  generatedAt: z4.string().datetime(),
@@ -2556,10 +2638,7 @@ var WorkspaceStateResponse = z4.object({
2556
2638
  source: z4.literal("read_time_projection"),
2557
2639
  capturedAt: z4.string().datetime()
2558
2640
  }).strict(),
2559
- policySnapshot: z4.object({
2560
- status: z4.literal("not_captured"),
2561
- reason: z4.literal("workspace_instruction_policy_snapshot_not_implemented")
2562
- }).strict()
2641
+ attemptGovernance: WorkspaceStateAttemptGovernance
2563
2642
  }).strict(),
2564
2643
  policy: WorkspaceStatePolicy,
2565
2644
  knowledge: WorkspaceStateKnowledge
@@ -4624,6 +4703,7 @@ var FileResourceRef = z7.object({
4624
4703
  fileId: z7.string().uuid(),
4625
4704
  mountPath: z7.string().min(1).optional()
4626
4705
  });
4706
+ var MODEL_ATTACHMENT_REFS_FIELD = "opengeni_attachment_refs";
4627
4707
  var ResourceRef = z7.discriminatedUnion("kind", [RepositoryResourceRef, FileResourceRef]);
4628
4708
  var ResourceMountPathError = class extends Error {
4629
4709
  constructor(message) {
@@ -4670,9 +4750,10 @@ function defaultRepositoryMountPath(uri) {
4670
4750
  `repos/${encodeURIComponent(url.host.toLowerCase())}/${segments.join("/")}`
4671
4751
  );
4672
4752
  }
4753
+ var DEFAULT_FILE_RESOURCE_MOUNT_ROOT = ".opengeni/files";
4673
4754
  function resourceMountPath(resource) {
4674
4755
  if (resource.mountPath) return normalizeResourceMountPath(resource.mountPath);
4675
- return resource.kind === "file" ? normalizeResourceMountPath(`files/${resource.fileId}`) : defaultRepositoryMountPath(resource.uri);
4756
+ return resource.kind === "file" ? normalizeResourceMountPath(`${DEFAULT_FILE_RESOURCE_MOUNT_ROOT}/${resource.fileId}`) : defaultRepositoryMountPath(resource.uri);
4676
4757
  }
4677
4758
  function assertUniqueResourceMountPaths(resources) {
4678
4759
  const mounted = /* @__PURE__ */ new Set();
@@ -4740,6 +4821,7 @@ var KnowledgeSourceKind = z7.enum([
4740
4821
  "other"
4741
4822
  ]);
4742
4823
  var DocumentSearchMode = z7.enum(["hybrid", "vector", "keyword"]);
4824
+ var DocumentAuthorityKind = z7.enum(["organization", "workspace", "personal"]);
4743
4825
  var DocumentVisibility = z7.enum(["workspace", "private"]);
4744
4826
  var DocumentCurationStatus = z7.enum([
4745
4827
  "none",
@@ -4783,6 +4865,9 @@ var Document = z7.object({
4783
4865
  sourceUpdatedAt: z7.string().nullable(),
4784
4866
  sourceVersion: z7.string().nullable(),
4785
4867
  aclTags: z7.array(z7.string()),
4868
+ authorityKind: DocumentAuthorityKind,
4869
+ authorityWorkspaceId: z7.string().uuid().nullable(),
4870
+ authoritySubjectId: z7.string().nullable(),
4786
4871
  visibility: DocumentVisibility,
4787
4872
  createdBy: z7.string().nullable(),
4788
4873
  agentAccess: z7.boolean(),
@@ -4795,6 +4880,9 @@ var Document = z7.object({
4795
4880
  });
4796
4881
  var DocumentSearchResult = z7.object({
4797
4882
  chunkId: z7.string().uuid(),
4883
+ // The workspace that ingested the document. Organization-authority results
4884
+ // may originate in another workspace in the same account; this identifier
4885
+ // is provenance and does not grant access to that workspace or its resources.
4798
4886
  workspaceId: z7.string().uuid(),
4799
4887
  documentId: z7.string().uuid(),
4800
4888
  baseId: z7.string().uuid(),
@@ -4815,7 +4903,13 @@ var DocumentSearchResult = z7.object({
4815
4903
  sourceCreatedAt: z7.string().nullable(),
4816
4904
  sourceUpdatedAt: z7.string().nullable(),
4817
4905
  sourceVersion: z7.string().nullable(),
4818
- aclTags: z7.array(z7.string())
4906
+ aclTags: z7.array(z7.string()),
4907
+ authorityKind: DocumentAuthorityKind,
4908
+ authorityWorkspaceId: z7.string().uuid().nullable(),
4909
+ authoritySubjectId: z7.string().nullable()
4910
+ });
4911
+ var DocumentSearchResponse = z7.object({
4912
+ results: z7.array(DocumentSearchResult)
4819
4913
  });
4820
4914
  var CreateDocumentBaseRequest = z7.object({
4821
4915
  name: z7.string().min(1),
@@ -4833,6 +4927,7 @@ var AddDocumentRequest = z7.object({
4833
4927
  sourceUpdatedAt: z7.string().datetime({ offset: true }).optional(),
4834
4928
  sourceVersion: z7.string().min(1).optional(),
4835
4929
  aclTags: z7.array(z7.string().min(1)).optional(),
4930
+ authorityKind: DocumentAuthorityKind.optional(),
4836
4931
  visibility: DocumentVisibility.optional(),
4837
4932
  agentAccess: z7.boolean().optional()
4838
4933
  });
@@ -4841,6 +4936,7 @@ var CreateKnowledgeDropRequest = z7.object({
4841
4936
  fileId: z7.string().uuid().optional(),
4842
4937
  filename: z7.string().min(1).optional(),
4843
4938
  title: z7.string().min(1).optional(),
4939
+ authorityKind: DocumentAuthorityKind.optional(),
4844
4940
  visibility: DocumentVisibility.optional(),
4845
4941
  agentAccess: z7.boolean().optional()
4846
4942
  }).refine((value) => value.text === void 0 !== (value.fileId === void 0), {
@@ -8717,9 +8813,9 @@ var HumanInputQuestion = z7.object({
8717
8813
  options: z7.array(HumanInputOption).max(20).default([]),
8718
8814
  required: z7.boolean().default(true),
8719
8815
  allowOther: z7.boolean().default(false),
8816
+ // Selection bounds only — agents invent useless text char mins/maxes.
8817
+ // Answer strings stay platform-capped on HumanInputAnswer (~8192).
8720
8818
  validation: z7.object({
8721
- minLength: z7.number().int().nonnegative().max(8192).nullable().optional(),
8722
- maxLength: z7.number().int().positive().max(8192).nullable().optional(),
8723
8819
  minSelections: z7.number().int().nonnegative().max(20).nullable().optional(),
8724
8820
  maxSelections: z7.number().int().positive().max(20).nullable().optional()
8725
8821
  }).nullable().optional()
@@ -8755,13 +8851,6 @@ var HumanInputQuestion = z7.object({
8755
8851
  });
8756
8852
  }
8757
8853
  const validation = question.validation;
8758
- if (validation?.minLength != null && validation?.maxLength != null && validation.minLength > validation.maxLength) {
8759
- ctx.addIssue({
8760
- code: "custom",
8761
- path: ["validation"],
8762
- message: "minLength exceeds maxLength"
8763
- });
8764
- }
8765
8854
  if (validation?.minSelections != null && validation?.maxSelections != null && validation.minSelections > validation.maxSelections) {
8766
8855
  ctx.addIssue({
8767
8856
  code: "custom",
@@ -9355,6 +9444,7 @@ var ModelCapabilitiesV1 = /* @__PURE__ */ defineModelContractSchema(
9355
9444
  codeExecution: ModelCapabilityStateV1
9356
9445
  }),
9357
9446
  inputModalities: z7.array(z7.enum(["text", "image", "audio"])),
9447
+ inputFileMediaTypes: z7.array(z7.string()).optional(),
9358
9448
  outputModalities: z7.array(z7.enum(["text", "image", "audio"])),
9359
9449
  transports: z7.object({
9360
9450
  sse: ModelCapabilityStateV1,
@@ -9771,6 +9861,7 @@ export {
9771
9861
  RollbackWorkspaceInstructionPolicyRequest,
9772
9862
  WorkspaceInstructionPolicyActivationResponse,
9773
9863
  WorkspaceInstructionPolicyConflictResponse,
9864
+ WorkspaceInstructionPolicyOperationReuseResponse,
9774
9865
  WORKSPACE_ARTIFACT_HTML_MAX_UTF8_BYTES,
9775
9866
  WORKSPACE_ARTIFACT_TITLE_MAX_CHARS,
9776
9867
  WORKSPACE_ARTIFACT_DESCRIPTION_MAX_CHARS,
@@ -9826,6 +9917,7 @@ export {
9826
9917
  WORKSPACE_STATE_BASE_NAME_MAX_CHARS,
9827
9918
  WORKSPACE_STATE_TOPIC_MAX_CHARS,
9828
9919
  WORKSPACE_STATE_MEMORY_SAMPLE_LIMIT,
9920
+ WorkspaceStateQuery,
9829
9921
  WorkspaceStateDocumentStatusCounts,
9830
9922
  WorkspaceStateSourceKindCounts,
9831
9923
  WorkspaceStateMemoryStatusCounts,
@@ -9840,6 +9932,8 @@ export {
9840
9932
  WorkspaceStateKnowledgeAvailable,
9841
9933
  WorkspaceStateKnowledgeUnavailable,
9842
9934
  WorkspaceStateKnowledge,
9935
+ WorkspaceStateGovernanceDriftStatus,
9936
+ WorkspaceStateAttemptGovernance,
9843
9937
  WorkspaceStateResponse,
9844
9938
  PREFERENCE_REGISTRY_CONTENT_MAX_CHARS,
9845
9939
  PREFERENCE_REGISTRY_DESCRIPTOR_DESCRIPTION_MAX_CHARS,
@@ -10021,12 +10115,14 @@ export {
10021
10115
  gitCredentialProviderForRepository,
10022
10116
  gitCredentialBindingIdForRepository,
10023
10117
  FileResourceRef,
10118
+ MODEL_ATTACHMENT_REFS_FIELD,
10024
10119
  ResourceRef,
10025
10120
  ResourceMountPathError,
10026
10121
  normalizeResourceMountPath,
10027
10122
  normalizeRepositorySubpath,
10028
10123
  resourceMountPathCollisionKey,
10029
10124
  defaultRepositoryMountPath,
10125
+ DEFAULT_FILE_RESOURCE_MOUNT_ROOT,
10030
10126
  resourceMountPath,
10031
10127
  assertUniqueResourceMountPaths,
10032
10128
  FileStatus,
@@ -10039,12 +10135,14 @@ export {
10039
10135
  DocumentStatus,
10040
10136
  KnowledgeSourceKind,
10041
10137
  DocumentSearchMode,
10138
+ DocumentAuthorityKind,
10042
10139
  DocumentVisibility,
10043
10140
  DocumentCurationStatus,
10044
10141
  DocumentCuration,
10045
10142
  DocumentBase,
10046
10143
  Document,
10047
10144
  DocumentSearchResult,
10145
+ DocumentSearchResponse,
10048
10146
  CreateDocumentBaseRequest,
10049
10147
  AddDocumentRequest,
10050
10148
  CreateKnowledgeDropRequest,
@@ -10460,4 +10558,4 @@ export {
10460
10558
  ClientConfig,
10461
10559
  evaluateWorkspaceModelPolicy
10462
10560
  };
10463
- //# sourceMappingURL=chunk-GMOYIHF3.js.map
10561
+ //# sourceMappingURL=chunk-JRHJTJVH.js.map