@neta-art/cohub 6.0.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 +6 -5
- package/dist/board/animation.d.ts +2 -1
- package/dist/board/animation.js +0 -1
- package/dist/board/core/connections.js +4 -4
- package/dist/board/core/export-plan.js +1 -1
- package/dist/board/core/shape-types.js +0 -1
- package/dist/board/index.d.ts +6 -5
- package/dist/board/index.js +7 -7
- package/dist/board/mutation.d.ts +2 -11
- package/dist/board/mutation.js +2 -56
- package/dist/board/render/renderers/text-card-renderer.js +1 -1
- package/dist/board/semantic-document.d.ts +30 -0
- package/dist/board/semantic-document.js +271 -0
- package/dist/board/semantic-mutation.d.ts +10 -0
- package/dist/board/semantic-mutation.js +203 -0
- package/dist/chunks/http.d.ts +15 -94
- package/dist/chunks/http.js +248 -1588
- package/dist/chunks/transport.js +1 -1
- package/dist/chunks/websocket.d.ts +3646 -3139
- package/dist/chunks/websocket.js +1 -1
- package/dist/http.d.ts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1045 -195
- package/dist/protocol/dist/board-authoring.d.ts +1305 -1
- package/dist/protocol/dist/board-authoring.js +80 -6
- package/dist/protocol/dist/board-codec.d.ts +2 -2
- package/dist/protocol/dist/board-codec.js +19 -4
- package/dist/protocol/dist/board-composition.d.ts +126 -1
- package/dist/protocol/dist/board-composition.js +1 -9
- package/dist/protocol/dist/board-connection.d.ts +16 -16
- package/dist/protocol/dist/board-connection.js +16 -16
- package/dist/protocol/dist/board-document.d.ts +34 -3
- package/dist/protocol/dist/board-document.js +3 -1
- package/dist/protocol/dist/board-effect.d.ts +94 -0
- package/dist/protocol/dist/board-effect.js +53 -0
- package/dist/protocol/dist/board-json.js +16 -0
- package/dist/protocol/dist/board.d.ts +34 -164
- package/dist/protocol/dist/board.js +44 -45
- package/dist/protocol/dist/index.d.ts +7 -7
- package/dist/types.d.ts +3 -1
- package/package.json +1 -2
- package/dist/board/codec.d.ts +0 -27
- package/dist/board/codec.js +0 -277
- package/dist/protocol/dist/board-content.js +0 -26
- package/dist/protocol/dist/board-upgrade.d.ts +0 -1
- package/dist/protocol/dist/board-upgrade.js +0 -2
- package/dist/protocol/dist/identifiers.js +0 -10
- package/dist/protocol/dist/index.js +0 -19
- package/dist/protocol/dist/provenance.js +0 -15
- package/dist/protocol/dist/public-identifiers.js +0 -38
- package/dist/protocol/dist/realtime/board-awareness.js +0 -119
- package/dist/protocol/dist/ui-command.js +0 -2
- package/dist/protocol/dist/work-promotion-stats.js +0 -11
- package/dist/protocol/dist/work-surface.js +0 -2
- package/dist/protocol/dist/work-view-stats.js +0 -3
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { BoardAuthoringItemSchema } from "../protocol/dist/board-authoring.js";
|
|
2
|
+
import { BoardAppearanceSchema, isUnknownItem } from "../protocol/dist/board-document.js";
|
|
3
|
+
import { applyBoardItemPatch } from "../protocol/dist/board-codec.js";
|
|
4
|
+
import { boardJsonEquals } from "../protocol/dist/board-json.js";
|
|
5
|
+
import { boardAuthoringItemToDocumentItem, boardItemToAuthoringItem } from "./semantic-document.js";
|
|
6
|
+
//#region src/board/semantic-mutation.ts
|
|
7
|
+
function semanticItem(item) {
|
|
8
|
+
const value = boardItemToAuthoringItem(item);
|
|
9
|
+
if (value) return value;
|
|
10
|
+
const raw = isUnknownItem(item) ? BoardAuthoringItemSchema.safeParse(item.raw) : null;
|
|
11
|
+
if (raw?.success) return raw.data;
|
|
12
|
+
throw new Error(`Cannot author unknown Board item ${item.id}; the item has no semantic extension schema`);
|
|
13
|
+
}
|
|
14
|
+
function mergePatchValue(before, after) {
|
|
15
|
+
if (boardJsonEquals(before, after)) return void 0;
|
|
16
|
+
if (after === void 0) return null;
|
|
17
|
+
if (before && after && typeof before === "object" && typeof after === "object" && !Array.isArray(before) && !Array.isArray(after)) {
|
|
18
|
+
const patch = {};
|
|
19
|
+
const keys = /* @__PURE__ */ new Set([...Object.keys(before), ...Object.keys(after)]);
|
|
20
|
+
for (const key of keys) {
|
|
21
|
+
const value = mergePatchValue(before[key], after[key]);
|
|
22
|
+
if (value !== void 0) patch[key] = value;
|
|
23
|
+
}
|
|
24
|
+
return patch;
|
|
25
|
+
}
|
|
26
|
+
return after;
|
|
27
|
+
}
|
|
28
|
+
function itemPatch(before, after) {
|
|
29
|
+
const beforeAuthoring = semanticItem(before);
|
|
30
|
+
const afterAuthoring = semanticItem(after);
|
|
31
|
+
const patch = {};
|
|
32
|
+
if (!boardJsonEquals(before.frame, after.frame)) patch.frame = after.frame;
|
|
33
|
+
const beforeParent = before.parentId ?? null;
|
|
34
|
+
const afterParent = after.parentId ?? null;
|
|
35
|
+
if (beforeParent !== afterParent) patch.parentId = afterParent;
|
|
36
|
+
if ((before.locked ?? false) !== (after.locked ?? false)) patch.locked = after.locked ?? null;
|
|
37
|
+
const metadata = mergePatchValue(before.metadata, after.metadata);
|
|
38
|
+
if (metadata !== void 0) patch.metadata = after.metadata === void 0 ? null : metadata;
|
|
39
|
+
const props = mergePatchValue(beforeAuthoring.props, afterAuthoring.props);
|
|
40
|
+
if (props !== void 0) patch.props = props;
|
|
41
|
+
const beforeStyle = "style" in beforeAuthoring ? beforeAuthoring.style : void 0;
|
|
42
|
+
const afterStyle = "style" in afterAuthoring ? afterAuthoring.style : void 0;
|
|
43
|
+
const style = mergePatchValue(beforeStyle, afterStyle);
|
|
44
|
+
if (style !== void 0) patch.style = afterStyle === void 0 ? null : style;
|
|
45
|
+
const beforeSource = "source" in beforeAuthoring ? beforeAuthoring.source : void 0;
|
|
46
|
+
const afterSource = "source" in afterAuthoring ? afterAuthoring.source : void 0;
|
|
47
|
+
const source = mergePatchValue(beforeSource, afterSource);
|
|
48
|
+
if (source !== void 0) patch.source = afterSource === void 0 ? null : source;
|
|
49
|
+
return Object.keys(patch).length ? patch : null;
|
|
50
|
+
}
|
|
51
|
+
function connectionPatch(before, after) {
|
|
52
|
+
const patch = {};
|
|
53
|
+
for (const key of [
|
|
54
|
+
"source",
|
|
55
|
+
"target",
|
|
56
|
+
"relation",
|
|
57
|
+
"direction",
|
|
58
|
+
"label",
|
|
59
|
+
"routing",
|
|
60
|
+
"style",
|
|
61
|
+
"metadata"
|
|
62
|
+
]) if (!boardJsonEquals(before[key], after[key])) patch[key] = after[key];
|
|
63
|
+
return Object.keys(patch).length ? patch : null;
|
|
64
|
+
}
|
|
65
|
+
/** Compile an editor document delta to the public semantic mutation command set. */
|
|
66
|
+
function boardDocumentToSemanticCommands(before, after) {
|
|
67
|
+
const commands = [];
|
|
68
|
+
if (!boardJsonEquals(before.appearance, after.appearance)) commands.push({
|
|
69
|
+
type: "board.patch",
|
|
70
|
+
patch: { metadataPatch: { appearance: after.appearance } }
|
|
71
|
+
});
|
|
72
|
+
const beforeConnections = new Map(before.connections.map((connection) => [connection.id, connection]));
|
|
73
|
+
const afterConnections = new Map(after.connections.map((connection) => [connection.id, connection]));
|
|
74
|
+
const beforeItems = new Map(before.items.map((item) => [item.id, item]));
|
|
75
|
+
const afterItems = new Map(after.items.map((item) => [item.id, item]));
|
|
76
|
+
for (const [id] of beforeConnections) if (!afterConnections.has(id)) commands.push({
|
|
77
|
+
type: "connection.delete",
|
|
78
|
+
connectionId: id
|
|
79
|
+
});
|
|
80
|
+
for (const item of after.items) {
|
|
81
|
+
const previous = beforeItems.get(item.id);
|
|
82
|
+
if (!previous) {
|
|
83
|
+
commands.push({
|
|
84
|
+
type: "item.create",
|
|
85
|
+
item: semanticItem(item)
|
|
86
|
+
});
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
if (previous.type !== item.type) {
|
|
90
|
+
commands.push({
|
|
91
|
+
type: "item.replace",
|
|
92
|
+
itemId: item.id,
|
|
93
|
+
item: semanticItem(item)
|
|
94
|
+
});
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
const patch = itemPatch(previous, item);
|
|
98
|
+
if (patch) commands.push({
|
|
99
|
+
type: "item.patch",
|
|
100
|
+
itemId: item.id,
|
|
101
|
+
patch
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
for (const [id] of beforeItems) if (!afterItems.has(id)) commands.push({
|
|
105
|
+
type: "item.delete",
|
|
106
|
+
itemId: id,
|
|
107
|
+
cascade: false
|
|
108
|
+
});
|
|
109
|
+
const workingOrder = before.items.map((item) => item.id);
|
|
110
|
+
for (const item of after.items) if (!beforeItems.has(item.id)) workingOrder.push(item.id);
|
|
111
|
+
for (const [id] of beforeItems) if (!afterItems.has(id)) workingOrder.splice(workingOrder.indexOf(id), 1);
|
|
112
|
+
for (let index = 0; index < after.items.length; index += 1) {
|
|
113
|
+
const id = after.items[index]?.id;
|
|
114
|
+
if (!id || workingOrder[index] === id) continue;
|
|
115
|
+
const previousIndex = workingOrder.indexOf(id);
|
|
116
|
+
if (previousIndex < 0) continue;
|
|
117
|
+
workingOrder.splice(previousIndex, 1);
|
|
118
|
+
workingOrder.splice(index, 0, id);
|
|
119
|
+
commands.push({
|
|
120
|
+
type: "item.reorder",
|
|
121
|
+
itemId: id,
|
|
122
|
+
index
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
for (const connection of after.connections) {
|
|
126
|
+
const previous = beforeConnections.get(connection.id);
|
|
127
|
+
if (!previous) {
|
|
128
|
+
commands.push({
|
|
129
|
+
type: "connection.create",
|
|
130
|
+
connection
|
|
131
|
+
});
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
const patch = connectionPatch(previous, connection);
|
|
135
|
+
if (patch) commands.push({
|
|
136
|
+
type: "connection.patch",
|
|
137
|
+
connectionId: connection.id,
|
|
138
|
+
patch
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
return commands;
|
|
142
|
+
}
|
|
143
|
+
/** Apply public semantic commands to the local render document (undo/rebase). */
|
|
144
|
+
function applyBoardSemanticCommands(document, commands) {
|
|
145
|
+
let items = [...document.items];
|
|
146
|
+
let connections = [...document.connections];
|
|
147
|
+
let appearance = document.appearance;
|
|
148
|
+
for (const command of commands) {
|
|
149
|
+
if (command.type === "board.patch") {
|
|
150
|
+
const candidate = command.patch.metadataPatch?.appearance ?? command.patch.metadata?.appearance;
|
|
151
|
+
if (candidate !== void 0) {
|
|
152
|
+
const parsed = BoardAppearanceSchema.safeParse(candidate);
|
|
153
|
+
if (parsed.success) appearance = parsed.data;
|
|
154
|
+
}
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
if (command.type === "item.create") {
|
|
158
|
+
if (!items.some((item) => item.id === command.item.id)) items.push(boardAuthoringItemToDocumentItem(command.item));
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
if (command.type === "item.patch") {
|
|
162
|
+
items = items.map((item) => item.id === command.itemId ? boardAuthoringItemToDocumentItem(applyBoardItemPatch(semanticItem(item), command.patch)) : item);
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
if (command.type === "item.replace") {
|
|
166
|
+
items = items.map((item) => item.id === command.itemId ? boardAuthoringItemToDocumentItem(command.item) : item);
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
if (command.type === "item.delete") {
|
|
170
|
+
items = items.filter((item) => item.id !== command.itemId);
|
|
171
|
+
connections = connections.filter((connection) => connection.source.itemId !== command.itemId && connection.target.itemId !== command.itemId);
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
if (command.type === "item.reorder") {
|
|
175
|
+
const index = items.findIndex((item) => item.id === command.itemId);
|
|
176
|
+
if (index < 0) continue;
|
|
177
|
+
const [item] = items.splice(index, 1);
|
|
178
|
+
if (item) items.splice(Math.min(command.index, items.length), 0, item);
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
if (command.type === "connection.create") {
|
|
182
|
+
if (!connections.some((connection) => connection.id === command.connection.id)) connections.push(command.connection);
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
if (command.type === "connection.patch") {
|
|
186
|
+
connections = connections.map((connection) => connection.id === command.connectionId ? {
|
|
187
|
+
...connection,
|
|
188
|
+
...command.patch,
|
|
189
|
+
id: connection.id
|
|
190
|
+
} : connection);
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
if (command.type === "connection.delete") connections = connections.filter((connection) => connection.id !== command.connectionId);
|
|
194
|
+
}
|
|
195
|
+
return {
|
|
196
|
+
...document,
|
|
197
|
+
appearance,
|
|
198
|
+
items,
|
|
199
|
+
connections
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
//#endregion
|
|
203
|
+
export { applyBoardSemanticCommands, boardDocumentToSemanticCommands };
|
package/dist/chunks/http.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as CreateInvitationInput, $i as
|
|
1
|
+
import { $ as CreateInvitationInput, $i as UiCommandRecord, $n as SpaceFsPreparingFile, Ai as SessionTurnPatchEvent, Ar as SpaceTurnAuthorFilter, At as MeResponse, Bn as SpaceDefaultResponse, Ci as RealtimePatchOperation, Co as RequestSource, Cr as SpacePublicProfile, Ct as LabelItemsResponse, Da as BoardAuthoringReadInput, Dn as SpaceCommerceBenefit, Dt as LabelResourceType, En as SpaceCheckpointDetailResponse, Fi as BoardAwarenessUpdate, G as CheckpointDiffFileResponse, Gn as SpaceFsCreateUploadInput, Gt as ReferenceAggregateResponse, H as Channel, Hi as WorkContentKind, Hn as SpaceFsCompleteUploadInput, Hr as UserProfile, Ii as WorkArtifactDescriptor, In as SpaceConfigInput, Ir as TaskRunDetailResponse, Jr as ChannelHealth, Jt as ReferenceQueryResponse, Kn as SpaceFsCreateUploadResponse, Kr as UserSessionsResponse, Kt as ReferenceDirection, Ln as SpaceConfigResponse, Lr as TaskRunRecord, Lt as PromptTemplateCatalogResponse, Ma as BoardSemanticMutation, Mn as SpaceCommerceProduct, Mt as PatchResourceLabelsInput, Nn as SpaceCommerceProductBenefitBinding, Nt as PatchResourceLabelsResponse, Oa as BoardAuthoringSnapshot, On as SpaceCommerceBuyerProfile, Pr as SpaceUsageResponse, Pt as Permission, Q as ClaimReferralResponse, Qi as UiCommandError, Qn as SpaceFsMoveInput, Qt as ReferralDashboard, Rn as SpaceConfigUpdateResponse, Rr as UserActivityQuery, Rt as PublicReferral, Sa as BoardSummary, St as LabelAssignmentRecord, Tr as SpaceRole, Tt as LabelListItem, Un as SpaceFsCompleteUploadResponse, Ur as UserRulesResponse, Vn as SpaceEnvInput, Vr as UserActivityResponse, Wt as ReferenceAggregateGroupBy, X as CheckpointDiffSummary, Xi as UiCommand, Yt as ReferenceQueryableType, Z as CheckpointRecord, Zn as SpaceFsFileResponse, _a as BoardPlaybackCommand, _n as SkillCatalogResponse, _o as Usage, a as WebsocketClientOptions, at as CreateSpaceSessionInput, ba as BoardPlaybackSnapshot, bi as BoardPlaybackChangedEvent$1, bn as SpaceAccessPolicy, br as SpacePendingDiffSummary, cn as SessionMessagesResponse, ct as CronJobUpdatePatch, d as BatchUserProfilesResponse, di as GenerationContentBlock, dn as SessionTurnResponse, dr as SpaceFsWriteFileInput, ea as UiCommandStatus, et as CreateInvitationResponse, fa as BoardCapabilities, fi as GenerationModelDeclaration, fn as SessionTurnSignedUrlsResponse, ga as BoardMutationReceipt, go as SpaceCompletionStreamEvent, gr as SpaceMember, gt as InvitationDetail, hn as SessionTurnsPaginatedResponse, ho as SpaceCompletionResult, ht as GlobalSearchType, it as CreateSpacePromptResponse, jn as SpaceCommerceOrder, jt as ModelCatalogEntry, kr as SpaceSessionsResponse, l as AcceptInvitationResponse, ln as SessionRecord, lt as CursorPageInfo, mn as SessionTurnWindowResponse, no as MessageRecord, nr as SpaceFsReadFilesResponse, on as SessionMessageResponse, oo as SessionTurnRecord, pa as BoardCreateInput, pn as SessionTurnStreamSnapshotResponse, po as CreateSpaceCompletionInput, pr as SpaceInvitationListResponse, pt as GlobalSearchResponse, qr as ChannelConfig, qt as ReferenceKind, r as WebsocketClient, ro as SessionForkRecord, rr as SpaceFsTreeResponse, rt as CreateSpacePromptInput, s as WebsocketEventPayload, sn as SessionMessagesPaginatedResponse, so as SpaceTurnsResponse, st as CronJobRecord, to as SpacePublicEndpoints, tt as CreateSpaceInput, un as SessionTurnIndexResponse, ur as SpaceFsUploadResponse, vi as BoardAwarenessUpdatedEvent$1, vo as BillingPayload, vr as SpaceModListItem, wr as SpaceRecord, xr as SpacePresenceSnapshot, yi as BoardChangedEvent$1, yo as ContentBlock, yr as SpacePendingDiffFileResponse, zn as SpaceCreateResponse, zt as PublicUserPageResponse } from "./websocket.js";
|
|
2
2
|
import { n as CohubEnvironment } from "./environment.js";
|
|
3
3
|
import { a as VoiceInputCreateOptions } from "./voice-input.js";
|
|
4
4
|
//#region ../protocol/dist/model/status.d.ts
|
|
@@ -965,33 +965,15 @@ declare function buildSpacePath(input: BuildSpacePathInput): string;
|
|
|
965
965
|
declare function buildSpaceInvitePath(input: BuildSpaceInvitePathInput): string;
|
|
966
966
|
//#endregion
|
|
967
967
|
//#region src/apis/spaces.d.ts
|
|
968
|
-
|
|
969
|
-
* A board transaction rejected by the server. `status`/`code` let callers
|
|
970
|
-
* distinguish a recoverable version conflict (409 / "VERSION_CONFLICT") from
|
|
971
|
-
* transient failures, so they can rebase and retry instead of surfacing an error.
|
|
972
|
-
*/
|
|
973
|
-
declare class BoardTransactionError extends Error {
|
|
974
|
-
readonly status?: number | undefined;
|
|
975
|
-
readonly code?: string | undefined;
|
|
976
|
-
readonly body?: unknown;
|
|
977
|
-
constructor(message: string, status?: number | undefined, code?: string | undefined, body?: unknown, options?: ErrorOptions);
|
|
978
|
-
get isVersionConflict(): boolean;
|
|
979
|
-
}
|
|
980
|
-
type BoardTransactionInput = Omit<BoardTransaction, "boardId">;
|
|
981
|
-
type BoardMutationInput = {
|
|
982
|
-
include?: BoardInspectInput["include"];
|
|
983
|
-
retries?: number;
|
|
984
|
-
build: (current: BoardBootstrap) => BoardOperation[] | Promise<BoardOperation[]>;
|
|
985
|
-
};
|
|
986
|
-
type BoardTransactionAppliedEvent = BoardTransactionAppliedEvent$1;
|
|
968
|
+
type BoardChangedEvent = BoardChangedEvent$1;
|
|
987
969
|
type BoardAwarenessUpdatedEvent = BoardAwarenessUpdatedEvent$1;
|
|
988
970
|
type BoardPlaybackChangedEvent = BoardPlaybackChangedEvent$1;
|
|
989
|
-
type BoardEventName = "
|
|
971
|
+
type BoardEventName = "changed" | "awareness" | "playback";
|
|
990
972
|
type BoardSubscriptionHandlers = {
|
|
991
|
-
|
|
973
|
+
changed?: (event: BoardChangedEvent) => void;
|
|
992
974
|
awareness?: (event: BoardAwarenessUpdatedEvent) => void;
|
|
993
975
|
playback?: (event: BoardPlaybackChangedEvent) => void;
|
|
994
|
-
event?: (event:
|
|
976
|
+
event?: (event: BoardChangedEvent | BoardAwarenessUpdatedEvent | BoardPlaybackChangedEvent) => void;
|
|
995
977
|
};
|
|
996
978
|
type SessionSubscriptionHandlers = {
|
|
997
979
|
patch?: (event: WebsocketEventPayload) => void;
|
|
@@ -1004,7 +986,7 @@ type SessionSubscriptionHandlers = {
|
|
|
1004
986
|
event?: (event: WebsocketEventPayload) => void;
|
|
1005
987
|
};
|
|
1006
988
|
type SessionEventName = "created" | "updated" | "turn.created" | "turn.patch" | "turn.lifecycle" | "turn.updated" | "turn.finalized" | "turn.error" | "message.persisted";
|
|
1007
|
-
type SpaceEventName = SessionEventName | "fs.changed" | "ports.changed" | "presence.updated" | "board.
|
|
989
|
+
type SpaceEventName = SessionEventName | "fs.changed" | "ports.changed" | "presence.updated" | "board.changed" | "board.playback.changed" | "work.version.published" | "task.created" | "task.updated" | "event";
|
|
1008
990
|
declare class SpacesApi {
|
|
1009
991
|
private readonly transport;
|
|
1010
992
|
constructor(transport: HttpTransport);
|
|
@@ -1512,7 +1494,7 @@ declare class BoardRealtimeClient {
|
|
|
1512
1494
|
private readonly boardId;
|
|
1513
1495
|
constructor(websocketClient: WebsocketClient | null, spaceId: string, boardId: string);
|
|
1514
1496
|
subscribe(handlers: BoardSubscriptionHandlers): () => void;
|
|
1515
|
-
on(type: "
|
|
1497
|
+
on(type: "changed", handler: (event: BoardChangedEvent) => void): () => void;
|
|
1516
1498
|
on(type: "awareness", handler: (event: BoardAwarenessUpdatedEvent) => void): () => void;
|
|
1517
1499
|
on(type: "playback", handler: (event: BoardPlaybackChangedEvent) => void): () => void;
|
|
1518
1500
|
}
|
|
@@ -1523,72 +1505,14 @@ declare class BoardClient {
|
|
|
1523
1505
|
readonly realtime: BoardRealtimeClient;
|
|
1524
1506
|
private readonly boards;
|
|
1525
1507
|
constructor(spaceId: string, id: string, transport: HttpTransport, websocketClient: WebsocketClient | null);
|
|
1526
|
-
inspect(input?: BoardInspectInput, customFetch?: Fetch): Promise<BoardBootstrap>;
|
|
1527
1508
|
capabilities(customFetch?: Fetch): Promise<BoardCapabilities>;
|
|
1528
1509
|
summary(customFetch?: Fetch): Promise<BoardSummary>;
|
|
1529
|
-
authoring(customFetch?: Fetch): Promise<BoardAuthoringSnapshot>;
|
|
1530
|
-
mutateSemantic(input: Omit<BoardSemanticMutation, "mutationId"> & {
|
|
1510
|
+
authoring(input?: BoardAuthoringReadInput, customFetch?: Fetch): Promise<BoardAuthoringSnapshot>;
|
|
1511
|
+
mutateSemantic(input: Omit<BoardSemanticMutation, "mutationId" | "dryRun"> & {
|
|
1531
1512
|
mutationId?: string;
|
|
1513
|
+
dryRun?: boolean;
|
|
1532
1514
|
}): Promise<BoardMutationReceipt>;
|
|
1533
|
-
mutate(input: BoardMutationInput): Promise<BoardMutationReceipt>;
|
|
1534
|
-
validate(transaction: BoardTransactionInput): Promise<BoardValidationResult>;
|
|
1535
|
-
apply(transaction: BoardTransactionInput): Promise<BoardMutationReceipt>;
|
|
1536
1515
|
updateAwareness(seq: number, update: BoardAwarenessUpdate): Promise<void>;
|
|
1537
|
-
playback(command: BoardPlaybackCommand): Promise<BoardPlaybackSnapshot>;
|
|
1538
|
-
/**
|
|
1539
|
-
* Read the Board's relations.
|
|
1540
|
-
*
|
|
1541
|
-
* A dedicated read rather than a filter over `inspect()`: a caller that wants
|
|
1542
|
-
* the graph should not have to fetch every node's geometry to get it.
|
|
1543
|
-
*/
|
|
1544
|
-
connections(customFetch?: Fetch): Promise<BoardConnectionRecord[]>;
|
|
1545
|
-
/**
|
|
1546
|
-
* Connections touching a node, in either direction.
|
|
1547
|
-
*
|
|
1548
|
-
* Filtered client-side from the Board's relation set, which is a single read and
|
|
1549
|
-
* bounded by the Board rather than by the node's degree.
|
|
1550
|
-
*/
|
|
1551
|
-
connectionsForNode(nodeId: string, customFetch?: Fetch): Promise<BoardConnectionRecord[]>;
|
|
1552
|
-
/**
|
|
1553
|
-
* Connect two nodes.
|
|
1554
|
-
*
|
|
1555
|
-
* Wraps the transaction so the common case is one call: the caller supplies the
|
|
1556
|
-
* two nodes and, optionally, the relation. `baseVersion` still has to be the
|
|
1557
|
-
* version the caller last read, because a relation is only meaningful against
|
|
1558
|
-
* the node set it was authored on.
|
|
1559
|
-
*/
|
|
1560
|
-
connect(input: {
|
|
1561
|
-
baseVersion: number;
|
|
1562
|
-
sourceNodeId: string;
|
|
1563
|
-
targetNodeId: string;
|
|
1564
|
-
id?: string;
|
|
1565
|
-
relation?: string;
|
|
1566
|
-
direction?: BoardConnectionDirection;
|
|
1567
|
-
label?: string;
|
|
1568
|
-
sourcePortId?: string;
|
|
1569
|
-
targetPortId?: string;
|
|
1570
|
-
txId?: string;
|
|
1571
|
-
}): Promise<BoardMutationReceipt>;
|
|
1572
|
-
/** Remove a connection. The nodes it joined are untouched. */
|
|
1573
|
-
disconnect(input: {
|
|
1574
|
-
baseVersion: number;
|
|
1575
|
-
connectionId: string;
|
|
1576
|
-
txId?: string;
|
|
1577
|
-
}): Promise<BoardMutationReceipt>;
|
|
1578
|
-
/**
|
|
1579
|
-
* Delete a node together with every relation that names it.
|
|
1580
|
-
*
|
|
1581
|
-
* The server refuses to orphan a relation, so the cascade is explicit and lands
|
|
1582
|
-
* in one transaction: one undo step restores the node and its edges together.
|
|
1583
|
-
* `connections` is the relation set the caller already read, so this stays a
|
|
1584
|
-
* single round-trip.
|
|
1585
|
-
*/
|
|
1586
|
-
deleteNodeWithConnections(input: {
|
|
1587
|
-
baseVersion: number;
|
|
1588
|
-
nodeId: string;
|
|
1589
|
-
connections: readonly BoardConnection[];
|
|
1590
|
-
txId?: string;
|
|
1591
|
-
}): Promise<BoardMutationReceipt>;
|
|
1592
1516
|
play(command: Omit<Extract<BoardPlaybackCommand, {
|
|
1593
1517
|
type: "play";
|
|
1594
1518
|
}>, "shared"> & {
|
|
@@ -1604,7 +1528,7 @@ declare class BoardClient {
|
|
|
1604
1528
|
type: "stop";
|
|
1605
1529
|
}>): Promise<BoardPlaybackSnapshot>;
|
|
1606
1530
|
subscribe(handlers: BoardSubscriptionHandlers): () => void;
|
|
1607
|
-
on(type: "
|
|
1531
|
+
on(type: "changed", handler: (event: BoardChangedEvent) => void): () => void;
|
|
1608
1532
|
on(type: "awareness", handler: (event: BoardAwarenessUpdatedEvent) => void): () => void;
|
|
1609
1533
|
on(type: "playback", handler: (event: BoardPlaybackChangedEvent) => void): () => void;
|
|
1610
1534
|
}
|
|
@@ -1614,15 +1538,12 @@ declare class SpaceBoardsApi {
|
|
|
1614
1538
|
private readonly websocketClient;
|
|
1615
1539
|
constructor(transport: HttpTransport, spaceId: string, websocketClient: WebsocketClient | null);
|
|
1616
1540
|
byId(boardId: string): BoardClient;
|
|
1617
|
-
create(input: BoardCreateInput): Promise<
|
|
1618
|
-
|
|
1619
|
-
authoring(boardId: string, customFetch?: Fetch): Promise<BoardAuthoringSnapshot>;
|
|
1541
|
+
create(input: BoardCreateInput): Promise<BoardAuthoringSnapshot>;
|
|
1542
|
+
authoring(boardId: string, input?: BoardAuthoringReadInput, customFetch?: Fetch): Promise<BoardAuthoringSnapshot>;
|
|
1620
1543
|
mutateSemantic(boardId: string, mutation: BoardSemanticMutation): Promise<BoardMutationReceipt>;
|
|
1621
1544
|
summary(boardId: string, customFetch?: Fetch): Promise<BoardSummary>;
|
|
1622
1545
|
capabilities(boardId: string, customFetch?: Fetch): Promise<BoardCapabilities>;
|
|
1623
|
-
|
|
1624
|
-
apply(transaction: BoardTransaction): Promise<BoardMutationReceipt>;
|
|
1625
|
-
playback(boardId: string, command: BoardPlaybackCommand): Promise<BoardPlaybackSnapshot>;
|
|
1546
|
+
private playback;
|
|
1626
1547
|
play(boardId: string, command: Omit<Extract<BoardPlaybackCommand, {
|
|
1627
1548
|
type: "play";
|
|
1628
1549
|
}>, "shared"> & {
|
|
@@ -2269,4 +2190,4 @@ declare class CohubHttpClient {
|
|
|
2269
2190
|
}
|
|
2270
2191
|
declare const createHttpClient: (options?: CohubClientOptions) => CohubHttpClient;
|
|
2271
2192
|
//#endregion
|
|
2272
|
-
export {
|
|
2193
|
+
export { SessionEventName as $, ChannelsApi as $t, WorkResolveResponse as A, PublicFileUrlResponse as An, SessionPatchReducer as At, ReferralsApi as B, PublicAssetMimeType as Bt, WorkPromotionProvider as C, resolveWorkTransport as Cn, GenerationStreamSubscriptionHandlers as Ct, WorkPublicOwnerRecord as D, PublicFileListResponse as Dn, parseAssistantMessageCommit as Dt, WorkPromotionStatsResponse as E, PublicFileListEntry as En, createSessionGenerationStreamClient as Et, WorkVersionRecord as F, GenerationUsageBilling as Fn, ReferenceResourceSelector as Ft, WaitForUiCommandOptions as G, UploadChatAttachmentInput as Gt, UserApi as H, PublicAssetUploadProgress as Ht, WorkViewSource as I, ListGenerationModelsResponse as In, ReferencesApi as It, BoardChangedEvent as J, SkillsApi as Jt, TasksApi as K, UploadChatImageAttachmentInput as Kt, WorkViewStatsResponse as L, PublicGenerationDeclaration as Ln, SearchApi as Lt, WorkStatus as M, CreateGenerationTaskRequest as Mn, SessionPatchStatus as Mt, WorkTargetType as N, CreateGenerationTaskResponse as Nn, createSessionPatchReducer as Nt, WorkPublicSpaceRecord as O, PublicFileUploadEntryInput as On, SessionPatchApplyInput as Ot, WorkUpdateInput as P, GenerationTaskResult as Pn, SessionAccessApi as Pt, BoardSubscriptionHandlers as Q, CronJobsApi as Qt, WorkVisibility as R, ModelStatusEntry as Rn, CreatePublicAssetUploadInput as Rt, WorkPromotionEventResponse as S, createWorkRuntime as Sn, GenerationStreamSubscribeOptions as St, WorkPromotionRecord as T, PublicFileCreateUploadResponse as Tn, SessionGenerationStreamClient as Tt, CreateUiCommandInput as U, PublicAssetUploadProtocol as Ut, UsersApi as V, PublicAssetPurpose as Vt, UiCommandsApi as W, PublicAssetsApi as Wt, BoardEventName as X, ModelsApi as Xt, BoardClient as Y, PromptsApi as Yt, BoardPlaybackChangedEvent as Z, GenerationsApi as Zt, WorkExtractedPageMeta as _, WorkRuntimeInvocationContext as _n, GenerationStreamFinalizedEvent as _t, WorkCommerceCreditConsumeResponse as a, RawHttpResponse as an, SpaceTurnListOptions as at, WorkPresentationMeta as b, WorkRuntimeTransport as bn, GenerationStreamOutOfSyncEvent as bt, WorkCommerceEntitlementsResponse as c, matchesUnauthorizedErrorToken as cn, BuildSpaceInvitePathInput as ct, WorkCommercePurchaseResponse as d, PopupBrokerTransport as dn, buildSpaceInvitePath as dt, CohubClientOptions as en, SessionSubscriptionHandlers as et, WorkAuthorizeResponse as f, WorkIdResolver as fn, buildSpacePath as ft, WorkDetailResponse as g, WorkRuntimeContext as gn, GenerationStreamEvent as gt, WorkCreateInput as h, WorkRuntimeCheckoutStatus as hn, GenerationStreamErrorEvent as ht, WorkCommerceCheckoutStatus as i, HttpTransport as in, SpacePublicFilesApi as it, WorkSessionResponse as j, SpaceStartupResponse as jn, SessionPatchState as jt, WorkRecord as k, PublicFileUploadPlanEntry as kn, SessionPatchApplyResult as kt, WorkCommerceOrder as l, sanitizeAccessToken as ln, BuildSpacePathInput as lt, WorkContentDownload as m, WorkRuntimeCheckoutState as mn, GenerationStreamCommitEvent as mt, createHttpClient as n, HttpError as nn, SpaceClient as nt, WorkCommerceCreditConsumeStatus as o, UnauthorizedContext as on, SpacesApi as ot, WorkContent as p, WorkRuntimeApi as pn, AssistantMessageCommit as pt, BoardAwarenessUpdatedEvent as q, UploadPublicAssetInput as qt, WorkCommerceApi as r, HttpTraceContext as rn, SpaceEventName as rt, WorkCommerceEntitlement as s, joinApiUrl as sn, WebSocketConnectionState as st, CohubHttpClient as t, Fetch as tn, SpaceChannelBindingRecord as tt, WorkCommerceProductResolveResponse as u, ParentBridgeTransport as un, PublicInviteApi as ut, WorkGetResponse as v, WorkRuntimeModeConfig as vn, GenerationStreamIntermediateMessage as vt, WorkPromotionProviderStatus as w, PublicFileCreateUploadInput as wn, GenerationStreamTurnUpdatedEvent as wt, WorkPromotionCreateInput as x, createSlugWorkIdResolver as xn, GenerationStreamStateEvent as xt, WorkMeta as y, WorkRuntimeRequestOptions as yn, GenerationStreamLifecycleEvent as yt, WorksApi as z, ModelStatusResponse as zn, CreatePublicAssetUploadResponse as zt };
|