@opengeni/sdk 0.46.0 → 0.52.1
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 +94 -2
- 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-FHI4DFIG.js +128 -0
- package/dist/chunk-FHI4DFIG.js.map +1 -0
- package/dist/chunk-FRJFNDIR.js +218 -0
- package/dist/chunk-FRJFNDIR.js.map +1 -0
- package/dist/{chunk-QKV5OCLJ.js → chunk-ILQZR5N6.js} +1380 -595
- package/dist/chunk-ILQZR5N6.js.map +1 -0
- package/dist/chunk-MZWTWOX6.js +661 -0
- package/dist/chunk-MZWTWOX6.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/client.d.ts +176 -20
- package/dist/codex-realtime-controller.d.ts +6 -6
- 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 +9 -4
- package/dist/desktop.d.ts +1 -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 +1 -1
- package/dist/index.d.ts +41 -35
- package/dist/index.js +104 -68
- package/dist/index.js.map +1 -1
- package/dist/interaction.d.ts +885 -0
- package/dist/interaction.js +55 -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 +12 -12
- package/dist/retained-artifacts.d.ts +12 -0
- package/dist/stream.d.ts +16 -1
- package/dist/terminal.d.ts +1 -1
- package/dist/transcription.d.ts +2 -2
- package/dist/types.d.ts +1203 -23
- package/dist/workspace-control-stream.d.ts +2 -2
- 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 +1801 -206
- package/src/company-profile.ts +92 -0
- 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/index.ts +194 -0
- package/src/interaction.ts +1830 -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/retained-artifacts.ts +326 -0
- package/src/stream.ts +102 -4
- package/src/transcription.ts +2 -2
- package/src/types.ts +1430 -33
- package/src/workspace-control-stream.ts +15 -5
- package/dist/chunk-QKV5OCLJ.js.map +0 -1
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
export {
|
|
2
|
+
createEditableArtifactSyncController,
|
|
3
|
+
editableArtifactCacheNamespace,
|
|
4
|
+
type CreateEditableArtifactSyncControllerOptions,
|
|
5
|
+
type EditableArtifactCacheAuthority,
|
|
6
|
+
type EditableArtifactQueueCommandsInput,
|
|
7
|
+
type EditableArtifactSyncController,
|
|
8
|
+
} from "./controller";
|
|
9
|
+
export {
|
|
10
|
+
createBrowserEditableArtifactSession,
|
|
11
|
+
createEditableArtifactReplicaId,
|
|
12
|
+
} from "./browser-session";
|
|
13
|
+
export type {
|
|
14
|
+
CreateBrowserEditableArtifactSessionOptions,
|
|
15
|
+
EditableArtifactBrowserRuntime,
|
|
16
|
+
} from "./browser-session";
|
|
17
|
+
export { EditableArtifactSyncError, EditableArtifactTransportError } from "./errors";
|
|
18
|
+
export type { EditableArtifactSyncErrorCode } from "./errors";
|
|
19
|
+
export { createEditableArtifactHttpLiveTransport } from "./http-live-transport";
|
|
20
|
+
export type {
|
|
21
|
+
CreateEditableArtifactHttpLiveTransportOptions,
|
|
22
|
+
EditableArtifactWebSocketCloseEvent,
|
|
23
|
+
EditableArtifactWebSocketLike,
|
|
24
|
+
EditableArtifactWebSocketMessageEvent,
|
|
25
|
+
} from "./http-live-transport";
|
|
26
|
+
export {
|
|
27
|
+
EditableArtifactStorageConflictError,
|
|
28
|
+
IndexedDbEditableArtifactStorage,
|
|
29
|
+
MemoryEditableArtifactStorage,
|
|
30
|
+
} from "./storage";
|
|
31
|
+
export type {
|
|
32
|
+
EditableArtifactAppendCommittedInput,
|
|
33
|
+
EditableArtifactExpectedStoredHead,
|
|
34
|
+
EditableArtifactStoragePort,
|
|
35
|
+
EditableArtifactStorageScope,
|
|
36
|
+
IndexedDbEditableArtifactStorageOptions,
|
|
37
|
+
} from "./storage";
|
|
38
|
+
export { EditableArtifactSyncPool } from "./pool";
|
|
39
|
+
export type { EditableArtifactSyncControllerFactory, EditableArtifactSyncLease } from "./pool";
|
|
40
|
+
export { createEditableArtifactSession } from "./session";
|
|
41
|
+
export type {
|
|
42
|
+
CreateEditableArtifactSessionOptions,
|
|
43
|
+
ApplySerializedArtifactCommandsOptions,
|
|
44
|
+
ApplySpreadsheetCommandsOptions,
|
|
45
|
+
CreateDocumentParagraphInput,
|
|
46
|
+
CreateDocumentParagraphResult,
|
|
47
|
+
CreatePresentationSlideInput,
|
|
48
|
+
CreatePresentationSlideResult,
|
|
49
|
+
CreateSpreadsheetSheetInput,
|
|
50
|
+
CreateSpreadsheetSheetResult,
|
|
51
|
+
EditableArtifactSession,
|
|
52
|
+
EditableSpreadsheetMetadataListener,
|
|
53
|
+
EditableSpreadsheetViewportListener,
|
|
54
|
+
EditableSpreadsheetViewportSubscriptionOptions,
|
|
55
|
+
} from "./session";
|
|
56
|
+
export type {
|
|
57
|
+
EditableArtifactBootstrap,
|
|
58
|
+
EditableArtifactBlockedPending,
|
|
59
|
+
EditableArtifactCausalEntry,
|
|
60
|
+
EditableArtifactCausalFrontier,
|
|
61
|
+
EditableArtifactCommittedTransaction,
|
|
62
|
+
EditableArtifactId,
|
|
63
|
+
EditableArtifactModality,
|
|
64
|
+
EditableArtifactLiveClose,
|
|
65
|
+
EditableArtifactLiveConnection,
|
|
66
|
+
EditableArtifactLiveLimits,
|
|
67
|
+
EditableArtifactLiveMessage,
|
|
68
|
+
EditableArtifactPendingTransaction,
|
|
69
|
+
EditableArtifactSerializedCommittedTransaction,
|
|
70
|
+
EditableArtifactSerializedModality,
|
|
71
|
+
EditableArtifactSerializedPendingTransaction,
|
|
72
|
+
EditableArtifactSerializedSnapshot,
|
|
73
|
+
EditableArtifactReplayPage,
|
|
74
|
+
EditableArtifactSnapshot,
|
|
75
|
+
EditableArtifactSpreadsheetCommittedTransaction,
|
|
76
|
+
EditableArtifactSpreadsheetPendingTransaction,
|
|
77
|
+
EditableArtifactSpreadsheetSnapshot,
|
|
78
|
+
EditableArtifactStoredReplica,
|
|
79
|
+
EditableArtifactSubmitReceipt,
|
|
80
|
+
EditableArtifactSyncListener,
|
|
81
|
+
EditableArtifactSyncScheduler,
|
|
82
|
+
EditableArtifactSyncState,
|
|
83
|
+
EditableArtifactSyncTicket,
|
|
84
|
+
EditableArtifactSyncTransport,
|
|
85
|
+
EditableArtifactSyncView,
|
|
86
|
+
EditableArtifactWorkerKernel,
|
|
87
|
+
EditableDocumentProjection,
|
|
88
|
+
EditableDocumentQuery,
|
|
89
|
+
EditablePresentationProjection,
|
|
90
|
+
EditablePresentationQuery,
|
|
91
|
+
EditablePresentationEditorSlideProjection,
|
|
92
|
+
EditablePresentationEditorSlideQuery,
|
|
93
|
+
EditablePresentationSlideCatalogProjection,
|
|
94
|
+
EditablePresentationSlideCatalogQuery,
|
|
95
|
+
EditableSpreadsheetCellValue,
|
|
96
|
+
EditableSpreadsheetFormulaError,
|
|
97
|
+
EditableSpreadsheetMetadataProjection,
|
|
98
|
+
EditableSpreadsheetMetadataQuery,
|
|
99
|
+
EditableSpreadsheetProjectedCell,
|
|
100
|
+
EditableSpreadsheetSheetMetadata,
|
|
101
|
+
EditableSpreadsheetUsedBounds,
|
|
102
|
+
EditableSpreadsheetViewportProjection,
|
|
103
|
+
EditableSpreadsheetViewportQuery,
|
|
104
|
+
} from "./types";
|
|
105
|
+
export {
|
|
106
|
+
ArtifactWorkerClientError,
|
|
107
|
+
createBrowserEditableArtifactWorkerKernel,
|
|
108
|
+
} from "./worker/browser-client";
|
|
109
|
+
export type {
|
|
110
|
+
ArtifactWorkerClientEndpoint,
|
|
111
|
+
ArtifactWorkerClientErrorEvent,
|
|
112
|
+
ArtifactWorkerClientMessageEvent,
|
|
113
|
+
BrowserEditableArtifactWorkerKernel,
|
|
114
|
+
CreateBrowserEditableArtifactWorkerKernelOptions,
|
|
115
|
+
} from "./worker/browser-client";
|
|
116
|
+
|
|
117
|
+
// Exact spreadsheet command construction used by SDK-backed UI adapters.
|
|
118
|
+
// Re-exporting the narrow codec leaf keeps React consumers on the SDK public
|
|
119
|
+
// boundary instead of coupling them directly to contracts internals.
|
|
120
|
+
export {
|
|
121
|
+
SPREADSHEET_ARTIFACT_COMMAND_VERSION,
|
|
122
|
+
editableArtifactStableId,
|
|
123
|
+
spreadsheetSheetId,
|
|
124
|
+
type SpreadsheetArtifactCommandBatch,
|
|
125
|
+
type SpreadsheetCellInput,
|
|
126
|
+
type SpreadsheetSheetGeneration,
|
|
127
|
+
} from "@opengeni/contracts/spreadsheet-artifact-commands";
|
|
128
|
+
|
|
129
|
+
export {
|
|
130
|
+
DOCUMENT_ARTIFACT_COMMAND_VERSION,
|
|
131
|
+
encodeDocumentArtifactCommandBatch,
|
|
132
|
+
type DocumentArtifactCommand,
|
|
133
|
+
type DocumentArtifactCommandBatch,
|
|
134
|
+
type DocumentArtifactCommentReply,
|
|
135
|
+
type DocumentArtifactId,
|
|
136
|
+
type DocumentArtifactPageGeometry,
|
|
137
|
+
type DocumentArtifactPageGeometryProjection,
|
|
138
|
+
type DocumentArtifactParagraphStyle,
|
|
139
|
+
type DocumentArtifactProjection,
|
|
140
|
+
type DocumentArtifactProjectionItem,
|
|
141
|
+
type DocumentArtifactQuery,
|
|
142
|
+
type DocumentArtifactQueryLimits,
|
|
143
|
+
type DocumentArtifactTableStyle,
|
|
144
|
+
type DocumentArtifactTextRange,
|
|
145
|
+
type DocumentArtifactTextRun,
|
|
146
|
+
type DocumentArtifactTextStyle,
|
|
147
|
+
type DocumentArtifactTextStylePatch,
|
|
148
|
+
} from "@opengeni/contracts/document-artifact-commands";
|
|
149
|
+
|
|
150
|
+
export {
|
|
151
|
+
PRESENTATION_ARTIFACT_COMMAND_VERSION,
|
|
152
|
+
PRESENTATION_ARTIFACT_QUERY_MAX_NODES,
|
|
153
|
+
PRESENTATION_ARTIFACT_QUERY_MAX_SLIDES,
|
|
154
|
+
PRESENTATION_ARTIFACT_QUERY_MAX_TEXT_BYTES,
|
|
155
|
+
PRESENTATION_ARTIFACT_QUERY_RESPONSE_MAX_BYTES,
|
|
156
|
+
encodePresentationArtifactCommandBatch,
|
|
157
|
+
type PresentationArtifactEditorSceneNode,
|
|
158
|
+
type PresentationArtifactEditorSlideResponse,
|
|
159
|
+
type PresentationArtifactFill,
|
|
160
|
+
type PresentationArtifactLine,
|
|
161
|
+
type PresentationArtifactNodeKind,
|
|
162
|
+
type PresentationArtifactOwner,
|
|
163
|
+
type PresentationArtifactRect,
|
|
164
|
+
type PresentationArtifactRichText,
|
|
165
|
+
type PresentationArtifactCommand,
|
|
166
|
+
type PresentationArtifactCommandBatch,
|
|
167
|
+
type PresentationArtifactSlideCatalogItem,
|
|
168
|
+
type PresentationArtifactSlideCatalogResponse,
|
|
169
|
+
type PresentationArtifactSlideLayoutFacts,
|
|
170
|
+
type PresentationArtifactTableCell,
|
|
171
|
+
type PresentationArtifactTextParagraph,
|
|
172
|
+
type PresentationArtifactTextRun,
|
|
173
|
+
type PresentationArtifactTextStyle,
|
|
174
|
+
type PresentationArtifactTransform,
|
|
175
|
+
} from "@opengeni/contracts/presentation-artifact-commands";
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createEditableArtifactSyncController,
|
|
3
|
+
editableArtifactCacheNamespace,
|
|
4
|
+
type CreateEditableArtifactSyncControllerOptions,
|
|
5
|
+
type EditableArtifactSyncController,
|
|
6
|
+
} from "./controller";
|
|
7
|
+
import type { EditableArtifactId } from "./types";
|
|
8
|
+
|
|
9
|
+
export type EditableArtifactSyncLease = {
|
|
10
|
+
controller: EditableArtifactSyncController;
|
|
11
|
+
release: () => void;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type EditableArtifactSyncControllerFactory = (
|
|
15
|
+
artifactId: EditableArtifactId,
|
|
16
|
+
) => CreateEditableArtifactSyncControllerOptions;
|
|
17
|
+
|
|
18
|
+
/** Owns one ref-counted controller per exact auth/cache authority + artifact. */
|
|
19
|
+
export class EditableArtifactSyncPool {
|
|
20
|
+
private readonly entries = new Map<
|
|
21
|
+
string,
|
|
22
|
+
{
|
|
23
|
+
controller: EditableArtifactSyncController;
|
|
24
|
+
references: number;
|
|
25
|
+
retirementRevision: number;
|
|
26
|
+
}
|
|
27
|
+
>();
|
|
28
|
+
|
|
29
|
+
constructor(private readonly optionsFor: EditableArtifactSyncControllerFactory) {}
|
|
30
|
+
|
|
31
|
+
acquire(artifactId: EditableArtifactId): EditableArtifactSyncLease {
|
|
32
|
+
// Resolve current authority on every acquisition. A pool may outlive one
|
|
33
|
+
// login; artifact id alone is never sufficient cache/socket identity.
|
|
34
|
+
const options = this.optionsFor(artifactId);
|
|
35
|
+
const key = JSON.stringify([
|
|
36
|
+
editableArtifactCacheNamespace(options.storageAuthority),
|
|
37
|
+
artifactId,
|
|
38
|
+
]);
|
|
39
|
+
let entry = this.entries.get(key);
|
|
40
|
+
if (!entry) {
|
|
41
|
+
const controller = createEditableArtifactSyncController(options);
|
|
42
|
+
entry = { controller, references: 0, retirementRevision: 0 };
|
|
43
|
+
this.entries.set(key, entry);
|
|
44
|
+
controller.start();
|
|
45
|
+
}
|
|
46
|
+
entry.retirementRevision += 1;
|
|
47
|
+
entry.references += 1;
|
|
48
|
+
let released = false;
|
|
49
|
+
return {
|
|
50
|
+
controller: entry.controller,
|
|
51
|
+
release: () => {
|
|
52
|
+
if (released) return;
|
|
53
|
+
released = true;
|
|
54
|
+
const current = this.entries.get(key);
|
|
55
|
+
if (!current || current.controller !== entry?.controller) return;
|
|
56
|
+
current.references -= 1;
|
|
57
|
+
if (current.references === 0) {
|
|
58
|
+
const retirementRevision = ++current.retirementRevision;
|
|
59
|
+
// React StrictMode and route transitions may release/reacquire in the
|
|
60
|
+
// same task. Keep the one live controller through that handoff.
|
|
61
|
+
queueMicrotask(() => {
|
|
62
|
+
const latest = this.entries.get(key);
|
|
63
|
+
if (
|
|
64
|
+
latest !== current ||
|
|
65
|
+
latest.references !== 0 ||
|
|
66
|
+
latest.retirementRevision !== retirementRevision
|
|
67
|
+
) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
this.entries.delete(key);
|
|
71
|
+
void latest.controller.close();
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
get size(): number {
|
|
79
|
+
return this.entries.size;
|
|
80
|
+
}
|
|
81
|
+
}
|