@buzzni/saycode-cli 0.7.2 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,10 @@ import { createInterface } from "node:readline";
3
3
  import { readFile } from "node:fs/promises";
4
4
  import { resolve, sep } from "node:path";
5
5
  import { pathToFileURL } from "node:url";
6
+ const ASSET_PERMISSIONS = ["assets.read", "assets.write", "files.select", "drafts.prepare"];
7
+ function usesAssetWorkflow(permissions) {
8
+ return permissions.some((permission) => ASSET_PERMISSIONS.includes(permission));
9
+ }
6
10
  const EXTENSION_ARTIFACT_ACTION_OPERATIONS = ["publishPublic"];
7
11
  const EXTENSION_ARTIFACT_SOURCE_TYPES = ["project-file", "personal-chat-file"];
8
12
  const ID_PATTERN$2 = /^[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$/;
@@ -225,6 +229,10 @@ function parseExtensionChannelContributions(value) {
225
229
  });
226
230
  }
227
231
  const EXTENSION_PERMISSIONS = [
232
+ "assets.read",
233
+ "assets.write",
234
+ "files.select",
235
+ "drafts.prepare",
228
236
  "projects.read",
229
237
  "remoteFiles.read",
230
238
  "remoteFiles.write",
@@ -254,7 +262,7 @@ const EXTENSION_PERMISSIONS = [
254
262
  const SAYCODE_EXTENSION_API_VERSION = 3;
255
263
  const SAYCODE_EXTENSION_MINIMUM_API_VERSION = 2;
256
264
  const MAX_EXTENSION_API_WINDOW_WIDTH = 2;
257
- const SAYCODE_EXTENSION_ENGINE_VERSION = "1.0.0";
265
+ const SAYCODE_EXTENSION_ENGINE_VERSION = "1.1.0";
258
266
  const SAYCODE_CHANNEL_API_VERSION = CHANNEL_API_VERSION;
259
267
  const SAYCODE_CHANNEL_MINIMUM_API_VERSION = CHANNEL_MINIMUM_API_VERSION;
260
268
  class UnsupportedChannelApiVersionError extends Error {
@@ -284,7 +292,7 @@ const V2_PERMISSIONS = /* @__PURE__ */ new Set([
284
292
  "browserViewer.install",
285
293
  "browserViewer.installChrome"
286
294
  ]);
287
- const V3_PERMISSIONS = /* @__PURE__ */ new Set(["artifacts.publishPublic"]);
295
+ const V3_PERMISSIONS = /* @__PURE__ */ new Set(["artifacts.publishPublic", "assets.read", "assets.write", "files.select", "drafts.prepare"]);
288
296
  const CHANNEL_PERMISSIONS = /* @__PURE__ */ new Set([
289
297
  "channels.receive",
290
298
  "channels.ack",
@@ -1284,6 +1292,7 @@ async function startExtensionHost(deps) {
1284
1292
  });
1285
1293
  const runtime = new ExtensionHostRuntime({
1286
1294
  manifest,
1295
+ requestTimeoutMs: usesAssetWorkflow(manifest.permissions) ? 13e4 : void 0,
1287
1296
  loadModule: (entrypoint) => deps.importModule(protocolUrl(deps.extensionId, entrypoint)),
1288
1297
  send: (message) => deps.bridge.send(message)
1289
1298
  });