superbee 0.2.1-pre.1 → 0.2.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/superbee.mjs CHANGED
@@ -44,7 +44,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
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.2.1-pre.1" }, source: { commit: "6fc36cae310b40a69d7eff16cadff02c37ba74e0", 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.2.1" }, source: { commit: "ff8f9c8681c94204cac23e8ab7bb2981bb256a12", dirty: false }, artifact: { channel: "npm-package" }, compatibility_contracts: { skill: 1, hook: 1, mcp: 1 } };
48
48
  }
49
49
  });
50
50
 
@@ -3912,7 +3912,7 @@ function assertAuthoredOkfStandardFields(frontmatter, existing, options = {}) {
3912
3912
  }
3913
3913
  return owner[key];
3914
3914
  };
3915
- const list3 = (key, previous3, validate, allowBare = false) => {
3915
+ const list4 = (key, previous3, validate, allowBare = false) => {
3916
3916
  if (!Object.hasOwn(frontmatter, key)) return;
3917
3917
  const value = frontmatter[key];
3918
3918
  if (!Array.isArray(value) && !(allowBare && isOkfRecord(value))) {
@@ -3937,11 +3937,11 @@ function assertAuthoredOkfStandardFields(frontmatter, existing, options = {}) {
3937
3937
  field(generated, "by", "generated.by", isOkfActor, "human:<id>, process:<id>, or <producer>/<version>", previous3, false);
3938
3938
  if (required2 && !Object.hasOwn(generated, "by")) fail("generated.by", "present when generated is authored");
3939
3939
  }
3940
- list3("verified", existing, (entry, path41) => {
3940
+ list4("verified", existing, (entry, path41) => {
3941
3941
  field(entry, "by", `${path41}.by`, isOkfActor, "human:<id>, process:<id>, or <producer>/<version>", void 0, true);
3942
3942
  field(entry, "at", `${path41}.at`, string, "an ISO-8601 datetime with an explicit UTC offset", void 0, true);
3943
3943
  }, true);
3944
- list3("sources", existing, (entry, path41) => {
3944
+ list4("sources", existing, (entry, path41) => {
3945
3945
  field(entry, "resource", `${path41}.resource`, nonempty, "a nonempty string", void 0, true);
3946
3946
  for (const key of ["id", "title"]) field(entry, key, `${path41}.${key}`, string, "a string");
3947
3947
  field(entry, "author", `${path41}.author`, nonempty, "a nonempty string");
@@ -3952,7 +3952,7 @@ function assertAuthoredOkfStandardFields(frontmatter, existing, options = {}) {
3952
3952
  const previous3 = existing?.type === frontmatter.type ? existing : void 0;
3953
3953
  field(frontmatter, "runtime", "runtime", nonempty, "a nonempty string", previous3, true);
3954
3954
  field(frontmatter, "computation", "computation", string, "a string", previous3);
3955
- list3("parameters", previous3, (entry, path41) => {
3955
+ list4("parameters", previous3, (entry, path41) => {
3956
3956
  for (const key of ["name", "type"]) field(entry, key, `${path41}.${key}`, string, "a string", void 0, true);
3957
3957
  field(entry, "required", `${path41}.required`, (value) => typeof value === "boolean", "a boolean");
3958
3958
  });
@@ -5479,6 +5479,170 @@ var init_filesystem_identity = __esm({
5479
5479
  }
5480
5480
  });
5481
5481
 
5482
+ // ../core/src/sha256.ts
5483
+ function rotr(value, bits) {
5484
+ return value >>> bits | value << 32 - bits;
5485
+ }
5486
+ function compress(h2, w2, view2, offset) {
5487
+ for (let i = 0; i < 16; i++) {
5488
+ w2[i] = view2.getUint32(offset + i * 4);
5489
+ }
5490
+ for (let i = 16; i < 64; i++) {
5491
+ const w15 = w2[i - 15];
5492
+ const w22 = w2[i - 2];
5493
+ const s0 = rotr(w15, 7) ^ rotr(w15, 18) ^ w15 >>> 3;
5494
+ const s1 = rotr(w22, 17) ^ rotr(w22, 19) ^ w22 >>> 10;
5495
+ w2[i] = w2[i - 16] + s0 + w2[i - 7] + s1 >>> 0;
5496
+ }
5497
+ let a = h2[0];
5498
+ let b = h2[1];
5499
+ let c = h2[2];
5500
+ let d2 = h2[3];
5501
+ let e = h2[4];
5502
+ let f2 = h2[5];
5503
+ let g = h2[6];
5504
+ let hh = h2[7];
5505
+ for (let i = 0; i < 64; i++) {
5506
+ const S1 = rotr(e, 6) ^ rotr(e, 11) ^ rotr(e, 25);
5507
+ const ch = e & f2 ^ ~e & g;
5508
+ const t1 = hh + S1 + ch + K[i] + w2[i] >>> 0;
5509
+ const S0 = rotr(a, 2) ^ rotr(a, 13) ^ rotr(a, 22);
5510
+ const maj = a & b ^ a & c ^ b & c;
5511
+ const t2 = S0 + maj >>> 0;
5512
+ hh = g;
5513
+ g = f2;
5514
+ f2 = e;
5515
+ e = d2 + t1 >>> 0;
5516
+ d2 = c;
5517
+ c = b;
5518
+ b = a;
5519
+ a = t1 + t2 >>> 0;
5520
+ }
5521
+ h2[0] = h2[0] + a >>> 0;
5522
+ h2[1] = h2[1] + b >>> 0;
5523
+ h2[2] = h2[2] + c >>> 0;
5524
+ h2[3] = h2[3] + d2 >>> 0;
5525
+ h2[4] = h2[4] + e >>> 0;
5526
+ h2[5] = h2[5] + f2 >>> 0;
5527
+ h2[6] = h2[6] + g >>> 0;
5528
+ h2[7] = h2[7] + hh >>> 0;
5529
+ }
5530
+ function sha256HexOfBytes(bytes) {
5531
+ const h2 = new Uint32Array(INITIAL_STATE);
5532
+ const w2 = new Uint32Array(64);
5533
+ const length = bytes.byteLength;
5534
+ const view2 = new DataView(bytes.buffer, bytes.byteOffset, length);
5535
+ const fullBlocks = length >>> 6;
5536
+ for (let block = 0; block < fullBlocks; block++) {
5537
+ compress(h2, w2, view2, block * 64);
5538
+ }
5539
+ const remaining = length - fullBlocks * 64;
5540
+ const tail = new Uint8Array(remaining + 1 + 8 > 64 ? 128 : 64);
5541
+ tail.set(bytes.subarray(fullBlocks * 64));
5542
+ tail[remaining] = 128;
5543
+ const tailView = new DataView(tail.buffer);
5544
+ const bitLengthHigh = Math.floor(length / 536870912);
5545
+ const bitLengthLow = length << 3 >>> 0;
5546
+ tailView.setUint32(tail.length - 8, bitLengthHigh);
5547
+ tailView.setUint32(tail.length - 4, bitLengthLow);
5548
+ for (let offset = 0; offset < tail.length; offset += 64) {
5549
+ compress(h2, w2, tailView, offset);
5550
+ }
5551
+ let hex3 = "";
5552
+ for (let i = 0; i < 8; i++) {
5553
+ hex3 += h2[i].toString(16).padStart(8, "0");
5554
+ }
5555
+ return hex3;
5556
+ }
5557
+ function sha256HexOfUtf8(input) {
5558
+ return sha256HexOfBytes(encoder.encode(input));
5559
+ }
5560
+ var K, INITIAL_STATE, encoder;
5561
+ var init_sha256 = __esm({
5562
+ "../core/src/sha256.ts"() {
5563
+ "use strict";
5564
+ init_define_SUPERBEE_BUILD_IDENTITY();
5565
+ init_define_SUPERBEE_UPDATE_POLICY();
5566
+ K = new Uint32Array([
5567
+ 1116352408,
5568
+ 1899447441,
5569
+ 3049323471,
5570
+ 3921009573,
5571
+ 961987163,
5572
+ 1508970993,
5573
+ 2453635748,
5574
+ 2870763221,
5575
+ 3624381080,
5576
+ 310598401,
5577
+ 607225278,
5578
+ 1426881987,
5579
+ 1925078388,
5580
+ 2162078206,
5581
+ 2614888103,
5582
+ 3248222580,
5583
+ 3835390401,
5584
+ 4022224774,
5585
+ 264347078,
5586
+ 604807628,
5587
+ 770255983,
5588
+ 1249150122,
5589
+ 1555081692,
5590
+ 1996064986,
5591
+ 2554220882,
5592
+ 2821834349,
5593
+ 2952996808,
5594
+ 3210313671,
5595
+ 3336571891,
5596
+ 3584528711,
5597
+ 113926993,
5598
+ 338241895,
5599
+ 666307205,
5600
+ 773529912,
5601
+ 1294757372,
5602
+ 1396182291,
5603
+ 1695183700,
5604
+ 1986661051,
5605
+ 2177026350,
5606
+ 2456956037,
5607
+ 2730485921,
5608
+ 2820302411,
5609
+ 3259730800,
5610
+ 3345764771,
5611
+ 3516065817,
5612
+ 3600352804,
5613
+ 4094571909,
5614
+ 275423344,
5615
+ 430227734,
5616
+ 506948616,
5617
+ 659060556,
5618
+ 883997877,
5619
+ 958139571,
5620
+ 1322822218,
5621
+ 1537002063,
5622
+ 1747873779,
5623
+ 1955562222,
5624
+ 2024104815,
5625
+ 2227730452,
5626
+ 2361852424,
5627
+ 2428436474,
5628
+ 2756734187,
5629
+ 3204031479,
5630
+ 3329325298
5631
+ ]);
5632
+ INITIAL_STATE = new Uint32Array([
5633
+ 1779033703,
5634
+ 3144134277,
5635
+ 1013904242,
5636
+ 2773480762,
5637
+ 1359893119,
5638
+ 2600822924,
5639
+ 528734635,
5640
+ 1541459225
5641
+ ]);
5642
+ encoder = new TextEncoder();
5643
+ }
5644
+ });
5645
+
5482
5646
  // ../core/src/version-transport.ts
5483
5647
  function stripETagWrapper(raw) {
5484
5648
  let value = raw.trim();
@@ -5512,9 +5676,8 @@ var init_version_transport = __esm({
5512
5676
  });
5513
5677
 
5514
5678
  // ../core/src/versioning.ts
5515
- import { createHash as createHash4 } from "node:crypto";
5516
5679
  function sha256Hex(input) {
5517
- return createHash4("sha256").update(input, "utf8").digest("hex");
5680
+ return sha256HexOfUtf8(input);
5518
5681
  }
5519
5682
  function contentVersion(doc2) {
5520
5683
  return `sha256:${sha256Hex(stringifyDoc(doc2.frontmatter, doc2.body ?? ""))}`;
@@ -5523,10 +5686,11 @@ function versionOfBytes(raw) {
5523
5686
  return `sha256:${sha256Hex(raw)}`;
5524
5687
  }
5525
5688
  function blobVersion(bytes) {
5526
- return `sha256:${createHash4("sha256").update(bytes).digest("hex")}`;
5689
+ return `sha256:${sha256HexOfBytes(bytes)}`;
5527
5690
  }
5528
5691
  function defaultActor() {
5529
- return process.env.USER?.trim() || process.env.USERNAME?.trim() || process.env.LOGNAME?.trim() || "local";
5692
+ const env = typeof process !== "undefined" ? process.env : void 0;
5693
+ return env?.USER?.trim() || env?.USERNAME?.trim() || env?.LOGNAME?.trim() || "local";
5530
5694
  }
5531
5695
  var init_versioning = __esm({
5532
5696
  "../core/src/versioning.ts"() {
@@ -5534,6 +5698,7 @@ var init_versioning = __esm({
5534
5698
  init_define_SUPERBEE_BUILD_IDENTITY();
5535
5699
  init_define_SUPERBEE_UPDATE_POLICY();
5536
5700
  init_frontmatter();
5701
+ init_sha256();
5537
5702
  init_version_transport();
5538
5703
  }
5539
5704
  });
@@ -5794,54 +5959,21 @@ var init_backend = __esm({
5794
5959
  }
5795
5960
  });
5796
5961
 
5797
- // ../core/src/index-marker.ts
5798
- var GENERATED_INDEX_MARKER;
5799
- var init_index_marker = __esm({
5800
- "../core/src/index-marker.ts"() {
5801
- "use strict";
5802
- init_define_SUPERBEE_BUILD_IDENTITY();
5803
- init_define_SUPERBEE_UPDATE_POLICY();
5804
- GENERATED_INDEX_MARKER = "<!-- agentstate-lite:generated-index:v1 -->";
5805
- }
5806
- });
5807
-
5808
- // ../core/src/bundle.ts
5809
- import path4 from "node:path";
5810
- function backendFor(bundle) {
5811
- return bundle.backend ?? new FilesystemBackend(bundle.root);
5962
+ // ../core/src/bundle-ops.ts
5963
+ function setDefaultBackendFactory(factory) {
5964
+ defaultBackendFactory = factory;
5812
5965
  }
5813
- async function readBundleOkfVersion2(bundle) {
5814
- return readBundleOkfVersion(backendFor(bundle));
5815
- }
5816
- function resolveOkfAuthoringVersion(requested) {
5817
- const version2 = requested ?? DEFAULT_OKF_AUTHORING_VERSION;
5818
- if (!SUPPORTED_OKF_AUTHORING_VERSIONS.includes(version2)) {
5966
+ function backendFor(bundle) {
5967
+ if (bundle.backend) return bundle.backend;
5968
+ if (defaultBackendFactory === void 0) {
5819
5969
  throw new InvalidInputError(
5820
- `Unsupported OKF authoring version '${version2}'. This build can author ${SUPPORTED_OKF_AUTHORING_VERSIONS.join(" and ")}; bundles declaring other versions can still be read or transported.`
5970
+ `Bundle '${bundle.root}' has no backend and this runtime installs no default: pass bundle.backend explicitly or register one with setDefaultBackendFactory.`
5821
5971
  );
5822
5972
  }
5823
- return version2;
5973
+ return defaultBackendFactory(bundle.root);
5824
5974
  }
5825
- async function initBundle(root, options = {}) {
5826
- const okfVersion = resolveOkfAuthoringVersion(options.okfVersion);
5827
- const resolved = path4.resolve(root);
5828
- const backend = new FilesystemBackend(resolved);
5829
- if (options.expectNew || await backend.readReserved("", "index.md") === null) {
5830
- const name = path4.basename(resolved);
5831
- const body = `${GENERATED_INDEX_MARKER}
5832
- # ${name}
5833
-
5834
- An Open Knowledge Format bundle.
5835
- `;
5836
- try {
5837
- await backend.writeReserved("", "index.md", stringifyWithData({ okf_version: okfVersion }, body), {
5838
- expectedVersion: null
5839
- });
5840
- } catch (err) {
5841
- if (options.expectNew || !(err instanceof VersionConflict)) throw err;
5842
- }
5843
- }
5844
- return { root: resolved };
5975
+ async function readBundleOkfVersion2(bundle) {
5976
+ return readBundleOkfVersion(backendFor(bundle));
5845
5977
  }
5846
5978
  async function writeDocVersionedForEdition2(bundle, doc2, okfVersion, options) {
5847
5979
  return writeDocVersionedForEdition(backendFor(bundle), doc2, okfVersion, options);
@@ -5888,6 +6020,60 @@ async function listBlobs2(bundle, prefix) {
5888
6020
  async function deleteBlob2(bundle, key, options) {
5889
6021
  return deleteBlob(backendFor(bundle), key, options);
5890
6022
  }
6023
+ var defaultBackendFactory;
6024
+ var init_bundle_ops = __esm({
6025
+ "../core/src/bundle-ops.ts"() {
6026
+ "use strict";
6027
+ init_define_SUPERBEE_BUILD_IDENTITY();
6028
+ init_define_SUPERBEE_UPDATE_POLICY();
6029
+ init_engine();
6030
+ init_errors();
6031
+ }
6032
+ });
6033
+
6034
+ // ../core/src/index-marker.ts
6035
+ var GENERATED_INDEX_MARKER;
6036
+ var init_index_marker = __esm({
6037
+ "../core/src/index-marker.ts"() {
6038
+ "use strict";
6039
+ init_define_SUPERBEE_BUILD_IDENTITY();
6040
+ init_define_SUPERBEE_UPDATE_POLICY();
6041
+ GENERATED_INDEX_MARKER = "<!-- agentstate-lite:generated-index:v1 -->";
6042
+ }
6043
+ });
6044
+
6045
+ // ../core/src/bundle.ts
6046
+ import path4 from "node:path";
6047
+ function resolveOkfAuthoringVersion(requested) {
6048
+ const version2 = requested ?? DEFAULT_OKF_AUTHORING_VERSION;
6049
+ if (!SUPPORTED_OKF_AUTHORING_VERSIONS.includes(version2)) {
6050
+ throw new InvalidInputError(
6051
+ `Unsupported OKF authoring version '${version2}'. This build can author ${SUPPORTED_OKF_AUTHORING_VERSIONS.join(" and ")}; bundles declaring other versions can still be read or transported.`
6052
+ );
6053
+ }
6054
+ return version2;
6055
+ }
6056
+ async function initBundle(root, options = {}) {
6057
+ const okfVersion = resolveOkfAuthoringVersion(options.okfVersion);
6058
+ const resolved = path4.resolve(root);
6059
+ const backend = new FilesystemBackend(resolved);
6060
+ if (options.expectNew || await backend.readReserved("", "index.md") === null) {
6061
+ const name = path4.basename(resolved);
6062
+ const body = `${GENERATED_INDEX_MARKER}
6063
+ # ${name}
6064
+
6065
+ An Open Knowledge Format bundle.
6066
+ `;
6067
+ try {
6068
+ await backend.writeReserved("", "index.md", stringifyWithData({ okf_version: okfVersion }, body), {
6069
+ expectedVersion: null
6070
+ });
6071
+ } catch (err) {
6072
+ if (options.expectNew || !(err instanceof VersionConflict)) throw err;
6073
+ }
6074
+ }
6075
+ return { root: resolved };
6076
+ }
5891
6077
  var SUPPORTED_OKF_AUTHORING_VERSIONS, DEFAULT_OKF_AUTHORING_VERSION;
5892
6078
  var init_bundle = __esm({
5893
6079
  "../core/src/bundle.ts"() {
@@ -5895,11 +6081,13 @@ var init_bundle = __esm({
5895
6081
  init_define_SUPERBEE_BUILD_IDENTITY();
5896
6082
  init_define_SUPERBEE_UPDATE_POLICY();
5897
6083
  init_backend();
5898
- init_engine();
6084
+ init_bundle_ops();
5899
6085
  init_errors();
5900
6086
  init_frontmatter();
5901
6087
  init_index_marker();
5902
6088
  init_versioning();
6089
+ init_bundle_ops();
6090
+ setDefaultBackendFactory((root) => new FilesystemBackend(root));
5903
6091
  SUPPORTED_OKF_AUTHORING_VERSIONS = ["0.1", "0.2"];
5904
6092
  DEFAULT_OKF_AUTHORING_VERSION = "0.2";
5905
6093
  }
@@ -6424,10 +6612,9 @@ var init_remote_backend = __esm({
6424
6612
  });
6425
6613
 
6426
6614
  // ../core/src/mutation.ts
6427
- import { setTimeout as delay3 } from "node:timers/promises";
6428
6615
  async function waitForFreshAttempt(error51, attempt) {
6429
6616
  if (error51.retryAfterMs <= 0) return;
6430
- await delay3(error51.retryAfterMs * 4 ** attempt);
6617
+ await new Promise((resolve2) => setTimeout(resolve2, error51.retryAfterMs * 4 ** attempt));
6431
6618
  }
6432
6619
  async function versionedMutation(opts) {
6433
6620
  const maxAttempts = opts.maxAttempts ?? CAS_MAX_ATTEMPTS;
@@ -7536,9 +7723,9 @@ function prepareKindFieldMutation(existing, input, okfVersion) {
7536
7723
  }
7537
7724
  }
7538
7725
  } else {
7539
- for (const list3 of [required2, optional2]) {
7540
- const idx = list3.indexOf(input.field);
7541
- if (idx >= 0) list3.splice(idx, 1);
7726
+ for (const list4 of [required2, optional2]) {
7727
+ const idx = list4.indexOf(input.field);
7728
+ if (idx >= 0) list4.splice(idx, 1);
7542
7729
  }
7543
7730
  deleteOwn(valuesMap, input.field);
7544
7731
  if (descriptionsMap) descriptionDeleted = deleteOwn(descriptionsMap, input.field);
@@ -8005,7 +8192,7 @@ var init_document_mutation = __esm({
8005
8192
  init_kinds();
8006
8193
  init_mutation();
8007
8194
  init_versioning();
8008
- init_bundle();
8195
+ init_bundle_ops();
8009
8196
  DEFAULT_MAX_ATTEMPTS = 5;
8010
8197
  KindConformanceError = class extends InvalidInputError {
8011
8198
  id;
@@ -8852,9 +9039,9 @@ function isShallowRepository(top) {
8852
9039
  function tryFastForwardAdoptLocalBoard(top, localSha, remoteSha) {
8853
9040
  if (localSha.length === 0 || remoteSha.length === 0) return false;
8854
9041
  if (isShallowRepository(top)) return false;
8855
- const list3 = runGit(top, ["worktree", "list", "--porcelain"]);
8856
- if (list3.status !== 0) return false;
8857
- const lines = list3.stdout.split("\n");
9042
+ const list4 = runGit(top, ["worktree", "list", "--porcelain"]);
9043
+ if (list4.status !== 0) return false;
9044
+ const lines = list4.stdout.split("\n");
8858
9045
  if (lines.includes(`branch refs/heads/${BOARD_BRANCH}`)) return false;
8859
9046
  for (const wt of lines.filter((l) => l.startsWith("worktree ")).map((l) => l.slice("worktree ".length))) {
8860
9047
  if (!existsSync(wt)) continue;
@@ -9101,8 +9288,8 @@ function provisionBoardWorktree(dir, budget = {}) {
9101
9288
  `refs/remotes/${BOARD_REF}`
9102
9289
  ]);
9103
9290
  if (r2.status !== 0) {
9104
- const list3 = runGit(top, ["worktree", "list", "--porcelain"]);
9105
- if (list3.status === 0 && list3.stdout.split("\n").includes(`branch refs/heads/${BOARD_BRANCH}`)) {
9291
+ const list4 = runGit(top, ["worktree", "list", "--porcelain"]);
9292
+ if (list4.status === 0 && list4.stdout.split("\n").includes(`branch refs/heads/${BOARD_BRANCH}`)) {
9106
9293
  return withIgnoreCoverage({ kind: "already", boardPath });
9107
9294
  }
9108
9295
  throw classifyGitError(failureOf(["worktree", "add"], r2));
@@ -9937,7 +10124,7 @@ var init_diff = __esm({
9937
10124
 
9938
10125
  // ../board-git/src/cursor.ts
9939
10126
  import { readFile } from "node:fs/promises";
9940
- import { createHash as createHash5 } from "node:crypto";
10127
+ import { createHash as createHash4 } from "node:crypto";
9941
10128
  import { basename, join as join3, resolve } from "node:path";
9942
10129
  function trimTrailing(value, char) {
9943
10130
  let end = value.length;
@@ -9970,7 +10157,7 @@ ${resolve(src.checkoutRoot)}`;
9970
10157
  ${resolve(src.root)}`;
9971
10158
  }
9972
10159
  function keyDigest(key) {
9973
- return createHash5("sha256").update(key, "utf8").digest("hex").slice(0, 32);
10160
+ return createHash4("sha256").update(key, "utf8").digest("hex").slice(0, 32);
9974
10161
  }
9975
10162
  function isRecord3(v2) {
9976
10163
  return typeof v2 === "object" && v2 !== null && !Array.isArray(v2);
@@ -13029,7 +13216,7 @@ var init_bundle2 = __esm({
13029
13216
  });
13030
13217
 
13031
13218
  // src/ui/managed-authority.ts
13032
- import { createHash as createHash6, randomBytes as randomBytes2, randomUUID as randomUUID3 } from "node:crypto";
13219
+ import { createHash as createHash5, randomBytes as randomBytes2, randomUUID as randomUUID3 } from "node:crypto";
13033
13220
  import { spawn } from "node:child_process";
13034
13221
  import { readdir as readdir2, realpath as realpath2, stat as stat2, unlink as unlink2 } from "node:fs/promises";
13035
13222
  import { homedir as homedir6 } from "node:os";
@@ -13055,7 +13242,7 @@ function boundedString(value, max = 4096) {
13055
13242
  }
13056
13243
  function managedUiAuthority(bundleRoot, actor, launchRoot = bundleRoot) {
13057
13244
  const tuple2 = { mode: "dir", bundle_root: bundleRoot, actor: actor ?? null };
13058
- const key = createHash6("sha256").update(JSON.stringify(tuple2)).digest("hex");
13245
+ const key = createHash5("sha256").update(JSON.stringify(tuple2)).digest("hex");
13059
13246
  return { key, ...tuple2, launch_root: launchRoot, protocol: MANAGED_UI_PROTOCOL };
13060
13247
  }
13061
13248
  function validateAuthority(value) {
@@ -47108,8 +47295,8 @@ var init_decode_named_character_reference = __esm({
47108
47295
  });
47109
47296
 
47110
47297
  // ../../node_modules/micromark-util-chunked/index.js
47111
- function splice(list3, start, remove, items) {
47112
- const end = list3.length;
47298
+ function splice(list4, start, remove, items) {
47299
+ const end = list4.length;
47113
47300
  let chunkStart = 0;
47114
47301
  let parameters;
47115
47302
  if (start < 0) {
@@ -47121,22 +47308,22 @@ function splice(list3, start, remove, items) {
47121
47308
  if (items.length < 1e4) {
47122
47309
  parameters = Array.from(items);
47123
47310
  parameters.unshift(start, remove);
47124
- list3.splice(...parameters);
47311
+ list4.splice(...parameters);
47125
47312
  } else {
47126
- if (remove) list3.splice(start, remove);
47313
+ if (remove) list4.splice(start, remove);
47127
47314
  while (chunkStart < items.length) {
47128
47315
  parameters = items.slice(chunkStart, chunkStart + 1e4);
47129
47316
  parameters.unshift(start, 0);
47130
- list3.splice(...parameters);
47317
+ list4.splice(...parameters);
47131
47318
  chunkStart += 1e4;
47132
47319
  start += 1e4;
47133
47320
  }
47134
47321
  }
47135
47322
  }
47136
- function push2(list3, items) {
47137
- if (list3.length > 0) {
47138
- splice(list3, list3.length, 0, items);
47139
- return list3;
47323
+ function push2(list4, items) {
47324
+ if (list4.length > 0) {
47325
+ splice(list4, list4.length, 0, items);
47326
+ return list4;
47140
47327
  }
47141
47328
  return items;
47142
47329
  }
@@ -47176,12 +47363,12 @@ function syntaxExtension(all2, extension2) {
47176
47363
  }
47177
47364
  }
47178
47365
  }
47179
- function constructs(existing, list3) {
47366
+ function constructs(existing, list4) {
47180
47367
  let index2 = -1;
47181
47368
  const before = [];
47182
- while (++index2 < list3.length) {
47369
+ while (++index2 < list4.length) {
47183
47370
  ;
47184
- (list3[index2].add === "after" ? existing : before).push(list3[index2]);
47371
+ (list4[index2].add === "after" ? existing : before).push(list4[index2]);
47185
47372
  }
47186
47373
  splice(existing, 0, 0, before);
47187
47374
  }
@@ -48424,13 +48611,13 @@ var init_code_text = __esm({
48424
48611
  });
48425
48612
 
48426
48613
  // ../../node_modules/micromark-util-subtokenize/lib/splice-buffer.js
48427
- function chunkedPush(list3, right) {
48614
+ function chunkedPush(list4, right) {
48428
48615
  let chunkStart = 0;
48429
48616
  if (right.length < 1e4) {
48430
- list3.push(...right);
48617
+ list4.push(...right);
48431
48618
  } else {
48432
48619
  while (chunkStart < right.length) {
48433
- list3.push(...right.slice(chunkStart, chunkStart + 1e4));
48620
+ list4.push(...right.slice(chunkStart, chunkStart + 1e4));
48434
48621
  chunkStart += 1e4;
48435
48622
  }
48436
48623
  }
@@ -50609,7 +50796,7 @@ function tokenizeListContinuation(effects, ok4, nok) {
50609
50796
  function notInCurrentItem(code3) {
50610
50797
  self.containerState._closeFlow = true;
50611
50798
  self.interrupt = void 0;
50612
- return factorySpace(effects, effects.attempt(list, ok4, nok), "linePrefix", self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(code3);
50799
+ return factorySpace(effects, effects.attempt(list2, ok4, nok), "linePrefix", self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(code3);
50613
50800
  }
50614
50801
  }
50615
50802
  function tokenizeIndent(effects, ok4, nok) {
@@ -50631,7 +50818,7 @@ function tokenizeListItemPrefixWhitespace(effects, ok4, nok) {
50631
50818
  return !markdownSpace(code3) && tail && tail[1].type === "listItemPrefixWhitespace" ? ok4(code3) : nok(code3);
50632
50819
  }
50633
50820
  }
50634
- var list, listItemPrefixWhitespaceConstruct, indentConstruct;
50821
+ var list2, listItemPrefixWhitespaceConstruct, indentConstruct;
50635
50822
  var init_list = __esm({
50636
50823
  "../../node_modules/micromark-core-commonmark/lib/list.js"() {
50637
50824
  init_define_SUPERBEE_BUILD_IDENTITY();
@@ -50640,7 +50827,7 @@ var init_list = __esm({
50640
50827
  init_micromark_util_character();
50641
50828
  init_blank_line();
50642
50829
  init_thematic_break();
50643
- list = {
50830
+ list2 = {
50644
50831
  continuation: {
50645
50832
  tokenize: tokenizeListContinuation
50646
50833
  },
@@ -50872,11 +51059,11 @@ function initializeFactory(field) {
50872
51059
  if (code3 === null) {
50873
51060
  return true;
50874
51061
  }
50875
- const list3 = constructs2[code3];
51062
+ const list4 = constructs2[code3];
50876
51063
  let index2 = -1;
50877
- if (list3) {
50878
- while (++index2 < list3.length) {
50879
- const item = list3[index2];
51064
+ if (list4) {
51065
+ while (++index2 < list4.length) {
51066
+ const item = list4[index2];
50880
51067
  if (!item.previous || item.previous.call(self, self.previous)) {
50881
51068
  return true;
50882
51069
  }
@@ -51004,19 +51191,19 @@ var init_constructs = __esm({
51004
51191
  init_micromark_core_commonmark();
51005
51192
  init_text();
51006
51193
  document3 = {
51007
- [42]: list,
51008
- [43]: list,
51009
- [45]: list,
51010
- [48]: list,
51011
- [49]: list,
51012
- [50]: list,
51013
- [51]: list,
51014
- [52]: list,
51015
- [53]: list,
51016
- [54]: list,
51017
- [55]: list,
51018
- [56]: list,
51019
- [57]: list,
51194
+ [42]: list2,
51195
+ [43]: list2,
51196
+ [45]: list2,
51197
+ [48]: list2,
51198
+ [49]: list2,
51199
+ [50]: list2,
51200
+ [51]: list2,
51201
+ [52]: list2,
51202
+ [53]: list2,
51203
+ [54]: list2,
51204
+ [55]: list2,
51205
+ [56]: list2,
51206
+ [57]: list2,
51020
51207
  [62]: blockQuote
51021
51208
  };
51022
51209
  contentInitial = {
@@ -51234,22 +51421,22 @@ function createTokenizer(parser, initialize, from) {
51234
51421
  function start(code3) {
51235
51422
  const left = code3 !== null && map2[code3];
51236
51423
  const all2 = code3 !== null && map2.null;
51237
- const list3 = [
51424
+ const list4 = [
51238
51425
  // To do: add more extension tests.
51239
51426
  /* c8 ignore next 2 */
51240
51427
  ...Array.isArray(left) ? left : left ? [left] : [],
51241
51428
  ...Array.isArray(all2) ? all2 : all2 ? [all2] : []
51242
51429
  ];
51243
- return handleListOfConstructs(list3)(code3);
51430
+ return handleListOfConstructs(list4)(code3);
51244
51431
  }
51245
51432
  }
51246
- function handleListOfConstructs(list3) {
51247
- listOfConstructs = list3;
51433
+ function handleListOfConstructs(list4) {
51434
+ listOfConstructs = list4;
51248
51435
  constructIndex = 0;
51249
- if (list3.length === 0) {
51436
+ if (list4.length === 0) {
51250
51437
  return bogusState;
51251
51438
  }
51252
- return handleConstruct(list3[constructIndex]);
51439
+ return handleConstruct(list4[constructIndex]);
51253
51440
  }
51254
51441
  function handleConstruct(construct) {
51255
51442
  return start;
@@ -51661,8 +51848,8 @@ function compiler(options) {
51661
51848
  link: opener(link3),
51662
51849
  listItem: opener(listItem),
51663
51850
  listItemValue: onenterlistitemvalue,
51664
- listOrdered: opener(list3, onenterlistordered),
51665
- listUnordered: opener(list3),
51851
+ listOrdered: opener(list4, onenterlistordered),
51852
+ listUnordered: opener(list4),
51666
51853
  paragraph: opener(paragraph),
51667
51854
  reference: onenterreference,
51668
51855
  referenceString: buffer,
@@ -52218,7 +52405,7 @@ function compiler(options) {
52218
52405
  children: []
52219
52406
  };
52220
52407
  }
52221
- function list3(token) {
52408
+ function list4(token) {
52222
52409
  return {
52223
52410
  type: "list",
52224
52411
  ordered: token.type === "listOrdered",
@@ -54019,10 +54206,10 @@ var init_unist_util_visit_parents = __esm({
54019
54206
  });
54020
54207
 
54021
54208
  // ../../node_modules/mdast-util-find-and-replace/lib/index.js
54022
- function findAndReplace(tree, list3, options) {
54209
+ function findAndReplace(tree, list4, options) {
54023
54210
  const settings = options || {};
54024
54211
  const ignored = convert(settings.ignore || []);
54025
- const pairs = toPairs(list3);
54212
+ const pairs = toPairs(list4);
54026
54213
  let pairIndex = -1;
54027
54214
  while (++pairIndex < pairs.length) {
54028
54215
  visitParents(tree, "text", visitor);
@@ -54106,10 +54293,10 @@ function toPairs(tupleOrList) {
54106
54293
  if (!Array.isArray(tupleOrList)) {
54107
54294
  throw new TypeError("Expected find and replace tuple or list of tuples");
54108
54295
  }
54109
- const list3 = !tupleOrList[0] || Array.isArray(tupleOrList[0]) ? tupleOrList : [tupleOrList];
54296
+ const list4 = !tupleOrList[0] || Array.isArray(tupleOrList[0]) ? tupleOrList : [tupleOrList];
54110
54297
  let index2 = -1;
54111
- while (++index2 < list3.length) {
54112
- const tuple2 = list3[index2];
54298
+ while (++index2 < list4.length) {
54299
+ const tuple2 = list4[index2];
54113
54300
  result3.push([toExpression(tuple2[0]), toFunction(tuple2[1])]);
54114
54301
  }
54115
54302
  return result3;
@@ -55721,7 +55908,7 @@ var init_sharing = __esm({
55721
55908
  });
55722
55909
 
55723
55910
  // src/ui/view-authorizations.ts
55724
- import { createHash as createHash7 } from "node:crypto";
55911
+ import { createHash as createHash6 } from "node:crypto";
55725
55912
  import { homedir as homedir8 } from "node:os";
55726
55913
  import { join as join6 } from "node:path";
55727
55914
  function stableRecord(bundle, subject) {
@@ -55771,12 +55958,12 @@ function assertMigratableViewAuthorization(name, raw) {
55771
55958
  }
55772
55959
  const canonical = JSON.stringify(value);
55773
55960
  if (raw !== `${canonical}
55774
- ` || name !== `${createHash7("sha256").update(canonical).digest("hex")}.json`) {
55961
+ ` || name !== `${createHash6("sha256").update(canonical).digest("hex")}.json`) {
55775
55962
  throw new Error("legacy View authorization does not match its immutable identity");
55776
55963
  }
55777
55964
  }
55778
55965
  function fileName(bundle, subject) {
55779
- return `${createHash7("sha256").update(serialized(bundle, subject)).digest("hex")}.json`;
55966
+ return `${createHash6("sha256").update(serialized(bundle, subject)).digest("hex")}.json`;
55780
55967
  }
55781
55968
  var STORE_DIR, LocalViewAuthorizationStore;
55782
55969
  var init_view_authorizations = __esm({
@@ -63963,9 +64150,9 @@ function collectLinkDeclarations(registry2) {
63963
64150
  for (const kind2 of registry2.kinds.values()) {
63964
64151
  if (!kind2.links) continue;
63965
64152
  for (const [text4, target] of Object.entries(kind2.links)) {
63966
- const list3 = byText.get(text4) ?? [];
63967
- list3.push({ governs: kind2.governs, target });
63968
- byText.set(text4, list3);
64153
+ const list4 = byText.get(text4) ?? [];
64154
+ list4.push({ governs: kind2.governs, target });
64155
+ byText.set(text4, list4);
63969
64156
  }
63970
64157
  }
63971
64158
  return byText;
@@ -64576,7 +64763,7 @@ var init_meaningful_change_order = __esm({
64576
64763
 
64577
64764
  // src/commands/list.ts
64578
64765
  import { parseArgs as parseArgs15 } from "node:util";
64579
- async function list2(argv2, deps = {}) {
64766
+ async function list3(argv2, deps = {}) {
64580
64767
  const stdout = deps.stdout ?? ((s) => void process.stdout.write(s));
64581
64768
  const { values } = parseLeafOrUsage(
64582
64769
  () => parseArgs15({
@@ -64889,7 +65076,7 @@ bundle's compatible storage coordinate through each document's declared Kind.
64889
65076
  });
64890
65077
 
64891
65078
  // src/kind-draft.ts
64892
- import { createHash as createHash8 } from "node:crypto";
65079
+ import { createHash as createHash7 } from "node:crypto";
64893
65080
  function kindDeclaresAnything(kind2) {
64894
65081
  return Object.values(DECLARES).some((declares) => declares(kind2));
64895
65082
  }
@@ -65003,7 +65190,7 @@ function warningsAfterApply(kind2, instances) {
65003
65190
  return total;
65004
65191
  }
65005
65192
  function draftPlanToken(input) {
65006
- return `sha256:${createHash8("sha256").update(JSON.stringify(input), "utf8").digest("hex")}`;
65193
+ return `sha256:${createHash7("sha256").update(JSON.stringify(input), "utf8").digest("hex")}`;
65007
65194
  }
65008
65195
  var ENUM_MIN_INSTANCES, ENUM_MIN_DISTINCT, ENUM_MAX_DISTINCT, SECTION_PROMOTION_FLOOR, EXCLUDED_FIELDS, FIELDS_DECLARES, DECLARES;
65009
65196
  var init_kind_draft = __esm({
@@ -66429,7 +66616,7 @@ Options:
66429
66616
  });
66430
66617
 
66431
66618
  // src/recipe-evolution.ts
66432
- import { createHash as createHash9 } from "node:crypto";
66619
+ import { createHash as createHash8 } from "node:crypto";
66433
66620
  import { isDeepStrictEqual as isDeepStrictEqual2 } from "node:util";
66434
66621
  function plainRecord2(value) {
66435
66622
  return value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
@@ -66633,7 +66820,7 @@ function monotonicEvolutionBlockers(current, desired, blockers) {
66633
66820
  }
66634
66821
  }
66635
66822
  function evolutionPlanToken(input) {
66636
- return `sha256:${createHash9("sha256").update(JSON.stringify(input), "utf8").digest("hex")}`;
66823
+ return `sha256:${createHash8("sha256").update(JSON.stringify(input), "utf8").digest("hex")}`;
66637
66824
  }
66638
66825
  async function prepareRecipeEvolution(bundle, sourceRecipe) {
66639
66826
  const okfVersion = await readBundleOkfVersion2(bundle) ?? "0.1";
@@ -67408,9 +67595,9 @@ async function status(argv2, deps = {}) {
67408
67595
  }
67409
67596
  if (l.to !== doc2.id) {
67410
67597
  inbound.add(l.to);
67411
- const list3 = inboundEdges.get(l.to) ?? [];
67412
- list3.push({ text: l.text, sourceType: docType2(doc2) });
67413
- inboundEdges.set(l.to, list3);
67598
+ const list4 = inboundEdges.get(l.to) ?? [];
67599
+ list4.push({ text: l.text, sourceType: docType2(doc2) });
67600
+ inboundEdges.set(l.to, list4);
67414
67601
  }
67415
67602
  const declared = linkTypeDeclarations.get(l.text);
67416
67603
  if (declared && declared.length > 0) {
@@ -91635,7 +91822,7 @@ function K3(Z, $, J, X) {
91635
91822
  function N3(Z, $, J, X, V) {
91636
91823
  return Z.registerResource($, J, { mimeType: p, ...X }, V);
91637
91824
  }
91638
- var r, v, K, QQ, ZQ, $Q, I, P, w, JQ, Y, j, XQ, H, _, A, f, u, E, VQ, O, DQ, d, h, LQ, WQ, BQ, R, m, GQ, dQ, KQ, NQ, YQ, U, T, k, jQ, FQ, M, C, p;
91825
+ var r, v, K2, QQ, ZQ, $Q, I, P, w, JQ, Y, j, XQ, H, _, A, f, u, E, VQ, O, DQ, d, h, LQ, WQ, BQ, R, m, GQ, dQ, KQ, NQ, YQ, U, T, k, jQ, FQ, M, C, p;
91639
91826
  var init_server3 = __esm({
91640
91827
  "../../node_modules/@modelcontextprotocol/ext-apps/dist/src/server/index.js"() {
91641
91828
  init_define_SUPERBEE_BUILD_IDENTITY();
@@ -91651,7 +91838,7 @@ var init_server3 = __esm({
91651
91838
  throw Error('Dynamic require of "' + Z + '" is not supported');
91652
91839
  });
91653
91840
  v = external_exports.union([external_exports.literal("light"), external_exports.literal("dark")]).describe("Color theme preference for the host environment.");
91654
- K = external_exports.union([external_exports.literal("inline"), external_exports.literal("fullscreen"), external_exports.literal("pip")]).describe("Display mode for UI presentation.");
91841
+ K2 = external_exports.union([external_exports.literal("inline"), external_exports.literal("fullscreen"), external_exports.literal("pip")]).describe("Display mode for UI presentation.");
91655
91842
  QQ = external_exports.union([external_exports.literal("--color-background-primary"), external_exports.literal("--color-background-secondary"), external_exports.literal("--color-background-tertiary"), external_exports.literal("--color-background-inverse"), external_exports.literal("--color-background-ghost"), external_exports.literal("--color-background-info"), external_exports.literal("--color-background-danger"), external_exports.literal("--color-background-success"), external_exports.literal("--color-background-warning"), external_exports.literal("--color-background-disabled"), external_exports.literal("--color-text-primary"), external_exports.literal("--color-text-secondary"), external_exports.literal("--color-text-tertiary"), external_exports.literal("--color-text-inverse"), external_exports.literal("--color-text-ghost"), external_exports.literal("--color-text-info"), external_exports.literal("--color-text-danger"), external_exports.literal("--color-text-success"), external_exports.literal("--color-text-warning"), external_exports.literal("--color-text-disabled"), external_exports.literal("--color-border-primary"), external_exports.literal("--color-border-secondary"), external_exports.literal("--color-border-tertiary"), external_exports.literal("--color-border-inverse"), external_exports.literal("--color-border-ghost"), external_exports.literal("--color-border-info"), external_exports.literal("--color-border-danger"), external_exports.literal("--color-border-success"), external_exports.literal("--color-border-warning"), external_exports.literal("--color-border-disabled"), external_exports.literal("--color-ring-primary"), external_exports.literal("--color-ring-secondary"), external_exports.literal("--color-ring-inverse"), external_exports.literal("--color-ring-info"), external_exports.literal("--color-ring-danger"), external_exports.literal("--color-ring-success"), external_exports.literal("--color-ring-warning"), external_exports.literal("--font-sans"), external_exports.literal("--font-mono"), external_exports.literal("--font-weight-normal"), external_exports.literal("--font-weight-medium"), external_exports.literal("--font-weight-semibold"), external_exports.literal("--font-weight-bold"), external_exports.literal("--font-text-xs-size"), external_exports.literal("--font-text-sm-size"), external_exports.literal("--font-text-md-size"), external_exports.literal("--font-text-lg-size"), external_exports.literal("--font-heading-xs-size"), external_exports.literal("--font-heading-sm-size"), external_exports.literal("--font-heading-md-size"), external_exports.literal("--font-heading-lg-size"), external_exports.literal("--font-heading-xl-size"), external_exports.literal("--font-heading-2xl-size"), external_exports.literal("--font-heading-3xl-size"), external_exports.literal("--font-text-xs-line-height"), external_exports.literal("--font-text-sm-line-height"), external_exports.literal("--font-text-md-line-height"), external_exports.literal("--font-text-lg-line-height"), external_exports.literal("--font-heading-xs-line-height"), external_exports.literal("--font-heading-sm-line-height"), external_exports.literal("--font-heading-md-line-height"), external_exports.literal("--font-heading-lg-line-height"), external_exports.literal("--font-heading-xl-line-height"), external_exports.literal("--font-heading-2xl-line-height"), external_exports.literal("--font-heading-3xl-line-height"), external_exports.literal("--border-radius-xs"), external_exports.literal("--border-radius-sm"), external_exports.literal("--border-radius-md"), external_exports.literal("--border-radius-lg"), external_exports.literal("--border-radius-xl"), external_exports.literal("--border-radius-full"), external_exports.literal("--border-width-regular"), external_exports.literal("--shadow-hairline"), external_exports.literal("--shadow-sm"), external_exports.literal("--shadow-md"), external_exports.literal("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming.");
91656
91843
  ZQ = external_exports.record(QQ.describe(`Style variables for theming MCP apps.
91657
91844
 
@@ -91693,7 +91880,7 @@ for compatibility with Zod schema generation. Both are functionally equivalent f
91693
91880
  O = external_exports.object({ text: external_exports.object({}).optional().describe("Host supports text content blocks."), image: external_exports.object({}).optional().describe("Host supports image content blocks."), audio: external_exports.object({}).optional().describe("Host supports audio content blocks."), resource: external_exports.object({}).optional().describe("Host supports resource content blocks."), resourceLink: external_exports.object({}).optional().describe("Host supports resource link content blocks."), structuredContent: external_exports.object({}).optional().describe("Host supports structured content.") });
91694
91881
  DQ = external_exports.object({ method: external_exports.literal("ui/notifications/request-teardown"), params: external_exports.object({}).optional() });
91695
91882
  d = external_exports.object({ experimental: external_exports.record(external_exports.string(), external_exports.record(external_exports.string(), external_exports.any()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed by identifier."), openLinks: external_exports.object({}).optional().describe("Host supports opening external URLs."), downloadFile: external_exports.object({}).optional().describe("Host supports file downloads via ui/download-file."), serverTools: external_exports.object({ listChanged: external_exports.boolean().optional().describe("Host supports tools/list_changed notifications.") }).optional().describe("Host can proxy tool calls to the MCP server."), serverResources: external_exports.object({ listChanged: external_exports.boolean().optional().describe("Host supports resources/list_changed notifications.") }).optional().describe("Host can proxy resource reads to the MCP server."), logging: external_exports.object({}).optional().describe("Host accepts log messages."), sandbox: external_exports.object({ permissions: j.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."), csp: Y.optional().describe("CSP domains approved by the host.") }).optional().describe("Sandbox configuration applied by the host."), updateModelContext: O.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."), message: O.optional().describe("Host supports receiving content messages (ui/message) from the view."), sampling: external_exports.object({ tools: external_exports.object({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.") }).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.") });
91696
- h = external_exports.object({ experimental: external_exports.record(external_exports.string(), external_exports.record(external_exports.string(), external_exports.any()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed by identifier."), tools: external_exports.object({ listChanged: external_exports.boolean().optional().describe("App supports tools/list_changed notifications.") }).optional().describe("App exposes MCP-style tools that the host can call."), availableDisplayModes: external_exports.array(K).optional().describe("Display modes the app supports.") });
91883
+ h = external_exports.object({ experimental: external_exports.record(external_exports.string(), external_exports.record(external_exports.string(), external_exports.any()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed by identifier."), tools: external_exports.object({ listChanged: external_exports.boolean().optional().describe("App supports tools/list_changed notifications.") }).optional().describe("App exposes MCP-style tools that the host can call."), availableDisplayModes: external_exports.array(K2).optional().describe("Display modes the app supports.") });
91697
91884
  LQ = external_exports.object({ method: external_exports.literal("ui/notifications/initialized"), params: external_exports.object({}).optional() });
91698
91885
  WQ = external_exports.object({ csp: Y.optional().describe("Content Security Policy configuration for UI resources."), permissions: j.optional().describe("Sandbox permissions requested by the UI resource."), domain: external_exports.string().optional().describe(`Dedicated origin for view sandbox.
91699
91886
 
@@ -91710,8 +91897,8 @@ Boolean requesting whether a visible border and background is provided by the ho
91710
91897
  - \`true\`: request visible border + background
91711
91898
  - \`false\`: request no visible border + background
91712
91899
  - omitted: host decides border`) });
91713
- BQ = external_exports.object({ method: external_exports.literal("ui/request-display-mode"), params: external_exports.object({ mode: K.describe("The display mode being requested.") }) });
91714
- R = external_exports.object({ mode: K.describe("The display mode that was actually set. May differ from requested if not supported.") }).passthrough();
91900
+ BQ = external_exports.object({ method: external_exports.literal("ui/request-display-mode"), params: external_exports.object({ mode: K2.describe("The display mode being requested.") }) });
91901
+ R = external_exports.object({ mode: K2.describe("The display mode that was actually set. May differ from requested if not supported.") }).passthrough();
91715
91902
  m = external_exports.union([external_exports.literal("model"), external_exports.literal("app")]).describe("Tool visibility scope - who can access the tool.");
91716
91903
  GQ = external_exports.object({ resourceUri: external_exports.string().optional(), visibility: external_exports.array(m).optional().describe(`Who can access this tool. Default: ["model", "app"]
91717
91904
  - "model": Tool visible to and callable by the agent
@@ -91721,7 +91908,7 @@ Boolean requesting whether a visible border and background is provided by the ho
91721
91908
  NQ = external_exports.object({ method: external_exports.literal("ui/message"), params: external_exports.object({ role: external_exports.literal("user").describe('Message role, currently only "user" is supported.'), content: external_exports.array(ContentBlockSchema).describe("Message content blocks (text, image, etc.).") }) });
91722
91909
  YQ = external_exports.object({ method: external_exports.literal("ui/notifications/sandbox-resource-ready"), params: external_exports.object({ html: external_exports.string().describe("HTML content to load into the inner iframe."), sandbox: external_exports.string().optional().describe("Optional override for the inner iframe's sandbox attribute."), csp: Y.optional().describe("CSP configuration from resource metadata."), permissions: j.optional().describe("Sandbox permissions from resource metadata.") }) });
91723
91910
  U = external_exports.object({ method: external_exports.literal("ui/notifications/tool-result"), params: CallToolResultSchema.describe("Standard MCP tool execution result.") });
91724
- T = external_exports.object({ toolInfo: external_exports.object({ id: RequestIdSchema.optional().describe("JSON-RPC id of the tools/call request."), tool: ToolSchema.describe("Tool definition including name, inputSchema, etc.") }).optional().describe("Metadata of the tool call that instantiated this App."), theme: v.optional().describe("Current color theme preference."), styles: u.optional().describe("Style configuration for theming the app."), displayMode: K.optional().describe("How the UI is currently displayed."), availableDisplayModes: external_exports.array(K).optional().describe("Display modes the host supports."), containerDimensions: external_exports.union([external_exports.object({ height: external_exports.number().describe("Fixed container height in pixels.") }), external_exports.object({ maxHeight: external_exports.union([external_exports.number(), external_exports.undefined()]).optional().describe("Maximum container height in pixels.") })]).and(external_exports.union([external_exports.object({ width: external_exports.number().describe("Fixed container width in pixels.") }), external_exports.object({ maxWidth: external_exports.union([external_exports.number(), external_exports.undefined()]).optional().describe("Maximum container width in pixels.") })])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
91911
+ T = external_exports.object({ toolInfo: external_exports.object({ id: RequestIdSchema.optional().describe("JSON-RPC id of the tools/call request."), tool: ToolSchema.describe("Tool definition including name, inputSchema, etc.") }).optional().describe("Metadata of the tool call that instantiated this App."), theme: v.optional().describe("Current color theme preference."), styles: u.optional().describe("Style configuration for theming the app."), displayMode: K2.optional().describe("How the UI is currently displayed."), availableDisplayModes: external_exports.array(K2).optional().describe("Display modes the host supports."), containerDimensions: external_exports.union([external_exports.object({ height: external_exports.number().describe("Fixed container height in pixels.") }), external_exports.object({ maxHeight: external_exports.union([external_exports.number(), external_exports.undefined()]).optional().describe("Maximum container height in pixels.") })]).and(external_exports.union([external_exports.object({ width: external_exports.number().describe("Fixed container width in pixels.") }), external_exports.object({ maxWidth: external_exports.union([external_exports.number(), external_exports.undefined()]).optional().describe("Maximum container width in pixels.") })])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
91725
91912
  container holding the app. Specify either width or maxWidth, and either height or maxHeight.`), locale: external_exports.string().optional().describe("User's language and region preference in BCP 47 format."), timeZone: external_exports.string().optional().describe("User's timezone in IANA format."), userAgent: external_exports.string().optional().describe("Host application identifier."), platform: external_exports.union([external_exports.literal("web"), external_exports.literal("desktop"), external_exports.literal("mobile")]).optional().describe("Platform type for responsive design decisions."), deviceCapabilities: external_exports.object({ touch: external_exports.boolean().optional().describe("Whether the device supports touch input."), hover: external_exports.boolean().optional().describe("Whether the device supports hover interactions.") }).optional().describe("Device input capabilities."), safeAreaInsets: external_exports.object({ top: external_exports.number().describe("Top safe area inset in pixels."), right: external_exports.number().describe("Right safe area inset in pixels."), bottom: external_exports.number().describe("Bottom safe area inset in pixels."), left: external_exports.number().describe("Left safe area inset in pixels.") }).optional().describe("Mobile safe area boundaries in pixels.") }).passthrough();
91726
91913
  k = external_exports.object({ method: external_exports.literal("ui/notifications/host-context-changed"), params: T.describe("Partial context update containing only changed fields.") });
91727
91914
  jQ = external_exports.object({ method: external_exports.literal("ui/update-model-context"), params: external_exports.object({ content: external_exports.array(ContentBlockSchema).optional().describe("Context content blocks (text, image, etc.)."), structuredContent: external_exports.record(external_exports.string(), external_exports.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.") }) });
@@ -98924,8 +99111,8 @@ var require_dist = __commonJS({
98924
99111
  return ajv;
98925
99112
  }
98926
99113
  const [formats, exportName] = opts.mode === "fast" ? [formats_1.fastFormats, fastName] : [formats_1.fullFormats, fullName];
98927
- const list3 = opts.formats || formats_1.formatNames;
98928
- addFormats(ajv, list3, formats, exportName);
99114
+ const list4 = opts.formats || formats_1.formatNames;
99115
+ addFormats(ajv, list4, formats, exportName);
98929
99116
  if (opts.keywords)
98930
99117
  (0, limit_1.default)(ajv);
98931
99118
  return ajv;
@@ -98937,11 +99124,11 @@ var require_dist = __commonJS({
98937
99124
  throw new Error(`Unknown format "${name}"`);
98938
99125
  return f2;
98939
99126
  };
98940
- function addFormats(ajv, list3, fs10, exportName) {
99127
+ function addFormats(ajv, list4, fs10, exportName) {
98941
99128
  var _a3;
98942
99129
  var _b;
98943
99130
  (_a3 = (_b = ajv.opts.code).formats) !== null && _a3 !== void 0 ? _a3 : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
98944
- for (const f2 of list3)
99131
+ for (const f2 of list4)
98945
99132
  ajv.addFormat(f2, fs10[f2]);
98946
99133
  }
98947
99134
  module.exports = exports = formatsPlugin;
@@ -109088,7 +109275,7 @@ var init_skill_compatibility = __esm({
109088
109275
  });
109089
109276
 
109090
109277
  // src/commands/skill.ts
109091
- import { createHash as createHash10 } from "node:crypto";
109278
+ import { createHash as createHash9 } from "node:crypto";
109092
109279
  import { existsSync as existsSync9, lstatSync as lstatSync9, readFileSync as readFileSync14, readdirSync as readdirSync3, realpathSync as realpathSync15, renameSync as renameSync7, rmSync as rmSync5, rmdirSync as rmdirSync3 } from "node:fs";
109093
109280
  import { homedir as homedir17 } from "node:os";
109094
109281
  import path38 from "node:path";
@@ -109129,7 +109316,7 @@ function resolveSkillAssets(executable) {
109129
109316
  const fileSha256 = Object.fromEntries(
109130
109317
  files.map((relativePath) => [
109131
109318
  relativePath,
109132
- `sha256:${createHash10("sha256").update(readFileSync14(join12(root, relativePath))).digest("hex")}`
109319
+ `sha256:${createHash9("sha256").update(readFileSync14(join12(root, relativePath))).digest("hex")}`
109133
109320
  ])
109134
109321
  );
109135
109322
  return {
@@ -109485,7 +109672,7 @@ function skillStatusForDir(dir, assets, installCommand = `${cliInvocation()} ski
109485
109672
  const installed = read.bytes;
109486
109673
  const shipped = readFileSync14(join12(assets.root, relativePath));
109487
109674
  if (!installed.equals(shipped)) assetsMatch = false;
109488
- if (manifest.kind === "v2" && manifest.file_sha256?.[relativePath] !== `sha256:${createHash10("sha256").update(installed).digest("hex")}`) {
109675
+ if (manifest.kind === "v2" && manifest.file_sha256?.[relativePath] !== `sha256:${createHash9("sha256").update(installed).digest("hex")}`) {
109489
109676
  receiptDigestsMatch = false;
109490
109677
  }
109491
109678
  }
@@ -112011,7 +112198,7 @@ var init_setup_plan = __esm({
112011
112198
  });
112012
112199
 
112013
112200
  // src/user-state-migration.ts
112014
- import { createHash as createHash11 } from "node:crypto";
112201
+ import { createHash as createHash10 } from "node:crypto";
112015
112202
  import {
112016
112203
  chmod as chmod2,
112017
112204
  lstat as lstat2,
@@ -112028,7 +112215,7 @@ function errno3(error51) {
112028
112215
  return error51?.code;
112029
112216
  }
112030
112217
  function digest(bytes) {
112031
- return createHash11("sha256").update(bytes).digest("hex");
112218
+ return createHash10("sha256").update(bytes).digest("hex");
112032
112219
  }
112033
112220
  function isRecord10(value) {
112034
112221
  return value !== null && typeof value === "object" && !Array.isArray(value);
@@ -112195,7 +112382,7 @@ async function ensureMigrationParent(input) {
112195
112382
  if (!(await stat5(parent)).isDirectory()) throw new Error("canonical state parent is unsafe");
112196
112383
  }
112197
112384
  function migrationTemporaryPath(root, relative2) {
112198
- const digest2 = createHash11("sha256").update(relative2).digest("hex").slice(0, 24);
112385
+ const digest2 = createHash10("sha256").update(relative2).digest("hex").slice(0, 24);
112199
112386
  return join13(root, dirname7(relative2), `.migration-${digest2}.tmp`);
112200
112387
  }
112201
112388
  async function sweepOwnedStagingTemporaries(root, records) {
@@ -112938,8 +113125,8 @@ var init_cli2 = __esm({
112938
113125
  blobs,
112939
113126
  delete: deleteCommand,
112940
113127
  link,
112941
- list: list2,
112942
- query: list2,
113128
+ list: list3,
113129
+ query: list3,
112943
113130
  new: newCommand,
112944
113131
  artifact,
112945
113132
  kinds,