@valbuild/shared 0.150.8 → 0.150.11

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.
Files changed (51) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/client/dist/valbuild-shared-client.cjs.dev.js +16 -2
  3. package/client/dist/valbuild-shared-client.cjs.prod.js +16 -2
  4. package/client/dist/valbuild-shared-client.esm.js +2 -2
  5. package/dist/{acquireTypes-dd976839.cjs.prod.js → acquireTypes-6250a305.cjs.prod.js} +46 -46
  6. package/dist/{acquireTypes-6e2f7961.esm.js → acquireTypes-c2227b23.esm.js} +2 -2
  7. package/dist/{acquireTypes-84a4077a.cjs.dev.js → acquireTypes-c9e757a1.cjs.dev.js} +46 -46
  8. package/dist/{slicedToArray-22567815.esm.js → createForOfIteratorHelper-9b80f1a2.esm.js} +136 -106
  9. package/dist/{slicedToArray-d99b4e2e.cjs.prod.js → createForOfIteratorHelper-9ca2078d.cjs.prod.js} +142 -111
  10. package/dist/{slicedToArray-c8a29f6b.cjs.dev.js → createForOfIteratorHelper-f2d7ac6d.cjs.dev.js} +142 -111
  11. package/dist/declarations/src/client/index.d.ts +2 -0
  12. package/dist/declarations/src/internal/ApiRoutes.d.ts +23 -0
  13. package/dist/declarations/src/internal/index.d.ts +2 -0
  14. package/dist/declarations/src/internal/pageInspection.d.ts +117 -0
  15. package/dist/declarations/src/internal/quickPreview.d.ts +91 -0
  16. package/dist/declarations/src/internal/valCanvasProtocol.d.ts +53 -0
  17. package/dist/declarations/src/publish/buildProposal.d.ts +16 -1
  18. package/dist/declarations/src/publish/buildQuickPreview.d.ts +46 -0
  19. package/dist/declarations/src/publish/index.d.ts +3 -2
  20. package/dist/declarations/src/publish/runStudioDeploy.d.ts +10 -0
  21. package/dist/getSitemapTree-5354ce90.cjs.prod.js +1421 -0
  22. package/dist/getSitemapTree-97b3166f.esm.js +1381 -0
  23. package/dist/getSitemapTree-d934ff9c.cjs.dev.js +1421 -0
  24. package/dist/{proposalProject-689c24cc.esm.js → proposalProject-5da177d5.esm.js} +1 -2
  25. package/dist/{proposalProject-926f2c68.cjs.dev.js → proposalProject-76caa377.cjs.prod.js} +2 -3
  26. package/dist/{proposalProject-fab0c026.cjs.prod.js → proposalProject-81fee08f.cjs.dev.js} +2 -3
  27. package/dist/{protocol-7ddc1a71.esm.js → protocol-55cfa3cf.esm.js} +1 -1
  28. package/dist/{protocol-4e2a455b.cjs.prod.js → protocol-b1055ef0.cjs.prod.js} +6 -6
  29. package/dist/{protocol-ac1c3ec7.cjs.dev.js → protocol-d0efb8cd.cjs.dev.js} +6 -6
  30. package/dist/wrapNativeSuper-639b12b7.esm.js +107 -0
  31. package/dist/wrapNativeSuper-8673414f.cjs.prod.js +113 -0
  32. package/dist/wrapNativeSuper-933f991e.cjs.dev.js +113 -0
  33. package/internal/dist/valbuild-shared-internal.cjs.dev.js +72 -34
  34. package/internal/dist/valbuild-shared-internal.cjs.prod.js +72 -34
  35. package/internal/dist/valbuild-shared-internal.esm.js +30 -7
  36. package/package.json +2 -2
  37. package/publish/dist/valbuild-shared-publish.cjs.dev.js +589 -237
  38. package/publish/dist/valbuild-shared-publish.cjs.prod.js +589 -237
  39. package/publish/dist/valbuild-shared-publish.esm.js +504 -155
  40. package/typecheck/dist/valbuild-shared-typecheck.cjs.dev.js +34 -34
  41. package/typecheck/dist/valbuild-shared-typecheck.cjs.prod.js +34 -34
  42. package/typecheck/dist/valbuild-shared-typecheck.esm.js +5 -5
  43. package/typecheck/testing/dist/valbuild-shared-typecheck-testing.cjs.dev.js +7 -7
  44. package/typecheck/testing/dist/valbuild-shared-typecheck-testing.cjs.prod.js +7 -7
  45. package/typecheck/testing/dist/valbuild-shared-typecheck-testing.esm.js +3 -3
  46. package/dist/createForOfIteratorHelper-666a6d17.esm.js +0 -137
  47. package/dist/createForOfIteratorHelper-87a33eff.cjs.dev.js +0 -145
  48. package/dist/createForOfIteratorHelper-fef4fa7d.cjs.prod.js +0 -145
  49. package/dist/getSitemapTree-873f7266.cjs.prod.js +0 -743
  50. package/dist/getSitemapTree-b6161fd8.esm.js +0 -717
  51. package/dist/getSitemapTree-be70d9fc.cjs.dev.js +0 -743
@@ -2,14 +2,14 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var createForOfIteratorHelper = require('../../dist/createForOfIteratorHelper-fef4fa7d.cjs.prod.js');
5
+ var createForOfIteratorHelper = require('../../dist/createForOfIteratorHelper-9ca2078d.cjs.prod.js');
6
6
  var core = require('@valbuild/core');
7
- var slicedToArray = require('../../dist/slicedToArray-d99b4e2e.cjs.prod.js');
8
7
  var zod = require('zod');
9
- var protocol = require('../../dist/protocol-4e2a455b.cjs.prod.js');
8
+ var protocol = require('../../dist/protocol-b1055ef0.cjs.prod.js');
10
9
  var zodValidationError = require('zod-validation-error');
11
- var getSitemapTree = require('../../dist/getSitemapTree-873f7266.cjs.prod.js');
10
+ var getSitemapTree = require('../../dist/getSitemapTree-5354ce90.cjs.prod.js');
12
11
  var FlexSearch = require('flexsearch');
12
+ var wrapNativeSuper = require('../../dist/wrapNativeSuper-8673414f.cjs.prod.js');
13
13
  var utils = require('../../dist/utils-32bcaca2.cjs.prod.js');
14
14
 
15
15
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
@@ -1495,6 +1495,23 @@ var PlanRefusalError = zod.z.object({
1495
1495
  */
1496
1496
  var VAL_STUDIO_HEADER = "x-val-studio";
1497
1497
 
1498
+ /**
1499
+ * On a user message in an AI chat: the tools called in the turn it asked for,
1500
+ * as the content server keeps them (valbuild/home `docs/proposals.md`,
1501
+ * Flow H) - what each tool row shows, never what the tool read or wrote.
1502
+ *
1503
+ * A chat with a summary this cannot read loads without its tool rows rather
1504
+ * than not at all, hence the `catch`.
1505
+ */
1506
+ var AIToolCallSummaries = zod.z.array(zod.z.object({
1507
+ toolCallId: zod.z.string(),
1508
+ name: zod.z.string(),
1509
+ isError: zod.z["boolean"](),
1510
+ /** `ask_user_question`: what was asked, and what was answered. */
1511
+ questions: zod.z.array(zod.z.unknown()).optional(),
1512
+ answers: zod.z.array(zod.z.unknown()).optional()
1513
+ })).optional()["catch"](undefined);
1514
+
1498
1515
  /**
1499
1516
  * What Val Build answered, mapped onto the statuses this server speaks: a
1500
1517
  * `code` in the JSON is what the web components act on, so it is passed
@@ -3544,6 +3561,7 @@ var Api = {
3544
3561
  messages: zod.z.array(zod.z.object({
3545
3562
  /** Who asked, on a user message in a proposal's chat. */
3546
3563
  authorId: zod.z.string().nullable().optional(),
3564
+ toolCalls: AIToolCallSummaries,
3547
3565
  role: zod.z.string(),
3548
3566
  content: zod.z.union([zod.z.string(), zod.z.array(zod.z.union([zod.z.object({
3549
3567
  type: zod.z.literal("text"),
@@ -3588,7 +3606,12 @@ var Api = {
3588
3606
  width: zod.z.number(),
3589
3607
  height: zod.z.number(),
3590
3608
  mimeType: zod.z.string()
3591
- })
3609
+ }),
3610
+ /**
3611
+ * SHA-256 of the bytes, hex: what a remote file's ref names.
3612
+ * Absent from a content service that predates it.
3613
+ */
3614
+ sha256: zod.z.string().optional()
3592
3615
  }))
3593
3616
  })
3594
3617
  }), zod.z.object({
@@ -3763,10 +3786,10 @@ var createValClient = function createValClient(host, config, options) {
3763
3786
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3764
3787
  var anyApi = Api;
3765
3788
  return /*#__PURE__*/function () {
3766
- var _ref = slicedToArray._asyncToGenerator(/*#__PURE__*/slicedToArray._regenerator().m(function _callee2(path, method, req) {
3789
+ var _ref = createForOfIteratorHelper._asyncToGenerator(/*#__PURE__*/createForOfIteratorHelper._regenerator().m(function _callee2(path, method, req) {
3767
3790
  var _anyApi$path, _apiEndpoint$req$body;
3768
3791
  var anyReq, fullPath, params, _i, _Object$keys, _anyReq$query, key, _anyReq$query2, _iterator, _step, value, _anyReq$query3, _anyReq$query4, apiEndpoint, reqBodyResult, headers, _i2, _Object$entries, _Object$entries$_i, name, _value, res, _t;
3769
- return slicedToArray._regenerator().w(function (_context2) {
3792
+ return createForOfIteratorHelper._regenerator().w(function (_context2) {
3770
3793
  while (1) switch (_context2.p = _context2.n) {
3771
3794
  case 0:
3772
3795
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -3853,7 +3876,7 @@ var createValClient = function createValClient(host, config, options) {
3853
3876
  };
3854
3877
  if (anyReq !== null && anyReq !== void 0 && anyReq.headers) {
3855
3878
  for (_i2 = 0, _Object$entries = Object.entries(anyReq.headers); _i2 < _Object$entries.length; _i2++) {
3856
- _Object$entries$_i = slicedToArray._slicedToArray(_Object$entries[_i2], 2), name = _Object$entries$_i[0], _value = _Object$entries$_i[1];
3879
+ _Object$entries$_i = createForOfIteratorHelper._slicedToArray(_Object$entries[_i2], 2), name = _Object$entries$_i[0], _value = _Object$entries$_i[1];
3857
3880
  if (typeof _value === "string") {
3858
3881
  headers[name] = _value;
3859
3882
  }
@@ -3866,10 +3889,10 @@ var createValClient = function createValClient(host, config, options) {
3866
3889
  headers: headers,
3867
3890
  body: anyReq.body !== undefined ? JSON.stringify(anyReq.body) : undefined
3868
3891
  }).then(/*#__PURE__*/function () {
3869
- var _ref2 = slicedToArray._asyncToGenerator(/*#__PURE__*/slicedToArray._regenerator().m(function _callee(res) {
3892
+ var _ref2 = createForOfIteratorHelper._asyncToGenerator(/*#__PURE__*/createForOfIteratorHelper._regenerator().m(function _callee(res) {
3870
3893
  var _apiEndpoint$res;
3871
3894
  var contentTypeHeaders, json, valClientResult, message, responseResult;
3872
- return slicedToArray._regenerator().w(function (_context) {
3895
+ return createForOfIteratorHelper._regenerator().w(function (_context) {
3873
3896
  while (1) switch (_context.n) {
3874
3897
  case 0:
3875
3898
  contentTypeHeaders = res.headers.get("content-type");
@@ -4073,7 +4096,7 @@ var urlOf = function urlOf() {
4073
4096
  var query = arguments.length <= 1 ? undefined : arguments[1];
4074
4097
  if (query) {
4075
4098
  var params = Object.entries(query).flatMap(function (_ref) {
4076
- var _ref2 = slicedToArray._slicedToArray(_ref, 2),
4099
+ var _ref2 = createForOfIteratorHelper._slicedToArray(_ref, 2),
4077
4100
  key = _ref2[0],
4078
4101
  value = _ref2[1];
4079
4102
  if (!value) {
@@ -4332,7 +4355,7 @@ function checkCompatibility(from, to) {
4332
4355
  var unknown = null;
4333
4356
  for (var _i = 0, _Object$entries = Object.entries(target); _i < _Object$entries.length; _i++) {
4334
4357
  var _fromValue$_key;
4335
- var _Object$entries$_i = slicedToArray._slicedToArray(_Object$entries[_i], 2),
4358
+ var _Object$entries$_i = createForOfIteratorHelper._slicedToArray(_Object$entries[_i], 2),
4336
4359
  _key = _Object$entries$_i[0],
4337
4360
  targetItem = _Object$entries$_i[1];
4338
4361
  var sourceItem = source[_key];
@@ -4661,7 +4684,7 @@ function getRoutesWithModulePaths(schemas, sources) {
4661
4684
  }
4662
4685
  }
4663
4686
  var routes = Array.from(routeMap.entries()).map(function (_ref) {
4664
- var _ref2 = slicedToArray._slicedToArray(_ref, 2),
4687
+ var _ref2 = createForOfIteratorHelper._slicedToArray(_ref, 2),
4665
4688
  route = _ref2[0],
4666
4689
  moduleFilePath = _ref2[1];
4667
4690
  return {
@@ -4723,7 +4746,7 @@ function findSimilar(key, targets) {
4723
4746
  */
4724
4747
  function getKeyOfRecordAt(sourcePath, snapshot) {
4725
4748
  var _Internal$splitModule = core.Internal.splitModuleFilePathAndModulePath(sourcePath),
4726
- _Internal$splitModule2 = slicedToArray._slicedToArray(_Internal$splitModule, 2),
4749
+ _Internal$splitModule2 = createForOfIteratorHelper._slicedToArray(_Internal$splitModule, 2),
4727
4750
  moduleFilePath = _Internal$splitModule2[0],
4728
4751
  modulePath = _Internal$splitModule2[1];
4729
4752
  var moduleSource = snapshot.sources[moduleFilePath];
@@ -4824,7 +4847,7 @@ function checkRouteIsValid(route, includePattern, excludePattern, snapshot) {
4824
4847
  var moduleEntries = Object.entries(routerModules);
4825
4848
  var foundInModule = null;
4826
4849
  for (var _i = 0, _moduleEntries = moduleEntries; _i < _moduleEntries.length; _i++) {
4827
- var _moduleEntries$_i = slicedToArray._slicedToArray(_moduleEntries[_i], 2),
4850
+ var _moduleEntries$_i = createForOfIteratorHelper._slicedToArray(_moduleEntries[_i], 2),
4828
4851
  _moduleFilePath = _moduleEntries$_i[0],
4829
4852
  routes = _moduleEntries$_i[1];
4830
4853
  if (routes.includes(route)) {
@@ -4834,7 +4857,7 @@ function checkRouteIsValid(route, includePattern, excludePattern, snapshot) {
4834
4857
  }
4835
4858
  if (!foundInModule) {
4836
4859
  var allRoutes = moduleEntries.flatMap(function (_ref4) {
4837
- var _ref5 = slicedToArray._slicedToArray(_ref4, 2),
4860
+ var _ref5 = createForOfIteratorHelper._slicedToArray(_ref4, 2),
4838
4861
  routes = _ref5[1];
4839
4862
  return routes;
4840
4863
  });
@@ -5314,7 +5337,7 @@ function localeAt(path, snapshot) {
5314
5337
  return null;
5315
5338
  }
5316
5339
  var _Internal$splitModule = core.Internal.splitModuleFilePathAndModulePath(path),
5317
- _Internal$splitModule2 = slicedToArray._slicedToArray(_Internal$splitModule, 2),
5340
+ _Internal$splitModule2 = createForOfIteratorHelper._slicedToArray(_Internal$splitModule, 2),
5318
5341
  moduleFilePath = _Internal$splitModule2[0],
5319
5342
  modulePath = _Internal$splitModule2[1];
5320
5343
  var schema = snapshot.schemas[moduleFilePath];
@@ -5388,7 +5411,7 @@ function localeOfRouteKey(schema, moduleFilePath, key, available) {
5388
5411
  return null;
5389
5412
  }
5390
5413
  for (var _i = 0, _Object$entries = Object.entries(schema.params); _i < _Object$entries.length; _i++) {
5391
- var _Object$entries$_i = slicedToArray._slicedToArray(_Object$entries[_i], 2),
5414
+ var _Object$entries$_i = createForOfIteratorHelper._slicedToArray(_Object$entries[_i], 2),
5392
5415
  name = _Object$entries$_i[0],
5393
5416
  param = _Object$entries$_i[1];
5394
5417
  if (isLocaleSchema(param) && Object.prototype.hasOwnProperty.call(values, name)) {
@@ -5495,7 +5518,7 @@ function localeOfObjectField(schema, source, available) {
5495
5518
  return null;
5496
5519
  }
5497
5520
  for (var _i2 = 0, _Object$entries2 = Object.entries(schema.items); _i2 < _Object$entries2.length; _i2++) {
5498
- var _Object$entries2$_i = slicedToArray._slicedToArray(_Object$entries2[_i2], 2),
5521
+ var _Object$entries2$_i = createForOfIteratorHelper._slicedToArray(_Object$entries2[_i2], 2),
5499
5522
  key = _Object$entries2$_i[0],
5500
5523
  item = _Object$entries2$_i[1];
5501
5524
  if (!isLocaleSchema(item)) {
@@ -7161,7 +7184,7 @@ function indexModule(searchIndex, moduleFilePath, source, schema) {
7161
7184
  // Add to index if we have search text
7162
7185
  if (searchText) {
7163
7186
  var _Internal$splitModule = core.Internal.splitModuleFilePathAndModulePath(path),
7164
- _Internal$splitModule2 = slicedToArray._slicedToArray(_Internal$splitModule, 2),
7187
+ _Internal$splitModule2 = createForOfIteratorHelper._slicedToArray(_Internal$splitModule, 2),
7165
7188
  modulePath = _Internal$splitModule2[1];
7166
7189
  var cleanPath = fastRemoveNonWordChars(modulePath) + " ";
7167
7190
  index.add(path, cleanPath + " " + path + " " + searchText);
@@ -7487,7 +7510,7 @@ function accentRamp(accent) {
7487
7510
  return null;
7488
7511
  }
7489
7512
  var _rgbToOklch = rgbToOklch(rgb),
7490
- _rgbToOklch2 = slicedToArray._slicedToArray(_rgbToOklch, 3),
7513
+ _rgbToOklch2 = createForOfIteratorHelper._slicedToArray(_rgbToOklch, 3),
7491
7514
  accentChroma = _rgbToOklch2[1],
7492
7515
  accentHue = _rgbToOklch2[2];
7493
7516
  var anchor = GREEN_PROFILE.find(function (entry) {
@@ -7506,7 +7529,7 @@ function accentRamp(accent) {
7506
7529
  }
7507
7530
  // Green's lightness and chroma, the accent's hue. Green's own hue is the
7508
7531
  // one thing a generated ramp does not keep.
7509
- var _entry$lch = slicedToArray._slicedToArray(entry.lch, 2),
7532
+ var _entry$lch = createForOfIteratorHelper._slicedToArray(entry.lch, 2),
7510
7533
  lightness = _entry$lch[0],
7511
7534
  chroma = _entry$lch[1];
7512
7535
  return rgbToHex(oklchToRgb(clampChromaToGamut([lightness, chroma * chromaScale, accentHue])));
@@ -7656,7 +7679,7 @@ function relativeLuminance(hex) {
7656
7679
  throw new Error("Not a six-digit hex colour: ".concat(hex));
7657
7680
  }
7658
7681
  var _rgb$map = rgb.map(srgbToLinear),
7659
- _rgb$map2 = slicedToArray._slicedToArray(_rgb$map, 3),
7682
+ _rgb$map2 = createForOfIteratorHelper._slicedToArray(_rgb$map, 3),
7660
7683
  r = _rgb$map2[0],
7661
7684
  g = _rgb$map2[1],
7662
7685
  b = _rgb$map2[2];
@@ -7936,7 +7959,7 @@ function isInsidePatchSetPath(inner, outer) {
7936
7959
  }
7937
7960
  var PatchSets = /*#__PURE__*/function () {
7938
7961
  function PatchSets() {
7939
- slicedToArray._classCallCheck(this, PatchSets);
7962
+ wrapNativeSuper._classCallCheck(this, PatchSets);
7940
7963
  createForOfIteratorHelper._defineProperty(this, "insertedPatches", void 0);
7941
7964
  createForOfIteratorHelper._defineProperty(this, "patchSetMetadata", void 0);
7942
7965
  createForOfIteratorHelper._defineProperty(this, "orderedInsertKeys", void 0);
@@ -7944,7 +7967,7 @@ var PatchSets = /*#__PURE__*/function () {
7944
7967
  this.orderedInsertKeys = [];
7945
7968
  this.insertedPatches = new Set();
7946
7969
  }
7947
- return slicedToArray._createClass(PatchSets, [{
7970
+ return wrapNativeSuper._createClass(PatchSets, [{
7948
7971
  key: "reset",
7949
7972
  value: function reset() {
7950
7973
  this.patchSetMetadata = {};
@@ -8386,7 +8409,7 @@ function sideFiles(trees, side) {
8386
8409
  for (var _i = 0, _layers = layers; _i < _layers.length; _i++) {
8387
8410
  var layer = _layers[_i];
8388
8411
  for (var _i2 = 0, _Object$entries = Object.entries(layer); _i2 < _Object$entries.length; _i2++) {
8389
- var _Object$entries$_i = slicedToArray._slicedToArray(_Object$entries[_i2], 2),
8412
+ var _Object$entries$_i = createForOfIteratorHelper._slicedToArray(_Object$entries[_i2], 2),
8390
8413
  path = _Object$entries$_i[0],
8391
8414
  text = _Object$entries$_i[1];
8392
8415
  if (text === null) delete files[path];else files[path] = text;
@@ -8412,11 +8435,11 @@ function schemaErrorsOf(schema, moduleFilePath, source) {
8412
8435
  if (res === false) return [];
8413
8436
  var errors = [];
8414
8437
  for (var _i3 = 0, _Object$entries2 = Object.entries(res); _i3 < _Object$entries2.length; _i3++) {
8415
- var _Object$entries2$_i = slicedToArray._slicedToArray(_Object$entries2[_i3], 2),
8438
+ var _Object$entries2$_i = createForOfIteratorHelper._slicedToArray(_Object$entries2[_i3], 2),
8416
8439
  sourcePath = _Object$entries2$_i[0],
8417
8440
  list = _Object$entries2$_i[1];
8418
8441
  var _Internal$splitModule = core.Internal.splitModuleFilePathAndModulePath(sourcePath),
8419
- _Internal$splitModule2 = slicedToArray._slicedToArray(_Internal$splitModule, 2),
8442
+ _Internal$splitModule2 = createForOfIteratorHelper._slicedToArray(_Internal$splitModule, 2),
8420
8443
  modulePath = _Internal$splitModule2[1];
8421
8444
  var path = modulePath ? core.Internal.createPatchPath(modulePath) : [];
8422
8445
  var _iterator = createForOfIteratorHelper._createForOfIteratorHelper(list),
@@ -8465,7 +8488,7 @@ function selfCheck(_x) {
8465
8488
  return _selfCheck.apply(this, arguments);
8466
8489
  }
8467
8490
  function _selfCheck() {
8468
- _selfCheck = slicedToArray._asyncToGenerator(/*#__PURE__*/slicedToArray._regenerator().m(function _callee(valModules) {
8491
+ _selfCheck = createForOfIteratorHelper._asyncToGenerator(/*#__PURE__*/createForOfIteratorHelper._regenerator().m(function _callee(valModules) {
8469
8492
  var options,
8470
8493
  errors,
8471
8494
  found,
@@ -8513,7 +8536,7 @@ function _selfCheck() {
8513
8536
  _t2,
8514
8537
  _t3,
8515
8538
  _t4;
8516
- return slicedToArray._regenerator().w(function (_context) {
8539
+ return createForOfIteratorHelper._regenerator().w(function (_context) {
8517
8540
  while (1) switch (_context.p = _context.n) {
8518
8541
  case 0:
8519
8542
  options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
@@ -8529,7 +8552,7 @@ function _selfCheck() {
8529
8552
  _context.n = 17;
8530
8553
  break;
8531
8554
  }
8532
- _step$value = slicedToArray._slicedToArray(_step.value, 2), index = _step$value[0], entry = _step$value[1];
8555
+ _step$value = createForOfIteratorHelper._slicedToArray(_step.value, 2), index = _step$value[0], entry = _step$value[1];
8533
8556
  module = void 0;
8534
8557
  _context.p = 3;
8535
8558
  _context.n = 4;
@@ -8606,7 +8629,7 @@ function _selfCheck() {
8606
8629
  return _context.a(3, 16);
8607
8630
  case 15:
8608
8631
  for (_i2 = 0, _Object$entries2 = Object.entries(result); _i2 < _Object$entries2.length; _i2++) {
8609
- _Object$entries2$_i = slicedToArray._slicedToArray(_Object$entries2[_i2], 2), _sourcePath = _Object$entries2$_i[0], _list = _Object$entries2$_i[1];
8632
+ _Object$entries2$_i = createForOfIteratorHelper._slicedToArray(_Object$entries2[_i2], 2), _sourcePath = _Object$entries2$_i[0], _list = _Object$entries2$_i[1];
8610
8633
  (_found = (_found$_ref = found[_ref = _sourcePath]) !== null && _found$_ref !== void 0 ? _found$_ref : found[_ref] = []).push.apply(_found, createForOfIteratorHelper._toConsumableArray(_list));
8611
8634
  }
8612
8635
  case 16:
@@ -8632,8 +8655,8 @@ function _selfCheck() {
8632
8655
  sources: sources
8633
8656
  })), surfaced = _partitionValidationE.surfaced, skipped = _partitionValidationE.skipped;
8634
8657
  for (_i = 0, _Object$entries = Object.entries(surfaced); _i < _Object$entries.length; _i++) {
8635
- _Object$entries$_i = slicedToArray._slicedToArray(_Object$entries[_i], 2), sourcePath = _Object$entries$_i[0], list = _Object$entries$_i[1];
8636
- _Internal$splitModule = core.Internal.splitModuleFilePathAndModulePath(sourcePath), _Internal$splitModule2 = slicedToArray._slicedToArray(_Internal$splitModule, 2), moduleFilePath = _Internal$splitModule2[0], modulePath = _Internal$splitModule2[1];
8658
+ _Object$entries$_i = createForOfIteratorHelper._slicedToArray(_Object$entries[_i], 2), sourcePath = _Object$entries$_i[0], list = _Object$entries$_i[1];
8659
+ _Internal$splitModule = core.Internal.splitModuleFilePathAndModulePath(sourcePath), _Internal$splitModule2 = createForOfIteratorHelper._slicedToArray(_Internal$splitModule, 2), moduleFilePath = _Internal$splitModule2[0], modulePath = _Internal$splitModule2[1];
8637
8660
  path = modulePath ? core.Internal.createPatchPath(modulePath) : [];
8638
8661
  _iterator2 = createForOfIteratorHelper._createForOfIteratorHelper(list);
8639
8662
  try {
@@ -8689,6 +8712,10 @@ exports.parseUpdateTarget = protocol.parseUpdateTarget;
8689
8712
  exports.parseVerify = protocol.parseVerify;
8690
8713
  exports.DEFAULT_CANVAS_SELECTION = getSitemapTree.DEFAULT_CANVAS_SELECTION;
8691
8714
  exports.DEFAULT_CANVAS_SELECTION_SOFT = getSitemapTree.DEFAULT_CANVAS_SELECTION_SOFT;
8715
+ exports.QUICK_PREVIEW_PARAM = getSitemapTree.QUICK_PREVIEW_PARAM;
8716
+ exports.QUICK_PREVIEW_SERVICE_WORKER_PATH = getSitemapTree.QUICK_PREVIEW_SERVICE_WORKER_PATH;
8717
+ exports.QUICK_PREVIEW_SERVICE_WORKER_SOURCE = getSitemapTree.QUICK_PREVIEW_SERVICE_WORKER_SOURCE;
8718
+ exports.QUICK_PREVIEW_STORE_MESSAGE = getSitemapTree.QUICK_PREVIEW_STORE_MESSAGE;
8692
8719
  exports.VAL_AI_SESSION_STORAGE_KEY = getSitemapTree.VAL_AI_SESSION_STORAGE_KEY;
8693
8720
  exports.VAL_CANVAS_MESSAGE = getSitemapTree.VAL_CANVAS_MESSAGE;
8694
8721
  exports.VAL_CANVAS_PARAM = getSitemapTree.VAL_CANVAS_PARAM;
@@ -8698,22 +8725,33 @@ exports.attachElementPicker = getSitemapTree.attachElementPicker;
8698
8725
  exports.createPickerOverlay = getSitemapTree.createPickerOverlay;
8699
8726
  exports.describeElement = getSitemapTree.describeElement;
8700
8727
  exports.elementLabel = getSitemapTree.elementLabel;
8728
+ exports.findBySelector = getSitemapTree.findBySelector;
8701
8729
  exports.formatRoutePattern = getSitemapTree.formatRoutePattern;
8702
8730
  exports.getNextAppRouterSourceFolder = getSitemapTree.getNextAppRouterSourceFolder;
8703
8731
  exports.getPageRouterSitemapTree = getSitemapTree.getPageRouterSitemapTree;
8704
8732
  exports.getPageRouterSourceFolder = getSitemapTree.getPageRouterSourceFolder;
8705
8733
  exports.getPatternFromModuleFilePath = getSitemapTree.getPatternFromModuleFilePath;
8706
8734
  exports.getTanStackRouterSourceFolder = getSitemapTree.getTanStackRouterSourceFolder;
8735
+ exports.isDesignTabOrigin = getSitemapTree.isDesignTabOrigin;
8736
+ exports.isQuickPreviewFiles = getSitemapTree.isQuickPreviewFiles;
8707
8737
  exports.isTanStackRoutesFolder = getSitemapTree.isTanStackRoutesFolder;
8708
8738
  exports.isValCanvasFrame = getSitemapTree.isValCanvasFrame;
8709
8739
  exports.isValCanvasPageMessage = getSitemapTree.isValCanvasPageMessage;
8710
8740
  exports.isValCanvasStudioMessage = getSitemapTree.isValCanvasStudioMessage;
8711
8741
  exports.modifierLabel = getSitemapTree.modifierLabel;
8742
+ exports.pageLocationOf = getSitemapTree.pageLocationOf;
8712
8743
  exports.parseRoutePattern = getSitemapTree.parseRoutePattern;
8744
+ exports.quickPreviewSiteOrigin = getSitemapTree.quickPreviewSiteOrigin;
8745
+ exports.readPageSnapshot = getSitemapTree.readPageSnapshot;
8746
+ exports.restoreScroll = getSitemapTree.restoreScroll;
8713
8747
  exports.startElementPicking = getSitemapTree.startElementPicking;
8748
+ exports.storeQuickPreview = getSitemapTree.storeQuickPreview;
8749
+ exports.watchPageLocation = getSitemapTree.watchPageLocation;
8750
+ exports.withQuickPreviewParam = getSitemapTree.withQuickPreviewParam;
8714
8751
  exports.withValCanvasParam = getSitemapTree.withValCanvasParam;
8715
8752
  exports.AA_LARGE = AA_LARGE;
8716
8753
  exports.AA_TEXT = AA_TEXT;
8754
+ exports.AIToolCallSummaries = AIToolCallSummaries;
8717
8755
  exports.AnalyticsBeacon = AnalyticsBeacon;
8718
8756
  exports.Api = Api;
8719
8757
  exports.BRAND_CONTRAST_PAIRS = BRAND_CONTRAST_PAIRS;
@@ -1,12 +1,12 @@
1
- import { c as _createForOfIteratorHelper, a as _objectSpread2, b as _toConsumableArray, _ as _typeof, d as _defineProperty } from '../../dist/createForOfIteratorHelper-666a6d17.esm.js';
1
+ import { f as _createForOfIteratorHelper, d as _objectSpread2, e as _toConsumableArray, _ as _typeof, g as _defineProperty, b as _asyncToGenerator, c as _regenerator, a as _slicedToArray } from '../../dist/createForOfIteratorHelper-9b80f1a2.esm.js';
2
2
  import { Internal, CODE_LANGUAGES, resolveSettingsModule, missingDeclaredKeys, localeOfValue, discriminatedUnionBranchOf, routePatternOf, matchRoutePattern, DEFAULT_COLOR_FORMAT, declaredKeySetOf } from '@valbuild/core';
3
- import { b as _asyncToGenerator, d as _regenerator, g as _slicedToArray, a as _createClass, e as _classCallCheck } from '../../dist/slicedToArray-22567815.esm.js';
4
3
  import { z } from 'zod';
5
- import { _ as _objectWithoutProperties } from '../../dist/protocol-7ddc1a71.esm.js';
6
- export { P as PublishProtocolError, b as parseArtifacts, p as parseBuildTarget, l as parseCancel, a as parseDeclare, m as parseDiscard, j as parseJob, n as parseNewestCiRun, h as parsePress, g as parseProblems, f as parseProjectSource, d as parsePromote, o as parsePublishToken, k as parseRenew, i as parseRequestStatus, e as parseStatus, q as parseUpdateTarget, c as parseVerify } from '../../dist/protocol-7ddc1a71.esm.js';
4
+ import { _ as _objectWithoutProperties } from '../../dist/protocol-55cfa3cf.esm.js';
5
+ export { P as PublishProtocolError, b as parseArtifacts, p as parseBuildTarget, l as parseCancel, a as parseDeclare, m as parseDiscard, j as parseJob, n as parseNewestCiRun, h as parsePress, g as parseProblems, f as parseProjectSource, d as parsePromote, o as parsePublishToken, k as parseRenew, i as parseRequestStatus, e as parseStatus, q as parseUpdateTarget, c as parseVerify } from '../../dist/protocol-55cfa3cf.esm.js';
7
6
  import { fromError } from 'zod-validation-error';
8
- export { D as DEFAULT_CANVAS_SELECTION, e as DEFAULT_CANVAS_SELECTION_SOFT, b as VAL_AI_SESSION_STORAGE_KEY, d as VAL_CANVAS_MESSAGE, c as VAL_CANVAS_PARAM, V as VAL_CONFIG_SESSION_STORAGE_KEY, a as VAL_THEME_SESSION_STORAGE_KEY, j as attachElementPicker, k as createPickerOverlay, h as describeElement, l as elementLabel, n as formatRoutePattern, o as getNextAppRouterSourceFolder, u as getPageRouterSitemapTree, r as getPageRouterSourceFolder, v as getPatternFromModuleFilePath, q as getTanStackRouterSourceFolder, t as isTanStackRoutesFolder, g as isValCanvasFrame, i as isValCanvasPageMessage, f as isValCanvasStudioMessage, m as modifierLabel, p as parseRoutePattern, s as startElementPicking, w as withValCanvasParam } from '../../dist/getSitemapTree-b6161fd8.esm.js';
7
+ export { D as DEFAULT_CANVAS_SELECTION, e as DEFAULT_CANVAS_SELECTION_SOFT, Q as QUICK_PREVIEW_PARAM, t as QUICK_PREVIEW_SERVICE_WORKER_PATH, x as QUICK_PREVIEW_SERVICE_WORKER_SOURCE, u as QUICK_PREVIEW_STORE_MESSAGE, b as VAL_AI_SESSION_STORAGE_KEY, d as VAL_CANVAS_MESSAGE, c as VAL_CANVAS_PARAM, V as VAL_CONFIG_SESSION_STORAGE_KEY, a as VAL_THEME_SESSION_STORAGE_KEY, j as attachElementPicker, k as createPickerOverlay, h as describeElement, l as elementLabel, q as findBySelector, E as formatRoutePattern, F as getNextAppRouterSourceFolder, J as getPageRouterSitemapTree, H as getPageRouterSourceFolder, K as getPatternFromModuleFilePath, G as getTanStackRouterSourceFolder, B as isDesignTabOrigin, v as isQuickPreviewFiles, I as isTanStackRoutesFolder, g as isValCanvasFrame, i as isValCanvasPageMessage, f as isValCanvasStudioMessage, m as modifierLabel, p as pageLocationOf, C as parseRoutePattern, A as quickPreviewSiteOrigin, o as readPageSnapshot, r as restoreScroll, s as startElementPicking, y as storeQuickPreview, n as watchPageLocation, z as withQuickPreviewParam, w as withValCanvasParam } from '../../dist/getSitemapTree-97b3166f.esm.js';
9
8
  import FlexSearch from 'flexsearch';
9
+ import { a as _createClass, c as _classCallCheck } from '../../dist/wrapNativeSuper-639b12b7.esm.js';
10
10
  import { b as base64DataUrlToUint8Array } from '../../dist/utils-00f3e1df.esm.js';
11
11
 
12
12
  function remirrorToRichTextSource(node, configDirectory, remoteOptions) {
@@ -1488,6 +1488,23 @@ var PlanRefusalError = z.object({
1488
1488
  */
1489
1489
  var VAL_STUDIO_HEADER = "x-val-studio";
1490
1490
 
1491
+ /**
1492
+ * On a user message in an AI chat: the tools called in the turn it asked for,
1493
+ * as the content server keeps them (valbuild/home `docs/proposals.md`,
1494
+ * Flow H) - what each tool row shows, never what the tool read or wrote.
1495
+ *
1496
+ * A chat with a summary this cannot read loads without its tool rows rather
1497
+ * than not at all, hence the `catch`.
1498
+ */
1499
+ var AIToolCallSummaries = z.array(z.object({
1500
+ toolCallId: z.string(),
1501
+ name: z.string(),
1502
+ isError: z["boolean"](),
1503
+ /** `ask_user_question`: what was asked, and what was answered. */
1504
+ questions: z.array(z.unknown()).optional(),
1505
+ answers: z.array(z.unknown()).optional()
1506
+ })).optional()["catch"](undefined);
1507
+
1491
1508
  /**
1492
1509
  * What Val Build answered, mapped onto the statuses this server speaks: a
1493
1510
  * `code` in the JSON is what the web components act on, so it is passed
@@ -3537,6 +3554,7 @@ var Api = {
3537
3554
  messages: z.array(z.object({
3538
3555
  /** Who asked, on a user message in a proposal's chat. */
3539
3556
  authorId: z.string().nullable().optional(),
3557
+ toolCalls: AIToolCallSummaries,
3540
3558
  role: z.string(),
3541
3559
  content: z.union([z.string(), z.array(z.union([z.object({
3542
3560
  type: z.literal("text"),
@@ -3581,7 +3599,12 @@ var Api = {
3581
3599
  width: z.number(),
3582
3600
  height: z.number(),
3583
3601
  mimeType: z.string()
3584
- })
3602
+ }),
3603
+ /**
3604
+ * SHA-256 of the bytes, hex: what a remote file's ref names.
3605
+ * Absent from a content service that predates it.
3606
+ */
3607
+ sha256: z.string().optional()
3585
3608
  }))
3586
3609
  })
3587
3610
  }), z.object({
@@ -8662,4 +8685,4 @@ var messageOf = function messageOf(error) {
8662
8685
  return error instanceof Error ? error.message : String(error);
8663
8686
  };
8664
8687
 
8665
- export { AA_LARGE, AA_TEXT, AnalyticsBeacon, Api, BRAND_CONTRAST_PAIRS, BinaryFileRef, CodeOptions, ColorOptions, DEFAULT_ERROR_MESSAGE, DateOptions, ENCODE_DEFAULTS, ENCODE_MIME_TYPE_OF, FileOptions, HistoricalCommit, HistoricalModule, HistoricalPatchSet, HistoryError, ImageEncodeOption, ImageOptions, JSONValue, JSON_ENTRIES_BATCH_MAX, LOCAL_FILE_IN_REMOTE_PROJECT_HINT, LOCAL_FILE_IN_REMOTE_PROJECT_WARNING, ModuleComparison, NEVER_ENCODED, ParentRef$1 as ParentRef, Patch, PatchBlock, PatchId, PatchJSON, PatchSets, PlanRefusalError, RAMP_STEPS, RemirrorBr, RemirrorBulletList, RemirrorHeading, RemirrorImage, RemirrorJSON, RemirrorLinkMark, RemirrorListItem, RemirrorOrderedList, RemirrorParagraph, RemirrorText, RemirrorTextMark, RestoreVerdict, RichTextOptions, SCHEMA_SOURCE_FIXES, SELF_CHECK_VERSION, STUDIO_FIXES, SerializedArraySchema, SerializedBooleanSchema, SerializedCodeSchema, SerializedColorSchema, SerializedDateSchema, SerializedDateTimeSchema, SerializedDiscriminatedUnionSchema, SerializedEnumSchema, SerializedFileSchema, SerializedImageSchema, SerializedKeyOfSchema, SerializedLiteralSchema, SerializedLocaleSchema, SerializedNumberSchema, SerializedObjectSchema, SerializedRecordSchema, SerializedRichTextSchema, SerializedRouteSchema, SerializedSchema, SerializedSettingsSchema, SerializedStringSchema, SerializedValViewSchema, SerializedVideoSchema, SharedValConfig, VAL_ENABLE_COOKIE_NAME, VAL_GREEN_RAMP, VAL_SESSION_COOKIE, VAL_STATE_COOKIE, VAL_STUDIO_HEADER, ValCommit, ValDeployment, VideoOptions, VideoStreamOption, WARNING_FIXES, WASM_ENCODED_MIME_TYPES, accentRamp, buildDuplicatePatch, buildEmptyAtPathPatch, buildFileRefValue, buildImageGalleryPatch, buildRemoveImageGalleryEntryPatch, buildSearchIndex, chainHeadOf, checkCompatibility, chooseEncoded, concatModulePath, contrastRatio, createRegExpFromPattern, createSearchIndex, createValClient, declaredLocales, describeContainerAtPath, emptyOf, enumLocaleTag, explainIncompatible, fallbackMimeType, filterBlockingValidationErrors, filterRoutesByPatterns, findSimilar, fitWithin, flattenRichText, forEachRichTextImage, getErrorMessageFromUnknownJson, getFilenameFromRef, getInlineImgInfo, getKeyOfRecordAt, getRefParts, getRoutesOf, getRoutesWithModulePaths, getSourceAt, getValDemo, indexModule, isInsidePatchSetPath, isLocaleSchema, isMimeTypeAccepted, isRemoteSchema, isRepairedOnSave, isSchemaSourceFixError, isSkippedSource, isStudioFix, isValidationWarning, isWarningFix, joinSharedChanges, keyOfRecordPath, levenshtein, localeAt, localeMeantBy, memoizePerRequest, newestCommitSha, partitionValidationErrors, performSearch, proposalCustomProperties, relativeLuminance, remirrorToRichTextSource, removeModule, resolveEncodeSettings, resolvePairGround, resolveSchemaSourceFixForError, resolveSchemaSourceFixes, resolveSerializedSchemaAtPath, richTextImageSchema, richTextToRemirror, safeParsePatch, schemaErrorsOf, schemaTypesOfPath, selectionClosure, selfCheck, shouldEncodeWithWasm, sideFiles, sideSource, sourcePathOfChild, themeCustomProperties, toolNames, traverseSchemaSource, urlOf, validateRoutePatterns, withExtension };
8688
+ export { AA_LARGE, AA_TEXT, AIToolCallSummaries, AnalyticsBeacon, Api, BRAND_CONTRAST_PAIRS, BinaryFileRef, CodeOptions, ColorOptions, DEFAULT_ERROR_MESSAGE, DateOptions, ENCODE_DEFAULTS, ENCODE_MIME_TYPE_OF, FileOptions, HistoricalCommit, HistoricalModule, HistoricalPatchSet, HistoryError, ImageEncodeOption, ImageOptions, JSONValue, JSON_ENTRIES_BATCH_MAX, LOCAL_FILE_IN_REMOTE_PROJECT_HINT, LOCAL_FILE_IN_REMOTE_PROJECT_WARNING, ModuleComparison, NEVER_ENCODED, ParentRef$1 as ParentRef, Patch, PatchBlock, PatchId, PatchJSON, PatchSets, PlanRefusalError, RAMP_STEPS, RemirrorBr, RemirrorBulletList, RemirrorHeading, RemirrorImage, RemirrorJSON, RemirrorLinkMark, RemirrorListItem, RemirrorOrderedList, RemirrorParagraph, RemirrorText, RemirrorTextMark, RestoreVerdict, RichTextOptions, SCHEMA_SOURCE_FIXES, SELF_CHECK_VERSION, STUDIO_FIXES, SerializedArraySchema, SerializedBooleanSchema, SerializedCodeSchema, SerializedColorSchema, SerializedDateSchema, SerializedDateTimeSchema, SerializedDiscriminatedUnionSchema, SerializedEnumSchema, SerializedFileSchema, SerializedImageSchema, SerializedKeyOfSchema, SerializedLiteralSchema, SerializedLocaleSchema, SerializedNumberSchema, SerializedObjectSchema, SerializedRecordSchema, SerializedRichTextSchema, SerializedRouteSchema, SerializedSchema, SerializedSettingsSchema, SerializedStringSchema, SerializedValViewSchema, SerializedVideoSchema, SharedValConfig, VAL_ENABLE_COOKIE_NAME, VAL_GREEN_RAMP, VAL_SESSION_COOKIE, VAL_STATE_COOKIE, VAL_STUDIO_HEADER, ValCommit, ValDeployment, VideoOptions, VideoStreamOption, WARNING_FIXES, WASM_ENCODED_MIME_TYPES, accentRamp, buildDuplicatePatch, buildEmptyAtPathPatch, buildFileRefValue, buildImageGalleryPatch, buildRemoveImageGalleryEntryPatch, buildSearchIndex, chainHeadOf, checkCompatibility, chooseEncoded, concatModulePath, contrastRatio, createRegExpFromPattern, createSearchIndex, createValClient, declaredLocales, describeContainerAtPath, emptyOf, enumLocaleTag, explainIncompatible, fallbackMimeType, filterBlockingValidationErrors, filterRoutesByPatterns, findSimilar, fitWithin, flattenRichText, forEachRichTextImage, getErrorMessageFromUnknownJson, getFilenameFromRef, getInlineImgInfo, getKeyOfRecordAt, getRefParts, getRoutesOf, getRoutesWithModulePaths, getSourceAt, getValDemo, indexModule, isInsidePatchSetPath, isLocaleSchema, isMimeTypeAccepted, isRemoteSchema, isRepairedOnSave, isSchemaSourceFixError, isSkippedSource, isStudioFix, isValidationWarning, isWarningFix, joinSharedChanges, keyOfRecordPath, levenshtein, localeAt, localeMeantBy, memoizePerRequest, newestCommitSha, partitionValidationErrors, performSearch, proposalCustomProperties, relativeLuminance, remirrorToRichTextSource, removeModule, resolveEncodeSettings, resolvePairGround, resolveSchemaSourceFixForError, resolveSchemaSourceFixes, resolveSerializedSchemaAtPath, richTextImageSchema, richTextToRemirror, safeParsePatch, schemaErrorsOf, schemaTypesOfPath, selectionClosure, selfCheck, shouldEncodeWithWasm, sideFiles, sideSource, sourcePathOfChild, themeCustomProperties, toolNames, traverseSchemaSource, urlOf, validateRoutePatterns, withExtension };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valbuild/shared",
3
- "version": "0.150.8",
3
+ "version": "0.150.11",
4
4
  "private": false,
5
5
  "description": "Val shared types and utilities",
6
6
  "repository": {
@@ -71,7 +71,7 @@
71
71
  ],
72
72
  "devDependencies": {
73
73
  "typescript": "^6.0.3",
74
- "@valbuild/tanstack-build": "0.150.1"
74
+ "@valbuild/tanstack-build": "0.150.9"
75
75
  },
76
76
  "sideEffects": false,
77
77
  "scripts": {