phylla-connector 0.2.0 → 0.4.0

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.
@@ -22,9 +22,9 @@ var __commonJS = (cb, mod) => function __require() {
22
22
  throw mod = 0, e;
23
23
  }
24
24
  };
25
- var __export = (target, all) => {
25
+ var __export = (target2, all) => {
26
26
  for (var name in all)
27
- __defProp(target, name, { get: all[name], enumerable: true });
27
+ __defProp(target2, name, { get: all[name], enumerable: true });
28
28
  };
29
29
  var __copyProps = (to, from, except, desc) => {
30
30
  if (from && typeof from === "object" || typeof from === "function") {
@@ -34,12 +34,12 @@ var __copyProps = (to, from, except, desc) => {
34
34
  }
35
35
  return to;
36
36
  };
37
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
37
+ var __toESM = (mod, isNodeMode, target2) => (target2 = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
38
38
  // If the importer is in node compatibility mode or this is not an ESM
39
39
  // file that has been converted to a CommonJS file using a Babel-
40
40
  // compatible transform (i.e. "__esModule" has not been set), then set
41
41
  // "default" to the CommonJS "module.exports" for node compatibility.
42
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
42
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target2, "default", { value: mod, enumerable: true }) : target2,
43
43
  mod
44
44
  ));
45
45
 
@@ -51,9 +51,9 @@ var init_define_PHYLLA_BUILT_IN_CLIENT = __esm({
51
51
  }
52
52
  });
53
53
 
54
- // connector/node_modules/ajv/dist/compile/codegen/code.js
54
+ // ../Phylla/connector/node_modules/ajv/dist/compile/codegen/code.js
55
55
  var require_code = __commonJS({
56
- "connector/node_modules/ajv/dist/compile/codegen/code.js"(exports) {
56
+ "../Phylla/connector/node_modules/ajv/dist/compile/codegen/code.js"(exports) {
57
57
  "use strict";
58
58
  init_define_PHYLLA_BUILT_IN_CLIENT();
59
59
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -206,9 +206,9 @@ var require_code = __commonJS({
206
206
  }
207
207
  });
208
208
 
209
- // connector/node_modules/ajv/dist/compile/codegen/scope.js
209
+ // ../Phylla/connector/node_modules/ajv/dist/compile/codegen/scope.js
210
210
  var require_scope = __commonJS({
211
- "connector/node_modules/ajv/dist/compile/codegen/scope.js"(exports) {
211
+ "../Phylla/connector/node_modules/ajv/dist/compile/codegen/scope.js"(exports) {
212
212
  "use strict";
213
213
  init_define_PHYLLA_BUILT_IN_CLIENT();
214
214
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -352,9 +352,9 @@ var require_scope = __commonJS({
352
352
  }
353
353
  });
354
354
 
355
- // connector/node_modules/ajv/dist/compile/codegen/index.js
355
+ // ../Phylla/connector/node_modules/ajv/dist/compile/codegen/index.js
356
356
  var require_codegen = __commonJS({
357
- "connector/node_modules/ajv/dist/compile/codegen/index.js"(exports) {
357
+ "../Phylla/connector/node_modules/ajv/dist/compile/codegen/index.js"(exports) {
358
358
  "use strict";
359
359
  init_define_PHYLLA_BUILT_IN_CLIENT();
360
360
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1073,9 +1073,9 @@ var require_codegen = __commonJS({
1073
1073
  }
1074
1074
  });
1075
1075
 
1076
- // connector/node_modules/ajv/dist/compile/util.js
1076
+ // ../Phylla/connector/node_modules/ajv/dist/compile/util.js
1077
1077
  var require_util = __commonJS({
1078
- "connector/node_modules/ajv/dist/compile/util.js"(exports) {
1078
+ "../Phylla/connector/node_modules/ajv/dist/compile/util.js"(exports) {
1079
1079
  "use strict";
1080
1080
  init_define_PHYLLA_BUILT_IN_CLIENT();
1081
1081
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1241,9 +1241,9 @@ var require_util = __commonJS({
1241
1241
  }
1242
1242
  });
1243
1243
 
1244
- // connector/node_modules/ajv/dist/compile/names.js
1244
+ // ../Phylla/connector/node_modules/ajv/dist/compile/names.js
1245
1245
  var require_names = __commonJS({
1246
- "connector/node_modules/ajv/dist/compile/names.js"(exports) {
1246
+ "../Phylla/connector/node_modules/ajv/dist/compile/names.js"(exports) {
1247
1247
  "use strict";
1248
1248
  init_define_PHYLLA_BUILT_IN_CLIENT();
1249
1249
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1281,9 +1281,9 @@ var require_names = __commonJS({
1281
1281
  }
1282
1282
  });
1283
1283
 
1284
- // connector/node_modules/ajv/dist/compile/errors.js
1284
+ // ../Phylla/connector/node_modules/ajv/dist/compile/errors.js
1285
1285
  var require_errors = __commonJS({
1286
- "connector/node_modules/ajv/dist/compile/errors.js"(exports) {
1286
+ "../Phylla/connector/node_modules/ajv/dist/compile/errors.js"(exports) {
1287
1287
  "use strict";
1288
1288
  init_define_PHYLLA_BUILT_IN_CLIENT();
1289
1289
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1404,9 +1404,9 @@ var require_errors = __commonJS({
1404
1404
  }
1405
1405
  });
1406
1406
 
1407
- // connector/node_modules/ajv/dist/compile/validate/boolSchema.js
1407
+ // ../Phylla/connector/node_modules/ajv/dist/compile/validate/boolSchema.js
1408
1408
  var require_boolSchema = __commonJS({
1409
- "connector/node_modules/ajv/dist/compile/validate/boolSchema.js"(exports) {
1409
+ "../Phylla/connector/node_modules/ajv/dist/compile/validate/boolSchema.js"(exports) {
1410
1410
  "use strict";
1411
1411
  init_define_PHYLLA_BUILT_IN_CLIENT();
1412
1412
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1456,9 +1456,9 @@ var require_boolSchema = __commonJS({
1456
1456
  }
1457
1457
  });
1458
1458
 
1459
- // connector/node_modules/ajv/dist/compile/rules.js
1459
+ // ../Phylla/connector/node_modules/ajv/dist/compile/rules.js
1460
1460
  var require_rules = __commonJS({
1461
- "connector/node_modules/ajv/dist/compile/rules.js"(exports) {
1461
+ "../Phylla/connector/node_modules/ajv/dist/compile/rules.js"(exports) {
1462
1462
  "use strict";
1463
1463
  init_define_PHYLLA_BUILT_IN_CLIENT();
1464
1464
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1488,9 +1488,9 @@ var require_rules = __commonJS({
1488
1488
  }
1489
1489
  });
1490
1490
 
1491
- // connector/node_modules/ajv/dist/compile/validate/applicability.js
1491
+ // ../Phylla/connector/node_modules/ajv/dist/compile/validate/applicability.js
1492
1492
  var require_applicability = __commonJS({
1493
- "connector/node_modules/ajv/dist/compile/validate/applicability.js"(exports) {
1493
+ "../Phylla/connector/node_modules/ajv/dist/compile/validate/applicability.js"(exports) {
1494
1494
  "use strict";
1495
1495
  init_define_PHYLLA_BUILT_IN_CLIENT();
1496
1496
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1512,9 +1512,9 @@ var require_applicability = __commonJS({
1512
1512
  }
1513
1513
  });
1514
1514
 
1515
- // connector/node_modules/ajv/dist/compile/validate/dataType.js
1515
+ // ../Phylla/connector/node_modules/ajv/dist/compile/validate/dataType.js
1516
1516
  var require_dataType = __commonJS({
1517
- "connector/node_modules/ajv/dist/compile/validate/dataType.js"(exports) {
1517
+ "../Phylla/connector/node_modules/ajv/dist/compile/validate/dataType.js"(exports) {
1518
1518
  "use strict";
1519
1519
  init_define_PHYLLA_BUILT_IN_CLIENT();
1520
1520
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1697,9 +1697,9 @@ var require_dataType = __commonJS({
1697
1697
  }
1698
1698
  });
1699
1699
 
1700
- // connector/node_modules/ajv/dist/compile/validate/defaults.js
1700
+ // ../Phylla/connector/node_modules/ajv/dist/compile/validate/defaults.js
1701
1701
  var require_defaults = __commonJS({
1702
- "connector/node_modules/ajv/dist/compile/validate/defaults.js"(exports) {
1702
+ "../Phylla/connector/node_modules/ajv/dist/compile/validate/defaults.js"(exports) {
1703
1703
  "use strict";
1704
1704
  init_define_PHYLLA_BUILT_IN_CLIENT();
1705
1705
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1735,9 +1735,9 @@ var require_defaults = __commonJS({
1735
1735
  }
1736
1736
  });
1737
1737
 
1738
- // connector/node_modules/ajv/dist/vocabularies/code.js
1738
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/code.js
1739
1739
  var require_code2 = __commonJS({
1740
- "connector/node_modules/ajv/dist/vocabularies/code.js"(exports) {
1740
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/code.js"(exports) {
1741
1741
  "use strict";
1742
1742
  init_define_PHYLLA_BUILT_IN_CLIENT();
1743
1743
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1869,9 +1869,9 @@ var require_code2 = __commonJS({
1869
1869
  }
1870
1870
  });
1871
1871
 
1872
- // connector/node_modules/ajv/dist/compile/validate/keyword.js
1872
+ // ../Phylla/connector/node_modules/ajv/dist/compile/validate/keyword.js
1873
1873
  var require_keyword = __commonJS({
1874
- "connector/node_modules/ajv/dist/compile/validate/keyword.js"(exports) {
1874
+ "../Phylla/connector/node_modules/ajv/dist/compile/validate/keyword.js"(exports) {
1875
1875
  "use strict";
1876
1876
  init_define_PHYLLA_BUILT_IN_CLIENT();
1877
1877
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1988,9 +1988,9 @@ var require_keyword = __commonJS({
1988
1988
  }
1989
1989
  });
1990
1990
 
1991
- // connector/node_modules/ajv/dist/compile/validate/subschema.js
1991
+ // ../Phylla/connector/node_modules/ajv/dist/compile/validate/subschema.js
1992
1992
  var require_subschema = __commonJS({
1993
- "connector/node_modules/ajv/dist/compile/validate/subschema.js"(exports) {
1993
+ "../Phylla/connector/node_modules/ajv/dist/compile/validate/subschema.js"(exports) {
1994
1994
  "use strict";
1995
1995
  init_define_PHYLLA_BUILT_IN_CLIENT();
1996
1996
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -2072,9 +2072,9 @@ var require_subschema = __commonJS({
2072
2072
  }
2073
2073
  });
2074
2074
 
2075
- // connector/node_modules/fast-deep-equal/index.js
2075
+ // ../Phylla/connector/node_modules/fast-deep-equal/index.js
2076
2076
  var require_fast_deep_equal = __commonJS({
2077
- "connector/node_modules/fast-deep-equal/index.js"(exports, module) {
2077
+ "../Phylla/connector/node_modules/fast-deep-equal/index.js"(exports, module) {
2078
2078
  "use strict";
2079
2079
  init_define_PHYLLA_BUILT_IN_CLIENT();
2080
2080
  module.exports = function equal(a, b) {
@@ -2108,9 +2108,9 @@ var require_fast_deep_equal = __commonJS({
2108
2108
  }
2109
2109
  });
2110
2110
 
2111
- // connector/node_modules/json-schema-traverse/index.js
2111
+ // ../Phylla/connector/node_modules/json-schema-traverse/index.js
2112
2112
  var require_json_schema_traverse = __commonJS({
2113
- "connector/node_modules/json-schema-traverse/index.js"(exports, module) {
2113
+ "../Phylla/connector/node_modules/json-schema-traverse/index.js"(exports, module) {
2114
2114
  "use strict";
2115
2115
  init_define_PHYLLA_BUILT_IN_CLIENT();
2116
2116
  var traverse = module.exports = function(schema, opts, cb) {
@@ -2197,9 +2197,9 @@ var require_json_schema_traverse = __commonJS({
2197
2197
  }
2198
2198
  });
2199
2199
 
2200
- // connector/node_modules/ajv/dist/compile/resolve.js
2200
+ // ../Phylla/connector/node_modules/ajv/dist/compile/resolve.js
2201
2201
  var require_resolve = __commonJS({
2202
- "connector/node_modules/ajv/dist/compile/resolve.js"(exports) {
2202
+ "../Phylla/connector/node_modules/ajv/dist/compile/resolve.js"(exports) {
2203
2203
  "use strict";
2204
2204
  init_define_PHYLLA_BUILT_IN_CLIENT();
2205
2205
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -2354,9 +2354,9 @@ var require_resolve = __commonJS({
2354
2354
  }
2355
2355
  });
2356
2356
 
2357
- // connector/node_modules/ajv/dist/compile/validate/index.js
2357
+ // ../Phylla/connector/node_modules/ajv/dist/compile/validate/index.js
2358
2358
  var require_validate = __commonJS({
2359
- "connector/node_modules/ajv/dist/compile/validate/index.js"(exports) {
2359
+ "../Phylla/connector/node_modules/ajv/dist/compile/validate/index.js"(exports) {
2360
2360
  "use strict";
2361
2361
  init_define_PHYLLA_BUILT_IN_CLIENT();
2362
2362
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -2863,9 +2863,9 @@ var require_validate = __commonJS({
2863
2863
  }
2864
2864
  });
2865
2865
 
2866
- // connector/node_modules/ajv/dist/runtime/validation_error.js
2866
+ // ../Phylla/connector/node_modules/ajv/dist/runtime/validation_error.js
2867
2867
  var require_validation_error = __commonJS({
2868
- "connector/node_modules/ajv/dist/runtime/validation_error.js"(exports) {
2868
+ "../Phylla/connector/node_modules/ajv/dist/runtime/validation_error.js"(exports) {
2869
2869
  "use strict";
2870
2870
  init_define_PHYLLA_BUILT_IN_CLIENT();
2871
2871
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -2880,9 +2880,9 @@ var require_validation_error = __commonJS({
2880
2880
  }
2881
2881
  });
2882
2882
 
2883
- // connector/node_modules/ajv/dist/compile/ref_error.js
2883
+ // ../Phylla/connector/node_modules/ajv/dist/compile/ref_error.js
2884
2884
  var require_ref_error = __commonJS({
2885
- "connector/node_modules/ajv/dist/compile/ref_error.js"(exports) {
2885
+ "../Phylla/connector/node_modules/ajv/dist/compile/ref_error.js"(exports) {
2886
2886
  "use strict";
2887
2887
  init_define_PHYLLA_BUILT_IN_CLIENT();
2888
2888
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -2898,9 +2898,9 @@ var require_ref_error = __commonJS({
2898
2898
  }
2899
2899
  });
2900
2900
 
2901
- // connector/node_modules/ajv/dist/compile/index.js
2901
+ // ../Phylla/connector/node_modules/ajv/dist/compile/index.js
2902
2902
  var require_compile = __commonJS({
2903
- "connector/node_modules/ajv/dist/compile/index.js"(exports) {
2903
+ "../Phylla/connector/node_modules/ajv/dist/compile/index.js"(exports) {
2904
2904
  "use strict";
2905
2905
  init_define_PHYLLA_BUILT_IN_CLIENT();
2906
2906
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -3123,9 +3123,9 @@ var require_compile = __commonJS({
3123
3123
  }
3124
3124
  });
3125
3125
 
3126
- // connector/node_modules/ajv/dist/refs/data.json
3126
+ // ../Phylla/connector/node_modules/ajv/dist/refs/data.json
3127
3127
  var require_data = __commonJS({
3128
- "connector/node_modules/ajv/dist/refs/data.json"(exports, module) {
3128
+ "../Phylla/connector/node_modules/ajv/dist/refs/data.json"(exports, module) {
3129
3129
  module.exports = {
3130
3130
  $id: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",
3131
3131
  description: "Meta-schema for $data reference (JSON AnySchema extension proposal)",
@@ -3142,9 +3142,9 @@ var require_data = __commonJS({
3142
3142
  }
3143
3143
  });
3144
3144
 
3145
- // connector/node_modules/fast-uri/lib/utils.js
3145
+ // ../Phylla/connector/node_modules/fast-uri/lib/utils.js
3146
3146
  var require_utils = __commonJS({
3147
- "connector/node_modules/fast-uri/lib/utils.js"(exports, module) {
3147
+ "../Phylla/connector/node_modules/fast-uri/lib/utils.js"(exports, module) {
3148
3148
  "use strict";
3149
3149
  init_define_PHYLLA_BUILT_IN_CLIENT();
3150
3150
  var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
@@ -3677,9 +3677,9 @@ var require_utils = __commonJS({
3677
3677
  }
3678
3678
  });
3679
3679
 
3680
- // connector/node_modules/fast-uri/lib/schemes.js
3680
+ // ../Phylla/connector/node_modules/fast-uri/lib/schemes.js
3681
3681
  var require_schemes = __commonJS({
3682
- "connector/node_modules/fast-uri/lib/schemes.js"(exports, module) {
3682
+ "../Phylla/connector/node_modules/fast-uri/lib/schemes.js"(exports, module) {
3683
3683
  "use strict";
3684
3684
  init_define_PHYLLA_BUILT_IN_CLIENT();
3685
3685
  var { isUUID } = require_utils();
@@ -3889,9 +3889,9 @@ var require_schemes = __commonJS({
3889
3889
  }
3890
3890
  });
3891
3891
 
3892
- // connector/node_modules/fast-uri/index.js
3892
+ // ../Phylla/connector/node_modules/fast-uri/index.js
3893
3893
  var require_fast_uri = __commonJS({
3894
- "connector/node_modules/fast-uri/index.js"(exports, module) {
3894
+ "../Phylla/connector/node_modules/fast-uri/index.js"(exports, module) {
3895
3895
  "use strict";
3896
3896
  init_define_PHYLLA_BUILT_IN_CLIENT();
3897
3897
  var { normalizeIPv6, removeDotSegments, removeDotSegmentsRelative, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
@@ -3954,58 +3954,58 @@ var require_fast_uri = __commonJS({
3954
3954
  return serialize(resolved, schemelessOptions);
3955
3955
  }
3956
3956
  function resolveComponent(base, relative, options, skipNormalization) {
3957
- const target = {};
3957
+ const target2 = {};
3958
3958
  if (!skipNormalization) {
3959
3959
  base = parse3(serialize(base, options), options);
3960
3960
  relative = parse3(serialize(relative, options), options);
3961
3961
  }
3962
3962
  options = options || {};
3963
3963
  if (!options.tolerant && relative.scheme) {
3964
- target.scheme = relative.scheme;
3965
- target.userinfo = relative.userinfo;
3966
- target.host = relative.host;
3967
- target.port = relative.port;
3968
- target.path = removeDotSegments(relative.path || "");
3969
- target.query = relative.query;
3964
+ target2.scheme = relative.scheme;
3965
+ target2.userinfo = relative.userinfo;
3966
+ target2.host = relative.host;
3967
+ target2.port = relative.port;
3968
+ target2.path = removeDotSegments(relative.path || "");
3969
+ target2.query = relative.query;
3970
3970
  } else {
3971
3971
  if (relative.userinfo !== void 0 || relative.host !== void 0 || relative.port !== void 0) {
3972
- target.userinfo = relative.userinfo;
3973
- target.host = relative.host;
3974
- target.port = relative.port;
3975
- target.path = removeDotSegments(relative.path || "");
3976
- target.query = relative.query;
3972
+ target2.userinfo = relative.userinfo;
3973
+ target2.host = relative.host;
3974
+ target2.port = relative.port;
3975
+ target2.path = removeDotSegments(relative.path || "");
3976
+ target2.query = relative.query;
3977
3977
  } else {
3978
3978
  if (!relative.path) {
3979
- target.path = base.path;
3979
+ target2.path = base.path;
3980
3980
  if (relative.query !== void 0) {
3981
- target.query = relative.query;
3981
+ target2.query = relative.query;
3982
3982
  } else {
3983
- target.query = base.query;
3983
+ target2.query = base.query;
3984
3984
  }
3985
3985
  } else {
3986
3986
  if (relative.path[0] === "/") {
3987
- target.path = removeDotSegments(relative.path);
3987
+ target2.path = removeDotSegments(relative.path);
3988
3988
  } else {
3989
3989
  const baseHasAuthority = base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0;
3990
3990
  if (baseHasAuthority && !base.path) {
3991
- target.path = "/" + relative.path;
3991
+ target2.path = "/" + relative.path;
3992
3992
  } else if (!base.path) {
3993
- target.path = relative.path;
3993
+ target2.path = relative.path;
3994
3994
  } else {
3995
- target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
3995
+ target2.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
3996
3996
  }
3997
- target.path = base.scheme === void 0 && !baseHasAuthority && target.path[0] !== "/" ? removeDotSegmentsRelative(target.path) : removeDotSegments(target.path);
3997
+ target2.path = base.scheme === void 0 && !baseHasAuthority && target2.path[0] !== "/" ? removeDotSegmentsRelative(target2.path) : removeDotSegments(target2.path);
3998
3998
  }
3999
- target.query = relative.query;
3999
+ target2.query = relative.query;
4000
4000
  }
4001
- target.userinfo = base.userinfo;
4002
- target.host = base.host;
4003
- target.port = base.port;
4001
+ target2.userinfo = base.userinfo;
4002
+ target2.host = base.host;
4003
+ target2.port = base.port;
4004
4004
  }
4005
- target.scheme = base.scheme;
4005
+ target2.scheme = base.scheme;
4006
4006
  }
4007
- target.fragment = relative.fragment;
4008
- return target;
4007
+ target2.fragment = relative.fragment;
4008
+ return target2;
4009
4009
  }
4010
4010
  function equal(uriA, uriB, options) {
4011
4011
  const normalizedA = normalizeComparableURI(uriA, options);
@@ -4320,9 +4320,9 @@ var require_fast_uri = __commonJS({
4320
4320
  }
4321
4321
  });
4322
4322
 
4323
- // connector/node_modules/ajv/dist/runtime/uri.js
4323
+ // ../Phylla/connector/node_modules/ajv/dist/runtime/uri.js
4324
4324
  var require_uri = __commonJS({
4325
- "connector/node_modules/ajv/dist/runtime/uri.js"(exports) {
4325
+ "../Phylla/connector/node_modules/ajv/dist/runtime/uri.js"(exports) {
4326
4326
  "use strict";
4327
4327
  init_define_PHYLLA_BUILT_IN_CLIENT();
4328
4328
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -4332,9 +4332,9 @@ var require_uri = __commonJS({
4332
4332
  }
4333
4333
  });
4334
4334
 
4335
- // connector/node_modules/ajv/dist/core.js
4335
+ // ../Phylla/connector/node_modules/ajv/dist/core.js
4336
4336
  var require_core = __commonJS({
4337
- "connector/node_modules/ajv/dist/core.js"(exports) {
4337
+ "../Phylla/connector/node_modules/ajv/dist/core.js"(exports) {
4338
4338
  "use strict";
4339
4339
  init_define_PHYLLA_BUILT_IN_CLIENT();
4340
4340
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -4944,9 +4944,9 @@ var require_core = __commonJS({
4944
4944
  }
4945
4945
  });
4946
4946
 
4947
- // connector/node_modules/ajv/dist/vocabularies/core/id.js
4947
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/core/id.js
4948
4948
  var require_id = __commonJS({
4949
- "connector/node_modules/ajv/dist/vocabularies/core/id.js"(exports) {
4949
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/core/id.js"(exports) {
4950
4950
  "use strict";
4951
4951
  init_define_PHYLLA_BUILT_IN_CLIENT();
4952
4952
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -4960,9 +4960,9 @@ var require_id = __commonJS({
4960
4960
  }
4961
4961
  });
4962
4962
 
4963
- // connector/node_modules/ajv/dist/vocabularies/core/ref.js
4963
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/core/ref.js
4964
4964
  var require_ref = __commonJS({
4965
- "connector/node_modules/ajv/dist/vocabularies/core/ref.js"(exports) {
4965
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/core/ref.js"(exports) {
4966
4966
  "use strict";
4967
4967
  init_define_PHYLLA_BUILT_IN_CLIENT();
4968
4968
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -5083,9 +5083,9 @@ var require_ref = __commonJS({
5083
5083
  }
5084
5084
  });
5085
5085
 
5086
- // connector/node_modules/ajv/dist/vocabularies/core/index.js
5086
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/core/index.js
5087
5087
  var require_core2 = __commonJS({
5088
- "connector/node_modules/ajv/dist/vocabularies/core/index.js"(exports) {
5088
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/core/index.js"(exports) {
5089
5089
  "use strict";
5090
5090
  init_define_PHYLLA_BUILT_IN_CLIENT();
5091
5091
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -5105,9 +5105,9 @@ var require_core2 = __commonJS({
5105
5105
  }
5106
5106
  });
5107
5107
 
5108
- // connector/node_modules/ajv/dist/vocabularies/validation/limitNumber.js
5108
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/validation/limitNumber.js
5109
5109
  var require_limitNumber = __commonJS({
5110
- "connector/node_modules/ajv/dist/vocabularies/validation/limitNumber.js"(exports) {
5110
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/validation/limitNumber.js"(exports) {
5111
5111
  "use strict";
5112
5112
  init_define_PHYLLA_BUILT_IN_CLIENT();
5113
5113
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -5138,9 +5138,9 @@ var require_limitNumber = __commonJS({
5138
5138
  }
5139
5139
  });
5140
5140
 
5141
- // connector/node_modules/ajv/dist/vocabularies/validation/multipleOf.js
5141
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/validation/multipleOf.js
5142
5142
  var require_multipleOf = __commonJS({
5143
- "connector/node_modules/ajv/dist/vocabularies/validation/multipleOf.js"(exports) {
5143
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/validation/multipleOf.js"(exports) {
5144
5144
  "use strict";
5145
5145
  init_define_PHYLLA_BUILT_IN_CLIENT();
5146
5146
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -5167,9 +5167,9 @@ var require_multipleOf = __commonJS({
5167
5167
  }
5168
5168
  });
5169
5169
 
5170
- // connector/node_modules/ajv/dist/runtime/ucs2length.js
5170
+ // ../Phylla/connector/node_modules/ajv/dist/runtime/ucs2length.js
5171
5171
  var require_ucs2length = __commonJS({
5172
- "connector/node_modules/ajv/dist/runtime/ucs2length.js"(exports) {
5172
+ "../Phylla/connector/node_modules/ajv/dist/runtime/ucs2length.js"(exports) {
5173
5173
  "use strict";
5174
5174
  init_define_PHYLLA_BUILT_IN_CLIENT();
5175
5175
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -5194,9 +5194,9 @@ var require_ucs2length = __commonJS({
5194
5194
  }
5195
5195
  });
5196
5196
 
5197
- // connector/node_modules/ajv/dist/vocabularies/validation/limitLength.js
5197
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/validation/limitLength.js
5198
5198
  var require_limitLength = __commonJS({
5199
- "connector/node_modules/ajv/dist/vocabularies/validation/limitLength.js"(exports) {
5199
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/validation/limitLength.js"(exports) {
5200
5200
  "use strict";
5201
5201
  init_define_PHYLLA_BUILT_IN_CLIENT();
5202
5202
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -5227,9 +5227,9 @@ var require_limitLength = __commonJS({
5227
5227
  }
5228
5228
  });
5229
5229
 
5230
- // connector/node_modules/ajv/dist/vocabularies/validation/pattern.js
5230
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/validation/pattern.js
5231
5231
  var require_pattern = __commonJS({
5232
- "connector/node_modules/ajv/dist/vocabularies/validation/pattern.js"(exports) {
5232
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/validation/pattern.js"(exports) {
5233
5233
  "use strict";
5234
5234
  init_define_PHYLLA_BUILT_IN_CLIENT();
5235
5235
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -5265,9 +5265,9 @@ var require_pattern = __commonJS({
5265
5265
  }
5266
5266
  });
5267
5267
 
5268
- // connector/node_modules/ajv/dist/vocabularies/validation/limitProperties.js
5268
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/validation/limitProperties.js
5269
5269
  var require_limitProperties = __commonJS({
5270
- "connector/node_modules/ajv/dist/vocabularies/validation/limitProperties.js"(exports) {
5270
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/validation/limitProperties.js"(exports) {
5271
5271
  "use strict";
5272
5272
  init_define_PHYLLA_BUILT_IN_CLIENT();
5273
5273
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -5295,9 +5295,9 @@ var require_limitProperties = __commonJS({
5295
5295
  }
5296
5296
  });
5297
5297
 
5298
- // connector/node_modules/ajv/dist/vocabularies/validation/required.js
5298
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/validation/required.js
5299
5299
  var require_required = __commonJS({
5300
- "connector/node_modules/ajv/dist/vocabularies/validation/required.js"(exports) {
5300
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/validation/required.js"(exports) {
5301
5301
  "use strict";
5302
5302
  init_define_PHYLLA_BUILT_IN_CLIENT();
5303
5303
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -5378,9 +5378,9 @@ var require_required = __commonJS({
5378
5378
  }
5379
5379
  });
5380
5380
 
5381
- // connector/node_modules/ajv/dist/vocabularies/validation/limitItems.js
5381
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/validation/limitItems.js
5382
5382
  var require_limitItems = __commonJS({
5383
- "connector/node_modules/ajv/dist/vocabularies/validation/limitItems.js"(exports) {
5383
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/validation/limitItems.js"(exports) {
5384
5384
  "use strict";
5385
5385
  init_define_PHYLLA_BUILT_IN_CLIENT();
5386
5386
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -5408,9 +5408,9 @@ var require_limitItems = __commonJS({
5408
5408
  }
5409
5409
  });
5410
5410
 
5411
- // connector/node_modules/ajv/dist/runtime/equal.js
5411
+ // ../Phylla/connector/node_modules/ajv/dist/runtime/equal.js
5412
5412
  var require_equal = __commonJS({
5413
- "connector/node_modules/ajv/dist/runtime/equal.js"(exports) {
5413
+ "../Phylla/connector/node_modules/ajv/dist/runtime/equal.js"(exports) {
5414
5414
  "use strict";
5415
5415
  init_define_PHYLLA_BUILT_IN_CLIENT();
5416
5416
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -5420,9 +5420,9 @@ var require_equal = __commonJS({
5420
5420
  }
5421
5421
  });
5422
5422
 
5423
- // connector/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js
5423
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js
5424
5424
  var require_uniqueItems = __commonJS({
5425
- "connector/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js"(exports) {
5425
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js"(exports) {
5426
5426
  "use strict";
5427
5427
  init_define_PHYLLA_BUILT_IN_CLIENT();
5428
5428
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -5488,9 +5488,9 @@ var require_uniqueItems = __commonJS({
5488
5488
  }
5489
5489
  });
5490
5490
 
5491
- // connector/node_modules/ajv/dist/vocabularies/validation/const.js
5491
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/validation/const.js
5492
5492
  var require_const = __commonJS({
5493
- "connector/node_modules/ajv/dist/vocabularies/validation/const.js"(exports) {
5493
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/validation/const.js"(exports) {
5494
5494
  "use strict";
5495
5495
  init_define_PHYLLA_BUILT_IN_CLIENT();
5496
5496
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -5518,9 +5518,9 @@ var require_const = __commonJS({
5518
5518
  }
5519
5519
  });
5520
5520
 
5521
- // connector/node_modules/ajv/dist/vocabularies/validation/enum.js
5521
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/validation/enum.js
5522
5522
  var require_enum = __commonJS({
5523
- "connector/node_modules/ajv/dist/vocabularies/validation/enum.js"(exports) {
5523
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/validation/enum.js"(exports) {
5524
5524
  "use strict";
5525
5525
  init_define_PHYLLA_BUILT_IN_CLIENT();
5526
5526
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -5568,9 +5568,9 @@ var require_enum = __commonJS({
5568
5568
  }
5569
5569
  });
5570
5570
 
5571
- // connector/node_modules/ajv/dist/vocabularies/validation/index.js
5571
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/validation/index.js
5572
5572
  var require_validation = __commonJS({
5573
- "connector/node_modules/ajv/dist/vocabularies/validation/index.js"(exports) {
5573
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/validation/index.js"(exports) {
5574
5574
  "use strict";
5575
5575
  init_define_PHYLLA_BUILT_IN_CLIENT();
5576
5576
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -5607,9 +5607,9 @@ var require_validation = __commonJS({
5607
5607
  }
5608
5608
  });
5609
5609
 
5610
- // connector/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js
5610
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js
5611
5611
  var require_additionalItems = __commonJS({
5612
- "connector/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js"(exports) {
5612
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js"(exports) {
5613
5613
  "use strict";
5614
5614
  init_define_PHYLLA_BUILT_IN_CLIENT();
5615
5615
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -5661,9 +5661,9 @@ var require_additionalItems = __commonJS({
5661
5661
  }
5662
5662
  });
5663
5663
 
5664
- // connector/node_modules/ajv/dist/vocabularies/applicator/items.js
5664
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/items.js
5665
5665
  var require_items = __commonJS({
5666
- "connector/node_modules/ajv/dist/vocabularies/applicator/items.js"(exports) {
5666
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/items.js"(exports) {
5667
5667
  "use strict";
5668
5668
  init_define_PHYLLA_BUILT_IN_CLIENT();
5669
5669
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -5719,9 +5719,9 @@ var require_items = __commonJS({
5719
5719
  }
5720
5720
  });
5721
5721
 
5722
- // connector/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js
5722
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js
5723
5723
  var require_prefixItems = __commonJS({
5724
- "connector/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js"(exports) {
5724
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js"(exports) {
5725
5725
  "use strict";
5726
5726
  init_define_PHYLLA_BUILT_IN_CLIENT();
5727
5727
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -5737,9 +5737,9 @@ var require_prefixItems = __commonJS({
5737
5737
  }
5738
5738
  });
5739
5739
 
5740
- // connector/node_modules/ajv/dist/vocabularies/applicator/items2020.js
5740
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/items2020.js
5741
5741
  var require_items2020 = __commonJS({
5742
- "connector/node_modules/ajv/dist/vocabularies/applicator/items2020.js"(exports) {
5742
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/items2020.js"(exports) {
5743
5743
  "use strict";
5744
5744
  init_define_PHYLLA_BUILT_IN_CLIENT();
5745
5745
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -5773,9 +5773,9 @@ var require_items2020 = __commonJS({
5773
5773
  }
5774
5774
  });
5775
5775
 
5776
- // connector/node_modules/ajv/dist/vocabularies/applicator/contains.js
5776
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/contains.js
5777
5777
  var require_contains = __commonJS({
5778
- "connector/node_modules/ajv/dist/vocabularies/applicator/contains.js"(exports) {
5778
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/contains.js"(exports) {
5779
5779
  "use strict";
5780
5780
  init_define_PHYLLA_BUILT_IN_CLIENT();
5781
5781
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -5868,9 +5868,9 @@ var require_contains = __commonJS({
5868
5868
  }
5869
5869
  });
5870
5870
 
5871
- // connector/node_modules/ajv/dist/vocabularies/applicator/dependencies.js
5871
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/dependencies.js
5872
5872
  var require_dependencies = __commonJS({
5873
- "connector/node_modules/ajv/dist/vocabularies/applicator/dependencies.js"(exports) {
5873
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/dependencies.js"(exports) {
5874
5874
  "use strict";
5875
5875
  init_define_PHYLLA_BUILT_IN_CLIENT();
5876
5876
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -5963,9 +5963,9 @@ var require_dependencies = __commonJS({
5963
5963
  }
5964
5964
  });
5965
5965
 
5966
- // connector/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js
5966
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js
5967
5967
  var require_propertyNames = __commonJS({
5968
- "connector/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js"(exports) {
5968
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js"(exports) {
5969
5969
  "use strict";
5970
5970
  init_define_PHYLLA_BUILT_IN_CLIENT();
5971
5971
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -6007,9 +6007,9 @@ var require_propertyNames = __commonJS({
6007
6007
  }
6008
6008
  });
6009
6009
 
6010
- // connector/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js
6010
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js
6011
6011
  var require_additionalProperties = __commonJS({
6012
- "connector/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js"(exports) {
6012
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js"(exports) {
6013
6013
  "use strict";
6014
6014
  init_define_PHYLLA_BUILT_IN_CLIENT();
6015
6015
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -6114,9 +6114,9 @@ var require_additionalProperties = __commonJS({
6114
6114
  }
6115
6115
  });
6116
6116
 
6117
- // connector/node_modules/ajv/dist/vocabularies/applicator/properties.js
6117
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/properties.js
6118
6118
  var require_properties = __commonJS({
6119
- "connector/node_modules/ajv/dist/vocabularies/applicator/properties.js"(exports) {
6119
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/properties.js"(exports) {
6120
6120
  "use strict";
6121
6121
  init_define_PHYLLA_BUILT_IN_CLIENT();
6122
6122
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -6173,9 +6173,9 @@ var require_properties = __commonJS({
6173
6173
  }
6174
6174
  });
6175
6175
 
6176
- // connector/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js
6176
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js
6177
6177
  var require_patternProperties = __commonJS({
6178
- "connector/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js"(exports) {
6178
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js"(exports) {
6179
6179
  "use strict";
6180
6180
  init_define_PHYLLA_BUILT_IN_CLIENT();
6181
6181
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -6248,9 +6248,9 @@ var require_patternProperties = __commonJS({
6248
6248
  }
6249
6249
  });
6250
6250
 
6251
- // connector/node_modules/ajv/dist/vocabularies/applicator/not.js
6251
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/not.js
6252
6252
  var require_not = __commonJS({
6253
- "connector/node_modules/ajv/dist/vocabularies/applicator/not.js"(exports) {
6253
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/not.js"(exports) {
6254
6254
  "use strict";
6255
6255
  init_define_PHYLLA_BUILT_IN_CLIENT();
6256
6256
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -6280,9 +6280,9 @@ var require_not = __commonJS({
6280
6280
  }
6281
6281
  });
6282
6282
 
6283
- // connector/node_modules/ajv/dist/vocabularies/applicator/anyOf.js
6283
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/anyOf.js
6284
6284
  var require_anyOf = __commonJS({
6285
- "connector/node_modules/ajv/dist/vocabularies/applicator/anyOf.js"(exports) {
6285
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/anyOf.js"(exports) {
6286
6286
  "use strict";
6287
6287
  init_define_PHYLLA_BUILT_IN_CLIENT();
6288
6288
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -6298,9 +6298,9 @@ var require_anyOf = __commonJS({
6298
6298
  }
6299
6299
  });
6300
6300
 
6301
- // connector/node_modules/ajv/dist/vocabularies/applicator/oneOf.js
6301
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/oneOf.js
6302
6302
  var require_oneOf = __commonJS({
6303
- "connector/node_modules/ajv/dist/vocabularies/applicator/oneOf.js"(exports) {
6303
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/oneOf.js"(exports) {
6304
6304
  "use strict";
6305
6305
  init_define_PHYLLA_BUILT_IN_CLIENT();
6306
6306
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -6357,9 +6357,9 @@ var require_oneOf = __commonJS({
6357
6357
  }
6358
6358
  });
6359
6359
 
6360
- // connector/node_modules/ajv/dist/vocabularies/applicator/allOf.js
6360
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/allOf.js
6361
6361
  var require_allOf = __commonJS({
6362
- "connector/node_modules/ajv/dist/vocabularies/applicator/allOf.js"(exports) {
6362
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/allOf.js"(exports) {
6363
6363
  "use strict";
6364
6364
  init_define_PHYLLA_BUILT_IN_CLIENT();
6365
6365
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -6385,9 +6385,9 @@ var require_allOf = __commonJS({
6385
6385
  }
6386
6386
  });
6387
6387
 
6388
- // connector/node_modules/ajv/dist/vocabularies/applicator/if.js
6388
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/if.js
6389
6389
  var require_if = __commonJS({
6390
- "connector/node_modules/ajv/dist/vocabularies/applicator/if.js"(exports) {
6390
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/if.js"(exports) {
6391
6391
  "use strict";
6392
6392
  init_define_PHYLLA_BUILT_IN_CLIENT();
6393
6393
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -6455,9 +6455,9 @@ var require_if = __commonJS({
6455
6455
  }
6456
6456
  });
6457
6457
 
6458
- // connector/node_modules/ajv/dist/vocabularies/applicator/thenElse.js
6458
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/thenElse.js
6459
6459
  var require_thenElse = __commonJS({
6460
- "connector/node_modules/ajv/dist/vocabularies/applicator/thenElse.js"(exports) {
6460
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/thenElse.js"(exports) {
6461
6461
  "use strict";
6462
6462
  init_define_PHYLLA_BUILT_IN_CLIENT();
6463
6463
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -6474,9 +6474,9 @@ var require_thenElse = __commonJS({
6474
6474
  }
6475
6475
  });
6476
6476
 
6477
- // connector/node_modules/ajv/dist/vocabularies/applicator/index.js
6477
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/index.js
6478
6478
  var require_applicator = __commonJS({
6479
- "connector/node_modules/ajv/dist/vocabularies/applicator/index.js"(exports) {
6479
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/applicator/index.js"(exports) {
6480
6480
  "use strict";
6481
6481
  init_define_PHYLLA_BUILT_IN_CLIENT();
6482
6482
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -6523,9 +6523,9 @@ var require_applicator = __commonJS({
6523
6523
  }
6524
6524
  });
6525
6525
 
6526
- // connector/node_modules/ajv/dist/vocabularies/format/format.js
6526
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/format/format.js
6527
6527
  var require_format = __commonJS({
6528
- "connector/node_modules/ajv/dist/vocabularies/format/format.js"(exports) {
6528
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/format/format.js"(exports) {
6529
6529
  "use strict";
6530
6530
  init_define_PHYLLA_BUILT_IN_CLIENT();
6531
6531
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -6614,9 +6614,9 @@ var require_format = __commonJS({
6614
6614
  }
6615
6615
  });
6616
6616
 
6617
- // connector/node_modules/ajv/dist/vocabularies/format/index.js
6617
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/format/index.js
6618
6618
  var require_format2 = __commonJS({
6619
- "connector/node_modules/ajv/dist/vocabularies/format/index.js"(exports) {
6619
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/format/index.js"(exports) {
6620
6620
  "use strict";
6621
6621
  init_define_PHYLLA_BUILT_IN_CLIENT();
6622
6622
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -6626,9 +6626,9 @@ var require_format2 = __commonJS({
6626
6626
  }
6627
6627
  });
6628
6628
 
6629
- // connector/node_modules/ajv/dist/vocabularies/metadata.js
6629
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/metadata.js
6630
6630
  var require_metadata = __commonJS({
6631
- "connector/node_modules/ajv/dist/vocabularies/metadata.js"(exports) {
6631
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/metadata.js"(exports) {
6632
6632
  "use strict";
6633
6633
  init_define_PHYLLA_BUILT_IN_CLIENT();
6634
6634
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -6650,9 +6650,9 @@ var require_metadata = __commonJS({
6650
6650
  }
6651
6651
  });
6652
6652
 
6653
- // connector/node_modules/ajv/dist/vocabularies/draft7.js
6653
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/draft7.js
6654
6654
  var require_draft7 = __commonJS({
6655
- "connector/node_modules/ajv/dist/vocabularies/draft7.js"(exports) {
6655
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/draft7.js"(exports) {
6656
6656
  "use strict";
6657
6657
  init_define_PHYLLA_BUILT_IN_CLIENT();
6658
6658
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -6673,9 +6673,9 @@ var require_draft7 = __commonJS({
6673
6673
  }
6674
6674
  });
6675
6675
 
6676
- // connector/node_modules/ajv/dist/vocabularies/discriminator/types.js
6676
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/discriminator/types.js
6677
6677
  var require_types = __commonJS({
6678
- "connector/node_modules/ajv/dist/vocabularies/discriminator/types.js"(exports) {
6678
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/discriminator/types.js"(exports) {
6679
6679
  "use strict";
6680
6680
  init_define_PHYLLA_BUILT_IN_CLIENT();
6681
6681
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -6688,9 +6688,9 @@ var require_types = __commonJS({
6688
6688
  }
6689
6689
  });
6690
6690
 
6691
- // connector/node_modules/ajv/dist/vocabularies/discriminator/index.js
6691
+ // ../Phylla/connector/node_modules/ajv/dist/vocabularies/discriminator/index.js
6692
6692
  var require_discriminator = __commonJS({
6693
- "connector/node_modules/ajv/dist/vocabularies/discriminator/index.js"(exports) {
6693
+ "../Phylla/connector/node_modules/ajv/dist/vocabularies/discriminator/index.js"(exports) {
6694
6694
  "use strict";
6695
6695
  init_define_PHYLLA_BUILT_IN_CLIENT();
6696
6696
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -6794,9 +6794,9 @@ var require_discriminator = __commonJS({
6794
6794
  }
6795
6795
  });
6796
6796
 
6797
- // connector/node_modules/ajv/dist/refs/json-schema-draft-07.json
6797
+ // ../Phylla/connector/node_modules/ajv/dist/refs/json-schema-draft-07.json
6798
6798
  var require_json_schema_draft_07 = __commonJS({
6799
- "connector/node_modules/ajv/dist/refs/json-schema-draft-07.json"(exports, module) {
6799
+ "../Phylla/connector/node_modules/ajv/dist/refs/json-schema-draft-07.json"(exports, module) {
6800
6800
  module.exports = {
6801
6801
  $schema: "http://json-schema.org/draft-07/schema#",
6802
6802
  $id: "http://json-schema.org/draft-07/schema#",
@@ -6951,9 +6951,9 @@ var require_json_schema_draft_07 = __commonJS({
6951
6951
  }
6952
6952
  });
6953
6953
 
6954
- // connector/node_modules/ajv/dist/ajv.js
6954
+ // ../Phylla/connector/node_modules/ajv/dist/ajv.js
6955
6955
  var require_ajv = __commonJS({
6956
- "connector/node_modules/ajv/dist/ajv.js"(exports, module) {
6956
+ "../Phylla/connector/node_modules/ajv/dist/ajv.js"(exports, module) {
6957
6957
  "use strict";
6958
6958
  init_define_PHYLLA_BUILT_IN_CLIENT();
6959
6959
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -7022,9 +7022,9 @@ var require_ajv = __commonJS({
7022
7022
  }
7023
7023
  });
7024
7024
 
7025
- // connector/node_modules/ajv-formats/dist/formats.js
7025
+ // ../Phylla/connector/node_modules/ajv-formats/dist/formats.js
7026
7026
  var require_formats = __commonJS({
7027
- "connector/node_modules/ajv-formats/dist/formats.js"(exports) {
7027
+ "../Phylla/connector/node_modules/ajv-formats/dist/formats.js"(exports) {
7028
7028
  "use strict";
7029
7029
  init_define_PHYLLA_BUILT_IN_CLIENT();
7030
7030
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -7226,9 +7226,9 @@ var require_formats = __commonJS({
7226
7226
  }
7227
7227
  });
7228
7228
 
7229
- // connector/node_modules/ajv-formats/dist/limit.js
7229
+ // ../Phylla/connector/node_modules/ajv-formats/dist/limit.js
7230
7230
  var require_limit = __commonJS({
7231
- "connector/node_modules/ajv-formats/dist/limit.js"(exports) {
7231
+ "../Phylla/connector/node_modules/ajv-formats/dist/limit.js"(exports) {
7232
7232
  "use strict";
7233
7233
  init_define_PHYLLA_BUILT_IN_CLIENT();
7234
7234
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -7299,9 +7299,9 @@ var require_limit = __commonJS({
7299
7299
  }
7300
7300
  });
7301
7301
 
7302
- // connector/node_modules/ajv-formats/dist/index.js
7302
+ // ../Phylla/connector/node_modules/ajv-formats/dist/index.js
7303
7303
  var require_dist = __commonJS({
7304
- "connector/node_modules/ajv-formats/dist/index.js"(exports, module) {
7304
+ "../Phylla/connector/node_modules/ajv-formats/dist/index.js"(exports, module) {
7305
7305
  "use strict";
7306
7306
  init_define_PHYLLA_BUILT_IN_CLIENT();
7307
7307
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -7345,22 +7345,22 @@ var require_dist = __commonJS({
7345
7345
  // connector/src/index.ts
7346
7346
  init_define_PHYLLA_BUILT_IN_CLIENT();
7347
7347
 
7348
- // connector/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
7348
+ // ../Phylla/connector/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
7349
7349
  init_define_PHYLLA_BUILT_IN_CLIENT();
7350
7350
 
7351
- // connector/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
7351
+ // ../Phylla/connector/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
7352
7352
  init_define_PHYLLA_BUILT_IN_CLIENT();
7353
7353
 
7354
- // connector/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
7354
+ // ../Phylla/connector/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
7355
7355
  init_define_PHYLLA_BUILT_IN_CLIENT();
7356
7356
 
7357
- // connector/node_modules/zod/v4/core/index.js
7357
+ // ../Phylla/connector/node_modules/zod/v4/core/index.js
7358
7358
  init_define_PHYLLA_BUILT_IN_CLIENT();
7359
7359
 
7360
- // connector/node_modules/zod/v4/core/core.js
7360
+ // ../Phylla/connector/node_modules/zod/v4/core/core.js
7361
7361
  init_define_PHYLLA_BUILT_IN_CLIENT();
7362
7362
 
7363
- // connector/node_modules/zod/v4/core/util.js
7363
+ // ../Phylla/connector/node_modules/zod/v4/core/util.js
7364
7364
  var util_exports = {};
7365
7365
  __export(util_exports, {
7366
7366
  BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
@@ -7529,8 +7529,8 @@ function defineLazy(object3, key, getter) {
7529
7529
  function objectClone(obj2) {
7530
7530
  return Object.create(Object.getPrototypeOf(obj2), Object.getOwnPropertyDescriptors(obj2));
7531
7531
  }
7532
- function assignProp(target, prop, value) {
7533
- Object.defineProperty(target, prop, {
7532
+ function assignProp(target2, prop, value) {
7533
+ Object.defineProperty(target2, prop, {
7534
7534
  value,
7535
7535
  writable: true,
7536
7536
  enumerable: true,
@@ -7544,8 +7544,8 @@ function rawShape(def) {
7544
7544
  function sourceShape(schema) {
7545
7545
  return rawShape(schema._zod.def) ?? schema._zod.def.shape;
7546
7546
  }
7547
- function deferProp(target, key, getter) {
7548
- Object.defineProperty(target, key, {
7547
+ function deferProp(target2, key, getter) {
7548
+ Object.defineProperty(target2, key, {
7549
7549
  get() {
7550
7550
  const value = getter();
7551
7551
  assignProp(this, key, value);
@@ -7555,36 +7555,36 @@ function deferProp(target, key, getter) {
7555
7555
  configurable: true
7556
7556
  });
7557
7557
  }
7558
- function putProp(target, key, value) {
7559
- if (key in target)
7560
- assignProp(target, key, value);
7558
+ function putProp(target2, key, value) {
7559
+ if (key in target2)
7560
+ assignProp(target2, key, value);
7561
7561
  else
7562
- target[key] = value;
7562
+ target2[key] = value;
7563
7563
  }
7564
- function mirrorShape(target, source, keys, wrap) {
7564
+ function mirrorShape(target2, source, keys, wrap) {
7565
7565
  const raw = sourceShape(source);
7566
7566
  for (const key of keys) {
7567
7567
  const desc = Object.getOwnPropertyDescriptor(raw, key);
7568
7568
  if (!desc.enumerable)
7569
7569
  continue;
7570
7570
  if (desc.get) {
7571
- deferProp(target, key, () => {
7571
+ deferProp(target2, key, () => {
7572
7572
  const value = source._zod.def.shape[key];
7573
7573
  return wrap ? wrap(value, key) : value;
7574
7574
  });
7575
7575
  } else
7576
- putProp(target, key, wrap ? wrap(desc.value, key) : desc.value);
7576
+ putProp(target2, key, wrap ? wrap(desc.value, key) : desc.value);
7577
7577
  }
7578
7578
  }
7579
- function mirrorProps(target, source) {
7579
+ function mirrorProps(target2, source) {
7580
7580
  for (const key of Reflect.ownKeys(source)) {
7581
7581
  const desc = Object.getOwnPropertyDescriptor(source, key);
7582
7582
  if (!desc.enumerable)
7583
7583
  continue;
7584
7584
  if (desc.get)
7585
- deferProp(target, key, () => source[key]);
7585
+ deferProp(target2, key, () => source[key]);
7586
7586
  else
7587
- putProp(target, key, desc.value);
7587
+ putProp(target2, key, desc.value);
7588
7588
  }
7589
7589
  }
7590
7590
  function mergeDefs(...defs) {
@@ -7763,35 +7763,35 @@ function normalizeParams(_params) {
7763
7763
  return params;
7764
7764
  }
7765
7765
  function createTransparentProxy(getter) {
7766
- let target;
7766
+ let target2;
7767
7767
  return new Proxy({}, {
7768
7768
  get(_, prop, receiver) {
7769
- target ?? (target = getter());
7770
- return Reflect.get(target, prop, receiver);
7769
+ target2 ?? (target2 = getter());
7770
+ return Reflect.get(target2, prop, receiver);
7771
7771
  },
7772
7772
  set(_, prop, value, receiver) {
7773
- target ?? (target = getter());
7774
- return Reflect.set(target, prop, value, receiver);
7773
+ target2 ?? (target2 = getter());
7774
+ return Reflect.set(target2, prop, value, receiver);
7775
7775
  },
7776
7776
  has(_, prop) {
7777
- target ?? (target = getter());
7778
- return Reflect.has(target, prop);
7777
+ target2 ?? (target2 = getter());
7778
+ return Reflect.has(target2, prop);
7779
7779
  },
7780
7780
  deleteProperty(_, prop) {
7781
- target ?? (target = getter());
7782
- return Reflect.deleteProperty(target, prop);
7781
+ target2 ?? (target2 = getter());
7782
+ return Reflect.deleteProperty(target2, prop);
7783
7783
  },
7784
7784
  ownKeys(_) {
7785
- target ?? (target = getter());
7786
- return Reflect.ownKeys(target);
7785
+ target2 ?? (target2 = getter());
7786
+ return Reflect.ownKeys(target2);
7787
7787
  },
7788
7788
  getOwnPropertyDescriptor(_, prop) {
7789
- target ?? (target = getter());
7790
- return Reflect.getOwnPropertyDescriptor(target, prop);
7789
+ target2 ?? (target2 = getter());
7790
+ return Reflect.getOwnPropertyDescriptor(target2, prop);
7791
7791
  },
7792
7792
  defineProperty(_, prop, descriptor) {
7793
- target ?? (target = getter());
7794
- return Reflect.defineProperty(target, prop, descriptor);
7793
+ target2 ?? (target2 = getter());
7794
+ return Reflect.defineProperty(target2, prop, descriptor);
7795
7795
  }
7796
7796
  });
7797
7797
  }
@@ -8217,7 +8217,7 @@ function constantCatch(value) {
8217
8217
  return fn;
8218
8218
  }
8219
8219
 
8220
- // connector/node_modules/zod/v4/core/core.js
8220
+ // ../Phylla/connector/node_modules/zod/v4/core/core.js
8221
8221
  var _a;
8222
8222
  var _zodDesc = { value: void 0, enumerable: false };
8223
8223
  var _E = "captureStackTrace" in Error ? Error : null;
@@ -8271,10 +8271,10 @@ function $constructor(name, initializer3, proto, params) {
8271
8271
  let up = own2;
8272
8272
  while (up && up !== ctorProto)
8273
8273
  up = Object.getPrototypeOf(up);
8274
- const target = up ?? own2;
8275
- if (!initialized.has(target)) {
8276
- initialized.add(target);
8277
- members(target, protoMembers);
8274
+ const target2 = up ?? own2;
8275
+ if (!initialized.has(target2)) {
8276
+ initialized.add(target2);
8277
+ members(target2, protoMembers);
8278
8278
  }
8279
8279
  }
8280
8280
  const proto2 = _.prototype;
@@ -8335,10 +8335,10 @@ function config(newConfig) {
8335
8335
  return globalConfig;
8336
8336
  }
8337
8337
 
8338
- // connector/node_modules/zod/v4/core/parse.js
8338
+ // ../Phylla/connector/node_modules/zod/v4/core/parse.js
8339
8339
  init_define_PHYLLA_BUILT_IN_CLIENT();
8340
8340
 
8341
- // connector/node_modules/zod/v4/core/errors.js
8341
+ // ../Phylla/connector/node_modules/zod/v4/core/errors.js
8342
8342
  init_define_PHYLLA_BUILT_IN_CLIENT();
8343
8343
  function _getMessage() {
8344
8344
  const internals = this._zod;
@@ -8454,7 +8454,7 @@ function formatError(error2, mapper = (issue2) => issue2.message) {
8454
8454
  return fieldErrors;
8455
8455
  }
8456
8456
 
8457
- // connector/node_modules/zod/v4/core/parse.js
8457
+ // ../Phylla/connector/node_modules/zod/v4/core/parse.js
8458
8458
  function finalizeParams(callee, params) {
8459
8459
  return { callee: params?.callee ?? callee, Err: params?.Err };
8460
8460
  }
@@ -8603,13 +8603,13 @@ var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
8603
8603
  return _safeParseAsync(_Err)(schema, value, _ctx);
8604
8604
  };
8605
8605
 
8606
- // connector/node_modules/zod/v4/core/schemas.js
8606
+ // ../Phylla/connector/node_modules/zod/v4/core/schemas.js
8607
8607
  init_define_PHYLLA_BUILT_IN_CLIENT();
8608
8608
 
8609
- // connector/node_modules/zod/v4/core/checks.js
8609
+ // ../Phylla/connector/node_modules/zod/v4/core/checks.js
8610
8610
  init_define_PHYLLA_BUILT_IN_CLIENT();
8611
8611
 
8612
- // connector/node_modules/zod/v4/core/regexes.js
8612
+ // ../Phylla/connector/node_modules/zod/v4/core/regexes.js
8613
8613
  init_define_PHYLLA_BUILT_IN_CLIENT();
8614
8614
  var cuid = /^[cC][0-9a-z]{6,}$/;
8615
8615
  var cuid2 = /^[0-9a-z]+$/;
@@ -8669,7 +8669,7 @@ var _null = /^null$/i;
8669
8669
  var lowercase = /^[^A-Z]*$/;
8670
8670
  var uppercase = /^[^a-z]*$/;
8671
8671
 
8672
- // connector/node_modules/zod/v4/core/checks.js
8672
+ // ../Phylla/connector/node_modules/zod/v4/core/checks.js
8673
8673
  var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
8674
8674
  var _a3;
8675
8675
  inst._zod ?? (inst._zod = {});
@@ -8989,7 +8989,7 @@ var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (ins
8989
8989
  };
8990
8990
  });
8991
8991
 
8992
- // connector/node_modules/zod/v4/core/doc.js
8992
+ // ../Phylla/connector/node_modules/zod/v4/core/doc.js
8993
8993
  init_define_PHYLLA_BUILT_IN_CLIENT();
8994
8994
  var Doc = class {
8995
8995
  constructor(args2 = [], closed = {}) {
@@ -9031,7 +9031,7 @@ ${content.join("\n")}
9031
9031
  }
9032
9032
  };
9033
9033
 
9034
- // connector/node_modules/zod/v4/core/versions.js
9034
+ // ../Phylla/connector/node_modules/zod/v4/core/versions.js
9035
9035
  init_define_PHYLLA_BUILT_IN_CLIENT();
9036
9036
  var version = {
9037
9037
  major: 4,
@@ -9039,7 +9039,7 @@ var version = {
9039
9039
  patch: 7
9040
9040
  };
9041
9041
 
9042
- // connector/node_modules/zod/v4/core/schemas.js
9042
+ // ../Phylla/connector/node_modules/zod/v4/core/schemas.js
9043
9043
  var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
9044
9044
  var _a3;
9045
9045
  inst ?? (inst = {});
@@ -10706,7 +10706,7 @@ function handleRefineResult(result, payload, input, inst) {
10706
10706
  }
10707
10707
  }
10708
10708
 
10709
- // connector/node_modules/zod/v4/core/memoizer.js
10709
+ // ../Phylla/connector/node_modules/zod/v4/core/memoizer.js
10710
10710
  init_define_PHYLLA_BUILT_IN_CLIENT();
10711
10711
  var $ZodCyclicError = class extends Error {
10712
10712
  constructor() {
@@ -10981,7 +10981,7 @@ function isBackEdge(ctx, value) {
10981
10981
  return backEdges !== void 0 && isRef(value) && backEdges.has(value);
10982
10982
  }
10983
10983
 
10984
- // connector/node_modules/zod/v4/locales/en.js
10984
+ // ../Phylla/connector/node_modules/zod/v4/locales/en.js
10985
10985
  init_define_PHYLLA_BUILT_IN_CLIENT();
10986
10986
  var error = () => {
10987
10987
  const Sizable = {
@@ -11107,7 +11107,7 @@ function en_default() {
11107
11107
  };
11108
11108
  }
11109
11109
 
11110
- // connector/node_modules/zod/v4/core/registries.js
11110
+ // ../Phylla/connector/node_modules/zod/v4/core/registries.js
11111
11111
  init_define_PHYLLA_BUILT_IN_CLIENT();
11112
11112
  var _a2;
11113
11113
  var $ZodRegistry = class {
@@ -11156,7 +11156,7 @@ function registry() {
11156
11156
  (_a2 = globalThis).__zod_globalRegistry ?? (_a2.__zod_globalRegistry = registry());
11157
11157
  var globalRegistry = globalThis.__zod_globalRegistry;
11158
11158
 
11159
- // connector/node_modules/zod/v4/core/api.js
11159
+ // ../Phylla/connector/node_modules/zod/v4/core/api.js
11160
11160
  init_define_PHYLLA_BUILT_IN_CLIENT();
11161
11161
  function snapshotChecks(def) {
11162
11162
  if (def.checks)
@@ -11684,28 +11684,28 @@ function _check(fn, params) {
11684
11684
  return ch;
11685
11685
  }
11686
11686
 
11687
- // connector/node_modules/zod/v4/core/to-json-schema.js
11687
+ // ../Phylla/connector/node_modules/zod/v4/core/to-json-schema.js
11688
11688
  init_define_PHYLLA_BUILT_IN_CLIENT();
11689
- function assignProps(target, ...sources) {
11689
+ function assignProps(target2, ...sources) {
11690
11690
  for (const source of sources) {
11691
11691
  for (const key of Reflect.ownKeys(source)) {
11692
11692
  if (Object.prototype.propertyIsEnumerable.call(source, key)) {
11693
- assignProp(target, key, source[key]);
11693
+ assignProp(target2, key, source[key]);
11694
11694
  }
11695
11695
  }
11696
11696
  }
11697
- return target;
11697
+ return target2;
11698
11698
  }
11699
11699
  function initializeContext(params) {
11700
- let target = params?.target ?? "draft-2020-12";
11701
- if (target === "draft-4")
11702
- target = "draft-04";
11703
- if (target === "draft-7")
11704
- target = "draft-07";
11700
+ let target2 = params?.target ?? "draft-2020-12";
11701
+ if (target2 === "draft-4")
11702
+ target2 = "draft-04";
11703
+ if (target2 === "draft-7")
11704
+ target2 = "draft-07";
11705
11705
  return {
11706
11706
  processors: params.processors ?? {},
11707
11707
  metadataRegistry: params?.metadata ?? globalRegistry,
11708
- target,
11708
+ target: target2,
11709
11709
  unrepresentable: params?.unrepresentable ?? "throw",
11710
11710
  override: params?.override ?? (() => {
11711
11711
  }),
@@ -12208,14 +12208,14 @@ var createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
12208
12208
  return finalize(ctx, schema);
12209
12209
  };
12210
12210
  var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
12211
- const { libraryOptions, target } = params ?? {};
12212
- const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
12211
+ const { libraryOptions, target: target2 } = params ?? {};
12212
+ const ctx = initializeContext({ ...libraryOptions ?? {}, target: target2, io, processors });
12213
12213
  processSchema(schema, ctx);
12214
12214
  extractDefs(ctx, schema);
12215
12215
  return finalize(ctx, schema);
12216
12216
  };
12217
12217
 
12218
- // connector/node_modules/zod/v4/core/json-schema-processors.js
12218
+ // ../Phylla/connector/node_modules/zod/v4/core/json-schema-processors.js
12219
12219
  init_define_PHYLLA_BUILT_IN_CLIENT();
12220
12220
  var narrowMin = (agg, key, value) => {
12221
12221
  if (agg[key] === void 0 || value > agg[key])
@@ -12754,10 +12754,10 @@ var optionalProcessor = (schema, ctx, _json, params) => {
12754
12754
  seen.ref = def.innerType;
12755
12755
  };
12756
12756
 
12757
- // connector/node_modules/zod/v4/mini/parse.js
12757
+ // ../Phylla/connector/node_modules/zod/v4/mini/parse.js
12758
12758
  init_define_PHYLLA_BUILT_IN_CLIENT();
12759
12759
 
12760
- // connector/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
12760
+ // ../Phylla/connector/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
12761
12761
  function isZ4Schema(s) {
12762
12762
  const schema = s;
12763
12763
  return !!schema._zod;
@@ -12820,22 +12820,22 @@ function getLiteralValue(schema) {
12820
12820
  return void 0;
12821
12821
  }
12822
12822
 
12823
- // connector/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
12823
+ // ../Phylla/connector/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
12824
12824
  init_define_PHYLLA_BUILT_IN_CLIENT();
12825
12825
 
12826
- // connector/node_modules/zod/v4/classic/external.js
12826
+ // ../Phylla/connector/node_modules/zod/v4/classic/external.js
12827
12827
  init_define_PHYLLA_BUILT_IN_CLIENT();
12828
12828
 
12829
- // connector/node_modules/zod/v4/classic/schemas.js
12829
+ // ../Phylla/connector/node_modules/zod/v4/classic/schemas.js
12830
12830
  init_define_PHYLLA_BUILT_IN_CLIENT();
12831
12831
 
12832
- // connector/node_modules/zod/v4/classic/checks.js
12832
+ // ../Phylla/connector/node_modules/zod/v4/classic/checks.js
12833
12833
  init_define_PHYLLA_BUILT_IN_CLIENT();
12834
12834
 
12835
- // connector/node_modules/zod/v4/classic/parse.js
12835
+ // ../Phylla/connector/node_modules/zod/v4/classic/parse.js
12836
12836
  init_define_PHYLLA_BUILT_IN_CLIENT();
12837
12837
 
12838
- // connector/node_modules/zod/v4/classic/errors.js
12838
+ // ../Phylla/connector/node_modules/zod/v4/classic/errors.js
12839
12839
  init_define_PHYLLA_BUILT_IN_CLIENT();
12840
12840
  var _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
12841
12841
  function _lazyMethod(proto, key, make) {
@@ -12881,7 +12881,7 @@ var ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer2, void 0
12881
12881
  Parent: Error
12882
12882
  });
12883
12883
 
12884
- // connector/node_modules/zod/v4/classic/parse.js
12884
+ // ../Phylla/connector/node_modules/zod/v4/classic/parse.js
12885
12885
  var parse2 = /* @__PURE__ */ _parse(ZodRealError);
12886
12886
  var parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError);
12887
12887
  var safeParse3 = /* @__PURE__ */ _safeParse(ZodRealError);
@@ -12895,7 +12895,7 @@ var safeDecode2 = /* @__PURE__ */ _safeDecode(ZodRealError);
12895
12895
  var safeEncodeAsync2 = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
12896
12896
  var safeDecodeAsync2 = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
12897
12897
 
12898
- // connector/node_modules/zod/v4/classic/schemas.js
12898
+ // ../Phylla/connector/node_modules/zod/v4/classic/schemas.js
12899
12899
  function _ensureDefaultLocale() {
12900
12900
  if (!globalConfig.localeError)
12901
12901
  config(en_default());
@@ -12978,8 +12978,8 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
12978
12978
  catch(params) {
12979
12979
  return _catch(this, params);
12980
12980
  },
12981
- pipe(target) {
12982
- return pipe(this, target);
12981
+ pipe(target2) {
12982
+ return pipe(this, target2);
12983
12983
  },
12984
12984
  readonly() {
12985
12985
  return readonly(this);
@@ -13839,7 +13839,7 @@ function preprocess(fn, schema) {
13839
13839
  });
13840
13840
  }
13841
13841
 
13842
- // connector/node_modules/zod/v4/classic/iso.js
13842
+ // ../Phylla/connector/node_modules/zod/v4/classic/iso.js
13843
13843
  var iso_exports = {};
13844
13844
  __export(iso_exports, {
13845
13845
  ZodISODate: () => ZodISODate,
@@ -13865,7 +13865,7 @@ function duration2(params) {
13865
13865
  return _isoDuration(ZodISODuration, params);
13866
13866
  }
13867
13867
 
13868
- // connector/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
13868
+ // ../Phylla/connector/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
13869
13869
  var LATEST_PROTOCOL_VERSION = "2025-11-25";
13870
13870
  var SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
13871
13871
  var RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
@@ -15384,134 +15384,134 @@ var UrlElicitationRequiredError = class extends McpError {
15384
15384
  }
15385
15385
  };
15386
15386
 
15387
- // connector/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
15387
+ // ../Phylla/connector/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
15388
15388
  init_define_PHYLLA_BUILT_IN_CLIENT();
15389
15389
  function isTerminal(status) {
15390
15390
  return status === "completed" || status === "failed" || status === "cancelled";
15391
15391
  }
15392
15392
 
15393
- // connector/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
15393
+ // ../Phylla/connector/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
15394
15394
  init_define_PHYLLA_BUILT_IN_CLIENT();
15395
15395
 
15396
- // connector/node_modules/zod-to-json-schema/dist/esm/index.js
15396
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/index.js
15397
15397
  init_define_PHYLLA_BUILT_IN_CLIENT();
15398
15398
 
15399
- // connector/node_modules/zod-to-json-schema/dist/esm/Options.js
15399
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/Options.js
15400
15400
  init_define_PHYLLA_BUILT_IN_CLIENT();
15401
15401
 
15402
- // connector/node_modules/zod-to-json-schema/dist/esm/Refs.js
15402
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/Refs.js
15403
15403
  init_define_PHYLLA_BUILT_IN_CLIENT();
15404
15404
 
15405
- // connector/node_modules/zod-to-json-schema/dist/esm/errorMessages.js
15405
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/errorMessages.js
15406
15406
  init_define_PHYLLA_BUILT_IN_CLIENT();
15407
15407
 
15408
- // connector/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js
15408
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js
15409
15409
  init_define_PHYLLA_BUILT_IN_CLIENT();
15410
15410
 
15411
- // connector/node_modules/zod-to-json-schema/dist/esm/parseDef.js
15411
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parseDef.js
15412
15412
  init_define_PHYLLA_BUILT_IN_CLIENT();
15413
15413
 
15414
- // connector/node_modules/zod-to-json-schema/dist/esm/selectParser.js
15414
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/selectParser.js
15415
15415
  init_define_PHYLLA_BUILT_IN_CLIENT();
15416
15416
 
15417
- // connector/node_modules/zod-to-json-schema/dist/esm/parsers/any.js
15417
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parsers/any.js
15418
15418
  init_define_PHYLLA_BUILT_IN_CLIENT();
15419
15419
 
15420
- // connector/node_modules/zod-to-json-schema/dist/esm/parsers/array.js
15420
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parsers/array.js
15421
15421
  init_define_PHYLLA_BUILT_IN_CLIENT();
15422
15422
 
15423
- // connector/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js
15423
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js
15424
15424
  init_define_PHYLLA_BUILT_IN_CLIENT();
15425
15425
 
15426
- // connector/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js
15426
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js
15427
15427
  init_define_PHYLLA_BUILT_IN_CLIENT();
15428
15428
 
15429
- // connector/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js
15429
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js
15430
15430
  init_define_PHYLLA_BUILT_IN_CLIENT();
15431
15431
 
15432
- // connector/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js
15432
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js
15433
15433
  init_define_PHYLLA_BUILT_IN_CLIENT();
15434
15434
 
15435
- // connector/node_modules/zod-to-json-schema/dist/esm/parsers/date.js
15435
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parsers/date.js
15436
15436
  init_define_PHYLLA_BUILT_IN_CLIENT();
15437
15437
 
15438
- // connector/node_modules/zod-to-json-schema/dist/esm/parsers/default.js
15438
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parsers/default.js
15439
15439
  init_define_PHYLLA_BUILT_IN_CLIENT();
15440
15440
 
15441
- // connector/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js
15441
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js
15442
15442
  init_define_PHYLLA_BUILT_IN_CLIENT();
15443
15443
 
15444
- // connector/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js
15444
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js
15445
15445
  init_define_PHYLLA_BUILT_IN_CLIENT();
15446
15446
 
15447
- // connector/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js
15447
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js
15448
15448
  init_define_PHYLLA_BUILT_IN_CLIENT();
15449
15449
 
15450
- // connector/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js
15450
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js
15451
15451
  init_define_PHYLLA_BUILT_IN_CLIENT();
15452
15452
 
15453
- // connector/node_modules/zod-to-json-schema/dist/esm/parsers/map.js
15453
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parsers/map.js
15454
15454
  init_define_PHYLLA_BUILT_IN_CLIENT();
15455
15455
 
15456
- // connector/node_modules/zod-to-json-schema/dist/esm/parsers/record.js
15456
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parsers/record.js
15457
15457
  init_define_PHYLLA_BUILT_IN_CLIENT();
15458
15458
 
15459
- // connector/node_modules/zod-to-json-schema/dist/esm/parsers/string.js
15459
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parsers/string.js
15460
15460
  init_define_PHYLLA_BUILT_IN_CLIENT();
15461
15461
  var ALPHA_NUMERIC = new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
15462
15462
 
15463
- // connector/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js
15463
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js
15464
15464
  init_define_PHYLLA_BUILT_IN_CLIENT();
15465
15465
 
15466
- // connector/node_modules/zod-to-json-schema/dist/esm/parsers/never.js
15466
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parsers/never.js
15467
15467
  init_define_PHYLLA_BUILT_IN_CLIENT();
15468
15468
 
15469
- // connector/node_modules/zod-to-json-schema/dist/esm/parsers/null.js
15469
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parsers/null.js
15470
15470
  init_define_PHYLLA_BUILT_IN_CLIENT();
15471
15471
 
15472
- // connector/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js
15472
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js
15473
15473
  init_define_PHYLLA_BUILT_IN_CLIENT();
15474
15474
 
15475
- // connector/node_modules/zod-to-json-schema/dist/esm/parsers/union.js
15475
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parsers/union.js
15476
15476
  init_define_PHYLLA_BUILT_IN_CLIENT();
15477
15477
 
15478
- // connector/node_modules/zod-to-json-schema/dist/esm/parsers/number.js
15478
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parsers/number.js
15479
15479
  init_define_PHYLLA_BUILT_IN_CLIENT();
15480
15480
 
15481
- // connector/node_modules/zod-to-json-schema/dist/esm/parsers/object.js
15481
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parsers/object.js
15482
15482
  init_define_PHYLLA_BUILT_IN_CLIENT();
15483
15483
 
15484
- // connector/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js
15484
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js
15485
15485
  init_define_PHYLLA_BUILT_IN_CLIENT();
15486
15486
 
15487
- // connector/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js
15487
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js
15488
15488
  init_define_PHYLLA_BUILT_IN_CLIENT();
15489
15489
 
15490
- // connector/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js
15490
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js
15491
15491
  init_define_PHYLLA_BUILT_IN_CLIENT();
15492
15492
 
15493
- // connector/node_modules/zod-to-json-schema/dist/esm/parsers/set.js
15493
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parsers/set.js
15494
15494
  init_define_PHYLLA_BUILT_IN_CLIENT();
15495
15495
 
15496
- // connector/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js
15496
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js
15497
15497
  init_define_PHYLLA_BUILT_IN_CLIENT();
15498
15498
 
15499
- // connector/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js
15499
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js
15500
15500
  init_define_PHYLLA_BUILT_IN_CLIENT();
15501
15501
 
15502
- // connector/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js
15502
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js
15503
15503
  init_define_PHYLLA_BUILT_IN_CLIENT();
15504
15504
 
15505
- // connector/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js
15505
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js
15506
15506
  init_define_PHYLLA_BUILT_IN_CLIENT();
15507
15507
 
15508
- // connector/node_modules/zod-to-json-schema/dist/esm/parseTypes.js
15508
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/parseTypes.js
15509
15509
  init_define_PHYLLA_BUILT_IN_CLIENT();
15510
15510
 
15511
- // connector/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js
15511
+ // ../Phylla/connector/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js
15512
15512
  init_define_PHYLLA_BUILT_IN_CLIENT();
15513
15513
 
15514
- // connector/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
15514
+ // ../Phylla/connector/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
15515
15515
  function getMethodLiteral(schema) {
15516
15516
  const shape = getObjectShape(schema);
15517
15517
  const methodSchema = shape?.method;
@@ -15532,7 +15532,7 @@ function parseWithCompat(schema, data) {
15532
15532
  return result.data;
15533
15533
  }
15534
15534
 
15535
- // connector/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
15535
+ // ../Phylla/connector/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
15536
15536
  var DEFAULT_REQUEST_TIMEOUT_MSEC = 6e4;
15537
15537
  var Protocol = class {
15538
15538
  constructor(_options) {
@@ -16509,7 +16509,7 @@ function mergeCapabilities(base, additional) {
16509
16509
  return result;
16510
16510
  }
16511
16511
 
16512
- // connector/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
16512
+ // ../Phylla/connector/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
16513
16513
  init_define_PHYLLA_BUILT_IN_CLIENT();
16514
16514
  var import_ajv = __toESM(require_ajv(), 1);
16515
16515
  var import_ajv_formats = __toESM(require_dist(), 1);
@@ -16578,7 +16578,7 @@ var AjvJsonSchemaValidator = class {
16578
16578
  }
16579
16579
  };
16580
16580
 
16581
- // connector/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js
16581
+ // ../Phylla/connector/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js
16582
16582
  init_define_PHYLLA_BUILT_IN_CLIENT();
16583
16583
  var ExperimentalServerTasks = class {
16584
16584
  constructor(_server) {
@@ -16792,7 +16792,7 @@ var ExperimentalServerTasks = class {
16792
16792
  }
16793
16793
  };
16794
16794
 
16795
- // connector/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js
16795
+ // ../Phylla/connector/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js
16796
16796
  init_define_PHYLLA_BUILT_IN_CLIENT();
16797
16797
  function assertToolsCallTaskCapability(requests, method, entityName) {
16798
16798
  if (!requests) {
@@ -16828,7 +16828,7 @@ function assertClientRequestTaskCapability(requests, method, entityName) {
16828
16828
  }
16829
16829
  }
16830
16830
 
16831
- // connector/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
16831
+ // ../Phylla/connector/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
16832
16832
  var Server = class extends Protocol {
16833
16833
  /**
16834
16834
  * Initializes this server with the given name and version information.
@@ -17199,11 +17199,11 @@ var Server = class extends Protocol {
17199
17199
  }
17200
17200
  };
17201
17201
 
17202
- // connector/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
17202
+ // ../Phylla/connector/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
17203
17203
  init_define_PHYLLA_BUILT_IN_CLIENT();
17204
17204
  import process2 from "node:process";
17205
17205
 
17206
- // connector/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
17206
+ // ../Phylla/connector/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
17207
17207
  init_define_PHYLLA_BUILT_IN_CLIENT();
17208
17208
  var STDIO_DEFAULT_MAX_BUFFER_SIZE = 10 * 1024 * 1024;
17209
17209
  var ReadBuffer = class {
@@ -17241,7 +17241,7 @@ function serializeMessage(message) {
17241
17241
  return JSON.stringify(message) + "\n";
17242
17242
  }
17243
17243
 
17244
- // connector/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
17244
+ // ../Phylla/connector/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
17245
17245
  var StdioServerTransport = class {
17246
17246
  constructor(_stdin = process2.stdin, _stdout = process2.stdout, options) {
17247
17247
  this._stdin = _stdin;
@@ -17750,6 +17750,19 @@ var SEED_MAP = {
17750
17750
  };
17751
17751
 
17752
17752
  // src/board/model.ts
17753
+ function boardKey(level) {
17754
+ const extra = level.kind !== "library" && level.board ? `~${level.board}` : "";
17755
+ switch (level.kind) {
17756
+ case "studio":
17757
+ return `studio${extra}`;
17758
+ case "client":
17759
+ return `client-${level.id}${extra}`;
17760
+ case "system":
17761
+ return `system-${level.id}${extra}`;
17762
+ case "library":
17763
+ return `library-${level.index}`;
17764
+ }
17765
+ }
17753
17766
  function archivedNow(x) {
17754
17767
  if (!x.archived && x.archivedAt === void 0) return false;
17755
17768
  return !(x.restoredAt !== void 0 && x.restoredAt > (x.archivedAt ?? 0));
@@ -17764,28 +17777,49 @@ function mergeStamps(a, b) {
17764
17777
  function defined(x) {
17765
17778
  return Object.fromEntries(Object.entries(x).filter(([, v]) => v !== void 0));
17766
17779
  }
17767
- function validPath(m, p) {
17768
- const t = m.techniques.find((x) => x.id === p.techniqueId);
17769
- return !!t && t.leverIds.includes(p.leverId) && m.goals.some((g) => g.id === p.goalId) && m.levers.some((l) => l.id === p.leverId);
17780
+ var gone = (n) => !!n.hidden || !!n.removed;
17781
+ function shownMap(m) {
17782
+ const goals = m.goals.filter((g) => !gone(g));
17783
+ const levers = m.levers.filter((l) => !gone(l));
17784
+ const leverIds = new Set(levers.map((l) => l.id));
17785
+ const techniques = m.techniques.filter((t) => !gone(t)).map((t) => ({ ...t, leverIds: t.leverIds.filter((id) => leverIds.has(id)) })).filter((t) => t.leverIds.length > 0);
17786
+ return { goals, levers, techniques };
17787
+ }
17788
+ function nodeProblem(kind, nodes, id) {
17789
+ const n = nodes.find((x) => x.id === id);
17790
+ if (!n) return `unknown ${kind} "${id}"`;
17791
+ if (n.removed) return `${kind} "${id}" is removed`;
17792
+ if (n.hidden) return `${kind} "${id}" is hidden`;
17793
+ return null;
17794
+ }
17795
+ function pathProblem(m, p) {
17796
+ const problem = nodeProblem("goal", m.goals, p.goalId) ?? nodeProblem("lever", m.levers, p.leverId) ?? nodeProblem("technique", m.techniques, p.techniqueId);
17797
+ if (problem) return problem;
17798
+ return m.techniques.find((t) => t.id === p.techniqueId).leverIds.includes(p.leverId) ? null : `technique "${p.techniqueId}" does not belong to lever "${p.leverId}"`;
17770
17799
  }
17771
- function addTechnique(b, t) {
17800
+ var validPath = (m, p) => pathProblem(m, p) === null;
17801
+ function addTechnique(b, t, now = Date.now()) {
17772
17802
  const name = t.name.trim().replace(/\s+/g, " ");
17773
- const existing = b.map.techniques.find((x) => x.name.toLowerCase() === name.toLowerCase());
17803
+ const existing = b.map.techniques.find((x) => !x.removed && x.name.toLowerCase() === name.toLowerCase());
17774
17804
  if (existing) return { board: b, id: existing.id };
17775
- const base = kebab(name) || "technique";
17776
- const taken = new Set(b.map.techniques.map((x) => x.id));
17777
- let id = base;
17778
- for (let n = 2; taken.has(id); n += 1) id = `${base}-${n}`;
17779
- const technique = { id, name, leverIds: t.leverIds, isNew: true };
17780
- return { board: { ...b, map: { ...b.map, techniques: [...b.map.techniques, technique] }, updatedAt: Date.now() }, id };
17805
+ const id = uniqueId(b.map.techniques, kebab(name) || "technique");
17806
+ const technique = { id, name, leverIds: t.leverIds, suggested: true, updatedAt: now };
17807
+ return { board: { ...b, map: { ...b.map, techniques: [...b.map.techniques, technique] }, updatedAt: now }, id };
17781
17808
  }
17782
17809
  var unsorted = (b) => b.items.filter((i) => i.status === "unsorted" && !i.removed);
17783
17810
  var present = (b) => b.items.filter((i) => !i.removed);
17811
+ function uniqueId(list2, base) {
17812
+ const taken = new Set(list2.map((n) => n.id));
17813
+ let id = base;
17814
+ for (let n = 2; taken.has(id); n += 1) id = `${base}-${n}`;
17815
+ return id;
17816
+ }
17784
17817
 
17785
17818
  // src/lib/driveIndex.ts
17786
17819
  var ROOT = "Phylla";
17787
17820
  var LEGACY_ROOTS = ["Design System AI"];
17788
17821
  var INDEX_FILE = "index.json";
17822
+ var PROJECTS_FILE = "projects.json";
17789
17823
  var looking = /* @__PURE__ */ new WeakMap();
17790
17824
  async function legacyRoot(drive) {
17791
17825
  for (const name of LEGACY_ROOTS) {
@@ -17827,7 +17861,9 @@ function findRoot(drive, { migrate, create = false }) {
17827
17861
  }
17828
17862
  return create ? job.then((id) => id ?? drive.folder(ROOT)) : job;
17829
17863
  }
17830
- var validEntry = (e) => !!e && typeof e === "object" && ["system", "client", "board"].includes(e.kind) && typeof e.id === "string" && typeof e.fileId === "string";
17864
+ var entryOfKind = (kinds) => (e) => !!e && typeof e === "object" && kinds.includes(e.kind) && typeof e.id === "string" && typeof e.fileId === "string";
17865
+ var validEntry = entryOfKind(["system", "client", "board"]);
17866
+ var validProjectEntry = entryOfKind(["project"]);
17831
17867
  var sameKey = (a, b) => a.kind === b.kind && a.id === b.id;
17832
17868
  function mergeIndexes(mine, theirs, skip = () => false) {
17833
17869
  const merged = mine.map((e) => ({ ...e }));
@@ -17844,27 +17880,33 @@ function mergeIndexes(mine, theirs, skip = () => false) {
17844
17880
  }
17845
17881
  return merged;
17846
17882
  }
17847
- var gone = (e) => e instanceof DriveError && e.status === 404;
17848
- var entriesOf = (raw) => {
17883
+ var gone2 = (e) => e instanceof DriveError && e.status === 404;
17884
+ var entriesOf = (raw, valid) => {
17849
17885
  const list2 = raw?.entries;
17850
- return Array.isArray(list2) ? list2.filter(validEntry) : [];
17886
+ return Array.isArray(list2) ? list2.filter(valid) : [];
17851
17887
  };
17852
17888
  function inTheirOrder(entries, theirs) {
17853
17889
  const at = new Map(theirs.map((t, i) => [`${t.kind}:${t.id}`, i]));
17854
17890
  return entries.map((e, i) => ({ e, rank: at.get(`${e.kind}:${e.id}`) ?? theirs.length + i })).sort((a, b) => a.rank - b.rank).map((x) => x.e);
17855
17891
  }
17856
- async function saveIndex(drive, root2, mine, { fileId = null, skip, beforeWrite } = {}) {
17892
+ async function saveIndex(drive, root2, mine, {
17893
+ fileId = null,
17894
+ skip,
17895
+ beforeWrite,
17896
+ file = INDEX_FILE,
17897
+ valid = validEntry
17898
+ } = {}) {
17857
17899
  let id = fileId;
17858
17900
  let entries = mine;
17859
17901
  for (let round = 0; round < 3; round += 1) {
17860
- id ??= await drive.find(INDEX_FILE, root2);
17902
+ id ??= await drive.find(file, root2);
17861
17903
  let read = null;
17862
17904
  if (id) {
17863
17905
  try {
17864
17906
  const at = await drive.modifiedTime(id);
17865
- read = { at, theirs: entriesOf(await drive.readJson(id)) };
17907
+ read = { at, theirs: entriesOf(await drive.readJson(id), valid) };
17866
17908
  } catch (e) {
17867
- if (!gone(e)) throw e;
17909
+ if (!gone2(e)) throw e;
17868
17910
  id = null;
17869
17911
  continue;
17870
17912
  }
@@ -17873,14 +17915,14 @@ async function saveIndex(drive, root2, mine, { fileId = null, skip, beforeWrite
17873
17915
  beforeWrite?.();
17874
17916
  if (id && read && round === 0 && await drive.modifiedTime(id) !== read.at) continue;
17875
17917
  try {
17876
- return { fileId: await drive.writeJson(root2, INDEX_FILE, { version: 1, entries }, id ?? void 0), entries };
17918
+ return { fileId: await drive.writeJson(root2, file, { version: 1, entries }, id ?? void 0), entries };
17877
17919
  } catch (e) {
17878
- if (!id || !gone(e)) throw e;
17920
+ if (!id || !gone2(e)) throw e;
17879
17921
  id = null;
17880
17922
  }
17881
17923
  }
17882
17924
  beforeWrite?.();
17883
- return { fileId: await drive.writeJson(root2, INDEX_FILE, { version: 1, entries }), entries };
17925
+ return { fileId: await drive.writeJson(root2, file, { version: 1, entries }), entries };
17884
17926
  }
17885
17927
 
17886
17928
  // connector/src/drive.ts
@@ -17924,6 +17966,10 @@ function places(drive) {
17924
17966
  var Missing = class extends Error {
17925
17967
  };
17926
17968
 
17969
+ // src/lib/connectorVersion.ts
17970
+ init_define_PHYLLA_BUILT_IN_CLIENT();
17971
+ var CONNECTOR_VERSION = "0.4.0";
17972
+
17927
17973
  // connector/src/tools.ts
17928
17974
  init_define_PHYLLA_BUILT_IN_CLIENT();
17929
17975
 
@@ -17992,6 +18038,58 @@ function motionForStyle(style) {
17992
18038
  custom: false
17993
18039
  };
17994
18040
  }
18041
+ function styleFor(system) {
18042
+ switch (system.designStyle) {
18043
+ case "brutalism":
18044
+ return "snappy";
18045
+ case "claymorphism":
18046
+ return "playful";
18047
+ case "glassmorphism":
18048
+ return "calm";
18049
+ }
18050
+ const words2 = (system.personality ?? []).join(" ").toLowerCase();
18051
+ if (/playful|fun|bold/.test(words2)) return "playful";
18052
+ if (/luxury|calm|elegant/.test(words2)) return "calm";
18053
+ return "snappy";
18054
+ }
18055
+ function motionOf(system) {
18056
+ const stored = system.motion;
18057
+ const fallback = motionForStyle(stored?.style ?? styleFor(system));
18058
+ if (!stored) return fallback;
18059
+ return {
18060
+ style: stored.style ?? fallback.style,
18061
+ durations: stored.durations?.length ? stored.durations : fallback.durations,
18062
+ easings: stored.easings?.length ? stored.easings : fallback.easings,
18063
+ spring: stored.spring ?? fallback.spring,
18064
+ presets: stored.presets?.length ? stored.presets : fallback.presets,
18065
+ slots: { ...DEFAULT_SLOTS, ...stored.slots ?? {} },
18066
+ calmData: stored.calmData ?? true,
18067
+ custom: stored.custom ?? false
18068
+ };
18069
+ }
18070
+ function springCurve(spring) {
18071
+ const dt = 1 / 120;
18072
+ let x = 0;
18073
+ let v = 0;
18074
+ let t = 0;
18075
+ const trace = [0];
18076
+ while (t < 3) {
18077
+ const a = -spring.stiffness * (x - 1) - spring.damping * v;
18078
+ v += a * dt;
18079
+ x += v * dt;
18080
+ t += dt;
18081
+ trace.push(x);
18082
+ if (Math.abs(x - 1) < 1e-3 && Math.abs(v) < 0.01) break;
18083
+ }
18084
+ trace[trace.length - 1] = 1;
18085
+ const n = 40;
18086
+ const points = Array.from({ length: n + 1 }, (_, i) => r2Precise(trace[Math.round(i / n * (trace.length - 1))]));
18087
+ return { points, ms: Math.round(t * 1e3) };
18088
+ }
18089
+ var r2Precise = (n) => Math.round(n * 1e3) / 1e3;
18090
+ function springToLinear(spring) {
18091
+ return `linear(${springCurve(spring).points.join(", ")})`;
18092
+ }
17995
18093
 
17996
18094
  // src/services/geminiService.ts
17997
18095
  var MOTION_STYLES2 = ["calm", "snappy", "playful", "expressive"];
@@ -18087,6 +18185,7 @@ var SORT_RULES = [
18087
18185
  "You sort design inspiration into a map of visual ideas: goal, then lever, then technique.",
18088
18186
  "For every item below, choose one to three paths. A path names a goal, a lever and a technique by id, and the technique must be one of that lever's own techniques (see its leverIds).",
18089
18187
  'Prefer the techniques on the map. Only when none fits, propose a new technique in newTechniques with a short name and the ids of the levers it belongs to (levers already on the map), and use "new:" followed by its exact name as the techniqueId.',
18188
+ 'Suggested techniques wait for the person (they are marked "suggested": true). You may file items under them, but prefer techniques that are not suggested.',
18090
18189
  "Add tags when you can tell: the main colours as hex, the type of thing, its subject and its medium.",
18091
18190
  "Return one filing for every item, by its id."
18092
18191
  ].join("\n");
@@ -18104,12 +18203,13 @@ function tagsOf(v) {
18104
18203
  function parseSort(raw, b) {
18105
18204
  const out = { filings: [], newTechniques: [], failed: [] };
18106
18205
  if (!isObj(raw)) return out;
18206
+ const shown = shownMap(b.map);
18107
18207
  const proposed = /* @__PURE__ */ new Map();
18108
18208
  for (const t of list(raw.newTechniques)) {
18109
18209
  if (!isObj(t)) continue;
18110
18210
  const name = word(t.name)?.replace(/\s+/g, " ");
18111
18211
  const leverIds = words(t.leverIds);
18112
- if (!name || !leverIds.length || !leverIds.every((id) => b.map.levers.some((l) => l.id === id))) continue;
18212
+ if (!name || !leverIds.length || !leverIds.every((id) => shown.levers.some((l) => l.id === id))) continue;
18113
18213
  if (!proposed.has(name.toLowerCase())) proposed.set(name.toLowerCase(), { name, leverIds: [...new Set(leverIds)], forItemIds: [] });
18114
18214
  }
18115
18215
  const onBoard = new Set(b.items.filter((i) => !i.removed).map((i) => i.id));
@@ -18138,10 +18238,10 @@ function parseSort(raw, b) {
18138
18238
  let path = { goalId, leverId, techniqueId };
18139
18239
  if (techniqueId.startsWith(NEW_TECHNIQUE)) {
18140
18240
  const name = techniqueId.slice(NEW_TECHNIQUE.length).trim().replace(/\s+/g, " ").toLowerCase();
18141
- const existing = b.map.techniques.find((t) => t.name.toLowerCase() === name);
18241
+ const existing = b.map.techniques.find((t) => !t.removed && t.name.toLowerCase() === name);
18142
18242
  const fresh = proposed.get(name);
18143
18243
  if (existing) path = { goalId, leverId, techniqueId: existing.id };
18144
- else if (fresh && fresh.leverIds.includes(leverId) && b.map.goals.some((g) => g.id === goalId)) {
18244
+ else if (fresh && fresh.leverIds.includes(leverId) && shown.goals.some((g) => g.id === goalId)) {
18145
18245
  path = { goalId, leverId, techniqueId: `${NEW_TECHNIQUE}${fresh.name}` };
18146
18246
  uses.push(fresh);
18147
18247
  paths.push(path);
@@ -18336,7 +18436,8 @@ var REQUEST_KINDS = [
18336
18436
  "tool-change",
18337
18437
  "tool-run",
18338
18438
  "tool-publish",
18339
- "tool-run-in-app"
18439
+ "tool-run-in-app",
18440
+ "ping"
18340
18441
  ];
18341
18442
  var REQUEST_STATUSES = ["open", "done", "failed"];
18342
18443
  function asRequest(raw, fileName) {
@@ -18370,84 +18471,19 @@ function sentenceFor(r, boardName = "") {
18370
18471
  return `Publish my "${r.toolName ?? "new"}" tool to its own address.`;
18371
18472
  case "tool-run-in-app":
18372
18473
  return "";
18474
+ // the app answers it itself
18475
+ case "ping":
18476
+ return "Check my Phylla connection.";
18373
18477
  }
18374
18478
  }
18375
18479
 
18376
- // connector/src/tools.ts
18377
- import { mkdtemp, writeFile as writeFile2 } from "node:fs/promises";
18378
- import { tmpdir } from "node:os";
18379
- import { join as join2 } from "node:path";
18380
-
18381
- // src/tools/answers.ts
18382
- init_define_PHYLLA_BUILT_IN_CLIENT();
18383
- var isObj2 = (v) => !!v && typeof v === "object" && !Array.isArray(v);
18384
- var filled = (v) => typeof v === "string" && v.trim().length > 0;
18385
- function planProblems(raw) {
18386
- if (!isObj2(raw)) return ["the plan"];
18387
- const missing = [];
18388
- for (const key of ["makes", "makerLabel", "look"]) if (!filled(raw[key])) missing.push(key);
18389
- if (raw.engine !== "code" && raw.engine !== "claude") missing.push('engine ("code" or "claude")');
18390
- if (!Array.isArray(raw.inputs)) missing.push("inputs");
18391
- if (!Array.isArray(raw.outputs) || !raw.outputs.length) missing.push("outputs");
18392
- for (const key of ["needs", "pins", "exclusions"]) if (!Array.isArray(raw[key])) missing.push(key);
18393
- for (const key of ["useBoardStyle", "usesPictures"]) if (typeof raw[key] !== "boolean") missing.push(key);
18394
- return missing;
18395
- }
18396
- function answerProblems(kind, raw) {
18397
- switch (kind) {
18398
- case "tool-plan":
18399
- if (!isObj2(raw) || typeof raw.fit !== "boolean") return ["fit (true or false)"];
18400
- if (!raw.fit) return [...filled(raw.why) ? [] : ["why"], ...filled(raw.add) ? [] : ["add"]];
18401
- return [...filled(raw.name) ? [] : ["name"], ...planProblems(raw.plan).map((p) => `plan.${p}`)];
18402
- case "tool-change":
18403
- return isObj2(raw) ? planProblems(raw.plan).map((p) => `plan.${p}`) : ["plan"];
18404
- case "tool-build":
18405
- if (!isObj2(raw)) return ["engine", "body"];
18406
- return [...raw.engine === "code" || raw.engine === "claude" ? [] : ['engine ("code" or "claude")'], ...filled(raw.body) ? [] : ["body"]];
18407
- case "tool-run":
18408
- case "tool-run-in-app":
18409
- return isObj2(raw) && filled(raw.resultId) ? [] : ["resultId"];
18410
- case "tool-publish":
18411
- return isObj2(raw) && typeof raw.address === "string" && /^https?:\/\//.test(raw.address) ? [] : ["address (a web address starting with https://)"];
18412
- default:
18413
- return [];
18414
- }
18415
- }
18416
-
18417
- // src/tools/generator.ts
18418
- init_define_PHYLLA_BUILT_IN_CLIENT();
18419
- var MAX_RESULT_BYTES = 50 * 1024 * 1024;
18420
- var FRAME_CSP = "default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; img-src data: blob:; media-src data: blob:";
18421
- var GENERATOR_CONTRACT = `A tool that runs in Phylla is one self-contained HTML file: its scripts and styles inline, loading nothing from outside the file, with no network calls (the page runs in a sandbox with no network; fetch and outside links fail).
18422
- 1. Once loaded, post { type: "phylla:ready" } to window.parent with targetOrigin "*".
18423
- 2. Phylla then posts { type: "phylla:run", runId, recipe, inputs, pictures } to the page. recipe has colours (hex and weight), techniques, media, subjects, types, notes and references. inputs are keyed by the input ids in the tool's plan, with the plan's defaults when the person left one alone. pictures are the reference pictures as data: URLs, only when the plan uses pictures.
18424
- 3. Answer each run once, within a minute, with { type: "phylla:files", runId, files: [{ name, mime, data }] }, where data is an ArrayBuffer (transfer it), or with { type: "phylla:error", runId, message } in plain words. All files together must stay under 50 MB.
18425
- 4. Draw with canvas or SVG. To make video, record a canvas with MediaRecorder (video/webm). When the plan asks for the png-tile format, make seamless tiles: the right edge meets the left and the bottom meets the top.
18426
- 5. Show a simple preview of the result on the page itself; Phylla shows the inputs and the Make button, so the page needs no form of its own.`;
18427
- function frameDocument(appHtml) {
18428
- return `<meta http-equiv="Content-Security-Policy" content="${FRAME_CSP}">
18429
- ${appHtml}`;
18430
- }
18431
-
18432
- // src/tools/model.ts
18480
+ // connector/src/handoff.ts
18433
18481
  init_define_PHYLLA_BUILT_IN_CLIENT();
18434
- var last = (xs) => xs[xs.length - 1];
18435
- function recordRecipe(t, fingerprint, now = Date.now()) {
18436
- const newest = last(t.recipeVersions);
18437
- if (newest && newest.fingerprint === fingerprint) return { tool: t, n: newest.n };
18438
- const n = (newest?.n ?? 0) + 1;
18439
- return { tool: { ...t, recipeVersions: [...t.recipeVersions, { n, fingerprint, at: now }], updatedAt: now }, n };
18440
- }
18441
- var build = (t) => t.builds.find((b) => b.n === t.currentBuild);
18442
- function currentPlan(t) {
18443
- const b = build(t);
18444
- return b && t.plans.find((p) => p.n === b.planVersion)?.plan || last(t.plans).plan;
18445
- }
18446
18482
 
18447
- // src/tools/runMessage.ts
18483
+ // src/lib/handoff.ts
18448
18484
  init_define_PHYLLA_BUILT_IN_CLIENT();
18449
18485
 
18450
- // src/tools/recipeNow.ts
18486
+ // src/lib/boardSummary.ts
18451
18487
  init_define_PHYLLA_BUILT_IN_CLIENT();
18452
18488
 
18453
18489
  // src/tools/recipe.ts
@@ -18553,6 +18589,1028 @@ function recipeFingerprint(r) {
18553
18589
  return h.toString(16).padStart(8, "0");
18554
18590
  }
18555
18591
 
18592
+ // src/lib/boardSummary.ts
18593
+ var MOST = 8;
18594
+ var NOTE_LENGTH = 200;
18595
+ var ranked2 = (counts) => [...counts].sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0])).slice(0, MOST).map(([k]) => k);
18596
+ var bump2 = (m, key, by) => m.set(key, (m.get(key) ?? 0) + by);
18597
+ var tidy = (note) => {
18598
+ const one = note.replace(/\s+/g, " ").trim();
18599
+ return one.length > NOTE_LENGTH ? `${one.slice(0, NOTE_LENGTH).trimEnd()}...` : one;
18600
+ };
18601
+ function boardSummary(boards) {
18602
+ const colours = /* @__PURE__ */ new Map();
18603
+ const techniques = /* @__PURE__ */ new Map();
18604
+ const notes = /* @__PURE__ */ new Set();
18605
+ for (const board of boards) {
18606
+ const r = computeRecipe(board);
18607
+ if (!r.sortedCount) continue;
18608
+ for (const c of r.colours) bump2(colours, c.hex, c.weight);
18609
+ for (const t of r.techniques) bump2(techniques, t.name, t.count);
18610
+ for (const n of r.notes) notes.add(tidy(n));
18611
+ }
18612
+ const lean = ranked2(colours).join(", ");
18613
+ const used = ranked2(techniques).join(", ");
18614
+ const said = [...notes].slice(0, MOST).map((n) => `"${n}"`).join(", ");
18615
+ const parts = [used && `techniques: ${used}`, said && `notes: ${said}`].filter(Boolean);
18616
+ if (!lean && !parts.length) return "";
18617
+ return `Their inspiration boards ${lean ? `lean on ${lean}` : "have"}${parts.length ? `${lean ? "; " : " "}${parts.join("; ")}` : ""}.`;
18618
+ }
18619
+
18620
+ // src/lib/discovery.ts
18621
+ init_define_PHYLLA_BUILT_IN_CLIENT();
18622
+ var QUESTIONS = [
18623
+ { id: "business.what", group: "The business", label: "What does the company do, in one sentence?", help: "Plain words, the way they would say it to a friend.", kind: "text", placeholder: "We deliver fresh fruit boxes across Lagos" },
18624
+ {
18625
+ id: "business.stage",
18626
+ group: "The business",
18627
+ label: "What stage are they at?",
18628
+ help: "An idea needs a lean system; a growing product needs a complete one.",
18629
+ kind: "single",
18630
+ options: [
18631
+ { value: "idea", label: "An idea" },
18632
+ { value: "launched", label: "Just launched" },
18633
+ { value: "growing", label: "Growing" },
18634
+ { value: "established", label: "Established" }
18635
+ ]
18636
+ },
18637
+ { id: "people.who", group: "The people", label: "Who uses the product?", help: "Who they are, and what they come to do.", kind: "long", placeholder: "Busy parents ordering for the week, mostly on their phones" },
18638
+ {
18639
+ id: "people.device",
18640
+ group: "The people",
18641
+ label: "Mostly phone, desktop, or both?",
18642
+ help: "Shapes type sizes and touch targets.",
18643
+ kind: "single",
18644
+ options: [
18645
+ { value: "phone", label: "Mostly phone" },
18646
+ { value: "desktop", label: "Mostly desktop" },
18647
+ { value: "both", label: "Both" }
18648
+ ]
18649
+ },
18650
+ {
18651
+ id: "people.access",
18652
+ group: "The people",
18653
+ label: "Any accessibility needs?",
18654
+ help: "Sets how strict the contrast checks are.",
18655
+ kind: "multi",
18656
+ options: [
18657
+ { value: "aa", label: "WCAG AA (the usual minimum)" },
18658
+ { value: "aaa", label: "WCAG AAA (stricter)" },
18659
+ { value: "older", label: "Many older users" },
18660
+ { value: "low-vision", label: "People with low vision" }
18661
+ ]
18662
+ },
18663
+ {
18664
+ id: "product.type",
18665
+ group: "The product",
18666
+ label: "What kind of product is it?",
18667
+ help: "Tells the AI what it is designing for.",
18668
+ kind: "single",
18669
+ options: [
18670
+ { value: "dashboard", label: "A dashboard or data product" },
18671
+ { value: "mobile", label: "A mobile app" },
18672
+ { value: "tool", label: "A creative tool or editor" },
18673
+ { value: "service", label: "A service people sign up for or book" },
18674
+ { value: "shop", label: "A shop" },
18675
+ { value: "marketing", label: "A website that sells something" }
18676
+ ]
18677
+ },
18678
+ { id: "product.screens", group: "The product", label: "Which three screens matter most?", help: "What the system has to get right first.", kind: "text", placeholder: "This week\u2019s box, checkout, delivery tracking" },
18679
+ { id: "feel.words", group: "The feel", label: "Three words for how it should feel", help: "Shapes colour, corners and the style.", kind: "text", placeholder: "fresh, warm, generous" },
18680
+ { id: "feel.admire", group: "The feel", label: "Products they admire, and why", help: "References for the brief.", kind: "long" },
18681
+ { id: "feel.avoid", group: "The feel", label: "Competitors they must not look like", help: "What the system steers away from.", kind: "long" },
18682
+ { id: "exists.brand", group: "What exists", label: "Existing brand colours, fonts or logo?", help: "Colours written as hex, like #E11D48, are kept exactly.", kind: "text", placeholder: "#E11D48, Outfit" },
18683
+ {
18684
+ id: "exists.themes",
18685
+ group: "What exists",
18686
+ label: "Light mode, dark mode, or both?",
18687
+ help: "Every system gets both; this sets which comes first.",
18688
+ kind: "single",
18689
+ options: [
18690
+ { value: "light", label: "Light first" },
18691
+ { value: "dark", label: "Dark first" },
18692
+ { value: "both", label: "Both equally" }
18693
+ ]
18694
+ },
18695
+ {
18696
+ id: "build.tool",
18697
+ group: "How it will be built",
18698
+ label: "Which AI tool will build it?",
18699
+ help: "The prompt export is written for this tool first.",
18700
+ kind: "single",
18701
+ options: [
18702
+ { value: "claude-code", label: "Claude Code" },
18703
+ { value: "cursor", label: "Cursor" },
18704
+ { value: "lovable", label: "Lovable" },
18705
+ { value: "v0", label: "v0" },
18706
+ { value: "other", label: "Something else" }
18707
+ ]
18708
+ }
18709
+ ];
18710
+ var GROUPS = Array.from(new Set(QUESTIONS.map((q) => q.group)));
18711
+ function answerText(a, id) {
18712
+ const v = a[id];
18713
+ if (Array.isArray(v)) return v.join(", ");
18714
+ return (v ?? "").trim();
18715
+ }
18716
+ function answerList(a, id) {
18717
+ const v = a[id];
18718
+ if (Array.isArray(v)) return v;
18719
+ return v ? [v] : [];
18720
+ }
18721
+ function optionLabel(id, value) {
18722
+ return QUESTIONS.find((q) => q.id === id)?.options?.find((o) => o.value === value)?.label ?? value;
18723
+ }
18724
+ function readableAnswer(a, id) {
18725
+ const q = QUESTIONS.find((x) => x.id === id);
18726
+ if (!q?.options) return answerText(a, id);
18727
+ return answerList(a, id).map((v) => optionLabel(id, v)).join(", ");
18728
+ }
18729
+ function feelWords(a) {
18730
+ return answerText(a, "feel.words").toLowerCase().split(/[,;\n]| and /).map((w) => w.trim()).filter(Boolean).slice(0, 5);
18731
+ }
18732
+ function templateBrief(clientName, a) {
18733
+ const para = (...parts) => parts.filter(Boolean).join(" ");
18734
+ const strip = (s) => s.replace(/\.$/, "");
18735
+ const what = answerText(a, "business.what");
18736
+ const out = [
18737
+ para(what ? `${clientName}, in their own words: \u201C${strip(what)}.\u201D` : `${clientName}.`, answerText(a, "business.stage") ? `Stage: ${readableAnswer(a, "business.stage").toLowerCase()}.` : ""),
18738
+ para(answerText(a, "people.who") ? `It is for ${strip(answerText(a, "people.who"))}.` : "", answerText(a, "people.device") ? `${readableAnswer(a, "people.device")}.` : ""),
18739
+ para(answerText(a, "product.type") ? `It is ${readableAnswer(a, "product.type").toLowerCase()}.` : "", answerText(a, "product.screens") ? `The screens that matter most: ${strip(answerText(a, "product.screens"))}.` : ""),
18740
+ para(
18741
+ feelWords(a).length ? `It should feel ${feelWords(a).join(", ")}.` : "",
18742
+ answerText(a, "feel.admire") ? `They admire ${strip(answerText(a, "feel.admire"))}.` : "",
18743
+ answerText(a, "feel.avoid") ? `It must not look like ${strip(answerText(a, "feel.avoid"))}.` : ""
18744
+ ),
18745
+ para(
18746
+ answerText(a, "exists.brand") ? `Existing brand: ${answerText(a, "exists.brand")}.` : "",
18747
+ answerText(a, "people.access") ? `Accessibility: ${readableAnswer(a, "people.access")}.` : "",
18748
+ answerText(a, "build.tool") ? `It will be built with ${readableAnswer(a, "build.tool")}.` : ""
18749
+ )
18750
+ ];
18751
+ return out.filter((p) => p.trim()).join("\n\n");
18752
+ }
18753
+
18754
+ // src/lib/projects.ts
18755
+ init_define_PHYLLA_BUILT_IN_CLIENT();
18756
+ var STATUS_WORDS = { building: "Building", "with-client": "With the client", live: "Live" };
18757
+
18758
+ // src/lib/promptExport.ts
18759
+ init_define_PHYLLA_BUILT_IN_CLIENT();
18760
+
18761
+ // src/lib/googleFontsUrl.ts
18762
+ init_define_PHYLLA_BUILT_IN_CLIENT();
18763
+ var encodeName = (name) => encodeURIComponent(name.trim()).replace(/%20/g, "+");
18764
+ var shared = (weights, wanted) => Array.from(new Set(Array.isArray(weights) ? weights.filter((w) => wanted.includes(w)) : [])).sort((a, b) => a - b);
18765
+ function familyParam(name, weights, wanted) {
18766
+ const have = shared(weights, wanted);
18767
+ if (have.length === 0 || have.length === 1 && have[0] === 400) return encodeName(name);
18768
+ return `${encodeName(name)}:wght@${have.join(";")}`;
18769
+ }
18770
+ function googleFontsHref(families, wanted) {
18771
+ const byName = /* @__PURE__ */ new Map();
18772
+ for (const f of families) {
18773
+ const name = f.name.trim();
18774
+ if (!name) continue;
18775
+ byName.set(name, [...byName.get(name) ?? [], ...Array.isArray(f.weights) ? f.weights : []]);
18776
+ }
18777
+ if (byName.size === 0) return "";
18778
+ const params = [...byName].map(([name, weights]) => `family=${familyParam(name, weights, wanted)}`);
18779
+ return `https://fonts.googleapis.com/css2?${params.join("&")}&display=swap`;
18780
+ }
18781
+
18782
+ // src/lib/motionExport.ts
18783
+ init_define_PHYLLA_BUILT_IN_CLIENT();
18784
+ var kebab2 = (s) => s.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
18785
+ var FORWARD = ["entrance", "page", "list", "loader"];
18786
+ var REST = { opacity: 1, x: 0, y: 0, scale: 1, rotate: 0, blur: 0 };
18787
+ var presetName = (m, id) => m.presets.find((p) => p.id === id)?.name ?? id;
18788
+ function cssState(state) {
18789
+ const t = [];
18790
+ if (state.x !== void 0 || state.y !== void 0) t.push(`translate(${state.x ?? 0}px, ${state.y ?? 0}px)`);
18791
+ if (state.scale !== void 0) t.push(`scale(${state.scale})`);
18792
+ if (state.rotate !== void 0) t.push(`rotate(${state.rotate}deg)`);
18793
+ const parts = [];
18794
+ if (state.opacity !== void 0) parts.push(`opacity: ${state.opacity};`);
18795
+ if (t.length) parts.push(`transform: ${t.join(" ")};`);
18796
+ if (state.blur !== void 0) parts.push(`filter: blur(${state.blur}px);`);
18797
+ return parts.join(" ");
18798
+ }
18799
+ function restFor(from) {
18800
+ return Object.fromEntries(Object.keys(from).map((k) => [k, REST[k]]));
18801
+ }
18802
+ function motionCss(m) {
18803
+ const vars = [
18804
+ ...m.durations.map((d) => ` --duration-${kebab2(d.name)}: ${d.ms}ms;`),
18805
+ ...m.easings.map((e) => ` --ease-${kebab2(e.name)}: ${e.value === "spring" ? springToLinear(m.spring) : e.value};`),
18806
+ ` --motion-entrance: ${m.slots.entrance};`,
18807
+ ` --motion-hover: ${m.slots.hover};`,
18808
+ ` --motion-press: ${m.slots.press};`
18809
+ ];
18810
+ const out = [`/* Motion: ${MOTION_STYLES.find((s) => s.id === m.style)?.label ?? m.style}. */`, `:root {
18811
+ ${vars.join("\n")}
18812
+ }`];
18813
+ for (const p of m.presets) {
18814
+ if (p.group === "hover" || p.group === "press") continue;
18815
+ const id = kebab2(p.id);
18816
+ const away = cssState(p.from);
18817
+ const rest = cssState(restFor(p.from));
18818
+ const [a, b] = FORWARD.includes(p.group) ? [away, rest] : [rest, away];
18819
+ out.push(`@keyframes ${id} {
18820
+ from { ${a} }
18821
+ to { ${b} }
18822
+ }`);
18823
+ const timing = `var(--duration-${kebab2(p.duration)}) var(--ease-${kebab2(p.easing)})${p.delay ? ` ${p.delay}ms` : ""}`;
18824
+ out.push(`.motion-${id} { animation: ${id} ${timing} ${p.loop ? "infinite alternate" : "both"}; }`);
18825
+ }
18826
+ out.push("@media (prefers-reduced-motion: reduce) {\n *, *::before, *::after { animation: none !important; transition: none !important; }\n}");
18827
+ return out.join("\n\n") + "\n";
18828
+ }
18829
+ var WHEN = {
18830
+ entrance: "when content first appears on screen",
18831
+ exit: "when something is dismissed or removed",
18832
+ hover: "on pointer hover over cards and buttons",
18833
+ press: "while a button or card is pressed",
18834
+ page: "when moving between pages or views",
18835
+ loader: "while waiting; it loops until the content is ready",
18836
+ list: "for lists and grids, one item after another"
18837
+ };
18838
+ var GROUP_LABEL = { entrance: "Entrances", exit: "Exits", hover: "Hover", press: "Press", page: "Page transitions", loader: "Loaders", list: "Lists" };
18839
+ function motionPrompt(m) {
18840
+ const style = MOTION_STYLES.find((s) => s.id === m.style);
18841
+ const L = ["## Motion", ""];
18842
+ L.push(`- **Style:** ${style?.label ?? m.style}. ${style?.blurb ?? ""}.`);
18843
+ L.push(`- **Durations:** ${m.durations.map((d) => `\`--duration-${kebab2(d.name)}\` (${d.ms} ms)`).join(", ")}.`);
18844
+ L.push(`- **Easing:** ${m.easings.map((e) => `\`--ease-${kebab2(e.name)}\``).join(", ")}. The spring is stiffness ${m.spring.stiffness}, damping ${m.spring.damping}.`);
18845
+ L.push(`- **What the screens use:** Entrance: ${presetName(m, m.slots.entrance)}. Hover: ${presetName(m, m.slots.hover)}. Press: ${presetName(m, m.slots.press)}.`);
18846
+ L.push(m.calmData ? "- **Calm data screens:** on. Dashboards, tables and charts use the same timing with no overshoot or bounce." : "- **Calm data screens:** off. Data screens move like the rest of the product.");
18847
+ for (const g of Object.keys(WHEN)) {
18848
+ const names = m.presets.filter((p) => p.group === g).map((p) => p.name);
18849
+ if (names.length) L.push(`- **${GROUP_LABEL[g]}** (${names.join(", ")}): use ${WHEN[g]}.`);
18850
+ }
18851
+ L.push("- Respect `prefers-reduced-motion: reduce`: show the final state at once, with no movement.", "");
18852
+ return L.join("\n");
18853
+ }
18854
+
18855
+ // src/lib/promptExport.ts
18856
+ var kebab3 = (s) => s.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/[^a-zA-Z0-9]+/g, "-").toLowerCase();
18857
+ var THEME_ORDER = [
18858
+ "background",
18859
+ "surface",
18860
+ "surfaceSecondary",
18861
+ "textPrimary",
18862
+ "textSecondary",
18863
+ "textTertiary",
18864
+ "border",
18865
+ "borderSubtle",
18866
+ "primary",
18867
+ "primaryForeground",
18868
+ "secondary",
18869
+ "secondaryForeground",
18870
+ "accent",
18871
+ "accentForeground",
18872
+ "muted",
18873
+ "mutedForeground"
18874
+ ];
18875
+ function themeVars(t) {
18876
+ return THEME_ORDER.filter((k) => t[k]).map((k) => ` --color-${kebab3(k)}: ${t[k]};`);
18877
+ }
18878
+ function sharedVars(s) {
18879
+ const out = [];
18880
+ const font2 = (name, fallback) => name ? `"${name}", ${fallback}` : fallback;
18881
+ out.push(` --font-display: ${font2(s.typography?.displayFont?.name, "sans-serif")};`);
18882
+ out.push(` --font-body: ${font2(s.typography?.bodyFont?.name, "sans-serif")};`);
18883
+ out.push(` --font-mono: ${font2(s.typography?.monoFont?.name, "monospace")};`);
18884
+ for (const t of s.typography?.scale ?? []) {
18885
+ out.push(` --text-${kebab3(t.name)}: ${t.size};`);
18886
+ out.push(` --leading-${kebab3(t.name)}: ${t.lineHeight};`);
18887
+ }
18888
+ for (const c of ["success", "warning", "error", "info"]) {
18889
+ if (s.colors?.[c]?.hex) out.push(` --color-${c}: ${s.colors[c].hex};`);
18890
+ }
18891
+ for (const sh of s.colors?.primaryScale ?? []) out.push(` --color-primary-${kebab3(sh.shade)}: ${sh.hex};`);
18892
+ for (const sh of s.colors?.neutrals ?? []) out.push(` --color-neutral-${kebab3(sh.shade)}: ${sh.hex};`);
18893
+ for (const sp of s.spacing?.scale ?? []) out.push(` --space-${kebab3(sp.name)}: ${sp.value};`);
18894
+ for (const r of s.borderRadius?.scale ?? []) out.push(` --radius-${kebab3(r.name)}: ${r.value};`);
18895
+ for (const sh of s.shadows?.scale ?? []) out.push(` --shadow-${kebab3(sh.name)}: ${sh.value};`);
18896
+ return out;
18897
+ }
18898
+ var TOKEN_WEIGHTS = [400, 500, 600, 700];
18899
+ function fontsUrl(s) {
18900
+ const fam = [s.typography?.displayFont, s.typography?.bodyFont, s.typography?.monoFont].filter((f) => !!f?.name);
18901
+ return googleFontsHref(fam.filter((f) => !/^(georgia|helvetica|arial|times)/i.test(f.name)), TOKEN_WEIGHTS);
18902
+ }
18903
+ function tokensCss(s) {
18904
+ const themes = Object.entries(s.themes ?? {});
18905
+ const light = s.themes?.light ?? themes[0]?.[1];
18906
+ const dark = s.themes?.dark;
18907
+ const url = fontsUrl(s);
18908
+ const parts = [];
18909
+ parts.push(`/* ${s.brandName} design tokens. Generated by Phylla.
18910
+ * Import this file once at the root of the product, then use tokens by name: var(--color-primary). */`);
18911
+ if (url) parts.push(`@import url("${url}");`);
18912
+ parts.push(`:root {
18913
+ color-scheme: light;
18914
+ ${[...sharedVars(s), ...light ? themeVars(light) : []].join("\n")}
18915
+ }`);
18916
+ if (dark) {
18917
+ parts.push(`@media (prefers-color-scheme: dark) {
18918
+ :root:not([data-theme="light"]) {
18919
+ color-scheme: dark;
18920
+ ${themeVars(dark).map((l) => " " + l).join("\n")}
18921
+ }
18922
+ }`);
18923
+ parts.push(`:root[data-theme="dark"] {
18924
+ color-scheme: dark;
18925
+ ${themeVars(dark).join("\n")}
18926
+ }`);
18927
+ }
18928
+ for (const [name, t] of themes) {
18929
+ if (name === "light" || name === "dark" || !t) continue;
18930
+ parts.push(`:root[data-theme="${kebab3(name)}"] {
18931
+ ${themeVars(t).join("\n")}
18932
+ }`);
18933
+ }
18934
+ parts.push(motionCss(motionOf(s)).trim());
18935
+ return parts.join("\n\n") + "\n";
18936
+ }
18937
+ var STYLE_RULES = {
18938
+ flat: ["Clean and flat. Separate surfaces with --color-border and small shadows (--shadow-sm, --shadow-md), never heavy depth.", "No gradients, glows or blur."],
18939
+ glassmorphism: ["Glass: panels use --color-surface at about 60% opacity with backdrop-filter: blur(16px), and a 1px --color-border-subtle edge.", "Keep text on glass at full contrast; never put body text on a busy background without a solid panel behind it."],
18940
+ claymorphism: ["Clay: soft, pillowy surfaces. Use --radius-lg for cards and --shadow-md and --shadow-lg, which carry the inner highlights.", "Buttons are rounded and slightly raised; they press down (translateY(1px)) when clicked."],
18941
+ brutalism: ["Neo-brutalist: hard edges. Use the small radii only, a 2px solid border in --color-text-primary on panels and buttons, and the hard offset shadows (--shadow-md) with no blur.", "Bold, high-contrast type. No gradients, no soft shadows."]
18942
+ };
18943
+ function systemBody(s, firstRule) {
18944
+ const style = s.designStyle ?? "flat";
18945
+ const themes = Object.keys(s.themes ?? {});
18946
+ const scale = s.typography?.scale ?? [];
18947
+ const L = [];
18948
+ L.push("## Rules", "");
18949
+ L.push(firstRule);
18950
+ L.push(
18951
+ "2. Use tokens by name: `var(--color-primary)`, `var(--space-md)`, `var(--radius-md)`. **Never write a hex colour, a font size in px, or a shadow by hand.** If a value is missing, use the nearest token and say so in your reply.",
18952
+ "3. Colour pairs are fixed: text on `--color-primary` is always `--color-primary-foreground`, on `--color-secondary` always `--color-secondary-foreground`, on `--color-accent` always `--color-accent-foreground`, on `--color-muted` always `--color-muted-foreground`. Body text is `--color-text-primary`; secondary text is `--color-text-secondary`.",
18953
+ "4. A token whose value is a gradient is only ever used as a background, never as a text or border colour.",
18954
+ `5. Themes: ${themes.join(", ")}. Light is the default; set data-theme on <html> to switch${themes.includes("dark") ? ", or follow the device setting" : ""}. Every screen must work in each theme.`,
18955
+ "6. Every interactive component has default, hover, focus (visible ring in `--color-primary`), disabled and loading states. Forms show errors next to the field in `--color-error`, in words that say how to fix them.",
18956
+ "7. Anything tappable is at least 44px tall and wide.",
18957
+ ""
18958
+ );
18959
+ L.push("## Style", "");
18960
+ L.push(`- **Personality:** ${(s.personality ?? []).join(", ") || "not set"}.`);
18961
+ L.push(`- **Style:** ${style}.`);
18962
+ for (const r of STYLE_RULES[style] ?? STYLE_RULES.flat) L.push(`- ${r}`);
18963
+ L.push("");
18964
+ L.push("## Foundations", "");
18965
+ L.push(
18966
+ `- **Type:** headings in ${s.typography?.displayFont?.name} (\`var(--font-display)\`), text in ${s.typography?.bodyFont?.name} (\`var(--font-body)\`), code and numbers in ${s.typography?.monoFont?.name} (\`var(--font-mono)\`).`,
18967
+ `- **Type scale:** ${scale.map((t) => `\`--text-${kebab3(t.name)}\` (${t.usage ?? t.name})`).join(", ")}. Each has a matching \`--leading-*\`.`,
18968
+ `- **Spacing:** ${(s.spacing?.scale ?? []).map((x) => `\`--space-${kebab3(x.name)}\``).join(", ")}. Use the small steps inside components and the large ones between sections.`,
18969
+ `- **Corners:** ${(s.borderRadius?.scale ?? []).map((x) => `\`--radius-${kebab3(x.name)}\` for ${(x.usage ?? x.name).toLowerCase()}`).join(", ")}.`,
18970
+ `- **Shadows:** ${(s.shadows?.scale ?? []).map((x) => `\`--shadow-${kebab3(x.name)}\` for ${x.usage.toLowerCase()}`).join(", ")}.`,
18971
+ `- **Status colours:** \`--color-success\`, \`--color-warning\`, \`--color-error\`, \`--color-info\`. Always pair them with a word, never colour alone.`,
18972
+ `- **Icons:** ${s.iconStyle?.recommended ?? "Lucide"}, ${String(s.iconStyle?.style ?? "outline").toLowerCase()}, stroke ${s.iconStyle?.strokeWidth ?? "2px"}, at ${(s.iconStyle?.sizes ?? ["16px", "20px", "24px"]).join(", ")}.`,
18973
+ ""
18974
+ );
18975
+ L.push(motionPrompt(motionOf(s)));
18976
+ L.push(
18977
+ "## Before you finish",
18978
+ "",
18979
+ "Check every change against this list, and fix anything that fails before replying:",
18980
+ "",
18981
+ "- [ ] Every colour, size, space, corner and shadow is a token. Search the diff for `#`, `rgb(` and `px` to be sure.",
18982
+ "- [ ] Text sits only on its paired background (rule 3).",
18983
+ "- [ ] Loading, empty and error states exist wherever data loads.",
18984
+ "- [ ] Keyboard focus is visible on everything interactive.",
18985
+ "- [ ] It works in every theme listed above.",
18986
+ ""
18987
+ );
18988
+ return L;
18989
+ }
18990
+
18991
+ // src/lib/handoff.ts
18992
+ var BLOCK_START = "<!-- phylla:start -->";
18993
+ var BLOCK_END = "<!-- phylla:end -->";
18994
+ var STAMPS = /* @__PURE__ */ new Set(["updatedAt", "createdAt", "lastExportedAt", "at"]);
18995
+ function stable(value) {
18996
+ if (Array.isArray(value)) return value.map(stable);
18997
+ if (value && typeof value === "object") {
18998
+ const out = {};
18999
+ for (const k of Object.keys(value).sort()) if (!STAMPS.has(k)) out[k] = stable(value[k]);
19000
+ return out;
19001
+ }
19002
+ return value;
19003
+ }
19004
+ function fingerprint(value) {
19005
+ const s = JSON.stringify(stable(value)) ?? "";
19006
+ let h = 2166136261;
19007
+ for (let i = 0; i < s.length; i += 1) {
19008
+ h ^= s.charCodeAt(i);
19009
+ h = Math.imul(h, 16777619) >>> 0;
19010
+ }
19011
+ return h.toString(16).padStart(8, "0");
19012
+ }
19013
+ function tokenValues(css) {
19014
+ const out = {};
19015
+ let where = "";
19016
+ for (const line of css.split("\n")) {
19017
+ if (line.includes("{")) {
19018
+ const dark = /prefers-color-scheme:\s*dark|data-theme="dark"/.test(line);
19019
+ const theme = /data-theme="([^"]+)"/.exec(line)?.[1];
19020
+ if (dark) where = " (dark theme)";
19021
+ else if (theme) where = ` (${theme} theme)`;
19022
+ else if (/^\s*:root\s*\{/.test(line) && !where.includes("dark")) where = "";
19023
+ continue;
19024
+ }
19025
+ if (line.trim() === "}" && !line.startsWith(" ")) where = "";
19026
+ const m = /^\s*(--[\w-]+):\s*(.+?);\s*$/.exec(line);
19027
+ if (m && !(`${m[1]}${where}` in out)) out[`${m[1]}${where}`] = m[2];
19028
+ }
19029
+ return out;
19030
+ }
19031
+ var briefOf = (c) => c.brief?.text?.trim() || templateBrief(c.name, c.discovery);
19032
+ function boardWords(b) {
19033
+ const s = boardSummary([b]);
19034
+ if (!s) return "Nothing sorted on it yet.";
19035
+ return s.replace(/^Their inspiration boards lean on/, "Leans on").replace(/^Their inspiration boards have/, "Has");
19036
+ }
19037
+ function projectLines(p, systemName) {
19038
+ return [
19039
+ `- **Name:** ${p.name}${p.what ? `, ${p.what}` : ""}`,
19040
+ `- **Status:** ${STATUS_WORDS[p.status]}`,
19041
+ `- **Live link:** ${p.links.live ?? "not set yet"}`,
19042
+ `- **GitHub:** ${p.links.repo ?? "not set yet"}`,
19043
+ `- **Design system:** ${systemName}${p.system.uses === "main" ? " (the main system of this client)" : " (its own)"}`
19044
+ ];
19045
+ }
19046
+ function designMd(src) {
19047
+ const s = src.system;
19048
+ const L = [];
19049
+ if (src.kind === "project") {
19050
+ L.push(`# ${src.project.name}: design guide from Phylla`, "");
19051
+ L.push(`This folder is connected to the Phylla project "${src.project.name}" for ${src.client.name}. Build everything here with the design system below, for the client and brief below, and in the spirit of the boards below.`, "");
19052
+ L.push(`## Client: ${src.client.name}`, "");
19053
+ if (src.client.oneLiner) L.push(src.client.oneLiner, "");
19054
+ L.push("## Brief", "", briefOf(src.client), "");
19055
+ L.push("## This project", "", ...projectLines(src.project, s.brandName), "");
19056
+ } else {
19057
+ L.push(`# ${s.brandName}: design guide from Phylla`, "");
19058
+ L.push(`This folder is connected to the Phylla design system "${s.brandName}". Build everything here with it, and in the spirit of the boards below.`, "");
19059
+ }
19060
+ L.push(`## Design system: ${s.brandName}`, "");
19061
+ if (s.brandTagline) L.push(s.brandTagline, "");
19062
+ L.push(...systemBody(s, "1. The tokens are in design-tokens.css. Import it once at the root, before any other styles."));
19063
+ L.push("## Inspiration boards", "");
19064
+ if (!src.boards.length) L.push("No boards yet.", "");
19065
+ for (const b of src.boards) L.push(`### ${b.name}`, "", boardWords(b), "");
19066
+ if (src.kind === "project") {
19067
+ L.push("## Other projects for this client", "");
19068
+ if (!src.otherProjects.length) L.push("None yet.", "");
19069
+ for (const o of src.otherProjects) L.push(`- ${o.project.name}: ${STATUS_WORDS[o.project.status]}, on ${o.systemName ?? "no system yet"}`);
19070
+ if (src.otherProjects.length) L.push("");
19071
+ }
19072
+ L.push(
19073
+ "## Working with Phylla",
19074
+ "",
19075
+ "- At the start of design work, call the Phylla tool `check_project` with the contents of phylla.json. If it names changes, tell the person what changed and ask before updating. On yes, call `connect_project` again and rewrite the files.",
19076
+ "- When a design choice needs references (a hero, a type treatment, a photo style), call `project_references` with a technique name from the boards above, and look at the pictures.",
19077
+ src.kind === "project" ? "- When the person asks, set the live link, the GitHub link or the status in Phylla with `update_project`. Never change the brief, the boards or the system from here." : "- Never change the system or its boards from here.",
19078
+ ""
19079
+ );
19080
+ return L.join("\n").replace(/\n{3,}/g, "\n\n");
19081
+ }
19082
+ var BLOCK = `${BLOCK_START}
19083
+ ## Phylla
19084
+
19085
+ This folder is connected to Phylla. Follow DESIGN.md and use the tokens in design-tokens.css for every colour, font, size, space, corner and shadow.
19086
+
19087
+ At the start of design work, call the Phylla tool \`check_project\` with the contents of phylla.json. If it names changes, tell the person and ask before updating the files.
19088
+ ${BLOCK_END}`;
19089
+ function handoffFiles(src, now) {
19090
+ const css = tokensCss(src.system);
19091
+ const boards = {};
19092
+ const fingerprints = { system: fingerprint(src.system) };
19093
+ for (const b of src.boards) {
19094
+ const key = boardKey(b.level);
19095
+ boards[key] = { name: b.name, items: present(b).length };
19096
+ fingerprints[`board:${key}`] = fingerprint(b);
19097
+ }
19098
+ const systemId = src.system.id ?? "";
19099
+ const base = { phylla: 1, systemId, connectedAt: now, tokens: tokenValues(css), boards };
19100
+ let phyllaJson;
19101
+ if (src.kind === "project") {
19102
+ const p = src.project;
19103
+ fingerprints.brief = fingerprint({ text: briefOf(src.client), discovery: src.client.discovery });
19104
+ fingerprints.project = fingerprint({ name: p.name, what: p.what, status: p.status, links: p.links, system: p.system });
19105
+ fingerprints.projects = fingerprint(src.otherProjects.map((o) => ({ id: o.project.id, name: o.project.name, status: o.project.status, system: o.systemName })));
19106
+ phyllaJson = {
19107
+ ...base,
19108
+ kind: "project",
19109
+ id: p.id,
19110
+ name: p.name,
19111
+ clientName: src.client.name,
19112
+ fingerprints,
19113
+ project: { name: p.name, status: p.status, ...p.links.live ? { live: p.links.live } : {}, ...p.links.repo ? { repo: p.links.repo } : {} },
19114
+ projects: src.otherProjects.map((o) => ({ id: o.project.id, name: o.project.name }))
19115
+ };
19116
+ } else {
19117
+ phyllaJson = { ...base, kind: "system", id: systemId, name: src.system.brandName, fingerprints };
19118
+ }
19119
+ return { phyllaJson, tokensCss: css, designMd: designMd(src), agentsBlock: BLOCK };
19120
+ }
19121
+ function describeChanges(before, after) {
19122
+ const out = [];
19123
+ const f0 = before.fingerprints;
19124
+ const f1 = after.fingerprints;
19125
+ if (before.systemId !== after.systemId) out.push(`The project now uses a different design system: ${after.systemId}.`);
19126
+ else if (f0.system !== f1.system) {
19127
+ const named = [];
19128
+ for (const [k, v] of Object.entries(after.tokens)) {
19129
+ if (!(k in before.tokens)) named.push(`${k} is new: ${v}.`);
19130
+ else if (before.tokens[k] !== v) named.push(`${k} changed from ${before.tokens[k]} to ${v}.`);
19131
+ }
19132
+ for (const k of Object.keys(before.tokens)) if (!(k in after.tokens)) named.push(`${k} was removed.`);
19133
+ out.push(...named.length ? named : ["The design system changed (its rules or notes, not a token value)."]);
19134
+ }
19135
+ if (f0.brief !== f1.brief) out.push("The brief changed.");
19136
+ if (before.project && after.project && f0.project !== f1.project) {
19137
+ const a = before.project;
19138
+ const b = after.project;
19139
+ if (a.name !== b.name) out.push(`The project is now called "${b.name}".`);
19140
+ if (a.status !== b.status) out.push(`The project status is now ${STATUS_WORDS[b.status]}.`);
19141
+ if (a.live !== b.live) out.push(b.live ? `The live link is now ${b.live}.` : "The live link was removed.");
19142
+ if (a.repo !== b.repo) out.push(b.repo ? `The GitHub link is now ${b.repo}.` : "The GitHub link was removed.");
19143
+ if (a.name === b.name && a.status === b.status && a.live === b.live && a.repo === b.repo) out.push("The project details changed.");
19144
+ }
19145
+ for (const [key, b] of Object.entries(after.boards)) {
19146
+ const a = before.boards[key];
19147
+ if (!a) out.push(`New board: "${b.name}".`);
19148
+ else if (f0[`board:${key}`] !== f1[`board:${key}`]) out.push(a.items === b.items ? `The board "${b.name}" changed.` : `The board "${b.name}" changed: ${a.items} items, now ${b.items}.`);
19149
+ }
19150
+ for (const [key, a] of Object.entries(before.boards)) if (!(key in after.boards)) out.push(`The board "${a.name}" is gone.`);
19151
+ const had = new Set((before.projects ?? []).map((p) => p.id));
19152
+ const has = new Set((after.projects ?? []).map((p) => p.id));
19153
+ for (const p of after.projects ?? []) if (!had.has(p.id)) out.push(`New project for this client: "${p.name}".`);
19154
+ for (const p of before.projects ?? []) if (!has.has(p.id)) out.push(`The project "${p.name}" is gone.`);
19155
+ return out;
19156
+ }
19157
+ function readPhyllaJson(raw) {
19158
+ if (!raw || typeof raw !== "object") return null;
19159
+ const r = raw;
19160
+ if (r.phylla !== 1 || r.kind !== "project" && r.kind !== "system") return null;
19161
+ if (typeof r.id !== "string" || typeof r.systemId !== "string" || typeof r.name !== "string") return null;
19162
+ const isMap = (v) => !!v && typeof v === "object" && !Array.isArray(v);
19163
+ if (!isMap(r.fingerprints) || !isMap(r.tokens) || !isMap(r.boards)) return null;
19164
+ return raw;
19165
+ }
19166
+
19167
+ // connector/src/kit.ts
19168
+ init_define_PHYLLA_BUILT_IN_CLIENT();
19169
+ var IMAGE_TYPES = ["image/png", "image/jpeg", "image/webp", "image/gif"];
19170
+ var isObj2 = (v) => !!v && typeof v === "object" && !Array.isArray(v);
19171
+ var text = (t) => ({ content: [{ type: "text", text: t }] });
19172
+ var fail = (t) => ({ content: [{ type: "text", text: t }], isError: true });
19173
+ var BadInput = class extends Error {
19174
+ };
19175
+ function args(raw) {
19176
+ if (raw === void 0 || raw === null) return {};
19177
+ if (!isObj2(raw)) throw new BadInput("The arguments must be an object.");
19178
+ return raw;
19179
+ }
19180
+ function needString(a, name) {
19181
+ const v = a[name];
19182
+ if (typeof v !== "string" || !v.trim()) throw new BadInput(`${name} is required, as text.`);
19183
+ return v.trim();
19184
+ }
19185
+ function maybeString(a, name) {
19186
+ const v = a[name];
19187
+ if (v === void 0 || v === null) return void 0;
19188
+ if (typeof v !== "string") throw new BadInput(`${name} must be text.`);
19189
+ return v.trim() || void 0;
19190
+ }
19191
+ function needId(a, name) {
19192
+ const v = needString(a, name);
19193
+ if (!/^[A-Za-z0-9_-]+$/.test(v)) throw new BadInput(`${name} "${v}" is not an id. Ids hold only letters, digits, _ and -.`);
19194
+ return v;
19195
+ }
19196
+ function explain(err) {
19197
+ if (err instanceof DriveError) {
19198
+ if (err.status === 401) return SIGN_IN_AGAIN;
19199
+ if (err.status === 403) return `Google Drive refused this (403). ${err.message}`;
19200
+ return err.message;
19201
+ }
19202
+ return err instanceof Error ? err.message : String(err);
19203
+ }
19204
+ var pretty = (v) => JSON.stringify(v, null, 2);
19205
+ var validBoard = (b) => isObj2(b) && typeof b.key === "string" && Array.isArray(b.items) && isObj2(b.map) && Array.isArray(b.map.goals) && Array.isArray(b.map.levers) && Array.isArray(b.map.techniques);
19206
+ var clip = (s, max) => s.length > max ? `${s.slice(0, max)}
19207
+ ... (cut short)` : s;
19208
+ async function readIndex(drive, root2) {
19209
+ const id = await drive.find(INDEX_FILE, root2);
19210
+ if (!id) return { id: null, entries: [] };
19211
+ const raw = await drive.readJson(id);
19212
+ return { id, entries: Array.isArray(raw?.entries) ? raw.entries.filter(validEntry) : [] };
19213
+ }
19214
+ async function allBoards(drive, p) {
19215
+ const root2 = await p.needRoot();
19216
+ const [{ entries }, boardsFolder] = await Promise.all([readIndex(drive, root2), p.boards()]);
19217
+ const folders = boardsFolder ? await drive.list(boardsFolder) : [];
19218
+ const out = entries.filter((e) => e.kind === "board" && !e.deleted).map((e) => ({ key: e.id, name: e.name, level: e.level, archived: e.archived, folder: folders.find((f) => f.name === e.id)?.id ?? e.fileId }));
19219
+ for (const f of folders) if (!out.some((b) => b.key === f.name)) out.push({ key: f.name, name: f.name, level: void 0, archived: void 0, folder: f.id });
19220
+ return out;
19221
+ }
19222
+ async function picture(drive, folder, mediaId) {
19223
+ try {
19224
+ const fileId = await drive.find(mediaId, folder);
19225
+ if (!fileId) return null;
19226
+ const blob = await drive.download(fileId);
19227
+ const type = blob.type.split(";")[0].trim().toLowerCase();
19228
+ if (!IMAGE_TYPES.includes(type)) return null;
19229
+ return { type: "image", data: Buffer.from(await blob.arrayBuffer()).toString("base64"), mimeType: type };
19230
+ } catch (err) {
19231
+ if (err instanceof DriveError && err.status === 401) throw err;
19232
+ return null;
19233
+ }
19234
+ }
19235
+
19236
+ // connector/src/handoff.ts
19237
+ var MAX_REFERENCES2 = 8;
19238
+ var STATUSES = ["building", "with-client", "live"];
19239
+ async function readRecords(drive, p) {
19240
+ const root2 = await p.needRoot();
19241
+ const { entries } = await readIndex(drive, root2);
19242
+ const projectsFile = await drive.find(PROJECTS_FILE, root2);
19243
+ const raw = projectsFile ? await drive.readJson(projectsFile).catch(() => null) : null;
19244
+ const projectEntries = (Array.isArray(raw?.entries) ? raw.entries : []).filter(validProjectEntry);
19245
+ const folderOf2 = { client: "Clients", project: "Projects", system: "Systems" };
19246
+ const read = async (e) => {
19247
+ if (e.fileId) {
19248
+ const got = await drive.readJson(e.fileId).catch(() => null);
19249
+ if (got) return got;
19250
+ }
19251
+ const folder = await drive.find(folderOf2[e.kind], root2);
19252
+ const file = folder ? await drive.find(`${e.id}.json`, folder) : null;
19253
+ return file ? drive.readJson(file).catch(() => null) : null;
19254
+ };
19255
+ const out = { clients: /* @__PURE__ */ new Map(), projects: /* @__PURE__ */ new Map(), systems: /* @__PURE__ */ new Map() };
19256
+ await Promise.all(
19257
+ [...entries, ...projectEntries].filter((e) => !e.deleted && e.kind !== "board").map(async (e) => {
19258
+ const r = await read(e);
19259
+ if (!isObj2(r) || r.id !== e.id) return;
19260
+ if (e.kind === "client") out.clients.set(e.id, r);
19261
+ if (e.kind === "project") out.projects.set(e.id, r);
19262
+ if (e.kind === "system") out.systems.set(e.id, r);
19263
+ })
19264
+ );
19265
+ return out;
19266
+ }
19267
+ async function readBoards(drive, p, keep) {
19268
+ const list2 = (await allBoards(drive, p)).filter((b) => !b.archived);
19269
+ const loaded = await Promise.all(
19270
+ list2.map(async (b) => {
19271
+ const file = await drive.find("board.json", b.folder);
19272
+ const board = file ? await drive.readJson(file).catch(() => null) : null;
19273
+ return validBoard(board) && keep(board) ? { key: b.key, folder: b.folder, board } : null;
19274
+ })
19275
+ );
19276
+ return loaded.filter((b) => !!b);
19277
+ }
19278
+ var lower = (s) => s.trim().toLowerCase();
19279
+ function systemIdOf(project, client) {
19280
+ return project.system.uses === "own" ? project.system.systemId : client?.mainSystemId ?? null;
19281
+ }
19282
+ async function sourceFor(drive, p, target2) {
19283
+ const records = await readRecords(drive, p);
19284
+ if (target2.projectId) {
19285
+ const project = records.projects.get(target2.projectId);
19286
+ if (!project) throw new Missing(`There is no project "${target2.projectId}" in Phylla. Call find_project with its name to get its id.`);
19287
+ const client = records.clients.get(project.clientId);
19288
+ if (!client) throw new Missing(`The client of "${project.name}" is not in Phylla any more.`);
19289
+ const systemId = systemIdOf(project, client);
19290
+ const system2 = systemId ? records.systems.get(systemId) : void 0;
19291
+ if (!system2) throw new Missing(`"${project.name}" has no design system yet. Choose one for it in Phylla, then connect again.`);
19292
+ const clientProjects = [...records.projects.values()].filter((x) => x.clientId === client.id);
19293
+ const systemIds = new Set([client.mainSystemId, ...clientProjects.map((x) => systemIdOf(x, client))].filter((x) => !!x));
19294
+ const boards2 = await readBoards(drive, p, (b) => b.level.kind === "client" && b.level.id === client.id || b.level.kind === "system" && systemIds.has(b.level.id));
19295
+ const otherProjects = clientProjects.filter((x) => x.id !== project.id).sort((a, b) => a.createdAt - b.createdAt).map((x) => {
19296
+ const id = systemIdOf(x, client);
19297
+ return { project: x, systemName: id && records.systems.get(id)?.brandName || null };
19298
+ });
19299
+ return { src: { kind: "project", client, project, system: system2, boards: boards2.map((b) => b.board), otherProjects }, boards: boards2 };
19300
+ }
19301
+ const system = target2.systemId ? records.systems.get(target2.systemId) : void 0;
19302
+ if (!system) throw new Missing(`There is no system "${target2.systemId}" in Phylla. Call find_project with its name and kind "system" to get its id.`);
19303
+ const boards = await readBoards(drive, p, (b) => b.level.kind === "system" && b.level.id === system.id);
19304
+ return { src: { kind: "system", system, boards: boards.map((b) => b.board) }, boards };
19305
+ }
19306
+ function target(a) {
19307
+ const projectId = a.projectId === void 0 ? void 0 : needId(a, "projectId");
19308
+ const systemId = a.systemId === void 0 ? void 0 : needId(a, "systemId");
19309
+ if (!projectId === !systemId) throw new BadInput("Give either projectId or systemId, not both.");
19310
+ return projectId ? { projectId } : { systemId };
19311
+ }
19312
+ function httpsLink(a, name) {
19313
+ const v = maybeString(a, name);
19314
+ if (v === void 0) return void 0;
19315
+ let url;
19316
+ try {
19317
+ url = new URL(v);
19318
+ } catch {
19319
+ throw new BadInput(`${name} "${v}" is not a web address. Give the whole address, starting with https://.`);
19320
+ }
19321
+ if (url.protocol !== "https:") throw new BadInput(`${name} "${v}" must start with https://.`);
19322
+ return v;
19323
+ }
19324
+ function closeNames(asked, names) {
19325
+ const a = lower(asked);
19326
+ const words2 = a.split(/\W+/).filter((w) => w.length >= 3);
19327
+ return [...new Set(names)].filter((n) => {
19328
+ const l = lower(n);
19329
+ return l.includes(a) || a.includes(l) || words2.some((w) => l.includes(w));
19330
+ }).sort((x, y) => Math.abs(x.length - asked.length) - Math.abs(y.length - asked.length)).slice(0, 5);
19331
+ }
19332
+ var BUILDING = `Building in a code folder: when the person asks to connect a folder to a Phylla project or system ("Connect this folder to my Phylla project "<name>"."), call find_project with the name and the kind, then connect_project with the id. If find_project lists more than one, ask which, naming each client. Write the files connect_project gives into the folder, and add the block to AGENTS.md and CLAUDE.md as it says. From then on, follow DESIGN.md and design-tokens.css. At the start of design work in a connected folder, call check_project with the contents of phylla.json; if it names changes, tell the person and ask before updating. For references behind a design choice, call project_references with a technique name and look at the pictures. When the person asks to set the live link, the GitHub link or the status, call update_project. Never change the brief, the boards or the system from a code folder.`;
19333
+ var BUILDING_INSTRUCTIONS = BUILDING;
19334
+ function createHandoffTools(drive, opts = {}) {
19335
+ const now = opts.now ?? Date.now;
19336
+ const random = opts.random ?? (() => Math.random().toString(36).slice(2, 8));
19337
+ const tool = (name, description, inputSchema, run) => ({
19338
+ name,
19339
+ description,
19340
+ inputSchema: { type: "object", ...inputSchema },
19341
+ async run(raw) {
19342
+ try {
19343
+ return await run(args(raw), places(drive));
19344
+ } catch (err) {
19345
+ return fail(explain(err));
19346
+ }
19347
+ }
19348
+ });
19349
+ const find_project = tool(
19350
+ "find_project",
19351
+ "Finds a Phylla project or design system by its name, ignoring capitals, and gives its id for connect_project. Lists every match with its client; never connects by itself.",
19352
+ {
19353
+ properties: {
19354
+ name: { type: "string", description: "The name the person gave, for example Crumb ordering app." },
19355
+ kind: { type: "string", enum: ["project", "system"], description: "project, or system for a system with no project." }
19356
+ },
19357
+ required: ["name", "kind"]
19358
+ },
19359
+ async (a, p) => {
19360
+ const name = needString(a, "name");
19361
+ const kind = needString(a, "kind");
19362
+ if (kind !== "project" && kind !== "system") throw new BadInput("kind must be project or system.");
19363
+ const r = await readRecords(drive, p);
19364
+ const all = kind === "project" ? [...r.projects.values()].map((x) => ({ id: x.id, name: x.name, line: `${x.name} (client ${r.clients.get(x.clientId)?.name ?? "unknown"}) id ${x.id}` })) : [...r.systems.values()].map((x) => {
19365
+ const client = x.clientId ? r.clients.get(x.clientId)?.name : void 0;
19366
+ return { id: x.id, name: x.brandName, line: `${x.brandName}${client ? ` (client ${client})` : ""} id ${x.id}` };
19367
+ });
19368
+ const exact = all.filter((x) => lower(x.name) === lower(name));
19369
+ if (exact.length === 1) return text(`Found one ${kind}: ${exact[0].line}. Connect it with connect_project and ${kind === "project" ? "projectId" : "systemId"} ${exact[0].id}.`);
19370
+ if (exact.length > 1) return text(`More than one ${kind} is called "${name}". Ask the person which one, naming each client:
19371
+ ${exact.map((x) => `- ${x.line}`).join("\n")}`);
19372
+ const close = closeNames(name, all.map((x) => x.name));
19373
+ const lines = all.filter((x) => close.includes(x.name)).map((x) => `- ${x.line}`);
19374
+ return text(lines.length ? `No ${kind} is called "${name}". The closest names:
19375
+ ${lines.join("\n")}
19376
+ Ask the person which one they meant.` : `No ${kind} is called "${name}", and none has a close name. Ask the person to check the name in Phylla.`);
19377
+ }
19378
+ );
19379
+ const connect_project = tool(
19380
+ "connect_project",
19381
+ "Hands a Phylla project (or a system with no project) over to this code folder: gives phylla.json, design-tokens.css, DESIGN.md and the block for AGENTS.md and CLAUDE.md, to write into the folder. Also used to update the files after check_project names changes and the person says yes.",
19382
+ {
19383
+ properties: {
19384
+ projectId: { type: "string", description: "The project id from find_project." },
19385
+ systemId: { type: "string", description: "For a system with no project: the system id from find_project." }
19386
+ }
19387
+ },
19388
+ async (a, p) => {
19389
+ const { src } = await sourceFor(drive, p, target(a));
19390
+ const files = handoffFiles(src, now());
19391
+ const what = src.kind === "project" ? `the Phylla project "${src.project.name}" for ${src.client.name}` : `the Phylla design system "${src.system.brandName}"`;
19392
+ return text(
19393
+ [
19394
+ `This folder now belongs to ${what}. Write these three files at the top of the folder, replacing older copies:`,
19395
+ "",
19396
+ "phylla.json",
19397
+ "```json",
19398
+ JSON.stringify(files.phyllaJson, null, 2),
19399
+ "```",
19400
+ "",
19401
+ "design-tokens.css",
19402
+ "```css",
19403
+ files.tokensCss.trimEnd(),
19404
+ "```",
19405
+ "",
19406
+ "DESIGN.md",
19407
+ "```markdown",
19408
+ files.designMd.trimEnd(),
19409
+ "```",
19410
+ "",
19411
+ "Then put this block in AGENTS.md and in CLAUDE.md, making either file if it is missing. If a file already has a block between these two markers, replace only that block; keep everything else in the file as it is:",
19412
+ "```markdown",
19413
+ files.agentsBlock,
19414
+ "```",
19415
+ "",
19416
+ "Then tell the person in a few lines that the folder is connected, and what it now follows."
19417
+ ].join("\n")
19418
+ );
19419
+ }
19420
+ );
19421
+ const check_project = tool(
19422
+ "check_project",
19423
+ "Says what changed in Phylla since phylla.json was written: system values by name, the brief, boards, project links and status, and the client projects. Call it at the start of design work in a connected folder.",
19424
+ { properties: { phyllaJson: { type: "object", description: "The contents of phylla.json in this folder." } }, required: ["phyllaJson"] },
19425
+ async (a, p) => {
19426
+ const before = readPhyllaJson(a.phyllaJson);
19427
+ if (!before) return text("phylla.json in this folder cannot be compared: it is missing parts or comes from an older connector. Ask the person, then connect again with connect_project.");
19428
+ const { src } = await sourceFor(drive, p, before.kind === "project" ? { projectId: before.id } : { systemId: before.id });
19429
+ const lines = describeChanges(before, handoffFiles(src, now()).phyllaJson);
19430
+ if (!lines.length) return text(`No changes in Phylla since ${new Date(before.connectedAt).toISOString().slice(0, 10)}. Carry on.`);
19431
+ return text(`Phylla changed since this folder was connected:
19432
+ ${lines.map((l) => `- ${l}`).join("\n")}
19433
+
19434
+ Ask the person before updating. On yes, call connect_project again and rewrite the files.`);
19435
+ }
19436
+ );
19437
+ const project_references = tool(
19438
+ "project_references",
19439
+ `Shows the reference pictures on the boards of a project (or system): sorted items, filtered by a technique name when given, up to ${MAX_REFERENCES2} at a time, each with its board and where it is filed.`,
19440
+ {
19441
+ properties: {
19442
+ projectId: { type: "string" },
19443
+ systemId: { type: "string" },
19444
+ technique: { type: "string", description: "A technique name from DESIGN.md, for example Oversized type. Leave out for any sorted picture." },
19445
+ boardKey: { type: "string", description: "Only this board." },
19446
+ limit: { type: "number", description: `How many pictures, at most ${MAX_REFERENCES2}.` }
19447
+ }
19448
+ },
19449
+ async (a, p) => {
19450
+ const { boards } = await sourceFor(drive, p, target(a));
19451
+ const technique = maybeString(a, "technique");
19452
+ const boardKey2 = maybeString(a, "boardKey");
19453
+ const limit = Math.max(1, Math.min(typeof a.limit === "number" ? Math.floor(a.limit) : MAX_REFERENCES2, MAX_REFERENCES2));
19454
+ const found = [];
19455
+ for (const at of boards) {
19456
+ if (boardKey2 && at.key !== boardKey2) continue;
19457
+ const m = at.board.map;
19458
+ const name = (list2, id) => list2.find((x) => x.id === id)?.name ?? id;
19459
+ const wanted = technique ? new Set(m.techniques.filter((t) => lower(t.name) === lower(technique)).map((t) => t.id)) : null;
19460
+ for (const item of present(at.board)) {
19461
+ if (item.status === "unsorted" || !item.paths.length || !(item.thumbId || item.mediaId)) continue;
19462
+ const paths = wanted ? item.paths.filter((x) => wanted.has(x.techniqueId)) : item.paths;
19463
+ if (!paths.length) continue;
19464
+ found.push({ at, item, where: paths.map((x) => `${name(m.goals, x.goalId)} > ${name(m.levers, x.leverId)} > ${name(m.techniques, x.techniqueId)}`).join("; ") });
19465
+ }
19466
+ }
19467
+ if (!found.length) return text(technique ? `No sorted picture is filed under "${technique}" on these boards. Check the technique names in DESIGN.md.` : "These boards have no sorted pictures yet.");
19468
+ const content = [];
19469
+ let shown = 0;
19470
+ for (const f of found) {
19471
+ if (shown >= limit) break;
19472
+ const image = await picture(drive, f.at.folder, f.item.thumbId || f.item.mediaId);
19473
+ if (!image) continue;
19474
+ content.push({ type: "text", text: `${f.at.board.name}: ${f.item.title} (${f.where})` }, image);
19475
+ shown += 1;
19476
+ }
19477
+ const rest = found.length - shown;
19478
+ if (rest > 0) content.push({ type: "text", text: `${rest} more not shown.` });
19479
+ return { content };
19480
+ }
19481
+ );
19482
+ const update_project = tool(
19483
+ "update_project",
19484
+ "Sets a project's live link, GitHub link or status in Phylla, when the person asks. Phylla shows it within 15 seconds while it is open, or the next time it opens. Never changes anything else.",
19485
+ {
19486
+ properties: {
19487
+ projectId: { type: "string" },
19488
+ live: { type: "string", description: "The live address, starting with https://." },
19489
+ repo: { type: "string", description: "The GitHub address, starting with https://." },
19490
+ status: { type: "string", enum: STATUSES }
19491
+ },
19492
+ required: ["projectId"]
19493
+ },
19494
+ async (a, p) => {
19495
+ const projectId = needId(a, "projectId");
19496
+ const live = httpsLink(a, "live");
19497
+ const repo = httpsLink(a, "repo");
19498
+ const status = maybeString(a, "status");
19499
+ if (status !== void 0 && !STATUSES.includes(status)) throw new BadInput(`status must be one of ${STATUSES.join(", ")}.`);
19500
+ if (live === void 0 && repo === void 0 && status === void 0) throw new BadInput("Give a live link, a GitHub link or a status to set.");
19501
+ const records = await readRecords(drive, p);
19502
+ const project = records.projects.get(projectId);
19503
+ if (!project) throw new Missing(`There is no project "${projectId}" in Phylla. Call find_project with its name to get its id.`);
19504
+ const links = { ...live !== void 0 ? { live } : {}, ...repo !== void 0 ? { repo } : {} };
19505
+ const patch = { ...Object.keys(links).length ? { links } : {}, ...status ? { status } : {} };
19506
+ const root2 = await p.needRoot();
19507
+ const inbox = await drive.folder("Inbox", await drive.folder("Projects", root2));
19508
+ await drive.writeJson(inbox, `connector-${now()}-${random()}.json`, { projectId, patch, at: now() });
19509
+ return text(`Sent to Phylla for "${project.name}". Phylla shows it within 15 seconds while it is open, or the next time it opens.`);
19510
+ }
19511
+ );
19512
+ return { find_project, connect_project, check_project, project_references, update_project };
19513
+ }
19514
+
19515
+ // connector/src/tools.ts
19516
+ import { mkdtemp, writeFile as writeFile2 } from "node:fs/promises";
19517
+ import { tmpdir } from "node:os";
19518
+ import { join as join2 } from "node:path";
19519
+
19520
+ // src/tools/answers.ts
19521
+ init_define_PHYLLA_BUILT_IN_CLIENT();
19522
+ var isObj3 = (v) => !!v && typeof v === "object" && !Array.isArray(v);
19523
+ var filled = (v) => typeof v === "string" && v.trim().length > 0;
19524
+ function planProblems(raw) {
19525
+ if (!isObj3(raw)) return ["the plan"];
19526
+ const missing = [];
19527
+ for (const key of ["makes", "makerLabel", "look"]) if (!filled(raw[key])) missing.push(key);
19528
+ if (raw.engine !== "code" && raw.engine !== "claude") missing.push('engine ("code" or "claude")');
19529
+ if (!Array.isArray(raw.inputs)) missing.push("inputs");
19530
+ if (!Array.isArray(raw.outputs) || !raw.outputs.length) missing.push("outputs");
19531
+ for (const key of ["needs", "pins", "exclusions"]) if (!Array.isArray(raw[key])) missing.push(key);
19532
+ for (const key of ["useBoardStyle", "usesPictures"]) if (typeof raw[key] !== "boolean") missing.push(key);
19533
+ return missing;
19534
+ }
19535
+ function answerProblems(kind, raw) {
19536
+ switch (kind) {
19537
+ case "tool-plan":
19538
+ if (!isObj3(raw) || typeof raw.fit !== "boolean") return ["fit (true or false)"];
19539
+ if (!raw.fit) return [...filled(raw.why) ? [] : ["why"], ...filled(raw.add) ? [] : ["add"]];
19540
+ return [...filled(raw.name) ? [] : ["name"], ...planProblems(raw.plan).map((p) => `plan.${p}`)];
19541
+ case "tool-change":
19542
+ return isObj3(raw) ? planProblems(raw.plan).map((p) => `plan.${p}`) : ["plan"];
19543
+ case "tool-build":
19544
+ if (!isObj3(raw)) return ["engine", "body"];
19545
+ return [...raw.engine === "code" || raw.engine === "claude" ? [] : ['engine ("code" or "claude")'], ...filled(raw.body) ? [] : ["body"]];
19546
+ case "tool-run":
19547
+ case "tool-run-in-app":
19548
+ return isObj3(raw) && filled(raw.resultId) ? [] : ["resultId"];
19549
+ case "tool-publish":
19550
+ return isObj3(raw) && typeof raw.address === "string" && /^https?:\/\//.test(raw.address) ? [] : ["address (a web address starting with https://)"];
19551
+ default:
19552
+ return [];
19553
+ }
19554
+ }
19555
+
19556
+ // src/tools/generator.ts
19557
+ init_define_PHYLLA_BUILT_IN_CLIENT();
19558
+ var MAX_RESULT_BYTES = 50 * 1024 * 1024;
19559
+ var FRAME_CSP = "default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; img-src data: blob:; media-src data: blob:";
19560
+ var GENERATOR_CONTRACT = `A tool that runs in Phylla is one self-contained HTML file: its scripts and styles inline, loading nothing from outside the file, with no network calls (the page runs in a sandbox with no network; fetch and outside links fail).
19561
+ 1. Once loaded, post { type: "phylla:ready" } to window.parent with targetOrigin "*".
19562
+ 2. Phylla then posts { type: "phylla:run", runId, recipe, inputs, pictures } to the page. recipe has colours (hex and weight), techniques, media, subjects, types, notes and references. When the tool follows a project's design system, recipe.system has that system's brandName, colours (name and hex, by role: primary, secondary, accent, success, warning, error, info), displayFont, bodyFont, spacingUnit and radius: draw in those colours and set type in those fonts (load nothing; name them in the output, such as in SVG font-family), and let the board's colours and techniques set the mood around them. inputs are keyed by the input ids in the tool's plan, with the plan's defaults when the person left one alone. pictures are the reference pictures as data: URLs, only when the plan uses pictures.
19563
+ 3. Answer each run once, within a minute, with { type: "phylla:files", runId, files: [{ name, mime, data }] }, where data is an ArrayBuffer (transfer it), or with { type: "phylla:error", runId, message } in plain words. All files together must stay under 50 MB.
19564
+ 4. Draw with canvas or SVG. To make video, record a canvas with MediaRecorder (video/webm). When the plan asks for the png-tile format, make seamless tiles: the right edge meets the left and the bottom meets the top.
19565
+ 5. Show a simple preview of the result on the page itself; Phylla shows the inputs and the Make button, so the page needs no form of its own.`;
19566
+ function frameDocument(appHtml) {
19567
+ return `<meta http-equiv="Content-Security-Policy" content="${FRAME_CSP}">
19568
+ ${appHtml}`;
19569
+ }
19570
+
19571
+ // src/tools/model.ts
19572
+ init_define_PHYLLA_BUILT_IN_CLIENT();
19573
+ var last = (xs) => xs[xs.length - 1];
19574
+ function recordRecipe(t, fingerprint2, now = Date.now(), systemFingerprint) {
19575
+ const newest = last(t.recipeVersions);
19576
+ const sameSystem = systemFingerprint === void 0 || newest?.systemFingerprint === systemFingerprint;
19577
+ if (newest && newest.fingerprint === fingerprint2 && sameSystem) return { tool: t, n: newest.n };
19578
+ const n = (newest?.n ?? 0) + 1;
19579
+ const version2 = { n, fingerprint: fingerprint2, ...systemFingerprint !== void 0 ? { systemFingerprint } : {}, at: now };
19580
+ return { tool: { ...t, recipeVersions: [...t.recipeVersions, version2], updatedAt: now }, n };
19581
+ }
19582
+ var build = (t) => t.builds.find((b) => b.n === t.currentBuild);
19583
+ function currentPlan(t) {
19584
+ const b = build(t);
19585
+ return b && t.plans.find((p) => p.n === b.planVersion)?.plan || last(t.plans).plan;
19586
+ }
19587
+
19588
+ // src/tools/runMessage.ts
19589
+ init_define_PHYLLA_BUILT_IN_CLIENT();
19590
+
19591
+ // src/tools/recipeNow.ts
19592
+ init_define_PHYLLA_BUILT_IN_CLIENT();
19593
+
19594
+ // src/tools/systemStyle.ts
19595
+ init_define_PHYLLA_BUILT_IN_CLIENT();
19596
+ var ROLES = ["primary", "secondary", "accent", "success", "warning", "error", "info"];
19597
+ function systemStyle(s) {
19598
+ const brand = s.colors ?? {};
19599
+ const colours = ROLES.flatMap((role) => {
19600
+ const c = brand[role];
19601
+ return c && typeof c.hex === "string" && c.hex.trim() ? [{ name: role, hex: c.hex.trim() }] : [];
19602
+ });
19603
+ return {
19604
+ systemId: s.id ?? "",
19605
+ brandName: s.brandName ?? "",
19606
+ colours,
19607
+ displayFont: s.typography?.displayFont?.name ?? "",
19608
+ bodyFont: s.typography?.bodyFont?.name ?? "",
19609
+ spacingUnit: s.spacing?.unit ?? "",
19610
+ radius: (s.borderRadius?.scale ?? []).map((r) => r.value).filter((v) => typeof v === "string")
19611
+ };
19612
+ }
19613
+
18556
19614
  // src/tools/toolFiles.ts
18557
19615
  init_define_PHYLLA_BUILT_IN_CLIENT();
18558
19616
  var NO_ROOT_FOR_TOOLS = "Phylla has no folder in this Google Drive yet. Open Phylla, sign in and open a board once.";
@@ -18566,13 +19624,13 @@ async function root(drive) {
18566
19624
  if (!id) throw new Error(NO_ROOT_FOR_TOOLS);
18567
19625
  return id;
18568
19626
  }
18569
- async function toolsFolder(drive, boardKey) {
19627
+ async function toolsFolder(drive, boardKey2) {
18570
19628
  const r = await root(drive);
18571
- if (boardKey === null) return drive.folder("Tools", r);
18572
- return drive.folder("Tools", await drive.folder(boardKey, await drive.folder("Boards", r)));
19629
+ if (boardKey2 === null) return drive.folder("Tools", r);
19630
+ return drive.folder("Tools", await drive.folder(boardKey2, await drive.folder("Boards", r)));
18573
19631
  }
18574
- async function toolFolder(drive, boardKey, toolId) {
18575
- return drive.folder(toolId, await toolsFolder(drive, boardKey));
19632
+ async function toolFolder(drive, boardKey2, toolId) {
19633
+ return drive.folder(toolId, await toolsFolder(drive, boardKey2));
18576
19634
  }
18577
19635
  var folderOf = (drive, t) => toolFolder(drive, t.boardKey, t.id);
18578
19636
  async function readToolIn(drive, folder) {
@@ -18583,8 +19641,8 @@ async function toolsIn(drive, folder) {
18583
19641
  const found = await Promise.all((await drive.list(folder)).map((f) => readToolIn(drive, f.id)));
18584
19642
  return found.filter((t) => !!t && t.movedTo === void 0);
18585
19643
  }
18586
- async function listTools(drive, boardKey) {
18587
- if (boardKey !== void 0) return toolsIn(drive, await toolsFolder(drive, boardKey));
19644
+ async function listTools(drive, boardKey2) {
19645
+ if (boardKey2 !== void 0) return toolsIn(drive, await toolsFolder(drive, boardKey2));
18588
19646
  const r = await root(drive);
18589
19647
  const boards = await drive.find("Boards", r, { folderOnly: true });
18590
19648
  const boardFolders = boards ? await drive.list(boards) : [];
@@ -18597,13 +19655,13 @@ async function listTools(drive, boardKey) {
18597
19655
  const account = await drive.find("Tools", r, { folderOnly: true });
18598
19656
  return [...perBoard.flat(), ...account ? await toolsIn(drive, account) : []];
18599
19657
  }
18600
- async function readTool(drive, boardKey, toolId) {
18601
- const tools2 = await toolsFolder(drive, boardKey);
19658
+ async function readTool(drive, boardKey2, toolId) {
19659
+ const tools2 = await toolsFolder(drive, boardKey2);
18602
19660
  const folder = await drive.find(toolId, tools2, { folderOnly: true });
18603
19661
  return folder ? readToolIn(drive, folder) : null;
18604
19662
  }
18605
- async function readLiveTool(drive, boardKey, toolId) {
18606
- let t = await readTool(drive, boardKey, toolId);
19663
+ async function readLiveTool(drive, boardKey2, toolId) {
19664
+ let t = await readTool(drive, boardKey2, toolId);
18607
19665
  for (let hops = 0; t && t.movedTo !== void 0 && hops < 4; hops += 1) t = await readTool(drive, t.movedTo, toolId);
18608
19666
  return t && t.movedTo === void 0 ? t : null;
18609
19667
  }
@@ -18651,6 +19709,7 @@ async function saveResult(drive, t, r, files) {
18651
19709
  }
18652
19710
 
18653
19711
  // src/tools/recipeNow.ts
19712
+ var NO_SYSTEM = "none";
18654
19713
  async function recipeNow(drive, t, board) {
18655
19714
  const plan = currentPlan(t);
18656
19715
  if (!t.boardKey || !plan.useBoardStyle) return { tool: t, recipe: null, n: null };
@@ -18659,9 +19718,10 @@ async function recipeNow(drive, t, board) {
18659
19718
  const newest = t.recipeVersions[t.recipeVersions.length - 1];
18660
19719
  return { tool: t, recipe: newest ? await readRecipe(drive, t, newest.n) : null, n: newest?.n ?? null };
18661
19720
  }
18662
- const recipe = computeRecipe(board, { pins: plan.pins, exclusions: plan.exclusions });
18663
19721
  const fresh = await readLiveTool(drive, t.boardKey, t.id).catch(() => null) ?? t;
18664
- const recorded = recordRecipe(fresh, recipeFingerprint(recipe));
19722
+ const followed = await systemNow(drive, fresh);
19723
+ const recipe = withSystem(computeRecipe(board, { pins: plan.pins, exclusions: plan.exclusions }), followed.style);
19724
+ const recorded = recordRecipe(fresh, recipeFingerprint({ ...recipe, system: void 0 }), Date.now(), followed.fingerprint);
18665
19725
  if (recorded.tool === fresh) return { tool: fresh, recipe, n: recorded.n };
18666
19726
  const n = Math.max(recorded.n, await highestRecipe(drive, fresh) + 1);
18667
19727
  const versions = recorded.tool.recipeVersions.map((v) => v.n === recorded.n ? { ...v, n } : v);
@@ -18670,6 +19730,27 @@ async function recipeNow(drive, t, board) {
18670
19730
  await saveTool(drive, tool);
18671
19731
  return { tool, recipe, n };
18672
19732
  }
19733
+ var withSystem = (r, style) => style ? { ...r, system: style } : r;
19734
+ async function systemNow(drive, t) {
19735
+ if (t.systemId === void 0) return {};
19736
+ if (t.systemId === null) return { fingerprint: NO_SYSTEM };
19737
+ const system = await readSystem(drive, t.systemId).catch(() => null);
19738
+ if (system) {
19739
+ const style = systemStyle(system);
19740
+ return { style, fingerprint: recipeFingerprint(style) };
19741
+ }
19742
+ const newest = t.recipeVersions[t.recipeVersions.length - 1];
19743
+ const recorded = newest ? await readRecipe(drive, t, newest.n).catch(() => null) : null;
19744
+ return { style: recorded?.system };
19745
+ }
19746
+ async function readSystem(drive, id) {
19747
+ const root2 = await findRoot(drive, { migrate: false });
19748
+ const systems = root2 && await drive.find("Systems", root2, { folderOnly: true });
19749
+ const file = systems && await drive.find(`${id}.json`, systems);
19750
+ if (!file) return null;
19751
+ const raw = await drive.readJson(file).catch(() => null);
19752
+ return raw && typeof raw === "object" && typeof raw.brandName === "string" ? { ...raw, id: raw.id ?? id } : null;
19753
+ }
18673
19754
  function withoutRemoved(recipe, board) {
18674
19755
  if (!recipe || !board) return recipe;
18675
19756
  const here = new Set(present(board).map((i) => i.id));
@@ -18721,7 +19802,8 @@ function publicRecipe(recipe, usesPictures) {
18721
19802
  types: [],
18722
19803
  notes: [],
18723
19804
  references: usesPictures ? recipe.references.map((r, n) => ({ itemId: `picture-${n + 1}`, title: r.title })) : [],
18724
- sortedCount: 0
19805
+ sortedCount: 0,
19806
+ ...recipe.system ? { system: { ...recipe.system, systemId: "" } } : {}
18725
19807
  };
18726
19808
  }
18727
19809
  var HOST_SCRIPT = `
@@ -18839,7 +19921,6 @@ ${HOST_SCRIPT}
18839
19921
 
18840
19922
  // connector/src/tools.ts
18841
19923
  var MAX_IMAGES = 20;
18842
- var IMAGE_TYPES = ["image/png", "image/jpeg", "image/webp", "image/gif"];
18843
19924
  var REJECTIONS_SHOWN = 3;
18844
19925
  var THEME_LIST = Object.keys(themeColorsSchema.properties).join(", ");
18845
19926
  var INSTRUCTIONS = `This connector reaches the person's inspiration boards, requests and design systems for Phylla, in their own Google Drive. It never deletes anything. A client, a system or the studio can have several boards; pick one by its key from list_boards.
@@ -18847,7 +19928,7 @@ var INSTRUCTIONS = `This connector reaches the person's inspiration boards, requ
18847
19928
  Sorting a board ("Sort my "<board>" inspiration board."):
18848
19929
  1. Call list_boards to find the board's key, then read_board with unsortedOnly: true. Every unsorted item comes with its words and, when the app stored one, its picture.
18849
19930
  2. Look at each picture carefully. For every item choose one to three paths. A path names a goal, a lever and a technique by id, and the technique must be one of that lever's own techniques (see its leverIds in the map).
18850
- 3. Prefer the techniques already on the map. Only when none fits, propose a new technique in newTechniques (a short name and the ids of levers already on the map) and use "new:" followed by its exact name as the techniqueId.
19931
+ 3. Prefer the techniques already on the map. Only when none fits, propose a new technique in newTechniques (a short name and the ids of levers already on the map) and use "new:" followed by its exact name as the techniqueId. Suggested techniques wait for the person. You may file items under them, but prefer techniques that are not suggested.
18851
19932
  4. Add tags when you can tell: the main colours as hex, the type of thing, its subject and its medium.
18852
19933
  5. Call file_items with your filings. It says how many were filed and why any failed; send a corrected filing for those. Call read_board again until no unsorted items are left (read_board shows at most 20 pictures at a time).
18853
19934
  6. If the board has an open sort request, finish it with complete_request({ id }) once the board is sorted. A sort request needs no result.
@@ -18857,6 +19938,7 @@ Watching a board ("Watch my "<board>" board and sort new items as they arrive, u
18857
19938
 
18858
19939
  Answering requests: call list_requests to see the open ones, and answer each with complete_request.
18859
19940
  - sort: sort the board as above, then complete_request({ id }).
19941
+ - ping: nothing to make. Call complete_request({ id }) at once, with no result, so Phylla can show that Claude Code reaches it.
18860
19942
  - use-board: read_board for the board and read_system for the request's systemId. Suggest only what the board clearly points to and only where it differs from the system now. Answer complete_request({ id, result: { suggestions: [...] } }), each suggestion with a one-sentence reason and the ids of the items behind it.
18861
19943
  - system-from-board: read_board, then design a complete system from it: the colours, fonts, notes and the ideas the examples are filed under are the brief. Call get_system_schema for the exact shape, and answer complete_request({ id, result: <the system> }).
18862
19944
  - describe: read the request's prompt (the brand description) and style (auto, flat, glassmorphism, brutalism or claymorphism; with auto, choose the style that fits). Design the full system against the schema from get_system_schema, and answer complete_request({ id, result: <the system> }).
@@ -18867,52 +19949,18 @@ If you cannot do a request, call complete_request({ id, error: "<why, in plain w
18867
19949
 
18868
19950
  create_system is only for when the person asks you directly, in conversation, to make a design system and there is no request for it.
18869
19951
 
18870
- Board tools. A tool makes new things in the spirit of a board (or of an idea): brand assets, posters, illustrations, textures, video, 3D. Each tool has one plan the person approves, builds, and results. Tools follow their board live: read_tool always gives the board's recipe as it is now, unless the person set the tool back to an earlier version.
19952
+ Board tools. A tool makes new things in the spirit of a board (or of an idea): brand assets, posters, illustrations, textures, video, 3D. Each tool has one plan the person approves, builds, and results. Tools follow their board live: read_tool always gives the board's recipe as it is now, unless the person set the tool back to an earlier version. A tool made from a project also follows that project's design system: its recipe then has a system (the brand colours by role, the display and body fonts, the spacing unit and the corner radii). Make in that system's colours and fonts, and let the board set the mood around them. A tool-plan request made from a project carries the project's systemId: call read_system for it and plan a tool that works in that system.
18871
19953
  - tool-plan: read_board_for_tool for the request's board (when it has one), or read the idea in the request's prompt. When the board is not a good fit (read_board_for_tool says so, or its items have nothing in common to build on), answer complete_request({ id, result: { fit: false, why: "<one sentence>", add: "<what to add to the board>" } }). Otherwise answer { fit: true, name, plan }. The plan has makes (one sentence), inputs (each { id, label, kind: text, number, choice, colour, picture or seed, default }), outputs (png, png-tile, svg, web-code, figma, video, 3d), engine, makerLabel, needs, look, useBoardStyle (the request's useBoardStyle when given, else true for a board), pins and exclusions (empty to start), and usesPictures. Choose engine "code" when the job can be drawn in code in a web page (patterns, grain, gradients, type-led layouts, marks, generative illustration, animated loops); the makerLabel is then "Runs in Phylla". Choose "claude" when it needs a model or another app (an image or video model, Blender, Figma); the makerLabel is then "Runs through your Claude Code, using <what>". In needs, name in plain words every connector this tool would need that your Claude Code does not have now, so the person hears it before the build. The look is one or two sentences on what makes the board's items belong together, and what to avoid.
18872
19954
  - tool-build: read_tool for the request's toolId, and build "the plan to build" it shows. For engine "code", the body is one self-contained HTML file that follows the generator contract (read_tool gives it). For engine "claude", the body is the instructions, in Markdown: how to make the thing, which connector to use, and what to check before handing a result back. Also make three samples with the plan's defaults and give them as samples (each a list of { name, mime, base64 }). Answer complete_request({ id, result: { engine, body, samples } }). Before answering, compare what the tool makes against the reference pictures and the look: it must read as the board, not as any AI output.
18873
19955
  - tool-change: read_tool, then answer complete_request({ id, result: { plan } }) with the whole revised plan, changed as the request's prompt says. The person approves it in the app, which then asks for the build.
18874
19956
  - tool-run: read_tool, make the result with the request's inputs (the plan's defaults for any left out), and save it with save_tool_result. Compare each result against the reference pictures and the look before saving; make a result that does not match again, and never show the person one that does not. Then complete_request({ id, result: { resultId } }).
18875
19957
  - tool-publish: only a tool whose engine is "code" can be published. Call read_tool with forPublish: true: it writes the tool as one web page to a folder on this computer and names it. Deploy that folder with whatever hosting connector you have (Vercel, for example). Answer complete_request({ id, result: { address: "https://..." } }). When you have no hosting connector, answer complete_request({ id, error: "Your Claude Code has no hosting connector, such as Vercel. Download the tool as one web page instead." }).
18876
19958
  - Asked in conversation to use a tool ("make three covers with my Podcast tool"): call list_tools to find it. A "claude" tool: make the results as for tool-run and save them with save_tool_result. A "code" tool runs in Phylla: call run_tool_in_app with the inputs, and give the person the sentence it answers with.
18877
- - tool-run-in-app requests are answered by the app itself. Never answer them.`;
18878
- var isObj3 = (v) => !!v && typeof v === "object" && !Array.isArray(v);
18879
- var text = (t) => ({ content: [{ type: "text", text: t }] });
18880
- var fail = (t) => ({ content: [{ type: "text", text: t }], isError: true });
18881
- var BadInput = class extends Error {
18882
- };
18883
- function args(raw) {
18884
- if (raw === void 0 || raw === null) return {};
18885
- if (!isObj3(raw)) throw new BadInput("The arguments must be an object.");
18886
- return raw;
18887
- }
18888
- function needString(a, name) {
18889
- const v = a[name];
18890
- if (typeof v !== "string" || !v.trim()) throw new BadInput(`${name} is required, as text.`);
18891
- return v.trim();
18892
- }
18893
- function maybeString(a, name) {
18894
- const v = a[name];
18895
- if (v === void 0 || v === null) return void 0;
18896
- if (typeof v !== "string") throw new BadInput(`${name} must be text.`);
18897
- return v.trim() || void 0;
18898
- }
18899
- function needId(a, name) {
18900
- const v = needString(a, name);
18901
- if (!/^[A-Za-z0-9_-]+$/.test(v)) throw new BadInput(`${name} "${v}" is not an id. Ids hold only letters, digits, _ and -.`);
18902
- return v;
18903
- }
18904
- function explain(err) {
18905
- if (err instanceof DriveError) {
18906
- if (err.status === 401) return SIGN_IN_AGAIN;
18907
- if (err.status === 403) return `Google Drive refused this (403). ${err.message}`;
18908
- return err.message;
18909
- }
18910
- return err instanceof Error ? err.message : String(err);
18911
- }
18912
- var pretty = (v) => JSON.stringify(v, null, 2);
19959
+ - tool-run-in-app requests are answered by the app itself. Never answer them.
19960
+
19961
+ ${BUILDING_INSTRUCTIONS}`;
18913
19962
  var forClaude = (r) => r.status === "open" && r.kind !== "tool-run-in-app";
18914
- var APP_ADDRESS = "https://phyllastudio.vercel.app";
18915
- var validBoard = (b) => isObj3(b) && typeof b.key === "string" && Array.isArray(b.items) && isObj3(b.map) && Array.isArray(b.map.goals) && Array.isArray(b.map.levers) && Array.isArray(b.map.techniques);
19963
+ var APP_ADDRESS = "https://phyllasystem.vercel.app";
18916
19964
  async function boardAt(drive, p, key) {
18917
19965
  await p.needRoot();
18918
19966
  const folder = await p.board(key);
@@ -18937,15 +19985,15 @@ async function withInbox(drive, at, before) {
18937
19985
  } catch {
18938
19986
  continue;
18939
19987
  }
18940
- if (!isObj3(raw)) continue;
19988
+ if (!isObj2(raw)) continue;
18941
19989
  for (const t of f.name < before && Array.isArray(raw.techniques) ? raw.techniques : []) {
18942
- if (!isObj3(t) || typeof t.name !== "string" || !t.name.trim()) continue;
19990
+ if (!isObj2(t) || typeof t.name !== "string" || !t.name.trim()) continue;
18943
19991
  const before2 = board;
18944
19992
  const added = addTechnique(board, { name: t.name, leverIds: Array.isArray(t.leverIds) ? t.leverIds.filter((l) => typeof l === "string") : [] });
18945
19993
  board = added.board;
18946
19994
  if (board !== before2) pendingTechniques.add(added.id);
18947
19995
  }
18948
- for (const fl of Array.isArray(raw.filings) ? raw.filings : []) if (isObj3(fl) && typeof fl.itemId === "string") pendingItems.add(fl.itemId);
19996
+ for (const fl of Array.isArray(raw.filings) ? raw.filings : []) if (isObj2(fl) && typeof fl.itemId === "string") pendingItems.add(fl.itemId);
18949
19997
  }
18950
19998
  return { board, pendingItems, pendingTechniques };
18951
19999
  }
@@ -18975,22 +20023,6 @@ ${clip(pretty(r.data), 4e3)}`).join("\n\n");
18975
20023
  Entries the app could not apply (newest first), each with the reason. Send a corrected filing for any that still matter:
18976
20024
  ${shown}`;
18977
20025
  }
18978
- var clip = (s, max) => s.length > max ? `${s.slice(0, max)}
18979
- ... (cut short)` : s;
18980
- async function readIndex(drive, root2) {
18981
- const id = await drive.find(INDEX_FILE, root2);
18982
- if (!id) return { id: null, entries: [] };
18983
- const raw = await drive.readJson(id);
18984
- return { id, entries: Array.isArray(raw?.entries) ? raw.entries.filter(validEntry) : [] };
18985
- }
18986
- async function allBoards(drive, p) {
18987
- const root2 = await p.needRoot();
18988
- const [{ entries }, boardsFolder] = await Promise.all([readIndex(drive, root2), p.boards()]);
18989
- const folders = boardsFolder ? await drive.list(boardsFolder) : [];
18990
- const out = entries.filter((e) => e.kind === "board" && !e.deleted).map((e) => ({ key: e.id, name: e.name, level: e.level, archived: e.archived, folder: folders.find((f) => f.name === e.id)?.id ?? e.fileId }));
18991
- for (const f of folders) if (!out.some((b) => b.key === f.name)) out.push({ key: f.name, name: f.name, level: void 0, archived: void 0, folder: f.id });
18992
- return out;
18993
- }
18994
20026
  function requestText(r, boardName = "") {
18995
20027
  const lines = [`- ${r.id}: ${r.kind}${r.boardKey ? ` on board ${r.boardKey}` : " (belongs to no board)"}, asked ${new Date(r.createdAt).toISOString()}`, ` The person's sentence: ${sentenceFor(r, boardName)}`];
18996
20028
  if (r.systemId) lines.push(` System: ${r.systemName ? `${r.systemName} ` : ""}(id ${r.systemId}); read it with read_system.`);
@@ -19019,44 +20051,45 @@ var WHAT_TO_DO = {
19019
20051
  "tool-change": "read_tool for toolId, revise the plan as prompt says, then complete_request({ id, result: { plan } }).",
19020
20052
  "tool-run": "read_tool for toolId, make the result with inputs, save it with save_tool_result, then complete_request({ id, result: { resultId } }).",
19021
20053
  "tool-publish": "read_tool for toolId with forPublish: true, deploy the page with your hosting connector, then complete_request({ id, result: { address } }).",
19022
- "tool-run-in-app": "nothing: the app answers this one itself."
20054
+ "tool-run-in-app": "nothing: the app answers this one itself.",
20055
+ ping: "nothing to make: complete_request({ id }) at once, to show Phylla that Claude Code can reach it."
19023
20056
  };
19024
20057
  function whyFailed(raw, b, proposals) {
19025
- if (!isObj3(raw)) return "a filing is not an object";
20058
+ if (!isObj2(raw)) return "a filing is not an object";
19026
20059
  const itemId = raw.itemId;
19027
20060
  const item = b.items.find((i) => i.id === itemId);
19028
20061
  if (!item || item.removed) return `item "${itemId}" is not on the board`;
19029
20062
  const paths = Array.isArray(raw.paths) ? raw.paths : [];
19030
20063
  if (!paths.length) return `no paths (item ${itemId})`;
19031
20064
  for (const p of paths.slice(0, 3)) {
19032
- if (!isObj3(p) || typeof p.goalId !== "string" || typeof p.leverId !== "string" || typeof p.techniqueId !== "string")
20065
+ if (!isObj2(p) || typeof p.goalId !== "string" || typeof p.leverId !== "string" || typeof p.techniqueId !== "string")
19033
20066
  return `every path needs a goalId, a leverId and a techniqueId (item ${itemId})`;
19034
20067
  const { goalId, leverId } = p;
19035
20068
  let { techniqueId } = p;
19036
- if (!b.map.goals.some((g) => g.id === goalId)) return `unknown goal "${goalId}" (item ${itemId})`;
19037
- if (!b.map.levers.some((l) => l.id === leverId)) return `unknown lever "${leverId}" (item ${itemId})`;
20069
+ const node2 = nodeProblem("goal", b.map.goals, goalId) ?? nodeProblem("lever", b.map.levers, leverId);
20070
+ if (node2) return `${node2} (item ${itemId})`;
19038
20071
  const name = techniqueId.startsWith(NEW_TECHNIQUE) ? techniqueId.slice(NEW_TECHNIQUE.length).trim().replace(/\s+/g, " ") : null;
19039
- const existing = name !== null ? b.map.techniques.find((t) => t.name.toLowerCase() === name.toLowerCase()) : void 0;
20072
+ const existing = name !== null ? b.map.techniques.find((t) => !t.removed && t.name.toLowerCase() === name.toLowerCase()) : void 0;
19040
20073
  if (existing) techniqueId = existing.id;
19041
20074
  else if (name !== null) {
19042
- const proposal = proposals.find((t) => isObj3(t) && typeof t.name === "string" && t.name.trim().replace(/\s+/g, " ").toLowerCase() === name.toLowerCase());
20075
+ const proposal = proposals.find((t) => isObj2(t) && typeof t.name === "string" && t.name.trim().replace(/\s+/g, " ").toLowerCase() === name.toLowerCase());
19043
20076
  if (!proposal) return `new technique "${name}" is not in newTechniques (item ${itemId})`;
19044
20077
  const levers = Array.isArray(proposal.leverIds) ? proposal.leverIds : [];
19045
- if (!levers.length || !levers.every((l) => b.map.levers.some((x) => x.id === l))) return `new technique "${name}" needs leverIds that are on the map (item ${itemId})`;
20078
+ const shown = shownMap(b.map).levers;
20079
+ if (!levers.length || !levers.every((l) => shown.some((x) => x.id === l))) return `new technique "${name}" needs leverIds that are on the map (item ${itemId})`;
19046
20080
  if (!levers.includes(leverId)) return `new technique "${name}" does not belong to lever "${leverId}" (item ${itemId})`;
19047
20081
  continue;
19048
20082
  }
19049
- const technique = b.map.techniques.find((t) => t.id === techniqueId);
19050
- if (!technique) return `unknown technique "${techniqueId}" (item ${itemId})`;
19051
- if (!validPath(b.map, { goalId, leverId, techniqueId })) return `technique "${techniqueId}" does not belong to lever "${leverId}" (item ${itemId})`;
20083
+ const why = pathProblem(b.map, { goalId, leverId, techniqueId });
20084
+ if (why) return `${why} (item ${itemId})`;
19052
20085
  }
19053
20086
  return `the filing for item ${itemId} cannot be used`;
19054
20087
  }
19055
20088
  var BRAND_KEYS2 = ["primary", "secondary", "accent", "success", "warning", "error", "info"];
19056
20089
  var THEME_KEYS3 = Object.keys(themeColorsSchema.properties);
19057
20090
  function missingParts(raw) {
19058
- if (!isObj3(raw)) return ["the system must be an object"];
19059
- const get = (path) => path.split(".").reduce((v, k) => isObj3(v) ? v[k] : void 0, raw);
20091
+ if (!isObj2(raw)) return ["the system must be an object"];
20092
+ const get = (path) => path.split(".").reduce((v, k) => isObj2(v) ? v[k] : void 0, raw);
19060
20093
  const filled2 = (path) => {
19061
20094
  const v = get(path);
19062
20095
  return typeof v === "string" && !!v.trim();
@@ -19067,7 +20100,7 @@ function missingParts(raw) {
19067
20100
  for (const k of ["colors.neutrals", "colors.primaryScale", "typography.scale", "spacing.scale", "borderRadius.scale", "shadows.scale"]) if (!Array.isArray(get(k))) out.push(`${k} (a list)`);
19068
20101
  for (const k of ["displayFont", "bodyFont", "monoFont"]) if (!filled2(`typography.${k}.name`)) out.push(`typography.${k}.name`);
19069
20102
  for (const theme of ["light", "dark"]) for (const k of THEME_KEYS3) if (!filled2(`themes.${theme}.${k}`)) out.push(`themes.${theme}.${k}`);
19070
- if (!isObj3(get("iconStyle"))) out.push("iconStyle");
20103
+ if (!isObj2(get("iconStyle"))) out.push("iconStyle");
19071
20104
  return out;
19072
20105
  }
19073
20106
  function systemProblem(raw) {
@@ -19132,7 +20165,7 @@ ${lines.join("\n")}` : "There are no boards in Drive yet."}${tail}`);
19132
20165
  );
19133
20166
  const read_board = tool(
19134
20167
  "read_board",
19135
- `Reads a board: its map (goals, levers and techniques, with each technique's leverIds), then its items. Each unsorted item comes with its stored picture as an image, up to ${MAX_IMAGES} per call. Items marked removed are off the board and are never shown. Unsorted items already filed in the Inbox (waiting for the app) are left out of the unsorted ones. Also shows the entries the app rejected, with the reasons.`,
20168
+ `Reads a board: its map as the person sees it (goals, levers and techniques, with each technique's leverIds; hidden and removed ones are left out), then its items. A lever with "feeds" names the part of a design system it informs, so the items under it are evidence for that part. A technique with "suggested": true waits for the person to accept it. Each unsorted item comes with its stored picture as an image, up to ${MAX_IMAGES} per call. Items marked removed are off the board and are never shown. Unsorted items already filed in the Inbox (waiting for the app) are left out of the unsorted ones. Also shows the entries the app rejected, with the reasons.`,
19136
20169
  {
19137
20170
  properties: {
19138
20171
  key: { type: "string", description: "The board key, from list_boards (for example studio, client-<id>, or client-<id>~<board id> for a client's other boards)." },
@@ -19250,7 +20283,7 @@ ${open2.map((r) => requestText(r, board.name)).join("\n")}` : "";
19250
20283
  }
19251
20284
  filings.push({ itemId: f.itemId, paths: f.paths.map((x) => ({ ...x, techniqueId: ids.get(x.techniqueId) ?? x.techniqueId })), ...f.tags ? { tags: f.tags } : {} });
19252
20285
  }
19253
- const raws = a.filings.filter((f) => isObj3(f) && typeof f.itemId === "string");
20286
+ const raws = a.filings.filter((f) => isObj2(f) && typeof f.itemId === "string");
19254
20287
  for (const id of r.failed) reasons.push(whyFailed(raws.find((f) => f.itemId === id), board, proposals));
19255
20288
  const noId = a.filings.length - raws.length;
19256
20289
  if (noId) reasons.push(`${noId} filing${noId === 1 ? " has" : "s have"} no itemId`);
@@ -19262,7 +20295,7 @@ ${open2.map((r) => requestText(r, board.name)).join("\n")}` : "";
19262
20295
  await drive.writeJson(inbox, name, { items: [], filings, techniques });
19263
20296
  written = ` Written to Inbox/${name}. The app applies it the next time the board is open (it checks every 15 seconds).`;
19264
20297
  }
19265
- const many = a.filings.some((f) => isObj3(f) && Array.isArray(f.paths) && f.paths.length > 3) ? " Only the first three paths of a filing are kept." : "";
20298
+ const many = a.filings.some((f) => isObj2(f) && Array.isArray(f.paths) && f.paths.length > 3) ? " Only the first three paths of a filing are kept." : "";
19266
20299
  return text(`${filings.length} filed, ${reasons.length} failed${reasons.length ? `: ${reasons.join("; ")}` : ""}.${written}${many}`);
19267
20300
  }
19268
20301
  );
@@ -19296,6 +20329,7 @@ ${open2.map((r) => requestText(r, b.name)).join("\n")}`);
19296
20329
  "complete_request",
19297
20330
  `Finishes an open request: checks the result for the request's kind, then writes it into the same request file with the status done (or failed, with error). The app is watching that file and takes it from there.
19298
20331
  - sort: no result needed (the sorting happens through file_items).
20332
+ - ping: no result needed. Complete it at once.
19299
20333
  - use-board: result is { suggestions: [...] }, shaped like ${JSON.stringify(SUGGEST_SCHEMA.properties.suggestions)}.
19300
20334
  - system-from-board and describe: result is a complete design system, shaped like get_system_schema. The app saves the system from this result, so never call create_system for these requests, or the system is saved twice.
19301
20335
  - theme: result is one theme's 16 colours, each a colour such as #0f1f17: ${THEME_LIST}. The app adds the theme to the system from this result.
@@ -19328,7 +20362,7 @@ To say a request cannot be done, give error instead of result.`,
19328
20362
  let result = a.result;
19329
20363
  if (request.kind === "use-board") {
19330
20364
  if (result === void 0) throw new BadInput("A use-board request needs a result: { suggestions: [...] }.");
19331
- const list2 = isObj3(result) ? result.suggestions : result;
20365
+ const list2 = isObj2(result) ? result.suggestions : result;
19332
20366
  if (!Array.isArray(list2)) throw new BadInput("The result must be { suggestions: [...] }.");
19333
20367
  const kept = parseSuggestions(result);
19334
20368
  if (kept.length !== list2.length)
@@ -19337,6 +20371,9 @@ To say a request cannot be done, give error instead of result.`,
19337
20371
  );
19338
20372
  } else if (request.kind === "sort") {
19339
20373
  if (result !== void 0) throw new BadInput("A sort request takes no result: the sorting goes through file_items. Call complete_request({ id }) on its own. Nothing was written.");
20374
+ } else if (request.kind === "ping") {
20375
+ if (result !== void 0) throw new BadInput("A ping request takes no result. Call complete_request({ id }) on its own. Nothing was written.");
20376
+ result = { connector: CONNECTOR_VERSION };
19340
20377
  } else if (request.kind === "system-from-board" || request.kind === "describe") {
19341
20378
  if (result === void 0) throw new BadInput(`A ${request.kind} request needs a result: the complete system (see get_system_schema).`);
19342
20379
  const problem = systemProblem(result);
@@ -19346,7 +20383,7 @@ To say a request cannot be done, give error instead of result.`,
19346
20383
  const missing = answerProblems(request.kind, result);
19347
20384
  if (missing.length) return fail(`The answer to a ${request.kind} request is missing or has wrong: ${missing.join(", ")}. Nothing was written.`);
19348
20385
  const onBoard = request.boardKey;
19349
- if (request.kind === "tool-plan" && !request.prompt && onBoard && isObj3(result) && result.fit === true) {
20386
+ if (request.kind === "tool-plan" && !request.prompt && onBoard && isObj2(result) && result.fit === true) {
19350
20387
  const sorted = computeRecipe((await boardAt(drive, p, onBoard)).board).sortedCount;
19351
20388
  if (sorted < MIN_SORTED_FOR_TOOL)
19352
20389
  return fail(`This board is not a good fit for a tool yet: it has ${sorted} sorted ${sorted === 1 ? "item" : "items"}, and a tool needs at least ${MIN_SORTED_FOR_TOOL}. Answer with { fit: false, why, add }. Nothing was written.`);
@@ -19361,7 +20398,7 @@ To say a request cannot be done, give error instead of result.`,
19361
20398
  }
19362
20399
  }
19363
20400
  await drive.writeJson(folder, `${id}.json`, { ...rest, status: "done", ...result !== void 0 ? { result } : {} }, fileId);
19364
- const after = request.kind === "system-from-board" || request.kind === "describe" ? " The app saves the system from this answer while it is open; do not call create_system for it." : request.kind === "use-board" ? " The app shows the suggestions to the person." : request.kind === "theme" ? " The app adds the theme to the system while it is open." : request.kind.startsWith("tool-") ? " The app saves this into the tool while it is open." : "";
20401
+ const after = request.kind === "system-from-board" || request.kind === "describe" ? " The app saves the system from this answer while it is open; do not call create_system for it." : request.kind === "use-board" ? " The app shows the suggestions to the person." : request.kind === "theme" ? " The app adds the theme to the system while it is open." : request.kind.startsWith("tool-") ? " The app saves this into the tool while it is open." : request.kind === "ping" ? " Phylla now shows that Claude Code is connected." : "";
19365
20402
  return text(`Request ${id} is done.${after}`);
19366
20403
  }
19367
20404
  );
@@ -19422,10 +20459,10 @@ To say a request cannot be done, give error instead of result.`,
19422
20459
  ${pretty(designSystemSchema)}`
19423
20460
  )
19424
20461
  );
19425
- async function findTool(p, toolId, boardKey) {
20462
+ async function findTool(p, toolId, boardKey2) {
19426
20463
  await p.needRoot();
19427
- const t = boardKey !== void 0 ? await readLiveTool(drive, boardKey, toolId) : (await listTools(drive)).find((x) => x.id === toolId) ?? null;
19428
- if (!t) throw new Missing(`There is no tool "${toolId}"${boardKey ? ` on the board "${boardKey}"` : ""}. Call list_tools to see the tools and their ids.`);
20464
+ const t = boardKey2 !== void 0 ? await readLiveTool(drive, boardKey2, toolId) : (await listTools(drive)).find((x) => x.id === toolId) ?? null;
20465
+ if (!t) throw new Missing(`There is no tool "${toolId}"${boardKey2 ? ` on the board "${boardKey2}"` : ""}. Call list_tools to see the tools and their ids.`);
19429
20466
  return t;
19430
20467
  }
19431
20468
  async function referencePictures(p, recipe) {
@@ -19541,11 +20578,11 @@ ${pretty(recipe)}` }, ...await referencePictures(p, recipe)] };
19541
20578
  if (build2.engine === "code") return fail("This tool runs in Phylla. Call run_tool_in_app instead.");
19542
20579
  if (!Array.isArray(a.files)) throw new BadInput("files must be a list of { name, mime, base64 }.");
19543
20580
  const files = a.files.map((f) => {
19544
- if (!isObj3(f) || typeof f.name !== "string" || typeof f.base64 !== "string") throw new BadInput("Each file needs name, mime and base64.");
20581
+ if (!isObj2(f) || typeof f.name !== "string" || typeof f.base64 !== "string") throw new BadInput("Each file needs name, mime and base64.");
19545
20582
  return { name: f.name.replace(/[\\/]/g, "-"), blob: new Blob([Buffer.from(f.base64, "base64")], { type: typeof f.mime === "string" ? f.mime : "" }) };
19546
20583
  });
19547
20584
  const { tool: t, n } = await recipeFor(p, t0);
19548
- const saved = await saveResult(drive, t, { build: build2.n, recipe: n ?? 0, inputs: isObj3(a.inputs) ? a.inputs : {}, madeAt: now(), madeBy: "claude-code" }, files);
20585
+ const saved = await saveResult(drive, t, { build: build2.n, recipe: n ?? 0, inputs: isObj2(a.inputs) ? a.inputs : {}, madeAt: now(), madeBy: "claude-code" }, files);
19549
20586
  return text(`Saved result ${saved.id} with ${files.length} ${files.length === 1 ? "file" : "files"}. It shows on the tool page.`);
19550
20587
  }
19551
20588
  );
@@ -19576,7 +20613,7 @@ ${pretty(recipe)}` }, ...await referencePictures(p, recipe)] };
19576
20613
  ...t.boardKey ? { boardKey: t.boardKey } : {},
19577
20614
  toolId: t.id,
19578
20615
  toolName: t.name,
19579
- inputs: isObj3(a.inputs) ? a.inputs : {},
20616
+ inputs: isObj2(a.inputs) ? a.inputs : {},
19580
20617
  createdAt: now(),
19581
20618
  status: "open"
19582
20619
  };
@@ -19598,7 +20635,8 @@ If Phylla is not open, open this page and the run finishes there.`);
19598
20635
  read_tool,
19599
20636
  read_board_for_tool,
19600
20637
  save_tool_result,
19601
- run_tool_in_app
20638
+ run_tool_in_app,
20639
+ ...createHandoffTools(drive, opts)
19602
20640
  };
19603
20641
  }
19604
20642
  function callTool(tools2, name, raw) {
@@ -19606,11 +20644,12 @@ function callTool(tools2, name, raw) {
19606
20644
  if (!t) return Promise.resolve(fail(`There is no tool called ${name}.`));
19607
20645
  return t.run(raw);
19608
20646
  }
19609
- function mapText(m) {
20647
+ function mapText(map) {
20648
+ const m = shownMap(map);
19610
20649
  return JSON.stringify({
19611
20650
  goals: m.goals.map(({ id, name }) => ({ id, name })),
19612
- levers: m.levers.map(({ id, name }) => ({ id, name })),
19613
- techniques: m.techniques.map(({ id, name, leverIds }) => ({ id, name, leverIds }))
20651
+ levers: m.levers.map(({ id, name, feeds }) => ({ id, name, ...feeds ? { feeds } : {} })),
20652
+ techniques: m.techniques.map(({ id, name, leverIds, suggested }) => ({ id, name, leverIds, ...suggested ? { suggested } : {} }))
19614
20653
  });
19615
20654
  }
19616
20655
  function itemText(i, m) {
@@ -19629,19 +20668,6 @@ function itemText(i, m) {
19629
20668
  if (i.status === "unsorted" && !i.thumbId) lines.push("No stored picture: judge it from its words and URL.");
19630
20669
  return lines.join("\n");
19631
20670
  }
19632
- async function picture(drive, folder, mediaId) {
19633
- try {
19634
- const fileId = await drive.find(mediaId, folder);
19635
- if (!fileId) return null;
19636
- const blob = await drive.download(fileId);
19637
- const type = blob.type.split(";")[0].trim().toLowerCase();
19638
- if (!IMAGE_TYPES.includes(type)) return null;
19639
- return { type: "image", data: Buffer.from(await blob.arrayBuffer()).toString("base64"), mimeType: type };
19640
- } catch (err) {
19641
- if (err instanceof DriveError && err.status === 401) throw err;
19642
- return null;
19643
- }
19644
- }
19645
20671
  async function findRequest(drive, p, id, key) {
19646
20672
  const folders = [];
19647
20673
  if (key) {
@@ -19668,7 +20694,7 @@ async function findRequest(drive, p, id, key) {
19668
20694
  // connector/src/index.ts
19669
20695
  var auth = createAuth(clientFromEnv());
19670
20696
  var tools = createTools(connectDrive(auth));
19671
- var server = new Server({ name: "phylla", version: "0.1.0" }, { capabilities: { tools: {} }, instructions: INSTRUCTIONS });
20697
+ var server = new Server({ name: "phylla", version: CONNECTOR_VERSION }, { capabilities: { tools: {} }, instructions: INSTRUCTIONS });
19672
20698
  server.setRequestHandler(ListToolsRequestSchema, async () => ({
19673
20699
  tools: Object.values(tools).map(({ name, description, inputSchema }) => ({ name, description, inputSchema }))
19674
20700
  }));