superbee 0.4.4-pre.12 → 0.4.4-pre.13

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/superbee.mjs CHANGED
@@ -44,7 +44,7 @@ var __toESM = (mod, isNodeMode, target3) => (target3 = mod != null ? __create(__
44
44
  var define_SUPERBEE_BUILD_IDENTITY_default;
45
45
  var init_define_SUPERBEE_BUILD_IDENTITY = __esm({
46
46
  "<define:__SUPERBEE_BUILD_IDENTITY__>"() {
47
- define_SUPERBEE_BUILD_IDENTITY_default = { schema: "superbee.build-identity.v1", package: { name: "superbee", version: "0.4.4-pre.12" }, source: { commit: "2923b36b32c6cf1a2ffafe048ded867a1484d839", dirty: false }, artifact: { channel: "npm-package" }, compatibility_contracts: { skill: 1, hook: 1, mcp: 1 } };
47
+ define_SUPERBEE_BUILD_IDENTITY_default = { schema: "superbee.build-identity.v1", package: { name: "superbee", version: "0.4.4-pre.13" }, source: { commit: "18c0655ead4adfea98f94b9bcf5224cf1e88e2ce", dirty: false }, artifact: { channel: "npm-package" }, compatibility_contracts: { skill: 1, hook: 1, mcp: 1 } };
48
48
  }
49
49
  });
50
50
 
@@ -29323,7 +29323,7 @@ var init_command_spec = __esm({
29323
29323
  {
29324
29324
  id: "workloadExec",
29325
29325
  leaves: [publicLeaf("workloadExec", "workload exec", workloadCommandArity, void 0, { flags: pathFlags({ flag: "request-file", role: "ingress" }) })],
29326
- usage: "workload exec --request-file <file> --url <HTTPS workspace origin> --workspace <slug> -- <command> [args...]",
29326
+ usage: "workload exec --request-file <file> --url <HTTPS workspace origin> --workspace <slug> [--host <HTTPS gateway origin>] -- <command> [args...]",
29327
29327
  summary: "In GitHub Actions, request or discover exactly the access in a bounded version1 intent file, without Portal config or an app ID; pending approval returns FORBIDDEN (exit 2) with a workspace administrator review link before the child starts; approved access passes a fresh masked bearer only to the child and removes its GitHub OIDC minting environment"
29328
29328
  },
29329
29329
  {
@@ -158083,6 +158083,18 @@ import { spawn as spawn6 } from "node:child_process";
158083
158083
  import { constants as constants10, homedir as homedir57 } from "node:os";
158084
158084
  import path70 from "node:path";
158085
158085
  import { parseArgs as parseArgs52 } from "node:util";
158086
+ function canonicalHttpsOrigin(value, flag) {
158087
+ const reason = flag === "url" ? "workload_origin_invalid" : "workload_host_invalid";
158088
+ let origin;
158089
+ try {
158090
+ origin = new URL(value);
158091
+ } catch {
158092
+ throw usage4(reason, `--${flag} must be one canonical HTTPS origin`);
158093
+ }
158094
+ if (origin.protocol !== "https:" || origin.username || origin.password || origin.port || origin.origin !== value || origin.pathname !== "/")
158095
+ throw usage4(reason, `--${flag} must be one canonical HTTPS origin`);
158096
+ return origin;
158097
+ }
158086
158098
  function intent(value) {
158087
158099
  if (!object12(value) || Object.keys(value).some((k) => !["version", "displayName", "events", "bundles", "sites"].includes(k)) || value.version !== 1 || typeof value.displayName !== "string" || value.displayName !== value.displayName.trim() || value.displayName.length < 1 || value.displayName.length > 80 || /[\u0000-\u001f\u007f]/.test(value.displayName) || !Array.isArray(value.events) || value.events.length < 1 || value.events.length > 3 || !value.events.every((x) => typeof x === "string" && EVENTS.has(x)) || new Set(value.events).size !== value.events.length || !object12(value.bundles) || Object.keys(value.bundles).length < 1 || Object.keys(value.bundles).length > 50 || !Object.entries(value.bundles).every(([k, v]) => isHostedBundleId(k) && (v === "read" || v === "write")) || value.sites !== void 0 && (!Array.isArray(value.sites) || value.sites.length > 5 || !value.sites.every(site) || new Set(value.sites).size !== value.sites.length)) {
158088
158100
  throw usage4("workload_request_invalid", "request file must contain only the bounded version1 display name, events, bundle capabilities and optional sites");
@@ -158149,6 +158161,7 @@ async function workloadExec(argv2, partial2 = {}) {
158149
158161
  const { values, positionals } = parseLeafOrUsage(() => parseArgs52({ args: argv2, strict: true, allowPositionals: true, options: {
158150
158162
  "request-file": { type: "string" },
158151
158163
  url: { type: "string" },
158164
+ host: { type: "string" },
158152
158165
  workspace: { type: "string" },
158153
158166
  help: { type: "boolean", short: "h" }
158154
158167
  } }), CLI_LEAVES.workloadExec);
@@ -158159,13 +158172,8 @@ async function workloadExec(argv2, partial2 = {}) {
158159
158172
  const separator = argv2.indexOf("--");
158160
158173
  if (separator < 0 || positionals.length !== argv2.length - separator - 1 || !positionals[0] || positionals.some((x) => x.includes("\0"))) throw usage4("workload_command_invalid", "place the command and its arguments after --");
158161
158174
  if (!values["request-file"] || !values.url || !isWorkspaceSlug(values.workspace)) throw usage4("workload_arguments_missing", "--request-file, --url and --workspace are required");
158162
- let origin;
158163
- try {
158164
- origin = new URL(values.url);
158165
- } catch {
158166
- throw usage4("workload_origin_invalid", "--url must be one canonical HTTPS workspace origin");
158167
- }
158168
- if (origin.protocol !== "https:" || origin.username || origin.password || origin.port || origin.origin !== values.url || origin.pathname !== "/") throw usage4("workload_origin_invalid", "--url must be one canonical HTTPS workspace origin");
158175
+ const origin = canonicalHttpsOrigin(values.url, "url");
158176
+ const explicitHost = values.host === void 0 ? void 0 : canonicalHttpsOrigin(values.host, "host");
158169
158177
  const acquired = await readExternalFileBytesNoFollowWithin(path70.resolve(deps2.cwd, values["request-file"]), 16 * 1024, deps2.home);
158170
158178
  if (acquired.state !== "present") throw usage4("workload_request_unreadable", "request file must be an ordinary readable file of at most 16 KiB outside private state");
158171
158179
  let parsed2;
@@ -158186,8 +158194,12 @@ async function workloadExec(argv2, partial2 = {}) {
158186
158194
  if (oidcUrl.protocol !== "https:" || oidcUrl.username || oidcUrl.password || oidcUrl.hash) throw unavailable2("github_oidc_invalid");
158187
158195
  let selected2;
158188
158196
  try {
158189
- selected2 = await followWorkspaceOrigin(deps2.fetch, resolveHostedTarget(origin.origin));
158190
- if (!selected2 || selected2.requestedOrigin !== origin.origin || selected2.workspaceSlug !== values.workspace) throw unavailable2("workspace_discovery_mismatch");
158197
+ if (explicitHost) {
158198
+ selected2 = { requestedOrigin: origin.origin, workspaceSlug: values.workspace, target: resolveHostedTarget(explicitHost.origin) };
158199
+ } else {
158200
+ selected2 = await followWorkspaceOrigin(deps2.fetch, resolveHostedTarget(origin.origin));
158201
+ if (!selected2 || selected2.requestedOrigin !== origin.origin || selected2.workspaceSlug !== values.workspace) throw unavailable2("workspace_discovery_mismatch");
158202
+ }
158191
158203
  await discoverHosted(deps2.fetch, selected2.target);
158192
158204
  } catch {
158193
158205
  throw unavailable2("workspace_discovery_unavailable");
@@ -158248,13 +158260,18 @@ var init_workload_exec = __esm({
158248
158260
  WORKLOAD_EXEC_USAGE = `superbee workload exec \u2014 run with exactly the workload access requested
158249
158261
 
158250
158262
  Usage:
158251
- superbee workload exec --request-file <file> --url <HTTPS workspace origin> --workspace <slug> -- <command> [args...]
158263
+ superbee workload exec --request-file <file> --url <HTTPS workspace origin> --workspace <slug> [--host <HTTPS gateway origin>] -- <command> [args...]
158252
158264
 
158253
158265
  GitHub Actions only: the existing exchange derives identity from the job's signed GitHub token.
158254
158266
  The UTF-8 JSON intent is at most 16 KiB: {version:1,displayName,events,bundles,sites?}. It contains
158255
158267
  only requested capabilities, never repository IDs, workflow refs, environment or credentials.
158256
158268
  No release.config.json, person login, app UUID or copied GitHub variable is required.
158257
158269
 
158270
+ Without --host, the workspace pointer must name its own parent-domain gateway. An explicit --host
158271
+ selects the receiving gateway after its normal protected-resource and issuer discovery; no pointer
158272
+ or environment fallback is used. That selected host receives the signed job token. --url remains
158273
+ the exact workspace audience and returned workspace authority; selecting a host grants no access.
158274
+
158258
158275
  Pending approval returns FORBIDDEN (exit 2), details.reason workload_approval_pending and the
158259
158276
  workspace administrator's review URL; no child starts and no bearer is emitted. Run the workflow
158260
158277
  again after approval. Denied or expired requests remain terminal; there is no polling or retry.
@@ -158267,7 +158284,8 @@ The child exit status is preserved. At most 128 command/argument tokens are acce
158267
158284
  Options:
158268
158285
  --request-file <file> Required bounded version1 JSON capability intent
158269
158286
  --url <origin> Required canonical HTTPS workspace origin, no path/query/fragment
158270
- --workspace <slug> Required workspace slug matching the origin's discovery
158287
+ --workspace <slug> Required workspace slug, matched by the hosted exchange
158288
+ --host <origin> Optional explicit canonical HTTPS receiving gateway, no path/query/fragment
158271
158289
  -h, --help Show this help`;
158272
158290
  object12 = (x) => x !== null && typeof x === "object" && !Array.isArray(x);
158273
158291
  uuid3 = (x) => typeof x === "string" && /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/.test(x);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superbee",
3
- "version": "0.4.4-pre.12",
3
+ "version": "0.4.4-pre.13",
4
4
  "type": "module",
5
5
  "description": "Agent-facing Superbee CLI for reading and writing local OKF knowledge bundles: context notes, docs, cross-links, and live bundle Views.",
6
6
  "keywords": [
@@ -101,6 +101,13 @@ bundle read/write capabilities and optional fixed sites. It contains no reposito
101
101
  refs, environment, credentials or app UUID. Each requested site must have its matching Read bundle
102
102
  capability. A protected main-only GitHub environment and `id-token: write` are required by the host.
103
103
  This works for custom research or documentation workflows without `release.config.json`.
104
+ By default, the workspace pointer must name its own parent-domain gateway. Optional explicit
105
+ `--host <HTTPS gateway origin>` selects the receiving service through ordinary protected-resource
106
+ and issuer discovery, without pointer or environment fallback. That service receives the signed
107
+ job token. In explicit mode, `--url` is the logical browser approval/audience origin (including a
108
+ shared neutral origin), and `--workspace` independently names the exact workspace: no first-label
109
+ inference is made. The server still decides current authority, and the CLI still checks returned
110
+ workspace, exact capabilities and expiry. Selecting a service grants no access.
104
111
 
105
112
  The existing exchange verifies the job's GitHub identity and resolves exactly approved access.
106
113
  Pending approval is `FORBIDDEN` (exit 2) with `details.reason: workload_approval_pending`, an opaque