@neta-art/cohub 2.14.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -0
- package/dist/board.d.ts +99 -0
- package/dist/board.js +2 -0
- package/dist/chunks/board.d.ts +2589 -0
- package/dist/chunks/board.js +392 -0
- package/dist/chunks/http.d.ts +234 -116
- package/dist/chunks/http.js +179 -66
- package/dist/chunks/websocket.d.ts +186 -176
- package/dist/chunks/websocket.js +2 -17
- package/dist/http.d.ts +4 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +3 -2
- package/package.json +5 -1
package/dist/chunks/http.d.ts
CHANGED
|
@@ -1,40 +1,55 @@
|
|
|
1
|
+
import { a as BoardCreateInput, b as BoardTransaction, g as BoardPlaybackSnapshot, h as BoardPlaybackCommand, l as BoardInspectInput, n as BoardBootstrap, r as BoardCapabilities, x as BoardValidationResult } from "./board.js";
|
|
2
|
+
import { $ as CreateSpacePromptInput, $r as BoardTransactionAppliedEvent$1, Ar as UserSessionsResponse, At as ModelCatalogEntry, Bn as SpaceFsCreateUploadResponse, Cn as SpaceCommerceBuyerProfile, Dn as SpaceCommerceProduct, Dr as UserRulesResponse, En as SpaceCommerceOrder, Er as UserProfile, Et as LabelResourceType, Fn as SpaceDefaultResponse, Gn as SpaceFsMoveInput, Gt as ReferenceDirection, In as SpaceEnvInput, It as PromptTemplateCatalogResponse, J as ClaimReferralResponse, Jt as ReferenceQueryableType, K as CheckpointDiffSummary, Kn as SpaceFsPreparingFile, Kt as ReferenceKind, Ln as SpaceFsCompleteUploadInput, Lt as PublicReferral, Mn as SpaceConfigResponse, Mr as ChannelHealth, Mt as PatchResourceLabelsResponse, Nn as SpaceConfigUpdateResponse, Nt as Permission, On as SpaceCommerceProductBenefitBinding, Pn as SpaceCreateResponse, Qr as BoardPlaybackChangedEvent$1, R as Channel, Rn as SpaceFsCompleteUploadResponse, Rt as PublicUserPageResponse, Si as BillingPayload, Sn as SpaceCommerceBenefit, Sr as SpaceUsageResponse, St as LabelItemsResponse, Tr as TaskRunRecord, Ut as ReferenceAggregateGroupBy, V as CheckpointDiffFileResponse, Wn as SpaceFsFileResponse, Wt as ReferenceAggregateResponse, X as CreateInvitationResponse, Xn as SpaceFsTreeResponse, Xr as GenerationModelDeclaration, Y as CreateInvitationInput, Yn as SpaceFsReadFilesResponse, Yr as GenerationContentBlock, Z as CreateSpaceInput, Zt as ReferralDashboard, a as WebsocketClientOptions, ai as SpacePublicEndpoints, an as SessionMessageResponse, ar as SpaceInvitation, at as CursorPageInfo, bi as Usage, br as SpaceSessionsResponse, cn as SessionRecord, d as BatchUserProfilesResponse, dn as SessionTurnSignedUrlsResponse, dr as SpacePendingDiffSummary, et as CreateSpacePromptResponse, fn as SessionTurnStreamSnapshotResponse, fr as SpacePresenceSnapshot, ft as GlobalSearchResponse, gi as CreateSpaceCompletionInput, gn as SkillCatalogResponse, gr as SpaceRole, hr as SpaceRecord, ht as InvitationDetail, ii as SessionTurnPatchEvent, ir as SpaceFsWriteFileInput, it as CronJobUpdatePatch, jn as SpaceConfigInput, jr as ChannelConfig, jt as PatchResourceLabelsInput, kt as MeResponse, l as AcceptInvitationResponse, ln as SessionTurnIndexResponse, lr as SpaceModListItem, mn as SessionTurnsPaginatedResponse, mr as SpacePublicProfile, mt as GlobalSearchType, ni as RealtimePatchOperation, oi as MessageRecord, on as SessionMessagesPaginatedResponse, pn as SessionTurnWindowResponse, q as CheckpointRecord, qt as ReferenceQueryResponse, r as WebsocketClient, rr as SpaceFsUploadResponse, rt as CronJobRecord, s as WebsocketEventPayload, si as SessionForkRecord, sn as SessionMessagesResponse, sr as SpaceMember, tt as CreateSpaceSessionInput, ui as SessionTurnRecord, un as SessionTurnResponse, ur as SpacePendingDiffFileResponse, vi as SpaceCompletionResult, vn as SpaceAccessPolicy, wr as TaskRunDetailResponse, wt as LabelListItem, xi as ContentBlock, xn as SpaceCheckpointDetailResponse, xt as LabelAssignmentRecord, yi as SpaceCompletionStreamEvent, zn as SpaceFsCreateUploadInput } from "./websocket.js";
|
|
1
3
|
import { n as CohubEnvironment } from "./environment.js";
|
|
2
|
-
import { $ as CheckpointDiffSummary, $n as SpaceFsPreparingFile, $r as ChannelConfig, $t as ReferenceKind, An as SpaceCommerceBuyerProfile, B as CanvasDocumentRecord, Bn as SpaceConfigUpdateResponse, Bt as Permission, Cn as SkillCatalogResponse, Cr as SpaceRole, Dr as SpaceSessionsResponse, Fn as SpaceCommerceProductBenefitBinding, G as Channel, Gn as SpaceFsCompleteUploadResponse, Gt as PublicUserPageResponse, Hn as SpaceDefaultResponse, It as MeResponse, J as CheckpointDiffFileResponse, Kn as SpaceFsCreateUploadInput, Lr as UserSessionsResponse, Lt as ModelCatalogEntry, Mr as TaskRunRecord, Nn as SpaceCommerceOrder, Nr as UserProfile, Nt as LabelResourceType, On as SpaceCheckpointDetailResponse, Ot as LabelAssignmentRecord, Pn as SpaceCommerceProduct, Pr as UserRulesResponse, Qn as SpaceFsMoveInput, Qt as ReferenceDirection, R as CanvasBootstrapResponse, Rn as SpaceConfigInput, Rt as PatchResourceLabelsInput, Sr as SpaceRecord, St as InvitationDetail, Tn as SpaceAccessPolicy, Un as SpaceEnvInput, Ut as PromptTemplateCatalogResponse, Vn as SpaceCreateResponse, W as CanvasTransactionInput, Wn as SpaceFsCompleteUploadInput, Wt as PublicReferral, Xr as GenerationContentBlock, Xt as ReferenceAggregateGroupBy, Zn as SpaceFsFileResponse, Zr as GenerationModelDeclaration, Zt as ReferenceAggregateResponse, _i as BillingPayload, _n as SessionTurnResponse, _r as SpacePendingDiffFileResponse, a as WebsocketClientOptions, bn as SessionTurnWindowResponse, ct as CreateSpaceSessionInput, d as BatchUserProfilesResponse, di as MessageRecord, dr as SpaceFsWriteFileInput, dt as CronJobUpdatePatch, ei as ChannelHealth, en as ReferenceQueryResponse, et as CheckpointRecord, fi as SessionForkRecord, fn as SessionMessageResponse, fr as SpaceInvitation, ft as CursorPageInfo, gi as Usage, gn as SessionTurnIndexResponse, gr as SpaceModListItem, hi as SessionTurnRecord, hn as SessionRecord, in as ReferralDashboard, it as CreateSpaceInput, jr as TaskRunDetailResponse, jt as LabelListItem, kn as SpaceCommerceBenefit, kr as SpaceUsageResponse, kt as LabelItemsResponse, l as AcceptInvitationResponse, li as SessionTurnPatchEvent, mn as SessionMessagesResponse, mr as SpaceMember, nr as SpaceFsReadFilesResponse, nt as CreateInvitationInput, ot as CreateSpacePromptInput, pn as SessionMessagesPaginatedResponse, qn as SpaceFsCreateUploadResponse, r as WebsocketClient, rr as SpaceFsTreeResponse, rt as CreateInvitationResponse, s as WebsocketEventPayload, si as RealtimePatchOperation, st as CreateSpacePromptResponse, tn as ReferenceQueryableType, tt as ClaimReferralResponse, ui as SpacePublicEndpoints, ur as SpaceFsUploadResponse, ut as CronJobRecord, vi as ContentBlock, vn as SessionTurnSignedUrlsResponse, vr as SpacePendingDiffSummary, xn as SessionTurnsPaginatedResponse, xr as SpacePublicProfile, xt as GlobalSearchType, yn as SessionTurnStreamSnapshotResponse, yr as SpacePresenceSnapshot, yt as GlobalSearchResponse, z as CanvasCreateInput, zn as SpaceConfigResponse, zt as PatchResourceLabelsResponse } from "./websocket.js";
|
|
3
4
|
import { a as VoiceInputCreateOptions } from "./voice-input.js";
|
|
4
|
-
//#region ../protocol/dist/
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
//#region ../protocol/dist/model/status.d.ts
|
|
6
|
+
/** Per-model availability status, derived from periodic probe results. */
|
|
7
|
+
type ModelAvailabilityStatus = "operational" | "degraded" | "outage";
|
|
8
|
+
/**
|
|
9
|
+
* Aggregated availability for a single model.
|
|
10
|
+
* All rate fields are percentages (0–100); `null` means no samples in that window.
|
|
11
|
+
*/
|
|
12
|
+
type ModelStatusEntry = {
|
|
13
|
+
status: ModelAvailabilityStatus;
|
|
14
|
+
/** 5-minute success rate — drives the selector dot color. Real observed
|
|
15
|
+
* traffic (`online`) when available, else the probe self-test window. */
|
|
16
|
+
successRate5m: number | null;
|
|
17
|
+
successRate2h: number | null;
|
|
18
|
+
successRate24h: number | null;
|
|
19
|
+
/** 1-hour average / P90 response duration in milliseconds. */
|
|
20
|
+
latencyAvgMs: number | null;
|
|
21
|
+
latencyP90Ms: number | null;
|
|
22
|
+
samples1h: number | null;
|
|
23
|
+
checkedAt: string | null;
|
|
24
|
+
probeIntervalSeconds: number | null;
|
|
25
|
+
/** 24-hour history in 15-minute buckets (oldest → newest), or null. */
|
|
26
|
+
history: Array<{
|
|
27
|
+
t: string;
|
|
28
|
+
status: ModelAvailabilityStatus;
|
|
29
|
+
rate: number | null;
|
|
30
|
+
samples: number;
|
|
31
|
+
}> | null;
|
|
32
|
+
/**
|
|
33
|
+
* Bar-chart series (oldest → newest), always 96 buckets. Source is real
|
|
34
|
+
* observed traffic (`online` heartbeats resampled to 5-min buckets) when
|
|
35
|
+
* available, else the probe self-test `history` (15-min buckets) as a
|
|
36
|
+
* fallback for models not yet covered by online. Drives the hover card
|
|
37
|
+
* bar chart; color each bucket via the 6-tier success-rate scale.
|
|
38
|
+
*/
|
|
39
|
+
heartbeats8h: Array<number | null> | null;
|
|
40
|
+
/**
|
|
41
|
+
* Total minutes spanned by `heartbeats8h` (online → 480, history fallback
|
|
42
|
+
* → 1440). The frontend divides by bucket count for the per-bar age and
|
|
43
|
+
* the axis label, so the window reads honestly regardless of source.
|
|
44
|
+
*/
|
|
45
|
+
heartbeatsWindowMinutes: number | null;
|
|
12
46
|
};
|
|
13
|
-
type
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
turnId?: string;
|
|
19
|
-
toolCallId?: string;
|
|
20
|
-
via?: RequestSourceVia;
|
|
47
|
+
type ModelStatusResponse = {
|
|
48
|
+
generatedAt: string;
|
|
49
|
+
overallStatus: ModelAvailabilityStatus | "unknown";
|
|
50
|
+
/** Keyed by model id. */
|
|
51
|
+
models: Record<string, ModelStatusEntry>;
|
|
21
52
|
};
|
|
22
|
-
declare const isRequestSourceUuid: (value: unknown) => value is string;
|
|
23
|
-
declare const REQUEST_SOURCE_VIA_MAX_LENGTH = 64;
|
|
24
|
-
declare const isRequestSourceEmpty: (source: RequestSource | null | undefined) => boolean;
|
|
25
|
-
declare const hasRequestSourceIdentity: (source: RequestSource | null | undefined) => boolean;
|
|
26
|
-
/** Drop invalid UUIDs; via-only is valid. */
|
|
27
|
-
declare const normalizeRequestSource: (input: unknown) => RequestSource | null;
|
|
28
|
-
declare const parseRequestSourceFromHeaders: (getHeader: (name: string) => string | null | undefined) => RequestSource | null;
|
|
29
|
-
declare const requestSourceToHeaders: (source: RequestSource | null | undefined) => Record<string, string>;
|
|
30
|
-
/** Read COHUB_* env into a RequestSource. */
|
|
31
|
-
declare const readRequestSourceFromEnv: (env?: Record<string, string | undefined>, defaults?: {
|
|
32
|
-
via?: RequestSourceVia;
|
|
33
|
-
}) => RequestSource | null;
|
|
34
|
-
declare const resolveRequestSourceChannel: (source: RequestSource | null | undefined, fallback?: string) => string;
|
|
35
|
-
/** Put identity under meta.source; strip body source. Via-only is skipped. */
|
|
36
|
-
declare const mergeRequestSourceIntoMeta: (meta: Record<string, unknown> | null | undefined, headerSource: RequestSource | null | undefined) => Record<string, unknown> | null;
|
|
37
|
-
declare const COHUB_SOURCE_HEADER_NAMES: readonly string[];
|
|
38
53
|
//#endregion
|
|
39
54
|
//#region ../protocol/dist/generation/index.d.ts
|
|
40
55
|
declare const GENERATION_TASK_TYPE: "generation";
|
|
@@ -87,73 +102,99 @@ type ListGenerationModelsResponse = {
|
|
|
87
102
|
models: PublicGenerationDeclaration[];
|
|
88
103
|
};
|
|
89
104
|
//#endregion
|
|
90
|
-
//#region ../protocol/dist/
|
|
91
|
-
type
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
type
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
thinkingLevel?: CompletionThinkingLevel | null;
|
|
113
|
-
/** When true, respond with SSE. Default false (JSON). */
|
|
114
|
-
stream?: boolean | null;
|
|
115
|
-
};
|
|
116
|
-
type CompletionUsage = Usage;
|
|
117
|
-
type CompletionAssistantMessage = {
|
|
118
|
-
role: "assistant";
|
|
119
|
-
content: ContentBlock[];
|
|
120
|
-
stopReason: "stop" | "length" | "error" | "aborted";
|
|
121
|
-
errorMessage?: string | null;
|
|
105
|
+
//#region ../protocol/dist/space-config.d.ts
|
|
106
|
+
type WorkspacePreviewKind = "file" | "board" | "port";
|
|
107
|
+
type WorkspacePreviewRef = {
|
|
108
|
+
kind: WorkspacePreviewKind;
|
|
109
|
+
key: string;
|
|
110
|
+
};
|
|
111
|
+
type WorkspaceLayoutPresentation = "split" | "focus" | "fullscreen";
|
|
112
|
+
type WorkspaceDefaultLayout = {
|
|
113
|
+
leftSidebar?: "expanded" | "collapsed";
|
|
114
|
+
filesColumn?: "visible" | "hidden";
|
|
115
|
+
fileTree?: "expanded" | "collapsed";
|
|
116
|
+
preview?: WorkspacePreviewRef;
|
|
117
|
+
presentation?: WorkspaceLayoutPresentation;
|
|
118
|
+
};
|
|
119
|
+
type NewChatBackgroundBase = {
|
|
120
|
+
opacity: number;
|
|
121
|
+
fit: "cover" | "contain" | "fill";
|
|
122
|
+
position: string;
|
|
123
|
+
};
|
|
124
|
+
type NewChatBackgroundUrlSource = {
|
|
125
|
+
kind: "url";
|
|
126
|
+
url: string;
|
|
122
127
|
};
|
|
123
|
-
type
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
usage: CompletionUsage | null;
|
|
130
|
-
};
|
|
131
|
-
type SpaceCompletionStreamEvent = {
|
|
132
|
-
type: "meta";
|
|
133
|
-
completionId: string;
|
|
134
|
-
provider: string;
|
|
135
|
-
model: string;
|
|
136
|
-
systemPromptPath: string | null;
|
|
137
|
-
} | {
|
|
138
|
-
type: "delta";
|
|
139
|
-
text: string;
|
|
140
|
-
} | {
|
|
141
|
-
type: "thinking_delta";
|
|
142
|
-
text: string;
|
|
143
|
-
} | {
|
|
144
|
-
type: "usage";
|
|
145
|
-
usage: CompletionUsage;
|
|
146
|
-
} | {
|
|
147
|
-
type: "done";
|
|
148
|
-
completionId: string;
|
|
149
|
-
message: CompletionAssistantMessage;
|
|
150
|
-
usage: CompletionUsage | null;
|
|
128
|
+
type NewChatBackgroundConfig = NewChatBackgroundBase & ({
|
|
129
|
+
type: "html";
|
|
130
|
+
source: NewChatBackgroundUrlSource | {
|
|
131
|
+
kind: "space";
|
|
132
|
+
path: string;
|
|
133
|
+
};
|
|
151
134
|
} | {
|
|
152
|
-
type: "
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
135
|
+
type: "image" | "video";
|
|
136
|
+
source: NewChatBackgroundUrlSource;
|
|
137
|
+
});
|
|
138
|
+
type SpaceConfig = {
|
|
139
|
+
ui?: {
|
|
140
|
+
newChat?: {
|
|
141
|
+
background?: NewChatBackgroundConfig;
|
|
142
|
+
};
|
|
143
|
+
workspace?: {
|
|
144
|
+
defaultLayout?: WorkspaceDefaultLayout;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
type SpacePreviewSessionCredential = {
|
|
149
|
+
token: string;
|
|
150
|
+
expiresIn: number;
|
|
156
151
|
};
|
|
152
|
+
type SpaceStartupResponse = {
|
|
153
|
+
status: "ready" | "missing" | "invalid" | "preparing";
|
|
154
|
+
config: SpaceConfig | null;
|
|
155
|
+
configRaw: string | null;
|
|
156
|
+
revision: {
|
|
157
|
+
mtimeMs: number;
|
|
158
|
+
size: number;
|
|
159
|
+
} | null;
|
|
160
|
+
previewSession: SpacePreviewSessionCredential | null;
|
|
161
|
+
retryAfterMs?: number;
|
|
162
|
+
};
|
|
163
|
+
//#endregion
|
|
164
|
+
//#region ../protocol/dist/provenance.d.ts
|
|
165
|
+
/** Request provenance via X-Cohub-Source-* headers. Never used for authorization. */
|
|
166
|
+
declare const COHUB_SOURCE_HEADER: {
|
|
167
|
+
readonly space: "X-Cohub-Source-Space";
|
|
168
|
+
readonly session: "X-Cohub-Source-Session";
|
|
169
|
+
readonly turn: "X-Cohub-Source-Turn";
|
|
170
|
+
readonly toolCall: "X-Cohub-Source-Tool-Call";
|
|
171
|
+
readonly via: "X-Cohub-Source-Via";
|
|
172
|
+
};
|
|
173
|
+
type RequestSourceVia = "cli" | "bash" | "tool" | "api" | "web" | (string & {});
|
|
174
|
+
/** Caller context: via (channel) and optional identity fields. */
|
|
175
|
+
type RequestSource = {
|
|
176
|
+
spaceId?: string;
|
|
177
|
+
sessionId?: string;
|
|
178
|
+
turnId?: string;
|
|
179
|
+
toolCallId?: string;
|
|
180
|
+
via?: RequestSourceVia;
|
|
181
|
+
};
|
|
182
|
+
declare const isRequestSourceUuid: (value: unknown) => value is string;
|
|
183
|
+
declare const REQUEST_SOURCE_VIA_MAX_LENGTH = 64;
|
|
184
|
+
declare const isRequestSourceEmpty: (source: RequestSource | null | undefined) => boolean;
|
|
185
|
+
declare const hasRequestSourceIdentity: (source: RequestSource | null | undefined) => boolean;
|
|
186
|
+
/** Drop invalid UUIDs; via-only is valid. */
|
|
187
|
+
declare const normalizeRequestSource: (input: unknown) => RequestSource | null;
|
|
188
|
+
declare const parseRequestSourceFromHeaders: (getHeader: (name: string) => string | null | undefined) => RequestSource | null;
|
|
189
|
+
declare const requestSourceToHeaders: (source: RequestSource | null | undefined) => Record<string, string>;
|
|
190
|
+
/** Read COHUB_* env into a RequestSource. */
|
|
191
|
+
declare const readRequestSourceFromEnv: (env?: Record<string, string | undefined>, defaults?: {
|
|
192
|
+
via?: RequestSourceVia;
|
|
193
|
+
}) => RequestSource | null;
|
|
194
|
+
declare const resolveRequestSourceChannel: (source: RequestSource | null | undefined, fallback?: string) => string;
|
|
195
|
+
/** Put identity under meta.source; strip body source. Via-only is skipped. */
|
|
196
|
+
declare const mergeRequestSourceIntoMeta: (meta: Record<string, unknown> | null | undefined, headerSource: RequestSource | null | undefined) => Record<string, unknown> | null;
|
|
197
|
+
declare const COHUB_SOURCE_HEADER_NAMES: readonly string[];
|
|
157
198
|
//#endregion
|
|
158
199
|
//#region src/work-runtime.d.ts
|
|
159
200
|
type WorkRuntimeContext = {
|
|
@@ -471,6 +512,7 @@ declare class ModelsApi {
|
|
|
471
512
|
constructor(transport: HttpTransport);
|
|
472
513
|
list(): Promise<ModelsCatalog>;
|
|
473
514
|
listMultimodal(): Promise<ListGenerationModelsResponse>;
|
|
515
|
+
status(): Promise<ModelStatusResponse>;
|
|
474
516
|
}
|
|
475
517
|
//#endregion
|
|
476
518
|
//#region src/apis/prompts.d.ts
|
|
@@ -843,16 +885,26 @@ declare class PublicInviteApi {
|
|
|
843
885
|
//#endregion
|
|
844
886
|
//#region src/apis/spaces.d.ts
|
|
845
887
|
/**
|
|
846
|
-
* A
|
|
888
|
+
* A board transaction rejected by the server. `status`/`code` let callers
|
|
847
889
|
* distinguish a recoverable version conflict (409 / "VERSION_CONFLICT") from
|
|
848
890
|
* transient failures, so they can rebase and retry instead of surfacing an error.
|
|
849
891
|
*/
|
|
850
|
-
declare class
|
|
892
|
+
declare class BoardTransactionError extends Error {
|
|
851
893
|
readonly status?: number | undefined;
|
|
852
894
|
readonly code?: string | undefined;
|
|
853
|
-
|
|
895
|
+
readonly body?: unknown;
|
|
896
|
+
constructor(message: string, status?: number | undefined, code?: string | undefined, body?: unknown, options?: ErrorOptions);
|
|
854
897
|
get isVersionConflict(): boolean;
|
|
855
898
|
}
|
|
899
|
+
type BoardTransactionInput = Omit<BoardTransaction, "boardId">;
|
|
900
|
+
type BoardTransactionAppliedEvent = BoardTransactionAppliedEvent$1;
|
|
901
|
+
type BoardPlaybackChangedEvent = BoardPlaybackChangedEvent$1;
|
|
902
|
+
type BoardEventName = "transaction" | "playback";
|
|
903
|
+
type BoardSubscriptionHandlers = {
|
|
904
|
+
transaction?: (event: BoardTransactionAppliedEvent) => void;
|
|
905
|
+
playback?: (event: BoardPlaybackChangedEvent) => void;
|
|
906
|
+
event?: (event: BoardTransactionAppliedEvent | BoardPlaybackChangedEvent) => void;
|
|
907
|
+
};
|
|
856
908
|
type SessionSubscriptionHandlers = {
|
|
857
909
|
patch?: (event: WebsocketEventPayload) => void;
|
|
858
910
|
/** @deprecated Use `session.subscribeGeneration({ state })`. */
|
|
@@ -864,7 +916,7 @@ type SessionSubscriptionHandlers = {
|
|
|
864
916
|
event?: (event: WebsocketEventPayload) => void;
|
|
865
917
|
};
|
|
866
918
|
type SessionEventName = "created" | "updated" | "turn.created" | "turn.patch" | "turn.lifecycle" | "turn.updated" | "turn.finalized" | "turn.error" | "message.persisted";
|
|
867
|
-
type SpaceEventName = SessionEventName | "fs.changed" | "ports.changed" | "presence.updated" | "
|
|
919
|
+
type SpaceEventName = SessionEventName | "fs.changed" | "ports.changed" | "presence.updated" | "board.transaction.applied" | "board.playback.changed" | "task.created" | "task.updated" | "event";
|
|
868
920
|
declare class SpacesApi {
|
|
869
921
|
private readonly transport;
|
|
870
922
|
constructor(transport: HttpTransport);
|
|
@@ -1323,16 +1375,70 @@ declare class SpaceCommerceApi {
|
|
|
1323
1375
|
businessKey: string;
|
|
1324
1376
|
}>;
|
|
1325
1377
|
}
|
|
1326
|
-
declare class
|
|
1378
|
+
declare class BoardRealtimeClient {
|
|
1379
|
+
private readonly websocketClient;
|
|
1380
|
+
private readonly spaceId;
|
|
1381
|
+
private readonly boardId;
|
|
1382
|
+
constructor(websocketClient: WebsocketClient | null, spaceId: string, boardId: string);
|
|
1383
|
+
subscribe(handlers: BoardSubscriptionHandlers): () => void;
|
|
1384
|
+
on(type: "transaction", handler: (event: BoardTransactionAppliedEvent) => void): () => void;
|
|
1385
|
+
on(type: "playback", handler: (event: BoardPlaybackChangedEvent) => void): () => void;
|
|
1386
|
+
}
|
|
1387
|
+
declare class BoardClient {
|
|
1388
|
+
readonly spaceId: string;
|
|
1389
|
+
readonly id: string;
|
|
1390
|
+
readonly realtime: BoardRealtimeClient;
|
|
1391
|
+
private readonly boards;
|
|
1392
|
+
constructor(spaceId: string, id: string, transport: HttpTransport, websocketClient: WebsocketClient | null);
|
|
1393
|
+
inspect(input?: BoardInspectInput, customFetch?: Fetch): Promise<BoardBootstrap>;
|
|
1394
|
+
capabilities(customFetch?: Fetch): Promise<BoardCapabilities>;
|
|
1395
|
+
validate(transaction: BoardTransactionInput): Promise<BoardValidationResult>;
|
|
1396
|
+
apply(transaction: BoardTransactionInput): Promise<BoardBootstrap>;
|
|
1397
|
+
playback(command: BoardPlaybackCommand): Promise<BoardPlaybackSnapshot>;
|
|
1398
|
+
play(command: Omit<Extract<BoardPlaybackCommand, {
|
|
1399
|
+
type: "play";
|
|
1400
|
+
}>, "shared"> & {
|
|
1401
|
+
shared?: true;
|
|
1402
|
+
}): Promise<BoardPlaybackSnapshot>;
|
|
1403
|
+
pause(command: Extract<BoardPlaybackCommand, {
|
|
1404
|
+
type: "pause";
|
|
1405
|
+
}>): Promise<BoardPlaybackSnapshot>;
|
|
1406
|
+
seek(command: Extract<BoardPlaybackCommand, {
|
|
1407
|
+
type: "seek";
|
|
1408
|
+
}>): Promise<BoardPlaybackSnapshot>;
|
|
1409
|
+
stop(command: Extract<BoardPlaybackCommand, {
|
|
1410
|
+
type: "stop";
|
|
1411
|
+
}>): Promise<BoardPlaybackSnapshot>;
|
|
1412
|
+
subscribe(handlers: BoardSubscriptionHandlers): () => void;
|
|
1413
|
+
on(type: "transaction", handler: (event: BoardTransactionAppliedEvent) => void): () => void;
|
|
1414
|
+
on(type: "playback", handler: (event: BoardPlaybackChangedEvent) => void): () => void;
|
|
1415
|
+
}
|
|
1416
|
+
declare class SpaceBoardsApi {
|
|
1327
1417
|
private readonly transport;
|
|
1328
1418
|
private readonly spaceId;
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1419
|
+
private readonly websocketClient;
|
|
1420
|
+
constructor(transport: HttpTransport, spaceId: string, websocketClient: WebsocketClient | null);
|
|
1421
|
+
byId(boardId: string): BoardClient;
|
|
1422
|
+
create(input: BoardCreateInput): Promise<BoardBootstrap>;
|
|
1423
|
+
inspect(boardId: string, input?: BoardInspectInput, customFetch?: Fetch): Promise<BoardBootstrap>;
|
|
1424
|
+
capabilities(boardId: string, customFetch?: Fetch): Promise<BoardCapabilities>;
|
|
1425
|
+
validate(transaction: BoardTransaction): Promise<BoardValidationResult>;
|
|
1426
|
+
apply(transaction: BoardTransaction): Promise<BoardBootstrap>;
|
|
1427
|
+
playback(boardId: string, command: BoardPlaybackCommand): Promise<BoardPlaybackSnapshot>;
|
|
1428
|
+
play(boardId: string, command: Omit<Extract<BoardPlaybackCommand, {
|
|
1429
|
+
type: "play";
|
|
1430
|
+
}>, "shared"> & {
|
|
1431
|
+
shared?: true;
|
|
1432
|
+
}): Promise<BoardPlaybackSnapshot>;
|
|
1433
|
+
pause(boardId: string, command: Extract<BoardPlaybackCommand, {
|
|
1434
|
+
type: "pause";
|
|
1435
|
+
}>): Promise<BoardPlaybackSnapshot>;
|
|
1436
|
+
seek(boardId: string, command: Extract<BoardPlaybackCommand, {
|
|
1437
|
+
type: "seek";
|
|
1438
|
+
}>): Promise<BoardPlaybackSnapshot>;
|
|
1439
|
+
stop(boardId: string, command: Extract<BoardPlaybackCommand, {
|
|
1440
|
+
type: "stop";
|
|
1441
|
+
}>): Promise<BoardPlaybackSnapshot>;
|
|
1336
1442
|
}
|
|
1337
1443
|
declare class SpaceCheckpointFilesApi {
|
|
1338
1444
|
private readonly transport;
|
|
@@ -1403,10 +1509,11 @@ declare class SpaceClient {
|
|
|
1403
1509
|
readonly sandbox: SpaceSandboxApi;
|
|
1404
1510
|
readonly invitations: SpaceInvitationsApi;
|
|
1405
1511
|
readonly labels: SpaceLabelsApi;
|
|
1406
|
-
readonly
|
|
1512
|
+
readonly boards: SpaceBoardsApi;
|
|
1407
1513
|
readonly commerce: SpaceCommerceApi;
|
|
1408
1514
|
constructor(id: string, transport: HttpTransport, websocketClient: WebsocketClient | null);
|
|
1409
1515
|
get(customFetch?: Fetch): Promise<SpaceRecord>;
|
|
1516
|
+
getStartup(customFetch?: Fetch): Promise<SpaceStartupResponse>;
|
|
1410
1517
|
prompt(input: CreateSpacePromptInput): Promise<CreateSpacePromptResponse>;
|
|
1411
1518
|
/**
|
|
1412
1519
|
* Raw LLM completion. Caller fully controls messages and optional system prompt file.
|
|
@@ -1428,11 +1535,6 @@ declare class SpaceClient {
|
|
|
1428
1535
|
rename(name: string): Promise<{
|
|
1429
1536
|
space: SpaceRecord;
|
|
1430
1537
|
}>;
|
|
1431
|
-
sendCanvasTransactionRealtime(documentId: string, input: CanvasTransactionInput): Promise<{
|
|
1432
|
-
document: {
|
|
1433
|
-
version: number;
|
|
1434
|
-
};
|
|
1435
|
-
}>;
|
|
1436
1538
|
profile(body: {
|
|
1437
1539
|
description?: string | null;
|
|
1438
1540
|
avatarUrl?: string | null;
|
|
@@ -1445,6 +1547,7 @@ declare class SpaceClient {
|
|
|
1445
1547
|
getConfig(): Promise<SpaceConfigResponse>;
|
|
1446
1548
|
updateConfig(input: SpaceConfigInput): Promise<SpaceConfigUpdateResponse>;
|
|
1447
1549
|
session(sessionId: string): SessionClient;
|
|
1550
|
+
board(boardId: string): BoardClient;
|
|
1448
1551
|
updatePresence(meta?: Record<string, unknown> | null): Promise<void>;
|
|
1449
1552
|
subscribe(handler: (event: WebsocketEventPayload) => void): () => void;
|
|
1450
1553
|
on(type: SpaceEventName, handler: (event: WebsocketEventPayload) => void): () => void;
|
|
@@ -1478,6 +1581,7 @@ declare class UserApi {
|
|
|
1478
1581
|
private readonly transportBaseUrl;
|
|
1479
1582
|
private readonly setStoredAuthToken?;
|
|
1480
1583
|
private readonly clearStoredAuthToken?;
|
|
1584
|
+
readonly labels: UserLabelsApi;
|
|
1481
1585
|
constructor(transport: HttpTransport, transportBaseUrl: string, setStoredAuthToken?: ((token: string) => void) | undefined, clearStoredAuthToken?: (() => void) | undefined);
|
|
1482
1586
|
getMe(options?: Fetch | {
|
|
1483
1587
|
fetch?: Fetch;
|
|
@@ -1503,6 +1607,20 @@ declare class UserApi {
|
|
|
1503
1607
|
setAuthToken(token: string): Promise<any>;
|
|
1504
1608
|
clearAuthToken(): Promise<null>;
|
|
1505
1609
|
}
|
|
1610
|
+
/** User-scoped labels — same label/assignment model as space labels, but private to the viewer. */
|
|
1611
|
+
declare class UserLabelsApi {
|
|
1612
|
+
private readonly transport;
|
|
1613
|
+
constructor(transport: HttpTransport);
|
|
1614
|
+
getResourceLabels(resourceType: LabelResourceType, resourceRef: string): Promise<{
|
|
1615
|
+
assignments: LabelAssignmentRecord[];
|
|
1616
|
+
}>;
|
|
1617
|
+
patchResourceLabels(resourceType: LabelResourceType, resourceRef: string, input: {
|
|
1618
|
+
addLabelRefs?: string[];
|
|
1619
|
+
removeLabelRefs?: string[];
|
|
1620
|
+
}): Promise<{
|
|
1621
|
+
assignments: LabelAssignmentRecord[];
|
|
1622
|
+
}>;
|
|
1623
|
+
}
|
|
1506
1624
|
//#endregion
|
|
1507
1625
|
//#region src/apis/users.d.ts
|
|
1508
1626
|
declare class UsersApi {
|
|
@@ -1792,4 +1910,4 @@ declare class CohubHttpClient {
|
|
|
1792
1910
|
}
|
|
1793
1911
|
declare const createHttpClient: (options?: CohubClientOptions) => CohubHttpClient;
|
|
1794
1912
|
//#endregion
|
|
1795
|
-
export {
|
|
1913
|
+
export { GenerationStreamFinalizedEvent as $, resolveWorkTransport as $t, ReferralsApi as A, ModelsApi as At, BoardTransactionInput as B, sanitizeAccessToken as Bt, WorkSessionResponse as C, PublicAssetPurpose as Ct, WorkVersionRecord as D, UploadPublicAssetInput as Dt, WorkUpdateInput as E, UploadChatImageAttachmentInput as Et, BoardEventName as F, Fetch as Ft, SpaceEventName as G, WorkRuntimeCheckoutState as Gt, SessionSubscriptionHandlers as H, PopupBrokerTransport as Ht, BoardPlaybackChangedEvent as I, HttpError as It, PublicInviteApi as J, WorkRuntimeModeConfig as Jt, SpacesApi as K, WorkRuntimeCheckoutStatus as Kt, BoardSubscriptionHandlers as L, HttpTransport as Lt, UserApi as M, CronJobsApi as Mt, TasksApi as N, ChannelsApi as Nt, WorkVisibility as O, SkillsApi as Ot, BoardClient as P, CohubClientOptions as Pt, GenerationStreamEvent as Q, createWorkRuntime as Qt, BoardTransactionAppliedEvent as R, RawHttpResponse as Rt, WorkResolveResponse as S, ModelStatusResponse as Sn, PublicAssetMimeType as St, WorkTargetType as T, UploadChatAttachmentInput as Tt, SpaceChannelBindingRecord as U, WorkIdResolver as Ut, SessionEventName as V, ParentBridgeTransport as Vt, SpaceClient as W, WorkRuntimeApi as Wt, GenerationStreamCommitEvent as X, WorkRuntimeTransport as Xt, AssistantMessageCommit as Y, WorkRuntimeRequestOptions as Yt, GenerationStreamErrorEvent as Z, createSlugWorkIdResolver as Zt, WorkMeta as _, GenerationTaskResult as _n, ReferenceResourceSelector as _t, WorkCommerceCreditConsumeResponse as a, hasRequestSourceIdentity as an, GenerationStreamSubscriptionHandlers as at, WorkPublicSpaceRecord as b, PublicGenerationDeclaration as bn, CreatePublicAssetUploadInput as bt, WorkCommerceEntitlementsResponse as c, mergeRequestSourceIntoMeta as cn, createSessionGenerationStreamClient as ct, WorkCommercePurchaseResponse as d, readRequestSourceFromEnv as dn, SessionPatchApplyResult as dt, COHUB_SOURCE_HEADER as en, GenerationStreamIntermediateMessage as et, WorkAuthorizeResponse as f, requestSourceToHeaders as fn, SessionPatchReducer as ft, WorkGetResponse as g, CreateGenerationTaskResponse as gn, SessionAccessApi as gt, WorkExtractedPageMeta as h, CreateGenerationTaskRequest as hn, createSessionPatchReducer as ht, WorkCommerceCheckoutStatus as i, RequestSourceVia as in, GenerationStreamSubscribeOptions as it, UsersApi as j, GenerationsApi as jt, WorksApi as k, PromptsApi as kt, WorkCommerceOrder as l, normalizeRequestSource as ln, parseAssistantMessageCommit as lt, WorkDetailResponse as m, SpaceStartupResponse as mn, SessionPatchStatus as mt, createHttpClient as n, REQUEST_SOURCE_VIA_MAX_LENGTH as nn, GenerationStreamOutOfSyncEvent as nt, WorkCommerceCreditConsumeStatus as o, isRequestSourceEmpty as on, GenerationStreamTurnUpdatedEvent as ot, WorkCreateInput as p, resolveRequestSourceChannel as pn, SessionPatchState as pt, WebSocketConnectionState as q, WorkRuntimeContext as qt, WorkCommerceApi as r, RequestSource as rn, GenerationStreamStateEvent as rt, WorkCommerceEntitlement as s, isRequestSourceUuid as sn, SessionGenerationStreamClient as st, CohubHttpClient as t, COHUB_SOURCE_HEADER_NAMES as tn, GenerationStreamLifecycleEvent as tt, WorkCommerceProductResolveResponse as u, parseRequestSourceFromHeaders as un, SessionPatchApplyInput as ut, WorkPresentationMeta as v, GenerationUsageBilling as vn, ReferencesApi as vt, WorkStatus as w, PublicAssetsApi as wt, WorkRecord as x, ModelStatusEntry as xn, CreatePublicAssetUploadResponse as xt, WorkPublicOwnerRecord as y, ListGenerationModelsResponse as yn, SearchApi as yt, BoardTransactionError as z, joinApiUrl as zt };
|