@octonodes/cli 0.2.5 → 0.2.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octonodes/cli",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "Octonode API and plugin development CLI.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -21,7 +21,7 @@
21
21
  "prepack": "tsc -b"
22
22
  },
23
23
  "dependencies": {
24
- "@octonodes/sdk": "0.2.5",
24
+ "@octonodes/sdk": "0.2.6",
25
25
  "@supabase/supabase-js": "2.107.0",
26
26
  "esbuild": "0.28.1",
27
27
  "tar": "7.5.22",
@@ -11541,7 +11541,7 @@ var require_plugin_publishing = __commonJS({
11541
11541
  "packages/schema/dist/plugin-publishing.js"(exports2) {
11542
11542
  "use strict";
11543
11543
  Object.defineProperty(exports2, "__esModule", { value: true });
11544
- exports2.PluginCloudBuild = exports2.PluginPublisherBuildDetail = exports2.PluginPublisherBuilds = exports2.PluginPublisherBuildQuery = exports2.PluginPublisherApplied = exports2.PluginPublisherApply = exports2.PluginPublisherReview = exports2.PluginPublisherReviewItem = exports2.PluginPublisherOperation = exports2.PluginPublisherConnections = exports2.PluginPublisherConnection = exports2.PluginPublisherPreview = exports2.PluginPublisherConsent = exports2.PluginPublisherAutomatic = exports2.PluginPublisherRepository = exports2.PluginPublisherInput = exports2.pluginReleaseScope = exports2.PluginReleaseConfig = exports2.PluginConfigPath = void 0;
11544
+ exports2.PluginCloudBuild = exports2.PluginPublisherBuildDetail = exports2.PluginPublisherBuilds = exports2.PluginPublisherBuildQuery = exports2.PluginPublisherListQuery = exports2.PluginPublisherApplied = exports2.PluginPublisherApply = exports2.PluginPublisherReview = exports2.PluginPublisherReviewItem = exports2.PluginPublisherOperation = exports2.PluginPublisherConnections = exports2.PluginPublisherConnection = exports2.PluginPublisherPreview = exports2.PluginPublisherConsent = exports2.PluginPublisherAutomatic = exports2.PluginPublisherRepository = exports2.PluginPublisherInput = exports2.pluginReleaseScope = exports2.PluginReleaseConfig = exports2.PluginConfigPath = void 0;
11545
11545
  var zod_1 = require("zod");
11546
11546
  var plugin_version_1 = require_plugin_version();
11547
11547
  exports2.PluginConfigPath = zod_1.z.string().max(512).refine((path) => /^(?:[a-zA-Z0-9_.-]+\/)*(?:plugin\.octonode\.(?:json|ya?ml)|octonode\.plugin\.json)$/.test(path) && !path.split("/").some((part) => [".", "..", ".git", "node_modules"].includes(part)), "Select a repository-relative octonode.plugin.json file (older plugin.octonode release files also work)");
@@ -11612,17 +11612,32 @@ var require_plugin_publishing = __commonJS({
11612
11612
  repositoryId: zod_1.z.number(),
11613
11613
  buildId: zod_1.z.number()
11614
11614
  });
11615
+ exports2.PluginPublisherListQuery = zod_1.z.object({
11616
+ q: zod_1.z.string().trim().max(200).default(""),
11617
+ offset: zod_1.z.coerce.number().int().min(0).max(1e6).default(0),
11618
+ limit: zod_1.z.coerce.number().int().min(1).max(100).default(25),
11619
+ days: zod_1.z.enum(["7", "30", "90"]).default("30"),
11620
+ scope: zod_1.z.enum(["", "user", "group", "org", "public"]).default(""),
11621
+ source: zod_1.z.enum(["", "sdk", "npm"]).default(""),
11622
+ sort: zod_1.z.enum(["updated", "name", "version", "scope", "source", "installs", "score", "versions"]).default("updated"),
11623
+ direction: zod_1.z.enum(["asc", "desc"]).default("desc")
11624
+ });
11615
11625
  exports2.PluginPublisherBuildQuery = zod_1.z.object({
11616
11626
  repositoryId: zod_1.z.coerce.number().int().positive().optional(),
11617
- page: zod_1.z.coerce.number().int().min(1).max(1e3).default(1),
11627
+ page: zod_1.z.coerce.number().int().min(1).max(1e6).default(1),
11618
11628
  search: zod_1.z.string().max(200).default(""),
11619
11629
  status: zod_1.z.enum(["", "queued", "in_progress", "success", "failure"]).default(""),
11620
- sort: zod_1.z.enum(["newest", "oldest", "name"]).default("newest")
11630
+ sort: zod_1.z.enum(["newest", "oldest", "name", "status", "branch", "sha"]).default("newest"),
11631
+ direction: zod_1.z.enum(["asc", "desc"]).default("asc"),
11632
+ limit: zod_1.z.coerce.number().int().min(1).max(100).default(30),
11633
+ branch: zod_1.z.string().trim().max(200).default(""),
11634
+ sha: zod_1.z.string().trim().max(200).default("")
11621
11635
  });
11622
11636
  exports2.PluginPublisherBuilds = zod_1.z.object({
11623
11637
  total: zod_1.z.number(),
11624
11638
  page: zod_1.z.number(),
11625
11639
  hasMore: zod_1.z.boolean(),
11640
+ limit: zod_1.z.number(),
11626
11641
  items: zod_1.z.array(zod_1.z.object({
11627
11642
  id: zod_1.z.number(),
11628
11643
  repositoryId: zod_1.z.number(),
@@ -11670,6 +11685,43 @@ var require_plugin_publishing = __commonJS({
11670
11685
  }
11671
11686
  });
11672
11687
 
11688
+ // packages/schema/dist/plugin-allowlist.js
11689
+ var require_plugin_allowlist = __commonJS({
11690
+ "packages/schema/dist/plugin-allowlist.js"(exports2) {
11691
+ "use strict";
11692
+ Object.defineProperty(exports2, "__esModule", { value: true });
11693
+ exports2.PluginAllowlistPage = exports2.PluginAllowlistInput = exports2.PluginAllowlistQuery = exports2.PluginAllowlistKind = void 0;
11694
+ var zod_1 = require("zod");
11695
+ exports2.PluginAllowlistKind = zod_1.z.enum(["org", "team", "user"]);
11696
+ exports2.PluginAllowlistQuery = zod_1.z.object({
11697
+ kind: exports2.PluginAllowlistKind,
11698
+ q: zod_1.z.string().trim().max(200).default(""),
11699
+ status: zod_1.z.enum(["allowed", "available", "all"]).default("allowed"),
11700
+ sort: zod_1.z.enum(["name", "id"]).default("name"),
11701
+ direction: zod_1.z.enum(["asc", "desc"]).default("asc"),
11702
+ offset: zod_1.z.coerce.number().int().min(0).max(1e6).default(0),
11703
+ limit: zod_1.z.coerce.number().int().min(1).max(100).default(25)
11704
+ });
11705
+ exports2.PluginAllowlistInput = zod_1.z.object({
11706
+ kind: exports2.PluginAllowlistKind,
11707
+ id: zod_1.z.string().min(1).max(200)
11708
+ }).strict();
11709
+ exports2.PluginAllowlistPage = zod_1.z.object({
11710
+ items: zod_1.z.array(zod_1.z.object({
11711
+ id: zod_1.z.string(),
11712
+ name: zod_1.z.string(),
11713
+ allowed: zod_1.z.boolean(),
11714
+ inherited: zod_1.z.boolean(),
11715
+ eligible: zod_1.z.boolean()
11716
+ })),
11717
+ total: zod_1.z.number(),
11718
+ offset: zod_1.z.number(),
11719
+ limit: zod_1.z.number(),
11720
+ canAdd: zod_1.z.boolean()
11721
+ });
11722
+ }
11723
+ });
11724
+
11673
11725
  // packages/schema/dist/index.js
11674
11726
  var require_dist = __commonJS({
11675
11727
  "packages/schema/dist/index.js"(exports2) {
@@ -11735,6 +11787,7 @@ var require_dist = __commonJS({
11735
11787
  __exportStar(require_execution(), exports2);
11736
11788
  __exportStar(require_execution_constants(), exports2);
11737
11789
  __exportStar(require_plugin_publishing(), exports2);
11790
+ __exportStar(require_plugin_allowlist(), exports2);
11738
11791
  }
11739
11792
  });
11740
11793
 
@@ -12201,8 +12254,8 @@ var require_constants2 = __commonJS({
12201
12254
  exports2.OCTONODE_STORE_DIR = OCTONODE_STORE_DIR;
12202
12255
  var OCTONODE_STUDIO_URL = () => exports2.PROCESS_ENV.OCTONODE_STUDIO_URL ?? exports2.PROCESS_ENV.VITE_OCTONODE_STUDIO_URL ?? exports2.PROCESS_ENV.VITE_PUBLIC_OCTONODE_STUDIO_URL;
12203
12256
  exports2.OCTONODE_STUDIO_URL = OCTONODE_STUDIO_URL;
12204
- var OCTONODE_USER = () => exports2.PROCESS_ENV.OCTONODE_USER;
12205
- exports2.OCTONODE_USER = OCTONODE_USER;
12257
+ var OCTONODE_USER2 = () => exports2.PROCESS_ENV.OCTONODE_USER;
12258
+ exports2.OCTONODE_USER = OCTONODE_USER2;
12206
12259
  var OCTONODE_USER_EMAIL = () => exports2.PROCESS_ENV.OCTONODE_USER_EMAIL;
12207
12260
  exports2.OCTONODE_USER_EMAIL = OCTONODE_USER_EMAIL;
12208
12261
  var OCTONODE_VISUAL_PORT = () => exports2.PROCESS_ENV.OCTONODE_VISUAL_PORT;
@@ -14234,11 +14287,15 @@ var RemoteRegistry = class {
14234
14287
  }
14235
14288
  this.baseUrl = baseUrl.replace(/\/$/, "");
14236
14289
  this.token = opts.token ?? (0, import_common5.OCTONODE_MARKETPLACE_TOKEN)();
14290
+ this.workspace = opts.workspace ?? (0, import_common5.OCTONODE_USER)()?.match(/^workspace:((?:user|org|team):.+)$/)?.[1];
14237
14291
  }
14238
14292
  async request(path, init = {}) {
14239
14293
  const headers = new Headers(init.headers);
14240
14294
  if (this.token) headers.set("authorization", `Bearer ${this.token}`);
14241
- const res = await fetch(`${this.baseUrl}${path}`, {
14295
+ const url = new URL(`${this.baseUrl}${path}`);
14296
+ if (this.workspace && (init.method === void 0 || init.method === "GET" || url.pathname.endsWith("/install")))
14297
+ url.searchParams.set("workspace", this.workspace);
14298
+ const res = await fetch(url.toString(), {
14242
14299
  ...init,
14243
14300
  headers,
14244
14301
  redirect: "error",
@@ -14378,13 +14435,15 @@ var RemoteRegistry = class {
14378
14435
  */
14379
14436
  async install(id, opts = {}) {
14380
14437
  const detail = await this.detail(id, opts.scope);
14438
+ if (detail.manifestId && detail.manifestId !== id)
14439
+ throw new Error("Publisher-qualified plugins require installToStore so their registry identity is preserved");
14381
14440
  const version = opts.version ?? detail.version;
14382
14441
  const release2 = detail.versions?.find((entry) => entry.version === version);
14383
14442
  const dir = await this.downloadBundle(
14384
14443
  id,
14385
14444
  version,
14386
14445
  opts.scope,
14387
- id,
14446
+ detail.manifestId ?? id,
14388
14447
  release2?.archiveSha256 ?? release2?.sha256
14389
14448
  );
14390
14449
  const plugin = await installPlugin(dir, opts);
@@ -14417,7 +14476,7 @@ var RemoteRegistry = class {
14417
14476
  throw new Error("Marketplace release is missing its immutable checksum");
14418
14477
  const availableScopes = versionMeta?.scope ?? detail.scope;
14419
14478
  const scope = opts.scope && availableScopes.includes(opts.scope) ? opts.scope : availableScopes[0];
14420
- const dir = await this.downloadBundle(id, version, scope, id, releaseChecksum);
14479
+ const dir = await this.downloadBundle(id, version, scope, detail.manifestId ?? id, releaseChecksum);
14421
14480
  const entry = (() => {
14422
14481
  try {
14423
14482
  return addToStore(dir, { storeRoot: opts.storeRoot });
@@ -14432,7 +14491,7 @@ var RemoteRegistry = class {
14432
14491
  "Library installation requires native dependency activation; use frozen --artifacts-only for CI restore"
14433
14492
  );
14434
14493
  if (!opts.cacheOnly && !opts.noDeps) {
14435
- const alias2 = opts.alias ?? entry.id;
14494
+ const alias2 = opts.alias ?? (detail.manifestId && id !== detail.manifestId ? id : entry.id);
14436
14495
  const pin2 = {
14437
14496
  pluginId: entry.id,
14438
14497
  remoteId: id,
@@ -14484,7 +14543,7 @@ var RemoteRegistry = class {
14484
14543
  cacheOnly: opts.cacheOnly
14485
14544
  }) : {};
14486
14545
  if (deps.depsError) throw new Error(deps.depsError);
14487
- const alias = opts.alias ?? entry.id;
14546
+ const alias = opts.alias ?? (detail.manifestId && id !== detail.manifestId ? id : entry.id);
14488
14547
  const pin = {
14489
14548
  pluginId: entry.id,
14490
14549
  remoteId: id,