@opengeni/sdk 6.1.0 → 7.0.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.
- package/README.md +84 -45
- package/dist/artifacts.js +4 -4
- package/dist/browser.d.ts +2 -0
- package/dist/browser.js +2 -2
- package/dist/chat/index.js +5 -5
- package/dist/{chunk-64S3VKJU.js → chunk-7ESHQLTB.js} +130 -83
- package/dist/chunk-7ESHQLTB.js.map +1 -0
- package/dist/{chunk-IZH5F7QC.js → chunk-L3MYVTPO.js} +10 -2
- package/dist/chunk-L3MYVTPO.js.map +1 -0
- package/dist/{chunk-CFSYTYMA.js → chunk-MXQX4M36.js} +2 -2
- package/dist/{chunk-VDACQXJZ.js → chunk-N76DIO4E.js} +8 -87
- package/dist/chunk-N76DIO4E.js.map +1 -0
- package/dist/{chunk-CMEU67C4.js → chunk-P7OFNKCH.js} +2 -2
- package/dist/chunk-P7OFNKCH.js.map +1 -0
- package/dist/{chunk-4ZQQQBOH.js → chunk-RCVWE6UR.js} +2 -2
- package/dist/client.d.ts +47 -21
- package/dist/core.js +3 -3
- package/dist/document-authority-client.d.ts +3 -1
- package/dist/document-authority.js +3 -3
- package/dist/editable-artifacts.js +13 -2
- package/dist/editable-artifacts.js.map +1 -1
- package/dist/embedding-client.d.ts +3 -21
- package/dist/index.d.ts +3 -1
- package/dist/index.js +6 -6
- package/dist/knowledge.d.ts +5 -3
- package/dist/knowledge.js +12 -3
- package/dist/knowledge.js.map +1 -1
- package/dist/organization-integration-policy.d.ts +26 -0
- package/dist/organization-integration-policy.js +26 -0
- package/dist/organization-integration-policy.js.map +1 -0
- package/dist/session-message-search.d.ts +41 -0
- package/dist/site-browser-runtime.gen.d.ts +1 -1
- package/dist/site-document.js +1 -1
- package/dist/site-document.js.map +1 -1
- package/dist/site.js +3 -3
- package/dist/skills.d.ts +3 -0
- package/dist/types.d.ts +168 -380
- package/package.json +7 -3
- package/src/browser.ts +12 -0
- package/src/client.ts +206 -136
- package/src/document-authority-client.ts +15 -0
- package/src/editable-artifacts/controller.ts +25 -1
- package/src/embedding-client.ts +10 -134
- package/src/index.ts +25 -34
- package/src/knowledge.ts +22 -1
- package/src/organization-integration-policy.ts +54 -0
- package/src/session-message-search.ts +39 -0
- package/src/site-browser-runtime.gen.ts +1 -1
- package/src/skills.ts +3 -0
- package/src/types.ts +176 -432
- package/dist/chunk-64S3VKJU.js.map +0 -1
- package/dist/chunk-CMEU67C4.js.map +0 -1
- package/dist/chunk-IZH5F7QC.js.map +0 -1
- package/dist/chunk-VDACQXJZ.js.map +0 -1
- /package/dist/{chunk-CFSYTYMA.js.map → chunk-MXQX4M36.js.map} +0 -0
- /package/dist/{chunk-4ZQQQBOH.js.map → chunk-RCVWE6UR.js.map} +0 -0
package/src/embedding-client.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OpenGeniClient as OpenGeniArtifactClient } from "./artifact-client";
|
|
2
|
-
import type { OpenGeniClientOptions
|
|
2
|
+
import type { OpenGeniClientOptions } from "./client";
|
|
3
3
|
import type { AddWorkspaceMemberRequest } from "./types";
|
|
4
4
|
import type {
|
|
5
5
|
ExternalIdentityLink,
|
|
@@ -12,52 +12,17 @@ import type {
|
|
|
12
12
|
|
|
13
13
|
/** Public product embedding administration, kept out of the native browser client. */
|
|
14
14
|
export class OpenGeniEmbeddingClient extends OpenGeniArtifactClient {
|
|
15
|
-
/**
|
|
16
|
-
*
|
|
17
|
-
async
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
): Promise<import("@opengeni/contracts/host-mcp-resolvers").HostMcpResolver> {
|
|
23
|
-
return this.requestJson(
|
|
24
|
-
"PUT",
|
|
25
|
-
`/v1/organizations/${organizationId}/mcp-credential-resolvers/${encodeURIComponent(externalSource)}`,
|
|
26
|
-
request,
|
|
27
|
-
{},
|
|
28
|
-
options,
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
async getHostMcpResolver(
|
|
33
|
-
organizationId: string,
|
|
34
|
-
externalSource: string,
|
|
35
|
-
options?: OpenGeniRequestOptions,
|
|
36
|
-
): Promise<import("@opengeni/contracts/host-mcp-resolvers").HostMcpResolver> {
|
|
37
|
-
return this.requestJson(
|
|
15
|
+
/** Recover this actor's connection creation result without resending secrets.
|
|
16
|
+
* A 404 means no visible committed result, not proof that an in-flight write failed. */
|
|
17
|
+
async getConnectionCreationResult(
|
|
18
|
+
workspaceId: string,
|
|
19
|
+
operationId: string,
|
|
20
|
+
): Promise<import("./types").ConnectionMetadata> {
|
|
21
|
+
const response = await this.requestJson<import("./types").ConnectionResponse>(
|
|
38
22
|
"GET",
|
|
39
|
-
`/v1/
|
|
40
|
-
undefined,
|
|
41
|
-
{},
|
|
42
|
-
options,
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/** Retains registration identity and namespace opt-in. Replays never restore
|
|
47
|
-
* a previous endpoint/secret. Use put with the current generation to reactivate. */
|
|
48
|
-
async revokeHostMcpResolver(
|
|
49
|
-
organizationId: string,
|
|
50
|
-
externalSource: string,
|
|
51
|
-
request: import("@opengeni/contracts/host-mcp-resolvers").RevokeHostMcpResolverRequest,
|
|
52
|
-
options?: OpenGeniRequestOptions,
|
|
53
|
-
): Promise<import("@opengeni/contracts/host-mcp-resolvers").HostMcpResolver> {
|
|
54
|
-
return this.requestJson(
|
|
55
|
-
"POST",
|
|
56
|
-
`/v1/organizations/${organizationId}/mcp-credential-resolvers/${encodeURIComponent(externalSource)}/revoke`,
|
|
57
|
-
request,
|
|
58
|
-
{},
|
|
59
|
-
options,
|
|
23
|
+
`/v1/workspaces/${encodeURIComponent(workspaceId)}/connections/operations/${encodeURIComponent(operationId)}`,
|
|
60
24
|
);
|
|
25
|
+
return response.connection;
|
|
61
26
|
}
|
|
62
27
|
|
|
63
28
|
/** Rotate existing inline credentials only while no credential-consuming work
|
|
@@ -247,95 +212,6 @@ export class OpenGeniEmbeddingClient extends OpenGeniArtifactClient {
|
|
|
247
212
|
return this.requestJson("GET", `/v1/workspaces/${workspaceId}/connect/catalog`);
|
|
248
213
|
}
|
|
249
214
|
|
|
250
|
-
/** Register credential-free, external-owner host authority. Does not itself
|
|
251
|
-
* authorize an execution or install MCP tools. */
|
|
252
|
-
async createHostMcpBinding(
|
|
253
|
-
workspaceId: string,
|
|
254
|
-
request: import("@opengeni/contracts/host-mcp-bindings").CreateHostMcpBindingRequest,
|
|
255
|
-
options: OpenGeniRequestOptions = {},
|
|
256
|
-
): Promise<import("@opengeni/contracts/host-mcp-bindings").HostMcpBinding> {
|
|
257
|
-
return this.requestJson(
|
|
258
|
-
"POST",
|
|
259
|
-
`/v1/workspaces/${encodeURIComponent(workspaceId)}/host-mcp-bindings`,
|
|
260
|
-
request,
|
|
261
|
-
{},
|
|
262
|
-
options,
|
|
263
|
-
);
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
async getHostMcpBinding(
|
|
267
|
-
workspaceId: string,
|
|
268
|
-
bindingId: string,
|
|
269
|
-
options: OpenGeniRequestOptions = {},
|
|
270
|
-
): Promise<import("@opengeni/contracts/host-mcp-bindings").HostMcpBinding> {
|
|
271
|
-
return this.requestJson(
|
|
272
|
-
"GET",
|
|
273
|
-
`/v1/workspaces/${encodeURIComponent(workspaceId)}/host-mcp-bindings/${encodeURIComponent(bindingId)}`,
|
|
274
|
-
undefined,
|
|
275
|
-
{},
|
|
276
|
-
options,
|
|
277
|
-
);
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
async revokeHostMcpBinding(
|
|
281
|
-
workspaceId: string,
|
|
282
|
-
bindingId: string,
|
|
283
|
-
request: { expectedGeneration: number },
|
|
284
|
-
options: OpenGeniRequestOptions = {},
|
|
285
|
-
): Promise<import("@opengeni/contracts/host-mcp-bindings").HostMcpBinding> {
|
|
286
|
-
return this.requestJson(
|
|
287
|
-
"POST",
|
|
288
|
-
`/v1/workspaces/${encodeURIComponent(workspaceId)}/host-mcp-bindings/${encodeURIComponent(bindingId)}/revoke`,
|
|
289
|
-
request,
|
|
290
|
-
{},
|
|
291
|
-
options,
|
|
292
|
-
);
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
/** Issue owner-scoped grant metadata; accepted execution must separately admit it. */
|
|
296
|
-
async issueHostMcpDelegation(
|
|
297
|
-
workspaceId: string,
|
|
298
|
-
request: import("@opengeni/contracts/host-mcp-bindings").IssueHostMcpDelegationRequest,
|
|
299
|
-
options: OpenGeniRequestOptions = {},
|
|
300
|
-
): Promise<import("@opengeni/contracts/host-mcp-bindings").HostMcpDelegation> {
|
|
301
|
-
return this.requestJson(
|
|
302
|
-
"POST",
|
|
303
|
-
`/v1/workspaces/${encodeURIComponent(workspaceId)}/host-mcp-delegations`,
|
|
304
|
-
request,
|
|
305
|
-
{},
|
|
306
|
-
options,
|
|
307
|
-
);
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
async getHostMcpDelegation(
|
|
311
|
-
workspaceId: string,
|
|
312
|
-
delegationId: string,
|
|
313
|
-
options: OpenGeniRequestOptions = {},
|
|
314
|
-
): Promise<import("@opengeni/contracts/host-mcp-bindings").HostMcpDelegation> {
|
|
315
|
-
return this.requestJson(
|
|
316
|
-
"GET",
|
|
317
|
-
`/v1/workspaces/${encodeURIComponent(workspaceId)}/host-mcp-delegations/${encodeURIComponent(delegationId)}`,
|
|
318
|
-
undefined,
|
|
319
|
-
{},
|
|
320
|
-
options,
|
|
321
|
-
);
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
async revokeHostMcpDelegation(
|
|
325
|
-
workspaceId: string,
|
|
326
|
-
delegationId: string,
|
|
327
|
-
request: { expectedGeneration: number },
|
|
328
|
-
options: OpenGeniRequestOptions = {},
|
|
329
|
-
): Promise<import("@opengeni/contracts/host-mcp-bindings").HostMcpDelegation> {
|
|
330
|
-
return this.requestJson(
|
|
331
|
-
"POST",
|
|
332
|
-
`/v1/workspaces/${encodeURIComponent(workspaceId)}/host-mcp-delegations/${encodeURIComponent(delegationId)}/revoke`,
|
|
333
|
-
request,
|
|
334
|
-
{},
|
|
335
|
-
options,
|
|
336
|
-
);
|
|
337
|
-
}
|
|
338
|
-
|
|
339
215
|
async listConnectAccounts(
|
|
340
216
|
workspaceId: string,
|
|
341
217
|
): Promise<import("@opengeni/contracts/connect").ConnectAccount[]> {
|
package/src/index.ts
CHANGED
|
@@ -4,6 +4,11 @@ export type {
|
|
|
4
4
|
ArtifactCatalogListOptions,
|
|
5
5
|
ArtifactCatalogListResponse,
|
|
6
6
|
} from "./artifact-catalog";
|
|
7
|
+
export type {
|
|
8
|
+
SessionMessageSearchRequest,
|
|
9
|
+
SessionMessageSearchMatch,
|
|
10
|
+
SessionMessageSearchResponse,
|
|
11
|
+
} from "./session-message-search";
|
|
7
12
|
export { OpenGeniEmbeddingClient as OpenGeniClient } from "./embedding-client";
|
|
8
13
|
export { pluginMcpUnavailableReason } from "@opengeni/contracts/plugin-discovery";
|
|
9
14
|
export type {
|
|
@@ -547,16 +552,8 @@ export type {
|
|
|
547
552
|
CapabilityKind,
|
|
548
553
|
CapabilityLifecycle,
|
|
549
554
|
CapabilityLifecycleStatus,
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
CapabilityPackConnector,
|
|
553
|
-
CapabilityPackConnectorAuthModel,
|
|
554
|
-
CapabilityPackRigRequirement,
|
|
555
|
-
CapabilityPackVariableSetSpec,
|
|
556
|
-
CapabilityPackKnowledge,
|
|
557
|
-
CapabilityPackScheduledTaskTemplate,
|
|
558
|
-
CapabilityPackSkill,
|
|
559
|
-
CapabilityPackSkillFile,
|
|
555
|
+
SkillArtifactDefinition,
|
|
556
|
+
SkillArtifactFile,
|
|
560
557
|
CapabilityRuntime,
|
|
561
558
|
CapabilityReadiness,
|
|
562
559
|
CapabilitySource,
|
|
@@ -612,6 +609,7 @@ export type {
|
|
|
612
609
|
CodexAccount,
|
|
613
610
|
CodexAccountOverview,
|
|
614
611
|
CodexAccountsResponse,
|
|
612
|
+
SessionCodexAccountsResponse,
|
|
615
613
|
OrganizationCodexAccountsResponse,
|
|
616
614
|
CodexAllocatorUpdate,
|
|
617
615
|
CodexAccountSwitchedPayload,
|
|
@@ -646,7 +644,7 @@ export type {
|
|
|
646
644
|
CompleteFileUploadResponse,
|
|
647
645
|
ConnectionKind,
|
|
648
646
|
ConnectionMetadata,
|
|
649
|
-
|
|
647
|
+
McpConnectionAccountSelection,
|
|
650
648
|
ConnectionOwnership,
|
|
651
649
|
ConnectionResponse,
|
|
652
650
|
ConnectionStatus,
|
|
@@ -726,7 +724,6 @@ export type {
|
|
|
726
724
|
DocumentVisibility,
|
|
727
725
|
MoveDocumentRequest,
|
|
728
726
|
EnableCapabilityRequest,
|
|
729
|
-
EnablePackRequest,
|
|
730
727
|
Entitlements,
|
|
731
728
|
EntitlementValue,
|
|
732
729
|
EntitlementsMode,
|
|
@@ -754,7 +751,6 @@ export type {
|
|
|
754
751
|
AtlassianSelectedSource,
|
|
755
752
|
AtlassianSourceKind,
|
|
756
753
|
AtlassianSyncCadence,
|
|
757
|
-
GetPackResponse,
|
|
758
754
|
GitHubActionPoliciesResponse,
|
|
759
755
|
GitHubActionPolicyActor,
|
|
760
756
|
GitHubActionPolicyActorState,
|
|
@@ -791,6 +787,8 @@ export type {
|
|
|
791
787
|
GitHubRepository,
|
|
792
788
|
GitHubRepositoryScope,
|
|
793
789
|
GoalSpec,
|
|
790
|
+
SessionGoalReportRequirement,
|
|
791
|
+
SessionGoalReportDelivery,
|
|
794
792
|
IntegrationClientMetadata,
|
|
795
793
|
KnownPermission,
|
|
796
794
|
KnownSessionEventType,
|
|
@@ -819,7 +817,6 @@ export type {
|
|
|
819
817
|
ListApiKeysResponse,
|
|
820
818
|
ListOrganizationSessionsOptions,
|
|
821
819
|
ListConnectionsResponse,
|
|
822
|
-
ListPacksResponse,
|
|
823
820
|
ListSlackUserLinkAccessRequestsResponse,
|
|
824
821
|
ListWorkspaceMemberCandidatesResponse,
|
|
825
822
|
ListWorkspaceMembersResponse,
|
|
@@ -828,17 +825,6 @@ export type {
|
|
|
828
825
|
McpPersonalConnectionSummary,
|
|
829
826
|
OAuthStartRequest,
|
|
830
827
|
OAuthStartResponse,
|
|
831
|
-
PackInstallation,
|
|
832
|
-
PackInstallationPreview,
|
|
833
|
-
PackInstallationStatus,
|
|
834
|
-
PackComponentResolution,
|
|
835
|
-
PackComponentResolutionStatus,
|
|
836
|
-
PackRigResolution,
|
|
837
|
-
PackUninstallPreview,
|
|
838
|
-
PreviewPackInstallationRequest,
|
|
839
|
-
InstallPackRequest,
|
|
840
|
-
UninstallPackRequest,
|
|
841
|
-
UninstallPackResult,
|
|
842
828
|
Permission,
|
|
843
829
|
PrepareSlackUserLinkAccessRequest,
|
|
844
830
|
ProductAccessMode,
|
|
@@ -877,7 +863,6 @@ export type {
|
|
|
877
863
|
RecordingFailedReason,
|
|
878
864
|
RecordingMode,
|
|
879
865
|
RecordingStartedPayload,
|
|
880
|
-
RegisterCapabilityPackRequest,
|
|
881
866
|
RepositoryResourceRef,
|
|
882
867
|
ResourceRef,
|
|
883
868
|
SaveGoogleDriveSourceRequest,
|
|
@@ -921,6 +906,12 @@ export type {
|
|
|
921
906
|
SessionQueueMutationResponse,
|
|
922
907
|
SessionQueueSnapshot,
|
|
923
908
|
SessionControlResponse,
|
|
909
|
+
SessionRetryRequest,
|
|
910
|
+
SandboxRecoverySelection,
|
|
911
|
+
SandboxRecoveryProjection,
|
|
912
|
+
SandboxRecoveryRequest,
|
|
913
|
+
SandboxRecoveryResponse,
|
|
914
|
+
SessionRetryResponse,
|
|
924
915
|
ComposerDraft,
|
|
925
916
|
DeleteSessionQueueItemRequest,
|
|
926
917
|
EditSessionQueueItemRequest,
|
|
@@ -951,17 +942,16 @@ export type {
|
|
|
951
942
|
RotateSessionMcpCredentialsRequest,
|
|
952
943
|
RotateSessionMcpCredentialsReceipt,
|
|
953
944
|
SessionMcpApprovalPolicy,
|
|
945
|
+
SessionMcpApprovalPolicyTarget,
|
|
954
946
|
SessionMcpServerInput,
|
|
955
947
|
SessionMcpServerMetadata,
|
|
956
948
|
SessionToolPolicy,
|
|
957
|
-
// Per-surface capability cell aliases (views of SessionCapabilities).
|
|
958
949
|
FileSystemCapability,
|
|
959
950
|
TerminalCapability,
|
|
960
951
|
GitCapability,
|
|
961
952
|
DesktopStreamCapability,
|
|
962
953
|
RecordingCapability,
|
|
963
954
|
ComputerUseCapability,
|
|
964
|
-
// Stream-surfacing client surface (Phase 5).
|
|
965
955
|
ClientAuthConfig,
|
|
966
956
|
StreamUrlRotatedPayload,
|
|
967
957
|
StreamOpenedPayload,
|
|
@@ -1015,7 +1005,6 @@ export type {
|
|
|
1015
1005
|
TurnInitiator,
|
|
1016
1006
|
ToolAuthNeededPayload,
|
|
1017
1007
|
UpdateConnectionRequest,
|
|
1018
|
-
// Channel-A structured services (P4.4) — A1 payloads + A2 request/response.
|
|
1019
1008
|
SandboxCommandOutputDeltaPayload,
|
|
1020
1009
|
FsChangeKind,
|
|
1021
1010
|
FsChangedPayload,
|
|
@@ -1190,6 +1179,7 @@ export type {
|
|
|
1190
1179
|
InstalledPlugin,
|
|
1191
1180
|
PluginInstallationSummary,
|
|
1192
1181
|
ListInstalledPluginsResponse,
|
|
1182
|
+
PluginUninstallComponentImpact,
|
|
1193
1183
|
PluginUninstallPreview,
|
|
1194
1184
|
UninstallPluginRequest,
|
|
1195
1185
|
UninstallPluginResult,
|
|
@@ -1202,8 +1192,6 @@ export type {
|
|
|
1202
1192
|
WorkspaceVideoGenerationSettings,
|
|
1203
1193
|
WorkspaceVoiceInputSettings,
|
|
1204
1194
|
VoiceInputProviderId,
|
|
1205
|
-
WorkspaceRegisteredPack,
|
|
1206
|
-
// Bring-your-own-compute: Machines dashboard + per-machine metrics (M10).
|
|
1207
1195
|
MetricSample,
|
|
1208
1196
|
MachineState,
|
|
1209
1197
|
MachineKind,
|
|
@@ -1220,11 +1208,8 @@ export type {
|
|
|
1220
1208
|
MachineMetricsSeriesResponse,
|
|
1221
1209
|
RemoveEnrollmentRequest,
|
|
1222
1210
|
RemoveEnrollmentResponse,
|
|
1223
|
-
// Bring-your-own-compute: the user-authenticated active-sandbox swap (M7).
|
|
1224
1211
|
SwapActiveSandboxRequest,
|
|
1225
1212
|
SwapActiveSandboxResponse,
|
|
1226
|
-
// Self-hosted enrollment UX (design 11): click-Grant approve-page lookup/deny +
|
|
1227
|
-
// headless enroll-token mint/exchange.
|
|
1228
1213
|
EnrollmentOs,
|
|
1229
1214
|
ResourceAuthorityScope,
|
|
1230
1215
|
DeviceEnrollmentLookupRequest,
|
|
@@ -1248,3 +1233,9 @@ export type {
|
|
|
1248
1233
|
FeedbackSubmissionResponse,
|
|
1249
1234
|
} from "./feedback";
|
|
1250
1235
|
export type * from "./knowledge";
|
|
1236
|
+
export type {
|
|
1237
|
+
ConnectorToolPermission,
|
|
1238
|
+
ConnectorToolPermissionEntry,
|
|
1239
|
+
ConnectorToolPermissionsResponse,
|
|
1240
|
+
UpdateConnectorToolPermissionsRequest,
|
|
1241
|
+
} from "./types";
|
package/src/knowledge.ts
CHANGED
|
@@ -9,6 +9,8 @@ export type {
|
|
|
9
9
|
AgentLearningOverrideRecord,
|
|
10
10
|
SaveAgentLearningSettingsRequest,
|
|
11
11
|
KnowledgeFilePreparationResult,
|
|
12
|
+
KnowledgeSavePreparationRequest,
|
|
13
|
+
KnowledgeSavePreparationResponse,
|
|
12
14
|
KnowledgeOriginalFileDownload,
|
|
13
15
|
KnowledgeEntryKind,
|
|
14
16
|
KnowledgeEntryScope,
|
|
@@ -35,16 +37,35 @@ export type {
|
|
|
35
37
|
} from "@opengeni/contracts";
|
|
36
38
|
|
|
37
39
|
import type { OpenGeniClient } from "./client";
|
|
38
|
-
import type {
|
|
40
|
+
import type {
|
|
41
|
+
KnowledgeSavePreparationRequest,
|
|
42
|
+
KnowledgeSavePreparationResponse,
|
|
43
|
+
KnowledgeFilePreparationResult,
|
|
44
|
+
} from "@opengeni/contracts";
|
|
39
45
|
|
|
40
46
|
/** Agent-only source preparation is a focused transport surface, outside the browser client. */
|
|
41
47
|
export async function prepareKnowledgeFile(
|
|
42
48
|
client: Pick<OpenGeniClient, "requestJson">,
|
|
43
49
|
workspaceId: string,
|
|
44
50
|
fileId: string,
|
|
51
|
+
purpose?: "evidence" | "reference",
|
|
45
52
|
): Promise<KnowledgeFilePreparationResult> {
|
|
46
53
|
return client.requestJson(
|
|
47
54
|
"POST",
|
|
48
55
|
`/v1/workspaces/${encodeURIComponent(workspaceId)}/knowledge/files/${encodeURIComponent(fileId)}/prepare`,
|
|
56
|
+
purpose ? { purpose } : undefined,
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** Read-only collection/duplicate discovery for a live selected agent or human Knowledge reviewer. */
|
|
61
|
+
export async function prepareKnowledgeSave(
|
|
62
|
+
client: Pick<OpenGeniClient, "requestJson">,
|
|
63
|
+
workspaceId: string,
|
|
64
|
+
request: KnowledgeSavePreparationRequest,
|
|
65
|
+
): Promise<KnowledgeSavePreparationResponse> {
|
|
66
|
+
return client.requestJson(
|
|
67
|
+
"POST",
|
|
68
|
+
`/v1/workspaces/${encodeURIComponent(workspaceId)}/knowledge/entries/prepare-save`,
|
|
69
|
+
request,
|
|
49
70
|
);
|
|
50
71
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { OpenGeniClient } from "./client";
|
|
2
|
+
|
|
3
|
+
export type OrganizationIntegrationPolicy = {
|
|
4
|
+
mode: "unrestricted" | "restricted";
|
|
5
|
+
allowedIntegrationKeys: string[];
|
|
6
|
+
revision: number;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export type UpdateOrganizationIntegrationPolicyRequest = {
|
|
10
|
+
mode: "unrestricted" | "restricted";
|
|
11
|
+
allowedIntegrationKeys: string[];
|
|
12
|
+
expectedRevision: number;
|
|
13
|
+
operationId: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
type PolicyClient = Pick<OpenGeniClient, "requestJson">;
|
|
17
|
+
|
|
18
|
+
export type OrganizationIntegrationCatalog = {
|
|
19
|
+
integrations: Array<{ key: string; label: string; kind: "curated" | "custom" }>;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** Discover stable policy identities; integrations must not guess provider identifiers. */
|
|
23
|
+
export async function getOrganizationIntegrationCatalog(
|
|
24
|
+
client: PolicyClient,
|
|
25
|
+
organizationId: string,
|
|
26
|
+
): Promise<OrganizationIntegrationCatalog> {
|
|
27
|
+
return client.requestJson(
|
|
28
|
+
"GET",
|
|
29
|
+
`/v1/organizations/${encodeURIComponent(organizationId)}/integration-policy/catalog`,
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export async function getOrganizationIntegrationPolicy(
|
|
34
|
+
client: PolicyClient,
|
|
35
|
+
organizationId: string,
|
|
36
|
+
): Promise<OrganizationIntegrationPolicy> {
|
|
37
|
+
return client.requestJson(
|
|
38
|
+
"GET",
|
|
39
|
+
`/v1/organizations/${encodeURIComponent(organizationId)}/integration-policy`,
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Retain operationId and the exact request when reconciling an uncertain outcome. */
|
|
44
|
+
export async function updateOrganizationIntegrationPolicy(
|
|
45
|
+
client: PolicyClient,
|
|
46
|
+
organizationId: string,
|
|
47
|
+
request: UpdateOrganizationIntegrationPolicyRequest,
|
|
48
|
+
): Promise<OrganizationIntegrationPolicy> {
|
|
49
|
+
return client.requestJson(
|
|
50
|
+
"PUT",
|
|
51
|
+
`/v1/organizations/${encodeURIComponent(organizationId)}/integration-policy`,
|
|
52
|
+
request,
|
|
53
|
+
);
|
|
54
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** Literal Unicode case-insensitive substring. Whitespace is significant. */
|
|
2
|
+
export type SessionMessageSearchRequest = {
|
|
3
|
+
query: string;
|
|
4
|
+
sessionId?: string | undefined;
|
|
5
|
+
/** Workspace-only first hit per session; cannot combine with sessionId. */
|
|
6
|
+
groupBy?: "session" | undefined;
|
|
7
|
+
archiveStatus?: "active" | "archived" | "all" | undefined;
|
|
8
|
+
limit?: number | undefined;
|
|
9
|
+
cursor?: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type SessionMessageSearchMatch = {
|
|
13
|
+
sessionId: string;
|
|
14
|
+
sessionTitle: string | null;
|
|
15
|
+
eventId: string;
|
|
16
|
+
sequence: number;
|
|
17
|
+
turnId: string | null;
|
|
18
|
+
role: "user" | "assistant";
|
|
19
|
+
messageId: string | null;
|
|
20
|
+
/** Zero-based UTF-16 offset in the complete visible message. */
|
|
21
|
+
messageMatchOffset: number;
|
|
22
|
+
/** Zero-based UTF-16 offsets in text; matchEnd is exclusive. */
|
|
23
|
+
snippet: { text: string; matchStart: number; matchEnd: number };
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type SessionMessageSearchResponse = {
|
|
27
|
+
matches: SessionMessageSearchMatch[];
|
|
28
|
+
nextCursor: string | null;
|
|
29
|
+
/** Empty advancing pages are valid. Continue until false. */
|
|
30
|
+
hasMore: boolean;
|
|
31
|
+
/** Cumulative distinct messages visited in this live traversal. */
|
|
32
|
+
scannedMessages: number;
|
|
33
|
+
/** Cumulative matching messages, or session representatives with groupBy=session. */
|
|
34
|
+
matchedMessageCount: number;
|
|
35
|
+
/** Cumulative occurrences, or session representatives with groupBy=session. */
|
|
36
|
+
matchedOccurrenceCount: number;
|
|
37
|
+
/** True only on exhaustion. Concurrent mutations require a fresh traversal. */
|
|
38
|
+
countIsExact: boolean;
|
|
39
|
+
};
|