@opengeni/sdk 3.3.2-canary.1 → 3.4.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 +1007 -72
- package/dist/adapters/express.d.ts +31 -0
- package/dist/adapters/express.js +87 -0
- package/dist/adapters/express.js.map +1 -0
- package/dist/adapters/hono.d.ts +16 -0
- package/dist/adapters/hono.js +8 -0
- package/dist/adapters/hono.js.map +1 -0
- package/dist/adapters/next.d.ts +29 -0
- package/dist/adapters/next.js +22 -0
- package/dist/adapters/next.js.map +1 -0
- package/dist/allowance-refusal.d.ts +2 -0
- package/dist/allowance-refusal.js +50 -0
- package/dist/allowance-refusal.js.map +1 -0
- package/dist/app-links.d.ts +42 -0
- package/dist/app-links.js +66 -0
- package/dist/app-links.js.map +1 -0
- package/dist/artifact-catalog.d.ts +40 -0
- package/dist/artifact-client.d.ts +20 -8
- package/dist/artifacts.d.ts +1 -1
- package/dist/artifacts.js +8 -6
- package/dist/automations.js +8 -2
- package/dist/automations.js.map +1 -1
- package/dist/azure-live-transport.d.ts +32 -0
- package/dist/browser.d.ts +6 -2
- package/dist/browser.js +25 -5
- package/dist/chat/fold.d.ts +75 -0
- package/dist/chat/handler.d.ts +41 -0
- package/dist/chat/http.d.ts +67 -0
- package/dist/chat/ids.d.ts +34 -0
- package/dist/chat/index.d.ts +9 -0
- package/dist/chat/index.js +1369 -0
- package/dist/chat/index.js.map +1 -0
- package/dist/chat/openai.d.ts +30 -0
- package/dist/chat/opengeni.d.ts +129 -0
- package/dist/chat/types.d.ts +207 -0
- package/dist/chat/vercel.d.ts +49 -0
- package/dist/chats.d.ts +8 -0
- package/dist/chunk-4AHR4KGA.js +301 -0
- package/dist/chunk-4AHR4KGA.js.map +1 -0
- package/dist/chunk-6GYGMLX4.js +332 -0
- package/dist/chunk-6GYGMLX4.js.map +1 -0
- package/dist/chunk-7EWT3PV6.js +368 -0
- package/dist/chunk-7EWT3PV6.js.map +1 -0
- package/dist/chunk-FTWVVPR6.js +1665 -0
- package/dist/chunk-FTWVVPR6.js.map +1 -0
- package/dist/{chunk-VYCTL62C.js → chunk-GZQSWAKD.js} +1 -1
- package/dist/chunk-GZQSWAKD.js.map +1 -0
- package/dist/chunk-KGEABAID.js +71 -0
- package/dist/chunk-KGEABAID.js.map +1 -0
- package/dist/{chunk-YKZME56C.js → chunk-KWADQ227.js} +3 -3
- package/dist/{chunk-YKZME56C.js.map → chunk-KWADQ227.js.map} +1 -1
- package/dist/{chunk-E5BNEG2D.js → chunk-NCU5OAN7.js} +27 -2
- package/dist/chunk-NCU5OAN7.js.map +1 -0
- package/dist/{chunk-BESZFWMU.js → chunk-OI5YLASH.js} +73 -2
- package/dist/chunk-OI5YLASH.js.map +1 -0
- package/dist/chunk-OV3POE62.js +359 -0
- package/dist/chunk-OV3POE62.js.map +1 -0
- package/dist/chunk-P7UWKORG.js +561 -0
- package/dist/chunk-P7UWKORG.js.map +1 -0
- package/dist/chunk-QGEIL4TR.js +195 -0
- package/dist/chunk-QGEIL4TR.js.map +1 -0
- package/dist/{chunk-GY6RQPCG.js → chunk-S2NLS3ES.js} +3598 -1278
- package/dist/chunk-S2NLS3ES.js.map +1 -0
- package/dist/chunk-UM4ZXXJR.js +9 -0
- package/dist/chunk-UM4ZXXJR.js.map +1 -0
- package/dist/{chunk-TFCLHRZK.js → chunk-UME3X7CP.js} +28 -32
- package/dist/chunk-UME3X7CP.js.map +1 -0
- package/dist/chunk-VT4YM4XQ.js +210 -0
- package/dist/chunk-VT4YM4XQ.js.map +1 -0
- package/dist/chunk-WSYYXONG.js +1602 -0
- package/dist/chunk-WSYYXONG.js.map +1 -0
- package/dist/{chunk-6NEPJ7NC.js → chunk-WVCJRSGJ.js} +119 -14
- package/dist/chunk-WVCJRSGJ.js.map +1 -0
- package/dist/chunk-X5ITQVXE.js +15 -0
- package/dist/chunk-X5ITQVXE.js.map +1 -0
- package/dist/chunk-XA7HVIHI.js +126 -0
- package/dist/chunk-XA7HVIHI.js.map +1 -0
- package/dist/{chunk-QTBAMHEF.js → chunk-YJCHB7R3.js} +60 -12
- package/dist/chunk-YJCHB7R3.js.map +1 -0
- package/dist/chunk-YKIHNLWD.js +153 -0
- package/dist/chunk-YKIHNLWD.js.map +1 -0
- package/dist/chunk-ZDUBPV33.js +277 -0
- package/dist/chunk-ZDUBPV33.js.map +1 -0
- package/dist/client.d.ts +1056 -118
- package/dist/codex-realtime-controller.d.ts +13 -0
- package/dist/codex-realtime-controller.js +4 -2
- package/dist/codex-realtime-v3-wire.d.ts +3 -2
- package/dist/codex-realtime.d.ts +5 -1
- package/dist/company-brain.d.ts +1 -11
- package/dist/core.d.ts +6 -2
- package/dist/core.js +23 -6
- package/dist/deprecation.d.ts +47 -0
- package/dist/document-authority-client.d.ts +24 -2
- package/dist/document-authority.js +7 -5
- package/dist/editable-artifacts/index.d.ts +1 -1
- package/dist/editable-artifacts/types.d.ts +12 -2
- package/dist/editable-artifacts.js +19 -3
- package/dist/editable-artifacts.js.map +1 -1
- package/dist/embedding-client.d.ts +129 -0
- package/dist/errors.d.ts +64 -1
- package/dist/external-vault-receiver.d.ts +203 -0
- package/dist/external-vault-receiver.js +564 -0
- package/dist/external-vault-receiver.js.map +1 -0
- package/dist/feedback.d.ts +23 -0
- package/dist/gateway-realtime-transport.js +1 -1
- package/dist/github-repositories.d.ts +10 -0
- package/dist/github-repositories.js +36 -0
- package/dist/github-repositories.js.map +1 -0
- package/dist/index.d.ts +61 -11
- package/dist/index.js +555 -338
- package/dist/index.js.map +1 -1
- package/dist/insights-usage.d.ts +33 -0
- package/dist/insights-usage.js +7 -0
- package/dist/insights-usage.js.map +1 -0
- package/dist/interaction.d.ts +165 -71
- package/dist/interaction.js +2 -2
- package/dist/knowledge.d.ts +7 -0
- package/dist/knowledge.js +20 -0
- package/dist/knowledge.js.map +1 -0
- package/dist/known-tools.d.ts +4 -0
- package/dist/message-links.d.ts +68 -0
- package/dist/model-context.d.ts +68 -0
- package/dist/model-display.d.ts +2 -0
- package/dist/model-display.js +17 -0
- package/dist/model-display.js.map +1 -0
- 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/pr-review-client.d.ts +1 -1
- package/dist/pr-review.d.ts +1 -1
- package/dist/pr-review.js.map +1 -1
- package/dist/preference-registry.d.ts +1 -1
- package/dist/prepared-mcp-setup.d.ts +5 -0
- package/dist/proxy.d.ts +13 -11
- package/dist/realtime.d.ts +1 -1
- package/dist/realtime.js +253 -7
- package/dist/realtime.js.map +1 -1
- package/dist/session-history-import.d.ts +22 -0
- package/dist/session-history-import.js +36 -0
- package/dist/session-history-import.js.map +1 -0
- package/dist/session-list-entries.d.ts +1 -0
- package/dist/session-list-entries.js +7 -0
- package/dist/session-list-entries.js.map +1 -0
- package/dist/session-message-search.d.ts +53 -0
- package/dist/session-proxy-client.d.ts +28 -0
- package/dist/session-proxy.d.ts +334 -0
- package/dist/session-proxy.js +24 -0
- package/dist/session-proxy.js.map +1 -0
- package/dist/session-titles.d.ts +2 -28
- package/dist/session-usage-limits.d.ts +10 -0
- package/dist/session-usage-limits.js +43 -0
- package/dist/session-usage-limits.js.map +1 -0
- package/dist/shared-catalog-loader.d.ts +34 -0
- package/dist/site-ai.d.ts +35 -0
- package/dist/site-bridge-host.d.ts +112 -0
- package/dist/site-bridge-host.js +286 -0
- package/dist/site-bridge-host.js.map +1 -0
- package/dist/site-browser-entry.d.ts +1 -0
- package/dist/site-browser-runtime.gen.d.ts +1 -0
- package/dist/site-data.d.ts +178 -0
- package/dist/site-document.d.ts +5 -0
- package/dist/site-document.js +20 -0
- package/dist/site-document.js.map +1 -0
- package/dist/site-document.test.d.ts +1 -0
- package/dist/site-http.d.ts +17 -0
- package/dist/site-sql.d.ts +31 -0
- package/dist/site-tool-bridge.d.ts +57 -0
- package/dist/site.d.ts +186 -0
- package/dist/site.js +63 -0
- package/dist/site.js.map +1 -0
- package/dist/skills.d.ts +75 -0
- package/dist/sse.d.ts +1 -1
- package/dist/stream.d.ts +2 -0
- package/dist/tenant-workspaces.d.ts +47 -0
- package/dist/tenant-workspaces.js +8 -0
- package/dist/tenant-workspaces.js.map +1 -0
- package/dist/tool-auth.d.ts +87 -0
- package/dist/tool-auth.js +23 -0
- package/dist/tool-auth.js.map +1 -0
- package/dist/tool-display-metadata.d.ts +3 -0
- package/dist/tools-37DCTCNZ.js +12 -0
- package/dist/tools-37DCTCNZ.js.map +1 -0
- package/dist/tools.d.ts +81 -0
- package/dist/transcription.d.ts +1 -1
- package/dist/types.d.ts +2785 -592
- package/dist/usage-allowances.d.ts +36 -0
- package/dist/usage-allowances.js +80 -0
- package/dist/usage-allowances.js.map +1 -0
- package/dist/vault-types.d.ts +324 -0
- package/dist/vaults-api.d.ts +65 -0
- package/dist/workspace-artifacts.d.ts +47 -5
- package/dist/workspace-instruction-policies.d.ts +2 -2
- package/dist/workspace-integrations.d.ts +74 -0
- package/dist/workspace-integrations.js +67 -0
- package/dist/workspace-integrations.js.map +1 -0
- package/dist/workspace-state.d.ts +8 -71
- package/package.json +99 -5
- package/src/adapters/express.ts +136 -0
- package/src/adapters/hono.ts +18 -0
- package/src/adapters/next.ts +42 -0
- package/src/allowance-refusal.ts +5 -0
- package/src/app-links.ts +117 -0
- package/src/artifact-catalog.ts +51 -0
- package/src/artifact-client.ts +40 -49
- package/src/artifacts.ts +1 -0
- package/src/automations-client.ts +8 -2
- package/src/azure-live-transport.ts +286 -0
- package/src/browser.ts +35 -0
- package/src/chat/fold.ts +431 -0
- package/src/chat/handler.ts +240 -0
- package/src/chat/http.ts +257 -0
- package/src/chat/ids.ts +85 -0
- package/src/chat/index.ts +88 -0
- package/src/chat/openai.ts +439 -0
- package/src/chat/opengeni.ts +737 -0
- package/src/chat/types.ts +219 -0
- package/src/chat/vercel.ts +204 -0
- package/src/chats.ts +16 -0
- package/src/client.ts +5595 -1847
- package/src/codex-realtime-controller.ts +163 -8
- package/src/codex-realtime-v3-wire.ts +4 -3
- package/src/codex-realtime-v3.ts +12 -3
- package/src/codex-realtime.ts +11 -3
- package/src/company-brain.ts +0 -40
- package/src/core.ts +18 -0
- package/src/deprecation.ts +149 -0
- package/src/document-authority-client.ts +104 -1
- package/src/editable-artifacts/controller.ts +36 -2
- package/src/editable-artifacts/index.ts +1 -0
- package/src/editable-artifacts/types.ts +29 -16
- package/src/embedding-client.ts +519 -0
- package/src/errors.ts +281 -5
- package/src/external-vault-receiver.ts +914 -0
- package/src/feedback.ts +20 -0
- package/src/gateway-realtime-transport.ts +3 -3
- package/src/github-repositories.ts +60 -0
- package/src/index.ts +592 -65
- package/src/insights-usage.ts +64 -0
- package/src/interaction.ts +315 -93
- package/src/knowledge.ts +72 -0
- package/src/known-tools.ts +279 -0
- package/src/message-links.ts +178 -0
- package/src/model-context.ts +113 -0
- package/src/model-display.ts +11 -0
- package/src/organization-integration-policy.ts +54 -0
- package/src/pr-review-client.ts +1 -1
- package/src/pr-review.ts +1 -1
- package/src/preference-registry.ts +2 -0
- package/src/prepared-mcp-setup.ts +123 -0
- package/src/proxy.ts +23 -12
- package/src/realtime.ts +15 -6
- package/src/session-history-import.ts +84 -0
- package/src/session-list-entries.ts +1 -0
- package/src/session-message-search.ts +47 -0
- package/src/session-proxy-client.ts +68 -0
- package/src/session-proxy.ts +2098 -0
- package/src/session-titles.ts +8 -82
- package/src/session-usage-limits.ts +71 -0
- package/src/shared-catalog-loader.ts +169 -0
- package/src/site-ai.ts +284 -0
- package/src/site-bridge-host.ts +422 -0
- package/src/site-browser-entry.ts +6 -0
- package/src/site-browser-runtime.gen.ts +2 -0
- package/src/site-data.ts +372 -0
- package/src/site-document.test.ts +64 -0
- package/src/site-document.ts +18 -0
- package/src/site-http.ts +171 -0
- package/src/site-sql.ts +153 -0
- package/src/site-tool-bridge.ts +401 -0
- package/src/site.ts +878 -0
- package/src/skills.ts +69 -0
- package/src/sse.ts +9 -3
- package/src/stream.ts +33 -10
- package/src/tenant-workspaces.ts +148 -0
- package/src/tool-auth.ts +301 -0
- package/src/tool-display-metadata.ts +27 -0
- package/src/tools.ts +452 -0
- package/src/transcription.ts +3 -0
- package/src/types.ts +3142 -594
- package/src/usage-allowances.ts +189 -0
- package/src/vault-types.ts +379 -0
- package/src/vaults-api.ts +339 -0
- package/src/workspace-artifacts.ts +55 -6
- package/src/workspace-instruction-policies.ts +2 -1
- package/src/workspace-integrations.ts +402 -0
- package/src/workspace-state.ts +8 -82
- package/dist/chunk-6NEPJ7NC.js.map +0 -1
- package/dist/chunk-BESZFWMU.js.map +0 -1
- package/dist/chunk-E5BNEG2D.js.map +0 -1
- package/dist/chunk-GY6RQPCG.js.map +0 -1
- package/dist/chunk-OO5LPTO7.js +0 -132
- package/dist/chunk-OO5LPTO7.js.map +0 -1
- package/dist/chunk-QTBAMHEF.js.map +0 -1
- package/dist/chunk-TFCLHRZK.js.map +0 -1
- package/dist/chunk-VYCTL62C.js.map +0 -1
|
@@ -28,7 +28,20 @@ export type CodexRealtimeControllerSnapshot = {
|
|
|
28
28
|
reconnectAttempt: number;
|
|
29
29
|
diagnostic: CodexRealtimeDiagnostic | null;
|
|
30
30
|
error: string | null;
|
|
31
|
+
/**
|
|
32
|
+
* Set when Opengeni refused or ended deployment-funded voice for credits or
|
|
33
|
+
* availability. Codes match voice input: `insufficient_credits`,
|
|
34
|
+
* `allowance_exhausted`, `monthly_model_cost_limit`, plus
|
|
35
|
+
* `realtime_voice_unavailable`. Cleared on the next start.
|
|
36
|
+
*/
|
|
37
|
+
refusal?: CodexRealtimeRefusal | null;
|
|
31
38
|
};
|
|
39
|
+
export type CodexRealtimeRefusal = {
|
|
40
|
+
code: string;
|
|
41
|
+
message: string;
|
|
42
|
+
};
|
|
43
|
+
/** A definitive credit/availability refusal from Opengeni, with its plain message. */
|
|
44
|
+
export declare function codexRealtimeRefusal(error: unknown): CodexRealtimeRefusal | null;
|
|
32
45
|
export type CodexRealtimeControllerClient = {
|
|
33
46
|
beginSessionRealtime(workspaceId: string, sessionId: string, request: BeginSessionRealtimeRequest): Promise<SessionRealtimeMutationResponse>;
|
|
34
47
|
heartbeatSessionRealtime(workspaceId: string, sessionId: string, realtimeId: string, request: RenewSessionRealtimeRequest): Promise<SessionRealtimeMutationResponse>;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CODEX_REALTIME_NEGOTIATION_TIMEOUT_MS,
|
|
3
|
+
codexRealtimeRefusal,
|
|
3
4
|
createCodexRealtimeController,
|
|
4
5
|
hasStoredSessionRealtimeOwnerProof,
|
|
5
6
|
projectSessionRealtimeLifecycle,
|
|
6
7
|
sessionRealtimeOwnerStorageKey,
|
|
7
8
|
sessionRealtimeOwnerStorageNamespace
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-WVCJRSGJ.js";
|
|
10
|
+
import "./chunk-7EWT3PV6.js";
|
|
10
11
|
export {
|
|
11
12
|
CODEX_REALTIME_NEGOTIATION_TIMEOUT_MS,
|
|
13
|
+
codexRealtimeRefusal,
|
|
12
14
|
createCodexRealtimeController,
|
|
13
15
|
hasStoredSessionRealtimeOwnerProof,
|
|
14
16
|
projectSessionRealtimeLifecycle,
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* These shapes are pinned to openai/codex@fa1d4c40. V3 delegates work with
|
|
5
5
|
* `delegation.created`; it does not expose the ordinary Realtime V2
|
|
6
|
-
* `function_call` protocol.
|
|
6
|
+
* `function_call` protocol. `transcript.segment` is an application adapter
|
|
7
|
+
* extension for providers that emit fragments without semantic turn boundaries.
|
|
7
8
|
*/
|
|
8
9
|
export declare const CODEX_REALTIME_INITIAL_ITEMS_MAX_COUNT = 128;
|
|
9
10
|
export declare const CODEX_REALTIME_INITIAL_ITEMS_MAX_TOKENS = 8192;
|
|
@@ -32,7 +33,7 @@ export type CodexRealtimeV3Event = (ProviderEventIdentity & {
|
|
|
32
33
|
startMs: number | null;
|
|
33
34
|
endMs: number | null;
|
|
34
35
|
}) | (ProviderEventIdentity & {
|
|
35
|
-
type: "turn.done";
|
|
36
|
+
type: "turn.done" | "transcript.segment";
|
|
36
37
|
turnId: string;
|
|
37
38
|
role: "user" | "assistant";
|
|
38
39
|
transcript: string;
|
package/dist/codex-realtime.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ export type AcquireCodexRealtimeMicrophoneOptions = {
|
|
|
15
15
|
};
|
|
16
16
|
export type StartCodexRealtimeWebrtcOptions = {
|
|
17
17
|
negotiate: CodexRealtimeNegotiator;
|
|
18
|
+
/** Exact configured provider model expected from the server broker. */
|
|
19
|
+
expectedModel?: CodexRealtimeWebrtcResponse["model"];
|
|
18
20
|
realtimeId: string;
|
|
19
21
|
operationId: string;
|
|
20
22
|
browserInstanceId: string;
|
|
@@ -54,6 +56,8 @@ export type CodexRealtimeWebrtcSession = {
|
|
|
54
56
|
setOutputMuted(muted: boolean): void;
|
|
55
57
|
activateRemoteAudio(): void;
|
|
56
58
|
retryAudibleOutput(): Promise<boolean>;
|
|
59
|
+
/** Gracefully finish provider output before sealing the durable ledger. */
|
|
60
|
+
drain?(): Promise<void>;
|
|
57
61
|
/** Idempotently close media, data channel, and peer transport. */
|
|
58
62
|
stop(): void;
|
|
59
63
|
};
|
|
@@ -61,7 +65,7 @@ export type CodexRealtimeWebrtcSession = {
|
|
|
61
65
|
* Complete the browser half of native connected-Codex GPT-Live V3 negotiation.
|
|
62
66
|
* Provider credentials never enter this boundary: `negotiate` sends SDP,
|
|
63
67
|
* public session configuration, and the active browser-owner proof only to the
|
|
64
|
-
*
|
|
68
|
+
* Opengeni API.
|
|
65
69
|
*/
|
|
66
70
|
export declare function startCodexRealtimeWebrtc(options: StartCodexRealtimeWebrtcOptions): Promise<CodexRealtimeWebrtcSession>;
|
|
67
71
|
export declare function acquireCodexRealtimeMicrophone(options?: AcquireCodexRealtimeMicrophoneOptions): Promise<MediaStream>;
|
package/dist/company-brain.d.ts
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import type { CompanyBrainContextReceiptPage as ContractCompanyBrainContextReceiptPage, CompanyBrainKnowledgeProposalPage as ContractCompanyBrainKnowledgeProposalPage, CompanyBrainOkfPackage as ContractCompanyBrainOkfPackage
|
|
1
|
+
import type { CompanyBrainContextReceiptPage as ContractCompanyBrainContextReceiptPage, CompanyBrainKnowledgeProposalPage as ContractCompanyBrainKnowledgeProposalPage, CompanyBrainOkfPackage as ContractCompanyBrainOkfPackage } from "@opengeni/contracts";
|
|
2
2
|
export type CompanyBrainOkfPackage = ContractCompanyBrainOkfPackage;
|
|
3
3
|
export type CompanyBrainContextReceiptPage = ContractCompanyBrainContextReceiptPage;
|
|
4
4
|
export type CompanyBrainKnowledgeProposalPage = ContractCompanyBrainKnowledgeProposalPage;
|
|
5
|
-
export type CompanyBrainKnowledgeSearchRequest = ContractKnowledgeSearchRequest;
|
|
6
|
-
export type CompanyBrainKnowledgeSearchResponse = ContractKnowledgeSearchResponse;
|
|
7
|
-
export type CompanyBrainKnowledgeBrowseRequest = ContractKnowledgeBrowseRequest;
|
|
8
|
-
export type CompanyBrainKnowledgeBrowseResponse = ContractKnowledgeBrowseResponse;
|
|
9
|
-
export type CompanyBrainKnowledgeGetResponse = ContractKnowledgeGetResponse;
|
|
10
|
-
export type CompanyBrainKnowledgeRecord = ContractKnowledgeRecord;
|
|
11
5
|
export type CompanyBrainContextReceiptListOptions = {
|
|
12
6
|
attemptId?: string;
|
|
13
7
|
cursor?: string;
|
|
@@ -19,10 +13,6 @@ export type CompanyBrainKnowledgeProposalListOptions = {
|
|
|
19
13
|
export type CompanyBrainInspectorTransport = {
|
|
20
14
|
requestJson<T>(method: string, path: string, body?: unknown): Promise<T>;
|
|
21
15
|
};
|
|
22
|
-
/** Human-authorized, permission-first Knowledge search for Company Brain inspectors. */
|
|
23
|
-
export declare function searchCompanyBrainKnowledge(client: CompanyBrainInspectorTransport, workspaceId: string, request: CompanyBrainKnowledgeSearchRequest): Promise<CompanyBrainKnowledgeSearchResponse>;
|
|
24
|
-
export declare function getCompanyBrainKnowledge(client: CompanyBrainInspectorTransport, workspaceId: string, recordId: string): Promise<CompanyBrainKnowledgeGetResponse>;
|
|
25
|
-
export declare function browseCompanyBrainKnowledge(client: CompanyBrainInspectorTransport, workspaceId: string, request?: CompanyBrainKnowledgeBrowseRequest): Promise<CompanyBrainKnowledgeBrowseResponse>;
|
|
26
16
|
export declare function listCompanyBrainContextReceipts(client: CompanyBrainInspectorTransport, workspaceId: string, options?: CompanyBrainContextReceiptListOptions): Promise<CompanyBrainContextReceiptPage>;
|
|
27
17
|
export declare function listCompanyBrainKnowledgeProposals(client: CompanyBrainInspectorTransport, workspaceId: string, options?: CompanyBrainKnowledgeProposalListOptions): Promise<CompanyBrainKnowledgeProposalPage>;
|
|
28
18
|
export type CompanyBrainOkfDownload = {
|
package/dist/core.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
/** Backward-compatible non-artifact client surface. */
|
|
2
2
|
export { OpenGeniDocumentAuthorityClient as OpenGeniCoreClient } from "./document-authority-client.js";
|
|
3
|
-
export
|
|
4
|
-
export {
|
|
3
|
+
export { OpenGeniToolCallError, OpenGeniToolReapprovalRequiredError, OpenGeniToolsClient, } from "./tools.js";
|
|
4
|
+
export type { OpenGeniGeneratedTools, OpenGeniDynamicToolNode, OpenGeniToolCallOptions, OpenGeniToolFunction, OpenGeniToolsFacade, OpenGeniWorkspaceTools, } from "./tools.js";
|
|
5
|
+
export type { FetchLike, FetchResponse, GetSessionOptions, OpenGeniClientOptions, OpenGeniRequestOptions, SendMessageInput, SteerMessageResult, TranscribeAudioInput, WorkspaceControlEventPage, } from "./client.js";
|
|
6
|
+
export { OpenGeniApiContractMismatchError, OpenGeniApiError, OpenGeniSetupError, OpenGeniSecureContextRequiredError, OpenGeniSessionListCursorError, OpenGeniStreamError, formatErrorMessage, isRetryableStreamError, } from "./errors.js";
|
|
5
7
|
export type { OpenGeniSecureContextRequiredReason } from "./errors.js";
|
|
8
|
+
export { parseDeprecationNotice } from "./deprecation.js";
|
|
9
|
+
export type { OpenGeniDeprecationHandler, OpenGeniDeprecationNotice } from "./deprecation.js";
|
|
6
10
|
export { resolveWorkspaceVoiceInputEnabled } from "./transcription.js";
|
|
7
11
|
export { OPENGENI_API_CONTRACT_HEADER, OPENGENI_API_CONTRACT_REVISION } from "./types.js";
|
package/dist/core.js
CHANGED
|
@@ -1,23 +1,34 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OpenGeniDocumentAuthorityClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OI5YLASH.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveWorkspaceVoiceInputEnabled
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import
|
|
6
|
+
} from "./chunk-GZQSWAKD.js";
|
|
7
|
+
import {
|
|
8
|
+
OpenGeniToolCallError,
|
|
9
|
+
OpenGeniToolReapprovalRequiredError,
|
|
10
|
+
OpenGeniToolsClient
|
|
11
|
+
} from "./chunk-P7UWKORG.js";
|
|
12
|
+
import {
|
|
13
|
+
parseDeprecationNotice
|
|
14
|
+
} from "./chunk-S2NLS3ES.js";
|
|
15
|
+
import "./chunk-X5ITQVXE.js";
|
|
16
|
+
import "./chunk-4AHR4KGA.js";
|
|
8
17
|
import {
|
|
9
18
|
OPENGENI_API_CONTRACT_HEADER,
|
|
10
19
|
OPENGENI_API_CONTRACT_REVISION
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-NCU5OAN7.js";
|
|
21
|
+
import "./chunk-YJCHB7R3.js";
|
|
13
22
|
import {
|
|
14
23
|
OpenGeniApiContractMismatchError,
|
|
15
24
|
OpenGeniApiError,
|
|
16
25
|
OpenGeniSecureContextRequiredError,
|
|
17
26
|
OpenGeniSessionListCursorError,
|
|
27
|
+
OpenGeniSetupError,
|
|
18
28
|
OpenGeniStreamError,
|
|
29
|
+
formatErrorMessage,
|
|
19
30
|
isRetryableStreamError
|
|
20
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-7EWT3PV6.js";
|
|
21
32
|
export {
|
|
22
33
|
OPENGENI_API_CONTRACT_HEADER,
|
|
23
34
|
OPENGENI_API_CONTRACT_REVISION,
|
|
@@ -26,8 +37,14 @@ export {
|
|
|
26
37
|
OpenGeniDocumentAuthorityClient as OpenGeniCoreClient,
|
|
27
38
|
OpenGeniSecureContextRequiredError,
|
|
28
39
|
OpenGeniSessionListCursorError,
|
|
40
|
+
OpenGeniSetupError,
|
|
29
41
|
OpenGeniStreamError,
|
|
42
|
+
OpenGeniToolCallError,
|
|
43
|
+
OpenGeniToolReapprovalRequiredError,
|
|
44
|
+
OpenGeniToolsClient,
|
|
45
|
+
formatErrorMessage,
|
|
30
46
|
isRetryableStreamError,
|
|
47
|
+
parseDeprecationNotice,
|
|
31
48
|
resolveWorkspaceVoiceInputEnabled
|
|
32
49
|
};
|
|
33
50
|
//# sourceMappingURL=core.js.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deprecation notices advertised by the Opengeni API.
|
|
3
|
+
*
|
|
4
|
+
* Per the public API compatibility policy, a route whose behaviour is scheduled
|
|
5
|
+
* for removal answers with the standard `Deprecation` (RFC 9745) and `Sunset`
|
|
6
|
+
* (RFC 8594) headers plus `Link: <notes>; rel="deprecation"`. The client
|
|
7
|
+
* surfaces them through `OpenGeniClientOptions.onDeprecation`, or by default
|
|
8
|
+
* as a one-time `console.warn` per route, so an integrator pinned to an older
|
|
9
|
+
* SDK learns about a removal well before it happens.
|
|
10
|
+
*/
|
|
11
|
+
export type OpenGeniDeprecationNotice = {
|
|
12
|
+
/** Request method, upper case. */
|
|
13
|
+
method: string;
|
|
14
|
+
/** Request path with ids collapsed (`/v1/workspaces/:id/...`), stable per route. */
|
|
15
|
+
route: string;
|
|
16
|
+
/** Exact request path. */
|
|
17
|
+
path: string;
|
|
18
|
+
/** When the deprecation was announced, if the header carried a date. */
|
|
19
|
+
deprecatedAt: Date | null;
|
|
20
|
+
/** Earliest removal on the server, if advertised. */
|
|
21
|
+
sunset: Date | null;
|
|
22
|
+
/** Migration notes (`rel="deprecation"`), if advertised. */
|
|
23
|
+
link: string | null;
|
|
24
|
+
/** Replacement (`rel="successor-version"`), if advertised. */
|
|
25
|
+
successor: string | null;
|
|
26
|
+
};
|
|
27
|
+
/** `false` silences notices; a function receives each route's notice once per client. */
|
|
28
|
+
export type OpenGeniDeprecationHandler = (notice: OpenGeniDeprecationNotice) => void;
|
|
29
|
+
type HeaderBag = {
|
|
30
|
+
get(name: string): string | null;
|
|
31
|
+
};
|
|
32
|
+
/** Read a deprecation notice from response headers; `null` when none is advertised. */
|
|
33
|
+
export declare function parseDeprecationNotice(method: string, url: string, headers: HeaderBag): OpenGeniDeprecationNotice | null;
|
|
34
|
+
/** The default handler: one `console.warn` per route per process. */
|
|
35
|
+
export declare function warnDeprecationOnce(notice: OpenGeniDeprecationNotice): void;
|
|
36
|
+
type FetchFunction<R extends {
|
|
37
|
+
headers: HeaderBag;
|
|
38
|
+
}> = (input: string | URL | Request, init?: RequestInit) => Promise<R>;
|
|
39
|
+
/**
|
|
40
|
+
* Wrap a fetch implementation so every response is inspected for a deprecation
|
|
41
|
+
* notice. The handler runs at most once per route for this wrapper and never
|
|
42
|
+
* affects the request: a throwing handler is swallowed.
|
|
43
|
+
*/
|
|
44
|
+
export declare function withDeprecationNotices<R extends {
|
|
45
|
+
headers: HeaderBag;
|
|
46
|
+
}>(fetchImpl: FetchFunction<R>, handler: OpenGeniDeprecationHandler | false | undefined): FetchFunction<R>;
|
|
47
|
+
export {};
|
|
@@ -1,13 +1,35 @@
|
|
|
1
|
+
import type { CompanyBrainOkfDownload, CompanyBrainOkfPackage } from "./company-brain.js";
|
|
1
2
|
import { OpenGeniClient as OpenGeniCoreClient } from "./client.js";
|
|
2
|
-
import type { DocumentAuthorityReclassification, DocumentDefaultCollectionBackfill, DocumentDefaultCollectionBackfillAudit, GetDocumentDefaultCollectionBackfillAuditOptions, ListDocumentAuthorityReclassificationsOptions, ListDocumentAuthorityReclassificationsResponse, ListDocumentDefaultCollectionBackfillRunsResponse, ListOrganizationDocumentAuthorityReclassificationsResponse, ReclassifyDocumentAuthorityRequest, RunDocumentDefaultCollectionBackfillRequest } from "./types.js";
|
|
3
|
+
import type { ApiKey, UpdateOrganizationApiKeyRequest, Document, IssueUserResourceGrantRequest, UserResourceGrantMutationResponse, DocumentBase, FileDownloadUrlResponse, DocumentAuthorityReclassification, DocumentDefaultCollectionBackfill, DocumentDefaultCollectionBackfillAudit, GetDocumentDefaultCollectionBackfillAuditOptions, ListDocumentAuthorityReclassificationsOptions, ListDocumentAuthorityReclassificationsResponse, ListDocumentDefaultCollectionBackfillRunsResponse, ListOrganizationDocumentAuthorityReclassificationsResponse, ReclassifyDocumentAuthorityRequest, RunDocumentDefaultCollectionBackfillRequest } from "./types.js";
|
|
3
4
|
/**
|
|
4
|
-
* Operator-only
|
|
5
|
+
* Operator-only authority administration and Document tenancy-backfill surface.
|
|
5
6
|
*
|
|
6
7
|
* The public root and legacy `core` clients extend this class for compatibility.
|
|
7
8
|
* Browser consoles that import `@opengeni/sdk/browser` do not retain these
|
|
8
9
|
* methods or their routes.
|
|
9
10
|
*/
|
|
10
11
|
export declare class OpenGeniDocumentAuthorityClient extends OpenGeniCoreClient {
|
|
12
|
+
/** Read organization-key metadata and policy; never returns the secret token. */
|
|
13
|
+
getOrganizationApiKey(organizationId: string, apiKeyId: string): Promise<ApiKey>;
|
|
14
|
+
/** Update metadata or replace the policy. Policy narrowing applies on the next request. */
|
|
15
|
+
updateOrganizationApiKey(organizationId: string, apiKeyId: string, request: UpdateOrganizationApiKeyRequest): Promise<ApiKey>;
|
|
16
|
+
/** Issue an exact-session or standing personal-resource grant. */
|
|
17
|
+
issueUserResourceGrant(workspaceId: string, authorityId: string, request: IssueUserResourceGrantRequest): Promise<UserResourceGrantMutationResponse>;
|
|
18
|
+
listDocumentBases(workspaceId: string): Promise<DocumentBase[]>;
|
|
19
|
+
/**
|
|
20
|
+
* List every Document the current human can manage from this workspace,
|
|
21
|
+
* including portable personal and organization-scoped Documents whose
|
|
22
|
+
* immutable ingestion workspace is different.
|
|
23
|
+
*/
|
|
24
|
+
listAccessibleDocuments(workspaceId: string): Promise<Document[]>;
|
|
25
|
+
/** Mint a source-file URL through the Document's effective authority. */
|
|
26
|
+
createDocumentOriginalFileDownloadUrl(workspaceId: string, documentId: string): Promise<FileDownloadUrlResponse>;
|
|
27
|
+
/** Retry indexing for a failed document. */
|
|
28
|
+
reindexDocument(workspaceId: string, baseId: string, documentId: string): Promise<Document>;
|
|
29
|
+
/** Permission-filtered Company Brain package with authorized guidance bodies. */
|
|
30
|
+
getCompanyBrain(workspaceId: string): Promise<CompanyBrainOkfPackage>;
|
|
31
|
+
/** Download the deterministic Markdown/YAML Company Brain package. */
|
|
32
|
+
exportCompanyBrainOkf(workspaceId: string): Promise<CompanyBrainOkfDownload>;
|
|
11
33
|
/**
|
|
12
34
|
* Atomically reclassify a Document's authority and every indexed chunk.
|
|
13
35
|
* The operation is replay-safe and rejects a stale expected authority tuple.
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OpenGeniDocumentAuthorityClient
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-OI5YLASH.js";
|
|
4
|
+
import "./chunk-S2NLS3ES.js";
|
|
5
|
+
import "./chunk-X5ITQVXE.js";
|
|
6
|
+
import "./chunk-4AHR4KGA.js";
|
|
7
|
+
import "./chunk-NCU5OAN7.js";
|
|
8
|
+
import "./chunk-YJCHB7R3.js";
|
|
9
|
+
import "./chunk-7EWT3PV6.js";
|
|
8
10
|
export {
|
|
9
11
|
OpenGeniDocumentAuthorityClient
|
|
10
12
|
};
|
|
@@ -13,7 +13,7 @@ export { EditableArtifactSyncPool } from "./pool.js";
|
|
|
13
13
|
export type { EditableArtifactSyncControllerFactory, EditableArtifactSyncLease } from "./pool.js";
|
|
14
14
|
export { createEditableArtifactSession } from "./session.js";
|
|
15
15
|
export type { CreateEditableArtifactSessionOptions, ApplySerializedArtifactCommandsOptions, ApplySpreadsheetCommandsOptions, CreateDocumentParagraphInput, CreateDocumentParagraphResult, CreatePresentationSlideInput, CreatePresentationSlideResult, CreateSpreadsheetSheetInput, CreateSpreadsheetSheetResult, EditableArtifactSession, EditableSpreadsheetMetadataListener, EditableSpreadsheetViewportListener, EditableSpreadsheetViewportSubscriptionOptions, } from "./session.js";
|
|
16
|
-
export type { EditableArtifactBootstrap, EditableArtifactBlockedPending, EditableArtifactCausalEntry, EditableArtifactCausalFrontier, EditableArtifactCommittedTransaction, EditableArtifactId, EditableArtifactModality, EditableArtifactLiveClose, EditableArtifactLiveConnection, EditableArtifactLiveLimits, EditableArtifactLiveMessage, EditableArtifactPendingTransaction, EditableArtifactSerializedCommittedTransaction, EditableArtifactSerializedModality, EditableArtifactSerializedPendingTransaction, EditableArtifactSerializedSnapshot, EditableArtifactReplayPage, EditableArtifactSnapshot, EditableArtifactSpreadsheetCommittedTransaction, EditableArtifactSpreadsheetPendingTransaction, EditableArtifactSpreadsheetSnapshot, EditableArtifactStoredReplica, EditableArtifactSubmitReceipt, EditableArtifactSyncListener, EditableArtifactSyncScheduler, EditableArtifactSyncState, EditableArtifactSyncTicket, EditableArtifactSyncTransport, EditableArtifactSyncView, EditableArtifactWorkerKernel, EditableDocumentProjection, EditableDocumentQuery, EditablePresentationProjection, EditablePresentationQuery, EditablePresentationEditorSlideProjection, EditablePresentationEditorSlideQuery, EditablePresentationSlideCatalogProjection, EditablePresentationSlideCatalogQuery, EditableSpreadsheetCellValue, EditableSpreadsheetFormulaError, EditableSpreadsheetMetadataProjection, EditableSpreadsheetMetadataQuery, EditableSpreadsheetProjectedCell, EditableSpreadsheetSheetMetadata, EditableSpreadsheetUsedBounds, EditableSpreadsheetViewportProjection, EditableSpreadsheetViewportQuery, } from "./types.js";
|
|
16
|
+
export type { EditableArtifactBootstrap, EditableArtifactBlockedPending, EditableArtifactCausalEntry, EditableArtifactCausalFrontier, EditableArtifactCommittedTransaction, EditableArtifactId, EditableArtifactModality, EditableArtifactLiveClose, EditableArtifactLiveConnection, EditableArtifactLiveLimits, EditableArtifactLiveMessage, EditableArtifactPendingTransaction, EditableArtifactSerializedCommittedTransaction, EditableArtifactSerializedModality, EditableArtifactSerializedPendingTransaction, EditableArtifactSerializedSnapshot, EditableArtifactReplayPage, EditableArtifactSnapshot, EditableArtifactSpreadsheetCommittedTransaction, EditableArtifactSpreadsheetPendingTransaction, EditableArtifactSpreadsheetSnapshot, EditableArtifactStoredReplica, EditableArtifactSubmitReceipt, EditableArtifactSyncListener, EditableArtifactSyncScheduler, EditableArtifactSyncState, EditableArtifactSyncTicket, EditableArtifactSyncTransport, EditableArtifactSyncView, EditableArtifactWorkerKernel, EditableDocumentProjection, EditableDocumentQuery, EditablePresentationProjection, EditablePresentationQuery, EditablePresentationEditorSlideProjection, EditablePresentationEditorSlideQuery, EditablePresentationSlideCatalogProjection, EditablePresentationSlideCatalogQuery, EditableSpreadsheetCellValue, EditableSpreadsheetDimensions, EditableSpreadsheetFormulaError, EditableSpreadsheetMetadataProjection, EditableSpreadsheetMetadataQuery, EditableSpreadsheetProjectedCell, EditableSpreadsheetSheetMetadata, EditableSpreadsheetUsedBounds, EditableSpreadsheetViewportProjection, EditableSpreadsheetViewportQuery, } from "./types.js";
|
|
17
17
|
export { ArtifactWorkerClientError, createBrowserEditableArtifactWorkerKernel, } from "./worker/browser-client.js";
|
|
18
18
|
export type { ArtifactWorkerClientEndpoint, ArtifactWorkerClientErrorEvent, ArtifactWorkerClientMessageEvent, BrowserEditableArtifactWorkerKernel, CreateBrowserEditableArtifactWorkerKernelOptions, } from "./worker/browser-client.js";
|
|
19
19
|
export { SPREADSHEET_ARTIFACT_COMMAND_VERSION, editableArtifactStableId, spreadsheetSheetId, type SpreadsheetArtifactCommandBatch, type SpreadsheetCellInput, type SpreadsheetSheetGeneration, } from "@opengeni/contracts/spreadsheet-artifact-commands";
|
|
@@ -148,7 +148,15 @@ export type EditableSpreadsheetProjectedCell = Readonly<{
|
|
|
148
148
|
* Immutable projection of one exact speculative kernel revision. Cells are
|
|
149
149
|
* sparse, strictly row-major, unique, and all inside the requested rectangle.
|
|
150
150
|
*/
|
|
151
|
-
export type
|
|
151
|
+
export type EditableSpreadsheetDimensions = Readonly<{
|
|
152
|
+
/** Integer CSS pixels. Present when the kernel models dimensions. */
|
|
153
|
+
defaultRowHeight?: number;
|
|
154
|
+
defaultColumnWidth?: number;
|
|
155
|
+
/** Sorted sparse absolute zero-based indices and non-default pixel sizes. */
|
|
156
|
+
rowHeights?: readonly (readonly [number, number])[];
|
|
157
|
+
columnWidths?: readonly (readonly [number, number])[];
|
|
158
|
+
}>;
|
|
159
|
+
export type EditableSpreadsheetViewportProjection = EditableSpreadsheetDimensions & Readonly<{
|
|
152
160
|
revision: bigint;
|
|
153
161
|
sheetId: string;
|
|
154
162
|
/** Creation operation that pins the live CRDT generation, if collaborative. */
|
|
@@ -167,7 +175,7 @@ export type EditableSpreadsheetUsedBounds = Readonly<{
|
|
|
167
175
|
/** Inclusive maximum occupied column. */
|
|
168
176
|
endColumn: number;
|
|
169
177
|
}>;
|
|
170
|
-
export type EditableSpreadsheetSheetMetadata = Readonly<{
|
|
178
|
+
export type EditableSpreadsheetSheetMetadata = EditableSpreadsheetDimensions & Readonly<{
|
|
171
179
|
sheetId: string;
|
|
172
180
|
generationId: string | null;
|
|
173
181
|
name: string;
|
|
@@ -403,6 +411,8 @@ export type EditableArtifactSyncView = {
|
|
|
403
411
|
writable: boolean;
|
|
404
412
|
pendingTransactions: number;
|
|
405
413
|
blockedPending: readonly EditableArtifactBlockedPending[];
|
|
414
|
+
/** A command barrier independent of the artifact's edit permission. */
|
|
415
|
+
authoringBlockedReason?: "pending_conflict" | "prior_writer" | undefined;
|
|
406
416
|
queuedMessages: number;
|
|
407
417
|
reconnectAttempt: number;
|
|
408
418
|
lastError: Error | null;
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
import {
|
|
19
19
|
OPENGENI_API_CONTRACT_HEADER,
|
|
20
20
|
OPENGENI_API_CONTRACT_REVISION
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-NCU5OAN7.js";
|
|
22
22
|
|
|
23
23
|
// src/editable-artifacts/controller.ts
|
|
24
24
|
import {
|
|
@@ -1562,6 +1562,10 @@ var EditableArtifactSyncControllerImpl = class {
|
|
|
1562
1562
|
this.rejectLiveWaiters(new Error("artifact sync controller closed"));
|
|
1563
1563
|
}
|
|
1564
1564
|
getView() {
|
|
1565
|
+
const blockedPending = this.allBlockedPending();
|
|
1566
|
+
const authoringBlockedReason = this.modality !== "spreadsheet" && blockedPending.length > 0 ? "pending_conflict" : this.orderedPending().some(
|
|
1567
|
+
(transaction) => transaction.replicaId !== this.writerReplicaId
|
|
1568
|
+
) ? "prior_writer" : void 0;
|
|
1565
1569
|
return {
|
|
1566
1570
|
artifactId: this.artifactId,
|
|
1567
1571
|
modality: this.modality,
|
|
@@ -1570,7 +1574,8 @@ var EditableArtifactSyncControllerImpl = class {
|
|
|
1570
1574
|
headSequence: this.headSequence,
|
|
1571
1575
|
writable: this.writable,
|
|
1572
1576
|
pendingTransactions: this.pending.size,
|
|
1573
|
-
blockedPending
|
|
1577
|
+
blockedPending,
|
|
1578
|
+
authoringBlockedReason,
|
|
1574
1579
|
queuedMessages: this.liveQueue.length,
|
|
1575
1580
|
reconnectAttempt: this.reconnectAttempt,
|
|
1576
1581
|
lastError: this.lastError
|
|
@@ -1847,8 +1852,9 @@ var EditableArtifactSyncControllerImpl = class {
|
|
|
1847
1852
|
let stateHash = stored.snapshot.stateHash;
|
|
1848
1853
|
let causalFrontier = stored.snapshot.modality === "spreadsheet" ? stored.snapshot.causalFrontier : null;
|
|
1849
1854
|
let nativeRevision = stored.snapshot.modality === "spreadsheet" ? null : stored.snapshot.nativeRevision;
|
|
1855
|
+
const retainedAcceptances = [];
|
|
1850
1856
|
for (const transaction of stored.tail) {
|
|
1851
|
-
validateCommittedTransaction(
|
|
1857
|
+
const embeddedPending = validateCommittedTransaction(
|
|
1852
1858
|
transaction,
|
|
1853
1859
|
this.artifactId,
|
|
1854
1860
|
this.modality,
|
|
@@ -1861,6 +1867,12 @@ var EditableArtifactSyncControllerImpl = class {
|
|
|
1861
1867
|
requireStateHash(transaction.priorStateHash, stateHash, "retained transaction prior state");
|
|
1862
1868
|
const applied = await this.kernel.applyRecovered(transaction);
|
|
1863
1869
|
requireStateHash(applied.stateHash, transaction.stateHash, "retained transaction");
|
|
1870
|
+
if (embeddedPending) {
|
|
1871
|
+
const pending = this.pending.get(embeddedPending.clientTransactionId);
|
|
1872
|
+
if (pending?.requestHash === embeddedPending.requestHash && bytesEqual2(pending.intentBytes, embeddedPending.intentBytes)) {
|
|
1873
|
+
retainedAcceptances.push({ transaction, pending: embeddedPending });
|
|
1874
|
+
}
|
|
1875
|
+
}
|
|
1864
1876
|
cursor = transaction.endSequence;
|
|
1865
1877
|
stateHash = transaction.stateHash;
|
|
1866
1878
|
if (transaction.modality === "spreadsheet") {
|
|
@@ -1893,6 +1905,10 @@ var EditableArtifactSyncControllerImpl = class {
|
|
|
1893
1905
|
this.retainedTailTransactions = stored.tail.length;
|
|
1894
1906
|
this.cursor = cursor;
|
|
1895
1907
|
this.headSequence = cursor;
|
|
1908
|
+
for (const { transaction, pending } of retainedAcceptances) {
|
|
1909
|
+
this.recordAcceptedMappingIdentity(transaction.transactionId, pending);
|
|
1910
|
+
await this.settlePending(transaction, true);
|
|
1911
|
+
}
|
|
1896
1912
|
}
|
|
1897
1913
|
async run() {
|
|
1898
1914
|
await this.initialize();
|