@neta-art/cohub 12.0.0 → 12.1.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/board/export/index.js +1 -1
- package/dist/board/export/node/index.d.ts +1 -0
- package/dist/board/export/node/index.js +5 -0
- package/dist/board/export/scene.js +2 -1
- package/dist/board/render/card-tag.d.ts +0 -1
- package/dist/board/render/card-tag.js +15 -17
- package/dist/board/render/index.d.ts +2 -2
- package/dist/board/render/index.js +6 -6
- package/dist/board/render/renderers/arrow-card-renderer.js +5 -7
- package/dist/board/render/renderers/audio-card-renderer.js +8 -7
- package/dist/board/render/renderers/base-card-renderer.d.ts +1 -1
- package/dist/board/render/renderers/base-card-renderer.js +2 -3
- package/dist/board/render/renderers/board-renderer-registry.d.ts +3 -1
- package/dist/board/render/renderers/custom-card-renderer.js +19 -17
- package/dist/board/render/renderers/file-card-renderer.js +10 -8
- package/dist/board/render/renderers/frame-card-renderer.js +5 -6
- package/dist/board/render/renderers/shape-card-renderer.js +5 -7
- package/dist/board/render/renderers/task-card-renderer.js +9 -9
- package/dist/board/render/renderers/text-card-renderer.js +5 -7
- package/dist/board/render/renderers/unknown-card-renderer.js +5 -7
- package/dist/board/render/text-resolution.d.ts +4 -7
- package/dist/board/render/text-resolution.js +20 -22
- package/dist/board/stage/canvas-size.d.ts +18 -0
- package/dist/board/stage/canvas-size.js +31 -0
- package/dist/board/stage/scene.d.ts +5 -1
- package/dist/board/stage/scene.js +35 -9
- package/dist/board/stage/stage.js +34 -13
- package/dist/board/stage/text-resolution-tracker.d.ts +8 -0
- package/dist/board/stage/text-resolution-tracker.js +33 -0
- package/dist/chunks/app-realtime.js +1 -1
- package/dist/chunks/{transport.js → http-error.js} +37 -1
- package/dist/chunks/http.js +30 -10
- package/dist/http.js +1 -1
- package/dist/index.js +2 -2
- package/dist/websocket.js +951 -1
- package/package.json +1 -1
- package/dist/chunks/websocket.js +0 -988
package/dist/chunks/http.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as getRealtimeSpaceRoom, c as HttpError, l as HttpTransport, s as isHttpErrorCode, x as getRealtimeBoardRoom, z as isUuid } from "./http-error.js";
|
|
2
2
|
import { l as resolveExecutionToken, o as resolveApiBaseUrl } from "./environment.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region ../protocol/dist/model/metrics.js
|
|
@@ -1039,28 +1039,48 @@ var SessionAccessApi = class {
|
|
|
1039
1039
|
};
|
|
1040
1040
|
//#endregion
|
|
1041
1041
|
//#region src/apis/file-list.ts
|
|
1042
|
+
const DIRECTORY_CHANGED_RETRY_DELAYS_MS = [
|
|
1043
|
+
100,
|
|
1044
|
+
250,
|
|
1045
|
+
500
|
|
1046
|
+
];
|
|
1042
1047
|
async function listDirectory(transport, endpoint, path, options) {
|
|
1043
1048
|
const pageOptions = typeof options === "object" ? options : void 0;
|
|
1044
1049
|
const fetch = typeof options === "function" ? options : pageOptions?.fetch;
|
|
1045
|
-
const
|
|
1046
|
-
const seen = /* @__PURE__ */ new Set();
|
|
1047
|
-
let cursor = pageOptions?.cursor;
|
|
1048
|
-
let responsePath = path;
|
|
1049
|
-
do {
|
|
1050
|
+
const readPage = (cursor) => {
|
|
1050
1051
|
const params = new URLSearchParams({ pagination: "true" });
|
|
1051
1052
|
if (path) params.set("path", path);
|
|
1052
1053
|
if (pageOptions?.limit !== void 0) params.set("limit", String(pageOptions.limit));
|
|
1053
1054
|
if (cursor) params.set("cursor", cursor);
|
|
1054
|
-
|
|
1055
|
+
return transport.request(`${endpoint}?${params}`, {
|
|
1055
1056
|
fetch,
|
|
1056
1057
|
signal: pageOptions?.signal
|
|
1057
1058
|
});
|
|
1058
|
-
|
|
1059
|
-
|
|
1059
|
+
};
|
|
1060
|
+
if (pageOptions) {
|
|
1061
|
+
const page = await readPage(pageOptions.cursor);
|
|
1062
|
+
return {
|
|
1060
1063
|
...page,
|
|
1061
|
-
nextCursor,
|
|
1064
|
+
nextCursor: page.nextCursor ?? null,
|
|
1062
1065
|
truncated: page.truncated ?? true
|
|
1063
1066
|
};
|
|
1067
|
+
}
|
|
1068
|
+
for (let attempt = 0;; attempt += 1) try {
|
|
1069
|
+
return await readAllPages(readPage, path);
|
|
1070
|
+
} catch (error) {
|
|
1071
|
+
const delay = DIRECTORY_CHANGED_RETRY_DELAYS_MS[attempt];
|
|
1072
|
+
if (delay === void 0 || !isHttpErrorCode(error, "directory_changed")) throw error;
|
|
1073
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
async function readAllPages(readPage, path) {
|
|
1077
|
+
const entries = /* @__PURE__ */ new Map();
|
|
1078
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1079
|
+
let cursor;
|
|
1080
|
+
let responsePath = path;
|
|
1081
|
+
do {
|
|
1082
|
+
const page = await readPage(cursor);
|
|
1083
|
+
const nextCursor = page.nextCursor ?? null;
|
|
1064
1084
|
responsePath = page.path;
|
|
1065
1085
|
for (const entry of page.entries) entries.set(entry.path, entry);
|
|
1066
1086
|
if (nextCursor && seen.has(nextCursor)) throw new Error("Server returned a repeated directory cursor.");
|
package/dist/http.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { n as createHttpClient, t as CohubHttpClient } from "./chunks/http.js";
|
|
2
|
-
import {
|
|
2
|
+
import { c as HttpError, l as HttpTransport } from "./chunks/http-error.js";
|
|
3
3
|
import { g as scopeListHasPermission, h as isUserLevelPermission, m as USER_LEVEL_PERMISSIONS, p as PERMISSIONS } from "./chunks/environment.js";
|
|
4
4
|
export { CohubHttpClient, HttpError, HttpTransport, PERMISSIONS, USER_LEVEL_PERMISSIONS, createHttpClient, isUserLevelPermission, scopeListHasPermission };
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { c as AppRtcError, i as WorkRoom, n as AppRoom, o as AppRoomRtc, r as WorkRealtimeApi, s as AppRtcChannel, t as AppRealtimeApi } from "./chunks/app-realtime.js";
|
|
2
2
|
import { $ as isTerminalDesktopCommandStatus, A as BoardClient, B as CronJobsApi, C as SessionPatchReducer, D as connectDisplay, E as DisplayConnection, F as PublicAssetsApi, G as DESKTOP_COMMAND_OPEN_TIMEOUT_MS, H as DESKTOP_COMMAND_ACCEPT_TIMEOUT_MS, I as SkillsApi, J as DESKTOP_COMMAND_SETTLEMENT_GRACE_SECONDS, K as DESKTOP_COMMAND_PAYLOAD_MAX_BYTES, L as PromptsApi, M as SessionAccessApi, N as ReferencesApi, P as SearchApi, Q as isDesktopCallMethod, R as ModelsApi, S as parseAssistantMessageCommit, T as SpaceDisplaysApi, U as DESKTOP_COMMAND_DEFAULT_TIMEOUT_MS, V as ChannelsApi, W as DESKTOP_COMMAND_MAX_TIMEOUT_MS, X as DESKTOP_COMMAND_VERSION, Y as DESKTOP_COMMAND_TERMINAL_TTL_SECONDS, Z as defaultDesktopCommandTimeoutMs, _ as PublicInviteApi, a as WorkCommerceApi, b as SessionGenerationStreamClient, c as AppsApi, ct as normalizeDisplayPoint, d as UserApi, et as parseDesktopCommand, f as TasksApi, g as SpacesApi, h as SpaceWebhooksApi, i as AppCommerceApi, it as DISPLAY_ELEMENT_REF_PATTERN, j as ensureRealtimeConnected, l as ReferralsApi, lt as splitDisplayText, m as SpacePublicFilesApi, n as createHttpClient, nt as resolveOpenSurface, o as DesktopCommandsApi, ot as DISPLAY_INPUT_MAX_TEXT, p as SpaceClient, q as DESKTOP_COMMAND_PENDING_TTL_SECONDS, r as RoomsApi, rt as NAVIGATION_ERROR_MESSAGE_MAX_LENGTH, s as UiCommandsApi, st as DISPLAY_SYSTEM_ACTIONS, t as CohubHttpClient, tt as parseDesktopCommandId, u as UsersApi, v as buildSpaceInvitePath, w as createSessionPatchReducer, x as createSessionGenerationStreamClient, y as buildSpacePath, z as GenerationsApi } from "./chunks/http.js";
|
|
3
|
-
import { A as
|
|
3
|
+
import { A as isRequestSourceClientId, B as isUuidLike, D as COHUB_SOURCE_HEADER_NAMES, E as COHUB_SOURCE_HEADER, F as parseRequestSourceFromHeaders, I as readRequestSourceFromEnv, L as requestSourceToHeaders, M as isRequestSourceUuid, N as mergeRequestSourceIntoMeta, O as REQUEST_SOURCE_VIA_MAX_LENGTH, P as normalizeRequestSource, R as resolveRequestSourceChannel, V as isUuidOrShortUuid, a as isBillingAccessBlockedError, c as HttpError, d as matchesUnauthorizedErrorToken, f as sanitizeAccessToken, i as isBillingAccessBlockedCode, j as isRequestSourceEmpty, k as hasRequestSourceIdentity, l as HttpTransport, n as FEATURE_NOT_ENTITLED_ERROR_CODE, o as isFeatureNotEntitledError, r as extractBillingPayload, s as isHttpErrorCode, t as BILLING_ACCESS_BLOCKED_ERROR_CODE, u as joinApiUrl, z as isUuid } from "./chunks/http-error.js";
|
|
4
4
|
import { a as normalizeWebsocketUrl, c as resolveExecutionAppId, d as resolveWebBaseUrl, f as resolveWebsocketUrl, g as scopeListHasPermission, h as isUserLevelPermission, i as normalizeVoiceInputWebsocketUrl, l as resolveExecutionToken, m as USER_LEVEL_PERMISSIONS, n as getCohubContext, o as resolveApiBaseUrl, p as PERMISSIONS, r as normalizeBaseUrl, s as resolveCohubEnvironment, t as COHUB_ENVIRONMENTS, u as resolveVoiceInputWebsocketUrl } from "./chunks/environment.js";
|
|
5
|
-
import {
|
|
5
|
+
import { WebsocketClient, createWebsocketClient } from "./websocket.js";
|
|
6
6
|
import { VoiceApi, VoiceInputClient, createVoiceInputClient } from "./voice-input.js";
|
|
7
7
|
import { filterSpacePickerItems, normalizeSpacePickerQuery, orderSpacePickerItems, selectSpacePickerItems } from "./space-picker.js";
|
|
8
8
|
import { z } from "zod";
|