@neta-art/cohub 5.8.0 → 5.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/http.d.ts +82 -1
- package/dist/chunks/http.js +180 -10
- package/dist/chunks/transport.js +16 -3
- package/dist/chunks/websocket.d.ts +6 -0
- package/dist/chunks/websocket.js +1 -1
- package/dist/http.d.ts +1 -1
- package/dist/index.d.ts +30 -2
- package/dist/index.js +23 -139
- package/dist/protocol/dist/board-connection.d.ts +7 -0
- package/dist/protocol/dist/board-connection.js +4 -0
- package/dist/protocol/dist/board-content.d.ts +1 -0
- package/dist/protocol/dist/board-content.js +26 -0
- package/dist/protocol/dist/board-document.d.ts +2 -0
- package/dist/protocol/dist/identifiers.js +10 -0
- package/dist/protocol/dist/index.d.ts +1 -0
- package/dist/protocol/dist/index.js +6 -1
- package/dist/protocol/dist/provenance.js +1 -0
- package/dist/protocol/dist/ui-command.js +2 -0
- package/dist/protocol/dist/work-promotion-stats.js +11 -0
- package/dist/protocol/dist/work-surface.js +2 -0
- package/dist/protocol/dist/work-view-stats.js +1 -0
- package/package.json +1 -1
package/dist/chunks/http.d.ts
CHANGED
|
@@ -200,6 +200,10 @@ type PublicFileUrlResponse = {
|
|
|
200
200
|
url: string;
|
|
201
201
|
};
|
|
202
202
|
//#endregion
|
|
203
|
+
//#region ../protocol/dist/work-promotion-stats.d.ts
|
|
204
|
+
declare const WORK_PROMOTION_EVENT_KEYS: readonly ["landing", "ready", "registration_completed", "paywall_viewed", "checkout_started"];
|
|
205
|
+
type WorkPromotionEventKey = typeof WORK_PROMOTION_EVENT_KEYS[number];
|
|
206
|
+
//#endregion
|
|
203
207
|
//#region src/work-runtime.d.ts
|
|
204
208
|
type WorkRuntimeContext = {
|
|
205
209
|
work: {
|
|
@@ -1540,6 +1544,8 @@ declare class BoardClient {
|
|
|
1540
1544
|
relation?: string;
|
|
1541
1545
|
direction?: BoardConnectionDirection;
|
|
1542
1546
|
label?: string;
|
|
1547
|
+
sourcePortId?: string;
|
|
1548
|
+
targetPortId?: string;
|
|
1543
1549
|
txId?: string;
|
|
1544
1550
|
}): Promise<BoardBootstrap>;
|
|
1545
1551
|
/** Remove a connection. The nodes it joined are untouched. */
|
|
@@ -2014,6 +2020,54 @@ type WorkViewStatsResponse = {
|
|
|
2014
2020
|
views: number;
|
|
2015
2021
|
}>;
|
|
2016
2022
|
};
|
|
2023
|
+
type WorkPromotionProvider = "generic" | "meta";
|
|
2024
|
+
type WorkPromotionRecord = {
|
|
2025
|
+
id: string;
|
|
2026
|
+
workId: string;
|
|
2027
|
+
name: string;
|
|
2028
|
+
provider: WorkPromotionProvider | string;
|
|
2029
|
+
parameters: Record<string, string>;
|
|
2030
|
+
createdBy: string;
|
|
2031
|
+
createdAt: string;
|
|
2032
|
+
};
|
|
2033
|
+
type WorkPromotionProviderStatus = {
|
|
2034
|
+
key: WorkPromotionProvider | string;
|
|
2035
|
+
configured: boolean;
|
|
2036
|
+
};
|
|
2037
|
+
type WorkPromotionCreateInput = {
|
|
2038
|
+
name: string;
|
|
2039
|
+
provider: WorkPromotionProvider | string;
|
|
2040
|
+
parameters: Record<string, string>;
|
|
2041
|
+
};
|
|
2042
|
+
type WorkPromotionStatsResponse = {
|
|
2043
|
+
promotion: WorkPromotionRecord;
|
|
2044
|
+
summary: {
|
|
2045
|
+
landing: number;
|
|
2046
|
+
ready: number;
|
|
2047
|
+
registrationCompleted: number;
|
|
2048
|
+
paywallViewed: number;
|
|
2049
|
+
checkoutStarted: number;
|
|
2050
|
+
readyRate: number;
|
|
2051
|
+
};
|
|
2052
|
+
daily: Array<{
|
|
2053
|
+
date: string;
|
|
2054
|
+
landing: number;
|
|
2055
|
+
ready: number;
|
|
2056
|
+
registrationCompleted: number;
|
|
2057
|
+
paywallViewed: number;
|
|
2058
|
+
checkoutStarted: number;
|
|
2059
|
+
}>;
|
|
2060
|
+
};
|
|
2061
|
+
type WorkPromotionEventResponse = {
|
|
2062
|
+
ok: true;
|
|
2063
|
+
eventId: string;
|
|
2064
|
+
browser: {
|
|
2065
|
+
provider: "generic";
|
|
2066
|
+
} | {
|
|
2067
|
+
provider: "meta";
|
|
2068
|
+
pixelId: string;
|
|
2069
|
+
} | null;
|
|
2070
|
+
};
|
|
2017
2071
|
type WorkSessionResponse = {
|
|
2018
2072
|
token: string;
|
|
2019
2073
|
expiresIn: number;
|
|
@@ -2053,6 +2107,31 @@ declare class WorksApi {
|
|
|
2053
2107
|
ok: true;
|
|
2054
2108
|
}>;
|
|
2055
2109
|
getStats(workId: string): Promise<WorkViewStatsResponse>;
|
|
2110
|
+
listPromotions(workId: string): Promise<{
|
|
2111
|
+
promotions: WorkPromotionRecord[];
|
|
2112
|
+
providers: WorkPromotionProviderStatus[];
|
|
2113
|
+
}>;
|
|
2114
|
+
createPromotion(workId: string, input: WorkPromotionCreateInput): Promise<{
|
|
2115
|
+
promotion: WorkPromotionRecord;
|
|
2116
|
+
}>;
|
|
2117
|
+
getPromotionStats(workId: string, promotionId: string): Promise<WorkPromotionStatsResponse>;
|
|
2118
|
+
recordPromotionEvent(workId: string, promotionId: string, input: {
|
|
2119
|
+
eventKey: WorkPromotionEventKey;
|
|
2120
|
+
eventId?: string;
|
|
2121
|
+
sourceUrl?: string;
|
|
2122
|
+
fbp?: string;
|
|
2123
|
+
fbc?: string;
|
|
2124
|
+
productKey?: string;
|
|
2125
|
+
}): Promise<WorkPromotionEventResponse>;
|
|
2126
|
+
recordPromotionRegistration(workId: string, promotionId: string, input?: {
|
|
2127
|
+
sourceUrl?: string;
|
|
2128
|
+
fbp?: string;
|
|
2129
|
+
fbc?: string;
|
|
2130
|
+
}): Promise<{
|
|
2131
|
+
reported: boolean;
|
|
2132
|
+
eventId: string | null;
|
|
2133
|
+
browser: WorkPromotionEventResponse["browser"];
|
|
2134
|
+
}>;
|
|
2056
2135
|
listVersions(workId: string): Promise<{
|
|
2057
2136
|
versions: WorkVersionRecord[];
|
|
2058
2137
|
}>;
|
|
@@ -2104,6 +2183,8 @@ type WorkCommercePurchaseResponse = {
|
|
|
2104
2183
|
message: string | null;
|
|
2105
2184
|
orderId: string;
|
|
2106
2185
|
productKey: string;
|
|
2186
|
+
value: number | null;
|
|
2187
|
+
currency: string | null;
|
|
2107
2188
|
};
|
|
2108
2189
|
};
|
|
2109
2190
|
type WorkCommerceOrder = {
|
|
@@ -2164,4 +2245,4 @@ declare class CohubHttpClient {
|
|
|
2164
2245
|
}
|
|
2165
2246
|
declare const createHttpClient: (options?: CohubClientOptions) => CohubHttpClient;
|
|
2166
2247
|
//#endregion
|
|
2167
|
-
export {
|
|
2248
|
+
export { BoardTransactionError as $, GenerationsApi as $t, WorkResolveResponse as A, PublicFileUploadPlanEntry as An, SessionPatchApplyInput as At, ReferralsApi as B, ModelStatusResponse as Bn, CreatePublicAssetUploadInput as Bt, WorkPromotionProvider as C, createWorkRuntime as Cn, GenerationStreamStateEvent as Ct, WorkPublicOwnerRecord as D, PublicFileListEntry as Dn, SessionGenerationStreamClient as Dt, WorkPromotionStatsResponse as E, PublicFileCreateUploadResponse as En, GenerationStreamTurnUpdatedEvent as Et, WorkVersionRecord as F, GenerationTaskResult as Fn, createSessionPatchReducer as Ft, WaitForUiCommandOptions as G, PublicAssetUploadProtocol as Gt, UserApi as H, PublicAssetMimeType as Ht, WorkViewSource as I, GenerationUsageBilling as In, SessionAccessApi as It, BoardClient as J, UploadChatImageAttachmentInput as Jt, TasksApi as K, PublicAssetsApi as Kt, WorkViewStatsResponse as L, ListGenerationModelsResponse as Ln, ReferenceResourceSelector as Lt, WorkStatus as M, SpaceStartupResponse as Mn, SessionPatchReducer as Mt, WorkTargetType as N, CreateGenerationTaskRequest as Nn, SessionPatchState as Nt, WorkPublicSpaceRecord as O, PublicFileListResponse as On, createSessionGenerationStreamClient as Ot, WorkUpdateInput as P, CreateGenerationTaskResponse as Pn, SessionPatchStatus as Pt, BoardTransactionAppliedEvent as Q, ModelsApi as Qt, WorkVisibility as R, PublicGenerationDeclaration as Rn, ReferencesApi as Rt, WorkPromotionEventResponse as S, createSlugWorkIdResolver as Sn, GenerationStreamOutOfSyncEvent as St, WorkPromotionRecord as T, PublicFileCreateUploadInput as Tn, GenerationStreamSubscriptionHandlers as Tt, CreateUiCommandInput as U, PublicAssetPurpose as Ut, UsersApi as V, CreatePublicAssetUploadResponse as Vt, UiCommandsApi as W, PublicAssetUploadProgress as Wt, BoardPlaybackChangedEvent as X, SkillsApi as Xt, BoardEventName as Y, UploadPublicAssetInput as Yt, BoardSubscriptionHandlers as Z, PromptsApi as Zt, WorkExtractedPageMeta as _, WorkRuntimeCheckoutStatus as _n, GenerationStreamErrorEvent as _t, WorkCommerceCreditConsumeResponse as a, HttpTraceContext as an, SpaceEventName as at, WorkPresentationMeta as b, WorkRuntimeRequestOptions as bn, GenerationStreamIntermediateMessage as bt, WorkCommerceEntitlementsResponse as c, UnauthorizedContext as cn, SpacesApi as ct, WorkCommercePurchaseResponse as d, sanitizeAccessToken as dn, BuildSpacePathInput as dt, CronJobsApi as en, BoardTransactionInput as et, WorkAuthorizeResponse as f, ParentBridgeTransport as fn, PublicInviteApi as ft, WorkDetailResponse as g, WorkRuntimeCheckoutState as gn, GenerationStreamCommitEvent as gt, WorkCreateInput as h, WorkRuntimeApi as hn, AssistantMessageCommit as ht, WorkCommerceCheckoutStatus as i, HttpError as in, SpaceClient as it, WorkSessionResponse as j, PublicFileUrlResponse as jn, SessionPatchApplyResult as jt, WorkRecord as k, PublicFileUploadEntryInput as kn, parseAssistantMessageCommit as kt, WorkCommerceOrder as l, joinApiUrl as ln, WebSocketConnectionState as lt, WorkContentDownload as m, WorkIdResolver as mn, buildSpacePath as mt, createHttpClient as n, CohubClientOptions as nn, SessionSubscriptionHandlers as nt, WorkCommerceCreditConsumeStatus as o, HttpTransport as on, SpacePublicFilesApi as ot, WorkContent as p, PopupBrokerTransport as pn, buildSpaceInvitePath as pt, BoardAwarenessUpdatedEvent as q, UploadChatAttachmentInput as qt, WorkCommerceApi as r, Fetch as rn, SpaceChannelBindingRecord as rt, WorkCommerceEntitlement as s, RawHttpResponse as sn, SpaceTurnListOptions as st, CohubHttpClient as t, ChannelsApi as tn, SessionEventName as tt, WorkCommerceProductResolveResponse as u, matchesUnauthorizedErrorToken as un, BuildSpaceInvitePathInput as ut, WorkGetResponse as v, WorkRuntimeContext as vn, GenerationStreamEvent as vt, WorkPromotionProviderStatus as w, resolveWorkTransport as wn, GenerationStreamSubscribeOptions as wt, WorkPromotionCreateInput as x, WorkRuntimeTransport as xn, GenerationStreamLifecycleEvent as xt, WorkMeta as y, WorkRuntimeModeConfig as yn, GenerationStreamFinalizedEvent as yt, WorksApi as z, ModelStatusEntry as zn, SearchApi as zt };
|
package/dist/chunks/http.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as
|
|
1
|
+
import { D as getRealtimeBoardRoom, O as getRealtimeSpaceRoom, n as HttpTransport, t as HttpError, y as isUuid } from "./transport.js";
|
|
2
2
|
import { a as resolveApiBaseUrl } from "./environment.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import "perfect-freehand";
|
|
@@ -520,6 +520,8 @@ const BoardConnectionAnchorSchema = z.union([
|
|
|
520
520
|
const AUTO_BOARD_CONNECTION_ANCHOR = { kind: "auto" };
|
|
521
521
|
const BoardConnectionEndpointSchema = z.object({
|
|
522
522
|
nodeId: z.string().min(1).max(160),
|
|
523
|
+
/** Optional semantic port. Older connections omit it and remain valid. */
|
|
524
|
+
portId: z.string().min(1).max(120).optional(),
|
|
523
525
|
anchor: BoardConnectionAnchorSchema.default(AUTO_BOARD_CONNECTION_ANCHOR)
|
|
524
526
|
});
|
|
525
527
|
/**
|
|
@@ -616,10 +618,12 @@ function createBoardConnection(input) {
|
|
|
616
618
|
id: input.id,
|
|
617
619
|
source: {
|
|
618
620
|
nodeId: input.sourceNodeId,
|
|
621
|
+
...input.sourcePortId ? { portId: input.sourcePortId } : {},
|
|
619
622
|
anchor: input.sourceAnchor ?? AUTO_BOARD_CONNECTION_ANCHOR
|
|
620
623
|
},
|
|
621
624
|
target: {
|
|
622
625
|
nodeId: input.targetNodeId,
|
|
626
|
+
...input.targetPortId ? { portId: input.targetPortId } : {},
|
|
623
627
|
anchor: input.targetAnchor ?? AUTO_BOARD_CONNECTION_ANCHOR
|
|
624
628
|
},
|
|
625
629
|
relation: input.relation ?? "related",
|
|
@@ -836,6 +840,27 @@ z.discriminatedUnion("type", [
|
|
|
836
840
|
playbackId: z.string().uuid()
|
|
837
841
|
})
|
|
838
842
|
]);
|
|
843
|
+
const BoardContentKindSchema = z.enum([
|
|
844
|
+
"text",
|
|
845
|
+
"image",
|
|
846
|
+
"video",
|
|
847
|
+
"audio",
|
|
848
|
+
"file",
|
|
849
|
+
"json",
|
|
850
|
+
"collection"
|
|
851
|
+
]);
|
|
852
|
+
const BoardPortSchema = z.object({
|
|
853
|
+
id: z.string().min(1).max(120),
|
|
854
|
+
kind: BoardContentKindSchema,
|
|
855
|
+
role: z.string().min(1).max(80).optional(),
|
|
856
|
+
required: z.boolean().optional(),
|
|
857
|
+
multiple: z.boolean().optional(),
|
|
858
|
+
maxItems: z.number().int().positive().optional()
|
|
859
|
+
}).strict();
|
|
860
|
+
z.object({
|
|
861
|
+
inputs: z.array(BoardPortSchema),
|
|
862
|
+
outputs: z.array(BoardPortSchema)
|
|
863
|
+
}).strict();
|
|
839
864
|
//#endregion
|
|
840
865
|
//#region ../protocol/dist/board-url.js
|
|
841
866
|
const BOARD_REMOTE_URL_MAX_LENGTH = 4096;
|
|
@@ -1742,21 +1767,20 @@ const UI_COMMAND_TERMINAL_STATUSES = [
|
|
|
1742
1767
|
const isTerminalUiCommandStatus = (status) => UI_COMMAND_TERMINAL_STATUSES.includes(status);
|
|
1743
1768
|
const METHOD_RE = /^[A-Za-z][A-Za-z0-9_.:-]{0,63}$/;
|
|
1744
1769
|
const isUiSurfaceMethod = (value) => typeof value === "string" && METHOD_RE.test(value);
|
|
1745
|
-
const WORK_ID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
1746
1770
|
const UI_COMMAND_ID_RE = /^[A-Za-z0-9_-]{1,64}$/;
|
|
1747
1771
|
const parseUiCommandId = (value) => {
|
|
1748
1772
|
if (typeof value !== "string") return null;
|
|
1749
1773
|
const trimmed = value.trim();
|
|
1750
1774
|
return UI_COMMAND_ID_RE.test(trimmed) ? trimmed : null;
|
|
1751
1775
|
};
|
|
1752
|
-
const isRecord$
|
|
1776
|
+
const isRecord$2 = (value) => Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
1753
1777
|
const asTrimmed = (value) => {
|
|
1754
1778
|
if (typeof value !== "string") return null;
|
|
1755
1779
|
const trimmed = value.trim();
|
|
1756
1780
|
return trimmed ? trimmed : null;
|
|
1757
1781
|
};
|
|
1758
1782
|
const parseLaunch = (value) => {
|
|
1759
|
-
if (!isRecord$
|
|
1783
|
+
if (!isRecord$2(value)) return void 0;
|
|
1760
1784
|
const search = asTrimmed(value.search);
|
|
1761
1785
|
const hash = asTrimmed(value.hash);
|
|
1762
1786
|
if (!search && !hash) return void 0;
|
|
@@ -1774,7 +1798,7 @@ const measureUiCommandPayload = (value) => {
|
|
|
1774
1798
|
}
|
|
1775
1799
|
};
|
|
1776
1800
|
const parseUiCommand = (input) => {
|
|
1777
|
-
if (!isRecord$
|
|
1801
|
+
if (!isRecord$2(input)) return {
|
|
1778
1802
|
command: null,
|
|
1779
1803
|
error: "command must be an object"
|
|
1780
1804
|
};
|
|
@@ -1783,7 +1807,7 @@ const parseUiCommand = (input) => {
|
|
|
1783
1807
|
error: "command.type must be one of: preview.show"
|
|
1784
1808
|
};
|
|
1785
1809
|
const preview = input.preview;
|
|
1786
|
-
if (!isRecord$
|
|
1810
|
+
if (!isRecord$2(preview)) return {
|
|
1787
1811
|
command: null,
|
|
1788
1812
|
error: "command.preview is required"
|
|
1789
1813
|
};
|
|
@@ -1796,7 +1820,7 @@ const parseUiCommand = (input) => {
|
|
|
1796
1820
|
command: null,
|
|
1797
1821
|
error: "command.preview.workId is required"
|
|
1798
1822
|
};
|
|
1799
|
-
if (!
|
|
1823
|
+
if (!isUuid(workId)) return {
|
|
1800
1824
|
command: null,
|
|
1801
1825
|
error: "command.preview.workId must be a Work id"
|
|
1802
1826
|
};
|
|
@@ -1814,7 +1838,7 @@ const parseUiCommand = (input) => {
|
|
|
1814
1838
|
}
|
|
1815
1839
|
let request;
|
|
1816
1840
|
if (input.request !== void 0 && input.request !== null) {
|
|
1817
|
-
if (!isRecord$
|
|
1841
|
+
if (!isRecord$2(input.request)) return {
|
|
1818
1842
|
command: null,
|
|
1819
1843
|
error: "command.request must be an object"
|
|
1820
1844
|
};
|
|
@@ -1866,6 +1890,123 @@ const parseUiCommand = (input) => {
|
|
|
1866
1890
|
};
|
|
1867
1891
|
};
|
|
1868
1892
|
//#endregion
|
|
1893
|
+
//#region ../protocol/dist/work-surface.js
|
|
1894
|
+
const WORK_SURFACE_PROTOCOL = "cohub.surface";
|
|
1895
|
+
const WORK_SURFACE_READY_TIMEOUT_MS = 1e4;
|
|
1896
|
+
const WORK_SURFACE_REQUEST_TIMEOUT_MS = 15e3;
|
|
1897
|
+
const WORK_COMPOSER_CHIP_KEY_MAX_LENGTH = 80;
|
|
1898
|
+
const WORK_COMPOSER_CHIP_LABEL_MAX_LENGTH = 120;
|
|
1899
|
+
const WORK_COMPOSER_CHIP_CONTENT_MAX_BYTES = 32 * 1024;
|
|
1900
|
+
const isRecord$1 = (value) => Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
1901
|
+
const isSurfaceEnvelope = (value) => isRecord$1(value) && value.protocol === "cohub.surface" && value.version === 1;
|
|
1902
|
+
const parseWorkSurfaceReady = (value) => {
|
|
1903
|
+
if (!isSurfaceEnvelope(value) || value.type !== "ready") return null;
|
|
1904
|
+
const methods = Array.isArray(value.methods) ? value.methods.filter((method) => typeof method === "string" && Boolean(method)) : [];
|
|
1905
|
+
return {
|
|
1906
|
+
protocol: WORK_SURFACE_PROTOCOL,
|
|
1907
|
+
version: 1,
|
|
1908
|
+
type: "ready",
|
|
1909
|
+
methods
|
|
1910
|
+
};
|
|
1911
|
+
};
|
|
1912
|
+
const parseWorkSurfaceResponse = (value) => {
|
|
1913
|
+
if (!isSurfaceEnvelope(value) || value.type !== "response") return null;
|
|
1914
|
+
if (typeof value.requestId !== "string" || !value.requestId) return null;
|
|
1915
|
+
const error = isRecord$1(value.error) ? {
|
|
1916
|
+
code: typeof value.error.code === "string" && value.error.code ? value.error.code : "surface_error",
|
|
1917
|
+
message: typeof value.error.message === "string" ? value.error.message : "Work surface call failed"
|
|
1918
|
+
} : void 0;
|
|
1919
|
+
return {
|
|
1920
|
+
protocol: WORK_SURFACE_PROTOCOL,
|
|
1921
|
+
version: 1,
|
|
1922
|
+
type: "response",
|
|
1923
|
+
requestId: value.requestId,
|
|
1924
|
+
ok: value.ok === true,
|
|
1925
|
+
...error ? { error } : {}
|
|
1926
|
+
};
|
|
1927
|
+
};
|
|
1928
|
+
const parseComposerChipKey = (value) => {
|
|
1929
|
+
if (typeof value !== "string") return null;
|
|
1930
|
+
const key = value.trim();
|
|
1931
|
+
if (!key || key.length > 80) return null;
|
|
1932
|
+
return key;
|
|
1933
|
+
};
|
|
1934
|
+
const parseWorkComposerChipSet = (value) => {
|
|
1935
|
+
if (!isSurfaceEnvelope(value) || value.type !== "composer.chip.set" || !isRecord$1(value.chip)) return null;
|
|
1936
|
+
const key = parseComposerChipKey(value.chip.key);
|
|
1937
|
+
if (!key || typeof value.chip.label !== "string" || typeof value.chip.content !== "string") return null;
|
|
1938
|
+
const label = value.chip.label.trim();
|
|
1939
|
+
if (!label || label.length > 120) return null;
|
|
1940
|
+
if (!value.chip.content.trim()) return null;
|
|
1941
|
+
if (new TextEncoder().encode(value.chip.content).length > 32768) return null;
|
|
1942
|
+
return {
|
|
1943
|
+
protocol: WORK_SURFACE_PROTOCOL,
|
|
1944
|
+
version: 1,
|
|
1945
|
+
type: "composer.chip.set",
|
|
1946
|
+
chip: {
|
|
1947
|
+
key,
|
|
1948
|
+
label,
|
|
1949
|
+
content: value.chip.content
|
|
1950
|
+
}
|
|
1951
|
+
};
|
|
1952
|
+
};
|
|
1953
|
+
const parseWorkComposerChipClear = (value) => {
|
|
1954
|
+
if (!isSurfaceEnvelope(value) || value.type !== "composer.chip.clear") return null;
|
|
1955
|
+
const key = parseComposerChipKey(value.key);
|
|
1956
|
+
return key ? {
|
|
1957
|
+
protocol: WORK_SURFACE_PROTOCOL,
|
|
1958
|
+
version: 1,
|
|
1959
|
+
type: "composer.chip.clear",
|
|
1960
|
+
key
|
|
1961
|
+
} : null;
|
|
1962
|
+
};
|
|
1963
|
+
const parseWorkSurfaceRequest = (value) => {
|
|
1964
|
+
if (!isSurfaceEnvelope(value) || value.type !== "request") return null;
|
|
1965
|
+
if (typeof value.requestId !== "string" || !value.requestId) return null;
|
|
1966
|
+
if (typeof value.method !== "string" || !value.method) return null;
|
|
1967
|
+
const commandId = parseUiCommandId(value.commandId);
|
|
1968
|
+
if (!commandId) return null;
|
|
1969
|
+
return {
|
|
1970
|
+
protocol: WORK_SURFACE_PROTOCOL,
|
|
1971
|
+
version: 1,
|
|
1972
|
+
type: "request",
|
|
1973
|
+
requestId: value.requestId,
|
|
1974
|
+
method: value.method,
|
|
1975
|
+
...value.input === void 0 ? {} : { input: value.input },
|
|
1976
|
+
commandId
|
|
1977
|
+
};
|
|
1978
|
+
};
|
|
1979
|
+
const buildWorkSurfaceReady = (methods) => ({
|
|
1980
|
+
protocol: WORK_SURFACE_PROTOCOL,
|
|
1981
|
+
version: 1,
|
|
1982
|
+
type: "ready",
|
|
1983
|
+
methods: [...methods]
|
|
1984
|
+
});
|
|
1985
|
+
const buildWorkSurfaceRequest = (input) => ({
|
|
1986
|
+
protocol: WORK_SURFACE_PROTOCOL,
|
|
1987
|
+
version: 1,
|
|
1988
|
+
type: "request",
|
|
1989
|
+
...input
|
|
1990
|
+
});
|
|
1991
|
+
const buildWorkSurfaceResponse = (input) => ({
|
|
1992
|
+
protocol: WORK_SURFACE_PROTOCOL,
|
|
1993
|
+
version: 1,
|
|
1994
|
+
type: "response",
|
|
1995
|
+
...input
|
|
1996
|
+
});
|
|
1997
|
+
const buildWorkComposerChipSet = (chip) => ({
|
|
1998
|
+
protocol: WORK_SURFACE_PROTOCOL,
|
|
1999
|
+
version: 1,
|
|
2000
|
+
type: "composer.chip.set",
|
|
2001
|
+
chip
|
|
2002
|
+
});
|
|
2003
|
+
const buildWorkComposerChipClear = (key) => ({
|
|
2004
|
+
protocol: WORK_SURFACE_PROTOCOL,
|
|
2005
|
+
version: 1,
|
|
2006
|
+
type: "composer.chip.clear",
|
|
2007
|
+
key
|
|
2008
|
+
});
|
|
2009
|
+
//#endregion
|
|
1869
2010
|
//#region src/board/core/draw-geometry.ts
|
|
1870
2011
|
/** Radius of a sample in world units given the stroke size and pressure. */
|
|
1871
2012
|
function sampleRadius(size, pressure) {
|
|
@@ -4155,7 +4296,9 @@ var BoardClient = class {
|
|
|
4155
4296
|
targetNodeId: input.targetNodeId,
|
|
4156
4297
|
...input.relation === void 0 ? {} : { relation: input.relation },
|
|
4157
4298
|
...input.direction === void 0 ? {} : { direction: input.direction },
|
|
4158
|
-
...input.label === void 0 ? {} : { label: input.label }
|
|
4299
|
+
...input.label === void 0 ? {} : { label: input.label },
|
|
4300
|
+
...input.sourcePortId === void 0 ? {} : { sourcePortId: input.sourcePortId },
|
|
4301
|
+
...input.targetPortId === void 0 ? {} : { targetPortId: input.targetPortId }
|
|
4159
4302
|
});
|
|
4160
4303
|
return this.apply({
|
|
4161
4304
|
txId: input.txId ?? randomBoardId(),
|
|
@@ -4917,6 +5060,33 @@ var WorksApi = class {
|
|
|
4917
5060
|
getStats(workId) {
|
|
4918
5061
|
return this.transport.request(`/api/works/${workId}/stats`);
|
|
4919
5062
|
}
|
|
5063
|
+
listPromotions(workId) {
|
|
5064
|
+
return this.transport.request(`/api/works/${workId}/promotions`);
|
|
5065
|
+
}
|
|
5066
|
+
createPromotion(workId, input) {
|
|
5067
|
+
return this.transport.request(`/api/works/${workId}/promotions`, {
|
|
5068
|
+
method: "POST",
|
|
5069
|
+
headers: { "Content-Type": "application/json" },
|
|
5070
|
+
body: JSON.stringify(input)
|
|
5071
|
+
});
|
|
5072
|
+
}
|
|
5073
|
+
getPromotionStats(workId, promotionId) {
|
|
5074
|
+
return this.transport.request(`/api/works/${workId}/promotions/${promotionId}/stats`);
|
|
5075
|
+
}
|
|
5076
|
+
recordPromotionEvent(workId, promotionId, input) {
|
|
5077
|
+
return this.transport.request(`/api/works/${workId}/promotions/${promotionId}/events`, {
|
|
5078
|
+
method: "POST",
|
|
5079
|
+
headers: { "Content-Type": "application/json" },
|
|
5080
|
+
body: JSON.stringify(input)
|
|
5081
|
+
});
|
|
5082
|
+
}
|
|
5083
|
+
recordPromotionRegistration(workId, promotionId, input) {
|
|
5084
|
+
return this.transport.request(`/api/works/${workId}/promotions/${promotionId}/registration`, {
|
|
5085
|
+
method: "POST",
|
|
5086
|
+
headers: input ? { "Content-Type": "application/json" } : void 0,
|
|
5087
|
+
body: input ? JSON.stringify(input) : void 0
|
|
5088
|
+
});
|
|
5089
|
+
}
|
|
4920
5090
|
listVersions(workId) {
|
|
4921
5091
|
return this.transport.request(`/api/works/${workId}/versions`);
|
|
4922
5092
|
}
|
|
@@ -5025,4 +5195,4 @@ var CohubHttpClient = class {
|
|
|
5025
5195
|
};
|
|
5026
5196
|
const createHttpClient = (options) => new CohubHttpClient(options);
|
|
5027
5197
|
//#endregion
|
|
5028
|
-
export {
|
|
5198
|
+
export { parseUsername as $, WORK_SURFACE_READY_TIMEOUT_MS as A, parseWorkSurfaceRequest as B, BoardInputError as C, WORK_COMPOSER_CHIP_CONTENT_MAX_BYTES as D, validateBoardNodes as E, buildWorkSurfaceRequest as F, UI_COMMAND_PENDING_TTL_SECONDS as G, UI_COMMAND_DEFAULT_TIMEOUT_MS as H, buildWorkSurfaceResponse as I, UI_COMMAND_VERSION as J, UI_COMMAND_SETTLEMENT_GRACE_SECONDS as K, parseWorkComposerChipClear as L, buildWorkComposerChipClear as M, buildWorkComposerChipSet as N, WORK_COMPOSER_CHIP_KEY_MAX_LENGTH as O, buildWorkSurfaceReady as P, parseSpaceSlug as Q, parseWorkComposerChipSet as R, createSessionPatchReducer as S, createBoardNode as T, UI_COMMAND_MAX_TIMEOUT_MS as U, parseWorkSurfaceResponse as V, UI_COMMAND_PAYLOAD_MAX_BYTES as W, isUiSurfaceMethod as X, isTerminalUiCommandStatus as Y, parseUiCommand as Z, buildSpacePath as _, ModelsApi as _t, ReferralsApi as a, validateBoardNodeInput as at, parseAssistantMessageCommit as b, ChannelsApi as bt, UiCommandsApi as c, ensureRealtimeConnected as ct, BoardTransactionError as d, SessionAccessApi as dt, BoardAwarenessClientPayloadSchema as et, SpaceClient as f, ReferencesApi as ft, buildSpaceInvitePath as g, PromptsApi as gt, PublicInviteApi as h, SkillsApi as ht, WorksApi as i, BOARD_NODE_CONTRACT as it, WORK_SURFACE_REQUEST_TIMEOUT_MS as j, WORK_COMPOSER_CHIP_LABEL_MAX_LENGTH as k, TasksApi as l, BOARD_BUILTIN_CAPABILITIES as lt, SpacesApi as m, PublicAssetsApi as mt, createHttpClient as n, BOARD_GEO_KINDS as nt, UsersApi as o, BoardPlaybackPolicySchema as ot, SpacePublicFilesApi as p, SearchApi as pt, UI_COMMAND_TERMINAL_TTL_SECONDS as q, WorkCommerceApi as r, BOARD_NATIVE_NODE_TYPES as rt, UserApi as s, parseBoardPlaybackPolicy as st, CohubHttpClient as t, BOARD_COLOR_IDS as tt, BoardClient as u, DEFAULT_BOARD_RENDER_LIMITS as ut, SessionGenerationStreamClient as v, GenerationsApi as vt, assertBoardNodes as w, SessionPatchReducer as x, createSessionGenerationStreamClient as y, CronJobsApi as yt, parseWorkSurfaceReady as z };
|
package/dist/chunks/transport.js
CHANGED
|
@@ -51,6 +51,20 @@ const getSessionTurnPatchStreamKey = (input, options = {}) => {
|
|
|
51
51
|
return options.includeSessionFallback ? getNonEmptyString(input.sessionId) : null;
|
|
52
52
|
};
|
|
53
53
|
//#endregion
|
|
54
|
+
//#region ../protocol/dist/identifiers.js
|
|
55
|
+
const UUID_SHAPE_PATTERN = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}";
|
|
56
|
+
const UUID_PATTERN = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}";
|
|
57
|
+
const UUID_OR_SHORT_UUID_PATTERN = `^(?:${UUID_PATTERN}|[0-9a-fA-F]{32})$`;
|
|
58
|
+
const UUID_SHAPE_REGEX = new RegExp(`^${UUID_SHAPE_PATTERN}$`);
|
|
59
|
+
const UUID_REGEX = new RegExp(`^${UUID_PATTERN}$`);
|
|
60
|
+
new RegExp(UUID_OR_SHORT_UUID_PATTERN);
|
|
61
|
+
function isUuidLike(value) {
|
|
62
|
+
return typeof value === "string" && UUID_SHAPE_REGEX.test(value);
|
|
63
|
+
}
|
|
64
|
+
function isUuid(value) {
|
|
65
|
+
return typeof value === "string" && UUID_REGEX.test(value);
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
54
68
|
//#region ../protocol/dist/provenance.js
|
|
55
69
|
/** Request provenance via X-Cohub-Source-* headers. Never used for authorization. */
|
|
56
70
|
const COHUB_SOURCE_HEADER = {
|
|
@@ -62,8 +76,7 @@ const COHUB_SOURCE_HEADER = {
|
|
|
62
76
|
sandboxVersion: "X-Cohub-Source-Sandbox",
|
|
63
77
|
via: "X-Cohub-Source-Via"
|
|
64
78
|
};
|
|
65
|
-
const
|
|
66
|
-
const isRequestSourceUuid = (value) => typeof value === "string" && UUID_RE.test(value);
|
|
79
|
+
const isRequestSourceUuid = (value) => isUuidLike(value);
|
|
67
80
|
const REQUEST_SOURCE_VIA_MAX_LENGTH = 64;
|
|
68
81
|
/** Opaque, url-safe client instance id. */
|
|
69
82
|
const CLIENT_ID_RE = /^[A-Za-z0-9_-]{8,64}$/;
|
|
@@ -439,4 +452,4 @@ var HttpTransport = class {
|
|
|
439
452
|
}
|
|
440
453
|
};
|
|
441
454
|
//#endregion
|
|
442
|
-
export {
|
|
455
|
+
export { isRealtimeDomain as A, WS_BOARD_AWARENESS_CAPABILITY as C, getRealtimeBoardRoom as D, WS_ROOM_SUBSCRIPTION_CAPABILITY as E, getRealtimeSpaceRoom as O, REALTIME_ROOM_MAX_PAYLOAD_BYTES as S, WS_REALTIME_ROOM_CAPABILITY as T, requestSourceToHeaders as _, sanitizeAccessToken as a, REALTIME_DOMAINS as b, REQUEST_SOURCE_VIA_MAX_LENGTH as c, isRequestSourceEmpty as d, isRequestSourceUuid as f, readRequestSourceFromEnv as g, parseRequestSourceFromHeaders as h, matchesUnauthorizedErrorToken as i, normalizeRealtimeRooms as j, getSessionTurnPatchStreamKey as k, hasRequestSourceIdentity as l, normalizeRequestSource as m, HttpTransport as n, COHUB_SOURCE_HEADER as o, mergeRequestSourceIntoMeta as p, joinApiUrl as r, COHUB_SOURCE_HEADER_NAMES as s, HttpError as t, isRequestSourceClientId as u, resolveRequestSourceChannel as v, WS_COMPACT_STREAM_CAPABILITY as w, REALTIME_ROOM_EVENT_NAME_PATTERN as x, isUuid as y };
|
|
@@ -521,6 +521,7 @@ declare const BoardConnectionSchema: z.ZodObject<{
|
|
|
521
521
|
id: z.ZodString;
|
|
522
522
|
source: z.ZodObject<{
|
|
523
523
|
nodeId: z.ZodString;
|
|
524
|
+
portId: z.ZodOptional<z.ZodString>;
|
|
524
525
|
anchor: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
525
526
|
kind: z.ZodLiteral<"auto">;
|
|
526
527
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -540,6 +541,7 @@ declare const BoardConnectionSchema: z.ZodObject<{
|
|
|
540
541
|
}, z.core.$strip>;
|
|
541
542
|
target: z.ZodObject<{
|
|
542
543
|
nodeId: z.ZodString;
|
|
544
|
+
portId: z.ZodOptional<z.ZodString>;
|
|
543
545
|
anchor: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
544
546
|
kind: z.ZodLiteral<"auto">;
|
|
545
547
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -606,6 +608,7 @@ type BoardConnectionInput = BoardConnection;
|
|
|
606
608
|
declare const BoardConnectionPatchSchema: z.ZodObject<{
|
|
607
609
|
source: z.ZodOptional<z.ZodObject<{
|
|
608
610
|
nodeId: z.ZodString;
|
|
611
|
+
portId: z.ZodOptional<z.ZodString>;
|
|
609
612
|
anchor: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
610
613
|
kind: z.ZodLiteral<"auto">;
|
|
611
614
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -625,6 +628,7 @@ declare const BoardConnectionPatchSchema: z.ZodObject<{
|
|
|
625
628
|
}, z.core.$strip>>;
|
|
626
629
|
target: z.ZodOptional<z.ZodObject<{
|
|
627
630
|
nodeId: z.ZodString;
|
|
631
|
+
portId: z.ZodOptional<z.ZodString>;
|
|
628
632
|
anchor: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
629
633
|
kind: z.ZodLiteral<"auto">;
|
|
630
634
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -1021,6 +1025,7 @@ declare const BoardCreateInputSchema: z.ZodObject<{
|
|
|
1021
1025
|
id: z.ZodString;
|
|
1022
1026
|
source: z.ZodObject<{
|
|
1023
1027
|
nodeId: z.ZodString;
|
|
1028
|
+
portId: z.ZodOptional<z.ZodString>;
|
|
1024
1029
|
anchor: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
1025
1030
|
kind: z.ZodLiteral<"auto">;
|
|
1026
1031
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -1040,6 +1045,7 @@ declare const BoardCreateInputSchema: z.ZodObject<{
|
|
|
1040
1045
|
}, z.core.$strip>;
|
|
1041
1046
|
target: z.ZodObject<{
|
|
1042
1047
|
nodeId: z.ZodString;
|
|
1048
|
+
portId: z.ZodOptional<z.ZodString>;
|
|
1043
1049
|
anchor: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
1044
1050
|
kind: z.ZodLiteral<"auto">;
|
|
1045
1051
|
}, z.core.$strip>, z.ZodObject<{
|
package/dist/chunks/websocket.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as isRealtimeDomain, C as WS_BOARD_AWARENESS_CAPABILITY, E as WS_ROOM_SUBSCRIPTION_CAPABILITY, O as getRealtimeSpaceRoom, T as WS_REALTIME_ROOM_CAPABILITY, j as normalizeRealtimeRooms, k as getSessionTurnPatchStreamKey, t as HttpError, w as WS_COMPACT_STREAM_CAPABILITY } from "./transport.js";
|
|
2
2
|
import { c as resolveWebsocketUrl } from "./environment.js";
|
|
3
3
|
//#region src/http-error.ts
|
|
4
4
|
/** Shared HTTP error code for every plan entitlement gate (402). */
|
package/dist/http.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { $ as CreateInvitationInput, $a as CompletionThinkingLevel, $n as SpaceFsPreparingFile, $t as ReferralListItem, A as BillingPluginStatus, An as SpaceCommerceFeatureBenefit, Ar as SpaceTurnAuthorFilter, At as MeResponse, B as BillingSubscriptionHistoryStatus, Bn as SpaceDefaultResponse, Br as UserActivityRankings, Bt as PublicUserProfile, C as BillingCreditStatus, Ca as BoardSequence, Cn as SpaceBootstrapStage, Cr as SpacePublicProfile, Ct as LabelItemsResponse, D as BillingDiscountPricing, Dn as SpaceCommerceBenefit, Dr as SpaceSandboxConfig, Dt as LabelResourceType, E as BillingDiscountOfferRef, Ea as BoardValidationResult, En as SpaceCheckpointDetailResponse, Er as SpaceSandboxAutoDestroyPolicy, Et as LabelRecord, F as BillingProductPricing, Fn as SpaceConfig, Fr as SpaceUsageSummary, Ft as PromptAccessMode, G as CheckpointDiffFileResponse, Ga as SessionForkRecord, Gn as SpaceFsCreateUploadInput, Gr as UserSessionSpaceSummary, Gt as ReferenceAggregateResponse, H as Channel, Ha as BoardRenderCost, Hn as SpaceFsCompleteUploadInput, Hr as UserProfile, Ht as PublicUserWorkItem, I as BillingPromotionCodePreview, In as SpaceConfigInput, Ir as TaskRunDetailResponse, It as PromptTemplateCatalogEntry, J as CheckpointDiffStats, Ja as SessionTurnRecord, Jn as SpaceFsEncoding, Jr as ChannelHealth, Jt as ReferenceQueryResponse, K as CheckpointDiffPatchKind, Ka as SessionTurnSegmentRecord, Kn as SpaceFsCreateUploadResponse, Kr as UserSessionsResponse, Kt as ReferenceDirection, L as BillingRedemptionResult, Ln as SpaceConfigResponse, Lr as TaskRunRecord, Lt as PromptTemplateCatalogResponse, M as BillingProductCreditBenefit, Mn as SpaceCommerceProduct, Mr as SpaceTurnsResponse, Mt as PatchResourceLabelsInput, N as BillingProductDisplay, Nn as SpaceCommerceProductBenefitBinding, Nr as SpaceUsageHourlyStat, Nt as PatchResourceLabelsResponse, O as BillingHistoryPagination, On as SpaceCommerceBuyerProfile, Or as SpaceSandboxProvider, Ot as LabelScopeType, P as BillingProductKind, Pn as SpaceCommerceProductCreditBenefit, Pr as SpaceUsageResponse, Pt as Permission, Q as ClaimReferralResponse, Qa as CompletionMessageRole, Qn as SpaceFsMoveInput, Qr as FeishuChannelConfig, Qt as ReferralDashboard, R as BillingResponsePayload, Rn as SpaceConfigUpdateResponse, Rr as UserActivityQuery, Rt as PublicReferral, S as BillingCreditGrantStatus, Sa as BoardRecord, Sn as SpaceBootstrapSource, Sr as SpacePresenceUser, St as LabelAssignmentRecord, T as BillingDiscountOffer, Ta as BoardTransaction, Tn as SpaceChannelBindingInput, Tr as SpaceRole, Tt as LabelListItem, U as CheckpointDiffDelivery, Un as SpaceFsCompleteUploadResponse, Ur as UserRulesResponse, Ut as ReferenceAggregateGroup, V as BillingSubscriptionSummary, Va as BoardCapability, Vn as SpaceEnvInput, Vr as UserActivityResponse, Vt as PublicUserSpaceItem, W as CheckpointDiffFile, Wa as MessageRecord, Wn as SpaceFsCreateDirectoryInput, Wr as UserSessionListItem, Wt as ReferenceAggregateGroupBy, X as CheckpointDiffSummary, Xa as CompletionAssistantMessage, Xn as SpaceFsFileKind, Xr as ChannelRuntimeState, Xt as ReferenceRecord, Y as CheckpointDiffStatus, Yn as SpaceFsEntry, Yr as ChannelHealthReasonCode, Yt as ReferenceQueryableType, Z as CheckpointRecord, Za as CompletionMessage, Zn as SpaceFsFileResponse, Zr as DiscordChannelConfig, Zt as ReferenceResourceType, _ as BillingCatalogProduct, _a as BoardOperation, _n as SkillCatalogResponse, _r as SpaceMeta, _t as JsonObject, aa as BoardBootstrap, an as SessionBindingRecord, ar as SpaceFsUploadEntry, at as CreateSpaceSessionInput, b as BillingConversionIntent, bn as SpaceAccessPolicy, br as SpacePendingDiffSummary, bt as LabelAssignmentListItem, ca as BoardCreateInput, cn as SessionMessagesResponse, cr as SpaceFsUploadPlanEntryInput, ct as CronJobUpdatePatch, d as BatchUserProfilesResponse, da as BoardEffect, di as GenerationContentBlock, dn as SessionTurnResponse, dr as SpaceFsWriteFileInput, dt as GenerationUsageHourlyStat, en as ReferralReward, eo as CompletionUsage, er as SpaceFsReadFilesError, et as CreateInvitationResponse, f as BillingBalanceActivity, fa as BoardInspectInput, fn as SessionTurnSignedUrlsResponse, fr as SpaceInvitation, ft as GenerationUsageSummary, g as BillingCatalog, ga as BoardNodeRecord, gn as SkillCatalogEntry, gr as SpaceMember, gt as InvitationDetail, h as BillingBalanceActivityStatus, ha as BoardNodeInput, hn as SessionTurnsPaginatedResponse, hr as SpaceListItem, ht as GlobalSearchType, ia as BoardAssetRef, in as SendMessageCronJobPayload, io as SpaceCompletionStreamEvent, ir as SpaceFsUploadDestination, it as CreateSpacePromptResponse, j as BillingProductBillingInterval, jn as SpaceCommerceOrder, jr as SpaceTurnListItem, jt as ModelCatalogEntry, k as BillingPaymentStatus, kn as SpaceCommerceCreditsBenefit, kr as SpaceSessionsResponse, kt as LabelSource, l as AcceptInvitationResponse, la as BoardDeleteReason, ln as SessionRecord, lr as SpaceFsUploadProgress, lt as CursorPageInfo, m as BillingBalanceActivityList, ma as BoardManifest, mn as SessionTurnWindowResponse, mr as SpaceInvitationLocation, mt as GlobalSearchResult, nn as ResourceLabelsResponse, no as ModelThinkingLevel, nr as SpaceFsReadFilesResponse, nt as CreateSpaceModInput, oa as BoardCapabilities, on as SessionMessageResponse, or as SpaceFsUploadError, ot as CronJobPayload, p as BillingBalanceActivityKind, pa as BoardKeyframe, pi as GenerationResult, pn as SessionTurnStreamSnapshotResponse, pr as SpaceInvitationListResponse, pt as GlobalSearchResponse, q as CheckpointDiffPatchLine, qa as SessionTurnIndexItem, qn as SpaceFsDeleteNodeInput, qr as ChannelConfig, qt as ReferenceKind, rn as SandboxSpecId, ro as SpaceCompletionResult, rr as SpaceFsTreeResponse, rt as CreateSpacePromptInput, sa as BoardClip, sn as SessionMessagesPaginatedResponse, so as ContentBlock, sr as SpaceFsUploadPlanEntry, st as CronJobRecord, ti as GenerationPolicy, tn as ReferralStatus, to as CreateSpaceCompletionInput, tr as SpaceFsReadFilesInput, tt as CreateSpaceInput, u as ApiError, ua as BoardDiagnostic, un as SessionTurnIndexResponse, ur as SpaceFsUploadResponse, ut as GenerationUsageBlock, v as BillingCheckoutActionState, va as BoardPlaybackCommand, vn as SkillCatalogSource, vr as SpaceModListItem, vt as JsonPrimitive, w as BillingCreditUnit, wa as BoardTarget, wn as SpaceBootstrapStatus, wr as SpaceRecord, wt as LabelItemsSessionFork, x as BillingCreditExpiryGroup, xa as BoardPlaybackSnapshot, xn as SpaceBootstrapMeta, xr as SpacePresenceSnapshot, xt as LabelAssignmentPageInfo, y as BillingCheckoutResult, ya as BoardPlaybackPolicy, yn as SpaceAccess, yr as SpacePendingDiffFileResponse, yt as JsonValue, z as BillingSubscriptionHistoryList, zn as SpaceCreateResponse, zr as UserActivityRange, zt as PublicUserPageResponse } from "./chunks/websocket.js";
|
|
2
|
-
import {
|
|
2
|
+
import { Bn as ModelStatusResponse, Fn as GenerationTaskResult, In as GenerationUsageBilling, Ln as ListGenerationModelsResponse, Mn as SpaceStartupResponse, Nn as CreateGenerationTaskRequest, Pn as CreateGenerationTaskResponse, Rn as PublicGenerationDeclaration, in as HttpError, n as createHttpClient, nn as CohubClientOptions, on as HttpTransport, rn as Fetch, t as CohubHttpClient, zn as ModelStatusEntry } from "./chunks/http.js";
|
|
3
3
|
export { AcceptInvitationResponse, ApiError, BatchUserProfilesResponse, BillingBalanceActivity, BillingBalanceActivityKind, BillingBalanceActivityList, BillingBalanceActivityStatus, BillingCatalog, BillingCatalogProduct, BillingCheckoutActionState, BillingCheckoutResult, BillingConversionIntent, BillingCreditExpiryGroup, BillingCreditGrantStatus, BillingCreditStatus, BillingCreditUnit, BillingDiscountOffer, BillingDiscountOfferRef, BillingDiscountPricing, BillingHistoryPagination, BillingPaymentStatus, BillingPluginStatus, BillingProductBillingInterval, BillingProductCreditBenefit, BillingProductDisplay, BillingProductKind, BillingProductPricing, BillingPromotionCodePreview, BillingRedemptionResult, BillingResponsePayload, BillingSubscriptionHistoryList, BillingSubscriptionHistoryStatus, BillingSubscriptionSummary, type BoardAssetRef, type BoardBootstrap, type BoardCapabilities, type BoardCapability, type BoardClip, type BoardCreateInput, type BoardDeleteReason, type BoardDiagnostic, type BoardEffect, type BoardInspectInput, type BoardKeyframe, type BoardManifest, type BoardNodeInput, type BoardNodeRecord, type BoardOperation, type BoardPlaybackCommand, type BoardPlaybackPolicy, type BoardPlaybackSnapshot, type BoardRecord, type BoardRenderCost, type BoardSequence, type BoardTarget, type BoardTransaction, type BoardValidationResult, Channel, type ChannelConfig, type ChannelHealth, type ChannelHealthReasonCode, type ChannelRuntimeState, CheckpointDiffDelivery, CheckpointDiffFile, CheckpointDiffFileResponse, CheckpointDiffPatchKind, CheckpointDiffPatchLine, CheckpointDiffStats, CheckpointDiffStatus, CheckpointDiffSummary, CheckpointRecord, ClaimReferralResponse, type CohubClientOptions, CohubHttpClient, type CompletionAssistantMessage, type CompletionMessage, type CompletionMessageRole, type CompletionThinkingLevel, type CompletionUsage, type ContentBlock, type CreateGenerationTaskRequest, type CreateGenerationTaskResponse, CreateInvitationInput, CreateInvitationResponse, type CreateSpaceCompletionInput, CreateSpaceInput, CreateSpaceModInput, CreateSpacePromptInput, CreateSpacePromptResponse, CreateSpaceSessionInput, CronJobPayload, CronJobRecord, CronJobUpdatePatch, CursorPageInfo, type DiscordChannelConfig, type FeishuChannelConfig, type Fetch, type GenerationContentBlock, type GenerationPolicy, type GenerationResult, type GenerationTaskResult, type GenerationUsageBilling, GenerationUsageBlock, GenerationUsageHourlyStat, GenerationUsageSummary, GlobalSearchResponse, GlobalSearchResult, GlobalSearchType, HttpError, HttpTransport, InvitationDetail, JsonObject, JsonPrimitive, JsonValue, LabelAssignmentListItem, LabelAssignmentPageInfo, LabelAssignmentRecord, LabelItemsResponse, LabelItemsSessionFork, LabelListItem, LabelRecord, LabelResourceType, LabelScopeType, LabelSource, type ListGenerationModelsResponse, MeResponse, type MessageRecord, ModelCatalogEntry, type ModelStatusEntry, type ModelStatusResponse, type ModelThinkingLevel, PatchResourceLabelsInput, PatchResourceLabelsResponse, Permission, PromptAccessMode, PromptTemplateCatalogEntry, PromptTemplateCatalogResponse, type PublicGenerationDeclaration, PublicReferral, PublicUserPageResponse, PublicUserProfile, PublicUserSpaceItem, PublicUserWorkItem, ReferenceAggregateGroup, ReferenceAggregateGroupBy, ReferenceAggregateResponse, ReferenceDirection, ReferenceKind, ReferenceQueryResponse, ReferenceQueryableType, ReferenceRecord, ReferenceResourceType, ReferralDashboard, ReferralListItem, ReferralReward, ReferralStatus, ResourceLabelsResponse, SandboxSpecId, SendMessageCronJobPayload, SessionBindingRecord, type SessionForkRecord, SessionMessageResponse, SessionMessagesPaginatedResponse, SessionMessagesResponse, SessionRecord, type SessionTurnIndexItem, SessionTurnIndexResponse, type SessionTurnRecord, SessionTurnResponse, type SessionTurnSegmentRecord, SessionTurnSignedUrlsResponse, SessionTurnStreamSnapshotResponse, SessionTurnWindowResponse, SessionTurnsPaginatedResponse, SkillCatalogEntry, SkillCatalogResponse, SkillCatalogSource, SpaceAccess, SpaceAccessPolicy, SpaceBootstrapMeta, SpaceBootstrapSource, SpaceBootstrapStage, SpaceBootstrapStatus, SpaceChannelBindingInput, SpaceCheckpointDetailResponse, SpaceCommerceBenefit, SpaceCommerceBuyerProfile, SpaceCommerceCreditsBenefit, SpaceCommerceFeatureBenefit, SpaceCommerceOrder, SpaceCommerceProduct, SpaceCommerceProductBenefitBinding, SpaceCommerceProductCreditBenefit, type SpaceCompletionResult, type SpaceCompletionStreamEvent, SpaceConfig, SpaceConfigInput, SpaceConfigResponse, SpaceConfigUpdateResponse, SpaceCreateResponse, SpaceDefaultResponse, SpaceEnvInput, SpaceFsCompleteUploadInput, SpaceFsCompleteUploadResponse, SpaceFsCreateDirectoryInput, SpaceFsCreateUploadInput, SpaceFsCreateUploadResponse, SpaceFsDeleteNodeInput, SpaceFsEncoding, SpaceFsEntry, SpaceFsFileKind, SpaceFsFileResponse, SpaceFsMoveInput, SpaceFsPreparingFile, SpaceFsReadFilesError, SpaceFsReadFilesInput, SpaceFsReadFilesResponse, SpaceFsTreeResponse, SpaceFsUploadDestination, SpaceFsUploadEntry, SpaceFsUploadError, SpaceFsUploadPlanEntry, SpaceFsUploadPlanEntryInput, SpaceFsUploadProgress, SpaceFsUploadResponse, SpaceFsWriteFileInput, SpaceInvitation, SpaceInvitationListResponse, SpaceInvitationLocation, SpaceListItem, SpaceMember, SpaceMeta, SpaceModListItem, SpacePendingDiffFileResponse, SpacePendingDiffSummary, SpacePresenceSnapshot, SpacePresenceUser, SpacePublicProfile, SpaceRecord, SpaceRole, SpaceSandboxAutoDestroyPolicy, SpaceSandboxConfig, SpaceSandboxProvider, SpaceSessionsResponse, type SpaceStartupResponse, SpaceTurnAuthorFilter, SpaceTurnListItem, SpaceTurnsResponse, SpaceUsageHourlyStat, SpaceUsageResponse, SpaceUsageSummary, TaskRunDetailResponse, TaskRunRecord, UserActivityQuery, UserActivityRange, UserActivityRankings, UserActivityResponse, UserProfile, UserRulesResponse, UserSessionListItem, UserSessionSpaceSummary, UserSessionsResponse, createHttpClient };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { $ as CreateInvitationInput, $a as CompletionThinkingLevel, $i as UiSurfaceRequest, $n as SpaceFsPreparingFile, $r as GenerationModelPolicy, $t as ReferralListItem, A as BillingPluginStatus, Aa as BOARD_NATIVE_NODE_TYPES, Ai as BoardAwarenessStateUpdate, An as SpaceCommerceFeatureBenefit, Ar as SpaceTurnAuthorFilter, At as MeResponse, B as BillingSubscriptionHistoryStatus, Bi as UI_COMMAND_MAX_TIMEOUT_MS, Bn as SpaceDefaultResponse, Br as UserActivityRankings, Bt as PublicUserProfile, C as BillingCreditStatus, Ca as BoardSequence, Ci as RealtimeServerEvent, Cn as SpaceBootstrapStage, Cr as SpacePublicProfile, Ct as LabelItemsResponse, D as BillingDiscountPricing, Da as parseBoardPlaybackPolicy, Di as WorkVersionPublishedEvent, Dn as SpaceCommerceBenefit, Dr as SpaceSandboxConfig, Dt as LabelResourceType, E as BillingDiscountOfferRef, Ea as BoardValidationResult, En as SpaceCheckpointDetailResponse, Er as SpaceSandboxAutoDestroyPolicy, Et as LabelRecord, F as BillingProductPricing, Fa as BoardNodeContract, Fi as WorkArtifactManifestFile, Fn as SpaceConfig, Fr as SpaceUsageSummary, Ft as PromptAccessMode, G as CheckpointDiffFileResponse, Ga as SessionForkRecord, Gi as UI_COMMAND_VERSION, Gn as SpaceFsCreateUploadInput, Gr as UserSessionSpaceSummary, Gt as ReferenceAggregateResponse, H as Channel, Ha as BoardRenderCost, Hi as UI_COMMAND_PENDING_TTL_SECONDS, Hn as SpaceFsCompleteUploadInput, Hr as UserProfile, Ht as PublicUserWorkItem, I as BillingPromotionCodePreview, Ia as BoardNodeValidationDiagnostic, Ii as WorkBoardArtifactManifest, In as SpaceConfigInput, Ir as TaskRunDetailResponse, It as PromptTemplateCatalogEntry, J as CheckpointDiffStats, Ja as SessionTurnRecord, Ji as UiCommandError, Jn as SpaceFsEncoding, Jr as ChannelHealth, Jt as ReferenceQueryResponse, K as CheckpointDiffPatchKind, Ka as SessionTurnSegmentRecord, Ki as UiCommand, Kn as SpaceFsCreateUploadResponse, Kr as UserSessionsResponse, Kt as ReferenceDirection, L as BillingRedemptionResult, La as validateBoardNodeInput, Li as WorkBoardAsset, Ln as SpaceConfigResponse, Lr as TaskRunRecord, Lt as PromptTemplateCatalogResponse, M as BillingProductCreditBenefit, Ma as BoardColorId, Mi as WorkArtifactDescriptor, Mn as SpaceCommerceProduct, Mr as SpaceTurnsResponse, Mt as PatchResourceLabelsInput, N as BillingProductDisplay, Na as BoardGeoKind, Ni as WorkArtifactDownloadDescriptor, Nn as SpaceCommerceProductBenefitBinding, Nr as SpaceUsageHourlyStat, Nt as PatchResourceLabelsResponse, O as BillingHistoryPagination, Oa as BOARD_COLOR_IDS, Oi as BoardAwarenessGesture, On as SpaceCommerceBuyerProfile, Or as SpaceSandboxProvider, Ot as LabelScopeType, P as BillingProductKind, Pa as BoardNativeNodeType, Pi as WorkArtifactManifest, Pn as SpaceCommerceProductCreditBenefit, Pr as SpaceUsageResponse, Pt as Permission, Q as ClaimReferralResponse, Qa as CompletionMessageRole, Qi as UiPreviewTarget, Qn as SpaceFsMoveInput, Qr as FeishuChannelConfig, Qt as ReferralDashboard, R as BillingResponsePayload, Ri as WorkContentKind, Rn as SpaceConfigUpdateResponse, Rr as UserActivityQuery, Rt as PublicReferral, S as BillingCreditGrantStatus, Sa as BoardRecord, Si as RealtimeRoomMember, Sn as SpaceBootstrapSource, So as resolveRequestSourceChannel, Sr as SpacePresenceUser, St as LabelAssignmentRecord, T as BillingDiscountOffer, Ta as BoardTransaction, Ti as RealtimeWorkVersionRecord, Tn as SpaceChannelBindingInput, Tr as SpaceRole, Tt as LabelListItem, U as CheckpointDiffDelivery, Ui as UI_COMMAND_SETTLEMENT_GRACE_SECONDS, Un as SpaceFsCompleteUploadResponse, Ur as UserRulesResponse, Ut as ReferenceAggregateGroup, V as BillingSubscriptionSummary, Va as BoardCapability, Vi as UI_COMMAND_PAYLOAD_MAX_BYTES, Vn as SpaceEnvInput, Vr as UserActivityResponse, Vt as PublicUserSpaceItem, W as CheckpointDiffFile, Wa as MessageRecord, Wi as UI_COMMAND_TERMINAL_TTL_SECONDS, Wn as SpaceFsCreateDirectoryInput, Wr as UserSessionListItem, Wt as ReferenceAggregateGroupBy, X as CheckpointDiffSummary, Xa as CompletionAssistantMessage, Xi as UiCommandStatus, Xn as SpaceFsFileKind, Xr as ChannelRuntimeState, Xt as ReferenceRecord, Y as CheckpointDiffStatus, Yi as UiCommandRecord, Yn as SpaceFsEntry, Yr as ChannelHealthReasonCode, Yt as ReferenceQueryableType, Z as CheckpointRecord, Za as CompletionMessage, Zi as UiPreviewShowCommand, Zn as SpaceFsFileResponse, Zr as DiscordChannelConfig, Zt as ReferenceResourceType, _ as BillingCatalogProduct, _a as BoardOperation, _i as ChannelEnvelope, _n as SkillCatalogResponse, _o as mergeRequestSourceIntoMeta, _r as SpaceMeta, _t as JsonObject, aa as BoardBootstrap, ai as encodeGenerationPolicy, an as SessionBindingRecord, ar as SpaceFsUploadEntry, at as CreateSpaceSessionInput, b as BillingConversionIntent, ba as BoardPlaybackPolicySchema, bi as RealtimeRoomDescriptor, bn as SpaceAccessPolicy, bo as readRequestSourceFromEnv, br as SpacePendingDiffSummary, bt as LabelAssignmentListItem, c as createWebsocketClient, ca as BoardCreateInput, ci as getAllowedGenerationModelIds, cn as SessionMessagesResponse, co as COHUB_SOURCE_HEADER, cr as SpaceFsUploadPlanEntryInput, ct as CronJobUpdatePatch, d as BatchUserProfilesResponse, da as BoardEffect, di as GenerationContentBlock, dn as SessionTurnResponse, do as RequestSource, dr as SpaceFsWriteFileInput, dt as GenerationUsageHourlyStat, ea as UiWorkPreviewTarget, ei as GenerationParameterConstraint, en as ReferralReward, eo as CompletionUsage, er as SpaceFsReadFilesError, et as CreateInvitationResponse, f as BillingBalanceActivity, fa as BoardInspectInput, fi as GenerationModelDeclaration, fn as SessionTurnSignedUrlsResponse, fo as RequestSourceVia, fr as SpaceInvitation, ft as GenerationUsageSummary, g as BillingCatalog, ga as BoardNodeRecord, gn as SkillCatalogEntry, go as isRequestSourceUuid, gr as SpaceMember, gt as InvitationDetail, h as BillingBalanceActivityStatus, ha as BoardNodeInput, hn as SessionTurnsPaginatedResponse, ho as isRequestSourceEmpty, hr as SpaceListItem, ht as GlobalSearchType, ia as BoardAssetRef, ii as decodeGenerationPolicy, in as SendMessageCronJobPayload, io as SpaceCompletionStreamEvent, ir as SpaceFsUploadDestination, it as CreateSpacePromptResponse, j as BillingProductBillingInterval, ja as BOARD_NODE_CONTRACT, ji as BoardAwarenessUpdate, jn as SpaceCommerceOrder, jr as SpaceTurnListItem, jt as ModelCatalogEntry, k as BillingPaymentStatus, ka as BOARD_GEO_KINDS, ki as BoardAwarenessNodePreview, kn as SpaceCommerceCreditsBenefit, kr as SpaceSessionsResponse, kt as LabelSource, l as AcceptInvitationResponse, la as BoardDeleteReason, li as normalizeGenerationPolicy, ln as SessionRecord, lo as COHUB_SOURCE_HEADER_NAMES, lr as SpaceFsUploadProgress, lt as CursorPageInfo, m as BillingBalanceActivityList, ma as BoardManifest, mn as SessionTurnWindowResponse, mo as isRequestSourceClientId, mr as SpaceInvitationLocation, mt as GlobalSearchResult, na as isUiSurfaceMethod, ni as GenerationPolicyError, nn as ResourceLabelsResponse, no as ModelThinkingLevel, nr as SpaceFsReadFilesResponse, nt as CreateSpaceModInput, oa as BoardCapabilities, oi as filterGenerationDeclarationsByPolicy, on as SessionMessageResponse, or as SpaceFsUploadError, ot as CronJobPayload, p as BillingBalanceActivityKind, pa as BoardKeyframe, pi as GenerationResult, pn as SessionTurnStreamSnapshotResponse, po as hasRequestSourceIdentity, pr as SpaceInvitationListResponse, pt as GlobalSearchResponse, q as CheckpointDiffPatchLine, qa as SessionTurnIndexItem, qi as UiCommandDispatchedPayload, qn as SpaceFsDeleteNodeInput, qr as ChannelConfig, qt as ReferenceKind, r as WebsocketClient, ra as parseUiCommand, ri as assertGenerationRequestAllowedByPolicy, rn as SandboxSpecId, ro as SpaceCompletionResult, rr as SpaceFsTreeResponse, rt as CreateSpacePromptInput, s as WebsocketEventPayload, sa as BoardClip, si as findGenerationModelPolicy, sn as SessionMessagesPaginatedResponse, so as ContentBlock, sr as SpaceFsUploadPlanEntry, st as CronJobRecord, ta as isTerminalUiCommandStatus, ti as GenerationPolicy, tn as ReferralStatus, to as CreateSpaceCompletionInput, tr as SpaceFsReadFilesInput, tt as CreateSpaceInput, u as ApiError, ua as BoardDiagnostic, ui as parseGenerationPolicyFromEnv, un as SessionTurnIndexResponse, uo as REQUEST_SOURCE_VIA_MAX_LENGTH, ur as SpaceFsUploadResponse, ut as GenerationUsageBlock, v as BillingCheckoutActionState, va as BoardPlaybackCommand, vi as LabelAssignmentsUpdatedEvent, vn as SkillCatalogSource, vo as normalizeRequestSource, vr as SpaceModListItem, vt as JsonPrimitive, w as BillingCreditUnit, wa as BoardTarget, wi as RealtimeWorkRecord, wn as SpaceBootstrapStatus, wr as SpaceRecord, wt as LabelItemsSessionFork, x as BillingCreditExpiryGroup, xa as BoardPlaybackSnapshot, xi as RealtimeRoomEvent, xn as SpaceBootstrapMeta, xo as requestSourceToHeaders, xr as SpacePresenceSnapshot, xt as LabelAssignmentPageInfo, y as BillingCheckoutResult, ya as BoardPlaybackPolicy, yn as SpaceAccess, yo as parseRequestSourceFromHeaders, yr as SpacePendingDiffFileResponse, yt as JsonValue, z as BillingSubscriptionHistoryList, zi as UI_COMMAND_DEFAULT_TIMEOUT_MS, zn as SpaceCreateResponse, zr as UserActivityRange, zt as PublicUserPageResponse } from "./chunks/websocket.js";
|
|
2
2
|
import { a as normalizeWebsocketUrl, c as resolveVoiceInputWebsocketUrl, i as normalizeVoiceInputWebsocketUrl, l as resolveWebsocketUrl, n as CohubEnvironment, o as resolveApiBaseUrl, r as normalizeBaseUrl, s as resolveCohubEnvironment, t as COHUB_ENVIRONMENTS } from "./chunks/environment.js";
|
|
3
|
-
import { $ as
|
|
3
|
+
import { $ as BoardTransactionError, $t as GenerationsApi, A as WorkResolveResponse, An as PublicFileUploadPlanEntry, At as SessionPatchApplyInput, B as ReferralsApi, Bn as ModelStatusResponse, Bt as CreatePublicAssetUploadInput, C as WorkPromotionProvider, Cn as createWorkRuntime, Ct as GenerationStreamStateEvent, D as WorkPublicOwnerRecord, Dn as PublicFileListEntry, Dt as SessionGenerationStreamClient, E as WorkPromotionStatsResponse, En as PublicFileCreateUploadResponse, Et as GenerationStreamTurnUpdatedEvent, F as WorkVersionRecord, Fn as GenerationTaskResult, Ft as createSessionPatchReducer, G as WaitForUiCommandOptions, Gt as PublicAssetUploadProtocol, H as UserApi, Ht as PublicAssetMimeType, I as WorkViewSource, In as GenerationUsageBilling, It as SessionAccessApi, J as BoardClient, Jt as UploadChatImageAttachmentInput, K as TasksApi, Kt as PublicAssetsApi, L as WorkViewStatsResponse, Ln as ListGenerationModelsResponse, Lt as ReferenceResourceSelector, M as WorkStatus, Mn as SpaceStartupResponse, Mt as SessionPatchReducer, N as WorkTargetType, Nn as CreateGenerationTaskRequest, Nt as SessionPatchState, O as WorkPublicSpaceRecord, On as PublicFileListResponse, Ot as createSessionGenerationStreamClient, P as WorkUpdateInput, Pn as CreateGenerationTaskResponse, Pt as SessionPatchStatus, Q as BoardTransactionAppliedEvent, Qt as ModelsApi, R as WorkVisibility, Rn as PublicGenerationDeclaration, Rt as ReferencesApi, S as WorkPromotionEventResponse, Sn as createSlugWorkIdResolver, St as GenerationStreamOutOfSyncEvent, T as WorkPromotionRecord, Tn as PublicFileCreateUploadInput, Tt as GenerationStreamSubscriptionHandlers, U as CreateUiCommandInput, Ut as PublicAssetPurpose, V as UsersApi, Vt as CreatePublicAssetUploadResponse, W as UiCommandsApi, Wt as PublicAssetUploadProgress, X as BoardPlaybackChangedEvent, Xt as SkillsApi, Y as BoardEventName, Yt as UploadPublicAssetInput, Z as BoardSubscriptionHandlers, Zt as PromptsApi, _ as WorkExtractedPageMeta, _n as WorkRuntimeCheckoutStatus, _t as GenerationStreamErrorEvent, a as WorkCommerceCreditConsumeResponse, an as HttpTraceContext, at as SpaceEventName, b as WorkPresentationMeta, bn as WorkRuntimeRequestOptions, bt as GenerationStreamIntermediateMessage, c as WorkCommerceEntitlementsResponse, cn as UnauthorizedContext, ct as SpacesApi, d as WorkCommercePurchaseResponse, dn as sanitizeAccessToken, dt as BuildSpacePathInput, en as CronJobsApi, et as BoardTransactionInput, f as WorkAuthorizeResponse, fn as ParentBridgeTransport, ft as PublicInviteApi, g as WorkDetailResponse, gn as WorkRuntimeCheckoutState, gt as GenerationStreamCommitEvent, h as WorkCreateInput, hn as WorkRuntimeApi, ht as AssistantMessageCommit, i as WorkCommerceCheckoutStatus, in as HttpError, it as SpaceClient, j as WorkSessionResponse, jn as PublicFileUrlResponse, jt as SessionPatchApplyResult, k as WorkRecord, kn as PublicFileUploadEntryInput, kt as parseAssistantMessageCommit, l as WorkCommerceOrder, ln as joinApiUrl, lt as WebSocketConnectionState, m as WorkContentDownload, mn as WorkIdResolver, mt as buildSpacePath, n as createHttpClient, nn as CohubClientOptions, nt as SessionSubscriptionHandlers, o as WorkCommerceCreditConsumeStatus, on as HttpTransport, ot as SpacePublicFilesApi, p as WorkContent, pn as PopupBrokerTransport, pt as buildSpaceInvitePath, q as BoardAwarenessUpdatedEvent, qt as UploadChatAttachmentInput, r as WorkCommerceApi, rn as Fetch, rt as SpaceChannelBindingRecord, s as WorkCommerceEntitlement, sn as RawHttpResponse, st as SpaceTurnListOptions, t as CohubHttpClient, tn as ChannelsApi, tt as SessionEventName, u as WorkCommerceProductResolveResponse, un as matchesUnauthorizedErrorToken, ut as BuildSpaceInvitePathInput, v as WorkGetResponse, vn as WorkRuntimeContext, vt as GenerationStreamEvent, w as WorkPromotionProviderStatus, wn as resolveWorkTransport, wt as GenerationStreamSubscribeOptions, x as WorkPromotionCreateInput, xn as WorkRuntimeTransport, xt as GenerationStreamLifecycleEvent, y as WorkMeta, yn as WorkRuntimeModeConfig, yt as GenerationStreamFinalizedEvent, z as WorksApi, zn as ModelStatusEntry, zt as SearchApi } from "./chunks/http.js";
|
|
4
4
|
import { a as VoiceInputCreateOptions, i as VoiceInputClientOptions, l as createVoiceInputClient, n as VoiceInputCallbacks, o as VoiceInputEvent, r as VoiceInputClient, t as VoiceApi } from "./chunks/voice-input.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
//#region ../protocol/dist/generation/catalog.d.ts
|
|
@@ -10,6 +10,10 @@ declare function filterDiscoverableGenerationModels<T extends GenerationModelVis
|
|
|
10
10
|
includeModelIds?: Iterable<string>;
|
|
11
11
|
}): T[];
|
|
12
12
|
//#endregion
|
|
13
|
+
//#region ../protocol/dist/identifiers.d.ts
|
|
14
|
+
declare function isUuid(value: string): boolean;
|
|
15
|
+
declare function isUuid(value: unknown): value is string;
|
|
16
|
+
//#endregion
|
|
13
17
|
//#region ../protocol/dist/work-surface.d.ts
|
|
14
18
|
declare const WORK_SURFACE_PROTOCOL = "cohub.surface";
|
|
15
19
|
declare const WORK_SURFACE_VERSION = 1;
|
|
@@ -349,6 +353,14 @@ declare class CohubClient {
|
|
|
349
353
|
declare const createCohubClient: (options?: CohubClientOptions) => CohubClient;
|
|
350
354
|
//#endregion
|
|
351
355
|
//#region src/work-ref.d.ts
|
|
356
|
+
/**
|
|
357
|
+
* Accepts every way a Work is named across Cohub — id, management URL, public
|
|
358
|
+
* URL, `cohub://works` URI, or `username/space/work` — and normalizes it.
|
|
359
|
+
*
|
|
360
|
+
* Public and mention forms may carry launch state (`?query#hash`); it is kept
|
|
361
|
+
* separately so it can be forwarded to the Work while the stable identity stays
|
|
362
|
+
* clean.
|
|
363
|
+
*/
|
|
352
364
|
type WorkPublicRef = {
|
|
353
365
|
username: string;
|
|
354
366
|
spaceSlug: string;
|
|
@@ -392,6 +404,10 @@ type WorkPurchaseRequest = {
|
|
|
392
404
|
productKey: string;
|
|
393
405
|
purchaseAttemptId: string;
|
|
394
406
|
};
|
|
407
|
+
type WorkCheckoutStarted = WorkPurchaseRequest & {
|
|
408
|
+
value?: number;
|
|
409
|
+
currency?: string;
|
|
410
|
+
};
|
|
395
411
|
/**
|
|
396
412
|
* Reactive dialog state managed by the core. The host (Svelte or React)
|
|
397
413
|
* subscribes via {@link WorkBridgeCoreConfig.onStateChange} and mirrors these
|
|
@@ -419,6 +435,12 @@ type WorkBridgeGetAccessToken = (options?: {
|
|
|
419
435
|
* Used for ownership checks and silent re-authorization cache lookups.
|
|
420
436
|
*/
|
|
421
437
|
type WorkBridgeGetViewerUuid = () => Promise<string | null>;
|
|
438
|
+
type WorkPromotionAttributionContext = {
|
|
439
|
+
promotionId: string;
|
|
440
|
+
sourceUrl?: string;
|
|
441
|
+
fbp?: string;
|
|
442
|
+
fbc?: string;
|
|
443
|
+
};
|
|
422
444
|
type WorkBridgeAuthorizationContext = {
|
|
423
445
|
/** The host surface handling this authorization request. */
|
|
424
446
|
surface: "page" | "preview" | "background" | "broker";
|
|
@@ -455,6 +477,12 @@ type WorkBridgeCoreConfig = {
|
|
|
455
477
|
getViewerUuid: WorkBridgeGetViewerUuid;
|
|
456
478
|
/** Starts a sign-in flow with a post-login redirect path. */
|
|
457
479
|
requestSignIn: WorkBridgeRequestSignIn;
|
|
480
|
+
/** Returns optional host-owned promotion attribution for checkout. */
|
|
481
|
+
getPromotionAttribution?: () => WorkPromotionAttributionContext | null;
|
|
482
|
+
/** Called when the host displays the purchase confirmation. */
|
|
483
|
+
onPurchaseRequested?: (input: WorkPurchaseRequest) => void;
|
|
484
|
+
/** Called immediately before navigating to a usable checkout. */
|
|
485
|
+
onCheckoutStarted?: (input: WorkCheckoutStarted) => void;
|
|
458
486
|
/** Called whenever the dialog state changes, for reactive UI binding. */
|
|
459
487
|
onStateChange?: (state: WorkBridgeDialogState) => void;
|
|
460
488
|
};
|
|
@@ -848,4 +876,4 @@ declare function createBoardExtensionRegistry(input?: {
|
|
|
848
876
|
builtins?: boolean;
|
|
849
877
|
}): BoardExtensionRegistry;
|
|
850
878
|
//#endregion
|
|
851
|
-
export { AcceptInvitationResponse, ApiError, type AssistantMessageCommit, BILLING_ACCESS_BLOCKED_ERROR_CODE, BOARD_COLOR_IDS, BOARD_GEO_KINDS, BOARD_NATIVE_NODE_TYPES, BOARD_NODE_CONTRACT, BatchUserProfilesResponse, BillingApi, BillingBalanceActivity, BillingBalanceActivityKind, BillingBalanceActivityList, BillingBalanceActivityStatus, BillingCatalog, BillingCatalogProduct, BillingCheckoutActionState, BillingCheckoutResult, BillingConversionIntent, BillingCreditExpiryGroup, BillingCreditGrantStatus, BillingCreditStatus, BillingCreditUnit, BillingDiscountOffer, BillingDiscountOfferRef, BillingDiscountPricing, BillingHistoryPagination, BillingPaymentStatus, BillingPluginStatus, BillingProductBillingInterval, BillingProductCreditBenefit, BillingProductDisplay, BillingProductKind, BillingProductPricing, BillingPromotionCodePreview, BillingRedemptionResult, BillingResponsePayload, BillingSubscriptionHistoryList, BillingSubscriptionHistoryStatus, BillingSubscriptionSummary, type BoardAssetRef, type BoardAwarenessGesture, type BoardAwarenessNodePreview, type BoardAwarenessStateUpdate, type BoardAwarenessUpdate, type BoardAwarenessUpdatedEvent, type BoardBootstrap, type BoardCapabilities, type BoardCapability, BoardClient, type BoardClip, type BoardColorId, type BoardCreateInput, type BoardDeleteReason, type BoardDiagnostic, type BoardEffect, type BoardEventName, BoardExtensionDefinition, BoardExtensionRegistry, type BoardGeoKind, BoardInputError, type BoardInspectInput, type BoardKeyframe, type BoardManifest, type BoardNativeNodeType, type BoardNodeContract, type BoardNodeFrameInput, type BoardNodeInput, type BoardNodeRecord, type BoardNodeSpec, type BoardNodeValidationDiagnostic, type BoardOperation, type BoardPlaybackChangedEvent, type BoardPlaybackCommand, type BoardPlaybackPolicy, BoardPlaybackPolicySchema, type BoardPlaybackSnapshot, BoardPresetDefinition, type BoardRecord, type BoardRenderCost, type BoardSequence, type BoardSubscriptionHandlers, type BoardTarget, type BoardTransaction, type BoardTransactionAppliedEvent, BoardTransactionError, type BoardTransactionInput, type BoardValidationResult, type BuildSpaceInvitePathInput, type BuildSpacePathInput, COHUB_ENVIRONMENTS, COHUB_SOURCE_HEADER, COHUB_SOURCE_HEADER_NAMES, Channel, type ChannelConfig, type ChannelEnvelope, type ChannelHealth, type ChannelHealthReasonCode, type ChannelRuntimeState, CheckpointDiffDelivery, CheckpointDiffFile, CheckpointDiffFileResponse, CheckpointDiffPatchKind, CheckpointDiffPatchLine, CheckpointDiffStats, CheckpointDiffStatus, CheckpointDiffSummary, CheckpointRecord, ClaimReferralResponse, CohubClient, type CohubClientOptions, type CohubEnvironment, CohubHttpClient, CompiledSequence, type CompletionAssistantMessage, type CompletionMessage, type CompletionMessageRole, type CompletionThinkingLevel, type CompletionUsage, type ContentBlock, type CreateGenerationTaskRequest, type CreateGenerationTaskResponse, CreateInvitationInput, CreateInvitationResponse, type CreatePublicAssetUploadInput, type CreatePublicAssetUploadResponse, type CreateSpaceCompletionInput, CreateSpaceInput, CreateSpaceModInput, CreateSpacePromptInput, CreateSpacePromptResponse, CreateSpaceSessionInput, type CreateUiCommandInput, CronJobPayload, CronJobRecord, CronJobUpdatePatch, CursorPageInfo, DEFAULT_BOARD_LIMITS, type DiscordChannelConfig, FEATURE_NOT_ENTITLED_ERROR_CODE, type FeishuChannelConfig, type Fetch, type GenerationContentBlock, type GenerationModelPolicy, type GenerationModelVisibility, type GenerationParameterConstraint, type GenerationPolicy, GenerationPolicyError, type GenerationResult, type GenerationStreamCommitEvent, type GenerationStreamErrorEvent, type GenerationStreamEvent, type GenerationStreamFinalizedEvent, type GenerationStreamIntermediateMessage, type GenerationStreamLifecycleEvent, type GenerationStreamOutOfSyncEvent, type GenerationStreamStateEvent, type GenerationStreamSubscribeOptions, type GenerationStreamSubscriptionHandlers, type GenerationStreamTurnUpdatedEvent, type GenerationTaskResult, type GenerationUsageBilling, GenerationUsageBlock, GenerationUsageHourlyStat, GenerationUsageSummary, GlobalSearchResponse, GlobalSearchResult, GlobalSearchType, HttpError, type HttpTraceContext, InvitationDetail, JsonObject, JsonPrimitive, JsonValue, LabelAssignmentListItem, LabelAssignmentPageInfo, LabelAssignmentRecord, type LabelAssignmentsUpdatedEvent, LabelItemsResponse, LabelItemsSessionFork, LabelListItem, LabelRecord, LabelResourceType, LabelScopeType, LabelSource, type ListGenerationModelsResponse, MeResponse, type MessageRecord, ModelCatalogEntry, type ModelStatusEntry, type ModelStatusResponse, type ModelThinkingLevel, ParentBridgeTransport, type ParsedWorkRef, PatchResourceLabelsInput, PatchResourceLabelsResponse, Permission, PopupBrokerTransport, PromptAccessMode, PromptTemplateCatalogEntry, PromptTemplateCatalogResponse, type PublicAssetMimeType, type PublicAssetPurpose, type PublicAssetUploadProgress, type PublicAssetUploadProtocol, type PublicFileCreateUploadInput, type PublicFileCreateUploadResponse, type PublicFileListEntry, type PublicFileListResponse, type PublicFileUploadEntryInput, type PublicFileUploadPlanEntry, type PublicFileUrlResponse, type PublicGenerationDeclaration, PublicReferral, PublicUserPageResponse, PublicUserProfile, PublicUserSpaceItem, PublicUserWorkItem, QualityProfile, REQUEST_SOURCE_VIA_MAX_LENGTH, type RawHttpResponse, type RealtimeRoomDescriptor, type RealtimeRoomEvent, type RealtimeRoomMember, type RealtimeServerEvent, type RealtimeWorkRecord, type RealtimeWorkVersionRecord, ReferenceAggregateGroup, ReferenceAggregateGroupBy, ReferenceAggregateResponse, ReferenceDirection, ReferenceKind, ReferenceQueryResponse, ReferenceQueryableType, ReferenceRecord, type ReferenceResourceSelector, ReferenceResourceType, ReferencesApi, ReferralDashboard, ReferralListItem, ReferralReward, ReferralStatus, ReferralsApi, RenderBounds, type RequestSource, type RequestSourceVia, ResourceLabelsResponse, SandboxSpecId, SendMessageCronJobPayload, SessionBindingRecord, type SessionEventName, type SessionForkRecord, SessionGenerationStreamClient, SessionMessageResponse, SessionMessagesPaginatedResponse, SessionMessagesResponse, type SessionPatchApplyInput, type SessionPatchApplyResult, SessionPatchReducer, type SessionPatchState, type SessionPatchStatus, SessionRecord, type SessionSubscriptionHandlers, type SessionTurnIndexItem, SessionTurnIndexResponse, type SessionTurnRecord, SessionTurnResponse, type SessionTurnSegmentRecord, SessionTurnSignedUrlsResponse, SessionTurnStreamSnapshotResponse, SessionTurnWindowResponse, SessionTurnsPaginatedResponse, SkillCatalogEntry, SkillCatalogResponse, SkillCatalogSource, SpaceAccess, SpaceAccessPolicy, SpaceBootstrapMeta, SpaceBootstrapSource, SpaceBootstrapStage, SpaceBootstrapStatus, SpaceChannelBindingInput, type SpaceChannelBindingRecord, SpaceCheckpointDetailResponse, SpaceCommerceBenefit, SpaceCommerceBuyerProfile, SpaceCommerceCreditsBenefit, SpaceCommerceFeatureBenefit, SpaceCommerceOrder, SpaceCommerceProduct, SpaceCommerceProductBenefitBinding, SpaceCommerceProductCreditBenefit, type SpaceCompletionResult, type SpaceCompletionStreamEvent, SpaceConfig, SpaceConfigInput, SpaceConfigResponse, SpaceConfigUpdateResponse, SpaceCreateResponse, SpaceDefaultResponse, SpaceEnvInput, type SpaceEventName, SpaceFsCompleteUploadInput, SpaceFsCompleteUploadResponse, SpaceFsCreateDirectoryInput, SpaceFsCreateUploadInput, SpaceFsCreateUploadResponse, SpaceFsDeleteNodeInput, SpaceFsEncoding, SpaceFsEntry, SpaceFsFileKind, SpaceFsFileResponse, SpaceFsMoveInput, SpaceFsPreparingFile, SpaceFsReadFilesError, SpaceFsReadFilesInput, SpaceFsReadFilesResponse, SpaceFsTreeResponse, SpaceFsUploadDestination, SpaceFsUploadEntry, SpaceFsUploadError, SpaceFsUploadPlanEntry, SpaceFsUploadPlanEntryInput, SpaceFsUploadProgress, SpaceFsUploadResponse, SpaceFsWriteFileInput, SpaceInvitation, SpaceInvitationListResponse, SpaceInvitationLocation, SpaceListItem, SpaceMember, SpaceMeta, SpaceModListItem, SpacePendingDiffFileResponse, SpacePendingDiffSummary, SpacePresenceSnapshot, SpacePresenceUser, SpacePublicFilesApi, SpacePublicProfile, SpaceRecord, SpaceRole, SpaceSandboxAutoDestroyPolicy, SpaceSandboxConfig, SpaceSandboxProvider, SpaceSessionsResponse, type SpaceStartupResponse, SpaceTurnAuthorFilter, SpaceTurnListItem, type SpaceTurnListOptions, SpaceTurnsResponse, SpaceUsageHourlyStat, SpaceUsageResponse, SpaceUsageSummary, TaskRunDetailResponse, TaskRunRecord, TimelineClipInput, TimelineInput, UI_COMMAND_DEFAULT_TIMEOUT_MS, UI_COMMAND_MAX_TIMEOUT_MS, UI_COMMAND_PAYLOAD_MAX_BYTES, UI_COMMAND_PENDING_TTL_SECONDS, UI_COMMAND_SETTLEMENT_GRACE_SECONDS, UI_COMMAND_TERMINAL_TTL_SECONDS, UI_COMMAND_VERSION, type UiCommand, type UiCommandDispatchedPayload, type UiCommandError, type UiCommandRecord, type UiCommandStatus, UiCommandsApi, type UiPreviewShowCommand, type UiPreviewTarget, type UiSurfaceRequest, type UiWorkPreviewTarget, type UnauthorizedContext, type UploadChatAttachmentInput, type UploadChatImageAttachmentInput, type UploadPublicAssetInput, UserActivityQuery, UserActivityRange, UserActivityRankings, UserActivityResponse, UserProfile, UserRulesResponse, UserSessionListItem, UserSessionSpaceSummary, UserSessionsResponse, UsersApi, VoiceApi, type VoiceInputCallbacks, VoiceInputClient, type VoiceInputClientOptions, type VoiceInputCreateOptions, type VoiceInputEvent, WORK_COMPOSER_CHIP_CONTENT_MAX_BYTES, WORK_COMPOSER_CHIP_KEY_MAX_LENGTH, WORK_COMPOSER_CHIP_LABEL_MAX_LENGTH, WORK_SURFACE_READY_TIMEOUT_MS, WORK_SURFACE_REQUEST_TIMEOUT_MS, type WaitForUiCommandOptions, type WebSocketConnectionState, WebsocketClient, type WorkArtifactDescriptor, type WorkArtifactDownloadDescriptor, type WorkArtifactManifest, type WorkArtifactManifestFile, type WorkAuthorizeRequest, type WorkAuthorizeResponse, type WorkBoardArtifactManifest, type WorkBoardAsset, type WorkBridgeAuthorizationContext, type WorkBridgeCore, type WorkBridgeCoreConfig, type WorkBridgeCoreWork, type WorkBridgeDialogState, type WorkBridgeGetAccessToken, type WorkBridgeGetViewerUuid, type WorkBridgeRequestSignIn, WorkCommerceApi, type WorkCommerceCheckoutStatus, type WorkCommerceCreditConsumeResponse, type WorkCommerceCreditConsumeStatus, type WorkCommerceEntitlement, type WorkCommerceEntitlementsResponse, type WorkCommerceOrder, type WorkCommerceProductResolveResponse, type WorkCommercePurchaseResponse, type WorkComposerChip, type WorkContent, type WorkContentDownload, type WorkContentKind, type WorkCreateInput, type WorkDetailResponse, type WorkExtractedPageMeta, type WorkGetResponse, type WorkIdResolver, type WorkMeta, type WorkPresentationMeta, type WorkPublicOwnerRecord, type WorkPublicRef, type WorkPublicSpaceRecord, type WorkPurchaseRequest, WorkRealtimeApi, type WorkRecord, WorkRefParseError, type WorkResolveResponse, WorkRoom, type WorkRoomAdmissionResponse, type WorkRoomCreateInput, type WorkRoomEvent, type WorkRoomEventMap, type WorkRoomPublishResult, type WorkRoomState, WorkRuntimeApi, type WorkRuntimeCheckoutState, type WorkRuntimeCheckoutStatus, type WorkRuntimeContext, type WorkRuntimeModeConfig, type WorkRuntimeRequestOptions, type WorkRuntimeTransport, type WorkSessionResponse, type WorkStatus, WorkSurfaceApi, type WorkSurfaceHandler, type WorkSurfaceHandlerContext, type WorkSurfaceReadyMessage, type WorkSurfaceResponseMessage, type WorkTargetType, type WorkUpdateInput, type WorkVersionPublishedEvent, type WorkVersionRecord, type WorkViewSource, type WorkViewStatsResponse, type WorkVisibility, WorksApi, assertBoardNodes, assertGenerationRequestAllowedByPolicy, buildSpaceInvitePath, buildSpacePath, buildWorkSurfaceRequest, clearGrantedWorkScopes, clip, compileSequence, createBoardExtensionRegistry, createBoardNode, createCohubClient, createHttpClient, createSessionGenerationStreamClient, createSessionPatchReducer, createSlugWorkIdResolver, createVoiceInputClient, createWebsocketClient, createWorkBridgeCore, createWorkRuntime, decodeGenerationPolicy, encodeGenerationPolicy, extractBillingPayload, filterDiscoverableGenerationModels, filterGenerationDeclarationsByPolicy, findGenerationModelPolicy, formatWorkRef, getAllowedGenerationModelIds, hasGrantedWorkScopes, hasRequestSourceIdentity, isBillingAccessBlockedCode, isBillingAccessBlockedError, isFeatureNotEntitledError, isGenerationModelHidden, isHttpErrorCode, isRequestSourceClientId, isRequestSourceEmpty, isRequestSourceUuid, isTerminalUiCommandStatus, isUiSurfaceMethod, isWorkId, joinApiUrl, matchesUnauthorizedErrorToken, mergeRequestSourceIntoMeta, normalizeBaseUrl, normalizeGenerationPolicy, normalizeRequestSource, normalizeVoiceInputWebsocketUrl, normalizeWebsocketUrl, parseAssistantMessageCommit, parseBoardPlaybackPolicy, parseGenerationPolicyFromEnv, parseRequestSourceFromHeaders, parseUiCommand, parseWorkRef, parseWorkSurfaceReady, parseWorkSurfaceResponse, readRequestSourceFromEnv, requestSourceToHeaders, resolveApiBaseUrl, resolveCohubEnvironment, resolveRequestSourceChannel, resolveVoiceInputWebsocketUrl, resolveWebsocketUrl, resolveWorkTransport, sanitizeAccessToken, setGrantedWorkScopes, timeline, validateBoardNodeInput, validateBoardNodes };
|
|
879
|
+
export { AcceptInvitationResponse, ApiError, type AssistantMessageCommit, BILLING_ACCESS_BLOCKED_ERROR_CODE, BOARD_COLOR_IDS, BOARD_GEO_KINDS, BOARD_NATIVE_NODE_TYPES, BOARD_NODE_CONTRACT, BatchUserProfilesResponse, BillingApi, BillingBalanceActivity, BillingBalanceActivityKind, BillingBalanceActivityList, BillingBalanceActivityStatus, BillingCatalog, BillingCatalogProduct, BillingCheckoutActionState, BillingCheckoutResult, BillingConversionIntent, BillingCreditExpiryGroup, BillingCreditGrantStatus, BillingCreditStatus, BillingCreditUnit, BillingDiscountOffer, BillingDiscountOfferRef, BillingDiscountPricing, BillingHistoryPagination, BillingPaymentStatus, BillingPluginStatus, BillingProductBillingInterval, BillingProductCreditBenefit, BillingProductDisplay, BillingProductKind, BillingProductPricing, BillingPromotionCodePreview, BillingRedemptionResult, BillingResponsePayload, BillingSubscriptionHistoryList, BillingSubscriptionHistoryStatus, BillingSubscriptionSummary, type BoardAssetRef, type BoardAwarenessGesture, type BoardAwarenessNodePreview, type BoardAwarenessStateUpdate, type BoardAwarenessUpdate, type BoardAwarenessUpdatedEvent, type BoardBootstrap, type BoardCapabilities, type BoardCapability, BoardClient, type BoardClip, type BoardColorId, type BoardCreateInput, type BoardDeleteReason, type BoardDiagnostic, type BoardEffect, type BoardEventName, BoardExtensionDefinition, BoardExtensionRegistry, type BoardGeoKind, BoardInputError, type BoardInspectInput, type BoardKeyframe, type BoardManifest, type BoardNativeNodeType, type BoardNodeContract, type BoardNodeFrameInput, type BoardNodeInput, type BoardNodeRecord, type BoardNodeSpec, type BoardNodeValidationDiagnostic, type BoardOperation, type BoardPlaybackChangedEvent, type BoardPlaybackCommand, type BoardPlaybackPolicy, BoardPlaybackPolicySchema, type BoardPlaybackSnapshot, BoardPresetDefinition, type BoardRecord, type BoardRenderCost, type BoardSequence, type BoardSubscriptionHandlers, type BoardTarget, type BoardTransaction, type BoardTransactionAppliedEvent, BoardTransactionError, type BoardTransactionInput, type BoardValidationResult, type BuildSpaceInvitePathInput, type BuildSpacePathInput, COHUB_ENVIRONMENTS, COHUB_SOURCE_HEADER, COHUB_SOURCE_HEADER_NAMES, Channel, type ChannelConfig, type ChannelEnvelope, type ChannelHealth, type ChannelHealthReasonCode, type ChannelRuntimeState, CheckpointDiffDelivery, CheckpointDiffFile, CheckpointDiffFileResponse, CheckpointDiffPatchKind, CheckpointDiffPatchLine, CheckpointDiffStats, CheckpointDiffStatus, CheckpointDiffSummary, CheckpointRecord, ClaimReferralResponse, CohubClient, type CohubClientOptions, type CohubEnvironment, CohubHttpClient, CompiledSequence, type CompletionAssistantMessage, type CompletionMessage, type CompletionMessageRole, type CompletionThinkingLevel, type CompletionUsage, type ContentBlock, type CreateGenerationTaskRequest, type CreateGenerationTaskResponse, CreateInvitationInput, CreateInvitationResponse, type CreatePublicAssetUploadInput, type CreatePublicAssetUploadResponse, type CreateSpaceCompletionInput, CreateSpaceInput, CreateSpaceModInput, CreateSpacePromptInput, CreateSpacePromptResponse, CreateSpaceSessionInput, type CreateUiCommandInput, CronJobPayload, CronJobRecord, CronJobUpdatePatch, CursorPageInfo, DEFAULT_BOARD_LIMITS, type DiscordChannelConfig, FEATURE_NOT_ENTITLED_ERROR_CODE, type FeishuChannelConfig, type Fetch, type GenerationContentBlock, type GenerationModelPolicy, type GenerationModelVisibility, type GenerationParameterConstraint, type GenerationPolicy, GenerationPolicyError, type GenerationResult, type GenerationStreamCommitEvent, type GenerationStreamErrorEvent, type GenerationStreamEvent, type GenerationStreamFinalizedEvent, type GenerationStreamIntermediateMessage, type GenerationStreamLifecycleEvent, type GenerationStreamOutOfSyncEvent, type GenerationStreamStateEvent, type GenerationStreamSubscribeOptions, type GenerationStreamSubscriptionHandlers, type GenerationStreamTurnUpdatedEvent, type GenerationTaskResult, type GenerationUsageBilling, GenerationUsageBlock, GenerationUsageHourlyStat, GenerationUsageSummary, GlobalSearchResponse, GlobalSearchResult, GlobalSearchType, HttpError, type HttpTraceContext, InvitationDetail, JsonObject, JsonPrimitive, JsonValue, LabelAssignmentListItem, LabelAssignmentPageInfo, LabelAssignmentRecord, type LabelAssignmentsUpdatedEvent, LabelItemsResponse, LabelItemsSessionFork, LabelListItem, LabelRecord, LabelResourceType, LabelScopeType, LabelSource, type ListGenerationModelsResponse, MeResponse, type MessageRecord, ModelCatalogEntry, type ModelStatusEntry, type ModelStatusResponse, type ModelThinkingLevel, ParentBridgeTransport, type ParsedWorkRef, PatchResourceLabelsInput, PatchResourceLabelsResponse, Permission, PopupBrokerTransport, PromptAccessMode, PromptTemplateCatalogEntry, PromptTemplateCatalogResponse, type PublicAssetMimeType, type PublicAssetPurpose, type PublicAssetUploadProgress, type PublicAssetUploadProtocol, type PublicFileCreateUploadInput, type PublicFileCreateUploadResponse, type PublicFileListEntry, type PublicFileListResponse, type PublicFileUploadEntryInput, type PublicFileUploadPlanEntry, type PublicFileUrlResponse, type PublicGenerationDeclaration, PublicReferral, PublicUserPageResponse, PublicUserProfile, PublicUserSpaceItem, PublicUserWorkItem, QualityProfile, REQUEST_SOURCE_VIA_MAX_LENGTH, type RawHttpResponse, type RealtimeRoomDescriptor, type RealtimeRoomEvent, type RealtimeRoomMember, type RealtimeServerEvent, type RealtimeWorkRecord, type RealtimeWorkVersionRecord, ReferenceAggregateGroup, ReferenceAggregateGroupBy, ReferenceAggregateResponse, ReferenceDirection, ReferenceKind, ReferenceQueryResponse, ReferenceQueryableType, ReferenceRecord, type ReferenceResourceSelector, ReferenceResourceType, ReferencesApi, ReferralDashboard, ReferralListItem, ReferralReward, ReferralStatus, ReferralsApi, RenderBounds, type RequestSource, type RequestSourceVia, ResourceLabelsResponse, SandboxSpecId, SendMessageCronJobPayload, SessionBindingRecord, type SessionEventName, type SessionForkRecord, SessionGenerationStreamClient, SessionMessageResponse, SessionMessagesPaginatedResponse, SessionMessagesResponse, type SessionPatchApplyInput, type SessionPatchApplyResult, SessionPatchReducer, type SessionPatchState, type SessionPatchStatus, SessionRecord, type SessionSubscriptionHandlers, type SessionTurnIndexItem, SessionTurnIndexResponse, type SessionTurnRecord, SessionTurnResponse, type SessionTurnSegmentRecord, SessionTurnSignedUrlsResponse, SessionTurnStreamSnapshotResponse, SessionTurnWindowResponse, SessionTurnsPaginatedResponse, SkillCatalogEntry, SkillCatalogResponse, SkillCatalogSource, SpaceAccess, SpaceAccessPolicy, SpaceBootstrapMeta, SpaceBootstrapSource, SpaceBootstrapStage, SpaceBootstrapStatus, SpaceChannelBindingInput, type SpaceChannelBindingRecord, SpaceCheckpointDetailResponse, SpaceCommerceBenefit, SpaceCommerceBuyerProfile, SpaceCommerceCreditsBenefit, SpaceCommerceFeatureBenefit, SpaceCommerceOrder, SpaceCommerceProduct, SpaceCommerceProductBenefitBinding, SpaceCommerceProductCreditBenefit, type SpaceCompletionResult, type SpaceCompletionStreamEvent, SpaceConfig, SpaceConfigInput, SpaceConfigResponse, SpaceConfigUpdateResponse, SpaceCreateResponse, SpaceDefaultResponse, SpaceEnvInput, type SpaceEventName, SpaceFsCompleteUploadInput, SpaceFsCompleteUploadResponse, SpaceFsCreateDirectoryInput, SpaceFsCreateUploadInput, SpaceFsCreateUploadResponse, SpaceFsDeleteNodeInput, SpaceFsEncoding, SpaceFsEntry, SpaceFsFileKind, SpaceFsFileResponse, SpaceFsMoveInput, SpaceFsPreparingFile, SpaceFsReadFilesError, SpaceFsReadFilesInput, SpaceFsReadFilesResponse, SpaceFsTreeResponse, SpaceFsUploadDestination, SpaceFsUploadEntry, SpaceFsUploadError, SpaceFsUploadPlanEntry, SpaceFsUploadPlanEntryInput, SpaceFsUploadProgress, SpaceFsUploadResponse, SpaceFsWriteFileInput, SpaceInvitation, SpaceInvitationListResponse, SpaceInvitationLocation, SpaceListItem, SpaceMember, SpaceMeta, SpaceModListItem, SpacePendingDiffFileResponse, SpacePendingDiffSummary, SpacePresenceSnapshot, SpacePresenceUser, SpacePublicFilesApi, SpacePublicProfile, SpaceRecord, SpaceRole, SpaceSandboxAutoDestroyPolicy, SpaceSandboxConfig, SpaceSandboxProvider, SpaceSessionsResponse, type SpaceStartupResponse, SpaceTurnAuthorFilter, SpaceTurnListItem, type SpaceTurnListOptions, SpaceTurnsResponse, SpaceUsageHourlyStat, SpaceUsageResponse, SpaceUsageSummary, TaskRunDetailResponse, TaskRunRecord, TimelineClipInput, TimelineInput, UI_COMMAND_DEFAULT_TIMEOUT_MS, UI_COMMAND_MAX_TIMEOUT_MS, UI_COMMAND_PAYLOAD_MAX_BYTES, UI_COMMAND_PENDING_TTL_SECONDS, UI_COMMAND_SETTLEMENT_GRACE_SECONDS, UI_COMMAND_TERMINAL_TTL_SECONDS, UI_COMMAND_VERSION, type UiCommand, type UiCommandDispatchedPayload, type UiCommandError, type UiCommandRecord, type UiCommandStatus, UiCommandsApi, type UiPreviewShowCommand, type UiPreviewTarget, type UiSurfaceRequest, type UiWorkPreviewTarget, type UnauthorizedContext, type UploadChatAttachmentInput, type UploadChatImageAttachmentInput, type UploadPublicAssetInput, UserActivityQuery, UserActivityRange, UserActivityRankings, UserActivityResponse, UserProfile, UserRulesResponse, UserSessionListItem, UserSessionSpaceSummary, UserSessionsResponse, UsersApi, VoiceApi, type VoiceInputCallbacks, VoiceInputClient, type VoiceInputClientOptions, type VoiceInputCreateOptions, type VoiceInputEvent, WORK_COMPOSER_CHIP_CONTENT_MAX_BYTES, WORK_COMPOSER_CHIP_KEY_MAX_LENGTH, WORK_COMPOSER_CHIP_LABEL_MAX_LENGTH, WORK_SURFACE_READY_TIMEOUT_MS, WORK_SURFACE_REQUEST_TIMEOUT_MS, type WaitForUiCommandOptions, type WebSocketConnectionState, WebsocketClient, type WorkArtifactDescriptor, type WorkArtifactDownloadDescriptor, type WorkArtifactManifest, type WorkArtifactManifestFile, type WorkAuthorizeRequest, type WorkAuthorizeResponse, type WorkBoardArtifactManifest, type WorkBoardAsset, type WorkBridgeAuthorizationContext, type WorkBridgeCore, type WorkBridgeCoreConfig, type WorkBridgeCoreWork, type WorkBridgeDialogState, type WorkBridgeGetAccessToken, type WorkBridgeGetViewerUuid, type WorkBridgeRequestSignIn, type WorkCheckoutStarted, WorkCommerceApi, type WorkCommerceCheckoutStatus, type WorkCommerceCreditConsumeResponse, type WorkCommerceCreditConsumeStatus, type WorkCommerceEntitlement, type WorkCommerceEntitlementsResponse, type WorkCommerceOrder, type WorkCommerceProductResolveResponse, type WorkCommercePurchaseResponse, type WorkComposerChip, type WorkContent, type WorkContentDownload, type WorkContentKind, type WorkCreateInput, type WorkDetailResponse, type WorkExtractedPageMeta, type WorkGetResponse, type WorkIdResolver, type WorkMeta, type WorkPresentationMeta, type WorkPromotionAttributionContext, type WorkPromotionCreateInput, type WorkPromotionEventResponse, type WorkPromotionProvider, type WorkPromotionProviderStatus, type WorkPromotionRecord, type WorkPromotionStatsResponse, type WorkPublicOwnerRecord, type WorkPublicRef, type WorkPublicSpaceRecord, type WorkPurchaseRequest, WorkRealtimeApi, type WorkRecord, WorkRefParseError, type WorkResolveResponse, WorkRoom, type WorkRoomAdmissionResponse, type WorkRoomCreateInput, type WorkRoomEvent, type WorkRoomEventMap, type WorkRoomPublishResult, type WorkRoomState, WorkRuntimeApi, type WorkRuntimeCheckoutState, type WorkRuntimeCheckoutStatus, type WorkRuntimeContext, type WorkRuntimeModeConfig, type WorkRuntimeRequestOptions, type WorkRuntimeTransport, type WorkSessionResponse, type WorkStatus, WorkSurfaceApi, type WorkSurfaceHandler, type WorkSurfaceHandlerContext, type WorkSurfaceReadyMessage, type WorkSurfaceResponseMessage, type WorkTargetType, type WorkUpdateInput, type WorkVersionPublishedEvent, type WorkVersionRecord, type WorkViewSource, type WorkViewStatsResponse, type WorkVisibility, WorksApi, assertBoardNodes, assertGenerationRequestAllowedByPolicy, buildSpaceInvitePath, buildSpacePath, buildWorkSurfaceRequest, clearGrantedWorkScopes, clip, compileSequence, createBoardExtensionRegistry, createBoardNode, createCohubClient, createHttpClient, createSessionGenerationStreamClient, createSessionPatchReducer, createSlugWorkIdResolver, createVoiceInputClient, createWebsocketClient, createWorkBridgeCore, createWorkRuntime, decodeGenerationPolicy, encodeGenerationPolicy, extractBillingPayload, filterDiscoverableGenerationModels, filterGenerationDeclarationsByPolicy, findGenerationModelPolicy, formatWorkRef, getAllowedGenerationModelIds, hasGrantedWorkScopes, hasRequestSourceIdentity, isBillingAccessBlockedCode, isBillingAccessBlockedError, isFeatureNotEntitledError, isGenerationModelHidden, isHttpErrorCode, isRequestSourceClientId, isRequestSourceEmpty, isRequestSourceUuid, isTerminalUiCommandStatus, isUiSurfaceMethod, isUuid, isWorkId, joinApiUrl, matchesUnauthorizedErrorToken, mergeRequestSourceIntoMeta, normalizeBaseUrl, normalizeGenerationPolicy, normalizeRequestSource, normalizeVoiceInputWebsocketUrl, normalizeWebsocketUrl, parseAssistantMessageCommit, parseBoardPlaybackPolicy, parseGenerationPolicyFromEnv, parseRequestSourceFromHeaders, parseUiCommand, parseWorkRef, parseWorkSurfaceReady, parseWorkSurfaceResponse, readRequestSourceFromEnv, requestSourceToHeaders, resolveApiBaseUrl, resolveCohubEnvironment, resolveRequestSourceChannel, resolveVoiceInputWebsocketUrl, resolveWebsocketUrl, resolveWorkTransport, sanitizeAccessToken, setGrantedWorkScopes, timeline, validateBoardNodeInput, validateBoardNodes };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { _ as requestSourceToHeaders, a as sanitizeAccessToken, b as
|
|
1
|
+
import { $ as parseUsername, A as WORK_SURFACE_READY_TIMEOUT_MS, B as parseWorkSurfaceRequest, C as BoardInputError, D as WORK_COMPOSER_CHIP_CONTENT_MAX_BYTES, E as validateBoardNodes, F as buildWorkSurfaceRequest, G as UI_COMMAND_PENDING_TTL_SECONDS, H as UI_COMMAND_DEFAULT_TIMEOUT_MS, I as buildWorkSurfaceResponse, J as UI_COMMAND_VERSION, K as UI_COMMAND_SETTLEMENT_GRACE_SECONDS, L as parseWorkComposerChipClear, M as buildWorkComposerChipClear, N as buildWorkComposerChipSet, O as WORK_COMPOSER_CHIP_KEY_MAX_LENGTH, P as buildWorkSurfaceReady, Q as parseSpaceSlug, R as parseWorkComposerChipSet, S as createSessionPatchReducer, T as createBoardNode, U as UI_COMMAND_MAX_TIMEOUT_MS, V as parseWorkSurfaceResponse, W as UI_COMMAND_PAYLOAD_MAX_BYTES, X as isUiSurfaceMethod, Y as isTerminalUiCommandStatus, Z as parseUiCommand, _ as buildSpacePath, _t as ModelsApi, a as ReferralsApi, at as validateBoardNodeInput, b as parseAssistantMessageCommit, bt as ChannelsApi, c as UiCommandsApi, ct as ensureRealtimeConnected, d as BoardTransactionError, dt as SessionAccessApi, et as BoardAwarenessClientPayloadSchema, f as SpaceClient, ft as ReferencesApi, g as buildSpaceInvitePath, gt as PromptsApi, h as PublicInviteApi, ht as SkillsApi, i as WorksApi, it as BOARD_NODE_CONTRACT, j as WORK_SURFACE_REQUEST_TIMEOUT_MS, k as WORK_COMPOSER_CHIP_LABEL_MAX_LENGTH, l as TasksApi, lt as BOARD_BUILTIN_CAPABILITIES, m as SpacesApi, mt as PublicAssetsApi, n as createHttpClient, nt as BOARD_GEO_KINDS, o as UsersApi, ot as BoardPlaybackPolicySchema, p as SpacePublicFilesApi, pt as SearchApi, q as UI_COMMAND_TERMINAL_TTL_SECONDS, r as WorkCommerceApi, rt as BOARD_NATIVE_NODE_TYPES, s as UserApi, st as parseBoardPlaybackPolicy, t as CohubHttpClient, tt as BOARD_COLOR_IDS, u as BoardClient, ut as DEFAULT_BOARD_RENDER_LIMITS, v as SessionGenerationStreamClient, vt as GenerationsApi, w as assertBoardNodes, x as SessionPatchReducer, y as createSessionGenerationStreamClient, yt as CronJobsApi, z as parseWorkSurfaceReady } from "./chunks/http.js";
|
|
2
|
+
import { _ as requestSourceToHeaders, a as sanitizeAccessToken, b as REALTIME_DOMAINS, c as REQUEST_SOURCE_VIA_MAX_LENGTH, d as isRequestSourceEmpty, f as isRequestSourceUuid, g as readRequestSourceFromEnv, h as parseRequestSourceFromHeaders, i as matchesUnauthorizedErrorToken, l as hasRequestSourceIdentity, m as normalizeRequestSource, n as HttpTransport, o as COHUB_SOURCE_HEADER, p as mergeRequestSourceIntoMeta, r as joinApiUrl, s as COHUB_SOURCE_HEADER_NAMES, t as HttpError, u as isRequestSourceClientId, v as resolveRequestSourceChannel, x as REALTIME_ROOM_EVENT_NAME_PATTERN, y as isUuid } from "./chunks/transport.js";
|
|
3
3
|
import { a as resolveApiBaseUrl, c as resolveWebsocketUrl, i as normalizeWebsocketUrl, n as normalizeBaseUrl, o as resolveCohubEnvironment, r as normalizeVoiceInputWebsocketUrl, s as resolveVoiceInputWebsocketUrl, t as COHUB_ENVIRONMENTS } from "./chunks/environment.js";
|
|
4
4
|
import { a as extractBillingPayload, c as isFeatureNotEntitledError, i as FEATURE_NOT_ENTITLED_ERROR_CODE, l as isHttpErrorCode, n as createWebsocketClient, o as isBillingAccessBlockedCode, r as BILLING_ACCESS_BLOCKED_ERROR_CODE, s as isBillingAccessBlockedError, t as WebsocketClient } from "./chunks/websocket.js";
|
|
5
5
|
import { VoiceApi, VoiceInputClient, createVoiceInputClient } from "./voice-input.js";
|
|
@@ -21,14 +21,14 @@ var GenerationPolicyError = class extends Error {
|
|
|
21
21
|
this.name = "GenerationPolicyError";
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
|
-
function isRecord
|
|
24
|
+
function isRecord(value) {
|
|
25
25
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
26
26
|
}
|
|
27
27
|
function isPrimitiveEnumValue(value) {
|
|
28
28
|
return typeof value === "string" || typeof value === "number" || typeof value === "boolean";
|
|
29
29
|
}
|
|
30
30
|
function normalizeConstraint(value) {
|
|
31
|
-
if (!isRecord
|
|
31
|
+
if (!isRecord(value) || typeof value.kind !== "string") return null;
|
|
32
32
|
if (value.kind === "enum") {
|
|
33
33
|
if (!Array.isArray(value.values) || value.values.length === 0 || !value.values.every(isPrimitiveEnumValue)) return null;
|
|
34
34
|
return {
|
|
@@ -58,7 +58,7 @@ function normalizeConstraint(value) {
|
|
|
58
58
|
return null;
|
|
59
59
|
}
|
|
60
60
|
function normalizeGenerationPolicy(value) {
|
|
61
|
-
if (!isRecord
|
|
61
|
+
if (!isRecord(value) || value.version !== 1) return null;
|
|
62
62
|
if (value.mode === "auto") return {
|
|
63
63
|
version: 1,
|
|
64
64
|
mode: "auto"
|
|
@@ -66,10 +66,10 @@ function normalizeGenerationPolicy(value) {
|
|
|
66
66
|
if (value.mode !== "limited" || !Array.isArray(value.models) || value.models.length === 0) return null;
|
|
67
67
|
const models = [];
|
|
68
68
|
for (const item of value.models) {
|
|
69
|
-
if (!isRecord
|
|
69
|
+
if (!isRecord(item) || typeof item.model !== "string" || !item.model.trim()) return null;
|
|
70
70
|
const modelPolicy = { model: item.model.trim() };
|
|
71
71
|
if (item.parameters !== void 0) {
|
|
72
|
-
if (!isRecord
|
|
72
|
+
if (!isRecord(item.parameters)) return null;
|
|
73
73
|
const parameters = {};
|
|
74
74
|
for (const [key, rawConstraint] of Object.entries(item.parameters)) {
|
|
75
75
|
if (!key.trim()) return null;
|
|
@@ -244,123 +244,6 @@ function filterGenerationDeclarationsByPolicy(declarations, policy) {
|
|
|
244
244
|
});
|
|
245
245
|
}
|
|
246
246
|
//#endregion
|
|
247
|
-
//#region ../protocol/dist/work-surface.js
|
|
248
|
-
const WORK_SURFACE_PROTOCOL = "cohub.surface";
|
|
249
|
-
const WORK_SURFACE_READY_TIMEOUT_MS = 1e4;
|
|
250
|
-
const WORK_SURFACE_REQUEST_TIMEOUT_MS = 15e3;
|
|
251
|
-
const WORK_COMPOSER_CHIP_KEY_MAX_LENGTH = 80;
|
|
252
|
-
const WORK_COMPOSER_CHIP_LABEL_MAX_LENGTH = 120;
|
|
253
|
-
const WORK_COMPOSER_CHIP_CONTENT_MAX_BYTES = 32 * 1024;
|
|
254
|
-
const isRecord = (value) => Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
255
|
-
const isSurfaceEnvelope = (value) => isRecord(value) && value.protocol === "cohub.surface" && value.version === 1;
|
|
256
|
-
const parseWorkSurfaceReady = (value) => {
|
|
257
|
-
if (!isSurfaceEnvelope(value) || value.type !== "ready") return null;
|
|
258
|
-
const methods = Array.isArray(value.methods) ? value.methods.filter((method) => typeof method === "string" && Boolean(method)) : [];
|
|
259
|
-
return {
|
|
260
|
-
protocol: WORK_SURFACE_PROTOCOL,
|
|
261
|
-
version: 1,
|
|
262
|
-
type: "ready",
|
|
263
|
-
methods
|
|
264
|
-
};
|
|
265
|
-
};
|
|
266
|
-
const parseWorkSurfaceResponse = (value) => {
|
|
267
|
-
if (!isSurfaceEnvelope(value) || value.type !== "response") return null;
|
|
268
|
-
if (typeof value.requestId !== "string" || !value.requestId) return null;
|
|
269
|
-
const error = isRecord(value.error) ? {
|
|
270
|
-
code: typeof value.error.code === "string" && value.error.code ? value.error.code : "surface_error",
|
|
271
|
-
message: typeof value.error.message === "string" ? value.error.message : "Work surface call failed"
|
|
272
|
-
} : void 0;
|
|
273
|
-
return {
|
|
274
|
-
protocol: WORK_SURFACE_PROTOCOL,
|
|
275
|
-
version: 1,
|
|
276
|
-
type: "response",
|
|
277
|
-
requestId: value.requestId,
|
|
278
|
-
ok: value.ok === true,
|
|
279
|
-
...error ? { error } : {}
|
|
280
|
-
};
|
|
281
|
-
};
|
|
282
|
-
const parseComposerChipKey = (value) => {
|
|
283
|
-
if (typeof value !== "string") return null;
|
|
284
|
-
const key = value.trim();
|
|
285
|
-
if (!key || key.length > 80) return null;
|
|
286
|
-
return key;
|
|
287
|
-
};
|
|
288
|
-
const parseWorkComposerChipSet = (value) => {
|
|
289
|
-
if (!isSurfaceEnvelope(value) || value.type !== "composer.chip.set" || !isRecord(value.chip)) return null;
|
|
290
|
-
const key = parseComposerChipKey(value.chip.key);
|
|
291
|
-
if (!key || typeof value.chip.label !== "string" || typeof value.chip.content !== "string") return null;
|
|
292
|
-
const label = value.chip.label.trim();
|
|
293
|
-
if (!label || label.length > 120) return null;
|
|
294
|
-
if (!value.chip.content.trim()) return null;
|
|
295
|
-
if (new TextEncoder().encode(value.chip.content).length > 32768) return null;
|
|
296
|
-
return {
|
|
297
|
-
protocol: WORK_SURFACE_PROTOCOL,
|
|
298
|
-
version: 1,
|
|
299
|
-
type: "composer.chip.set",
|
|
300
|
-
chip: {
|
|
301
|
-
key,
|
|
302
|
-
label,
|
|
303
|
-
content: value.chip.content
|
|
304
|
-
}
|
|
305
|
-
};
|
|
306
|
-
};
|
|
307
|
-
const parseWorkComposerChipClear = (value) => {
|
|
308
|
-
if (!isSurfaceEnvelope(value) || value.type !== "composer.chip.clear") return null;
|
|
309
|
-
const key = parseComposerChipKey(value.key);
|
|
310
|
-
return key ? {
|
|
311
|
-
protocol: WORK_SURFACE_PROTOCOL,
|
|
312
|
-
version: 1,
|
|
313
|
-
type: "composer.chip.clear",
|
|
314
|
-
key
|
|
315
|
-
} : null;
|
|
316
|
-
};
|
|
317
|
-
const parseWorkSurfaceRequest = (value) => {
|
|
318
|
-
if (!isSurfaceEnvelope(value) || value.type !== "request") return null;
|
|
319
|
-
if (typeof value.requestId !== "string" || !value.requestId) return null;
|
|
320
|
-
if (typeof value.method !== "string" || !value.method) return null;
|
|
321
|
-
const commandId = parseUiCommandId(value.commandId);
|
|
322
|
-
if (!commandId) return null;
|
|
323
|
-
return {
|
|
324
|
-
protocol: WORK_SURFACE_PROTOCOL,
|
|
325
|
-
version: 1,
|
|
326
|
-
type: "request",
|
|
327
|
-
requestId: value.requestId,
|
|
328
|
-
method: value.method,
|
|
329
|
-
...value.input === void 0 ? {} : { input: value.input },
|
|
330
|
-
commandId
|
|
331
|
-
};
|
|
332
|
-
};
|
|
333
|
-
const buildWorkSurfaceReady = (methods) => ({
|
|
334
|
-
protocol: WORK_SURFACE_PROTOCOL,
|
|
335
|
-
version: 1,
|
|
336
|
-
type: "ready",
|
|
337
|
-
methods: [...methods]
|
|
338
|
-
});
|
|
339
|
-
const buildWorkSurfaceRequest = (input) => ({
|
|
340
|
-
protocol: WORK_SURFACE_PROTOCOL,
|
|
341
|
-
version: 1,
|
|
342
|
-
type: "request",
|
|
343
|
-
...input
|
|
344
|
-
});
|
|
345
|
-
const buildWorkSurfaceResponse = (input) => ({
|
|
346
|
-
protocol: WORK_SURFACE_PROTOCOL,
|
|
347
|
-
version: 1,
|
|
348
|
-
type: "response",
|
|
349
|
-
...input
|
|
350
|
-
});
|
|
351
|
-
const buildWorkComposerChipSet = (chip) => ({
|
|
352
|
-
protocol: WORK_SURFACE_PROTOCOL,
|
|
353
|
-
version: 1,
|
|
354
|
-
type: "composer.chip.set",
|
|
355
|
-
chip
|
|
356
|
-
});
|
|
357
|
-
const buildWorkComposerChipClear = (key) => ({
|
|
358
|
-
protocol: WORK_SURFACE_PROTOCOL,
|
|
359
|
-
version: 1,
|
|
360
|
-
type: "composer.chip.clear",
|
|
361
|
-
key
|
|
362
|
-
});
|
|
363
|
-
//#endregion
|
|
364
247
|
//#region src/apis/billing.ts
|
|
365
248
|
var BillingApi = class {
|
|
366
249
|
transport;
|
|
@@ -1741,16 +1624,7 @@ var CohubClient = class {
|
|
|
1741
1624
|
const createCohubClient = (options) => new CohubClient(options);
|
|
1742
1625
|
//#endregion
|
|
1743
1626
|
//#region src/work-ref.ts
|
|
1744
|
-
|
|
1745
|
-
* Accepts every way a Work is named across Cohub — id, management URL, public
|
|
1746
|
-
* URL, `cohub://works` URI, or `username/space/work` — and normalizes it.
|
|
1747
|
-
*
|
|
1748
|
-
* Public and mention forms may carry launch state (`?query#hash`); it is kept
|
|
1749
|
-
* separately so it can be forwarded to the Work while the stable identity stays
|
|
1750
|
-
* clean.
|
|
1751
|
-
*/
|
|
1752
|
-
const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
1753
|
-
const isWorkId = (value) => UUID_PATTERN.test(value.trim());
|
|
1627
|
+
const isWorkId = (value) => isUuid(value.trim());
|
|
1754
1628
|
function decodePart(value) {
|
|
1755
1629
|
try {
|
|
1756
1630
|
return decodeURIComponent(value).trim();
|
|
@@ -1792,7 +1666,7 @@ function parseUrlRef(value) {
|
|
|
1792
1666
|
} : null;
|
|
1793
1667
|
}
|
|
1794
1668
|
if (url.protocol !== "http:" && url.protocol !== "https:") return null;
|
|
1795
|
-
if (parts.length === 4 && parts[0] === "spaces" &&
|
|
1669
|
+
if (parts.length === 4 && parts[0] === "spaces" && isUuid(parts[1] ?? "") && parts[2] === "works" && isUuid(parts[3] ?? "")) return { id: parts[3] };
|
|
1796
1670
|
if (parts.length === 4 && parts[2] === "w") {
|
|
1797
1671
|
const ref = publicRef([
|
|
1798
1672
|
parts[0],
|
|
@@ -1814,7 +1688,7 @@ var WorkRefParseError = class extends Error {
|
|
|
1814
1688
|
};
|
|
1815
1689
|
function parseWorkRef(input) {
|
|
1816
1690
|
const value = input.trim();
|
|
1817
|
-
if (
|
|
1691
|
+
if (isUuid(value)) return { id: value };
|
|
1818
1692
|
const parsedUrl = parseUrlRef(value.includes("://") ? value : value.startsWith("/") ? `https://cohub.invalid${value}` : value);
|
|
1819
1693
|
if (parsedUrl) return parsedUrl;
|
|
1820
1694
|
const parts = value.split("/").filter(Boolean);
|
|
@@ -2038,6 +1912,7 @@ function createWorkBridgeCore(config) {
|
|
|
2038
1912
|
await config.requestSignIn(typeof location !== "undefined" ? location.pathname + location.search + location.hash : "/");
|
|
2039
1913
|
return null;
|
|
2040
1914
|
}
|
|
1915
|
+
const promotionAttribution = config.getPromotionAttribution?.() ?? null;
|
|
2041
1916
|
const response = await fetch(`${apiOrigin}/api/works/${work.id}/commerce/purchase`, {
|
|
2042
1917
|
method: "POST",
|
|
2043
1918
|
headers: {
|
|
@@ -2046,7 +1921,8 @@ function createWorkBridgeCore(config) {
|
|
|
2046
1921
|
},
|
|
2047
1922
|
body: JSON.stringify({
|
|
2048
1923
|
productKey,
|
|
2049
|
-
purchaseAttemptId
|
|
1924
|
+
purchaseAttemptId,
|
|
1925
|
+
...promotionAttribution ? { promotionAttribution } : {}
|
|
2050
1926
|
})
|
|
2051
1927
|
});
|
|
2052
1928
|
if (!response.ok) throw new Error((await response.json().catch(() => null))?.message ?? "Purchase failed.");
|
|
@@ -2118,6 +1994,7 @@ function createWorkBridgeCore(config) {
|
|
|
2118
1994
|
state.purchaseError = null;
|
|
2119
1995
|
state.purchaseOpen = true;
|
|
2120
1996
|
notify();
|
|
1997
|
+
config.onPurchaseRequested?.({ ...state.pendingPurchase });
|
|
2121
1998
|
}
|
|
2122
1999
|
if (data.type === "cohub.work.authorize") {
|
|
2123
2000
|
const allowedViewerScopes = clonePermissionScopes(work.allowedViewerScopes);
|
|
@@ -2208,7 +2085,14 @@ function createWorkBridgeCore(config) {
|
|
|
2208
2085
|
productKey: next.productKey
|
|
2209
2086
|
});
|
|
2210
2087
|
const url = next.checkoutUrl;
|
|
2211
|
-
if (next.checkoutUsable === true && typeof url === "string" && url)
|
|
2088
|
+
if (next.checkoutUsable === true && typeof url === "string" && url) {
|
|
2089
|
+
config.onCheckoutStarted?.({
|
|
2090
|
+
...state.pendingPurchase,
|
|
2091
|
+
...typeof next.value === "number" ? { value: next.value } : {},
|
|
2092
|
+
...typeof next.currency === "string" ? { currency: next.currency } : {}
|
|
2093
|
+
});
|
|
2094
|
+
window.location.href = url;
|
|
2095
|
+
}
|
|
2212
2096
|
}
|
|
2213
2097
|
state.purchaseOpen = false;
|
|
2214
2098
|
state.pendingPurchase = null;
|
|
@@ -2601,4 +2485,4 @@ function createBoardExtensionRegistry(input = {}) {
|
|
|
2601
2485
|
return registry;
|
|
2602
2486
|
}
|
|
2603
2487
|
//#endregion
|
|
2604
|
-
export { BILLING_ACCESS_BLOCKED_ERROR_CODE, BOARD_COLOR_IDS, BOARD_GEO_KINDS, BOARD_NATIVE_NODE_TYPES, BOARD_NODE_CONTRACT, BillingApi, BoardClient, BoardExtensionRegistry, BoardInputError, BoardPlaybackPolicySchema, BoardTransactionError, COHUB_ENVIRONMENTS, COHUB_SOURCE_HEADER, COHUB_SOURCE_HEADER_NAMES, CohubClient, CohubHttpClient, DEFAULT_BOARD_LIMITS, FEATURE_NOT_ENTITLED_ERROR_CODE, GenerationPolicyError, HttpError, ParentBridgeTransport, PopupBrokerTransport, REQUEST_SOURCE_VIA_MAX_LENGTH, ReferencesApi, ReferralsApi, SessionGenerationStreamClient, SessionPatchReducer, SpacePublicFilesApi, UI_COMMAND_DEFAULT_TIMEOUT_MS, UI_COMMAND_MAX_TIMEOUT_MS, UI_COMMAND_PAYLOAD_MAX_BYTES, UI_COMMAND_PENDING_TTL_SECONDS, UI_COMMAND_SETTLEMENT_GRACE_SECONDS, UI_COMMAND_TERMINAL_TTL_SECONDS, UI_COMMAND_VERSION, UiCommandsApi, UsersApi, VoiceApi, VoiceInputClient, WORK_COMPOSER_CHIP_CONTENT_MAX_BYTES, WORK_COMPOSER_CHIP_KEY_MAX_LENGTH, WORK_COMPOSER_CHIP_LABEL_MAX_LENGTH, WORK_SURFACE_READY_TIMEOUT_MS, WORK_SURFACE_REQUEST_TIMEOUT_MS, WebsocketClient, WorkCommerceApi, WorkRealtimeApi, WorkRefParseError, WorkRoom, WorkRuntimeApi, WorkSurfaceApi, WorksApi, assertBoardNodes, assertGenerationRequestAllowedByPolicy, buildSpaceInvitePath, buildSpacePath, buildWorkSurfaceRequest, clearGrantedWorkScopes, clip, compileSequence, createBoardExtensionRegistry, createBoardNode, createCohubClient, createHttpClient, createSessionGenerationStreamClient, createSessionPatchReducer, createSlugWorkIdResolver, createVoiceInputClient, createWebsocketClient, createWorkBridgeCore, createWorkRuntime, decodeGenerationPolicy, encodeGenerationPolicy, extractBillingPayload, filterDiscoverableGenerationModels, filterGenerationDeclarationsByPolicy, findGenerationModelPolicy, formatWorkRef, getAllowedGenerationModelIds, hasGrantedWorkScopes, hasRequestSourceIdentity, isBillingAccessBlockedCode, isBillingAccessBlockedError, isFeatureNotEntitledError, isGenerationModelHidden, isHttpErrorCode, isRequestSourceClientId, isRequestSourceEmpty, isRequestSourceUuid, isTerminalUiCommandStatus, isUiSurfaceMethod, isWorkId, joinApiUrl, matchesUnauthorizedErrorToken, mergeRequestSourceIntoMeta, normalizeBaseUrl, normalizeGenerationPolicy, normalizeRequestSource, normalizeVoiceInputWebsocketUrl, normalizeWebsocketUrl, parseAssistantMessageCommit, parseBoardPlaybackPolicy, parseGenerationPolicyFromEnv, parseRequestSourceFromHeaders, parseUiCommand, parseWorkRef, parseWorkSurfaceReady, parseWorkSurfaceResponse, readRequestSourceFromEnv, requestSourceToHeaders, resolveApiBaseUrl, resolveCohubEnvironment, resolveRequestSourceChannel, resolveVoiceInputWebsocketUrl, resolveWebsocketUrl, resolveWorkTransport, sanitizeAccessToken, setGrantedWorkScopes, timeline, validateBoardNodeInput, validateBoardNodes };
|
|
2488
|
+
export { BILLING_ACCESS_BLOCKED_ERROR_CODE, BOARD_COLOR_IDS, BOARD_GEO_KINDS, BOARD_NATIVE_NODE_TYPES, BOARD_NODE_CONTRACT, BillingApi, BoardClient, BoardExtensionRegistry, BoardInputError, BoardPlaybackPolicySchema, BoardTransactionError, COHUB_ENVIRONMENTS, COHUB_SOURCE_HEADER, COHUB_SOURCE_HEADER_NAMES, CohubClient, CohubHttpClient, DEFAULT_BOARD_LIMITS, FEATURE_NOT_ENTITLED_ERROR_CODE, GenerationPolicyError, HttpError, ParentBridgeTransport, PopupBrokerTransport, REQUEST_SOURCE_VIA_MAX_LENGTH, ReferencesApi, ReferralsApi, SessionGenerationStreamClient, SessionPatchReducer, SpacePublicFilesApi, UI_COMMAND_DEFAULT_TIMEOUT_MS, UI_COMMAND_MAX_TIMEOUT_MS, UI_COMMAND_PAYLOAD_MAX_BYTES, UI_COMMAND_PENDING_TTL_SECONDS, UI_COMMAND_SETTLEMENT_GRACE_SECONDS, UI_COMMAND_TERMINAL_TTL_SECONDS, UI_COMMAND_VERSION, UiCommandsApi, UsersApi, VoiceApi, VoiceInputClient, WORK_COMPOSER_CHIP_CONTENT_MAX_BYTES, WORK_COMPOSER_CHIP_KEY_MAX_LENGTH, WORK_COMPOSER_CHIP_LABEL_MAX_LENGTH, WORK_SURFACE_READY_TIMEOUT_MS, WORK_SURFACE_REQUEST_TIMEOUT_MS, WebsocketClient, WorkCommerceApi, WorkRealtimeApi, WorkRefParseError, WorkRoom, WorkRuntimeApi, WorkSurfaceApi, WorksApi, assertBoardNodes, assertGenerationRequestAllowedByPolicy, buildSpaceInvitePath, buildSpacePath, buildWorkSurfaceRequest, clearGrantedWorkScopes, clip, compileSequence, createBoardExtensionRegistry, createBoardNode, createCohubClient, createHttpClient, createSessionGenerationStreamClient, createSessionPatchReducer, createSlugWorkIdResolver, createVoiceInputClient, createWebsocketClient, createWorkBridgeCore, createWorkRuntime, decodeGenerationPolicy, encodeGenerationPolicy, extractBillingPayload, filterDiscoverableGenerationModels, filterGenerationDeclarationsByPolicy, findGenerationModelPolicy, formatWorkRef, getAllowedGenerationModelIds, hasGrantedWorkScopes, hasRequestSourceIdentity, isBillingAccessBlockedCode, isBillingAccessBlockedError, isFeatureNotEntitledError, isGenerationModelHidden, isHttpErrorCode, isRequestSourceClientId, isRequestSourceEmpty, isRequestSourceUuid, isTerminalUiCommandStatus, isUiSurfaceMethod, isUuid, isWorkId, joinApiUrl, matchesUnauthorizedErrorToken, mergeRequestSourceIntoMeta, normalizeBaseUrl, normalizeGenerationPolicy, normalizeRequestSource, normalizeVoiceInputWebsocketUrl, normalizeWebsocketUrl, parseAssistantMessageCommit, parseBoardPlaybackPolicy, parseGenerationPolicyFromEnv, parseRequestSourceFromHeaders, parseUiCommand, parseWorkRef, parseWorkSurfaceReady, parseWorkSurfaceResponse, readRequestSourceFromEnv, requestSourceToHeaders, resolveApiBaseUrl, resolveCohubEnvironment, resolveRequestSourceChannel, resolveVoiceInputWebsocketUrl, resolveWebsocketUrl, resolveWorkTransport, sanitizeAccessToken, setGrantedWorkScopes, timeline, validateBoardNodeInput, validateBoardNodes };
|
|
@@ -36,6 +36,7 @@ type BoardConnectionAnchor = z.infer<typeof BoardConnectionAnchorSchema>;
|
|
|
36
36
|
declare const AUTO_BOARD_CONNECTION_ANCHOR: BoardConnectionAnchor;
|
|
37
37
|
declare const BoardConnectionEndpointSchema: z.ZodObject<{
|
|
38
38
|
nodeId: z.ZodString;
|
|
39
|
+
portId: z.ZodOptional<z.ZodString>;
|
|
39
40
|
anchor: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
40
41
|
kind: z.ZodLiteral<"auto">;
|
|
41
42
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -125,6 +126,7 @@ declare const BoardConnectionSchema: z.ZodObject<{
|
|
|
125
126
|
id: z.ZodString;
|
|
126
127
|
source: z.ZodObject<{
|
|
127
128
|
nodeId: z.ZodString;
|
|
129
|
+
portId: z.ZodOptional<z.ZodString>;
|
|
128
130
|
anchor: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
129
131
|
kind: z.ZodLiteral<"auto">;
|
|
130
132
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -144,6 +146,7 @@ declare const BoardConnectionSchema: z.ZodObject<{
|
|
|
144
146
|
}, z.core.$strip>;
|
|
145
147
|
target: z.ZodObject<{
|
|
146
148
|
nodeId: z.ZodString;
|
|
149
|
+
portId: z.ZodOptional<z.ZodString>;
|
|
147
150
|
anchor: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
148
151
|
kind: z.ZodLiteral<"auto">;
|
|
149
152
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -210,6 +213,7 @@ type BoardConnectionInput = BoardConnection;
|
|
|
210
213
|
declare const BoardConnectionPatchSchema: z.ZodObject<{
|
|
211
214
|
source: z.ZodOptional<z.ZodObject<{
|
|
212
215
|
nodeId: z.ZodString;
|
|
216
|
+
portId: z.ZodOptional<z.ZodString>;
|
|
213
217
|
anchor: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
214
218
|
kind: z.ZodLiteral<"auto">;
|
|
215
219
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -229,6 +233,7 @@ declare const BoardConnectionPatchSchema: z.ZodObject<{
|
|
|
229
233
|
}, z.core.$strip>>;
|
|
230
234
|
target: z.ZodOptional<z.ZodObject<{
|
|
231
235
|
nodeId: z.ZodString;
|
|
236
|
+
portId: z.ZodOptional<z.ZodString>;
|
|
232
237
|
anchor: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
233
238
|
kind: z.ZodLiteral<"auto">;
|
|
234
239
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -298,6 +303,8 @@ declare function createBoardConnection(input: {
|
|
|
298
303
|
relation?: string;
|
|
299
304
|
direction?: BoardConnectionDirection;
|
|
300
305
|
label?: string;
|
|
306
|
+
sourcePortId?: string;
|
|
307
|
+
targetPortId?: string;
|
|
301
308
|
sourceAnchor?: BoardConnectionAnchor;
|
|
302
309
|
targetAnchor?: BoardConnectionAnchor;
|
|
303
310
|
routing?: Partial<BoardConnectionRoutingConfig>;
|
|
@@ -55,6 +55,8 @@ const BoardConnectionAnchorSchema = z.union([
|
|
|
55
55
|
const AUTO_BOARD_CONNECTION_ANCHOR = { kind: "auto" };
|
|
56
56
|
const BoardConnectionEndpointSchema = z.object({
|
|
57
57
|
nodeId: z.string().min(1).max(160),
|
|
58
|
+
/** Optional semantic port. Older connections omit it and remain valid. */
|
|
59
|
+
portId: z.string().min(1).max(120).optional(),
|
|
58
60
|
anchor: BoardConnectionAnchorSchema.default(AUTO_BOARD_CONNECTION_ANCHOR)
|
|
59
61
|
});
|
|
60
62
|
/**
|
|
@@ -179,10 +181,12 @@ function createBoardConnection(input) {
|
|
|
179
181
|
id: input.id,
|
|
180
182
|
source: {
|
|
181
183
|
nodeId: input.sourceNodeId,
|
|
184
|
+
...input.sourcePortId ? { portId: input.sourcePortId } : {},
|
|
182
185
|
anchor: input.sourceAnchor ?? AUTO_BOARD_CONNECTION_ANCHOR
|
|
183
186
|
},
|
|
184
187
|
target: {
|
|
185
188
|
nodeId: input.targetNodeId,
|
|
189
|
+
...input.targetPortId ? { portId: input.targetPortId } : {},
|
|
186
190
|
anchor: input.targetAnchor ?? AUTO_BOARD_CONNECTION_ANCHOR
|
|
187
191
|
},
|
|
188
192
|
relation: input.relation ?? "related",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region ../protocol/dist/board-content.js
|
|
3
|
+
const BOARD_CONTENT_KINDS = [
|
|
4
|
+
"text",
|
|
5
|
+
"image",
|
|
6
|
+
"video",
|
|
7
|
+
"audio",
|
|
8
|
+
"file",
|
|
9
|
+
"json",
|
|
10
|
+
"collection"
|
|
11
|
+
];
|
|
12
|
+
const BoardContentKindSchema = z.enum(BOARD_CONTENT_KINDS);
|
|
13
|
+
const BoardPortSchema = z.object({
|
|
14
|
+
id: z.string().min(1).max(120),
|
|
15
|
+
kind: BoardContentKindSchema,
|
|
16
|
+
role: z.string().min(1).max(80).optional(),
|
|
17
|
+
required: z.boolean().optional(),
|
|
18
|
+
multiple: z.boolean().optional(),
|
|
19
|
+
maxItems: z.number().int().positive().optional()
|
|
20
|
+
}).strict();
|
|
21
|
+
z.object({
|
|
22
|
+
inputs: z.array(BoardPortSchema),
|
|
23
|
+
outputs: z.array(BoardPortSchema)
|
|
24
|
+
}).strict();
|
|
25
|
+
//#endregion
|
|
26
|
+
export { BOARD_CONTENT_KINDS, BoardContentKindSchema, BoardPortSchema };
|
|
@@ -1376,6 +1376,7 @@ declare const BoardDocumentSchema: z.ZodObject<{
|
|
|
1376
1376
|
id: z.ZodString;
|
|
1377
1377
|
source: z.ZodObject<{
|
|
1378
1378
|
nodeId: z.ZodString;
|
|
1379
|
+
portId: z.ZodOptional<z.ZodString>;
|
|
1379
1380
|
anchor: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
1380
1381
|
kind: z.ZodLiteral<"auto">;
|
|
1381
1382
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -1395,6 +1396,7 @@ declare const BoardDocumentSchema: z.ZodObject<{
|
|
|
1395
1396
|
}, z.core.$strip>;
|
|
1396
1397
|
target: z.ZodObject<{
|
|
1397
1398
|
nodeId: z.ZodString;
|
|
1399
|
+
portId: z.ZodOptional<z.ZodString>;
|
|
1398
1400
|
anchor: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
1399
1401
|
kind: z.ZodLiteral<"auto">;
|
|
1400
1402
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region ../protocol/dist/identifiers.js
|
|
2
|
+
const UUID_SHAPE_PATTERN = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}";
|
|
3
|
+
const UUID_PATTERN = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}";
|
|
4
|
+
const SHORT_UUID_PATTERN = "[0-9a-fA-F]{32}";
|
|
5
|
+
const UUID_OR_SHORT_UUID_PATTERN = `^(?:${UUID_PATTERN}|${SHORT_UUID_PATTERN})$`;
|
|
6
|
+
new RegExp(`^${UUID_SHAPE_PATTERN}$`);
|
|
7
|
+
new RegExp(`^${UUID_PATTERN}$`);
|
|
8
|
+
new RegExp(UUID_OR_SHORT_UUID_PATTERN);
|
|
9
|
+
//#endregion
|
|
10
|
+
export { SHORT_UUID_PATTERN, UUID_OR_SHORT_UUID_PATTERN, UUID_PATTERN, UUID_SHAPE_PATTERN };
|
|
@@ -2,6 +2,7 @@ import { BoardCapability, BoardRenderCost } from "./board-constants.js";
|
|
|
2
2
|
import { AUTO_BOARD_CONNECTION_ANCHOR, BOARD_CONNECTION_DIRECTIONS, BOARD_CONNECTION_LINES, BOARD_CONNECTION_ROUTINGS, BOARD_CONNECTION_SIDES, BoardConnection, BoardConnectionAnchor, BoardConnectionAnchorSchema, BoardConnectionDirection, BoardConnectionEndpoint, BoardConnectionEndpointSchema, BoardConnectionInput, BoardConnectionLine, BoardConnectionPatch, BoardConnectionPatchSchema, BoardConnectionRecord, BoardConnectionRouting, BoardConnectionRoutingConfig, BoardConnectionRoutingSchema, BoardConnectionSchema, BoardConnectionSide, BoardConnectionStyle, BoardConnectionStyleSchema, BoardConnectionWaypointSchema, BoardRelationSchema, DEFAULT_BOARD_CONNECTION_ROUTING, DEFAULT_BOARD_CONNECTION_STYLE, DEFAULT_BOARD_RELATION, connectionNodeIds, connectionOtherNodeId, connectionTouchesNode, createBoardConnection, flipBoardConnection, normalizeBoardConnectionStyle } from "./board-connection.js";
|
|
3
3
|
import { BOARD_COLOR_IDS, BOARD_GEO_KINDS, BoardColorId, BoardGeoKind, BoardNodeValidationDiagnostic } from "./board-node.js";
|
|
4
4
|
import { BOARD_DOCUMENT_KIND, BOARD_EXTENSION, BoardAssetRef, BoardAssetRefSchema, BoardClip, BoardClipSchema, BoardDiagnostic, BoardEffect, BoardEffectSchema, BoardManifest, BoardManifestSchema, BoardNodeInput, BoardNodeRecord, BoardRecord, BoardSequence, BoardSequenceSchema, BoardTarget, BoardTargetSchema, BoardValidationResult, InvalidBoardFileError, isBoardPath, parseBoardManifest, serializeBoardManifest } from "./board.js";
|
|
5
|
+
import "./board-content.js";
|
|
5
6
|
import "./realtime/board-awareness.js";
|
|
6
7
|
import "./work.js";
|
|
7
8
|
import "./realtime/types.js";
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import "./board-constants.js";
|
|
2
2
|
import { AUTO_BOARD_CONNECTION_ANCHOR, BOARD_CONNECTION_DIRECTIONS, BOARD_CONNECTION_LINES, BOARD_CONNECTION_ROUTINGS, BOARD_CONNECTION_SIDES, BoardConnectionAnchorSchema, BoardConnectionEndpointSchema, BoardConnectionPatchSchema, BoardConnectionRoutingSchema, BoardConnectionSchema, BoardConnectionStyleSchema, BoardConnectionWaypointSchema, BoardRelationSchema, DEFAULT_BOARD_CONNECTION_ROUTING, DEFAULT_BOARD_CONNECTION_STYLE, DEFAULT_BOARD_RELATION, connectionNodeIds, connectionOtherNodeId, connectionTouchesNode, createBoardConnection, flipBoardConnection, normalizeBoardConnectionStyle } from "./board-connection.js";
|
|
3
3
|
import { BOARD_DOCUMENT_KIND, BOARD_EXTENSION, BOARD_MANIFEST_KIND, BoardAssetRefSchema, BoardClipSchema, BoardEffectSchema, BoardKeyframeSchema, BoardManifestSchema, BoardNodeInputSchema, BoardSequenceSchema, BoardTargetSchema, InvalidBoardFileError, isBoardPath, parseBoardManifest, serializeBoardManifest } from "./board.js";
|
|
4
|
+
import { BOARD_CONTENT_KINDS, BoardContentKindSchema, BoardPortSchema } from "./board-content.js";
|
|
4
5
|
import { BOARD_COLOR_IDS, BOARD_GEO_KINDS, BOARD_NATIVE_NODE_TYPES, BoardColorIdSchema, BoardGeoKindSchema, validateBoardNodeInput } from "./board-node.js";
|
|
5
6
|
import { BoardAwarenessDrawPointSchema, BoardAwarenessFrameSchema, BoardAwarenessGestureSchema, BoardAwarenessNodePreviewSchema, BoardAwarenessPointSchema, BoardAwarenessStateUpdateSchema, BoardAwarenessUpdateSchema } from "./realtime/board-awareness.js";
|
|
7
|
+
import { SHORT_UUID_PATTERN, UUID_OR_SHORT_UUID_PATTERN, UUID_PATTERN, UUID_SHAPE_PATTERN } from "./identifiers.js";
|
|
6
8
|
import { COHUB_SOURCE_HEADER } from "./provenance.js";
|
|
7
9
|
import { RESERVED_PLATFORM_PATH_SEGMENTS } from "./public-identifiers.js";
|
|
10
|
+
import "./ui-command.js";
|
|
11
|
+
import "./work-surface.js";
|
|
8
12
|
import "./work-view-stats.js";
|
|
9
|
-
|
|
13
|
+
import { WORK_PROMOTION_EVENT_KEYS } from "./work-promotion-stats.js";
|
|
14
|
+
export { AUTO_BOARD_CONNECTION_ANCHOR, BOARD_COLOR_IDS, BOARD_CONNECTION_DIRECTIONS, BOARD_CONNECTION_LINES, BOARD_CONNECTION_ROUTINGS, BOARD_CONNECTION_SIDES, BOARD_CONTENT_KINDS, BOARD_DOCUMENT_KIND, BOARD_EXTENSION, BOARD_GEO_KINDS, BOARD_MANIFEST_KIND, BOARD_NATIVE_NODE_TYPES, BoardAssetRefSchema, BoardAwarenessDrawPointSchema, BoardAwarenessFrameSchema, BoardAwarenessGestureSchema, BoardAwarenessNodePreviewSchema, BoardAwarenessPointSchema, BoardAwarenessStateUpdateSchema, BoardAwarenessUpdateSchema, BoardClipSchema, BoardColorIdSchema, BoardConnectionAnchorSchema, BoardConnectionEndpointSchema, BoardConnectionPatchSchema, BoardConnectionRoutingSchema, BoardConnectionSchema, BoardConnectionStyleSchema, BoardConnectionWaypointSchema, BoardContentKindSchema, BoardEffectSchema, BoardGeoKindSchema, BoardKeyframeSchema, BoardManifestSchema, BoardNodeInputSchema, BoardPortSchema, BoardRelationSchema, BoardSequenceSchema, BoardTargetSchema, COHUB_SOURCE_HEADER, DEFAULT_BOARD_CONNECTION_ROUTING, DEFAULT_BOARD_CONNECTION_STYLE, DEFAULT_BOARD_RELATION, InvalidBoardFileError, RESERVED_PLATFORM_PATH_SEGMENTS, SHORT_UUID_PATTERN, UUID_OR_SHORT_UUID_PATTERN, UUID_PATTERN, UUID_SHAPE_PATTERN, WORK_PROMOTION_EVENT_KEYS, connectionNodeIds, connectionOtherNodeId, connectionTouchesNode, createBoardConnection, flipBoardConnection, isBoardPath, normalizeBoardConnectionStyle, parseBoardManifest, serializeBoardManifest, validateBoardNodeInput };
|