@sisense/sdk-ai-core 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/engines/build-query/build-query-engine.d.ts.map +1 -1
- package/dist/engines/build-query/types.d.ts +9 -4
- package/dist/engines/build-query/types.d.ts.map +1 -1
- package/dist/engines/chart-builder/chart-builder-engine.d.ts +2 -2
- package/dist/engines/chart-builder/chart-builder-engine.d.ts.map +1 -1
- package/dist/engines/chart-builder/create-chart/create-chart.d.ts +6 -1
- package/dist/engines/chart-builder/create-chart/create-chart.d.ts.map +1 -1
- package/dist/engines/chart-builder/create-chart/generate-chart-recommendations.d.ts.map +1 -1
- package/dist/engines/chart-builder/create-chart/generate-chart-table.d.ts +5 -1
- package/dist/engines/chart-builder/create-chart/generate-chart-table.d.ts.map +1 -1
- package/dist/engines/chart-builder/types.d.ts +9 -2
- package/dist/engines/chart-builder/types.d.ts.map +1 -1
- package/dist/engines/chart-builder/update-chart/update-chart-data-options.d.ts.map +1 -1
- package/dist/engines/recommend-queries/recommend-queries-engine.d.ts.map +1 -1
- package/dist/engines/shared/nlq-query-helpers.d.ts +5 -0
- package/dist/engines/shared/nlq-query-helpers.d.ts.map +1 -0
- package/dist/index.js +863 -829
- package/dist/index.js.map +1 -1
- package/dist/services/nlq/nlq-service.d.ts +6 -1
- package/dist/services/nlq/nlq-service.d.ts.map +1 -1
- package/dist/utils/http-client.d.ts +1 -0
- package/dist/utils/http-client.d.ts.map +1 -1
- package/dist/utils/proxy-utils.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -48,26 +48,26 @@ const Dn = Symbol("Let zodToJsonSchema decide on which parser to use"), Fn = {
|
|
|
48
48
|
]))
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
|
-
function
|
|
51
|
+
function _a(e, t, a, r) {
|
|
52
52
|
r != null && r.errorMessages && a && (e.errorMessage = {
|
|
53
53
|
...e.errorMessage,
|
|
54
54
|
[t]: a
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
e[t] = a,
|
|
57
|
+
function M(e, t, a, r, n) {
|
|
58
|
+
e[t] = a, _a(e, t, r, n);
|
|
59
59
|
}
|
|
60
|
-
const
|
|
60
|
+
const xa = (e, t) => {
|
|
61
61
|
let a = 0;
|
|
62
62
|
for (; a < e.length && a < t.length && e[a] === t[a]; a++)
|
|
63
63
|
;
|
|
64
64
|
return [(e.length - a).toString(), ...t.slice(a)].join("/");
|
|
65
65
|
};
|
|
66
|
-
var
|
|
66
|
+
var w;
|
|
67
67
|
(function(e) {
|
|
68
68
|
e.ZodString = "ZodString", e.ZodNumber = "ZodNumber", e.ZodNaN = "ZodNaN", e.ZodBigInt = "ZodBigInt", e.ZodBoolean = "ZodBoolean", e.ZodDate = "ZodDate", e.ZodSymbol = "ZodSymbol", e.ZodUndefined = "ZodUndefined", e.ZodNull = "ZodNull", e.ZodAny = "ZodAny", e.ZodUnknown = "ZodUnknown", e.ZodNever = "ZodNever", e.ZodVoid = "ZodVoid", e.ZodArray = "ZodArray", e.ZodObject = "ZodObject", e.ZodUnion = "ZodUnion", e.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", e.ZodIntersection = "ZodIntersection", e.ZodTuple = "ZodTuple", e.ZodRecord = "ZodRecord", e.ZodMap = "ZodMap", e.ZodSet = "ZodSet", e.ZodFunction = "ZodFunction", e.ZodLazy = "ZodLazy", e.ZodLiteral = "ZodLiteral", e.ZodEnum = "ZodEnum", e.ZodEffects = "ZodEffects", e.ZodNativeEnum = "ZodNativeEnum", e.ZodOptional = "ZodOptional", e.ZodNullable = "ZodNullable", e.ZodDefault = "ZodDefault", e.ZodCatch = "ZodCatch", e.ZodPromise = "ZodPromise", e.ZodBranded = "ZodBranded", e.ZodPipeline = "ZodPipeline", e.ZodReadonly = "ZodReadonly";
|
|
69
|
-
})(
|
|
70
|
-
function
|
|
69
|
+
})(w || (w = {}));
|
|
70
|
+
function R(e) {
|
|
71
71
|
if (e.target !== "openAi")
|
|
72
72
|
return {};
|
|
73
73
|
const t = [
|
|
@@ -76,7 +76,7 @@ function L(e) {
|
|
|
76
76
|
e.openAiAnyTypeName
|
|
77
77
|
];
|
|
78
78
|
return e.flags.hasReferencedOpenAiAnyType = !0, {
|
|
79
|
-
$ref: e.$refStrategy === "relative" ?
|
|
79
|
+
$ref: e.$refStrategy === "relative" ? xa(t, e.currentPath) : t.join("/")
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
82
|
function En(e, t) {
|
|
@@ -84,10 +84,10 @@ function En(e, t) {
|
|
|
84
84
|
const a = {
|
|
85
85
|
type: "array"
|
|
86
86
|
};
|
|
87
|
-
return (r = e.type) != null && r._def && ((i = (n = e.type) == null ? void 0 : n._def) == null ? void 0 : i.typeName) !==
|
|
87
|
+
return (r = e.type) != null && r._def && ((i = (n = e.type) == null ? void 0 : n._def) == null ? void 0 : i.typeName) !== w.ZodAny && (a.items = D(e.type._def, {
|
|
88
88
|
...t,
|
|
89
89
|
currentPath: [...t.currentPath, "items"]
|
|
90
|
-
})), e.minLength &&
|
|
90
|
+
})), e.minLength && M(a, "minItems", e.minLength.value, e.minLength.message, t), e.maxLength && M(a, "maxItems", e.maxLength.value, e.maxLength.message, t), e.exactLength && (M(a, "minItems", e.exactLength.value, e.exactLength.message, t), M(a, "maxItems", e.exactLength.value, e.exactLength.message, t)), a;
|
|
91
91
|
}
|
|
92
92
|
function kn(e, t) {
|
|
93
93
|
const a = {
|
|
@@ -99,13 +99,13 @@ function kn(e, t) {
|
|
|
99
99
|
for (const r of e.checks)
|
|
100
100
|
switch (r.kind) {
|
|
101
101
|
case "min":
|
|
102
|
-
t.target === "jsonSchema7" ? r.inclusive ?
|
|
102
|
+
t.target === "jsonSchema7" ? r.inclusive ? M(a, "minimum", r.value, r.message, t) : M(a, "exclusiveMinimum", r.value, r.message, t) : (r.inclusive || (a.exclusiveMinimum = !0), M(a, "minimum", r.value, r.message, t));
|
|
103
103
|
break;
|
|
104
104
|
case "max":
|
|
105
|
-
t.target === "jsonSchema7" ? r.inclusive ?
|
|
105
|
+
t.target === "jsonSchema7" ? r.inclusive ? M(a, "maximum", r.value, r.message, t) : M(a, "exclusiveMaximum", r.value, r.message, t) : (r.inclusive || (a.exclusiveMaximum = !0), M(a, "maximum", r.value, r.message, t));
|
|
106
106
|
break;
|
|
107
107
|
case "multipleOf":
|
|
108
|
-
|
|
108
|
+
M(a, "multipleOf", r.value, r.message, t);
|
|
109
109
|
break;
|
|
110
110
|
}
|
|
111
111
|
return a;
|
|
@@ -151,7 +151,7 @@ const Pn = (e, t) => {
|
|
|
151
151
|
for (const r of e.checks)
|
|
152
152
|
switch (r.kind) {
|
|
153
153
|
case "min":
|
|
154
|
-
|
|
154
|
+
M(
|
|
155
155
|
a,
|
|
156
156
|
"minimum",
|
|
157
157
|
r.value,
|
|
@@ -161,7 +161,7 @@ const Pn = (e, t) => {
|
|
|
161
161
|
);
|
|
162
162
|
break;
|
|
163
163
|
case "max":
|
|
164
|
-
|
|
164
|
+
M(
|
|
165
165
|
a,
|
|
166
166
|
"maximum",
|
|
167
167
|
r.value,
|
|
@@ -173,14 +173,14 @@ const Pn = (e, t) => {
|
|
|
173
173
|
}
|
|
174
174
|
return a;
|
|
175
175
|
};
|
|
176
|
-
function
|
|
176
|
+
function _n(e, t) {
|
|
177
177
|
return {
|
|
178
178
|
...D(e.innerType._def, t),
|
|
179
179
|
default: e.defaultValue()
|
|
180
180
|
};
|
|
181
181
|
}
|
|
182
|
-
function
|
|
183
|
-
return t.effectStrategy === "input" ? D(e.schema._def, t) :
|
|
182
|
+
function xn(e, t) {
|
|
183
|
+
return t.effectStrategy === "input" ? D(e.schema._def, t) : R(t);
|
|
184
184
|
}
|
|
185
185
|
function In(e) {
|
|
186
186
|
return {
|
|
@@ -189,7 +189,7 @@ function In(e) {
|
|
|
189
189
|
};
|
|
190
190
|
}
|
|
191
191
|
const jn = (e) => "type" in e && e.type === "string" ? !1 : "allOf" in e;
|
|
192
|
-
function
|
|
192
|
+
function Rn(e, t) {
|
|
193
193
|
const a = [
|
|
194
194
|
D(e.left._def, {
|
|
195
195
|
...t,
|
|
@@ -219,7 +219,7 @@ function Ln(e, t) {
|
|
|
219
219
|
...r
|
|
220
220
|
} : void 0;
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function Ln(e, t) {
|
|
223
223
|
const a = typeof e.value;
|
|
224
224
|
return a !== "bigint" && a !== "number" && a !== "boolean" && a !== "string" ? {
|
|
225
225
|
type: Array.isArray(e.value) ? "array" : "object"
|
|
@@ -274,7 +274,7 @@ const Z = {
|
|
|
274
274
|
nanoid: /^[a-zA-Z0-9_-]{21}$/,
|
|
275
275
|
jwt: /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/
|
|
276
276
|
};
|
|
277
|
-
function
|
|
277
|
+
function Ra(e, t) {
|
|
278
278
|
const a = {
|
|
279
279
|
type: "string"
|
|
280
280
|
};
|
|
@@ -282,10 +282,10 @@ function La(e, t) {
|
|
|
282
282
|
for (const r of e.checks)
|
|
283
283
|
switch (r.kind) {
|
|
284
284
|
case "min":
|
|
285
|
-
|
|
285
|
+
M(a, "minLength", typeof a.minLength == "number" ? Math.max(a.minLength, r.value) : r.value, r.message, t);
|
|
286
286
|
break;
|
|
287
287
|
case "max":
|
|
288
|
-
|
|
288
|
+
M(a, "maxLength", typeof a.maxLength == "number" ? Math.min(a.maxLength, r.value) : r.value, r.message, t);
|
|
289
289
|
break;
|
|
290
290
|
case "email":
|
|
291
291
|
switch (t.emailStrategy) {
|
|
@@ -334,7 +334,7 @@ function La(e, t) {
|
|
|
334
334
|
z(a, "duration", r.message, t);
|
|
335
335
|
break;
|
|
336
336
|
case "length":
|
|
337
|
-
|
|
337
|
+
M(a, "minLength", typeof a.minLength == "number" ? Math.max(a.minLength, r.value) : r.value, r.message, t), M(a, "maxLength", typeof a.maxLength == "number" ? Math.min(a.maxLength, r.value) : r.value, r.message, t);
|
|
338
338
|
break;
|
|
339
339
|
case "includes": {
|
|
340
340
|
I(a, RegExp(St(r.value, t)), r.message, t);
|
|
@@ -368,7 +368,7 @@ function La(e, t) {
|
|
|
368
368
|
break;
|
|
369
369
|
}
|
|
370
370
|
case "contentEncoding:base64": {
|
|
371
|
-
|
|
371
|
+
M(a, "contentEncoding", "base64", r.message, t);
|
|
372
372
|
break;
|
|
373
373
|
}
|
|
374
374
|
case "pattern:zod": {
|
|
@@ -403,7 +403,7 @@ function z(e, t, a, r) {
|
|
|
403
403
|
}), delete e.format, e.errorMessage && (delete e.errorMessage.format, Object.keys(e.errorMessage).length === 0 && delete e.errorMessage)), e.anyOf.push({
|
|
404
404
|
format: t,
|
|
405
405
|
...a && r.errorMessages && { errorMessage: { format: a } }
|
|
406
|
-
})) :
|
|
406
|
+
})) : M(e, "format", t, a, r);
|
|
407
407
|
}
|
|
408
408
|
function I(e, t, a, r) {
|
|
409
409
|
var n;
|
|
@@ -415,7 +415,7 @@ function I(e, t, a, r) {
|
|
|
415
415
|
}), delete e.pattern, e.errorMessage && (delete e.errorMessage.pattern, Object.keys(e.errorMessage).length === 0 && delete e.errorMessage)), e.allOf.push({
|
|
416
416
|
pattern: ca(t, r),
|
|
417
417
|
...a && r.errorMessages && { errorMessage: { pattern: a } }
|
|
418
|
-
})) :
|
|
418
|
+
})) : M(e, "pattern", ca(t, r), a, r);
|
|
419
419
|
}
|
|
420
420
|
function ca(e, t) {
|
|
421
421
|
var u;
|
|
@@ -470,9 +470,9 @@ function ca(e, t) {
|
|
|
470
470
|
}
|
|
471
471
|
return n;
|
|
472
472
|
}
|
|
473
|
-
function
|
|
473
|
+
function La(e, t) {
|
|
474
474
|
var r, n, i, o, l, u;
|
|
475
|
-
if (t.target === "openAi" && console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."), t.target === "openApi3" && ((r = e.keyType) == null ? void 0 : r._def.typeName) ===
|
|
475
|
+
if (t.target === "openAi" && console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."), t.target === "openApi3" && ((r = e.keyType) == null ? void 0 : r._def.typeName) === w.ZodEnum)
|
|
476
476
|
return {
|
|
477
477
|
type: "object",
|
|
478
478
|
required: e.keyType._def.values,
|
|
@@ -481,7 +481,7 @@ function Ra(e, t) {
|
|
|
481
481
|
[m]: D(e.valueType._def, {
|
|
482
482
|
...t,
|
|
483
483
|
currentPath: [...t.currentPath, "properties", m]
|
|
484
|
-
}) ??
|
|
484
|
+
}) ?? R(t)
|
|
485
485
|
}), {}),
|
|
486
486
|
additionalProperties: t.rejectedAdditionalProperties
|
|
487
487
|
};
|
|
@@ -494,21 +494,21 @@ function Ra(e, t) {
|
|
|
494
494
|
};
|
|
495
495
|
if (t.target === "openApi3")
|
|
496
496
|
return a;
|
|
497
|
-
if (((n = e.keyType) == null ? void 0 : n._def.typeName) ===
|
|
498
|
-
const { type: c, ...m } =
|
|
497
|
+
if (((n = e.keyType) == null ? void 0 : n._def.typeName) === w.ZodString && ((i = e.keyType._def.checks) != null && i.length)) {
|
|
498
|
+
const { type: c, ...m } = Ra(e.keyType._def, t);
|
|
499
499
|
return {
|
|
500
500
|
...a,
|
|
501
501
|
propertyNames: m
|
|
502
502
|
};
|
|
503
503
|
} else {
|
|
504
|
-
if (((o = e.keyType) == null ? void 0 : o._def.typeName) ===
|
|
504
|
+
if (((o = e.keyType) == null ? void 0 : o._def.typeName) === w.ZodEnum)
|
|
505
505
|
return {
|
|
506
506
|
...a,
|
|
507
507
|
propertyNames: {
|
|
508
508
|
enum: e.keyType._def.values
|
|
509
509
|
}
|
|
510
510
|
};
|
|
511
|
-
if (((l = e.keyType) == null ? void 0 : l._def.typeName) ===
|
|
511
|
+
if (((l = e.keyType) == null ? void 0 : l._def.typeName) === w.ZodBranded && e.keyType._def.type._def.typeName === w.ZodString && ((u = e.keyType._def.type._def.checks) != null && u.length)) {
|
|
512
512
|
const { type: c, ...m } = Ia(e.keyType._def, t);
|
|
513
513
|
return {
|
|
514
514
|
...a,
|
|
@@ -520,14 +520,14 @@ function Ra(e, t) {
|
|
|
520
520
|
}
|
|
521
521
|
function Un(e, t) {
|
|
522
522
|
if (t.mapStrategy === "record")
|
|
523
|
-
return
|
|
523
|
+
return La(e, t);
|
|
524
524
|
const a = D(e.keyType._def, {
|
|
525
525
|
...t,
|
|
526
526
|
currentPath: [...t.currentPath, "items", "items", "0"]
|
|
527
|
-
}) ||
|
|
527
|
+
}) || R(t), r = D(e.valueType._def, {
|
|
528
528
|
...t,
|
|
529
529
|
currentPath: [...t.currentPath, "items", "items", "1"]
|
|
530
|
-
}) ||
|
|
530
|
+
}) || R(t);
|
|
531
531
|
return {
|
|
532
532
|
type: "array",
|
|
533
533
|
maxItems: 125,
|
|
@@ -548,7 +548,7 @@ function Zn(e) {
|
|
|
548
548
|
}
|
|
549
549
|
function zn(e) {
|
|
550
550
|
return e.target === "openAi" ? void 0 : {
|
|
551
|
-
not:
|
|
551
|
+
not: R({
|
|
552
552
|
...e,
|
|
553
553
|
currentPath: [...e.currentPath, "not"]
|
|
554
554
|
})
|
|
@@ -658,16 +658,16 @@ function Yn(e, t) {
|
|
|
658
658
|
for (const r of e.checks)
|
|
659
659
|
switch (r.kind) {
|
|
660
660
|
case "int":
|
|
661
|
-
a.type = "integer",
|
|
661
|
+
a.type = "integer", _a(a, "type", r.message, t);
|
|
662
662
|
break;
|
|
663
663
|
case "min":
|
|
664
|
-
t.target === "jsonSchema7" ? r.inclusive ?
|
|
664
|
+
t.target === "jsonSchema7" ? r.inclusive ? M(a, "minimum", r.value, r.message, t) : M(a, "exclusiveMinimum", r.value, r.message, t) : (r.inclusive || (a.exclusiveMinimum = !0), M(a, "minimum", r.value, r.message, t));
|
|
665
665
|
break;
|
|
666
666
|
case "max":
|
|
667
|
-
t.target === "jsonSchema7" ? r.inclusive ?
|
|
667
|
+
t.target === "jsonSchema7" ? r.inclusive ? M(a, "maximum", r.value, r.message, t) : M(a, "exclusiveMaximum", r.value, r.message, t) : (r.inclusive || (a.exclusiveMaximum = !0), M(a, "maximum", r.value, r.message, t));
|
|
668
668
|
break;
|
|
669
669
|
case "multipleOf":
|
|
670
|
-
|
|
670
|
+
M(a, "multipleOf", r.value, r.message, t);
|
|
671
671
|
break;
|
|
672
672
|
}
|
|
673
673
|
return a;
|
|
@@ -727,11 +727,11 @@ const Kn = (e, t) => {
|
|
|
727
727
|
return a ? {
|
|
728
728
|
anyOf: [
|
|
729
729
|
{
|
|
730
|
-
not:
|
|
730
|
+
not: R(t)
|
|
731
731
|
},
|
|
732
732
|
a
|
|
733
733
|
]
|
|
734
|
-
} :
|
|
734
|
+
} : R(t);
|
|
735
735
|
}, Xn = (e, t) => {
|
|
736
736
|
if (t.pipeStrategy === "input")
|
|
737
737
|
return D(e.in._def, t);
|
|
@@ -760,7 +760,7 @@ function ti(e, t) {
|
|
|
760
760
|
currentPath: [...t.currentPath, "items"]
|
|
761
761
|
})
|
|
762
762
|
};
|
|
763
|
-
return e.minSize &&
|
|
763
|
+
return e.minSize && M(r, "minItems", e.minSize.value, e.minSize.message, t), e.maxSize && M(r, "maxItems", e.maxSize.value, e.maxSize.message, t), r;
|
|
764
764
|
}
|
|
765
765
|
function ai(e, t) {
|
|
766
766
|
return e.rest ? {
|
|
@@ -786,81 +786,81 @@ function ai(e, t) {
|
|
|
786
786
|
}
|
|
787
787
|
function ri(e) {
|
|
788
788
|
return {
|
|
789
|
-
not:
|
|
789
|
+
not: R(e)
|
|
790
790
|
};
|
|
791
791
|
}
|
|
792
792
|
function ni(e) {
|
|
793
|
-
return
|
|
793
|
+
return R(e);
|
|
794
794
|
}
|
|
795
795
|
const ii = (e, t) => D(e.innerType._def, t), oi = (e, t, a) => {
|
|
796
796
|
switch (t) {
|
|
797
|
-
case
|
|
798
|
-
return
|
|
799
|
-
case
|
|
797
|
+
case w.ZodString:
|
|
798
|
+
return Ra(e, a);
|
|
799
|
+
case w.ZodNumber:
|
|
800
800
|
return Yn(e, a);
|
|
801
|
-
case
|
|
801
|
+
case w.ZodObject:
|
|
802
802
|
return Hn(e, a);
|
|
803
|
-
case
|
|
803
|
+
case w.ZodBigInt:
|
|
804
804
|
return kn(e, a);
|
|
805
|
-
case
|
|
805
|
+
case w.ZodBoolean:
|
|
806
806
|
return Nn();
|
|
807
|
-
case
|
|
807
|
+
case w.ZodDate:
|
|
808
808
|
return ja(e, a);
|
|
809
|
-
case
|
|
809
|
+
case w.ZodUndefined:
|
|
810
810
|
return ri(a);
|
|
811
|
-
case
|
|
811
|
+
case w.ZodNull:
|
|
812
812
|
return Wn(a);
|
|
813
|
-
case
|
|
813
|
+
case w.ZodArray:
|
|
814
814
|
return En(e, a);
|
|
815
|
-
case
|
|
816
|
-
case
|
|
815
|
+
case w.ZodUnion:
|
|
816
|
+
case w.ZodDiscriminatedUnion:
|
|
817
817
|
return Vn(e, a);
|
|
818
|
-
case
|
|
819
|
-
return Ln(e, a);
|
|
820
|
-
case b.ZodTuple:
|
|
821
|
-
return ai(e, a);
|
|
822
|
-
case b.ZodRecord:
|
|
823
|
-
return Ra(e, a);
|
|
824
|
-
case b.ZodLiteral:
|
|
818
|
+
case w.ZodIntersection:
|
|
825
819
|
return Rn(e, a);
|
|
826
|
-
case
|
|
820
|
+
case w.ZodTuple:
|
|
821
|
+
return ai(e, a);
|
|
822
|
+
case w.ZodRecord:
|
|
823
|
+
return La(e, a);
|
|
824
|
+
case w.ZodLiteral:
|
|
825
|
+
return Ln(e, a);
|
|
826
|
+
case w.ZodEnum:
|
|
827
827
|
return In(e);
|
|
828
|
-
case
|
|
828
|
+
case w.ZodNativeEnum:
|
|
829
829
|
return Zn(e);
|
|
830
|
-
case
|
|
830
|
+
case w.ZodNullable:
|
|
831
831
|
return Jn(e, a);
|
|
832
|
-
case
|
|
832
|
+
case w.ZodOptional:
|
|
833
833
|
return Kn(e, a);
|
|
834
|
-
case
|
|
834
|
+
case w.ZodMap:
|
|
835
835
|
return Un(e, a);
|
|
836
|
-
case
|
|
836
|
+
case w.ZodSet:
|
|
837
837
|
return ti(e, a);
|
|
838
|
-
case
|
|
838
|
+
case w.ZodLazy:
|
|
839
839
|
return () => e.getter()._def;
|
|
840
|
-
case
|
|
840
|
+
case w.ZodPromise:
|
|
841
841
|
return ei(e, a);
|
|
842
|
-
case
|
|
843
|
-
case
|
|
842
|
+
case w.ZodNaN:
|
|
843
|
+
case w.ZodNever:
|
|
844
844
|
return zn(a);
|
|
845
|
-
case
|
|
846
|
-
return _n(e, a);
|
|
847
|
-
case b.ZodAny:
|
|
848
|
-
return L(a);
|
|
849
|
-
case b.ZodUnknown:
|
|
850
|
-
return ni(a);
|
|
851
|
-
case b.ZodDefault:
|
|
845
|
+
case w.ZodEffects:
|
|
852
846
|
return xn(e, a);
|
|
853
|
-
case
|
|
847
|
+
case w.ZodAny:
|
|
848
|
+
return R(a);
|
|
849
|
+
case w.ZodUnknown:
|
|
850
|
+
return ni(a);
|
|
851
|
+
case w.ZodDefault:
|
|
852
|
+
return _n(e, a);
|
|
853
|
+
case w.ZodBranded:
|
|
854
854
|
return Ia(e, a);
|
|
855
|
-
case
|
|
855
|
+
case w.ZodReadonly:
|
|
856
856
|
return ii(e, a);
|
|
857
|
-
case
|
|
857
|
+
case w.ZodCatch:
|
|
858
858
|
return $n(e, a);
|
|
859
|
-
case
|
|
859
|
+
case w.ZodPipeline:
|
|
860
860
|
return Xn(e, a);
|
|
861
|
-
case
|
|
862
|
-
case
|
|
863
|
-
case
|
|
861
|
+
case w.ZodFunction:
|
|
862
|
+
case w.ZodVoid:
|
|
863
|
+
case w.ZodSymbol:
|
|
864
864
|
return;
|
|
865
865
|
default:
|
|
866
866
|
return /* @__PURE__ */ ((r) => {
|
|
@@ -894,10 +894,10 @@ const si = (e, t) => {
|
|
|
894
894
|
case "root":
|
|
895
895
|
return { $ref: e.path.join("/") };
|
|
896
896
|
case "relative":
|
|
897
|
-
return { $ref:
|
|
897
|
+
return { $ref: xa(t.currentPath, e.path) };
|
|
898
898
|
case "none":
|
|
899
899
|
case "seen":
|
|
900
|
-
return e.path.length < t.currentPath.length && e.path.every((a, r) => t.currentPath[r] === a) ? (console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),
|
|
900
|
+
return e.path.length < t.currentPath.length && e.path.every((a, r) => t.currentPath[r] === a) ? (console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`), R(t)) : t.$refStrategy === "seen" ? R(t) : void 0;
|
|
901
901
|
}
|
|
902
902
|
}, li = (e, t, a) => (e.description && (a.description = e.description, t.markdownDescription && (a.markdownDescription = e.description)), a), ui = (e, t) => {
|
|
903
903
|
const a = Tn(t);
|
|
@@ -906,7 +906,7 @@ const si = (e, t) => {
|
|
|
906
906
|
e._def,
|
|
907
907
|
a,
|
|
908
908
|
!1
|
|
909
|
-
) ??
|
|
909
|
+
) ?? R(a);
|
|
910
910
|
a.flags.hasReferencedOpenAiAnyType && (r || (r = {}), r[a.openAiAnyTypeName] || (r[a.openAiAnyTypeName] = {
|
|
911
911
|
// Skipping "object" as no properties can be defined and additionalProperties must be "false"
|
|
912
912
|
type: ["string", "number", "integer", "boolean", "array", "null"],
|
|
@@ -1018,27 +1018,27 @@ const si = (e, t) => {
|
|
|
1018
1018
|
return s.ZodObject.create(o, e._def);
|
|
1019
1019
|
}
|
|
1020
1020
|
return e;
|
|
1021
|
-
},
|
|
1021
|
+
}, Lt = (e, t) => ee(e, t, "include"), ci = (e, t) => ee(e, t, "exclude"), se = (e, t = 0, a, r) => {
|
|
1022
1022
|
var i;
|
|
1023
1023
|
const n = (i = e == null ? void 0 : e._def) == null ? void 0 : i.typeName;
|
|
1024
|
-
return n === "ZodOptional" ?
|
|
1024
|
+
return n === "ZodOptional" ? se(
|
|
1025
1025
|
e.unwrap(),
|
|
1026
1026
|
t
|
|
1027
|
-
) : n === "ZodNullable" ?
|
|
1027
|
+
) : n === "ZodNullable" ? se(
|
|
1028
1028
|
e.unwrap(),
|
|
1029
1029
|
t
|
|
1030
|
-
) + " | null" : n === "ZodArray" ? `Array<${
|
|
1030
|
+
) + " | null" : n === "ZodArray" ? `Array<${se(
|
|
1031
1031
|
e.element,
|
|
1032
1032
|
t
|
|
1033
1033
|
)}>${e.description ? ` - ${e.description}` : ""}` : n === "ZodObject" ? `{
|
|
1034
1034
|
${Object.entries(e.shape).map(
|
|
1035
1035
|
([l, u]) => {
|
|
1036
1036
|
var c, m;
|
|
1037
|
-
return `${da(t + 1)}${l}${(c = u.isOptional) != null && c.call(u) ? "?" : ""}: ${
|
|
1037
|
+
return `${da(t + 1)}${l}${(c = u.isOptional) != null && c.call(u) ? "?" : ""}: ${se(u, t + 1, l, (m = u.isOptional) == null ? void 0 : m.call(u))}${u.description ? ` - ${u.description}` : ""}`;
|
|
1038
1038
|
}
|
|
1039
1039
|
).join(`,
|
|
1040
1040
|
`)}
|
|
1041
|
-
${da(t)}}` + (e.description ? ` - ${e.description}` : "") : n === "ZodEnum" ? e.options.map((l) => `"${l}"`).join(" | ") + (e.description ? ` - ${e.description}` : "") : n === "ZodUnion" ? e.options.map((o) =>
|
|
1041
|
+
${da(t)}}` + (e.description ? ` - ${e.description}` : "") : n === "ZodEnum" ? e.options.map((l) => `"${l}"`).join(" | ") + (e.description ? ` - ${e.description}` : "") : n === "ZodUnion" ? e.options.map((o) => se(o, t)).join(" | ") : n === "ZodLiteral" ? JSON.stringify(e.value) : n === "ZodString" ? "string" : n === "ZodNumber" ? "number" : n === "ZodBoolean" ? "boolean" : "any";
|
|
1042
1042
|
};
|
|
1043
1043
|
function Ba({
|
|
1044
1044
|
function: e,
|
|
@@ -1144,7 +1144,7 @@ const qa = s.enum(["bar", "column", "area", "line", "polar"]), Ua = s.enum(["pie
|
|
|
1144
1144
|
), Di = s.object({
|
|
1145
1145
|
chartType: st,
|
|
1146
1146
|
axesMapping: Ci
|
|
1147
|
-
}),
|
|
1147
|
+
}), fc = s.object({
|
|
1148
1148
|
dataSourceTitle: s.string().describe("Data source title"),
|
|
1149
1149
|
userPrompt: s.string().describe(
|
|
1150
1150
|
`Combined natural language user prompt describing multiple actions on a chart. Pass the user prompt exactly as received - do NOT transform or modify it. The chart builder logic will handle prompt splitting internally.
|
|
@@ -1153,7 +1153,7 @@ When responding to changes involving an existing chart:
|
|
|
1153
1153
|
- If the prompt involves **enhancing** how existing fields are displayed (e.g., "show cost on the right axis", "add trend line", "change color", "adjust scale"), apply the changes **to the existing chart**.
|
|
1154
1154
|
`
|
|
1155
1155
|
)
|
|
1156
|
-
}),
|
|
1156
|
+
}), pc = s.object({
|
|
1157
1157
|
dataSourceTitle: s.string().describe("Data source title"),
|
|
1158
1158
|
userPrompt: s.string().describe(
|
|
1159
1159
|
`Combined natural language user prompt describing multiple actions on a chart. Pass the user prompt exactly as received - do NOT transform or modify it. The chart builder logic will handle prompt splitting internally.
|
|
@@ -1185,8 +1185,8 @@ When responding to changes involving an existing chart:
|
|
|
1185
1185
|
chartTitle: s.string().describe("The new chart title")
|
|
1186
1186
|
}), Ei = de.extend({
|
|
1187
1187
|
chartType: st
|
|
1188
|
-
}), ki = de, Ni = de, $i = de, Pi = de,
|
|
1189
|
-
let
|
|
1188
|
+
}), ki = de, Ni = de, $i = de, Pi = de, _i = de;
|
|
1189
|
+
let xi = (e) => crypto.getRandomValues(new Uint8Array(e)), Ii = (e, t, a) => {
|
|
1190
1190
|
let r = (2 << Math.log2(e.length - 1)) - 1, n = -~(1.6 * r * t / e.length);
|
|
1191
1191
|
return (i = t) => {
|
|
1192
1192
|
let o = "";
|
|
@@ -1196,8 +1196,8 @@ let _i = (e) => crypto.getRandomValues(new Uint8Array(e)), Ii = (e, t, a) => {
|
|
|
1196
1196
|
if (o += e[l[u] & r] || "", o.length >= i) return o;
|
|
1197
1197
|
}
|
|
1198
1198
|
};
|
|
1199
|
-
}, Za = (e, t = 21) => Ii(e, t | 0,
|
|
1200
|
-
const
|
|
1199
|
+
}, Za = (e, t = 21) => Ii(e, t | 0, xi);
|
|
1200
|
+
const ce = Za("0123456789abcdef", 24);
|
|
1201
1201
|
function et() {
|
|
1202
1202
|
const t = Za("0123456789abcdef", 32)();
|
|
1203
1203
|
return t.substring(0, 8) + "-" + t.substring(8, 12) + "-4" + t.substring(13, 16) + "-" + (parseInt(t[16], 16) & 3 | 8).toString(16) + t.substring(17, 20) + "-" + t.substring(20);
|
|
@@ -1215,7 +1215,7 @@ function ji(e, t) {
|
|
|
1215
1215
|
}
|
|
1216
1216
|
}), a;
|
|
1217
1217
|
}
|
|
1218
|
-
const
|
|
1218
|
+
const Ri = Symbol("Let zodToJsonSchema decide on which parser to use"), fa = {
|
|
1219
1219
|
name: void 0,
|
|
1220
1220
|
$refStrategy: "root",
|
|
1221
1221
|
effectStrategy: "input",
|
|
@@ -1234,7 +1234,7 @@ const Li = Symbol("Let zodToJsonSchema decide on which parser to use"), fa = {
|
|
|
1234
1234
|
emailStrategy: "format:email",
|
|
1235
1235
|
base64Strategy: "contentEncoding:base64",
|
|
1236
1236
|
nameStrategy: "ref"
|
|
1237
|
-
},
|
|
1237
|
+
}, Li = (e) => typeof e == "string" ? {
|
|
1238
1238
|
...fa,
|
|
1239
1239
|
basePath: ["#"],
|
|
1240
1240
|
definitions: {},
|
|
@@ -1253,7 +1253,7 @@ function Bi(e) {
|
|
|
1253
1253
|
return !0;
|
|
1254
1254
|
}
|
|
1255
1255
|
const qi = (e) => {
|
|
1256
|
-
const t =
|
|
1256
|
+
const t = Li(e), a = t.name !== void 0 ? [...t.basePath, t.definitionPath, t.name] : t.basePath;
|
|
1257
1257
|
return {
|
|
1258
1258
|
...t,
|
|
1259
1259
|
currentPath: a,
|
|
@@ -1276,7 +1276,7 @@ function za(e, t, a, r) {
|
|
|
1276
1276
|
[t]: a
|
|
1277
1277
|
});
|
|
1278
1278
|
}
|
|
1279
|
-
function
|
|
1279
|
+
function T(e, t, a, r, n) {
|
|
1280
1280
|
e[t] = a, za(e, t, r, n);
|
|
1281
1281
|
}
|
|
1282
1282
|
function Ui() {
|
|
@@ -1290,7 +1290,7 @@ function Zi(e, t) {
|
|
|
1290
1290
|
return ((n = (r = e.type) == null ? void 0 : r._def) == null ? void 0 : n.typeName) !== v.ZodAny && (a.items = O(e.type._def, {
|
|
1291
1291
|
...t,
|
|
1292
1292
|
currentPath: [...t.currentPath, "items"]
|
|
1293
|
-
})), e.minLength &&
|
|
1293
|
+
})), e.minLength && T(a, "minItems", e.minLength.value, e.minLength.message, t), e.maxLength && T(a, "maxItems", e.maxLength.value, e.maxLength.message, t), e.exactLength && (T(a, "minItems", e.exactLength.value, e.exactLength.message, t), T(a, "maxItems", e.exactLength.value, e.exactLength.message, t)), a;
|
|
1294
1294
|
}
|
|
1295
1295
|
function zi(e, t) {
|
|
1296
1296
|
const a = {
|
|
@@ -1302,13 +1302,13 @@ function zi(e, t) {
|
|
|
1302
1302
|
for (const r of e.checks)
|
|
1303
1303
|
switch (r.kind) {
|
|
1304
1304
|
case "min":
|
|
1305
|
-
t.target === "jsonSchema7" ? r.inclusive ?
|
|
1305
|
+
t.target === "jsonSchema7" ? r.inclusive ? T(a, "minimum", r.value, r.message, t) : T(a, "exclusiveMinimum", r.value, r.message, t) : (r.inclusive || (a.exclusiveMinimum = !0), T(a, "minimum", r.value, r.message, t));
|
|
1306
1306
|
break;
|
|
1307
1307
|
case "max":
|
|
1308
|
-
t.target === "jsonSchema7" ? r.inclusive ?
|
|
1308
|
+
t.target === "jsonSchema7" ? r.inclusive ? T(a, "maximum", r.value, r.message, t) : T(a, "exclusiveMaximum", r.value, r.message, t) : (r.inclusive || (a.exclusiveMaximum = !0), T(a, "maximum", r.value, r.message, t));
|
|
1309
1309
|
break;
|
|
1310
1310
|
case "multipleOf":
|
|
1311
|
-
|
|
1311
|
+
T(a, "multipleOf", r.value, r.message, t);
|
|
1312
1312
|
break;
|
|
1313
1313
|
}
|
|
1314
1314
|
return a;
|
|
@@ -1354,7 +1354,7 @@ const Yi = (e, t) => {
|
|
|
1354
1354
|
for (const r of e.checks)
|
|
1355
1355
|
switch (r.kind) {
|
|
1356
1356
|
case "min":
|
|
1357
|
-
|
|
1357
|
+
T(
|
|
1358
1358
|
a,
|
|
1359
1359
|
"minimum",
|
|
1360
1360
|
r.value,
|
|
@@ -1364,7 +1364,7 @@ const Yi = (e, t) => {
|
|
|
1364
1364
|
);
|
|
1365
1365
|
break;
|
|
1366
1366
|
case "max":
|
|
1367
|
-
|
|
1367
|
+
T(
|
|
1368
1368
|
a,
|
|
1369
1369
|
"maximum",
|
|
1370
1370
|
r.value,
|
|
@@ -1435,7 +1435,7 @@ function eo(e, t) {
|
|
|
1435
1435
|
};
|
|
1436
1436
|
}
|
|
1437
1437
|
let At;
|
|
1438
|
-
const
|
|
1438
|
+
const ne = {
|
|
1439
1439
|
/**
|
|
1440
1440
|
* `c` was changed to `[cC]` to replicate /i flag
|
|
1441
1441
|
*/
|
|
@@ -1472,10 +1472,10 @@ function Va(e, t) {
|
|
|
1472
1472
|
for (const n of e.checks)
|
|
1473
1473
|
switch (n.kind) {
|
|
1474
1474
|
case "min":
|
|
1475
|
-
|
|
1475
|
+
T(a, "minLength", typeof a.minLength == "number" ? Math.max(a.minLength, n.value) : n.value, n.message, t);
|
|
1476
1476
|
break;
|
|
1477
1477
|
case "max":
|
|
1478
|
-
|
|
1478
|
+
T(a, "maxLength", typeof a.maxLength == "number" ? Math.min(a.maxLength, n.value) : n.value, n.message, t);
|
|
1479
1479
|
break;
|
|
1480
1480
|
case "email":
|
|
1481
1481
|
switch (t.emailStrategy) {
|
|
@@ -1486,7 +1486,7 @@ function Va(e, t) {
|
|
|
1486
1486
|
W(a, "idn-email", n.message, t);
|
|
1487
1487
|
break;
|
|
1488
1488
|
case "pattern:zod":
|
|
1489
|
-
V(a,
|
|
1489
|
+
V(a, ne.email, n.message, t);
|
|
1490
1490
|
break;
|
|
1491
1491
|
}
|
|
1492
1492
|
break;
|
|
@@ -1500,10 +1500,10 @@ function Va(e, t) {
|
|
|
1500
1500
|
V(a, n.regex, n.message, t);
|
|
1501
1501
|
break;
|
|
1502
1502
|
case "cuid":
|
|
1503
|
-
V(a,
|
|
1503
|
+
V(a, ne.cuid, n.message, t);
|
|
1504
1504
|
break;
|
|
1505
1505
|
case "cuid2":
|
|
1506
|
-
V(a,
|
|
1506
|
+
V(a, ne.cuid2, n.message, t);
|
|
1507
1507
|
break;
|
|
1508
1508
|
case "startsWith":
|
|
1509
1509
|
V(a, RegExp(`^${r(n.value)}`), n.message, t);
|
|
@@ -1524,7 +1524,7 @@ function Va(e, t) {
|
|
|
1524
1524
|
W(a, "duration", n.message, t);
|
|
1525
1525
|
break;
|
|
1526
1526
|
case "length":
|
|
1527
|
-
|
|
1527
|
+
T(a, "minLength", typeof a.minLength == "number" ? Math.max(a.minLength, n.value) : n.value, n.message, t), T(a, "maxLength", typeof a.maxLength == "number" ? Math.min(a.maxLength, n.value) : n.value, n.message, t);
|
|
1528
1528
|
break;
|
|
1529
1529
|
case "includes": {
|
|
1530
1530
|
V(a, RegExp(r(n.value)), n.message, t);
|
|
@@ -1535,10 +1535,10 @@ function Va(e, t) {
|
|
|
1535
1535
|
break;
|
|
1536
1536
|
}
|
|
1537
1537
|
case "emoji":
|
|
1538
|
-
V(a,
|
|
1538
|
+
V(a, ne.emoji, n.message, t);
|
|
1539
1539
|
break;
|
|
1540
1540
|
case "ulid": {
|
|
1541
|
-
V(a,
|
|
1541
|
+
V(a, ne.ulid, n.message, t);
|
|
1542
1542
|
break;
|
|
1543
1543
|
}
|
|
1544
1544
|
case "base64": {
|
|
@@ -1548,18 +1548,18 @@ function Va(e, t) {
|
|
|
1548
1548
|
break;
|
|
1549
1549
|
}
|
|
1550
1550
|
case "contentEncoding:base64": {
|
|
1551
|
-
|
|
1551
|
+
T(a, "contentEncoding", "base64", n.message, t);
|
|
1552
1552
|
break;
|
|
1553
1553
|
}
|
|
1554
1554
|
case "pattern:zod": {
|
|
1555
|
-
V(a,
|
|
1555
|
+
V(a, ne.base64, n.message, t);
|
|
1556
1556
|
break;
|
|
1557
1557
|
}
|
|
1558
1558
|
}
|
|
1559
1559
|
break;
|
|
1560
1560
|
}
|
|
1561
1561
|
case "nanoid":
|
|
1562
|
-
V(a,
|
|
1562
|
+
V(a, ne.nanoid, n.message, t);
|
|
1563
1563
|
}
|
|
1564
1564
|
return a;
|
|
1565
1565
|
}
|
|
@@ -1573,7 +1573,7 @@ const to = (e) => Array.from(e).map((t) => /[a-zA-Z0-9]/.test(t) ? t : `\\${t}`)
|
|
|
1573
1573
|
}), delete e.format, e.errorMessage && (delete e.errorMessage.format, Object.keys(e.errorMessage).length === 0 && delete e.errorMessage)), e.anyOf.push({
|
|
1574
1574
|
format: t,
|
|
1575
1575
|
...a && r.errorMessages && { errorMessage: { format: a } }
|
|
1576
|
-
})) :
|
|
1576
|
+
})) : T(e, "format", t, a, r);
|
|
1577
1577
|
}, V = (e, t, a, r) => {
|
|
1578
1578
|
var n;
|
|
1579
1579
|
e.pattern || (n = e.allOf) != null && n.some((i) => i.pattern) ? (e.allOf || (e.allOf = []), e.pattern && (e.allOf.push({
|
|
@@ -1584,7 +1584,7 @@ const to = (e) => Array.from(e).map((t) => /[a-zA-Z0-9]/.test(t) ? t : `\\${t}`)
|
|
|
1584
1584
|
}), delete e.pattern, e.errorMessage && (delete e.errorMessage.pattern, Object.keys(e.errorMessage).length === 0 && delete e.errorMessage)), e.allOf.push({
|
|
1585
1585
|
pattern: pa(t, r),
|
|
1586
1586
|
...a && r.errorMessages && { errorMessage: { pattern: a } }
|
|
1587
|
-
})) :
|
|
1587
|
+
})) : T(e, "pattern", pa(t, r), a, r);
|
|
1588
1588
|
}, pa = (e, t) => {
|
|
1589
1589
|
var c;
|
|
1590
1590
|
const a = typeof e == "function" ? e() : e;
|
|
@@ -1812,13 +1812,13 @@ function lo(e, t) {
|
|
|
1812
1812
|
a.type = "integer", za(a, "type", r.message, t);
|
|
1813
1813
|
break;
|
|
1814
1814
|
case "min":
|
|
1815
|
-
t.target === "jsonSchema7" ? r.inclusive ?
|
|
1815
|
+
t.target === "jsonSchema7" ? r.inclusive ? T(a, "minimum", r.value, r.message, t) : T(a, "exclusiveMinimum", r.value, r.message, t) : (r.inclusive || (a.exclusiveMinimum = !0), T(a, "minimum", r.value, r.message, t));
|
|
1816
1816
|
break;
|
|
1817
1817
|
case "max":
|
|
1818
|
-
t.target === "jsonSchema7" ? r.inclusive ?
|
|
1818
|
+
t.target === "jsonSchema7" ? r.inclusive ? T(a, "maximum", r.value, r.message, t) : T(a, "exclusiveMaximum", r.value, r.message, t) : (r.inclusive || (a.exclusiveMaximum = !0), T(a, "maximum", r.value, r.message, t));
|
|
1819
1819
|
break;
|
|
1820
1820
|
case "multipleOf":
|
|
1821
|
-
|
|
1821
|
+
T(a, "multipleOf", r.value, r.message, t);
|
|
1822
1822
|
break;
|
|
1823
1823
|
}
|
|
1824
1824
|
return a;
|
|
@@ -1900,7 +1900,7 @@ function ho(e, t) {
|
|
|
1900
1900
|
currentPath: [...t.currentPath, "items"]
|
|
1901
1901
|
})
|
|
1902
1902
|
};
|
|
1903
|
-
return e.minSize &&
|
|
1903
|
+
return e.minSize && T(r, "minItems", e.minSize.value, e.minSize.message, t), e.maxSize && T(r, "maxItems", e.maxSize.value, e.maxSize.message, t), r;
|
|
1904
1904
|
}
|
|
1905
1905
|
function go(e, t) {
|
|
1906
1906
|
return e.rest ? {
|
|
@@ -1938,7 +1938,7 @@ function O(e, t, a = !1) {
|
|
|
1938
1938
|
const r = t.seen.get(e);
|
|
1939
1939
|
if (t.override) {
|
|
1940
1940
|
const l = (o = t.override) == null ? void 0 : o.call(t, e, t, r, a);
|
|
1941
|
-
if (l !==
|
|
1941
|
+
if (l !== Ri)
|
|
1942
1942
|
return l;
|
|
1943
1943
|
}
|
|
1944
1944
|
if (r && !a) {
|
|
@@ -2106,7 +2106,7 @@ function Fo(e, t, a) {
|
|
|
2106
2106
|
function Bt(e) {
|
|
2107
2107
|
return e.endsWith("/") ? e : `${e}/`;
|
|
2108
2108
|
}
|
|
2109
|
-
const
|
|
2109
|
+
const hc = (e) => {
|
|
2110
2110
|
if (e instanceof Error)
|
|
2111
2111
|
try {
|
|
2112
2112
|
return JSON.parse(e.message);
|
|
@@ -2116,23 +2116,24 @@ const pc = (e) => {
|
|
|
2116
2116
|
return e;
|
|
2117
2117
|
};
|
|
2118
2118
|
function Mo() {
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
return console.debug("no tenant prefix", e), "";
|
|
2126
|
-
}
|
|
2119
|
+
var o, l;
|
|
2120
|
+
const e = (l = (o = window.App) == null ? void 0 : o.user) == null ? void 0 : l.tenant;
|
|
2121
|
+
if (!e)
|
|
2122
|
+
return "";
|
|
2123
|
+
const t = window.location.host, { tenantDomainNames: a, name: r } = e;
|
|
2124
|
+
return t && a && a.some((u) => u.includes(t)) || r === "system" ? "" : r ? `/${r}` : "";
|
|
2127
2125
|
}
|
|
2128
|
-
const Ya = {
|
|
2126
|
+
const Ya = {
|
|
2127
|
+
"x-sisense-ai": "true",
|
|
2128
|
+
"x-sisense-origin": "fusion-ui"
|
|
2129
|
+
};
|
|
2129
2130
|
function Ha(e, t, a = Ya) {
|
|
2130
2131
|
let r = Mo();
|
|
2131
2132
|
r.startsWith("/") && (r = r.slice(1));
|
|
2132
2133
|
const n = new mn(
|
|
2133
2134
|
`${Bt(e)}${r}`,
|
|
2134
2135
|
t,
|
|
2135
|
-
"sdk-ai-core-0.6.
|
|
2136
|
+
"sdk-ai-core-0.6.2",
|
|
2136
2137
|
a
|
|
2137
2138
|
);
|
|
2138
2139
|
return n.login(), n;
|
|
@@ -2152,19 +2153,19 @@ function Nt(e) {
|
|
|
2152
2153
|
const t = e, a = (t == null ? void 0 : t.status) ?? (t == null ? void 0 : t.statusCode) ?? ((r = t == null ? void 0 : t.response) == null ? void 0 : r.status);
|
|
2153
2154
|
return a !== void 0 ? Number(a) : void 0;
|
|
2154
2155
|
}
|
|
2155
|
-
const Eo = "buildChart", ko = "buildDashboard",
|
|
2156
|
+
const Eo = "buildChart", ko = "buildDashboard", gc = "buildDataModel", No = "recommendQueries", $o = "getDashboards", Po = "getDataSources", _o = "getDataSourceFields", xo = "buildQuery", at = 10, Ot = 200, Dt = 50, Qa = "LLM_PLACEHOLDER", Ga = "x-user-action-id", Ka = "traceparent", Xa = "x-interface-name", er = "x-feature-name", tr = "x-quota-id", ga = [
|
|
2156
2157
|
Ga,
|
|
2157
2158
|
Ka,
|
|
2158
2159
|
Xa,
|
|
2159
2160
|
er,
|
|
2160
2161
|
tr
|
|
2161
2162
|
], Io = "api/v2/ai/llm/consumption/capture", jo = "api/v2/ai/llm/consumption/report";
|
|
2162
|
-
class
|
|
2163
|
+
class Ro extends Error {
|
|
2163
2164
|
constructor(t = "Quota exceeded") {
|
|
2164
2165
|
super(t), this.name = "QuotaExceededError";
|
|
2165
2166
|
}
|
|
2166
2167
|
}
|
|
2167
|
-
async function
|
|
2168
|
+
async function Lo(e) {
|
|
2168
2169
|
const t = C();
|
|
2169
2170
|
try {
|
|
2170
2171
|
const a = await t.post(
|
|
@@ -2176,7 +2177,7 @@ async function Ro(e) {
|
|
|
2176
2177
|
} catch (a) {
|
|
2177
2178
|
const r = Nt(a);
|
|
2178
2179
|
if (r === 429)
|
|
2179
|
-
throw new
|
|
2180
|
+
throw new Ro();
|
|
2180
2181
|
if (r === 400 || r === 422) {
|
|
2181
2182
|
const n = (a == null ? void 0 : a.message) ?? (r === 422 ? "Request validation failed (e.g. missing x-feature-name or x-interface-name). Ensure tracking headers are passed." : "The LLM configuration is missing. Reach out to your Admin to configure your LLM provider.");
|
|
2182
2183
|
console.debug(`LLM consumption capture skipped: ${n}`);
|
|
@@ -2196,7 +2197,7 @@ function qo() {
|
|
|
2196
2197
|
return et();
|
|
2197
2198
|
}
|
|
2198
2199
|
function Uo() {
|
|
2199
|
-
const e =
|
|
2200
|
+
const e = ce(32), t = ce(16);
|
|
2200
2201
|
return `00-${e}-${t}-01`;
|
|
2201
2202
|
}
|
|
2202
2203
|
class Zo {
|
|
@@ -2221,7 +2222,7 @@ class Zo {
|
|
|
2221
2222
|
async startAction(t, a) {
|
|
2222
2223
|
this._ensureContext(t, a);
|
|
2223
2224
|
try {
|
|
2224
|
-
const r = await
|
|
2225
|
+
const r = await Lo(me());
|
|
2225
2226
|
return r && (this.quotaId = r), this._buildHeaders();
|
|
2226
2227
|
} catch (r) {
|
|
2227
2228
|
throw this.currentActionId = null, this.currentTraceparent = null, this.interfaceName = null, this.featureName = null, this.quotaId = null, r;
|
|
@@ -2268,7 +2269,7 @@ function me(e = {}) {
|
|
|
2268
2269
|
};
|
|
2269
2270
|
}
|
|
2270
2271
|
const Jo = () => qt.endAction();
|
|
2271
|
-
async function
|
|
2272
|
+
async function yc(e, t, a) {
|
|
2272
2273
|
let r = !1;
|
|
2273
2274
|
try {
|
|
2274
2275
|
return await zo(e, t), r = !0, await a();
|
|
@@ -2318,7 +2319,7 @@ function C() {
|
|
|
2318
2319
|
);
|
|
2319
2320
|
return $t;
|
|
2320
2321
|
}
|
|
2321
|
-
function
|
|
2322
|
+
function bc() {
|
|
2322
2323
|
const e = C(), t = e.url, a = e.auth, r = Ha(t, a);
|
|
2323
2324
|
nr(r);
|
|
2324
2325
|
}
|
|
@@ -2333,11 +2334,11 @@ function or() {
|
|
|
2333
2334
|
);
|
|
2334
2335
|
return Pt;
|
|
2335
2336
|
}
|
|
2336
|
-
function
|
|
2337
|
+
function wc() {
|
|
2337
2338
|
const e = rr(C());
|
|
2338
2339
|
ir(e);
|
|
2339
2340
|
}
|
|
2340
|
-
function
|
|
2341
|
+
function vc(e) {
|
|
2341
2342
|
const t = To(e);
|
|
2342
2343
|
nr(t);
|
|
2343
2344
|
const a = rr(t);
|
|
@@ -2494,7 +2495,6 @@ DO NOT use any tools.
|
|
|
2494
2495
|
Return a JSON object matching the schema structure, with:
|
|
2495
2496
|
- chartType: The selected or user-specified chart type.
|
|
2496
2497
|
- axesMapping: The populated axes mapping object per the relevant schema.
|
|
2497
|
-
Provide a brief explanation of your chart type choice and axes mapping decisions, referencing the prompt and column data.
|
|
2498
2498
|
`;
|
|
2499
2499
|
function Ko(e, t) {
|
|
2500
2500
|
return e ? e.map((a) => ({
|
|
@@ -2556,7 +2556,7 @@ ${JSON.stringify(n)}`;
|
|
|
2556
2556
|
}
|
|
2557
2557
|
return u;
|
|
2558
2558
|
};
|
|
2559
|
-
async function
|
|
2559
|
+
async function Cc(e, t, a) {
|
|
2560
2560
|
return await (a ?? C()).post(
|
|
2561
2561
|
`api/v2/ai/nlq/query/${e}`,
|
|
2562
2562
|
t,
|
|
@@ -2577,7 +2577,7 @@ async function ts(e, t, a) {
|
|
|
2577
2577
|
me()
|
|
2578
2578
|
) ?? null;
|
|
2579
2579
|
}
|
|
2580
|
-
async function
|
|
2580
|
+
async function Sc(e, t, a) {
|
|
2581
2581
|
return await (a ?? C()).get(
|
|
2582
2582
|
`api/v2/ai/recommendations/query/${e}/${t.numOfRecommendations}`,
|
|
2583
2583
|
me()
|
|
@@ -2589,30 +2589,36 @@ async function as(e, t, a) {
|
|
|
2589
2589
|
me()
|
|
2590
2590
|
) ?? null;
|
|
2591
2591
|
}
|
|
2592
|
-
async function rs(e, t) {
|
|
2593
|
-
|
|
2592
|
+
async function rs(e, t, a) {
|
|
2593
|
+
return ts(
|
|
2594
|
+
e,
|
|
2595
|
+
{ text: t, forceGeneration: !0 },
|
|
2596
|
+
a
|
|
2597
|
+
);
|
|
2598
|
+
}
|
|
2599
|
+
async function ns(e, t) {
|
|
2594
2600
|
const { dataSourceTitle: a, queryPrompt: r } = e;
|
|
2595
2601
|
console.debug(
|
|
2596
|
-
|
|
2602
|
+
xo,
|
|
2597
2603
|
a,
|
|
2598
2604
|
r,
|
|
2599
2605
|
t.toolCallId
|
|
2600
2606
|
);
|
|
2601
|
-
const n =
|
|
2607
|
+
const n = await rs(
|
|
2602
2608
|
a,
|
|
2603
|
-
|
|
2604
|
-
|
|
2609
|
+
r,
|
|
2610
|
+
t.httpClient
|
|
2605
2611
|
);
|
|
2606
|
-
if (!(
|
|
2612
|
+
if (!(n != null && n.chartState))
|
|
2607
2613
|
throw new Error(
|
|
2608
2614
|
`Error: Failed to build query for "${r}". Chart state not found. Try rephrasing or check data source "${a}".`
|
|
2609
2615
|
);
|
|
2610
|
-
|
|
2616
|
+
n.dataset || (n.dataset = "There was an error executing the query, please rephrase it or simplify it into multiple queries");
|
|
2617
|
+
const i = t.toolCallId, o = n.chartState.title ?? "";
|
|
2611
2618
|
return {
|
|
2612
|
-
queryId:
|
|
2613
|
-
title:
|
|
2614
|
-
nlqResult:
|
|
2615
|
-
dataset: l
|
|
2619
|
+
queryId: i,
|
|
2620
|
+
title: o,
|
|
2621
|
+
nlqResult: n
|
|
2616
2622
|
};
|
|
2617
2623
|
}
|
|
2618
2624
|
const ur = async (e, t, a) => {
|
|
@@ -2639,77 +2645,81 @@ const ur = async (e, t, a) => {
|
|
|
2639
2645
|
if (n.nlqResponse = r, !ot(n))
|
|
2640
2646
|
throw new Error("Error: Non-chart widget props not supported yet");
|
|
2641
2647
|
return n.title = n.title || r.nlqPrompt || t, n;
|
|
2642
|
-
},
|
|
2648
|
+
}, is = async (e, t, a, r, n) => {
|
|
2643
2649
|
try {
|
|
2644
|
-
let i, o = t;
|
|
2650
|
+
let i, o = t, l;
|
|
2645
2651
|
if (r && n) {
|
|
2646
|
-
const
|
|
2647
|
-
if (!
|
|
2652
|
+
const g = n(r);
|
|
2653
|
+
if (!g)
|
|
2648
2654
|
throw new Error("Error: Failed to get query result.");
|
|
2649
|
-
i =
|
|
2655
|
+
i = g.nlqResult, o = g.title || t;
|
|
2650
2656
|
} else {
|
|
2651
|
-
const
|
|
2657
|
+
const g = await ns(
|
|
2652
2658
|
{ dataSourceTitle: e, queryPrompt: t },
|
|
2653
2659
|
{
|
|
2654
2660
|
toolCallId: "chart-builder-internal",
|
|
2655
2661
|
httpClient: a
|
|
2656
2662
|
}
|
|
2657
2663
|
);
|
|
2658
|
-
i =
|
|
2664
|
+
i = g.nlqResult, o = g.title || t, l = g;
|
|
2659
2665
|
}
|
|
2660
2666
|
if (!i)
|
|
2661
2667
|
throw new Error("Error: Failed to get NLQ result.");
|
|
2662
|
-
const
|
|
2663
|
-
if (!
|
|
2668
|
+
const u = i.dataSchema;
|
|
2669
|
+
if (!u)
|
|
2664
2670
|
throw new Error("Error: Data schema not found");
|
|
2665
|
-
const
|
|
2671
|
+
const c = sn({
|
|
2666
2672
|
data: i.chartState,
|
|
2667
|
-
context:
|
|
2673
|
+
context: u
|
|
2668
2674
|
});
|
|
2669
|
-
if (!
|
|
2675
|
+
if (!c.success)
|
|
2670
2676
|
throw new Error(
|
|
2671
|
-
"Error: Failed to translate query JSON: " + JSON.stringify(
|
|
2677
|
+
"Error: Failed to translate query JSON: " + JSON.stringify(c.errors)
|
|
2672
2678
|
);
|
|
2673
|
-
const
|
|
2674
|
-
|
|
2675
|
-
$a(
|
|
2676
|
-
),
|
|
2677
|
-
...
|
|
2678
|
-
...
|
|
2679
|
+
const m = c.data, d = ln(
|
|
2680
|
+
m,
|
|
2681
|
+
$a(u.dataSource)
|
|
2682
|
+
), f = [
|
|
2683
|
+
...m.dimensions || [],
|
|
2684
|
+
...m.measures || []
|
|
2679
2685
|
];
|
|
2680
2686
|
return {
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2687
|
+
widgetProps: {
|
|
2688
|
+
title: o,
|
|
2689
|
+
id: ce(),
|
|
2690
|
+
widgetType: "chart",
|
|
2691
|
+
dataSource: m.dataSource,
|
|
2692
|
+
chartType: "table",
|
|
2693
|
+
dataOptions: { columns: f },
|
|
2694
|
+
filters: m.filters || [],
|
|
2695
|
+
highlights: m.highlights || [],
|
|
2696
|
+
nlqResponse: {
|
|
2697
|
+
chartRecommendations: {},
|
|
2698
|
+
detailedDescription: o,
|
|
2699
|
+
nlqPrompt: o,
|
|
2700
|
+
userMsg: o,
|
|
2701
|
+
queryTitle: o,
|
|
2702
|
+
jaql: d
|
|
2703
|
+
}
|
|
2704
|
+
},
|
|
2705
|
+
...l && { queryResult: l }
|
|
2697
2706
|
};
|
|
2698
2707
|
} catch (i) {
|
|
2699
2708
|
return console.error(
|
|
2700
2709
|
"Error: Failed to generate chart table from NLQ V3. Falling back to NLQ V2.",
|
|
2701
2710
|
i
|
|
2702
|
-
), ur(
|
|
2711
|
+
), { widgetProps: await ur(
|
|
2703
2712
|
e,
|
|
2704
2713
|
t,
|
|
2705
2714
|
a
|
|
2706
|
-
);
|
|
2715
|
+
) };
|
|
2707
2716
|
}
|
|
2708
|
-
},
|
|
2717
|
+
}, os = async (e, t, a, r, n, i) => a ? (console.debug(
|
|
2709
2718
|
"Generating chart table from NLQ V3",
|
|
2710
2719
|
t,
|
|
2711
|
-
e
|
|
2712
|
-
|
|
2720
|
+
e,
|
|
2721
|
+
n
|
|
2722
|
+
), is(
|
|
2713
2723
|
e,
|
|
2714
2724
|
t,
|
|
2715
2725
|
r,
|
|
@@ -2719,11 +2729,11 @@ const ur = async (e, t, a) => {
|
|
|
2719
2729
|
"Generating chart table from NLQ V2",
|
|
2720
2730
|
t,
|
|
2721
2731
|
e
|
|
2722
|
-
), ur(
|
|
2732
|
+
), { widgetProps: await ur(
|
|
2723
2733
|
e,
|
|
2724
2734
|
t,
|
|
2725
2735
|
r
|
|
2726
|
-
)), cr = async ({
|
|
2736
|
+
) }), cr = async ({
|
|
2727
2737
|
dataSourceTitle: e,
|
|
2728
2738
|
queryPrompt: t,
|
|
2729
2739
|
chartPrompt: a,
|
|
@@ -2731,44 +2741,43 @@ const ur = async (e, t, a) => {
|
|
|
2731
2741
|
chartTitle: n,
|
|
2732
2742
|
queryId: i
|
|
2733
2743
|
}, o) => {
|
|
2734
|
-
const l = await
|
|
2744
|
+
const { widgetProps: l, queryResult: u } = await os(
|
|
2735
2745
|
e,
|
|
2736
2746
|
t,
|
|
2737
2747
|
o.isNlqV3Enabled ?? !1,
|
|
2738
2748
|
o.httpClient,
|
|
2739
2749
|
i,
|
|
2740
2750
|
o.retrieveQuery
|
|
2741
|
-
),
|
|
2751
|
+
), c = l.dataOptions.columns, m = await lr(
|
|
2742
2752
|
a,
|
|
2743
|
-
|
|
2753
|
+
c,
|
|
2744
2754
|
r,
|
|
2745
2755
|
o.openAIClient
|
|
2746
2756
|
);
|
|
2747
|
-
l.nlqResponse.chartRecommendations =
|
|
2748
|
-
const { axesMapping:
|
|
2749
|
-
l.dataOptions =
|
|
2750
|
-
const
|
|
2751
|
-
|
|
2757
|
+
l.nlqResponse.chartRecommendations = m || l.nlqResponse.chartRecommendations;
|
|
2758
|
+
const { axesMapping: d, chartType: f } = m;
|
|
2759
|
+
l.dataOptions = d, l.chartType = f, l.title = l.title || n;
|
|
2760
|
+
const p = Na(
|
|
2761
|
+
f,
|
|
2752
2762
|
l.dataOptions,
|
|
2753
2763
|
{},
|
|
2754
2764
|
!0
|
|
2755
2765
|
);
|
|
2756
2766
|
return l.styleOptions = {
|
|
2757
|
-
...
|
|
2758
|
-
..."legend" in
|
|
2767
|
+
...p,
|
|
2768
|
+
..."legend" in p ? { legend: { enabled: !0, position: "bottom" } } : {}
|
|
2759
2769
|
}, {
|
|
2760
|
-
...l,
|
|
2761
|
-
|
|
2762
|
-
dataColumns: u
|
|
2770
|
+
widgetProps: { ...l, artifactId: ce(), dataColumns: c },
|
|
2771
|
+
queryResult: u
|
|
2763
2772
|
};
|
|
2764
|
-
},
|
|
2773
|
+
}, ss = async ({
|
|
2765
2774
|
queryPrompt: e,
|
|
2766
2775
|
chartPrompt: t,
|
|
2767
2776
|
chartType: a,
|
|
2768
2777
|
chartTitle: r,
|
|
2769
2778
|
queryId: n
|
|
2770
2779
|
}, i) => {
|
|
2771
|
-
var
|
|
2780
|
+
var d, f;
|
|
2772
2781
|
const o = n ?? i.queryId ?? null;
|
|
2773
2782
|
console.debug(
|
|
2774
2783
|
"toolCall",
|
|
@@ -2778,7 +2787,7 @@ const ur = async (e, t, a) => {
|
|
|
2778
2787
|
a,
|
|
2779
2788
|
r
|
|
2780
2789
|
);
|
|
2781
|
-
const l = i.dataSourceTitle, u = i.toolCallId, c = await cr(
|
|
2790
|
+
const l = i.dataSourceTitle, u = i.toolCallId, { widgetProps: c, queryResult: m } = await cr(
|
|
2782
2791
|
{
|
|
2783
2792
|
dataSourceTitle: l,
|
|
2784
2793
|
queryPrompt: e,
|
|
@@ -2789,29 +2798,29 @@ const ur = async (e, t, a) => {
|
|
|
2789
2798
|
},
|
|
2790
2799
|
i
|
|
2791
2800
|
);
|
|
2792
|
-
return (
|
|
2801
|
+
return (d = i.saveChart) == null || d.call(i, u, c), m && ((f = i.onInternalQueryResult) == null || f.call(i, m)), {
|
|
2793
2802
|
message: `New chart (chartId: ${u}) created successfully`
|
|
2794
2803
|
};
|
|
2795
|
-
},
|
|
2804
|
+
}, ls = ({
|
|
2796
2805
|
chartTitle: e,
|
|
2797
2806
|
chartWidgetProps: t
|
|
2798
2807
|
}) => ({
|
|
2799
2808
|
...t,
|
|
2800
2809
|
title: e
|
|
2801
|
-
}),
|
|
2810
|
+
}), us = async ({ chartId: e, chartTitle: t }, a) => {
|
|
2802
2811
|
var i, o;
|
|
2803
2812
|
console.debug("toolCall", "updateChartTitle", e, t);
|
|
2804
2813
|
const r = (i = a.retrieveChart) == null ? void 0 : i.call(a, e);
|
|
2805
2814
|
if (!r)
|
|
2806
2815
|
throw new Error("Chart not found");
|
|
2807
|
-
const n =
|
|
2816
|
+
const n = ls({
|
|
2808
2817
|
chartTitle: t,
|
|
2809
2818
|
chartWidgetProps: r
|
|
2810
2819
|
});
|
|
2811
2820
|
return (o = a.saveChart) == null || o.call(a, e, n), {
|
|
2812
2821
|
message: "Chart title updated successfully"
|
|
2813
2822
|
};
|
|
2814
|
-
},
|
|
2823
|
+
}, cs = async ({
|
|
2815
2824
|
userPrompt: e,
|
|
2816
2825
|
chartType: t,
|
|
2817
2826
|
chartWidgetProps: a
|
|
@@ -2839,7 +2848,7 @@ const ur = async (e, t, a) => {
|
|
|
2839
2848
|
..."markerSize" in n && "markerSize" in u ? { markerSize: n.markerSize } : {}
|
|
2840
2849
|
} : u;
|
|
2841
2850
|
return a.styleOptions = c, a;
|
|
2842
|
-
},
|
|
2851
|
+
}, ms = async ({ chartId: e, userPrompt: t, chartType: a }, r) => {
|
|
2843
2852
|
var o, l;
|
|
2844
2853
|
console.debug(
|
|
2845
2854
|
"toolCall",
|
|
@@ -2851,7 +2860,7 @@ const ur = async (e, t, a) => {
|
|
|
2851
2860
|
const n = (o = r.retrieveChart) == null ? void 0 : o.call(r, e);
|
|
2852
2861
|
if (!n)
|
|
2853
2862
|
throw new Error("Chart not found");
|
|
2854
|
-
const i = await
|
|
2863
|
+
const i = await cs({
|
|
2855
2864
|
userPrompt: t,
|
|
2856
2865
|
chartType: a,
|
|
2857
2866
|
chartWidgetProps: n
|
|
@@ -2859,9 +2868,9 @@ const ur = async (e, t, a) => {
|
|
|
2859
2868
|
return (l = r.saveChart) == null || l.call(r, e, i), {
|
|
2860
2869
|
message: "Chart type updated successfully"
|
|
2861
2870
|
};
|
|
2862
|
-
},
|
|
2871
|
+
}, ds = s.object({
|
|
2863
2872
|
width: s.enum(["thin", "bold", "thick"])
|
|
2864
|
-
}),
|
|
2873
|
+
}), fs = s.enum(["line/basic", "line/spline"]), J = s.object({
|
|
2865
2874
|
enabled: s.boolean().optional().describe(
|
|
2866
2875
|
"Boolean flag that defines if legend should be shown on the chart"
|
|
2867
2876
|
),
|
|
@@ -2925,9 +2934,9 @@ const ur = async (e, t, a) => {
|
|
|
2925
2934
|
seriesCapacity: s.number().optional().describe("Maximum number of series to chart")
|
|
2926
2935
|
}).describe(
|
|
2927
2936
|
"Configuration that limits the series or categories that are charted."
|
|
2928
|
-
).strict(),
|
|
2929
|
-
lineWidth:
|
|
2930
|
-
subtype:
|
|
2937
|
+
).strict(), ps = s.object({
|
|
2938
|
+
lineWidth: ds.optional(),
|
|
2939
|
+
subtype: fs.optional(),
|
|
2931
2940
|
markers: Be.optional(),
|
|
2932
2941
|
navigator: ut.optional(),
|
|
2933
2942
|
dataLimits: fe.optional(),
|
|
@@ -2945,7 +2954,7 @@ const ur = async (e, t, a) => {
|
|
|
2945
2954
|
yAxis: Fe.optional(),
|
|
2946
2955
|
y2Axis: Me.optional(),
|
|
2947
2956
|
seriesLabels: Y.optional()
|
|
2948
|
-
}).strict(),
|
|
2957
|
+
}).strict(), hs = s.object({
|
|
2949
2958
|
enabled: s.boolean().optional().describe(
|
|
2950
2959
|
"Boolean flag that defines if convolution ability should be enabled on chart"
|
|
2951
2960
|
),
|
|
@@ -2958,12 +2967,12 @@ const ur = async (e, t, a) => {
|
|
|
2958
2967
|
selectedConvolutionType: s.enum(["byPercentage", "bySlicesCount"]).optional().describe("Selected type of convolution behavior")
|
|
2959
2968
|
}).describe(
|
|
2960
2969
|
'Configuration that defines the ability of the Pie chart to collapse (convolve) and hide part of the data under the single category "Others".'
|
|
2961
|
-
).strict(),
|
|
2970
|
+
).strict(), gs = s.object({
|
|
2962
2971
|
subtype: s.enum(["pie/basic", "pie/donut", "pie/ring"]).optional(),
|
|
2963
2972
|
seriesLabels: Y.optional(),
|
|
2964
2973
|
legend: J.optional(),
|
|
2965
|
-
convolution:
|
|
2966
|
-
}).strict(),
|
|
2974
|
+
convolution: hs.optional()
|
|
2975
|
+
}).strict(), ys = s.object({
|
|
2967
2976
|
markers: Be.optional(),
|
|
2968
2977
|
dataLimits: fe.optional(),
|
|
2969
2978
|
markerSize: s.object({
|
|
@@ -2976,7 +2985,7 @@ const ur = async (e, t, a) => {
|
|
|
2976
2985
|
yAxis: Fe.optional(),
|
|
2977
2986
|
y2Axis: Me.optional(),
|
|
2978
2987
|
seriesLabels: Y.optional()
|
|
2979
|
-
}).strict(),
|
|
2988
|
+
}).strict(), bs = s.object({
|
|
2980
2989
|
subtype: s.enum([
|
|
2981
2990
|
"area/basic",
|
|
2982
2991
|
"area/spline",
|
|
@@ -2992,7 +3001,7 @@ const ur = async (e, t, a) => {
|
|
|
2992
3001
|
yAxis: Fe.optional(),
|
|
2993
3002
|
y2Axis: Me.optional(),
|
|
2994
3003
|
seriesLabels: Y.optional()
|
|
2995
|
-
}).strict(),
|
|
3004
|
+
}).strict(), ws = s.object({
|
|
2996
3005
|
dataLimits: fe.optional(),
|
|
2997
3006
|
funnelDirection: s.enum(["inverted", "regular"]).optional().describe("Direction of FunnelChart narrowing"),
|
|
2998
3007
|
funnelSize: s.enum(["narrow", "regular", "wide"]).optional().describe(
|
|
@@ -3004,7 +3013,7 @@ const ur = async (e, t, a) => {
|
|
|
3004
3013
|
neckWidth: s.number().optional(),
|
|
3005
3014
|
seriesLabels: Y.optional(),
|
|
3006
3015
|
legend: J.optional()
|
|
3007
|
-
}).strict(),
|
|
3016
|
+
}).strict(), vs = s.object({
|
|
3008
3017
|
dataLimits: fe.optional(),
|
|
3009
3018
|
layout: s.enum([
|
|
3010
3019
|
"squarified",
|
|
@@ -3019,14 +3028,14 @@ const ur = async (e, t, a) => {
|
|
|
3019
3028
|
tooltip: s.object({
|
|
3020
3029
|
mode: s.enum(["contribution", "value"]).optional().describe("Define mode of data showing")
|
|
3021
3030
|
})
|
|
3022
|
-
}).strict(),
|
|
3031
|
+
}).strict(), Cs = s.object({
|
|
3023
3032
|
dataLimits: fe.optional(),
|
|
3024
3033
|
levels: s.number().optional(),
|
|
3025
3034
|
borderWidth: s.number().optional(),
|
|
3026
3035
|
borderColor: s.string().optional(),
|
|
3027
3036
|
seriesLabels: Y.optional(),
|
|
3028
3037
|
legend: J.optional()
|
|
3029
|
-
}).strict(),
|
|
3038
|
+
}).strict(), Ss = s.object({
|
|
3030
3039
|
dataLimits: fe.optional(),
|
|
3031
3040
|
subtype: s.enum(["boxplot/full", "boxplot/hollow"]).optional(),
|
|
3032
3041
|
boxType: s.enum(["iqr", "extremums", "standardDeviation"]).optional(),
|
|
@@ -3038,7 +3047,7 @@ const ur = async (e, t, a) => {
|
|
|
3038
3047
|
y2Axis: Me.optional(),
|
|
3039
3048
|
markers: Be.optional(),
|
|
3040
3049
|
seriesLabels: Y.optional()
|
|
3041
|
-
}).strict(),
|
|
3050
|
+
}).strict(), As = s.object({
|
|
3042
3051
|
subtype: s.enum(["indicator/numeric", "indicator/gauge"]).optional(),
|
|
3043
3052
|
value: s.number().optional(),
|
|
3044
3053
|
min: s.number().optional(),
|
|
@@ -3050,7 +3059,7 @@ const ur = async (e, t, a) => {
|
|
|
3050
3059
|
"Boolean flag to force render indicator in ticker mode regardless of display size"
|
|
3051
3060
|
),
|
|
3052
3061
|
skin: s.enum(["1", "2"]).optional().describe("Skin gauge indicator")
|
|
3053
|
-
}).strict(),
|
|
3062
|
+
}).strict(), Os = s.object({
|
|
3054
3063
|
dataLimits: fe.optional(),
|
|
3055
3064
|
height: s.number().optional(),
|
|
3056
3065
|
width: s.number().optional(),
|
|
@@ -3088,34 +3097,34 @@ const ur = async (e, t, a) => {
|
|
|
3088
3097
|
rowsPerPage: s.number().optional().describe("Number of rows per page"),
|
|
3089
3098
|
paddingHorizontal: s.number().optional().describe("Horizontal padding around whole table"),
|
|
3090
3099
|
paddingVertical: s.number().optional().describe("Vertical padding around whole table")
|
|
3091
|
-
}),
|
|
3092
|
-
line:
|
|
3100
|
+
}), Ds = {
|
|
3101
|
+
line: ps,
|
|
3093
3102
|
bar: ya,
|
|
3094
|
-
area:
|
|
3103
|
+
area: bs,
|
|
3095
3104
|
column: ya,
|
|
3096
3105
|
// Assuming column is similar to bar; adjust as needed
|
|
3097
|
-
pie:
|
|
3098
|
-
scatter:
|
|
3099
|
-
funnel:
|
|
3100
|
-
treemap:
|
|
3101
|
-
sunburst:
|
|
3102
|
-
boxplot:
|
|
3103
|
-
indicator:
|
|
3104
|
-
polar:
|
|
3106
|
+
pie: gs,
|
|
3107
|
+
scatter: ys,
|
|
3108
|
+
funnel: ws,
|
|
3109
|
+
treemap: vs,
|
|
3110
|
+
sunburst: Cs,
|
|
3111
|
+
boxplot: Ss,
|
|
3112
|
+
indicator: As,
|
|
3113
|
+
polar: Os,
|
|
3105
3114
|
table: mr,
|
|
3106
3115
|
arearange: s.object({}),
|
|
3107
3116
|
scattermap: s.object({}),
|
|
3108
3117
|
areamap: s.object({}),
|
|
3109
3118
|
"calendar-heatmap": s.object({}),
|
|
3110
3119
|
streamgraph: s.object({})
|
|
3111
|
-
},
|
|
3120
|
+
}, Fs = s.object({
|
|
3112
3121
|
chartType: st
|
|
3113
3122
|
});
|
|
3114
|
-
function
|
|
3115
|
-
const t =
|
|
3123
|
+
function Ms(e) {
|
|
3124
|
+
const t = Ds[e];
|
|
3116
3125
|
if (!t)
|
|
3117
3126
|
throw new Error(`Unsupported chart type: ${e}`);
|
|
3118
|
-
return
|
|
3127
|
+
return Fs.extend({
|
|
3119
3128
|
styleOptions: t
|
|
3120
3129
|
});
|
|
3121
3130
|
}
|
|
@@ -3206,7 +3215,7 @@ const wa = s.object({
|
|
|
3206
3215
|
trillion: s.boolean().optional().describe(
|
|
3207
3216
|
"Boolean flag whether to show an abbreviation for a number greater than or equal one trillion - e.g. 1T"
|
|
3208
3217
|
)
|
|
3209
|
-
}),
|
|
3218
|
+
}), Ts = s.object({
|
|
3210
3219
|
ignoreAnomalies: s.boolean().optional().describe(
|
|
3211
3220
|
"Boolean flag that enables the function to automatically identify and ignore anomalous values in the series. This can be particularly useful when you want to maintain the integrity of your analysis by avoiding potential outliers. default is false"
|
|
3212
3221
|
),
|
|
@@ -3218,7 +3227,7 @@ const wa = s.object({
|
|
|
3218
3227
|
]).optional().describe(
|
|
3219
3228
|
"Trend analysis model type to be used for the operation. default is linear"
|
|
3220
3229
|
)
|
|
3221
|
-
}).describe("Trend analysis options for the measure"),
|
|
3230
|
+
}).describe("Trend analysis options for the measure"), Es = s.object({
|
|
3222
3231
|
confidenceInterval: s.number().optional().describe(
|
|
3223
3232
|
"Confidence interval showing the probabilistic upper and lower limits of the forecasted series according to the uncertainty level. The valid range is (0.8 <= X < 1). default is 0.8"
|
|
3224
3233
|
),
|
|
@@ -3277,8 +3286,8 @@ const wa = s.object({
|
|
|
3277
3286
|
treatNullDataAsZeros: s.boolean().describe(
|
|
3278
3287
|
"Boolean flag whether null values are treated as zeros in the chart"
|
|
3279
3288
|
),
|
|
3280
|
-
trend:
|
|
3281
|
-
forecast:
|
|
3289
|
+
trend: Ts.optional().describe("Trend analysis options for the measure."),
|
|
3290
|
+
forecast: Es.optional().describe("Forecast analysis options for the measure.")
|
|
3282
3291
|
}).describe("Configuration for measures.StyledMeasure"),
|
|
3283
3292
|
dimensions: s.object({
|
|
3284
3293
|
column: ba,
|
|
@@ -3345,19 +3354,19 @@ const wa = s.object({
|
|
|
3345
3354
|
category: s.array(k.dimensions),
|
|
3346
3355
|
outliersEnabled: s.boolean().optional(),
|
|
3347
3356
|
value: s.array(k.measures)
|
|
3348
|
-
}),
|
|
3357
|
+
}), ks = s.object({
|
|
3349
3358
|
colorBy: k.measures,
|
|
3350
3359
|
// todo: or statement dimensions or measures
|
|
3351
3360
|
details: k.dimensions,
|
|
3352
3361
|
geo: s.array(k.dimensions),
|
|
3353
3362
|
size: k.measures
|
|
3354
|
-
}),
|
|
3363
|
+
}), Ns = s.object({
|
|
3355
3364
|
color: s.array(k.measures),
|
|
3356
3365
|
geo: s.array(k.dimensions)
|
|
3357
3366
|
}), hr = s.object({
|
|
3358
3367
|
date: s.array(k.dimensions),
|
|
3359
3368
|
value: s.array(k.measures)
|
|
3360
|
-
}),
|
|
3369
|
+
}), $s = s.object({
|
|
3361
3370
|
columns: s.array(k.dimensions)
|
|
3362
3371
|
}), qe = (e) => {
|
|
3363
3372
|
switch (e) {
|
|
@@ -3377,19 +3386,19 @@ const wa = s.object({
|
|
|
3377
3386
|
case "indicator":
|
|
3378
3387
|
return fr;
|
|
3379
3388
|
case "table":
|
|
3380
|
-
return
|
|
3389
|
+
return $s;
|
|
3381
3390
|
case "boxplot":
|
|
3382
3391
|
return pr;
|
|
3383
3392
|
case "scattermap":
|
|
3384
|
-
return Es;
|
|
3385
|
-
case "areamap":
|
|
3386
3393
|
return ks;
|
|
3394
|
+
case "areamap":
|
|
3395
|
+
return Ns;
|
|
3387
3396
|
case "calendar-heatmap":
|
|
3388
3397
|
return hr;
|
|
3389
3398
|
default:
|
|
3390
3399
|
return s.object({});
|
|
3391
3400
|
}
|
|
3392
|
-
},
|
|
3401
|
+
}, Ac = {
|
|
3393
3402
|
line: ye,
|
|
3394
3403
|
bar: ye,
|
|
3395
3404
|
area: ye,
|
|
@@ -3427,7 +3436,7 @@ const wa = s.object({
|
|
|
3427
3436
|
|
|
3428
3437
|
dataOptions: {
|
|
3429
3438
|
${Object.entries(t.shape).map(
|
|
3430
|
-
([u, c]) => `- ${u}: ${
|
|
3439
|
+
([u, c]) => `- ${u}: ${se(c)}`
|
|
3431
3440
|
).join(`
|
|
3432
3441
|
`)}
|
|
3433
3442
|
}
|
|
@@ -3458,26 +3467,28 @@ const wa = s.object({
|
|
|
3458
3467
|
] } }
|
|
3459
3468
|
|
|
3460
3469
|
`;
|
|
3461
|
-
},
|
|
3470
|
+
}, Ps = async ({
|
|
3462
3471
|
systemPrompt: e,
|
|
3463
3472
|
userPrompt: t,
|
|
3464
3473
|
chartWidgetProps: a
|
|
3465
3474
|
}) => {
|
|
3466
|
-
const { chartType: r } = a, n = qe(r)
|
|
3467
|
-
|
|
3468
|
-
|
|
3475
|
+
const { chartType: r } = a, n = qe(r);
|
|
3476
|
+
s.object({
|
|
3477
|
+
dataOptions: n
|
|
3478
|
+
});
|
|
3479
|
+
const i = await lt({
|
|
3469
3480
|
systemPrompt: e,
|
|
3470
3481
|
userPrompt: t,
|
|
3471
3482
|
responseFormat: { type: "json_object" }
|
|
3472
3483
|
});
|
|
3473
|
-
console.debug("LLM RESPONSE DATA OPTIONS",
|
|
3474
|
-
const
|
|
3484
|
+
console.debug("LLM RESPONSE DATA OPTIONS", i);
|
|
3485
|
+
const { dataOptions: o = null } = i, l = o ? _s(a.dataOptions, o) : a.dataOptions;
|
|
3475
3486
|
return {
|
|
3476
3487
|
...a,
|
|
3477
|
-
dataOptions:
|
|
3488
|
+
dataOptions: l
|
|
3478
3489
|
};
|
|
3479
3490
|
};
|
|
3480
|
-
function
|
|
3491
|
+
function _s(e, t) {
|
|
3481
3492
|
const a = { ...e };
|
|
3482
3493
|
for (const r of Object.keys(t)) {
|
|
3483
3494
|
const n = r, i = t[n], o = e[n] || [];
|
|
@@ -3508,7 +3519,7 @@ const xs = async ({ chartId: e, userPrompt: t }, a, r) => {
|
|
|
3508
3519
|
const n = (o = r.retrieveChart) == null ? void 0 : o.call(r, e);
|
|
3509
3520
|
if (!n)
|
|
3510
3521
|
throw new Error("Chart not found");
|
|
3511
|
-
const i = await
|
|
3522
|
+
const i = await Ps({
|
|
3512
3523
|
systemPrompt: a,
|
|
3513
3524
|
userPrompt: t,
|
|
3514
3525
|
chartWidgetProps: n
|
|
@@ -3528,12 +3539,12 @@ const xs = async ({ chartId: e, userPrompt: t }, a, r) => {
|
|
|
3528
3539
|
i,
|
|
3529
3540
|
r
|
|
3530
3541
|
);
|
|
3531
|
-
},
|
|
3542
|
+
}, Is = {
|
|
3532
3543
|
toolName: "updateChartTypeOfMeasures",
|
|
3533
3544
|
buildSystemPrompt: (e) => {
|
|
3534
3545
|
const t = qe(
|
|
3535
3546
|
e.chartType
|
|
3536
|
-
), a =
|
|
3547
|
+
), a = Lt(t, [
|
|
3537
3548
|
"column",
|
|
3538
3549
|
"chartType"
|
|
3539
3550
|
]);
|
|
@@ -3542,12 +3553,12 @@ const xs = async ({ chartId: e, userPrompt: t }, a, r) => {
|
|
|
3542
3553
|
a
|
|
3543
3554
|
);
|
|
3544
3555
|
}
|
|
3545
|
-
},
|
|
3556
|
+
}, js = {
|
|
3546
3557
|
toolName: "updateChartSorting",
|
|
3547
3558
|
buildSystemPrompt: (e) => {
|
|
3548
3559
|
const t = qe(
|
|
3549
3560
|
e.chartType
|
|
3550
|
-
), a =
|
|
3561
|
+
), a = Lt(t, [
|
|
3551
3562
|
"column",
|
|
3552
3563
|
"sortType"
|
|
3553
3564
|
]);
|
|
@@ -3557,12 +3568,12 @@ const xs = async ({ chartId: e, userPrompt: t }, a, r) => {
|
|
|
3557
3568
|
"IMPORTANT: When setting sortType on a column within dataOptions, if sortType exists on any other column, set it to null to ensure only one is active."
|
|
3558
3569
|
);
|
|
3559
3570
|
}
|
|
3560
|
-
},
|
|
3571
|
+
}, Rs = {
|
|
3561
3572
|
toolName: "updateTrendAndForecast",
|
|
3562
3573
|
buildSystemPrompt: (e) => {
|
|
3563
3574
|
const t = qe(
|
|
3564
3575
|
e.chartType
|
|
3565
|
-
), a =
|
|
3576
|
+
), a = Lt(t, [
|
|
3566
3577
|
"column",
|
|
3567
3578
|
"trend",
|
|
3568
3579
|
"forecast"
|
|
@@ -3593,56 +3604,56 @@ const xs = async ({ chartId: e, userPrompt: t }, a, r) => {
|
|
|
3593
3604
|
'IMPORTANT: This tool cannot swap data columns (e.g. changing "Revenue" to "Profit"). Use createChart for that.'
|
|
3594
3605
|
);
|
|
3595
3606
|
}
|
|
3596
|
-
},
|
|
3597
|
-
_s
|
|
3598
|
-
), Bs = mt(
|
|
3607
|
+
}, Bs = mt(
|
|
3599
3608
|
Is
|
|
3600
3609
|
), qs = mt(
|
|
3601
3610
|
js
|
|
3602
3611
|
), Us = mt(
|
|
3612
|
+
Rs
|
|
3613
|
+
), Zs = mt(
|
|
3603
3614
|
Ls
|
|
3604
3615
|
);
|
|
3605
3616
|
function gr(e) {
|
|
3606
3617
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
3607
3618
|
}
|
|
3608
|
-
var
|
|
3609
|
-
return
|
|
3619
|
+
var zs = function(t) {
|
|
3620
|
+
return Ws(t) && !Vs(t);
|
|
3610
3621
|
};
|
|
3611
|
-
function
|
|
3622
|
+
function Ws(e) {
|
|
3612
3623
|
return !!e && typeof e == "object";
|
|
3613
3624
|
}
|
|
3614
|
-
function
|
|
3625
|
+
function Vs(e) {
|
|
3615
3626
|
var t = Object.prototype.toString.call(e);
|
|
3616
|
-
return t === "[object RegExp]" || t === "[object Date]" ||
|
|
3617
|
-
}
|
|
3618
|
-
var Vs = typeof Symbol == "function" && Symbol.for, Js = Vs ? Symbol.for("react.element") : 60103;
|
|
3619
|
-
function Ys(e) {
|
|
3620
|
-
return e.$$typeof === Js;
|
|
3627
|
+
return t === "[object RegExp]" || t === "[object Date]" || Hs(e);
|
|
3621
3628
|
}
|
|
3629
|
+
var Js = typeof Symbol == "function" && Symbol.for, Ys = Js ? Symbol.for("react.element") : 60103;
|
|
3622
3630
|
function Hs(e) {
|
|
3631
|
+
return e.$$typeof === Ys;
|
|
3632
|
+
}
|
|
3633
|
+
function Qs(e) {
|
|
3623
3634
|
return Array.isArray(e) ? [] : {};
|
|
3624
3635
|
}
|
|
3625
|
-
function
|
|
3626
|
-
return t.clone !== !1 && t.isMergeableObject(e) ? Ae(
|
|
3636
|
+
function Re(e, t) {
|
|
3637
|
+
return t.clone !== !1 && t.isMergeableObject(e) ? Ae(Qs(e), e, t) : e;
|
|
3627
3638
|
}
|
|
3628
|
-
function
|
|
3639
|
+
function Gs(e, t, a) {
|
|
3629
3640
|
return e.concat(t).map(function(r) {
|
|
3630
|
-
return
|
|
3641
|
+
return Re(r, a);
|
|
3631
3642
|
});
|
|
3632
3643
|
}
|
|
3633
|
-
function
|
|
3644
|
+
function Ks(e, t) {
|
|
3634
3645
|
if (!t.customMerge)
|
|
3635
3646
|
return Ae;
|
|
3636
3647
|
var a = t.customMerge(e);
|
|
3637
3648
|
return typeof a == "function" ? a : Ae;
|
|
3638
3649
|
}
|
|
3639
|
-
function
|
|
3650
|
+
function Xs(e) {
|
|
3640
3651
|
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e).filter(function(t) {
|
|
3641
3652
|
return Object.propertyIsEnumerable.call(e, t);
|
|
3642
3653
|
}) : [];
|
|
3643
3654
|
}
|
|
3644
3655
|
function va(e) {
|
|
3645
|
-
return Object.keys(e).concat(
|
|
3656
|
+
return Object.keys(e).concat(Xs(e));
|
|
3646
3657
|
}
|
|
3647
3658
|
function yr(e, t) {
|
|
3648
3659
|
try {
|
|
@@ -3651,21 +3662,21 @@ function yr(e, t) {
|
|
|
3651
3662
|
return !1;
|
|
3652
3663
|
}
|
|
3653
3664
|
}
|
|
3654
|
-
function
|
|
3665
|
+
function el(e, t) {
|
|
3655
3666
|
return yr(e, t) && !(Object.hasOwnProperty.call(e, t) && Object.propertyIsEnumerable.call(e, t));
|
|
3656
3667
|
}
|
|
3657
|
-
function
|
|
3668
|
+
function tl(e, t, a) {
|
|
3658
3669
|
var r = {};
|
|
3659
3670
|
return a.isMergeableObject(e) && va(e).forEach(function(n) {
|
|
3660
|
-
r[n] =
|
|
3671
|
+
r[n] = Re(e[n], a);
|
|
3661
3672
|
}), va(t).forEach(function(n) {
|
|
3662
|
-
|
|
3673
|
+
el(e, n) || (yr(e, n) && a.isMergeableObject(t[n]) ? r[n] = Ks(n, a)(e[n], t[n], a) : r[n] = Re(t[n], a));
|
|
3663
3674
|
}), r;
|
|
3664
3675
|
}
|
|
3665
3676
|
function Ae(e, t, a) {
|
|
3666
|
-
a = a || {}, a.arrayMerge = a.arrayMerge ||
|
|
3677
|
+
a = a || {}, a.arrayMerge = a.arrayMerge || Gs, a.isMergeableObject = a.isMergeableObject || zs, a.cloneUnlessOtherwiseSpecified = Re;
|
|
3667
3678
|
var r = Array.isArray(t), n = Array.isArray(e), i = r === n;
|
|
3668
|
-
return i ? r ? a.arrayMerge(e, t, a) :
|
|
3679
|
+
return i ? r ? a.arrayMerge(e, t, a) : tl(e, t, a) : Re(t, a);
|
|
3669
3680
|
}
|
|
3670
3681
|
Ae.all = function(t, a) {
|
|
3671
3682
|
if (!Array.isArray(t))
|
|
@@ -3674,12 +3685,12 @@ Ae.all = function(t, a) {
|
|
|
3674
3685
|
return Ae(r, n, a);
|
|
3675
3686
|
}, {});
|
|
3676
3687
|
};
|
|
3677
|
-
var
|
|
3678
|
-
const
|
|
3688
|
+
var al = Ae, rl = al;
|
|
3689
|
+
const nl = /* @__PURE__ */ gr(rl), il = async ({
|
|
3679
3690
|
userPrompt: e,
|
|
3680
3691
|
chartWidgetProps: t
|
|
3681
3692
|
}) => {
|
|
3682
|
-
const { styleOptions: a, chartType: r } = t, n =
|
|
3693
|
+
const { styleOptions: a, chartType: r } = t, n = Ms(r), o = `
|
|
3683
3694
|
You are a chart style options assistant. You edit only the fields the user mentions.
|
|
3684
3695
|
|
|
3685
3696
|
DO NOT use any tools.
|
|
@@ -3689,7 +3700,7 @@ const rl = /* @__PURE__ */ gr(al), nl = async ({
|
|
|
3689
3700
|
Editable chart style properties are as follows:
|
|
3690
3701
|
|
|
3691
3702
|
styleOptions: {
|
|
3692
|
-
${Object.entries(n.shape).map(([d, f]) => `- ${d}: ${
|
|
3703
|
+
${Object.entries(n.shape).map(([d, f]) => `- ${d}: ${se(f)}`).join(`
|
|
3693
3704
|
`)}
|
|
3694
3705
|
}
|
|
3695
3706
|
`}
|
|
@@ -3709,7 +3720,7 @@ const rl = /* @__PURE__ */ gr(al), nl = async ({
|
|
|
3709
3720
|
systemPrompt: o,
|
|
3710
3721
|
userPrompt: e,
|
|
3711
3722
|
responseFormat: { type: "json_object" }
|
|
3712
|
-
}), { styleOptions: u = a } = l, c =
|
|
3723
|
+
}), { styleOptions: u = a } = l, c = nl(
|
|
3713
3724
|
a || {},
|
|
3714
3725
|
u || {}
|
|
3715
3726
|
);
|
|
@@ -3717,13 +3728,13 @@ const rl = /* @__PURE__ */ gr(al), nl = async ({
|
|
|
3717
3728
|
...t,
|
|
3718
3729
|
styleOptions: c
|
|
3719
3730
|
};
|
|
3720
|
-
},
|
|
3731
|
+
}, ol = async ({ chartId: e, userPrompt: t }, a) => {
|
|
3721
3732
|
var i, o;
|
|
3722
3733
|
console.debug("toolCall", "updateChartStyleOptions", e, t);
|
|
3723
3734
|
const r = (i = a.retrieveChart) == null ? void 0 : i.call(a, e);
|
|
3724
3735
|
if (!r)
|
|
3725
3736
|
throw new Error("Chart not found");
|
|
3726
|
-
const n = await
|
|
3737
|
+
const n = await il({
|
|
3727
3738
|
userPrompt: t,
|
|
3728
3739
|
chartWidgetProps: r
|
|
3729
3740
|
});
|
|
@@ -3745,7 +3756,7 @@ const rl = /* @__PURE__ */ gr(al), nl = async ({
|
|
|
3745
3756
|
{ ...i },
|
|
3746
3757
|
{ ...n, ...o }
|
|
3747
3758
|
)
|
|
3748
|
-
}),
|
|
3759
|
+
}), sl = (e) => [
|
|
3749
3760
|
X(
|
|
3750
3761
|
Mi,
|
|
3751
3762
|
"createChart",
|
|
@@ -3756,28 +3767,28 @@ IMPORTANT: Split the user prompt into two parts:
|
|
|
3756
3767
|
2. chartPrompt: Be as faithful to the original user prompt as possible and keep chart-specific instructions. Do not infer the chart type from the user prompt.
|
|
3757
3768
|
|
|
3758
3769
|
Use this tool for initial creation OR when adding/removing/swapping data fields (e.g. changing Revenue to Profit). This tool also handles data limits (Top 10, Bottom 5).`,
|
|
3759
|
-
|
|
3770
|
+
ss,
|
|
3760
3771
|
e
|
|
3761
3772
|
),
|
|
3762
3773
|
X(
|
|
3763
3774
|
Ti,
|
|
3764
3775
|
"updateChartTitle",
|
|
3765
3776
|
"Update the title of an existing chart",
|
|
3766
|
-
|
|
3777
|
+
us,
|
|
3767
3778
|
e
|
|
3768
3779
|
),
|
|
3769
3780
|
X(
|
|
3770
3781
|
Ei,
|
|
3771
3782
|
"updateChartType",
|
|
3772
3783
|
"Switch the chart type of an existing chart",
|
|
3773
|
-
|
|
3784
|
+
ms,
|
|
3774
3785
|
e
|
|
3775
3786
|
),
|
|
3776
3787
|
X(
|
|
3777
3788
|
ki,
|
|
3778
3789
|
"updateChartTypeOfMeasures",
|
|
3779
3790
|
"Update the chart type of specific measures within a mixed/combo chart (e.g., make one measure a Bar and another a Line).",
|
|
3780
|
-
|
|
3791
|
+
Bs,
|
|
3781
3792
|
e
|
|
3782
3793
|
),
|
|
3783
3794
|
X(
|
|
@@ -3786,14 +3797,14 @@ Use this tool for initial creation OR when adding/removing/swapping data fields
|
|
|
3786
3797
|
`Update the sorting order (Ascending/Descending) of an existing chart.
|
|
3787
3798
|
|
|
3788
3799
|
IMPORTANT: This tool ONLY handles the sorting order. It does NOT handle data limits or filtering (e.g., "Top 10", "Bottom 5"). Those constraints must be applied during chart creation or regeneration.`,
|
|
3789
|
-
|
|
3800
|
+
qs,
|
|
3790
3801
|
e
|
|
3791
3802
|
),
|
|
3792
3803
|
X(
|
|
3793
3804
|
$i,
|
|
3794
3805
|
"updateTrendAndForecast",
|
|
3795
3806
|
"Update the trend and forecast analysis of existing measures in an existing chart",
|
|
3796
|
-
|
|
3807
|
+
Us,
|
|
3797
3808
|
e
|
|
3798
3809
|
),
|
|
3799
3810
|
X(
|
|
@@ -3804,18 +3815,18 @@ Use this tool for initial creation OR when adding/removing/swapping data fields
|
|
|
3804
3815
|
For a measure, for example, you can update its color and show it on the right axis.
|
|
3805
3816
|
|
|
3806
3817
|
IMPORTANT: This tool cannot swap data columns (e.g. changing "Revenue" to "Profit"). Use createChart for that.`,
|
|
3807
|
-
|
|
3818
|
+
Zs,
|
|
3808
3819
|
e
|
|
3809
3820
|
),
|
|
3810
3821
|
X(
|
|
3811
|
-
|
|
3822
|
+
_i,
|
|
3812
3823
|
"updateChartStyleOptions",
|
|
3813
3824
|
"Update cosmetic styling options: legend position, axis titles (text), axis label formatting.",
|
|
3814
|
-
|
|
3825
|
+
ol,
|
|
3815
3826
|
e
|
|
3816
3827
|
)
|
|
3817
3828
|
];
|
|
3818
|
-
function
|
|
3829
|
+
function ll(e, t) {
|
|
3819
3830
|
return `You are an intelligent and proactive chart assistant.
|
|
3820
3831
|
Your role is to create and update a chart based on natural language requests by using the available tools.
|
|
3821
3832
|
|
|
@@ -3850,54 +3861,75 @@ If the prompt can be handled by a single tool, use that tool without splitting t
|
|
|
3850
3861
|
`;
|
|
3851
3862
|
}
|
|
3852
3863
|
async function wr(e, t) {
|
|
3864
|
+
var S;
|
|
3853
3865
|
const { dataSourceTitle: a, userPrompt: r } = e, n = "queryId" in e ? e.queryId : void 0;
|
|
3854
|
-
if (console.debug(
|
|
3866
|
+
if (console.debug(
|
|
3867
|
+
Eo,
|
|
3868
|
+
a,
|
|
3869
|
+
r,
|
|
3870
|
+
n
|
|
3871
|
+
), !r)
|
|
3855
3872
|
throw new Error(
|
|
3856
3873
|
"Error: Please ask the user to specify textual user input"
|
|
3857
3874
|
);
|
|
3858
3875
|
const i = t.toolCallId;
|
|
3859
|
-
let o = null, l = "",
|
|
3860
|
-
const
|
|
3876
|
+
let o = null, l = null, u = "", c = !1;
|
|
3877
|
+
const m = {
|
|
3861
3878
|
...t,
|
|
3862
3879
|
dataSourceTitle: a,
|
|
3863
3880
|
queryId: n,
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3881
|
+
naturalResponseEnabled: t.naturalResponseEnabled,
|
|
3882
|
+
onInternalQueryResult: (b) => {
|
|
3883
|
+
l = b;
|
|
3884
|
+
},
|
|
3885
|
+
retrieveChart: (b) => o || (b && t.retrieveChart ? t.retrieveChart(b) : null),
|
|
3886
|
+
saveChart: (b, F) => {
|
|
3887
|
+
var E;
|
|
3888
|
+
(E = t.saveChart) == null || E.call(t, i, F), o = F;
|
|
3868
3889
|
}
|
|
3869
|
-
},
|
|
3890
|
+
}, d = ll(
|
|
3870
3891
|
(t.chartSummaries ?? []).slice(-at),
|
|
3871
3892
|
(t.querySummaries ?? []).slice(-at)
|
|
3872
|
-
),
|
|
3873
|
-
systemPrompt:
|
|
3893
|
+
), f = sl(m), { combinedMessage: p, isError: g } = await sr({
|
|
3894
|
+
systemPrompt: d,
|
|
3874
3895
|
userPrompt: r,
|
|
3875
|
-
tools:
|
|
3896
|
+
tools: f,
|
|
3876
3897
|
openAIClient: t.openAIClient
|
|
3877
3898
|
});
|
|
3878
|
-
if (
|
|
3879
|
-
throw new Error(
|
|
3899
|
+
if (u = p, c = g, c)
|
|
3900
|
+
throw new Error(u);
|
|
3901
|
+
const h = l, y = t.naturalResponseEnabled && ((S = h == null ? void 0 : h.nlqResult) == null ? void 0 : S.dataset) != null ? h.nlqResult.dataset : void 0;
|
|
3880
3902
|
return {
|
|
3881
|
-
message:
|
|
3903
|
+
message: u,
|
|
3882
3904
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3883
3905
|
chartId: i,
|
|
3884
|
-
chart: o ? br(o, a) : void 0
|
|
3906
|
+
chart: o ? br(o, a) : void 0,
|
|
3907
|
+
...y !== void 0 && { dataset: y }
|
|
3885
3908
|
};
|
|
3886
3909
|
}
|
|
3887
|
-
const
|
|
3910
|
+
const Oc = s.object({
|
|
3888
3911
|
dataSourceTitle: s.string().describe("The title of the data source to query"),
|
|
3889
3912
|
queryPrompt: s.string().describe(
|
|
3890
3913
|
"The natural language query describing what data to retrieve"
|
|
3891
3914
|
)
|
|
3892
|
-
})
|
|
3915
|
+
});
|
|
3916
|
+
function Dc(e) {
|
|
3917
|
+
return {
|
|
3918
|
+
queryId: e.queryId,
|
|
3919
|
+
title: e.title,
|
|
3920
|
+
chartState: e.nlqResult.chartState,
|
|
3921
|
+
dataset: e.nlqResult.dataset
|
|
3922
|
+
};
|
|
3923
|
+
}
|
|
3924
|
+
const ul = "api/v2/datamodels";
|
|
3893
3925
|
async function vr(e, t) {
|
|
3894
|
-
const a = t ?? C(), r = `${
|
|
3926
|
+
const a = t ?? C(), r = `${ul}/schema?title=${encodeURIComponent(
|
|
3895
3927
|
e
|
|
3896
3928
|
)}`;
|
|
3897
3929
|
return await a.get(r) ?? null;
|
|
3898
3930
|
}
|
|
3899
3931
|
const Zt = "api/datasources";
|
|
3900
|
-
function
|
|
3932
|
+
function cl(e, t) {
|
|
3901
3933
|
const a = t.reduce(
|
|
3902
3934
|
(r, n) => (n.schema.tables.forEach((i) => {
|
|
3903
3935
|
r[i.name] = {}, i.columns.forEach((o) => {
|
|
@@ -3914,7 +3946,7 @@ function ul(e, t) {
|
|
|
3914
3946
|
};
|
|
3915
3947
|
});
|
|
3916
3948
|
}
|
|
3917
|
-
async function
|
|
3949
|
+
async function ml(e) {
|
|
3918
3950
|
const t = e ?? C(), a = `${Zt}/?sharedWith=r,w`;
|
|
3919
3951
|
return await t.get(a) || [];
|
|
3920
3952
|
}
|
|
@@ -3923,7 +3955,7 @@ async function Cr(e, t) {
|
|
|
3923
3955
|
`${Zt}/${encodeURIComponent(e)}`
|
|
3924
3956
|
) ?? null;
|
|
3925
3957
|
}
|
|
3926
|
-
async function
|
|
3958
|
+
async function dl(e, t) {
|
|
3927
3959
|
return (t ?? C()).post(
|
|
3928
3960
|
`${Zt}/${encodeURIComponent(
|
|
3929
3961
|
e
|
|
@@ -3936,14 +3968,14 @@ async function ml(e, t) {
|
|
|
3936
3968
|
}
|
|
3937
3969
|
async function Sr(e, t) {
|
|
3938
3970
|
var r;
|
|
3939
|
-
const a = await
|
|
3971
|
+
const a = await dl(e, t);
|
|
3940
3972
|
if (!a) return [];
|
|
3941
3973
|
try {
|
|
3942
3974
|
const n = await vr(
|
|
3943
3975
|
e,
|
|
3944
3976
|
t
|
|
3945
3977
|
);
|
|
3946
|
-
return n != null && n.datasets ?
|
|
3978
|
+
return n != null && n.datasets ? cl(
|
|
3947
3979
|
a,
|
|
3948
3980
|
n.datasets
|
|
3949
3981
|
) : a;
|
|
@@ -3958,7 +3990,7 @@ async function Sr(e, t) {
|
|
|
3958
3990
|
throw n;
|
|
3959
3991
|
}
|
|
3960
3992
|
}
|
|
3961
|
-
function
|
|
3993
|
+
function fl(e) {
|
|
3962
3994
|
const t = [];
|
|
3963
3995
|
return e.forEach((a) => {
|
|
3964
3996
|
const r = ua(a.column), n = {
|
|
@@ -3980,19 +4012,19 @@ function dl(e) {
|
|
|
3980
4012
|
});
|
|
3981
4013
|
}), t;
|
|
3982
4014
|
}
|
|
3983
|
-
async function
|
|
4015
|
+
async function pl(e, t, a) {
|
|
3984
4016
|
const n = await (t ?? Sr)(e, a);
|
|
3985
|
-
return
|
|
4017
|
+
return fl(n);
|
|
3986
4018
|
}
|
|
3987
|
-
async function
|
|
4019
|
+
async function Fc(e, t) {
|
|
3988
4020
|
console.debug(Po, t.toolCallId);
|
|
3989
|
-
const a = await
|
|
4021
|
+
const a = await ml(t.httpClient);
|
|
3990
4022
|
return {
|
|
3991
4023
|
dataSourceTitles: a.map((r) => r.title),
|
|
3992
4024
|
dataSources: a
|
|
3993
4025
|
};
|
|
3994
4026
|
}
|
|
3995
|
-
const
|
|
4027
|
+
const Mc = s.object({}), zt = Symbol.for("yaml.alias"), _t = Symbol.for("yaml.document"), ae = Symbol.for("yaml.map"), Ar = Symbol.for("yaml.pair"), dt = Symbol.for("yaml.scalar"), Te = Symbol.for("yaml.seq"), q = Symbol.for("yaml.node.type"), pe = (e) => !!e && typeof e == "object" && e[q] === zt, Ue = (e) => !!e && typeof e == "object" && e[q] === _t, Ze = (e) => !!e && typeof e == "object" && e[q] === ae, x = (e) => !!e && typeof e == "object" && e[q] === Ar, N = (e) => !!e && typeof e == "object" && e[q] === dt, ze = (e) => !!e && typeof e == "object" && e[q] === Te;
|
|
3996
4028
|
function P(e) {
|
|
3997
4029
|
if (e && typeof e == "object")
|
|
3998
4030
|
switch (e[q]) {
|
|
@@ -4002,7 +4034,7 @@ function P(e) {
|
|
|
4002
4034
|
}
|
|
4003
4035
|
return !1;
|
|
4004
4036
|
}
|
|
4005
|
-
function
|
|
4037
|
+
function _(e) {
|
|
4006
4038
|
if (e && typeof e == "object")
|
|
4007
4039
|
switch (e[q]) {
|
|
4008
4040
|
case zt:
|
|
@@ -4013,18 +4045,18 @@ function x(e) {
|
|
|
4013
4045
|
}
|
|
4014
4046
|
return !1;
|
|
4015
4047
|
}
|
|
4016
|
-
const Or = (e) => (N(e) || P(e)) && !!e.anchor,
|
|
4048
|
+
const Or = (e) => (N(e) || P(e)) && !!e.anchor, oe = Symbol("break visit"), hl = Symbol("skip children"), xe = Symbol("remove node");
|
|
4017
4049
|
function Ee(e, t) {
|
|
4018
|
-
const a =
|
|
4019
|
-
Ue(e) ? be(null, e.contents, a, Object.freeze([e])) ===
|
|
4050
|
+
const a = gl(t);
|
|
4051
|
+
Ue(e) ? be(null, e.contents, a, Object.freeze([e])) === xe && (e.contents = null) : be(null, e, a, Object.freeze([]));
|
|
4020
4052
|
}
|
|
4021
|
-
Ee.BREAK =
|
|
4022
|
-
Ee.SKIP =
|
|
4023
|
-
Ee.REMOVE =
|
|
4053
|
+
Ee.BREAK = oe;
|
|
4054
|
+
Ee.SKIP = hl;
|
|
4055
|
+
Ee.REMOVE = xe;
|
|
4024
4056
|
function be(e, t, a, r) {
|
|
4025
|
-
const n =
|
|
4026
|
-
if (
|
|
4027
|
-
return
|
|
4057
|
+
const n = yl(e, t, a, r);
|
|
4058
|
+
if (_(n) || x(n))
|
|
4059
|
+
return bl(e, r, n), be(e, n, a, r);
|
|
4028
4060
|
if (typeof n != "symbol") {
|
|
4029
4061
|
if (P(t)) {
|
|
4030
4062
|
r = Object.freeze(r.concat(t));
|
|
@@ -4033,26 +4065,26 @@ function be(e, t, a, r) {
|
|
|
4033
4065
|
if (typeof o == "number")
|
|
4034
4066
|
i = o - 1;
|
|
4035
4067
|
else {
|
|
4036
|
-
if (o ===
|
|
4037
|
-
return
|
|
4038
|
-
o ===
|
|
4068
|
+
if (o === oe)
|
|
4069
|
+
return oe;
|
|
4070
|
+
o === xe && (t.items.splice(i, 1), i -= 1);
|
|
4039
4071
|
}
|
|
4040
4072
|
}
|
|
4041
|
-
} else if (
|
|
4073
|
+
} else if (x(t)) {
|
|
4042
4074
|
r = Object.freeze(r.concat(t));
|
|
4043
4075
|
const i = be("key", t.key, a, r);
|
|
4044
|
-
if (i ===
|
|
4045
|
-
return
|
|
4046
|
-
i ===
|
|
4076
|
+
if (i === oe)
|
|
4077
|
+
return oe;
|
|
4078
|
+
i === xe && (t.key = null);
|
|
4047
4079
|
const o = be("value", t.value, a, r);
|
|
4048
|
-
if (o ===
|
|
4049
|
-
return
|
|
4050
|
-
o ===
|
|
4080
|
+
if (o === oe)
|
|
4081
|
+
return oe;
|
|
4082
|
+
o === xe && (t.value = null);
|
|
4051
4083
|
}
|
|
4052
4084
|
}
|
|
4053
4085
|
return n;
|
|
4054
4086
|
}
|
|
4055
|
-
function
|
|
4087
|
+
function gl(e) {
|
|
4056
4088
|
return typeof e == "object" && (e.Collection || e.Node || e.Value) ? Object.assign({
|
|
4057
4089
|
Alias: e.Node,
|
|
4058
4090
|
Map: e.Node,
|
|
@@ -4067,7 +4099,7 @@ function hl(e) {
|
|
|
4067
4099
|
Seq: e.Collection
|
|
4068
4100
|
}, e) : e;
|
|
4069
4101
|
}
|
|
4070
|
-
function
|
|
4102
|
+
function yl(e, t, a, r) {
|
|
4071
4103
|
var n, i, o, l, u;
|
|
4072
4104
|
if (typeof a == "function")
|
|
4073
4105
|
return a(e, t, r);
|
|
@@ -4075,18 +4107,18 @@ function gl(e, t, a, r) {
|
|
|
4075
4107
|
return (n = a.Map) == null ? void 0 : n.call(a, e, t, r);
|
|
4076
4108
|
if (ze(t))
|
|
4077
4109
|
return (i = a.Seq) == null ? void 0 : i.call(a, e, t, r);
|
|
4078
|
-
if (
|
|
4110
|
+
if (x(t))
|
|
4079
4111
|
return (o = a.Pair) == null ? void 0 : o.call(a, e, t, r);
|
|
4080
4112
|
if (N(t))
|
|
4081
4113
|
return (l = a.Scalar) == null ? void 0 : l.call(a, e, t, r);
|
|
4082
4114
|
if (pe(t))
|
|
4083
4115
|
return (u = a.Alias) == null ? void 0 : u.call(a, e, t, r);
|
|
4084
4116
|
}
|
|
4085
|
-
function
|
|
4117
|
+
function bl(e, t, a) {
|
|
4086
4118
|
const r = t[t.length - 1];
|
|
4087
4119
|
if (P(r))
|
|
4088
4120
|
r.items[e] = a;
|
|
4089
|
-
else if (
|
|
4121
|
+
else if (x(r))
|
|
4090
4122
|
e === "key" ? r.key = a : r.value = a;
|
|
4091
4123
|
else if (Ue(r))
|
|
4092
4124
|
r.contents = a;
|
|
@@ -4095,14 +4127,14 @@ function yl(e, t, a) {
|
|
|
4095
4127
|
throw new Error(`Cannot replace node with ${n} parent`);
|
|
4096
4128
|
}
|
|
4097
4129
|
}
|
|
4098
|
-
const
|
|
4130
|
+
const wl = {
|
|
4099
4131
|
"!": "%21",
|
|
4100
4132
|
",": "%2C",
|
|
4101
4133
|
"[": "%5B",
|
|
4102
4134
|
"]": "%5D",
|
|
4103
4135
|
"{": "%7B",
|
|
4104
4136
|
"}": "%7D"
|
|
4105
|
-
},
|
|
4137
|
+
}, vl = (e) => e.replace(/[!,[\]{}]/g, (t) => wl[t]);
|
|
4106
4138
|
class j {
|
|
4107
4139
|
constructor(t, a) {
|
|
4108
4140
|
this.docStart = null, this.docEnd = !1, this.yaml = Object.assign({}, j.defaultYaml, t), this.tags = Object.assign({}, j.defaultTags, a);
|
|
@@ -4192,16 +4224,16 @@ class j {
|
|
|
4192
4224
|
tagString(t) {
|
|
4193
4225
|
for (const [a, r] of Object.entries(this.tags))
|
|
4194
4226
|
if (t.startsWith(r))
|
|
4195
|
-
return a +
|
|
4227
|
+
return a + vl(t.substring(r.length));
|
|
4196
4228
|
return t[0] === "!" ? t : `!<${t}>`;
|
|
4197
4229
|
}
|
|
4198
4230
|
toString(t) {
|
|
4199
4231
|
const a = this.yaml.explicit ? [`%YAML ${this.yaml.version || "1.2"}`] : [], r = Object.entries(this.tags);
|
|
4200
4232
|
let n;
|
|
4201
|
-
if (t && r.length > 0 &&
|
|
4233
|
+
if (t && r.length > 0 && _(t.contents)) {
|
|
4202
4234
|
const i = {};
|
|
4203
4235
|
Ee(t.contents, (o, l) => {
|
|
4204
|
-
|
|
4236
|
+
_(l) && l.tag && (i[l.tag] = !0);
|
|
4205
4237
|
}), n = Object.keys(i);
|
|
4206
4238
|
} else
|
|
4207
4239
|
n = [];
|
|
@@ -4235,7 +4267,7 @@ function Mr(e, t) {
|
|
|
4235
4267
|
return r;
|
|
4236
4268
|
}
|
|
4237
4269
|
}
|
|
4238
|
-
function
|
|
4270
|
+
function Cl(e, t) {
|
|
4239
4271
|
const a = [], r = /* @__PURE__ */ new Map();
|
|
4240
4272
|
let n = null;
|
|
4241
4273
|
return {
|
|
@@ -4287,9 +4319,9 @@ function we(e, t, a, r) {
|
|
|
4287
4319
|
}
|
|
4288
4320
|
return e.call(t, a, r);
|
|
4289
4321
|
}
|
|
4290
|
-
function
|
|
4322
|
+
function L(e, t, a) {
|
|
4291
4323
|
if (Array.isArray(e))
|
|
4292
|
-
return e.map((r, n) =>
|
|
4324
|
+
return e.map((r, n) => L(r, String(n), a));
|
|
4293
4325
|
if (e && typeof e.toJSON == "function") {
|
|
4294
4326
|
if (!a || !Or(e))
|
|
4295
4327
|
return e.toJSON(t, a);
|
|
@@ -4322,7 +4354,7 @@ class Wt {
|
|
|
4322
4354
|
mapAsMap: a === !0,
|
|
4323
4355
|
mapKeyWarned: !1,
|
|
4324
4356
|
maxAliasCount: typeof r == "number" ? r : 100
|
|
4325
|
-
}, l =
|
|
4357
|
+
}, l = L(this, "", o);
|
|
4326
4358
|
if (typeof n == "function")
|
|
4327
4359
|
for (const { count: u, res: c } of o.anchors.values())
|
|
4328
4360
|
n(c, u);
|
|
@@ -4365,7 +4397,7 @@ class Tr extends Wt {
|
|
|
4365
4397
|
throw new ReferenceError(u);
|
|
4366
4398
|
}
|
|
4367
4399
|
let l = r.get(o);
|
|
4368
|
-
if (l || (
|
|
4400
|
+
if (l || (L(o, null, a), l = r.get(o)), (l == null ? void 0 : l.res) === void 0) {
|
|
4369
4401
|
const u = "This should not happen: Alias anchor was not resolved?";
|
|
4370
4402
|
throw new ReferenceError(u);
|
|
4371
4403
|
}
|
|
@@ -4399,7 +4431,7 @@ function Qe(e, t, a) {
|
|
|
4399
4431
|
i > r && (r = i);
|
|
4400
4432
|
}
|
|
4401
4433
|
return r;
|
|
4402
|
-
} else if (
|
|
4434
|
+
} else if (x(t)) {
|
|
4403
4435
|
const r = Qe(e, t.key, a), n = Qe(e, t.value, a);
|
|
4404
4436
|
return Math.max(r, n);
|
|
4405
4437
|
}
|
|
@@ -4411,7 +4443,7 @@ class A extends Wt {
|
|
|
4411
4443
|
super(dt), this.value = t;
|
|
4412
4444
|
}
|
|
4413
4445
|
toJSON(t, a) {
|
|
4414
|
-
return a != null && a.keep ? this.value :
|
|
4446
|
+
return a != null && a.keep ? this.value : L(this.value, t, a);
|
|
4415
4447
|
}
|
|
4416
4448
|
toString() {
|
|
4417
4449
|
return String(this.value);
|
|
@@ -4422,8 +4454,8 @@ A.BLOCK_LITERAL = "BLOCK_LITERAL";
|
|
|
4422
4454
|
A.PLAIN = "PLAIN";
|
|
4423
4455
|
A.QUOTE_DOUBLE = "QUOTE_DOUBLE";
|
|
4424
4456
|
A.QUOTE_SINGLE = "QUOTE_SINGLE";
|
|
4425
|
-
const
|
|
4426
|
-
function
|
|
4457
|
+
const Sl = "tag:yaml.org,2002:";
|
|
4458
|
+
function Al(e, t, a) {
|
|
4427
4459
|
if (t) {
|
|
4428
4460
|
const r = a.filter((i) => i.tag === t), n = r.find((i) => !i.format) ?? r[0];
|
|
4429
4461
|
if (!n)
|
|
@@ -4435,11 +4467,11 @@ function Sl(e, t, a) {
|
|
|
4435
4467
|
return ((n = r.identify) == null ? void 0 : n.call(r, e)) && !r.format;
|
|
4436
4468
|
});
|
|
4437
4469
|
}
|
|
4438
|
-
function
|
|
4470
|
+
function Le(e, t, a) {
|
|
4439
4471
|
var d, f, p;
|
|
4440
|
-
if (Ue(e) && (e = e.contents),
|
|
4472
|
+
if (Ue(e) && (e = e.contents), _(e))
|
|
4441
4473
|
return e;
|
|
4442
|
-
if (
|
|
4474
|
+
if (x(e)) {
|
|
4443
4475
|
const g = (f = (d = a.schema[ae]).createNode) == null ? void 0 : f.call(d, a.schema, null, a);
|
|
4444
4476
|
return g.items.push(e), g;
|
|
4445
4477
|
}
|
|
@@ -4451,8 +4483,8 @@ function Re(e, t, a) {
|
|
|
4451
4483
|
return u.anchor ?? (u.anchor = n(e)), new Tr(u.anchor);
|
|
4452
4484
|
u = { anchor: null, node: null }, l.set(e, u);
|
|
4453
4485
|
}
|
|
4454
|
-
t != null && t.startsWith("!!") && (t =
|
|
4455
|
-
let c =
|
|
4486
|
+
t != null && t.startsWith("!!") && (t = Sl + t.slice(2));
|
|
4487
|
+
let c = Al(e, t, o.tags);
|
|
4456
4488
|
if (!c) {
|
|
4457
4489
|
if (e && typeof e.toJSON == "function" && (e = e.toJSON()), !e || typeof e != "object") {
|
|
4458
4490
|
const g = new A(e);
|
|
@@ -4474,7 +4506,7 @@ function rt(e, t, a) {
|
|
|
4474
4506
|
} else
|
|
4475
4507
|
r = /* @__PURE__ */ new Map([[i, r]]);
|
|
4476
4508
|
}
|
|
4477
|
-
return
|
|
4509
|
+
return Le(r, void 0, {
|
|
4478
4510
|
aliasDuplicateObjects: !1,
|
|
4479
4511
|
keepUndefined: !1,
|
|
4480
4512
|
onAnchor: () => {
|
|
@@ -4484,7 +4516,7 @@ function rt(e, t, a) {
|
|
|
4484
4516
|
sourceObjects: /* @__PURE__ */ new Map()
|
|
4485
4517
|
});
|
|
4486
4518
|
}
|
|
4487
|
-
const
|
|
4519
|
+
const _e = (e) => e == null || typeof e == "object" && !!e[Symbol.iterator]().next().done;
|
|
4488
4520
|
class kr extends Wt {
|
|
4489
4521
|
constructor(t, a) {
|
|
4490
4522
|
super(t), Object.defineProperty(this, "schema", {
|
|
@@ -4501,7 +4533,7 @@ class kr extends Wt {
|
|
|
4501
4533
|
*/
|
|
4502
4534
|
clone(t) {
|
|
4503
4535
|
const a = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
|
|
4504
|
-
return t && (a.schema = t), a.items = a.items.map((r) =>
|
|
4536
|
+
return t && (a.schema = t), a.items = a.items.map((r) => _(r) || x(r) ? r.clone(t) : r), this.range && (a.range = this.range.slice()), a;
|
|
4505
4537
|
}
|
|
4506
4538
|
/**
|
|
4507
4539
|
* Adds a value to the collection. For `!!map` and `!!omap` the value must
|
|
@@ -4509,7 +4541,7 @@ class kr extends Wt {
|
|
|
4509
4541
|
* that already exists in the map.
|
|
4510
4542
|
*/
|
|
4511
4543
|
addIn(t, a) {
|
|
4512
|
-
if (
|
|
4544
|
+
if (_e(t))
|
|
4513
4545
|
this.add(a);
|
|
4514
4546
|
else {
|
|
4515
4547
|
const [r, ...n] = t, i = this.get(r, !0);
|
|
@@ -4545,7 +4577,7 @@ class kr extends Wt {
|
|
|
4545
4577
|
}
|
|
4546
4578
|
hasAllNullValues(t) {
|
|
4547
4579
|
return this.items.every((a) => {
|
|
4548
|
-
if (!
|
|
4580
|
+
if (!x(a))
|
|
4549
4581
|
return !1;
|
|
4550
4582
|
const r = a.value;
|
|
4551
4583
|
return r == null || t && N(r) && r.value == null && !r.commentBefore && !r.comment && !r.tag;
|
|
@@ -4580,14 +4612,14 @@ class kr extends Wt {
|
|
|
4580
4612
|
}
|
|
4581
4613
|
}
|
|
4582
4614
|
}
|
|
4583
|
-
const
|
|
4615
|
+
const Ol = (e) => e.replace(/^(?!$)(?: $)?/gm, "#");
|
|
4584
4616
|
function G(e, t) {
|
|
4585
4617
|
return /^\n+$/.test(e) ? e.substring(1) : t ? e.replace(/^(?! *$)/gm, t) : e;
|
|
4586
4618
|
}
|
|
4587
|
-
const
|
|
4619
|
+
const le = (e, t, a) => e.endsWith(`
|
|
4588
4620
|
`) ? G(a, t) : a.includes(`
|
|
4589
4621
|
`) ? `
|
|
4590
|
-
` + G(a, t) : (e.endsWith(" ") ? "" : " ") + a, Nr = "flow",
|
|
4622
|
+
` + G(a, t) : (e.endsWith(" ") ? "" : " ") + a, Nr = "flow", xt = "block", Ge = "quoted";
|
|
4591
4623
|
function ft(e, t, a = "flow", { indentAtStart: r, lineWidth: n = 80, minContentWidth: i = 20, onFold: o, onOverflow: l } = {}) {
|
|
4592
4624
|
if (!n || n < 0)
|
|
4593
4625
|
return e;
|
|
@@ -4599,9 +4631,9 @@ function ft(e, t, a = "flow", { indentAtStart: r, lineWidth: n = 80, minContentW
|
|
|
4599
4631
|
let d = n - t.length;
|
|
4600
4632
|
typeof r == "number" && (r > n - Math.max(2, i) ? c.push(0) : d = n - r);
|
|
4601
4633
|
let f, p, g = !1, h = -1, y = -1, S = -1;
|
|
4602
|
-
a ===
|
|
4603
|
-
for (let
|
|
4604
|
-
if (a === Ge &&
|
|
4634
|
+
a === xt && (h = Ca(e, h, t.length), h !== -1 && (d = h + u));
|
|
4635
|
+
for (let F; F = e[h += 1]; ) {
|
|
4636
|
+
if (a === Ge && F === "\\") {
|
|
4605
4637
|
switch (y = h, e[h + 1]) {
|
|
4606
4638
|
case "x":
|
|
4607
4639
|
h += 3;
|
|
@@ -4617,11 +4649,11 @@ function ft(e, t, a = "flow", { indentAtStart: r, lineWidth: n = 80, minContentW
|
|
|
4617
4649
|
}
|
|
4618
4650
|
S = h;
|
|
4619
4651
|
}
|
|
4620
|
-
if (
|
|
4652
|
+
if (F === `
|
|
4621
4653
|
`)
|
|
4622
|
-
a ===
|
|
4654
|
+
a === xt && (h = Ca(e, h, t.length)), d = h + t.length + u, f = void 0;
|
|
4623
4655
|
else {
|
|
4624
|
-
if (
|
|
4656
|
+
if (F === " " && p && p !== " " && p !== `
|
|
4625
4657
|
` && p !== " ") {
|
|
4626
4658
|
const E = e[h + 1];
|
|
4627
4659
|
E && E !== " " && E !== `
|
|
@@ -4632,7 +4664,7 @@ function ft(e, t, a = "flow", { indentAtStart: r, lineWidth: n = 80, minContentW
|
|
|
4632
4664
|
c.push(f), d = f + u, f = void 0;
|
|
4633
4665
|
else if (a === Ge) {
|
|
4634
4666
|
for (; p === " " || p === " "; )
|
|
4635
|
-
p =
|
|
4667
|
+
p = F, F = e[h += 1], g = !0;
|
|
4636
4668
|
const E = h > S + 1 ? h - 2 : y - 1;
|
|
4637
4669
|
if (m[E])
|
|
4638
4670
|
return e;
|
|
@@ -4640,19 +4672,19 @@ function ft(e, t, a = "flow", { indentAtStart: r, lineWidth: n = 80, minContentW
|
|
|
4640
4672
|
} else
|
|
4641
4673
|
g = !0;
|
|
4642
4674
|
}
|
|
4643
|
-
p =
|
|
4675
|
+
p = F;
|
|
4644
4676
|
}
|
|
4645
4677
|
if (g && l && l(), c.length === 0)
|
|
4646
4678
|
return e;
|
|
4647
4679
|
o && o();
|
|
4648
|
-
let
|
|
4649
|
-
for (let
|
|
4650
|
-
const E = c[
|
|
4651
|
-
E === 0 ?
|
|
4652
|
-
${t}${e.slice(0, $)}` : (a === Ge && m[E] && (
|
|
4680
|
+
let b = e.slice(0, c[0]);
|
|
4681
|
+
for (let F = 0; F < c.length; ++F) {
|
|
4682
|
+
const E = c[F], $ = c[F + 1] || e.length;
|
|
4683
|
+
E === 0 ? b = `
|
|
4684
|
+
${t}${e.slice(0, $)}` : (a === Ge && m[E] && (b += `${e[E]}\\`), b += `
|
|
4653
4685
|
${t}${e.slice(E + 1, $)}`);
|
|
4654
4686
|
}
|
|
4655
|
-
return
|
|
4687
|
+
return b;
|
|
4656
4688
|
}
|
|
4657
4689
|
function Ca(e, t, a) {
|
|
4658
4690
|
let r = t, n = t + 1, i = e[n];
|
|
@@ -4673,7 +4705,7 @@ const pt = (e, t) => ({
|
|
|
4673
4705
|
lineWidth: e.options.lineWidth,
|
|
4674
4706
|
minContentWidth: e.options.minContentWidth
|
|
4675
4707
|
}), ht = (e) => /^(%|---|\.\.\.)/m.test(e);
|
|
4676
|
-
function
|
|
4708
|
+
function Dl(e, t, a) {
|
|
4677
4709
|
if (!t || t < 0)
|
|
4678
4710
|
return !1;
|
|
4679
4711
|
const r = t - a, n = e.length;
|
|
@@ -4782,7 +4814,7 @@ function Ke({ comment: e, type: t, value: a }, r, n, i) {
|
|
|
4782
4814
|
const { blockQuote: o, commentString: l, lineWidth: u } = r.options;
|
|
4783
4815
|
if (!o || /\n[\t ]+$/.test(a))
|
|
4784
4816
|
return ve(a, r);
|
|
4785
|
-
const c = r.indent || (r.forceBlockIndent || ht(a) ? " " : ""), m = o === "literal" ? !0 : o === "folded" || t === A.BLOCK_FOLDED ? !1 : t === A.BLOCK_LITERAL ? !0 : !
|
|
4817
|
+
const c = r.indent || (r.forceBlockIndent || ht(a) ? " " : ""), m = o === "literal" ? !0 : o === "folded" || t === A.BLOCK_FOLDED ? !1 : t === A.BLOCK_LITERAL ? !0 : !Dl(a, u, c.length);
|
|
4786
4818
|
if (!a)
|
|
4787
4819
|
return m ? `|
|
|
4788
4820
|
` : `>
|
|
@@ -4810,8 +4842,8 @@ function Ke({ comment: e, type: t, value: a }, r, n, i) {
|
|
|
4810
4842
|
else
|
|
4811
4843
|
break;
|
|
4812
4844
|
}
|
|
4813
|
-
let
|
|
4814
|
-
|
|
4845
|
+
let b = a.substring(0, S < y ? S + 1 : y);
|
|
4846
|
+
b && (a = a.substring(b.length), b = b.replace(/\n+/g, `$&${c}`));
|
|
4815
4847
|
let E = (h ? c ? "2" : "1" : "") + d;
|
|
4816
4848
|
if (e && (E += " " + l(e.replace(/ ?[\r\n]+/g, " ")), n && n()), !m) {
|
|
4817
4849
|
const $ = a.replace(/\n+/g, `
|
|
@@ -4821,15 +4853,15 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/
|
|
|
4821
4853
|
o !== "folded" && t !== A.BLOCK_FOLDED && (Q.onOverflow = () => {
|
|
4822
4854
|
U = !0;
|
|
4823
4855
|
});
|
|
4824
|
-
const $e = ft(`${
|
|
4856
|
+
const $e = ft(`${b}${$}${p}`, c, xt, Q);
|
|
4825
4857
|
if (!U)
|
|
4826
4858
|
return `>${E}
|
|
4827
4859
|
${c}${$e}`;
|
|
4828
4860
|
}
|
|
4829
4861
|
return a = a.replace(/\n+/g, `$&${c}`), `|${E}
|
|
4830
|
-
${c}${
|
|
4862
|
+
${c}${b}${a}${p}`;
|
|
4831
4863
|
}
|
|
4832
|
-
function
|
|
4864
|
+
function Fl(e, t, a, r) {
|
|
4833
4865
|
const { type: n, value: i } = e, { actualString: o, implicitKey: l, indent: u, indentStep: c, inFlow: m } = t;
|
|
4834
4866
|
if (l && i.includes(`
|
|
4835
4867
|
`) || m && /[[\]{},]/.test(i))
|
|
@@ -4872,7 +4904,7 @@ function Vt(e, t, a, r) {
|
|
|
4872
4904
|
case A.QUOTE_SINGLE:
|
|
4873
4905
|
return It(o.value, t);
|
|
4874
4906
|
case A.PLAIN:
|
|
4875
|
-
return
|
|
4907
|
+
return Fl(o, t, a, r);
|
|
4876
4908
|
default:
|
|
4877
4909
|
return null;
|
|
4878
4910
|
}
|
|
@@ -4888,7 +4920,7 @@ function Vt(e, t, a, r) {
|
|
|
4888
4920
|
function $r(e, t) {
|
|
4889
4921
|
const a = Object.assign({
|
|
4890
4922
|
blockQuote: !0,
|
|
4891
|
-
commentString:
|
|
4923
|
+
commentString: Ol,
|
|
4892
4924
|
defaultKeyType: null,
|
|
4893
4925
|
defaultStringType: "PLAIN",
|
|
4894
4926
|
directives: null,
|
|
@@ -4926,7 +4958,7 @@ function $r(e, t) {
|
|
|
4926
4958
|
options: a
|
|
4927
4959
|
};
|
|
4928
4960
|
}
|
|
4929
|
-
function
|
|
4961
|
+
function Ml(e, t) {
|
|
4930
4962
|
var n;
|
|
4931
4963
|
if (t.tag) {
|
|
4932
4964
|
const i = e.filter((o) => o.tag === t.tag);
|
|
@@ -4953,7 +4985,7 @@ function Fl(e, t) {
|
|
|
4953
4985
|
}
|
|
4954
4986
|
return a;
|
|
4955
4987
|
}
|
|
4956
|
-
function
|
|
4988
|
+
function Tl(e, t, { anchors: a, doc: r }) {
|
|
4957
4989
|
if (!r.directives)
|
|
4958
4990
|
return "";
|
|
4959
4991
|
const n = [], i = (N(e) || P(e)) && e.anchor;
|
|
@@ -4963,7 +4995,7 @@ function Ml(e, t, { anchors: a, doc: r }) {
|
|
|
4963
4995
|
}
|
|
4964
4996
|
function Oe(e, t, a, r) {
|
|
4965
4997
|
var u;
|
|
4966
|
-
if (
|
|
4998
|
+
if (x(e))
|
|
4967
4999
|
return e.toString(t, a, r);
|
|
4968
5000
|
if (pe(e)) {
|
|
4969
5001
|
if (t.doc.directives)
|
|
@@ -4973,21 +5005,21 @@ function Oe(e, t, a, r) {
|
|
|
4973
5005
|
t.resolvedAliases ? t.resolvedAliases.add(e) : t.resolvedAliases = /* @__PURE__ */ new Set([e]), e = e.resolve(t.doc);
|
|
4974
5006
|
}
|
|
4975
5007
|
let n;
|
|
4976
|
-
const i =
|
|
4977
|
-
n ?? (n =
|
|
4978
|
-
const o =
|
|
5008
|
+
const i = _(e) ? e : t.doc.createNode(e, { onTagObj: (c) => n = c });
|
|
5009
|
+
n ?? (n = Ml(t.doc.schema.tags, i));
|
|
5010
|
+
const o = Tl(i, n, t);
|
|
4979
5011
|
o.length > 0 && (t.indentAtStart = (t.indentAtStart ?? 0) + o.length + 1);
|
|
4980
5012
|
const l = typeof n.stringify == "function" ? n.stringify(i, t, a, r) : N(i) ? Vt(i, t, a, r) : i.toString(t, a, r);
|
|
4981
5013
|
return o ? N(i) || l[0] === "{" || l[0] === "[" ? `${o} ${l}` : `${o}
|
|
4982
5014
|
${t.indent}${l}` : l;
|
|
4983
5015
|
}
|
|
4984
|
-
function
|
|
5016
|
+
function El({ key: e, value: t }, a, r, n) {
|
|
4985
5017
|
const { allNullValues: i, doc: o, indent: l, indentStep: u, options: { commentString: c, indentSeq: m, simpleKeys: d } } = a;
|
|
4986
|
-
let f =
|
|
5018
|
+
let f = _(e) && e.comment || null;
|
|
4987
5019
|
if (d) {
|
|
4988
5020
|
if (f)
|
|
4989
5021
|
throw new Error("With simple keys, key nodes cannot have comments");
|
|
4990
|
-
if (P(e) || !
|
|
5022
|
+
if (P(e) || !_(e) && typeof e == "object") {
|
|
4991
5023
|
const Q = "With simple keys, collection cannot be used as a key value";
|
|
4992
5024
|
throw new Error(Q);
|
|
4993
5025
|
}
|
|
@@ -5008,23 +5040,23 @@ function Tl({ key: e, value: t }, a, r, n) {
|
|
|
5008
5040
|
if (i || t == null)
|
|
5009
5041
|
return g && r && r(), y === "" ? "?" : p ? `? ${y}` : y;
|
|
5010
5042
|
} else if (i && !d || t == null && p)
|
|
5011
|
-
return y = `? ${y}`, f && !g ? y +=
|
|
5012
|
-
g && (f = null), p ? (f && (y +=
|
|
5013
|
-
${l}:`) : (y = `${y}:`, f && (y +=
|
|
5014
|
-
let S,
|
|
5015
|
-
|
|
5043
|
+
return y = `? ${y}`, f && !g ? y += le(y, a.indent, c(f)) : h && n && n(), y;
|
|
5044
|
+
g && (f = null), p ? (f && (y += le(y, a.indent, c(f))), y = `? ${y}
|
|
5045
|
+
${l}:`) : (y = `${y}:`, f && (y += le(y, a.indent, c(f))));
|
|
5046
|
+
let S, b, F;
|
|
5047
|
+
_(t) ? (S = !!t.spaceBefore, b = t.commentBefore, F = t.comment) : (S = !1, b = null, F = null, t && typeof t == "object" && (t = o.createNode(t))), a.implicitKey = !1, !p && !f && N(t) && (a.indentAtStart = y.length + 1), h = !1, !m && u.length >= 2 && !a.inFlow && !p && ze(t) && !t.flow && !t.tag && !t.anchor && (a.indent = a.indent.substring(2));
|
|
5016
5048
|
let E = !1;
|
|
5017
5049
|
const $ = Oe(t, a, () => E = !0, () => h = !0);
|
|
5018
5050
|
let U = " ";
|
|
5019
|
-
if (f || S ||
|
|
5051
|
+
if (f || S || b) {
|
|
5020
5052
|
if (U = S ? `
|
|
5021
|
-
` : "",
|
|
5022
|
-
const Q = c(
|
|
5053
|
+
` : "", b) {
|
|
5054
|
+
const Q = c(b);
|
|
5023
5055
|
U += `
|
|
5024
5056
|
${G(Q, a.indent)}`;
|
|
5025
5057
|
}
|
|
5026
5058
|
$ === "" && !a.inFlow ? U === `
|
|
5027
|
-
` &&
|
|
5059
|
+
` && F && (U = `
|
|
5028
5060
|
|
|
5029
5061
|
`) : U += `
|
|
5030
5062
|
${a.indent}`;
|
|
@@ -5034,17 +5066,17 @@ ${a.indent}`;
|
|
|
5034
5066
|
if (oa || !on) {
|
|
5035
5067
|
let sa = !1;
|
|
5036
5068
|
if (oa && (Q === "&" || Q === "!")) {
|
|
5037
|
-
let
|
|
5038
|
-
Q === "&" &&
|
|
5069
|
+
let re = $.indexOf(" ");
|
|
5070
|
+
Q === "&" && re !== -1 && re < $e && $[re + 1] === "!" && (re = $.indexOf(" ", re + 1)), (re === -1 || $e < re) && (sa = !0);
|
|
5039
5071
|
}
|
|
5040
5072
|
sa || (U = `
|
|
5041
5073
|
${a.indent}`);
|
|
5042
5074
|
}
|
|
5043
5075
|
} else ($ === "" || $[0] === `
|
|
5044
5076
|
`) && (U = "");
|
|
5045
|
-
return y += U + $, a.inFlow ? E && r && r() :
|
|
5077
|
+
return y += U + $, a.inFlow ? E && r && r() : F && !E ? y += le(y, a.indent, c(F)) : h && n && n(), y;
|
|
5046
5078
|
}
|
|
5047
|
-
function
|
|
5079
|
+
function kl(e, t) {
|
|
5048
5080
|
(e === "debug" || e === "warn") && console.warn(t);
|
|
5049
5081
|
}
|
|
5050
5082
|
const Ve = "<<", K = {
|
|
@@ -5056,7 +5088,7 @@ const Ve = "<<", K = {
|
|
|
5056
5088
|
addToJSMap: Pr
|
|
5057
5089
|
}),
|
|
5058
5090
|
stringify: () => Ve
|
|
5059
|
-
},
|
|
5091
|
+
}, Nl = (e, t) => (K.identify(t) || N(t) && (!t.type || t.type === A.PLAIN) && K.identify(t.value)) && (e == null ? void 0 : e.doc.schema.tags.some((a) => a.tag === K.tag && a.default));
|
|
5060
5092
|
function Pr(e, t, a) {
|
|
5061
5093
|
if (a = e && pe(a) ? a.resolve(e.doc) : a, ze(a))
|
|
5062
5094
|
for (const r of a.items)
|
|
@@ -5081,19 +5113,19 @@ function Ft(e, t, a) {
|
|
|
5081
5113
|
});
|
|
5082
5114
|
return t;
|
|
5083
5115
|
}
|
|
5084
|
-
function
|
|
5085
|
-
if (
|
|
5116
|
+
function _r(e, t, { key: a, value: r }) {
|
|
5117
|
+
if (_(a) && a.addToJSMap)
|
|
5086
5118
|
a.addToJSMap(e, t, r);
|
|
5087
|
-
else if (
|
|
5119
|
+
else if (Nl(e, a))
|
|
5088
5120
|
Pr(e, t, r);
|
|
5089
5121
|
else {
|
|
5090
|
-
const n =
|
|
5122
|
+
const n = L(a, "", e);
|
|
5091
5123
|
if (t instanceof Map)
|
|
5092
|
-
t.set(n,
|
|
5124
|
+
t.set(n, L(r, n, e));
|
|
5093
5125
|
else if (t instanceof Set)
|
|
5094
5126
|
t.add(n);
|
|
5095
5127
|
else {
|
|
5096
|
-
const i =
|
|
5128
|
+
const i = $l(a, n, e), o = L(r, i, e);
|
|
5097
5129
|
i in t ? Object.defineProperty(t, i, {
|
|
5098
5130
|
value: o,
|
|
5099
5131
|
writable: !0,
|
|
@@ -5104,12 +5136,12 @@ function xr(e, t, { key: a, value: r }) {
|
|
|
5104
5136
|
}
|
|
5105
5137
|
return t;
|
|
5106
5138
|
}
|
|
5107
|
-
function
|
|
5139
|
+
function $l(e, t, a) {
|
|
5108
5140
|
if (t === null)
|
|
5109
5141
|
return "";
|
|
5110
5142
|
if (typeof t != "object")
|
|
5111
5143
|
return String(t);
|
|
5112
|
-
if (
|
|
5144
|
+
if (_(e) && (a != null && a.doc)) {
|
|
5113
5145
|
const r = $r(a.doc, {});
|
|
5114
5146
|
r.anchors = /* @__PURE__ */ new Set();
|
|
5115
5147
|
for (const i of a.anchors.keys())
|
|
@@ -5118,14 +5150,14 @@ function Nl(e, t, a) {
|
|
|
5118
5150
|
const n = e.toString(r);
|
|
5119
5151
|
if (!a.mapKeyWarned) {
|
|
5120
5152
|
let i = JSON.stringify(n);
|
|
5121
|
-
i.length > 40 && (i = i.substring(0, 36) + '..."'),
|
|
5153
|
+
i.length > 40 && (i = i.substring(0, 36) + '..."'), kl(a.doc.options.logLevel, `Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`), a.mapKeyWarned = !0;
|
|
5122
5154
|
}
|
|
5123
5155
|
return n;
|
|
5124
5156
|
}
|
|
5125
5157
|
return JSON.stringify(t);
|
|
5126
5158
|
}
|
|
5127
5159
|
function Jt(e, t, a) {
|
|
5128
|
-
const r =
|
|
5160
|
+
const r = Le(e, void 0, a), n = Le(t, void 0, a);
|
|
5129
5161
|
return new B(r, n);
|
|
5130
5162
|
}
|
|
5131
5163
|
class B {
|
|
@@ -5134,35 +5166,35 @@ class B {
|
|
|
5134
5166
|
}
|
|
5135
5167
|
clone(t) {
|
|
5136
5168
|
let { key: a, value: r } = this;
|
|
5137
|
-
return
|
|
5169
|
+
return _(a) && (a = a.clone(t)), _(r) && (r = r.clone(t)), new B(a, r);
|
|
5138
5170
|
}
|
|
5139
5171
|
toJSON(t, a) {
|
|
5140
5172
|
const r = a != null && a.mapAsMap ? /* @__PURE__ */ new Map() : {};
|
|
5141
|
-
return
|
|
5173
|
+
return _r(a, r, this);
|
|
5142
5174
|
}
|
|
5143
5175
|
toString(t, a, r) {
|
|
5144
|
-
return t != null && t.doc ?
|
|
5176
|
+
return t != null && t.doc ? El(this, t, a, r) : JSON.stringify(this);
|
|
5145
5177
|
}
|
|
5146
5178
|
}
|
|
5147
|
-
function
|
|
5148
|
-
return (t.inFlow ?? e.flow ?
|
|
5179
|
+
function xr(e, t, a) {
|
|
5180
|
+
return (t.inFlow ?? e.flow ? _l : Pl)(e, t, a);
|
|
5149
5181
|
}
|
|
5150
|
-
function
|
|
5182
|
+
function Pl({ comment: e, items: t }, a, { blockItemPrefix: r, flowChars: n, itemIndent: i, onChompKeep: o, onComment: l }) {
|
|
5151
5183
|
const { indent: u, options: { commentString: c } } = a, m = Object.assign({}, a, { indent: i, type: null });
|
|
5152
5184
|
let d = !1;
|
|
5153
5185
|
const f = [];
|
|
5154
5186
|
for (let g = 0; g < t.length; ++g) {
|
|
5155
5187
|
const h = t[g];
|
|
5156
5188
|
let y = null;
|
|
5157
|
-
if (
|
|
5189
|
+
if (_(h))
|
|
5158
5190
|
!d && h.spaceBefore && f.push(""), nt(a, f, h.commentBefore, d), h.comment && (y = h.comment);
|
|
5159
|
-
else if (
|
|
5160
|
-
const
|
|
5161
|
-
|
|
5191
|
+
else if (x(h)) {
|
|
5192
|
+
const b = _(h.key) ? h.key : null;
|
|
5193
|
+
b && (!d && b.spaceBefore && f.push(""), nt(a, f, b.commentBefore, d));
|
|
5162
5194
|
}
|
|
5163
5195
|
d = !1;
|
|
5164
5196
|
let S = Oe(h, m, () => y = null, () => d = !0);
|
|
5165
|
-
y && (S +=
|
|
5197
|
+
y && (S += le(S, i, c(y))), d && y && (d = !1), f.push(r + S);
|
|
5166
5198
|
}
|
|
5167
5199
|
let p;
|
|
5168
5200
|
if (f.length === 0)
|
|
@@ -5179,7 +5211,7 @@ ${u}${h}` : `
|
|
|
5179
5211
|
return e ? (p += `
|
|
5180
5212
|
` + G(c(e), u), l && l()) : d && o && o(), p;
|
|
5181
5213
|
}
|
|
5182
|
-
function
|
|
5214
|
+
function _l({ items: e }, t, { flowChars: a, itemIndent: r }) {
|
|
5183
5215
|
const { indent: n, indentStep: i, flowCollectionPadding: o, options: { commentString: l } } = t;
|
|
5184
5216
|
r += i;
|
|
5185
5217
|
const u = Object.assign({}, t, {
|
|
@@ -5192,17 +5224,17 @@ function Pl({ items: e }, t, { flowChars: a, itemIndent: r }) {
|
|
|
5192
5224
|
for (let g = 0; g < e.length; ++g) {
|
|
5193
5225
|
const h = e[g];
|
|
5194
5226
|
let y = null;
|
|
5195
|
-
if (
|
|
5227
|
+
if (_(h))
|
|
5196
5228
|
h.spaceBefore && d.push(""), nt(t, d, h.commentBefore, !1), h.comment && (y = h.comment);
|
|
5197
|
-
else if (
|
|
5198
|
-
const
|
|
5199
|
-
|
|
5200
|
-
const
|
|
5201
|
-
|
|
5229
|
+
else if (x(h)) {
|
|
5230
|
+
const b = _(h.key) ? h.key : null;
|
|
5231
|
+
b && (b.spaceBefore && d.push(""), nt(t, d, b.commentBefore, !1), b.comment && (c = !0));
|
|
5232
|
+
const F = _(h.value) ? h.value : null;
|
|
5233
|
+
F ? (F.comment && (y = F.comment), F.commentBefore && (c = !0)) : h.value == null && (b != null && b.comment) && (y = b.comment);
|
|
5202
5234
|
}
|
|
5203
5235
|
y && (c = !0);
|
|
5204
5236
|
let S = Oe(h, u, () => y = null);
|
|
5205
|
-
g < e.length - 1 && (S += ","), y && (S +=
|
|
5237
|
+
g < e.length - 1 && (S += ","), y && (S += le(S, r, l(y))), !c && (d.length > m || S.includes(`
|
|
5206
5238
|
`)) && (c = !0), d.push(S), m = d.length;
|
|
5207
5239
|
}
|
|
5208
5240
|
const { start: f, end: p } = a;
|
|
@@ -5229,10 +5261,10 @@ function nt({ indent: e, options: { commentString: t } }, a, r, n) {
|
|
|
5229
5261
|
a.push(i.trimStart());
|
|
5230
5262
|
}
|
|
5231
5263
|
}
|
|
5232
|
-
function
|
|
5264
|
+
function ue(e, t) {
|
|
5233
5265
|
const a = N(t) ? t.value : t;
|
|
5234
5266
|
for (const r of e)
|
|
5235
|
-
if (
|
|
5267
|
+
if (x(r) && (r.key === t || r.key === a || N(r.key) && r.key.value === a))
|
|
5236
5268
|
return r;
|
|
5237
5269
|
}
|
|
5238
5270
|
class te extends kr {
|
|
@@ -5271,8 +5303,8 @@ class te extends kr {
|
|
|
5271
5303
|
add(t, a) {
|
|
5272
5304
|
var o;
|
|
5273
5305
|
let r;
|
|
5274
|
-
|
|
5275
|
-
const n =
|
|
5306
|
+
x(t) ? r = t : !t || typeof t != "object" || !("key" in t) ? r = new B(t, t == null ? void 0 : t.value) : r = new B(t.key, t.value);
|
|
5307
|
+
const n = ue(this.items, r.key), i = (o = this.schema) == null ? void 0 : o.sortMapEntries;
|
|
5276
5308
|
if (n) {
|
|
5277
5309
|
if (!a)
|
|
5278
5310
|
throw new Error(`Key ${r.key} already set`);
|
|
@@ -5284,15 +5316,15 @@ class te extends kr {
|
|
|
5284
5316
|
this.items.push(r);
|
|
5285
5317
|
}
|
|
5286
5318
|
delete(t) {
|
|
5287
|
-
const a =
|
|
5319
|
+
const a = ue(this.items, t);
|
|
5288
5320
|
return a ? this.items.splice(this.items.indexOf(a), 1).length > 0 : !1;
|
|
5289
5321
|
}
|
|
5290
5322
|
get(t, a) {
|
|
5291
|
-
const r =
|
|
5323
|
+
const r = ue(this.items, t), n = r == null ? void 0 : r.value;
|
|
5292
5324
|
return (!a && N(n) ? n.value : n) ?? void 0;
|
|
5293
5325
|
}
|
|
5294
5326
|
has(t) {
|
|
5295
|
-
return !!
|
|
5327
|
+
return !!ue(this.items, t);
|
|
5296
5328
|
}
|
|
5297
5329
|
set(t, a) {
|
|
5298
5330
|
this.add(new B(t, a), !0);
|
|
@@ -5306,16 +5338,16 @@ class te extends kr {
|
|
|
5306
5338
|
const n = r ? new r() : a != null && a.mapAsMap ? /* @__PURE__ */ new Map() : {};
|
|
5307
5339
|
a != null && a.onCreate && a.onCreate(n);
|
|
5308
5340
|
for (const i of this.items)
|
|
5309
|
-
|
|
5341
|
+
_r(a, n, i);
|
|
5310
5342
|
return n;
|
|
5311
5343
|
}
|
|
5312
5344
|
toString(t, a, r) {
|
|
5313
5345
|
if (!t)
|
|
5314
5346
|
return JSON.stringify(this);
|
|
5315
5347
|
for (const n of this.items)
|
|
5316
|
-
if (!
|
|
5348
|
+
if (!x(n))
|
|
5317
5349
|
throw new Error(`Map items must all be pairs; found ${JSON.stringify(n)} instead`);
|
|
5318
|
-
return !t.allNullValues && this.hasAllNullValues(!1) && (t = Object.assign({}, t, { allNullValues: !0 })),
|
|
5350
|
+
return !t.allNullValues && this.hasAllNullValues(!1) && (t = Object.assign({}, t, { allNullValues: !0 })), xr(this, t, {
|
|
5319
5351
|
blockItemPrefix: "",
|
|
5320
5352
|
flowChars: { start: "{", end: "}" },
|
|
5321
5353
|
itemIndent: t.indent || "",
|
|
@@ -5392,11 +5424,11 @@ class it extends kr {
|
|
|
5392
5424
|
a != null && a.onCreate && a.onCreate(r);
|
|
5393
5425
|
let n = 0;
|
|
5394
5426
|
for (const i of this.items)
|
|
5395
|
-
r.push(
|
|
5427
|
+
r.push(L(i, String(n++), a));
|
|
5396
5428
|
return r;
|
|
5397
5429
|
}
|
|
5398
5430
|
toString(t, a, r) {
|
|
5399
|
-
return t ?
|
|
5431
|
+
return t ? xr(this, t, {
|
|
5400
5432
|
blockItemPrefix: "- ",
|
|
5401
5433
|
flowChars: { start: "[", end: "]" },
|
|
5402
5434
|
itemIndent: (t.indent || "") + " ",
|
|
@@ -5413,7 +5445,7 @@ class it extends kr {
|
|
|
5413
5445
|
const u = a instanceof Set ? l : String(o++);
|
|
5414
5446
|
l = n.call(a, u, l);
|
|
5415
5447
|
}
|
|
5416
|
-
i.items.push(
|
|
5448
|
+
i.items.push(Le(l, void 0, r));
|
|
5417
5449
|
}
|
|
5418
5450
|
}
|
|
5419
5451
|
return i;
|
|
@@ -5497,7 +5529,7 @@ const Ir = {
|
|
|
5497
5529
|
const t = Number(e.value);
|
|
5498
5530
|
return isFinite(t) ? t.toExponential() : H(e);
|
|
5499
5531
|
}
|
|
5500
|
-
},
|
|
5532
|
+
}, Rr = {
|
|
5501
5533
|
identify: (e) => typeof e == "number",
|
|
5502
5534
|
default: !0,
|
|
5503
5535
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -5508,7 +5540,7 @@ const Ir = {
|
|
|
5508
5540
|
},
|
|
5509
5541
|
stringify: H
|
|
5510
5542
|
}, bt = (e) => typeof e == "bigint" || Number.isInteger(e), Ht = (e, t, a, { intAsBigInt: r }) => r ? BigInt(e) : parseInt(e.substring(t), a);
|
|
5511
|
-
function
|
|
5543
|
+
function Lr(e, t, a) {
|
|
5512
5544
|
const { value: r } = e;
|
|
5513
5545
|
return bt(r) && r >= 0 ? a + r.toString(t) : H(e);
|
|
5514
5546
|
}
|
|
@@ -5519,7 +5551,7 @@ const Br = {
|
|
|
5519
5551
|
format: "OCT",
|
|
5520
5552
|
test: /^0o[0-7]+$/,
|
|
5521
5553
|
resolve: (e, t, a) => Ht(e, 2, 8, a),
|
|
5522
|
-
stringify: (e) =>
|
|
5554
|
+
stringify: (e) => Lr(e, 8, "0o")
|
|
5523
5555
|
}, qr = {
|
|
5524
5556
|
identify: bt,
|
|
5525
5557
|
default: !0,
|
|
@@ -5534,7 +5566,7 @@ const Br = {
|
|
|
5534
5566
|
format: "HEX",
|
|
5535
5567
|
test: /^0x[0-9a-fA-F]+$/,
|
|
5536
5568
|
resolve: (e, t, a) => Ht(e, 2, 16, a),
|
|
5537
|
-
stringify: (e) =>
|
|
5569
|
+
stringify: (e) => Lr(e, 16, "0x")
|
|
5538
5570
|
}, xl = [
|
|
5539
5571
|
ke,
|
|
5540
5572
|
Ne,
|
|
@@ -5546,12 +5578,12 @@ const Br = {
|
|
|
5546
5578
|
Ur,
|
|
5547
5579
|
Ir,
|
|
5548
5580
|
jr,
|
|
5549
|
-
|
|
5581
|
+
Rr
|
|
5550
5582
|
];
|
|
5551
5583
|
function Sa(e) {
|
|
5552
5584
|
return typeof e == "bigint" || Number.isInteger(e);
|
|
5553
5585
|
}
|
|
5554
|
-
const Ye = ({ value: e }) => JSON.stringify(e),
|
|
5586
|
+
const Ye = ({ value: e }) => JSON.stringify(e), Il = [
|
|
5555
5587
|
{
|
|
5556
5588
|
identify: (e) => typeof e == "string",
|
|
5557
5589
|
default: !0,
|
|
@@ -5592,14 +5624,14 @@ const Ye = ({ value: e }) => JSON.stringify(e), _l = [
|
|
|
5592
5624
|
resolve: (e) => parseFloat(e),
|
|
5593
5625
|
stringify: Ye
|
|
5594
5626
|
}
|
|
5595
|
-
],
|
|
5627
|
+
], jl = {
|
|
5596
5628
|
default: !0,
|
|
5597
5629
|
tag: "",
|
|
5598
5630
|
test: /^/,
|
|
5599
5631
|
resolve(e, t) {
|
|
5600
5632
|
return t(`Unresolved plain scalar ${JSON.stringify(e)}`), e;
|
|
5601
5633
|
}
|
|
5602
|
-
},
|
|
5634
|
+
}, Rl = [ke, Ne].concat(Il, jl), Qt = {
|
|
5603
5635
|
identify: (e) => e instanceof Uint8Array,
|
|
5604
5636
|
// Buffer inherits from Uint8Array
|
|
5605
5637
|
default: !1,
|
|
@@ -5647,7 +5679,7 @@ function Zr(e, t) {
|
|
|
5647
5679
|
if (ze(e))
|
|
5648
5680
|
for (let a = 0; a < e.items.length; ++a) {
|
|
5649
5681
|
let r = e.items[a];
|
|
5650
|
-
if (!
|
|
5682
|
+
if (!x(r)) {
|
|
5651
5683
|
if (Ze(r)) {
|
|
5652
5684
|
r.items.length > 1 && t("Each pair must have its own sequence indicator");
|
|
5653
5685
|
const n = r.items[0] || new B(new A(null));
|
|
@@ -5659,7 +5691,7 @@ ${i.comment}` : r.comment;
|
|
|
5659
5691
|
}
|
|
5660
5692
|
r = n;
|
|
5661
5693
|
}
|
|
5662
|
-
e.items[a] =
|
|
5694
|
+
e.items[a] = x(r) ? r : new B(r);
|
|
5663
5695
|
}
|
|
5664
5696
|
}
|
|
5665
5697
|
else
|
|
@@ -5713,7 +5745,7 @@ class Ce extends it {
|
|
|
5713
5745
|
a != null && a.onCreate && a.onCreate(r);
|
|
5714
5746
|
for (const n of this.items) {
|
|
5715
5747
|
let i, o;
|
|
5716
|
-
if (
|
|
5748
|
+
if (x(n) ? (i = L(n.key, "", a), o = L(n.value, i, a)) : i = L(n, "", a), r.has(i))
|
|
5717
5749
|
throw new Error("Ordered maps must not include duplicate keys");
|
|
5718
5750
|
r.set(i, o);
|
|
5719
5751
|
}
|
|
@@ -5763,7 +5795,7 @@ const Vr = {
|
|
|
5763
5795
|
test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
|
|
5764
5796
|
resolve: (e) => e.slice(-3).toLowerCase() === "nan" ? NaN : e[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
|
|
5765
5797
|
stringify: H
|
|
5766
|
-
},
|
|
5798
|
+
}, Bl = {
|
|
5767
5799
|
identify: (e) => typeof e == "number",
|
|
5768
5800
|
default: !0,
|
|
5769
5801
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -5774,7 +5806,7 @@ const Vr = {
|
|
|
5774
5806
|
const t = Number(e.value);
|
|
5775
5807
|
return isFinite(t) ? t.toExponential() : H(e);
|
|
5776
5808
|
}
|
|
5777
|
-
},
|
|
5809
|
+
}, ql = {
|
|
5778
5810
|
identify: (e) => typeof e == "number",
|
|
5779
5811
|
default: !0,
|
|
5780
5812
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -5817,7 +5849,7 @@ function Xt(e, t, a) {
|
|
|
5817
5849
|
}
|
|
5818
5850
|
return H(e);
|
|
5819
5851
|
}
|
|
5820
|
-
const
|
|
5852
|
+
const Ul = {
|
|
5821
5853
|
identify: We,
|
|
5822
5854
|
default: !0,
|
|
5823
5855
|
tag: "tag:yaml.org,2002:int",
|
|
@@ -5825,7 +5857,7 @@ const ql = {
|
|
|
5825
5857
|
test: /^[-+]?0b[0-1_]+$/,
|
|
5826
5858
|
resolve: (e, t, a) => wt(e, 2, 2, a),
|
|
5827
5859
|
stringify: (e) => Xt(e, 2, "0b")
|
|
5828
|
-
},
|
|
5860
|
+
}, Zl = {
|
|
5829
5861
|
identify: We,
|
|
5830
5862
|
default: !0,
|
|
5831
5863
|
tag: "tag:yaml.org,2002:int",
|
|
@@ -5833,14 +5865,14 @@ const ql = {
|
|
|
5833
5865
|
test: /^[-+]?0[0-7_]+$/,
|
|
5834
5866
|
resolve: (e, t, a) => wt(e, 1, 8, a),
|
|
5835
5867
|
stringify: (e) => Xt(e, 8, "0")
|
|
5836
|
-
},
|
|
5868
|
+
}, zl = {
|
|
5837
5869
|
identify: We,
|
|
5838
5870
|
default: !0,
|
|
5839
5871
|
tag: "tag:yaml.org,2002:int",
|
|
5840
5872
|
test: /^[-+]?[0-9][0-9_]*$/,
|
|
5841
5873
|
resolve: (e, t, a) => wt(e, 0, 10, a),
|
|
5842
5874
|
stringify: H
|
|
5843
|
-
},
|
|
5875
|
+
}, Wl = {
|
|
5844
5876
|
identify: We,
|
|
5845
5877
|
default: !0,
|
|
5846
5878
|
tag: "tag:yaml.org,2002:int",
|
|
@@ -5855,20 +5887,20 @@ class Se extends te {
|
|
|
5855
5887
|
}
|
|
5856
5888
|
add(t) {
|
|
5857
5889
|
let a;
|
|
5858
|
-
|
|
5890
|
+
x(t) ? a = t : t && typeof t == "object" && "key" in t && "value" in t && t.value === null ? a = new B(t.key, null) : a = new B(t, null), ue(this.items, a.key) || this.items.push(a);
|
|
5859
5891
|
}
|
|
5860
5892
|
/**
|
|
5861
5893
|
* If `keepPair` is `true`, returns the Pair matching `key`.
|
|
5862
5894
|
* Otherwise, returns the value of that Pair's key.
|
|
5863
5895
|
*/
|
|
5864
5896
|
get(t, a) {
|
|
5865
|
-
const r =
|
|
5866
|
-
return !a &&
|
|
5897
|
+
const r = ue(this.items, t);
|
|
5898
|
+
return !a && x(r) ? N(r.key) ? r.key.value : r.key : r;
|
|
5867
5899
|
}
|
|
5868
5900
|
set(t, a) {
|
|
5869
5901
|
if (typeof a != "boolean")
|
|
5870
5902
|
throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof a}`);
|
|
5871
|
-
const r =
|
|
5903
|
+
const r = ue(this.items, t);
|
|
5872
5904
|
r && !a ? this.items.splice(this.items.indexOf(r), 1) : !r && a && this.items.push(new B(t));
|
|
5873
5905
|
}
|
|
5874
5906
|
toJSON(t, a) {
|
|
@@ -5967,13 +5999,13 @@ const Hr = {
|
|
|
5967
5999
|
yt,
|
|
5968
6000
|
Vr,
|
|
5969
6001
|
Jr,
|
|
5970
|
-
ql,
|
|
5971
6002
|
Ul,
|
|
5972
6003
|
Zl,
|
|
5973
6004
|
zl,
|
|
6005
|
+
Wl,
|
|
5974
6006
|
Ll,
|
|
5975
|
-
Rl,
|
|
5976
6007
|
Bl,
|
|
6008
|
+
ql,
|
|
5977
6009
|
Qt,
|
|
5978
6010
|
K,
|
|
5979
6011
|
Kt,
|
|
@@ -5985,13 +6017,13 @@ const Hr = {
|
|
|
5985
6017
|
], Oa = /* @__PURE__ */ new Map([
|
|
5986
6018
|
["core", xl],
|
|
5987
6019
|
["failsafe", [ke, Ne, gt]],
|
|
5988
|
-
["json",
|
|
6020
|
+
["json", Rl],
|
|
5989
6021
|
["yaml11", Aa],
|
|
5990
6022
|
["yaml-1.1", Aa]
|
|
5991
6023
|
]), Da = {
|
|
5992
6024
|
binary: Qt,
|
|
5993
6025
|
bool: Yt,
|
|
5994
|
-
float:
|
|
6026
|
+
float: Rr,
|
|
5995
6027
|
floatExp: jr,
|
|
5996
6028
|
floatNaN: Ir,
|
|
5997
6029
|
floatTime: Qr,
|
|
@@ -6007,7 +6039,7 @@ const Hr = {
|
|
|
6007
6039
|
seq: Ne,
|
|
6008
6040
|
set: ea,
|
|
6009
6041
|
timestamp: vt
|
|
6010
|
-
},
|
|
6042
|
+
}, Vl = {
|
|
6011
6043
|
"tag:yaml.org,2002:binary": Qt,
|
|
6012
6044
|
"tag:yaml.org,2002:merge": K,
|
|
6013
6045
|
"tag:yaml.org,2002:omap": Kt,
|
|
@@ -6040,17 +6072,17 @@ function Mt(e, t, a) {
|
|
|
6040
6072
|
return i.includes(l) || i.push(l), i;
|
|
6041
6073
|
}, []);
|
|
6042
6074
|
}
|
|
6043
|
-
const
|
|
6075
|
+
const Jl = (e, t) => e.key < t.key ? -1 : e.key > t.key ? 1 : 0;
|
|
6044
6076
|
class aa {
|
|
6045
6077
|
constructor({ compat: t, customTags: a, merge: r, resolveKnownTags: n, schema: i, sortMapEntries: o, toStringDefaults: l }) {
|
|
6046
|
-
this.compat = Array.isArray(t) ? Mt(t, "compat") : t ? Mt(null, t) : null, this.name = typeof i == "string" && i || "core", this.knownTags = n ?
|
|
6078
|
+
this.compat = Array.isArray(t) ? Mt(t, "compat") : t ? Mt(null, t) : null, this.name = typeof i == "string" && i || "core", this.knownTags = n ? Vl : {}, this.tags = Mt(a, this.name, r), this.toStringOptions = l ?? null, Object.defineProperty(this, ae, { value: ke }), Object.defineProperty(this, dt, { value: gt }), Object.defineProperty(this, Te, { value: Ne }), this.sortMapEntries = typeof o == "function" ? o : o === !0 ? Jl : null;
|
|
6047
6079
|
}
|
|
6048
6080
|
clone() {
|
|
6049
6081
|
const t = Object.create(aa.prototype, Object.getOwnPropertyDescriptors(this));
|
|
6050
6082
|
return t.tags = this.tags.slice(), t;
|
|
6051
6083
|
}
|
|
6052
6084
|
}
|
|
6053
|
-
function
|
|
6085
|
+
function Yl(e, t) {
|
|
6054
6086
|
var u;
|
|
6055
6087
|
const a = [];
|
|
6056
6088
|
let r = t.directives === !0;
|
|
@@ -6067,7 +6099,7 @@ function Jl(e, t) {
|
|
|
6067
6099
|
}
|
|
6068
6100
|
let o = !1, l = null;
|
|
6069
6101
|
if (e.contents) {
|
|
6070
|
-
if (
|
|
6102
|
+
if (_(e.contents)) {
|
|
6071
6103
|
if (e.contents.spaceBefore && r && a.push(""), e.contents.commentBefore) {
|
|
6072
6104
|
const d = i(e.contents.commentBefore);
|
|
6073
6105
|
a.push(G(d, ""));
|
|
@@ -6076,7 +6108,7 @@ function Jl(e, t) {
|
|
|
6076
6108
|
}
|
|
6077
6109
|
const c = l ? void 0 : () => o = !0;
|
|
6078
6110
|
let m = Oe(e.contents, n, () => l = null, c);
|
|
6079
|
-
l && (m +=
|
|
6111
|
+
l && (m += le(m, "", i(l))), (m[0] === "|" || m[0] === ">") && a[a.length - 1] === "---" ? a[a.length - 1] = `--- ${m}` : a.push(m);
|
|
6080
6112
|
} else
|
|
6081
6113
|
a.push(Oe(e.contents, n));
|
|
6082
6114
|
if ((u = e.directives) != null && u.docEnd)
|
|
@@ -6096,7 +6128,7 @@ function Jl(e, t) {
|
|
|
6096
6128
|
}
|
|
6097
6129
|
class ra {
|
|
6098
6130
|
constructor(t, a, r) {
|
|
6099
|
-
this.commentBefore = null, this.comment = null, this.errors = [], this.warnings = [], Object.defineProperty(this, q, { value:
|
|
6131
|
+
this.commentBefore = null, this.comment = null, this.errors = [], this.warnings = [], Object.defineProperty(this, q, { value: _t });
|
|
6100
6132
|
let n = null;
|
|
6101
6133
|
typeof a == "function" || Array.isArray(a) ? n = a : r === void 0 && a && (r = a, a = void 0);
|
|
6102
6134
|
const i = Object.assign({
|
|
@@ -6120,9 +6152,9 @@ class ra {
|
|
|
6120
6152
|
*/
|
|
6121
6153
|
clone() {
|
|
6122
6154
|
const t = Object.create(ra.prototype, {
|
|
6123
|
-
[q]: { value:
|
|
6155
|
+
[q]: { value: _t }
|
|
6124
6156
|
});
|
|
6125
|
-
return t.commentBefore = this.commentBefore, t.comment = this.comment, t.errors = this.errors.slice(), t.warnings = this.warnings.slice(), t.options = Object.assign({}, this.options), this.directives && (t.directives = this.directives.clone()), t.schema = this.schema.clone(), t.contents =
|
|
6157
|
+
return t.commentBefore = this.commentBefore, t.comment = this.comment, t.errors = this.errors.slice(), t.warnings = this.warnings.slice(), t.options = Object.assign({}, this.options), this.directives && (t.directives = this.directives.clone()), t.schema = this.schema.clone(), t.contents = _(this.contents) ? this.contents.clone(t.schema) : this.contents, this.range && (t.range = this.range.slice()), t;
|
|
6126
6158
|
}
|
|
6127
6159
|
/** Adds a value to the document. */
|
|
6128
6160
|
add(t) {
|
|
@@ -6154,10 +6186,10 @@ class ra {
|
|
|
6154
6186
|
if (typeof a == "function")
|
|
6155
6187
|
t = a.call({ "": t }, "", t), n = a;
|
|
6156
6188
|
else if (Array.isArray(a)) {
|
|
6157
|
-
const y = (
|
|
6189
|
+
const y = (b) => typeof b == "number" || b instanceof String || b instanceof Number, S = a.filter(y).map(String);
|
|
6158
6190
|
S.length > 0 && (a = a.concat(S)), n = a;
|
|
6159
6191
|
} else r === void 0 && a && (r = a, a = void 0);
|
|
6160
|
-
const { aliasDuplicateObjects: i, anchorPrefix: o, flow: l, keepUndefined: u, onTagObj: c, tag: m } = r ?? {}, { onAnchor: d, setAnchors: f, sourceObjects: p } =
|
|
6192
|
+
const { aliasDuplicateObjects: i, anchorPrefix: o, flow: l, keepUndefined: u, onTagObj: c, tag: m } = r ?? {}, { onAnchor: d, setAnchors: f, sourceObjects: p } = Cl(
|
|
6161
6193
|
this,
|
|
6162
6194
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
6163
6195
|
o || "a"
|
|
@@ -6169,7 +6201,7 @@ class ra {
|
|
|
6169
6201
|
replacer: n,
|
|
6170
6202
|
schema: this.schema,
|
|
6171
6203
|
sourceObjects: p
|
|
6172
|
-
}, h =
|
|
6204
|
+
}, h = Le(t, m, g);
|
|
6173
6205
|
return l && P(h) && (h.flow = !0), f(), h;
|
|
6174
6206
|
}
|
|
6175
6207
|
/**
|
|
@@ -6192,7 +6224,7 @@ class ra {
|
|
|
6192
6224
|
* @returns `true` if the item was found and removed.
|
|
6193
6225
|
*/
|
|
6194
6226
|
deleteIn(t) {
|
|
6195
|
-
return
|
|
6227
|
+
return _e(t) ? this.contents == null ? !1 : (this.contents = null, !0) : ge(this.contents) ? this.contents.deleteIn(t) : !1;
|
|
6196
6228
|
}
|
|
6197
6229
|
/**
|
|
6198
6230
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -6208,7 +6240,7 @@ class ra {
|
|
|
6208
6240
|
* `true` (collections are always returned intact).
|
|
6209
6241
|
*/
|
|
6210
6242
|
getIn(t, a) {
|
|
6211
|
-
return
|
|
6243
|
+
return _e(t) ? !a && N(this.contents) ? this.contents.value : this.contents : P(this.contents) ? this.contents.getIn(t, a) : void 0;
|
|
6212
6244
|
}
|
|
6213
6245
|
/**
|
|
6214
6246
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -6220,7 +6252,7 @@ class ra {
|
|
|
6220
6252
|
* Checks if the document includes a value at `path`.
|
|
6221
6253
|
*/
|
|
6222
6254
|
hasIn(t) {
|
|
6223
|
-
return
|
|
6255
|
+
return _e(t) ? this.contents !== void 0 : P(this.contents) ? this.contents.hasIn(t) : !1;
|
|
6224
6256
|
}
|
|
6225
6257
|
/**
|
|
6226
6258
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -6234,7 +6266,7 @@ class ra {
|
|
|
6234
6266
|
* boolean to add/remove the item from the set.
|
|
6235
6267
|
*/
|
|
6236
6268
|
setIn(t, a) {
|
|
6237
|
-
|
|
6269
|
+
_e(t) ? this.contents = a : this.contents == null ? this.contents = rt(this.schema, Array.from(t), a) : ge(this.contents) && this.contents.setIn(t, a);
|
|
6238
6270
|
}
|
|
6239
6271
|
/**
|
|
6240
6272
|
* Change the YAML version and schema used by the document.
|
|
@@ -6278,7 +6310,7 @@ class ra {
|
|
|
6278
6310
|
mapAsMap: r === !0,
|
|
6279
6311
|
mapKeyWarned: !1,
|
|
6280
6312
|
maxAliasCount: typeof n == "number" ? n : 100
|
|
6281
|
-
}, u =
|
|
6313
|
+
}, u = L(this.contents, a ?? "", l);
|
|
6282
6314
|
if (typeof i == "function")
|
|
6283
6315
|
for (const { count: c, res: m } of l.anchors.values())
|
|
6284
6316
|
i(m, c);
|
|
@@ -6301,7 +6333,7 @@ class ra {
|
|
|
6301
6333
|
const a = JSON.stringify(t.indent);
|
|
6302
6334
|
throw new Error(`"indent" option must be a positive integer, not ${a}`);
|
|
6303
6335
|
}
|
|
6304
|
-
return
|
|
6336
|
+
return Yl(this, t);
|
|
6305
6337
|
}
|
|
6306
6338
|
}
|
|
6307
6339
|
function ge(e) {
|
|
@@ -6327,11 +6359,11 @@ function Gr(e, t, a) {
|
|
|
6327
6359
|
}
|
|
6328
6360
|
return Ue(e) && !r ? e.toString(a) : new ra(e, r, a).toString(a);
|
|
6329
6361
|
}
|
|
6330
|
-
const
|
|
6331
|
-
async function
|
|
6362
|
+
const Hl = "api/v1/formulas";
|
|
6363
|
+
async function Ql(e, t) {
|
|
6332
6364
|
const a = t ?? C();
|
|
6333
6365
|
try {
|
|
6334
|
-
const r = `${
|
|
6366
|
+
const r = `${Hl}?datasource=${encodeURIComponent(
|
|
6335
6367
|
e
|
|
6336
6368
|
)}&flat=true`, n = await a.get(r, void 0, {
|
|
6337
6369
|
skipTrackingParam: !0
|
|
@@ -6345,11 +6377,11 @@ async function Hl(e, t) {
|
|
|
6345
6377
|
);
|
|
6346
6378
|
}
|
|
6347
6379
|
}
|
|
6348
|
-
async function
|
|
6380
|
+
async function Tc(e, t) {
|
|
6349
6381
|
var u;
|
|
6350
6382
|
const { dataSourceTitle: a } = e;
|
|
6351
6383
|
if (console.debug(
|
|
6352
|
-
|
|
6384
|
+
_o,
|
|
6353
6385
|
a,
|
|
6354
6386
|
t.toolCallId
|
|
6355
6387
|
), !a)
|
|
@@ -6358,7 +6390,7 @@ async function Fc(e, t) {
|
|
|
6358
6390
|
);
|
|
6359
6391
|
const r = t.httpClient, [n, i] = await Promise.all([
|
|
6360
6392
|
Sr(a, r),
|
|
6361
|
-
|
|
6393
|
+
Ql(a, r).catch((c) => {
|
|
6362
6394
|
const m = Nt(c) ?? Nt(c.cause);
|
|
6363
6395
|
if (m === 401 || m === 403 || m === 404)
|
|
6364
6396
|
return [];
|
|
@@ -6377,7 +6409,7 @@ async function Fc(e, t) {
|
|
|
6377
6409
|
formulas: o
|
|
6378
6410
|
};
|
|
6379
6411
|
}
|
|
6380
|
-
function
|
|
6412
|
+
function Gl(e, t, a, r) {
|
|
6381
6413
|
const i = `${e}: ${t}${a ? " (truncated summary from the data source)" : ""}.`;
|
|
6382
6414
|
if (Object.keys(r).length === 0)
|
|
6383
6415
|
return i;
|
|
@@ -6388,7 +6420,7 @@ function Ql(e, t, a, r) {
|
|
|
6388
6420
|
|
|
6389
6421
|
${l}`;
|
|
6390
6422
|
}
|
|
6391
|
-
function
|
|
6423
|
+
function Kl(e) {
|
|
6392
6424
|
if (!(e != null && e.length))
|
|
6393
6425
|
return "";
|
|
6394
6426
|
const t = e.slice(
|
|
@@ -6408,27 +6440,27 @@ function Gl(e) {
|
|
|
6408
6440
|
{ defaultStringType: "PLAIN" }
|
|
6409
6441
|
).trimEnd();
|
|
6410
6442
|
}
|
|
6411
|
-
function
|
|
6443
|
+
function Ec(e, t, a) {
|
|
6412
6444
|
const r = t.length, n = new Set(t.map((p) => p.table)).size, i = t.slice(0, Ot), o = r > Ot, l = {};
|
|
6413
6445
|
for (const p of i) {
|
|
6414
6446
|
const g = p.table;
|
|
6415
6447
|
l[g] || (l[g] = []), l[g].push(p.column);
|
|
6416
6448
|
}
|
|
6417
6449
|
const u = r === 1 ? "field" : "fields", c = n === 1 ? "table" : "tables", m = o ? `Retrieved ${r} ${u} from ${n} ${c} (showing first ${Ot} in summary)` : `Retrieved ${r} ${u} from ${n} ${c}`;
|
|
6418
|
-
let d =
|
|
6419
|
-
const f =
|
|
6450
|
+
let d = Gl(e, m, o, l);
|
|
6451
|
+
const f = Kl(a ?? []);
|
|
6420
6452
|
return f && (d = `${d}
|
|
6421
6453
|
|
|
6422
6454
|
${f}`), d;
|
|
6423
6455
|
}
|
|
6424
|
-
const
|
|
6456
|
+
const kc = s.object({
|
|
6425
6457
|
dataSourceTitle: s.string().describe("Data source title")
|
|
6426
6458
|
}), he = "api/v1/dashboards";
|
|
6427
|
-
function
|
|
6459
|
+
function Nc(e, t) {
|
|
6428
6460
|
const a = t ?? C();
|
|
6429
6461
|
return `${Bt(a.url)}app/main/dashboards/${e}`;
|
|
6430
6462
|
}
|
|
6431
|
-
async function
|
|
6463
|
+
async function Xl(e = {}, t) {
|
|
6432
6464
|
const a = t ?? C(), { fields: r, expand: n, searchByTitle: i } = e, o = new URLSearchParams({
|
|
6433
6465
|
...i && { name: i },
|
|
6434
6466
|
...(r == null ? void 0 : r.length) && { fields: r == null ? void 0 : r.join(",") },
|
|
@@ -6438,7 +6470,7 @@ async function Kl(e = {}, t) {
|
|
|
6438
6470
|
);
|
|
6439
6471
|
return l || [];
|
|
6440
6472
|
}
|
|
6441
|
-
async function
|
|
6473
|
+
async function eu(e, t) {
|
|
6442
6474
|
const a = t ?? C();
|
|
6443
6475
|
try {
|
|
6444
6476
|
return await a.get(
|
|
@@ -6450,20 +6482,20 @@ async function Xl(e, t) {
|
|
|
6450
6482
|
);
|
|
6451
6483
|
}
|
|
6452
6484
|
}
|
|
6453
|
-
async function
|
|
6485
|
+
async function tu(e, t) {
|
|
6454
6486
|
const a = t ?? C();
|
|
6455
6487
|
return await pn(a, e, {
|
|
6456
6488
|
includeWidgets: !0,
|
|
6457
6489
|
includeFilters: !0
|
|
6458
6490
|
});
|
|
6459
6491
|
}
|
|
6460
|
-
async function
|
|
6492
|
+
async function Rt(e, t, a) {
|
|
6461
6493
|
return await (a ?? C()).patch(
|
|
6462
6494
|
`${he}/${e}`,
|
|
6463
6495
|
t
|
|
6464
6496
|
) ?? null;
|
|
6465
6497
|
}
|
|
6466
|
-
async function
|
|
6498
|
+
async function au(e, t, a) {
|
|
6467
6499
|
return await (a ?? C()).post(
|
|
6468
6500
|
`${he}/${e}/widgets`,
|
|
6469
6501
|
t
|
|
@@ -6479,15 +6511,15 @@ async function Fa(e, t, a) {
|
|
|
6479
6511
|
}
|
|
6480
6512
|
) ?? null;
|
|
6481
6513
|
}
|
|
6482
|
-
function
|
|
6514
|
+
function $c(e, t) {
|
|
6483
6515
|
return (t ?? C()).delete(`${he}/${e}`);
|
|
6484
6516
|
}
|
|
6485
|
-
function
|
|
6517
|
+
function ru(e, t, a) {
|
|
6486
6518
|
return (a ?? C()).delete(
|
|
6487
6519
|
`${he}/${e}/widgets/${t}`
|
|
6488
6520
|
);
|
|
6489
6521
|
}
|
|
6490
|
-
function
|
|
6522
|
+
function nu(e) {
|
|
6491
6523
|
return {
|
|
6492
6524
|
columns: e.columns.map((t) => ({
|
|
6493
6525
|
width: t.widthPercentage,
|
|
@@ -6511,7 +6543,7 @@ function ru(e) {
|
|
|
6511
6543
|
};
|
|
6512
6544
|
}
|
|
6513
6545
|
async function Kr(e) {
|
|
6514
|
-
return (await
|
|
6546
|
+
return (await Xl(
|
|
6515
6547
|
{
|
|
6516
6548
|
fields: ["title", "oid", "datasource", "settings"]
|
|
6517
6549
|
},
|
|
@@ -6527,17 +6559,17 @@ async function Kr(e) {
|
|
|
6527
6559
|
dataSourceTitle: r.datasource.title
|
|
6528
6560
|
}));
|
|
6529
6561
|
}
|
|
6530
|
-
async function
|
|
6562
|
+
async function iu(e, t) {
|
|
6531
6563
|
var r;
|
|
6532
|
-
const a = await
|
|
6564
|
+
const a = await tu(
|
|
6533
6565
|
e,
|
|
6534
6566
|
t
|
|
6535
6567
|
);
|
|
6536
6568
|
if (!(a && ((r = a.settings) == null ? void 0 : r.managedByTool) !== "studio-assistant"))
|
|
6537
6569
|
return a ? hn.toDashboardProps(a) : void 0;
|
|
6538
6570
|
}
|
|
6539
|
-
async function
|
|
6540
|
-
const a = await
|
|
6571
|
+
async function ou(e, t) {
|
|
6572
|
+
const a = await iu(
|
|
6541
6573
|
e,
|
|
6542
6574
|
t
|
|
6543
6575
|
);
|
|
@@ -6547,14 +6579,14 @@ async function iu(e, t) {
|
|
|
6547
6579
|
);
|
|
6548
6580
|
return a;
|
|
6549
6581
|
}
|
|
6550
|
-
async function
|
|
6582
|
+
async function su(e, t, a) {
|
|
6551
6583
|
if (t.length === 0)
|
|
6552
6584
|
return [];
|
|
6553
6585
|
const n = t.map((l) => {
|
|
6554
6586
|
const u = la.fromWidgetProps(l), c = ot(l) && l.dataSource ? Tt(l.dataSource) : void 0;
|
|
6555
6587
|
return la.toWidgetDto(u, c);
|
|
6556
6588
|
}).map(
|
|
6557
|
-
(l, u) =>
|
|
6589
|
+
(l, u) => au(e, l, a).then(
|
|
6558
6590
|
(c) => ({
|
|
6559
6591
|
index: u,
|
|
6560
6592
|
result: c
|
|
@@ -6563,14 +6595,14 @@ async function ou(e, t, a) {
|
|
|
6563
6595
|
);
|
|
6564
6596
|
return (await Promise.all(n)).sort((l, u) => l.index - u.index).map((l) => l.result).filter((l) => l !== void 0);
|
|
6565
6597
|
}
|
|
6566
|
-
async function
|
|
6598
|
+
async function lu(e, t, a) {
|
|
6567
6599
|
const r = gn(t);
|
|
6568
|
-
await
|
|
6600
|
+
await Rt(e, r, a);
|
|
6569
6601
|
}
|
|
6570
|
-
function
|
|
6602
|
+
function Pc(e) {
|
|
6571
6603
|
return !!e.id;
|
|
6572
6604
|
}
|
|
6573
|
-
async function
|
|
6605
|
+
async function _c(e, t) {
|
|
6574
6606
|
var d, f;
|
|
6575
6607
|
const a = e.defaultDataSource;
|
|
6576
6608
|
if (!a)
|
|
@@ -6587,20 +6619,20 @@ async function $c(e, t) {
|
|
|
6587
6619
|
if (e.id) {
|
|
6588
6620
|
i = e.id;
|
|
6589
6621
|
try {
|
|
6590
|
-
await
|
|
6622
|
+
await Rt(
|
|
6591
6623
|
e.id,
|
|
6592
6624
|
{
|
|
6593
6625
|
title: o
|
|
6594
6626
|
},
|
|
6595
6627
|
t
|
|
6596
6628
|
);
|
|
6597
|
-
const p = await
|
|
6629
|
+
const p = await eu(
|
|
6598
6630
|
i,
|
|
6599
6631
|
t
|
|
6600
6632
|
);
|
|
6601
6633
|
p && await Promise.all(
|
|
6602
6634
|
p.map(
|
|
6603
|
-
(g) =>
|
|
6635
|
+
(g) => ru(
|
|
6604
6636
|
i,
|
|
6605
6637
|
g.oid,
|
|
6606
6638
|
t
|
|
@@ -6634,7 +6666,7 @@ async function $c(e, t) {
|
|
|
6634
6666
|
...e,
|
|
6635
6667
|
id: i,
|
|
6636
6668
|
title: o
|
|
6637
|
-
}, u = await
|
|
6669
|
+
}, u = await su(
|
|
6638
6670
|
i,
|
|
6639
6671
|
e.widgets,
|
|
6640
6672
|
t
|
|
@@ -6665,13 +6697,13 @@ async function $c(e, t) {
|
|
|
6665
6697
|
})
|
|
6666
6698
|
)
|
|
6667
6699
|
} : (f = e.layoutOptions) == null ? void 0 : f.widgetsPanel;
|
|
6668
|
-
return m && await
|
|
6700
|
+
return m && await Rt(
|
|
6669
6701
|
i,
|
|
6670
6702
|
{
|
|
6671
|
-
layout:
|
|
6703
|
+
layout: nu(m)
|
|
6672
6704
|
},
|
|
6673
6705
|
t
|
|
6674
|
-
), await
|
|
6706
|
+
), await lu(
|
|
6675
6707
|
i,
|
|
6676
6708
|
e.filters ?? [],
|
|
6677
6709
|
t
|
|
@@ -6681,12 +6713,12 @@ async function $c(e, t) {
|
|
|
6681
6713
|
layoutOptions: { widgetsPanel: m }
|
|
6682
6714
|
};
|
|
6683
6715
|
}
|
|
6684
|
-
async function
|
|
6716
|
+
async function xc(e, t) {
|
|
6685
6717
|
return console.debug($o, t.toolCallId), {
|
|
6686
6718
|
dashboards: await Kr(t.httpClient)
|
|
6687
6719
|
};
|
|
6688
6720
|
}
|
|
6689
|
-
const
|
|
6721
|
+
const Ic = s.object({}), jc = s.object({
|
|
6690
6722
|
dataSourceTitle: s.string().describe("Data source title"),
|
|
6691
6723
|
userPrompt: s.string().describe(
|
|
6692
6724
|
`Combined natural language user prompt describing actions on a dashboard.
|
|
@@ -6699,31 +6731,31 @@ Examples:
|
|
|
6699
6731
|
- "Add filters for region and date to the dashboard"
|
|
6700
6732
|
`
|
|
6701
6733
|
)
|
|
6702
|
-
}),
|
|
6734
|
+
}), uu = s.object({
|
|
6703
6735
|
dashboardTitle: s.string().optional().describe("Optional dashboard title"),
|
|
6704
6736
|
widgetIdsToAdd: s.array(s.string()).describe(
|
|
6705
6737
|
"Chart Widget IDs or Chart Widget List ID to add to the dashboard. Use empty array if no charts are found"
|
|
6706
6738
|
)
|
|
6707
|
-
}), uu = s.object({
|
|
6708
|
-
dashboardTitle: s.string().describe("Fusion dashboard title to load")
|
|
6709
6739
|
}), cu = s.object({
|
|
6740
|
+
dashboardTitle: s.string().describe("Fusion dashboard title to load")
|
|
6741
|
+
}), mu = s.object({
|
|
6710
6742
|
dashboardId: s.string().describe("Dashboard ID to update"),
|
|
6711
6743
|
dashboardTitle: s.string().describe("New dashboard title")
|
|
6712
|
-
}),
|
|
6744
|
+
}), du = s.object({
|
|
6713
6745
|
dashboardId: s.string().describe("Existing dashboard ID to add widgets to"),
|
|
6714
6746
|
widgetIdsToAdd: s.array(s.string()).describe("Chart IDs or Chart List ID to add to the dashboard")
|
|
6715
|
-
}),
|
|
6747
|
+
}), fu = s.object({
|
|
6716
6748
|
dashboardId: s.string().describe("Existing dashboard ID to add a chart to"),
|
|
6717
6749
|
userPrompt: s.string().describe("User prompt to describe a chart widget for the dashboard")
|
|
6718
|
-
}),
|
|
6750
|
+
}), pu = s.object({
|
|
6719
6751
|
dashboardId: s.string().describe("Existing dashboard ID to update a chart widget in"),
|
|
6720
6752
|
widgetId: s.string().describe("Widget ID to update"),
|
|
6721
6753
|
userPrompt: s.string().describe("User prompt to describe the update to the chart widget")
|
|
6722
|
-
}),
|
|
6754
|
+
}), hu = s.object({
|
|
6723
6755
|
dashboardId: s.string().describe("Dashboard ID to add filters to"),
|
|
6724
6756
|
userPrompt: s.string().describe("Combined user prompt to add filters to the dashboard.")
|
|
6725
6757
|
});
|
|
6726
|
-
var
|
|
6758
|
+
var gu = function e(t, a) {
|
|
6727
6759
|
if (t === a) return !0;
|
|
6728
6760
|
if (t && a && typeof t == "object" && typeof a == "object") {
|
|
6729
6761
|
if (t.constructor !== a.constructor) return !1;
|
|
@@ -6748,13 +6780,13 @@ var hu = function e(t, a) {
|
|
|
6748
6780
|
}
|
|
6749
6781
|
return t !== t && a !== a;
|
|
6750
6782
|
};
|
|
6751
|
-
const
|
|
6752
|
-
function
|
|
6783
|
+
const yu = /* @__PURE__ */ gr(gu);
|
|
6784
|
+
function bu(e) {
|
|
6753
6785
|
return e.columns.flatMap(
|
|
6754
6786
|
(t) => t.rows.flatMap((a) => a.cells.map((r) => r.widgetId))
|
|
6755
6787
|
);
|
|
6756
6788
|
}
|
|
6757
|
-
function
|
|
6789
|
+
function wu(e, t) {
|
|
6758
6790
|
const a = e.columns.map((r) => ({
|
|
6759
6791
|
...r,
|
|
6760
6792
|
rows: r.rows.map((n) => ({
|
|
@@ -6767,7 +6799,7 @@ function bu(e, t) {
|
|
|
6767
6799
|
})).filter((r) => r.rows.length > 0);
|
|
6768
6800
|
return a.length > 0 ? { columns: a } : { columns: [] };
|
|
6769
6801
|
}
|
|
6770
|
-
function
|
|
6802
|
+
function vu(e) {
|
|
6771
6803
|
return e.columns.length === 1 ? {
|
|
6772
6804
|
...e,
|
|
6773
6805
|
columns: [
|
|
@@ -6778,16 +6810,16 @@ function wu(e) {
|
|
|
6778
6810
|
]
|
|
6779
6811
|
} : e;
|
|
6780
6812
|
}
|
|
6781
|
-
function
|
|
6813
|
+
function Cu(e, t) {
|
|
6782
6814
|
if (!t)
|
|
6783
6815
|
return [];
|
|
6784
|
-
const a =
|
|
6816
|
+
const a = bu(t);
|
|
6785
6817
|
return e.filter((r) => !a.includes(r.id)).map((r) => r.id);
|
|
6786
6818
|
}
|
|
6787
|
-
function
|
|
6819
|
+
function Su(e) {
|
|
6788
6820
|
var r, n;
|
|
6789
6821
|
let t = { ...e };
|
|
6790
|
-
const a =
|
|
6822
|
+
const a = Cu(
|
|
6791
6823
|
t.widgets,
|
|
6792
6824
|
(r = t.layoutOptions) == null ? void 0 : r.widgetsPanel
|
|
6793
6825
|
);
|
|
@@ -6798,11 +6830,11 @@ function Cu(e) {
|
|
|
6798
6830
|
const i = new Set(
|
|
6799
6831
|
t.widgets.map((l) => l.id)
|
|
6800
6832
|
);
|
|
6801
|
-
let o =
|
|
6833
|
+
let o = wu(
|
|
6802
6834
|
t.layoutOptions.widgetsPanel,
|
|
6803
6835
|
i
|
|
6804
6836
|
);
|
|
6805
|
-
o =
|
|
6837
|
+
o = vu(o), t = {
|
|
6806
6838
|
...t,
|
|
6807
6839
|
layoutOptions: {
|
|
6808
6840
|
...t.layoutOptions,
|
|
@@ -6812,7 +6844,7 @@ function Cu(e) {
|
|
|
6812
6844
|
}
|
|
6813
6845
|
return { changed: !0, updatedDashboardProps: t };
|
|
6814
6846
|
}
|
|
6815
|
-
function
|
|
6847
|
+
function Au(e, t) {
|
|
6816
6848
|
return {
|
|
6817
6849
|
changed: !0,
|
|
6818
6850
|
updatedDashboardProps: {
|
|
@@ -6821,7 +6853,7 @@ function Su(e, t) {
|
|
|
6821
6853
|
}
|
|
6822
6854
|
};
|
|
6823
6855
|
}
|
|
6824
|
-
function
|
|
6856
|
+
function Ou(e, t) {
|
|
6825
6857
|
var a;
|
|
6826
6858
|
return {
|
|
6827
6859
|
changed: !0,
|
|
@@ -6837,9 +6869,9 @@ function Au(e, t) {
|
|
|
6837
6869
|
}
|
|
6838
6870
|
};
|
|
6839
6871
|
}
|
|
6840
|
-
function
|
|
6872
|
+
function Du(e, t) {
|
|
6841
6873
|
var a;
|
|
6842
|
-
return
|
|
6874
|
+
return yu(t, (a = e.layoutOptions) == null ? void 0 : a.widgetsPanel) ? { changed: !1, updatedDashboardProps: e } : {
|
|
6843
6875
|
changed: !0,
|
|
6844
6876
|
updatedDashboardProps: {
|
|
6845
6877
|
...e,
|
|
@@ -6850,7 +6882,7 @@ function Ou(e, t) {
|
|
|
6850
6882
|
}
|
|
6851
6883
|
};
|
|
6852
6884
|
}
|
|
6853
|
-
function
|
|
6885
|
+
function Fu(e, t) {
|
|
6854
6886
|
return {
|
|
6855
6887
|
changed: !0,
|
|
6856
6888
|
updatedDashboardProps: an(
|
|
@@ -6859,7 +6891,7 @@ function Du(e, t) {
|
|
|
6859
6891
|
)
|
|
6860
6892
|
};
|
|
6861
6893
|
}
|
|
6862
|
-
function
|
|
6894
|
+
function Mu(e, t) {
|
|
6863
6895
|
var a, r, n;
|
|
6864
6896
|
return {
|
|
6865
6897
|
changed: !0,
|
|
@@ -6879,7 +6911,7 @@ function Fu(e, t) {
|
|
|
6879
6911
|
}
|
|
6880
6912
|
};
|
|
6881
6913
|
}
|
|
6882
|
-
function
|
|
6914
|
+
function Tu(e) {
|
|
6883
6915
|
const t = /* @__PURE__ */ new Map(), { widgets: a, defaultDataSource: r } = e;
|
|
6884
6916
|
return r && Et(r) && t.set(
|
|
6885
6917
|
r.title,
|
|
@@ -6941,7 +6973,7 @@ function Ma(e) {
|
|
|
6941
6973
|
]
|
|
6942
6974
|
};
|
|
6943
6975
|
}
|
|
6944
|
-
function
|
|
6976
|
+
function Eu(e, t) {
|
|
6945
6977
|
const r = {
|
|
6946
6978
|
cells: [{
|
|
6947
6979
|
widthPercentage: 100,
|
|
@@ -7000,7 +7032,7 @@ function Xr() {
|
|
|
7000
7032
|
}
|
|
7001
7033
|
};
|
|
7002
7034
|
}
|
|
7003
|
-
function
|
|
7035
|
+
function ku() {
|
|
7004
7036
|
return {
|
|
7005
7037
|
title: "Dashboard Title",
|
|
7006
7038
|
widgets: [],
|
|
@@ -7020,7 +7052,7 @@ async function en(e, t, a) {
|
|
|
7020
7052
|
);
|
|
7021
7053
|
const n = $a(r);
|
|
7022
7054
|
return {
|
|
7023
|
-
...
|
|
7055
|
+
...ku(),
|
|
7024
7056
|
title: t,
|
|
7025
7057
|
defaultDataSource: n
|
|
7026
7058
|
};
|
|
@@ -7028,16 +7060,16 @@ async function en(e, t, a) {
|
|
|
7028
7060
|
function tn(e) {
|
|
7029
7061
|
return {
|
|
7030
7062
|
...e,
|
|
7031
|
-
id:
|
|
7063
|
+
id: ce()
|
|
7032
7064
|
};
|
|
7033
7065
|
}
|
|
7034
|
-
function
|
|
7066
|
+
function Nu(e, t) {
|
|
7035
7067
|
return {
|
|
7036
7068
|
...e,
|
|
7037
7069
|
widgets: [...e.widgets, ...t]
|
|
7038
7070
|
};
|
|
7039
7071
|
}
|
|
7040
|
-
function
|
|
7072
|
+
function $u(e, t = []) {
|
|
7041
7073
|
var i;
|
|
7042
7074
|
const a = (i = e.layoutOptions) == null ? void 0 : i.widgetsPanel;
|
|
7043
7075
|
let r = a || {
|
|
@@ -7048,19 +7080,19 @@ function Nu(e, t = []) {
|
|
|
7048
7080
|
) : (r || (r = Ma(
|
|
7049
7081
|
e.widgets.map((o) => o.id)
|
|
7050
7082
|
)), t.forEach((o) => {
|
|
7051
|
-
r =
|
|
7083
|
+
r = Eu(r, o);
|
|
7052
7084
|
})), {
|
|
7053
7085
|
...e,
|
|
7054
7086
|
layoutOptions: { widgetsPanel: r }
|
|
7055
7087
|
};
|
|
7056
7088
|
}
|
|
7057
|
-
function
|
|
7089
|
+
function Pu(e, t) {
|
|
7058
7090
|
return {
|
|
7059
7091
|
...e,
|
|
7060
7092
|
title: t
|
|
7061
7093
|
};
|
|
7062
7094
|
}
|
|
7063
|
-
async function
|
|
7095
|
+
async function _u(e, t, a = [], r) {
|
|
7064
7096
|
const n = await en(
|
|
7065
7097
|
e,
|
|
7066
7098
|
t,
|
|
@@ -7071,11 +7103,11 @@ async function Pu(e, t, a = [], r) {
|
|
|
7071
7103
|
function na(e, t) {
|
|
7072
7104
|
if (t.length === 0)
|
|
7073
7105
|
return e;
|
|
7074
|
-
const a =
|
|
7106
|
+
const a = Nu(
|
|
7075
7107
|
e,
|
|
7076
7108
|
t
|
|
7077
7109
|
);
|
|
7078
|
-
return
|
|
7110
|
+
return $u(
|
|
7079
7111
|
a,
|
|
7080
7112
|
t.map((n) => n.id)
|
|
7081
7113
|
);
|
|
@@ -7091,18 +7123,18 @@ function an(e, t) {
|
|
|
7091
7123
|
function xu(e, t) {
|
|
7092
7124
|
switch (t.type) {
|
|
7093
7125
|
case "filters/updated":
|
|
7094
|
-
return Su(e, t.payload);
|
|
7095
|
-
case "filtersPanel/collapse/changed":
|
|
7096
7126
|
return Au(e, t.payload);
|
|
7127
|
+
case "filtersPanel/collapse/changed":
|
|
7128
|
+
return Ou(e, t.payload);
|
|
7097
7129
|
case "widgetsPanel/layout/updated":
|
|
7098
|
-
return
|
|
7130
|
+
return Du(
|
|
7099
7131
|
e,
|
|
7100
7132
|
t.payload
|
|
7101
7133
|
);
|
|
7102
7134
|
case "widgets/deleted":
|
|
7103
|
-
return
|
|
7135
|
+
return Fu(e, t.payload);
|
|
7104
7136
|
case "widgetsPanel/editMode/isEditing/changed":
|
|
7105
|
-
return
|
|
7137
|
+
return Mu(
|
|
7106
7138
|
e,
|
|
7107
7139
|
t.payload
|
|
7108
7140
|
);
|
|
@@ -7110,14 +7142,14 @@ function xu(e, t) {
|
|
|
7110
7142
|
return { changed: !1, updatedDashboardProps: e };
|
|
7111
7143
|
}
|
|
7112
7144
|
}
|
|
7113
|
-
function
|
|
7145
|
+
function Rc(e, t) {
|
|
7114
7146
|
const { changed: a, updatedDashboardProps: r } = xu(
|
|
7115
7147
|
e,
|
|
7116
7148
|
t
|
|
7117
7149
|
);
|
|
7118
|
-
return a ?
|
|
7150
|
+
return a ? Su(r) : { changed: a, updatedDashboardProps: r };
|
|
7119
7151
|
}
|
|
7120
|
-
const
|
|
7152
|
+
const Iu = async ({ dashboardTitle: e, widgetIdsToAdd: t }, a) => {
|
|
7121
7153
|
const { dataSourceTitle: r, getWidgetList: n, saveDashboard: i, httpClient: o } = a;
|
|
7122
7154
|
console.debug(
|
|
7123
7155
|
"toolCall",
|
|
@@ -7134,16 +7166,16 @@ const _u = async ({ dashboardTitle: e, widgetIdsToAdd: t }, a) => {
|
|
|
7134
7166
|
c
|
|
7135
7167
|
);
|
|
7136
7168
|
}
|
|
7137
|
-
const u = await
|
|
7169
|
+
const u = await _u(
|
|
7138
7170
|
r,
|
|
7139
7171
|
e || `Dashboard for ${r}`,
|
|
7140
7172
|
l,
|
|
7141
7173
|
o
|
|
7142
7174
|
);
|
|
7143
|
-
return u.artifactId =
|
|
7175
|
+
return u.artifactId = ce(), i == null || i(u), {
|
|
7144
7176
|
message: l.length > 0 ? 'Dashboard created successfully. Click "Save" to persist to My Dashboards.' : "Dashboard created with no chart widgets. Run the createChartWidgetForDashboard tool to create one."
|
|
7145
7177
|
};
|
|
7146
|
-
},
|
|
7178
|
+
}, ju = async ({ dashboardTitle: e }, t) => {
|
|
7147
7179
|
const { saveDashboard: a, httpClient: r } = t;
|
|
7148
7180
|
console.debug("toolCall", "loadExistingFusionDashboard", e);
|
|
7149
7181
|
const i = (await Kr(r)).find(
|
|
@@ -7153,7 +7185,7 @@ const _u = async ({ dashboardTitle: e, widgetIdsToAdd: t }, a) => {
|
|
|
7153
7185
|
throw new Error(
|
|
7154
7186
|
`Fusion dashboard with title ${e} not found`
|
|
7155
7187
|
);
|
|
7156
|
-
const o = await
|
|
7188
|
+
const o = await ou(
|
|
7157
7189
|
i.dashboardId,
|
|
7158
7190
|
r
|
|
7159
7191
|
), l = {
|
|
@@ -7164,19 +7196,19 @@ const _u = async ({ dashboardTitle: e, widgetIdsToAdd: t }, a) => {
|
|
|
7164
7196
|
...Xr()
|
|
7165
7197
|
},
|
|
7166
7198
|
// Generate a new artifact id for the dashboard
|
|
7167
|
-
artifactId: o.artifactId ||
|
|
7199
|
+
artifactId: o.artifactId || ce()
|
|
7168
7200
|
};
|
|
7169
7201
|
return a == null || a(l), {
|
|
7170
7202
|
message: "Dashboard loaded successfully from Fusion."
|
|
7171
7203
|
};
|
|
7172
|
-
},
|
|
7204
|
+
}, Ru = async ({ dashboardId: e, dashboardTitle: t }, a) => {
|
|
7173
7205
|
const { retrieveDashboard: r, saveDashboard: n } = a;
|
|
7174
7206
|
console.debug("toolCall", "updateDashboard", e, t);
|
|
7175
7207
|
const i = r == null ? void 0 : r(e);
|
|
7176
7208
|
if (!i)
|
|
7177
7209
|
throw new Error("Dashboard not found");
|
|
7178
7210
|
let o = i;
|
|
7179
|
-
return t && t !== o.title && (o =
|
|
7211
|
+
return t && t !== o.title && (o = Pu(o, t)), n == null || n(o), {
|
|
7180
7212
|
message: 'Dashboard updated successfully. Click "Save" to persist changes to My Dashboards.'
|
|
7181
7213
|
};
|
|
7182
7214
|
}, Lu = async ({ dashboardId: e, widgetIdsToAdd: t }, a) => {
|
|
@@ -7206,7 +7238,7 @@ const _u = async ({ dashboardTitle: e, widgetIdsToAdd: t }, a) => {
|
|
|
7206
7238
|
return n == null || n(u), {
|
|
7207
7239
|
message: l.length > 0 ? 'Widgets added successfully. Click "Save" to persist changes to My Dashboards.' : t.length > 0 ? "Widgets cannot be located. Try to create chart widgets one by one and add them to the dashboard." : "Widgets cannot be located. Run the recommend queries tool and add them all as widgets to the dashboard."
|
|
7208
7240
|
};
|
|
7209
|
-
},
|
|
7241
|
+
}, Bu = `import {
|
|
7210
7242
|
DateDimension,
|
|
7211
7243
|
LevelAttribute,
|
|
7212
7244
|
Attribute,
|
|
@@ -8195,7 +8227,7 @@ export declare function customFilter(
|
|
|
8195
8227
|
attribute: Attribute,
|
|
8196
8228
|
jaql: any,
|
|
8197
8229
|
config?: BaseFilterConfig,
|
|
8198
|
-
): Filter;`,
|
|
8230
|
+
): Filter;`, qu = `import {
|
|
8199
8231
|
Attribute,
|
|
8200
8232
|
Measure,
|
|
8201
8233
|
Filter,
|
|
@@ -9201,17 +9233,17 @@ export declare function rank(
|
|
|
9201
9233
|
rankType?: string,
|
|
9202
9234
|
groupBy?: Attribute[],
|
|
9203
9235
|
): CalculatedMeasure;`;
|
|
9204
|
-
function
|
|
9236
|
+
function Uu() {
|
|
9205
9237
|
return `You are an expert in translating natural language into JSON filter expressions for data filtering.
|
|
9206
9238
|
|
|
9207
9239
|
**Task:** Convert user prompts into JSON filter objects using the provided resources. DO NOT use any tools.
|
|
9208
9240
|
|
|
9209
9241
|
**Available Resources:**
|
|
9210
9242
|
1. **Measure Factory Types:**
|
|
9211
|
-
${
|
|
9243
|
+
${qu}
|
|
9212
9244
|
|
|
9213
9245
|
2. **Filter Factory Types:**
|
|
9214
|
-
${
|
|
9246
|
+
${Bu}
|
|
9215
9247
|
|
|
9216
9248
|
**Data Model Structure:**
|
|
9217
9249
|
- DM.TableName.ColumnName (e.g., DM.Commerce.Revenue) - Use exact names.
|
|
@@ -9322,7 +9354,7 @@ const Ta = ia(
|
|
|
9322
9354
|
"filterFactory",
|
|
9323
9355
|
Pa
|
|
9324
9356
|
);
|
|
9325
|
-
function
|
|
9357
|
+
function Zu(e, t) {
|
|
9326
9358
|
const r = e.split(".")[0];
|
|
9327
9359
|
if (r === "filterFactory") {
|
|
9328
9360
|
if (Ea[e])
|
|
@@ -9333,7 +9365,7 @@ function Uu(e, t) {
|
|
|
9333
9365
|
`Function "${e}" not found in filterFactory or measureFactory.`
|
|
9334
9366
|
);
|
|
9335
9367
|
}
|
|
9336
|
-
function
|
|
9368
|
+
function zu(e, t, a) {
|
|
9337
9369
|
const r = a.find(
|
|
9338
9370
|
(n) => `DM.${n.table}.${n.column}` === e
|
|
9339
9371
|
);
|
|
@@ -9350,16 +9382,16 @@ function Zu(e, t, a) {
|
|
|
9350
9382
|
dataSource: t
|
|
9351
9383
|
});
|
|
9352
9384
|
}
|
|
9353
|
-
function
|
|
9354
|
-
return typeof e == "object" && e !== null && e.function && e.args ? rn(e, t, a) : typeof e == "string" && e.startsWith("DM.") ?
|
|
9385
|
+
function Wu(e, t, a) {
|
|
9386
|
+
return typeof e == "object" && e !== null && e.function && e.args ? rn(e, t, a) : typeof e == "string" && e.startsWith("DM.") ? zu(e, t, a) : e;
|
|
9355
9387
|
}
|
|
9356
9388
|
function rn(e, t, a) {
|
|
9357
9389
|
const { function: r, args: n } = e, i = n.map(
|
|
9358
|
-
(o) =>
|
|
9390
|
+
(o) => Wu(o, t, a)
|
|
9359
9391
|
);
|
|
9360
|
-
return
|
|
9392
|
+
return Zu(r, i);
|
|
9361
9393
|
}
|
|
9362
|
-
function
|
|
9394
|
+
function Vu(e) {
|
|
9363
9395
|
const { attribute: t, config: a } = e;
|
|
9364
9396
|
if (Sn(e) && "granularity" in t) {
|
|
9365
9397
|
const r = t.granularity;
|
|
@@ -9371,24 +9403,24 @@ function Wu(e) {
|
|
|
9371
9403
|
}
|
|
9372
9404
|
return e;
|
|
9373
9405
|
}
|
|
9374
|
-
function
|
|
9375
|
-
return Cn(e) ? e : [e].map(
|
|
9406
|
+
function Ju(e) {
|
|
9407
|
+
return Cn(e) ? e : [e].map(Vu);
|
|
9376
9408
|
}
|
|
9377
|
-
const
|
|
9409
|
+
const Yu = (e, t, a) => {
|
|
9378
9410
|
const r = JSON.parse(e), n = rn(r, t, a);
|
|
9379
|
-
return
|
|
9380
|
-
},
|
|
9411
|
+
return Ju(n);
|
|
9412
|
+
}, Hu = s.object({
|
|
9381
9413
|
filtersJson: s.string().describe("A JSON string representing the filters"),
|
|
9382
9414
|
explanation: s.string().describe(
|
|
9383
9415
|
"A non-technical explanation of how the filters were manipulated"
|
|
9384
9416
|
)
|
|
9385
|
-
}),
|
|
9386
|
-
const i =
|
|
9417
|
+
}), Qu = async (e, t, a, r) => {
|
|
9418
|
+
const i = Tu(a).get(t);
|
|
9387
9419
|
if (!i)
|
|
9388
9420
|
throw new Error(
|
|
9389
9421
|
`Data source "${t}" not found in dashboard. Please ask the user to specify a valid data source.`
|
|
9390
9422
|
);
|
|
9391
|
-
const o =
|
|
9423
|
+
const o = Uu(), l = await pl(t), u = `${e}
|
|
9392
9424
|
|
|
9393
9425
|
Available Data Fields:
|
|
9394
9426
|
${JSON.stringify(
|
|
@@ -9401,13 +9433,13 @@ ${JSON.stringify(
|
|
|
9401
9433
|
openAIClient: r,
|
|
9402
9434
|
responseFormat: {
|
|
9403
9435
|
type: "json_schema",
|
|
9404
|
-
schema:
|
|
9436
|
+
schema: Hu,
|
|
9405
9437
|
name: "filters"
|
|
9406
9438
|
}
|
|
9407
9439
|
}), { filtersJson: m, explanation: d } = c;
|
|
9408
9440
|
if (!m)
|
|
9409
9441
|
throw new Error("Failed to manipulate filters");
|
|
9410
|
-
const f =
|
|
9442
|
+
const f = Yu(
|
|
9411
9443
|
m,
|
|
9412
9444
|
i,
|
|
9413
9445
|
l
|
|
@@ -9419,7 +9451,7 @@ ${JSON.stringify(
|
|
|
9419
9451
|
},
|
|
9420
9452
|
explanation: d
|
|
9421
9453
|
};
|
|
9422
|
-
},
|
|
9454
|
+
}, Gu = async ({ dashboardId: e, userPrompt: t }, a) => {
|
|
9423
9455
|
const { dataSourceTitle: r, retrieveDashboard: n, saveDashboard: i, openAIClient: o } = a;
|
|
9424
9456
|
console.debug(
|
|
9425
9457
|
"toolCall",
|
|
@@ -9431,7 +9463,7 @@ ${JSON.stringify(
|
|
|
9431
9463
|
const l = n == null ? void 0 : n(e);
|
|
9432
9464
|
if (!l)
|
|
9433
9465
|
throw new Error("Dashboard not found");
|
|
9434
|
-
const { dashboardProps: u, explanation: c } = await
|
|
9466
|
+
const { dashboardProps: u, explanation: c } = await Qu(
|
|
9435
9467
|
t,
|
|
9436
9468
|
r,
|
|
9437
9469
|
l,
|
|
@@ -9440,7 +9472,7 @@ ${JSON.stringify(
|
|
|
9440
9472
|
return i == null || i(u), {
|
|
9441
9473
|
message: `${c} Click "Save" to persist changes to My Dashboards.`
|
|
9442
9474
|
};
|
|
9443
|
-
},
|
|
9475
|
+
}, Ku = async ({ dashboardId: e, userPrompt: t }, a) => {
|
|
9444
9476
|
console.debug(
|
|
9445
9477
|
"toolCall",
|
|
9446
9478
|
"createChartWidgetForDashboard",
|
|
@@ -9478,8 +9510,8 @@ ${JSON.stringify(
|
|
|
9478
9510
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9479
9511
|
retrieveChart: (S) => f,
|
|
9480
9512
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9481
|
-
saveChart: (S,
|
|
9482
|
-
f =
|
|
9513
|
+
saveChart: (S, b) => {
|
|
9514
|
+
f = b;
|
|
9483
9515
|
},
|
|
9484
9516
|
isNlqV3Enabled: c,
|
|
9485
9517
|
httpClient: l,
|
|
@@ -9497,7 +9529,7 @@ ${JSON.stringify(
|
|
|
9497
9529
|
return o == null || o(y), {
|
|
9498
9530
|
message: m && f ? 'Dashboard created and chart widget added successfully. Click "Save" to persist changes to My Dashboards.' : `Chart widget (widgetId: ${h.id}) added to the dashboard successfully. Click "Save" to persist changes to My Dashboards.`
|
|
9499
9531
|
};
|
|
9500
|
-
},
|
|
9532
|
+
}, Xu = async ({ dashboardId: e, widgetId: t, userPrompt: a }, r) => {
|
|
9501
9533
|
console.debug(
|
|
9502
9534
|
"toolCall",
|
|
9503
9535
|
"updateChartWidgetForDashboard",
|
|
@@ -9520,7 +9552,7 @@ ${JSON.stringify(
|
|
|
9520
9552
|
if (!d)
|
|
9521
9553
|
throw new Error("Dashboard not found.");
|
|
9522
9554
|
let f = d.widgets.findIndex(
|
|
9523
|
-
(
|
|
9555
|
+
(b) => b.id === t
|
|
9524
9556
|
);
|
|
9525
9557
|
f === -1 && (console.debug(
|
|
9526
9558
|
"Widget not found. Retrieving the last chart widget from dashboard."
|
|
@@ -9543,11 +9575,11 @@ ${JSON.stringify(
|
|
|
9543
9575
|
dataSourceTitle: i,
|
|
9544
9576
|
chartSummaries: h,
|
|
9545
9577
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9546
|
-
retrieveChart: (
|
|
9578
|
+
retrieveChart: (b) => g,
|
|
9547
9579
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9548
|
-
saveChart: (
|
|
9580
|
+
saveChart: (b, F) => {
|
|
9549
9581
|
const E = {
|
|
9550
|
-
...
|
|
9582
|
+
...F,
|
|
9551
9583
|
id: t
|
|
9552
9584
|
};
|
|
9553
9585
|
d.widgets[f] = E, g = E;
|
|
@@ -9578,7 +9610,7 @@ ${JSON.stringify(
|
|
|
9578
9610
|
widgetType: a.widgetType
|
|
9579
9611
|
} : {}
|
|
9580
9612
|
}))
|
|
9581
|
-
}),
|
|
9613
|
+
}), ie = (e, t, a, r, n) => Ba({
|
|
9582
9614
|
schema: e,
|
|
9583
9615
|
name: t,
|
|
9584
9616
|
description: a,
|
|
@@ -9586,58 +9618,58 @@ ${JSON.stringify(
|
|
|
9586
9618
|
{ ...i },
|
|
9587
9619
|
{ ...n, ...o }
|
|
9588
9620
|
)
|
|
9589
|
-
}),
|
|
9590
|
-
|
|
9591
|
-
|
|
9621
|
+
}), ec = (e) => [
|
|
9622
|
+
ie(
|
|
9623
|
+
cu,
|
|
9592
9624
|
"loadExistingFusionDashboard",
|
|
9593
9625
|
"Load an existing Fusion dashboard by title",
|
|
9594
|
-
|
|
9626
|
+
ju,
|
|
9595
9627
|
e
|
|
9596
9628
|
),
|
|
9597
|
-
|
|
9598
|
-
|
|
9629
|
+
ie(
|
|
9630
|
+
uu,
|
|
9599
9631
|
"createDashboard",
|
|
9600
9632
|
"Create a new dashboard with optional widgets",
|
|
9601
|
-
|
|
9633
|
+
Iu,
|
|
9602
9634
|
e
|
|
9603
9635
|
),
|
|
9604
|
-
|
|
9605
|
-
|
|
9636
|
+
ie(
|
|
9637
|
+
mu,
|
|
9606
9638
|
"updateDashboard",
|
|
9607
9639
|
"Update the title of an existing dashboard",
|
|
9608
|
-
|
|
9640
|
+
Ru,
|
|
9609
9641
|
e
|
|
9610
9642
|
),
|
|
9611
|
-
|
|
9612
|
-
|
|
9643
|
+
ie(
|
|
9644
|
+
du,
|
|
9613
9645
|
"addDashboardWidgets",
|
|
9614
9646
|
"Add existing chart or chart list to an existing dashboard",
|
|
9615
9647
|
Lu,
|
|
9616
9648
|
e
|
|
9617
9649
|
),
|
|
9618
|
-
|
|
9619
|
-
|
|
9650
|
+
ie(
|
|
9651
|
+
fu,
|
|
9620
9652
|
"createChartWidgetForDashboard",
|
|
9621
9653
|
"Create a new chart widget and add it to the dashboard",
|
|
9622
|
-
|
|
9654
|
+
Ku,
|
|
9623
9655
|
e
|
|
9624
9656
|
),
|
|
9625
|
-
|
|
9626
|
-
|
|
9657
|
+
ie(
|
|
9658
|
+
pu,
|
|
9627
9659
|
"updateChartWidgetForDashboard",
|
|
9628
9660
|
"Update an existing chart widget in the dashboard.",
|
|
9629
|
-
|
|
9661
|
+
Xu,
|
|
9630
9662
|
e
|
|
9631
9663
|
),
|
|
9632
|
-
|
|
9633
|
-
|
|
9664
|
+
ie(
|
|
9665
|
+
hu,
|
|
9634
9666
|
"addDashboardFilters",
|
|
9635
9667
|
"Add combined filters to an existing dashboard. Do not split the prompt into multiple filters.",
|
|
9636
|
-
|
|
9668
|
+
Gu,
|
|
9637
9669
|
e
|
|
9638
9670
|
)
|
|
9639
9671
|
];
|
|
9640
|
-
function
|
|
9672
|
+
function tc(e, t, a) {
|
|
9641
9673
|
return `You are an intelligent and proactive dashboard assistant.
|
|
9642
9674
|
Your role is to create, load, and update a dashboard, its widgets, and its filters based on natural language requests by using the available tools.
|
|
9643
9675
|
|
|
@@ -9661,7 +9693,7 @@ function ec(e, t, a) {
|
|
|
9661
9693
|
8. To update a chart widget, make sure the widget exists within the dashboard.
|
|
9662
9694
|
`;
|
|
9663
9695
|
}
|
|
9664
|
-
async function
|
|
9696
|
+
async function Lc(e, t) {
|
|
9665
9697
|
const { dataSourceTitle: a, userPrompt: r } = e;
|
|
9666
9698
|
if (console.debug(ko, a, r), !r)
|
|
9667
9699
|
throw new Error(
|
|
@@ -9698,12 +9730,12 @@ async function jc(e, t) {
|
|
|
9698
9730
|
} catch {
|
|
9699
9731
|
}
|
|
9700
9732
|
return h;
|
|
9701
|
-
}), m =
|
|
9733
|
+
}), m = tc(
|
|
9702
9734
|
(t.chartSummaries ?? []).slice(-at),
|
|
9703
9735
|
// only use the latest chart list summary so that the LLM can focus on the latest recommendations
|
|
9704
9736
|
(t.chartListSummaries ?? []).slice(-1),
|
|
9705
9737
|
c.slice(-at)
|
|
9706
|
-
), d =
|
|
9738
|
+
), d = ec(u), { combinedMessage: f, isError: p } = await sr({
|
|
9707
9739
|
systemPrompt: m,
|
|
9708
9740
|
userPrompt: r,
|
|
9709
9741
|
tools: d,
|
|
@@ -9718,7 +9750,7 @@ async function jc(e, t) {
|
|
|
9718
9750
|
dashboard: i ? ka(i, a) : void 0
|
|
9719
9751
|
};
|
|
9720
9752
|
}
|
|
9721
|
-
const
|
|
9753
|
+
const ac = 4, Bc = s.object({
|
|
9722
9754
|
dataSourceTitle: s.string().describe("Data source title"),
|
|
9723
9755
|
queryCount: s.number().optional().describe("Number of recommended queries to return."),
|
|
9724
9756
|
userPrompt: s.string().optional().describe(
|
|
@@ -9727,7 +9759,7 @@ const tc = 4, Lc = s.object({
|
|
|
9727
9759
|
existingWidgets: s.array(s.string()).optional().describe(
|
|
9728
9760
|
"List of existing widget titles/descriptions to avoid duplicates when adding to existing dashboard."
|
|
9729
9761
|
)
|
|
9730
|
-
}),
|
|
9762
|
+
}), rc = {
|
|
9731
9763
|
bar: "bar",
|
|
9732
9764
|
column: "column",
|
|
9733
9765
|
line: "line",
|
|
@@ -9740,13 +9772,13 @@ const tc = 4, Lc = s.object({
|
|
|
9740
9772
|
sunburst: "sunburst",
|
|
9741
9773
|
boxplot: "boxplot"
|
|
9742
9774
|
};
|
|
9743
|
-
function
|
|
9775
|
+
function nc(e) {
|
|
9744
9776
|
const t = e.toLowerCase();
|
|
9745
|
-
for (const [a, r] of Object.entries(
|
|
9777
|
+
for (const [a, r] of Object.entries(rc))
|
|
9746
9778
|
if (t.includes(a))
|
|
9747
9779
|
return r;
|
|
9748
9780
|
}
|
|
9749
|
-
function
|
|
9781
|
+
function ic(e, t) {
|
|
9750
9782
|
if (!e && !(t != null && t.length))
|
|
9751
9783
|
return;
|
|
9752
9784
|
let a = "";
|
|
@@ -9760,10 +9792,10 @@ ${[...new Set(t)].map((i) => `- ${i}`).join(`
|
|
|
9760
9792
|
}
|
|
9761
9793
|
return a;
|
|
9762
9794
|
}
|
|
9763
|
-
async function
|
|
9795
|
+
async function qc(e, t, a) {
|
|
9764
9796
|
const {
|
|
9765
9797
|
dataSourceTitle: r,
|
|
9766
|
-
queryCount: n =
|
|
9798
|
+
queryCount: n = ac,
|
|
9767
9799
|
userPrompt: i,
|
|
9768
9800
|
existingWidgets: o
|
|
9769
9801
|
} = e, l = "Error: Failed to get recommended queries";
|
|
@@ -9780,7 +9812,7 @@ async function Rc(e, t, a) {
|
|
|
9780
9812
|
throw new Error(
|
|
9781
9813
|
"Error: Data source not found. Make sure to create a model first"
|
|
9782
9814
|
);
|
|
9783
|
-
const c =
|
|
9815
|
+
const c = ic(i, o), m = await as(
|
|
9784
9816
|
r,
|
|
9785
9817
|
{
|
|
9786
9818
|
numOfRecommendations: n,
|
|
@@ -9797,35 +9829,36 @@ async function Rc(e, t, a) {
|
|
|
9797
9829
|
}));
|
|
9798
9830
|
a(p);
|
|
9799
9831
|
}
|
|
9800
|
-
const d = i ?
|
|
9832
|
+
const d = i ? nc(i) : void 0;
|
|
9801
9833
|
return {
|
|
9802
9834
|
recommendations: await Promise.all(
|
|
9803
9835
|
m.map(async (p) => {
|
|
9804
|
-
const g = d ? `Create a ${d} chart visualization` : "Create a chart visualization"
|
|
9836
|
+
const g = d ? `Create a ${d} chart visualization` : "Create a chart visualization", { widgetProps: h, queryResult: y } = await cr(
|
|
9837
|
+
{
|
|
9838
|
+
dataSourceTitle: r,
|
|
9839
|
+
queryPrompt: p.nlqPrompt,
|
|
9840
|
+
chartPrompt: g,
|
|
9841
|
+
chartType: d,
|
|
9842
|
+
chartTitle: p.nlqPrompt
|
|
9843
|
+
},
|
|
9844
|
+
{
|
|
9845
|
+
toolCallId: t.toolCallId,
|
|
9846
|
+
isNlqV3Enabled: t.isNlqV3Enabled,
|
|
9847
|
+
httpClient: t.httpClient,
|
|
9848
|
+
openAIClient: t.openAIClient
|
|
9849
|
+
}
|
|
9850
|
+
);
|
|
9805
9851
|
return {
|
|
9806
|
-
...
|
|
9807
|
-
{
|
|
9808
|
-
dataSourceTitle: r,
|
|
9809
|
-
queryPrompt: p.nlqPrompt,
|
|
9810
|
-
chartPrompt: g,
|
|
9811
|
-
chartType: d,
|
|
9812
|
-
chartTitle: p.nlqPrompt
|
|
9813
|
-
},
|
|
9814
|
-
{
|
|
9815
|
-
toolCallId: t.toolCallId,
|
|
9816
|
-
isNlqV3Enabled: t.isNlqV3Enabled,
|
|
9817
|
-
httpClient: t.httpClient,
|
|
9818
|
-
openAIClient: t.openAIClient
|
|
9819
|
-
}
|
|
9820
|
-
),
|
|
9852
|
+
...h,
|
|
9821
9853
|
nlqPrompt: p.nlqPrompt,
|
|
9822
|
-
detailedDescription: p.detailedDescription
|
|
9854
|
+
detailedDescription: p.detailedDescription,
|
|
9855
|
+
...y !== void 0 && { queryResult: y }
|
|
9823
9856
|
};
|
|
9824
9857
|
})
|
|
9825
9858
|
)
|
|
9826
9859
|
};
|
|
9827
9860
|
}
|
|
9828
|
-
async function
|
|
9861
|
+
async function Uc({ title: e }) {
|
|
9829
9862
|
var n;
|
|
9830
9863
|
const t = C(), a = {
|
|
9831
9864
|
operationName: "createNewElasticube",
|
|
@@ -9911,7 +9944,7 @@ fragment experiments on Experiments {
|
|
|
9911
9944
|
throw new Error(r.errors[0].error.message);
|
|
9912
9945
|
return (n = r == null ? void 0 : r.data) == null ? void 0 : n.newCube;
|
|
9913
9946
|
}
|
|
9914
|
-
async function
|
|
9947
|
+
async function Zc({
|
|
9915
9948
|
filePath: e,
|
|
9916
9949
|
fileName: t
|
|
9917
9950
|
}) {
|
|
@@ -9938,14 +9971,14 @@ async function qc({
|
|
|
9938
9971
|
a
|
|
9939
9972
|
) ?? null;
|
|
9940
9973
|
}
|
|
9941
|
-
async function
|
|
9974
|
+
async function zc({
|
|
9942
9975
|
elasticubeOid: e
|
|
9943
9976
|
}) {
|
|
9944
9977
|
return await C().get(
|
|
9945
9978
|
`/api/v2/perspectives/getPerspectiveElasticubesAndLatestRevisionsByOid?parentOid=${e}`
|
|
9946
9979
|
) ?? null;
|
|
9947
9980
|
}
|
|
9948
|
-
async function
|
|
9981
|
+
async function Wc({
|
|
9949
9982
|
elasticubeOid: e,
|
|
9950
9983
|
filePath: t,
|
|
9951
9984
|
fileName: a,
|
|
@@ -10041,7 +10074,7 @@ async function Zc({
|
|
|
10041
10074
|
d
|
|
10042
10075
|
), columns: m, tableOid: o };
|
|
10043
10076
|
}
|
|
10044
|
-
async function
|
|
10077
|
+
async function Vc({
|
|
10045
10078
|
elasticubeOid: e
|
|
10046
10079
|
}) {
|
|
10047
10080
|
const t = {
|
|
@@ -10064,12 +10097,12 @@ async function zc({
|
|
|
10064
10097
|
t
|
|
10065
10098
|
) ?? null;
|
|
10066
10099
|
}
|
|
10067
|
-
async function
|
|
10100
|
+
async function Jc() {
|
|
10068
10101
|
return await C().get(
|
|
10069
10102
|
"/api/v2/builds"
|
|
10070
10103
|
) ?? null;
|
|
10071
10104
|
}
|
|
10072
|
-
async function
|
|
10105
|
+
async function Yc({
|
|
10073
10106
|
elasticubeOid: e,
|
|
10074
10107
|
source: t,
|
|
10075
10108
|
target: a
|
|
@@ -10104,7 +10137,7 @@ async function Vc({
|
|
|
10104
10137
|
r
|
|
10105
10138
|
) ?? null;
|
|
10106
10139
|
}
|
|
10107
|
-
async function
|
|
10140
|
+
async function Hc() {
|
|
10108
10141
|
var r;
|
|
10109
10142
|
const e = C(), t = {
|
|
10110
10143
|
operationName: "elasticubesMetadata",
|
|
@@ -10229,7 +10262,7 @@ fragment experiments on Experiments {
|
|
|
10229
10262
|
throw new Error("Failed to get elasticubes list");
|
|
10230
10263
|
return a.data.elasticubesMetadata;
|
|
10231
10264
|
}
|
|
10232
|
-
async function
|
|
10265
|
+
async function Qc({
|
|
10233
10266
|
cubeOid: e
|
|
10234
10267
|
}) {
|
|
10235
10268
|
const t = C(), a = {
|
|
@@ -10405,7 +10438,7 @@ fragment experiments on Experiments {
|
|
|
10405
10438
|
a
|
|
10406
10439
|
) ?? null;
|
|
10407
10440
|
}
|
|
10408
|
-
async function
|
|
10441
|
+
async function Gc({
|
|
10409
10442
|
oid: e,
|
|
10410
10443
|
replacementDataSource: t
|
|
10411
10444
|
}) {
|
|
@@ -10427,7 +10460,7 @@ async function Hc({
|
|
|
10427
10460
|
throw new Error("Failed to delete elasticube");
|
|
10428
10461
|
return n.data.removeElasticubeByOid;
|
|
10429
10462
|
}
|
|
10430
|
-
async function
|
|
10463
|
+
async function oc(e, t) {
|
|
10431
10464
|
const a = C(), r = new File([t], e, { type: "text/csv" }), n = {
|
|
10432
10465
|
filename: e,
|
|
10433
10466
|
size: r.size
|
|
@@ -10439,8 +10472,8 @@ async function ic(e, t) {
|
|
|
10439
10472
|
throw new Error("Failed to get file validation token");
|
|
10440
10473
|
return { file: r, fileToken: i.token };
|
|
10441
10474
|
}
|
|
10442
|
-
async function
|
|
10443
|
-
const a = C(), { fileToken: r, file: n } = await
|
|
10475
|
+
async function Kc(e, t) {
|
|
10476
|
+
const a = C(), { fileToken: r, file: n } = await oc(e, t), i = new FormData();
|
|
10444
10477
|
i.append("file", n);
|
|
10445
10478
|
const o = {
|
|
10446
10479
|
Accept: "application/json",
|
|
@@ -10460,11 +10493,11 @@ async function Qc(e, t) {
|
|
|
10460
10493
|
) : new Error("Failed to upload file");
|
|
10461
10494
|
return await l.json();
|
|
10462
10495
|
}
|
|
10463
|
-
async function
|
|
10496
|
+
async function Xc() {
|
|
10464
10497
|
return await C().get("api/globals");
|
|
10465
10498
|
}
|
|
10466
10499
|
const nn = "api/v2/settings/ai/llm";
|
|
10467
|
-
async function
|
|
10500
|
+
async function em() {
|
|
10468
10501
|
const t = await C().get(
|
|
10469
10502
|
nn
|
|
10470
10503
|
);
|
|
@@ -10472,7 +10505,7 @@ async function Kc() {
|
|
|
10472
10505
|
throw new Error("Failed to load LLM settings");
|
|
10473
10506
|
return t;
|
|
10474
10507
|
}
|
|
10475
|
-
async function
|
|
10508
|
+
async function tm(e) {
|
|
10476
10509
|
const t = C(), a = {
|
|
10477
10510
|
provider: e.provider,
|
|
10478
10511
|
model: e.model,
|
|
@@ -10491,12 +10524,12 @@ async function Xc(e) {
|
|
|
10491
10524
|
}
|
|
10492
10525
|
export {
|
|
10493
10526
|
ga as ALLOWED_HEADERS,
|
|
10494
|
-
|
|
10527
|
+
rc as CHART_TYPE_KEYWORDS,
|
|
10495
10528
|
Zt as DATA_SOURCES_API_URL_PATH,
|
|
10496
10529
|
Ya as DEFAULT_HEADERS,
|
|
10497
10530
|
Qa as DEFAULT_LLM,
|
|
10498
|
-
|
|
10499
|
-
|
|
10531
|
+
ac as DEFAULT_QUERY_COUNT,
|
|
10532
|
+
Hl as FORMULAS_API_URL_PATH,
|
|
10500
10533
|
er as HEADER_FEATURE_NAME,
|
|
10501
10534
|
Xa as HEADER_INTERFACE_NAME,
|
|
10502
10535
|
tr as HEADER_QUOTA_ID,
|
|
@@ -10504,68 +10537,68 @@ export {
|
|
|
10504
10537
|
Ga as HEADER_USER_ACTION_ID,
|
|
10505
10538
|
Ot as MAX_DATA_SOURCE_FIELDS_SUMMARY,
|
|
10506
10539
|
Dt as MAX_DATA_SOURCE_FORMULAS_SUMMARY,
|
|
10507
|
-
|
|
10540
|
+
Ro as QuotaExceededError,
|
|
10508
10541
|
at as TOOL_CONTEXT_MAX_ASSETS,
|
|
10509
|
-
|
|
10542
|
+
xo as TOOL_NAME_BUILD_QUERY,
|
|
10510
10543
|
Eo as TOOL_NAME_CHART_BUILDER,
|
|
10511
10544
|
ko as TOOL_NAME_DASHBOARD_BUILDER,
|
|
10512
|
-
|
|
10545
|
+
gc as TOOL_NAME_DATA_MODEL_BUILDER,
|
|
10513
10546
|
$o as TOOL_NAME_GET_DASHBOARDS,
|
|
10514
10547
|
Po as TOOL_NAME_GET_DATA_SOURCES,
|
|
10515
|
-
|
|
10548
|
+
_o as TOOL_NAME_GET_DATA_SOURCE_FIELDS,
|
|
10516
10549
|
No as TOOL_NAME_RECOMMEND_QUERIES,
|
|
10517
|
-
|
|
10518
|
-
|
|
10519
|
-
|
|
10520
|
-
|
|
10521
|
-
|
|
10522
|
-
|
|
10550
|
+
hu as addDashboardFiltersSchema,
|
|
10551
|
+
du as addDashboardWidgetsSchema,
|
|
10552
|
+
Wc as addDataSet,
|
|
10553
|
+
Yc as addRelation,
|
|
10554
|
+
au as addWidgetToFusionDashboard,
|
|
10555
|
+
Nu as addWidgetsToDashboard,
|
|
10523
10556
|
na as addWidgetsToExistingDashboard,
|
|
10524
|
-
|
|
10525
|
-
|
|
10557
|
+
su as addWidgetsToFusionDashboard,
|
|
10558
|
+
vu as adjustSingleColumnWidth,
|
|
10526
10559
|
Ci as axesMapping,
|
|
10527
10560
|
wr as buildChartEngine,
|
|
10528
|
-
|
|
10529
|
-
|
|
10530
|
-
|
|
10531
|
-
|
|
10532
|
-
|
|
10533
|
-
|
|
10534
|
-
|
|
10535
|
-
|
|
10536
|
-
|
|
10537
|
-
|
|
10538
|
-
|
|
10539
|
-
|
|
10540
|
-
|
|
10561
|
+
fc as buildChartSchema,
|
|
10562
|
+
pc as buildChartSchemaNaturalConversation,
|
|
10563
|
+
ic as buildContextualPrompt,
|
|
10564
|
+
tc as buildContextualSystemPrompt,
|
|
10565
|
+
Lc as buildDashboardEngine,
|
|
10566
|
+
jc as buildDashboardSchema,
|
|
10567
|
+
Vc as buildElasticube,
|
|
10568
|
+
ns as buildQueryEngine,
|
|
10569
|
+
Oc as buildQuerySchema,
|
|
10570
|
+
Jc as buildStatus,
|
|
10571
|
+
Lo as captureConsumption,
|
|
10572
|
+
Rc as changeDashboard,
|
|
10573
|
+
Ac as chartDataOptionsSchemas,
|
|
10541
10574
|
Ai as chartIdSchema,
|
|
10542
10575
|
Di as chartRecommendationsSchema,
|
|
10543
10576
|
st as chartType,
|
|
10544
|
-
|
|
10545
|
-
|
|
10577
|
+
Su as cleanupDashboardAfterChange,
|
|
10578
|
+
wu as cleanupOrphanedCells,
|
|
10546
10579
|
Mi as createChartSchema,
|
|
10547
|
-
|
|
10548
|
-
|
|
10549
|
-
|
|
10580
|
+
fu as createChartWidgetForDashboardSchema,
|
|
10581
|
+
uu as createDashboardSchema,
|
|
10582
|
+
Uc as createElasticube,
|
|
10550
10583
|
en as createEmptyDashboard,
|
|
10551
10584
|
Fa as createEmptyFusionDashboard,
|
|
10552
10585
|
Ha as createHttpClientFromAuthenticator,
|
|
10553
10586
|
To as createHttpClientFromConfig,
|
|
10554
|
-
|
|
10587
|
+
_u as createNewDashboard,
|
|
10555
10588
|
rr as createOpenAIClient,
|
|
10556
10589
|
Qo as createOpenAIClientHelper,
|
|
10557
10590
|
lt as createStructuredCompletion,
|
|
10558
10591
|
sr as createToolsCompletion,
|
|
10559
10592
|
k as dataOptionsEditingSchemas,
|
|
10560
|
-
|
|
10561
|
-
|
|
10593
|
+
Gc as deleteElasticube,
|
|
10594
|
+
$c as deleteFusionDashboard,
|
|
10562
10595
|
an as deleteWidgetsFromDashboard,
|
|
10563
10596
|
Jo as endUserAction,
|
|
10564
10597
|
ci as excludeSchemaProperties,
|
|
10565
|
-
|
|
10566
|
-
|
|
10567
|
-
|
|
10568
|
-
|
|
10598
|
+
nc as extractChartTypeFromPrompt,
|
|
10599
|
+
bu as extractWidgetIdsFromLayout,
|
|
10600
|
+
Lt as filterSchemaProperties,
|
|
10601
|
+
Cu as findOutOfPlaceWidgets,
|
|
10569
10602
|
cr as generateChart,
|
|
10570
10603
|
Uo as generateTraceparent,
|
|
10571
10604
|
qo as generateUserActionId,
|
|
@@ -10573,83 +10606,84 @@ export {
|
|
|
10573
10606
|
br as getBaseChartSummary,
|
|
10574
10607
|
Xr as getBaseDashboardConfig,
|
|
10575
10608
|
ka as getBaseDashboardSummary,
|
|
10576
|
-
|
|
10577
|
-
|
|
10578
|
-
|
|
10579
|
-
|
|
10609
|
+
Zc as getCSVSchemaDetails,
|
|
10610
|
+
Tu as getDashboardDataSourcesMap,
|
|
10611
|
+
xc as getDashboardsEngine,
|
|
10612
|
+
Ic as getDashboardsSchema,
|
|
10580
10613
|
Cr as getDataSourceByTitle,
|
|
10581
|
-
|
|
10582
|
-
|
|
10583
|
-
|
|
10584
|
-
|
|
10614
|
+
dl as getDataSourceFields,
|
|
10615
|
+
Tc as getDataSourceFieldsEngine,
|
|
10616
|
+
kc as getDataSourceFieldsSchema,
|
|
10617
|
+
Ec as getDataSourceFieldsSummary,
|
|
10585
10618
|
Sr as getDataSourceFieldsWithDescriptions,
|
|
10586
10619
|
vr as getDataSourceSchema,
|
|
10587
|
-
|
|
10588
|
-
|
|
10589
|
-
|
|
10590
|
-
|
|
10591
|
-
|
|
10592
|
-
|
|
10593
|
-
|
|
10594
|
-
|
|
10595
|
-
|
|
10596
|
-
|
|
10597
|
-
|
|
10620
|
+
ml as getDataSources,
|
|
10621
|
+
Fc as getDataSourcesEngine,
|
|
10622
|
+
Mc as getDataSourcesSchema,
|
|
10623
|
+
Qc as getElasticube,
|
|
10624
|
+
Hc as getElasticubes,
|
|
10625
|
+
Ql as getFormulasByDataSource,
|
|
10626
|
+
tu as getFusionDashboardModel,
|
|
10627
|
+
iu as getFusionDashboardProps,
|
|
10628
|
+
Nc as getFusionDashboardUrl,
|
|
10629
|
+
eu as getFusionDashboardWidgets,
|
|
10630
|
+
Xl as getFusionDashboards,
|
|
10598
10631
|
C as getHttpClient,
|
|
10599
10632
|
Nt as getHttpErrorStatus,
|
|
10600
|
-
|
|
10601
|
-
|
|
10633
|
+
em as getLlmSettings,
|
|
10634
|
+
Cc as getNlqResult,
|
|
10602
10635
|
es as getNlqResultLight,
|
|
10603
10636
|
ts as getNlqV3Result,
|
|
10604
|
-
|
|
10637
|
+
pl as getNormalizedDataSourceFields,
|
|
10605
10638
|
or as getOpenAIClient,
|
|
10606
|
-
|
|
10607
|
-
|
|
10639
|
+
zc as getPerspectiveOid,
|
|
10640
|
+
Sc as getQueryRecommendations,
|
|
10608
10641
|
as as getQueryRecommendationsLight,
|
|
10609
10642
|
ar as getUserActionHeaders,
|
|
10610
|
-
|
|
10643
|
+
vc as initializeClients,
|
|
10611
10644
|
nr as initializeHttpClient,
|
|
10612
10645
|
ir as initializeOpenAIClient,
|
|
10613
|
-
|
|
10646
|
+
Pc as isDashboardSaved,
|
|
10614
10647
|
Ma as layoutDashboardWidgets,
|
|
10615
|
-
|
|
10616
|
-
|
|
10617
|
-
|
|
10618
|
-
|
|
10648
|
+
ou as loadExistingDashboardFromFusion,
|
|
10649
|
+
cu as loadExistingFusionDashboardSchema,
|
|
10650
|
+
Xc as loadGlobals,
|
|
10651
|
+
ce as nanoidHex,
|
|
10619
10652
|
et as nanoidUUIDv4,
|
|
10620
|
-
|
|
10653
|
+
fl as normalizeFields,
|
|
10621
10654
|
Bt as normalizeUrl,
|
|
10622
10655
|
Si as nullableChartType,
|
|
10623
|
-
|
|
10624
|
-
|
|
10625
|
-
|
|
10656
|
+
hc as parseError,
|
|
10657
|
+
Rt as patchFusionDashboard,
|
|
10658
|
+
_c as persistDashboardToFusion,
|
|
10626
10659
|
Oi as queryIdSchema,
|
|
10627
|
-
|
|
10628
|
-
|
|
10660
|
+
qc as recommendQueriesEngine,
|
|
10661
|
+
Bc as recommendQueriesSchema,
|
|
10629
10662
|
Bo as reportConsumption,
|
|
10630
|
-
|
|
10631
|
-
|
|
10663
|
+
bc as resetHttpClient,
|
|
10664
|
+
wc as resetOpenAIClient,
|
|
10632
10665
|
tn as resetWidgetForDashboard,
|
|
10633
|
-
|
|
10666
|
+
yc as runWithUserAction,
|
|
10634
10667
|
zo as startUserAction,
|
|
10668
|
+
Dc as toQuerySummary,
|
|
10635
10669
|
de as updateChartSchema,
|
|
10636
10670
|
Ni as updateChartSortingSchema,
|
|
10637
|
-
|
|
10671
|
+
_i as updateChartStyleOptionsSchema,
|
|
10638
10672
|
Ti as updateChartTitleSchema,
|
|
10639
10673
|
ki as updateChartTypeOfMeasuresSchema,
|
|
10640
10674
|
Ei as updateChartTypeSchema,
|
|
10641
|
-
|
|
10642
|
-
|
|
10643
|
-
|
|
10644
|
-
|
|
10645
|
-
|
|
10646
|
-
|
|
10675
|
+
pu as updateChartWidgetForDashboardSchema,
|
|
10676
|
+
mu as updateDashboardSchema,
|
|
10677
|
+
Pu as updateDashboardTitle,
|
|
10678
|
+
$u as updateDashboardWidgetsLayout,
|
|
10679
|
+
lu as updateFusionDashboardFilters,
|
|
10680
|
+
tm as updateLlmSettings,
|
|
10647
10681
|
Pi as updateOtherChartDataOptionsSchema,
|
|
10648
10682
|
$i as updateTrendAndForecastSchema,
|
|
10649
|
-
|
|
10683
|
+
Kc as uploadCSVMultipart,
|
|
10650
10684
|
me as withTrackingHeaders,
|
|
10651
|
-
|
|
10685
|
+
Eu as withWidgetAdded,
|
|
10652
10686
|
Ba as zodFunction,
|
|
10653
|
-
|
|
10687
|
+
se as zodToReadableType
|
|
10654
10688
|
};
|
|
10655
10689
|
//# sourceMappingURL=index.js.map
|