@neta-art/cohub 7.0.0 → 8.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.
@@ -1,4 +1,4 @@
1
- import { $ as CreateInvitationInput, $i as UiCommandRecord, $n as SpaceFsPreparingFile, Ai as SessionTurnPatchEvent, Ar as SpaceTurnAuthorFilter, At as MeResponse, Bn as SpaceDefaultResponse, Ci as RealtimePatchOperation, Co as RequestSource, Cr as SpacePublicProfile, Ct as LabelItemsResponse, Da as BoardAuthoringReadInput, Dn as SpaceCommerceBenefit, Dt as LabelResourceType, En as SpaceCheckpointDetailResponse, Fi as BoardAwarenessUpdate, G as CheckpointDiffFileResponse, Gn as SpaceFsCreateUploadInput, Gt as ReferenceAggregateResponse, H as Channel, Hi as WorkContentKind, Hn as SpaceFsCompleteUploadInput, Hr as UserProfile, Ii as WorkArtifactDescriptor, In as SpaceConfigInput, Ir as TaskRunDetailResponse, Jr as ChannelHealth, Jt as ReferenceQueryResponse, Kn as SpaceFsCreateUploadResponse, Kr as UserSessionsResponse, Kt as ReferenceDirection, Ln as SpaceConfigResponse, Lr as TaskRunRecord, Lt as PromptTemplateCatalogResponse, Ma as BoardSemanticMutation, Mn as SpaceCommerceProduct, Mt as PatchResourceLabelsInput, Nn as SpaceCommerceProductBenefitBinding, Nt as PatchResourceLabelsResponse, Oa as BoardAuthoringSnapshot, On as SpaceCommerceBuyerProfile, Pr as SpaceUsageResponse, Pt as Permission, Q as ClaimReferralResponse, Qi as UiCommandError, Qn as SpaceFsMoveInput, Qt as ReferralDashboard, Rn as SpaceConfigUpdateResponse, Rr as UserActivityQuery, Rt as PublicReferral, Sa as BoardSummary, St as LabelAssignmentRecord, Tr as SpaceRole, Tt as LabelListItem, Un as SpaceFsCompleteUploadResponse, Ur as UserRulesResponse, Vn as SpaceEnvInput, Vr as UserActivityResponse, Wt as ReferenceAggregateGroupBy, X as CheckpointDiffSummary, Xi as UiCommand, Yt as ReferenceQueryableType, Z as CheckpointRecord, Zn as SpaceFsFileResponse, _a as BoardPlaybackCommand, _n as SkillCatalogResponse, _o as Usage, a as WebsocketClientOptions, at as CreateSpaceSessionInput, ba as BoardPlaybackSnapshot, bi as BoardPlaybackChangedEvent$1, bn as SpaceAccessPolicy, br as SpacePendingDiffSummary, cn as SessionMessagesResponse, ct as CronJobUpdatePatch, d as BatchUserProfilesResponse, di as GenerationContentBlock, dn as SessionTurnResponse, dr as SpaceFsWriteFileInput, ea as UiCommandStatus, et as CreateInvitationResponse, fa as BoardCapabilities, fi as GenerationModelDeclaration, fn as SessionTurnSignedUrlsResponse, ga as BoardMutationReceipt, go as SpaceCompletionStreamEvent, gr as SpaceMember, gt as InvitationDetail, hn as SessionTurnsPaginatedResponse, ho as SpaceCompletionResult, ht as GlobalSearchType, it as CreateSpacePromptResponse, jn as SpaceCommerceOrder, jt as ModelCatalogEntry, kr as SpaceSessionsResponse, l as AcceptInvitationResponse, ln as SessionRecord, lt as CursorPageInfo, mn as SessionTurnWindowResponse, no as MessageRecord, nr as SpaceFsReadFilesResponse, on as SessionMessageResponse, oo as SessionTurnRecord, pa as BoardCreateInput, pn as SessionTurnStreamSnapshotResponse, po as CreateSpaceCompletionInput, pr as SpaceInvitationListResponse, pt as GlobalSearchResponse, qr as ChannelConfig, qt as ReferenceKind, r as WebsocketClient, ro as SessionForkRecord, rr as SpaceFsTreeResponse, rt as CreateSpacePromptInput, s as WebsocketEventPayload, sn as SessionMessagesPaginatedResponse, so as SpaceTurnsResponse, st as CronJobRecord, to as SpacePublicEndpoints, tt as CreateSpaceInput, un as SessionTurnIndexResponse, ur as SpaceFsUploadResponse, vi as BoardAwarenessUpdatedEvent$1, vo as BillingPayload, vr as SpaceModListItem, wr as SpaceRecord, xr as SpacePresenceSnapshot, yi as BoardChangedEvent$1, yo as ContentBlock, yr as SpacePendingDiffFileResponse, zn as SpaceCreateResponse, zt as PublicUserPageResponse } from "./websocket.js";
1
+ import { $ as CreateInvitationInput, $i as DesktopCommand, $n as SpaceFsMoveInput, $t as ReferralDashboard, Ar as SpaceSessionsResponse, At as MeResponse, Bn as SpaceCreateResponse, Bt as PublicUserPageResponse, Ca as BoardSummary, Ct as LabelItemsResponse, Di as RealtimePatchOperation, Dn as SpaceCheckpointDetailResponse, Dt as LabelResourceType, Er as SpaceRole, Fr as SpaceUsageResponse, G as CheckpointDiffFileResponse, Gt as ReferenceAggregateGroupBy, H as Channel, Hn as SpaceEnvInput, Hr as UserActivityResponse, Ii as BoardAwarenessUpdate, Jr as ChannelConfig, Jt as ReferenceKind, Kn as SpaceFsCreateUploadInput, Kt as ReferenceAggregateResponse, Li as AppArtifactDescriptor, Ln as SpaceConfigInput, Lr as TaskRunDetailResponse, Lt as PromptTemplateCatalogResponse, Mi as SessionTurnPatchEvent, Mn as SpaceCommerceOrder, Mt as PatchResourceLabelsInput, Na as BoardSemanticMutation, Nn as SpaceCommerceProduct, Nt as PatchResourceLabelsResponse, Oa as BoardAuthoringReadInput, On as SpaceCommerceBenefit, Pn as SpaceCommerceProductBenefitBinding, Pt as Permission, Q as ClaimReferralResponse, Qn as SpaceFsFileResponse, Rn as SpaceConfigResponse, Rr as TaskRunRecord, Rt as PublicReferral, Si as BoardPlaybackChangedEvent$1, Sr as SpacePresenceSnapshot, St as LabelAssignmentRecord, Tr as SpaceRecord, Tt as LabelListItem, Ui as AppContentKind, Un as SpaceFsCompleteUploadInput, Ur as UserProfile, Vn as SpaceDefaultResponse, Wn as SpaceFsCompleteUploadResponse, Wr as UserRulesResponse, X as CheckpointDiffSummary, Xt as ReferenceQueryableType, Yr as ChannelHealth, Yt as ReferenceQueryResponse, Z as CheckpointRecord, _a as BoardMutationReceipt, _o as SpaceCompletionStreamEvent, _r as SpaceMember, a as WebsocketClientOptions, at as CreateSpaceSessionInput, bi as BoardAwarenessUpdatedEvent$1, bo as ContentBlock, br as SpacePendingDiffFileResponse, cn as SessionMessagesPaginatedResponse, co as SpaceTurnsResponse, ct as CronJobUpdatePatch, d as BatchUserProfilesResponse, dn as SessionTurnIndexResponse, dr as SpaceFsUploadResponse, er as SpaceFsPreparingFile, et as CreateInvitationResponse, fi as GenerationContentBlock, fn as SessionTurnResponse, fr as SpaceFsWriteFileInput, gn as SessionTurnsPaginatedResponse, go as SpaceCompletionResult, gt as InvitationDetail, hn as SessionTurnWindowResponse, ht as GlobalSearchType, io as SessionForkRecord, ir as SpaceFsTreeResponse, it as CreateSpacePromptResponse, jr as SpaceTurnAuthorFilter, jt as ModelCatalogEntry, ka as BoardAuthoringSnapshot, kn as SpaceCommerceBuyerProfile, l as AcceptInvitationResponse, ln as SessionMessagesResponse, lt as CursorPageInfo, ma as BoardCreateInput, mn as SessionTurnStreamSnapshotResponse, mo as CreateSpaceCompletionInput, mr as SpaceInvitationListResponse, na as DesktopCommandRecord, no as SpacePublicEndpoints, pa as BoardCapabilities, pi as GenerationModelDeclaration, pn as SessionTurnSignedUrlsResponse, pt as GlobalSearchResponse, qn as SpaceFsCreateUploadResponse, qr as UserSessionsResponse, qt as ReferenceDirection, r as WebsocketClient, ra as DesktopCommandStatus, ro as MessageRecord, rr as SpaceFsReadFilesResponse, rt as CreateSpacePromptInput, s as WebsocketEventPayload, sn as SessionMessageResponse, so as SessionTurnRecord, st as CronJobRecord, ta as DesktopCommandError, tt as CreateSpaceInput, un as SessionRecord, va as BoardPlaybackCommand, vn as SkillCatalogResponse, vo as Usage, wo as RequestSource, wr as SpacePublicProfile, xa as BoardPlaybackSnapshot, xi as BoardChangedEvent$1, xn as SpaceAccessPolicy, xr as SpacePendingDiffSummary, yo as BillingPayload, yr as SpaceModListItem, zn as SpaceConfigUpdateResponse, zr as UserActivityQuery } from "./websocket.js";
2
2
  import { n as CohubEnvironment } from "./environment.js";
3
3
  import { a as VoiceInputCreateOptions } from "./voice-input.js";
4
4
  //#region ../protocol/dist/model/status.d.ts
@@ -104,9 +104,9 @@ type ListGenerationModelsResponse = {
104
104
  };
105
105
  //#endregion
106
106
  //#region ../protocol/dist/space-config.d.ts
107
- type WorkspacePreviewKind = "file" | "board" | "port";
108
- type WorkspacePreviewRef = {
109
- kind: WorkspacePreviewKind;
107
+ type WindowKind = "file" | "board" | "port";
108
+ type WindowRef = {
109
+ kind: WindowKind;
110
110
  key: string;
111
111
  };
112
112
  type WorkspaceLayoutPresentation = "split" | "focus" | "fullscreen";
@@ -114,7 +114,7 @@ type WorkspaceDefaultLayout = {
114
114
  leftSidebar?: "expanded" | "collapsed";
115
115
  filesColumn?: "visible" | "hidden";
116
116
  fileTree?: "expanded" | "collapsed";
117
- preview?: WorkspacePreviewRef;
117
+ window?: WindowRef;
118
118
  presentation?: WorkspaceLayoutPresentation;
119
119
  };
120
120
  type NewChatBackgroundBase = {
@@ -201,21 +201,21 @@ type PublicFileUrlResponse = {
201
201
  url: string;
202
202
  };
203
203
  //#endregion
204
- //#region ../protocol/dist/work-promotion-stats.d.ts
205
- declare const WORK_PROMOTION_EVENT_KEYS: readonly ["landing", "ready", "registration_completed", "paywall_viewed", "checkout_started"];
206
- type WorkPromotionEventKey = typeof WORK_PROMOTION_EVENT_KEYS[number];
204
+ //#region ../protocol/dist/app-promotion-stats.d.ts
205
+ declare const APP_PROMOTION_EVENT_KEYS: readonly ["landing", "ready", "registration_completed", "paywall_viewed", "checkout_started"];
206
+ type AppPromotionEventKey = typeof APP_PROMOTION_EVENT_KEYS[number];
207
207
  //#endregion
208
- //#region src/work-runtime.d.ts
209
- type WorkRuntimeInvocationContext = {
210
- surface: "page" | "preview" | "background" | "broker";
211
- source?: "ui_command" | "user" | "route";
208
+ //#region src/app-runtime.d.ts
209
+ type AppRuntimeInvocationContext = {
210
+ surface: "page" | "app" | "background" | "broker";
211
+ source?: "desktop_command" | "user" | "route";
212
212
  spaceId?: string;
213
213
  sessionId?: string;
214
214
  turnId?: string;
215
215
  toolCallId?: string;
216
216
  };
217
- type WorkRuntimeContext = {
218
- work: {
217
+ type AppRuntimeContext = {
218
+ app: {
219
219
  id: string;
220
220
  slug: string;
221
221
  url?: string | null;
@@ -227,98 +227,104 @@ type WorkRuntimeContext = {
227
227
  viewer?: {
228
228
  userUuid: string;
229
229
  } | null;
230
- invocation?: WorkRuntimeInvocationContext;
230
+ invocation?: AppRuntimeInvocationContext;
231
231
  permissions?: {
232
232
  scopes: Permission[];
233
- workScopes: Permission[];
233
+ appScopes: Permission[];
234
234
  viewerScopes: Permission[];
235
235
  };
236
236
  };
237
- type WorkRuntimeCheckoutStatus = "success" | "failed" | "cancel" | null;
238
- type WorkRuntimeCheckoutState = {
239
- status: WorkRuntimeCheckoutStatus;
237
+ type AppRuntimeCheckoutStatus = "success" | "failed" | "cancel" | null;
238
+ type AppRuntimeCheckoutState = {
239
+ status: AppRuntimeCheckoutStatus;
240
240
  orderId: string | null;
241
241
  };
242
242
  /**
243
- * Options for a single work runtime transport request.
243
+ * Options for a single app runtime transport request.
244
244
  */
245
- type WorkRuntimeRequestOptions = {
245
+ type AppRuntimeRequestOptions = {
246
246
  /** How long to wait for a matching response before resolving with null. */
247
247
  timeoutMs?: number;
248
248
  /** When set, re-posts the request on this interval until a response arrives. */
249
249
  retryIntervalMs?: number;
250
250
  };
251
251
  /**
252
- * Transport layer for {@link WorkRuntimeApi}. Decoupled so the same API can run
252
+ * Transport layer for {@link AppRuntimeApi}. Decoupled so the same API can run
253
253
  * over either the iframe parent bridge (bridge mode) or a popup broker window
254
254
  * (broker mode). The transport is responsible for posting the request and
255
255
  * resolving with the first matching response (or null on timeout).
256
256
  */
257
- interface WorkRuntimeTransport {
258
- request<T>(message: Record<string, unknown>, options?: WorkRuntimeRequestOptions): Promise<T | null>;
257
+ type AppContextChangedListener = (context: AppRuntimeContext) => void;
258
+ interface AppRuntimeTransport {
259
+ request<T>(message: Record<string, unknown>, options?: AppRuntimeRequestOptions): Promise<T | null>;
260
+ subscribeContextChanged?: (listener: AppContextChangedListener) => () => void;
259
261
  }
260
262
  /**
261
263
  * Bridge-mode transport: posts messages to `window.parent` (the Cohub host
262
- * embedding the work in an iframe) and listens for the matching reply.
264
+ * embedding the app in an iframe) and listens for the matching reply.
263
265
  * Behaviorally identical to the previous module-level `request()` helper.
264
266
  */
265
- declare class ParentBridgeTransport implements WorkRuntimeTransport {
267
+ declare class ParentBridgeTransport implements AppRuntimeTransport {
266
268
  private trustedParentOrigin;
267
- request<T>(message: Record<string, unknown>, options?: WorkRuntimeRequestOptions): Promise<T | null>;
269
+ private contextListeners;
270
+ private contextListener;
271
+ subscribeContextChanged(listener: AppContextChangedListener): () => void;
272
+ request<T>(message: Record<string, unknown>, options?: AppRuntimeRequestOptions): Promise<T | null>;
268
273
  }
269
274
  /**
270
- * Broker-mode transport for standalone-deployed works. Opens a popup window to
275
+ * Broker-mode transport for standalone-deployed apps. Opens a popup window to
271
276
  * the Cohub auth broker page, performs a ready-handshake, sends the request via
272
277
  * postMessage, and resolves with the broker's response. The popup is closed
273
278
  * after a single request is fulfilled (one-shot, per §7.2 of the plan).
274
279
  *
275
280
  * Non-interactive messages (`context`, `checkout-state`) are answered locally
276
- * without opening a popup — the work already knows its own workId, and
277
- * checkout state is not available on the work's own origin in broker mode.
281
+ * without opening a popup — the app already knows its own appId, and
282
+ * checkout state is not available on the app's own origin in broker mode.
278
283
  */
279
- declare class PopupBrokerTransport implements WorkRuntimeTransport {
284
+ declare class PopupBrokerTransport implements AppRuntimeTransport {
280
285
  private readonly brokerOrigin;
281
- private readonly workId?;
282
- private readonly getWorkId?;
286
+ private readonly appId?;
287
+ private readonly getAppId?;
283
288
  constructor(config: {
284
289
  brokerOrigin: string;
285
- /** Explicit work id. When absent, {@link getWorkId} is used to resolve it. */
286
- workId?: string;
290
+ /** Explicit app id. When absent, {@link getAppId} is used to resolve it. */
291
+ appId?: string;
287
292
  /**
288
- * Lazily resolves the work id at runtime (e.g. via the public
289
- * `works.getBySlug` reverse lookup). Used in standalone deployments where
290
- * the workId is not known at code-authoring time. The resolver is expected
293
+ * Lazily resolves the app id at runtime (e.g. via the public
294
+ * `apps.getBySlug` reverse lookup). Used in standalone deployments where
295
+ * the appId is not known at code-authoring time. The resolver is expected
291
296
  * to cache its own result.
292
297
  */
293
- getWorkId?: () => Promise<string | null>;
298
+ getAppId?: () => Promise<string | null>;
294
299
  });
295
- private resolveWorkId;
296
- request<T>(message: Record<string, unknown>, options?: WorkRuntimeRequestOptions): Promise<T | null>;
300
+ private resolveAppId;
301
+ request<T>(message: Record<string, unknown>, options?: AppRuntimeRequestOptions): Promise<T | null>;
297
302
  }
298
- declare class WorkRuntimeApi {
303
+ declare class AppRuntimeApi {
299
304
  private token;
300
305
  private readonly transport;
301
306
  private tokenStorageKey;
302
307
  private scopesStorageKey;
303
- private readonly workIdResolver?;
308
+ private readonly appIdResolver?;
304
309
  /** Ensures storage keys are resolved (via slug lookup) at most once. */
305
310
  private storageKeysReady;
306
311
  /** Scopes previously granted via requestAuthorization, retained so token
307
312
  * refreshes can re-authorize (preserving viewerScopes) instead of falling
308
- * back to a base session token that only carries workScopes. */
313
+ * back to a base session token that only carries appScopes. */
309
314
  private authorizedScopes;
310
- constructor(transport?: WorkRuntimeTransport, workId?: string, workIdResolver?: WorkIdResolver);
315
+ constructor(transport?: AppRuntimeTransport, appId?: string, appIdResolver?: AppIdResolver);
311
316
  /**
312
- * Resolves the localStorage keys once the workId is known. When the workId is
317
+ * Resolves the localStorage keys once the appId is known. When the appId is
313
318
  * only available via slug reverse lookup, this performs the lookup on first
314
- * use and then restores any cached token/scopes for that workId.
319
+ * use and then restores any cached token/scopes for that appId.
315
320
  */
316
321
  private ensureStorageKeys;
317
322
  private readStoredToken;
318
323
  private writeStoredToken;
319
324
  private readStoredScopes;
320
325
  private writeStoredScopes;
321
- context(): Promise<WorkRuntimeContext | null>;
326
+ context(): Promise<AppRuntimeContext | null>;
327
+ onContextChanged(listener: AppContextChangedListener): () => void;
322
328
  getAccessToken(options?: {
323
329
  forceRefresh?: boolean;
324
330
  }): Promise<string | null>;
@@ -338,51 +344,53 @@ declare class WorkRuntimeApi {
338
344
  orderId: string;
339
345
  productKey: string;
340
346
  } | null>;
341
- checkoutState(): Promise<WorkRuntimeCheckoutState | null>;
347
+ checkoutState(): Promise<AppRuntimeCheckoutState | null>;
342
348
  }
343
349
  /**
344
- * Configuration for the work runtime mode.
350
+ * Configuration for the app runtime mode.
345
351
  */
346
- type WorkRuntimeModeConfig = {
352
+ type AppRuntimeModeConfig = {
347
353
  /** Explicit mode selection. When omitted, auto-detection is used. */
348
354
  mode?: "bridge" | "broker";
349
355
  /** Cohub origin for the broker page (e.g. "https://cohub.live"). */
350
356
  brokerOrigin?: string;
351
357
  /**
352
- * The work's public id. Required for broker mode unless the slug triple
358
+ * The app's public id. Required for broker mode unless the slug triple
353
359
  * below is supplied, in which case the id is resolved at runtime.
354
360
  */
355
- workId?: string;
356
- /** Space owner's username. Used with {@link spaceSlug} + {@link workSlug} to
357
- * resolve the workId at runtime via the public `works.getBySlug` API. */
361
+ appId?: string;
362
+ /** Space owner's username. Used with {@link spaceSlug} + {@link appSlug} to
363
+ * resolve the appId at runtime via the public `apps.getBySlug` API. */
358
364
  ownerUsername?: string;
359
- /** Space slug. Part of the slug triple used for runtime workId resolution. */
365
+ /** Space slug. Part of the slug triple used for runtime appId resolution. */
360
366
  spaceSlug?: string;
361
- /** Work slug. Part of the slug triple used for runtime workId resolution. */
362
- workSlug?: string;
367
+ /** App slug. Part of the slug triple used for runtime appId resolution. */
368
+ appSlug?: string;
363
369
  };
364
- /** Lazily resolves a work's public id, e.g. via slug reverse lookup. */
365
- type WorkIdResolver = () => Promise<string | null>;
370
+ /** Lazily resolves an app's public id, e.g. via slug reverse lookup. */
371
+ type AppIdResolver = () => Promise<string | null>;
366
372
  /**
367
- * Builds a memoized workId resolver that reverse-looks-up the workId from the
368
- * public slug triple via `GET /api/works/by-slug/:username/:spaceSlug/:workSlug`.
369
- * The endpoint is anonymous (no auth) for public works, so no token is needed.
370
- * The result is cached; a failed lookup is not cached so it can be retried.
373
+ * Builds a memoized appId resolver that reverse-looks-up the appId from the
374
+ * public slug triple via `GET /api/apps/by-slug/:username/:spaceSlug/:appSlug`
375
+ * (the works REST routes are dual-mounted; `/api/works` keeps serving older
376
+ * consumers with identical payloads). The endpoint is
377
+ * anonymous (no auth) for public apps, so no token is needed. The result is
378
+ * cached; a failed lookup is not cached so it can be retried.
371
379
  */
372
- declare function createSlugWorkIdResolver(deps: {
380
+ declare function createSlugAppIdResolver(deps: {
373
381
  apiBaseUrl: string;
374
382
  fetch?: typeof globalThis.fetch;
375
383
  ownerUsername: string;
376
384
  spaceSlug: string;
377
- workSlug: string;
378
- }): WorkIdResolver;
385
+ appSlug: string;
386
+ }): AppIdResolver;
379
387
  /**
380
- * Resolves the appropriate transport based on the work mode configuration.
388
+ * Resolves the appropriate transport based on the app mode configuration.
381
389
  * Auto-detection: inside an iframe → bridge; standalone with broker config →
382
- * broker; otherwise → bridge (returns null for non-work contexts).
390
+ * broker; otherwise → bridge (returns null for non-app contexts).
383
391
  */
384
- declare function resolveWorkTransport(config?: WorkRuntimeModeConfig, workIdResolver?: WorkIdResolver): WorkRuntimeTransport;
385
- declare const createWorkRuntime: (transport?: WorkRuntimeTransport, workId?: string, workIdResolver?: WorkIdResolver) => WorkRuntimeApi;
392
+ declare function resolveAppTransport(config?: AppRuntimeModeConfig, appIdResolver?: AppIdResolver): AppRuntimeTransport;
393
+ declare const createAppRuntime: (transport?: AppRuntimeTransport, appId?: string, appIdResolver?: AppIdResolver) => AppRuntimeApi;
386
394
  //#endregion
387
395
  //#region src/transport.d.ts
388
396
  type Fetch = typeof globalThis.fetch;
@@ -429,8 +437,10 @@ type CohubClientOptions = {
429
437
  fetch?: Fetch;
430
438
  websocket?: WebsocketClientOptions;
431
439
  voice?: VoiceInputCreateOptions;
432
- /** Work runtime mode configuration (bridge vs broker). */
433
- work?: WorkRuntimeModeConfig;
440
+ /** App runtime mode configuration (bridge vs broker). */
441
+ app?: AppRuntimeModeConfig;
442
+ /** @deprecated Use `app`. Kept so existing runtimes keep configuring broker mode. */
443
+ work?: AppRuntimeModeConfig;
434
444
  /** Optional X-Cohub-Source-* headers (static or per-request getter). */
435
445
  requestSource?: RequestSource | null | (() => RequestSource | null | undefined);
436
446
  };
@@ -986,7 +996,7 @@ type SessionSubscriptionHandlers = {
986
996
  event?: (event: WebsocketEventPayload) => void;
987
997
  };
988
998
  type SessionEventName = "created" | "updated" | "turn.created" | "turn.patch" | "turn.lifecycle" | "turn.updated" | "turn.finalized" | "turn.error" | "message.persisted";
989
- type SpaceEventName = SessionEventName | "fs.changed" | "ports.changed" | "presence.updated" | "board.changed" | "board.playback.changed" | "work.version.published" | "task.created" | "task.updated" | "event";
999
+ type SpaceEventName = SessionEventName | "fs.changed" | "ports.changed" | "presence.updated" | "board.changed" | "board.playback.changed" | "app.version.published" | "task.created" | "task.updated" | "event";
990
1000
  declare class SpacesApi {
991
1001
  private readonly transport;
992
1002
  constructor(transport: HttpTransport);
@@ -1702,37 +1712,6 @@ declare class TasksApi {
1702
1712
  }>;
1703
1713
  }
1704
1714
  //#endregion
1705
- //#region src/apis/ui-commands.d.ts
1706
- type CreateUiCommandInput = {
1707
- command: UiCommand;
1708
- commandId?: string;
1709
- targetClientId?: string;
1710
- };
1711
- type WaitForUiCommandOptions = {
1712
- timeoutMs?: number;
1713
- pollIntervalMs?: number;
1714
- signal?: AbortSignal;
1715
- };
1716
- declare class UiCommandsApi {
1717
- private readonly transport;
1718
- constructor(transport: HttpTransport);
1719
- create(input: CreateUiCommandInput): Promise<{
1720
- command: UiCommandRecord;
1721
- }>;
1722
- get(commandId: string): Promise<{
1723
- command: UiCommandRecord;
1724
- }>;
1725
- reportResult(commandId: string, input: {
1726
- status: UiCommandStatus;
1727
- result?: unknown;
1728
- error?: UiCommandError | null;
1729
- }): Promise<{
1730
- command: UiCommandRecord;
1731
- }>;
1732
- run(input: CreateUiCommandInput, options?: WaitForUiCommandOptions): Promise<UiCommandRecord>;
1733
- wait(commandId: string, options?: WaitForUiCommandOptions): Promise<UiCommandRecord>;
1734
- }
1735
- //#endregion
1736
1715
  //#region src/apis/user.d.ts
1737
1716
  declare class UserApi {
1738
1717
  private readonly transport;
@@ -1802,15 +1781,15 @@ declare class ReferralsApi {
1802
1781
  }>;
1803
1782
  }
1804
1783
  //#endregion
1805
- //#region src/apis/works.d.ts
1806
- type WorkTargetType = "file" | "directory" | "port";
1807
- type WorkStatus = "published" | "disabled";
1808
- type WorkVisibility = "public" | "space";
1809
- type WorkPresentationMeta = {
1784
+ //#region src/apis/apps.d.ts
1785
+ type AppTargetType = "file" | "directory" | "port";
1786
+ type AppStatus = "published" | "disabled";
1787
+ type AppVisibility = "public" | "space";
1788
+ type AppPresentationMeta = {
1810
1789
  hideCohubBar?: boolean;
1811
1790
  };
1812
1791
  /** Snapshot of fields extracted from the published page head. */
1813
- type WorkExtractedPageMeta = {
1792
+ type AppExtractedPageMeta = {
1814
1793
  title?: string | null;
1815
1794
  description?: string | null;
1816
1795
  icon?: string | null;
@@ -1821,11 +1800,11 @@ type WorkExtractedPageMeta = {
1821
1800
  extractedAt?: string | null;
1822
1801
  };
1823
1802
  /**
1824
- * Work presentation metadata.
1803
+ * App presentation metadata.
1825
1804
  * `title` / `description` / `icon` / `image` / `lang` / `themeColor`
1826
1805
  * power public page head, share cards, and lists.
1827
1806
  */
1828
- type WorkMeta = Record<string, unknown> & {
1807
+ type AppMeta = Record<string, unknown> & {
1829
1808
  title?: string;
1830
1809
  /** @deprecated Prefer `title`. Kept for older clients. */
1831
1810
  name?: string;
@@ -1836,68 +1815,68 @@ type WorkMeta = Record<string, unknown> & {
1836
1815
  lang?: string;
1837
1816
  /** CSS color from meta theme-color. */
1838
1817
  themeColor?: string;
1839
- presentation?: WorkPresentationMeta;
1840
- extracted?: WorkExtractedPageMeta;
1818
+ presentation?: AppPresentationMeta;
1819
+ extracted?: AppExtractedPageMeta;
1841
1820
  source?: RequestSource;
1842
1821
  };
1843
- type WorkRecord = {
1822
+ type AppRecord = {
1844
1823
  id: string;
1845
1824
  spaceId: string;
1846
1825
  userUuid: string;
1847
1826
  slug: string;
1848
- status: WorkStatus;
1849
- visibility: WorkVisibility;
1850
- targetType: WorkTargetType;
1827
+ status: AppStatus;
1828
+ visibility: AppVisibility;
1829
+ targetType: AppTargetType;
1851
1830
  targetRef: string;
1852
1831
  assetKey: string | null;
1853
1832
  currentVersionId: string | null;
1854
1833
  latestVersion: number;
1855
1834
  publishedAt: string | null;
1856
- workScopes: Permission[];
1835
+ appScopes: Permission[];
1857
1836
  allowedViewerScopes: Permission[];
1858
- meta: WorkMeta | null;
1837
+ meta: AppMeta | null;
1859
1838
  createdAt: string | null;
1860
1839
  updatedAt: string | null;
1861
1840
  };
1862
- type WorkCreateInput = {
1841
+ type AppCreateInput = {
1863
1842
  spaceId: string;
1864
1843
  slug: string;
1865
- status?: WorkStatus;
1866
- visibility?: WorkVisibility;
1867
- targetType: WorkTargetType;
1844
+ status?: AppStatus;
1845
+ visibility?: AppVisibility;
1846
+ targetType: AppTargetType;
1868
1847
  targetRef: string;
1869
1848
  assetKey?: string | null;
1870
- workScopes?: Permission[];
1849
+ appScopes?: Permission[];
1871
1850
  allowedViewerScopes?: Permission[];
1872
- meta?: WorkMeta | null;
1851
+ meta?: AppMeta | null;
1873
1852
  };
1874
- type WorkUpdateInput = Partial<{
1853
+ type AppUpdateInput = Partial<{
1875
1854
  slug: string;
1876
- status: WorkStatus;
1877
- visibility: WorkVisibility;
1878
- targetType: WorkTargetType;
1855
+ status: AppStatus;
1856
+ visibility: AppVisibility;
1857
+ targetType: AppTargetType;
1879
1858
  targetRef: string;
1880
- workScopes: Permission[];
1859
+ appScopes: Permission[];
1881
1860
  allowedViewerScopes: Permission[];
1882
- meta: WorkMeta | null;
1861
+ meta: AppMeta | null;
1883
1862
  }>;
1884
- type WorkVersionRecord = {
1863
+ type AppVersionRecord = {
1885
1864
  id: string;
1886
- workId: string;
1865
+ appId: string;
1887
1866
  version: number;
1888
- targetType: WorkTargetType;
1867
+ targetType: AppTargetType;
1889
1868
  targetRef: string;
1890
1869
  assetKey: string | null;
1891
- contentKind: WorkContentKind;
1892
- artifact: WorkArtifactDescriptor | null;
1893
- meta: WorkMeta | null;
1870
+ contentKind: AppContentKind;
1871
+ artifact: AppArtifactDescriptor | null;
1872
+ meta: AppMeta | null;
1894
1873
  createdAt: string | null;
1895
1874
  };
1896
- type WorkContentDownload = {
1875
+ type AppContentDownload = {
1897
1876
  manifestUrl: string;
1898
1877
  manifestSha256: string;
1899
1878
  };
1900
- type WorkContent = {
1879
+ type AppContent = {
1901
1880
  kind: "port";
1902
1881
  url: string;
1903
1882
  targetType: "port";
@@ -1917,7 +1896,7 @@ type WorkContent = {
1917
1896
  sizeBytes: number;
1918
1897
  sha256: string;
1919
1898
  }) & {
1920
- download?: WorkContentDownload;
1899
+ download?: AppContentDownload;
1921
1900
  }) | {
1922
1901
  kind: "board";
1923
1902
  url: string;
@@ -1926,30 +1905,30 @@ type WorkContent = {
1926
1905
  boardId: string;
1927
1906
  boardVersion: number;
1928
1907
  };
1929
- type WorkPublicSpaceRecord = {
1908
+ type AppPublicSpaceRecord = {
1930
1909
  id: string;
1931
1910
  slug: string;
1932
1911
  name: string | null;
1933
1912
  userUuid: string;
1934
1913
  publicProfile?: SpacePublicProfile | null;
1935
1914
  };
1936
- type WorkPublicOwnerRecord = {
1915
+ type AppPublicOwnerRecord = {
1937
1916
  userUuid: string;
1938
1917
  username: string;
1939
1918
  displayName: string;
1940
1919
  avatarUrl?: string | null;
1941
1920
  };
1942
- type WorkDetailResponse = {
1943
- work: WorkRecord;
1944
- space: WorkPublicSpaceRecord;
1945
- owner: WorkPublicOwnerRecord;
1921
+ type AppDetailResponse = {
1922
+ app: AppRecord;
1923
+ space: AppPublicSpaceRecord;
1924
+ owner: AppPublicOwnerRecord;
1946
1925
  publicUrl: string | null;
1947
- content: WorkContent | null;
1926
+ content: AppContent | null;
1948
1927
  };
1949
- type WorkGetResponse = WorkDetailResponse;
1950
- type WorkResolveResponse = WorkDetailResponse;
1951
- type WorkViewSource = "web" | "cli" | "api";
1952
- type WorkViewStatsResponse = {
1928
+ type AppGetResponse = AppDetailResponse;
1929
+ type AppResolveResponse = AppDetailResponse;
1930
+ type AppViewSource = "web" | "cli" | "api";
1931
+ type AppViewStatsResponse = {
1953
1932
  summary: {
1954
1933
  totalViews: number;
1955
1934
  views24h: number;
@@ -1961,31 +1940,31 @@ type WorkViewStatsResponse = {
1961
1940
  views: number;
1962
1941
  }>;
1963
1942
  sources: Array<{
1964
- source: WorkViewSource;
1943
+ source: AppViewSource;
1965
1944
  views: number;
1966
1945
  }>;
1967
1946
  };
1968
- type WorkPromotionProvider = "generic" | "meta";
1969
- type WorkPromotionRecord = {
1947
+ type AppPromotionProvider = "generic" | "meta";
1948
+ type AppPromotionRecord = {
1970
1949
  id: string;
1971
- workId: string;
1950
+ appId: string;
1972
1951
  name: string;
1973
- provider: WorkPromotionProvider | string;
1952
+ provider: AppPromotionProvider | string;
1974
1953
  parameters: Record<string, string>;
1975
1954
  createdBy: string;
1976
1955
  createdAt: string;
1977
1956
  };
1978
- type WorkPromotionProviderStatus = {
1979
- key: WorkPromotionProvider | string;
1957
+ type AppPromotionProviderStatus = {
1958
+ key: AppPromotionProvider | string;
1980
1959
  configured: boolean;
1981
1960
  };
1982
- type WorkPromotionCreateInput = {
1961
+ type AppPromotionCreateInput = {
1983
1962
  name: string;
1984
- provider: WorkPromotionProvider | string;
1963
+ provider: AppPromotionProvider | string;
1985
1964
  parameters: Record<string, string>;
1986
1965
  };
1987
- type WorkPromotionStatsResponse = {
1988
- promotion: WorkPromotionRecord;
1966
+ type AppPromotionStatsResponse = {
1967
+ promotion: AppPromotionRecord;
1989
1968
  summary: {
1990
1969
  landing: number;
1991
1970
  ready: number;
@@ -2003,7 +1982,7 @@ type WorkPromotionStatsResponse = {
2003
1982
  checkoutStarted: number;
2004
1983
  }>;
2005
1984
  };
2006
- type WorkPromotionEventResponse = {
1985
+ type AppPromotionEventResponse = {
2007
1986
  ok: true;
2008
1987
  eventId: string;
2009
1988
  browser: {
@@ -2013,12 +1992,12 @@ type WorkPromotionEventResponse = {
2013
1992
  pixelId: string;
2014
1993
  } | null;
2015
1994
  };
2016
- type WorkSessionResponse = {
1995
+ type AppSessionResponse = {
2017
1996
  token: string;
2018
1997
  expiresIn: number;
2019
- work: WorkRecord;
1998
+ app: AppRecord;
2020
1999
  };
2021
- type WorkAuthorizeResponse = {
2000
+ type AppAuthorizeResponse = {
2022
2001
  token: string;
2023
2002
  expiresIn: number;
2024
2003
  grant: {
@@ -2027,99 +2006,198 @@ type WorkAuthorizeResponse = {
2027
2006
  expiresAt: string;
2028
2007
  };
2029
2008
  };
2030
- declare class WorksApi {
2009
+ declare class AppsApi {
2031
2010
  private readonly transport;
2032
2011
  constructor(transport: HttpTransport);
2033
2012
  listBySpace(spaceId: string): Promise<{
2034
- works: WorkRecord[];
2013
+ apps: AppRecord[];
2035
2014
  }>;
2036
- get(id: string): Promise<WorkDetailResponse>;
2015
+ get(id: string): Promise<AppDetailResponse>;
2037
2016
  /**
2038
- * Loads a published work's metadata + owner info by id (public access model).
2039
- * Used by the standalone work auth broker page.
2017
+ * Loads a published app's metadata + owner info by id (public access model).
2018
+ * Used by the standalone app auth broker page.
2040
2019
  */
2041
- getPublicById(id: string): Promise<WorkDetailResponse>;
2042
- getBySlug(username: string, spaceSlug: string, workSlug: string, options?: {
2020
+ getPublicById(id: string): Promise<AppDetailResponse>;
2021
+ getBySlug(username: string, spaceSlug: string, appSlug: string, options?: {
2043
2022
  signal?: AbortSignal;
2044
- }): Promise<WorkDetailResponse>;
2045
- create(input: WorkCreateInput): Promise<{
2046
- work: WorkRecord;
2023
+ }): Promise<AppDetailResponse>;
2024
+ create(input: AppCreateInput): Promise<{
2025
+ app: AppRecord;
2047
2026
  }>;
2048
- update(id: string, input: WorkUpdateInput): Promise<{
2049
- work: WorkRecord;
2027
+ update(id: string, input: AppUpdateInput): Promise<{
2028
+ app: AppRecord;
2050
2029
  }>;
2051
2030
  delete(id: string): Promise<{
2052
2031
  ok: true;
2053
2032
  }>;
2054
- getStats(workId: string): Promise<WorkViewStatsResponse>;
2055
- listPromotions(workId: string): Promise<{
2056
- promotions: WorkPromotionRecord[];
2057
- providers: WorkPromotionProviderStatus[];
2033
+ getStats(appId: string): Promise<AppViewStatsResponse>;
2034
+ listPromotions(appId: string): Promise<{
2035
+ promotions: AppPromotionRecord[];
2036
+ providers: AppPromotionProviderStatus[];
2058
2037
  }>;
2059
- createPromotion(workId: string, input: WorkPromotionCreateInput): Promise<{
2060
- promotion: WorkPromotionRecord;
2038
+ createPromotion(appId: string, input: AppPromotionCreateInput): Promise<{
2039
+ promotion: AppPromotionRecord;
2061
2040
  }>;
2062
- getPromotionStats(workId: string, promotionId: string): Promise<WorkPromotionStatsResponse>;
2063
- recordPromotionEvent(workId: string, promotionId: string, input: {
2064
- eventKey: WorkPromotionEventKey;
2041
+ getPromotionStats(appId: string, promotionId: string): Promise<AppPromotionStatsResponse>;
2042
+ recordPromotionEvent(appId: string, promotionId: string, input: {
2043
+ eventKey: AppPromotionEventKey;
2065
2044
  eventId?: string;
2066
2045
  sourceUrl?: string;
2067
2046
  fbp?: string;
2068
2047
  fbc?: string;
2069
2048
  productKey?: string;
2070
- }): Promise<WorkPromotionEventResponse>;
2071
- recordPromotionRegistration(workId: string, promotionId: string, input?: {
2049
+ }): Promise<AppPromotionEventResponse>;
2050
+ recordPromotionRegistration(appId: string, promotionId: string, input?: {
2072
2051
  sourceUrl?: string;
2073
2052
  fbp?: string;
2074
2053
  fbc?: string;
2075
2054
  }): Promise<{
2076
2055
  reported: boolean;
2077
2056
  eventId: string | null;
2078
- browser: WorkPromotionEventResponse["browser"];
2057
+ browser: AppPromotionEventResponse["browser"];
2079
2058
  }>;
2080
- listVersions(workId: string): Promise<{
2081
- versions: WorkVersionRecord[];
2059
+ listVersions(appId: string): Promise<{
2060
+ versions: AppVersionRecord[];
2082
2061
  }>;
2083
- publishVersion(workId: string, input?: {
2084
- meta?: WorkMeta | null;
2062
+ publishVersion(appId: string, input?: {
2063
+ meta?: AppMeta | null;
2085
2064
  }): Promise<{
2086
- work: WorkRecord;
2087
- version: WorkVersionRecord;
2065
+ app: AppRecord;
2066
+ version: AppVersionRecord;
2088
2067
  }>;
2089
- createSession(workId: string): Promise<WorkSessionResponse>;
2090
- authorize(workId: string, input: {
2068
+ createSession(appId: string): Promise<AppSessionResponse>;
2069
+ authorize(appId: string, input: {
2091
2070
  scopes: Permission[];
2092
2071
  reason?: string;
2093
- }): Promise<WorkAuthorizeResponse>;
2072
+ }): Promise<AppAuthorizeResponse>;
2073
+ }
2074
+ /** @deprecated Use `AppTargetType`. */
2075
+ type WorkTargetType = AppTargetType;
2076
+ /** @deprecated Use `AppStatus`. */
2077
+ type WorkStatus = AppStatus;
2078
+ /** @deprecated Use `AppVisibility`. */
2079
+ type WorkVisibility = AppVisibility;
2080
+ /** @deprecated Use `AppPresentationMeta`. */
2081
+ type WorkPresentationMeta = AppPresentationMeta;
2082
+ /** @deprecated Use `AppExtractedPageMeta`. */
2083
+ type WorkExtractedPageMeta = AppExtractedPageMeta;
2084
+ /** @deprecated Use `AppMeta`. */
2085
+ type WorkMeta = AppMeta;
2086
+ /** @deprecated Use `AppRecord`. */
2087
+ type WorkRecord = AppRecord;
2088
+ /** @deprecated Use `AppCreateInput`. */
2089
+ type WorkCreateInput = AppCreateInput;
2090
+ /** @deprecated Use `AppUpdateInput`. */
2091
+ type WorkUpdateInput = AppUpdateInput;
2092
+ /** @deprecated Use `AppVersionRecord`. */
2093
+ type WorkVersionRecord = AppVersionRecord;
2094
+ /** @deprecated Use `AppContentDownload`. */
2095
+ type WorkContentDownload = AppContentDownload;
2096
+ /** @deprecated Use `AppContent`. */
2097
+ type WorkContent = AppContent;
2098
+ /** @deprecated Use `AppPublicSpaceRecord`. */
2099
+ type WorkPublicSpaceRecord = AppPublicSpaceRecord;
2100
+ /** @deprecated Use `AppPublicOwnerRecord`. */
2101
+ type WorkPublicOwnerRecord = AppPublicOwnerRecord;
2102
+ /** @deprecated Use `AppDetailResponse`. */
2103
+ type WorkDetailResponse = AppDetailResponse;
2104
+ /** @deprecated Use `AppGetResponse`. */
2105
+ type WorkGetResponse = AppGetResponse;
2106
+ /** @deprecated Use `AppResolveResponse`. */
2107
+ type WorkResolveResponse = AppResolveResponse;
2108
+ /** @deprecated Use `AppViewSource`. */
2109
+ type WorkViewSource = AppViewSource;
2110
+ /** @deprecated Use `AppViewStatsResponse`. */
2111
+ type WorkViewStatsResponse = AppViewStatsResponse;
2112
+ /** @deprecated Use `AppPromotionProvider`. */
2113
+ type WorkPromotionProvider = AppPromotionProvider;
2114
+ /** @deprecated Use `AppPromotionRecord`. */
2115
+ type WorkPromotionRecord = AppPromotionRecord;
2116
+ /** @deprecated Use `AppPromotionProviderStatus`. */
2117
+ type WorkPromotionProviderStatus = AppPromotionProviderStatus;
2118
+ /** @deprecated Use `AppPromotionCreateInput`. */
2119
+ type WorkPromotionCreateInput = AppPromotionCreateInput;
2120
+ /** @deprecated Use `AppPromotionStatsResponse`. */
2121
+ type WorkPromotionStatsResponse = AppPromotionStatsResponse;
2122
+ /** @deprecated Use `AppPromotionEventResponse`. */
2123
+ type WorkPromotionEventResponse = AppPromotionEventResponse;
2124
+ /** @deprecated Use `AppSessionResponse`. */
2125
+ type WorkSessionResponse = AppSessionResponse;
2126
+ /** @deprecated Use `AppAuthorizeResponse`. */
2127
+ type WorkAuthorizeResponse = AppAuthorizeResponse;
2128
+ //#endregion
2129
+ //#region src/apis/desktop-commands.d.ts
2130
+ /** @deprecated Use `DesktopCommand`. */
2131
+ type UiCommand = DesktopCommand;
2132
+ /** @deprecated Use `DesktopCommandError`. */
2133
+ type UiCommandError = DesktopCommandError;
2134
+ /** @deprecated Use `DesktopCommandRecord`. */
2135
+ type UiCommandRecord = DesktopCommandRecord;
2136
+ /** @deprecated Use `DesktopCommandStatus`. */
2137
+ type UiCommandStatus = DesktopCommandStatus;
2138
+ type CreateDesktopCommandInput = {
2139
+ command: DesktopCommand;
2140
+ commandId?: string;
2141
+ targetClientId?: string;
2142
+ };
2143
+ type WaitForDesktopCommandOptions = {
2144
+ timeoutMs?: number;
2145
+ pollIntervalMs?: number;
2146
+ signal?: AbortSignal;
2147
+ };
2148
+ /** @deprecated Use `CreateDesktopCommandInput`. */
2149
+ type CreateUiCommandInput = CreateDesktopCommandInput;
2150
+ /** @deprecated Use `WaitForDesktopCommandOptions`. */
2151
+ type WaitForUiCommandOptions = WaitForDesktopCommandOptions;
2152
+ declare class DesktopCommandsApi {
2153
+ private readonly transport;
2154
+ constructor(transport: HttpTransport);
2155
+ create(input: CreateDesktopCommandInput): Promise<{
2156
+ command: DesktopCommandRecord;
2157
+ }>;
2158
+ get(commandId: string): Promise<{
2159
+ command: DesktopCommandRecord;
2160
+ }>;
2161
+ reportResult(commandId: string, input: {
2162
+ status: DesktopCommandStatus;
2163
+ result?: unknown;
2164
+ error?: DesktopCommandError | null;
2165
+ }): Promise<{
2166
+ command: DesktopCommandRecord;
2167
+ }>;
2168
+ run(input: CreateDesktopCommandInput, options?: WaitForDesktopCommandOptions): Promise<DesktopCommandRecord>;
2169
+ wait(commandId: string, options?: WaitForDesktopCommandOptions): Promise<DesktopCommandRecord>;
2094
2170
  }
2171
+ /** @deprecated Use `DesktopCommandsApi`. */
2172
+ declare class UiCommandsApi extends DesktopCommandsApi {}
2095
2173
  //#endregion
2096
- //#region src/apis/work-commerce.d.ts
2097
- type WorkCommerceEntitlement = {
2174
+ //#region src/apis/app-commerce.d.ts
2175
+ type AppCommerceEntitlement = {
2098
2176
  benefitKey: string;
2099
2177
  enabled: boolean;
2100
2178
  metadata: Record<string, string | number | boolean>;
2101
2179
  };
2102
- type WorkCommerceEntitlementsResponse = {
2103
- entitlements: WorkCommerceEntitlement[];
2180
+ type AppCommerceEntitlementsResponse = {
2181
+ entitlements: AppCommerceEntitlement[];
2104
2182
  credits: {
2105
2183
  available: number;
2106
2184
  net: number;
2107
2185
  };
2108
2186
  businessKey: string;
2109
2187
  };
2110
- type WorkCommerceCheckoutStatus = "success" | "failed" | "cancel" | null;
2111
- type WorkCommerceProductResolveResponse = {
2188
+ type AppCommerceCheckoutStatus = "success" | "failed" | "cancel" | null;
2189
+ type AppCommerceProductResolveResponse = {
2112
2190
  products: SpaceCommerceProduct[];
2113
2191
  };
2114
- type WorkCommerceCreditConsumeStatus = "consumed" | "insufficient" | "disabled";
2115
- type WorkCommerceCreditConsumeResponse = {
2116
- status: WorkCommerceCreditConsumeStatus;
2192
+ type AppCommerceCreditConsumeStatus = "consumed" | "insufficient" | "disabled";
2193
+ type AppCommerceCreditConsumeResponse = {
2194
+ status: AppCommerceCreditConsumeStatus;
2117
2195
  amount: number;
2118
2196
  remaining: number;
2119
2197
  shortfall: number | null;
2120
2198
  businessKey: string;
2121
2199
  };
2122
- type WorkCommercePurchaseResponse = {
2200
+ type AppCommercePurchaseResponse = {
2123
2201
  checkout: {
2124
2202
  providerKey: string | null;
2125
2203
  checkoutUrl: string | null;
@@ -2132,7 +2210,7 @@ type WorkCommercePurchaseResponse = {
2132
2210
  currency: string | null;
2133
2211
  };
2134
2212
  };
2135
- type WorkCommerceOrder = {
2213
+ type AppCommerceOrder = {
2136
2214
  id: string;
2137
2215
  productKeySnapshot: string;
2138
2216
  productNameSnapshot: string;
@@ -2143,25 +2221,43 @@ type WorkCommerceOrder = {
2143
2221
  paidAt: string | null;
2144
2222
  buyerProfile: SpaceCommerceBuyerProfile | null;
2145
2223
  };
2146
- declare class WorkCommerceApi {
2224
+ declare class AppCommerceApi {
2147
2225
  private readonly transport;
2148
2226
  constructor(transport: HttpTransport);
2149
- resolveProducts(workId: string, input: {
2227
+ resolveProducts(appId: string, input: {
2150
2228
  productKeys: string[];
2151
- }): Promise<WorkCommerceProductResolveResponse>;
2152
- getEntitlements(workId: string): Promise<WorkCommerceEntitlementsResponse>;
2153
- consumeCredits(workId: string, input: {
2229
+ }): Promise<AppCommerceProductResolveResponse>;
2230
+ getEntitlements(appId: string): Promise<AppCommerceEntitlementsResponse>;
2231
+ consumeCredits(appId: string, input: {
2154
2232
  amount: number;
2155
2233
  operationId: string;
2156
2234
  reason?: string;
2157
- }): Promise<WorkCommerceCreditConsumeResponse>;
2158
- purchase(workId: string, input: {
2235
+ }): Promise<AppCommerceCreditConsumeResponse>;
2236
+ purchase(appId: string, input: {
2159
2237
  productKey: string;
2160
- }): Promise<WorkCommercePurchaseResponse>;
2161
- getOrder(workId: string, orderId: string): Promise<{
2162
- order: WorkCommerceOrder;
2238
+ }): Promise<AppCommercePurchaseResponse>;
2239
+ getOrder(appId: string, orderId: string): Promise<{
2240
+ order: AppCommerceOrder;
2163
2241
  }>;
2164
2242
  }
2243
+ /** @deprecated Use `AppCommerceEntitlement`. */
2244
+ type WorkCommerceEntitlement = AppCommerceEntitlement;
2245
+ /** @deprecated Use `AppCommerceEntitlementsResponse`. */
2246
+ type WorkCommerceEntitlementsResponse = AppCommerceEntitlementsResponse;
2247
+ /** @deprecated Use `AppCommerceCheckoutStatus`. */
2248
+ type WorkCommerceCheckoutStatus = AppCommerceCheckoutStatus;
2249
+ /** @deprecated Use `AppCommerceProductResolveResponse`. */
2250
+ type WorkCommerceProductResolveResponse = AppCommerceProductResolveResponse;
2251
+ /** @deprecated Use `AppCommerceCreditConsumeStatus`. */
2252
+ type WorkCommerceCreditConsumeStatus = AppCommerceCreditConsumeStatus;
2253
+ /** @deprecated Use `AppCommerceCreditConsumeResponse`. */
2254
+ type WorkCommerceCreditConsumeResponse = AppCommerceCreditConsumeResponse;
2255
+ /** @deprecated Use `AppCommercePurchaseResponse`. */
2256
+ type WorkCommercePurchaseResponse = AppCommercePurchaseResponse;
2257
+ /** @deprecated Use `AppCommerceApi`. */
2258
+ declare class WorkCommerceApi extends AppCommerceApi {}
2259
+ /** @deprecated Use `AppCommerceOrder`. */
2260
+ type WorkCommerceOrder = AppCommerceOrder;
2165
2261
  //#endregion
2166
2262
  //#region src/http.d.ts
2167
2263
  declare class CohubHttpClient {
@@ -2181,13 +2277,19 @@ declare class CohubHttpClient {
2181
2277
  readonly cronJobs: CronJobsApi;
2182
2278
  readonly invite: PublicInviteApi;
2183
2279
  readonly referrals: ReferralsApi;
2184
- readonly works: WorksApi;
2185
- readonly workCommerce: WorkCommerceApi;
2186
- readonly ui: UiCommandsApi;
2280
+ readonly apps: AppsApi;
2281
+ readonly appCommerce: AppCommerceApi;
2282
+ /** @deprecated Use `apps`. */
2283
+ get works(): AppsApi;
2284
+ /** @deprecated Use `appCommerce`. */
2285
+ get workCommerce(): AppCommerceApi;
2286
+ readonly desktop: DesktopCommandsApi;
2287
+ /** @deprecated Use `desktop`. */
2288
+ get ui(): DesktopCommandsApi;
2187
2289
  private readonly transport;
2188
2290
  constructor(options?: CohubClientOptions);
2189
2291
  space(spaceId: string): SpaceClient;
2190
2292
  }
2191
2293
  declare const createHttpClient: (options?: CohubClientOptions) => CohubHttpClient;
2192
2294
  //#endregion
2193
- export { SessionEventName as $, ChannelsApi as $t, WorkResolveResponse as A, PublicFileUrlResponse as An, SessionPatchReducer as At, ReferralsApi as B, PublicAssetMimeType as Bt, WorkPromotionProvider as C, resolveWorkTransport as Cn, GenerationStreamSubscriptionHandlers as Ct, WorkPublicOwnerRecord as D, PublicFileListResponse as Dn, parseAssistantMessageCommit as Dt, WorkPromotionStatsResponse as E, PublicFileListEntry as En, createSessionGenerationStreamClient as Et, WorkVersionRecord as F, GenerationUsageBilling as Fn, ReferenceResourceSelector as Ft, WaitForUiCommandOptions as G, UploadChatAttachmentInput as Gt, UserApi as H, PublicAssetUploadProgress as Ht, WorkViewSource as I, ListGenerationModelsResponse as In, ReferencesApi as It, BoardChangedEvent as J, SkillsApi as Jt, TasksApi as K, UploadChatImageAttachmentInput as Kt, WorkViewStatsResponse as L, PublicGenerationDeclaration as Ln, SearchApi as Lt, WorkStatus as M, CreateGenerationTaskRequest as Mn, SessionPatchStatus as Mt, WorkTargetType as N, CreateGenerationTaskResponse as Nn, createSessionPatchReducer as Nt, WorkPublicSpaceRecord as O, PublicFileUploadEntryInput as On, SessionPatchApplyInput as Ot, WorkUpdateInput as P, GenerationTaskResult as Pn, SessionAccessApi as Pt, BoardSubscriptionHandlers as Q, CronJobsApi as Qt, WorkVisibility as R, ModelStatusEntry as Rn, CreatePublicAssetUploadInput as Rt, WorkPromotionEventResponse as S, createWorkRuntime as Sn, GenerationStreamSubscribeOptions as St, WorkPromotionRecord as T, PublicFileCreateUploadResponse as Tn, SessionGenerationStreamClient as Tt, CreateUiCommandInput as U, PublicAssetUploadProtocol as Ut, UsersApi as V, PublicAssetPurpose as Vt, UiCommandsApi as W, PublicAssetsApi as Wt, BoardEventName as X, ModelsApi as Xt, BoardClient as Y, PromptsApi as Yt, BoardPlaybackChangedEvent as Z, GenerationsApi as Zt, WorkExtractedPageMeta as _, WorkRuntimeInvocationContext as _n, GenerationStreamFinalizedEvent as _t, WorkCommerceCreditConsumeResponse as a, RawHttpResponse as an, SpaceTurnListOptions as at, WorkPresentationMeta as b, WorkRuntimeTransport as bn, GenerationStreamOutOfSyncEvent as bt, WorkCommerceEntitlementsResponse as c, matchesUnauthorizedErrorToken as cn, BuildSpaceInvitePathInput as ct, WorkCommercePurchaseResponse as d, PopupBrokerTransport as dn, buildSpaceInvitePath as dt, CohubClientOptions as en, SessionSubscriptionHandlers as et, WorkAuthorizeResponse as f, WorkIdResolver as fn, buildSpacePath as ft, WorkDetailResponse as g, WorkRuntimeContext as gn, GenerationStreamEvent as gt, WorkCreateInput as h, WorkRuntimeCheckoutStatus as hn, GenerationStreamErrorEvent as ht, WorkCommerceCheckoutStatus as i, HttpTransport as in, SpacePublicFilesApi as it, WorkSessionResponse as j, SpaceStartupResponse as jn, SessionPatchState as jt, WorkRecord as k, PublicFileUploadPlanEntry as kn, SessionPatchApplyResult as kt, WorkCommerceOrder as l, sanitizeAccessToken as ln, BuildSpacePathInput as lt, WorkContentDownload as m, WorkRuntimeCheckoutState as mn, GenerationStreamCommitEvent as mt, createHttpClient as n, HttpError as nn, SpaceClient as nt, WorkCommerceCreditConsumeStatus as o, UnauthorizedContext as on, SpacesApi as ot, WorkContent as p, WorkRuntimeApi as pn, AssistantMessageCommit as pt, BoardAwarenessUpdatedEvent as q, UploadPublicAssetInput as qt, WorkCommerceApi as r, HttpTraceContext as rn, SpaceEventName as rt, WorkCommerceEntitlement as s, joinApiUrl as sn, WebSocketConnectionState as st, CohubHttpClient as t, Fetch as tn, SpaceChannelBindingRecord as tt, WorkCommerceProductResolveResponse as u, ParentBridgeTransport as un, PublicInviteApi as ut, WorkGetResponse as v, WorkRuntimeModeConfig as vn, GenerationStreamIntermediateMessage as vt, WorkPromotionProviderStatus as w, PublicFileCreateUploadInput as wn, GenerationStreamTurnUpdatedEvent as wt, WorkPromotionCreateInput as x, createSlugWorkIdResolver as xn, GenerationStreamStateEvent as xt, WorkMeta as y, WorkRuntimeRequestOptions as yn, GenerationStreamLifecycleEvent as yt, WorksApi as z, ModelStatusResponse as zn, CreatePublicAssetUploadResponse as zt };
2295
+ export { AppUpdateInput as $, AppContextChangedListener as $n, PublicInviteApi as $t, WaitForUiCommandOptions as A, PublicAssetPurpose as An, WorkViewStatsResponse as At, AppPromotionCreateInput as B, GenerationsApi as Bn, BoardPlaybackChangedEvent as Bt, DesktopCommandsApi as C, SessionAccessApi as Cn, CreateGenerationTaskResponse as Cr, WorkResolveResponse as Ct, UiCommandStatus as D, CreatePublicAssetUploadInput as Dn, PublicGenerationDeclaration as Dr, WorkUpdateInput as Dt, UiCommandRecord as E, SearchApi as En, ListGenerationModelsResponse as Er, WorkTargetType as Et, AppDetailResponse as F, UploadChatImageAttachmentInput as Fn, TasksApi as Ft, AppPromotionStatsResponse as G, HttpError as Gn, SpaceClient as Gt, AppPromotionProvider as H, ChannelsApi as Hn, SessionEventName as Ht, AppExtractedPageMeta as I, UploadPublicAssetInput as In, BoardAwarenessUpdatedEvent as It, AppRecord as J, RawHttpResponse as Jn, SpaceTurnListOptions as Jt, AppPublicOwnerRecord as K, HttpTraceContext as Kn, SpaceEventName as Kt, AppGetResponse as L, SkillsApi as Ln, BoardChangedEvent as Lt, AppContent as M, PublicAssetUploadProtocol as Mn, ReferralsApi as Mt, AppContentDownload as N, PublicAssetsApi as Nn, UsersApi as Nt, UiCommandsApi as O, CreatePublicAssetUploadResponse as On, ModelStatusEntry as Or, WorkVersionRecord as Ot, AppCreateInput as P, UploadChatAttachmentInput as Pn, UserApi as Pt, AppTargetType as Q, sanitizeAccessToken as Qn, BuildSpacePathInput as Qt, AppMeta as R, PromptsApi as Rn, BoardClient as Rt, CreateUiCommandInput as S, createSessionPatchReducer as Sn, CreateGenerationTaskRequest as Sr, WorkRecord as St, UiCommandError as T, ReferencesApi as Tn, GenerationUsageBilling as Tr, WorkStatus as Tt, AppPromotionProviderStatus as U, CohubClientOptions as Un, SessionSubscriptionHandlers as Ut, AppPromotionEventResponse as V, CronJobsApi as Vn, BoardSubscriptionHandlers as Vt, AppPromotionRecord as W, Fetch as Wn, SpaceChannelBindingRecord as Wt, AppSessionResponse as X, joinApiUrl as Xn, WebSocketConnectionState as Xt, AppResolveResponse as Y, UnauthorizedContext as Yn, SpacesApi as Yt, AppStatus as Z, matchesUnauthorizedErrorToken as Zn, BuildSpaceInvitePathInput as Zt, WorkCommerceEntitlementsResponse as _, SessionPatchApplyInput as _n, PublicFileListResponse as _r, WorkPromotionProviderStatus as _t, AppCommerceCreditConsumeResponse as a, GenerationStreamEvent as an, AppRuntimeInvocationContext as ar, WorkAuthorizeResponse as at, WorkCommercePurchaseResponse as b, SessionPatchState as bn, PublicFileUrlResponse as br, WorkPublicOwnerRecord as bt, AppCommerceEntitlementsResponse as c, GenerationStreamLifecycleEvent as cn, AppRuntimeTransport as cr, WorkCreateInput as ct, AppCommercePurchaseResponse as d, GenerationStreamSubscribeOptions as dn, createAppRuntime as dr, WorkGetResponse as dt, buildSpaceInvitePath as en, AppIdResolver as er, AppVersionRecord as et, WorkCommerceApi as f, GenerationStreamSubscriptionHandlers as fn, createSlugAppIdResolver as fr, WorkMeta as ft, WorkCommerceEntitlement as g, parseAssistantMessageCommit as gn, PublicFileListEntry as gr, WorkPromotionProvider as gt, WorkCommerceCreditConsumeStatus as h, createSessionGenerationStreamClient as hn, PublicFileCreateUploadResponse as hr, WorkPromotionEventResponse as ht, AppCommerceCheckoutStatus as i, GenerationStreamErrorEvent as in, AppRuntimeContext as ir, AppsApi as it, AppAuthorizeResponse as j, PublicAssetUploadProgress as jn, WorkVisibility as jt, WaitForDesktopCommandOptions as k, PublicAssetMimeType as kn, ModelStatusResponse as kr, WorkViewSource as kt, AppCommerceOrder as l, GenerationStreamOutOfSyncEvent as ln, ParentBridgeTransport as lr, WorkDetailResponse as lt, WorkCommerceCreditConsumeResponse as m, SessionGenerationStreamClient as mn, PublicFileCreateUploadInput as mr, WorkPromotionCreateInput as mt, createHttpClient as n, AssistantMessageCommit as nn, AppRuntimeCheckoutState as nr, AppViewStatsResponse as nt, AppCommerceCreditConsumeStatus as o, GenerationStreamFinalizedEvent as on, AppRuntimeModeConfig as or, WorkContent as ot, WorkCommerceCheckoutStatus as p, GenerationStreamTurnUpdatedEvent as pn, resolveAppTransport as pr, WorkPresentationMeta as pt, AppPublicSpaceRecord as q, HttpTransport as qn, SpacePublicFilesApi as qt, AppCommerceApi as r, GenerationStreamCommitEvent as rn, AppRuntimeCheckoutStatus as rr, AppVisibility as rt, AppCommerceEntitlement as s, GenerationStreamIntermediateMessage as sn, AppRuntimeRequestOptions as sr, WorkContentDownload as st, CohubHttpClient as t, buildSpacePath as tn, AppRuntimeApi as tr, AppViewSource as tt, AppCommerceProductResolveResponse as u, GenerationStreamStateEvent as un, PopupBrokerTransport as ur, WorkExtractedPageMeta as ut, WorkCommerceOrder as v, SessionPatchApplyResult as vn, PublicFileUploadEntryInput as vr, WorkPromotionRecord as vt, UiCommand as w, ReferenceResourceSelector as wn, GenerationTaskResult as wr, WorkSessionResponse as wt, CreateDesktopCommandInput as x, SessionPatchStatus as xn, SpaceStartupResponse as xr, WorkPublicSpaceRecord as xt, WorkCommerceProductResolveResponse as y, SessionPatchReducer as yn, PublicFileUploadPlanEntry as yr, WorkPromotionStatsResponse as yt, AppPresentationMeta as z, ModelsApi as zn, BoardEventName as zt };