kollab 0.1.28 → 0.1.29
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/index.js +183 -114
- package/dist/kollab-sidecar.cjs +444 -374
- package/package.json +1 -1
package/dist/kollab-sidecar.cjs
CHANGED
|
@@ -3280,24 +3280,24 @@ var require_utils = __commonJS({
|
|
|
3280
3280
|
return match === "\\" ? "" : match;
|
|
3281
3281
|
});
|
|
3282
3282
|
};
|
|
3283
|
-
exports2.escapeLast = (
|
|
3284
|
-
const idx =
|
|
3285
|
-
if (idx === -1) return
|
|
3286
|
-
if (
|
|
3287
|
-
return `${
|
|
3283
|
+
exports2.escapeLast = (input3, char, lastIdx) => {
|
|
3284
|
+
const idx = input3.lastIndexOf(char, lastIdx);
|
|
3285
|
+
if (idx === -1) return input3;
|
|
3286
|
+
if (input3[idx - 1] === "\\") return exports2.escapeLast(input3, char, idx - 1);
|
|
3287
|
+
return `${input3.slice(0, idx)}\\${input3.slice(idx)}`;
|
|
3288
3288
|
};
|
|
3289
|
-
exports2.removePrefix = (
|
|
3290
|
-
let output2 =
|
|
3289
|
+
exports2.removePrefix = (input3, state = {}) => {
|
|
3290
|
+
let output2 = input3;
|
|
3291
3291
|
if (output2.startsWith("./")) {
|
|
3292
3292
|
output2 = output2.slice(2);
|
|
3293
3293
|
state.prefix = "./";
|
|
3294
3294
|
}
|
|
3295
3295
|
return output2;
|
|
3296
3296
|
};
|
|
3297
|
-
exports2.wrapOutput = (
|
|
3297
|
+
exports2.wrapOutput = (input3, state = {}, options = {}) => {
|
|
3298
3298
|
const prepend = options.contains ? "" : "^";
|
|
3299
3299
|
const append = options.contains ? "" : "$";
|
|
3300
|
-
let output2 = `${prepend}(?:${
|
|
3300
|
+
let output2 = `${prepend}(?:${input3})${append}`;
|
|
3301
3301
|
if (state.negated === true) {
|
|
3302
3302
|
output2 = `(?:^(?!${output2}).*$)`;
|
|
3303
3303
|
}
|
|
@@ -3360,14 +3360,14 @@ var require_scan = __commonJS({
|
|
|
3360
3360
|
token.depth = token.isGlobstar ? Infinity : 1;
|
|
3361
3361
|
}
|
|
3362
3362
|
};
|
|
3363
|
-
var scan = (
|
|
3363
|
+
var scan = (input3, options) => {
|
|
3364
3364
|
const opts = options || {};
|
|
3365
|
-
const length =
|
|
3365
|
+
const length = input3.length - 1;
|
|
3366
3366
|
const scanToEnd = opts.parts === true || opts.tokens === true || opts.scanToEnd === true;
|
|
3367
3367
|
const slashes = [];
|
|
3368
3368
|
const tokens = [];
|
|
3369
3369
|
const parts2 = [];
|
|
3370
|
-
let str =
|
|
3370
|
+
let str = input3;
|
|
3371
3371
|
let index = -1;
|
|
3372
3372
|
let start = 0;
|
|
3373
3373
|
let lastIndex = 0;
|
|
@@ -3596,7 +3596,7 @@ var require_scan = __commonJS({
|
|
|
3596
3596
|
}
|
|
3597
3597
|
const state = {
|
|
3598
3598
|
prefix,
|
|
3599
|
-
input:
|
|
3599
|
+
input: input3,
|
|
3600
3600
|
start,
|
|
3601
3601
|
base,
|
|
3602
3602
|
glob,
|
|
@@ -3620,7 +3620,7 @@ var require_scan = __commonJS({
|
|
|
3620
3620
|
for (let idx = 0; idx < slashes.length; idx++) {
|
|
3621
3621
|
const n2 = prevIndex !== void 0 ? prevIndex + 1 : start;
|
|
3622
3622
|
const i = slashes[idx];
|
|
3623
|
-
const value3 =
|
|
3623
|
+
const value3 = input3.slice(n2, i);
|
|
3624
3624
|
if (opts.tokens) {
|
|
3625
3625
|
if (idx === 0 && start !== 0) {
|
|
3626
3626
|
tokens[idx].isPrefix = true;
|
|
@@ -3637,9 +3637,9 @@ var require_scan = __commonJS({
|
|
|
3637
3637
|
}
|
|
3638
3638
|
}
|
|
3639
3639
|
const n = prevIndex !== void 0 ? prevIndex + 1 : start;
|
|
3640
|
-
const value2 =
|
|
3640
|
+
const value2 = input3.slice(n);
|
|
3641
3641
|
parts2.push(value2);
|
|
3642
|
-
if (opts.tokens && prevIndex && prevIndex + 1 <
|
|
3642
|
+
if (opts.tokens && prevIndex && prevIndex + 1 < input3.length) {
|
|
3643
3643
|
tokens[tokens.length - 1].value = value2;
|
|
3644
3644
|
depth(tokens[tokens.length - 1]);
|
|
3645
3645
|
state.maxDepth += tokens[tokens.length - 1].depth;
|
|
@@ -3683,14 +3683,14 @@ var require_parse = __commonJS({
|
|
|
3683
3683
|
var syntaxError = (type, char) => {
|
|
3684
3684
|
return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
3685
3685
|
};
|
|
3686
|
-
var splitTopLevel = (
|
|
3686
|
+
var splitTopLevel = (input3) => {
|
|
3687
3687
|
const parts2 = [];
|
|
3688
3688
|
let bracket = 0;
|
|
3689
3689
|
let paren = 0;
|
|
3690
3690
|
let quote = 0;
|
|
3691
3691
|
let value2 = "";
|
|
3692
3692
|
let escaped = false;
|
|
3693
|
-
for (const ch of
|
|
3693
|
+
for (const ch of input3) {
|
|
3694
3694
|
if (escaped === true) {
|
|
3695
3695
|
value2 += ch;
|
|
3696
3696
|
escaped = false;
|
|
@@ -3907,14 +3907,14 @@ var require_parse = __commonJS({
|
|
|
3907
3907
|
}
|
|
3908
3908
|
return { risky: false };
|
|
3909
3909
|
};
|
|
3910
|
-
var parse6 = (
|
|
3911
|
-
if (typeof
|
|
3910
|
+
var parse6 = (input3, options) => {
|
|
3911
|
+
if (typeof input3 !== "string") {
|
|
3912
3912
|
throw new TypeError("Expected a string");
|
|
3913
3913
|
}
|
|
3914
|
-
|
|
3914
|
+
input3 = REPLACEMENTS[input3] || input3;
|
|
3915
3915
|
const opts = { ...options };
|
|
3916
3916
|
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
3917
|
-
let len =
|
|
3917
|
+
let len = input3.length;
|
|
3918
3918
|
if (len > max) {
|
|
3919
3919
|
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
3920
3920
|
}
|
|
@@ -3950,7 +3950,7 @@ var require_parse = __commonJS({
|
|
|
3950
3950
|
opts.noextglob = opts.noext;
|
|
3951
3951
|
}
|
|
3952
3952
|
const state = {
|
|
3953
|
-
input:
|
|
3953
|
+
input: input3,
|
|
3954
3954
|
index: -1,
|
|
3955
3955
|
start: 0,
|
|
3956
3956
|
dot: opts.dot === true,
|
|
@@ -3966,17 +3966,17 @@ var require_parse = __commonJS({
|
|
|
3966
3966
|
globstar: false,
|
|
3967
3967
|
tokens
|
|
3968
3968
|
};
|
|
3969
|
-
|
|
3970
|
-
len =
|
|
3969
|
+
input3 = utils.removePrefix(input3, state);
|
|
3970
|
+
len = input3.length;
|
|
3971
3971
|
const extglobs = [];
|
|
3972
3972
|
const braces = [];
|
|
3973
3973
|
const stack = [];
|
|
3974
3974
|
let prev = bos;
|
|
3975
3975
|
let value2;
|
|
3976
3976
|
const eos = () => state.index === len - 1;
|
|
3977
|
-
const peek = state.peek = (n = 1) =>
|
|
3978
|
-
const advance = state.advance = () =>
|
|
3979
|
-
const remaining = () =>
|
|
3977
|
+
const peek = state.peek = (n = 1) => input3[state.index + n];
|
|
3978
|
+
const advance = state.advance = () => input3[++state.index] || "";
|
|
3979
|
+
const remaining = () => input3.slice(state.index + 1);
|
|
3980
3980
|
const consume = (value3 = "", num = 0) => {
|
|
3981
3981
|
state.consumed += value3;
|
|
3982
3982
|
state.index += num;
|
|
@@ -4046,8 +4046,8 @@ var require_parse = __commonJS({
|
|
|
4046
4046
|
extglobs.push(token);
|
|
4047
4047
|
};
|
|
4048
4048
|
const extglobClose = (token) => {
|
|
4049
|
-
const literal2 =
|
|
4050
|
-
const body =
|
|
4049
|
+
const literal2 = input3.slice(token.startIndex, state.index + 1);
|
|
4050
|
+
const body = input3.slice(token.startIndex + 2, state.index);
|
|
4051
4051
|
const analysis = analyzeRepeatedExtglob(body, opts);
|
|
4052
4052
|
if ((token.type === "plus" || token.type === "star") && analysis.risky) {
|
|
4053
4053
|
const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0;
|
|
@@ -4087,9 +4087,9 @@ var require_parse = __commonJS({
|
|
|
4087
4087
|
push({ type: "paren", extglob: true, value: value2, output: output2 });
|
|
4088
4088
|
decrement("parens");
|
|
4089
4089
|
};
|
|
4090
|
-
if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(
|
|
4090
|
+
if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input3)) {
|
|
4091
4091
|
let backslashes = false;
|
|
4092
|
-
let output2 =
|
|
4092
|
+
let output2 = input3.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc2, chars, first, rest, index) => {
|
|
4093
4093
|
if (first === "\\") {
|
|
4094
4094
|
backslashes = true;
|
|
4095
4095
|
return m;
|
|
@@ -4123,8 +4123,8 @@ var require_parse = __commonJS({
|
|
|
4123
4123
|
});
|
|
4124
4124
|
}
|
|
4125
4125
|
}
|
|
4126
|
-
if (output2 ===
|
|
4127
|
-
state.output =
|
|
4126
|
+
if (output2 === input3 && opts.contains === true) {
|
|
4127
|
+
state.output = input3;
|
|
4128
4128
|
return state;
|
|
4129
4129
|
}
|
|
4130
4130
|
state.output = utils.wrapOutput(output2, state, options);
|
|
@@ -4479,7 +4479,7 @@ var require_parse = __commonJS({
|
|
|
4479
4479
|
continue;
|
|
4480
4480
|
}
|
|
4481
4481
|
while (rest.slice(0, 3) === "/**") {
|
|
4482
|
-
const after =
|
|
4482
|
+
const after = input3[state.index + 4];
|
|
4483
4483
|
if (after && after !== "/") {
|
|
4484
4484
|
break;
|
|
4485
4485
|
}
|
|
@@ -4600,14 +4600,14 @@ var require_parse = __commonJS({
|
|
|
4600
4600
|
}
|
|
4601
4601
|
return state;
|
|
4602
4602
|
};
|
|
4603
|
-
parse6.fastpaths = (
|
|
4603
|
+
parse6.fastpaths = (input3, options) => {
|
|
4604
4604
|
const opts = { ...options };
|
|
4605
4605
|
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
4606
|
-
const len =
|
|
4606
|
+
const len = input3.length;
|
|
4607
4607
|
if (len > max) {
|
|
4608
4608
|
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
4609
4609
|
}
|
|
4610
|
-
|
|
4610
|
+
input3 = REPLACEMENTS[input3] || input3;
|
|
4611
4611
|
const {
|
|
4612
4612
|
DOT_LITERAL,
|
|
4613
4613
|
SLASH_LITERAL,
|
|
@@ -4658,7 +4658,7 @@ var require_parse = __commonJS({
|
|
|
4658
4658
|
}
|
|
4659
4659
|
}
|
|
4660
4660
|
};
|
|
4661
|
-
const output2 = utils.removePrefix(
|
|
4661
|
+
const output2 = utils.removePrefix(input3, state);
|
|
4662
4662
|
let source = create(output2);
|
|
4663
4663
|
if (source && opts.strictSlashes !== true) {
|
|
4664
4664
|
source += `${SLASH_LITERAL}?`;
|
|
@@ -4681,7 +4681,7 @@ var require_picomatch = __commonJS({
|
|
|
4681
4681
|
var isObject3 = (val) => val && typeof val === "object" && !Array.isArray(val);
|
|
4682
4682
|
var picomatch2 = (glob, options, returnState = false) => {
|
|
4683
4683
|
if (Array.isArray(glob)) {
|
|
4684
|
-
const fns = glob.map((
|
|
4684
|
+
const fns = glob.map((input3) => picomatch2(input3, options, returnState));
|
|
4685
4685
|
const arrayMatcher = (str) => {
|
|
4686
4686
|
for (const isMatch2 of fns) {
|
|
4687
4687
|
const state2 = isMatch2(str);
|
|
@@ -4705,9 +4705,9 @@ var require_picomatch = __commonJS({
|
|
|
4705
4705
|
const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
|
|
4706
4706
|
isIgnored = picomatch2(opts.ignore, ignoreOpts, returnState);
|
|
4707
4707
|
}
|
|
4708
|
-
const matcher = (
|
|
4709
|
-
const { isMatch: isMatch2, match, output: output2 } = picomatch2.test(
|
|
4710
|
-
const result = { glob, state, regex, posix, input:
|
|
4708
|
+
const matcher = (input3, returnObject = false) => {
|
|
4709
|
+
const { isMatch: isMatch2, match, output: output2 } = picomatch2.test(input3, regex, options, { glob, posix });
|
|
4710
|
+
const result = { glob, state, regex, posix, input: input3, output: output2, match, isMatch: isMatch2 };
|
|
4711
4711
|
if (typeof opts.onResult === "function") {
|
|
4712
4712
|
opts.onResult(result);
|
|
4713
4713
|
}
|
|
@@ -4715,7 +4715,7 @@ var require_picomatch = __commonJS({
|
|
|
4715
4715
|
result.isMatch = false;
|
|
4716
4716
|
return returnObject ? result : false;
|
|
4717
4717
|
}
|
|
4718
|
-
if (isIgnored(
|
|
4718
|
+
if (isIgnored(input3)) {
|
|
4719
4719
|
if (typeof opts.onIgnore === "function") {
|
|
4720
4720
|
opts.onIgnore(result);
|
|
4721
4721
|
}
|
|
@@ -4732,40 +4732,40 @@ var require_picomatch = __commonJS({
|
|
|
4732
4732
|
}
|
|
4733
4733
|
return matcher;
|
|
4734
4734
|
};
|
|
4735
|
-
picomatch2.test = (
|
|
4736
|
-
if (typeof
|
|
4735
|
+
picomatch2.test = (input3, regex, options, { glob, posix } = {}) => {
|
|
4736
|
+
if (typeof input3 !== "string") {
|
|
4737
4737
|
throw new TypeError("Expected input to be a string");
|
|
4738
4738
|
}
|
|
4739
|
-
if (
|
|
4739
|
+
if (input3 === "") {
|
|
4740
4740
|
return { isMatch: false, output: "" };
|
|
4741
4741
|
}
|
|
4742
4742
|
const opts = options || {};
|
|
4743
4743
|
const format = opts.format || (posix ? utils.toPosixSlashes : null);
|
|
4744
|
-
let match =
|
|
4745
|
-
let output2 = match && format ? format(
|
|
4744
|
+
let match = input3 === glob;
|
|
4745
|
+
let output2 = match && format ? format(input3) : input3;
|
|
4746
4746
|
if (match === false) {
|
|
4747
|
-
output2 = format ? format(
|
|
4747
|
+
output2 = format ? format(input3) : input3;
|
|
4748
4748
|
match = output2 === glob;
|
|
4749
4749
|
}
|
|
4750
4750
|
if (match === false || opts.capture === true) {
|
|
4751
4751
|
if (opts.matchBase === true || opts.basename === true) {
|
|
4752
|
-
match = picomatch2.matchBase(
|
|
4752
|
+
match = picomatch2.matchBase(input3, regex, options, posix);
|
|
4753
4753
|
} else {
|
|
4754
4754
|
match = regex.exec(output2);
|
|
4755
4755
|
}
|
|
4756
4756
|
}
|
|
4757
4757
|
return { isMatch: Boolean(match), match, output: output2 };
|
|
4758
4758
|
};
|
|
4759
|
-
picomatch2.matchBase = (
|
|
4759
|
+
picomatch2.matchBase = (input3, glob, options, posix = options && options.windows) => {
|
|
4760
4760
|
const regex = glob instanceof RegExp ? glob : picomatch2.makeRe(glob, options);
|
|
4761
|
-
return regex.test(utils.basename(
|
|
4761
|
+
return regex.test(utils.basename(input3, { windows: posix }));
|
|
4762
4762
|
};
|
|
4763
4763
|
picomatch2.isMatch = (str, patterns, options) => picomatch2(patterns, options)(str);
|
|
4764
4764
|
picomatch2.parse = (pattern, options) => {
|
|
4765
4765
|
if (Array.isArray(pattern)) return pattern.map((p) => picomatch2.parse(p, options));
|
|
4766
4766
|
return parse6(pattern, { ...options, fastpaths: false });
|
|
4767
4767
|
};
|
|
4768
|
-
picomatch2.scan = (
|
|
4768
|
+
picomatch2.scan = (input3, options) => scan(input3, options);
|
|
4769
4769
|
picomatch2.compileRe = (state, options, returnOutput = false, returnState = false) => {
|
|
4770
4770
|
if (returnOutput === true) {
|
|
4771
4771
|
return state.output;
|
|
@@ -4783,16 +4783,16 @@ var require_picomatch = __commonJS({
|
|
|
4783
4783
|
}
|
|
4784
4784
|
return regex;
|
|
4785
4785
|
};
|
|
4786
|
-
picomatch2.makeRe = (
|
|
4787
|
-
if (!
|
|
4786
|
+
picomatch2.makeRe = (input3, options = {}, returnOutput = false, returnState = false) => {
|
|
4787
|
+
if (!input3 || typeof input3 !== "string") {
|
|
4788
4788
|
throw new TypeError("Expected a non-empty string");
|
|
4789
4789
|
}
|
|
4790
4790
|
let parsed = { negated: false, fastpaths: true };
|
|
4791
|
-
if (options.fastpaths !== false && (
|
|
4792
|
-
parsed.output = parse6.fastpaths(
|
|
4791
|
+
if (options.fastpaths !== false && (input3[0] === "." || input3[0] === "*")) {
|
|
4792
|
+
parsed.output = parse6.fastpaths(input3, options);
|
|
4793
4793
|
}
|
|
4794
4794
|
if (!parsed.output) {
|
|
4795
|
-
parsed = parse6(
|
|
4795
|
+
parsed = parse6(input3, options);
|
|
4796
4796
|
}
|
|
4797
4797
|
return picomatch2.compileRe(parsed, options, returnOutput, returnState);
|
|
4798
4798
|
};
|
|
@@ -25139,10 +25139,10 @@ function parseJsonErrorBody(raw) {
|
|
|
25139
25139
|
return void 0;
|
|
25140
25140
|
}
|
|
25141
25141
|
}
|
|
25142
|
-
function buildCreditReservedHint(
|
|
25143
|
-
const reserved =
|
|
25142
|
+
function buildCreditReservedHint(input3) {
|
|
25143
|
+
const reserved = input3.code === KOLLAB_CREDIT_RESERVED_CODE || String(input3.error ?? "").toLowerCase().includes("credits are temporarily reserved");
|
|
25144
25144
|
if (!reserved) return void 0;
|
|
25145
|
-
const wait =
|
|
25145
|
+
const wait = input3.retryAfterSeconds ? `about ${input3.retryAfterSeconds}s` : "a short while";
|
|
25146
25146
|
return `Workspace credits are temporarily held by in-flight or just-interrupted requests in this space; this is not a balance problem. Wait ${wait} and retry the same command. If it keeps happening, check for other runs in this space.`;
|
|
25147
25147
|
}
|
|
25148
25148
|
|
|
@@ -27106,67 +27106,67 @@ var import_promises2 = require("fs/promises");
|
|
|
27106
27106
|
|
|
27107
27107
|
// src/lib/ask-command.ts
|
|
27108
27108
|
init_cjs_shims();
|
|
27109
|
-
function buildAskRequestBody(spaceId,
|
|
27109
|
+
function buildAskRequestBody(spaceId, input3) {
|
|
27110
27110
|
const qaQueryOption = {};
|
|
27111
|
-
if (
|
|
27112
|
-
qaQueryOption.knowledgeBaseIds = [
|
|
27111
|
+
if (input3.projectId) {
|
|
27112
|
+
qaQueryOption.knowledgeBaseIds = [input3.projectId];
|
|
27113
27113
|
}
|
|
27114
|
-
if (
|
|
27115
|
-
qaQueryOption.fileIds =
|
|
27114
|
+
if (input3.fileIds && input3.fileIds.length > 0) {
|
|
27115
|
+
qaQueryOption.fileIds = input3.fileIds;
|
|
27116
27116
|
}
|
|
27117
27117
|
const body = {
|
|
27118
|
-
question:
|
|
27119
|
-
message:
|
|
27118
|
+
question: input3.question,
|
|
27119
|
+
message: input3.question,
|
|
27120
27120
|
spaceId,
|
|
27121
|
-
conversationId:
|
|
27121
|
+
conversationId: input3.conversationId ?? "",
|
|
27122
27122
|
qaQueryOption,
|
|
27123
|
-
agent_id:
|
|
27124
|
-
agent_mentioned: hasKollabAgentMention(
|
|
27123
|
+
agent_id: input3.agentId ?? "default",
|
|
27124
|
+
agent_mentioned: hasKollabAgentMention(input3.question)
|
|
27125
27125
|
};
|
|
27126
|
-
if (
|
|
27127
|
-
body.projectId =
|
|
27126
|
+
if (input3.projectId) {
|
|
27127
|
+
body.projectId = input3.projectId;
|
|
27128
27128
|
}
|
|
27129
|
-
if (
|
|
27130
|
-
body.model_tier =
|
|
27129
|
+
if (input3.modelTier) {
|
|
27130
|
+
body.model_tier = input3.modelTier;
|
|
27131
27131
|
}
|
|
27132
|
-
if (
|
|
27133
|
-
body.byok_credential_id =
|
|
27132
|
+
if (input3.byokCredentialId) {
|
|
27133
|
+
body.byok_credential_id = input3.byokCredentialId;
|
|
27134
27134
|
}
|
|
27135
|
-
if (
|
|
27136
|
-
body.mcp_server_ids =
|
|
27135
|
+
if (input3.mcpServerIds && input3.mcpServerIds.length > 0) {
|
|
27136
|
+
body.mcp_server_ids = input3.mcpServerIds;
|
|
27137
27137
|
}
|
|
27138
|
-
if (
|
|
27139
|
-
body.uploaded_file_keys =
|
|
27138
|
+
if (input3.uploadedFileKeys && input3.uploadedFileKeys.length > 0) {
|
|
27139
|
+
body.uploaded_file_keys = input3.uploadedFileKeys;
|
|
27140
27140
|
}
|
|
27141
|
-
if (Array.isArray(
|
|
27142
|
-
body.attachments =
|
|
27141
|
+
if (Array.isArray(input3.attachments) && input3.attachments.length > 0) {
|
|
27142
|
+
body.attachments = input3.attachments;
|
|
27143
27143
|
}
|
|
27144
|
-
if (
|
|
27145
|
-
body.quotedMessageId =
|
|
27144
|
+
if (input3.quotedMessageId) {
|
|
27145
|
+
body.quotedMessageId = input3.quotedMessageId;
|
|
27146
27146
|
}
|
|
27147
|
-
if (
|
|
27147
|
+
if (input3.remixShareToken) {
|
|
27148
27148
|
body.remix_source = {
|
|
27149
27149
|
source_type: "share",
|
|
27150
|
-
share_token:
|
|
27151
|
-
...
|
|
27150
|
+
share_token: input3.remixShareToken,
|
|
27151
|
+
...input3.remixSourceTaskTitle ? { source_task_title: input3.remixSourceTaskTitle } : {}
|
|
27152
27152
|
};
|
|
27153
27153
|
}
|
|
27154
|
-
if (
|
|
27155
|
-
body.composer_mode =
|
|
27154
|
+
if (input3.composerMode) {
|
|
27155
|
+
body.composer_mode = input3.composerMode;
|
|
27156
27156
|
}
|
|
27157
|
-
if (
|
|
27158
|
-
body.composer_mode_options =
|
|
27157
|
+
if (input3.composerModeOptions && Object.keys(input3.composerModeOptions).length > 0) {
|
|
27158
|
+
body.composer_mode_options = input3.composerModeOptions;
|
|
27159
27159
|
}
|
|
27160
27160
|
return body;
|
|
27161
27161
|
}
|
|
27162
|
-
function buildAnswerQuestionRequestBody(
|
|
27162
|
+
function buildAnswerQuestionRequestBody(input3) {
|
|
27163
27163
|
return {
|
|
27164
|
-
conversationId:
|
|
27165
|
-
tool_use_id:
|
|
27166
|
-
answers:
|
|
27167
|
-
agent_id:
|
|
27168
|
-
...
|
|
27169
|
-
...
|
|
27164
|
+
conversationId: input3.conversationId,
|
|
27165
|
+
tool_use_id: input3.toolUseId,
|
|
27166
|
+
answers: input3.answers,
|
|
27167
|
+
agent_id: input3.agentId ?? "default",
|
|
27168
|
+
...input3.modelTier ? { model_tier: input3.modelTier } : {},
|
|
27169
|
+
...input3.byokCredentialId ? { byok_credential_id: input3.byokCredentialId } : {}
|
|
27170
27170
|
};
|
|
27171
27171
|
}
|
|
27172
27172
|
function hasKollabAgentMention(text2) {
|
|
@@ -27616,20 +27616,20 @@ function mimeFromPath2(filePath) {
|
|
|
27616
27616
|
};
|
|
27617
27617
|
return map2[ext] ?? "application/octet-stream";
|
|
27618
27618
|
}
|
|
27619
|
-
async function uploadTaskAttachmentBytes(creds,
|
|
27620
|
-
if (!
|
|
27619
|
+
async function uploadTaskAttachmentBytes(creds, input3) {
|
|
27620
|
+
if (!input3.conversationId.trim()) {
|
|
27621
27621
|
throw new Error("conversationId is required");
|
|
27622
27622
|
}
|
|
27623
|
-
if (
|
|
27623
|
+
if (input3.content.byteLength > MAX_FILE_BYTES2) {
|
|
27624
27624
|
throw new Error(
|
|
27625
|
-
`File exceeds the 500 MB upload limit (${
|
|
27625
|
+
`File exceeds the 500 MB upload limit (${input3.content.byteLength} bytes): ${input3.fileName}`
|
|
27626
27626
|
);
|
|
27627
27627
|
}
|
|
27628
|
-
const fallbackMimeType =
|
|
27628
|
+
const fallbackMimeType = input3.contentType || mimeFromPath2(input3.fileName);
|
|
27629
27629
|
const uploadUrlResult = await api(creds, "POST", "/skills/chat/upload-url", {
|
|
27630
|
-
conversation_id:
|
|
27631
|
-
file_name:
|
|
27632
|
-
file_size:
|
|
27630
|
+
conversation_id: input3.conversationId,
|
|
27631
|
+
file_name: input3.fileName,
|
|
27632
|
+
file_size: input3.content.byteLength
|
|
27633
27633
|
});
|
|
27634
27634
|
if (!uploadUrlResult.ok || !uploadUrlResult.data) {
|
|
27635
27635
|
throw new Error(uploadUrlResult.error ?? "Failed to get upload URL");
|
|
@@ -27643,11 +27643,11 @@ async function uploadTaskAttachmentBytes(creds, input2) {
|
|
|
27643
27643
|
file_name: uploadedFileName
|
|
27644
27644
|
} = uploadUrlResult.data;
|
|
27645
27645
|
const resolvedMimeType = contentType || fallbackMimeType;
|
|
27646
|
-
const resolvedFileName = uploadedFileName ||
|
|
27646
|
+
const resolvedFileName = uploadedFileName || input3.fileName;
|
|
27647
27647
|
const putResponse = await fetch(uploadUrl, {
|
|
27648
27648
|
method: "PUT",
|
|
27649
27649
|
headers: { "Content-Type": resolvedMimeType },
|
|
27650
|
-
body:
|
|
27650
|
+
body: input3.content
|
|
27651
27651
|
});
|
|
27652
27652
|
if (!putResponse.ok) {
|
|
27653
27653
|
throw new Error(
|
|
@@ -27659,12 +27659,12 @@ async function uploadTaskAttachmentBytes(creds, input2) {
|
|
|
27659
27659
|
const syncResult = await api(
|
|
27660
27660
|
creds,
|
|
27661
27661
|
"POST",
|
|
27662
|
-
`/artifacts/conversation/${
|
|
27662
|
+
`/artifacts/conversation/${input3.conversationId}/sync-upload`,
|
|
27663
27663
|
{
|
|
27664
27664
|
file_name: resolvedFileName,
|
|
27665
27665
|
s3_key: fileKey,
|
|
27666
27666
|
s3_bucket: s3Bucket,
|
|
27667
|
-
size:
|
|
27667
|
+
size: input3.content.byteLength,
|
|
27668
27668
|
content_type: resolvedMimeType
|
|
27669
27669
|
}
|
|
27670
27670
|
);
|
|
@@ -27689,7 +27689,7 @@ async function uploadTaskAttachmentBytes(creds, input2) {
|
|
|
27689
27689
|
// ignores these extra fields, while existing scripts may still read them.
|
|
27690
27690
|
file_key: fileKey,
|
|
27691
27691
|
file_name: resolvedFileName,
|
|
27692
|
-
file_size:
|
|
27692
|
+
file_size: input3.content.byteLength,
|
|
27693
27693
|
mime_type: resolvedMimeType,
|
|
27694
27694
|
download_url: downloadUrl,
|
|
27695
27695
|
s3_bucket: s3Bucket,
|
|
@@ -27698,13 +27698,13 @@ async function uploadTaskAttachmentBytes(creds, input2) {
|
|
|
27698
27698
|
return {
|
|
27699
27699
|
fileKey,
|
|
27700
27700
|
filename: resolvedFileName,
|
|
27701
|
-
size:
|
|
27701
|
+
size: input3.content.byteLength,
|
|
27702
27702
|
mime: resolvedMimeType,
|
|
27703
|
-
conversationId:
|
|
27703
|
+
conversationId: input3.conversationId,
|
|
27704
27704
|
hint: "Pass fileKey to `task ask --uploaded-file-keys` and attachments to `task ask --attachments`.",
|
|
27705
27705
|
attachments: [attachmentItem],
|
|
27706
27706
|
uploadedFileKeys: [fileKey],
|
|
27707
|
-
taskAskExample: `kollab task ask --conversation-id ${
|
|
27707
|
+
taskAskExample: `kollab task ask --conversation-id ${input3.conversationId} --question "Analyse this file" --uploaded-file-keys '["${fileKey}"]' --attachments '${JSON.stringify([attachmentItem])}'`
|
|
27708
27708
|
};
|
|
27709
27709
|
}
|
|
27710
27710
|
function registerTaskUploadCommand(task) {
|
|
@@ -27804,7 +27804,7 @@ function registerTaskAskCommand(task) {
|
|
|
27804
27804
|
"--uploaded-file-keys"
|
|
27805
27805
|
) : void 0;
|
|
27806
27806
|
const existingAttachments = opts.attachments !== void 0 ? parseJsonOption(opts.attachments, "--attachments") : void 0;
|
|
27807
|
-
const
|
|
27807
|
+
const input3 = {
|
|
27808
27808
|
question: resolvedQuestion.question,
|
|
27809
27809
|
conversationId: opts.conversationId || process.env.CURRENT_CONVERSATION_ID || void 0,
|
|
27810
27810
|
projectId: opts.projectId,
|
|
@@ -27827,13 +27827,13 @@ function registerTaskAskCommand(task) {
|
|
|
27827
27827
|
await materializeLargeQuestionAsAttachment(
|
|
27828
27828
|
creds,
|
|
27829
27829
|
spaceId,
|
|
27830
|
-
|
|
27830
|
+
input3,
|
|
27831
27831
|
resolvedQuestion
|
|
27832
27832
|
);
|
|
27833
27833
|
const result = await runChatTurn(creds, {
|
|
27834
27834
|
path: "/skills/chat/stream",
|
|
27835
|
-
body: buildAskRequestBody(spaceId,
|
|
27836
|
-
conversationId:
|
|
27835
|
+
body: buildAskRequestBody(spaceId, input3),
|
|
27836
|
+
conversationId: input3.conversationId
|
|
27837
27837
|
});
|
|
27838
27838
|
printResult(result);
|
|
27839
27839
|
}
|
|
@@ -27854,34 +27854,34 @@ async function resolveAskQuestion(opts) {
|
|
|
27854
27854
|
}
|
|
27855
27855
|
return { question: opts.question ?? "" };
|
|
27856
27856
|
}
|
|
27857
|
-
async function materializeLargeQuestionAsAttachment(creds, spaceId,
|
|
27858
|
-
if (!shouldMaterializeLargeQuestion(
|
|
27857
|
+
async function materializeLargeQuestionAsAttachment(creds, spaceId, input3, resolvedQuestion) {
|
|
27858
|
+
if (!shouldMaterializeLargeQuestion(input3.question)) {
|
|
27859
27859
|
return;
|
|
27860
27860
|
}
|
|
27861
27861
|
const conversationId = await ensureConversationForLargeQuestion(
|
|
27862
27862
|
creds,
|
|
27863
27863
|
spaceId,
|
|
27864
|
-
|
|
27864
|
+
input3
|
|
27865
27865
|
);
|
|
27866
27866
|
const uploaded = await uploadTaskAttachmentBytes(creds, {
|
|
27867
27867
|
conversationId,
|
|
27868
27868
|
fileName: buildLargeQuestionFileName(resolvedQuestion.sourceFilePath),
|
|
27869
|
-
content: new TextEncoder().encode(
|
|
27869
|
+
content: new TextEncoder().encode(input3.question),
|
|
27870
27870
|
contentType: "text/plain;charset=utf-8"
|
|
27871
27871
|
});
|
|
27872
|
-
|
|
27873
|
-
|
|
27874
|
-
|
|
27875
|
-
...
|
|
27872
|
+
input3.conversationId = conversationId;
|
|
27873
|
+
input3.question = CLI_LARGE_QUESTION_ATTACHMENT_PROMPT;
|
|
27874
|
+
input3.uploadedFileKeys = [
|
|
27875
|
+
...input3.uploadedFileKeys ?? [],
|
|
27876
27876
|
...uploaded.uploadedFileKeys
|
|
27877
27877
|
];
|
|
27878
|
-
|
|
27879
|
-
...normalizeAttachmentArray(
|
|
27878
|
+
input3.attachments = [
|
|
27879
|
+
...normalizeAttachmentArray(input3.attachments),
|
|
27880
27880
|
...uploaded.attachments
|
|
27881
27881
|
];
|
|
27882
27882
|
}
|
|
27883
|
-
async function ensureConversationForLargeQuestion(creds, spaceId,
|
|
27884
|
-
const existingConversationId =
|
|
27883
|
+
async function ensureConversationForLargeQuestion(creds, spaceId, input3) {
|
|
27884
|
+
const existingConversationId = input3.conversationId?.trim();
|
|
27885
27885
|
if (existingConversationId) {
|
|
27886
27886
|
return existingConversationId;
|
|
27887
27887
|
}
|
|
@@ -27889,7 +27889,7 @@ async function ensureConversationForLargeQuestion(creds, spaceId, input2) {
|
|
|
27889
27889
|
creds,
|
|
27890
27890
|
"POST",
|
|
27891
27891
|
"/qa/conversation",
|
|
27892
|
-
buildLargeQuestionConversationPayload(spaceId,
|
|
27892
|
+
buildLargeQuestionConversationPayload(spaceId, input3)
|
|
27893
27893
|
);
|
|
27894
27894
|
if (!createResult.ok) {
|
|
27895
27895
|
throw new Error(
|
|
@@ -27905,13 +27905,13 @@ async function ensureConversationForLargeQuestion(creds, spaceId, input2) {
|
|
|
27905
27905
|
function shouldMaterializeLargeQuestion(question) {
|
|
27906
27906
|
return Buffer.byteLength(question, "utf8") > CLI_DIRECT_QUESTION_MAX_BYTES;
|
|
27907
27907
|
}
|
|
27908
|
-
function buildLargeQuestionConversationPayload(spaceId,
|
|
27908
|
+
function buildLargeQuestionConversationPayload(spaceId, input3) {
|
|
27909
27909
|
return {
|
|
27910
27910
|
question: "",
|
|
27911
27911
|
spaceId,
|
|
27912
|
-
...
|
|
27913
|
-
...
|
|
27914
|
-
...
|
|
27912
|
+
...input3.projectId ? { parentId: input3.projectId } : {},
|
|
27913
|
+
...input3.modelTier ? { modelTier: input3.modelTier } : {},
|
|
27914
|
+
...input3.composerMode ? { composerMode: input3.composerMode } : {}
|
|
27915
27915
|
};
|
|
27916
27916
|
}
|
|
27917
27917
|
function buildLargeQuestionFileName(sourceFilePath) {
|
|
@@ -27934,7 +27934,7 @@ function registerTaskAnswerQuestionCommand(task) {
|
|
|
27934
27934
|
).requiredOption("--conversation-id <uuid>", "Conversation ID").requiredOption("--tool-use-id <id>", "Questionnaire tool_use_id").requiredOption("--answers <json>", "Answers JSON object").option("--model-tier <tier>", MODEL_SELECTION_OPTION_DESCRIPTION).option("--byok-credential-id <uuid>", "Opaque workspace BYOK credential ID").option("--agent-id <uuid>", "Agent override").action(
|
|
27935
27935
|
async (opts) => {
|
|
27936
27936
|
const answers = parseQuestionnaireAnswers(opts.answers);
|
|
27937
|
-
const
|
|
27937
|
+
const input3 = {
|
|
27938
27938
|
conversationId: opts.conversationId,
|
|
27939
27939
|
toolUseId: opts.toolUseId,
|
|
27940
27940
|
answers,
|
|
@@ -27945,7 +27945,7 @@ function registerTaskAnswerQuestionCommand(task) {
|
|
|
27945
27945
|
const creds = requireCredentials();
|
|
27946
27946
|
const result = await runChatTurn(creds, {
|
|
27947
27947
|
path: "/skills/chat/answer-question",
|
|
27948
|
-
body: buildAnswerQuestionRequestBody(
|
|
27948
|
+
body: buildAnswerQuestionRequestBody(input3),
|
|
27949
27949
|
conversationId: opts.conversationId
|
|
27950
27950
|
});
|
|
27951
27951
|
printResult(result);
|
|
@@ -28286,15 +28286,15 @@ async function fireRelay(creds, spaceId, conversationId, relayQuestion, projectI
|
|
|
28286
28286
|
}
|
|
28287
28287
|
return { accepted: false, attempts: RELAY_RETRY_MAX, ack: null, lastError };
|
|
28288
28288
|
}
|
|
28289
|
-
async function runRelayTest(creds, spaceId,
|
|
28290
|
-
let conversationId =
|
|
28289
|
+
async function runRelayTest(creds, spaceId, input3) {
|
|
28290
|
+
let conversationId = input3.conversationId ?? null;
|
|
28291
28291
|
if (!conversationId) {
|
|
28292
28292
|
conversationId = await createConversation(
|
|
28293
28293
|
creds,
|
|
28294
28294
|
spaceId,
|
|
28295
|
-
|
|
28296
|
-
|
|
28297
|
-
|
|
28295
|
+
input3.question,
|
|
28296
|
+
input3.projectId,
|
|
28297
|
+
input3.modelTier
|
|
28298
28298
|
);
|
|
28299
28299
|
}
|
|
28300
28300
|
if (!conversationId) {
|
|
@@ -28315,10 +28315,10 @@ async function runRelayTest(creds, spaceId, input2) {
|
|
|
28315
28315
|
}
|
|
28316
28316
|
const controller = new AbortController();
|
|
28317
28317
|
const mainBody = buildAskRequestBody(spaceId, {
|
|
28318
|
-
question:
|
|
28318
|
+
question: input3.question,
|
|
28319
28319
|
conversationId,
|
|
28320
|
-
projectId:
|
|
28321
|
-
modelTier:
|
|
28320
|
+
projectId: input3.projectId,
|
|
28321
|
+
modelTier: input3.modelTier
|
|
28322
28322
|
});
|
|
28323
28323
|
const startedAt = Date.now();
|
|
28324
28324
|
let mainCompleted = false;
|
|
@@ -28334,7 +28334,7 @@ async function runRelayTest(creds, spaceId, input2) {
|
|
|
28334
28334
|
}).catch(() => {
|
|
28335
28335
|
mainCompleted = mainCompleted || false;
|
|
28336
28336
|
});
|
|
28337
|
-
const generatingDeadline = Date.now() +
|
|
28337
|
+
const generatingDeadline = Date.now() + input3.generatingWaitMs;
|
|
28338
28338
|
let sawGenerating = false;
|
|
28339
28339
|
while (Date.now() <= generatingDeadline && !mainCompleted) {
|
|
28340
28340
|
const status = await getGenerationStatus(creds, conversationId);
|
|
@@ -28344,11 +28344,11 @@ async function runRelayTest(creds, spaceId, input2) {
|
|
|
28344
28344
|
}
|
|
28345
28345
|
await sleep4(STATUS_POLL_INTERVAL_MS);
|
|
28346
28346
|
}
|
|
28347
|
-
if (sawGenerating &&
|
|
28348
|
-
await sleep4(
|
|
28347
|
+
if (sawGenerating && input3.relayAfterMs > 0) {
|
|
28348
|
+
await sleep4(input3.relayAfterMs);
|
|
28349
28349
|
}
|
|
28350
|
-
const relayCount = Math.max(1,
|
|
28351
|
-
const relayIntervalMs =
|
|
28350
|
+
const relayCount = Math.max(1, input3.relayCount ?? 1);
|
|
28351
|
+
const relayIntervalMs = input3.relayIntervalMs ?? 1500;
|
|
28352
28352
|
const relays = [];
|
|
28353
28353
|
let relay = {
|
|
28354
28354
|
accepted: false,
|
|
@@ -28358,14 +28358,14 @@ async function runRelayTest(creds, spaceId, input2) {
|
|
|
28358
28358
|
};
|
|
28359
28359
|
const runId = (0, import_node_crypto2.randomUUID)();
|
|
28360
28360
|
for (let i = 1; i <= relayCount; i += 1) {
|
|
28361
|
-
const q = `${
|
|
28361
|
+
const q = `${input3.relayQuestion} [relay-${runId}-${i}]`;
|
|
28362
28362
|
const r = await fireRelay(
|
|
28363
28363
|
creds,
|
|
28364
28364
|
spaceId,
|
|
28365
28365
|
conversationId,
|
|
28366
28366
|
q,
|
|
28367
|
-
|
|
28368
|
-
|
|
28367
|
+
input3.projectId,
|
|
28368
|
+
input3.modelTier
|
|
28369
28369
|
);
|
|
28370
28370
|
if (i === 1) {
|
|
28371
28371
|
relay = r;
|
|
@@ -28385,7 +28385,7 @@ async function runRelayTest(creds, spaceId, input2) {
|
|
|
28385
28385
|
await sleep4(relayIntervalMs);
|
|
28386
28386
|
}
|
|
28387
28387
|
}
|
|
28388
|
-
const remainingMs = Math.max(0,
|
|
28388
|
+
const remainingMs = Math.max(0, input3.maxWaitMs - (Date.now() - startedAt));
|
|
28389
28389
|
let timeout;
|
|
28390
28390
|
const winner = await Promise.race([
|
|
28391
28391
|
mainPromise.then(() => "completed"),
|
|
@@ -28402,7 +28402,7 @@ async function runRelayTest(creds, spaceId, input2) {
|
|
|
28402
28402
|
assessRelayMessages(relays, messages);
|
|
28403
28403
|
finalGenerationStatus = await getGenerationStatus(creds, conversationId);
|
|
28404
28404
|
if (finalGenerationStatus !== "generating" && relays.every((r) => !r.accepted || r.answered || r.explicitlyFailed)) break;
|
|
28405
|
-
const remaining =
|
|
28405
|
+
const remaining = input3.maxWaitMs - (Date.now() - startedAt);
|
|
28406
28406
|
if (remaining <= 0) break;
|
|
28407
28407
|
await sleep4(Math.min(STATUS_POLL_INTERVAL_MS, remaining));
|
|
28408
28408
|
} while (true);
|
|
@@ -30039,10 +30039,10 @@ function targetsSystemRoot(rest) {
|
|
|
30039
30039
|
return t === "" || t === "/" || t === "~" || t === "/*" || /^[A-Za-z]:$/.test(t);
|
|
30040
30040
|
});
|
|
30041
30041
|
}
|
|
30042
|
-
function hasUnbalancedQuotes(
|
|
30042
|
+
function hasUnbalancedQuotes(input3) {
|
|
30043
30043
|
let quote = null;
|
|
30044
|
-
for (let i = 0; i <
|
|
30045
|
-
const ch =
|
|
30044
|
+
for (let i = 0; i < input3.length; i += 1) {
|
|
30045
|
+
const ch = input3[i];
|
|
30046
30046
|
if (ch === "\\" && quote !== "'") {
|
|
30047
30047
|
i += 1;
|
|
30048
30048
|
continue;
|
|
@@ -32161,8 +32161,8 @@ function listTools() {
|
|
|
32161
32161
|
outputSchema: MCP_TOOL_OUTPUT_SCHEMAS[name]
|
|
32162
32162
|
}));
|
|
32163
32163
|
}
|
|
32164
|
-
async function runMcpServer(
|
|
32165
|
-
const readline = (0, import_node_readline.createInterface)({ input:
|
|
32164
|
+
async function runMcpServer(input3 = process.stdin, output2 = process.stdout) {
|
|
32165
|
+
const readline = (0, import_node_readline.createInterface)({ input: input3, crlfDelay: Infinity });
|
|
32166
32166
|
const write = (message) => {
|
|
32167
32167
|
output2.write(`${JSON.stringify(message)}
|
|
32168
32168
|
`);
|
|
@@ -33048,9 +33048,62 @@ function registerUserCommands(program3) {
|
|
|
33048
33048
|
});
|
|
33049
33049
|
}
|
|
33050
33050
|
|
|
33051
|
+
// src/commands/site-platform.ts
|
|
33052
|
+
init_cjs_shims();
|
|
33053
|
+
var import_node_fs5 = require("fs");
|
|
33054
|
+
function input(file2) {
|
|
33055
|
+
return JSON.parse((0, import_node_fs5.readFileSync)(file2 === "-" ? 0 : file2, "utf8"));
|
|
33056
|
+
}
|
|
33057
|
+
function registerSitePlatformCommands(program3) {
|
|
33058
|
+
const data2 = program3.command("data").description("Space collections, records and committed change feed");
|
|
33059
|
+
for (const action of ["collections", "configure", "list", "get", "save", "delete", "changes"]) {
|
|
33060
|
+
const command = data2.command(action).requiredOption("--app <id>", "Hosted App ID");
|
|
33061
|
+
if (action !== "collections") command.requiredOption("--collection <name>", "Collection name");
|
|
33062
|
+
if (["get", "delete"].includes(action)) command.requiredOption("--id <id>", "Record ID");
|
|
33063
|
+
if (["configure", "save"].includes(action)) command.requiredOption("--file <path>", "JSON file or - for stdin");
|
|
33064
|
+
command.option("--after <cursor>").option("--upper <cursor>").option("--sort <field>").option("--order <direction>").option("--revision <revision>").option("--limit <count>");
|
|
33065
|
+
command.action(async (options) => {
|
|
33066
|
+
const credentials = requireCredentials();
|
|
33067
|
+
const space = requireSpaceId(credentials);
|
|
33068
|
+
const base = `/spaces/${encodeURIComponent(space)}/site-platform/apps/${encodeURIComponent(options.app)}/collections`;
|
|
33069
|
+
const resource = `${base}/${encodeURIComponent(options.collection ?? "")}`;
|
|
33070
|
+
const query = new URLSearchParams(Object.fromEntries(["after", "upper", "sort", "order", "revision", "limit"].filter((key) => options[key] !== void 0).map((key) => [key, options[key]])));
|
|
33071
|
+
const path13 = action === "collections" ? base : action === "configure" ? resource : action === "changes" ? `${resource}/changes` : `${resource}/records${["get", "delete"].includes(action) ? `/${encodeURIComponent(options.id)}` : ""}`;
|
|
33072
|
+
printResult(await api(credentials, ["configure"].includes(action) ? "PUT" : action === "save" ? "POST" : action === "delete" ? "DELETE" : "GET", `${path13}?${query}`, options.file ? input(options.file) : void 0));
|
|
33073
|
+
});
|
|
33074
|
+
}
|
|
33075
|
+
const mail = program3.command("mail").description("Space mailbox, verified destinations, send and delivery records");
|
|
33076
|
+
mail.command("mailbox").action(async () => {
|
|
33077
|
+
const c = requireCredentials();
|
|
33078
|
+
printResult(await api(c, "POST", `/spaces/${encodeURIComponent(requireSpaceId(c))}/site-platform/mailbox`));
|
|
33079
|
+
});
|
|
33080
|
+
for (const action of ["list", "get", "status", "send"]) {
|
|
33081
|
+
const command = mail.command(action).requiredOption("--mailbox <id>", "Mailbox ID");
|
|
33082
|
+
if (["get", "status"].includes(action)) command.requiredOption("--id <id>", "Message ID");
|
|
33083
|
+
if (action === "send") command.requiredOption("--file <path>", "JSON: recipientIds, subject, text, idempotencyKey");
|
|
33084
|
+
command.option("--after <cursor>").option("--limit <count>").action(async (options) => {
|
|
33085
|
+
const c = requireCredentials();
|
|
33086
|
+
const query = new URLSearchParams(Object.fromEntries(["after", "limit"].filter((key) => options[key] !== void 0).map((key) => [key, options[key]])));
|
|
33087
|
+
const path13 = `/spaces/${encodeURIComponent(requireSpaceId(c))}/site-platform/mailboxes/${encodeURIComponent(options.mailbox)}/messages${options.id ? `/${encodeURIComponent(options.id)}` : ""}`;
|
|
33088
|
+
printResult(await api(c, action === "send" ? "POST" : "GET", `${path13}?${query}`, options.file ? input(options.file) : void 0));
|
|
33089
|
+
});
|
|
33090
|
+
}
|
|
33091
|
+
const recipient = mail.command("recipient");
|
|
33092
|
+
for (const action of ["list", "request", "verify"]) {
|
|
33093
|
+
const cmd = recipient.command(action);
|
|
33094
|
+
if (action === "request") cmd.requiredOption("--address <address>");
|
|
33095
|
+
if (action === "verify") cmd.requiredOption("--id <id>").requiredOption("--file <path>", "JSON containing code; - for stdin");
|
|
33096
|
+
cmd.action(async (options) => {
|
|
33097
|
+
const c = requireCredentials();
|
|
33098
|
+
const path13 = `/spaces/${encodeURIComponent(requireSpaceId(c))}/site-platform/recipients${action === "verify" ? `/${encodeURIComponent(options.id)}/verify` : ""}`;
|
|
33099
|
+
printResult(await api(c, action === "list" ? "GET" : "POST", path13, action === "request" ? { address: options.address } : options.file ? input(options.file) : void 0));
|
|
33100
|
+
});
|
|
33101
|
+
}
|
|
33102
|
+
}
|
|
33103
|
+
|
|
33051
33104
|
// src/commands/app.ts
|
|
33052
33105
|
init_cjs_shims();
|
|
33053
|
-
var
|
|
33106
|
+
var import_node_fs7 = require("fs");
|
|
33054
33107
|
var import_node_path4 = require("path");
|
|
33055
33108
|
|
|
33056
33109
|
// src/auth/hosted-app-credentials.ts
|
|
@@ -33077,7 +33130,7 @@ async function requireHostedAppCredentials() {
|
|
|
33077
33130
|
|
|
33078
33131
|
// src/commands/app-services.ts
|
|
33079
33132
|
init_cjs_shims();
|
|
33080
|
-
var
|
|
33133
|
+
var import_node_fs6 = require("fs");
|
|
33081
33134
|
function registerHostedSiteCommands(app) {
|
|
33082
33135
|
const services = app.command("services").description("Configure shared forms and news for a static site (no function or compute slot)");
|
|
33083
33136
|
for (const action of ["info", "enable", "disable", "delete-data"]) {
|
|
@@ -33099,7 +33152,7 @@ function registerHostedSiteCommands(app) {
|
|
|
33099
33152
|
services.command("restore").requiredOption("--id <appId>", "Empty destination App ID").requiredOption("--file <path>", "Exported site-services.json").action(async (options) => {
|
|
33100
33153
|
try {
|
|
33101
33154
|
const credentials = await requireHostedAppCredentials();
|
|
33102
|
-
printResult(await api(credentials, "POST", `/hosted-apps/${encodeURIComponent(options.id)}/services/restore`, JSON.parse((0,
|
|
33155
|
+
printResult(await api(credentials, "POST", `/hosted-apps/${encodeURIComponent(options.id)}/services/restore`, JSON.parse((0, import_node_fs6.readFileSync)(options.file, "utf8"))));
|
|
33103
33156
|
} catch (error62) {
|
|
33104
33157
|
emitError(error62 instanceof Error ? error62.message : String(error62));
|
|
33105
33158
|
}
|
|
@@ -33115,7 +33168,7 @@ function registerHostedSiteCommands(app) {
|
|
|
33115
33168
|
form.command("verify").requiredOption("--id <appId>", "Hosted App ID").description("Read the six digit code from stdin").action(async (options) => {
|
|
33116
33169
|
try {
|
|
33117
33170
|
if (process.stdin.isTTY) throw new Error("Pass the verification code through stdin");
|
|
33118
|
-
const code = (0,
|
|
33171
|
+
const code = (0, import_node_fs6.readFileSync)(0, "utf8").trim();
|
|
33119
33172
|
printResult(await api(await requireHostedAppCredentials(), "POST", `/hosted-apps/${encodeURIComponent(options.id)}/services/forms/contact/verify`, { code }));
|
|
33120
33173
|
} catch (error62) {
|
|
33121
33174
|
emitError(error62 instanceof Error ? error62.message : String(error62));
|
|
@@ -33137,7 +33190,7 @@ function registerHostedSiteCommands(app) {
|
|
|
33137
33190
|
const news = app.command("news").description("Manage the news collection; public reads show published records only");
|
|
33138
33191
|
news.command("save").requiredOption("--id <appId>", "Hosted App ID").requiredOption("--file <path>", "JSON: optional id, title, body, status (draft/published)").action(async (options) => {
|
|
33139
33192
|
try {
|
|
33140
|
-
printResult(await api(await requireHostedAppCredentials(), "PUT", `/hosted-apps/${encodeURIComponent(options.id)}/services/collections/news/documents`, JSON.parse((0,
|
|
33193
|
+
printResult(await api(await requireHostedAppCredentials(), "PUT", `/hosted-apps/${encodeURIComponent(options.id)}/services/collections/news/documents`, JSON.parse((0, import_node_fs6.readFileSync)(options.file, "utf8"))));
|
|
33141
33194
|
} catch (error62) {
|
|
33142
33195
|
emitError(error62 instanceof Error ? error62.message : String(error62));
|
|
33143
33196
|
}
|
|
@@ -33339,12 +33392,12 @@ async function createBlankTask(creds, spaceId, projectId) {
|
|
|
33339
33392
|
return readResourceId(requireApiData(result, "Create Hosted App task"), "task");
|
|
33340
33393
|
}
|
|
33341
33394
|
async function resolveHostedAppSource(creds, spaceId, options) {
|
|
33342
|
-
const fileSize = (0,
|
|
33395
|
+
const fileSize = (0, import_node_fs7.statSync)(options.file).size;
|
|
33343
33396
|
const kind = validateHostedAppFile(options.file, fileSize);
|
|
33344
33397
|
const conversationId = options.conversationId?.trim();
|
|
33345
33398
|
if (conversationId && options.projectId?.trim()) throw new Error("--project-id cannot be used with --conversation-id");
|
|
33346
33399
|
const resolvedConversationId = conversationId || await createBlankTask(creds, spaceId, options.projectId?.trim());
|
|
33347
|
-
const content = (0,
|
|
33400
|
+
const content = (0, import_node_fs7.readFileSync)(options.file);
|
|
33348
33401
|
const upload = await uploadTaskAttachmentBytes(creds, {
|
|
33349
33402
|
conversationId: resolvedConversationId,
|
|
33350
33403
|
fileName: (0, import_node_path4.basename)(options.file),
|
|
@@ -33740,8 +33793,8 @@ var fs6 = __toESM(require("fs"));
|
|
|
33740
33793
|
var path6 = __toESM(require("path"));
|
|
33741
33794
|
var UNKNOWN_VERSION = "0.0.0";
|
|
33742
33795
|
function injectedVersion() {
|
|
33743
|
-
if ("0.1.
|
|
33744
|
-
return "0.1.
|
|
33796
|
+
if ("0.1.29".length > 0) {
|
|
33797
|
+
return "0.1.29";
|
|
33745
33798
|
}
|
|
33746
33799
|
return null;
|
|
33747
33800
|
}
|
|
@@ -38089,8 +38142,8 @@ function applyRememberRequest(message, authorized) {
|
|
|
38089
38142
|
}
|
|
38090
38143
|
async function performAction(message, scope, options) {
|
|
38091
38144
|
const { command } = message;
|
|
38092
|
-
const resolve4 = (
|
|
38093
|
-
const check2 = authorizeTarget(scope,
|
|
38145
|
+
const resolve4 = (input3) => {
|
|
38146
|
+
const check2 = authorizeTarget(scope, input3);
|
|
38094
38147
|
if (!check2.ok) throw Object.assign(new Error(check2.message), { code: check2.code });
|
|
38095
38148
|
return check2.resolved;
|
|
38096
38149
|
};
|
|
@@ -38302,7 +38355,7 @@ __export(external_exports, {
|
|
|
38302
38355
|
httpUrl: () => httpUrl,
|
|
38303
38356
|
iban: () => iban2,
|
|
38304
38357
|
includes: () => _includes,
|
|
38305
|
-
input: () =>
|
|
38358
|
+
input: () => input2,
|
|
38306
38359
|
instanceof: () => _instanceof,
|
|
38307
38360
|
int: () => int,
|
|
38308
38361
|
int32: () => int32,
|
|
@@ -38866,8 +38919,8 @@ var Cached = class {
|
|
|
38866
38919
|
function cached(getter) {
|
|
38867
38920
|
return new Cached(getter);
|
|
38868
38921
|
}
|
|
38869
|
-
function nullish(
|
|
38870
|
-
return
|
|
38922
|
+
function nullish(input3) {
|
|
38923
|
+
return input3 === null || input3 === void 0;
|
|
38871
38924
|
}
|
|
38872
38925
|
function cleanRegex(source) {
|
|
38873
38926
|
const start = source.startsWith("^") ? 1 : 0;
|
|
@@ -39004,8 +39057,8 @@ function randomString2(length = 10) {
|
|
|
39004
39057
|
function esc(str) {
|
|
39005
39058
|
return JSON.stringify(str);
|
|
39006
39059
|
}
|
|
39007
|
-
function slugify(
|
|
39008
|
-
return
|
|
39060
|
+
function slugify(input3) {
|
|
39061
|
+
return input3.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
39009
39062
|
}
|
|
39010
39063
|
var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
|
|
39011
39064
|
};
|
|
@@ -39373,12 +39426,12 @@ function finalizeIssue(iss, ctx, config2) {
|
|
|
39373
39426
|
}
|
|
39374
39427
|
return full;
|
|
39375
39428
|
}
|
|
39376
|
-
function getSizableOrigin(
|
|
39377
|
-
if (
|
|
39429
|
+
function getSizableOrigin(input3) {
|
|
39430
|
+
if (input3 instanceof Set)
|
|
39378
39431
|
return "set";
|
|
39379
|
-
if (
|
|
39432
|
+
if (input3 instanceof Map)
|
|
39380
39433
|
return "map";
|
|
39381
|
-
if (
|
|
39434
|
+
if (input3 instanceof File)
|
|
39382
39435
|
return "file";
|
|
39383
39436
|
return "unknown";
|
|
39384
39437
|
}
|
|
@@ -39396,10 +39449,10 @@ function codePointLength(str) {
|
|
|
39396
39449
|
}
|
|
39397
39450
|
return count;
|
|
39398
39451
|
}
|
|
39399
|
-
function getLengthableOrigin(
|
|
39400
|
-
if (Array.isArray(
|
|
39452
|
+
function getLengthableOrigin(input3) {
|
|
39453
|
+
if (Array.isArray(input3))
|
|
39401
39454
|
return "array";
|
|
39402
|
-
if (typeof
|
|
39455
|
+
if (typeof input3 === "string")
|
|
39403
39456
|
return "string";
|
|
39404
39457
|
return "unknown";
|
|
39405
39458
|
}
|
|
@@ -39425,12 +39478,12 @@ function parsedType(data2) {
|
|
|
39425
39478
|
return t;
|
|
39426
39479
|
}
|
|
39427
39480
|
function issue(...args) {
|
|
39428
|
-
const [iss,
|
|
39481
|
+
const [iss, input3, inst] = args;
|
|
39429
39482
|
if (typeof iss === "string") {
|
|
39430
39483
|
return {
|
|
39431
39484
|
message: iss,
|
|
39432
39485
|
code: "custom",
|
|
39433
|
-
input:
|
|
39486
|
+
input: input3,
|
|
39434
39487
|
inst
|
|
39435
39488
|
};
|
|
39436
39489
|
}
|
|
@@ -40337,23 +40390,23 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
40337
40390
|
const origin = isInt ? "int" : "number";
|
|
40338
40391
|
const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
|
|
40339
40392
|
inst._zod.check = (payload) => {
|
|
40340
|
-
const
|
|
40393
|
+
const input3 = payload.value;
|
|
40341
40394
|
if (isInt) {
|
|
40342
|
-
if (!Number.isInteger(
|
|
40395
|
+
if (!Number.isInteger(input3)) {
|
|
40343
40396
|
payload.issues.push({
|
|
40344
40397
|
expected: origin,
|
|
40345
40398
|
format: def.format,
|
|
40346
40399
|
code: "invalid_type",
|
|
40347
40400
|
continue: false,
|
|
40348
|
-
input:
|
|
40401
|
+
input: input3,
|
|
40349
40402
|
inst
|
|
40350
40403
|
});
|
|
40351
40404
|
return;
|
|
40352
40405
|
}
|
|
40353
|
-
if (!Number.isSafeInteger(
|
|
40354
|
-
if (
|
|
40406
|
+
if (!Number.isSafeInteger(input3)) {
|
|
40407
|
+
if (input3 > 0) {
|
|
40355
40408
|
payload.issues.push({
|
|
40356
|
-
input:
|
|
40409
|
+
input: input3,
|
|
40357
40410
|
code: "too_big",
|
|
40358
40411
|
maximum: Number.MAX_SAFE_INTEGER,
|
|
40359
40412
|
note: "Integers must be within the safe integer range.",
|
|
@@ -40364,7 +40417,7 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
40364
40417
|
});
|
|
40365
40418
|
} else {
|
|
40366
40419
|
payload.issues.push({
|
|
40367
|
-
input:
|
|
40420
|
+
input: input3,
|
|
40368
40421
|
code: "too_small",
|
|
40369
40422
|
minimum: Number.MIN_SAFE_INTEGER,
|
|
40370
40423
|
note: "Integers must be within the safe integer range.",
|
|
@@ -40377,10 +40430,10 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
40377
40430
|
return;
|
|
40378
40431
|
}
|
|
40379
40432
|
}
|
|
40380
|
-
if (
|
|
40433
|
+
if (input3 < minimum) {
|
|
40381
40434
|
payload.issues.push({
|
|
40382
40435
|
origin: "number",
|
|
40383
|
-
input:
|
|
40436
|
+
input: input3,
|
|
40384
40437
|
code: "too_small",
|
|
40385
40438
|
minimum,
|
|
40386
40439
|
inclusive: true,
|
|
@@ -40388,10 +40441,10 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
40388
40441
|
continue: !def.abort
|
|
40389
40442
|
});
|
|
40390
40443
|
}
|
|
40391
|
-
if (
|
|
40444
|
+
if (input3 > maximum) {
|
|
40392
40445
|
payload.issues.push({
|
|
40393
40446
|
origin: "number",
|
|
40394
|
-
input:
|
|
40447
|
+
input: input3,
|
|
40395
40448
|
code: "too_big",
|
|
40396
40449
|
maximum,
|
|
40397
40450
|
inclusive: true,
|
|
@@ -40405,11 +40458,11 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
|
|
|
40405
40458
|
$ZodCheck.init(inst, def);
|
|
40406
40459
|
const [minimum, maximum] = BIGINT_FORMAT_RANGES[def.format];
|
|
40407
40460
|
inst._zod.check = (payload) => {
|
|
40408
|
-
const
|
|
40409
|
-
if (
|
|
40461
|
+
const input3 = payload.value;
|
|
40462
|
+
if (input3 < minimum) {
|
|
40410
40463
|
payload.issues.push({
|
|
40411
40464
|
origin: "bigint",
|
|
40412
|
-
input:
|
|
40465
|
+
input: input3,
|
|
40413
40466
|
code: "too_small",
|
|
40414
40467
|
minimum,
|
|
40415
40468
|
inclusive: true,
|
|
@@ -40417,10 +40470,10 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
|
|
|
40417
40470
|
continue: !def.abort
|
|
40418
40471
|
});
|
|
40419
40472
|
}
|
|
40420
|
-
if (
|
|
40473
|
+
if (input3 > maximum) {
|
|
40421
40474
|
payload.issues.push({
|
|
40422
40475
|
origin: "bigint",
|
|
40423
|
-
input:
|
|
40476
|
+
input: input3,
|
|
40424
40477
|
code: "too_big",
|
|
40425
40478
|
maximum,
|
|
40426
40479
|
inclusive: true,
|
|
@@ -40435,16 +40488,16 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
|
|
|
40435
40488
|
$ZodCheck.init(inst, def);
|
|
40436
40489
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasSize);
|
|
40437
40490
|
inst._zod.check = (payload) => {
|
|
40438
|
-
const
|
|
40439
|
-
const size =
|
|
40491
|
+
const input3 = payload.value;
|
|
40492
|
+
const size = input3.size;
|
|
40440
40493
|
if (size <= def.maximum)
|
|
40441
40494
|
return;
|
|
40442
40495
|
payload.issues.push({
|
|
40443
|
-
origin: getSizableOrigin(
|
|
40496
|
+
origin: getSizableOrigin(input3),
|
|
40444
40497
|
code: "too_big",
|
|
40445
40498
|
maximum: def.maximum,
|
|
40446
40499
|
inclusive: true,
|
|
40447
|
-
input:
|
|
40500
|
+
input: input3,
|
|
40448
40501
|
inst,
|
|
40449
40502
|
continue: !def.abort
|
|
40450
40503
|
});
|
|
@@ -40455,16 +40508,16 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
|
|
|
40455
40508
|
$ZodCheck.init(inst, def);
|
|
40456
40509
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasSize);
|
|
40457
40510
|
inst._zod.check = (payload) => {
|
|
40458
|
-
const
|
|
40459
|
-
const size =
|
|
40511
|
+
const input3 = payload.value;
|
|
40512
|
+
const size = input3.size;
|
|
40460
40513
|
if (size >= def.minimum)
|
|
40461
40514
|
return;
|
|
40462
40515
|
payload.issues.push({
|
|
40463
|
-
origin: getSizableOrigin(
|
|
40516
|
+
origin: getSizableOrigin(input3),
|
|
40464
40517
|
code: "too_small",
|
|
40465
40518
|
minimum: def.minimum,
|
|
40466
40519
|
inclusive: true,
|
|
40467
|
-
input:
|
|
40520
|
+
input: input3,
|
|
40468
40521
|
inst,
|
|
40469
40522
|
continue: !def.abort
|
|
40470
40523
|
});
|
|
@@ -40475,13 +40528,13 @@ var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (i
|
|
|
40475
40528
|
$ZodCheck.init(inst, def);
|
|
40476
40529
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasSize);
|
|
40477
40530
|
inst._zod.check = (payload) => {
|
|
40478
|
-
const
|
|
40479
|
-
const size =
|
|
40531
|
+
const input3 = payload.value;
|
|
40532
|
+
const size = input3.size;
|
|
40480
40533
|
if (size === def.size)
|
|
40481
40534
|
return;
|
|
40482
40535
|
const tooBig = size > def.size;
|
|
40483
40536
|
payload.issues.push({
|
|
40484
|
-
origin: getSizableOrigin(
|
|
40537
|
+
origin: getSizableOrigin(input3),
|
|
40485
40538
|
...tooBig ? { code: "too_big", maximum: def.size } : { code: "too_small", minimum: def.size },
|
|
40486
40539
|
inclusive: true,
|
|
40487
40540
|
exact: true,
|
|
@@ -40496,18 +40549,18 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
|
|
|
40496
40549
|
$ZodCheck.init(inst, def);
|
|
40497
40550
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasLength);
|
|
40498
40551
|
inst._zod.check = (payload) => {
|
|
40499
|
-
const
|
|
40500
|
-
const units =
|
|
40501
|
-
const length = typeof
|
|
40552
|
+
const input3 = payload.value;
|
|
40553
|
+
const units = input3.length;
|
|
40554
|
+
const length = typeof input3 === "string" && units > def.maximum ? codePointLength(input3) : units;
|
|
40502
40555
|
if (length <= def.maximum)
|
|
40503
40556
|
return;
|
|
40504
|
-
const origin = getLengthableOrigin(
|
|
40557
|
+
const origin = getLengthableOrigin(input3);
|
|
40505
40558
|
payload.issues.push({
|
|
40506
40559
|
origin,
|
|
40507
40560
|
code: "too_big",
|
|
40508
40561
|
maximum: def.maximum,
|
|
40509
40562
|
inclusive: true,
|
|
40510
|
-
input:
|
|
40563
|
+
input: input3,
|
|
40511
40564
|
inst,
|
|
40512
40565
|
continue: !def.abort
|
|
40513
40566
|
});
|
|
@@ -40518,18 +40571,18 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
|
|
|
40518
40571
|
$ZodCheck.init(inst, def);
|
|
40519
40572
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasLength);
|
|
40520
40573
|
inst._zod.check = (payload) => {
|
|
40521
|
-
const
|
|
40522
|
-
const units =
|
|
40523
|
-
const length = typeof
|
|
40574
|
+
const input3 = payload.value;
|
|
40575
|
+
const units = input3.length;
|
|
40576
|
+
const length = typeof input3 === "string" && units >= def.minimum && units < def.minimum * 2 ? codePointLength(input3) : units;
|
|
40524
40577
|
if (length >= def.minimum)
|
|
40525
40578
|
return;
|
|
40526
|
-
const origin = getLengthableOrigin(
|
|
40579
|
+
const origin = getLengthableOrigin(input3);
|
|
40527
40580
|
payload.issues.push({
|
|
40528
40581
|
origin,
|
|
40529
40582
|
code: "too_small",
|
|
40530
40583
|
minimum: def.minimum,
|
|
40531
40584
|
inclusive: true,
|
|
40532
|
-
input:
|
|
40585
|
+
input: input3,
|
|
40533
40586
|
inst,
|
|
40534
40587
|
continue: !def.abort
|
|
40535
40588
|
});
|
|
@@ -40540,12 +40593,12 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
|
|
|
40540
40593
|
$ZodCheck.init(inst, def);
|
|
40541
40594
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasLength);
|
|
40542
40595
|
inst._zod.check = (payload) => {
|
|
40543
|
-
const
|
|
40544
|
-
const units =
|
|
40545
|
-
const length = typeof
|
|
40596
|
+
const input3 = payload.value;
|
|
40597
|
+
const units = input3.length;
|
|
40598
|
+
const length = typeof input3 === "string" && units >= def.length && units <= def.length * 2 ? codePointLength(input3) : units;
|
|
40546
40599
|
if (length === def.length)
|
|
40547
40600
|
return;
|
|
40548
|
-
const origin = getLengthableOrigin(
|
|
40601
|
+
const origin = getLengthableOrigin(input3);
|
|
40549
40602
|
const tooBig = length > def.length;
|
|
40550
40603
|
payload.issues.push({
|
|
40551
40604
|
origin,
|
|
@@ -40691,10 +40744,10 @@ var $ZodCheckProperties = /* @__PURE__ */ $constructor("$ZodCheckProperties", (i
|
|
|
40691
40744
|
return void 0;
|
|
40692
40745
|
}
|
|
40693
40746
|
entries ?? (entries = Reflect.ownKeys(def.shape).map((key) => [key, def.shape[key]]));
|
|
40694
|
-
const
|
|
40747
|
+
const input3 = payload.value;
|
|
40695
40748
|
let proms;
|
|
40696
40749
|
for (const [key, schema] of entries) {
|
|
40697
|
-
const result = schema._zod.run({ value:
|
|
40750
|
+
const result = schema._zod.run({ value: input3[key], issues: [] }, {});
|
|
40698
40751
|
if (result instanceof Promise) {
|
|
40699
40752
|
proms ?? (proms = []);
|
|
40700
40753
|
proms.push(result.then((result2) => handleCheckPropertyResult(result2, payload, key)));
|
|
@@ -40964,11 +41017,11 @@ var $ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def) => {
|
|
|
40964
41017
|
});
|
|
40965
41018
|
var URL_BAD_FORMAT = 1;
|
|
40966
41019
|
var URL_UNPARSEABLE = 2;
|
|
40967
|
-
function canParseURL(
|
|
41020
|
+
function canParseURL(input3) {
|
|
40968
41021
|
try {
|
|
40969
41022
|
if (typeof URL !== "undefined" && typeof URL.canParse === "function")
|
|
40970
|
-
return URL.canParse(
|
|
40971
|
-
new URL(
|
|
41023
|
+
return URL.canParse(input3);
|
|
41024
|
+
new URL(input3);
|
|
40972
41025
|
return true;
|
|
40973
41026
|
} catch {
|
|
40974
41027
|
return false;
|
|
@@ -41250,10 +41303,10 @@ function isLuhnAlgo(digits) {
|
|
|
41250
41303
|
}
|
|
41251
41304
|
return sum % 10 === 0;
|
|
41252
41305
|
}
|
|
41253
|
-
function isValidCreditCard(
|
|
41254
|
-
if (!creditCard.test(
|
|
41306
|
+
function isValidCreditCard(input3) {
|
|
41307
|
+
if (!creditCard.test(input3))
|
|
41255
41308
|
return false;
|
|
41256
|
-
return isLuhnAlgo(
|
|
41309
|
+
return isLuhnAlgo(input3.replace(CC_SANITIZE, ""));
|
|
41257
41310
|
}
|
|
41258
41311
|
var $ZodCreditCard = /* @__PURE__ */ $constructor("$ZodCreditCard", (inst, def) => {
|
|
41259
41312
|
def.pattern ?? (def.pattern = creditCard);
|
|
@@ -41283,10 +41336,10 @@ function isIso7064Mod97(iban3) {
|
|
|
41283
41336
|
}
|
|
41284
41337
|
return remainder === 1;
|
|
41285
41338
|
}
|
|
41286
|
-
function isValidIBAN(
|
|
41287
|
-
if (!iban.test(
|
|
41339
|
+
function isValidIBAN(input3) {
|
|
41340
|
+
if (!iban.test(input3))
|
|
41288
41341
|
return false;
|
|
41289
|
-
return isIso7064Mod97(
|
|
41342
|
+
return isIso7064Mod97(input3);
|
|
41290
41343
|
}
|
|
41291
41344
|
var $ZodIBAN = /* @__PURE__ */ $constructor("$ZodIBAN", (inst, def) => {
|
|
41292
41345
|
def.pattern ?? (def.pattern = iban);
|
|
@@ -41360,15 +41413,15 @@ var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
|
|
|
41360
41413
|
payload.value = Number(payload.value);
|
|
41361
41414
|
} catch (_) {
|
|
41362
41415
|
}
|
|
41363
|
-
const
|
|
41364
|
-
if (typeof
|
|
41416
|
+
const input3 = payload.value;
|
|
41417
|
+
if (typeof input3 === "number" && !Number.isNaN(input3) && Number.isFinite(input3)) {
|
|
41365
41418
|
return payload;
|
|
41366
41419
|
}
|
|
41367
|
-
const received = typeof
|
|
41420
|
+
const received = typeof input3 === "number" ? Number.isNaN(input3) ? "NaN" : !Number.isFinite(input3) ? String(input3) : void 0 : void 0;
|
|
41368
41421
|
payload.issues.push({
|
|
41369
41422
|
expected: "number",
|
|
41370
41423
|
code: "invalid_type",
|
|
41371
|
-
input:
|
|
41424
|
+
input: input3,
|
|
41372
41425
|
inst,
|
|
41373
41426
|
...received ? { received } : {}
|
|
41374
41427
|
});
|
|
@@ -41388,13 +41441,13 @@ var $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
|
|
|
41388
41441
|
payload.value = Boolean(payload.value);
|
|
41389
41442
|
} catch (_) {
|
|
41390
41443
|
}
|
|
41391
|
-
const
|
|
41392
|
-
if (typeof
|
|
41444
|
+
const input3 = payload.value;
|
|
41445
|
+
if (typeof input3 === "boolean")
|
|
41393
41446
|
return payload;
|
|
41394
41447
|
payload.issues.push({
|
|
41395
41448
|
expected: "boolean",
|
|
41396
41449
|
code: "invalid_type",
|
|
41397
|
-
input:
|
|
41450
|
+
input: input3,
|
|
41398
41451
|
inst
|
|
41399
41452
|
});
|
|
41400
41453
|
return payload;
|
|
@@ -41427,13 +41480,13 @@ var $ZodBigIntFormat = /* @__PURE__ */ $constructor("$ZodBigIntFormat", (inst, d
|
|
|
41427
41480
|
var $ZodSymbol = /* @__PURE__ */ $constructor("$ZodSymbol", (inst, def) => {
|
|
41428
41481
|
$ZodType.init(inst, def);
|
|
41429
41482
|
inst._zod.parse = (payload, _ctx) => {
|
|
41430
|
-
const
|
|
41431
|
-
if (typeof
|
|
41483
|
+
const input3 = payload.value;
|
|
41484
|
+
if (typeof input3 === "symbol")
|
|
41432
41485
|
return payload;
|
|
41433
41486
|
payload.issues.push({
|
|
41434
41487
|
expected: "symbol",
|
|
41435
41488
|
code: "invalid_type",
|
|
41436
|
-
input:
|
|
41489
|
+
input: input3,
|
|
41437
41490
|
inst
|
|
41438
41491
|
});
|
|
41439
41492
|
return payload;
|
|
@@ -41444,13 +41497,13 @@ var $ZodUndefined = /* @__PURE__ */ $constructor("$ZodUndefined", (inst, def) =>
|
|
|
41444
41497
|
inst._zod.pattern = _undefined;
|
|
41445
41498
|
inst._zod.values = /* @__PURE__ */ new Set([void 0]);
|
|
41446
41499
|
inst._zod.parse = (payload, _ctx) => {
|
|
41447
|
-
const
|
|
41448
|
-
if (typeof
|
|
41500
|
+
const input3 = payload.value;
|
|
41501
|
+
if (typeof input3 === "undefined")
|
|
41449
41502
|
return payload;
|
|
41450
41503
|
payload.issues.push({
|
|
41451
41504
|
expected: "undefined",
|
|
41452
41505
|
code: "invalid_type",
|
|
41453
|
-
input:
|
|
41506
|
+
input: input3,
|
|
41454
41507
|
inst
|
|
41455
41508
|
});
|
|
41456
41509
|
return payload;
|
|
@@ -41461,13 +41514,13 @@ var $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => {
|
|
|
41461
41514
|
inst._zod.pattern = _null;
|
|
41462
41515
|
inst._zod.values = /* @__PURE__ */ new Set([null]);
|
|
41463
41516
|
inst._zod.parse = (payload, _ctx) => {
|
|
41464
|
-
const
|
|
41465
|
-
if (
|
|
41517
|
+
const input3 = payload.value;
|
|
41518
|
+
if (input3 === null)
|
|
41466
41519
|
return payload;
|
|
41467
41520
|
payload.issues.push({
|
|
41468
41521
|
expected: "null",
|
|
41469
41522
|
code: "invalid_type",
|
|
41470
|
-
input:
|
|
41523
|
+
input: input3,
|
|
41471
41524
|
inst
|
|
41472
41525
|
});
|
|
41473
41526
|
return payload;
|
|
@@ -41496,13 +41549,13 @@ var $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
|
|
|
41496
41549
|
var $ZodVoid = /* @__PURE__ */ $constructor("$ZodVoid", (inst, def) => {
|
|
41497
41550
|
$ZodType.init(inst, def);
|
|
41498
41551
|
inst._zod.parse = (payload, _ctx) => {
|
|
41499
|
-
const
|
|
41500
|
-
if (typeof
|
|
41552
|
+
const input3 = payload.value;
|
|
41553
|
+
if (typeof input3 === "undefined")
|
|
41501
41554
|
return payload;
|
|
41502
41555
|
payload.issues.push({
|
|
41503
41556
|
expected: "void",
|
|
41504
41557
|
code: "invalid_type",
|
|
41505
|
-
input:
|
|
41558
|
+
input: input3,
|
|
41506
41559
|
inst
|
|
41507
41560
|
});
|
|
41508
41561
|
return payload;
|
|
@@ -41517,15 +41570,15 @@ var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
|
|
|
41517
41570
|
} catch (_err) {
|
|
41518
41571
|
}
|
|
41519
41572
|
}
|
|
41520
|
-
const
|
|
41521
|
-
const isDate =
|
|
41522
|
-
const isValidDate = isDate && !Number.isNaN(
|
|
41573
|
+
const input3 = payload.value;
|
|
41574
|
+
const isDate = input3 instanceof Date;
|
|
41575
|
+
const isValidDate = isDate && !Number.isNaN(input3.getTime());
|
|
41523
41576
|
if (isValidDate)
|
|
41524
41577
|
return payload;
|
|
41525
41578
|
payload.issues.push({
|
|
41526
41579
|
expected: "date",
|
|
41527
41580
|
code: "invalid_type",
|
|
41528
|
-
input:
|
|
41581
|
+
input: input3,
|
|
41529
41582
|
...isDate ? { received: "Invalid Date" } : {},
|
|
41530
41583
|
inst
|
|
41531
41584
|
});
|
|
@@ -41554,9 +41607,9 @@ function capSize(inst, size) {
|
|
|
41554
41607
|
return parse6(payload, ctx);
|
|
41555
41608
|
};
|
|
41556
41609
|
}
|
|
41557
|
-
var arraySize = (
|
|
41558
|
-
var mapSize = (
|
|
41559
|
-
var setSize = (
|
|
41610
|
+
var arraySize = (input3) => Array.isArray(input3) ? input3.length : -1;
|
|
41611
|
+
var mapSize = (input3) => input3 instanceof Map ? input3.size : -1;
|
|
41612
|
+
var setSize = (input3) => input3 instanceof Set ? input3.size : -1;
|
|
41560
41613
|
function handleArrayResult(result, final, index) {
|
|
41561
41614
|
if (result.issues.length) {
|
|
41562
41615
|
final.issues.push(...prefixIssues(index, result.issues));
|
|
@@ -41568,21 +41621,21 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
41568
41621
|
const memo2 = globalConfig.memoizer;
|
|
41569
41622
|
memo2?.attach(inst);
|
|
41570
41623
|
inst._zod.parse = (payload, ctx) => {
|
|
41571
|
-
const
|
|
41572
|
-
if (!Array.isArray(
|
|
41624
|
+
const input3 = payload.value;
|
|
41625
|
+
if (!Array.isArray(input3)) {
|
|
41573
41626
|
payload.issues.push({
|
|
41574
41627
|
expected: "array",
|
|
41575
41628
|
code: "invalid_type",
|
|
41576
|
-
input:
|
|
41629
|
+
input: input3,
|
|
41577
41630
|
inst
|
|
41578
41631
|
});
|
|
41579
41632
|
return payload;
|
|
41580
41633
|
}
|
|
41581
|
-
payload.value = memo2 ? memo2.alloc(inst, payload, Array(
|
|
41634
|
+
payload.value = memo2 ? memo2.alloc(inst, payload, Array(input3.length), ctx) : Array(input3.length);
|
|
41582
41635
|
const proms = [];
|
|
41583
41636
|
const abortEarly = ctx?.abortEarly;
|
|
41584
|
-
for (let i = 0; i <
|
|
41585
|
-
const item =
|
|
41637
|
+
for (let i = 0; i < input3.length; i++) {
|
|
41638
|
+
const item = input3[i];
|
|
41586
41639
|
const result = def.element._zod.run({
|
|
41587
41640
|
value: item,
|
|
41588
41641
|
issues: []
|
|
@@ -41602,8 +41655,8 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
41602
41655
|
};
|
|
41603
41656
|
capSize(inst, arraySize);
|
|
41604
41657
|
});
|
|
41605
|
-
function handlePropertyResult(result, final, key,
|
|
41606
|
-
const isPresent = key in
|
|
41658
|
+
function handlePropertyResult(result, final, key, input3, optin, optout) {
|
|
41659
|
+
const isPresent = key in input3;
|
|
41607
41660
|
const isOptionalOut = optout === "optional";
|
|
41608
41661
|
if (!isPresent && isOptionalOut && optin === "optional") {
|
|
41609
41662
|
return;
|
|
@@ -41655,7 +41708,7 @@ function normalizeDef(def) {
|
|
|
41655
41708
|
optionalKeys: new Set(okeys)
|
|
41656
41709
|
};
|
|
41657
41710
|
}
|
|
41658
|
-
function handleCatchall(proms,
|
|
41711
|
+
function handleCatchall(proms, input3, payload, ctx, def, inst, abortEarly) {
|
|
41659
41712
|
const unrecognized = [];
|
|
41660
41713
|
const keySet = def.keySet;
|
|
41661
41714
|
const _catchall = def.catchall._zod;
|
|
@@ -41663,7 +41716,7 @@ function handleCatchall(proms, input2, payload, ctx, def, inst, abortEarly) {
|
|
|
41663
41716
|
const optin = _catchall.optin;
|
|
41664
41717
|
const optout = _catchall.optout;
|
|
41665
41718
|
let seen = 0;
|
|
41666
|
-
for (const key in
|
|
41719
|
+
for (const key in input3) {
|
|
41667
41720
|
if (abortEarly && payload.issues.length !== seen) {
|
|
41668
41721
|
if (aborted(payload, seen))
|
|
41669
41722
|
break;
|
|
@@ -41680,18 +41733,18 @@ function handleCatchall(proms, input2, payload, ctx, def, inst, abortEarly) {
|
|
|
41680
41733
|
unrecognized.push(key);
|
|
41681
41734
|
continue;
|
|
41682
41735
|
}
|
|
41683
|
-
const r = _catchall.run({ value:
|
|
41736
|
+
const r = _catchall.run({ value: input3[key], issues: [] }, ctx);
|
|
41684
41737
|
if (r instanceof Promise) {
|
|
41685
|
-
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key,
|
|
41738
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input3, optin, optout)));
|
|
41686
41739
|
} else {
|
|
41687
|
-
handlePropertyResult(r, payload, key,
|
|
41740
|
+
handlePropertyResult(r, payload, key, input3, optin, optout);
|
|
41688
41741
|
}
|
|
41689
41742
|
}
|
|
41690
41743
|
if (unrecognized.length) {
|
|
41691
41744
|
payload.issues.push({
|
|
41692
41745
|
code: "unrecognized_keys",
|
|
41693
41746
|
keys: unrecognized,
|
|
41694
|
-
input:
|
|
41747
|
+
input: input3,
|
|
41695
41748
|
inst,
|
|
41696
41749
|
// Describes the shape of the input, not the validity of the parsed value, so it never aborts. The parse still fails; the schema's own checks just get to run first, and an enclosing intersection can reconcile the key against a sibling operand.
|
|
41697
41750
|
continue: true
|
|
@@ -41742,12 +41795,12 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
41742
41795
|
memo2?.attach(inst);
|
|
41743
41796
|
inst._zod.parse = (payload, ctx) => {
|
|
41744
41797
|
value2 ?? (value2 = _normalized.value);
|
|
41745
|
-
const
|
|
41746
|
-
if (!isObject3(
|
|
41798
|
+
const input3 = payload.value;
|
|
41799
|
+
if (!isObject3(input3)) {
|
|
41747
41800
|
payload.issues.push({
|
|
41748
41801
|
expected: "object",
|
|
41749
41802
|
code: "invalid_type",
|
|
41750
|
-
input:
|
|
41803
|
+
input: input3,
|
|
41751
41804
|
inst
|
|
41752
41805
|
});
|
|
41753
41806
|
return payload;
|
|
@@ -41768,17 +41821,17 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
41768
41821
|
const el = shape[key];
|
|
41769
41822
|
const optin = el._zod.optin;
|
|
41770
41823
|
const optout = el._zod.optout;
|
|
41771
|
-
const r = el._zod.run({ value:
|
|
41824
|
+
const r = el._zod.run({ value: input3[key], issues: [] }, ctx);
|
|
41772
41825
|
if (r instanceof Promise) {
|
|
41773
|
-
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key,
|
|
41826
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input3, optin, optout)));
|
|
41774
41827
|
} else {
|
|
41775
|
-
handlePropertyResult(r, payload, key,
|
|
41828
|
+
handlePropertyResult(r, payload, key, input3, optin, optout);
|
|
41776
41829
|
}
|
|
41777
41830
|
}
|
|
41778
41831
|
if (!catchall) {
|
|
41779
41832
|
return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
41780
41833
|
}
|
|
41781
|
-
return handleCatchall(proms,
|
|
41834
|
+
return handleCatchall(proms, input3, payload, ctx, _normalized.value, inst, abortEarly === true);
|
|
41782
41835
|
};
|
|
41783
41836
|
});
|
|
41784
41837
|
var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => {
|
|
@@ -41887,12 +41940,12 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
41887
41940
|
let value2;
|
|
41888
41941
|
inst._zod.parse = (payload, ctx) => {
|
|
41889
41942
|
value2 ?? (value2 = _normalized.value);
|
|
41890
|
-
const
|
|
41891
|
-
if (!isObject3(
|
|
41943
|
+
const input3 = payload.value;
|
|
41944
|
+
if (!isObject3(input3)) {
|
|
41892
41945
|
payload.issues.push({
|
|
41893
41946
|
expected: "object",
|
|
41894
41947
|
code: "invalid_type",
|
|
41895
|
-
input:
|
|
41948
|
+
input: input3,
|
|
41896
41949
|
inst
|
|
41897
41950
|
});
|
|
41898
41951
|
return payload;
|
|
@@ -41903,7 +41956,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
41903
41956
|
payload = fastpass(payload, ctx);
|
|
41904
41957
|
if (!catchall)
|
|
41905
41958
|
return payload;
|
|
41906
|
-
return handleCatchall([],
|
|
41959
|
+
return handleCatchall([], input3, payload, ctx, value2, inst, ctx?.abortEarly === true);
|
|
41907
41960
|
}
|
|
41908
41961
|
return superParse(payload, ctx);
|
|
41909
41962
|
};
|
|
@@ -42095,17 +42148,17 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
42095
42148
|
});
|
|
42096
42149
|
const disc = cached(() => discriminatorMap(def));
|
|
42097
42150
|
inst._zod.parse = (payload, ctx) => {
|
|
42098
|
-
const
|
|
42099
|
-
if (!isObject2(
|
|
42151
|
+
const input3 = payload.value;
|
|
42152
|
+
if (!isObject2(input3)) {
|
|
42100
42153
|
payload.issues.push({
|
|
42101
42154
|
code: "invalid_type",
|
|
42102
42155
|
expected: "object",
|
|
42103
|
-
input:
|
|
42156
|
+
input: input3,
|
|
42104
42157
|
inst
|
|
42105
42158
|
});
|
|
42106
42159
|
return payload;
|
|
42107
42160
|
}
|
|
42108
|
-
const value2 =
|
|
42161
|
+
const value2 = input3?.[def.discriminator];
|
|
42109
42162
|
const opt = disc.value.get(value2);
|
|
42110
42163
|
if (opt && (value2 !== void 0 || ctx.direction !== "backward")) {
|
|
42111
42164
|
return opt._zod.run(payload, ctx);
|
|
@@ -42119,7 +42172,7 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
42119
42172
|
note: "No matching discriminator",
|
|
42120
42173
|
discriminator: def.discriminator,
|
|
42121
42174
|
options: Array.from(disc.value.keys()).filter((value3) => disc.value.get(value3) !== null),
|
|
42122
|
-
input:
|
|
42175
|
+
input: input3,
|
|
42123
42176
|
path: [def.discriminator],
|
|
42124
42177
|
inst
|
|
42125
42178
|
});
|
|
@@ -42129,9 +42182,9 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
42129
42182
|
var $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => {
|
|
42130
42183
|
$ZodType.init(inst, def);
|
|
42131
42184
|
inst._zod.parse = (payload, ctx) => {
|
|
42132
|
-
const
|
|
42133
|
-
const left = def.left._zod.run({ value:
|
|
42134
|
-
const right = def.right._zod.run({ value:
|
|
42185
|
+
const input3 = payload.value;
|
|
42186
|
+
const left = def.left._zod.run({ value: input3, issues: [] }, ctx);
|
|
42187
|
+
const right = def.right._zod.run({ value: input3, issues: [] }, ctx);
|
|
42135
42188
|
const async = left instanceof Promise || right instanceof Promise;
|
|
42136
42189
|
if (async) {
|
|
42137
42190
|
return Promise.all([left, right]).then(([left2, right2]) => {
|
|
@@ -42246,10 +42299,10 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
42246
42299
|
const memo2 = globalConfig.memoizer;
|
|
42247
42300
|
memo2?.attach(inst);
|
|
42248
42301
|
inst._zod.parse = (payload, ctx) => {
|
|
42249
|
-
const
|
|
42250
|
-
if (!Array.isArray(
|
|
42302
|
+
const input3 = payload.value;
|
|
42303
|
+
if (!Array.isArray(input3)) {
|
|
42251
42304
|
payload.issues.push({
|
|
42252
|
-
input:
|
|
42305
|
+
input: input3,
|
|
42253
42306
|
inst,
|
|
42254
42307
|
expected: "tuple",
|
|
42255
42308
|
code: "invalid_type"
|
|
@@ -42261,23 +42314,23 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
42261
42314
|
const optinStart = getTupleOptStart(items, "optin");
|
|
42262
42315
|
const optoutStart = getTupleOptStart(items, "optout");
|
|
42263
42316
|
if (!def.rest) {
|
|
42264
|
-
if (
|
|
42317
|
+
if (input3.length < optinStart) {
|
|
42265
42318
|
payload.issues.push({
|
|
42266
42319
|
code: "too_small",
|
|
42267
42320
|
minimum: optinStart,
|
|
42268
42321
|
inclusive: true,
|
|
42269
|
-
input:
|
|
42322
|
+
input: input3,
|
|
42270
42323
|
inst,
|
|
42271
42324
|
origin: "array"
|
|
42272
42325
|
});
|
|
42273
42326
|
return payload;
|
|
42274
42327
|
}
|
|
42275
|
-
if (
|
|
42328
|
+
if (input3.length > items.length) {
|
|
42276
42329
|
payload.issues.push({
|
|
42277
42330
|
code: "too_big",
|
|
42278
42331
|
maximum: items.length,
|
|
42279
42332
|
inclusive: true,
|
|
42280
|
-
input:
|
|
42333
|
+
input: input3,
|
|
42281
42334
|
inst,
|
|
42282
42335
|
origin: "array"
|
|
42283
42336
|
});
|
|
@@ -42287,7 +42340,7 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
42287
42340
|
const abortEarly = def.rest ? ctx?.abortEarly : void 0;
|
|
42288
42341
|
let itemAborted = false;
|
|
42289
42342
|
for (let i = 0; i < items.length; i++) {
|
|
42290
|
-
const r = items[i]._zod.run({ value:
|
|
42343
|
+
const r = items[i]._zod.run({ value: input3[i], issues: [] }, ctx);
|
|
42291
42344
|
if (r instanceof Promise) {
|
|
42292
42345
|
proms.push(r.then((rr) => {
|
|
42293
42346
|
itemResults[i] = rr;
|
|
@@ -42300,7 +42353,7 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
42300
42353
|
}
|
|
42301
42354
|
if (def.rest && !itemAborted) {
|
|
42302
42355
|
let i = items.length - 1;
|
|
42303
|
-
const rest =
|
|
42356
|
+
const rest = input3.slice(items.length);
|
|
42304
42357
|
let seen = payload.issues.length;
|
|
42305
42358
|
for (const el of rest) {
|
|
42306
42359
|
if (abortEarly && payload.issues.length !== seen) {
|
|
@@ -42318,9 +42371,9 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
42318
42371
|
}
|
|
42319
42372
|
}
|
|
42320
42373
|
if (proms.length) {
|
|
42321
|
-
return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items,
|
|
42374
|
+
return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items, input3, optoutStart));
|
|
42322
42375
|
}
|
|
42323
|
-
return handleTupleResults(itemResults, payload, items,
|
|
42376
|
+
return handleTupleResults(itemResults, payload, items, input3, optoutStart);
|
|
42324
42377
|
};
|
|
42325
42378
|
});
|
|
42326
42379
|
function getTupleOptStart(items, key) {
|
|
@@ -42337,10 +42390,10 @@ function handleTupleResult(result, final, index) {
|
|
|
42337
42390
|
}
|
|
42338
42391
|
final.value[index] = result.value;
|
|
42339
42392
|
}
|
|
42340
|
-
function handleTupleResults(itemResults, final, items,
|
|
42393
|
+
function handleTupleResults(itemResults, final, items, input3, optoutStart) {
|
|
42341
42394
|
for (let i = 0; i < items.length; i++) {
|
|
42342
42395
|
const r = itemResults[i];
|
|
42343
|
-
const isPresent = i <
|
|
42396
|
+
const isPresent = i < input3.length;
|
|
42344
42397
|
if (!isPresent && i >= optoutStart && items[i]._zod.optin === "optional") {
|
|
42345
42398
|
final.value.length = i;
|
|
42346
42399
|
break;
|
|
@@ -42354,7 +42407,7 @@ function handleTupleResults(itemResults, final, items, input2, optoutStart) {
|
|
|
42354
42407
|
}
|
|
42355
42408
|
final.value[i] = r.value;
|
|
42356
42409
|
}
|
|
42357
|
-
for (let i = final.value.length - 1; i >=
|
|
42410
|
+
for (let i = final.value.length - 1; i >= input3.length; i--) {
|
|
42358
42411
|
if (items[i]._zod.optout === "optional" && final.value[i] === void 0) {
|
|
42359
42412
|
final.value.length = i;
|
|
42360
42413
|
} else {
|
|
@@ -42368,12 +42421,12 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
42368
42421
|
const memo2 = globalConfig.memoizer;
|
|
42369
42422
|
memo2?.attach(inst);
|
|
42370
42423
|
inst._zod.parse = (payload, ctx) => {
|
|
42371
|
-
const
|
|
42372
|
-
if (!isPlainObject(
|
|
42424
|
+
const input3 = payload.value;
|
|
42425
|
+
if (!isPlainObject(input3)) {
|
|
42373
42426
|
payload.issues.push({
|
|
42374
42427
|
expected: "record",
|
|
42375
42428
|
code: "invalid_type",
|
|
42376
|
-
input:
|
|
42429
|
+
input: input3,
|
|
42377
42430
|
inst
|
|
42378
42431
|
});
|
|
42379
42432
|
return payload;
|
|
@@ -42406,7 +42459,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
42406
42459
|
const outKey = keyResult.value;
|
|
42407
42460
|
if (outKey === "__proto__")
|
|
42408
42461
|
continue;
|
|
42409
|
-
const result = def.valueType._zod.run({ value:
|
|
42462
|
+
const result = def.valueType._zod.run({ value: input3[key], issues: [] }, ctx);
|
|
42410
42463
|
if (result instanceof Promise) {
|
|
42411
42464
|
proms.push(result.then((result2) => {
|
|
42412
42465
|
if (result2.issues.length) {
|
|
@@ -42423,12 +42476,12 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
42423
42476
|
}
|
|
42424
42477
|
}
|
|
42425
42478
|
let unrecognized;
|
|
42426
|
-
for (const key in
|
|
42479
|
+
for (const key in input3) {
|
|
42427
42480
|
if (!recordKeys.has(key)) {
|
|
42428
42481
|
if (def.mode === "loose") {
|
|
42429
42482
|
if (key === "__proto__")
|
|
42430
42483
|
continue;
|
|
42431
|
-
payload.value[key] =
|
|
42484
|
+
payload.value[key] = input3[key];
|
|
42432
42485
|
} else {
|
|
42433
42486
|
unrecognized = unrecognized ?? [];
|
|
42434
42487
|
unrecognized.push(key);
|
|
@@ -42438,7 +42491,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
42438
42491
|
if (unrecognized && unrecognized.length > 0) {
|
|
42439
42492
|
payload.issues.push({
|
|
42440
42493
|
code: "unrecognized_keys",
|
|
42441
|
-
input:
|
|
42494
|
+
input: input3,
|
|
42442
42495
|
inst,
|
|
42443
42496
|
keys: unrecognized,
|
|
42444
42497
|
continue: true
|
|
@@ -42447,10 +42500,10 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
42447
42500
|
} else {
|
|
42448
42501
|
payload.value = memo2 ? memo2.alloc(inst, payload, {}, ctx) : {};
|
|
42449
42502
|
let unrecognized;
|
|
42450
|
-
for (const key of Reflect.ownKeys(
|
|
42503
|
+
for (const key of Reflect.ownKeys(input3)) {
|
|
42451
42504
|
if (key === "__proto__")
|
|
42452
42505
|
continue;
|
|
42453
|
-
if (!Object.prototype.propertyIsEnumerable.call(
|
|
42506
|
+
if (!Object.prototype.propertyIsEnumerable.call(input3, key))
|
|
42454
42507
|
continue;
|
|
42455
42508
|
let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
|
|
42456
42509
|
if (keyResult instanceof Promise) {
|
|
@@ -42468,7 +42521,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
42468
42521
|
}
|
|
42469
42522
|
if (keyResult.issues.length) {
|
|
42470
42523
|
if (def.mode === "loose") {
|
|
42471
|
-
payload.value[key] =
|
|
42524
|
+
payload.value[key] = input3[key];
|
|
42472
42525
|
} else if (values) {
|
|
42473
42526
|
unrecognized = unrecognized ?? [];
|
|
42474
42527
|
unrecognized.push(key);
|
|
@@ -42487,7 +42540,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
42487
42540
|
const outKey = keyResult.value;
|
|
42488
42541
|
if (outKey === "__proto__")
|
|
42489
42542
|
continue;
|
|
42490
|
-
const result = def.valueType._zod.run({ value:
|
|
42543
|
+
const result = def.valueType._zod.run({ value: input3[key], issues: [] }, ctx);
|
|
42491
42544
|
if (result instanceof Promise) {
|
|
42492
42545
|
proms.push(result.then((result2) => {
|
|
42493
42546
|
if (result2.issues.length) {
|
|
@@ -42505,7 +42558,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
42505
42558
|
if (unrecognized && unrecognized.length > 0) {
|
|
42506
42559
|
payload.issues.push({
|
|
42507
42560
|
code: "unrecognized_keys",
|
|
42508
|
-
input:
|
|
42561
|
+
input: input3,
|
|
42509
42562
|
inst,
|
|
42510
42563
|
keys: unrecognized,
|
|
42511
42564
|
continue: true
|
|
@@ -42523,12 +42576,12 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
|
42523
42576
|
const memo2 = globalConfig.memoizer;
|
|
42524
42577
|
memo2?.attach(inst);
|
|
42525
42578
|
inst._zod.parse = (payload, ctx) => {
|
|
42526
|
-
const
|
|
42527
|
-
if (!(
|
|
42579
|
+
const input3 = payload.value;
|
|
42580
|
+
if (!(input3 instanceof Map)) {
|
|
42528
42581
|
payload.issues.push({
|
|
42529
42582
|
expected: "map",
|
|
42530
42583
|
code: "invalid_type",
|
|
42531
|
-
input:
|
|
42584
|
+
input: input3,
|
|
42532
42585
|
inst
|
|
42533
42586
|
});
|
|
42534
42587
|
return payload;
|
|
@@ -42537,7 +42590,7 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
|
42537
42590
|
payload.value = memo2 ? memo2.alloc(inst, payload, /* @__PURE__ */ new Map(), ctx) : /* @__PURE__ */ new Map();
|
|
42538
42591
|
const abortEarly = ctx?.abortEarly;
|
|
42539
42592
|
let seen = payload.issues.length;
|
|
42540
|
-
for (const [key, value2] of
|
|
42593
|
+
for (const [key, value2] of input3) {
|
|
42541
42594
|
if (abortEarly && payload.issues.length !== seen) {
|
|
42542
42595
|
if (aborted(payload, seen))
|
|
42543
42596
|
break;
|
|
@@ -42547,10 +42600,10 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
|
42547
42600
|
const valueResult = def.valueType._zod.run({ value: value2, issues: [] }, ctx);
|
|
42548
42601
|
if (keyResult instanceof Promise || valueResult instanceof Promise) {
|
|
42549
42602
|
proms.push(Promise.all([keyResult, valueResult]).then(([keyResult2, valueResult2]) => {
|
|
42550
|
-
handleMapResult(keyResult2, valueResult2, payload, key,
|
|
42603
|
+
handleMapResult(keyResult2, valueResult2, payload, key, input3, inst, ctx);
|
|
42551
42604
|
}));
|
|
42552
42605
|
} else {
|
|
42553
|
-
handleMapResult(keyResult, valueResult, payload, key,
|
|
42606
|
+
handleMapResult(keyResult, valueResult, payload, key, input3, inst, ctx);
|
|
42554
42607
|
}
|
|
42555
42608
|
}
|
|
42556
42609
|
if (proms.length)
|
|
@@ -42559,7 +42612,7 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
|
42559
42612
|
};
|
|
42560
42613
|
capSize(inst, mapSize);
|
|
42561
42614
|
});
|
|
42562
|
-
function handleMapResult(keyResult, valueResult, final, key,
|
|
42615
|
+
function handleMapResult(keyResult, valueResult, final, key, input3, inst, ctx) {
|
|
42563
42616
|
if (keyResult.issues.length) {
|
|
42564
42617
|
if (propertyKeyTypes.has(typeof key)) {
|
|
42565
42618
|
final.issues.push(...prefixIssues(key, keyResult.issues));
|
|
@@ -42567,7 +42620,7 @@ function handleMapResult(keyResult, valueResult, final, key, input2, inst, ctx)
|
|
|
42567
42620
|
final.issues.push({
|
|
42568
42621
|
code: "invalid_key",
|
|
42569
42622
|
origin: "map",
|
|
42570
|
-
input:
|
|
42623
|
+
input: input3,
|
|
42571
42624
|
inst,
|
|
42572
42625
|
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
|
|
42573
42626
|
});
|
|
@@ -42580,7 +42633,7 @@ function handleMapResult(keyResult, valueResult, final, key, input2, inst, ctx)
|
|
|
42580
42633
|
final.issues.push({
|
|
42581
42634
|
origin: "map",
|
|
42582
42635
|
code: "invalid_element",
|
|
42583
|
-
input:
|
|
42636
|
+
input: input3,
|
|
42584
42637
|
inst,
|
|
42585
42638
|
key,
|
|
42586
42639
|
issues: valueResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
|
|
@@ -42594,10 +42647,10 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
|
|
|
42594
42647
|
const memo2 = globalConfig.memoizer;
|
|
42595
42648
|
memo2?.attach(inst);
|
|
42596
42649
|
inst._zod.parse = (payload, ctx) => {
|
|
42597
|
-
const
|
|
42598
|
-
if (!(
|
|
42650
|
+
const input3 = payload.value;
|
|
42651
|
+
if (!(input3 instanceof Set)) {
|
|
42599
42652
|
payload.issues.push({
|
|
42600
|
-
input:
|
|
42653
|
+
input: input3,
|
|
42601
42654
|
inst,
|
|
42602
42655
|
expected: "set",
|
|
42603
42656
|
code: "invalid_type"
|
|
@@ -42608,7 +42661,7 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
|
|
|
42608
42661
|
payload.value = memo2 ? memo2.alloc(inst, payload, /* @__PURE__ */ new Set(), ctx) : /* @__PURE__ */ new Set();
|
|
42609
42662
|
const abortEarly = ctx?.abortEarly;
|
|
42610
42663
|
let seen = payload.issues.length;
|
|
42611
|
-
for (const item of
|
|
42664
|
+
for (const item of input3) {
|
|
42612
42665
|
if (abortEarly && payload.issues.length !== seen) {
|
|
42613
42666
|
if (aborted(payload, seen))
|
|
42614
42667
|
break;
|
|
@@ -42642,14 +42695,14 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
|
42642
42695
|
return new RegExp(patternValues.length ? `^(${patternValues.map((o) => escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
|
|
42643
42696
|
});
|
|
42644
42697
|
inst._zod.parse = (payload, _ctx) => {
|
|
42645
|
-
const
|
|
42646
|
-
if (valuesSet.has(
|
|
42698
|
+
const input3 = payload.value;
|
|
42699
|
+
if (valuesSet.has(input3)) {
|
|
42647
42700
|
return payload;
|
|
42648
42701
|
}
|
|
42649
42702
|
payload.issues.push({
|
|
42650
42703
|
code: "invalid_value",
|
|
42651
42704
|
values,
|
|
42652
|
-
input:
|
|
42705
|
+
input: input3,
|
|
42653
42706
|
inst
|
|
42654
42707
|
});
|
|
42655
42708
|
return payload;
|
|
@@ -42664,14 +42717,14 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
42664
42717
|
return new RegExp(vals.length ? `^(${vals.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$` : "^[^\\s\\S]$");
|
|
42665
42718
|
});
|
|
42666
42719
|
inst._zod.parse = (payload, _ctx) => {
|
|
42667
|
-
const
|
|
42668
|
-
if (values.has(
|
|
42720
|
+
const input3 = payload.value;
|
|
42721
|
+
if (values.has(input3)) {
|
|
42669
42722
|
return payload;
|
|
42670
42723
|
}
|
|
42671
42724
|
payload.issues.push({
|
|
42672
42725
|
code: "invalid_value",
|
|
42673
42726
|
values: def.values,
|
|
42674
|
-
input:
|
|
42727
|
+
input: input3,
|
|
42675
42728
|
inst
|
|
42676
42729
|
});
|
|
42677
42730
|
return payload;
|
|
@@ -42680,13 +42733,13 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
42680
42733
|
var $ZodFile = /* @__PURE__ */ $constructor("$ZodFile", (inst, def) => {
|
|
42681
42734
|
$ZodType.init(inst, def);
|
|
42682
42735
|
inst._zod.parse = (payload, _ctx) => {
|
|
42683
|
-
const
|
|
42684
|
-
if (
|
|
42736
|
+
const input3 = payload.value;
|
|
42737
|
+
if (input3 instanceof File)
|
|
42685
42738
|
return payload;
|
|
42686
42739
|
payload.issues.push({
|
|
42687
42740
|
expected: "file",
|
|
42688
42741
|
code: "invalid_type",
|
|
42689
|
-
input:
|
|
42742
|
+
input: input3,
|
|
42690
42743
|
inst
|
|
42691
42744
|
});
|
|
42692
42745
|
return payload;
|
|
@@ -43194,20 +43247,20 @@ var $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
|
|
|
43194
43247
|
return payload;
|
|
43195
43248
|
};
|
|
43196
43249
|
inst._zod.check = (payload) => {
|
|
43197
|
-
const
|
|
43198
|
-
const r = def.fn(
|
|
43250
|
+
const input3 = payload.value;
|
|
43251
|
+
const r = def.fn(input3);
|
|
43199
43252
|
if (r instanceof Promise) {
|
|
43200
|
-
return r.then((r2) => handleRefineResult(r2, payload,
|
|
43253
|
+
return r.then((r2) => handleRefineResult(r2, payload, input3, inst));
|
|
43201
43254
|
}
|
|
43202
|
-
handleRefineResult(r, payload,
|
|
43255
|
+
handleRefineResult(r, payload, input3, inst);
|
|
43203
43256
|
return;
|
|
43204
43257
|
};
|
|
43205
43258
|
});
|
|
43206
|
-
function handleRefineResult(result, payload,
|
|
43259
|
+
function handleRefineResult(result, payload, input3, inst) {
|
|
43207
43260
|
if (!result) {
|
|
43208
43261
|
const _iss = {
|
|
43209
43262
|
code: "custom",
|
|
43210
|
-
input:
|
|
43263
|
+
input: input3,
|
|
43211
43264
|
inst,
|
|
43212
43265
|
// incorporates params.error into issue reporting
|
|
43213
43266
|
path: [...inst._zod.def.path ?? []],
|
|
@@ -43440,8 +43493,8 @@ var memo = {
|
|
|
43440
43493
|
else
|
|
43441
43494
|
rechecked = true;
|
|
43442
43495
|
}
|
|
43443
|
-
const
|
|
43444
|
-
if (!isRef(
|
|
43496
|
+
const input3 = payload.value;
|
|
43497
|
+
if (!isRef(input3))
|
|
43445
43498
|
return base(payload, ctx);
|
|
43446
43499
|
let state = ctx[STATE];
|
|
43447
43500
|
if (!state) {
|
|
@@ -43456,7 +43509,7 @@ var memo = {
|
|
|
43456
43509
|
lastCtx = ctx;
|
|
43457
43510
|
lastBucket = bucket;
|
|
43458
43511
|
}
|
|
43459
|
-
const hit = bucket.get(
|
|
43512
|
+
const hit = bucket.get(input3);
|
|
43460
43513
|
if (hit) {
|
|
43461
43514
|
payload.value = hit.value;
|
|
43462
43515
|
if (hit.issues) {
|
|
@@ -44975,9 +45028,9 @@ var error12 = () => {
|
|
|
44975
45028
|
nan: "NaN"
|
|
44976
45029
|
// All other type names omitted - they fall back to raw values via ?? operator
|
|
44977
45030
|
};
|
|
44978
|
-
function getTypeName(type,
|
|
44979
|
-
if (type === "number" && typeof
|
|
44980
|
-
return String(
|
|
45031
|
+
function getTypeName(type, input3) {
|
|
45032
|
+
if (type === "number" && typeof input3 === "number" && !Number.isFinite(input3)) {
|
|
45033
|
+
return String(input3);
|
|
44981
45034
|
}
|
|
44982
45035
|
return TypeDictionary[type] ?? type;
|
|
44983
45036
|
}
|
|
@@ -53483,23 +53536,23 @@ function _overwrite(tx) {
|
|
|
53483
53536
|
}
|
|
53484
53537
|
// @__NO_SIDE_EFFECTS__
|
|
53485
53538
|
function _normalize(form) {
|
|
53486
|
-
return /* @__PURE__ */ _overwrite((
|
|
53539
|
+
return /* @__PURE__ */ _overwrite((input3) => input3.normalize(form));
|
|
53487
53540
|
}
|
|
53488
53541
|
// @__NO_SIDE_EFFECTS__
|
|
53489
53542
|
function _trim() {
|
|
53490
|
-
return /* @__PURE__ */ _overwrite((
|
|
53543
|
+
return /* @__PURE__ */ _overwrite((input3) => input3.trim());
|
|
53491
53544
|
}
|
|
53492
53545
|
// @__NO_SIDE_EFFECTS__
|
|
53493
53546
|
function _toLowerCase() {
|
|
53494
|
-
return /* @__PURE__ */ _overwrite((
|
|
53547
|
+
return /* @__PURE__ */ _overwrite((input3) => input3.toLowerCase());
|
|
53495
53548
|
}
|
|
53496
53549
|
// @__NO_SIDE_EFFECTS__
|
|
53497
53550
|
function _toUpperCase() {
|
|
53498
|
-
return /* @__PURE__ */ _overwrite((
|
|
53551
|
+
return /* @__PURE__ */ _overwrite((input3) => input3.toUpperCase());
|
|
53499
53552
|
}
|
|
53500
53553
|
// @__NO_SIDE_EFFECTS__
|
|
53501
53554
|
function _slugify() {
|
|
53502
|
-
return /* @__PURE__ */ _overwrite((
|
|
53555
|
+
return /* @__PURE__ */ _overwrite((input3) => slugify(input3));
|
|
53503
53556
|
}
|
|
53504
53557
|
// @__NO_SIDE_EFFECTS__
|
|
53505
53558
|
function _array(Class2, element, params) {
|
|
@@ -53805,8 +53858,8 @@ function _stringbool(Classes, _params) {
|
|
|
53805
53858
|
type: "pipe",
|
|
53806
53859
|
in: stringSchema,
|
|
53807
53860
|
out: booleanSchema,
|
|
53808
|
-
transform: ((
|
|
53809
|
-
let data2 =
|
|
53861
|
+
transform: ((input3, payload) => {
|
|
53862
|
+
let data2 = input3;
|
|
53810
53863
|
if (params.case !== "sensitive")
|
|
53811
53864
|
data2 = data2.toLowerCase();
|
|
53812
53865
|
if (truthySet.has(data2)) {
|
|
@@ -53825,8 +53878,8 @@ function _stringbool(Classes, _params) {
|
|
|
53825
53878
|
return {};
|
|
53826
53879
|
}
|
|
53827
53880
|
}),
|
|
53828
|
-
reverseTransform: ((
|
|
53829
|
-
if (
|
|
53881
|
+
reverseTransform: ((input3, _payload) => {
|
|
53882
|
+
if (input3 === true) {
|
|
53830
53883
|
return truthyArray[0] || "true";
|
|
53831
53884
|
} else {
|
|
53832
53885
|
return falsyArray[0] || "false";
|
|
@@ -55101,9 +55154,9 @@ var allProcessors = {
|
|
|
55101
55154
|
optional: optionalProcessor,
|
|
55102
55155
|
lazy: lazyProcessor
|
|
55103
55156
|
};
|
|
55104
|
-
function toJSONSchema(
|
|
55105
|
-
if ("_idmap" in
|
|
55106
|
-
const registry2 =
|
|
55157
|
+
function toJSONSchema(input3, params) {
|
|
55158
|
+
if ("_idmap" in input3) {
|
|
55159
|
+
const registry2 = input3;
|
|
55107
55160
|
const ctx2 = initializeContext({ ...params, processors: allProcessors });
|
|
55108
55161
|
const defs = {};
|
|
55109
55162
|
for (const entry of registry2._idmap.entries()) {
|
|
@@ -55131,9 +55184,9 @@ function toJSONSchema(input2, params) {
|
|
|
55131
55184
|
return { schemas };
|
|
55132
55185
|
}
|
|
55133
55186
|
const ctx = initializeContext({ ...params, processors: allProcessors });
|
|
55134
|
-
processSchema(
|
|
55135
|
-
extractDefs(ctx,
|
|
55136
|
-
return finalize(ctx,
|
|
55187
|
+
processSchema(input3, ctx);
|
|
55188
|
+
extractDefs(ctx, input3);
|
|
55189
|
+
return finalize(ctx, input3);
|
|
55137
55190
|
}
|
|
55138
55191
|
|
|
55139
55192
|
// node_modules/zod/v4/core/json-schema-generator.js
|
|
@@ -57940,7 +57993,7 @@ function outSide(def) {
|
|
|
57940
57993
|
function inSide(def) {
|
|
57941
57994
|
return def.in._zod.traits.has("$ZodTransform") ? outSide(def) : def.in;
|
|
57942
57995
|
}
|
|
57943
|
-
function
|
|
57996
|
+
function input2(schema) {
|
|
57944
57997
|
return visit(schema, {
|
|
57945
57998
|
pipe: (s) => inSide(s._zod.def),
|
|
57946
57999
|
// A default value belongs to the output side, so a rewritten inner type leaves it stranded. `.default()` widens the declared input type with `undefined`, and `optional` is what carries that across.
|
|
@@ -58968,6 +59021,18 @@ function isCliCommandAllowed(raw, groupName, subcommand) {
|
|
|
58968
59021
|
if (subcommand && PUBLIC_MODEL_COMMANDS.has(subcommand)) return true;
|
|
58969
59022
|
return allowed.get("model") === "all" || subcommand === "run" && allowed.get("model run") === "all";
|
|
58970
59023
|
}
|
|
59024
|
+
if (groupName === "data" || groupName === "mail") {
|
|
59025
|
+
const entries = raw === void 0 ? process.env.KOLLAB_ALLOWED_CLI_COMMANDS : raw;
|
|
59026
|
+
let scopes = [];
|
|
59027
|
+
try {
|
|
59028
|
+
const parsed = JSON.parse(entries || "[]");
|
|
59029
|
+
if (Array.isArray(parsed) && parsed.every((s) => typeof s === "string")) scopes = parsed;
|
|
59030
|
+
} catch {
|
|
59031
|
+
return false;
|
|
59032
|
+
}
|
|
59033
|
+
const action = groupName === "data" ? ["collections", "list", "get", "changes"].includes(subcommand ?? "") ? "read" : subcommand === "configure" ? "manage" : "write" : subcommand === "send" ? "send" : ["mailbox", "recipient"].includes(subcommand ?? "") ? "manage" : "read";
|
|
59034
|
+
return scopes.includes(`${groupName}:${action}`);
|
|
59035
|
+
}
|
|
58971
59036
|
const permission = allowed.get(groupName);
|
|
58972
59037
|
if (!permission) return false;
|
|
58973
59038
|
if (groupName !== "app" || permission === "all") return true;
|
|
@@ -58992,6 +59057,10 @@ function enforceCliCommandRestrictions(program3) {
|
|
|
58992
59057
|
for (const cmd of program3.commands) {
|
|
58993
59058
|
const groupName = cmd.name();
|
|
58994
59059
|
if (UNRESTRICTED_COMMANDS.has(groupName)) continue;
|
|
59060
|
+
if (groupName === "data" || groupName === "mail") {
|
|
59061
|
+
for (const sub of cmd.commands) if (!isCliCommandAllowed(void 0, groupName, sub.name())) blockCommand(sub, `${groupName} ${sub.name()}`);
|
|
59062
|
+
continue;
|
|
59063
|
+
}
|
|
58995
59064
|
if (groupName === "model") {
|
|
58996
59065
|
for (const sub of cmd.commands) {
|
|
58997
59066
|
if (!isCliCommandAllowed(void 0, "model", sub.name())) blockCommand(sub, `model ${sub.name()}`);
|
|
@@ -59061,6 +59130,7 @@ registerWorkspaceCommands(program2);
|
|
|
59061
59130
|
registerImagineCommands(program2);
|
|
59062
59131
|
registerUserCommands(program2);
|
|
59063
59132
|
registerHostedAppCommands(program2);
|
|
59133
|
+
registerSitePlatformCommands(program2);
|
|
59064
59134
|
registerBrowserCommands(program2);
|
|
59065
59135
|
registerInviteCommands(program2);
|
|
59066
59136
|
registerModelCommands(program2);
|