@opengeni/sdk 0.48.0 → 0.57.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 +147 -1
- package/dist/artifact-client.d.ts +20 -2
- package/dist/artifacts.d.ts +4 -0
- package/dist/artifacts.js +11 -0
- package/dist/artifacts.js.map +1 -0
- package/dist/{chunk-V5F253OG.js → chunk-GU6JF75T.js} +6 -3
- package/dist/chunk-GU6JF75T.js.map +1 -0
- package/dist/chunk-HJ3HHUT5.js +222 -0
- package/dist/chunk-HJ3HHUT5.js.map +1 -0
- package/dist/{chunk-KIHGPM7H.js → chunk-JDLDDRNE.js} +20 -14
- package/dist/chunk-JDLDDRNE.js.map +1 -0
- package/dist/chunk-JRPFWI6T.js +128 -0
- package/dist/chunk-JRPFWI6T.js.map +1 -0
- package/dist/{chunk-MBGBLVUV.js → chunk-PKQ377ED.js} +1725 -555
- package/dist/chunk-PKQ377ED.js.map +1 -0
- package/dist/chunk-ST5DDKJP.js +987 -0
- package/dist/chunk-ST5DDKJP.js.map +1 -0
- package/dist/chunk-VWE2QIVO.js +1162 -0
- package/dist/chunk-VWE2QIVO.js.map +1 -0
- package/dist/chunk-VYCTL62C.js +230 -0
- package/dist/chunk-VYCTL62C.js.map +1 -0
- package/dist/{chunk-DXDL7EEW.js → chunk-YKZME56C.js} +197 -113
- package/dist/chunk-YKZME56C.js.map +1 -0
- package/dist/client.d.ts +240 -16
- package/dist/codex-realtime-controller.d.ts +9 -6
- package/dist/codex-realtime-controller.js +2 -2
- package/dist/codex-realtime-lifecycle.d.ts +1 -1
- package/dist/codex-realtime-v3.d.ts +3 -3
- package/dist/codex-realtime.d.ts +1 -1
- package/dist/company-profile.d.ts +100 -0
- package/dist/core.d.ts +5 -5
- package/dist/core.js +10 -5
- package/dist/desktop.d.ts +9 -1
- package/dist/editable-artifact-resources.d.ts +96 -0
- package/dist/editable-artifacts/browser-session.d.ts +35 -0
- package/dist/editable-artifacts/controller.d.ts +60 -0
- package/dist/editable-artifacts/errors.d.ts +23 -0
- package/dist/editable-artifacts/http-live-transport.d.ts +46 -0
- package/dist/editable-artifacts/index.d.ts +19 -0
- package/dist/editable-artifacts/pool.d.ts +15 -0
- package/dist/editable-artifacts/session.d.ts +96 -0
- package/dist/editable-artifacts/storage.d.ts +72 -0
- package/dist/editable-artifacts/types.d.ts +416 -0
- package/dist/editable-artifacts/worker/browser-client.d.ts +80 -0
- package/dist/editable-artifacts/worker/browser-entry.d.ts +6 -0
- package/dist/editable-artifacts/worker/kernel-adapter.d.ts +45 -0
- package/dist/editable-artifacts/worker/rpc-protocol.d.ts +92 -0
- package/dist/editable-artifacts/worker/runtime.d.ts +66 -0
- package/dist/editable-artifacts/worker/wire-codec.d.ts +52 -0
- package/dist/editable-artifacts-worker.d.ts +8 -0
- package/dist/editable-artifacts-worker.js +1708 -0
- package/dist/editable-artifacts-worker.js.map +1 -0
- package/dist/editable-artifacts.d.ts +6 -0
- package/dist/editable-artifacts.js +5954 -0
- package/dist/editable-artifacts.js.map +1 -0
- package/dist/gateway-realtime-transport.d.ts +2 -1
- package/dist/gateway-realtime-transport.js +5 -3
- package/dist/index.d.ts +45 -35
- package/dist/index.js +134 -64
- package/dist/index.js.map +1 -1
- package/dist/interaction-revision-stream.d.ts +11 -0
- package/dist/interaction.d.ts +1484 -0
- package/dist/interaction.js +81 -0
- package/dist/interaction.js.map +1 -0
- package/dist/memory-slack-client.d.ts +13 -0
- package/dist/memory-slack-delivery.d.ts +99 -0
- package/dist/memory-slack.d.ts +4 -0
- package/dist/memory-slack.js +44 -0
- package/dist/memory-slack.js.map +1 -0
- package/dist/proxy.d.ts +3 -3
- package/dist/realtime.d.ts +14 -14
- package/dist/realtime.js +11 -7
- package/dist/realtime.js.map +1 -1
- package/dist/retained-artifacts.d.ts +12 -0
- package/dist/stream.d.ts +1 -1
- package/dist/terminal.d.ts +1 -1
- package/dist/types.d.ts +1347 -34
- package/dist/workspace-control-stream.d.ts +2 -2
- package/dist/workspace-live-stream.d.ts +14 -0
- package/dist/workspace-state.d.ts +1 -1
- package/package.json +29 -3
- package/src/artifact-client.ts +129 -0
- package/src/artifacts.ts +17 -0
- package/src/client.ts +3022 -910
- package/src/codex-realtime-controller.ts +25 -7
- package/src/codex-realtime-lifecycle.ts +1 -0
- package/src/company-profile.ts +92 -0
- package/src/desktop.ts +11 -1
- package/src/editable-artifact-resources.ts +119 -0
- package/src/editable-artifacts/browser-session.ts +176 -0
- package/src/editable-artifacts/controller.ts +2632 -0
- package/src/editable-artifacts/errors.ts +52 -0
- package/src/editable-artifacts/http-live-transport.ts +1449 -0
- package/src/editable-artifacts/index.ts +175 -0
- package/src/editable-artifacts/pool.ts +81 -0
- package/src/editable-artifacts/session.ts +778 -0
- package/src/editable-artifacts/storage.ts +1718 -0
- package/src/editable-artifacts/types.ts +499 -0
- package/src/editable-artifacts/worker/browser-client.ts +1167 -0
- package/src/editable-artifacts/worker/browser-entry.ts +57 -0
- package/src/editable-artifacts/worker/kernel-adapter.ts +1039 -0
- package/src/editable-artifacts/worker/rpc-protocol.ts +622 -0
- package/src/editable-artifacts/worker/runtime.ts +1204 -0
- package/src/editable-artifacts/worker/wire-codec.ts +852 -0
- package/src/editable-artifacts-worker.ts +8 -0
- package/src/editable-artifacts.ts +6 -0
- package/src/errors.ts +16 -2
- package/src/gateway-realtime-transport.ts +252 -109
- package/src/index.ts +215 -1
- package/src/interaction-revision-stream.ts +117 -0
- package/src/interaction.ts +2874 -0
- package/src/memory-slack-client.ts +71 -0
- package/src/memory-slack-delivery.ts +128 -0
- package/src/memory-slack.ts +19 -0
- package/src/realtime.ts +14 -4
- package/src/retained-artifacts.ts +326 -0
- package/src/types.ts +1636 -52
- package/src/workspace-live-stream.ts +137 -0
- package/dist/chunk-DXDL7EEW.js.map +0 -1
- package/dist/chunk-KIHGPM7H.js.map +0 -1
- package/dist/chunk-MBGBLVUV.js.map +0 -1
- package/dist/chunk-V5F253OG.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type StreamSessionEventsOptions } from "./stream";
|
|
2
|
-
import type { WorkspaceControlEvent } from "./types";
|
|
1
|
+
import { type StreamSessionEventsOptions } from "./stream.js";
|
|
2
|
+
import type { WorkspaceControlEvent } from "./types.js";
|
|
3
3
|
export type WorkspaceControlStreamTransport = {
|
|
4
4
|
/** The server replays every durable event after the cursor before going live. */
|
|
5
5
|
openStream: (after: number, signal: AbortSignal | undefined) => Promise<ReadableStream<Uint8Array>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { WorkspaceInteractionRevisionEvent } from "./interaction.js";
|
|
2
|
+
import { type StreamSessionEventsOptions } from "./stream.js";
|
|
3
|
+
import type { WorkspaceControlEvent } from "./types.js";
|
|
4
|
+
export type WorkspaceLiveEvent = WorkspaceControlEvent | WorkspaceInteractionRevisionEvent;
|
|
5
|
+
export type WorkspaceLiveStreamOptions = Omit<StreamSessionEventsOptions, "after"> & {
|
|
6
|
+
controlAfter?: number;
|
|
7
|
+
interactionAfter?: number;
|
|
8
|
+
};
|
|
9
|
+
export type WorkspaceLiveStreamTransport = {
|
|
10
|
+
openStream: (controlAfter: number, interactionAfter: number, signal: AbortSignal | undefined) => Promise<ReadableStream<Uint8Array>>;
|
|
11
|
+
};
|
|
12
|
+
/** One reconnecting SSE connection with independent durable cursors. */
|
|
13
|
+
export declare function streamWorkspaceLiveEvents(transport: WorkspaceLiveStreamTransport, options?: WorkspaceLiveStreamOptions): AsyncGenerator<WorkspaceLiveEvent, void, void>;
|
|
14
|
+
export declare function parseWorkspaceLiveEvent(data: string): WorkspaceLiveEvent | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { WorkspaceInstructionPolicyKind, WorkspaceInstructionPolicyProvenanceSource, WorkspaceInstructionPolicyScope } from "./workspace-instruction-policies";
|
|
1
|
+
import type { WorkspaceInstructionPolicyKind, WorkspaceInstructionPolicyProvenanceSource, WorkspaceInstructionPolicyScope } from "./workspace-instruction-policies.js";
|
|
2
2
|
export type WorkspaceStateDocumentStatusCounts = {
|
|
3
3
|
queued: number;
|
|
4
4
|
indexing: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeni/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.57.0",
|
|
4
4
|
"description": "Framework-agnostic TypeScript SDK for the OpenGeni API: typed client, session lifecycle, SSE event streaming with reconnect + replay-by-sequence, and proxy re-streaming helpers.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -13,7 +13,11 @@
|
|
|
13
13
|
"src"
|
|
14
14
|
],
|
|
15
15
|
"type": "module",
|
|
16
|
-
"sideEffects":
|
|
16
|
+
"sideEffects": [
|
|
17
|
+
"./src/editable-artifacts-worker.ts",
|
|
18
|
+
"./src/editable-artifacts/worker/browser-entry.ts",
|
|
19
|
+
"./dist/editable-artifacts-worker.js"
|
|
20
|
+
],
|
|
17
21
|
"main": "./dist/index.js",
|
|
18
22
|
"module": "./dist/index.js",
|
|
19
23
|
"types": "./dist/index.d.ts",
|
|
@@ -26,10 +30,30 @@
|
|
|
26
30
|
"types": "./dist/core.d.ts",
|
|
27
31
|
"import": "./dist/core.js"
|
|
28
32
|
},
|
|
33
|
+
"./artifacts": {
|
|
34
|
+
"types": "./dist/artifacts.d.ts",
|
|
35
|
+
"import": "./dist/artifacts.js"
|
|
36
|
+
},
|
|
37
|
+
"./memory-slack": {
|
|
38
|
+
"types": "./dist/memory-slack.d.ts",
|
|
39
|
+
"import": "./dist/memory-slack.js"
|
|
40
|
+
},
|
|
29
41
|
"./realtime": {
|
|
30
42
|
"types": "./dist/realtime.d.ts",
|
|
31
43
|
"import": "./dist/realtime.js"
|
|
32
44
|
},
|
|
45
|
+
"./editable-artifacts": {
|
|
46
|
+
"types": "./dist/editable-artifacts.d.ts",
|
|
47
|
+
"import": "./dist/editable-artifacts.js"
|
|
48
|
+
},
|
|
49
|
+
"./editable-artifacts/worker": {
|
|
50
|
+
"types": "./dist/editable-artifacts-worker.d.ts",
|
|
51
|
+
"import": "./dist/editable-artifacts-worker.js"
|
|
52
|
+
},
|
|
53
|
+
"./interaction": {
|
|
54
|
+
"types": "./dist/interaction.d.ts",
|
|
55
|
+
"import": "./dist/interaction.js"
|
|
56
|
+
},
|
|
33
57
|
"./codex-realtime-controller": {
|
|
34
58
|
"types": "./dist/codex-realtime-controller.d.ts",
|
|
35
59
|
"import": "./dist/codex-realtime-controller.js"
|
|
@@ -48,7 +72,9 @@
|
|
|
48
72
|
"build": "bun ../../scripts/build-typescript-package.ts",
|
|
49
73
|
"prepublishOnly": "bash ../../scripts/prepublish-guard"
|
|
50
74
|
},
|
|
51
|
-
"dependencies": {
|
|
75
|
+
"dependencies": {
|
|
76
|
+
"@opengeni/contracts": "^0.50.0"
|
|
77
|
+
},
|
|
52
78
|
"engines": {
|
|
53
79
|
"node": ">=18"
|
|
54
80
|
}
|
package/src/artifact-client.ts
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import { OpenGeniClient as OpenGeniCoreClient } from "./client";
|
|
2
|
+
import type {
|
|
3
|
+
CreateEditableArtifactMaterializationRequest,
|
|
4
|
+
CreateEditableArtifactResourceRequest,
|
|
5
|
+
EditableArtifactListResource,
|
|
6
|
+
EditableArtifactMaterializationJobResource,
|
|
7
|
+
EditableArtifactPinnedVersionResource,
|
|
8
|
+
EditableArtifactResource,
|
|
9
|
+
ImportEditableArtifactResourceRequest,
|
|
10
|
+
ListSessionEditableArtifactResourcesOptions,
|
|
11
|
+
PinEditableArtifactVersionRequest,
|
|
12
|
+
ReadEditableArtifactMaterializationOptions,
|
|
13
|
+
ReadEditableArtifactResourceOptions,
|
|
14
|
+
} from "./editable-artifact-resources";
|
|
2
15
|
import type {
|
|
3
16
|
CreateWorkspaceArtifactRequest,
|
|
4
17
|
PublishWorkspaceArtifactVersionRequest,
|
|
@@ -12,6 +25,122 @@ import type {
|
|
|
12
25
|
|
|
13
26
|
/** Public SDK client. Artifact operations stay out of the console's eager core graph. */
|
|
14
27
|
export class OpenGeniClient extends OpenGeniCoreClient {
|
|
28
|
+
async createEditableArtifact(
|
|
29
|
+
workspaceId: string,
|
|
30
|
+
request: CreateEditableArtifactResourceRequest,
|
|
31
|
+
options: Readonly<{ signal?: AbortSignal | undefined }> = {},
|
|
32
|
+
): Promise<EditableArtifactResource> {
|
|
33
|
+
return await this.requestJson<EditableArtifactResource>(
|
|
34
|
+
"POST",
|
|
35
|
+
`/v1/workspaces/${encodeURIComponent(workspaceId)}/editable-artifacts`,
|
|
36
|
+
request,
|
|
37
|
+
{},
|
|
38
|
+
options,
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async importEditableArtifact(
|
|
43
|
+
workspaceId: string,
|
|
44
|
+
request: ImportEditableArtifactResourceRequest,
|
|
45
|
+
options: Readonly<{ signal?: AbortSignal | undefined }> = {},
|
|
46
|
+
): Promise<EditableArtifactResource> {
|
|
47
|
+
return await this.requestJson<EditableArtifactResource>(
|
|
48
|
+
"POST",
|
|
49
|
+
`/v1/workspaces/${encodeURIComponent(workspaceId)}/editable-artifacts/imports`,
|
|
50
|
+
request,
|
|
51
|
+
{},
|
|
52
|
+
options,
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async getEditableArtifact(
|
|
57
|
+
workspaceId: string,
|
|
58
|
+
artifactId: string,
|
|
59
|
+
options: ReadEditableArtifactResourceOptions,
|
|
60
|
+
): Promise<EditableArtifactResource> {
|
|
61
|
+
return await this.requestJson<EditableArtifactResource>(
|
|
62
|
+
"GET",
|
|
63
|
+
`/v1/workspaces/${encodeURIComponent(workspaceId)}/editable-artifacts/${encodeURIComponent(artifactId)}`,
|
|
64
|
+
undefined,
|
|
65
|
+
{ replicaId: options.replicaId },
|
|
66
|
+
options,
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async listSessionEditableArtifacts(
|
|
71
|
+
workspaceId: string,
|
|
72
|
+
sourceSessionId: string,
|
|
73
|
+
options: ListSessionEditableArtifactResourcesOptions,
|
|
74
|
+
): Promise<EditableArtifactListResource> {
|
|
75
|
+
return await this.requestJson<EditableArtifactListResource>(
|
|
76
|
+
"GET",
|
|
77
|
+
`/v1/workspaces/${encodeURIComponent(workspaceId)}/editable-artifacts`,
|
|
78
|
+
undefined,
|
|
79
|
+
{ sourceSessionId, replicaId: options.replicaId },
|
|
80
|
+
options,
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
async pinEditableArtifactVersion(
|
|
85
|
+
workspaceId: string,
|
|
86
|
+
artifactId: string,
|
|
87
|
+
request: PinEditableArtifactVersionRequest,
|
|
88
|
+
options: Readonly<{ signal?: AbortSignal | undefined }> = {},
|
|
89
|
+
): Promise<EditableArtifactPinnedVersionResource> {
|
|
90
|
+
return await this.requestJson<EditableArtifactPinnedVersionResource>(
|
|
91
|
+
"POST",
|
|
92
|
+
`/v1/workspaces/${encodeURIComponent(workspaceId)}/editable-artifacts/${encodeURIComponent(artifactId)}/versions`,
|
|
93
|
+
request,
|
|
94
|
+
{},
|
|
95
|
+
options,
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
async createEditableArtifactMaterialization(
|
|
100
|
+
workspaceId: string,
|
|
101
|
+
artifactId: string,
|
|
102
|
+
request: CreateEditableArtifactMaterializationRequest,
|
|
103
|
+
options: Readonly<{ signal?: AbortSignal | undefined }> = {},
|
|
104
|
+
): Promise<EditableArtifactMaterializationJobResource> {
|
|
105
|
+
return await this.requestJson<EditableArtifactMaterializationJobResource>(
|
|
106
|
+
"POST",
|
|
107
|
+
`/v1/workspaces/${encodeURIComponent(workspaceId)}/editable-artifacts/${encodeURIComponent(artifactId)}/materializations`,
|
|
108
|
+
request,
|
|
109
|
+
{},
|
|
110
|
+
options,
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
async getEditableArtifactMaterialization(
|
|
115
|
+
workspaceId: string,
|
|
116
|
+
artifactId: string,
|
|
117
|
+
jobId: string,
|
|
118
|
+
options: ReadEditableArtifactMaterializationOptions,
|
|
119
|
+
): Promise<EditableArtifactMaterializationJobResource> {
|
|
120
|
+
return await this.requestJson<EditableArtifactMaterializationJobResource>(
|
|
121
|
+
"GET",
|
|
122
|
+
`/v1/workspaces/${encodeURIComponent(workspaceId)}/editable-artifacts/${encodeURIComponent(artifactId)}/materializations/${encodeURIComponent(jobId)}`,
|
|
123
|
+
undefined,
|
|
124
|
+
{ replicaId: options.replicaId },
|
|
125
|
+
options,
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** The caller owns the returned bounded response stream. */
|
|
130
|
+
async downloadEditableArtifactMaterialization(
|
|
131
|
+
workspaceId: string,
|
|
132
|
+
artifactId: string,
|
|
133
|
+
jobId: string,
|
|
134
|
+
options: ReadEditableArtifactMaterializationOptions,
|
|
135
|
+
): Promise<Response> {
|
|
136
|
+
return await this.requestResponse(
|
|
137
|
+
"GET",
|
|
138
|
+
`/v1/workspaces/${encodeURIComponent(workspaceId)}/editable-artifacts/${encodeURIComponent(artifactId)}/materializations/${encodeURIComponent(jobId)}/download`,
|
|
139
|
+
{ replicaId: options.replicaId },
|
|
140
|
+
options,
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
15
144
|
async listWorkspaceArtifacts(
|
|
16
145
|
workspaceId: string,
|
|
17
146
|
options: WorkspaceArtifactListOptions = {},
|
package/src/artifacts.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Artifact-only API client entry; keeps unrelated SDK surfaces out of editor bundles. */
|
|
2
|
+
export { OpenGeniClient } from "./artifact-client";
|
|
3
|
+
export type {
|
|
4
|
+
CreateEditableArtifactMaterializationRequest,
|
|
5
|
+
CreateEditableArtifactResourceRequest,
|
|
6
|
+
EditableArtifactListResource,
|
|
7
|
+
EditableArtifactMaterializationFormat,
|
|
8
|
+
EditableArtifactMaterializationJobResource,
|
|
9
|
+
EditableArtifactMaterializationResultResource,
|
|
10
|
+
EditableArtifactPinnedVersionResource,
|
|
11
|
+
EditableArtifactResource,
|
|
12
|
+
ListSessionEditableArtifactResourcesOptions,
|
|
13
|
+
PinEditableArtifactVersionRequest,
|
|
14
|
+
ReadEditableArtifactMaterializationOptions,
|
|
15
|
+
ReadEditableArtifactResourceOptions,
|
|
16
|
+
} from "./editable-artifact-resources";
|
|
17
|
+
export type { FetchLike, OpenGeniClientOptions, OpenGeniRequestOptions } from "./client";
|