copilotkit 4.0.1 → 4.1.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.
Files changed (3) hide show
  1. package/README.md +3 -1
  2. package/index.js +757 -543
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -78,9 +78,9 @@ function getTelemetryEndpointUrl() {
78
78
  }
79
79
  function getBuildInfo() {
80
80
  return {
81
- version: true ? "4.0.1" : "dev",
82
- buildNumber: true ? "27840207129" : "dev",
83
- commitSha: true ? "e5f3dcfef0b6d5732bd9c436285eab0e650303f8" : "dev"
81
+ version: true ? "4.1.0" : "dev",
82
+ buildNumber: true ? "28196669403" : "dev",
83
+ commitSha: true ? "c3ac42deeab5cae449709aebbcfb746741974860" : "dev"
84
84
  };
85
85
  }
86
86
  function getTemplateRef() {
@@ -606,10 +606,21 @@ var init_types = __esm({
606
606
  TEMPLATE_REPOS["microsoft-agent-framework-dotnet"],
607
607
  `\u{1FA81}\u{1F91D}${FRAMEWORK_EMOJI["microsoft-agent-framework-dotnet"]}`
608
608
  ),
609
- postInstallCommands: [
610
- 'cd agent && dotnet user-secrets set GitHubToken "<your-github-token>"'
611
- ],
612
- environment: []
609
+ // No root-`.env` vendor gate: the agent's model credentials are configured
610
+ // via dotnet user-secrets (GitHub Models, by default) or OpenAI/Azure
611
+ // OpenAI, none of which live in the root `.env`, so a fixed root-`.env` key
612
+ // requirement would falsely warn. The GitHub-token user-secrets command is
613
+ // credential setup (not a generic post-install build step), so it is
614
+ // surfaced as explicit credential guidance below instead.
615
+ environment: [],
616
+ setupNotes: [
617
+ { text: " Set up the agent model credentials:" },
618
+ {
619
+ text: " GitHub Models: ",
620
+ code: 'cd agent && dotnet user-secrets set GitHubToken "<your-github-token>"'
621
+ },
622
+ { text: " or OpenAI / Azure OpenAI \u2014 see the agent README" }
623
+ ]
613
624
  },
614
625
  "microsoft-agent-framework-py": {
615
626
  ...standardTemplate(
@@ -617,13 +628,20 @@ var init_types = __esm({
617
628
  TEMPLATE_REPOS["microsoft-agent-framework-py"],
618
629
  `\u{1FA81}\u{1F91D}${FRAMEWORK_EMOJI["microsoft-agent-framework-py"]}`
619
630
  ),
620
- // No root-`.env` vendor gate: the template's README configures credentials
621
- // in `agent/.env`, and the agent accepts either OpenAI (`OPENAI_API_KEY`)
622
- // or Azure OpenAI (`AZURE_OPENAI_ENDPOINT`, optionally `AZURE_OPENAI_API_KEY`
631
+ // No root-`.env` vendor gate: the template configures credentials in
632
+ // `agent/.env`, and the agent accepts either OpenAI (`OPENAI_API_KEY`) or
633
+ // Azure OpenAI (`AZURE_OPENAI_ENDPOINT`, optionally `AZURE_OPENAI_API_KEY`
623
634
  // or `az login`). The dev preflight only reads the root `.env`, so any fixed
624
635
  // key requirement here would falsely warn on valid Azure/`agent/.env`
625
- // setups. Credential guidance lives in the template README.
626
- environment: []
636
+ // setups the guidance below points at `agent/.env` instead.
637
+ environment: [],
638
+ setupNotes: [
639
+ { text: " Set up the agent model credentials in agent/.env:" },
640
+ { text: " OpenAI: ", code: "OPENAI_API_KEY=sk-..." },
641
+ {
642
+ text: " or Azure OpenAI (AZURE_OPENAI_ENDPOINT, then `az login`) \u2014 see the agent README"
643
+ }
644
+ ]
627
645
  },
628
646
  ag2: standardTemplate(
629
647
  "ag2",
@@ -873,16 +891,16 @@ function processSegment(segment, parts) {
873
891
  }
874
892
  return true;
875
893
  }
876
- function parsePath(path16) {
877
- if (typeof path16 !== "string") {
878
- throw new TypeError(`Expected a string, got ${typeof path16}`);
894
+ function parsePath(path18) {
895
+ if (typeof path18 !== "string") {
896
+ throw new TypeError(`Expected a string, got ${typeof path18}`);
879
897
  }
880
898
  const parts = [];
881
899
  let currentSegment = "";
882
900
  let currentPart = "start";
883
901
  let isEscaping = false;
884
902
  let position = 0;
885
- for (const character of path16) {
903
+ for (const character of path18) {
886
904
  position++;
887
905
  if (isEscaping) {
888
906
  currentSegment += character;
@@ -992,13 +1010,13 @@ function parsePath(path16) {
992
1010
  }
993
1011
  return parts;
994
1012
  }
995
- function normalizePath(path16) {
996
- if (typeof path16 === "string") {
997
- return parsePath(path16);
1013
+ function normalizePath(path18) {
1014
+ if (typeof path18 === "string") {
1015
+ return parsePath(path18);
998
1016
  }
999
- if (Array.isArray(path16)) {
1017
+ if (Array.isArray(path18)) {
1000
1018
  const normalized = [];
1001
- for (const [index, segment] of path16.entries()) {
1019
+ for (const [index, segment] of path18.entries()) {
1002
1020
  if (typeof segment !== "string" && typeof segment !== "number") {
1003
1021
  throw new TypeError(`Expected a string or number for path segment at index ${index}, got ${typeof segment}`);
1004
1022
  }
@@ -1018,11 +1036,11 @@ function normalizePath(path16) {
1018
1036
  }
1019
1037
  return [];
1020
1038
  }
1021
- function getProperty(object2, path16, value) {
1022
- if (!isObject(object2) || typeof path16 !== "string" && !Array.isArray(path16)) {
1039
+ function getProperty(object2, path18, value) {
1040
+ if (!isObject(object2) || typeof path18 !== "string" && !Array.isArray(path18)) {
1023
1041
  return value === void 0 ? object2 : value;
1024
1042
  }
1025
- const pathArray = normalizePath(path16);
1043
+ const pathArray = normalizePath(path18);
1026
1044
  if (pathArray.length === 0) {
1027
1045
  return value;
1028
1046
  }
@@ -1038,12 +1056,12 @@ function getProperty(object2, path16, value) {
1038
1056
  }
1039
1057
  return object2 === void 0 ? value : object2;
1040
1058
  }
1041
- function setProperty(object2, path16, value) {
1042
- if (!isObject(object2) || typeof path16 !== "string" && !Array.isArray(path16)) {
1059
+ function setProperty(object2, path18, value) {
1060
+ if (!isObject(object2) || typeof path18 !== "string" && !Array.isArray(path18)) {
1043
1061
  return object2;
1044
1062
  }
1045
1063
  const root = object2;
1046
- const pathArray = normalizePath(path16);
1064
+ const pathArray = normalizePath(path18);
1047
1065
  if (pathArray.length === 0) {
1048
1066
  return object2;
1049
1067
  }
@@ -1060,11 +1078,11 @@ function setProperty(object2, path16, value) {
1060
1078
  }
1061
1079
  return root;
1062
1080
  }
1063
- function deleteProperty(object2, path16) {
1064
- if (!isObject(object2) || typeof path16 !== "string" && !Array.isArray(path16)) {
1081
+ function deleteProperty(object2, path18) {
1082
+ if (!isObject(object2) || typeof path18 !== "string" && !Array.isArray(path18)) {
1065
1083
  return false;
1066
1084
  }
1067
- const pathArray = normalizePath(path16);
1085
+ const pathArray = normalizePath(path18);
1068
1086
  if (pathArray.length === 0) {
1069
1087
  return false;
1070
1088
  }
@@ -1084,11 +1102,11 @@ function deleteProperty(object2, path16) {
1084
1102
  }
1085
1103
  }
1086
1104
  }
1087
- function hasProperty(object2, path16) {
1088
- if (!isObject(object2) || typeof path16 !== "string" && !Array.isArray(path16)) {
1105
+ function hasProperty(object2, path18) {
1106
+ if (!isObject(object2) || typeof path18 !== "string" && !Array.isArray(path18)) {
1089
1107
  return false;
1090
1108
  }
1091
- const pathArray = normalizePath(path16);
1109
+ const pathArray = normalizePath(path18);
1092
1110
  if (pathArray.length === 0) {
1093
1111
  return false;
1094
1112
  }
@@ -1243,7 +1261,7 @@ var init_retryify_async = __esm({
1243
1261
  throw error48;
1244
1262
  const delay3 = Math.round(interval * Math.random());
1245
1263
  if (delay3 > 0) {
1246
- const delayPromise = new Promise((resolve2) => setTimeout(resolve2, delay3));
1264
+ const delayPromise = new Promise((resolve3) => setTimeout(resolve3, delay3));
1247
1265
  return delayPromise.then(() => attempt.apply(void 0, args));
1248
1266
  } else {
1249
1267
  return attempt.apply(void 0, args);
@@ -4659,7 +4677,7 @@ var require_compile = __commonJS({
4659
4677
  const schOrFunc = root.refs[ref];
4660
4678
  if (schOrFunc)
4661
4679
  return schOrFunc;
4662
- let _sch = resolve2.call(this, root, ref);
4680
+ let _sch = resolve3.call(this, root, ref);
4663
4681
  if (_sch === void 0) {
4664
4682
  const schema = (_a2 = root.localRefs) === null || _a2 === void 0 ? void 0 : _a2[ref];
4665
4683
  const { schemaId } = this.opts;
@@ -4686,7 +4704,7 @@ var require_compile = __commonJS({
4686
4704
  function sameSchemaEnv(s1, s2) {
4687
4705
  return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
4688
4706
  }
4689
- function resolve2(root, ref) {
4707
+ function resolve3(root, ref) {
4690
4708
  let sch;
4691
4709
  while (typeof (sch = this.refs[ref]) == "string")
4692
4710
  ref = sch;
@@ -4902,8 +4920,8 @@ var require_utils = __commonJS({
4902
4920
  }
4903
4921
  return ind;
4904
4922
  }
4905
- function removeDotSegments(path16) {
4906
- let input = path16;
4923
+ function removeDotSegments(path18) {
4924
+ let input = path18;
4907
4925
  const output = [];
4908
4926
  let nextSlash = -1;
4909
4927
  let len = 0;
@@ -5102,8 +5120,8 @@ var require_schemes = __commonJS({
5102
5120
  wsComponent.secure = void 0;
5103
5121
  }
5104
5122
  if (wsComponent.resourceName) {
5105
- const [path16, query] = wsComponent.resourceName.split("?");
5106
- wsComponent.path = path16 && path16 !== "/" ? path16 : void 0;
5123
+ const [path18, query] = wsComponent.resourceName.split("?");
5124
+ wsComponent.path = path18 && path18 !== "/" ? path18 : void 0;
5107
5125
  wsComponent.query = query;
5108
5126
  wsComponent.resourceName = void 0;
5109
5127
  }
@@ -5262,7 +5280,7 @@ var require_fast_uri = __commonJS({
5262
5280
  }
5263
5281
  return uri;
5264
5282
  }
5265
- function resolve2(baseURI, relativeURI, options) {
5283
+ function resolve3(baseURI, relativeURI, options) {
5266
5284
  const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
5267
5285
  const resolved = resolveComponent(parse3(baseURI, schemelessOptions), parse3(relativeURI, schemelessOptions), schemelessOptions, true);
5268
5286
  schemelessOptions.skipEscape = true;
@@ -5490,7 +5508,7 @@ var require_fast_uri = __commonJS({
5490
5508
  var fastUri = {
5491
5509
  SCHEMES,
5492
5510
  normalize,
5493
- resolve: resolve2,
5511
+ resolve: resolve3,
5494
5512
  resolveComponent,
5495
5513
  equal,
5496
5514
  serialize,
@@ -9290,12 +9308,12 @@ var require_dist = __commonJS({
9290
9308
  throw new Error(`Unknown format "${name}"`);
9291
9309
  return f;
9292
9310
  };
9293
- function addFormats(ajv, list, fs17, exportName) {
9311
+ function addFormats(ajv, list, fs18, exportName) {
9294
9312
  var _a2;
9295
9313
  var _b;
9296
9314
  (_a2 = (_b = ajv.opts.code).formats) !== null && _a2 !== void 0 ? _a2 : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
9297
9315
  for (const f of list)
9298
- ajv.addFormat(f, fs17[f]);
9316
+ ajv.addFormat(f, fs18[f]);
9299
9317
  }
9300
9318
  module.exports = exports = formatsPlugin;
9301
9319
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -12427,8 +12445,8 @@ var require_req = __commonJS({
12427
12445
  if (req.originalUrl) {
12428
12446
  _req.url = req.originalUrl;
12429
12447
  } else {
12430
- const path16 = req.path;
12431
- _req.url = typeof path16 === "string" ? path16 : req.url ? req.url.path || req.url : void 0;
12448
+ const path18 = req.path;
12449
+ _req.url = typeof path18 === "string" ? path18 : req.url ? req.url.path || req.url : void 0;
12432
12450
  }
12433
12451
  if (req.query) {
12434
12452
  _req.query = req.query;
@@ -12596,14 +12614,14 @@ var require_redact = __commonJS({
12596
12614
  }
12597
12615
  return obj;
12598
12616
  }
12599
- function parsePath2(path16) {
12617
+ function parsePath2(path18) {
12600
12618
  const parts = [];
12601
12619
  let current = "";
12602
12620
  let inBrackets = false;
12603
12621
  let inQuotes = false;
12604
12622
  let quoteChar = "";
12605
- for (let i = 0; i < path16.length; i++) {
12606
- const char = path16[i];
12623
+ for (let i = 0; i < path18.length; i++) {
12624
+ const char = path18[i];
12607
12625
  if (!inBrackets && char === ".") {
12608
12626
  if (current) {
12609
12627
  parts.push(current);
@@ -12734,10 +12752,10 @@ var require_redact = __commonJS({
12734
12752
  return current;
12735
12753
  }
12736
12754
  function redactPaths(obj, paths, censor, remove = false) {
12737
- for (const path16 of paths) {
12738
- const parts = parsePath2(path16);
12755
+ for (const path18 of paths) {
12756
+ const parts = parsePath2(path18);
12739
12757
  if (parts.includes("*")) {
12740
- redactWildcardPath(obj, parts, censor, path16, remove);
12758
+ redactWildcardPath(obj, parts, censor, path18, remove);
12741
12759
  } else {
12742
12760
  if (remove) {
12743
12761
  removeKey(obj, parts);
@@ -12824,8 +12842,8 @@ var require_redact = __commonJS({
12824
12842
  }
12825
12843
  } else {
12826
12844
  if (afterWildcard.includes("*")) {
12827
- const wrappedCensor = typeof censor === "function" ? (value, path16) => {
12828
- const fullPath = [...pathArray.slice(0, pathLength), ...path16];
12845
+ const wrappedCensor = typeof censor === "function" ? (value, path18) => {
12846
+ const fullPath = [...pathArray.slice(0, pathLength), ...path18];
12829
12847
  return censor(value, fullPath);
12830
12848
  } : censor;
12831
12849
  redactWildcardPath(current, afterWildcard, wrappedCensor, originalPath, remove);
@@ -12862,8 +12880,8 @@ var require_redact = __commonJS({
12862
12880
  return null;
12863
12881
  }
12864
12882
  const pathStructure = /* @__PURE__ */ new Map();
12865
- for (const path16 of pathsToClone) {
12866
- const parts = parsePath2(path16);
12883
+ for (const path18 of pathsToClone) {
12884
+ const parts = parsePath2(path18);
12867
12885
  let current = pathStructure;
12868
12886
  for (let i = 0; i < parts.length; i++) {
12869
12887
  const part = parts[i];
@@ -12915,24 +12933,24 @@ var require_redact = __commonJS({
12915
12933
  }
12916
12934
  return cloneSelectively(obj, pathStructure);
12917
12935
  }
12918
- function validatePath(path16) {
12919
- if (typeof path16 !== "string") {
12936
+ function validatePath(path18) {
12937
+ if (typeof path18 !== "string") {
12920
12938
  throw new Error("Paths must be (non-empty) strings");
12921
12939
  }
12922
- if (path16 === "") {
12940
+ if (path18 === "") {
12923
12941
  throw new Error("Invalid redaction path ()");
12924
12942
  }
12925
- if (path16.includes("..")) {
12926
- throw new Error(`Invalid redaction path (${path16})`);
12943
+ if (path18.includes("..")) {
12944
+ throw new Error(`Invalid redaction path (${path18})`);
12927
12945
  }
12928
- if (path16.includes(",")) {
12929
- throw new Error(`Invalid redaction path (${path16})`);
12946
+ if (path18.includes(",")) {
12947
+ throw new Error(`Invalid redaction path (${path18})`);
12930
12948
  }
12931
12949
  let bracketCount = 0;
12932
12950
  let inQuotes = false;
12933
12951
  let quoteChar = "";
12934
- for (let i = 0; i < path16.length; i++) {
12935
- const char = path16[i];
12952
+ for (let i = 0; i < path18.length; i++) {
12953
+ const char = path18[i];
12936
12954
  if ((char === '"' || char === "'") && bracketCount > 0) {
12937
12955
  if (!inQuotes) {
12938
12956
  inQuotes = true;
@@ -12946,20 +12964,20 @@ var require_redact = __commonJS({
12946
12964
  } else if (char === "]" && !inQuotes) {
12947
12965
  bracketCount--;
12948
12966
  if (bracketCount < 0) {
12949
- throw new Error(`Invalid redaction path (${path16})`);
12967
+ throw new Error(`Invalid redaction path (${path18})`);
12950
12968
  }
12951
12969
  }
12952
12970
  }
12953
12971
  if (bracketCount !== 0) {
12954
- throw new Error(`Invalid redaction path (${path16})`);
12972
+ throw new Error(`Invalid redaction path (${path18})`);
12955
12973
  }
12956
12974
  }
12957
12975
  function validatePaths(paths) {
12958
12976
  if (!Array.isArray(paths)) {
12959
12977
  throw new TypeError("paths must be an array");
12960
12978
  }
12961
- for (const path16 of paths) {
12962
- validatePath(path16);
12979
+ for (const path18 of paths) {
12980
+ validatePath(path18);
12963
12981
  }
12964
12982
  }
12965
12983
  function slowRedact(options = {}) {
@@ -13127,8 +13145,8 @@ var require_redaction = __commonJS({
13127
13145
  if (shape[k] === null) {
13128
13146
  o[k] = (value) => topCensor(value, [k]);
13129
13147
  } else {
13130
- const wrappedCensor = typeof censor === "function" ? (value, path16) => {
13131
- return censor(value, [k, ...path16]);
13148
+ const wrappedCensor = typeof censor === "function" ? (value, path18) => {
13149
+ return censor(value, [k, ...path18]);
13132
13150
  } : censor;
13133
13151
  o[k] = Redact({
13134
13152
  paths: shape[k],
@@ -13349,10 +13367,10 @@ var require_atomic_sleep = __commonJS({
13349
13367
  var require_sonic_boom = __commonJS({
13350
13368
  "node_modules/.pnpm/sonic-boom@4.2.1/node_modules/sonic-boom/index.js"(exports, module) {
13351
13369
  "use strict";
13352
- var fs17 = __require("fs");
13370
+ var fs18 = __require("fs");
13353
13371
  var EventEmitter3 = __require("events");
13354
13372
  var inherits = __require("util").inherits;
13355
- var path16 = __require("path");
13373
+ var path18 = __require("path");
13356
13374
  var sleep = require_atomic_sleep();
13357
13375
  var assert3 = __require("assert");
13358
13376
  var BUSY_WRITE_TIMEOUT = 100;
@@ -13407,21 +13425,21 @@ var require_sonic_boom = __commonJS({
13407
13425
  if (sonic.sync) {
13408
13426
  try {
13409
13427
  if (sonic.mkdir)
13410
- fs17.mkdirSync(path16.dirname(file2), { recursive: true });
13411
- const fd = fs17.openSync(file2, flags, mode);
13428
+ fs18.mkdirSync(path18.dirname(file2), { recursive: true });
13429
+ const fd = fs18.openSync(file2, flags, mode);
13412
13430
  fileOpened(null, fd);
13413
13431
  } catch (err) {
13414
13432
  fileOpened(err);
13415
13433
  throw err;
13416
13434
  }
13417
13435
  } else if (sonic.mkdir) {
13418
- fs17.mkdir(path16.dirname(file2), { recursive: true }, (err) => {
13436
+ fs18.mkdir(path18.dirname(file2), { recursive: true }, (err) => {
13419
13437
  if (err)
13420
13438
  return fileOpened(err);
13421
- fs17.open(file2, flags, mode, fileOpened);
13439
+ fs18.open(file2, flags, mode, fileOpened);
13422
13440
  });
13423
13441
  } else {
13424
- fs17.open(file2, flags, mode, fileOpened);
13442
+ fs18.open(file2, flags, mode, fileOpened);
13425
13443
  }
13426
13444
  }
13427
13445
  function SonicBoom(opts) {
@@ -13462,8 +13480,8 @@ var require_sonic_boom = __commonJS({
13462
13480
  this.flush = flushBuffer;
13463
13481
  this.flushSync = flushBufferSync;
13464
13482
  this._actualWrite = actualWriteBuffer;
13465
- fsWriteSync = () => fs17.writeSync(this.fd, this._writingBuf);
13466
- fsWrite = () => fs17.write(this.fd, this._writingBuf, this.release);
13483
+ fsWriteSync = () => fs18.writeSync(this.fd, this._writingBuf);
13484
+ fsWrite = () => fs18.write(this.fd, this._writingBuf, this.release);
13467
13485
  } else if (contentMode === void 0 || contentMode === kContentModeUtf8) {
13468
13486
  this._writingBuf = "";
13469
13487
  this.write = write;
@@ -13472,15 +13490,15 @@ var require_sonic_boom = __commonJS({
13472
13490
  this._actualWrite = actualWrite;
13473
13491
  fsWriteSync = () => {
13474
13492
  if (Buffer.isBuffer(this._writingBuf)) {
13475
- return fs17.writeSync(this.fd, this._writingBuf);
13493
+ return fs18.writeSync(this.fd, this._writingBuf);
13476
13494
  }
13477
- return fs17.writeSync(this.fd, this._writingBuf, "utf8");
13495
+ return fs18.writeSync(this.fd, this._writingBuf, "utf8");
13478
13496
  };
13479
13497
  fsWrite = () => {
13480
13498
  if (Buffer.isBuffer(this._writingBuf)) {
13481
- return fs17.write(this.fd, this._writingBuf, this.release);
13499
+ return fs18.write(this.fd, this._writingBuf, this.release);
13482
13500
  }
13483
- return fs17.write(this.fd, this._writingBuf, "utf8", this.release);
13501
+ return fs18.write(this.fd, this._writingBuf, "utf8", this.release);
13484
13502
  };
13485
13503
  } else {
13486
13504
  throw new Error(`SonicBoom supports "${kContentModeUtf8}" and "${kContentModeBuffer}", but passed ${contentMode}`);
@@ -13537,7 +13555,7 @@ var require_sonic_boom = __commonJS({
13537
13555
  }
13538
13556
  }
13539
13557
  if (this._fsync) {
13540
- fs17.fsyncSync(this.fd);
13558
+ fs18.fsyncSync(this.fd);
13541
13559
  }
13542
13560
  const len = this._len;
13543
13561
  if (this._reopening) {
@@ -13652,7 +13670,7 @@ var require_sonic_boom = __commonJS({
13652
13670
  const onDrain = () => {
13653
13671
  if (!this._fsync) {
13654
13672
  try {
13655
- fs17.fsync(this.fd, (err) => {
13673
+ fs18.fsync(this.fd, (err) => {
13656
13674
  this._flushPending = false;
13657
13675
  cb(err);
13658
13676
  });
@@ -13754,7 +13772,7 @@ var require_sonic_boom = __commonJS({
13754
13772
  const fd = this.fd;
13755
13773
  this.once("ready", () => {
13756
13774
  if (fd !== this.fd) {
13757
- fs17.close(fd, (err) => {
13775
+ fs18.close(fd, (err) => {
13758
13776
  if (err) {
13759
13777
  return this.emit("error", err);
13760
13778
  }
@@ -13803,7 +13821,7 @@ var require_sonic_boom = __commonJS({
13803
13821
  buf = this._bufs[0];
13804
13822
  }
13805
13823
  try {
13806
- const n = Buffer.isBuffer(buf) ? fs17.writeSync(this.fd, buf) : fs17.writeSync(this.fd, buf, "utf8");
13824
+ const n = Buffer.isBuffer(buf) ? fs18.writeSync(this.fd, buf) : fs18.writeSync(this.fd, buf, "utf8");
13807
13825
  const releasedBufObj = releaseWritingBuf(buf, this._len, n);
13808
13826
  buf = releasedBufObj.writingBuf;
13809
13827
  this._len = releasedBufObj.len;
@@ -13819,7 +13837,7 @@ var require_sonic_boom = __commonJS({
13819
13837
  }
13820
13838
  }
13821
13839
  try {
13822
- fs17.fsyncSync(this.fd);
13840
+ fs18.fsyncSync(this.fd);
13823
13841
  } catch {
13824
13842
  }
13825
13843
  }
@@ -13840,7 +13858,7 @@ var require_sonic_boom = __commonJS({
13840
13858
  buf = mergeBuf(this._bufs[0], this._lens[0]);
13841
13859
  }
13842
13860
  try {
13843
- const n = fs17.writeSync(this.fd, buf);
13861
+ const n = fs18.writeSync(this.fd, buf);
13844
13862
  buf = buf.subarray(n);
13845
13863
  this._len = Math.max(this._len - n, 0);
13846
13864
  if (buf.length <= 0) {
@@ -13868,13 +13886,13 @@ var require_sonic_boom = __commonJS({
13868
13886
  this._writingBuf = this._writingBuf.length ? this._writingBuf : this._bufs.shift() || "";
13869
13887
  if (this.sync) {
13870
13888
  try {
13871
- const written = Buffer.isBuffer(this._writingBuf) ? fs17.writeSync(this.fd, this._writingBuf) : fs17.writeSync(this.fd, this._writingBuf, "utf8");
13889
+ const written = Buffer.isBuffer(this._writingBuf) ? fs18.writeSync(this.fd, this._writingBuf) : fs18.writeSync(this.fd, this._writingBuf, "utf8");
13872
13890
  release(null, written);
13873
13891
  } catch (err) {
13874
13892
  release(err);
13875
13893
  }
13876
13894
  } else {
13877
- fs17.write(this.fd, this._writingBuf, release);
13895
+ fs18.write(this.fd, this._writingBuf, release);
13878
13896
  }
13879
13897
  }
13880
13898
  function actualWriteBuffer() {
@@ -13883,7 +13901,7 @@ var require_sonic_boom = __commonJS({
13883
13901
  this._writingBuf = this._writingBuf.length ? this._writingBuf : mergeBuf(this._bufs.shift(), this._lens.shift());
13884
13902
  if (this.sync) {
13885
13903
  try {
13886
- const written = fs17.writeSync(this.fd, this._writingBuf);
13904
+ const written = fs18.writeSync(this.fd, this._writingBuf);
13887
13905
  release(null, written);
13888
13906
  } catch (err) {
13889
13907
  release(err);
@@ -13892,7 +13910,7 @@ var require_sonic_boom = __commonJS({
13892
13910
  if (kCopyBuffer) {
13893
13911
  this._writingBuf = Buffer.from(this._writingBuf);
13894
13912
  }
13895
- fs17.write(this.fd, this._writingBuf, release);
13913
+ fs18.write(this.fd, this._writingBuf, release);
13896
13914
  }
13897
13915
  }
13898
13916
  function actualClose(sonic) {
@@ -13908,12 +13926,12 @@ var require_sonic_boom = __commonJS({
13908
13926
  sonic._lens = [];
13909
13927
  assert3(typeof sonic.fd === "number", `sonic.fd must be a number, got ${typeof sonic.fd}`);
13910
13928
  try {
13911
- fs17.fsync(sonic.fd, closeWrapped);
13929
+ fs18.fsync(sonic.fd, closeWrapped);
13912
13930
  } catch {
13913
13931
  }
13914
13932
  function closeWrapped() {
13915
13933
  if (sonic.fd !== 1 && sonic.fd !== 2) {
13916
- fs17.close(sonic.fd, done);
13934
+ fs18.close(sonic.fd, done);
13917
13935
  } else {
13918
13936
  done();
13919
13937
  }
@@ -14651,15 +14669,15 @@ var require_transport = __commonJS({
14651
14669
  if (!unquoted) {
14652
14670
  return false;
14653
14671
  }
14654
- let path16 = unquoted;
14655
- if (path16.startsWith("file://")) {
14672
+ let path18 = unquoted;
14673
+ if (path18.startsWith("file://")) {
14656
14674
  try {
14657
- path16 = fileURLToPath3(path16);
14675
+ path18 = fileURLToPath3(path18);
14658
14676
  } catch {
14659
14677
  return false;
14660
14678
  }
14661
14679
  }
14662
- return isAbsolute(path16) && !existsSync8(path16);
14680
+ return isAbsolute(path18) && !existsSync8(path18);
14663
14681
  }
14664
14682
  function stripQuotes(value) {
14665
14683
  const first = value[0];
@@ -16965,20 +16983,20 @@ function removeTrailingSlashes(str) {
16965
16983
  i--;
16966
16984
  return str.slice(0, i);
16967
16985
  }
16968
- function resolveUrl(backendURL, path16) {
16986
+ function resolveUrl(backendURL, path18) {
16969
16987
  if (ABSOLUTE_URL_REGEX.test(backendURL)) {
16970
16988
  const backendURLObj = new URL(backendURL);
16971
16989
  const basePath = removeTrailingSlashes(backendURLObj.pathname);
16972
- const cleanPath2 = path16.replace(constants_LEADING_SLASHES_REGEX, "");
16990
+ const cleanPath2 = path18.replace(constants_LEADING_SLASHES_REGEX, "");
16973
16991
  const newPath = `${basePath}/${cleanPath2}`;
16974
16992
  backendURLObj.pathname = newPath;
16975
16993
  return backendURLObj.toString();
16976
16994
  }
16977
16995
  const cleanBase = removeTrailingSlashes(backendURL);
16978
- const cleanPath = path16.replace(constants_LEADING_SLASHES_REGEX, "");
16996
+ const cleanPath = path18.replace(constants_LEADING_SLASHES_REGEX, "");
16979
16997
  return `${cleanBase}/${cleanPath}`;
16980
16998
  }
16981
- async function fetcher(context, path16, options) {
16999
+ async function fetcher(context, path18, options) {
16982
17000
  const finalRetryConfig = {
16983
17001
  ...context.retryConfig,
16984
17002
  ...options?.retryConfig || {},
@@ -16992,7 +17010,7 @@ async function fetcher(context, path16, options) {
16992
17010
  while (attemptsMade <= (maxRetries ?? 0)) {
16993
17011
  const requestId = generateUUID();
16994
17012
  const fetchImpl = context.customFetch || globalThis.fetch;
16995
- const resolvedUrl = resolveUrl(context.backendURL, path16);
17013
+ const resolvedUrl = resolveUrl(context.backendURL, path18);
16996
17014
  let url2;
16997
17015
  try {
16998
17016
  url2 = new URL(resolvedUrl);
@@ -17037,7 +17055,7 @@ async function fetcher(context, path16, options) {
17037
17055
  code: "PARSE_ERROR",
17038
17056
  cause: parseError
17039
17057
  }, response);
17040
- options?.onError?.(errorResponse2, path16);
17058
+ options?.onError?.(errorResponse2, path18);
17041
17059
  if (options?.throw)
17042
17060
  throw new Error("Failed to parse response");
17043
17061
  return errorResponse2;
@@ -17058,7 +17076,7 @@ async function fetcher(context, path16, options) {
17058
17076
  lastErrorResponse = errorResponse;
17059
17077
  let shouldRetryThisRequest = false;
17060
17078
  if (nonRetryableStatusCodes?.includes(response.status)) {
17061
- getDebugLogger().debug(`Not retrying request to ${path16} with status ${response.status} (nonRetryableStatusCodes)`);
17079
+ getDebugLogger().debug(`Not retrying request to ${path18} with status ${response.status} (nonRetryableStatusCodes)`);
17062
17080
  shouldRetryThisRequest = false;
17063
17081
  } else if ("function" == typeof finalRetryConfig.shouldRetry)
17064
17082
  try {
@@ -17067,17 +17085,17 @@ async function fetcher(context, path16, options) {
17067
17085
  url: url2.toString(),
17068
17086
  method: requestOptions.method || "GET"
17069
17087
  });
17070
- getDebugLogger().debug(`Custom retry strategy for ${path16} with status ${response.status}: ${shouldRetryThisRequest}`);
17088
+ getDebugLogger().debug(`Custom retry strategy for ${path18} with status ${response.status}: ${shouldRetryThisRequest}`);
17071
17089
  } catch {
17072
17090
  shouldRetryThisRequest = retryableStatusCodes?.includes(response.status) ?? false;
17073
17091
  getDebugLogger().debug(`Custom retry strategy failed, falling back to status code check: ${shouldRetryThisRequest}`);
17074
17092
  }
17075
17093
  else {
17076
17094
  shouldRetryThisRequest = retryableStatusCodes?.includes(response.status) ?? false;
17077
- getDebugLogger().debug(`Standard retry check for ${path16} with status ${response.status}: ${shouldRetryThisRequest}`);
17095
+ getDebugLogger().debug(`Standard retry check for ${path18} with status ${response.status}: ${shouldRetryThisRequest}`);
17078
17096
  }
17079
17097
  if (!shouldRetryThisRequest || attemptsMade >= (maxRetries ?? 0)) {
17080
- options?.onError?.(errorResponse, path16);
17098
+ options?.onError?.(errorResponse, path18);
17081
17099
  if (options?.throw)
17082
17100
  throw new Error(errorResponse.error?.message || "Request failed");
17083
17101
  return errorResponse;
@@ -17098,7 +17116,7 @@ async function fetcher(context, path16, options) {
17098
17116
  lastErrorResponse = errorResponse;
17099
17117
  const shouldRetryThisRequest = isNetworkError && retryOnNetworkError;
17100
17118
  if (!shouldRetryThisRequest || attemptsMade >= (maxRetries ?? 0)) {
17101
- options?.onError?.(errorResponse, path16);
17119
+ options?.onError?.(errorResponse, path18);
17102
17120
  if (options?.throw)
17103
17121
  throw fetchError;
17104
17122
  return errorResponse;
@@ -17113,7 +17131,7 @@ async function fetcher(context, path16, options) {
17113
17131
  status: 0,
17114
17132
  code: "MAX_RETRIES_EXCEEDED"
17115
17133
  }, null);
17116
- options?.onError?.(maxRetriesErrorResponse, path16);
17134
+ options?.onError?.(maxRetriesErrorResponse, path18);
17117
17135
  if (options?.throw)
17118
17136
  throw new Error(`Request failed after ${maxRetries} retries`);
17119
17137
  return maxRetriesErrorResponse;
@@ -17606,9 +17624,9 @@ async function identifyUser(context, storageConfig, options) {
17606
17624
  identityProvider: body.identityProvider
17607
17625
  }
17608
17626
  }, void 0, storageConfig);
17609
- const path16 = `${API_ENDPOINTS.PATCH_SUBJECT}/${subjectId}`;
17627
+ const path18 = `${API_ENDPOINTS.PATCH_SUBJECT}/${subjectId}`;
17610
17628
  const { subjectId: _subjectId, id: _legacySubjectId, ...patchBody } = body;
17611
- return withFallback(context, path16, "PATCH", {
17629
+ return withFallback(context, path18, "PATCH", {
17612
17630
  ...restOptions,
17613
17631
  body: patchBody
17614
17632
  }, async (fallbackOptions) => {
@@ -17817,9 +17835,9 @@ async function processPendingIdentifySubmissions(context, submissions) {
17817
17835
  }
17818
17836
  try {
17819
17837
  getDebugLogger().log("Retrying identify user submission:", submission);
17820
- const path16 = `${API_ENDPOINTS.PATCH_SUBJECT}/${subjectId}`;
17838
+ const path18 = `${API_ENDPOINTS.PATCH_SUBJECT}/${subjectId}`;
17821
17839
  const { subjectId: _subjectId, id: _legacySubjectId, ...patchBody } = submission;
17822
- const response = await fetcher(context, path16, {
17840
+ const response = await fetcher(context, path18, {
17823
17841
  method: "PATCH",
17824
17842
  body: patchBody
17825
17843
  });
@@ -17983,7 +18001,7 @@ var init_dist5 = __esm({
17983
18001
  noop = () => {
17984
18002
  };
17985
18003
  _debugLogger = createDebugLogger(false);
17986
- delay = (ms) => new Promise((resolve2) => setTimeout(resolve2, ms));
18004
+ delay = (ms) => new Promise((resolve3) => setTimeout(resolve3, ms));
17987
18005
  fetcher_createResponseContext = createResponseContext;
17988
18006
  COOKIE_KEY_MAP = {
17989
18007
  consents: "c",
@@ -18160,8 +18178,8 @@ var init_dist5 = __esm({
18160
18178
  async identifyUser(options) {
18161
18179
  return identifyUser(this.fetcherContext, this.storageConfig, options);
18162
18180
  }
18163
- async $fetch(path16, options) {
18164
- return fetcher(this.fetcherContext, path16, options);
18181
+ async $fetch(path18, options) {
18182
+ return fetcher(this.fetcherContext, path18, options);
18165
18183
  }
18166
18184
  checkPendingConsentSubmissions() {
18167
18185
  checkPendingConsentSubmissions(this.fetcherContext, (submissions) => this.processPendingConsentSubmissions(submissions));
@@ -18434,10 +18452,10 @@ function mergeDefs(...defs) {
18434
18452
  function cloneDef(schema) {
18435
18453
  return mergeDefs(schema._zod.def);
18436
18454
  }
18437
- function getElementAtPath(obj, path16) {
18438
- if (!path16)
18455
+ function getElementAtPath(obj, path18) {
18456
+ if (!path18)
18439
18457
  return obj;
18440
- return path16.reduce((acc, key) => acc?.[key], obj);
18458
+ return path18.reduce((acc, key) => acc?.[key], obj);
18441
18459
  }
18442
18460
  function promiseAllObject(promisesObj) {
18443
18461
  const keys = Object.keys(promisesObj);
@@ -18749,11 +18767,11 @@ function aborted(x, startIndex = 0) {
18749
18767
  }
18750
18768
  return false;
18751
18769
  }
18752
- function prefixIssues(path16, issues) {
18770
+ function prefixIssues(path18, issues) {
18753
18771
  return issues.map((iss) => {
18754
18772
  var _a2;
18755
18773
  (_a2 = iss).path ?? (_a2.path = []);
18756
- iss.path.unshift(path16);
18774
+ iss.path.unshift(path18);
18757
18775
  return iss;
18758
18776
  });
18759
18777
  }
@@ -18996,7 +19014,7 @@ function formatError(error48, mapper = (issue2) => issue2.message) {
18996
19014
  }
18997
19015
  function treeifyError(error48, mapper = (issue2) => issue2.message) {
18998
19016
  const result = { errors: [] };
18999
- const processError = (error49, path16 = []) => {
19017
+ const processError = (error49, path18 = []) => {
19000
19018
  var _a2, _b;
19001
19019
  for (const issue2 of error49.issues) {
19002
19020
  if (issue2.code === "invalid_union" && issue2.errors.length) {
@@ -19006,7 +19024,7 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
19006
19024
  } else if (issue2.code === "invalid_element") {
19007
19025
  processError({ issues: issue2.issues }, issue2.path);
19008
19026
  } else {
19009
- const fullpath = [...path16, ...issue2.path];
19027
+ const fullpath = [...path18, ...issue2.path];
19010
19028
  if (fullpath.length === 0) {
19011
19029
  result.errors.push(mapper(issue2));
19012
19030
  continue;
@@ -19038,8 +19056,8 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
19038
19056
  }
19039
19057
  function toDotPath(_path) {
19040
19058
  const segs = [];
19041
- const path16 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
19042
- for (const seg of path16) {
19059
+ const path18 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
19060
+ for (const seg of path18) {
19043
19061
  if (typeof seg === "number")
19044
19062
  segs.push(`[${seg}]`);
19045
19063
  else if (typeof seg === "symbol")
@@ -31802,13 +31820,13 @@ function resolveRef(ref, ctx) {
31802
31820
  if (!ref.startsWith("#")) {
31803
31821
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
31804
31822
  }
31805
- const path16 = ref.slice(1).split("/").filter(Boolean);
31806
- if (path16.length === 0) {
31823
+ const path18 = ref.slice(1).split("/").filter(Boolean);
31824
+ if (path18.length === 0) {
31807
31825
  return ctx.rootSchema;
31808
31826
  }
31809
31827
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
31810
- if (path16[0] === defsKey) {
31811
- const key = path16[1];
31828
+ if (path18[0] === defsKey) {
31829
+ const key = path18[1];
31812
31830
  if (!key || !ctx.defs[key]) {
31813
31831
  throw new Error(`Reference not found: ${ref}`);
31814
31832
  }
@@ -33771,14 +33789,14 @@ var require_react_development = __commonJS({
33771
33789
  );
33772
33790
  actScopeDepth = prevActScopeDepth;
33773
33791
  }
33774
- function recursivelyFlushAsyncActWork(returnValue, resolve2, reject) {
33792
+ function recursivelyFlushAsyncActWork(returnValue, resolve3, reject) {
33775
33793
  var queue = ReactSharedInternals.actQueue;
33776
33794
  if (null !== queue)
33777
33795
  if (0 !== queue.length)
33778
33796
  try {
33779
33797
  flushActQueue(queue);
33780
33798
  enqueueTask(function() {
33781
- return recursivelyFlushAsyncActWork(returnValue, resolve2, reject);
33799
+ return recursivelyFlushAsyncActWork(returnValue, resolve3, reject);
33782
33800
  });
33783
33801
  return;
33784
33802
  } catch (error48) {
@@ -33786,7 +33804,7 @@ var require_react_development = __commonJS({
33786
33804
  }
33787
33805
  else
33788
33806
  ReactSharedInternals.actQueue = null;
33789
- 0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve2(returnValue);
33807
+ 0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve3(returnValue);
33790
33808
  }
33791
33809
  function flushActQueue(queue) {
33792
33810
  if (!isFlushing) {
@@ -33975,7 +33993,7 @@ var require_react_development = __commonJS({
33975
33993
  ));
33976
33994
  });
33977
33995
  return {
33978
- then: function(resolve2, reject) {
33996
+ then: function(resolve3, reject) {
33979
33997
  didAwaitActCall = true;
33980
33998
  thenable.then(
33981
33999
  function(returnValue) {
@@ -33985,7 +34003,7 @@ var require_react_development = __commonJS({
33985
34003
  flushActQueue(queue), enqueueTask(function() {
33986
34004
  return recursivelyFlushAsyncActWork(
33987
34005
  returnValue,
33988
- resolve2,
34006
+ resolve3,
33989
34007
  reject
33990
34008
  );
33991
34009
  });
@@ -34000,7 +34018,7 @@ var require_react_development = __commonJS({
34000
34018
  reject(_thrownError);
34001
34019
  }
34002
34020
  } else
34003
- resolve2(returnValue);
34021
+ resolve3(returnValue);
34004
34022
  },
34005
34023
  function(error48) {
34006
34024
  popActScope(prevActQueue, prevActScopeDepth);
@@ -34022,15 +34040,15 @@ var require_react_development = __commonJS({
34022
34040
  if (0 < ReactSharedInternals.thrownErrors.length)
34023
34041
  throw callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
34024
34042
  return {
34025
- then: function(resolve2, reject) {
34043
+ then: function(resolve3, reject) {
34026
34044
  didAwaitActCall = true;
34027
34045
  0 === prevActScopeDepth ? (ReactSharedInternals.actQueue = queue, enqueueTask(function() {
34028
34046
  return recursivelyFlushAsyncActWork(
34029
34047
  returnValue$jscomp$0,
34030
- resolve2,
34048
+ resolve3,
34031
34049
  reject
34032
34050
  );
34033
- })) : resolve2(returnValue$jscomp$0);
34051
+ })) : resolve3(returnValue$jscomp$0);
34034
34052
  }
34035
34053
  };
34036
34054
  };
@@ -38916,8 +38934,8 @@ var require_react_reconciler_production = __commonJS({
38916
38934
  currentEntangledActionThenable = {
38917
38935
  status: "pending",
38918
38936
  value: void 0,
38919
- then: function(resolve2) {
38920
- entangledListeners.push(resolve2);
38937
+ then: function(resolve3) {
38938
+ entangledListeners.push(resolve3);
38921
38939
  }
38922
38940
  };
38923
38941
  }
@@ -38941,8 +38959,8 @@ var require_react_reconciler_production = __commonJS({
38941
38959
  status: "pending",
38942
38960
  value: null,
38943
38961
  reason: null,
38944
- then: function(resolve2) {
38945
- listeners.push(resolve2);
38962
+ then: function(resolve3) {
38963
+ listeners.push(resolve3);
38946
38964
  }
38947
38965
  };
38948
38966
  thenable.then(
@@ -46224,11 +46242,11 @@ var require_react_reconciler_development = __commonJS({
46224
46242
  fiber = fiber.next, id--;
46225
46243
  return fiber;
46226
46244
  }
46227
- function copyWithSetImpl(obj, path16, index, value) {
46228
- if (index >= path16.length)
46245
+ function copyWithSetImpl(obj, path18, index, value) {
46246
+ if (index >= path18.length)
46229
46247
  return value;
46230
- var key = path16[index], updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj);
46231
- updated[key] = copyWithSetImpl(obj[key], path16, index + 1, value);
46248
+ var key = path18[index], updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj);
46249
+ updated[key] = copyWithSetImpl(obj[key], path18, index + 1, value);
46232
46250
  return updated;
46233
46251
  }
46234
46252
  function copyWithRename(obj, oldPath, newPath) {
@@ -46255,11 +46273,11 @@ var require_react_reconciler_development = __commonJS({
46255
46273
  );
46256
46274
  return updated;
46257
46275
  }
46258
- function copyWithDeleteImpl(obj, path16, index) {
46259
- var key = path16[index], updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj);
46260
- if (index + 1 === path16.length)
46276
+ function copyWithDeleteImpl(obj, path18, index) {
46277
+ var key = path18[index], updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj);
46278
+ if (index + 1 === path18.length)
46261
46279
  return isArrayImpl(updated) ? updated.splice(key, 1) : delete updated[key], updated;
46262
- updated[key] = copyWithDeleteImpl(obj[key], path16, index + 1);
46280
+ updated[key] = copyWithDeleteImpl(obj[key], path18, index + 1);
46263
46281
  return updated;
46264
46282
  }
46265
46283
  function shouldSuspendImpl() {
@@ -48705,8 +48723,8 @@ var require_react_reconciler_development = __commonJS({
48705
48723
  currentEntangledActionThenable = {
48706
48724
  status: "pending",
48707
48725
  value: void 0,
48708
- then: function(resolve2) {
48709
- entangledListeners.push(resolve2);
48726
+ then: function(resolve3) {
48727
+ entangledListeners.push(resolve3);
48710
48728
  }
48711
48729
  };
48712
48730
  }
@@ -48730,8 +48748,8 @@ var require_react_reconciler_development = __commonJS({
48730
48748
  status: "pending",
48731
48749
  value: null,
48732
48750
  reason: null,
48733
- then: function(resolve2) {
48734
- listeners.push(resolve2);
48751
+ then: function(resolve3) {
48752
+ listeners.push(resolve3);
48735
48753
  }
48736
48754
  };
48737
48755
  thenable.then(
@@ -59685,29 +59703,29 @@ var require_react_reconciler_development = __commonJS({
59685
59703
  var didWarnAboutNestedUpdates = false;
59686
59704
  var didWarnAboutFindNodeInStrictMode = {};
59687
59705
  var overrideHookState = null, overrideHookStateDeletePath = null, overrideHookStateRenamePath = null, overrideProps = null, overridePropsDeletePath = null, overridePropsRenamePath = null, scheduleUpdate = null, scheduleRetry = null, setErrorHandler = null, setSuspenseHandler = null;
59688
- overrideHookState = function(fiber, id, path16, value) {
59706
+ overrideHookState = function(fiber, id, path18, value) {
59689
59707
  id = findHook(fiber, id);
59690
- null !== id && (path16 = copyWithSetImpl(id.memoizedState, path16, 0, value), id.memoizedState = path16, id.baseState = path16, fiber.memoizedProps = assign({}, fiber.memoizedProps), path16 = enqueueConcurrentRenderForLane(fiber, 2), null !== path16 && scheduleUpdateOnFiber(path16, fiber, 2));
59708
+ null !== id && (path18 = copyWithSetImpl(id.memoizedState, path18, 0, value), id.memoizedState = path18, id.baseState = path18, fiber.memoizedProps = assign({}, fiber.memoizedProps), path18 = enqueueConcurrentRenderForLane(fiber, 2), null !== path18 && scheduleUpdateOnFiber(path18, fiber, 2));
59691
59709
  };
59692
- overrideHookStateDeletePath = function(fiber, id, path16) {
59710
+ overrideHookStateDeletePath = function(fiber, id, path18) {
59693
59711
  id = findHook(fiber, id);
59694
- null !== id && (path16 = copyWithDeleteImpl(id.memoizedState, path16, 0), id.memoizedState = path16, id.baseState = path16, fiber.memoizedProps = assign({}, fiber.memoizedProps), path16 = enqueueConcurrentRenderForLane(fiber, 2), null !== path16 && scheduleUpdateOnFiber(path16, fiber, 2));
59712
+ null !== id && (path18 = copyWithDeleteImpl(id.memoizedState, path18, 0), id.memoizedState = path18, id.baseState = path18, fiber.memoizedProps = assign({}, fiber.memoizedProps), path18 = enqueueConcurrentRenderForLane(fiber, 2), null !== path18 && scheduleUpdateOnFiber(path18, fiber, 2));
59695
59713
  };
59696
59714
  overrideHookStateRenamePath = function(fiber, id, oldPath, newPath) {
59697
59715
  id = findHook(fiber, id);
59698
59716
  null !== id && (oldPath = copyWithRename(id.memoizedState, oldPath, newPath), id.memoizedState = oldPath, id.baseState = oldPath, fiber.memoizedProps = assign({}, fiber.memoizedProps), oldPath = enqueueConcurrentRenderForLane(fiber, 2), null !== oldPath && scheduleUpdateOnFiber(oldPath, fiber, 2));
59699
59717
  };
59700
- overrideProps = function(fiber, path16, value) {
59701
- fiber.pendingProps = copyWithSetImpl(fiber.memoizedProps, path16, 0, value);
59718
+ overrideProps = function(fiber, path18, value) {
59719
+ fiber.pendingProps = copyWithSetImpl(fiber.memoizedProps, path18, 0, value);
59702
59720
  fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps);
59703
- path16 = enqueueConcurrentRenderForLane(fiber, 2);
59704
- null !== path16 && scheduleUpdateOnFiber(path16, fiber, 2);
59721
+ path18 = enqueueConcurrentRenderForLane(fiber, 2);
59722
+ null !== path18 && scheduleUpdateOnFiber(path18, fiber, 2);
59705
59723
  };
59706
- overridePropsDeletePath = function(fiber, path16) {
59707
- fiber.pendingProps = copyWithDeleteImpl(fiber.memoizedProps, path16, 0);
59724
+ overridePropsDeletePath = function(fiber, path18) {
59725
+ fiber.pendingProps = copyWithDeleteImpl(fiber.memoizedProps, path18, 0);
59708
59726
  fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps);
59709
- path16 = enqueueConcurrentRenderForLane(fiber, 2);
59710
- null !== path16 && scheduleUpdateOnFiber(path16, fiber, 2);
59727
+ path18 = enqueueConcurrentRenderForLane(fiber, 2);
59728
+ null !== path18 && scheduleUpdateOnFiber(path18, fiber, 2);
59711
59729
  };
59712
59730
  overridePropsRenamePath = function(fiber, oldPath, newPath) {
59713
59731
  fiber.pendingProps = copyWithRename(
@@ -66183,7 +66201,7 @@ var require_backend = __commonJS({
66183
66201
  return [initialArg, function() {
66184
66202
  }];
66185
66203
  },
66186
- useRef: function useRef9(initialValue) {
66204
+ useRef: function useRef10(initialValue) {
66187
66205
  var hook = nextHook();
66188
66206
  initialValue = null !== hook ? hook.memoizedState : {
66189
66207
  current: initialValue
@@ -66198,7 +66216,7 @@ var require_backend = __commonJS({
66198
66216
  });
66199
66217
  return initialValue;
66200
66218
  },
66201
- useState: function useState14(initialState) {
66219
+ useState: function useState15(initialState) {
66202
66220
  var hook = nextHook();
66203
66221
  initialState = null !== hook ? hook.memoizedState : "function" === typeof initialState ? initialState() : initialState;
66204
66222
  hookLog.push({
@@ -69699,8 +69717,8 @@ var require_backend = __commonJS({
69699
69717
  }
69700
69718
  return false;
69701
69719
  }
69702
- function utils_getInObject(object2, path16) {
69703
- return path16.reduce(function(reduced, attr) {
69720
+ function utils_getInObject(object2, path18) {
69721
+ return path18.reduce(function(reduced, attr) {
69704
69722
  if (reduced) {
69705
69723
  if (utils_hasOwnProperty.call(reduced, attr)) {
69706
69724
  return reduced[attr];
@@ -69712,11 +69730,11 @@ var require_backend = __commonJS({
69712
69730
  return null;
69713
69731
  }, object2);
69714
69732
  }
69715
- function deletePathInObject(object2, path16) {
69716
- var length = path16.length;
69717
- var last = path16[length - 1];
69733
+ function deletePathInObject(object2, path18) {
69734
+ var length = path18.length;
69735
+ var last = path18[length - 1];
69718
69736
  if (object2 != null) {
69719
- var parent = utils_getInObject(object2, path16.slice(0, length - 1));
69737
+ var parent = utils_getInObject(object2, path18.slice(0, length - 1));
69720
69738
  if (parent) {
69721
69739
  if (src_isArray(parent)) {
69722
69740
  parent.splice(last, 1);
@@ -69742,11 +69760,11 @@ var require_backend = __commonJS({
69742
69760
  }
69743
69761
  }
69744
69762
  }
69745
- function utils_setInObject(object2, path16, value) {
69746
- var length = path16.length;
69747
- var last = path16[length - 1];
69763
+ function utils_setInObject(object2, path18, value) {
69764
+ var length = path18.length;
69765
+ var last = path18[length - 1];
69748
69766
  if (object2 != null) {
69749
- var parent = utils_getInObject(object2, path16.slice(0, length - 1));
69767
+ var parent = utils_getInObject(object2, path18.slice(0, length - 1));
69750
69768
  if (parent) {
69751
69769
  parent[last] = value;
69752
69770
  }
@@ -70282,8 +70300,8 @@ var require_backend = __commonJS({
70282
70300
  unserializable: Symbol("unserializable")
70283
70301
  };
70284
70302
  var LEVEL_THRESHOLD = 2;
70285
- function createDehydrated(type, inspectable, data, cleaned, path16) {
70286
- cleaned.push(path16);
70303
+ function createDehydrated(type, inspectable, data, cleaned, path18) {
70304
+ cleaned.push(path18);
70287
70305
  var dehydrated = {
70288
70306
  inspectable,
70289
70307
  type,
@@ -70301,13 +70319,13 @@ var require_backend = __commonJS({
70301
70319
  }
70302
70320
  return dehydrated;
70303
70321
  }
70304
- function dehydrate(data, cleaned, unserializable, path16, isPathAllowed) {
70322
+ function dehydrate(data, cleaned, unserializable, path18, isPathAllowed) {
70305
70323
  var level = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : 0;
70306
70324
  var type = getDataType(data);
70307
70325
  var isPathAllowedCheck;
70308
70326
  switch (type) {
70309
70327
  case "html_element":
70310
- cleaned.push(path16);
70328
+ cleaned.push(path18);
70311
70329
  return {
70312
70330
  inspectable: false,
70313
70331
  preview_short: formatDataForPreview(data, false),
@@ -70316,7 +70334,7 @@ var require_backend = __commonJS({
70316
70334
  type
70317
70335
  };
70318
70336
  case "function":
70319
- cleaned.push(path16);
70337
+ cleaned.push(path18);
70320
70338
  return {
70321
70339
  inspectable: false,
70322
70340
  preview_short: formatDataForPreview(data, false),
@@ -70325,14 +70343,14 @@ var require_backend = __commonJS({
70325
70343
  type
70326
70344
  };
70327
70345
  case "string":
70328
- isPathAllowedCheck = isPathAllowed(path16);
70346
+ isPathAllowedCheck = isPathAllowed(path18);
70329
70347
  if (isPathAllowedCheck) {
70330
70348
  return data;
70331
70349
  } else {
70332
70350
  return data.length <= 500 ? data : data.slice(0, 500) + "...";
70333
70351
  }
70334
70352
  case "bigint":
70335
- cleaned.push(path16);
70353
+ cleaned.push(path18);
70336
70354
  return {
70337
70355
  inspectable: false,
70338
70356
  preview_short: formatDataForPreview(data, false),
@@ -70341,7 +70359,7 @@ var require_backend = __commonJS({
70341
70359
  type
70342
70360
  };
70343
70361
  case "symbol":
70344
- cleaned.push(path16);
70362
+ cleaned.push(path18);
70345
70363
  return {
70346
70364
  inspectable: false,
70347
70365
  preview_short: formatDataForPreview(data, false),
@@ -70350,9 +70368,9 @@ var require_backend = __commonJS({
70350
70368
  type
70351
70369
  };
70352
70370
  case "react_element": {
70353
- isPathAllowedCheck = isPathAllowed(path16);
70371
+ isPathAllowedCheck = isPathAllowed(path18);
70354
70372
  if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
70355
- cleaned.push(path16);
70373
+ cleaned.push(path18);
70356
70374
  return {
70357
70375
  inspectable: true,
70358
70376
  preview_short: formatDataForPreview(data, false),
@@ -70369,19 +70387,19 @@ var require_backend = __commonJS({
70369
70387
  preview_long: formatDataForPreview(data, true),
70370
70388
  name: getDisplayNameForReactElement(data) || "Unknown"
70371
70389
  };
70372
- unserializableValue.key = dehydrate(data.key, cleaned, unserializable, path16.concat(["key"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
70390
+ unserializableValue.key = dehydrate(data.key, cleaned, unserializable, path18.concat(["key"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
70373
70391
  if (data.$$typeof === REACT_LEGACY_ELEMENT_TYPE) {
70374
- unserializableValue.ref = dehydrate(data.ref, cleaned, unserializable, path16.concat(["ref"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
70392
+ unserializableValue.ref = dehydrate(data.ref, cleaned, unserializable, path18.concat(["ref"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
70375
70393
  }
70376
- unserializableValue.props = dehydrate(data.props, cleaned, unserializable, path16.concat(["props"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
70377
- unserializable.push(path16);
70394
+ unserializableValue.props = dehydrate(data.props, cleaned, unserializable, path18.concat(["props"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
70395
+ unserializable.push(path18);
70378
70396
  return unserializableValue;
70379
70397
  }
70380
70398
  case "react_lazy": {
70381
- isPathAllowedCheck = isPathAllowed(path16);
70399
+ isPathAllowedCheck = isPathAllowed(path18);
70382
70400
  var payload = data._payload;
70383
70401
  if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
70384
- cleaned.push(path16);
70402
+ cleaned.push(path18);
70385
70403
  var inspectable = payload !== null && hydration_typeof(payload) === "object" && (payload._status === 1 || payload._status === 2 || payload.status === "fulfilled" || payload.status === "rejected");
70386
70404
  return {
70387
70405
  inspectable,
@@ -70398,13 +70416,13 @@ var require_backend = __commonJS({
70398
70416
  preview_long: formatDataForPreview(data, true),
70399
70417
  name: "lazy()"
70400
70418
  };
70401
- _unserializableValue._payload = dehydrate(payload, cleaned, unserializable, path16.concat(["_payload"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
70402
- unserializable.push(path16);
70419
+ _unserializableValue._payload = dehydrate(payload, cleaned, unserializable, path18.concat(["_payload"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
70420
+ unserializable.push(path18);
70403
70421
  return _unserializableValue;
70404
70422
  }
70405
70423
  case "array_buffer":
70406
70424
  case "data_view":
70407
- cleaned.push(path16);
70425
+ cleaned.push(path18);
70408
70426
  return {
70409
70427
  inspectable: false,
70410
70428
  preview_short: formatDataForPreview(data, false),
@@ -70414,21 +70432,21 @@ var require_backend = __commonJS({
70414
70432
  type
70415
70433
  };
70416
70434
  case "array":
70417
- isPathAllowedCheck = isPathAllowed(path16);
70435
+ isPathAllowedCheck = isPathAllowed(path18);
70418
70436
  if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
70419
- return createDehydrated(type, true, data, cleaned, path16);
70437
+ return createDehydrated(type, true, data, cleaned, path18);
70420
70438
  }
70421
70439
  var arr = [];
70422
70440
  for (var i = 0; i < data.length; i++) {
70423
- arr[i] = dehydrateKey(data, i, cleaned, unserializable, path16.concat([i]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
70441
+ arr[i] = dehydrateKey(data, i, cleaned, unserializable, path18.concat([i]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
70424
70442
  }
70425
70443
  return arr;
70426
70444
  case "html_all_collection":
70427
70445
  case "typed_array":
70428
70446
  case "iterator":
70429
- isPathAllowedCheck = isPathAllowed(path16);
70447
+ isPathAllowedCheck = isPathAllowed(path18);
70430
70448
  if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
70431
- return createDehydrated(type, true, data, cleaned, path16);
70449
+ return createDehydrated(type, true, data, cleaned, path18);
70432
70450
  } else {
70433
70451
  var _unserializableValue2 = {
70434
70452
  unserializable: true,
@@ -70440,13 +70458,13 @@ var require_backend = __commonJS({
70440
70458
  name: typeof data.constructor !== "function" || typeof data.constructor.name !== "string" || data.constructor.name === "Object" ? "" : data.constructor.name
70441
70459
  };
70442
70460
  Array.from(data).forEach(function(item, i2) {
70443
- return _unserializableValue2[i2] = dehydrate(item, cleaned, unserializable, path16.concat([i2]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
70461
+ return _unserializableValue2[i2] = dehydrate(item, cleaned, unserializable, path18.concat([i2]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
70444
70462
  });
70445
- unserializable.push(path16);
70463
+ unserializable.push(path18);
70446
70464
  return _unserializableValue2;
70447
70465
  }
70448
70466
  case "opaque_iterator":
70449
- cleaned.push(path16);
70467
+ cleaned.push(path18);
70450
70468
  return {
70451
70469
  inspectable: false,
70452
70470
  preview_short: formatDataForPreview(data, false),
@@ -70455,7 +70473,7 @@ var require_backend = __commonJS({
70455
70473
  type
70456
70474
  };
70457
70475
  case "date":
70458
- cleaned.push(path16);
70476
+ cleaned.push(path18);
70459
70477
  return {
70460
70478
  inspectable: false,
70461
70479
  preview_short: formatDataForPreview(data, false),
@@ -70464,7 +70482,7 @@ var require_backend = __commonJS({
70464
70482
  type
70465
70483
  };
70466
70484
  case "regexp":
70467
- cleaned.push(path16);
70485
+ cleaned.push(path18);
70468
70486
  return {
70469
70487
  inspectable: false,
70470
70488
  preview_short: formatDataForPreview(data, false),
@@ -70473,9 +70491,9 @@ var require_backend = __commonJS({
70473
70491
  type
70474
70492
  };
70475
70493
  case "thenable":
70476
- isPathAllowedCheck = isPathAllowed(path16);
70494
+ isPathAllowedCheck = isPathAllowed(path18);
70477
70495
  if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
70478
- cleaned.push(path16);
70496
+ cleaned.push(path18);
70479
70497
  return {
70480
70498
  inspectable: data.status === "fulfilled" || data.status === "rejected",
70481
70499
  preview_short: formatDataForPreview(data, false),
@@ -70496,8 +70514,8 @@ var require_backend = __commonJS({
70496
70514
  preview_long: formatDataForPreview(data, true),
70497
70515
  name: "fulfilled Thenable"
70498
70516
  };
70499
- _unserializableValue3.value = dehydrate(data.value, cleaned, unserializable, path16.concat(["value"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
70500
- unserializable.push(path16);
70517
+ _unserializableValue3.value = dehydrate(data.value, cleaned, unserializable, path18.concat(["value"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
70518
+ unserializable.push(path18);
70501
70519
  return _unserializableValue3;
70502
70520
  }
70503
70521
  case "rejected": {
@@ -70508,12 +70526,12 @@ var require_backend = __commonJS({
70508
70526
  preview_long: formatDataForPreview(data, true),
70509
70527
  name: "rejected Thenable"
70510
70528
  };
70511
- _unserializableValue4.reason = dehydrate(data.reason, cleaned, unserializable, path16.concat(["reason"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
70512
- unserializable.push(path16);
70529
+ _unserializableValue4.reason = dehydrate(data.reason, cleaned, unserializable, path18.concat(["reason"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
70530
+ unserializable.push(path18);
70513
70531
  return _unserializableValue4;
70514
70532
  }
70515
70533
  default:
70516
- cleaned.push(path16);
70534
+ cleaned.push(path18);
70517
70535
  return {
70518
70536
  inspectable: false,
70519
70537
  preview_short: formatDataForPreview(data, false),
@@ -70523,21 +70541,21 @@ var require_backend = __commonJS({
70523
70541
  };
70524
70542
  }
70525
70543
  case "object":
70526
- isPathAllowedCheck = isPathAllowed(path16);
70544
+ isPathAllowedCheck = isPathAllowed(path18);
70527
70545
  if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
70528
- return createDehydrated(type, true, data, cleaned, path16);
70546
+ return createDehydrated(type, true, data, cleaned, path18);
70529
70547
  } else {
70530
70548
  var object2 = {};
70531
70549
  getAllEnumerableKeys(data).forEach(function(key) {
70532
70550
  var name = key.toString();
70533
- object2[name] = dehydrateKey(data, key, cleaned, unserializable, path16.concat([name]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
70551
+ object2[name] = dehydrateKey(data, key, cleaned, unserializable, path18.concat([name]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
70534
70552
  });
70535
70553
  return object2;
70536
70554
  }
70537
70555
  case "class_instance": {
70538
- isPathAllowedCheck = isPathAllowed(path16);
70556
+ isPathAllowedCheck = isPathAllowed(path18);
70539
70557
  if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
70540
- return createDehydrated(type, true, data, cleaned, path16);
70558
+ return createDehydrated(type, true, data, cleaned, path18);
70541
70559
  }
70542
70560
  var value = {
70543
70561
  unserializable: true,
@@ -70549,15 +70567,15 @@ var require_backend = __commonJS({
70549
70567
  };
70550
70568
  getAllEnumerableKeys(data).forEach(function(key) {
70551
70569
  var keyAsString = key.toString();
70552
- value[keyAsString] = dehydrate(data[key], cleaned, unserializable, path16.concat([keyAsString]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
70570
+ value[keyAsString] = dehydrate(data[key], cleaned, unserializable, path18.concat([keyAsString]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
70553
70571
  });
70554
- unserializable.push(path16);
70572
+ unserializable.push(path18);
70555
70573
  return value;
70556
70574
  }
70557
70575
  case "error": {
70558
- isPathAllowedCheck = isPathAllowed(path16);
70576
+ isPathAllowedCheck = isPathAllowed(path18);
70559
70577
  if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
70560
- return createDehydrated(type, true, data, cleaned, path16);
70578
+ return createDehydrated(type, true, data, cleaned, path18);
70561
70579
  }
70562
70580
  var _value = {
70563
70581
  unserializable: true,
@@ -70567,22 +70585,22 @@ var require_backend = __commonJS({
70567
70585
  preview_long: formatDataForPreview(data, true),
70568
70586
  name: data.name
70569
70587
  };
70570
- _value.message = dehydrate(data.message, cleaned, unserializable, path16.concat(["message"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
70571
- _value.stack = dehydrate(data.stack, cleaned, unserializable, path16.concat(["stack"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
70588
+ _value.message = dehydrate(data.message, cleaned, unserializable, path18.concat(["message"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
70589
+ _value.stack = dehydrate(data.stack, cleaned, unserializable, path18.concat(["stack"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
70572
70590
  if ("cause" in data) {
70573
- _value.cause = dehydrate(data.cause, cleaned, unserializable, path16.concat(["cause"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
70591
+ _value.cause = dehydrate(data.cause, cleaned, unserializable, path18.concat(["cause"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
70574
70592
  }
70575
70593
  getAllEnumerableKeys(data).forEach(function(key) {
70576
70594
  var keyAsString = key.toString();
70577
- _value[keyAsString] = dehydrate(data[key], cleaned, unserializable, path16.concat([keyAsString]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
70595
+ _value[keyAsString] = dehydrate(data[key], cleaned, unserializable, path18.concat([keyAsString]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
70578
70596
  });
70579
- unserializable.push(path16);
70597
+ unserializable.push(path18);
70580
70598
  return _value;
70581
70599
  }
70582
70600
  case "infinity":
70583
70601
  case "nan":
70584
70602
  case "undefined":
70585
- cleaned.push(path16);
70603
+ cleaned.push(path18);
70586
70604
  return {
70587
70605
  type
70588
70606
  };
@@ -70590,10 +70608,10 @@ var require_backend = __commonJS({
70590
70608
  return data;
70591
70609
  }
70592
70610
  }
70593
- function dehydrateKey(parent, key, cleaned, unserializable, path16, isPathAllowed) {
70611
+ function dehydrateKey(parent, key, cleaned, unserializable, path18, isPathAllowed) {
70594
70612
  var level = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : 0;
70595
70613
  try {
70596
- return dehydrate(parent[key], cleaned, unserializable, path16, isPathAllowed, level);
70614
+ return dehydrate(parent[key], cleaned, unserializable, path18, isPathAllowed, level);
70597
70615
  } catch (error48) {
70598
70616
  var preview = "";
70599
70617
  if (hydration_typeof(error48) === "object" && error48 !== null && typeof error48.stack === "string") {
@@ -70601,7 +70619,7 @@ var require_backend = __commonJS({
70601
70619
  } else if (typeof error48 === "string") {
70602
70620
  preview = error48;
70603
70621
  }
70604
- cleaned.push(path16);
70622
+ cleaned.push(path18);
70605
70623
  return {
70606
70624
  inspectable: false,
70607
70625
  preview_short: "[Exception]",
@@ -70611,8 +70629,8 @@ var require_backend = __commonJS({
70611
70629
  };
70612
70630
  }
70613
70631
  }
70614
- function fillInPath(object2, data, path16, value) {
70615
- var target = getInObject(object2, path16);
70632
+ function fillInPath(object2, data, path18, value) {
70633
+ var target = getInObject(object2, path18);
70616
70634
  if (target != null) {
70617
70635
  if (!target[meta3.unserializable]) {
70618
70636
  delete target[meta3.inspectable];
@@ -70627,9 +70645,9 @@ var require_backend = __commonJS({
70627
70645
  }
70628
70646
  if (value !== null && data.unserializable.length > 0) {
70629
70647
  var unserializablePath = data.unserializable[0];
70630
- var isMatch = unserializablePath.length === path16.length;
70631
- for (var i = 0; i < path16.length; i++) {
70632
- if (path16[i] !== unserializablePath[i]) {
70648
+ var isMatch = unserializablePath.length === path18.length;
70649
+ for (var i = 0; i < path18.length; i++) {
70650
+ if (path18[i] !== unserializablePath[i]) {
70633
70651
  isMatch = false;
70634
70652
  break;
70635
70653
  }
@@ -70638,13 +70656,13 @@ var require_backend = __commonJS({
70638
70656
  upgradeUnserializable(value, value);
70639
70657
  }
70640
70658
  }
70641
- setInObject(object2, path16, value);
70659
+ setInObject(object2, path18, value);
70642
70660
  }
70643
70661
  function hydrate(object2, cleaned, unserializable) {
70644
- cleaned.forEach(function(path16) {
70645
- var length = path16.length;
70646
- var last = path16[length - 1];
70647
- var parent = getInObject(object2, path16.slice(0, length - 1));
70662
+ cleaned.forEach(function(path18) {
70663
+ var length = path18.length;
70664
+ var last = path18[length - 1];
70665
+ var parent = getInObject(object2, path18.slice(0, length - 1));
70648
70666
  if (!parent || !parent.hasOwnProperty(last)) {
70649
70667
  return;
70650
70668
  }
@@ -70670,10 +70688,10 @@ var require_backend = __commonJS({
70670
70688
  parent[last] = replaced;
70671
70689
  }
70672
70690
  });
70673
- unserializable.forEach(function(path16) {
70674
- var length = path16.length;
70675
- var last = path16[length - 1];
70676
- var parent = getInObject(object2, path16.slice(0, length - 1));
70691
+ unserializable.forEach(function(path18) {
70692
+ var length = path18.length;
70693
+ var last = path18[length - 1];
70694
+ var parent = getInObject(object2, path18.slice(0, length - 1));
70677
70695
  if (!parent || !parent.hasOwnProperty(last)) {
70678
70696
  return;
70679
70697
  }
@@ -70796,11 +70814,11 @@ var require_backend = __commonJS({
70796
70814
  return gte(version2, FIRST_DEVTOOLS_BACKEND_LOCKSTEP_VER);
70797
70815
  }
70798
70816
  function cleanForBridge(data, isPathAllowed) {
70799
- var path16 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
70817
+ var path18 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
70800
70818
  if (data !== null) {
70801
70819
  var cleanedPaths = [];
70802
70820
  var unserializablePaths = [];
70803
- var cleanedData = dehydrate(data, cleanedPaths, unserializablePaths, path16, isPathAllowed);
70821
+ var cleanedData = dehydrate(data, cleanedPaths, unserializablePaths, path18, isPathAllowed);
70804
70822
  return {
70805
70823
  data: cleanedData,
70806
70824
  cleaned: cleanedPaths,
@@ -70810,18 +70828,18 @@ var require_backend = __commonJS({
70810
70828
  return null;
70811
70829
  }
70812
70830
  }
70813
- function copyWithDelete(obj, path16) {
70831
+ function copyWithDelete(obj, path18) {
70814
70832
  var index = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
70815
- var key = path16[index];
70833
+ var key = path18[index];
70816
70834
  var updated = shared_isArray(obj) ? obj.slice() : utils_objectSpread({}, obj);
70817
- if (index + 1 === path16.length) {
70835
+ if (index + 1 === path18.length) {
70818
70836
  if (shared_isArray(updated)) {
70819
70837
  updated.splice(key, 1);
70820
70838
  } else {
70821
70839
  delete updated[key];
70822
70840
  }
70823
70841
  } else {
70824
- updated[key] = copyWithDelete(obj[key], path16, index + 1);
70842
+ updated[key] = copyWithDelete(obj[key], path18, index + 1);
70825
70843
  }
70826
70844
  return updated;
70827
70845
  }
@@ -70842,14 +70860,14 @@ var require_backend = __commonJS({
70842
70860
  }
70843
70861
  return updated;
70844
70862
  }
70845
- function copyWithSet(obj, path16, value) {
70863
+ function copyWithSet(obj, path18, value) {
70846
70864
  var index = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0;
70847
- if (index >= path16.length) {
70865
+ if (index >= path18.length) {
70848
70866
  return value;
70849
70867
  }
70850
- var key = path16[index];
70868
+ var key = path18[index];
70851
70869
  var updated = shared_isArray(obj) ? obj.slice() : utils_objectSpread({}, obj);
70852
- updated[key] = copyWithSet(obj[key], path16, value, index + 1);
70870
+ updated[key] = copyWithSet(obj[key], path18, value, index + 1);
70853
70871
  return updated;
70854
70872
  }
70855
70873
  function getEffectDurations(root) {
@@ -72172,12 +72190,12 @@ var require_backend = __commonJS({
72172
72190
  }
72173
72191
  });
72174
72192
  bridge_defineProperty(_this, "overrideValueAtPath", function(_ref) {
72175
- var id = _ref.id, path16 = _ref.path, rendererID = _ref.rendererID, type = _ref.type, value = _ref.value;
72193
+ var id = _ref.id, path18 = _ref.path, rendererID = _ref.rendererID, type = _ref.type, value = _ref.value;
72176
72194
  switch (type) {
72177
72195
  case "context":
72178
72196
  _this.send("overrideContext", {
72179
72197
  id,
72180
- path: path16,
72198
+ path: path18,
72181
72199
  rendererID,
72182
72200
  wasForwarded: true,
72183
72201
  value
@@ -72186,7 +72204,7 @@ var require_backend = __commonJS({
72186
72204
  case "hooks":
72187
72205
  _this.send("overrideHookState", {
72188
72206
  id,
72189
- path: path16,
72207
+ path: path18,
72190
72208
  rendererID,
72191
72209
  wasForwarded: true,
72192
72210
  value
@@ -72195,7 +72213,7 @@ var require_backend = __commonJS({
72195
72213
  case "props":
72196
72214
  _this.send("overrideProps", {
72197
72215
  id,
72198
- path: path16,
72216
+ path: path18,
72199
72217
  rendererID,
72200
72218
  wasForwarded: true,
72201
72219
  value
@@ -72204,7 +72222,7 @@ var require_backend = __commonJS({
72204
72222
  case "state":
72205
72223
  _this.send("overrideState", {
72206
72224
  id,
72207
- path: path16,
72225
+ path: path18,
72208
72226
  rendererID,
72209
72227
  wasForwarded: true,
72210
72228
  value
@@ -72548,12 +72566,12 @@ var require_backend = __commonJS({
72548
72566
  }
72549
72567
  });
72550
72568
  agent_defineProperty(_this, "copyElementPath", function(_ref5) {
72551
- var id = _ref5.id, path16 = _ref5.path, rendererID = _ref5.rendererID;
72569
+ var id = _ref5.id, path18 = _ref5.path, rendererID = _ref5.rendererID;
72552
72570
  var renderer2 = _this._rendererInterfaces[rendererID];
72553
72571
  if (renderer2 == null) {
72554
72572
  console.warn('Invalid renderer id "'.concat(rendererID, '" for element "').concat(id, '"'));
72555
72573
  } else {
72556
- var value = renderer2.getSerializedElementValueByPath(id, path16);
72574
+ var value = renderer2.getSerializedElementValueByPath(id, path18);
72557
72575
  if (value != null) {
72558
72576
  _this._bridge.send("saveToClipboard", value);
72559
72577
  } else {
@@ -72562,12 +72580,12 @@ var require_backend = __commonJS({
72562
72580
  }
72563
72581
  });
72564
72582
  agent_defineProperty(_this, "deletePath", function(_ref6) {
72565
- var hookID = _ref6.hookID, id = _ref6.id, path16 = _ref6.path, rendererID = _ref6.rendererID, type = _ref6.type;
72583
+ var hookID = _ref6.hookID, id = _ref6.id, path18 = _ref6.path, rendererID = _ref6.rendererID, type = _ref6.type;
72566
72584
  var renderer2 = _this._rendererInterfaces[rendererID];
72567
72585
  if (renderer2 == null) {
72568
72586
  console.warn('Invalid renderer id "'.concat(rendererID, '" for element "').concat(id, '"'));
72569
72587
  } else {
72570
- renderer2.deletePath(type, id, hookID, path16);
72588
+ renderer2.deletePath(type, id, hookID, path18);
72571
72589
  }
72572
72590
  });
72573
72591
  agent_defineProperty(_this, "getBackendVersion", function() {
@@ -72604,12 +72622,12 @@ var require_backend = __commonJS({
72604
72622
  }
72605
72623
  });
72606
72624
  agent_defineProperty(_this, "inspectElement", function(_ref9) {
72607
- var forceFullData = _ref9.forceFullData, id = _ref9.id, path16 = _ref9.path, rendererID = _ref9.rendererID, requestID = _ref9.requestID;
72625
+ var forceFullData = _ref9.forceFullData, id = _ref9.id, path18 = _ref9.path, rendererID = _ref9.rendererID, requestID = _ref9.requestID;
72608
72626
  var renderer2 = _this._rendererInterfaces[rendererID];
72609
72627
  if (renderer2 == null) {
72610
72628
  console.warn('Invalid renderer id "'.concat(rendererID, '" for element "').concat(id, '"'));
72611
72629
  } else {
72612
- _this._bridge.send("inspectedElement", renderer2.inspectElement(requestID, id, path16, forceFullData));
72630
+ _this._bridge.send("inspectedElement", renderer2.inspectElement(requestID, id, path18, forceFullData));
72613
72631
  if (_this._persistedSelectionMatch === null || _this._persistedSelectionMatch.id !== id) {
72614
72632
  _this._persistedSelection = null;
72615
72633
  _this._persistedSelectionMatch = null;
@@ -72643,15 +72661,15 @@ var require_backend = __commonJS({
72643
72661
  }
72644
72662
  for (var rendererID in _this._rendererInterfaces) {
72645
72663
  var renderer2 = _this._rendererInterfaces[rendererID];
72646
- var path16 = null;
72664
+ var path18 = null;
72647
72665
  if (suspendedByPathIndex !== null && rendererPath !== null) {
72648
72666
  var suspendedByPathRendererIndex = suspendedByPathIndex - suspendedByOffset;
72649
72667
  var rendererHasRequestedSuspendedByPath = renderer2.getElementAttributeByPath(id, ["suspendedBy", suspendedByPathRendererIndex]) !== void 0;
72650
72668
  if (rendererHasRequestedSuspendedByPath) {
72651
- path16 = ["suspendedBy", suspendedByPathRendererIndex].concat(rendererPath);
72669
+ path18 = ["suspendedBy", suspendedByPathRendererIndex].concat(rendererPath);
72652
72670
  }
72653
72671
  }
72654
- var inspectedRootsPayload = renderer2.inspectElement(requestID, id, path16, forceFullData);
72672
+ var inspectedRootsPayload = renderer2.inspectElement(requestID, id, path18, forceFullData);
72655
72673
  switch (inspectedRootsPayload.type) {
72656
72674
  case "hydrated-path":
72657
72675
  inspectedRootsPayload.path[1] += suspendedByOffset;
@@ -72745,20 +72763,20 @@ var require_backend = __commonJS({
72745
72763
  }
72746
72764
  });
72747
72765
  agent_defineProperty(_this, "overrideValueAtPath", function(_ref15) {
72748
- var hookID = _ref15.hookID, id = _ref15.id, path16 = _ref15.path, rendererID = _ref15.rendererID, type = _ref15.type, value = _ref15.value;
72766
+ var hookID = _ref15.hookID, id = _ref15.id, path18 = _ref15.path, rendererID = _ref15.rendererID, type = _ref15.type, value = _ref15.value;
72749
72767
  var renderer2 = _this._rendererInterfaces[rendererID];
72750
72768
  if (renderer2 == null) {
72751
72769
  console.warn('Invalid renderer id "'.concat(rendererID, '" for element "').concat(id, '"'));
72752
72770
  } else {
72753
- renderer2.overrideValueAtPath(type, id, hookID, path16, value);
72771
+ renderer2.overrideValueAtPath(type, id, hookID, path18, value);
72754
72772
  }
72755
72773
  });
72756
72774
  agent_defineProperty(_this, "overrideContext", function(_ref16) {
72757
- var id = _ref16.id, path16 = _ref16.path, rendererID = _ref16.rendererID, wasForwarded = _ref16.wasForwarded, value = _ref16.value;
72775
+ var id = _ref16.id, path18 = _ref16.path, rendererID = _ref16.rendererID, wasForwarded = _ref16.wasForwarded, value = _ref16.value;
72758
72776
  if (!wasForwarded) {
72759
72777
  _this.overrideValueAtPath({
72760
72778
  id,
72761
- path: path16,
72779
+ path: path18,
72762
72780
  rendererID,
72763
72781
  type: "context",
72764
72782
  value
@@ -72766,11 +72784,11 @@ var require_backend = __commonJS({
72766
72784
  }
72767
72785
  });
72768
72786
  agent_defineProperty(_this, "overrideHookState", function(_ref17) {
72769
- var id = _ref17.id, hookID = _ref17.hookID, path16 = _ref17.path, rendererID = _ref17.rendererID, wasForwarded = _ref17.wasForwarded, value = _ref17.value;
72787
+ var id = _ref17.id, hookID = _ref17.hookID, path18 = _ref17.path, rendererID = _ref17.rendererID, wasForwarded = _ref17.wasForwarded, value = _ref17.value;
72770
72788
  if (!wasForwarded) {
72771
72789
  _this.overrideValueAtPath({
72772
72790
  id,
72773
- path: path16,
72791
+ path: path18,
72774
72792
  rendererID,
72775
72793
  type: "hooks",
72776
72794
  value
@@ -72778,11 +72796,11 @@ var require_backend = __commonJS({
72778
72796
  }
72779
72797
  });
72780
72798
  agent_defineProperty(_this, "overrideProps", function(_ref18) {
72781
- var id = _ref18.id, path16 = _ref18.path, rendererID = _ref18.rendererID, wasForwarded = _ref18.wasForwarded, value = _ref18.value;
72799
+ var id = _ref18.id, path18 = _ref18.path, rendererID = _ref18.rendererID, wasForwarded = _ref18.wasForwarded, value = _ref18.value;
72782
72800
  if (!wasForwarded) {
72783
72801
  _this.overrideValueAtPath({
72784
72802
  id,
72785
- path: path16,
72803
+ path: path18,
72786
72804
  rendererID,
72787
72805
  type: "props",
72788
72806
  value
@@ -72790,11 +72808,11 @@ var require_backend = __commonJS({
72790
72808
  }
72791
72809
  });
72792
72810
  agent_defineProperty(_this, "overrideState", function(_ref19) {
72793
- var id = _ref19.id, path16 = _ref19.path, rendererID = _ref19.rendererID, wasForwarded = _ref19.wasForwarded, value = _ref19.value;
72811
+ var id = _ref19.id, path18 = _ref19.path, rendererID = _ref19.rendererID, wasForwarded = _ref19.wasForwarded, value = _ref19.value;
72794
72812
  if (!wasForwarded) {
72795
72813
  _this.overrideValueAtPath({
72796
72814
  id,
72797
- path: path16,
72815
+ path: path18,
72798
72816
  rendererID,
72799
72817
  type: "state",
72800
72818
  value
@@ -72861,12 +72879,12 @@ var require_backend = __commonJS({
72861
72879
  _this._bridge.send("stopInspectingHost", selected);
72862
72880
  });
72863
72881
  agent_defineProperty(_this, "storeAsGlobal", function(_ref23) {
72864
- var count = _ref23.count, id = _ref23.id, path16 = _ref23.path, rendererID = _ref23.rendererID;
72882
+ var count = _ref23.count, id = _ref23.id, path18 = _ref23.path, rendererID = _ref23.rendererID;
72865
72883
  var renderer2 = _this._rendererInterfaces[rendererID];
72866
72884
  if (renderer2 == null) {
72867
72885
  console.warn('Invalid renderer id "'.concat(rendererID, '" for element "').concat(id, '"'));
72868
72886
  } else {
72869
- renderer2.storeAsGlobal(id, path16, count);
72887
+ renderer2.storeAsGlobal(id, path18, count);
72870
72888
  }
72871
72889
  });
72872
72890
  agent_defineProperty(_this, "updateHookSettings", function(settings) {
@@ -72883,12 +72901,12 @@ var require_backend = __commonJS({
72883
72901
  var rendererID = +rendererIDString;
72884
72902
  var renderer2 = _this._rendererInterfaces[rendererID];
72885
72903
  if (_this._lastSelectedRendererID === rendererID) {
72886
- var path16 = renderer2.getPathForElement(_this._lastSelectedElementID);
72887
- if (path16 !== null) {
72888
- renderer2.setTrackedPath(path16);
72904
+ var path18 = renderer2.getPathForElement(_this._lastSelectedElementID);
72905
+ if (path18 !== null) {
72906
+ renderer2.setTrackedPath(path18);
72889
72907
  _this._persistedSelection = {
72890
72908
  rendererID,
72891
- path: path16
72909
+ path: path18
72892
72910
  };
72893
72911
  }
72894
72912
  }
@@ -72963,11 +72981,11 @@ var require_backend = __commonJS({
72963
72981
  var rendererID = _this._lastSelectedRendererID;
72964
72982
  var id = _this._lastSelectedElementID;
72965
72983
  var renderer2 = _this._rendererInterfaces[rendererID];
72966
- var path16 = renderer2 != null ? renderer2.getPathForElement(id) : null;
72967
- if (path16 !== null) {
72984
+ var path18 = renderer2 != null ? renderer2.getPathForElement(id) : null;
72985
+ if (path18 !== null) {
72968
72986
  storage_sessionStorageSetItem(SESSION_STORAGE_LAST_SELECTION_KEY, JSON.stringify({
72969
72987
  rendererID,
72970
- path: path16
72988
+ path: path18
72971
72989
  }));
72972
72990
  } else {
72973
72991
  storage_sessionStorageRemoveItem(SESSION_STORAGE_LAST_SELECTION_KEY);
@@ -73700,7 +73718,7 @@ var require_backend = __commonJS({
73700
73718
  hasElementWithId: function hasElementWithId() {
73701
73719
  return false;
73702
73720
  },
73703
- inspectElement: function inspectElement(requestID, id, path16) {
73721
+ inspectElement: function inspectElement(requestID, id, path18) {
73704
73722
  return {
73705
73723
  id,
73706
73724
  responseID: requestID,
@@ -78997,9 +79015,9 @@ var require_backend = __commonJS({
78997
79015
  }
78998
79016
  return null;
78999
79017
  }
79000
- function getElementAttributeByPath(id, path16) {
79018
+ function getElementAttributeByPath(id, path18) {
79001
79019
  if (isMostRecentlyInspectedElement(id)) {
79002
- return utils_getInObject(mostRecentlyInspectedElement, path16);
79020
+ return utils_getInObject(mostRecentlyInspectedElement, path18);
79003
79021
  }
79004
79022
  return void 0;
79005
79023
  }
@@ -79706,9 +79724,9 @@ var require_backend = __commonJS({
79706
79724
  function isMostRecentlyInspectedElementCurrent(id) {
79707
79725
  return isMostRecentlyInspectedElement(id) && !hasElementUpdatedSinceLastInspected;
79708
79726
  }
79709
- function mergeInspectedPaths(path16) {
79727
+ function mergeInspectedPaths(path18) {
79710
79728
  var current = currentlyInspectedPaths;
79711
- path16.forEach(function(key) {
79729
+ path18.forEach(function(key) {
79712
79730
  if (!current[key]) {
79713
79731
  current[key] = {};
79714
79732
  }
@@ -79716,21 +79734,21 @@ var require_backend = __commonJS({
79716
79734
  });
79717
79735
  }
79718
79736
  function createIsPathAllowed(key, secondaryCategory) {
79719
- return function isPathAllowed(path16) {
79737
+ return function isPathAllowed(path18) {
79720
79738
  switch (secondaryCategory) {
79721
79739
  case "hooks":
79722
- if (path16.length === 1) {
79740
+ if (path18.length === 1) {
79723
79741
  return true;
79724
79742
  }
79725
- if (path16[path16.length - 2] === "hookSource" && path16[path16.length - 1] === "fileName") {
79743
+ if (path18[path18.length - 2] === "hookSource" && path18[path18.length - 1] === "fileName") {
79726
79744
  return true;
79727
79745
  }
79728
- if (path16[path16.length - 1] === "subHooks" || path16[path16.length - 2] === "subHooks") {
79746
+ if (path18[path18.length - 1] === "subHooks" || path18[path18.length - 2] === "subHooks") {
79729
79747
  return true;
79730
79748
  }
79731
79749
  break;
79732
79750
  case "suspendedBy":
79733
- if (path16.length < 5) {
79751
+ if (path18.length < 5) {
79734
79752
  return true;
79735
79753
  }
79736
79754
  break;
@@ -79741,8 +79759,8 @@ var require_backend = __commonJS({
79741
79759
  if (!current) {
79742
79760
  return false;
79743
79761
  }
79744
- for (var i = 0; i < path16.length; i++) {
79745
- current = current[path16[i]];
79762
+ for (var i = 0; i < path18.length; i++) {
79763
+ current = current[path18[i]];
79746
79764
  if (!current) {
79747
79765
  return false;
79748
79766
  }
@@ -79796,38 +79814,38 @@ var require_backend = __commonJS({
79796
79814
  break;
79797
79815
  }
79798
79816
  }
79799
- function storeAsGlobal(id, path16, count) {
79817
+ function storeAsGlobal(id, path18, count) {
79800
79818
  if (isMostRecentlyInspectedElement(id)) {
79801
- var value = utils_getInObject(mostRecentlyInspectedElement, path16);
79819
+ var value = utils_getInObject(mostRecentlyInspectedElement, path18);
79802
79820
  var key = "$reactTemp".concat(count);
79803
79821
  window[key] = value;
79804
79822
  console.log(key);
79805
79823
  console.log(value);
79806
79824
  }
79807
79825
  }
79808
- function getSerializedElementValueByPath(id, path16) {
79826
+ function getSerializedElementValueByPath(id, path18) {
79809
79827
  if (isMostRecentlyInspectedElement(id)) {
79810
- var valueToCopy = utils_getInObject(mostRecentlyInspectedElement, path16);
79828
+ var valueToCopy = utils_getInObject(mostRecentlyInspectedElement, path18);
79811
79829
  return serializeToString(valueToCopy);
79812
79830
  }
79813
79831
  }
79814
- function inspectElement(requestID, id, path16, forceFullData) {
79815
- if (path16 !== null) {
79816
- mergeInspectedPaths(path16);
79832
+ function inspectElement(requestID, id, path18, forceFullData) {
79833
+ if (path18 !== null) {
79834
+ mergeInspectedPaths(path18);
79817
79835
  }
79818
79836
  if (isMostRecentlyInspectedElement(id) && !forceFullData) {
79819
79837
  if (!hasElementUpdatedSinceLastInspected) {
79820
- if (path16 !== null) {
79838
+ if (path18 !== null) {
79821
79839
  var secondaryCategory = null;
79822
- if (path16[0] === "hooks" || path16[0] === "suspendedBy") {
79823
- secondaryCategory = path16[0];
79840
+ if (path18[0] === "hooks" || path18[0] === "suspendedBy") {
79841
+ secondaryCategory = path18[0];
79824
79842
  }
79825
79843
  return {
79826
79844
  id,
79827
79845
  responseID: requestID,
79828
79846
  type: "hydrated-path",
79829
- path: path16,
79830
- value: cleanForBridge(utils_getInObject(mostRecentlyInspectedElement, path16), createIsPathAllowed(null, secondaryCategory), path16)
79847
+ path: path18,
79848
+ value: cleanForBridge(utils_getInObject(mostRecentlyInspectedElement, path18), createIsPathAllowed(null, secondaryCategory), path18)
79831
79849
  };
79832
79850
  } else {
79833
79851
  return {
@@ -80016,7 +80034,7 @@ var require_backend = __commonJS({
80016
80034
  console.groupEnd();
80017
80035
  }
80018
80036
  }
80019
- function deletePath(type, id, hookID, path16) {
80037
+ function deletePath(type, id, hookID, path18) {
80020
80038
  var devtoolsInstance = idToDevToolsInstanceMap.get(id);
80021
80039
  if (devtoolsInstance === void 0) {
80022
80040
  console.warn('Could not find DevToolsInstance with id "'.concat(id, '"'));
@@ -80030,12 +80048,12 @@ var require_backend = __commonJS({
80030
80048
  var instance2 = fiber.stateNode;
80031
80049
  switch (type) {
80032
80050
  case "context":
80033
- path16 = path16.slice(1);
80051
+ path18 = path18.slice(1);
80034
80052
  switch (fiber.tag) {
80035
80053
  case ClassComponent:
80036
- if (path16.length === 0) {
80054
+ if (path18.length === 0) {
80037
80055
  } else {
80038
- deletePathInObject(instance2.context, path16);
80056
+ deletePathInObject(instance2.context, path18);
80039
80057
  }
80040
80058
  instance2.forceUpdate();
80041
80059
  break;
@@ -80045,21 +80063,21 @@ var require_backend = __commonJS({
80045
80063
  break;
80046
80064
  case "hooks":
80047
80065
  if (typeof overrideHookStateDeletePath === "function") {
80048
- overrideHookStateDeletePath(fiber, hookID, path16);
80066
+ overrideHookStateDeletePath(fiber, hookID, path18);
80049
80067
  }
80050
80068
  break;
80051
80069
  case "props":
80052
80070
  if (instance2 === null) {
80053
80071
  if (typeof overridePropsDeletePath === "function") {
80054
- overridePropsDeletePath(fiber, path16);
80072
+ overridePropsDeletePath(fiber, path18);
80055
80073
  }
80056
80074
  } else {
80057
- fiber.pendingProps = copyWithDelete(instance2.props, path16);
80075
+ fiber.pendingProps = copyWithDelete(instance2.props, path18);
80058
80076
  instance2.forceUpdate();
80059
80077
  }
80060
80078
  break;
80061
80079
  case "state":
80062
- deletePathInObject(instance2.state, path16);
80080
+ deletePathInObject(instance2.state, path18);
80063
80081
  instance2.forceUpdate();
80064
80082
  break;
80065
80083
  }
@@ -80115,7 +80133,7 @@ var require_backend = __commonJS({
80115
80133
  }
80116
80134
  }
80117
80135
  }
80118
- function overrideValueAtPath(type, id, hookID, path16, value) {
80136
+ function overrideValueAtPath(type, id, hookID, path18, value) {
80119
80137
  var devtoolsInstance = idToDevToolsInstanceMap.get(id);
80120
80138
  if (devtoolsInstance === void 0) {
80121
80139
  console.warn('Could not find DevToolsInstance with id "'.concat(id, '"'));
@@ -80129,13 +80147,13 @@ var require_backend = __commonJS({
80129
80147
  var instance2 = fiber.stateNode;
80130
80148
  switch (type) {
80131
80149
  case "context":
80132
- path16 = path16.slice(1);
80150
+ path18 = path18.slice(1);
80133
80151
  switch (fiber.tag) {
80134
80152
  case ClassComponent:
80135
- if (path16.length === 0) {
80153
+ if (path18.length === 0) {
80136
80154
  instance2.context = value;
80137
80155
  } else {
80138
- utils_setInObject(instance2.context, path16, value);
80156
+ utils_setInObject(instance2.context, path18, value);
80139
80157
  }
80140
80158
  instance2.forceUpdate();
80141
80159
  break;
@@ -80145,18 +80163,18 @@ var require_backend = __commonJS({
80145
80163
  break;
80146
80164
  case "hooks":
80147
80165
  if (typeof overrideHookState === "function") {
80148
- overrideHookState(fiber, hookID, path16, value);
80166
+ overrideHookState(fiber, hookID, path18, value);
80149
80167
  }
80150
80168
  break;
80151
80169
  case "props":
80152
80170
  switch (fiber.tag) {
80153
80171
  case ClassComponent:
80154
- fiber.pendingProps = copyWithSet(instance2.props, path16, value);
80172
+ fiber.pendingProps = copyWithSet(instance2.props, path18, value);
80155
80173
  instance2.forceUpdate();
80156
80174
  break;
80157
80175
  default:
80158
80176
  if (typeof overrideProps === "function") {
80159
- overrideProps(fiber, path16, value);
80177
+ overrideProps(fiber, path18, value);
80160
80178
  }
80161
80179
  break;
80162
80180
  }
@@ -80164,7 +80182,7 @@ var require_backend = __commonJS({
80164
80182
  case "state":
80165
80183
  switch (fiber.tag) {
80166
80184
  case ClassComponent:
80167
- utils_setInObject(instance2.state, path16, value);
80185
+ utils_setInObject(instance2.state, path18, value);
80168
80186
  instance2.forceUpdate();
80169
80187
  break;
80170
80188
  }
@@ -80450,14 +80468,14 @@ var require_backend = __commonJS({
80450
80468
  var trackedPathMatchInstance = null;
80451
80469
  var trackedPathMatchDepth = -1;
80452
80470
  var mightBeOnTrackedPath = false;
80453
- function setTrackedPath(path16) {
80454
- if (path16 === null) {
80471
+ function setTrackedPath(path18) {
80472
+ if (path18 === null) {
80455
80473
  trackedPathMatchFiber = null;
80456
80474
  trackedPathMatchInstance = null;
80457
80475
  trackedPathMatchDepth = -1;
80458
80476
  mightBeOnTrackedPath = false;
80459
80477
  }
80460
- trackedPath = path16;
80478
+ trackedPath = path18;
80461
80479
  }
80462
80480
  function updateTrackedPathStateBeforeMount(fiber, fiberInstance) {
80463
80481
  if (trackedPath === null || !mightBeOnTrackedPath) {
@@ -81227,9 +81245,9 @@ var require_backend = __commonJS({
81227
81245
  }
81228
81246
  var currentlyInspectedElementID = null;
81229
81247
  var currentlyInspectedPaths = {};
81230
- function mergeInspectedPaths(path16) {
81248
+ function mergeInspectedPaths(path18) {
81231
81249
  var current = currentlyInspectedPaths;
81232
- path16.forEach(function(key) {
81250
+ path18.forEach(function(key) {
81233
81251
  if (!current[key]) {
81234
81252
  current[key] = {};
81235
81253
  }
@@ -81237,13 +81255,13 @@ var require_backend = __commonJS({
81237
81255
  });
81238
81256
  }
81239
81257
  function createIsPathAllowed(key) {
81240
- return function isPathAllowed(path16) {
81258
+ return function isPathAllowed(path18) {
81241
81259
  var current = currentlyInspectedPaths[key];
81242
81260
  if (!current) {
81243
81261
  return false;
81244
81262
  }
81245
- for (var i = 0; i < path16.length; i++) {
81246
- current = current[path16[i]];
81263
+ for (var i = 0; i < path18.length; i++) {
81264
+ current = current[path18[i]];
81247
81265
  if (!current) {
81248
81266
  return false;
81249
81267
  }
@@ -81293,24 +81311,24 @@ var require_backend = __commonJS({
81293
81311
  break;
81294
81312
  }
81295
81313
  }
81296
- function storeAsGlobal(id, path16, count) {
81314
+ function storeAsGlobal(id, path18, count) {
81297
81315
  var inspectedElement = inspectElementRaw(id);
81298
81316
  if (inspectedElement !== null) {
81299
- var value = utils_getInObject(inspectedElement, path16);
81317
+ var value = utils_getInObject(inspectedElement, path18);
81300
81318
  var key = "$reactTemp".concat(count);
81301
81319
  window[key] = value;
81302
81320
  console.log(key);
81303
81321
  console.log(value);
81304
81322
  }
81305
81323
  }
81306
- function getSerializedElementValueByPath(id, path16) {
81324
+ function getSerializedElementValueByPath(id, path18) {
81307
81325
  var inspectedElement = inspectElementRaw(id);
81308
81326
  if (inspectedElement !== null) {
81309
- var valueToCopy = utils_getInObject(inspectedElement, path16);
81327
+ var valueToCopy = utils_getInObject(inspectedElement, path18);
81310
81328
  return serializeToString(valueToCopy);
81311
81329
  }
81312
81330
  }
81313
- function inspectElement(requestID, id, path16, forceFullData) {
81331
+ function inspectElement(requestID, id, path18, forceFullData) {
81314
81332
  if (forceFullData || currentlyInspectedElementID !== id) {
81315
81333
  currentlyInspectedElementID = id;
81316
81334
  currentlyInspectedPaths = {};
@@ -81323,8 +81341,8 @@ var require_backend = __commonJS({
81323
81341
  type: "not-found"
81324
81342
  };
81325
81343
  }
81326
- if (path16 !== null) {
81327
- mergeInspectedPaths(path16);
81344
+ if (path18 !== null) {
81345
+ mergeInspectedPaths(path18);
81328
81346
  }
81329
81347
  updateSelectedElement(id);
81330
81348
  inspectedElement.context = cleanForBridge(inspectedElement.context, createIsPathAllowed("context"));
@@ -81527,10 +81545,10 @@ var require_backend = __commonJS({
81527
81545
  console.groupEnd();
81528
81546
  }
81529
81547
  }
81530
- function getElementAttributeByPath(id, path16) {
81548
+ function getElementAttributeByPath(id, path18) {
81531
81549
  var inspectedElement = inspectElementRaw(id);
81532
81550
  if (inspectedElement !== null) {
81533
- return utils_getInObject(inspectedElement, path16);
81551
+ return utils_getInObject(inspectedElement, path18);
81534
81552
  }
81535
81553
  return void 0;
81536
81554
  }
@@ -81547,14 +81565,14 @@ var require_backend = __commonJS({
81547
81565
  }
81548
81566
  return element.type;
81549
81567
  }
81550
- function deletePath(type, id, hookID, path16) {
81568
+ function deletePath(type, id, hookID, path18) {
81551
81569
  var internalInstance = idToInternalInstanceMap.get(id);
81552
81570
  if (internalInstance != null) {
81553
81571
  var publicInstance = internalInstance._instance;
81554
81572
  if (publicInstance != null) {
81555
81573
  switch (type) {
81556
81574
  case "context":
81557
- deletePathInObject(publicInstance.context, path16);
81575
+ deletePathInObject(publicInstance.context, path18);
81558
81576
  forceUpdate(publicInstance);
81559
81577
  break;
81560
81578
  case "hooks":
@@ -81562,12 +81580,12 @@ var require_backend = __commonJS({
81562
81580
  case "props":
81563
81581
  var element = internalInstance._currentElement;
81564
81582
  internalInstance._currentElement = legacy_renderer_objectSpread(legacy_renderer_objectSpread({}, element), {}, {
81565
- props: copyWithDelete(element.props, path16)
81583
+ props: copyWithDelete(element.props, path18)
81566
81584
  });
81567
81585
  forceUpdate(publicInstance);
81568
81586
  break;
81569
81587
  case "state":
81570
- deletePathInObject(publicInstance.state, path16);
81588
+ deletePathInObject(publicInstance.state, path18);
81571
81589
  forceUpdate(publicInstance);
81572
81590
  break;
81573
81591
  }
@@ -81601,14 +81619,14 @@ var require_backend = __commonJS({
81601
81619
  }
81602
81620
  }
81603
81621
  }
81604
- function overrideValueAtPath(type, id, hookID, path16, value) {
81622
+ function overrideValueAtPath(type, id, hookID, path18, value) {
81605
81623
  var internalInstance = idToInternalInstanceMap.get(id);
81606
81624
  if (internalInstance != null) {
81607
81625
  var publicInstance = internalInstance._instance;
81608
81626
  if (publicInstance != null) {
81609
81627
  switch (type) {
81610
81628
  case "context":
81611
- utils_setInObject(publicInstance.context, path16, value);
81629
+ utils_setInObject(publicInstance.context, path18, value);
81612
81630
  forceUpdate(publicInstance);
81613
81631
  break;
81614
81632
  case "hooks":
@@ -81616,12 +81634,12 @@ var require_backend = __commonJS({
81616
81634
  case "props":
81617
81635
  var element = internalInstance._currentElement;
81618
81636
  internalInstance._currentElement = legacy_renderer_objectSpread(legacy_renderer_objectSpread({}, element), {}, {
81619
- props: copyWithSet(element.props, path16, value)
81637
+ props: copyWithSet(element.props, path18, value)
81620
81638
  });
81621
81639
  forceUpdate(publicInstance);
81622
81640
  break;
81623
81641
  case "state":
81624
- utils_setInObject(publicInstance.state, path16, value);
81642
+ utils_setInObject(publicInstance.state, path18, value);
81625
81643
  forceUpdate(publicInstance);
81626
81644
  break;
81627
81645
  }
@@ -81666,7 +81684,7 @@ var require_backend = __commonJS({
81666
81684
  }
81667
81685
  function setTraceUpdatesEnabled(enabled) {
81668
81686
  }
81669
- function setTrackedPath(path16) {
81687
+ function setTrackedPath(path18) {
81670
81688
  }
81671
81689
  function getOwnersList(id) {
81672
81690
  return null;
@@ -82953,8 +82971,8 @@ var init_devtools = __esm({
82953
82971
 
82954
82972
  // node_modules/.pnpm/ink@6.8.0_@types+react@19.2.14_react-devtools-core@7.0.1_react@19.2.4/node_modules/ink/build/reconciler.js
82955
82973
  async function loadPackageJson() {
82956
- const fs17 = await import("node:fs");
82957
- const content = fs17.readFileSync(new URL("../package.json", import.meta.url), "utf8");
82974
+ const fs18 = await import("node:fs");
82975
+ const content = fs18.readFileSync(new URL("../package.json", import.meta.url), "utf8");
82958
82976
  return JSON.parse(content);
82959
82977
  }
82960
82978
  var import_react_reconciler, import_constants8, Scheduler, import_react, diff, cleanupYogaNode, currentUpdatePriority, currentRootNode, packageJson, reconciler_default;
@@ -85931,8 +85949,8 @@ var init_ErrorOverview = __esm({
85931
85949
  init_dist8();
85932
85950
  init_Box();
85933
85951
  init_Text();
85934
- cleanupPath = (path16) => {
85935
- return path16?.replace(`file://${cwd()}/`, "");
85952
+ cleanupPath = (path18) => {
85953
+ return path18?.replace(`file://${cwd()}/`, "");
85936
85954
  };
85937
85955
  stackUtils = new import_stack_utils.default({
85938
85956
  cwd: cwd(),
@@ -86829,8 +86847,8 @@ var init_ink = __esm({
86829
86847
  }
86830
86848
  }
86831
86849
  async waitUntilExit() {
86832
- this.exitPromise ||= new Promise((resolve2, reject) => {
86833
- this.resolveExitPromise = resolve2;
86850
+ this.exitPromise ||= new Promise((resolve3, reject) => {
86851
+ this.resolveExitPromise = resolve3;
86834
86852
  this.rejectExitPromise = reject;
86835
86853
  });
86836
86854
  if (!this.beforeExitHandler) {
@@ -88493,7 +88511,7 @@ var init_consent_prompt = __esm({
88493
88511
  // apps/cli/src/services/consent/consent-runner.ts
88494
88512
  async function runConsentPrompt(deps) {
88495
88513
  const renderer2 = deps.renderer ?? render_default;
88496
- return await new Promise((resolve2, reject) => {
88514
+ return await new Promise((resolve3, reject) => {
88497
88515
  let settled = false;
88498
88516
  const instance2 = renderer2(
88499
88517
  (0, import_react31.createElement)(ConsentPrompt, {
@@ -88503,7 +88521,7 @@ async function runConsentPrompt(deps) {
88503
88521
  return;
88504
88522
  settled = true;
88505
88523
  instance2.unmount();
88506
- resolve2(choice);
88524
+ resolve3(choice);
88507
88525
  }
88508
88526
  })
88509
88527
  );
@@ -88825,7 +88843,7 @@ function createTelemetryService(deps) {
88825
88843
  outcome: event.properties.outcome
88826
88844
  };
88827
88845
  const promise2 = (async () => {
88828
- await new Promise((resolve2) => setImmediate(resolve2));
88846
+ await new Promise((resolve3) => setImmediate(resolve3));
88829
88847
  await sendOne(prepared);
88830
88848
  })();
88831
88849
  inFlight.add(promise2);
@@ -88837,8 +88855,8 @@ function createTelemetryService(deps) {
88837
88855
  return;
88838
88856
  await Promise.race([
88839
88857
  Promise.allSettled(Array.from(inFlight)),
88840
- new Promise((resolve2) => {
88841
- const t = setTimeout(resolve2, timeoutMs);
88858
+ new Promise((resolve3) => {
88859
+ const t = setTimeout(resolve3, timeoutMs);
88842
88860
  t.unref?.();
88843
88861
  })
88844
88862
  ]);
@@ -88861,6 +88879,7 @@ var telemetry_exports = {};
88861
88879
  __export(telemetry_exports, {
88862
88880
  __resetTelemetryForTests: () => __resetTelemetryForTests,
88863
88881
  __setConsentProviderForTests: () => __setConsentProviderForTests,
88882
+ cliLogTelemetryLogger: () => cliLogTelemetryLogger,
88864
88883
  exitWithFlush: () => exitWithFlush,
88865
88884
  flushTelemetry: () => flushTelemetry,
88866
88885
  getCliConsentProvider: () => getCliConsentProvider,
@@ -89054,7 +89073,7 @@ var init_telemetry = __esm({
89054
89073
  instance = null;
89055
89074
  consentProviderInstance = null;
89056
89075
  cliLogTelemetryLogger = {
89057
- debug: (payload) => writeCliLog("info", payload),
89076
+ debug: () => void 0,
89058
89077
  warn: (payload) => writeCliLog("info", payload),
89059
89078
  error: (payload) => writeCliLog("error", payload)
89060
89079
  };
@@ -89699,15 +89718,15 @@ var init_wsl_utils = __esm({
89699
89718
  const { stdout } = await executePowerShell(command, { powerShellPath: psPath });
89700
89719
  return stdout.trim();
89701
89720
  };
89702
- convertWslPathToWindows = async (path16) => {
89703
- if (/^[a-z]+:\/\//i.test(path16)) {
89704
- return path16;
89721
+ convertWslPathToWindows = async (path18) => {
89722
+ if (/^[a-z]+:\/\//i.test(path18)) {
89723
+ return path18;
89705
89724
  }
89706
89725
  try {
89707
- const { stdout } = await execFile2("wslpath", ["-aw", path16], { encoding: "utf8" });
89726
+ const { stdout } = await execFile2("wslpath", ["-aw", path18], { encoding: "utf8" });
89708
89727
  return stdout.trim();
89709
89728
  } catch {
89710
- return path16;
89729
+ return path18;
89711
89730
  }
89712
89731
  };
89713
89732
  }
@@ -90106,19 +90125,19 @@ var init_open = __esm({
90106
90125
  }
90107
90126
  const subprocess = childProcess3.spawn(command, cliArguments, childProcessOptions);
90108
90127
  if (options.wait) {
90109
- return new Promise((resolve2, reject) => {
90128
+ return new Promise((resolve3, reject) => {
90110
90129
  subprocess.once("error", reject);
90111
90130
  subprocess.once("close", (exitCode) => {
90112
90131
  if (!options.allowNonzeroExitCode && exitCode !== 0) {
90113
90132
  reject(new Error(`Exited with code ${exitCode}`));
90114
90133
  return;
90115
90134
  }
90116
- resolve2(subprocess);
90135
+ resolve3(subprocess);
90117
90136
  });
90118
90137
  });
90119
90138
  }
90120
90139
  if (isFallbackAttempt) {
90121
- return new Promise((resolve2, reject) => {
90140
+ return new Promise((resolve3, reject) => {
90122
90141
  subprocess.once("error", reject);
90123
90142
  subprocess.once("spawn", () => {
90124
90143
  subprocess.once("close", (exitCode) => {
@@ -90128,17 +90147,17 @@ var init_open = __esm({
90128
90147
  return;
90129
90148
  }
90130
90149
  subprocess.unref();
90131
- resolve2(subprocess);
90150
+ resolve3(subprocess);
90132
90151
  });
90133
90152
  });
90134
90153
  });
90135
90154
  }
90136
90155
  subprocess.unref();
90137
- return new Promise((resolve2, reject) => {
90156
+ return new Promise((resolve3, reject) => {
90138
90157
  subprocess.once("error", reject);
90139
90158
  subprocess.once("spawn", () => {
90140
90159
  subprocess.off("error", reject);
90141
- resolve2(subprocess);
90160
+ resolve3(subprocess);
90142
90161
  });
90143
90162
  });
90144
90163
  };
@@ -91200,9 +91219,9 @@ function BrowserLoginProvider({
91200
91219
  }
91201
91220
  if (shouldConfirm) {
91202
91221
  setState({ ...idleState, phase: "confirming" });
91203
- await new Promise((resolve2, reject) => {
91222
+ await new Promise((resolve3, reject) => {
91204
91223
  pendingConfirmationRef.current = {
91205
- resolve: resolve2,
91224
+ resolve: resolve3,
91206
91225
  reject: (reason) => {
91207
91226
  reject(reason);
91208
91227
  return void 0;
@@ -91211,9 +91230,9 @@ function BrowserLoginProvider({
91211
91230
  });
91212
91231
  }
91213
91232
  setState({ ...idleState, phase: "waiting" });
91214
- const manualClerkToken = new Promise((resolve2, reject) => {
91233
+ const manualClerkToken = new Promise((resolve3, reject) => {
91215
91234
  pendingManualTokenRef.current = {
91216
- resolve: resolve2,
91235
+ resolve: resolve3,
91217
91236
  reject: (reason) => {
91218
91237
  reject(reason);
91219
91238
  return void 0;
@@ -91244,9 +91263,9 @@ function BrowserLoginProvider({
91244
91263
  errorMessage: "",
91245
91264
  loginUrl: ""
91246
91265
  });
91247
- await new Promise((resolve2) => {
91266
+ await new Promise((resolve3) => {
91248
91267
  setTimeout(() => {
91249
- resolve2(void 0);
91268
+ resolve3(void 0);
91250
91269
  }, MANUAL_PASTE_FINALIZING_MS);
91251
91270
  });
91252
91271
  }
@@ -91425,17 +91444,20 @@ import * as fs13 from "node:fs";
91425
91444
  import * as path9 from "node:path";
91426
91445
  import * as os6 from "node:os";
91427
91446
  import { execSync } from "node:child_process";
91447
+ function isProjectDirOccupied(projectDir) {
91448
+ return fs13.existsSync(projectDir) && fs13.readdirSync(projectDir).length > 0;
91449
+ }
91450
+ function assertProjectDirAvailable(projectDir) {
91451
+ if (isProjectDirOccupied(projectDir)) {
91452
+ throw tagError(
91453
+ new Error(`${projectDir} already exists and is not empty`),
91454
+ TELEMETRY_ERROR_CODES.PREREQUISITE_MISSING
91455
+ );
91456
+ }
91457
+ }
91428
91458
  async function scaffoldProject(options) {
91429
91459
  const { projectDir, template } = options;
91430
- if (fs13.existsSync(projectDir)) {
91431
- const entries = fs13.readdirSync(projectDir);
91432
- if (entries.length > 0) {
91433
- throw tagError(
91434
- new Error(`${projectDir} already exists and is not empty`),
91435
- TELEMETRY_ERROR_CODES.PREREQUISITE_MISSING
91436
- );
91437
- }
91438
- }
91460
+ assertProjectDirAvailable(projectDir);
91439
91461
  const localTemplateDir = process.env["COPILOTKIT_TEMPLATE_DIR"];
91440
91462
  if (localTemplateDir !== void 0 && localTemplateDir !== "") {
91441
91463
  if (!fs13.existsSync(localTemplateDir)) {
@@ -92386,11 +92408,11 @@ var init_theme = __esm({
92386
92408
 
92387
92409
  // apps/cli/src/ui/hosted-project-select.tsx
92388
92410
  function defer() {
92389
- let resolve2;
92411
+ let resolve3;
92390
92412
  const promise2 = new Promise((res) => {
92391
- resolve2 = res;
92413
+ resolve3 = res;
92392
92414
  });
92393
- return { promise: promise2, resolve: resolve2 };
92415
+ return { promise: promise2, resolve: resolve3 };
92394
92416
  }
92395
92417
  function ProjectExplainer({ dim = false }) {
92396
92418
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Text, { dimColor: dim, children: "An Intelligence project is where this app's threads, messages, and analytics are stored." });
@@ -92838,7 +92860,7 @@ var init_skills_install = __esm({
92838
92860
  SKILLS_SOURCE = "CopilotKit/CopilotKit/skills";
92839
92861
  ALL_SELECTION = "*";
92840
92862
  SELECTION_TOKEN = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
92841
- defaultRunner = (command, args) => new Promise((resolve2, reject) => {
92863
+ defaultRunner = (command, args) => new Promise((resolve3, reject) => {
92842
92864
  const child = spawn(command, [...args], {
92843
92865
  stdio: "inherit",
92844
92866
  // `npx` is a `.cmd` shim on Windows and is only resolvable through a shell
@@ -92848,7 +92870,7 @@ var init_skills_install = __esm({
92848
92870
  });
92849
92871
  child.on("error", reject);
92850
92872
  child.on("close", (code) => {
92851
- resolve2(code ?? 1);
92873
+ resolve3(code ?? 1);
92852
92874
  });
92853
92875
  });
92854
92876
  }
@@ -92885,14 +92907,14 @@ var defaultWriter;
92885
92907
  var init_clipboard = __esm({
92886
92908
  "apps/cli/src/services/clipboard.ts"() {
92887
92909
  "use strict";
92888
- defaultWriter = (clipboardCommand, text) => new Promise((resolve2, reject) => {
92910
+ defaultWriter = (clipboardCommand, text) => new Promise((resolve3, reject) => {
92889
92911
  const child = spawn2(clipboardCommand.command, [...clipboardCommand.args], {
92890
92912
  stdio: ["pipe", "ignore", "ignore"]
92891
92913
  });
92892
92914
  child.on("error", reject);
92893
92915
  child.on("close", (code) => {
92894
92916
  if (code === 0) {
92895
- resolve2();
92917
+ resolve3();
92896
92918
  return;
92897
92919
  }
92898
92920
  reject(new Error(`${clipboardCommand.command} exited with code ${code ?? "null"}`));
@@ -93307,12 +93329,12 @@ var init_docs = __esm({
93307
93329
  import { spawn as spawn3 } from "node:child_process";
93308
93330
  import { StringDecoder } from "node:string_decoder";
93309
93331
  function delay2(ms) {
93310
- return new Promise((resolve2) => {
93311
- setTimeout(resolve2, ms);
93332
+ return new Promise((resolve3) => {
93333
+ setTimeout(resolve3, ms);
93312
93334
  });
93313
93335
  }
93314
93336
  function runInstallOnce(cwd2, command) {
93315
- return new Promise((resolve2) => {
93337
+ return new Promise((resolve3) => {
93316
93338
  const child = spawn3(command, { cwd: cwd2, shell: true, stdio: ["ignore", "pipe", "pipe"] });
93317
93339
  const stdoutDecoder = new StringDecoder("utf8");
93318
93340
  const stderrDecoder = new StringDecoder("utf8");
@@ -93331,7 +93353,7 @@ function runInstallOnce(cwd2, command) {
93331
93353
  }
93332
93354
  });
93333
93355
  child.once("error", (error48) => {
93334
- resolve2({
93356
+ resolve3({
93335
93357
  ok: false,
93336
93358
  code: null,
93337
93359
  stdoutTail: "",
@@ -93342,7 +93364,7 @@ function runInstallOnce(cwd2, command) {
93342
93364
  child.once("close", (code) => {
93343
93365
  stdout += stdoutDecoder.end();
93344
93366
  stderr += stderrDecoder.end();
93345
- resolve2({
93367
+ resolve3({
93346
93368
  ok: code === 0,
93347
93369
  code,
93348
93370
  stdoutTail: stdout.slice(-STDOUT_TAIL_LIMIT).trim(),
@@ -93437,15 +93459,146 @@ var init_vendor_env_keys = __esm({
93437
93459
  }
93438
93460
  });
93439
93461
 
93462
+ // apps/cli/src/services/env-file.ts
93463
+ import fs16 from "node:fs";
93464
+ import path13 from "node:path";
93465
+ function escapeRegExp(s) {
93466
+ return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
93467
+ }
93468
+ function envLineRegExp(key) {
93469
+ return new RegExp(`^[ \\t]*(?:export\\s+)?${escapeRegExp(key)}=.*$`, "m");
93470
+ }
93471
+ function upsertEnvVar(content, key, value) {
93472
+ const line = `${key}=${value}`;
93473
+ const re = envLineRegExp(key);
93474
+ if (re.test(content)) {
93475
+ return content.replace(re, () => line);
93476
+ }
93477
+ const separator = content.length > 0 && !content.endsWith("\n") ? "\n" : "";
93478
+ return `${content}${separator}${line}
93479
+ `;
93480
+ }
93481
+ function writeVendorKey(projectDir, key, value) {
93482
+ const trimmed = value.trim();
93483
+ if (trimmed === "" || isPlaceholderValue(trimmed)) {
93484
+ return;
93485
+ }
93486
+ const envPath = path13.join(projectDir, ".env");
93487
+ const existing = fs16.existsSync(envPath) ? fs16.readFileSync(envPath, "utf8") : "";
93488
+ fs16.writeFileSync(envPath, upsertEnvVar(existing, key, trimmed));
93489
+ }
93490
+ var init_env_file = __esm({
93491
+ "apps/cli/src/services/env-file.ts"() {
93492
+ "use strict";
93493
+ init_vendor_key_predicate();
93494
+ }
93495
+ });
93496
+
93497
+ // apps/cli/src/ui/vendor-key-prompt.tsx
93498
+ function VendorKeyPrompt({
93499
+ requirements,
93500
+ onComplete
93501
+ }) {
93502
+ const [index, setIndex] = (0, import_react39.useState)(0);
93503
+ const [value, setValue] = (0, import_react39.useState)("");
93504
+ const [error48, setError] = (0, import_react39.useState)(null);
93505
+ const indexRef = (0, import_react39.useRef)(0);
93506
+ const valueRef = (0, import_react39.useRef)("");
93507
+ const acceptedRef = (0, import_react39.useRef)([]);
93508
+ const current = requirements[index];
93509
+ use_input_default((input, key) => {
93510
+ const active = requirements[indexRef.current];
93511
+ if (!active) {
93512
+ return;
93513
+ }
93514
+ if (key.return) {
93515
+ const trimmed = valueRef.current.trim();
93516
+ if (trimmed !== "" && isPlaceholderValue(trimmed)) {
93517
+ valueRef.current = "";
93518
+ setValue("");
93519
+ setError(
93520
+ `That looks like a placeholder, not a key \u2014 enter a real ${active.requirement.key} or press Enter to skip.`
93521
+ );
93522
+ return;
93523
+ }
93524
+ setError(null);
93525
+ const nextAccepted = trimmed === "" ? acceptedRef.current : [...acceptedRef.current, { key: active.requirement.key, value: trimmed }];
93526
+ const nextIndex = indexRef.current + 1;
93527
+ acceptedRef.current = nextAccepted;
93528
+ valueRef.current = "";
93529
+ setValue("");
93530
+ if (nextIndex >= requirements.length) {
93531
+ indexRef.current = nextIndex;
93532
+ setIndex(nextIndex);
93533
+ onComplete(nextAccepted);
93534
+ return;
93535
+ }
93536
+ indexRef.current = nextIndex;
93537
+ setIndex(nextIndex);
93538
+ return;
93539
+ }
93540
+ if (key.backspace || key.delete) {
93541
+ const next = valueRef.current.slice(0, -1);
93542
+ valueRef.current = next;
93543
+ setValue(next);
93544
+ return;
93545
+ }
93546
+ if (key.ctrl || key.meta || key.escape || key.tab || key.upArrow || key.downArrow || key.leftArrow || key.rightArrow) {
93547
+ return;
93548
+ }
93549
+ const cleaned = Array.from(input).filter((char) => {
93550
+ const code = char.charCodeAt(0);
93551
+ return code > 31 && code !== 127;
93552
+ }).join("");
93553
+ if (cleaned.length > 0) {
93554
+ const next = valueRef.current + cleaned;
93555
+ valueRef.current = next;
93556
+ setValue(next);
93557
+ setError(null);
93558
+ }
93559
+ });
93560
+ if (!current) {
93561
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Box_default, {});
93562
+ }
93563
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { flexDirection: "column", children: [
93564
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { children: [
93565
+ "Set ",
93566
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { bold: true, children: current.requirement.key }),
93567
+ " now, or press Enter to skip and add it later."
93568
+ ] }),
93569
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { dimColor: true, children: current.requirement.note }),
93570
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { dimColor: true, children: [
93571
+ "Create a key: ",
93572
+ current.requirement.url
93573
+ ] }),
93574
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { children: [
93575
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { children: "> " }),
93576
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { children: "\u2022".repeat(value.length) })
93577
+ ] }),
93578
+ error48 !== null ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: "yellow", children: error48 }) : null
93579
+ ] });
93580
+ }
93581
+ var import_react39, import_jsx_runtime11;
93582
+ var init_vendor_key_prompt = __esm({
93583
+ async "apps/cli/src/ui/vendor-key-prompt.tsx"() {
93584
+ "use strict";
93585
+ await init_build2();
93586
+ import_react39 = __toESM(require_react(), 1);
93587
+ init_vendor_key_predicate();
93588
+ import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
93589
+ }
93590
+ });
93591
+
93440
93592
  // apps/cli/src/ui/init-flow.tsx
93593
+ import * as path14 from "node:path";
93441
93594
  function FrameworkIndicator({ isSelected = false }) {
93442
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Box_default, { marginRight: 1, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: isSelected ? theme.accent : void 0, children: isSelected ? "\u276F" : " " }) });
93595
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box_default, { marginRight: 1, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { color: isSelected ? theme.accent : void 0, children: isSelected ? "\u276F" : " " }) });
93443
93596
  }
93444
93597
  function FrameworkItem({
93445
93598
  isSelected = false,
93446
93599
  label
93447
93600
  }) {
93448
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: isSelected ? theme.accent : void 0, bold: isSelected, children: label });
93601
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { color: isSelected ? theme.accent : void 0, bold: isSelected, children: label });
93449
93602
  }
93450
93603
  function validateName(name) {
93451
93604
  if (name.length === 0)
@@ -93458,6 +93611,13 @@ function validateName(name) {
93458
93611
  return NAME_PATTERN_MESSAGE;
93459
93612
  return null;
93460
93613
  }
93614
+ function checkProjectDirAvailable(name, baseDir = process.cwd()) {
93615
+ const projectDir = path14.resolve(baseDir, name);
93616
+ if (isProjectDirOccupied(projectDir)) {
93617
+ return `A directory named "${name}" already exists here \u2014 choose a different name.`;
93618
+ }
93619
+ return null;
93620
+ }
93461
93621
  function computeFrameworkPickerLimit(rows, itemCount) {
93462
93622
  if (!Number.isFinite(rows) || rows <= 0)
93463
93623
  return itemCount;
@@ -93470,8 +93630,8 @@ function computeFrameworkPickerLimit(rows, itemCount) {
93470
93630
  function useStdoutRows() {
93471
93631
  const { stdout } = use_stdout_default();
93472
93632
  const readRows = () => stdout && Number.isFinite(stdout.rows) && stdout.rows > 0 ? stdout.rows : 0;
93473
- const [rows, setRows] = (0, import_react39.useState)(readRows);
93474
- (0, import_react39.useEffect)(() => {
93633
+ const [rows, setRows] = (0, import_react40.useState)(readRows);
93634
+ (0, import_react40.useEffect)(() => {
93475
93635
  if (!stdout)
93476
93636
  return;
93477
93637
  const update = () => {
@@ -93490,10 +93650,11 @@ function InitFlow({
93490
93650
  initialFramework,
93491
93651
  onComplete,
93492
93652
  onIntelligenceSelected,
93493
- onFrameworkSelected
93653
+ onFrameworkSelected,
93654
+ checkNameAvailable = checkProjectDirAvailable
93494
93655
  }) {
93495
- const [name, setName] = (0, import_react39.useState)(initialName ?? "");
93496
- const [nameError, setNameError] = (0, import_react39.useState)(null);
93656
+ const [name, setName] = (0, import_react40.useState)(initialName ?? "");
93657
+ const [nameError, setNameError] = (0, import_react40.useState)(null);
93497
93658
  function firstStep() {
93498
93659
  if (initialName === null)
93499
93660
  return "name";
@@ -93501,9 +93662,9 @@ function InitFlow({
93501
93662
  return "done";
93502
93663
  return "framework";
93503
93664
  }
93504
- const [step, setStep] = (0, import_react39.useState)(firstStep);
93665
+ const [step, setStep] = (0, import_react40.useState)(firstStep);
93505
93666
  const stdoutRows = useStdoutRows();
93506
- (0, import_react39.useEffect)(() => {
93667
+ (0, import_react40.useEffect)(() => {
93507
93668
  if (initialFramework !== null) {
93508
93669
  onFrameworkSelected?.({
93509
93670
  framework: initialFramework,
@@ -93517,7 +93678,7 @@ function InitFlow({
93517
93678
  });
93518
93679
  }
93519
93680
  }, []);
93520
- (0, import_react39.useEffect)(() => {
93681
+ (0, import_react40.useEffect)(() => {
93521
93682
  if (step === "done" && initialFramework !== null) {
93522
93683
  const chosen = initialFramework;
93523
93684
  onComplete(resolveOptions(name, chosen));
@@ -93539,6 +93700,11 @@ function InitFlow({
93539
93700
  setNameError(error48);
93540
93701
  return;
93541
93702
  }
93703
+ const availabilityError = checkNameAvailable(trimmed);
93704
+ if (availabilityError) {
93705
+ setNameError(availabilityError);
93706
+ return;
93707
+ }
93542
93708
  setNameError(null);
93543
93709
  setName(trimmed);
93544
93710
  advancePastName(trimmed);
@@ -93565,16 +93731,16 @@ function InitFlow({
93565
93731
  frameworkChoices.length
93566
93732
  );
93567
93733
  const frameworkIsScrolling = frameworkLimit < frameworkChoices.length;
93568
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { flexDirection: "column", children: [
93569
- step === "name" && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { flexDirection: "column", children: [
93570
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { bold: true, children: "App name" }),
93571
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { dimColor: true, children: "Names your new app and its folder \u2014 lowercase, numbers, hyphens, max 30" }),
93572
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { children: [
93573
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { children: [
93734
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Box_default, { flexDirection: "column", children: [
93735
+ step === "name" && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Box_default, { flexDirection: "column", children: [
93736
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { bold: true, children: "App name" }),
93737
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { dimColor: true, children: "Names your new app and its folder \u2014 lowercase, numbers, hyphens, max 30" }),
93738
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Box_default, { children: [
93739
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Text, { children: [
93574
93740
  ">",
93575
93741
  " "
93576
93742
  ] }),
93577
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
93743
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
93578
93744
  build_default,
93579
93745
  {
93580
93746
  value: name,
@@ -93584,11 +93750,11 @@ function InitFlow({
93584
93750
  }
93585
93751
  )
93586
93752
  ] }),
93587
- nameError !== null && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: "red", children: nameError })
93753
+ nameError !== null && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { color: "red", children: nameError })
93588
93754
  ] }),
93589
- step === "framework" && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { flexDirection: "column", children: [
93590
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { bold: true, children: "Select agent framework" }),
93591
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
93755
+ step === "framework" && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Box_default, { flexDirection: "column", children: [
93756
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { bold: true, children: "Select agent framework" }),
93757
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
93592
93758
  SelectInput_default,
93593
93759
  {
93594
93760
  items: frameworkChoices,
@@ -93598,7 +93764,7 @@ function InitFlow({
93598
93764
  limit: frameworkLimit
93599
93765
  }
93600
93766
  ),
93601
- frameworkIsScrolling && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { dimColor: true, children: [
93767
+ frameworkIsScrolling && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Text, { dimColor: true, children: [
93602
93768
  "\u2191\u2193 to browse all ",
93603
93769
  frameworkChoices.length,
93604
93770
  " \xB7 \u21B5 select"
@@ -93606,17 +93772,18 @@ function InitFlow({
93606
93772
  ] })
93607
93773
  ] });
93608
93774
  }
93609
- var import_react39, import_jsx_runtime11, DISALLOWED_NAME_CHAR_RE, NAME_PATTERN_MESSAGE, FRAMEWORK_PICKER_RESERVED_ROWS, MIN_FRAMEWORK_PICKER_VISIBLE, MAX_FRAMEWORK_PICKER_VISIBLE;
93775
+ var import_react40, import_jsx_runtime12, DISALLOWED_NAME_CHAR_RE, NAME_PATTERN_MESSAGE, FRAMEWORK_PICKER_RESERVED_ROWS, MIN_FRAMEWORK_PICKER_VISIBLE, MAX_FRAMEWORK_PICKER_VISIBLE;
93610
93776
  var init_init_flow = __esm({
93611
93777
  async "apps/cli/src/ui/init-flow.tsx"() {
93612
93778
  "use strict";
93613
- import_react39 = __toESM(require_react(), 1);
93779
+ import_react40 = __toESM(require_react(), 1);
93614
93780
  await init_build2();
93615
93781
  await init_build3();
93616
93782
  await init_build4();
93617
93783
  init_types();
93784
+ init_project_scaffold();
93618
93785
  init_theme();
93619
- import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
93786
+ import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
93620
93787
  DISALLOWED_NAME_CHAR_RE = /[^a-z0-9-]/;
93621
93788
  NAME_PATTERN_MESSAGE = "Use only lowercase letters, numbers, and hyphens, and do not start or end with a hyphen.";
93622
93789
  FRAMEWORK_PICKER_RESERVED_ROWS = 4;
@@ -93626,8 +93793,8 @@ var init_init_flow = __esm({
93626
93793
  });
93627
93794
 
93628
93795
  // apps/cli/src/services/intelligence-readme.ts
93629
- import * as fs16 from "node:fs";
93630
- import * as path13 from "node:path";
93796
+ import * as fs17 from "node:fs";
93797
+ import * as path15 from "node:path";
93631
93798
  function buildSection(projectSlug) {
93632
93799
  return `${INTELLIGENCE_README_HEADING}
93633
93800
 
@@ -93644,14 +93811,14 @@ Learn more at https://docs.copilotkit.ai.
93644
93811
  `;
93645
93812
  }
93646
93813
  function appendIntelligenceReadme(dir, opts) {
93647
- const readmePath = path13.join(dir, "README.md");
93648
- const existing = fs16.existsSync(readmePath) ? fs16.readFileSync(readmePath, "utf8") : "";
93814
+ const readmePath = path15.join(dir, "README.md");
93815
+ const existing = fs17.existsSync(readmePath) ? fs17.readFileSync(readmePath, "utf8") : "";
93649
93816
  if (existing.includes(INTELLIGENCE_README_HEADING)) {
93650
93817
  return;
93651
93818
  }
93652
93819
  const section = buildSection(opts.projectSlug);
93653
93820
  const prefix = existing.length === 0 ? "" : existing.endsWith("\n") ? "\n" : "\n\n";
93654
- fs16.writeFileSync(readmePath, existing + prefix + section);
93821
+ fs17.writeFileSync(readmePath, existing + prefix + section);
93655
93822
  }
93656
93823
  var INTELLIGENCE_README_HEADING;
93657
93824
  var init_intelligence_readme = __esm({
@@ -93684,7 +93851,7 @@ import {
93684
93851
  readFileSync as readFileSync6,
93685
93852
  rmSync as rmSync3
93686
93853
  } from "node:fs";
93687
- import * as path14 from "node:path";
93854
+ import * as path16 from "node:path";
93688
93855
  import { execSync as execSync2 } from "node:child_process";
93689
93856
  function shouldRenderInitBrowserLoginConfirmation(phase) {
93690
93857
  return phase === "confirming" || phase === "waiting" || phase === "finalizing";
@@ -93701,12 +93868,12 @@ async function initGit(projectDir) {
93701
93868
  function commandExists(command, environment = process.env, platform3 = process.platform) {
93702
93869
  const pathValue = environment.PATH ?? "";
93703
93870
  const pathExtensions = platform3 === "win32" ? (environment.PATHEXT ?? ".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean) : [""];
93704
- for (const searchPath of pathValue.split(path14.delimiter)) {
93871
+ for (const searchPath of pathValue.split(path16.delimiter)) {
93705
93872
  if (!searchPath) {
93706
93873
  continue;
93707
93874
  }
93708
93875
  for (const extension of pathExtensions) {
93709
- const candidatePath = path14.join(searchPath, `${command}${extension}`);
93876
+ const candidatePath = path16.join(searchPath, `${command}${extension}`);
93710
93877
  try {
93711
93878
  accessSync(candidatePath, constants2.X_OK);
93712
93879
  return true;
@@ -93716,15 +93883,18 @@ function commandExists(command, environment = process.env, platform3 = process.p
93716
93883
  }
93717
93884
  return false;
93718
93885
  }
93886
+ function vendorKeyPromptInteractive() {
93887
+ return process.stdin.isTTY === true && process.stdout.isTTY === true;
93888
+ }
93719
93889
  function buildInitNextSteps(templateDefinition, projectName, result, unsatisfiedKeys, installAlreadyRan = false) {
93720
93890
  const missingPrerequisites = templateDefinition.prerequisites.filter(
93721
93891
  (prerequisite) => result.missingPrerequisites.includes(prerequisite.command)
93722
93892
  );
93723
- const unsatisfiedByKey = new Map(
93724
- unsatisfiedKeys.map((u) => [u.requirement.key, u])
93893
+ const vendorKeys = new Set(
93894
+ resolveVendorEnvKeys(templateDefinition).map((req) => req.key)
93725
93895
  );
93726
93896
  const envNotes = templateDefinition.environment.filter(
93727
- (envKey) => !(envKey.key === "COPILOTKIT_LICENSE_TOKEN" && result.licenseWritten) && !unsatisfiedByKey.has(envKey.key)
93897
+ (envKey) => !(envKey.key === "COPILOTKIT_LICENSE_TOKEN" && result.licenseWritten) && !vendorKeys.has(envKey.key)
93728
93898
  ).map((envKey) => {
93729
93899
  const envTarget = result.envCreatedFromExample || result.licenseWritten ? "the scaffolded .env file" : ".env";
93730
93900
  return `Set ${envKey.key} in ${envTarget}. ${envKey.note}`;
@@ -93772,6 +93942,9 @@ function buildInitNextSteps(templateDefinition, projectName, result, unsatisfied
93772
93942
  code: `${requirement.key}=${requirement.example}`
93773
93943
  });
93774
93944
  }
93945
+ for (const note of templateDefinition.setupNotes ?? []) {
93946
+ steps.push(note.code !== void 0 ? { ...note } : { text: note.text });
93947
+ }
93775
93948
  steps.push({
93776
93949
  text: ` Start the dev server${SEP2}`,
93777
93950
  code: templateDefinition.runCommand
@@ -93870,6 +94043,7 @@ async function scaffoldInitProject(options, dependencies = defaultInitScaffoldDe
93870
94043
  TELEMETRY_ERROR_CODES.INVALID_FRAMEWORK
93871
94044
  );
93872
94045
  }
94046
+ dependencies.assertProjectDirAvailable(projectDir);
93873
94047
  onPhaseChange?.("auth");
93874
94048
  const { cliToken: ensuredToken, alreadyAuthenticated } = await ensureCliToken2(
93875
94049
  dependencies,
@@ -94029,17 +94203,18 @@ function ScaffoldProgress({
94029
94203
  const { exit } = use_app_default();
94030
94204
  const browserLogin = useBrowserLogin();
94031
94205
  const templateDefinition = resolveInitTemplate(options);
94032
- const [phase, setPhase] = (0, import_react40.useState)("auth");
94033
- const [errorMessage, setErrorMessage] = (0, import_react40.useState)("");
94034
- const scaffoldErrorRef = (0, import_react40.useRef)(null);
94035
- const [authMessage, setAuthMessage] = (0, import_react40.useState)("");
94036
- const [nextSteps, setNextSteps] = (0, import_react40.useState)([]);
94037
- const [scaffoldWarnings, setScaffoldWarnings] = (0, import_react40.useState)([]);
94038
- const [scaffoldResult, setScaffoldResult] = (0, import_react40.useState)(null);
94039
- const [installError, setInstallError] = (0, import_react40.useState)(null);
94040
- const isMountedRef = (0, import_react40.useRef)(true);
94041
- const selectionDeferredRef = (0, import_react40.useRef)(null);
94042
- const scaffoldDependencies = (0, import_react40.useMemo)(
94206
+ const [phase, setPhase] = (0, import_react41.useState)("auth");
94207
+ const [errorMessage, setErrorMessage] = (0, import_react41.useState)("");
94208
+ const scaffoldErrorRef = (0, import_react41.useRef)(null);
94209
+ const [authMessage, setAuthMessage] = (0, import_react41.useState)("");
94210
+ const [nextSteps, setNextSteps] = (0, import_react41.useState)([]);
94211
+ const [scaffoldWarnings, setScaffoldWarnings] = (0, import_react41.useState)([]);
94212
+ const [scaffoldResult, setScaffoldResult] = (0, import_react41.useState)(null);
94213
+ const [vendorKeyRequirements, setVendorKeyRequirements] = (0, import_react41.useState)([]);
94214
+ const [installError, setInstallError] = (0, import_react41.useState)(null);
94215
+ const isMountedRef = (0, import_react41.useRef)(true);
94216
+ const selectionDeferredRef = (0, import_react41.useRef)(null);
94217
+ const scaffoldDependencies = (0, import_react41.useMemo)(
94043
94218
  () => ({
94044
94219
  ...defaultInitScaffoldDependencies,
94045
94220
  login: browserLogin.runLogin,
@@ -94050,8 +94225,8 @@ function ScaffoldProgress({
94050
94225
  new Error("Not authenticated for project selection.")
94051
94226
  );
94052
94227
  }
94053
- return new Promise((resolve2, reject) => {
94054
- selectionDeferredRef.current = { resolve: resolve2, reject };
94228
+ return new Promise((resolve3, reject) => {
94229
+ selectionDeferredRef.current = { resolve: resolve3, reject };
94055
94230
  });
94056
94231
  },
94057
94232
  // Test-injected deps win over the inline wiring above; the production
@@ -94060,7 +94235,7 @@ function ScaffoldProgress({
94060
94235
  }),
94061
94236
  [browserLogin.runLogin, dependencies]
94062
94237
  );
94063
- (0, import_react40.useEffect)(() => {
94238
+ (0, import_react41.useEffect)(() => {
94064
94239
  if (phase === "success" || phase === "error") {
94065
94240
  const flushThenExit = setTimeout(
94066
94241
  () => exit(resolveScaffoldExitError(phase, scaffoldErrorRef.current)),
@@ -94070,13 +94245,13 @@ function ScaffoldProgress({
94070
94245
  }
94071
94246
  return void 0;
94072
94247
  }, [phase, exit]);
94073
- (0, import_react40.useEffect)(
94248
+ (0, import_react41.useEffect)(
94074
94249
  () => () => {
94075
94250
  isMountedRef.current = false;
94076
94251
  },
94077
94252
  []
94078
94253
  );
94079
- (0, import_react40.useEffect)(() => {
94254
+ (0, import_react41.useEffect)(() => {
94080
94255
  let cancelled = false;
94081
94256
  async function run() {
94082
94257
  const result = await scaffoldInitProject(
@@ -94098,7 +94273,18 @@ function ScaffoldProgress({
94098
94273
  if (cancelled)
94099
94274
  return;
94100
94275
  setScaffoldResult(result);
94101
- setPhase("install-prompt");
94276
+ const interactive = (scaffoldDependencies.isVendorKeyPromptInteractive ?? vendorKeyPromptInteractive)();
94277
+ const unsatisfied = interactive ? findUnsatisfiedVendorKeys(
94278
+ process.env,
94279
+ scaffoldDependencies.readProjectEnvFile(result.projectDir),
94280
+ resolveVendorEnvKeys(templateDefinition)
94281
+ ) : [];
94282
+ if (unsatisfied.length > 0) {
94283
+ setVendorKeyRequirements(unsatisfied);
94284
+ setPhase("vendor-key");
94285
+ } else {
94286
+ setPhase("install-prompt");
94287
+ }
94102
94288
  }
94103
94289
  run().catch((err) => {
94104
94290
  if (cancelled)
@@ -94136,33 +94322,33 @@ function ScaffoldProgress({
94136
94322
  setPhase("success");
94137
94323
  }
94138
94324
  if (shouldRenderInitBrowserLoginConfirmation(browserLogin.state.phase)) {
94139
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(BrowserLoginConfirmation, { reason: authReason });
94325
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(BrowserLoginConfirmation, { reason: authReason });
94140
94326
  }
94141
94327
  if (phase === "auth") {
94142
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Box_default, { flexDirection: "column", children: [
94143
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
94144
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { children: authReason }),
94145
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { dimColor: true, children: "Sign in with your browser to continue." })
94328
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Box_default, { flexDirection: "column", children: [
94329
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
94330
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text, { children: authReason }),
94331
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text, { dimColor: true, children: "Sign in with your browser to continue." })
94146
94332
  ] }),
94147
- authMessage ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { color: "yellow", children: authMessage }) : null,
94148
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Spinner, { label: "\u{1FA81} Verifying authentication\u2026" })
94333
+ authMessage ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text, { color: "yellow", children: authMessage }) : null,
94334
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Spinner, { label: "\u{1FA81} Verifying authentication\u2026" })
94149
94335
  ] });
94150
94336
  }
94151
94337
  if (phase === "license") {
94152
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Box_default, { flexDirection: "column", children: [
94153
- authMessage ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { color: "yellow", children: authMessage }) : null,
94154
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Spinner, { label: "\u{1FA81} Issuing license key\u2026" })
94338
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Box_default, { flexDirection: "column", children: [
94339
+ authMessage ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text, { color: "yellow", children: authMessage }) : null,
94340
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Spinner, { label: "\u{1FA81} Issuing license key\u2026" })
94155
94341
  ] });
94156
94342
  }
94157
94343
  if (phase === "scaffold") {
94158
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Spinner, { label: "\u{1FA81} Downloading template\u2026" }) });
94344
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Spinner, { label: "\u{1FA81} Downloading template\u2026" }) });
94159
94345
  }
94160
94346
  if (phase === "select-project") {
94161
94347
  const auth = authStore.get();
94162
94348
  if (auth === null) {
94163
94349
  return null;
94164
94350
  }
94165
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
94351
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
94166
94352
  HostedProjectSelect,
94167
94353
  {
94168
94354
  apiClient: createApiClient(getOpsApiUrl(), auth.cliToken),
@@ -94182,13 +94368,29 @@ function ScaffoldProgress({
94182
94368
  );
94183
94369
  }
94184
94370
  if (phase === "activate-intelligence") {
94185
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Spinner, { label: "\u{1FA81} Activating Intelligence\u2026" }) });
94371
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Spinner, { label: "\u{1FA81} Activating Intelligence\u2026" }) });
94186
94372
  }
94187
94373
  if (phase === "git") {
94188
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Spinner, { label: "Initializing git repository\u2026" }) });
94374
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Spinner, { label: "Initializing git repository\u2026" }) });
94375
+ }
94376
+ if (phase === "vendor-key" && scaffoldResult) {
94377
+ const result = scaffoldResult;
94378
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
94379
+ VendorKeyPrompt,
94380
+ {
94381
+ requirements: vendorKeyRequirements,
94382
+ onComplete: (entries) => {
94383
+ const write = scaffoldDependencies.writeVendorKey ?? writeVendorKey;
94384
+ for (const entry of entries) {
94385
+ write(result.projectDir, entry.key, entry.value);
94386
+ }
94387
+ setPhase("install-prompt");
94388
+ }
94389
+ }
94390
+ );
94189
94391
  }
94190
94392
  if (phase === "install-prompt" && scaffoldResult) {
94191
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
94393
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
94192
94394
  InstallPrompt,
94193
94395
  {
94194
94396
  installCommand: templateDefinition.installCommand,
@@ -94224,11 +94426,11 @@ function ScaffoldProgress({
94224
94426
  );
94225
94427
  }
94226
94428
  if (phase === "installing") {
94227
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Spinner, { label: "\u{1FA81} Installing dependencies\u2026" });
94429
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Spinner, { label: "\u{1FA81} Installing dependencies\u2026" });
94228
94430
  }
94229
94431
  if (phase === "success") {
94230
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Box_default, { flexDirection: "column", children: [
94231
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(SuccessText, { marker: templateDefinition.successEmoji, children: [
94432
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Box_default, { flexDirection: "column", children: [
94433
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(SuccessText, { marker: templateDefinition.successEmoji, children: [
94232
94434
  'App "',
94233
94435
  options.name,
94234
94436
  '" created successfully!'
@@ -94236,15 +94438,15 @@ function ScaffoldProgress({
94236
94438
  installError ? (
94237
94439
  // The error detail is not inlined here — it goes to the CLI log; the
94238
94440
  // second line points the user at the full captured output.
94239
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
94240
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { color: "yellow", children: "Install didn't finish after a retry." }),
94241
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Text, { color: "yellow", children: [
94441
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
94442
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text, { color: "yellow", children: "Install didn't finish after a retry." }),
94443
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Text, { color: "yellow", children: [
94242
94444
  "Full output: ",
94243
94445
  getCliLogPath()
94244
94446
  ] })
94245
94447
  ] })
94246
94448
  ) : null,
94247
- scaffoldWarnings.map((warning, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Text, { color: "yellow", children: [
94449
+ scaffoldWarnings.map((warning, index) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Text, { color: "yellow", children: [
94248
94450
  "\u26A0 ",
94249
94451
  warning
94250
94452
  ] }, `warn-${index}`)),
@@ -94257,27 +94459,27 @@ function ScaffoldProgress({
94257
94459
  // white) washes out on one background or the other. The `code` tail is
94258
94460
  // `bold` to stand out from prose; prose-only lines (headings, notes)
94259
94461
  // carry no `code`.
94260
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Text, { children: [
94462
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Text, { children: [
94261
94463
  step.text,
94262
- step.code !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { bold: true, children: step.code }) : null
94464
+ step.code !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text, { bold: true, children: step.code }) : null
94263
94465
  ] }, `step-${index}`)
94264
94466
  )),
94265
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { children: " " })
94467
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text, { children: " " })
94266
94468
  ] });
94267
94469
  }
94268
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Box_default, { flexDirection: "column", children: [
94269
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Text, { color: "red", children: [
94470
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Box_default, { flexDirection: "column", children: [
94471
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Text, { color: "red", children: [
94270
94472
  "Init failed: ",
94271
94473
  errorMessage
94272
94474
  ] }),
94273
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { children: " " })
94475
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text, { children: " " })
94274
94476
  ] });
94275
94477
  }
94276
94478
  function InstallPrompt({
94277
94479
  installCommand,
94278
94480
  onAnswer
94279
94481
  }) {
94280
- const answeredRef = (0, import_react40.useRef)(false);
94482
+ const answeredRef = (0, import_react41.useRef)(false);
94281
94483
  use_input_default((input, key) => {
94282
94484
  if (answeredRef.current)
94283
94485
  return;
@@ -94289,16 +94491,16 @@ function InstallPrompt({
94289
94491
  onAnswer(false);
94290
94492
  }
94291
94493
  });
94292
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box_default, { flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Text, { children: [
94494
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Box_default, { flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Text, { children: [
94293
94495
  "Want me to install the dependencies for you now? (",
94294
94496
  installCommand,
94295
94497
  ")",
94296
94498
  " ",
94297
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { bold: true, children: "[Y/n]" })
94499
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text, { bold: true, children: "[Y/n]" })
94298
94500
  ] }) });
94299
94501
  }
94300
94502
  function renderDefaultScaffoldProgress(options, telemetry) {
94301
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ScaffoldProgress, { options, telemetry });
94503
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ScaffoldProgress, { options, telemetry });
94302
94504
  }
94303
94505
  function resolvePrefilledOptions(name, intelligence, framework) {
94304
94506
  if (name === null)
@@ -94329,8 +94531,8 @@ function InitApp({
94329
94531
  initialIntelligence,
94330
94532
  initialFramework
94331
94533
  );
94332
- const [options, setOptions] = (0, import_react40.useState)(prefilled);
94333
- (0, import_react40.useEffect)(() => {
94534
+ const [options, setOptions] = (0, import_react41.useState)(prefilled);
94535
+ (0, import_react41.useEffect)(() => {
94334
94536
  if (prefilled !== null) {
94335
94537
  if (initialIntelligence !== null) {
94336
94538
  onIntelligenceSelected?.({
@@ -94346,13 +94548,13 @@ function InitApp({
94346
94548
  }
94347
94549
  }
94348
94550
  }, []);
94349
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Box_default, { flexDirection: "column", children: [
94350
- !noBanner && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
94351
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Banner, {}),
94352
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IntelligenceFeatures, {})
94551
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Box_default, { flexDirection: "column", children: [
94552
+ !noBanner && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
94553
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Banner, {}),
94554
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IntelligenceFeatures, {})
94353
94555
  ] }),
94354
- options !== null ? renderScaffoldProgress(options, telemetry) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
94355
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
94556
+ options !== null ? renderScaffoldProgress(options, telemetry) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
94557
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
94356
94558
  InitFlow,
94357
94559
  {
94358
94560
  initialName,
@@ -94367,7 +94569,7 @@ function InitApp({
94367
94569
  }
94368
94570
  }
94369
94571
  ),
94370
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CliTip, {})
94572
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CliTip, {})
94371
94573
  ] })
94372
94574
  ] });
94373
94575
  }
@@ -94379,6 +94581,13 @@ async function runInit(flags, callbacks) {
94379
94581
  if (nameError !== null) {
94380
94582
  throw tagError(new Error(nameError), TELEMETRY_ERROR_CODES.INVALID_NAME);
94381
94583
  }
94584
+ const availabilityError = checkProjectDirAvailable(initialName);
94585
+ if (availabilityError !== null) {
94586
+ throw tagError(
94587
+ new Error(availabilityError),
94588
+ TELEMETRY_ERROR_CODES.PREREQUISITE_MISSING
94589
+ );
94590
+ }
94382
94591
  }
94383
94592
  const initialIntelligence = flags.intelligence ?? null;
94384
94593
  const frameworkFlagRaw = flags.framework?.trim() ?? null;
@@ -94391,7 +94600,7 @@ async function runInit(flags, callbacks) {
94391
94600
  }
94392
94601
  const initialFramework = frameworkFlag;
94393
94602
  const { waitUntilExit } = render_default(
94394
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(BrowserLoginProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
94603
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(BrowserLoginProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
94395
94604
  InitApp,
94396
94605
  {
94397
94606
  initialName,
@@ -94406,11 +94615,11 @@ async function runInit(flags, callbacks) {
94406
94615
  );
94407
94616
  await waitUntilExit();
94408
94617
  }
94409
- var import_react40, import_jsx_runtime12, PROJECT_CREATION_AUTH_HANDOFF, INIT_AUTH_REASON_WITH_LICENSE, INIT_AUTH_REASON_ACCOUNT_ONLY, defaultInitScaffoldDependencies;
94618
+ var import_react41, import_jsx_runtime13, PROJECT_CREATION_AUTH_HANDOFF, INIT_AUTH_REASON_WITH_LICENSE, INIT_AUTH_REASON_ACCOUNT_ONLY, defaultInitScaffoldDependencies;
94410
94619
  var init_init = __esm({
94411
94620
  async "apps/cli/src/commands/init.tsx"() {
94412
94621
  "use strict";
94413
- import_react40 = __toESM(require_react(), 1);
94622
+ import_react41 = __toESM(require_react(), 1);
94414
94623
  await init_build2();
94415
94624
  await init_build2();
94416
94625
  init_types();
@@ -94420,6 +94629,8 @@ var init_init = __esm({
94420
94629
  init_intelligence_activation();
94421
94630
  init_install_dependencies();
94422
94631
  init_vendor_env_keys();
94632
+ init_env_file();
94633
+ await init_vendor_key_prompt();
94423
94634
  init_config_service();
94424
94635
  init_event_properties();
94425
94636
  init_cli_logs();
@@ -94433,7 +94644,7 @@ var init_init = __esm({
94433
94644
  await init_hosted_project_select();
94434
94645
  init_project_config();
94435
94646
  init_intelligence_readme();
94436
- import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
94647
+ import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
94437
94648
  PROJECT_CREATION_AUTH_HANDOFF = {
94438
94649
  source: "cli",
94439
94650
  mode: "project_creation"
@@ -94446,17 +94657,18 @@ var init_init = __esm({
94446
94657
  getCliToken: () => authStore.getToken(),
94447
94658
  createApiClient,
94448
94659
  getOpsApiUrl,
94660
+ assertProjectDirAvailable,
94449
94661
  scaffoldProject,
94450
94662
  initGit,
94451
94663
  copyEnvExample,
94452
94664
  cleanupTestHarness: removeTestHarnessArtifacts,
94453
94665
  writeLicenseKey,
94454
94666
  commandExists,
94455
- resolveProjectDir: (projectName) => path14.resolve(process.cwd(), projectName),
94667
+ resolveProjectDir: (projectName) => path16.resolve(process.cwd(), projectName),
94456
94668
  activateIntelligence,
94457
94669
  installDependencies,
94458
94670
  readProjectEnvFile: (projectDir) => {
94459
- const envPath = path14.join(projectDir, ".env");
94671
+ const envPath = path16.join(projectDir, ".env");
94460
94672
  return existsSync7(envPath) ? readFileSync6(envPath, "utf8") : "";
94461
94673
  },
94462
94674
  resolveHostedScaffoldConfig,
@@ -94467,7 +94679,9 @@ var init_init = __esm({
94467
94679
  },
94468
94680
  writeProjectConfig,
94469
94681
  appendIntelligenceReadme,
94470
- writeHostedApiKey
94682
+ writeHostedApiKey,
94683
+ writeVendorKey,
94684
+ isVendorKeyPromptInteractive: vendorKeyPromptInteractive
94471
94685
  };
94472
94686
  }
94473
94687
  });
@@ -94496,7 +94710,7 @@ var init_version = __esm({
94496
94710
  // apps/cli/src/ui/login-flow.tsx
94497
94711
  function LoginFlow({ onComplete }) {
94498
94712
  const { runLogin: runLogin2 } = useBrowserLogin();
94499
- (0, import_react41.useEffect)(() => {
94713
+ (0, import_react42.useEffect)(() => {
94500
94714
  runLogin2().then(() => {
94501
94715
  onComplete({ success: true });
94502
94716
  }).catch((error48) => {
@@ -94508,15 +94722,15 @@ function LoginFlow({ onComplete }) {
94508
94722
  onComplete({ error: fallbackError, success: false });
94509
94723
  });
94510
94724
  }, [onComplete, runLogin2]);
94511
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(BrowserLoginConfirmation, {});
94725
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(BrowserLoginConfirmation, {});
94512
94726
  }
94513
- var import_react41, import_jsx_runtime13;
94727
+ var import_react42, import_jsx_runtime14;
94514
94728
  var init_login_flow = __esm({
94515
94729
  async "apps/cli/src/ui/login-flow.tsx"() {
94516
94730
  "use strict";
94517
- import_react41 = __toESM(require_react(), 1);
94731
+ import_react42 = __toESM(require_react(), 1);
94518
94732
  await init_browser_login();
94519
- import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
94733
+ import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
94520
94734
  }
94521
94735
  });
94522
94736
 
@@ -94526,16 +94740,16 @@ __export(login_exports, {
94526
94740
  runLogin: () => runLogin
94527
94741
  });
94528
94742
  async function runLogin() {
94529
- return await new Promise((resolve2, reject) => {
94743
+ return await new Promise((resolve3, reject) => {
94530
94744
  const { unmount } = render_default(
94531
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(BrowserLoginProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
94745
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(BrowserLoginProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
94532
94746
  LoginFlow,
94533
94747
  {
94534
94748
  onComplete: (result) => {
94535
94749
  setTimeout(() => {
94536
94750
  unmount();
94537
94751
  if (result.success) {
94538
- resolve2();
94752
+ resolve3();
94539
94753
  } else {
94540
94754
  reject(result.error ?? new Error("Login failed"));
94541
94755
  }
@@ -94546,14 +94760,14 @@ async function runLogin() {
94546
94760
  );
94547
94761
  });
94548
94762
  }
94549
- var import_jsx_runtime14;
94763
+ var import_jsx_runtime15;
94550
94764
  var init_login = __esm({
94551
94765
  async "apps/cli/src/commands/login.tsx"() {
94552
94766
  "use strict";
94553
94767
  await init_build2();
94554
94768
  await init_login_flow();
94555
94769
  await init_browser_login();
94556
- import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
94770
+ import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
94557
94771
  }
94558
94772
  });
94559
94773
 
@@ -94734,16 +94948,16 @@ function KiteGame({
94734
94948
  const { stdout } = use_stdout_default();
94735
94949
  const terminalWidth = useTerminalWidth(stdout);
94736
94950
  const playableWidth = getPlayableWidth(terminalWidth);
94737
- const rngRef = (0, import_react42.useRef)(rng);
94738
- const [highScore, setHighScore] = (0, import_react42.useState)(() => readKiteGameHighScore());
94739
- const [state, setState] = (0, import_react42.useState)(
94951
+ const rngRef = (0, import_react43.useRef)(rng);
94952
+ const [highScore, setHighScore] = (0, import_react43.useState)(() => readKiteGameHighScore());
94953
+ const [state, setState] = (0, import_react43.useState)(
94740
94954
  () => createKiteGame({ width: playableWidth, rng: rngRef.current })
94741
94955
  );
94742
- const rows = (0, import_react42.useMemo)(() => renderKiteGameRows(state), [state]);
94743
- (0, import_react42.useEffect)(() => {
94956
+ const rows = (0, import_react43.useMemo)(() => renderKiteGameRows(state), [state]);
94957
+ (0, import_react43.useEffect)(() => {
94744
94958
  rngRef.current = rng;
94745
94959
  }, [rng]);
94746
- (0, import_react42.useEffect)(() => {
94960
+ (0, import_react43.useEffect)(() => {
94747
94961
  setState((currentState) => {
94748
94962
  if (currentState.width === playableWidth) {
94749
94963
  return currentState;
@@ -94755,13 +94969,13 @@ function KiteGame({
94755
94969
  });
94756
94970
  });
94757
94971
  }, [playableWidth]);
94758
- (0, import_react42.useEffect)(() => {
94972
+ (0, import_react43.useEffect)(() => {
94759
94973
  if (!state.crashed) {
94760
94974
  return;
94761
94975
  }
94762
94976
  setHighScore(saveKiteGameHighScore(state.score));
94763
94977
  }, [state.crashed, state.score]);
94764
- (0, import_react42.useEffect)(() => {
94978
+ (0, import_react43.useEffect)(() => {
94765
94979
  if (!state.started || state.crashed) {
94766
94980
  return void 0;
94767
94981
  }
@@ -94804,23 +95018,23 @@ function KiteGame({
94804
95018
  setState((currentState) => flapKite(currentState));
94805
95019
  }
94806
95020
  });
94807
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Box_default, { flexDirection: "column", children: [
94808
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Text, { children: [
95021
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Box_default, { flexDirection: "column", children: [
95022
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Text, { children: [
94809
95023
  "CopilotKit Kite Score ",
94810
95024
  state.score,
94811
95025
  " High",
94812
95026
  " ",
94813
95027
  Math.max(highScore, state.score)
94814
95028
  ] }),
94815
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Box_default, { flexDirection: "column", borderStyle: "single", children: rows.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { children: row }, `${index}-${row}`)) }),
94816
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { children: state.crashed ? "Crashed. Enter/r to reset. Space to restart. q/Esc to quit." : state.started ? "Space/up to send wind. q/Esc to quit." : "Ready. Space/up to start. q/Esc to quit." })
95029
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Box_default, { flexDirection: "column", borderStyle: "single", children: rows.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { children: row }, `${index}-${row}`)) }),
95030
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { children: state.crashed ? "Crashed. Enter/r to reset. Space to restart. q/Esc to quit." : state.started ? "Space/up to send wind. q/Esc to quit." : "Ready. Space/up to start. q/Esc to quit." })
94817
95031
  ] });
94818
95032
  }
94819
95033
  function useTerminalWidth(stdout) {
94820
- const [terminalWidth, setTerminalWidth] = (0, import_react42.useState)(
95034
+ const [terminalWidth, setTerminalWidth] = (0, import_react43.useState)(
94821
95035
  () => getStdoutColumns(stdout)
94822
95036
  );
94823
- (0, import_react42.useEffect)(() => {
95037
+ (0, import_react43.useEffect)(() => {
94824
95038
  const updateTerminalWidth = () => {
94825
95039
  setTerminalWidth(getStdoutColumns(stdout));
94826
95040
  };
@@ -94837,15 +95051,15 @@ function getStdoutColumns(stdout) {
94837
95051
  function getPlayableWidth(terminalWidth) {
94838
95052
  return Math.max(MIN_PLAYABLE_WIDTH, terminalWidth - BORDER_COLUMNS);
94839
95053
  }
94840
- var import_react42, import_jsx_runtime15, DEFAULT_TICK_MS, MIN_PLAYABLE_WIDTH, BORDER_COLUMNS;
95054
+ var import_react43, import_jsx_runtime16, DEFAULT_TICK_MS, MIN_PLAYABLE_WIDTH, BORDER_COLUMNS;
94841
95055
  var init_kite_game = __esm({
94842
95056
  async "apps/cli/src/ui/kite-game.tsx"() {
94843
95057
  "use strict";
94844
95058
  await init_build2();
94845
- import_react42 = __toESM(require_react(), 1);
95059
+ import_react43 = __toESM(require_react(), 1);
94846
95060
  init_kite_game_engine();
94847
95061
  init_kite_game_score();
94848
- import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
95062
+ import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
94849
95063
  DEFAULT_TICK_MS = 75;
94850
95064
  MIN_PLAYABLE_WIDTH = 32;
94851
95065
  BORDER_COLUMNS = 2;
@@ -94858,20 +95072,20 @@ __export(kite_exports, {
94858
95072
  runKite: () => runKite
94859
95073
  });
94860
95074
  async function runKite() {
94861
- return await new Promise((resolve2, reject) => {
94862
- const { waitUntilExit } = render_default(/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(KiteGame, { onExit: resolve2 }));
95075
+ return await new Promise((resolve3, reject) => {
95076
+ const { waitUntilExit } = render_default(/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(KiteGame, { onExit: resolve3 }));
94863
95077
  waitUntilExit().then(() => {
94864
- resolve2();
95078
+ resolve3();
94865
95079
  }).catch(reject);
94866
95080
  });
94867
95081
  }
94868
- var import_jsx_runtime16;
95082
+ var import_jsx_runtime17;
94869
95083
  var init_kite = __esm({
94870
95084
  async "apps/cli/src/commands/kite.tsx"() {
94871
95085
  "use strict";
94872
95086
  await init_build2();
94873
95087
  await init_kite_game();
94874
- import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
95088
+ import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
94875
95089
  }
94876
95090
  });
94877
95091
 
@@ -94881,7 +95095,7 @@ init_types();
94881
95095
  await init_telemetry();
94882
95096
  import { parseArgs } from "node:util";
94883
95097
  import { realpathSync } from "node:fs";
94884
- import path15 from "node:path";
95098
+ import path17 from "node:path";
94885
95099
  import { fileURLToPath as fileURLToPath2 } from "node:url";
94886
95100
 
94887
95101
  // apps/cli/src/services/telemetry/init-events.ts
@@ -95921,7 +96135,7 @@ ${HELP_TEXT_BY_TOPIC.root}`
95921
96135
  await entry.run(commandArgv, command);
95922
96136
  }
95923
96137
  function resolveRealPath(candidatePath) {
95924
- const absolutePath = path15.resolve(candidatePath);
96138
+ const absolutePath = path17.resolve(candidatePath);
95925
96139
  try {
95926
96140
  return realpathSync.native(absolutePath);
95927
96141
  } catch {