@neta-art/cohub 5.10.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 +47 -50
- package/dist/board/animation.d.ts +157 -67
- package/dist/board/animation.js +161 -306
- 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/geometry.js +4 -4
- package/dist/board/index.d.ts +8 -7
- package/dist/board/index.js +8 -9
- package/dist/board/mutation.d.ts +2 -17
- package/dist/board/mutation.js +2 -93
- 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 +27 -95
- package/dist/chunks/http.js +628 -1610
- package/dist/chunks/transport.js +1 -1
- package/dist/chunks/websocket.d.ts +3462 -533
- package/dist/chunks/websocket.js +1 -1
- package/dist/http.d.ts +3 -3
- package/dist/index.d.ts +158 -299
- package/dist/index.js +1207 -499
- package/dist/protocol/dist/board-authoring.d.ts +1305 -0
- package/dist/protocol/dist/board-authoring.js +291 -0
- package/dist/protocol/dist/board-capability-registry.d.ts +2 -0
- package/dist/protocol/dist/board-capability-registry.js +74 -0
- package/dist/protocol/dist/board-codec.d.ts +2 -0
- package/dist/protocol/dist/board-codec.js +19 -0
- package/dist/protocol/dist/board-composition.d.ts +383 -0
- package/dist/protocol/dist/board-composition.js +310 -0
- package/dist/protocol/dist/board-connection.d.ts +16 -16
- package/dist/protocol/dist/board-connection.js +16 -16
- package/dist/protocol/dist/board-constants.js +0 -25
- 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-node.d.ts +1 -12
- package/dist/protocol/dist/board-node.js +1 -81
- package/dist/protocol/dist/board.d.ts +42 -245
- package/dist/protocol/dist/board.js +56 -117
- package/dist/protocol/dist/index.d.ts +9 -4
- package/dist/types.d.ts +4 -1
- package/docs/work-runtime-guide.md +19 -3
- package/package.json +2 -2
- package/dist/board/codec.d.ts +0 -27
- package/dist/board/codec.js +0 -277
- package/dist/board/nodes.d.ts +0 -113
- package/dist/board/nodes.js +0 -154
- package/dist/protocol/dist/board-content.js +0 -26
- package/dist/protocol/dist/identifiers.js +0 -10
- package/dist/protocol/dist/index.js +0 -14
- 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, $n as SpaceFsPreparingFile,
|
|
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
|
|
@@ -206,6 +206,14 @@ declare const WORK_PROMOTION_EVENT_KEYS: readonly ["landing", "ready", "registra
|
|
|
206
206
|
type WorkPromotionEventKey = typeof WORK_PROMOTION_EVENT_KEYS[number];
|
|
207
207
|
//#endregion
|
|
208
208
|
//#region src/work-runtime.d.ts
|
|
209
|
+
type WorkRuntimeInvocationContext = {
|
|
210
|
+
surface: "page" | "preview" | "background" | "broker";
|
|
211
|
+
source?: "ui_command" | "user" | "route";
|
|
212
|
+
spaceId?: string;
|
|
213
|
+
sessionId?: string;
|
|
214
|
+
turnId?: string;
|
|
215
|
+
toolCallId?: string;
|
|
216
|
+
};
|
|
209
217
|
type WorkRuntimeContext = {
|
|
210
218
|
work: {
|
|
211
219
|
id: string;
|
|
@@ -219,6 +227,7 @@ type WorkRuntimeContext = {
|
|
|
219
227
|
viewer?: {
|
|
220
228
|
userUuid: string;
|
|
221
229
|
} | null;
|
|
230
|
+
invocation?: WorkRuntimeInvocationContext;
|
|
222
231
|
permissions?: {
|
|
223
232
|
scopes: Permission[];
|
|
224
233
|
workScopes: Permission[];
|
|
@@ -956,33 +965,15 @@ declare function buildSpacePath(input: BuildSpacePathInput): string;
|
|
|
956
965
|
declare function buildSpaceInvitePath(input: BuildSpaceInvitePathInput): string;
|
|
957
966
|
//#endregion
|
|
958
967
|
//#region src/apis/spaces.d.ts
|
|
959
|
-
|
|
960
|
-
* A board transaction rejected by the server. `status`/`code` let callers
|
|
961
|
-
* distinguish a recoverable version conflict (409 / "VERSION_CONFLICT") from
|
|
962
|
-
* transient failures, so they can rebase and retry instead of surfacing an error.
|
|
963
|
-
*/
|
|
964
|
-
declare class BoardTransactionError extends Error {
|
|
965
|
-
readonly status?: number | undefined;
|
|
966
|
-
readonly code?: string | undefined;
|
|
967
|
-
readonly body?: unknown;
|
|
968
|
-
constructor(message: string, status?: number | undefined, code?: string | undefined, body?: unknown, options?: ErrorOptions);
|
|
969
|
-
get isVersionConflict(): boolean;
|
|
970
|
-
}
|
|
971
|
-
type BoardTransactionInput = Omit<BoardTransaction, "boardId">;
|
|
972
|
-
type BoardMutationInput = {
|
|
973
|
-
include?: BoardInspectInput["include"];
|
|
974
|
-
retries?: number;
|
|
975
|
-
build: (current: BoardBootstrap) => BoardOperation[] | Promise<BoardOperation[]>;
|
|
976
|
-
};
|
|
977
|
-
type BoardTransactionAppliedEvent = BoardTransactionAppliedEvent$1;
|
|
968
|
+
type BoardChangedEvent = BoardChangedEvent$1;
|
|
978
969
|
type BoardAwarenessUpdatedEvent = BoardAwarenessUpdatedEvent$1;
|
|
979
970
|
type BoardPlaybackChangedEvent = BoardPlaybackChangedEvent$1;
|
|
980
|
-
type BoardEventName = "
|
|
971
|
+
type BoardEventName = "changed" | "awareness" | "playback";
|
|
981
972
|
type BoardSubscriptionHandlers = {
|
|
982
|
-
|
|
973
|
+
changed?: (event: BoardChangedEvent) => void;
|
|
983
974
|
awareness?: (event: BoardAwarenessUpdatedEvent) => void;
|
|
984
975
|
playback?: (event: BoardPlaybackChangedEvent) => void;
|
|
985
|
-
event?: (event:
|
|
976
|
+
event?: (event: BoardChangedEvent | BoardAwarenessUpdatedEvent | BoardPlaybackChangedEvent) => void;
|
|
986
977
|
};
|
|
987
978
|
type SessionSubscriptionHandlers = {
|
|
988
979
|
patch?: (event: WebsocketEventPayload) => void;
|
|
@@ -995,7 +986,7 @@ type SessionSubscriptionHandlers = {
|
|
|
995
986
|
event?: (event: WebsocketEventPayload) => void;
|
|
996
987
|
};
|
|
997
988
|
type SessionEventName = "created" | "updated" | "turn.created" | "turn.patch" | "turn.lifecycle" | "turn.updated" | "turn.finalized" | "turn.error" | "message.persisted";
|
|
998
|
-
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";
|
|
999
990
|
declare class SpacesApi {
|
|
1000
991
|
private readonly transport;
|
|
1001
992
|
constructor(transport: HttpTransport);
|
|
@@ -1503,7 +1494,7 @@ declare class BoardRealtimeClient {
|
|
|
1503
1494
|
private readonly boardId;
|
|
1504
1495
|
constructor(websocketClient: WebsocketClient | null, spaceId: string, boardId: string);
|
|
1505
1496
|
subscribe(handlers: BoardSubscriptionHandlers): () => void;
|
|
1506
|
-
on(type: "
|
|
1497
|
+
on(type: "changed", handler: (event: BoardChangedEvent) => void): () => void;
|
|
1507
1498
|
on(type: "awareness", handler: (event: BoardAwarenessUpdatedEvent) => void): () => void;
|
|
1508
1499
|
on(type: "playback", handler: (event: BoardPlaybackChangedEvent) => void): () => void;
|
|
1509
1500
|
}
|
|
@@ -1514,70 +1505,14 @@ declare class BoardClient {
|
|
|
1514
1505
|
readonly realtime: BoardRealtimeClient;
|
|
1515
1506
|
private readonly boards;
|
|
1516
1507
|
constructor(spaceId: string, id: string, transport: HttpTransport, websocketClient: WebsocketClient | null);
|
|
1517
|
-
inspect(input?: BoardInspectInput, customFetch?: Fetch): Promise<BoardBootstrap>;
|
|
1518
1508
|
capabilities(customFetch?: Fetch): Promise<BoardCapabilities>;
|
|
1519
1509
|
summary(customFetch?: Fetch): Promise<BoardSummary>;
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
}): Promise<
|
|
1510
|
+
authoring(input?: BoardAuthoringReadInput, customFetch?: Fetch): Promise<BoardAuthoringSnapshot>;
|
|
1511
|
+
mutateSemantic(input: Omit<BoardSemanticMutation, "mutationId" | "dryRun"> & {
|
|
1512
|
+
mutationId?: string;
|
|
1513
|
+
dryRun?: boolean;
|
|
1514
|
+
}): Promise<BoardMutationReceipt>;
|
|
1525
1515
|
updateAwareness(seq: number, update: BoardAwarenessUpdate): Promise<void>;
|
|
1526
|
-
playback(command: BoardPlaybackCommand): Promise<BoardPlaybackSnapshot>;
|
|
1527
|
-
/**
|
|
1528
|
-
* Read the Board's relations.
|
|
1529
|
-
*
|
|
1530
|
-
* A dedicated read rather than a filter over `inspect()`: a caller that wants
|
|
1531
|
-
* the graph should not have to fetch every node's geometry to get it.
|
|
1532
|
-
*/
|
|
1533
|
-
connections(customFetch?: Fetch): Promise<BoardConnectionRecord[]>;
|
|
1534
|
-
/**
|
|
1535
|
-
* Connections touching a node, in either direction.
|
|
1536
|
-
*
|
|
1537
|
-
* Filtered client-side from the Board's relation set, which is a single read and
|
|
1538
|
-
* bounded by the Board rather than by the node's degree.
|
|
1539
|
-
*/
|
|
1540
|
-
connectionsForNode(nodeId: string, customFetch?: Fetch): Promise<BoardConnectionRecord[]>;
|
|
1541
|
-
/**
|
|
1542
|
-
* Connect two nodes.
|
|
1543
|
-
*
|
|
1544
|
-
* Wraps the transaction so the common case is one call: the caller supplies the
|
|
1545
|
-
* two nodes and, optionally, the relation. `baseVersion` still has to be the
|
|
1546
|
-
* version the caller last read, because a relation is only meaningful against
|
|
1547
|
-
* the node set it was authored on.
|
|
1548
|
-
*/
|
|
1549
|
-
connect(input: {
|
|
1550
|
-
baseVersion: number;
|
|
1551
|
-
sourceNodeId: string;
|
|
1552
|
-
targetNodeId: string;
|
|
1553
|
-
id?: string;
|
|
1554
|
-
relation?: string;
|
|
1555
|
-
direction?: BoardConnectionDirection;
|
|
1556
|
-
label?: string;
|
|
1557
|
-
sourcePortId?: string;
|
|
1558
|
-
targetPortId?: string;
|
|
1559
|
-
txId?: string;
|
|
1560
|
-
}): Promise<BoardBootstrap>;
|
|
1561
|
-
/** Remove a connection. The nodes it joined are untouched. */
|
|
1562
|
-
disconnect(input: {
|
|
1563
|
-
baseVersion: number;
|
|
1564
|
-
connectionId: string;
|
|
1565
|
-
txId?: string;
|
|
1566
|
-
}): Promise<BoardBootstrap>;
|
|
1567
|
-
/**
|
|
1568
|
-
* Delete a node together with every relation that names it.
|
|
1569
|
-
*
|
|
1570
|
-
* The server refuses to orphan a relation, so the cascade is explicit and lands
|
|
1571
|
-
* in one transaction: one undo step restores the node and its edges together.
|
|
1572
|
-
* `connections` is the relation set the caller already read, so this stays a
|
|
1573
|
-
* single round-trip.
|
|
1574
|
-
*/
|
|
1575
|
-
deleteNodeWithConnections(input: {
|
|
1576
|
-
baseVersion: number;
|
|
1577
|
-
nodeId: string;
|
|
1578
|
-
connections: readonly BoardConnection[];
|
|
1579
|
-
txId?: string;
|
|
1580
|
-
}): Promise<BoardBootstrap>;
|
|
1581
1516
|
play(command: Omit<Extract<BoardPlaybackCommand, {
|
|
1582
1517
|
type: "play";
|
|
1583
1518
|
}>, "shared"> & {
|
|
@@ -1593,7 +1528,7 @@ declare class BoardClient {
|
|
|
1593
1528
|
type: "stop";
|
|
1594
1529
|
}>): Promise<BoardPlaybackSnapshot>;
|
|
1595
1530
|
subscribe(handlers: BoardSubscriptionHandlers): () => void;
|
|
1596
|
-
on(type: "
|
|
1531
|
+
on(type: "changed", handler: (event: BoardChangedEvent) => void): () => void;
|
|
1597
1532
|
on(type: "awareness", handler: (event: BoardAwarenessUpdatedEvent) => void): () => void;
|
|
1598
1533
|
on(type: "playback", handler: (event: BoardPlaybackChangedEvent) => void): () => void;
|
|
1599
1534
|
}
|
|
@@ -1603,15 +1538,12 @@ declare class SpaceBoardsApi {
|
|
|
1603
1538
|
private readonly websocketClient;
|
|
1604
1539
|
constructor(transport: HttpTransport, spaceId: string, websocketClient: WebsocketClient | null);
|
|
1605
1540
|
byId(boardId: string): BoardClient;
|
|
1606
|
-
create(input: BoardCreateInput): Promise<
|
|
1607
|
-
|
|
1541
|
+
create(input: BoardCreateInput): Promise<BoardAuthoringSnapshot>;
|
|
1542
|
+
authoring(boardId: string, input?: BoardAuthoringReadInput, customFetch?: Fetch): Promise<BoardAuthoringSnapshot>;
|
|
1543
|
+
mutateSemantic(boardId: string, mutation: BoardSemanticMutation): Promise<BoardMutationReceipt>;
|
|
1608
1544
|
summary(boardId: string, customFetch?: Fetch): Promise<BoardSummary>;
|
|
1609
1545
|
capabilities(boardId: string, customFetch?: Fetch): Promise<BoardCapabilities>;
|
|
1610
|
-
|
|
1611
|
-
apply(transaction: BoardTransaction, options?: {
|
|
1612
|
-
compact?: boolean;
|
|
1613
|
-
}): Promise<BoardBootstrap>;
|
|
1614
|
-
playback(boardId: string, command: BoardPlaybackCommand): Promise<BoardPlaybackSnapshot>;
|
|
1546
|
+
private playback;
|
|
1615
1547
|
play(boardId: string, command: Omit<Extract<BoardPlaybackCommand, {
|
|
1616
1548
|
type: "play";
|
|
1617
1549
|
}>, "shared"> & {
|
|
@@ -2258,4 +2190,4 @@ declare class CohubHttpClient {
|
|
|
2258
2190
|
}
|
|
2259
2191
|
declare const createHttpClient: (options?: CohubClientOptions) => CohubHttpClient;
|
|
2260
2192
|
//#endregion
|
|
2261
|
-
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 };
|