copilotkit 4.0.0 → 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.
- package/README.md +3 -1
- package/index.js +1024 -578
- 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.
|
|
82
|
-
buildNumber: true ? "
|
|
83
|
-
commitSha: true ? "
|
|
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
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
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
|
|
621
|
-
//
|
|
622
|
-
//
|
|
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
|
|
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(
|
|
877
|
-
if (typeof
|
|
878
|
-
throw new TypeError(`Expected a string, got ${typeof
|
|
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
|
|
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(
|
|
996
|
-
if (typeof
|
|
997
|
-
return parsePath(
|
|
1013
|
+
function normalizePath(path18) {
|
|
1014
|
+
if (typeof path18 === "string") {
|
|
1015
|
+
return parsePath(path18);
|
|
998
1016
|
}
|
|
999
|
-
if (Array.isArray(
|
|
1017
|
+
if (Array.isArray(path18)) {
|
|
1000
1018
|
const normalized = [];
|
|
1001
|
-
for (const [index, segment] of
|
|
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,
|
|
1022
|
-
if (!isObject(object2) || typeof
|
|
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(
|
|
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,
|
|
1042
|
-
if (!isObject(object2) || typeof
|
|
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(
|
|
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,
|
|
1064
|
-
if (!isObject(object2) || typeof
|
|
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(
|
|
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,
|
|
1088
|
-
if (!isObject(object2) || typeof
|
|
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(
|
|
1109
|
+
const pathArray = normalizePath(path18);
|
|
1092
1110
|
if (pathArray.length === 0) {
|
|
1093
1111
|
return false;
|
|
1094
1112
|
}
|
|
@@ -1241,9 +1259,9 @@ var init_retryify_async = __esm({
|
|
|
1241
1259
|
throw error48;
|
|
1242
1260
|
if (Date.now() >= timestamp)
|
|
1243
1261
|
throw error48;
|
|
1244
|
-
const
|
|
1245
|
-
if (
|
|
1246
|
-
const delayPromise = new Promise((
|
|
1262
|
+
const delay3 = Math.round(interval * Math.random());
|
|
1263
|
+
if (delay3 > 0) {
|
|
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 =
|
|
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
|
|
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(
|
|
4906
|
-
let input =
|
|
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 [
|
|
5106
|
-
wsComponent.path =
|
|
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
|
|
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:
|
|
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,
|
|
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,
|
|
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
|
|
12431
|
-
_req.url = typeof
|
|
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(
|
|
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 <
|
|
12606
|
-
const char =
|
|
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
|
|
12738
|
-
const parts = parsePath2(
|
|
12755
|
+
for (const path18 of paths) {
|
|
12756
|
+
const parts = parsePath2(path18);
|
|
12739
12757
|
if (parts.includes("*")) {
|
|
12740
|
-
redactWildcardPath(obj, parts, censor,
|
|
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,
|
|
12828
|
-
const fullPath = [...pathArray.slice(0, pathLength), ...
|
|
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
|
|
12866
|
-
const parts = parsePath2(
|
|
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(
|
|
12919
|
-
if (typeof
|
|
12936
|
+
function validatePath(path18) {
|
|
12937
|
+
if (typeof path18 !== "string") {
|
|
12920
12938
|
throw new Error("Paths must be (non-empty) strings");
|
|
12921
12939
|
}
|
|
12922
|
-
if (
|
|
12940
|
+
if (path18 === "") {
|
|
12923
12941
|
throw new Error("Invalid redaction path ()");
|
|
12924
12942
|
}
|
|
12925
|
-
if (
|
|
12926
|
-
throw new Error(`Invalid redaction path (${
|
|
12943
|
+
if (path18.includes("..")) {
|
|
12944
|
+
throw new Error(`Invalid redaction path (${path18})`);
|
|
12927
12945
|
}
|
|
12928
|
-
if (
|
|
12929
|
-
throw new Error(`Invalid redaction path (${
|
|
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 <
|
|
12935
|
-
const char =
|
|
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 (${
|
|
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 (${
|
|
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
|
|
12962
|
-
validatePath(
|
|
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,
|
|
13131
|
-
return censor(value, [k, ...
|
|
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
|
|
13370
|
+
var fs18 = __require("fs");
|
|
13353
13371
|
var EventEmitter3 = __require("events");
|
|
13354
13372
|
var inherits = __require("util").inherits;
|
|
13355
|
-
var
|
|
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
|
-
|
|
13411
|
-
const fd =
|
|
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
|
-
|
|
13436
|
+
fs18.mkdir(path18.dirname(file2), { recursive: true }, (err) => {
|
|
13419
13437
|
if (err)
|
|
13420
13438
|
return fileOpened(err);
|
|
13421
|
-
|
|
13439
|
+
fs18.open(file2, flags, mode, fileOpened);
|
|
13422
13440
|
});
|
|
13423
13441
|
} else {
|
|
13424
|
-
|
|
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 = () =>
|
|
13466
|
-
fsWrite = () =>
|
|
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
|
|
13493
|
+
return fs18.writeSync(this.fd, this._writingBuf);
|
|
13476
13494
|
}
|
|
13477
|
-
return
|
|
13495
|
+
return fs18.writeSync(this.fd, this._writingBuf, "utf8");
|
|
13478
13496
|
};
|
|
13479
13497
|
fsWrite = () => {
|
|
13480
13498
|
if (Buffer.isBuffer(this._writingBuf)) {
|
|
13481
|
-
return
|
|
13499
|
+
return fs18.write(this.fd, this._writingBuf, this.release);
|
|
13482
13500
|
}
|
|
13483
|
-
return
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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) ?
|
|
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
|
-
|
|
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 =
|
|
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) ?
|
|
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
|
-
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
14655
|
-
if (
|
|
14672
|
+
let path18 = unquoted;
|
|
14673
|
+
if (path18.startsWith("file://")) {
|
|
14656
14674
|
try {
|
|
14657
|
-
|
|
14675
|
+
path18 = fileURLToPath3(path18);
|
|
14658
14676
|
} catch {
|
|
14659
14677
|
return false;
|
|
14660
14678
|
}
|
|
14661
14679
|
}
|
|
14662
|
-
return isAbsolute(
|
|
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,
|
|
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 =
|
|
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 =
|
|
16996
|
+
const cleanPath = path18.replace(constants_LEADING_SLASHES_REGEX, "");
|
|
16979
16997
|
return `${cleanBase}/${cleanPath}`;
|
|
16980
16998
|
}
|
|
16981
|
-
async function fetcher(context,
|
|
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,
|
|
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,
|
|
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 ${
|
|
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 ${
|
|
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 ${
|
|
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,
|
|
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,
|
|
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,
|
|
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
|
|
17627
|
+
const path18 = `${API_ENDPOINTS.PATCH_SUBJECT}/${subjectId}`;
|
|
17610
17628
|
const { subjectId: _subjectId, id: _legacySubjectId, ...patchBody } = body;
|
|
17611
|
-
return withFallback(context,
|
|
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
|
|
17838
|
+
const path18 = `${API_ENDPOINTS.PATCH_SUBJECT}/${subjectId}`;
|
|
17821
17839
|
const { subjectId: _subjectId, id: _legacySubjectId, ...patchBody } = submission;
|
|
17822
|
-
const response = await fetcher(context,
|
|
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((
|
|
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(
|
|
18164
|
-
return fetcher(this.fetcherContext,
|
|
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,
|
|
18438
|
-
if (!
|
|
18455
|
+
function getElementAtPath(obj, path18) {
|
|
18456
|
+
if (!path18)
|
|
18439
18457
|
return obj;
|
|
18440
|
-
return
|
|
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(
|
|
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(
|
|
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,
|
|
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 = [...
|
|
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
|
|
19042
|
-
for (const seg of
|
|
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
|
|
31806
|
-
if (
|
|
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 (
|
|
31811
|
-
const key =
|
|
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,
|
|
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,
|
|
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)) :
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
34048
|
+
resolve3,
|
|
34031
34049
|
reject
|
|
34032
34050
|
);
|
|
34033
|
-
})) :
|
|
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(
|
|
38920
|
-
entangledListeners.push(
|
|
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(
|
|
38945
|
-
listeners.push(
|
|
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,
|
|
46228
|
-
if (index >=
|
|
46245
|
+
function copyWithSetImpl(obj, path18, index, value) {
|
|
46246
|
+
if (index >= path18.length)
|
|
46229
46247
|
return value;
|
|
46230
|
-
var key =
|
|
46231
|
-
updated[key] = copyWithSetImpl(obj[key],
|
|
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,
|
|
46259
|
-
var key =
|
|
46260
|
-
if (index + 1 ===
|
|
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],
|
|
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(
|
|
48709
|
-
entangledListeners.push(
|
|
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(
|
|
48734
|
-
listeners.push(
|
|
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,
|
|
59706
|
+
overrideHookState = function(fiber, id, path18, value) {
|
|
59689
59707
|
id = findHook(fiber, id);
|
|
59690
|
-
null !== id && (
|
|
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,
|
|
59710
|
+
overrideHookStateDeletePath = function(fiber, id, path18) {
|
|
59693
59711
|
id = findHook(fiber, id);
|
|
59694
|
-
null !== id && (
|
|
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,
|
|
59701
|
-
fiber.pendingProps = copyWithSetImpl(fiber.memoizedProps,
|
|
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
|
-
|
|
59704
|
-
null !==
|
|
59721
|
+
path18 = enqueueConcurrentRenderForLane(fiber, 2);
|
|
59722
|
+
null !== path18 && scheduleUpdateOnFiber(path18, fiber, 2);
|
|
59705
59723
|
};
|
|
59706
|
-
overridePropsDeletePath = function(fiber,
|
|
59707
|
-
fiber.pendingProps = copyWithDeleteImpl(fiber.memoizedProps,
|
|
59724
|
+
overridePropsDeletePath = function(fiber, path18) {
|
|
59725
|
+
fiber.pendingProps = copyWithDeleteImpl(fiber.memoizedProps, path18, 0);
|
|
59708
59726
|
fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps);
|
|
59709
|
-
|
|
59710
|
-
null !==
|
|
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
|
|
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
|
|
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,
|
|
69703
|
-
return
|
|
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,
|
|
69716
|
-
var length =
|
|
69717
|
-
var last =
|
|
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,
|
|
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,
|
|
69746
|
-
var length =
|
|
69747
|
-
var last =
|
|
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,
|
|
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,
|
|
70286
|
-
cleaned.push(
|
|
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,
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
70371
|
+
isPathAllowedCheck = isPathAllowed(path18);
|
|
70354
70372
|
if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
|
|
70355
|
-
cleaned.push(
|
|
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,
|
|
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,
|
|
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,
|
|
70377
|
-
unserializable.push(
|
|
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(
|
|
70399
|
+
isPathAllowedCheck = isPathAllowed(path18);
|
|
70382
70400
|
var payload = data._payload;
|
|
70383
70401
|
if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
|
|
70384
|
-
cleaned.push(
|
|
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,
|
|
70402
|
-
unserializable.push(
|
|
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(
|
|
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(
|
|
70435
|
+
isPathAllowedCheck = isPathAllowed(path18);
|
|
70418
70436
|
if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
|
|
70419
|
-
return createDehydrated(type, true, data, cleaned,
|
|
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,
|
|
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(
|
|
70447
|
+
isPathAllowedCheck = isPathAllowed(path18);
|
|
70430
70448
|
if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
|
|
70431
|
-
return createDehydrated(type, true, data, cleaned,
|
|
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,
|
|
70461
|
+
return _unserializableValue2[i2] = dehydrate(item, cleaned, unserializable, path18.concat([i2]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
|
|
70444
70462
|
});
|
|
70445
|
-
unserializable.push(
|
|
70463
|
+
unserializable.push(path18);
|
|
70446
70464
|
return _unserializableValue2;
|
|
70447
70465
|
}
|
|
70448
70466
|
case "opaque_iterator":
|
|
70449
|
-
cleaned.push(
|
|
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(
|
|
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(
|
|
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(
|
|
70494
|
+
isPathAllowedCheck = isPathAllowed(path18);
|
|
70477
70495
|
if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
|
|
70478
|
-
cleaned.push(
|
|
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,
|
|
70500
|
-
unserializable.push(
|
|
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,
|
|
70512
|
-
unserializable.push(
|
|
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(
|
|
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(
|
|
70544
|
+
isPathAllowedCheck = isPathAllowed(path18);
|
|
70527
70545
|
if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
|
|
70528
|
-
return createDehydrated(type, true, data, cleaned,
|
|
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,
|
|
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(
|
|
70556
|
+
isPathAllowedCheck = isPathAllowed(path18);
|
|
70539
70557
|
if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
|
|
70540
|
-
return createDehydrated(type, true, data, cleaned,
|
|
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,
|
|
70570
|
+
value[keyAsString] = dehydrate(data[key], cleaned, unserializable, path18.concat([keyAsString]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
|
|
70553
70571
|
});
|
|
70554
|
-
unserializable.push(
|
|
70572
|
+
unserializable.push(path18);
|
|
70555
70573
|
return value;
|
|
70556
70574
|
}
|
|
70557
70575
|
case "error": {
|
|
70558
|
-
isPathAllowedCheck = isPathAllowed(
|
|
70576
|
+
isPathAllowedCheck = isPathAllowed(path18);
|
|
70559
70577
|
if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
|
|
70560
|
-
return createDehydrated(type, true, data, cleaned,
|
|
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,
|
|
70571
|
-
_value.stack = dehydrate(data.stack, cleaned, unserializable,
|
|
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,
|
|
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,
|
|
70595
|
+
_value[keyAsString] = dehydrate(data[key], cleaned, unserializable, path18.concat([keyAsString]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
|
|
70578
70596
|
});
|
|
70579
|
-
unserializable.push(
|
|
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(
|
|
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,
|
|
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,
|
|
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(
|
|
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,
|
|
70615
|
-
var target = getInObject(object2,
|
|
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 ===
|
|
70631
|
-
for (var i = 0; i <
|
|
70632
|
-
if (
|
|
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,
|
|
70659
|
+
setInObject(object2, path18, value);
|
|
70642
70660
|
}
|
|
70643
70661
|
function hydrate(object2, cleaned, unserializable) {
|
|
70644
|
-
cleaned.forEach(function(
|
|
70645
|
-
var length =
|
|
70646
|
-
var last =
|
|
70647
|
-
var parent = getInObject(object2,
|
|
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(
|
|
70674
|
-
var length =
|
|
70675
|
-
var last =
|
|
70676
|
-
var parent = getInObject(object2,
|
|
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
|
|
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,
|
|
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,
|
|
70831
|
+
function copyWithDelete(obj, path18) {
|
|
70814
70832
|
var index = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
|
|
70815
|
-
var key =
|
|
70833
|
+
var key = path18[index];
|
|
70816
70834
|
var updated = shared_isArray(obj) ? obj.slice() : utils_objectSpread({}, obj);
|
|
70817
|
-
if (index + 1 ===
|
|
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],
|
|
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,
|
|
70863
|
+
function copyWithSet(obj, path18, value) {
|
|
70846
70864
|
var index = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0;
|
|
70847
|
-
if (index >=
|
|
70865
|
+
if (index >= path18.length) {
|
|
70848
70866
|
return value;
|
|
70849
70867
|
}
|
|
70850
|
-
var key =
|
|
70868
|
+
var key = path18[index];
|
|
70851
70869
|
var updated = shared_isArray(obj) ? obj.slice() : utils_objectSpread({}, obj);
|
|
70852
|
-
updated[key] = copyWithSet(obj[key],
|
|
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,
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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
|
|
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
|
-
|
|
72669
|
+
path18 = ["suspendedBy", suspendedByPathRendererIndex].concat(rendererPath);
|
|
72652
72670
|
}
|
|
72653
72671
|
}
|
|
72654
|
-
var inspectedRootsPayload = renderer2.inspectElement(requestID, id,
|
|
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,
|
|
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,
|
|
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,
|
|
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:
|
|
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,
|
|
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:
|
|
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,
|
|
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:
|
|
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,
|
|
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:
|
|
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,
|
|
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,
|
|
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
|
|
72887
|
-
if (
|
|
72888
|
-
renderer2.setTrackedPath(
|
|
72904
|
+
var path18 = renderer2.getPathForElement(_this._lastSelectedElementID);
|
|
72905
|
+
if (path18 !== null) {
|
|
72906
|
+
renderer2.setTrackedPath(path18);
|
|
72889
72907
|
_this._persistedSelection = {
|
|
72890
72908
|
rendererID,
|
|
72891
|
-
path:
|
|
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
|
|
72967
|
-
if (
|
|
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:
|
|
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,
|
|
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,
|
|
79018
|
+
function getElementAttributeByPath(id, path18) {
|
|
79001
79019
|
if (isMostRecentlyInspectedElement(id)) {
|
|
79002
|
-
return utils_getInObject(mostRecentlyInspectedElement,
|
|
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(
|
|
79727
|
+
function mergeInspectedPaths(path18) {
|
|
79710
79728
|
var current = currentlyInspectedPaths;
|
|
79711
|
-
|
|
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(
|
|
79737
|
+
return function isPathAllowed(path18) {
|
|
79720
79738
|
switch (secondaryCategory) {
|
|
79721
79739
|
case "hooks":
|
|
79722
|
-
if (
|
|
79740
|
+
if (path18.length === 1) {
|
|
79723
79741
|
return true;
|
|
79724
79742
|
}
|
|
79725
|
-
if (
|
|
79743
|
+
if (path18[path18.length - 2] === "hookSource" && path18[path18.length - 1] === "fileName") {
|
|
79726
79744
|
return true;
|
|
79727
79745
|
}
|
|
79728
|
-
if (
|
|
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 (
|
|
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 <
|
|
79745
|
-
current = current[
|
|
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,
|
|
79817
|
+
function storeAsGlobal(id, path18, count) {
|
|
79800
79818
|
if (isMostRecentlyInspectedElement(id)) {
|
|
79801
|
-
var value = utils_getInObject(mostRecentlyInspectedElement,
|
|
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,
|
|
79826
|
+
function getSerializedElementValueByPath(id, path18) {
|
|
79809
79827
|
if (isMostRecentlyInspectedElement(id)) {
|
|
79810
|
-
var valueToCopy = utils_getInObject(mostRecentlyInspectedElement,
|
|
79828
|
+
var valueToCopy = utils_getInObject(mostRecentlyInspectedElement, path18);
|
|
79811
79829
|
return serializeToString(valueToCopy);
|
|
79812
79830
|
}
|
|
79813
79831
|
}
|
|
79814
|
-
function inspectElement(requestID, id,
|
|
79815
|
-
if (
|
|
79816
|
-
mergeInspectedPaths(
|
|
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 (
|
|
79838
|
+
if (path18 !== null) {
|
|
79821
79839
|
var secondaryCategory = null;
|
|
79822
|
-
if (
|
|
79823
|
-
secondaryCategory =
|
|
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:
|
|
79830
|
-
value: cleanForBridge(utils_getInObject(mostRecentlyInspectedElement,
|
|
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,
|
|
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
|
-
|
|
80051
|
+
path18 = path18.slice(1);
|
|
80034
80052
|
switch (fiber.tag) {
|
|
80035
80053
|
case ClassComponent:
|
|
80036
|
-
if (
|
|
80054
|
+
if (path18.length === 0) {
|
|
80037
80055
|
} else {
|
|
80038
|
-
deletePathInObject(instance2.context,
|
|
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,
|
|
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,
|
|
80072
|
+
overridePropsDeletePath(fiber, path18);
|
|
80055
80073
|
}
|
|
80056
80074
|
} else {
|
|
80057
|
-
fiber.pendingProps = copyWithDelete(instance2.props,
|
|
80075
|
+
fiber.pendingProps = copyWithDelete(instance2.props, path18);
|
|
80058
80076
|
instance2.forceUpdate();
|
|
80059
80077
|
}
|
|
80060
80078
|
break;
|
|
80061
80079
|
case "state":
|
|
80062
|
-
deletePathInObject(instance2.state,
|
|
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,
|
|
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
|
-
|
|
80150
|
+
path18 = path18.slice(1);
|
|
80133
80151
|
switch (fiber.tag) {
|
|
80134
80152
|
case ClassComponent:
|
|
80135
|
-
if (
|
|
80153
|
+
if (path18.length === 0) {
|
|
80136
80154
|
instance2.context = value;
|
|
80137
80155
|
} else {
|
|
80138
|
-
utils_setInObject(instance2.context,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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(
|
|
80454
|
-
if (
|
|
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 =
|
|
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(
|
|
81248
|
+
function mergeInspectedPaths(path18) {
|
|
81231
81249
|
var current = currentlyInspectedPaths;
|
|
81232
|
-
|
|
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(
|
|
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 <
|
|
81246
|
-
current = current[
|
|
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,
|
|
81314
|
+
function storeAsGlobal(id, path18, count) {
|
|
81297
81315
|
var inspectedElement = inspectElementRaw(id);
|
|
81298
81316
|
if (inspectedElement !== null) {
|
|
81299
|
-
var value = utils_getInObject(inspectedElement,
|
|
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,
|
|
81324
|
+
function getSerializedElementValueByPath(id, path18) {
|
|
81307
81325
|
var inspectedElement = inspectElementRaw(id);
|
|
81308
81326
|
if (inspectedElement !== null) {
|
|
81309
|
-
var valueToCopy = utils_getInObject(inspectedElement,
|
|
81327
|
+
var valueToCopy = utils_getInObject(inspectedElement, path18);
|
|
81310
81328
|
return serializeToString(valueToCopy);
|
|
81311
81329
|
}
|
|
81312
81330
|
}
|
|
81313
|
-
function inspectElement(requestID, id,
|
|
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 (
|
|
81327
|
-
mergeInspectedPaths(
|
|
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,
|
|
81548
|
+
function getElementAttributeByPath(id, path18) {
|
|
81531
81549
|
var inspectedElement = inspectElementRaw(id);
|
|
81532
81550
|
if (inspectedElement !== null) {
|
|
81533
|
-
return utils_getInObject(inspectedElement,
|
|
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,
|
|
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,
|
|
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,
|
|
81583
|
+
props: copyWithDelete(element.props, path18)
|
|
81566
81584
|
});
|
|
81567
81585
|
forceUpdate(publicInstance);
|
|
81568
81586
|
break;
|
|
81569
81587
|
case "state":
|
|
81570
|
-
deletePathInObject(publicInstance.state,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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(
|
|
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
|
|
82957
|
-
const content =
|
|
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 = (
|
|
85935
|
-
return
|
|
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((
|
|
86833
|
-
this.resolveExitPromise =
|
|
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((
|
|
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
|
-
|
|
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((
|
|
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((
|
|
88841
|
-
const t = setTimeout(
|
|
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: (
|
|
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 (
|
|
89703
|
-
if (/^[a-z]+:\/\//i.test(
|
|
89704
|
-
return
|
|
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",
|
|
89726
|
+
const { stdout } = await execFile2("wslpath", ["-aw", path18], { encoding: "utf8" });
|
|
89708
89727
|
return stdout.trim();
|
|
89709
89728
|
} catch {
|
|
89710
|
-
return
|
|
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((
|
|
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
|
-
|
|
90135
|
+
resolve3(subprocess);
|
|
90117
90136
|
});
|
|
90118
90137
|
});
|
|
90119
90138
|
}
|
|
90120
90139
|
if (isFallbackAttempt) {
|
|
90121
|
-
return new Promise((
|
|
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
|
-
|
|
90150
|
+
resolve3(subprocess);
|
|
90132
90151
|
});
|
|
90133
90152
|
});
|
|
90134
90153
|
});
|
|
90135
90154
|
}
|
|
90136
90155
|
subprocess.unref();
|
|
90137
|
-
return new Promise((
|
|
90156
|
+
return new Promise((resolve3, reject) => {
|
|
90138
90157
|
subprocess.once("error", reject);
|
|
90139
90158
|
subprocess.once("spawn", () => {
|
|
90140
90159
|
subprocess.off("error", reject);
|
|
90141
|
-
|
|
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((
|
|
91222
|
+
await new Promise((resolve3, reject) => {
|
|
91204
91223
|
pendingConfirmationRef.current = {
|
|
91205
|
-
resolve:
|
|
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((
|
|
91233
|
+
const manualClerkToken = new Promise((resolve3, reject) => {
|
|
91215
91234
|
pendingManualTokenRef.current = {
|
|
91216
|
-
resolve:
|
|
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((
|
|
91266
|
+
await new Promise((resolve3) => {
|
|
91248
91267
|
setTimeout(() => {
|
|
91249
|
-
|
|
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
|
-
|
|
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)) {
|
|
@@ -91561,6 +91583,21 @@ function copyEnvExample(projectDir) {
|
|
|
91561
91583
|
}
|
|
91562
91584
|
return false;
|
|
91563
91585
|
}
|
|
91586
|
+
function removeTestHarnessArtifacts(projectDir) {
|
|
91587
|
+
const markerPath = path9.join(projectDir, "docker-compose.test.yml");
|
|
91588
|
+
if (!fs13.existsSync(markerPath)) {
|
|
91589
|
+
return [];
|
|
91590
|
+
}
|
|
91591
|
+
const removed = [];
|
|
91592
|
+
for (const artifact of TEST_HARNESS_ARTIFACTS) {
|
|
91593
|
+
const target = path9.join(projectDir, artifact);
|
|
91594
|
+
if (fs13.existsSync(target)) {
|
|
91595
|
+
fs13.rmSync(target, { recursive: true, force: true });
|
|
91596
|
+
removed.push(artifact);
|
|
91597
|
+
}
|
|
91598
|
+
}
|
|
91599
|
+
return removed;
|
|
91600
|
+
}
|
|
91564
91601
|
function writeEnvLicenseKey(projectDir, licenseKey) {
|
|
91565
91602
|
const envPath = path9.join(projectDir, ".env");
|
|
91566
91603
|
const envExamplePath = path9.join(projectDir, ".env.example");
|
|
@@ -91605,11 +91642,18 @@ async function commitInitial(projectDir) {
|
|
|
91605
91642
|
stdio: "pipe"
|
|
91606
91643
|
});
|
|
91607
91644
|
}
|
|
91608
|
-
var LICENSE_TOKEN_LINE_RE;
|
|
91645
|
+
var TEST_HARNESS_ARTIFACTS, LICENSE_TOKEN_LINE_RE;
|
|
91609
91646
|
var init_project_scaffold = __esm({
|
|
91610
91647
|
"apps/cli/src/services/project-scaffold.ts"() {
|
|
91611
91648
|
"use strict";
|
|
91612
91649
|
init_event_properties();
|
|
91650
|
+
TEST_HARNESS_ARTIFACTS = [
|
|
91651
|
+
"docker",
|
|
91652
|
+
".dockerignore",
|
|
91653
|
+
"docker-compose.test.yml",
|
|
91654
|
+
"Dockerfile",
|
|
91655
|
+
"docker-route-override.ts"
|
|
91656
|
+
];
|
|
91613
91657
|
LICENSE_TOKEN_LINE_RE = /^[ \t]*(?:export\s+)?COPILOTKIT_LICENSE_TOKEN=.*$/m;
|
|
91614
91658
|
}
|
|
91615
91659
|
});
|
|
@@ -92035,12 +92079,24 @@ function withFsErrorTag(operation) {
|
|
|
92035
92079
|
throw err;
|
|
92036
92080
|
}
|
|
92037
92081
|
}
|
|
92082
|
+
function buildIntelligenceEnvKeys(hosted) {
|
|
92083
|
+
const keys = [];
|
|
92084
|
+
if (hosted.apiUrl !== "") {
|
|
92085
|
+
keys.push({ key: "INTELLIGENCE_API_URL" });
|
|
92086
|
+
}
|
|
92087
|
+
if (hosted.gatewayWsUrl !== "") {
|
|
92088
|
+
keys.push({ key: "INTELLIGENCE_GATEWAY_WS_URL" });
|
|
92089
|
+
}
|
|
92090
|
+
keys.push({ key: "INTELLIGENCE_API_KEY" });
|
|
92091
|
+
return keys;
|
|
92092
|
+
}
|
|
92038
92093
|
function activateIntelligence({
|
|
92039
92094
|
projectDir,
|
|
92040
92095
|
vendorEnvKeys = [],
|
|
92041
92096
|
hosted
|
|
92042
92097
|
}) {
|
|
92043
|
-
|
|
92098
|
+
const intelligenceEnvKeys = hosted ? buildIntelligenceEnvKeys(hosted) : [];
|
|
92099
|
+
writeDevInfraScript(projectDir, vendorEnvKeys, intelligenceEnvKeys);
|
|
92044
92100
|
const devScriptPatched = chainDevInfraScript(projectDir);
|
|
92045
92101
|
if (hosted) {
|
|
92046
92102
|
writeHostedEnvBlock(projectDir, hosted);
|
|
@@ -92058,19 +92114,25 @@ function resolveHostedScaffoldConfig() {
|
|
|
92058
92114
|
slEnabled: getHostedSlEnabled()
|
|
92059
92115
|
};
|
|
92060
92116
|
}
|
|
92061
|
-
function buildDevInfraScriptContent(vendorEnvKeys) {
|
|
92117
|
+
function buildDevInfraScriptContent(vendorEnvKeys, intelligenceEnvKeys) {
|
|
92062
92118
|
const validEnvKeyName = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
92063
|
-
for (const entry of vendorEnvKeys) {
|
|
92119
|
+
for (const entry of [...vendorEnvKeys, ...intelligenceEnvKeys]) {
|
|
92064
92120
|
if (!validEnvKeyName.test(entry.key)) {
|
|
92065
92121
|
throw new Error(
|
|
92066
|
-
`
|
|
92122
|
+
`Env key "${entry.key}" is not a valid environment variable name; refusing to template it into the dev preflight script.`
|
|
92067
92123
|
);
|
|
92068
92124
|
}
|
|
92069
92125
|
}
|
|
92070
92126
|
const requiredEnvKeysJson = JSON.stringify(vendorEnvKeys, null, 2);
|
|
92127
|
+
const requiredIntelligenceKeysJson = JSON.stringify(
|
|
92128
|
+
intelligenceEnvKeys,
|
|
92129
|
+
null,
|
|
92130
|
+
2
|
|
92131
|
+
);
|
|
92071
92132
|
return `#!/usr/bin/env node
|
|
92072
|
-
// Warns about missing LLM vendor API keys
|
|
92073
|
-
//
|
|
92133
|
+
// Warns about missing LLM vendor API keys and missing CopilotKit Intelligence
|
|
92134
|
+
// configuration before \`npm run dev\`, then lets the dev server start anyway
|
|
92135
|
+
// (chat/generations and Intelligence features fail until the values are set).
|
|
92074
92136
|
// Written by \`copilotkit init\`; safe to delete if you manage env validation
|
|
92075
92137
|
// yourself.
|
|
92076
92138
|
import { existsSync, readFileSync } from 'node:fs';
|
|
@@ -92078,6 +92140,13 @@ import { existsSync, readFileSync } from 'node:fs';
|
|
|
92078
92140
|
/** Vendor API keys this scaffold needs before chat and generations will work. */
|
|
92079
92141
|
const REQUIRED_ENV_KEYS = ${requiredEnvKeysJson};
|
|
92080
92142
|
|
|
92143
|
+
/**
|
|
92144
|
+
* Hosted CopilotKit Intelligence env var NAMES this scaffold was generated with
|
|
92145
|
+
* (no values \u2014 those live only in .env). Empty for a non-hosted build. A
|
|
92146
|
+
* missing/blank value means the generated .env was overwritten.
|
|
92147
|
+
*/
|
|
92148
|
+
const REQUIRED_INTELLIGENCE_KEYS = ${requiredIntelligenceKeysJson};
|
|
92149
|
+
|
|
92081
92150
|
const envFileExists = existsSync('.env');
|
|
92082
92151
|
const envFileContent = envFileExists ? readFileSync('.env', 'utf8') : '';
|
|
92083
92152
|
|
|
@@ -92116,17 +92185,45 @@ if (failedKeys.length > 0) {
|
|
|
92116
92185
|
);
|
|
92117
92186
|
}
|
|
92118
92187
|
|
|
92188
|
+
// Hosted Intelligence config check (ENT-949). Reuses the shared predicate above:
|
|
92189
|
+
// a key is unsatisfied when missing/blank in both process.env and .env \u2014 the
|
|
92190
|
+
// symptom of an overwritten generated .env. Names the missing keys only; the
|
|
92191
|
+
// values belong solely in .env, so the fix is to restore it or re-run init.
|
|
92192
|
+
const intelligenceFailures = findUnsatisfiedVendorKeys(
|
|
92193
|
+
process.env,
|
|
92194
|
+
envFileContent,
|
|
92195
|
+
REQUIRED_INTELLIGENCE_KEYS,
|
|
92196
|
+
).map(({ requirement }) => requirement);
|
|
92197
|
+
|
|
92198
|
+
if (intelligenceFailures.length > 0) {
|
|
92199
|
+
console.warn(
|
|
92200
|
+
'\u26A0 CopilotKit Intelligence is not configured \u2014 your .env may have been overwritten.',
|
|
92201
|
+
);
|
|
92202
|
+
for (const entry of intelligenceFailures) {
|
|
92203
|
+
console.warn(\` Missing: \${entry.key}\`);
|
|
92204
|
+
}
|
|
92205
|
+
console.warn(
|
|
92206
|
+
'Restore the value(s) in .env, or re-run \`copilotkit init\` to reconfigure.',
|
|
92207
|
+
);
|
|
92208
|
+
console.warn(
|
|
92209
|
+
'Starting the dev server anyway \u2014 Intelligence features will not work until these are set.',
|
|
92210
|
+
);
|
|
92211
|
+
}
|
|
92212
|
+
|
|
92119
92213
|
process.exit(0);
|
|
92120
92214
|
`;
|
|
92121
92215
|
}
|
|
92122
|
-
function writeDevInfraScript(projectDir, vendorEnvKeys) {
|
|
92216
|
+
function writeDevInfraScript(projectDir, vendorEnvKeys, intelligenceEnvKeys) {
|
|
92123
92217
|
const scriptPath = path12.join(projectDir, DEV_INFRA_SCRIPT_PATH);
|
|
92124
92218
|
if (fs15.existsSync(scriptPath)) {
|
|
92125
92219
|
return;
|
|
92126
92220
|
}
|
|
92127
92221
|
withFsErrorTag(() => {
|
|
92128
92222
|
fs15.mkdirSync(path12.dirname(scriptPath), { recursive: true });
|
|
92129
|
-
fs15.writeFileSync(
|
|
92223
|
+
fs15.writeFileSync(
|
|
92224
|
+
scriptPath,
|
|
92225
|
+
buildDevInfraScriptContent(vendorEnvKeys, intelligenceEnvKeys)
|
|
92226
|
+
);
|
|
92130
92227
|
});
|
|
92131
92228
|
}
|
|
92132
92229
|
function chainDevInfraScript(projectDir) {
|
|
@@ -92294,16 +92391,31 @@ var init_hosted_project2 = __esm({
|
|
|
92294
92391
|
}
|
|
92295
92392
|
});
|
|
92296
92393
|
|
|
92394
|
+
// apps/cli/src/ui/theme.ts
|
|
92395
|
+
var theme;
|
|
92396
|
+
var init_theme = __esm({
|
|
92397
|
+
"apps/cli/src/ui/theme.ts"() {
|
|
92398
|
+
"use strict";
|
|
92399
|
+
theme = {
|
|
92400
|
+
/**
|
|
92401
|
+
* Brand violet accent — used for the product name, selected picker rows, and
|
|
92402
|
+
* primary marks. A single source of truth so the shade is tuned in one place.
|
|
92403
|
+
*/
|
|
92404
|
+
accent: "#6B5CFF"
|
|
92405
|
+
};
|
|
92406
|
+
}
|
|
92407
|
+
});
|
|
92408
|
+
|
|
92297
92409
|
// apps/cli/src/ui/hosted-project-select.tsx
|
|
92298
92410
|
function defer() {
|
|
92299
|
-
let
|
|
92411
|
+
let resolve3;
|
|
92300
92412
|
const promise2 = new Promise((res) => {
|
|
92301
|
-
|
|
92413
|
+
resolve3 = res;
|
|
92302
92414
|
});
|
|
92303
|
-
return { promise: promise2, resolve:
|
|
92415
|
+
return { promise: promise2, resolve: resolve3 };
|
|
92304
92416
|
}
|
|
92305
|
-
function ProjectExplainer() {
|
|
92306
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Text, { children: "An Intelligence project is where this app's threads, messages, and analytics are stored." });
|
|
92417
|
+
function ProjectExplainer({ dim = false }) {
|
|
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." });
|
|
92307
92419
|
}
|
|
92308
92420
|
function HostedProjectSelect({
|
|
92309
92421
|
apiClient,
|
|
@@ -92491,16 +92603,24 @@ function HostedProjectSelect({
|
|
|
92491
92603
|
{ label: "Create a new project", value: "__create__" }
|
|
92492
92604
|
];
|
|
92493
92605
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
92494
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Text, {
|
|
92495
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ProjectExplainer, {}),
|
|
92606
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Text, { children: "Connect this app to one of your existing projects, or create a new one." }),
|
|
92607
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ProjectExplainer, { dim: true }),
|
|
92496
92608
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Text, { children: " " }),
|
|
92497
92609
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Text, { children: "Select a project (\u2191/\u2193 to move, Enter to choose, Esc to cancel):" }),
|
|
92498
92610
|
items.map((item, index) => {
|
|
92499
92611
|
const selected = index === pickerIndex;
|
|
92500
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
92501
|
-
|
|
92502
|
-
|
|
92503
|
-
|
|
92612
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
92613
|
+
Text,
|
|
92614
|
+
{
|
|
92615
|
+
color: selected ? theme.accent : void 0,
|
|
92616
|
+
bold: selected,
|
|
92617
|
+
children: [
|
|
92618
|
+
selected ? "\u276F " : "- ",
|
|
92619
|
+
item.label
|
|
92620
|
+
]
|
|
92621
|
+
},
|
|
92622
|
+
item.value
|
|
92623
|
+
);
|
|
92504
92624
|
})
|
|
92505
92625
|
] });
|
|
92506
92626
|
}
|
|
@@ -92543,6 +92663,7 @@ var init_hosted_project_select = __esm({
|
|
|
92543
92663
|
import_react37 = __toESM(require_react(), 1);
|
|
92544
92664
|
await init_build2();
|
|
92545
92665
|
init_hosted_project2();
|
|
92666
|
+
init_theme();
|
|
92546
92667
|
import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
|
|
92547
92668
|
}
|
|
92548
92669
|
});
|
|
@@ -92739,7 +92860,7 @@ var init_skills_install = __esm({
|
|
|
92739
92860
|
SKILLS_SOURCE = "CopilotKit/CopilotKit/skills";
|
|
92740
92861
|
ALL_SELECTION = "*";
|
|
92741
92862
|
SELECTION_TOKEN = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
92742
|
-
defaultRunner = (command, args) => new Promise((
|
|
92863
|
+
defaultRunner = (command, args) => new Promise((resolve3, reject) => {
|
|
92743
92864
|
const child = spawn(command, [...args], {
|
|
92744
92865
|
stdio: "inherit",
|
|
92745
92866
|
// `npx` is a `.cmd` shim on Windows and is only resolvable through a shell
|
|
@@ -92749,7 +92870,7 @@ var init_skills_install = __esm({
|
|
|
92749
92870
|
});
|
|
92750
92871
|
child.on("error", reject);
|
|
92751
92872
|
child.on("close", (code) => {
|
|
92752
|
-
|
|
92873
|
+
resolve3(code ?? 1);
|
|
92753
92874
|
});
|
|
92754
92875
|
});
|
|
92755
92876
|
}
|
|
@@ -92786,14 +92907,14 @@ var defaultWriter;
|
|
|
92786
92907
|
var init_clipboard = __esm({
|
|
92787
92908
|
"apps/cli/src/services/clipboard.ts"() {
|
|
92788
92909
|
"use strict";
|
|
92789
|
-
defaultWriter = (clipboardCommand, text) => new Promise((
|
|
92910
|
+
defaultWriter = (clipboardCommand, text) => new Promise((resolve3, reject) => {
|
|
92790
92911
|
const child = spawn2(clipboardCommand.command, [...clipboardCommand.args], {
|
|
92791
92912
|
stdio: ["pipe", "ignore", "ignore"]
|
|
92792
92913
|
});
|
|
92793
92914
|
child.on("error", reject);
|
|
92794
92915
|
child.on("close", (code) => {
|
|
92795
92916
|
if (code === 0) {
|
|
92796
|
-
|
|
92917
|
+
resolve3();
|
|
92797
92918
|
return;
|
|
92798
92919
|
}
|
|
92799
92920
|
reject(new Error(`${clipboardCommand.command} exited with code ${code ?? "null"}`));
|
|
@@ -92827,8 +92948,12 @@ Start by inspecting my repo, then walk me through the setup.`;
|
|
|
92827
92948
|
// apps/cli/src/ui/banner.tsx
|
|
92828
92949
|
function Banner() {
|
|
92829
92950
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
|
|
92830
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { color:
|
|
92831
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.
|
|
92951
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { color: theme.accent, children: KITE }),
|
|
92952
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Text, { bold: true, children: [
|
|
92953
|
+
"~ Welcome to ",
|
|
92954
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { color: theme.accent, children: "CopilotKit" }),
|
|
92955
|
+
"! ~"
|
|
92956
|
+
] })
|
|
92832
92957
|
] });
|
|
92833
92958
|
}
|
|
92834
92959
|
function IntelligenceFeatures() {
|
|
@@ -92845,6 +92970,7 @@ var init_banner = __esm({
|
|
|
92845
92970
|
async "apps/cli/src/ui/banner.tsx"() {
|
|
92846
92971
|
"use strict";
|
|
92847
92972
|
await init_build2();
|
|
92973
|
+
init_theme();
|
|
92848
92974
|
import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
|
|
92849
92975
|
KITE = `\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF
|
|
92850
92976
|
\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u281F\u2819\u28FF\u285B\u283B\u283F\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF
|
|
@@ -93202,38 +93328,99 @@ var init_docs = __esm({
|
|
|
93202
93328
|
// apps/cli/src/services/install-dependencies.ts
|
|
93203
93329
|
import { spawn as spawn3 } from "node:child_process";
|
|
93204
93330
|
import { StringDecoder } from "node:string_decoder";
|
|
93205
|
-
function
|
|
93206
|
-
|
|
93207
|
-
|
|
93208
|
-
})
|
|
93209
|
-
|
|
93210
|
-
|
|
93211
|
-
|
|
93331
|
+
function delay2(ms) {
|
|
93332
|
+
return new Promise((resolve3) => {
|
|
93333
|
+
setTimeout(resolve3, ms);
|
|
93334
|
+
});
|
|
93335
|
+
}
|
|
93336
|
+
function runInstallOnce(cwd2, command) {
|
|
93337
|
+
return new Promise((resolve3) => {
|
|
93338
|
+
const child = spawn3(command, { cwd: cwd2, shell: true, stdio: ["ignore", "pipe", "pipe"] });
|
|
93339
|
+
const stdoutDecoder = new StringDecoder("utf8");
|
|
93340
|
+
const stderrDecoder = new StringDecoder("utf8");
|
|
93341
|
+
let stdout = "";
|
|
93212
93342
|
let stderr = "";
|
|
93343
|
+
child.stdout?.on("data", (chunk) => {
|
|
93344
|
+
stdout += stdoutDecoder.write(chunk);
|
|
93345
|
+
if (stdout.length > STDOUT_TAIL_LIMIT * 2) {
|
|
93346
|
+
stdout = stdout.slice(-STDOUT_TAIL_LIMIT);
|
|
93347
|
+
}
|
|
93348
|
+
});
|
|
93213
93349
|
child.stderr?.on("data", (chunk) => {
|
|
93214
|
-
stderr +=
|
|
93350
|
+
stderr += stderrDecoder.write(chunk);
|
|
93215
93351
|
if (stderr.length > STDERR_TAIL_LIMIT * 2) {
|
|
93216
93352
|
stderr = stderr.slice(-STDERR_TAIL_LIMIT);
|
|
93217
93353
|
}
|
|
93218
93354
|
});
|
|
93219
93355
|
child.once("error", (error48) => {
|
|
93220
|
-
|
|
93356
|
+
resolve3({
|
|
93357
|
+
ok: false,
|
|
93358
|
+
code: null,
|
|
93359
|
+
stdoutTail: "",
|
|
93360
|
+
stderrTail: "",
|
|
93361
|
+
spawnError: error48.message
|
|
93362
|
+
});
|
|
93221
93363
|
});
|
|
93222
93364
|
child.once("close", (code) => {
|
|
93223
|
-
|
|
93224
|
-
|
|
93225
|
-
|
|
93226
|
-
|
|
93227
|
-
|
|
93228
|
-
|
|
93365
|
+
stdout += stdoutDecoder.end();
|
|
93366
|
+
stderr += stderrDecoder.end();
|
|
93367
|
+
resolve3({
|
|
93368
|
+
ok: code === 0,
|
|
93369
|
+
code,
|
|
93370
|
+
stdoutTail: stdout.slice(-STDOUT_TAIL_LIMIT).trim(),
|
|
93371
|
+
stderrTail: stderr.slice(-STDERR_TAIL_LIMIT).trim()
|
|
93372
|
+
});
|
|
93229
93373
|
});
|
|
93230
93374
|
});
|
|
93231
93375
|
}
|
|
93232
|
-
|
|
93376
|
+
async function installDependencies({
|
|
93377
|
+
cwd: cwd2,
|
|
93378
|
+
command,
|
|
93379
|
+
log,
|
|
93380
|
+
retryDelayMs = DEFAULT_RETRY_DELAY_MS
|
|
93381
|
+
}) {
|
|
93382
|
+
let lastAttempt;
|
|
93383
|
+
for (let attempt = 1; attempt <= INSTALL_MAX_ATTEMPTS; attempt += 1) {
|
|
93384
|
+
if (attempt > 1 && retryDelayMs > 0) {
|
|
93385
|
+
await delay2(retryDelayMs);
|
|
93386
|
+
}
|
|
93387
|
+
lastAttempt = await runInstallOnce(cwd2, command);
|
|
93388
|
+
if (lastAttempt.ok) {
|
|
93389
|
+
if (attempt > 1) {
|
|
93390
|
+
log?.("info", {
|
|
93391
|
+
event: "install_succeeded_after_retry",
|
|
93392
|
+
command,
|
|
93393
|
+
cwd: cwd2,
|
|
93394
|
+
attempt
|
|
93395
|
+
});
|
|
93396
|
+
}
|
|
93397
|
+
return { ok: true };
|
|
93398
|
+
}
|
|
93399
|
+
log?.("error", {
|
|
93400
|
+
event: "install_failed",
|
|
93401
|
+
command,
|
|
93402
|
+
cwd: cwd2,
|
|
93403
|
+
attempt,
|
|
93404
|
+
maxAttempts: INSTALL_MAX_ATTEMPTS,
|
|
93405
|
+
exitCode: lastAttempt.code,
|
|
93406
|
+
...lastAttempt.spawnError ? { spawnError: lastAttempt.spawnError } : {},
|
|
93407
|
+
stdoutTail: lastAttempt.stdoutTail,
|
|
93408
|
+
stderrTail: lastAttempt.stderrTail
|
|
93409
|
+
});
|
|
93410
|
+
}
|
|
93411
|
+
return {
|
|
93412
|
+
ok: false,
|
|
93413
|
+
stderrTail: lastAttempt?.spawnError ?? lastAttempt?.stderrTail ?? "install failed"
|
|
93414
|
+
};
|
|
93415
|
+
}
|
|
93416
|
+
var STDERR_TAIL_LIMIT, STDOUT_TAIL_LIMIT, INSTALL_MAX_ATTEMPTS, DEFAULT_RETRY_DELAY_MS;
|
|
93233
93417
|
var init_install_dependencies = __esm({
|
|
93234
93418
|
"apps/cli/src/services/install-dependencies.ts"() {
|
|
93235
93419
|
"use strict";
|
|
93236
93420
|
STDERR_TAIL_LIMIT = 2e3;
|
|
93421
|
+
STDOUT_TAIL_LIMIT = 4e3;
|
|
93422
|
+
INSTALL_MAX_ATTEMPTS = 2;
|
|
93423
|
+
DEFAULT_RETRY_DELAY_MS = 1e3;
|
|
93237
93424
|
}
|
|
93238
93425
|
});
|
|
93239
93426
|
|
|
@@ -93272,7 +93459,147 @@ var init_vendor_env_keys = __esm({
|
|
|
93272
93459
|
}
|
|
93273
93460
|
});
|
|
93274
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
|
+
|
|
93275
93592
|
// apps/cli/src/ui/init-flow.tsx
|
|
93593
|
+
import * as path14 from "node:path";
|
|
93594
|
+
function FrameworkIndicator({ isSelected = false }) {
|
|
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" : " " }) });
|
|
93596
|
+
}
|
|
93597
|
+
function FrameworkItem({
|
|
93598
|
+
isSelected = false,
|
|
93599
|
+
label
|
|
93600
|
+
}) {
|
|
93601
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { color: isSelected ? theme.accent : void 0, bold: isSelected, children: label });
|
|
93602
|
+
}
|
|
93276
93603
|
function validateName(name) {
|
|
93277
93604
|
if (name.length === 0)
|
|
93278
93605
|
return "App name is required.";
|
|
@@ -93284,16 +93611,50 @@ function validateName(name) {
|
|
|
93284
93611
|
return NAME_PATTERN_MESSAGE;
|
|
93285
93612
|
return null;
|
|
93286
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
|
+
}
|
|
93621
|
+
function computeFrameworkPickerLimit(rows, itemCount) {
|
|
93622
|
+
if (!Number.isFinite(rows) || rows <= 0)
|
|
93623
|
+
return itemCount;
|
|
93624
|
+
const available = rows - FRAMEWORK_PICKER_RESERVED_ROWS;
|
|
93625
|
+
return Math.max(
|
|
93626
|
+
MIN_FRAMEWORK_PICKER_VISIBLE,
|
|
93627
|
+
Math.min(itemCount, available, MAX_FRAMEWORK_PICKER_VISIBLE)
|
|
93628
|
+
);
|
|
93629
|
+
}
|
|
93630
|
+
function useStdoutRows() {
|
|
93631
|
+
const { stdout } = use_stdout_default();
|
|
93632
|
+
const readRows = () => stdout && Number.isFinite(stdout.rows) && stdout.rows > 0 ? stdout.rows : 0;
|
|
93633
|
+
const [rows, setRows] = (0, import_react40.useState)(readRows);
|
|
93634
|
+
(0, import_react40.useEffect)(() => {
|
|
93635
|
+
if (!stdout)
|
|
93636
|
+
return;
|
|
93637
|
+
const update = () => {
|
|
93638
|
+
setRows(readRows());
|
|
93639
|
+
};
|
|
93640
|
+
stdout.on("resize", update);
|
|
93641
|
+
return () => {
|
|
93642
|
+
stdout.off("resize", update);
|
|
93643
|
+
};
|
|
93644
|
+
}, [stdout]);
|
|
93645
|
+
return rows;
|
|
93646
|
+
}
|
|
93287
93647
|
function InitFlow({
|
|
93288
93648
|
initialName,
|
|
93289
93649
|
initialIntelligence,
|
|
93290
93650
|
initialFramework,
|
|
93291
93651
|
onComplete,
|
|
93292
93652
|
onIntelligenceSelected,
|
|
93293
|
-
onFrameworkSelected
|
|
93653
|
+
onFrameworkSelected,
|
|
93654
|
+
checkNameAvailable = checkProjectDirAvailable
|
|
93294
93655
|
}) {
|
|
93295
|
-
const [name, setName] = (0,
|
|
93296
|
-
const [nameError, setNameError] = (0,
|
|
93656
|
+
const [name, setName] = (0, import_react40.useState)(initialName ?? "");
|
|
93657
|
+
const [nameError, setNameError] = (0, import_react40.useState)(null);
|
|
93297
93658
|
function firstStep() {
|
|
93298
93659
|
if (initialName === null)
|
|
93299
93660
|
return "name";
|
|
@@ -93301,8 +93662,9 @@ function InitFlow({
|
|
|
93301
93662
|
return "done";
|
|
93302
93663
|
return "framework";
|
|
93303
93664
|
}
|
|
93304
|
-
const [step, setStep] = (0,
|
|
93305
|
-
|
|
93665
|
+
const [step, setStep] = (0, import_react40.useState)(firstStep);
|
|
93666
|
+
const stdoutRows = useStdoutRows();
|
|
93667
|
+
(0, import_react40.useEffect)(() => {
|
|
93306
93668
|
if (initialFramework !== null) {
|
|
93307
93669
|
onFrameworkSelected?.({
|
|
93308
93670
|
framework: initialFramework,
|
|
@@ -93316,7 +93678,7 @@ function InitFlow({
|
|
|
93316
93678
|
});
|
|
93317
93679
|
}
|
|
93318
93680
|
}, []);
|
|
93319
|
-
(0,
|
|
93681
|
+
(0, import_react40.useEffect)(() => {
|
|
93320
93682
|
if (step === "done" && initialFramework !== null) {
|
|
93321
93683
|
const chosen = initialFramework;
|
|
93322
93684
|
onComplete(resolveOptions(name, chosen));
|
|
@@ -93338,6 +93700,11 @@ function InitFlow({
|
|
|
93338
93700
|
setNameError(error48);
|
|
93339
93701
|
return;
|
|
93340
93702
|
}
|
|
93703
|
+
const availabilityError = checkNameAvailable(trimmed);
|
|
93704
|
+
if (availabilityError) {
|
|
93705
|
+
setNameError(availabilityError);
|
|
93706
|
+
return;
|
|
93707
|
+
}
|
|
93341
93708
|
setNameError(null);
|
|
93342
93709
|
setName(trimmed);
|
|
93343
93710
|
advancePastName(trimmed);
|
|
@@ -93359,16 +93726,21 @@ function InitFlow({
|
|
|
93359
93726
|
const frameworkChoices = initialIntelligence === true ? FRAMEWORK_CHOICES.filter(
|
|
93360
93727
|
(choice) => THREADS_FRAMEWORKS.has(choice.value)
|
|
93361
93728
|
) : FRAMEWORK_CHOICES;
|
|
93362
|
-
|
|
93363
|
-
|
|
93364
|
-
|
|
93365
|
-
|
|
93366
|
-
|
|
93367
|
-
|
|
93729
|
+
const frameworkLimit = computeFrameworkPickerLimit(
|
|
93730
|
+
stdoutRows,
|
|
93731
|
+
frameworkChoices.length
|
|
93732
|
+
);
|
|
93733
|
+
const frameworkIsScrolling = frameworkLimit < frameworkChoices.length;
|
|
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: [
|
|
93368
93740
|
">",
|
|
93369
93741
|
" "
|
|
93370
93742
|
] }),
|
|
93371
|
-
/* @__PURE__ */ (0,
|
|
93743
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
93372
93744
|
build_default,
|
|
93373
93745
|
{
|
|
93374
93746
|
value: name,
|
|
@@ -93378,38 +93750,51 @@ function InitFlow({
|
|
|
93378
93750
|
}
|
|
93379
93751
|
)
|
|
93380
93752
|
] }),
|
|
93381
|
-
nameError !== null && /* @__PURE__ */ (0,
|
|
93753
|
+
nameError !== null && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { color: "red", children: nameError })
|
|
93382
93754
|
] }),
|
|
93383
|
-
step === "framework" && /* @__PURE__ */ (0,
|
|
93384
|
-
/* @__PURE__ */ (0,
|
|
93385
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
93386
93758
|
SelectInput_default,
|
|
93387
93759
|
{
|
|
93388
93760
|
items: frameworkChoices,
|
|
93389
|
-
onSelect: handleFrameworkSelect
|
|
93761
|
+
onSelect: handleFrameworkSelect,
|
|
93762
|
+
indicatorComponent: FrameworkIndicator,
|
|
93763
|
+
itemComponent: FrameworkItem,
|
|
93764
|
+
limit: frameworkLimit
|
|
93390
93765
|
}
|
|
93391
|
-
)
|
|
93766
|
+
),
|
|
93767
|
+
frameworkIsScrolling && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Text, { dimColor: true, children: [
|
|
93768
|
+
"\u2191\u2193 to browse all ",
|
|
93769
|
+
frameworkChoices.length,
|
|
93770
|
+
" \xB7 \u21B5 select"
|
|
93771
|
+
] })
|
|
93392
93772
|
] })
|
|
93393
93773
|
] });
|
|
93394
93774
|
}
|
|
93395
|
-
var
|
|
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;
|
|
93396
93776
|
var init_init_flow = __esm({
|
|
93397
93777
|
async "apps/cli/src/ui/init-flow.tsx"() {
|
|
93398
93778
|
"use strict";
|
|
93399
|
-
|
|
93779
|
+
import_react40 = __toESM(require_react(), 1);
|
|
93400
93780
|
await init_build2();
|
|
93401
93781
|
await init_build3();
|
|
93402
93782
|
await init_build4();
|
|
93403
93783
|
init_types();
|
|
93404
|
-
|
|
93784
|
+
init_project_scaffold();
|
|
93785
|
+
init_theme();
|
|
93786
|
+
import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
|
|
93405
93787
|
DISALLOWED_NAME_CHAR_RE = /[^a-z0-9-]/;
|
|
93406
93788
|
NAME_PATTERN_MESSAGE = "Use only lowercase letters, numbers, and hyphens, and do not start or end with a hyphen.";
|
|
93789
|
+
FRAMEWORK_PICKER_RESERVED_ROWS = 4;
|
|
93790
|
+
MIN_FRAMEWORK_PICKER_VISIBLE = 3;
|
|
93791
|
+
MAX_FRAMEWORK_PICKER_VISIBLE = 6;
|
|
93407
93792
|
}
|
|
93408
93793
|
});
|
|
93409
93794
|
|
|
93410
93795
|
// apps/cli/src/services/intelligence-readme.ts
|
|
93411
|
-
import * as
|
|
93412
|
-
import * as
|
|
93796
|
+
import * as fs17 from "node:fs";
|
|
93797
|
+
import * as path15 from "node:path";
|
|
93413
93798
|
function buildSection(projectSlug) {
|
|
93414
93799
|
return `${INTELLIGENCE_README_HEADING}
|
|
93415
93800
|
|
|
@@ -93426,14 +93811,14 @@ Learn more at https://docs.copilotkit.ai.
|
|
|
93426
93811
|
`;
|
|
93427
93812
|
}
|
|
93428
93813
|
function appendIntelligenceReadme(dir, opts) {
|
|
93429
|
-
const readmePath =
|
|
93430
|
-
const existing =
|
|
93814
|
+
const readmePath = path15.join(dir, "README.md");
|
|
93815
|
+
const existing = fs17.existsSync(readmePath) ? fs17.readFileSync(readmePath, "utf8") : "";
|
|
93431
93816
|
if (existing.includes(INTELLIGENCE_README_HEADING)) {
|
|
93432
93817
|
return;
|
|
93433
93818
|
}
|
|
93434
93819
|
const section = buildSection(opts.projectSlug);
|
|
93435
93820
|
const prefix = existing.length === 0 ? "" : existing.endsWith("\n") ? "\n" : "\n\n";
|
|
93436
|
-
|
|
93821
|
+
fs17.writeFileSync(readmePath, existing + prefix + section);
|
|
93437
93822
|
}
|
|
93438
93823
|
var INTELLIGENCE_README_HEADING;
|
|
93439
93824
|
var init_intelligence_readme = __esm({
|
|
@@ -93466,7 +93851,7 @@ import {
|
|
|
93466
93851
|
readFileSync as readFileSync6,
|
|
93467
93852
|
rmSync as rmSync3
|
|
93468
93853
|
} from "node:fs";
|
|
93469
|
-
import * as
|
|
93854
|
+
import * as path16 from "node:path";
|
|
93470
93855
|
import { execSync as execSync2 } from "node:child_process";
|
|
93471
93856
|
function shouldRenderInitBrowserLoginConfirmation(phase) {
|
|
93472
93857
|
return phase === "confirming" || phase === "waiting" || phase === "finalizing";
|
|
@@ -93483,12 +93868,12 @@ async function initGit(projectDir) {
|
|
|
93483
93868
|
function commandExists(command, environment = process.env, platform3 = process.platform) {
|
|
93484
93869
|
const pathValue = environment.PATH ?? "";
|
|
93485
93870
|
const pathExtensions = platform3 === "win32" ? (environment.PATHEXT ?? ".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean) : [""];
|
|
93486
|
-
for (const searchPath of pathValue.split(
|
|
93871
|
+
for (const searchPath of pathValue.split(path16.delimiter)) {
|
|
93487
93872
|
if (!searchPath) {
|
|
93488
93873
|
continue;
|
|
93489
93874
|
}
|
|
93490
93875
|
for (const extension of pathExtensions) {
|
|
93491
|
-
const candidatePath =
|
|
93876
|
+
const candidatePath = path16.join(searchPath, `${command}${extension}`);
|
|
93492
93877
|
try {
|
|
93493
93878
|
accessSync(candidatePath, constants2.X_OK);
|
|
93494
93879
|
return true;
|
|
@@ -93498,15 +93883,18 @@ function commandExists(command, environment = process.env, platform3 = process.p
|
|
|
93498
93883
|
}
|
|
93499
93884
|
return false;
|
|
93500
93885
|
}
|
|
93886
|
+
function vendorKeyPromptInteractive() {
|
|
93887
|
+
return process.stdin.isTTY === true && process.stdout.isTTY === true;
|
|
93888
|
+
}
|
|
93501
93889
|
function buildInitNextSteps(templateDefinition, projectName, result, unsatisfiedKeys, installAlreadyRan = false) {
|
|
93502
93890
|
const missingPrerequisites = templateDefinition.prerequisites.filter(
|
|
93503
93891
|
(prerequisite) => result.missingPrerequisites.includes(prerequisite.command)
|
|
93504
93892
|
);
|
|
93505
|
-
const
|
|
93506
|
-
|
|
93893
|
+
const vendorKeys = new Set(
|
|
93894
|
+
resolveVendorEnvKeys(templateDefinition).map((req) => req.key)
|
|
93507
93895
|
);
|
|
93508
93896
|
const envNotes = templateDefinition.environment.filter(
|
|
93509
|
-
(envKey) => !(envKey.key === "COPILOTKIT_LICENSE_TOKEN" && result.licenseWritten) && !
|
|
93897
|
+
(envKey) => !(envKey.key === "COPILOTKIT_LICENSE_TOKEN" && result.licenseWritten) && !vendorKeys.has(envKey.key)
|
|
93510
93898
|
).map((envKey) => {
|
|
93511
93899
|
const envTarget = result.envCreatedFromExample || result.licenseWritten ? "the scaffolded .env file" : ".env";
|
|
93512
93900
|
return `Set ${envKey.key} in ${envTarget}. ${envKey.note}`;
|
|
@@ -93554,6 +93942,9 @@ function buildInitNextSteps(templateDefinition, projectName, result, unsatisfied
|
|
|
93554
93942
|
code: `${requirement.key}=${requirement.example}`
|
|
93555
93943
|
});
|
|
93556
93944
|
}
|
|
93945
|
+
for (const note of templateDefinition.setupNotes ?? []) {
|
|
93946
|
+
steps.push(note.code !== void 0 ? { ...note } : { text: note.text });
|
|
93947
|
+
}
|
|
93557
93948
|
steps.push({
|
|
93558
93949
|
text: ` Start the dev server${SEP2}`,
|
|
93559
93950
|
code: templateDefinition.runCommand
|
|
@@ -93652,6 +94043,7 @@ async function scaffoldInitProject(options, dependencies = defaultInitScaffoldDe
|
|
|
93652
94043
|
TELEMETRY_ERROR_CODES.INVALID_FRAMEWORK
|
|
93653
94044
|
);
|
|
93654
94045
|
}
|
|
94046
|
+
dependencies.assertProjectDirAvailable(projectDir);
|
|
93655
94047
|
onPhaseChange?.("auth");
|
|
93656
94048
|
const { cliToken: ensuredToken, alreadyAuthenticated } = await ensureCliToken2(
|
|
93657
94049
|
dependencies,
|
|
@@ -93686,6 +94078,15 @@ async function scaffoldInitProject(options, dependencies = defaultInitScaffoldDe
|
|
|
93686
94078
|
...hostedConfig ? { hosted: hostedConfig } : {}
|
|
93687
94079
|
});
|
|
93688
94080
|
}
|
|
94081
|
+
try {
|
|
94082
|
+
dependencies.cleanupTestHarness(projectDir);
|
|
94083
|
+
} catch (cleanupError) {
|
|
94084
|
+
const detail = cleanupError instanceof Error ? cleanupError.message : String(cleanupError);
|
|
94085
|
+
process.stderr.write(
|
|
94086
|
+
`Warning: could not remove docker test-harness artifacts from the new app (${detail}); they remain in the scaffold.
|
|
94087
|
+
`
|
|
94088
|
+
);
|
|
94089
|
+
}
|
|
93689
94090
|
onPhaseChange?.("git");
|
|
93690
94091
|
try {
|
|
93691
94092
|
await dependencies.initGit(projectDir);
|
|
@@ -93802,17 +94203,18 @@ function ScaffoldProgress({
|
|
|
93802
94203
|
const { exit } = use_app_default();
|
|
93803
94204
|
const browserLogin = useBrowserLogin();
|
|
93804
94205
|
const templateDefinition = resolveInitTemplate(options);
|
|
93805
|
-
const [phase, setPhase] = (0,
|
|
93806
|
-
const [errorMessage, setErrorMessage] = (0,
|
|
93807
|
-
const scaffoldErrorRef = (0,
|
|
93808
|
-
const [authMessage, setAuthMessage] = (0,
|
|
93809
|
-
const [nextSteps, setNextSteps] = (0,
|
|
93810
|
-
const [scaffoldWarnings, setScaffoldWarnings] = (0,
|
|
93811
|
-
const [scaffoldResult, setScaffoldResult] = (0,
|
|
93812
|
-
const [
|
|
93813
|
-
const
|
|
93814
|
-
const
|
|
93815
|
-
const
|
|
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)(
|
|
93816
94218
|
() => ({
|
|
93817
94219
|
...defaultInitScaffoldDependencies,
|
|
93818
94220
|
login: browserLogin.runLogin,
|
|
@@ -93823,8 +94225,8 @@ function ScaffoldProgress({
|
|
|
93823
94225
|
new Error("Not authenticated for project selection.")
|
|
93824
94226
|
);
|
|
93825
94227
|
}
|
|
93826
|
-
return new Promise((
|
|
93827
|
-
selectionDeferredRef.current = { resolve:
|
|
94228
|
+
return new Promise((resolve3, reject) => {
|
|
94229
|
+
selectionDeferredRef.current = { resolve: resolve3, reject };
|
|
93828
94230
|
});
|
|
93829
94231
|
},
|
|
93830
94232
|
// Test-injected deps win over the inline wiring above; the production
|
|
@@ -93833,7 +94235,7 @@ function ScaffoldProgress({
|
|
|
93833
94235
|
}),
|
|
93834
94236
|
[browserLogin.runLogin, dependencies]
|
|
93835
94237
|
);
|
|
93836
|
-
(0,
|
|
94238
|
+
(0, import_react41.useEffect)(() => {
|
|
93837
94239
|
if (phase === "success" || phase === "error") {
|
|
93838
94240
|
const flushThenExit = setTimeout(
|
|
93839
94241
|
() => exit(resolveScaffoldExitError(phase, scaffoldErrorRef.current)),
|
|
@@ -93843,13 +94245,13 @@ function ScaffoldProgress({
|
|
|
93843
94245
|
}
|
|
93844
94246
|
return void 0;
|
|
93845
94247
|
}, [phase, exit]);
|
|
93846
|
-
(0,
|
|
94248
|
+
(0, import_react41.useEffect)(
|
|
93847
94249
|
() => () => {
|
|
93848
94250
|
isMountedRef.current = false;
|
|
93849
94251
|
},
|
|
93850
94252
|
[]
|
|
93851
94253
|
);
|
|
93852
|
-
(0,
|
|
94254
|
+
(0, import_react41.useEffect)(() => {
|
|
93853
94255
|
let cancelled = false;
|
|
93854
94256
|
async function run() {
|
|
93855
94257
|
const result = await scaffoldInitProject(
|
|
@@ -93871,7 +94273,18 @@ function ScaffoldProgress({
|
|
|
93871
94273
|
if (cancelled)
|
|
93872
94274
|
return;
|
|
93873
94275
|
setScaffoldResult(result);
|
|
93874
|
-
|
|
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
|
+
}
|
|
93875
94288
|
}
|
|
93876
94289
|
run().catch((err) => {
|
|
93877
94290
|
if (cancelled)
|
|
@@ -93909,33 +94322,33 @@ function ScaffoldProgress({
|
|
|
93909
94322
|
setPhase("success");
|
|
93910
94323
|
}
|
|
93911
94324
|
if (shouldRenderInitBrowserLoginConfirmation(browserLogin.state.phase)) {
|
|
93912
|
-
return /* @__PURE__ */ (0,
|
|
94325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(BrowserLoginConfirmation, { reason: authReason });
|
|
93913
94326
|
}
|
|
93914
94327
|
if (phase === "auth") {
|
|
93915
|
-
return /* @__PURE__ */ (0,
|
|
93916
|
-
/* @__PURE__ */ (0,
|
|
93917
|
-
/* @__PURE__ */ (0,
|
|
93918
|
-
/* @__PURE__ */ (0,
|
|
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." })
|
|
93919
94332
|
] }),
|
|
93920
|
-
authMessage ? /* @__PURE__ */ (0,
|
|
93921
|
-
/* @__PURE__ */ (0,
|
|
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" })
|
|
93922
94335
|
] });
|
|
93923
94336
|
}
|
|
93924
94337
|
if (phase === "license") {
|
|
93925
|
-
return /* @__PURE__ */ (0,
|
|
93926
|
-
authMessage ? /* @__PURE__ */ (0,
|
|
93927
|
-
/* @__PURE__ */ (0,
|
|
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" })
|
|
93928
94341
|
] });
|
|
93929
94342
|
}
|
|
93930
94343
|
if (phase === "scaffold") {
|
|
93931
|
-
return /* @__PURE__ */ (0,
|
|
94344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Spinner, { label: "\u{1FA81} Downloading template\u2026" }) });
|
|
93932
94345
|
}
|
|
93933
94346
|
if (phase === "select-project") {
|
|
93934
94347
|
const auth = authStore.get();
|
|
93935
94348
|
if (auth === null) {
|
|
93936
94349
|
return null;
|
|
93937
94350
|
}
|
|
93938
|
-
return /* @__PURE__ */ (0,
|
|
94351
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
93939
94352
|
HostedProjectSelect,
|
|
93940
94353
|
{
|
|
93941
94354
|
apiClient: createApiClient(getOpsApiUrl(), auth.cliToken),
|
|
@@ -93955,13 +94368,29 @@ function ScaffoldProgress({
|
|
|
93955
94368
|
);
|
|
93956
94369
|
}
|
|
93957
94370
|
if (phase === "activate-intelligence") {
|
|
93958
|
-
return /* @__PURE__ */ (0,
|
|
94371
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Spinner, { label: "\u{1FA81} Activating Intelligence\u2026" }) });
|
|
93959
94372
|
}
|
|
93960
94373
|
if (phase === "git") {
|
|
93961
|
-
return /* @__PURE__ */ (0,
|
|
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
|
+
);
|
|
93962
94391
|
}
|
|
93963
94392
|
if (phase === "install-prompt" && scaffoldResult) {
|
|
93964
|
-
return /* @__PURE__ */ (0,
|
|
94393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
93965
94394
|
InstallPrompt,
|
|
93966
94395
|
{
|
|
93967
94396
|
installCommand: templateDefinition.installCommand,
|
|
@@ -93973,7 +94402,8 @@ function ScaffoldProgress({
|
|
|
93973
94402
|
setPhase("installing");
|
|
93974
94403
|
scaffoldDependencies.installDependencies({
|
|
93975
94404
|
cwd: scaffoldResult.projectDir,
|
|
93976
|
-
command: templateDefinition.installCommand
|
|
94405
|
+
command: templateDefinition.installCommand,
|
|
94406
|
+
log: writeCliLog
|
|
93977
94407
|
}).then((r) => {
|
|
93978
94408
|
if (r.ok)
|
|
93979
94409
|
return true;
|
|
@@ -93996,24 +94426,27 @@ function ScaffoldProgress({
|
|
|
93996
94426
|
);
|
|
93997
94427
|
}
|
|
93998
94428
|
if (phase === "installing") {
|
|
93999
|
-
return /* @__PURE__ */ (0,
|
|
94429
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Spinner, { label: "\u{1FA81} Installing dependencies\u2026" });
|
|
94000
94430
|
}
|
|
94001
94431
|
if (phase === "success") {
|
|
94002
|
-
return /* @__PURE__ */ (0,
|
|
94003
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
94004
94434
|
'App "',
|
|
94005
94435
|
options.name,
|
|
94006
94436
|
'" created successfully!'
|
|
94007
94437
|
] }),
|
|
94008
|
-
installError ?
|
|
94009
|
-
|
|
94010
|
-
|
|
94011
|
-
|
|
94012
|
-
|
|
94013
|
-
|
|
94014
|
-
|
|
94015
|
-
|
|
94016
|
-
|
|
94438
|
+
installError ? (
|
|
94439
|
+
// The error detail is not inlined here — it goes to the CLI log; the
|
|
94440
|
+
// second line points the user at the full captured output.
|
|
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: [
|
|
94444
|
+
"Full output: ",
|
|
94445
|
+
getCliLogPath()
|
|
94446
|
+
] })
|
|
94447
|
+
] })
|
|
94448
|
+
) : null,
|
|
94449
|
+
scaffoldWarnings.map((warning, index) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Text, { color: "yellow", children: [
|
|
94017
94450
|
"\u26A0 ",
|
|
94018
94451
|
warning
|
|
94019
94452
|
] }, `warn-${index}`)),
|
|
@@ -94026,27 +94459,27 @@ function ScaffoldProgress({
|
|
|
94026
94459
|
// white) washes out on one background or the other. The `code` tail is
|
|
94027
94460
|
// `bold` to stand out from prose; prose-only lines (headings, notes)
|
|
94028
94461
|
// carry no `code`.
|
|
94029
|
-
/* @__PURE__ */ (0,
|
|
94462
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Text, { children: [
|
|
94030
94463
|
step.text,
|
|
94031
|
-
step.code !== void 0 ? /* @__PURE__ */ (0,
|
|
94464
|
+
step.code !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text, { bold: true, children: step.code }) : null
|
|
94032
94465
|
] }, `step-${index}`)
|
|
94033
94466
|
)),
|
|
94034
|
-
/* @__PURE__ */ (0,
|
|
94467
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text, { children: " " })
|
|
94035
94468
|
] });
|
|
94036
94469
|
}
|
|
94037
|
-
return /* @__PURE__ */ (0,
|
|
94038
|
-
/* @__PURE__ */ (0,
|
|
94470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
94471
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Text, { color: "red", children: [
|
|
94039
94472
|
"Init failed: ",
|
|
94040
94473
|
errorMessage
|
|
94041
94474
|
] }),
|
|
94042
|
-
/* @__PURE__ */ (0,
|
|
94475
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text, { children: " " })
|
|
94043
94476
|
] });
|
|
94044
94477
|
}
|
|
94045
94478
|
function InstallPrompt({
|
|
94046
94479
|
installCommand,
|
|
94047
94480
|
onAnswer
|
|
94048
94481
|
}) {
|
|
94049
|
-
const answeredRef = (0,
|
|
94482
|
+
const answeredRef = (0, import_react41.useRef)(false);
|
|
94050
94483
|
use_input_default((input, key) => {
|
|
94051
94484
|
if (answeredRef.current)
|
|
94052
94485
|
return;
|
|
@@ -94058,16 +94491,16 @@ function InstallPrompt({
|
|
|
94058
94491
|
onAnswer(false);
|
|
94059
94492
|
}
|
|
94060
94493
|
});
|
|
94061
|
-
return /* @__PURE__ */ (0,
|
|
94494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Box_default, { flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Text, { children: [
|
|
94062
94495
|
"Want me to install the dependencies for you now? (",
|
|
94063
94496
|
installCommand,
|
|
94064
94497
|
")",
|
|
94065
94498
|
" ",
|
|
94066
|
-
/* @__PURE__ */ (0,
|
|
94499
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text, { bold: true, children: "[Y/n]" })
|
|
94067
94500
|
] }) });
|
|
94068
94501
|
}
|
|
94069
94502
|
function renderDefaultScaffoldProgress(options, telemetry) {
|
|
94070
|
-
return /* @__PURE__ */ (0,
|
|
94503
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ScaffoldProgress, { options, telemetry });
|
|
94071
94504
|
}
|
|
94072
94505
|
function resolvePrefilledOptions(name, intelligence, framework) {
|
|
94073
94506
|
if (name === null)
|
|
@@ -94098,8 +94531,8 @@ function InitApp({
|
|
|
94098
94531
|
initialIntelligence,
|
|
94099
94532
|
initialFramework
|
|
94100
94533
|
);
|
|
94101
|
-
const [options, setOptions] = (0,
|
|
94102
|
-
(0,
|
|
94534
|
+
const [options, setOptions] = (0, import_react41.useState)(prefilled);
|
|
94535
|
+
(0, import_react41.useEffect)(() => {
|
|
94103
94536
|
if (prefilled !== null) {
|
|
94104
94537
|
if (initialIntelligence !== null) {
|
|
94105
94538
|
onIntelligenceSelected?.({
|
|
@@ -94115,13 +94548,13 @@ function InitApp({
|
|
|
94115
94548
|
}
|
|
94116
94549
|
}
|
|
94117
94550
|
}, []);
|
|
94118
|
-
return /* @__PURE__ */ (0,
|
|
94119
|
-
!noBanner && /* @__PURE__ */ (0,
|
|
94120
|
-
/* @__PURE__ */ (0,
|
|
94121
|
-
/* @__PURE__ */ (0,
|
|
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, {})
|
|
94122
94555
|
] }),
|
|
94123
|
-
options !== null ? renderScaffoldProgress(options, telemetry) : /* @__PURE__ */ (0,
|
|
94124
|
-
/* @__PURE__ */ (0,
|
|
94556
|
+
options !== null ? renderScaffoldProgress(options, telemetry) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
94557
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
94125
94558
|
InitFlow,
|
|
94126
94559
|
{
|
|
94127
94560
|
initialName,
|
|
@@ -94136,7 +94569,7 @@ function InitApp({
|
|
|
94136
94569
|
}
|
|
94137
94570
|
}
|
|
94138
94571
|
),
|
|
94139
|
-
/* @__PURE__ */ (0,
|
|
94572
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CliTip, {})
|
|
94140
94573
|
] })
|
|
94141
94574
|
] });
|
|
94142
94575
|
}
|
|
@@ -94148,6 +94581,13 @@ async function runInit(flags, callbacks) {
|
|
|
94148
94581
|
if (nameError !== null) {
|
|
94149
94582
|
throw tagError(new Error(nameError), TELEMETRY_ERROR_CODES.INVALID_NAME);
|
|
94150
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
|
+
}
|
|
94151
94591
|
}
|
|
94152
94592
|
const initialIntelligence = flags.intelligence ?? null;
|
|
94153
94593
|
const frameworkFlagRaw = flags.framework?.trim() ?? null;
|
|
@@ -94160,7 +94600,7 @@ async function runInit(flags, callbacks) {
|
|
|
94160
94600
|
}
|
|
94161
94601
|
const initialFramework = frameworkFlag;
|
|
94162
94602
|
const { waitUntilExit } = render_default(
|
|
94163
|
-
/* @__PURE__ */ (0,
|
|
94603
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(BrowserLoginProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
94164
94604
|
InitApp,
|
|
94165
94605
|
{
|
|
94166
94606
|
initialName,
|
|
@@ -94175,11 +94615,11 @@ async function runInit(flags, callbacks) {
|
|
|
94175
94615
|
);
|
|
94176
94616
|
await waitUntilExit();
|
|
94177
94617
|
}
|
|
94178
|
-
var
|
|
94618
|
+
var import_react41, import_jsx_runtime13, PROJECT_CREATION_AUTH_HANDOFF, INIT_AUTH_REASON_WITH_LICENSE, INIT_AUTH_REASON_ACCOUNT_ONLY, defaultInitScaffoldDependencies;
|
|
94179
94619
|
var init_init = __esm({
|
|
94180
94620
|
async "apps/cli/src/commands/init.tsx"() {
|
|
94181
94621
|
"use strict";
|
|
94182
|
-
|
|
94622
|
+
import_react41 = __toESM(require_react(), 1);
|
|
94183
94623
|
await init_build2();
|
|
94184
94624
|
await init_build2();
|
|
94185
94625
|
init_types();
|
|
@@ -94189,6 +94629,8 @@ var init_init = __esm({
|
|
|
94189
94629
|
init_intelligence_activation();
|
|
94190
94630
|
init_install_dependencies();
|
|
94191
94631
|
init_vendor_env_keys();
|
|
94632
|
+
init_env_file();
|
|
94633
|
+
await init_vendor_key_prompt();
|
|
94192
94634
|
init_config_service();
|
|
94193
94635
|
init_event_properties();
|
|
94194
94636
|
init_cli_logs();
|
|
@@ -94202,7 +94644,7 @@ var init_init = __esm({
|
|
|
94202
94644
|
await init_hosted_project_select();
|
|
94203
94645
|
init_project_config();
|
|
94204
94646
|
init_intelligence_readme();
|
|
94205
|
-
|
|
94647
|
+
import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
|
|
94206
94648
|
PROJECT_CREATION_AUTH_HANDOFF = {
|
|
94207
94649
|
source: "cli",
|
|
94208
94650
|
mode: "project_creation"
|
|
@@ -94215,16 +94657,18 @@ var init_init = __esm({
|
|
|
94215
94657
|
getCliToken: () => authStore.getToken(),
|
|
94216
94658
|
createApiClient,
|
|
94217
94659
|
getOpsApiUrl,
|
|
94660
|
+
assertProjectDirAvailable,
|
|
94218
94661
|
scaffoldProject,
|
|
94219
94662
|
initGit,
|
|
94220
94663
|
copyEnvExample,
|
|
94664
|
+
cleanupTestHarness: removeTestHarnessArtifacts,
|
|
94221
94665
|
writeLicenseKey,
|
|
94222
94666
|
commandExists,
|
|
94223
|
-
resolveProjectDir: (projectName) =>
|
|
94667
|
+
resolveProjectDir: (projectName) => path16.resolve(process.cwd(), projectName),
|
|
94224
94668
|
activateIntelligence,
|
|
94225
94669
|
installDependencies,
|
|
94226
94670
|
readProjectEnvFile: (projectDir) => {
|
|
94227
|
-
const envPath =
|
|
94671
|
+
const envPath = path16.join(projectDir, ".env");
|
|
94228
94672
|
return existsSync7(envPath) ? readFileSync6(envPath, "utf8") : "";
|
|
94229
94673
|
},
|
|
94230
94674
|
resolveHostedScaffoldConfig,
|
|
@@ -94235,7 +94679,9 @@ var init_init = __esm({
|
|
|
94235
94679
|
},
|
|
94236
94680
|
writeProjectConfig,
|
|
94237
94681
|
appendIntelligenceReadme,
|
|
94238
|
-
writeHostedApiKey
|
|
94682
|
+
writeHostedApiKey,
|
|
94683
|
+
writeVendorKey,
|
|
94684
|
+
isVendorKeyPromptInteractive: vendorKeyPromptInteractive
|
|
94239
94685
|
};
|
|
94240
94686
|
}
|
|
94241
94687
|
});
|
|
@@ -94264,7 +94710,7 @@ var init_version = __esm({
|
|
|
94264
94710
|
// apps/cli/src/ui/login-flow.tsx
|
|
94265
94711
|
function LoginFlow({ onComplete }) {
|
|
94266
94712
|
const { runLogin: runLogin2 } = useBrowserLogin();
|
|
94267
|
-
(0,
|
|
94713
|
+
(0, import_react42.useEffect)(() => {
|
|
94268
94714
|
runLogin2().then(() => {
|
|
94269
94715
|
onComplete({ success: true });
|
|
94270
94716
|
}).catch((error48) => {
|
|
@@ -94276,15 +94722,15 @@ function LoginFlow({ onComplete }) {
|
|
|
94276
94722
|
onComplete({ error: fallbackError, success: false });
|
|
94277
94723
|
});
|
|
94278
94724
|
}, [onComplete, runLogin2]);
|
|
94279
|
-
return /* @__PURE__ */ (0,
|
|
94725
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(BrowserLoginConfirmation, {});
|
|
94280
94726
|
}
|
|
94281
|
-
var
|
|
94727
|
+
var import_react42, import_jsx_runtime14;
|
|
94282
94728
|
var init_login_flow = __esm({
|
|
94283
94729
|
async "apps/cli/src/ui/login-flow.tsx"() {
|
|
94284
94730
|
"use strict";
|
|
94285
|
-
|
|
94731
|
+
import_react42 = __toESM(require_react(), 1);
|
|
94286
94732
|
await init_browser_login();
|
|
94287
|
-
|
|
94733
|
+
import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
|
|
94288
94734
|
}
|
|
94289
94735
|
});
|
|
94290
94736
|
|
|
@@ -94294,16 +94740,16 @@ __export(login_exports, {
|
|
|
94294
94740
|
runLogin: () => runLogin
|
|
94295
94741
|
});
|
|
94296
94742
|
async function runLogin() {
|
|
94297
|
-
return await new Promise((
|
|
94743
|
+
return await new Promise((resolve3, reject) => {
|
|
94298
94744
|
const { unmount } = render_default(
|
|
94299
|
-
/* @__PURE__ */ (0,
|
|
94745
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(BrowserLoginProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
94300
94746
|
LoginFlow,
|
|
94301
94747
|
{
|
|
94302
94748
|
onComplete: (result) => {
|
|
94303
94749
|
setTimeout(() => {
|
|
94304
94750
|
unmount();
|
|
94305
94751
|
if (result.success) {
|
|
94306
|
-
|
|
94752
|
+
resolve3();
|
|
94307
94753
|
} else {
|
|
94308
94754
|
reject(result.error ?? new Error("Login failed"));
|
|
94309
94755
|
}
|
|
@@ -94314,14 +94760,14 @@ async function runLogin() {
|
|
|
94314
94760
|
);
|
|
94315
94761
|
});
|
|
94316
94762
|
}
|
|
94317
|
-
var
|
|
94763
|
+
var import_jsx_runtime15;
|
|
94318
94764
|
var init_login = __esm({
|
|
94319
94765
|
async "apps/cli/src/commands/login.tsx"() {
|
|
94320
94766
|
"use strict";
|
|
94321
94767
|
await init_build2();
|
|
94322
94768
|
await init_login_flow();
|
|
94323
94769
|
await init_browser_login();
|
|
94324
|
-
|
|
94770
|
+
import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
|
|
94325
94771
|
}
|
|
94326
94772
|
});
|
|
94327
94773
|
|
|
@@ -94502,16 +94948,16 @@ function KiteGame({
|
|
|
94502
94948
|
const { stdout } = use_stdout_default();
|
|
94503
94949
|
const terminalWidth = useTerminalWidth(stdout);
|
|
94504
94950
|
const playableWidth = getPlayableWidth(terminalWidth);
|
|
94505
|
-
const rngRef = (0,
|
|
94506
|
-
const [highScore, setHighScore] = (0,
|
|
94507
|
-
const [state, setState] = (0,
|
|
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)(
|
|
94508
94954
|
() => createKiteGame({ width: playableWidth, rng: rngRef.current })
|
|
94509
94955
|
);
|
|
94510
|
-
const rows = (0,
|
|
94511
|
-
(0,
|
|
94956
|
+
const rows = (0, import_react43.useMemo)(() => renderKiteGameRows(state), [state]);
|
|
94957
|
+
(0, import_react43.useEffect)(() => {
|
|
94512
94958
|
rngRef.current = rng;
|
|
94513
94959
|
}, [rng]);
|
|
94514
|
-
(0,
|
|
94960
|
+
(0, import_react43.useEffect)(() => {
|
|
94515
94961
|
setState((currentState) => {
|
|
94516
94962
|
if (currentState.width === playableWidth) {
|
|
94517
94963
|
return currentState;
|
|
@@ -94523,13 +94969,13 @@ function KiteGame({
|
|
|
94523
94969
|
});
|
|
94524
94970
|
});
|
|
94525
94971
|
}, [playableWidth]);
|
|
94526
|
-
(0,
|
|
94972
|
+
(0, import_react43.useEffect)(() => {
|
|
94527
94973
|
if (!state.crashed) {
|
|
94528
94974
|
return;
|
|
94529
94975
|
}
|
|
94530
94976
|
setHighScore(saveKiteGameHighScore(state.score));
|
|
94531
94977
|
}, [state.crashed, state.score]);
|
|
94532
|
-
(0,
|
|
94978
|
+
(0, import_react43.useEffect)(() => {
|
|
94533
94979
|
if (!state.started || state.crashed) {
|
|
94534
94980
|
return void 0;
|
|
94535
94981
|
}
|
|
@@ -94572,23 +95018,23 @@ function KiteGame({
|
|
|
94572
95018
|
setState((currentState) => flapKite(currentState));
|
|
94573
95019
|
}
|
|
94574
95020
|
});
|
|
94575
|
-
return /* @__PURE__ */ (0,
|
|
94576
|
-
/* @__PURE__ */ (0,
|
|
95021
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
95022
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Text, { children: [
|
|
94577
95023
|
"CopilotKit Kite Score ",
|
|
94578
95024
|
state.score,
|
|
94579
95025
|
" High",
|
|
94580
95026
|
" ",
|
|
94581
95027
|
Math.max(highScore, state.score)
|
|
94582
95028
|
] }),
|
|
94583
|
-
/* @__PURE__ */ (0,
|
|
94584
|
-
/* @__PURE__ */ (0,
|
|
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." })
|
|
94585
95031
|
] });
|
|
94586
95032
|
}
|
|
94587
95033
|
function useTerminalWidth(stdout) {
|
|
94588
|
-
const [terminalWidth, setTerminalWidth] = (0,
|
|
95034
|
+
const [terminalWidth, setTerminalWidth] = (0, import_react43.useState)(
|
|
94589
95035
|
() => getStdoutColumns(stdout)
|
|
94590
95036
|
);
|
|
94591
|
-
(0,
|
|
95037
|
+
(0, import_react43.useEffect)(() => {
|
|
94592
95038
|
const updateTerminalWidth = () => {
|
|
94593
95039
|
setTerminalWidth(getStdoutColumns(stdout));
|
|
94594
95040
|
};
|
|
@@ -94605,15 +95051,15 @@ function getStdoutColumns(stdout) {
|
|
|
94605
95051
|
function getPlayableWidth(terminalWidth) {
|
|
94606
95052
|
return Math.max(MIN_PLAYABLE_WIDTH, terminalWidth - BORDER_COLUMNS);
|
|
94607
95053
|
}
|
|
94608
|
-
var
|
|
95054
|
+
var import_react43, import_jsx_runtime16, DEFAULT_TICK_MS, MIN_PLAYABLE_WIDTH, BORDER_COLUMNS;
|
|
94609
95055
|
var init_kite_game = __esm({
|
|
94610
95056
|
async "apps/cli/src/ui/kite-game.tsx"() {
|
|
94611
95057
|
"use strict";
|
|
94612
95058
|
await init_build2();
|
|
94613
|
-
|
|
95059
|
+
import_react43 = __toESM(require_react(), 1);
|
|
94614
95060
|
init_kite_game_engine();
|
|
94615
95061
|
init_kite_game_score();
|
|
94616
|
-
|
|
95062
|
+
import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
|
|
94617
95063
|
DEFAULT_TICK_MS = 75;
|
|
94618
95064
|
MIN_PLAYABLE_WIDTH = 32;
|
|
94619
95065
|
BORDER_COLUMNS = 2;
|
|
@@ -94626,20 +95072,20 @@ __export(kite_exports, {
|
|
|
94626
95072
|
runKite: () => runKite
|
|
94627
95073
|
});
|
|
94628
95074
|
async function runKite() {
|
|
94629
|
-
return await new Promise((
|
|
94630
|
-
const { waitUntilExit } = render_default(/* @__PURE__ */ (0,
|
|
95075
|
+
return await new Promise((resolve3, reject) => {
|
|
95076
|
+
const { waitUntilExit } = render_default(/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(KiteGame, { onExit: resolve3 }));
|
|
94631
95077
|
waitUntilExit().then(() => {
|
|
94632
|
-
|
|
95078
|
+
resolve3();
|
|
94633
95079
|
}).catch(reject);
|
|
94634
95080
|
});
|
|
94635
95081
|
}
|
|
94636
|
-
var
|
|
95082
|
+
var import_jsx_runtime17;
|
|
94637
95083
|
var init_kite = __esm({
|
|
94638
95084
|
async "apps/cli/src/commands/kite.tsx"() {
|
|
94639
95085
|
"use strict";
|
|
94640
95086
|
await init_build2();
|
|
94641
95087
|
await init_kite_game();
|
|
94642
|
-
|
|
95088
|
+
import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
|
|
94643
95089
|
}
|
|
94644
95090
|
});
|
|
94645
95091
|
|
|
@@ -94649,7 +95095,7 @@ init_types();
|
|
|
94649
95095
|
await init_telemetry();
|
|
94650
95096
|
import { parseArgs } from "node:util";
|
|
94651
95097
|
import { realpathSync } from "node:fs";
|
|
94652
|
-
import
|
|
95098
|
+
import path17 from "node:path";
|
|
94653
95099
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
94654
95100
|
|
|
94655
95101
|
// apps/cli/src/services/telemetry/init-events.ts
|
|
@@ -95689,7 +96135,7 @@ ${HELP_TEXT_BY_TOPIC.root}`
|
|
|
95689
96135
|
await entry.run(commandArgv, command);
|
|
95690
96136
|
}
|
|
95691
96137
|
function resolveRealPath(candidatePath) {
|
|
95692
|
-
const absolutePath =
|
|
96138
|
+
const absolutePath = path17.resolve(candidatePath);
|
|
95693
96139
|
try {
|
|
95694
96140
|
return realpathSync.native(absolutePath);
|
|
95695
96141
|
} catch {
|