@ancha-labs/cli 0.4.3 → 0.4.5
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/lib/ancha.mjs +15888 -12060
- package/lib/assets/SKILL.md +1 -1
- package/lib/assets/docs/cloud.md +1 -1
- package/lib/assets/docs/explain.md +1 -1
- package/lib/assets/docs/integrations.md +2 -2
- package/lib/assets/docs/playgrounds.md +3 -4
- package/lib/assets/docs/run.md +4 -4
- package/lib/assets/docs/setup.md +1 -1
- package/lib/assets/docs/tools.md +8 -6
- package/lib/assets/docs/traces.md +11 -9
- package/lib/assets/harbor/companion.mjs +10830 -7370
- package/lib/assets/ui/app.js +47 -12
- package/lib/assets/ui/style.css +2 -0
- package/lib/mcp-entry.mjs +591 -290
- package/lib/worker.mjs +12467 -8964
- package/lib/world-server.mjs +10740 -7284
- package/package.json +1 -1
package/lib/mcp-entry.mjs
CHANGED
|
@@ -1006,14 +1006,14 @@ var require_foldFlowLines = __commonJS({
|
|
|
1006
1006
|
var FOLD_FLOW = "flow";
|
|
1007
1007
|
var FOLD_BLOCK = "block";
|
|
1008
1008
|
var FOLD_QUOTED = "quoted";
|
|
1009
|
-
function foldFlowLines(
|
|
1009
|
+
function foldFlowLines(text11, indent, mode = "flow", { indentAtStart, lineWidth = 80, minContentWidth = 20, onFold, onOverflow } = {}) {
|
|
1010
1010
|
if (!lineWidth || lineWidth < 0)
|
|
1011
|
-
return
|
|
1011
|
+
return text11;
|
|
1012
1012
|
if (lineWidth < minContentWidth)
|
|
1013
1013
|
minContentWidth = 0;
|
|
1014
1014
|
const endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length);
|
|
1015
|
-
if (
|
|
1016
|
-
return
|
|
1015
|
+
if (text11.length <= endStep)
|
|
1016
|
+
return text11;
|
|
1017
1017
|
const folds = [];
|
|
1018
1018
|
const escapedFolds = {};
|
|
1019
1019
|
let end = lineWidth - indent.length;
|
|
@@ -1030,14 +1030,14 @@ var require_foldFlowLines = __commonJS({
|
|
|
1030
1030
|
let escStart = -1;
|
|
1031
1031
|
let escEnd = -1;
|
|
1032
1032
|
if (mode === FOLD_BLOCK) {
|
|
1033
|
-
i = consumeMoreIndentedLines(
|
|
1033
|
+
i = consumeMoreIndentedLines(text11, i, indent.length);
|
|
1034
1034
|
if (i !== -1)
|
|
1035
1035
|
end = i + endStep;
|
|
1036
1036
|
}
|
|
1037
|
-
for (let ch; ch =
|
|
1037
|
+
for (let ch; ch = text11[i += 1]; ) {
|
|
1038
1038
|
if (mode === FOLD_QUOTED && ch === "\\") {
|
|
1039
1039
|
escStart = i;
|
|
1040
|
-
switch (
|
|
1040
|
+
switch (text11[i + 1]) {
|
|
1041
1041
|
case "x":
|
|
1042
1042
|
i += 3;
|
|
1043
1043
|
break;
|
|
@@ -1054,12 +1054,12 @@ var require_foldFlowLines = __commonJS({
|
|
|
1054
1054
|
}
|
|
1055
1055
|
if (ch === "\n") {
|
|
1056
1056
|
if (mode === FOLD_BLOCK)
|
|
1057
|
-
i = consumeMoreIndentedLines(
|
|
1057
|
+
i = consumeMoreIndentedLines(text11, i, indent.length);
|
|
1058
1058
|
end = i + indent.length + endStep;
|
|
1059
1059
|
split = void 0;
|
|
1060
1060
|
} else {
|
|
1061
1061
|
if (ch === " " && prev && prev !== " " && prev !== "\n" && prev !== " ") {
|
|
1062
|
-
const next =
|
|
1062
|
+
const next = text11[i + 1];
|
|
1063
1063
|
if (next && next !== " " && next !== "\n" && next !== " ")
|
|
1064
1064
|
split = i;
|
|
1065
1065
|
}
|
|
@@ -1071,12 +1071,12 @@ var require_foldFlowLines = __commonJS({
|
|
|
1071
1071
|
} else if (mode === FOLD_QUOTED) {
|
|
1072
1072
|
while (prev === " " || prev === " ") {
|
|
1073
1073
|
prev = ch;
|
|
1074
|
-
ch =
|
|
1074
|
+
ch = text11[i += 1];
|
|
1075
1075
|
overflow = true;
|
|
1076
1076
|
}
|
|
1077
1077
|
const j = i > escEnd + 1 ? i - 2 : escStart - 1;
|
|
1078
1078
|
if (escapedFolds[j])
|
|
1079
|
-
return
|
|
1079
|
+
return text11;
|
|
1080
1080
|
folds.push(j);
|
|
1081
1081
|
escapedFolds[j] = true;
|
|
1082
1082
|
end = j + endStep;
|
|
@@ -1091,39 +1091,39 @@ var require_foldFlowLines = __commonJS({
|
|
|
1091
1091
|
if (overflow && onOverflow)
|
|
1092
1092
|
onOverflow();
|
|
1093
1093
|
if (folds.length === 0)
|
|
1094
|
-
return
|
|
1094
|
+
return text11;
|
|
1095
1095
|
if (onFold)
|
|
1096
1096
|
onFold();
|
|
1097
|
-
let res =
|
|
1097
|
+
let res = text11.slice(0, folds[0]);
|
|
1098
1098
|
for (let i2 = 0; i2 < folds.length; ++i2) {
|
|
1099
1099
|
const fold = folds[i2];
|
|
1100
|
-
const end2 = folds[i2 + 1] ||
|
|
1100
|
+
const end2 = folds[i2 + 1] || text11.length;
|
|
1101
1101
|
if (fold === 0)
|
|
1102
1102
|
res = `
|
|
1103
|
-
${indent}${
|
|
1103
|
+
${indent}${text11.slice(0, end2)}`;
|
|
1104
1104
|
else {
|
|
1105
1105
|
if (mode === FOLD_QUOTED && escapedFolds[fold])
|
|
1106
|
-
res += `${
|
|
1106
|
+
res += `${text11[fold]}\\`;
|
|
1107
1107
|
res += `
|
|
1108
|
-
${indent}${
|
|
1108
|
+
${indent}${text11.slice(fold + 1, end2)}`;
|
|
1109
1109
|
}
|
|
1110
1110
|
}
|
|
1111
1111
|
return res;
|
|
1112
1112
|
}
|
|
1113
|
-
function consumeMoreIndentedLines(
|
|
1113
|
+
function consumeMoreIndentedLines(text11, i, indent) {
|
|
1114
1114
|
let end = i;
|
|
1115
1115
|
let start = i + 1;
|
|
1116
|
-
let ch =
|
|
1116
|
+
let ch = text11[start];
|
|
1117
1117
|
while (ch === " " || ch === " ") {
|
|
1118
1118
|
if (i < start + indent) {
|
|
1119
|
-
ch =
|
|
1119
|
+
ch = text11[++i];
|
|
1120
1120
|
} else {
|
|
1121
1121
|
do {
|
|
1122
|
-
ch =
|
|
1122
|
+
ch = text11[++i];
|
|
1123
1123
|
} while (ch && ch !== "\n");
|
|
1124
1124
|
end = i;
|
|
1125
1125
|
start = i + 1;
|
|
1126
|
-
ch =
|
|
1126
|
+
ch = text11[start];
|
|
1127
1127
|
}
|
|
1128
1128
|
}
|
|
1129
1129
|
return end;
|
|
@@ -3129,9 +3129,9 @@ var require_timestamp = __commonJS({
|
|
|
3129
3129
|
const match = str.match(timestamp2.test);
|
|
3130
3130
|
if (!match)
|
|
3131
3131
|
throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");
|
|
3132
|
-
const [, year, month,
|
|
3132
|
+
const [, year, month, day5, hour2, minute, second] = match.map(Number);
|
|
3133
3133
|
const millisec = match[7] ? Number((match[7] + "00").substr(1, 3)) : 0;
|
|
3134
|
-
let date9 = Date.UTC(year, month - 1,
|
|
3134
|
+
let date9 = Date.UTC(year, month - 1, day5, hour2 || 0, minute || 0, second || 0, millisec);
|
|
3135
3135
|
const tz = match[8];
|
|
3136
3136
|
if (tz && tz !== "Z") {
|
|
3137
3137
|
let d = parseSexagesimal(tz, false);
|
|
@@ -11044,15 +11044,15 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
11044
11044
|
const syms = normalized.symbolKeys;
|
|
11045
11045
|
const doc = new Doc(["payload", "ctx"], { shape, inst, memo: memo4, syms });
|
|
11046
11046
|
const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
|
11047
|
-
const prefixStr = (
|
|
11048
|
-
let ${
|
|
11049
|
-
for (let i = 0; i < ${
|
|
11050
|
-
const iss = ${
|
|
11047
|
+
const prefixStr = (id9, k) => `
|
|
11048
|
+
let ${id9}_ab = false;
|
|
11049
|
+
for (let i = 0; i < ${id9}.issues.length; i++) {
|
|
11050
|
+
const iss = ${id9}.issues[i];
|
|
11051
11051
|
iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
|
|
11052
11052
|
payload.issues.push(iss);
|
|
11053
|
-
if (iss.continue !== true) ${
|
|
11053
|
+
if (iss.continue !== true) ${id9}_ab = true;
|
|
11054
11054
|
}
|
|
11055
|
-
if (${
|
|
11055
|
+
if (${id9}_ab && ctx && ctx.abortEarly) {
|
|
11056
11056
|
payload.value = newResult;
|
|
11057
11057
|
return payload;
|
|
11058
11058
|
}`;
|
|
@@ -11066,34 +11066,34 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
11066
11066
|
for (const key2 of normalized.allKeys) {
|
|
11067
11067
|
if (key2 === "__proto__")
|
|
11068
11068
|
continue;
|
|
11069
|
-
const
|
|
11069
|
+
const id9 = ids[key2];
|
|
11070
11070
|
const k = typeof key2 === "symbol" ? `syms[${syms.indexOf(key2)}]` : esc(key2);
|
|
11071
11071
|
const isPresent = `${k} in input`;
|
|
11072
11072
|
const schema = shape[key2];
|
|
11073
11073
|
const optin = schema?._zod?.optin;
|
|
11074
11074
|
const isOptionalIn = optin !== void 0;
|
|
11075
11075
|
const isOptionalOut = schema?._zod?.optout === "optional";
|
|
11076
|
-
doc.write(`const ${
|
|
11076
|
+
doc.write(`const ${id9} = ${parseStr(k)};`);
|
|
11077
11077
|
if (isOptionalIn && isOptionalOut) {
|
|
11078
|
-
const assign = optin === "optional" ? `${
|
|
11078
|
+
const assign = optin === "optional" ? `${id9}_present` : `${id9}.value !== undefined || ${id9}_present`;
|
|
11079
11079
|
doc.write(`
|
|
11080
|
-
const ${
|
|
11081
|
-
if (!${
|
|
11082
|
-
if (${
|
|
11080
|
+
const ${id9}_present = ${isPresent};
|
|
11081
|
+
if (!${id9}.issues.length || ${id9}_present) {
|
|
11082
|
+
if (${id9}.issues.length) {${prefixStr(id9, k)}
|
|
11083
11083
|
}
|
|
11084
11084
|
|
|
11085
11085
|
if (${assign}) {
|
|
11086
|
-
newResult[${k}] = ${
|
|
11086
|
+
newResult[${k}] = ${id9}.value;
|
|
11087
11087
|
}
|
|
11088
11088
|
}
|
|
11089
11089
|
|
|
11090
11090
|
`);
|
|
11091
11091
|
} else if (!isOptionalIn) {
|
|
11092
11092
|
doc.write(`
|
|
11093
|
-
const ${
|
|
11094
|
-
if (${
|
|
11093
|
+
const ${id9}_present = ${isPresent};
|
|
11094
|
+
if (${id9}.issues.length) {${prefixStr(id9, k)}
|
|
11095
11095
|
}
|
|
11096
|
-
if (!${
|
|
11096
|
+
if (!${id9}_present && !${id9}.issues.length) {
|
|
11097
11097
|
payload.issues.push({
|
|
11098
11098
|
code: "invalid_type",
|
|
11099
11099
|
expected: "nonoptional",
|
|
@@ -11106,22 +11106,22 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
11106
11106
|
}
|
|
11107
11107
|
}
|
|
11108
11108
|
|
|
11109
|
-
if (${
|
|
11110
|
-
newResult[${k}] = ${
|
|
11109
|
+
if (${id9}_present) {
|
|
11110
|
+
newResult[${k}] = ${id9}.value;
|
|
11111
11111
|
}
|
|
11112
11112
|
|
|
11113
11113
|
`);
|
|
11114
11114
|
} else {
|
|
11115
11115
|
doc.write(`
|
|
11116
|
-
if (${
|
|
11116
|
+
if (${id9}.issues.length) {${prefixStr(id9, k)}
|
|
11117
11117
|
}
|
|
11118
11118
|
`);
|
|
11119
11119
|
if (optin === "defaulted") {
|
|
11120
|
-
doc.write(`newResult[${k}] = ${
|
|
11120
|
+
doc.write(`newResult[${k}] = ${id9}.value;`);
|
|
11121
11121
|
} else {
|
|
11122
11122
|
doc.write(`
|
|
11123
|
-
if (${
|
|
11124
|
-
newResult[${k}] = ${
|
|
11123
|
+
if (${id9}.value !== undefined || ${isPresent}) {
|
|
11124
|
+
newResult[${k}] = ${id9}.value;
|
|
11125
11125
|
}
|
|
11126
11126
|
`);
|
|
11127
11127
|
}
|
|
@@ -16776,8 +16776,8 @@ function ko_default() {
|
|
|
16776
16776
|
}
|
|
16777
16777
|
|
|
16778
16778
|
// node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/locales/lt.js
|
|
16779
|
-
var capitalizeFirstCharacter = (
|
|
16780
|
-
return
|
|
16779
|
+
var capitalizeFirstCharacter = (text11) => {
|
|
16780
|
+
return text11.charAt(0).toUpperCase() + text11.slice(1);
|
|
16781
16781
|
};
|
|
16782
16782
|
function getUnitTypeFromNumber(number6) {
|
|
16783
16783
|
const abs = Math.abs(number6);
|
|
@@ -20753,14 +20753,14 @@ function generatePropertyCheck(doc, ctx, def, accessor) {
|
|
|
20753
20753
|
generateCheck(doc, ctx, def.schema, propAccessor);
|
|
20754
20754
|
}
|
|
20755
20755
|
function generateOverwriteCheck(doc, ctx, check3, currentAccessor, newAccessor) {
|
|
20756
|
-
const
|
|
20757
|
-
if (!
|
|
20756
|
+
const tx2 = check3._zod.def.tx;
|
|
20757
|
+
if (!tx2) {
|
|
20758
20758
|
throw new ZodCompileUnsupportedError("overwrite check without a transform function");
|
|
20759
20759
|
}
|
|
20760
|
-
if (isAsyncFunction(
|
|
20760
|
+
if (isAsyncFunction(tx2)) {
|
|
20761
20761
|
throw new ZodCompileAsyncError("z.compile: async overwrite transforms are not supported");
|
|
20762
20762
|
}
|
|
20763
|
-
const txConst = addConstant(ctx,
|
|
20763
|
+
const txConst = addConstant(ctx, tx2);
|
|
20764
20764
|
doc.write(`const ${newAccessor} = ${txConst}(${currentAccessor});`);
|
|
20765
20765
|
}
|
|
20766
20766
|
function throwAsync() {
|
|
@@ -22656,10 +22656,10 @@ function _mime(types, params) {
|
|
|
22656
22656
|
});
|
|
22657
22657
|
}
|
|
22658
22658
|
// @__NO_SIDE_EFFECTS__
|
|
22659
|
-
function _overwrite(
|
|
22659
|
+
function _overwrite(tx2) {
|
|
22660
22660
|
return new $ZodCheckOverwrite({
|
|
22661
22661
|
check: "overwrite",
|
|
22662
|
-
tx
|
|
22662
|
+
tx: tx2
|
|
22663
22663
|
});
|
|
22664
22664
|
}
|
|
22665
22665
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -23149,26 +23149,26 @@ function extractDefs(ctx, schema) {
|
|
|
23149
23149
|
return;
|
|
23150
23150
|
const idToSchema = /* @__PURE__ */ new Map();
|
|
23151
23151
|
for (const entry2 of ctx.seen.entries()) {
|
|
23152
|
-
const
|
|
23153
|
-
if (
|
|
23154
|
-
const existing = idToSchema.get(
|
|
23152
|
+
const id9 = ctx.metadataRegistry.get(entry2[0])?.id;
|
|
23153
|
+
if (id9) {
|
|
23154
|
+
const existing = idToSchema.get(id9);
|
|
23155
23155
|
if (existing && existing !== entry2[0]) {
|
|
23156
|
-
throw new Error(`Duplicate schema id "${
|
|
23156
|
+
throw new Error(`Duplicate schema id "${id9}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
|
|
23157
23157
|
}
|
|
23158
|
-
idToSchema.set(
|
|
23158
|
+
idToSchema.set(id9, entry2[0]);
|
|
23159
23159
|
}
|
|
23160
23160
|
}
|
|
23161
23161
|
const makeURI = (entry2) => {
|
|
23162
23162
|
const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
23163
23163
|
if (ctx.external) {
|
|
23164
23164
|
const externalId = ctx.external.registry.get(entry2[0])?.id;
|
|
23165
|
-
const uriGenerator = ctx.external.uri ?? ((
|
|
23165
|
+
const uriGenerator = ctx.external.uri ?? ((id10) => id10);
|
|
23166
23166
|
if (externalId) {
|
|
23167
23167
|
return { ref: uriGenerator(externalId) };
|
|
23168
23168
|
}
|
|
23169
|
-
const
|
|
23170
|
-
entry2[1].defId =
|
|
23171
|
-
return { defId:
|
|
23169
|
+
const id9 = entry2[1].defId ?? entry2[1].schema.id ?? `schema${ctx.counter++}`;
|
|
23170
|
+
entry2[1].defId = id9;
|
|
23171
|
+
return { defId: id9, ref: `${uriGenerator("__shared")}#/${defsSegment}/${encodeJSONPointerSegment(id9)}` };
|
|
23172
23172
|
}
|
|
23173
23173
|
const uriPrefix = `#`;
|
|
23174
23174
|
const defUriPrefix = `${uriPrefix}/${defsSegment}/`;
|
|
@@ -23216,8 +23216,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
23216
23216
|
continue;
|
|
23217
23217
|
}
|
|
23218
23218
|
}
|
|
23219
|
-
const
|
|
23220
|
-
if (
|
|
23219
|
+
const id9 = ctx.metadataRegistry.get(entry2[0])?.id;
|
|
23220
|
+
if (id9) {
|
|
23221
23221
|
extractToDef(entry2);
|
|
23222
23222
|
continue;
|
|
23223
23223
|
}
|
|
@@ -23450,10 +23450,10 @@ function finalize(ctx, schema) {
|
|
|
23450
23450
|
} else {
|
|
23451
23451
|
}
|
|
23452
23452
|
if (ctx.external?.uri) {
|
|
23453
|
-
const
|
|
23454
|
-
if (!
|
|
23453
|
+
const id9 = ctx.external.registry.get(schema)?.id;
|
|
23454
|
+
if (!id9)
|
|
23455
23455
|
throw new Error("Schema is missing an `id` property");
|
|
23456
|
-
result.$id = ctx.external.uri(
|
|
23456
|
+
result.$id = ctx.external.uri(id9);
|
|
23457
23457
|
}
|
|
23458
23458
|
assignProps(result, root.defId ? root.schema : root.def ?? root.schema);
|
|
23459
23459
|
const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
|
|
@@ -24059,7 +24059,7 @@ function stringifyKeyNames(bySchema, json2, visited) {
|
|
|
24059
24059
|
const values2 = json2.enum ?? (json2.const !== void 0 ? [json2.const] : void 0);
|
|
24060
24060
|
if (!numericType && !values2?.some((v) => typeof v === "number"))
|
|
24061
24061
|
return json2;
|
|
24062
|
-
const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format, id:
|
|
24062
|
+
const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format, id: id9, ...rest } = json2;
|
|
24063
24063
|
if (rest.enum)
|
|
24064
24064
|
rest.enum = rest.enum.map((v) => typeof v === "number" ? String(v) : v);
|
|
24065
24065
|
else if (typeof rest.const === "number")
|
|
@@ -24290,12 +24290,12 @@ function toJSONSchema(input2, params) {
|
|
|
24290
24290
|
processSchema(schema, ctx2);
|
|
24291
24291
|
}
|
|
24292
24292
|
const schemas = {};
|
|
24293
|
-
const
|
|
24293
|
+
const external2 = {
|
|
24294
24294
|
registry: registry2,
|
|
24295
24295
|
uri: params?.uri,
|
|
24296
24296
|
defs
|
|
24297
24297
|
};
|
|
24298
|
-
ctx2.external =
|
|
24298
|
+
ctx2.external = external2;
|
|
24299
24299
|
for (const entry2 of registry2._idmap.entries()) {
|
|
24300
24300
|
const [key2, schema] = entry2;
|
|
24301
24301
|
extractDefs(ctx2, schema);
|
|
@@ -24743,8 +24743,8 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
24743
24743
|
and(arg) {
|
|
24744
24744
|
return intersection(this, arg);
|
|
24745
24745
|
},
|
|
24746
|
-
transform(
|
|
24747
|
-
return pipe(this, transform(
|
|
24746
|
+
transform(tx2) {
|
|
24747
|
+
return pipe(this, transform(tx2));
|
|
24748
24748
|
},
|
|
24749
24749
|
default(d) {
|
|
24750
24750
|
return _default2(this, d);
|
|
@@ -29210,8 +29210,8 @@ var REF_REWRITE_NAME_MAP_KEYS = /* @__PURE__ */ new Set([
|
|
|
29210
29210
|
"dependentSchemas",
|
|
29211
29211
|
"dependencies"
|
|
29212
29212
|
]);
|
|
29213
|
-
function establishesNewBase(
|
|
29214
|
-
return
|
|
29213
|
+
function establishesNewBase(id9) {
|
|
29214
|
+
return id9 !== void 0 && !(typeof id9 === "string" && id9.startsWith("#"));
|
|
29215
29215
|
}
|
|
29216
29216
|
function wrapOutputSchemaForLegacy(natural) {
|
|
29217
29217
|
const $schema = typeof natural["$schema"] === "string" ? natural["$schema"] : void 0;
|
|
@@ -34812,9 +34812,9 @@ var require_resolve = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
34812
34812
|
}
|
|
34813
34813
|
return count2;
|
|
34814
34814
|
}
|
|
34815
|
-
function getFullPath(resolver,
|
|
34816
|
-
if (normalize !== false)
|
|
34817
|
-
return _getFullPath(resolver, resolver.parse(
|
|
34815
|
+
function getFullPath(resolver, id9 = "", normalize) {
|
|
34816
|
+
if (normalize !== false) id9 = normalizeId(id9);
|
|
34817
|
+
return _getFullPath(resolver, resolver.parse(id9));
|
|
34818
34818
|
}
|
|
34819
34819
|
exports.getFullPath = getFullPath;
|
|
34820
34820
|
function _getFullPath(resolver, p2) {
|
|
@@ -34822,13 +34822,13 @@ var require_resolve = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
34822
34822
|
}
|
|
34823
34823
|
exports._getFullPath = _getFullPath;
|
|
34824
34824
|
const TRAILING_SLASH_HASH = /#\/?$/;
|
|
34825
|
-
function normalizeId(
|
|
34826
|
-
return
|
|
34825
|
+
function normalizeId(id9) {
|
|
34826
|
+
return id9 ? id9.replace(TRAILING_SLASH_HASH, "") : "";
|
|
34827
34827
|
}
|
|
34828
34828
|
exports.normalizeId = normalizeId;
|
|
34829
|
-
function resolveUrl(resolver, baseId,
|
|
34830
|
-
|
|
34831
|
-
return resolver.resolve(baseId,
|
|
34829
|
+
function resolveUrl(resolver, baseId, id9) {
|
|
34830
|
+
id9 = normalizeId(id9);
|
|
34831
|
+
return resolver.resolve(baseId, id9);
|
|
34832
34832
|
}
|
|
34833
34833
|
exports.resolveUrl = resolveUrl;
|
|
34834
34834
|
const ANCHOR = /^[a-z_][-a-z0-9._]*$/i;
|
|
@@ -35473,8 +35473,8 @@ var require_compile = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
35473
35473
|
const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p2);
|
|
35474
35474
|
let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, void 0);
|
|
35475
35475
|
if (Object.keys(root.schema).length > 0 && refPath === baseId) return getJsonPointer.call(this, p2, root);
|
|
35476
|
-
const
|
|
35477
|
-
const schOrRef = this.refs[
|
|
35476
|
+
const id9 = (0, resolve_1.normalizeId)(refPath);
|
|
35477
|
+
const schOrRef = this.refs[id9] || this.schemas[id9];
|
|
35478
35478
|
if (typeof schOrRef == "string") {
|
|
35479
35479
|
const sch = resolveSchema.call(this, root, schOrRef);
|
|
35480
35480
|
if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object") return;
|
|
@@ -35482,7 +35482,7 @@ var require_compile = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
35482
35482
|
}
|
|
35483
35483
|
if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== "object") return;
|
|
35484
35484
|
if (!schOrRef.validate) compileSchema.call(this, schOrRef);
|
|
35485
|
-
if (
|
|
35485
|
+
if (id9 === (0, resolve_1.normalizeId)(ref20)) {
|
|
35486
35486
|
const { schema } = schOrRef;
|
|
35487
35487
|
const { schemaId } = this.opts;
|
|
35488
35488
|
const schId = schema[schemaId];
|
|
@@ -36703,13 +36703,13 @@ var require_core$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
36703
36703
|
for (const sch of schema) this.addSchema(sch, void 0, _meta, _validateSchema);
|
|
36704
36704
|
return this;
|
|
36705
36705
|
}
|
|
36706
|
-
let
|
|
36706
|
+
let id9;
|
|
36707
36707
|
if (typeof schema === "object") {
|
|
36708
36708
|
const { schemaId } = this.opts;
|
|
36709
|
-
|
|
36710
|
-
if (
|
|
36709
|
+
id9 = schema[schemaId];
|
|
36710
|
+
if (id9 !== void 0 && typeof id9 != "string") throw new Error(`schema ${schemaId} must be string`);
|
|
36711
36711
|
}
|
|
36712
|
-
key2 = (0, resolve_1.normalizeId)(key2 ||
|
|
36712
|
+
key2 = (0, resolve_1.normalizeId)(key2 || id9);
|
|
36713
36713
|
this._checkUnique(key2);
|
|
36714
36714
|
this.schemas[key2] = this._addSchema(schema, _meta, key2, _validateSchema, true);
|
|
36715
36715
|
return this;
|
|
@@ -36774,11 +36774,11 @@ var require_core$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
36774
36774
|
case "object": {
|
|
36775
36775
|
const cacheKey = schemaKeyRef;
|
|
36776
36776
|
this._cache.delete(cacheKey);
|
|
36777
|
-
let
|
|
36778
|
-
if (
|
|
36779
|
-
|
|
36780
|
-
delete this.schemas[
|
|
36781
|
-
delete this.refs[
|
|
36777
|
+
let id9 = schemaKeyRef[this.opts.schemaId];
|
|
36778
|
+
if (id9) {
|
|
36779
|
+
id9 = (0, resolve_1.normalizeId)(id9);
|
|
36780
|
+
delete this.schemas[id9];
|
|
36781
|
+
delete this.refs[id9];
|
|
36782
36782
|
}
|
|
36783
36783
|
return this;
|
|
36784
36784
|
}
|
|
@@ -36838,7 +36838,7 @@ var require_core$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
36838
36838
|
}
|
|
36839
36839
|
errorsText(errors = this.errors, { separator = ", ", dataVar = "data" } = {}) {
|
|
36840
36840
|
if (!errors || errors.length === 0) return "No errors";
|
|
36841
|
-
return errors.map((e) => `${dataVar}${e.instancePath} ${e.message}`).reduce((
|
|
36841
|
+
return errors.map((e) => `${dataVar}${e.instancePath} ${e.message}`).reduce((text11, msg) => text11 + separator + msg);
|
|
36842
36842
|
}
|
|
36843
36843
|
$dataMetaSchema(metaSchema, keywordsJsonPointers) {
|
|
36844
36844
|
const rules = this.RULES.all;
|
|
@@ -36870,14 +36870,14 @@ var require_core$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
36870
36870
|
}
|
|
36871
36871
|
}
|
|
36872
36872
|
_addSchema(schema, meta3, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) {
|
|
36873
|
-
let
|
|
36873
|
+
let id9;
|
|
36874
36874
|
const { schemaId } = this.opts;
|
|
36875
|
-
if (typeof schema == "object")
|
|
36875
|
+
if (typeof schema == "object") id9 = schema[schemaId];
|
|
36876
36876
|
else if (this.opts.jtd) throw new Error("schema must be object");
|
|
36877
36877
|
else if (typeof schema != "boolean") throw new Error("schema must be object or boolean");
|
|
36878
36878
|
let sch = this._cache.get(schema);
|
|
36879
36879
|
if (sch !== void 0) return sch;
|
|
36880
|
-
baseId = (0, resolve_1.normalizeId)(
|
|
36880
|
+
baseId = (0, resolve_1.normalizeId)(id9 || baseId);
|
|
36881
36881
|
const localRefs = resolve_1.getSchemaRefs.call(this, schema, baseId);
|
|
36882
36882
|
sch = new compile_1.SchemaEnv({
|
|
36883
36883
|
schema,
|
|
@@ -36894,8 +36894,8 @@ var require_core$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
36894
36894
|
if (validateSchema) this.validateSchema(schema, true);
|
|
36895
36895
|
return sch;
|
|
36896
36896
|
}
|
|
36897
|
-
_checkUnique(
|
|
36898
|
-
if (this.schemas[
|
|
36897
|
+
_checkUnique(id9) {
|
|
36898
|
+
if (this.schemas[id9] || this.refs[id9]) throw new Error(`schema with key or id "${id9}" already exists`);
|
|
36899
36899
|
}
|
|
36900
36900
|
_compileSchemaEnv(sch) {
|
|
36901
36901
|
if (sch.meta) this._compileMetaSchema(sch);
|
|
@@ -39944,8 +39944,8 @@ var require_formats = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
39944
39944
|
if (!matches) return false;
|
|
39945
39945
|
const year = +matches[1];
|
|
39946
39946
|
const month = +matches[2];
|
|
39947
|
-
const
|
|
39948
|
-
return month >= 1 && month <= 12 &&
|
|
39947
|
+
const day5 = +matches[3];
|
|
39948
|
+
return month >= 1 && month <= 12 && day5 >= 1 && day5 <= (month === 2 && isLeapYear(year) ? 29 : DAYS2[month]);
|
|
39949
39949
|
}
|
|
39950
39950
|
function compareDate(d1, d2) {
|
|
39951
39951
|
if (!(d1 && d2)) return void 0;
|
|
@@ -41812,22 +41812,22 @@ var ProbeWindow = class ProbeWindow2 {
|
|
|
41812
41812
|
* never collide with Protocol's numeric ids (e.g. on a shared stdio pipe).
|
|
41813
41813
|
*/
|
|
41814
41814
|
async exchange(buildRequest, timeoutMs) {
|
|
41815
|
-
const
|
|
41815
|
+
const id9 = `server-discover-probe-${++this._probeCounter}`;
|
|
41816
41816
|
return new Promise((resolve) => {
|
|
41817
41817
|
let settled = false;
|
|
41818
41818
|
const settle2 = (reply2) => {
|
|
41819
41819
|
if (settled) return;
|
|
41820
41820
|
settled = true;
|
|
41821
41821
|
clearTimeout(timer);
|
|
41822
|
-
if (this._pending?.id ===
|
|
41822
|
+
if (this._pending?.id === id9) this._pending = void 0;
|
|
41823
41823
|
resolve(reply2);
|
|
41824
41824
|
};
|
|
41825
41825
|
const timer = setTimeout(() => settle2({ kind: "timeout" }), timeoutMs);
|
|
41826
41826
|
this._pending = {
|
|
41827
|
-
id:
|
|
41827
|
+
id: id9,
|
|
41828
41828
|
resolve: settle2
|
|
41829
41829
|
};
|
|
41830
|
-
this._transport.send(buildRequest(
|
|
41830
|
+
this._transport.send(buildRequest(id9)).catch((error62) => settle2({
|
|
41831
41831
|
kind: "send-error",
|
|
41832
41832
|
error: error62
|
|
41833
41833
|
}));
|
|
@@ -41877,10 +41877,10 @@ function disarmSpentCloseGuard(transport) {
|
|
|
41877
41877
|
pendingSpentCloseGuards.delete(transport);
|
|
41878
41878
|
disarm?.();
|
|
41879
41879
|
}
|
|
41880
|
-
function buildProbeRequest(
|
|
41880
|
+
function buildProbeRequest(id9, protocolVersion, clientInfo, capabilities) {
|
|
41881
41881
|
return {
|
|
41882
41882
|
jsonrpc: "2.0",
|
|
41883
|
-
id:
|
|
41883
|
+
id: id9,
|
|
41884
41884
|
method: "server/discover",
|
|
41885
41885
|
params: { _meta: codecForVersion(protocolVersion).outboundEnvelope({
|
|
41886
41886
|
protocolVersion,
|
|
@@ -41910,11 +41910,11 @@ function normalizeReply(reply2, timeoutMs) {
|
|
|
41910
41910
|
error: error62
|
|
41911
41911
|
};
|
|
41912
41912
|
if (error62 instanceof SdkHttpError) {
|
|
41913
|
-
const
|
|
41913
|
+
const text11 = error62.data?.text;
|
|
41914
41914
|
return {
|
|
41915
41915
|
kind: "http-error",
|
|
41916
41916
|
status: error62.data.status,
|
|
41917
|
-
body: typeof
|
|
41917
|
+
body: typeof text11 === "string" ? text11 : void 0,
|
|
41918
41918
|
statusText: error62.data.statusText
|
|
41919
41919
|
};
|
|
41920
41920
|
}
|
|
@@ -41947,7 +41947,7 @@ async function negotiateEra(negotiation, deps) {
|
|
|
41947
41947
|
let correctiveUsed = false;
|
|
41948
41948
|
let timeoutRetriesRemaining = maxRetries;
|
|
41949
41949
|
for (; ; ) {
|
|
41950
|
-
const reply2 = await window.exchange((
|
|
41950
|
+
const reply2 = await window.exchange((id9) => buildProbeRequest(id9, requestedVersion, deps.clientInfo, deps.capabilities), timeoutMs);
|
|
41951
41951
|
if (reply2.kind === "timeout" && timeoutRetriesRemaining > 0) {
|
|
41952
41952
|
timeoutRetriesRemaining--;
|
|
41953
41953
|
continue;
|
|
@@ -43213,8 +43213,8 @@ var Client = class extends Protocol {
|
|
|
43213
43213
|
* through would surface as "unknown message ID" via `onerror`).
|
|
43214
43214
|
*/
|
|
43215
43215
|
_onresponse(response) {
|
|
43216
|
-
const
|
|
43217
|
-
const entry2 = typeof
|
|
43216
|
+
const id9 = response.id;
|
|
43217
|
+
const entry2 = typeof id9 === "string" ? this._listenState.get(id9) : void 0;
|
|
43218
43218
|
if (entry2 !== void 0) {
|
|
43219
43219
|
if (isJSONRPCErrorResponse(response)) entry2.settle({
|
|
43220
43220
|
cause: "remote",
|
|
@@ -43484,7 +43484,7 @@ function createParser(config2) {
|
|
|
43484
43484
|
"`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?"
|
|
43485
43485
|
);
|
|
43486
43486
|
const { onEvent = noop, onError = noop, onRetry = noop, onComment, maxBufferSize } = config2, pendingFragments = [];
|
|
43487
|
-
let pendingFragmentsLength = 0, isFirstChunk = true,
|
|
43487
|
+
let pendingFragmentsLength = 0, isFirstChunk = true, id9, data = "", dataLines = 0, eventType, terminated = false;
|
|
43488
43488
|
function feed(chunk) {
|
|
43489
43489
|
if (terminated)
|
|
43490
43490
|
throw new Error(
|
|
@@ -43507,7 +43507,7 @@ function createParser(config2) {
|
|
|
43507
43507
|
trailing !== "" && (pendingFragments.push(trailing), pendingFragmentsLength = trailing.length), checkBufferSize();
|
|
43508
43508
|
}
|
|
43509
43509
|
function checkBufferSize() {
|
|
43510
|
-
maxBufferSize !== void 0 && (pendingFragmentsLength + data.length <= maxBufferSize || (terminated = true, pendingFragments.length = 0, pendingFragmentsLength = 0,
|
|
43510
|
+
maxBufferSize !== void 0 && (pendingFragmentsLength + data.length <= maxBufferSize || (terminated = true, pendingFragments.length = 0, pendingFragmentsLength = 0, id9 = void 0, data = "", dataLines = 0, eventType = void 0, onError(
|
|
43511
43511
|
new ParseError(`Buffered data exceeded max buffer size of ${maxBufferSize} characters`, {
|
|
43512
43512
|
type: "max-buffer-size-exceeded"
|
|
43513
43513
|
})
|
|
@@ -43520,7 +43520,7 @@ function createParser(config2) {
|
|
|
43520
43520
|
`, searchIndex);
|
|
43521
43521
|
for (; lfIndex !== -1; ) {
|
|
43522
43522
|
if (searchIndex === lfIndex) {
|
|
43523
|
-
dataLines > 0 && onEvent({ id:
|
|
43523
|
+
dataLines > 0 && onEvent({ id: id9, event: eventType, data }), id9 = void 0, data = "", dataLines = 0, eventType = void 0, searchIndex = lfIndex + 1, lfIndex = chunk.indexOf(`
|
|
43524
43524
|
`, searchIndex);
|
|
43525
43525
|
continue;
|
|
43526
43526
|
}
|
|
@@ -43528,7 +43528,7 @@ function createParser(config2) {
|
|
|
43528
43528
|
if (isDataPrefix(chunk, searchIndex, firstCharCode)) {
|
|
43529
43529
|
const valueStart = chunk.charCodeAt(searchIndex + 5) === SPACE ? searchIndex + 6 : searchIndex + 5, value2 = chunk.slice(valueStart, lfIndex);
|
|
43530
43530
|
if (dataLines === 0 && chunk.charCodeAt(lfIndex + 1) === LF) {
|
|
43531
|
-
onEvent({ id:
|
|
43531
|
+
onEvent({ id: id9, event: eventType, data: value2 }), id9 = void 0, data = "", eventType = void 0, searchIndex = lfIndex + 2, lfIndex = chunk.indexOf(`
|
|
43532
43532
|
`, searchIndex);
|
|
43533
43533
|
continue;
|
|
43534
43534
|
}
|
|
@@ -43571,7 +43571,7 @@ ${value22}`, dataLines++;
|
|
|
43571
43571
|
}
|
|
43572
43572
|
if (firstCharCode === 105 && chunk.charCodeAt(start + 1) === 100 && chunk.charCodeAt(start + 2) === 58) {
|
|
43573
43573
|
const value22 = chunk.slice(chunk.charCodeAt(start + 3) === SPACE ? start + 4 : start + 3, end);
|
|
43574
|
-
value22.includes("\0") || (
|
|
43574
|
+
value22.includes("\0") || (id9 = value22);
|
|
43575
43575
|
return;
|
|
43576
43576
|
}
|
|
43577
43577
|
if (firstCharCode === 58) {
|
|
@@ -43599,7 +43599,7 @@ ${value22}`, dataLines++;
|
|
|
43599
43599
|
${value2}`, dataLines++;
|
|
43600
43600
|
break;
|
|
43601
43601
|
case "id":
|
|
43602
|
-
value2.includes("\0") || (
|
|
43602
|
+
value2.includes("\0") || (id9 = value2);
|
|
43603
43603
|
break;
|
|
43604
43604
|
case "retry":
|
|
43605
43605
|
/^\d+$/.test(value2) ? onRetry(parseInt(value2, 10)) : onError(
|
|
@@ -43622,17 +43622,17 @@ ${value2}`, dataLines++;
|
|
|
43622
43622
|
}
|
|
43623
43623
|
function dispatchEvent() {
|
|
43624
43624
|
dataLines > 0 && onEvent({
|
|
43625
|
-
id:
|
|
43625
|
+
id: id9,
|
|
43626
43626
|
event: eventType,
|
|
43627
43627
|
data
|
|
43628
|
-
}),
|
|
43628
|
+
}), id9 = void 0, data = "", dataLines = 0, eventType = void 0;
|
|
43629
43629
|
}
|
|
43630
43630
|
function reset(options = {}) {
|
|
43631
43631
|
if (options.consume && pendingFragments.length > 0) {
|
|
43632
43632
|
const incompleteLine = pendingFragments.join("");
|
|
43633
43633
|
parseLine(incompleteLine, 0, incompleteLine.length);
|
|
43634
43634
|
}
|
|
43635
|
-
isFirstChunk = true,
|
|
43635
|
+
isFirstChunk = true, id9 = void 0, data = "", dataLines = 0, eventType = void 0, pendingFragments.length = 0, pendingFragmentsLength = 0, terminated = false;
|
|
43636
43636
|
}
|
|
43637
43637
|
return { feed, reset };
|
|
43638
43638
|
}
|
|
@@ -43892,8 +43892,8 @@ var StreamableHTTPClientTransport = class {
|
|
|
43892
43892
|
}
|
|
43893
43893
|
/** Error text for a redirect `response` that was not followed, or `undefined` for any other response. */
|
|
43894
43894
|
_unfollowedRedirect(url3, response) {
|
|
43895
|
-
const
|
|
43896
|
-
return
|
|
43895
|
+
const text11 = this._redirectPolicy === "follow" ? void 0 : unfollowedRedirect(url3, response);
|
|
43896
|
+
return text11 && `${text11} (redirectPolicy: 'same-origin')`;
|
|
43897
43897
|
}
|
|
43898
43898
|
async _commonHeaders() {
|
|
43899
43899
|
const headers = new Headers(this._requestInit?.headers || void 0);
|
|
@@ -43984,13 +43984,13 @@ var StreamableHTTPClientTransport = class {
|
|
|
43984
43984
|
if (response.status === 403) {
|
|
43985
43985
|
const { resourceMetadataUrl, scope: scope2, error: error62, errorDescription } = extractWWWAuthenticateParams(response);
|
|
43986
43986
|
if (error62 === "insufficient_scope") {
|
|
43987
|
-
const
|
|
43987
|
+
const text11 = await response.text?.().catch(() => null);
|
|
43988
43988
|
if (await this._stepUpAuthorize({
|
|
43989
43989
|
scope: scope2,
|
|
43990
43990
|
resourceMetadataUrl,
|
|
43991
43991
|
errorDescription,
|
|
43992
43992
|
statusText: response.statusText,
|
|
43993
|
-
text:
|
|
43993
|
+
text: text11
|
|
43994
43994
|
}, stepUpRetries) !== "AUTHORIZED") throw markAuthSeamEscape(new UnauthorizedError());
|
|
43995
43995
|
return this._startOrAuthSse(options, isAuthRetry, stepUpRetries + 1);
|
|
43996
43996
|
}
|
|
@@ -44222,7 +44222,7 @@ var StreamableHTTPClientTransport = class {
|
|
|
44222
44222
|
}));
|
|
44223
44223
|
throw markAuthSeamEscape(new UnauthorizedError());
|
|
44224
44224
|
}
|
|
44225
|
-
const
|
|
44225
|
+
const text11 = await response.text?.().catch(() => null);
|
|
44226
44226
|
if (response.status === 403) {
|
|
44227
44227
|
const { resourceMetadataUrl, scope: scope2, error: error62, errorDescription } = extractWWWAuthenticateParams(response);
|
|
44228
44228
|
if (error62 === "insufficient_scope") {
|
|
@@ -44231,13 +44231,13 @@ var StreamableHTTPClientTransport = class {
|
|
|
44231
44231
|
resourceMetadataUrl,
|
|
44232
44232
|
errorDescription,
|
|
44233
44233
|
statusText: response.statusText,
|
|
44234
|
-
text:
|
|
44234
|
+
text: text11
|
|
44235
44235
|
}, stepUpRetries) !== "AUTHORIZED") throw markAuthSeamEscape(new UnauthorizedError());
|
|
44236
44236
|
return this._send(message4, options, isAuthRetry, stepUpRetries + 1);
|
|
44237
44237
|
}
|
|
44238
44238
|
}
|
|
44239
|
-
if (response.status === 400 && typeof
|
|
44240
|
-
const parsed2 = JSONRPCMessageSchema.parse(JSON.parse(
|
|
44239
|
+
if (response.status === 400 && typeof text11 === "string" && this._isModernEnvelopedRequest(message4)) try {
|
|
44240
|
+
const parsed2 = JSONRPCMessageSchema.parse(JSON.parse(text11));
|
|
44241
44241
|
const requests = (Array.isArray(message4) ? message4 : [message4]).filter((m) => isJSONRPCRequest(m));
|
|
44242
44242
|
if (isJSONRPCErrorResponse(parsed2) && requests.some((r) => r.id === parsed2.id)) {
|
|
44243
44243
|
this.onmessage?.(parsed2);
|
|
@@ -44245,11 +44245,11 @@ var StreamableHTTPClientTransport = class {
|
|
|
44245
44245
|
}
|
|
44246
44246
|
} catch {
|
|
44247
44247
|
}
|
|
44248
|
-
const reason = this._unfollowedRedirect(this._url, response) ??
|
|
44248
|
+
const reason = this._unfollowedRedirect(this._url, response) ?? text11;
|
|
44249
44249
|
throw new SdkHttpError(SdkErrorCode.ClientHttpNotImplemented, `Error POSTing to endpoint: ${reason}`, {
|
|
44250
44250
|
status: response.status,
|
|
44251
44251
|
statusText: response.statusText,
|
|
44252
|
-
text:
|
|
44252
|
+
text: text11
|
|
44253
44253
|
});
|
|
44254
44254
|
}
|
|
44255
44255
|
if (response.status === 202) {
|
|
@@ -45517,8 +45517,8 @@ var REF_REWRITE_NAME_MAP_KEYS2 = /* @__PURE__ */ new Set([
|
|
|
45517
45517
|
"dependentSchemas",
|
|
45518
45518
|
"dependencies"
|
|
45519
45519
|
]);
|
|
45520
|
-
function establishesNewBase2(
|
|
45521
|
-
return
|
|
45520
|
+
function establishesNewBase2(id9) {
|
|
45521
|
+
return id9 !== void 0 && !(typeof id9 === "string" && id9.startsWith("#"));
|
|
45522
45522
|
}
|
|
45523
45523
|
function wrapOutputSchemaForLegacy2(natural) {
|
|
45524
45524
|
const $schema = typeof natural["$schema"] === "string" ? natural["$schema"] : void 0;
|
|
@@ -50784,9 +50784,9 @@ var require_resolve2 = /* @__PURE__ */ __commonJSMin2(((exports) => {
|
|
|
50784
50784
|
}
|
|
50785
50785
|
return count2;
|
|
50786
50786
|
}
|
|
50787
|
-
function getFullPath(resolver,
|
|
50788
|
-
if (normalize !== false)
|
|
50789
|
-
return _getFullPath(resolver, resolver.parse(
|
|
50787
|
+
function getFullPath(resolver, id9 = "", normalize) {
|
|
50788
|
+
if (normalize !== false) id9 = normalizeId(id9);
|
|
50789
|
+
return _getFullPath(resolver, resolver.parse(id9));
|
|
50790
50790
|
}
|
|
50791
50791
|
exports.getFullPath = getFullPath;
|
|
50792
50792
|
function _getFullPath(resolver, p2) {
|
|
@@ -50794,13 +50794,13 @@ var require_resolve2 = /* @__PURE__ */ __commonJSMin2(((exports) => {
|
|
|
50794
50794
|
}
|
|
50795
50795
|
exports._getFullPath = _getFullPath;
|
|
50796
50796
|
const TRAILING_SLASH_HASH = /#\/?$/;
|
|
50797
|
-
function normalizeId(
|
|
50798
|
-
return
|
|
50797
|
+
function normalizeId(id9) {
|
|
50798
|
+
return id9 ? id9.replace(TRAILING_SLASH_HASH, "") : "";
|
|
50799
50799
|
}
|
|
50800
50800
|
exports.normalizeId = normalizeId;
|
|
50801
|
-
function resolveUrl(resolver, baseId,
|
|
50802
|
-
|
|
50803
|
-
return resolver.resolve(baseId,
|
|
50801
|
+
function resolveUrl(resolver, baseId, id9) {
|
|
50802
|
+
id9 = normalizeId(id9);
|
|
50803
|
+
return resolver.resolve(baseId, id9);
|
|
50804
50804
|
}
|
|
50805
50805
|
exports.resolveUrl = resolveUrl;
|
|
50806
50806
|
const ANCHOR = /^[a-z_][-a-z0-9._]*$/i;
|
|
@@ -51445,8 +51445,8 @@ var require_compile2 = /* @__PURE__ */ __commonJSMin2(((exports) => {
|
|
|
51445
51445
|
const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p2);
|
|
51446
51446
|
let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, void 0);
|
|
51447
51447
|
if (Object.keys(root.schema).length > 0 && refPath === baseId) return getJsonPointer.call(this, p2, root);
|
|
51448
|
-
const
|
|
51449
|
-
const schOrRef = this.refs[
|
|
51448
|
+
const id9 = (0, resolve_1.normalizeId)(refPath);
|
|
51449
|
+
const schOrRef = this.refs[id9] || this.schemas[id9];
|
|
51450
51450
|
if (typeof schOrRef == "string") {
|
|
51451
51451
|
const sch = resolveSchema.call(this, root, schOrRef);
|
|
51452
51452
|
if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object") return;
|
|
@@ -51454,7 +51454,7 @@ var require_compile2 = /* @__PURE__ */ __commonJSMin2(((exports) => {
|
|
|
51454
51454
|
}
|
|
51455
51455
|
if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== "object") return;
|
|
51456
51456
|
if (!schOrRef.validate) compileSchema.call(this, schOrRef);
|
|
51457
|
-
if (
|
|
51457
|
+
if (id9 === (0, resolve_1.normalizeId)(ref20)) {
|
|
51458
51458
|
const { schema } = schOrRef;
|
|
51459
51459
|
const { schemaId } = this.opts;
|
|
51460
51460
|
const schId = schema[schemaId];
|
|
@@ -52675,13 +52675,13 @@ var require_core$32 = /* @__PURE__ */ __commonJSMin2(((exports) => {
|
|
|
52675
52675
|
for (const sch of schema) this.addSchema(sch, void 0, _meta, _validateSchema);
|
|
52676
52676
|
return this;
|
|
52677
52677
|
}
|
|
52678
|
-
let
|
|
52678
|
+
let id9;
|
|
52679
52679
|
if (typeof schema === "object") {
|
|
52680
52680
|
const { schemaId } = this.opts;
|
|
52681
|
-
|
|
52682
|
-
if (
|
|
52681
|
+
id9 = schema[schemaId];
|
|
52682
|
+
if (id9 !== void 0 && typeof id9 != "string") throw new Error(`schema ${schemaId} must be string`);
|
|
52683
52683
|
}
|
|
52684
|
-
key2 = (0, resolve_1.normalizeId)(key2 ||
|
|
52684
|
+
key2 = (0, resolve_1.normalizeId)(key2 || id9);
|
|
52685
52685
|
this._checkUnique(key2);
|
|
52686
52686
|
this.schemas[key2] = this._addSchema(schema, _meta, key2, _validateSchema, true);
|
|
52687
52687
|
return this;
|
|
@@ -52746,11 +52746,11 @@ var require_core$32 = /* @__PURE__ */ __commonJSMin2(((exports) => {
|
|
|
52746
52746
|
case "object": {
|
|
52747
52747
|
const cacheKey = schemaKeyRef;
|
|
52748
52748
|
this._cache.delete(cacheKey);
|
|
52749
|
-
let
|
|
52750
|
-
if (
|
|
52751
|
-
|
|
52752
|
-
delete this.schemas[
|
|
52753
|
-
delete this.refs[
|
|
52749
|
+
let id9 = schemaKeyRef[this.opts.schemaId];
|
|
52750
|
+
if (id9) {
|
|
52751
|
+
id9 = (0, resolve_1.normalizeId)(id9);
|
|
52752
|
+
delete this.schemas[id9];
|
|
52753
|
+
delete this.refs[id9];
|
|
52754
52754
|
}
|
|
52755
52755
|
return this;
|
|
52756
52756
|
}
|
|
@@ -52810,7 +52810,7 @@ var require_core$32 = /* @__PURE__ */ __commonJSMin2(((exports) => {
|
|
|
52810
52810
|
}
|
|
52811
52811
|
errorsText(errors = this.errors, { separator = ", ", dataVar = "data" } = {}) {
|
|
52812
52812
|
if (!errors || errors.length === 0) return "No errors";
|
|
52813
|
-
return errors.map((e) => `${dataVar}${e.instancePath} ${e.message}`).reduce((
|
|
52813
|
+
return errors.map((e) => `${dataVar}${e.instancePath} ${e.message}`).reduce((text11, msg) => text11 + separator + msg);
|
|
52814
52814
|
}
|
|
52815
52815
|
$dataMetaSchema(metaSchema, keywordsJsonPointers) {
|
|
52816
52816
|
const rules = this.RULES.all;
|
|
@@ -52842,14 +52842,14 @@ var require_core$32 = /* @__PURE__ */ __commonJSMin2(((exports) => {
|
|
|
52842
52842
|
}
|
|
52843
52843
|
}
|
|
52844
52844
|
_addSchema(schema, meta3, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) {
|
|
52845
|
-
let
|
|
52845
|
+
let id9;
|
|
52846
52846
|
const { schemaId } = this.opts;
|
|
52847
|
-
if (typeof schema == "object")
|
|
52847
|
+
if (typeof schema == "object") id9 = schema[schemaId];
|
|
52848
52848
|
else if (this.opts.jtd) throw new Error("schema must be object");
|
|
52849
52849
|
else if (typeof schema != "boolean") throw new Error("schema must be object or boolean");
|
|
52850
52850
|
let sch = this._cache.get(schema);
|
|
52851
52851
|
if (sch !== void 0) return sch;
|
|
52852
|
-
baseId = (0, resolve_1.normalizeId)(
|
|
52852
|
+
baseId = (0, resolve_1.normalizeId)(id9 || baseId);
|
|
52853
52853
|
const localRefs = resolve_1.getSchemaRefs.call(this, schema, baseId);
|
|
52854
52854
|
sch = new compile_1.SchemaEnv({
|
|
52855
52855
|
schema,
|
|
@@ -52866,8 +52866,8 @@ var require_core$32 = /* @__PURE__ */ __commonJSMin2(((exports) => {
|
|
|
52866
52866
|
if (validateSchema) this.validateSchema(schema, true);
|
|
52867
52867
|
return sch;
|
|
52868
52868
|
}
|
|
52869
|
-
_checkUnique(
|
|
52870
|
-
if (this.schemas[
|
|
52869
|
+
_checkUnique(id9) {
|
|
52870
|
+
if (this.schemas[id9] || this.refs[id9]) throw new Error(`schema with key or id "${id9}" already exists`);
|
|
52871
52871
|
}
|
|
52872
52872
|
_compileSchemaEnv(sch) {
|
|
52873
52873
|
if (sch.meta) this._compileMetaSchema(sch);
|
|
@@ -55916,8 +55916,8 @@ var require_formats2 = /* @__PURE__ */ __commonJSMin2(((exports) => {
|
|
|
55916
55916
|
if (!matches) return false;
|
|
55917
55917
|
const year = +matches[1];
|
|
55918
55918
|
const month = +matches[2];
|
|
55919
|
-
const
|
|
55920
|
-
return month >= 1 && month <= 12 &&
|
|
55919
|
+
const day5 = +matches[3];
|
|
55920
|
+
return month >= 1 && month <= 12 && day5 >= 1 && day5 <= (month === 2 && isLeapYear(year) ? 29 : DAYS2[month]);
|
|
55921
55921
|
}
|
|
55922
55922
|
function compareDate(d1, d2) {
|
|
55923
55923
|
if (!(d1 && d2)) return void 0;
|
|
@@ -57049,7 +57049,7 @@ var Server = class extends Protocol2 {
|
|
|
57049
57049
|
if (hasPreviousToolUse) {
|
|
57050
57050
|
const toolUseIds = new Set(previousContent.filter((c) => c.type === "tool_use").map((c) => c.id));
|
|
57051
57051
|
const toolResultIds = new Set(lastContent.filter((c) => c.type === "tool_result").map((c) => c.toolUseId));
|
|
57052
|
-
if (toolUseIds.size !== toolResultIds.size || ![...toolUseIds].every((
|
|
57052
|
+
if (toolUseIds.size !== toolResultIds.size || ![...toolUseIds].every((id9) => toolResultIds.has(id9))) throw new ProtocolError3(ProtocolErrorCode2.InvalidParams, "ids of tool_result blocks and tool_use blocks from previous message do not match");
|
|
57053
57053
|
}
|
|
57054
57054
|
}
|
|
57055
57055
|
const hasTools = Boolean(params.tools || params.toolChoice);
|
|
@@ -57818,20 +57818,20 @@ var RANGE_HINT = "use <min>..<max> of simulated time, such as 3m..12m, or one du
|
|
|
57818
57818
|
var RATE_RE = /^(\d+(?:\.\d+)?)(?:\.\.(\d+(?:\.\d+)?))?\/(m|h|d)$/;
|
|
57819
57819
|
var RATE_HINT = "use <min>..<max>/<unit> or <n>/<unit> with unit m, h or d, such as 0..2/h";
|
|
57820
57820
|
var MAX_NOISE_PER_HOUR = 60;
|
|
57821
|
-
function parseDurationRange(
|
|
57822
|
-
const parts =
|
|
57823
|
-
if (parts.length > 2 || parts.some((part) => part === "")) throw new AnchaError("SCENE_INVALID", `invalid duration range "${
|
|
57821
|
+
function parseDurationRange(text11) {
|
|
57822
|
+
const parts = text11.split("..");
|
|
57823
|
+
if (parts.length > 2 || parts.some((part) => part === "")) throw new AnchaError("SCENE_INVALID", `invalid duration range "${text11}"`, { hint: RANGE_HINT });
|
|
57824
57824
|
const minMs = parseDuration(parts[0]), maxMs = parseDuration(parts[1] ?? parts[0]);
|
|
57825
|
-
if (minMs < 0 || maxMs < minMs) throw new AnchaError("SCENE_INVALID", `invalid duration range "${
|
|
57825
|
+
if (minMs < 0 || maxMs < minMs) throw new AnchaError("SCENE_INVALID", `invalid duration range "${text11}": need 0 <= min <= max`, { hint: RANGE_HINT });
|
|
57826
57826
|
return { minMs, maxMs };
|
|
57827
57827
|
}
|
|
57828
|
-
function parseRate(
|
|
57829
|
-
const match = RATE_RE.exec(
|
|
57830
|
-
if (!match) throw new AnchaError("SCENE_INVALID", `invalid rate "${
|
|
57828
|
+
function parseRate(text11) {
|
|
57829
|
+
const match = RATE_RE.exec(text11);
|
|
57830
|
+
if (!match) throw new AnchaError("SCENE_INVALID", `invalid rate "${text11}"`, { hint: RATE_HINT });
|
|
57831
57831
|
const perHour = { m: 60, h: 1, d: 1 / 24 }[match[3]];
|
|
57832
57832
|
const minPerHour = Number(match[1]) * perHour, maxPerHour = Number(match[2] ?? match[1]) * perHour;
|
|
57833
|
-
if (maxPerHour < minPerHour) throw new AnchaError("SCENE_INVALID", `invalid rate "${
|
|
57834
|
-
if (maxPerHour > MAX_NOISE_PER_HOUR) throw new AnchaError("SCENE_INVALID", `invalid rate "${
|
|
57833
|
+
if (maxPerHour < minPerHour) throw new AnchaError("SCENE_INVALID", `invalid rate "${text11}": min is above max`, { hint: RATE_HINT });
|
|
57834
|
+
if (maxPerHour > MAX_NOISE_PER_HOUR) throw new AnchaError("SCENE_INVALID", `invalid rate "${text11}": at most ${MAX_NOISE_PER_HOUR} per hour`, { hint: RATE_HINT });
|
|
57835
57835
|
return { minPerHour, maxPerHour };
|
|
57836
57836
|
}
|
|
57837
57837
|
function parsed(parse3, description2) {
|
|
@@ -58012,15 +58012,15 @@ var SalesforceSeedSchema = external_exports.strictObject({
|
|
|
58012
58012
|
}).superRefine((seed2, ctx) => {
|
|
58013
58013
|
const ids = /* @__PURE__ */ new Set(), byType = {};
|
|
58014
58014
|
for (const type of salesforceObjectNames) {
|
|
58015
|
-
const collection = salesforceCollections[type],
|
|
58015
|
+
const collection = salesforceCollections[type], external2 = /* @__PURE__ */ new Set();
|
|
58016
58016
|
byType[type] = /* @__PURE__ */ new Set();
|
|
58017
58017
|
for (const [index, item2] of seed2[collection].entries()) {
|
|
58018
58018
|
if (!item2.Id.startsWith(prefix[type]) || ids.has(item2.Id)) ctx.addIssue({ code: "custom", path: [collection, index, "Id"], message: "duplicate ID or wrong object ID prefix" });
|
|
58019
58019
|
ids.add(item2.Id);
|
|
58020
58020
|
byType[type].add(item2.Id);
|
|
58021
58021
|
if (item2.External_Id__c) {
|
|
58022
|
-
if (
|
|
58023
|
-
|
|
58022
|
+
if (external2.has(item2.External_Id__c)) ctx.addIssue({ code: "custom", path: [collection, index, "External_Id__c"], message: "external ID must be unique within its object" });
|
|
58023
|
+
external2.add(item2.External_Id__c);
|
|
58024
58024
|
}
|
|
58025
58025
|
}
|
|
58026
58026
|
}
|
|
@@ -58231,8 +58231,8 @@ var GA4SeedSchema = external_exports.strictObject({
|
|
|
58231
58231
|
seed2.principals.forEach((p2, i) => {
|
|
58232
58232
|
if (new Set(p2.propertyIds).size !== p2.propertyIds.length) issue2(["principals", i, "propertyIds"], "duplicate property");
|
|
58233
58233
|
if (new Set(p2.scopes).size !== p2.scopes.length) issue2(["principals", i, "scopes"], "duplicate scope");
|
|
58234
|
-
p2.propertyIds.forEach((
|
|
58235
|
-
if (!properties.has(
|
|
58234
|
+
p2.propertyIds.forEach((id9, j) => {
|
|
58235
|
+
if (!properties.has(id9)) issue2(["principals", i, "propertyIds", j], "unknown property");
|
|
58236
58236
|
});
|
|
58237
58237
|
});
|
|
58238
58238
|
if (!seed2.principals.some((p2) => p2.id === seed2.actor)) issue2(["actor"], "unknown principal");
|
|
@@ -58463,8 +58463,8 @@ var GongSeedSchema = external_exports.strictObject({
|
|
|
58463
58463
|
for (const kind of ["principals", "users"]) seed2[kind].forEach((p2, i) => {
|
|
58464
58464
|
if (!accounts.has(p2.accountId)) issue2([kind, i, "accountId"], "unknown account");
|
|
58465
58465
|
if (new Set(p2.workspaceIds).size !== p2.workspaceIds.length) issue2([kind, i, "workspaceIds"], "duplicate workspace");
|
|
58466
|
-
p2.workspaceIds.forEach((
|
|
58467
|
-
if (workspaces.get(
|
|
58466
|
+
p2.workspaceIds.forEach((id9, j) => {
|
|
58467
|
+
if (workspaces.get(id9)?.accountId !== p2.accountId) issue2([kind, i, "workspaceIds", j], "workspace must belong to the same account");
|
|
58468
58468
|
});
|
|
58469
58469
|
});
|
|
58470
58470
|
if (!seed2.principals.some((p2) => p2.id === seed2.actor)) issue2(["actor"], "unknown principal");
|
|
@@ -58499,8 +58499,8 @@ var GongSeedSchema = external_exports.strictObject({
|
|
|
58499
58499
|
});
|
|
58500
58500
|
});
|
|
58501
58501
|
});
|
|
58502
|
-
seed2.principals.forEach((p2, i) => p2.allowedCallIds?.forEach((
|
|
58503
|
-
const call2 = calls.get(
|
|
58502
|
+
seed2.principals.forEach((p2, i) => p2.allowedCallIds?.forEach((id9, j) => {
|
|
58503
|
+
const call2 = calls.get(id9);
|
|
58504
58504
|
if (!call2 || workspaces.get(call2.metaData.workspaceId)?.accountId !== p2.accountId || !p2.workspaceIds.includes(call2.metaData.workspaceId)) issue2(["principals", i, "allowedCallIds", j], "allowed call must belong to an accessible workspace");
|
|
58505
58505
|
}));
|
|
58506
58506
|
});
|
|
@@ -58937,9 +58937,9 @@ var GMAIL_SCOPES = {
|
|
|
58937
58937
|
var scopeValues = Object.values(GMAIL_SCOPES);
|
|
58938
58938
|
var EMAIL = /^[^\s<>@",;:()[\]\\]+@[^\s<>@",;:()[\]\\]+\.[^\s<>@",;:()[\]\\]+$/;
|
|
58939
58939
|
function parseGmailAddress(value2) {
|
|
58940
|
-
const
|
|
58941
|
-
if (EMAIL.test(
|
|
58942
|
-
const match = /^(.*?)\s*<([^<>]+)>$/.exec(
|
|
58940
|
+
const text11 = value2.trim();
|
|
58941
|
+
if (EMAIL.test(text11)) return { name: "", email: text11 };
|
|
58942
|
+
const match = /^(.*?)\s*<([^<>]+)>$/.exec(text11);
|
|
58943
58943
|
if (!match || !EMAIL.test(match[2].trim())) return void 0;
|
|
58944
58944
|
let name3 = match[1].trim();
|
|
58945
58945
|
if (name3.startsWith('"') && name3.endsWith('"') && name3.length >= 2) name3 = name3.slice(1, -1).replace(/\\(.)/g, "$1");
|
|
@@ -59030,7 +59030,7 @@ var GmailSeedSchema = external_exports.strictObject({
|
|
|
59030
59030
|
const key2 = box.address.toLowerCase();
|
|
59031
59031
|
if (addresses2.has(key2)) issue2(["mailboxes", i, "address"], "duplicate mailbox address");
|
|
59032
59032
|
addresses2.add(key2);
|
|
59033
|
-
const names = new Set(GMAIL_SYSTEM_LABELS.map((
|
|
59033
|
+
const names = new Set(GMAIL_SYSTEM_LABELS.map((id9) => id9.toLowerCase()));
|
|
59034
59034
|
box.labels.forEach((l, j) => {
|
|
59035
59035
|
if (names.has(l.name.toLowerCase())) issue2(["mailboxes", i, "labels", j, "name"], "label name is already used, or is a system label");
|
|
59036
59036
|
names.add(l.name.toLowerCase());
|
|
@@ -61660,9 +61660,9 @@ var LobSeedSchema = external_exports.strictObject({
|
|
|
61660
61660
|
});
|
|
61661
61661
|
const directory = /* @__PURE__ */ new Set();
|
|
61662
61662
|
seed2.directory?.forEach((entry2, i) => {
|
|
61663
|
-
const
|
|
61664
|
-
if (directory.has(
|
|
61665
|
-
directory.add(
|
|
61663
|
+
const id9 = `${entry2.line1}|${entry2.line2 ?? ""}|${entry2.zip.slice(0, 5)}`.toUpperCase();
|
|
61664
|
+
if (directory.has(id9)) issue2(["directory", i], "duplicate address");
|
|
61665
|
+
directory.add(id9);
|
|
61666
61666
|
});
|
|
61667
61667
|
const addresses2 = new Map(seed2.addresses.map((entry2) => [entry2.key, entry2]));
|
|
61668
61668
|
seed2.addresses.forEach((entry2, i) => {
|
|
@@ -61714,9 +61714,9 @@ var LobSeedSchema = external_exports.strictObject({
|
|
|
61714
61714
|
else if (!bank.verified) issue2(["checks", i, "bankAccount"], `${entry2.bankAccount} is not verified`);
|
|
61715
61715
|
if (entry2.message !== void 0 && entry2.checkBottom) issue2(["checks", i, "message"], "a check takes a message or a checkBottom, not both");
|
|
61716
61716
|
if (entry2.checkNumber !== void 0) {
|
|
61717
|
-
const
|
|
61718
|
-
if (checkNumbers.has(
|
|
61719
|
-
checkNumbers.add(
|
|
61717
|
+
const id9 = `${entry2.bankAccount}#${entry2.checkNumber}`;
|
|
61718
|
+
if (checkNumbers.has(id9)) issue2(["checks", i, "checkNumber"], "duplicate check number for this bank account");
|
|
61719
|
+
checkNumbers.add(id9);
|
|
61720
61720
|
}
|
|
61721
61721
|
});
|
|
61722
61722
|
});
|
|
@@ -62394,9 +62394,9 @@ var KalshiSeedSchema = external_exports.strictObject({
|
|
|
62394
62394
|
if (!entry2.ticker.startsWith(`${entry2.series}-`)) issue2(["events", i, "ticker"], "an event ticker starts with its series ticker and a dash");
|
|
62395
62395
|
if (entry2.mutuallyExclusive && entry2.markets.filter((item2) => item2.result === "yes").length > 1) issue2(["events", i, "markets"], "at most one market of a mutually exclusive event resolves Yes");
|
|
62396
62396
|
entry2.markets.forEach((item2, j) => {
|
|
62397
|
-
const at = ["events", i, "markets", j],
|
|
62398
|
-
if (markets.has(
|
|
62399
|
-
markets.set(
|
|
62397
|
+
const at = ["events", i, "markets", j], id9 = `${entry2.ticker}-${item2.suffix}`;
|
|
62398
|
+
if (markets.has(id9)) issue2([...at, "suffix"], "duplicate market");
|
|
62399
|
+
markets.set(id9, item2);
|
|
62400
62400
|
if (parseDuration(item2.close) <= parseDuration(item2.open)) issue2([...at, "close"], "close is not after open");
|
|
62401
62401
|
if (item2.result === void 0 !== (item2.settled === void 0)) issue2([...at, "result"], "result and settled go together");
|
|
62402
62402
|
if (item2.settled !== void 0 && parseDuration(item2.settled) < parseDuration(item2.close)) issue2([...at, "settled"], "a market settles after it closes");
|
|
@@ -64154,16 +64154,16 @@ var FormulaSyntaxError = class extends Error {
|
|
|
64154
64154
|
};
|
|
64155
64155
|
var FormulaGap = class extends Error {
|
|
64156
64156
|
};
|
|
64157
|
-
function tokenize(
|
|
64157
|
+
function tokenize(text11) {
|
|
64158
64158
|
const out = [];
|
|
64159
64159
|
let i = 0;
|
|
64160
64160
|
const quoted = (close, what) => {
|
|
64161
64161
|
let j = i + 1, value2 = "";
|
|
64162
64162
|
for (; ; ) {
|
|
64163
|
-
if (j >=
|
|
64164
|
-
const c =
|
|
64165
|
-
if (c === "\\" && j + 1 <
|
|
64166
|
-
const e =
|
|
64163
|
+
if (j >= text11.length) throw new FormulaSyntaxError(`unterminated ${what}`);
|
|
64164
|
+
const c = text11[j];
|
|
64165
|
+
if (c === "\\" && j + 1 < text11.length) {
|
|
64166
|
+
const e = text11[j + 1];
|
|
64167
64167
|
value2 += e === "n" ? "\n" : e === "t" ? " " : e;
|
|
64168
64168
|
j += 2;
|
|
64169
64169
|
continue;
|
|
@@ -64175,8 +64175,8 @@ function tokenize(text10) {
|
|
|
64175
64175
|
i = j + 1;
|
|
64176
64176
|
return value2;
|
|
64177
64177
|
};
|
|
64178
|
-
while (i <
|
|
64179
|
-
const c =
|
|
64178
|
+
while (i < text11.length) {
|
|
64179
|
+
const c = text11[i], rest = text11.slice(i);
|
|
64180
64180
|
if (/\s/.test(c)) {
|
|
64181
64181
|
i++;
|
|
64182
64182
|
continue;
|
|
@@ -64217,8 +64217,8 @@ function tokenize(text10) {
|
|
|
64217
64217
|
out.push({ kind: "end" });
|
|
64218
64218
|
return out;
|
|
64219
64219
|
}
|
|
64220
|
-
function parseFormula(
|
|
64221
|
-
const tokens = tokenize(
|
|
64220
|
+
function parseFormula(text11) {
|
|
64221
|
+
const tokens = tokenize(text11);
|
|
64222
64222
|
let at = 0;
|
|
64223
64223
|
const isOp = (value2) => {
|
|
64224
64224
|
const token = tokens[at];
|
|
@@ -64336,8 +64336,8 @@ function num(value2) {
|
|
|
64336
64336
|
if (typeof value2 === "number") return value2;
|
|
64337
64337
|
if (typeof value2 === "boolean") return value2 ? 1 : 0;
|
|
64338
64338
|
if (typeof value2 === "string") {
|
|
64339
|
-
const
|
|
64340
|
-
return !
|
|
64339
|
+
const text11 = value2.trim();
|
|
64340
|
+
return !text11 ? 0 : NUMERIC.test(text11) ? Number(text11) : NaN;
|
|
64341
64341
|
}
|
|
64342
64342
|
return NaN;
|
|
64343
64343
|
}
|
|
@@ -64357,8 +64357,8 @@ function validDay(y, m, d) {
|
|
|
64357
64357
|
const ms = utc(y, m, d), date9 = new Date(ms);
|
|
64358
64358
|
return date9.getUTCFullYear() === y && date9.getUTCMonth() === m && date9.getUTCDate() === d ? ms : null;
|
|
64359
64359
|
}
|
|
64360
|
-
function parseFormulaDate(
|
|
64361
|
-
const value2 =
|
|
64360
|
+
function parseFormulaDate(text11) {
|
|
64361
|
+
const value2 = text11.trim();
|
|
64362
64362
|
let match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(value2);
|
|
64363
64363
|
if (match) {
|
|
64364
64364
|
const ms = validDay(+match[1], +match[2] - 1, +match[3]);
|
|
@@ -64435,14 +64435,14 @@ var UNITS = {
|
|
|
64435
64435
|
};
|
|
64436
64436
|
var FIXED = { milliseconds: 1, seconds: 1e3, minutes: 6e4, hours: 36e5, days: 864e5, weeks: 6048e5 };
|
|
64437
64437
|
var unitOf = (value2) => {
|
|
64438
|
-
const
|
|
64439
|
-
return UNITS[
|
|
64438
|
+
const text11 = formulaText(value2).trim();
|
|
64439
|
+
return UNITS[text11] ?? UNITS[text11.toLowerCase()] ?? null;
|
|
64440
64440
|
};
|
|
64441
64441
|
function addMonths(ms, months) {
|
|
64442
|
-
const date9 = new Date(ms),
|
|
64442
|
+
const date9 = new Date(ms), day5 = date9.getUTCDate();
|
|
64443
64443
|
const target = new Date(utc(date9.getUTCFullYear(), date9.getUTCMonth() + months, 1, date9.getUTCHours(), date9.getUTCMinutes(), date9.getUTCSeconds(), date9.getUTCMilliseconds()));
|
|
64444
64444
|
const last = new Date(utc(target.getUTCFullYear(), target.getUTCMonth() + 1, 0)).getUTCDate();
|
|
64445
|
-
target.setUTCDate(Math.min(
|
|
64445
|
+
target.setUTCDate(Math.min(day5, last));
|
|
64446
64446
|
return target.getTime();
|
|
64447
64447
|
}
|
|
64448
64448
|
function monthsBetween(a, b) {
|
|
@@ -64544,7 +64544,7 @@ function formatFormulaDate(ms, format) {
|
|
|
64544
64544
|
};
|
|
64545
64545
|
return format.replace(FORMAT_TOKENS, (part, literal2) => literal2 ?? token(part));
|
|
64546
64546
|
}
|
|
64547
|
-
function parseWithFormat(
|
|
64547
|
+
function parseWithFormat(text11, format) {
|
|
64548
64548
|
const parts = [];
|
|
64549
64549
|
let pattern = "";
|
|
64550
64550
|
let last = 0;
|
|
@@ -64562,7 +64562,7 @@ function parseWithFormat(text10, format) {
|
|
|
64562
64562
|
parts.push(token);
|
|
64563
64563
|
}
|
|
64564
64564
|
pattern += format.slice(last).replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
64565
|
-
const match = new RegExp(`^${pattern}$`).exec(
|
|
64565
|
+
const match = new RegExp(`^${pattern}$`).exec(text11.trim());
|
|
64566
64566
|
if (!match) return null;
|
|
64567
64567
|
let y = 1970, mo = 0, d = 1, h = 0, mi = 0, s = 0, pm = null;
|
|
64568
64568
|
parts.forEach((token, i) => {
|
|
@@ -64579,14 +64579,14 @@ function parseWithFormat(text10, format) {
|
|
|
64579
64579
|
});
|
|
64580
64580
|
if (mo < 0) return null;
|
|
64581
64581
|
if (pm !== null) h = h % 12 + (pm ? 12 : 0);
|
|
64582
|
-
const
|
|
64583
|
-
if (
|
|
64582
|
+
const day5 = validDay(y, mo, d);
|
|
64583
|
+
if (day5 === null) return null;
|
|
64584
64584
|
const timed2 = parts.some((token) => /^[Hhms]/.test(token));
|
|
64585
|
-
return formulaDate(
|
|
64585
|
+
return formulaDate(day5 + h * 36e5 + mi * 6e4 + s * 1e3, !timed2);
|
|
64586
64586
|
}
|
|
64587
64587
|
var isWorkday = (ms) => {
|
|
64588
|
-
const
|
|
64589
|
-
return
|
|
64588
|
+
const day5 = new Date(ms).getUTCDay();
|
|
64589
|
+
return day5 !== 0 && day5 !== 6;
|
|
64590
64590
|
};
|
|
64591
64591
|
var startOfDay = (ms) => Math.floor(ms / 864e5) * 864e5;
|
|
64592
64592
|
var text1 = (fn) => ({ min: 1, max: 1, run: (args) => fn(formulaText(args[0])) });
|
|
@@ -64626,16 +64626,16 @@ var FUNCTIONS = {
|
|
|
64626
64626
|
ISERROR: { min: 1, max: 1, run: (args) => isFormulaError(args[0]) || typeof args[0] === "number" && Number.isNaN(args[0]) },
|
|
64627
64627
|
// text
|
|
64628
64628
|
CONCATENATE: { min: 1, max: Infinity, run: (args) => args.map(formulaText).join("") },
|
|
64629
|
-
LEN: text1((
|
|
64630
|
-
LOWER: text1((
|
|
64631
|
-
UPPER: text1((
|
|
64632
|
-
TRIM: text1((
|
|
64629
|
+
LEN: text1((text11) => [...text11].length),
|
|
64630
|
+
LOWER: text1((text11) => text11.toLowerCase()),
|
|
64631
|
+
UPPER: text1((text11) => text11.toUpperCase()),
|
|
64632
|
+
TRIM: text1((text11) => text11.trim()),
|
|
64633
64633
|
T: { min: 1, max: 1, run: (args) => typeof single(args[0]) === "string" ? single(args[0]) : "" },
|
|
64634
|
-
ENCODE_URL_COMPONENT: text1((
|
|
64634
|
+
ENCODE_URL_COMPONENT: text1((text11) => encodeURIComponent(text11)),
|
|
64635
64635
|
LEFT: { min: 2, max: 2, run: (args) => formulaText(args[0]).slice(0, Math.max(0, num(args[1]))) },
|
|
64636
64636
|
RIGHT: { min: 2, max: 2, run: (args) => {
|
|
64637
|
-
const
|
|
64638
|
-
return n ?
|
|
64637
|
+
const text11 = formulaText(args[0]), n = Math.max(0, num(args[1]));
|
|
64638
|
+
return n ? text11.slice(-n) : "";
|
|
64639
64639
|
} },
|
|
64640
64640
|
MID: { min: 3, max: 3, run: (args) => {
|
|
64641
64641
|
const start = Math.max(1, num(args[1]));
|
|
@@ -64650,20 +64650,20 @@ var FUNCTIONS = {
|
|
|
64650
64650
|
return at < 0 ? null : at + 1;
|
|
64651
64651
|
} },
|
|
64652
64652
|
SUBSTITUTE: { min: 3, max: 4, run: (args) => {
|
|
64653
|
-
const
|
|
64654
|
-
if (!old) return
|
|
64655
|
-
if (args[3] === void 0) return
|
|
64653
|
+
const text11 = formulaText(args[0]), old = formulaText(args[1]), replacement = formulaText(args[2]);
|
|
64654
|
+
if (!old) return text11;
|
|
64655
|
+
if (args[3] === void 0) return text11.split(old).join(replacement);
|
|
64656
64656
|
const index = num(args[3]);
|
|
64657
64657
|
let at = -1;
|
|
64658
64658
|
for (let i = 0; i < index; i++) {
|
|
64659
|
-
at =
|
|
64660
|
-
if (at < 0) return
|
|
64659
|
+
at = text11.indexOf(old, at + 1);
|
|
64660
|
+
if (at < 0) return text11;
|
|
64661
64661
|
}
|
|
64662
|
-
return
|
|
64662
|
+
return text11.slice(0, at) + replacement + text11.slice(at + old.length);
|
|
64663
64663
|
} },
|
|
64664
64664
|
REPLACE: { min: 4, max: 4, run: (args) => {
|
|
64665
|
-
const
|
|
64666
|
-
return
|
|
64665
|
+
const text11 = formulaText(args[0]), start = Math.max(1, num(args[1])) - 1;
|
|
64666
|
+
return text11.slice(0, start) + formulaText(args[3]) + text11.slice(start + Math.max(0, num(args[2])));
|
|
64667
64667
|
} },
|
|
64668
64668
|
REPT: { min: 2, max: 2, run: (args) => formulaText(args[0]).repeat(Math.max(0, Math.floor(num(args[1])) || 0)) },
|
|
64669
64669
|
REGEX_MATCH: { min: 2, max: 2, run: (args) => {
|
|
@@ -64765,9 +64765,9 @@ var FUNCTIONS = {
|
|
|
64765
64765
|
} },
|
|
64766
64766
|
DATETIME_PARSE: { min: 1, max: 3, run: (args) => {
|
|
64767
64767
|
if (args[2] !== void 0) throw new FormulaGap("DATETIME_PARSE() with a locale");
|
|
64768
|
-
const
|
|
64769
|
-
if (!
|
|
64770
|
-
return (args[1] === void 0 ? parseFormulaDate(
|
|
64768
|
+
const text11 = formulaText(args[0]);
|
|
64769
|
+
if (!text11) return null;
|
|
64770
|
+
return (args[1] === void 0 ? parseFormulaDate(text11) : parseWithFormat(text11, formulaText(args[1]))) ?? err();
|
|
64771
64771
|
} },
|
|
64772
64772
|
DATESTR: { min: 1, max: 1, run: (args) => {
|
|
64773
64773
|
const date9 = dateArg(args[0]);
|
|
@@ -64813,8 +64813,8 @@ var FUNCTIONS = {
|
|
|
64813
64813
|
WEEKDAY: { min: 1, max: 2, run: (args) => {
|
|
64814
64814
|
const date9 = dateArg(args[0]);
|
|
64815
64815
|
if (date9 === null || isFormulaError(date9)) return date9;
|
|
64816
|
-
const monday = args[1] !== void 0 && formulaText(args[1]).toLowerCase() === "monday",
|
|
64817
|
-
return monday ? (
|
|
64816
|
+
const monday = args[1] !== void 0 && formulaText(args[1]).toLowerCase() === "monday", day5 = new Date(date9.ms).getUTCDay();
|
|
64817
|
+
return monday ? (day5 + 6) % 7 : day5;
|
|
64818
64818
|
} },
|
|
64819
64819
|
WEEKNUM: { min: 1, max: 2, run: (args) => {
|
|
64820
64820
|
const date9 = dateArg(args[0]);
|
|
@@ -64946,9 +64946,9 @@ var AirtableSeedSchema = external_exports.strictObject({
|
|
|
64946
64946
|
if (new Set(entry2.fields.map((item2) => lower(item2.name))).size !== entry2.fields.length) issue2([...at, "fields"], "duplicate field name");
|
|
64947
64947
|
if (!PRIMARY_TYPES.has(entry2.fields[0].type)) issue2([...at, "fields", 0, "type"], `a ${entry2.fields[0].type} field cannot be the primary field`);
|
|
64948
64948
|
const has = (fieldName) => fields3.has(fieldName);
|
|
64949
|
-
const formula = (
|
|
64949
|
+
const formula = (text11, path2, vars = [], hasField = has) => {
|
|
64950
64950
|
try {
|
|
64951
|
-
checkFormula(parseFormula(
|
|
64951
|
+
checkFormula(parseFormula(text11), hasField, vars);
|
|
64952
64952
|
} catch (error62) {
|
|
64953
64953
|
if (error62 instanceof FormulaSyntaxError || error62 instanceof FormulaGap) issue2(path2, `invalid formula: ${error62.message}`);
|
|
64954
64954
|
else throw error62;
|
|
@@ -65222,8 +65222,300 @@ function airtableStarterSeed() {
|
|
|
65222
65222
|
});
|
|
65223
65223
|
}
|
|
65224
65224
|
|
|
65225
|
+
// packages/core/src/tools/netsuite.ts
|
|
65226
|
+
var NETSUITE_ACCOUNT_TYPES = ["Bank", "AcctRec", "OthCurrAsset", "AcctPay", "OthCurrLiab", "Equity", "Income", "COGS", "Expense"];
|
|
65227
|
+
var text10 = external_exports.string().min(1).max(255);
|
|
65228
|
+
var id7 = external_exports.number().int().positive().max(2e9);
|
|
65229
|
+
var money5 = external_exports.number().finite().refine((value2) => Math.round(value2 * 100) === Number((value2 * 100).toFixed(6)), "at most two decimals");
|
|
65230
|
+
var positive = money5.refine((value2) => value2 > 0, "must be more than 0");
|
|
65231
|
+
var day4 = external_exports.string().refine(
|
|
65232
|
+
(value2) => /^-?\d+d$/.test(value2) || /^\d{4}-\d{2}-\d{2}$/.test(value2) && (/* @__PURE__ */ new Date(`${value2}T00:00:00Z`)).toISOString().slice(0, 10) === value2,
|
|
65233
|
+
"expected YYYY-MM-DD or an offset in days from the scene start, e.g. -30d"
|
|
65234
|
+
);
|
|
65235
|
+
var external = text10.optional();
|
|
65236
|
+
var entity = {
|
|
65237
|
+
id: id7,
|
|
65238
|
+
entityId: text10.optional(),
|
|
65239
|
+
companyName: text10,
|
|
65240
|
+
email: external_exports.email().max(254).optional(),
|
|
65241
|
+
phone: external_exports.string().max(32).optional(),
|
|
65242
|
+
terms: id7.optional(),
|
|
65243
|
+
inactive: external_exports.boolean().default(false),
|
|
65244
|
+
comments: external_exports.string().max(4e3).optional(),
|
|
65245
|
+
externalId: external
|
|
65246
|
+
};
|
|
65247
|
+
var itemLine = external_exports.strictObject({ item: id7, quantity: external_exports.number().positive().default(1), rate: money5.optional(), description: external_exports.string().max(4e3).optional() });
|
|
65248
|
+
var expenseLine = external_exports.strictObject({ account: id7, amount: positive, memo: external_exports.string().max(4e3).optional() });
|
|
65249
|
+
var application = external_exports.strictObject({ doc: id7, amount: positive });
|
|
65250
|
+
var tx = { id: id7, tranId: text10.optional(), date: day4, memo: external_exports.string().max(4e3).optional(), externalId: external };
|
|
65251
|
+
var NetsuiteSeedSchema = external_exports.strictObject({
|
|
65252
|
+
/** The account ID in NetSuite's realm form: 1234567 for production, 1234567_SB1 for a sandbox. */
|
|
65253
|
+
account: external_exports.strictObject({ id: external_exports.string().regex(/^\d{4,10}(?:_SB\d{1,2})?$/), company: text10 }).default({ id: "7654321", company: "Acme" }),
|
|
65254
|
+
policy: external_exports.strictObject({
|
|
65255
|
+
/** New vendor bills wait for approval, and only an approved bill can be paid. */
|
|
65256
|
+
billApproval: external_exports.boolean().default(true),
|
|
65257
|
+
/** The integration's role may approve and reject vendor bills. */
|
|
65258
|
+
approveBills: external_exports.boolean().default(true),
|
|
65259
|
+
/** New sales orders wait for approval before they can be billed. */
|
|
65260
|
+
salesOrderApproval: external_exports.boolean().default(false)
|
|
65261
|
+
}).default({ billApproval: true, approveBills: true, salesOrderApproval: false }),
|
|
65262
|
+
subsidiaries: external_exports.array(external_exports.strictObject({ id: id7, name: text10 })).min(1).max(50).default([{ id: 1, name: "Acme" }]),
|
|
65263
|
+
currencies: external_exports.array(external_exports.strictObject({ id: id7, name: text10, symbol: external_exports.string().regex(/^[A-Z]{3}$/) })).min(1).max(50).default([{ id: 1, name: "US Dollar", symbol: "USD" }]),
|
|
65264
|
+
terms: external_exports.array(external_exports.strictObject({ id: id7, name: text10, days: external_exports.number().int().min(0).max(365) })).max(50).default([{ id: 1, name: "Net 15", days: 15 }, { id: 2, name: "Net 30", days: 30 }, { id: 3, name: "Due on receipt", days: 0 }]),
|
|
65265
|
+
accounts: external_exports.array(external_exports.strictObject({ id: id7, number: external_exports.string().max(60).optional(), name: text10, type: external_exports.enum(NETSUITE_ACCOUNT_TYPES), inactive: external_exports.boolean().default(false), externalId: external })).max(500).default([]),
|
|
65266
|
+
customers: external_exports.array(external_exports.strictObject({ ...entity, creditLimit: money5.optional(), creditHold: external_exports.enum(["AUTO", "ON", "OFF"]).default("AUTO") })).max(5e3).default([]),
|
|
65267
|
+
vendors: external_exports.array(external_exports.strictObject(entity)).max(5e3).default([]),
|
|
65268
|
+
items: external_exports.array(external_exports.strictObject({
|
|
65269
|
+
id: id7,
|
|
65270
|
+
itemId: text10,
|
|
65271
|
+
displayName: text10.optional(),
|
|
65272
|
+
description: external_exports.string().max(4e3).optional(),
|
|
65273
|
+
rate: money5.optional(),
|
|
65274
|
+
incomeAccount: id7.optional(),
|
|
65275
|
+
inactive: external_exports.boolean().default(false),
|
|
65276
|
+
externalId: external
|
|
65277
|
+
})).max(5e3).default([]),
|
|
65278
|
+
salesOrders: external_exports.array(external_exports.strictObject({ ...tx, customer: id7, terms: id7.optional(), pendingApproval: external_exports.boolean().default(false), lines: external_exports.array(itemLine).min(1).max(500) })).max(5e3).default([]),
|
|
65279
|
+
/** An invoice billed from a sales order names it in `salesOrder`; its lines bill that order's lines, by item. */
|
|
65280
|
+
invoices: external_exports.array(external_exports.strictObject({ ...tx, customer: id7, terms: id7.optional(), dueDate: day4.optional(), salesOrder: id7.optional(), lines: external_exports.array(itemLine).min(1).max(500) })).max(5e3).default([]),
|
|
65281
|
+
creditMemos: external_exports.array(external_exports.strictObject({ ...tx, customer: id7, lines: external_exports.array(itemLine).min(1).max(500), apply: external_exports.array(application).max(500).default([]) })).max(5e3).default([]),
|
|
65282
|
+
customerPayments: external_exports.array(external_exports.strictObject({ ...tx, customer: id7, amount: positive, account: id7.optional(), apply: external_exports.array(application).max(500).default([]) })).max(5e3).default([]),
|
|
65283
|
+
/** `tranId` on a bill is the vendor's own invoice number. */
|
|
65284
|
+
vendorBills: external_exports.array(external_exports.strictObject({
|
|
65285
|
+
...tx,
|
|
65286
|
+
vendor: id7,
|
|
65287
|
+
terms: id7.optional(),
|
|
65288
|
+
dueDate: day4.optional(),
|
|
65289
|
+
approval: external_exports.enum(["pending", "approved", "rejected"]).optional(),
|
|
65290
|
+
expenses: external_exports.array(expenseLine).max(500).default([]),
|
|
65291
|
+
lines: external_exports.array(itemLine).max(500).default([])
|
|
65292
|
+
})).max(5e3).default([]),
|
|
65293
|
+
vendorPayments: external_exports.array(external_exports.strictObject({ ...tx, vendor: id7, amount: positive, account: id7.optional(), apply: external_exports.array(application).max(500).default([]) })).max(5e3).default([]),
|
|
65294
|
+
journalEntries: external_exports.array(external_exports.strictObject({ ...tx, lines: external_exports.array(external_exports.strictObject({ account: id7, debit: positive.optional(), credit: positive.optional(), memo: external_exports.string().max(4e3).optional(), entity: id7.optional() })).min(2).max(500) })).max(5e3).default([])
|
|
65295
|
+
}).superRefine((seed2, ctx) => {
|
|
65296
|
+
const issue2 = (path2, message4) => ctx.addIssue({ code: "custom", path: path2, message: message4 });
|
|
65297
|
+
const round2 = (v) => Math.sign(v) * Math.round(Number(`${Math.abs(v).toFixed(10)}e2`)) / 100 || 0;
|
|
65298
|
+
const accountById = new Map(seed2.accounts.map((a) => [a.id, a]));
|
|
65299
|
+
const itemById = new Map(seed2.items.map((i) => [i.id, i]));
|
|
65300
|
+
const itemTotal = (lines2) => round2(lines2.reduce((sum, line2) => sum + round2(line2.quantity * (line2.rate ?? itemById.get(line2.item)?.rate ?? 0)), 0));
|
|
65301
|
+
const transactionAccount = (account2, path2) => {
|
|
65302
|
+
if (account2 === void 0) return void 0;
|
|
65303
|
+
const known = accountById.get(account2);
|
|
65304
|
+
if (!known) issue2(path2, "missing account");
|
|
65305
|
+
else if (known.inactive) issue2(path2, "inactive account");
|
|
65306
|
+
return known;
|
|
65307
|
+
};
|
|
65308
|
+
const ids = (list, name3) => {
|
|
65309
|
+
const seen = /* @__PURE__ */ new Set();
|
|
65310
|
+
for (const [index, item2] of list.entries()) {
|
|
65311
|
+
if (seen.has(item2.id)) issue2([name3, index, "id"], "duplicate ID");
|
|
65312
|
+
seen.add(item2.id);
|
|
65313
|
+
}
|
|
65314
|
+
return seen;
|
|
65315
|
+
};
|
|
65316
|
+
const accounts = ids(seed2.accounts, "accounts"), terms = ids(seed2.terms, "terms"), items = ids(seed2.items, "items");
|
|
65317
|
+
ids(seed2.subsidiaries, "subsidiaries");
|
|
65318
|
+
ids(seed2.currencies, "currencies");
|
|
65319
|
+
const customers = new Set(seed2.customers.map((c) => c.id)), vendors = new Set(seed2.vendors.map((v) => v.id)), entities = /* @__PURE__ */ new Set();
|
|
65320
|
+
for (const [name3, list] of [["customers", seed2.customers], ["vendors", seed2.vendors]]) for (const [index, e] of list.entries()) {
|
|
65321
|
+
if (entities.has(e.id)) issue2([name3, index, "id"], "customers and vendors share one ID space");
|
|
65322
|
+
entities.add(e.id);
|
|
65323
|
+
}
|
|
65324
|
+
for (const [list, name3] of [[seed2.customers, "customers"], [seed2.vendors, "vendors"]]) for (const [index, e] of list.entries()) if (e.terms !== void 0 && !terms.has(e.terms)) issue2([name3, index, "terms"], "missing term");
|
|
65325
|
+
for (const [index, item2] of seed2.items.entries()) if (item2.incomeAccount !== void 0 && !accounts.has(item2.incomeAccount)) issue2(["items", index, "incomeAccount"], "missing account");
|
|
65326
|
+
const transactions = ["salesOrders", "invoices", "creditMemos", "customerPayments", "vendorBills", "vendorPayments", "journalEntries"];
|
|
65327
|
+
const externalIds = (names) => {
|
|
65328
|
+
const seen = /* @__PURE__ */ new Set();
|
|
65329
|
+
for (const name3 of names) for (const [index, record4] of seed2[name3].entries()) {
|
|
65330
|
+
if (record4.externalId === void 0) continue;
|
|
65331
|
+
const key2 = record4.externalId.toLowerCase();
|
|
65332
|
+
if (seen.has(key2)) issue2([name3, index, "externalId"], "duplicate external ID");
|
|
65333
|
+
seen.add(key2);
|
|
65334
|
+
}
|
|
65335
|
+
};
|
|
65336
|
+
externalIds(["customers", "vendors"]);
|
|
65337
|
+
externalIds(transactions);
|
|
65338
|
+
externalIds(["items"]);
|
|
65339
|
+
externalIds(["accounts"]);
|
|
65340
|
+
const txIds = /* @__PURE__ */ new Map();
|
|
65341
|
+
for (const name3 of transactions) for (const [index, t] of seed2[name3].entries()) {
|
|
65342
|
+
if (txIds.has(t.id)) issue2([name3, index, "id"], "transactions share one ID space");
|
|
65343
|
+
txIds.set(t.id, name3);
|
|
65344
|
+
}
|
|
65345
|
+
const lines = (name3, index, list) => list.forEach((line2, i) => {
|
|
65346
|
+
if (!items.has(line2.item)) issue2([name3, index, "lines", i, "item"], "missing item");
|
|
65347
|
+
});
|
|
65348
|
+
for (const name3 of ["salesOrders", "invoices", "creditMemos"]) for (const [index, t] of seed2[name3].entries()) {
|
|
65349
|
+
if (!customers.has(t.customer)) issue2([name3, index, "customer"], "missing customer");
|
|
65350
|
+
lines(name3, index, t.lines);
|
|
65351
|
+
}
|
|
65352
|
+
for (const name3 of ["salesOrders", "invoices", "vendorBills"]) for (const [index, t] of seed2[name3].entries()) {
|
|
65353
|
+
if (t.terms !== void 0 && !terms.has(t.terms)) issue2([name3, index, "terms"], "missing term");
|
|
65354
|
+
}
|
|
65355
|
+
const orderById = new Map(seed2.salesOrders.map((order3) => [order3.id, {
|
|
65356
|
+
...order3,
|
|
65357
|
+
lines: order3.lines.map((line2) => ({ ...line2, billed: 0 }))
|
|
65358
|
+
}]));
|
|
65359
|
+
for (const [index, t] of seed2.invoices.entries()) {
|
|
65360
|
+
if (t.salesOrder === void 0) continue;
|
|
65361
|
+
const order3 = orderById.get(t.salesOrder), path2 = ["invoices", index, "salesOrder"];
|
|
65362
|
+
if (!order3) {
|
|
65363
|
+
issue2(path2, "missing sales order");
|
|
65364
|
+
continue;
|
|
65365
|
+
}
|
|
65366
|
+
if (order3.customer !== t.customer) issue2(path2, "sales order belongs to another customer");
|
|
65367
|
+
if (order3.pendingApproval) issue2(path2, "sales order is pending approval");
|
|
65368
|
+
for (const [i, line2] of t.lines.entries()) {
|
|
65369
|
+
if (!order3.lines.some((l) => l.item === line2.item)) {
|
|
65370
|
+
issue2(["invoices", index, "lines", i, "item"], "item is not on the sales order");
|
|
65371
|
+
continue;
|
|
65372
|
+
}
|
|
65373
|
+
const open2 = order3.lines.find((l) => l.item === line2.item && l.quantity - l.billed >= line2.quantity - 1e-9);
|
|
65374
|
+
if (!open2) issue2(["invoices", index, "lines", i, "quantity"], "quantity exceeds a remaining sales order line");
|
|
65375
|
+
else open2.billed += line2.quantity;
|
|
65376
|
+
}
|
|
65377
|
+
}
|
|
65378
|
+
for (const [index, t] of seed2.vendorBills.entries()) {
|
|
65379
|
+
if (!vendors.has(t.vendor)) issue2(["vendorBills", index, "vendor"], "missing vendor");
|
|
65380
|
+
if (!t.expenses.length && !t.lines.length) issue2(["vendorBills", index], "a bill needs at least one expense or item line");
|
|
65381
|
+
t.expenses.forEach((line2, i) => {
|
|
65382
|
+
const path2 = ["vendorBills", index, "expenses", i, "account"], account2 = transactionAccount(line2.account, path2);
|
|
65383
|
+
if (account2?.type === "AcctRec" || account2?.type === "AcctPay") issue2(path2, "expense account cannot be receivables or payables");
|
|
65384
|
+
});
|
|
65385
|
+
lines("vendorBills", index, t.lines);
|
|
65386
|
+
}
|
|
65387
|
+
const invoiceById = new Map(seed2.invoices.map((t) => [t.id, t])), billById = new Map(seed2.vendorBills.map((t) => [t.id, t]));
|
|
65388
|
+
const invoiceApplied = /* @__PURE__ */ new Map(), billApplied = /* @__PURE__ */ new Map();
|
|
65389
|
+
const applies = (name3) => {
|
|
65390
|
+
for (const [index, t] of seed2[name3].entries()) {
|
|
65391
|
+
const seen = /* @__PURE__ */ new Set();
|
|
65392
|
+
for (const [i, a] of t.apply.entries()) {
|
|
65393
|
+
const path2 = [name3, index, "apply", i, "doc"];
|
|
65394
|
+
if (seen.has(a.doc)) issue2(path2, "duplicate applied document");
|
|
65395
|
+
seen.add(a.doc);
|
|
65396
|
+
if ("vendor" in t) {
|
|
65397
|
+
const bill = billById.get(a.doc);
|
|
65398
|
+
if (!bill) {
|
|
65399
|
+
issue2(path2, "missing vendor bill");
|
|
65400
|
+
continue;
|
|
65401
|
+
}
|
|
65402
|
+
if (bill.vendor !== t.vendor) issue2(path2, "vendor bill belongs to another vendor");
|
|
65403
|
+
if (seed2.policy.billApproval && bill.approval !== "approved") issue2(path2, "vendor bill is not approved");
|
|
65404
|
+
billApplied.set(a.doc, (billApplied.get(a.doc) ?? 0) + a.amount);
|
|
65405
|
+
} else {
|
|
65406
|
+
const invoice = invoiceById.get(a.doc);
|
|
65407
|
+
if (!invoice) {
|
|
65408
|
+
issue2(path2, "missing invoice");
|
|
65409
|
+
continue;
|
|
65410
|
+
}
|
|
65411
|
+
if (invoice.customer !== t.customer) issue2(path2, "invoice belongs to another customer");
|
|
65412
|
+
invoiceApplied.set(a.doc, (invoiceApplied.get(a.doc) ?? 0) + a.amount);
|
|
65413
|
+
}
|
|
65414
|
+
}
|
|
65415
|
+
}
|
|
65416
|
+
};
|
|
65417
|
+
applies("creditMemos");
|
|
65418
|
+
applies("customerPayments");
|
|
65419
|
+
applies("vendorPayments");
|
|
65420
|
+
for (const [index, t] of seed2.invoices.entries()) {
|
|
65421
|
+
if (round2(invoiceApplied.get(t.id) ?? 0) > itemTotal(t.lines) + 1e-9) issue2(["invoices", index], "invoice is over-applied");
|
|
65422
|
+
}
|
|
65423
|
+
for (const [index, t] of seed2.vendorBills.entries()) {
|
|
65424
|
+
const total = round2(itemTotal(t.lines) + t.expenses.reduce((sum, line2) => sum + line2.amount, 0));
|
|
65425
|
+
if (round2(billApplied.get(t.id) ?? 0) > total + 1e-9) issue2(["vendorBills", index], "vendor bill is over-applied");
|
|
65426
|
+
}
|
|
65427
|
+
for (const [index, t] of seed2.creditMemos.entries()) {
|
|
65428
|
+
if (round2(t.apply.reduce((sum, a) => sum + a.amount, 0)) > itemTotal(t.lines) + 1e-9) issue2(["creditMemos", index, "apply"], "applies more than the credit memo");
|
|
65429
|
+
}
|
|
65430
|
+
for (const [index, t] of seed2.customerPayments.entries()) {
|
|
65431
|
+
if (!customers.has(t.customer)) issue2(["customerPayments", index, "customer"], "missing customer");
|
|
65432
|
+
const path2 = ["customerPayments", index, "account"], account2 = transactionAccount(t.account, path2);
|
|
65433
|
+
if (account2 && account2.type !== "Bank" && account2.type !== "OthCurrAsset") issue2(path2, "payment account must be Bank or OthCurrAsset");
|
|
65434
|
+
if (t.apply.reduce((sum, a) => sum + a.amount, 0) > t.amount + 1e-9) issue2(["customerPayments", index, "apply"], "applies more than the payment");
|
|
65435
|
+
}
|
|
65436
|
+
for (const [index, t] of seed2.vendorPayments.entries()) {
|
|
65437
|
+
if (!vendors.has(t.vendor)) issue2(["vendorPayments", index, "vendor"], "missing vendor");
|
|
65438
|
+
const path2 = ["vendorPayments", index, "account"], account2 = transactionAccount(t.account, path2);
|
|
65439
|
+
if (account2 && account2.type !== "Bank") issue2(path2, "payment account must be Bank");
|
|
65440
|
+
if (t.apply.reduce((sum, a) => sum + a.amount, 0) > t.amount + 1e-9) issue2(["vendorPayments", index, "apply"], "applies more than the payment");
|
|
65441
|
+
}
|
|
65442
|
+
for (const [index, t] of seed2.journalEntries.entries()) {
|
|
65443
|
+
t.lines.forEach((line2, i) => {
|
|
65444
|
+
const path2 = ["journalEntries", index, "lines", i, "account"], account2 = transactionAccount(line2.account, path2);
|
|
65445
|
+
if (account2?.type === "AcctRec" || account2?.type === "AcctPay") issue2(path2, "post receivables and payables with invoices, credit memos, bills and payments");
|
|
65446
|
+
if (line2.entity !== void 0 && !entities.has(line2.entity)) issue2(["journalEntries", index, "lines", i, "entity"], "missing customer or vendor");
|
|
65447
|
+
if (line2.debit === void 0 === (line2.credit === void 0)) issue2(["journalEntries", index, "lines", i], "a line has a debit or a credit");
|
|
65448
|
+
});
|
|
65449
|
+
const debit = t.lines.reduce((sum, l) => sum + (l.debit ?? 0), 0), credit = t.lines.reduce((sum, l) => sum + (l.credit ?? 0), 0);
|
|
65450
|
+
if (Math.abs(debit - credit) > 5e-3) issue2(["journalEntries", index, "lines"], "debits and credits differ");
|
|
65451
|
+
}
|
|
65452
|
+
});
|
|
65453
|
+
var netsuiteStarterSeed = {
|
|
65454
|
+
account: { id: "7654321", company: "Acme" },
|
|
65455
|
+
policy: { billApproval: true, approveBills: true, salesOrderApproval: false },
|
|
65456
|
+
accounts: [
|
|
65457
|
+
{ id: 1, number: "1000", name: "Operating Checking", type: "Bank" },
|
|
65458
|
+
{ id: 2, number: "1100", name: "Accounts Receivable", type: "AcctRec" },
|
|
65459
|
+
{ id: 3, number: "1200", name: "Undeposited Funds", type: "OthCurrAsset" },
|
|
65460
|
+
{ id: 4, number: "2000", name: "Accounts Payable", type: "AcctPay" },
|
|
65461
|
+
{ id: 5, number: "2100", name: "Accrued Expenses", type: "OthCurrLiab" },
|
|
65462
|
+
{ id: 6, number: "4000", name: "Services Revenue", type: "Income" },
|
|
65463
|
+
{ id: 7, number: "4100", name: "License Revenue", type: "Income" },
|
|
65464
|
+
{ id: 8, number: "6100", name: "Cloud Hosting", type: "Expense" },
|
|
65465
|
+
{ id: 9, number: "6200", name: "Legal Fees", type: "Expense" },
|
|
65466
|
+
{ id: 10, number: "6300", name: "Office Supplies", type: "Expense" }
|
|
65467
|
+
],
|
|
65468
|
+
customers: [
|
|
65469
|
+
{ id: 101, companyName: "Ridgeway Robotics", email: "ap@ridgeway-robotics.example", phone: "+1 503 555 0142", terms: 2, creditLimit: 2e4 },
|
|
65470
|
+
{ id: 102, companyName: "Pinecrest Health", email: "payables@pinecrest-health.example", terms: 2, creditLimit: 5e4 },
|
|
65471
|
+
{ id: 103, companyName: "Bluefield Logistics", email: "finance@bluefield-logistics.example", terms: 1, creditLimit: 5e3, creditHold: "ON" },
|
|
65472
|
+
{ id: 104, companyName: "Kestrel Credit Union", email: "vendors@kestrel-cu.example", terms: 2 },
|
|
65473
|
+
{ id: 105, companyName: "Lakeview Retail", email: "ap@lakeview-retail.example", terms: 2 }
|
|
65474
|
+
],
|
|
65475
|
+
vendors: [
|
|
65476
|
+
{ id: 201, companyName: "Northgate Cloud Hosting", email: "billing@northgate-hosting.example", terms: 2 },
|
|
65477
|
+
{ id: 202, companyName: "Harlow & Reid LLP", email: "accounts@harlowreid.example", terms: 2 },
|
|
65478
|
+
{ id: 203, companyName: "Pemberton Office Supply", email: "orders@pemberton-supply.example", terms: 1 },
|
|
65479
|
+
{ id: 204, companyName: "Swiftline Couriers", email: "invoices@swiftline.example", terms: 1 }
|
|
65480
|
+
],
|
|
65481
|
+
items: [
|
|
65482
|
+
{ id: 301, itemId: "IMPL", displayName: "Implementation", description: "Implementation services, per week", rate: 1500, incomeAccount: 6 },
|
|
65483
|
+
{ id: 302, itemId: "LIC-ANNUAL", displayName: "Platform license (annual)", rate: 12e3, incomeAccount: 7 },
|
|
65484
|
+
{ id: 303, itemId: "SUPPORT-MO", displayName: "Support plan (monthly)", rate: 600, incomeAccount: 6 },
|
|
65485
|
+
{ id: 304, itemId: "TRAINING", displayName: "Training session", rate: 900, incomeAccount: 6 }
|
|
65486
|
+
],
|
|
65487
|
+
salesOrders: [
|
|
65488
|
+
{ id: 1001, tranId: "SO1001", date: "-20d", customer: 102, memo: "Rollout, three weeks", lines: [{ item: 301, quantity: 3 }] }
|
|
65489
|
+
],
|
|
65490
|
+
invoices: [
|
|
65491
|
+
{ id: 1002, tranId: "INV1001", date: "-45d", customer: 101, lines: [{ item: 303, quantity: 2 }] },
|
|
65492
|
+
{ id: 1003, tranId: "INV1002", date: "-10d", customer: 101, lines: [{ item: 303, quantity: 1 }] },
|
|
65493
|
+
{ id: 1004, tranId: "INV1003", date: "-18d", customer: 102, salesOrder: 1001, lines: [{ item: 301, quantity: 1 }] },
|
|
65494
|
+
{ id: 1005, tranId: "INV1004", date: "-70d", customer: 103, lines: [{ item: 304, quantity: 2 }] },
|
|
65495
|
+
{ id: 1006, tranId: "INV1005", date: "-60d", customer: 104, lines: [{ item: 302, quantity: 1 }] }
|
|
65496
|
+
],
|
|
65497
|
+
customerPayments: [
|
|
65498
|
+
{ id: 1007, date: "-5d", customer: 101, amount: 200, account: 3, apply: [{ doc: 1002, amount: 200 }] },
|
|
65499
|
+
{ id: 1008, date: "-40d", customer: 104, amount: 12e3, account: 3, apply: [{ doc: 1006, amount: 12e3 }] }
|
|
65500
|
+
],
|
|
65501
|
+
creditMemos: [
|
|
65502
|
+
{ id: 1009, tranId: "CM1001", date: "-4d", customer: 101, memo: "Support outage credit", lines: [{ item: 303, quantity: 1, rate: 100 }], apply: [{ doc: 1002, amount: 100 }] }
|
|
65503
|
+
],
|
|
65504
|
+
vendorBills: [
|
|
65505
|
+
{ id: 1010, tranId: "NCH-88231", date: "-12d", vendor: 201, approval: "approved", expenses: [{ account: 8, amount: 2400, memo: "October hosting" }] },
|
|
65506
|
+
{ id: 1011, tranId: "HR-2026-114", date: "-3d", vendor: 202, approval: "pending", expenses: [{ account: 9, amount: 3750, memo: "Contract review" }] },
|
|
65507
|
+
{ id: 1012, tranId: "PEM-5521", date: "-25d", vendor: 203, approval: "approved", expenses: [{ account: 10, amount: 180 }] }
|
|
65508
|
+
],
|
|
65509
|
+
vendorPayments: [
|
|
65510
|
+
{ id: 1013, date: "-10d", vendor: 203, amount: 180, account: 1, apply: [{ doc: 1012, amount: 180 }] }
|
|
65511
|
+
],
|
|
65512
|
+
journalEntries: [
|
|
65513
|
+
{ id: 1014, tranId: "JE1001", date: "-1d", memo: "Accrue November legal fees", lines: [{ account: 9, debit: 1200 }, { account: 5, credit: 1200 }] }
|
|
65514
|
+
]
|
|
65515
|
+
};
|
|
65516
|
+
|
|
65225
65517
|
// packages/core/src/scene/schema.ts
|
|
65226
|
-
var SUPPORTED_TWINS = ["slack", "github", "datadog", "pagerduty", "linkedin-ads", "salesforce", "gong", "hubspot", "ga4", "google-ads", "chatgpt-ads", "open-meteo", "google-drive", "gmail", "amazon-s3", "linear", "okta", "stripe", "clerk", "better-stack", "notion", "attio", "dropbox", "resend", "microsoft-word", "shopify", "lob", "paypal", "jira", "kalshi", "intercom", "zendesk", "google-calendar", "twilio", "asana", "discord", "sentry", "airtable"];
|
|
65518
|
+
var SUPPORTED_TWINS = ["slack", "github", "datadog", "pagerduty", "linkedin-ads", "salesforce", "gong", "hubspot", "ga4", "google-ads", "chatgpt-ads", "open-meteo", "google-drive", "gmail", "amazon-s3", "linear", "okta", "stripe", "clerk", "better-stack", "notion", "attio", "dropbox", "resend", "microsoft-word", "shopify", "lob", "paypal", "jira", "kalshi", "intercom", "zendesk", "google-calendar", "twilio", "asana", "discord", "sentry", "airtable", "netsuite"];
|
|
65227
65519
|
var refName3 = external_exports.string().describe(`Declares a ref: a bare name matching ${REF_NAME_PATTERN}, e.g. alice`);
|
|
65228
65520
|
var refUse3 = external_exports.string().describe("Reference to a declared ref: $name or $kind.name, e.g. $alice or $user.alice").meta({ pattern: REF_USE_PATTERN });
|
|
65229
65521
|
var DURATION_ERROR = "expected a duration string like 500ms, 30s, 5m, 1h, 1m30s, 2d or -1h";
|
|
@@ -65430,6 +65722,8 @@ var ToolObservationSchema = external_exports.strictObject({
|
|
|
65430
65722
|
args: external_exports.unknown().optional(),
|
|
65431
65723
|
/** What the tool function returned. A recorded failure has `error` instead. */
|
|
65432
65724
|
result: external_exports.unknown().optional(),
|
|
65725
|
+
/** The result as the trace held it, when its numbers don't survive a JavaScript round trip (50.0, 1e5): a tool that returns text gets this text back. */
|
|
65726
|
+
text: external_exports.string().optional(),
|
|
65433
65727
|
error: external_exports.string().optional(),
|
|
65434
65728
|
/** The framework's envelope as the trace held it (an MCP CallToolResult, a LangChain ToolMessage), for replay over MCP. */
|
|
65435
65729
|
wrap: external_exports.enum(["mcp", "langchain", "output"]).optional(),
|
|
@@ -65449,8 +65743,12 @@ var SceneToolSchema = external_exports.strictObject({
|
|
|
65449
65743
|
recorded: external_exports.array(ToolObservationSchema).optional(),
|
|
65450
65744
|
/** Calls from other traces of this agent, so a simulated answer can follow how the tool behaved there. */
|
|
65451
65745
|
examples: external_exports.array(ToolExampleSchema).optional(),
|
|
65452
|
-
/**
|
|
65453
|
-
|
|
65746
|
+
/**
|
|
65747
|
+
* A call production never made: simulated (the default for a read), a tool error (the default for a write), the twin,
|
|
65748
|
+
* or `run`: the tool's own code, over the store the agent fills from its records (ANCHA_RECORDS). Once a `run` tool
|
|
65749
|
+
* has changed something in a test, `run` tools answer from their code only.
|
|
65750
|
+
*/
|
|
65751
|
+
unrecorded: external_exports.enum(["simulate", "fail", "twin", "run"]).optional(),
|
|
65454
65752
|
/** The twin that answers what production never recorded (TRACE_PLAN_V2 §5.3). */
|
|
65455
65753
|
twin: external_exports.string().optional(),
|
|
65456
65754
|
/** The agent reaches this tool over MCP: in a test its client points at {{tools.mcp_url}}, so there is nothing to wrap. */
|
|
@@ -65491,7 +65789,7 @@ var SceneSchema = external_exports.strictObject({
|
|
|
65491
65789
|
task: external_exports.string().optional(),
|
|
65492
65790
|
trigger: TriggerSchema.optional(),
|
|
65493
65791
|
tools: external_exports.record(external_exports.string().regex(TOOL_NAME_PATTERN, "a tool name as the model saw it"), SceneToolSchema).optional(),
|
|
65494
|
-
seed: external_exports.strictObject({ slack: SlackSeedSchema.optional(), github: GitHubSeedSchema.optional(), datadog: DatadogSeedSchema.optional(), pagerduty: PagerDutySeedSchema.optional(), "linkedin-ads": LinkedInAdsSeedSchema.optional(), salesforce: SalesforceSeedSchema.optional(), gong: GongSeedSchema.optional(), hubspot: HubSpotSeedSchema.optional(), ga4: GA4SeedSchema.optional(), "google-ads": GoogleAdsSeedSchema.optional(), "chatgpt-ads": ChatGPTAdsSeedSchema.optional(), "open-meteo": OpenMeteoSeedSchema.optional(), "google-drive": GoogleDriveSeedSchema.optional(), gmail: GmailSeedSchema.optional(), "amazon-s3": AmazonS3SeedSchema.optional(), linear: LinearSeedSchema.optional(), "okta": OktaSeedSchema.optional(), stripe: StripeSeedSchema.optional(), "clerk": ClerkSeedSchema.optional(), "better-stack": BetterStackSeedSchema.optional(), notion: NotionSeedSchema.optional(), attio: AttioSeedSchema.optional(), "dropbox": DropboxSeedSchema.optional(), resend: ResendSeedSchema.optional(), "microsoft-word": MicrosoftWordSeedSchema.optional(), shopify: ShopifySeedSchema.optional(), "lob": LobSeedSchema.optional(), paypal: PayPalSeedSchema.optional(), jira: JiraSeedSchema.optional(), "kalshi": KalshiSeedSchema.optional(), intercom: IntercomSeedSchema.optional(), "zendesk": ZendeskSeedSchema.optional(), "google-calendar": GoogleCalendarSeedSchema.optional(), "twilio": TwilioSeedSchema.optional(), "asana": AsanaSeedSchema.optional(), "discord": DiscordSeedSchema.optional(), sentry: SentrySeedSchema.optional(), "airtable": AirtableSeedSchema.optional() }),
|
|
65792
|
+
seed: external_exports.strictObject({ slack: SlackSeedSchema.optional(), github: GitHubSeedSchema.optional(), datadog: DatadogSeedSchema.optional(), pagerduty: PagerDutySeedSchema.optional(), "linkedin-ads": LinkedInAdsSeedSchema.optional(), salesforce: SalesforceSeedSchema.optional(), gong: GongSeedSchema.optional(), hubspot: HubSpotSeedSchema.optional(), ga4: GA4SeedSchema.optional(), "google-ads": GoogleAdsSeedSchema.optional(), "chatgpt-ads": ChatGPTAdsSeedSchema.optional(), "open-meteo": OpenMeteoSeedSchema.optional(), "google-drive": GoogleDriveSeedSchema.optional(), gmail: GmailSeedSchema.optional(), "amazon-s3": AmazonS3SeedSchema.optional(), linear: LinearSeedSchema.optional(), "okta": OktaSeedSchema.optional(), stripe: StripeSeedSchema.optional(), "clerk": ClerkSeedSchema.optional(), "better-stack": BetterStackSeedSchema.optional(), notion: NotionSeedSchema.optional(), attio: AttioSeedSchema.optional(), "dropbox": DropboxSeedSchema.optional(), resend: ResendSeedSchema.optional(), "microsoft-word": MicrosoftWordSeedSchema.optional(), shopify: ShopifySeedSchema.optional(), "lob": LobSeedSchema.optional(), paypal: PayPalSeedSchema.optional(), jira: JiraSeedSchema.optional(), "kalshi": KalshiSeedSchema.optional(), intercom: IntercomSeedSchema.optional(), "zendesk": ZendeskSeedSchema.optional(), "google-calendar": GoogleCalendarSeedSchema.optional(), "twilio": TwilioSeedSchema.optional(), "asana": AsanaSeedSchema.optional(), "discord": DiscordSeedSchema.optional(), sentry: SentrySeedSchema.optional(), "airtable": AirtableSeedSchema.optional(), netsuite: NetsuiteSeedSchema.optional() }),
|
|
65495
65793
|
world_rules: external_exports.strictObject({ actors: external_exports.array(ActorSchema).optional(), app_calls: external_exports.array(AppCallSchema).optional(), pipelines: external_exports.array(PipelineRuleSchema).optional(), faults: external_exports.array(FaultRuleSchema).optional(), metrics: external_exports.array(MetricRuleSchema).optional(), logs: external_exports.array(LogRuleSchema).optional(), monitors: external_exports.array(MonitorRuleSchema).optional(), integrations: external_exports.array(IntegrationSchema).optional() }).optional(),
|
|
65496
65794
|
people: PeopleSchema.optional(),
|
|
65497
65795
|
until: UntilSchema.optional(),
|
|
@@ -65600,10 +65898,10 @@ var TestFileDocument = external_exports.strictObject({
|
|
|
65600
65898
|
});
|
|
65601
65899
|
|
|
65602
65900
|
// packages/core/src/test-data/schema.ts
|
|
65603
|
-
var
|
|
65901
|
+
var id8 = external_exports.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);
|
|
65604
65902
|
var version3 = external_exports.string().regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/, "use an exact version, such as 1.0.0");
|
|
65605
|
-
var header = { schema_version: external_exports.literal(1), id:
|
|
65606
|
-
var VersionRefSchema = external_exports.strictObject({ id:
|
|
65903
|
+
var header = { schema_version: external_exports.literal(1), id: id8, version: version3, title: external_exports.string().min(1) };
|
|
65904
|
+
var VersionRefSchema = external_exports.strictObject({ id: id8, version: version3 });
|
|
65607
65905
|
var seed = SceneSchema.shape.seed.shape;
|
|
65608
65906
|
var slack = seed.slack.unwrap();
|
|
65609
65907
|
var github = seed.github.unwrap();
|
|
@@ -65648,7 +65946,8 @@ var DatasetSchema = external_exports.discriminatedUnion("tool", [
|
|
|
65648
65946
|
external_exports.strictObject({ ...header, kind: external_exports.literal("dataset"), tool: external_exports.literal("asana"), seed: seed["asana"].unwrap() }),
|
|
65649
65947
|
external_exports.strictObject({ ...header, kind: external_exports.literal("dataset"), tool: external_exports.literal("discord"), seed: seed["discord"].unwrap() }),
|
|
65650
65948
|
external_exports.strictObject({ ...header, kind: external_exports.literal("dataset"), tool: external_exports.literal("sentry"), seed: seed["sentry"].unwrap() }),
|
|
65651
|
-
external_exports.strictObject({ ...header, kind: external_exports.literal("dataset"), tool: external_exports.literal("airtable"), seed: seed["airtable"].unwrap() })
|
|
65949
|
+
external_exports.strictObject({ ...header, kind: external_exports.literal("dataset"), tool: external_exports.literal("airtable"), seed: seed["airtable"].unwrap() }),
|
|
65950
|
+
external_exports.strictObject({ ...header, kind: external_exports.literal("dataset"), tool: external_exports.literal("netsuite"), seed: seed["netsuite"].unwrap() })
|
|
65652
65951
|
]);
|
|
65653
65952
|
var ref19 = external_exports.string().regex(new RegExp(REF_USE_PATTERN));
|
|
65654
65953
|
var BindingSchema = external_exports.strictObject({
|
|
@@ -65687,7 +65986,7 @@ var InitialChangeSchema = external_exports.discriminatedUnion("op", [
|
|
|
65687
65986
|
var ScenarioDefinitionSchema = SceneSchema.omit({ seed: true, twins: true, world_rules: true }).extend({
|
|
65688
65987
|
schema_version: external_exports.literal(1),
|
|
65689
65988
|
kind: external_exports.literal("scenario"),
|
|
65690
|
-
id:
|
|
65989
|
+
id: id8,
|
|
65691
65990
|
version: version3,
|
|
65692
65991
|
checks_version: version3,
|
|
65693
65992
|
preset: VersionRefSchema,
|
|
@@ -65956,48 +66255,49 @@ var descriptor = (name3, title, description2, resources, version4, limitations)
|
|
|
65956
66255
|
resources,
|
|
65957
66256
|
version: version4,
|
|
65958
66257
|
transport: "HTTP",
|
|
65959
|
-
fidelity: "client-tested
|
|
66258
|
+
fidelity: "client-tested",
|
|
65960
66259
|
limitations
|
|
65961
66260
|
});
|
|
65962
66261
|
var TOOL_DESCRIPTORS = [
|
|
65963
|
-
descriptor("slack", "Slack", "Channels, messages and threads", ["Channels", "People", "Messages"], "Web API
|
|
65964
|
-
descriptor("github", "GitHub", "Repositories, pull requests and deployments", ["Repositories", "Commits", "Pull requests", "Deployments"], "REST
|
|
65965
|
-
descriptor("datadog", "Datadog", "Monitors, metrics and logs", ["Monitors", "Metrics", "Logs", "Dashboards"], "v1 / v2
|
|
65966
|
-
descriptor("pagerduty", "PagerDuty", "Incidents, on-call and escalation", ["Incidents", "Services", "People", "Schedules"], "REST v2 / Events v2
|
|
65967
|
-
descriptor("linkedin-ads", "LinkedIn Ads", "Campaigns, audiences and performance", ["Ad accounts", "Campaigns", "Creatives", "Performance"], "202610", ["
|
|
65968
|
-
descriptor("salesforce", "Salesforce", "Accounts, contacts and pipeline", ["Accounts", "Contacts", "Leads", "Opportunities", "Campaigns"], "REST v67.0", ["
|
|
65969
|
-
{ ...descriptor("google-ads", "Google Ads", "Search campaigns, ads and reports", ["Customers", "Campaigns", "Budgets", "Ad groups", "Ads", "Performance"], "v26", ["
|
|
65970
|
-
descriptor("chatgpt-ads", "ChatGPT Ads", "Campaigns, creative reviews and insights", ["Ad account", "Campaigns", "Ad groups", "Ads", "Insights"], "Advertiser API v1", ["Single-image chat cards and historical insights; local review model
|
|
65971
|
-
descriptor("hubspot", "HubSpot", "Companies, contacts and deals", ["Companies", "Contacts", "Deals", "Pipelines"], "CRM v3", ["
|
|
65972
|
-
descriptor("ga4", "Google Analytics", "Traffic, campaigns and conversions", ["Properties", "Traffic", "Campaign performance"], "Data API v1beta REST", ["Synthetic historical reports;
|
|
65973
|
-
descriptor("gong", "Gong", "Sales calls and customer conversations", ["Calls", "Transcripts", "People"], "v2
|
|
65974
|
-
descriptor("open-meteo", "Open-Meteo", "Weather forecasts and place lookup", ["Places", "Current conditions", "Hourly", "Daily"], "v1
|
|
65975
|
-
descriptor("google-drive", "Google Drive", "Files, folders, sharing and comments", ["Files", "Folders", "Permissions", "Comments", "Revisions", "Changes"], "Drive API v3
|
|
65976
|
-
descriptor("gmail", "Gmail", "Mailboxes, threads, labels and drafts", ["Messages", "Threads", "Labels", "Drafts", "History"], "v1
|
|
65977
|
-
descriptor("amazon-s3", "Amazon S3", "Buckets, objects and multipart uploads", ["Buckets", "Objects", "Tags", "Multipart uploads"], "REST (SigV4)
|
|
65978
|
-
descriptor("linear", "Linear", "Issues, projects and team workflows", ["Issues", "Comments", "Teams", "Workflow states", "Labels", "Projects", "Users"], "GraphQL
|
|
65979
|
-
descriptor("okta", "Okta", "People, groups, app assignments and the System Log", ["Users", "Groups", "Applications", "App assignments", "System Log"], "Management API v1
|
|
65980
|
-
descriptor("stripe", "Stripe", "Customers, subscriptions, invoices and payments", ["Customers", "Products", "Prices", "Subscriptions", "Invoices", "Invoice items", "Payment intents", "Charges", "Refunds", "Balance"], "API 2026-10-28.endive
|
|
65981
|
-
descriptor("clerk", "Clerk", "Users, organizations, invitations and sessions", ["Users", "Organizations", "Memberships", "Invitations", "Sessions"], "Backend API v1
|
|
65982
|
-
descriptor("better-stack", "Better Stack", "Uptime monitors, heartbeats, incidents and status pages", ["Monitors", "Heartbeats", "Incidents", "On-call", "Status pages"], "Uptime API v2 / v3
|
|
65983
|
-
descriptor("notion", "Notion", "Pages, databases, blocks and comments", ["Pages", "Blocks", "Databases", "Data sources", "Comments", "Users", "Search"], "Notion-Version 2025-09-03
|
|
65984
|
-
descriptor("attio", "Attio", "People, companies, deals, lists, notes and tasks", ["Objects", "Attributes", "Records", "Lists", "Entries", "Notes", "Tasks", "Workspace members"], "REST v2
|
|
65985
|
-
descriptor("dropbox", "Dropbox", "Files, folders, shared links and shared folders", ["Files", "Folders", "Revisions", "Shared links", "Shared folders"], "API v2
|
|
65986
|
-
descriptor("resend", "Resend", "Transactional email, broadcasts, domains, contacts and segments", ["Emails", "Batch", "Broadcasts", "Domains", "Contacts", "Segments"], "REST
|
|
65987
|
-
descriptor("microsoft-word", "Microsoft Word", "Word documents in OneDrive through Microsoft Graph", ["Documents", "Folders", "Versions", "Sharing links", "Invitations"], "Graph v1.0 drive items", ["One OneDrive; Word files are real .docx packages built from paragraphs, with PDF conversion.
|
|
65988
|
-
descriptor("shopify", "Shopify", "Orders, products, inventory, customers, fulfillments and refunds", ["Orders", "Products", "Inventory", "Customers", "Fulfillments", "Refunds", "Locations"], "Admin GraphQL 2026-10
|
|
65989
|
-
descriptor("lob", "Lob", "Letters, postcards and checks by mail, with US address verification", ["Addresses", "Letters", "Postcards", "Checks", "Bank accounts", "Templates", "US verifications"], "Print & Mail API v1
|
|
65990
|
-
descriptor("paypal", "PayPal", "Checkout orders, payments, refunds, subscriptions and transaction reports", ["Orders", "Authorizations", "Captures", "Refunds", "Plans", "Subscriptions", "Transactions", "Balances"], "REST
|
|
65991
|
-
descriptor("jira", "Jira", "Issues, JQL search, comments, transitions and sprints", ["Projects", "Issues", "Comments", "Transitions", "Search", "Users", "Boards", "Sprints"], "REST v3/v2 and agile 1.0
|
|
65992
|
-
descriptor("kalshi", "Kalshi", "Event contracts: markets, order books, orders, positions and settlements", ["Series", "Events", "Markets", "Order books", "Orders", "Fills", "Positions", "Settlements"], "Trade API v2
|
|
65993
|
-
descriptor("intercom", "Intercom", "Inbox conversations, contacts, companies, tags, notes and help center articles", ["Conversations", "Contacts", "Companies", "Tags", "Notes", "Admins", "Teams", "Articles"], "API 2.14
|
|
65994
|
-
descriptor("zendesk", "Zendesk", "Support tickets, replies, people and organizations", ["Tickets", "Comments", "Search", "Users", "Organizations", "Groups", "Macros", "Views"], "Support API v2
|
|
65995
|
-
descriptor("google-calendar", "Google Calendar", "Calendars, events, attendees, recurrence and free/busy", ["Calendar list", "Calendars", "Events", "Instances", "Free/busy", "Settings"], "API v3
|
|
65996
|
-
descriptor("twilio", "Twilio", "SMS, voice calls, Verify codes and phone number lookups", ["Messages", "Calls", "Phone numbers", "Verify", "Lookup", "Balance"], "REST 2010-04-01, Verify v2 and Lookup v2
|
|
65997
|
-
descriptor("asana", "Asana", "Projects, sections, tasks, subtasks and comments", ["Projects", "Sections", "Tasks", "Subtasks", "Comments", "Search", "Users"], "REST API 1.0
|
|
65998
|
-
descriptor("discord", "Discord", "A community server as its bot sees it: channels, messages, threads and reactions", ["Channels", "Messages", "Threads", "Reactions", "Pins", "Members", "Roles", "DMs"], "REST API v10
|
|
65999
|
-
descriptor("sentry", "Sentry", "Issues, error events, triage and releases", ["Organizations", "Projects", "Teams", "Members", "Issues", "Events", "Tags", "Comments", "Releases", "Deploys", "Events query"], "REST API /api/0
|
|
66000
|
-
descriptor("airtable", "Airtable", "Bases of linked tables: records, views, formulas and comments", ["Bases", "Tables", "Fields", "Records", "Views", "Formulas", "Comments"], "Web API v0
|
|
66262
|
+
descriptor("slack", "Slack", "Channels, messages and threads", ["Channels", "People", "Messages"], "Web API", ["Bot-token API."]),
|
|
66263
|
+
descriptor("github", "GitHub", "Repositories, pull requests and deployments", ["Repositories", "Commits", "Pull requests", "Deployments"], "REST", ["Repository and deployment operations."]),
|
|
66264
|
+
descriptor("datadog", "Datadog", "Monitors, metrics and logs", ["Monitors", "Metrics", "Logs", "Dashboards"], "v1 / v2", ["Query grammar and monitor behavior."]),
|
|
66265
|
+
descriptor("pagerduty", "PagerDuty", "Incidents, on-call and escalation", ["Incidents", "Services", "People", "Schedules"], "REST v2 / Events v2", ["Explicit schedules and escalations."]),
|
|
66266
|
+
descriptor("linkedin-ads", "LinkedIn Ads", "Campaigns, audiences and performance", ["Ad accounts", "Campaigns", "Creatives", "Performance"], "202610", ["Single-image campaign operations; historical synthetic reports."]),
|
|
66267
|
+
descriptor("salesforce", "Salesforce", "Accounts, contacts and pipeline", ["Accounts", "Contacts", "Leads", "Opportunities", "Campaigns"], "REST v67.0", ["SOQL and standard object fields."]),
|
|
66268
|
+
{ ...descriptor("google-ads", "Google Ads", "Search campaigns, ads and reports", ["Customers", "Campaigns", "Budgets", "Ad groups", "Ads", "Performance"], "v26", ["Search/manual CPC operations and GAQL grammar."]), transport: "HTTP + gRPC" },
|
|
66269
|
+
descriptor("chatgpt-ads", "ChatGPT Ads", "Campaigns, creative reviews and insights", ["Ad account", "Campaigns", "Ad groups", "Ads", "Insights"], "Advertiser API v1", ["Single-image chat cards and historical insights; local review model."]),
|
|
66270
|
+
descriptor("hubspot", "HubSpot", "Companies, contacts and deals", ["Companies", "Contacts", "Deals", "Pipelines"], "CRM v3", ["CRM objects and search; delayed search indexing."]),
|
|
66271
|
+
descriptor("ga4", "Google Analytics", "Traffic, campaigns and conversions", ["Properties", "Traffic", "Campaign performance"], "Data API v1beta REST", ["Synthetic historical reports; dimensions and metrics."]),
|
|
66272
|
+
descriptor("gong", "Gong", "Sales calls and customer conversations", ["Calls", "Transcripts", "People"], "v2", ["Read-only call and transcript."]),
|
|
66273
|
+
descriptor("open-meteo", "Open-Meteo", "Weather forecasts and place lookup", ["Places", "Current conditions", "Hourly", "Daily"], "v1", ["Synthetic climate per seeded place, moved by the scene clock; metric units; one location per request."]),
|
|
66274
|
+
descriptor("google-drive", "Google Drive", "Files, folders, sharing and comments", ["Files", "Folders", "Permissions", "Comments", "Revisions", "Changes"], "Drive API v3", ["My Drive for one signed-in account.", "Exports Docs, Sheets and Slides as text, Markdown, HTML, CSV or TSV.", "Sharing notifications are recorded in state."]),
|
|
66275
|
+
descriptor("gmail", "Gmail", "Mailboxes, threads, labels and drafts", ["Messages", "Threads", "Labels", "Drafts", "History"], "v1", ["Mail moves only inside the world: mail to a seeded mailbox is delivered, anything else is recorded in Sent.", "Common search operators."]),
|
|
66276
|
+
descriptor("amazon-s3", "Amazon S3", "Buckets, objects and multipart uploads", ["Buckets", "Objects", "Tags", "Multipart uploads"], "REST (SigV4)", ["Path-style addressing: the SDK chooses it for an IP endpoint; set forcePathStyle for a host name.", "One account and access key; per-bucket read-write, read-only or no access stands in for IAM policies.", "Presigned URLs are verified."]),
|
|
66277
|
+
descriptor("linear", "Linear", "Issues, projects and team workflows", ["Issues", "Comments", "Teams", "Workflow states", "Labels", "Projects", "Users"], "GraphQL", ["Linear's published schema.", "Filters cover the common comparators.", "@linear/sdk accepts a plain-http apiUrl only on localhost, 127.0.0.1 or [::1]; elsewhere the endpoint needs TLS."]),
|
|
66278
|
+
descriptor("okta", "Okta", "People, groups, app assignments and the System Log", ["Users", "Groups", "Applications", "App assignments", "System Log"], "Management API v1", ["One org and one SSWS API token owned by a super administrator.", "Lifecycle changes are immediate; activation and reset links are returned.", "The System Log records every change made through the API."]),
|
|
66279
|
+
descriptor("stripe", "Stripe", "Customers, subscriptions, invoices and payments", ["Customers", "Products", "Prices", "Subscriptions", "Invoices", "Invoice items", "Payment intents", "Charges", "Refunds", "Balance"], "API 2026-10-28.endive", ["Test mode only: cards are test tokens (pm_card_visa, pm_card_chargeDeclined\u2026) or seeded cards.", "The SDK takes no base path: point host/port/protocol at the env-scoped host ({env}-stripe.localhost) or prefix STRIPE_API_URL in a custom fetch client."]),
|
|
66280
|
+
descriptor("clerk", "Clerk", "Users, organizations, invitations and sessions", ["Users", "Organizations", "Memberships", "Invitations", "Sessions"], "Backend API v1", ["One application instance with email sign-in.", "Invitations are recorded; pending ones expire on the scene clock.", "Sessions can be listed and revoked."]),
|
|
66281
|
+
descriptor("better-stack", "Better Stack", "Uptime monitors, heartbeats, incidents and status pages", ["Monitors", "Heartbeats", "Incidents", "On-call", "Status pages"], "Uptime API v2 / v3", ["A monitor is down while it has an open incident, and heartbeats recover when pinged.", "No official SDK exists; tested against the documented REST shapes."]),
|
|
66282
|
+
descriptor("notion", "Notion", "Pages, databases, blocks and comments", ["Pages", "Blocks", "Databases", "Data sources", "Comments", "Users", "Search"], "Notion-Version 2025-09-03", ["An internal integration: it sees only pages shared with it, as Notion does.", "Text, heading, list, to-do, toggle, quote, callout, code, divider and bookmark blocks.", "Databases are served as data sources."]),
|
|
66283
|
+
descriptor("attio", "Attio", "People, companies, deals, lists, notes and tasks", ["Objects", "Attributes", "Records", "Lists", "Entries", "Notes", "Tasks", "Workspace members"], "REST v2", ["Standard people, companies and deals objects with typed values and value history.", "Attio publishes no official API client: tested over HTTP against the shapes in its OpenAPI document."]),
|
|
66284
|
+
descriptor("dropbox", "Dropbox", "Files, folders, shared links and shared folders", ["Files", "Folders", "Revisions", "Shared links", "Shared folders"], "API v2", ["The SDK has no base-URL option: give it a fetch that sends https://api.dropboxapi.com and https://content.dropboxapi.com to DROPBOX_API_URL.", "One account; uploads up to 150 MB.", "Sharing records links and members."]),
|
|
66285
|
+
descriptor("resend", "Resend", "Transactional email, broadcasts, domains, contacts and segments", ["Emails", "Batch", "Broadcasts", "Domains", "Contacts", "Segments"], "REST", ["bounced@ and complained@resend.dev give those outcomes, other recipients are delivered two simulated seconds after sending.", "Broadcasts go to the segment\u2019s subscribed contacts as they are when the send is requested.", "Domain verification completes two simulated minutes after it is requested."]),
|
|
66286
|
+
descriptor("microsoft-word", "Microsoft Word", "Word documents in OneDrive through Microsoft Graph", ["Documents", "Folders", "Versions", "Sharing links", "Invitations"], "Graph v1.0 drive items", ["One OneDrive; Word files are real .docx packages built from paragraphs, with PDF conversion.", "The Graph client signs only https Graph hosts and deletes an Authorization header sent elsewhere: set baseUrl to MICROSOFT_GRAPH_API_URL plus / and pass the token as a lower-case authorization header in fetchOptions.headers. Its api() only takes https URLs: follow @odata.nextLink with the part after /v1.0.", "Invitations and sharing are recorded."]),
|
|
66287
|
+
descriptor("shopify", "Shopify", "Orders, products, inventory, customers, fulfillments and refunds", ["Orders", "Products", "Inventory", "Customers", "Fulfillments", "Refunds", "Locations"], "Admin GraphQL 2026-10", ["The endpoint is ${SHOPIFY_API_URL}/admin/api/2026-10/graphql.json with the X-Shopify-Access-Token header. @shopify/admin-api-client always calls https://<store>.myshopify.com: give it a customFetchApi that swaps that origin for SHOPIFY_API_URL."]),
|
|
66288
|
+
descriptor("lob", "Lob", "Letters, postcards and checks by mail, with US address verification", ["Addresses", "Letters", "Postcards", "Checks", "Bank accounts", "Templates", "US verifications"], "Print & Mail API v1", ["USPS tracking follows the scene clock, and mail to an address the postal directory does not know, or a vacant one, comes back.", "Pass LOB_API_URL (it ends in /v1) as the SDK Configuration basePath and LOB_API_KEY as its username. Proof links name https://lob-assets.com as Lob\u2019s do (the SDK rejects any other host); fetch them under LOB_ASSETS_URL instead.", "US verification consults the world\u2019s postal directory. File URLs are recorded."]),
|
|
66289
|
+
descriptor("paypal", "PayPal", "Checkout orders, payments, refunds, subscriptions and transaction reports", ["Orders", "Authorizations", "Captures", "Refunds", "Plans", "Subscriptions", "Transactions", "Balances"], "REST", ["Exchange PAYPAL_CLIENT_ID and PAYPAL_CLIENT_SECRET at ${PAYPAL_API_URL}/v1/oauth2/token. The server SDK only knows PayPal\u2019s own hosts: call PAYPAL_API_URL over HTTP, or give the SDK an axios adapter (unstable_httpClientOptions) that swaps https://api-m.sandbox.paypal.com for it.", "Payers approve orders and subscriptions in their browser: new ones wait for approval, seeded approved orders can be captured."]),
|
|
66290
|
+
descriptor("jira", "Jira", "Issues, JQL search, comments, transitions and sprints", ["Projects", "Issues", "Comments", "Transitions", "Search", "Users", "Boards", "Sprints"], "REST v3/v2 and agile 1.0", ["Atlassian publishes no official JavaScript client: call ${JIRA_BASE_URL}/rest/api/3/... with HTTP Basic (JIRA_EMAIL and JIRA_API_TOKEN). /rest/api/3/search is gone, as on live Jira; /search/jql returns only issue ids unless fields are requested.", "Team-managed projects with the simplified workflow (To Do, In Progress, In Review, Done)."]),
|
|
66291
|
+
descriptor("kalshi", "Kalshi", "Event contracts: markets, order books, orders, positions and settlements", ["Series", "Events", "Markets", "Order books", "Orders", "Fills", "Positions", "Settlements"], "Trade API v2", ["Pass KALSHI_API_URL (it ends in /trade-api/v2) as the SDK basePath, KALSHI_API_KEY_ID as apiKey and KALSHI_PRIVATE_KEY as privateKeyPem: requests are signed with RSA-PSS as on Kalshi.", "Orders trade against other traders\u2019 resting bids seeded with the scene, at the resting price, with Kalshi\u2019s fee; nobody else trades unless the scene says so, and no money moves.", "Primary subaccount."]),
|
|
66292
|
+
descriptor("intercom", "Intercom", "Inbox conversations, contacts, companies, tags, notes and help center articles", ["Conversations", "Contacts", "Companies", "Tags", "Notes", "Admins", "Teams", "Articles"], "API 2.14", ["Point the official intercom-client at INTERCOM_API_URL with its baseUrl option. Gaps answer 400 in Intercom\u2019s error shape (marked as gaps), since the client retries every 5xx."]),
|
|
66293
|
+
descriptor("zendesk", "Zendesk", "Support tickets, replies, people and organizations", ["Tickets", "Comments", "Search", "Users", "Organizations", "Groups", "Macros", "Views"], "Support API v2", ["Send ZENDESK_EMAIL/token:ZENDESK_API_TOKEN as Basic auth to ZENDESK_API_URL (it ends in /api/v2; paths take an optional .json). Zendesk publishes no official Node client; the tests use the documented HTTP shapes.", "Replies are recorded.", "Search covers the common ticket, user and organization properties."]),
|
|
66294
|
+
descriptor("google-calendar", "Google Calendar", "Calendars, events, attendees, recurrence and free/busy", ["Calendar list", "Calendars", "Events", "Instances", "Free/busy", "Settings"], "API v3", ["Give the official client GOOGLE_CALENDAR_API_URL as the per-request rootUrl (a global rootUrl keeps only the origin). Gaps answer 400 in Google\u2019s error shape (marked as gaps), since the client retries 5xx responses."]),
|
|
66295
|
+
descriptor("twilio", "Twilio", "SMS, voice calls, Verify codes and phone number lookups", ["Messages", "Calls", "Phone numbers", "Verify", "Lookup", "Balance"], "REST 2010-04-01, Verify v2 and Lookup v2", ["The SDK always calls https://api.twilio.com, verify.twilio.com and lookups.twilio.com: give twilio() an httpClient (a RequestClient subclass) that sends https://api.twilio.com to TWILIO_API_URL and https://verify.twilio.com or https://lookups.twilio.com to TWILIO_API_URL plus /verify or /lookups.", "SMS status follows the scene clock and the world\u2019s phone directory (landlines and unreachable phones come back undelivered, opted-out numbers are refused); status callbacks are recorded; Verify codes are in the ground truth.", "SMS and voice; the account SID and auth token."]),
|
|
66296
|
+
descriptor("asana", "Asana", "Projects, sections, tasks, subtasks and comments", ["Projects", "Sections", "Tasks", "Subtasks", "Comments", "Search", "Users"], "REST API 1.0", ['Send ASANA_ACCESS_TOKEN as a Bearer token to ASANA_API_URL (it ends in /api/1.0); bodies are wrapped in {"data": \u2026}. Asana publishes an official Node client (asana); these tests use the documented HTTP shapes.', "Lists return compact records unless opt_fields asks for more, and page with limit and offset; task search covers text, people, projects, sections, completion and dates."]),
|
|
66297
|
+
descriptor("discord", "Discord", "A community server as its bot sees it: channels, messages, threads and reactions", ["Channels", "Messages", "Threads", "Reactions", "Pins", "Members", "Roles", "DMs"], "REST API v10", ["Send Authorization: Bot DISCORD_BOT_TOKEN to DISCORD_API_URL (it ends in /api/v10). Discord publishes no official Node client; the tests use the documented HTTP API.", "What the bot may read and send follows its role and each channel\u2019s permission overwrites (Missing Access, Missing Permissions); IDs are snowflakes on the scene clock.", "REST."]),
|
|
66298
|
+
descriptor("sentry", "Sentry", "Issues, error events, triage and releases", ["Organizations", "Projects", "Teams", "Members", "Issues", "Events", "Tags", "Comments", "Releases", "Deploys", "Events query"], "REST API /api/0", ['Call ${SENTRY_API_URL}/api/0/... with Authorization: Bearer SENTRY_AUTH_TOKEN, using the shapes in Sentry\u2019s API docs (Sentry\u2019s generated API client is source-available, so the tests use HTTP). Lists page through the Link header (rel="next", results="true", cursor).', "Issue search covers Sentry\u2019s syntax for status, assignment, level, priority, releases, environments, times, users, error fields and tags; the organization default is is:unresolved issue.priority:[high, medium] over 14 days.", "Client keys point their DSNs at this replica."]),
|
|
66299
|
+
descriptor("airtable", "Airtable", "Bases of linked tables: records, views, formulas and comments", ["Bases", "Tables", "Fields", "Records", "Views", "Formulas", "Comments"], "Web API v0", ["Send AIRTABLE_API_KEY (a personal access token) as a Bearer token to AIRTABLE_API_URL (it ends in /v0). The official airtable.js client reads AIRTABLE_API_KEY and AIRTABLE_ENDPOINT_URL by itself; these tests use the documented HTTP API.", "filterByFormula, view filters and formula, count, lookup and rollup fields run on a formula engine; links stay in step on both sides; TODAY() and NOW() follow the scene clock."]),
|
|
66300
|
+
descriptor("netsuite", "NetSuite", "Order to cash and procure to pay: customers, vendors, invoices, payments, bills and SuiteQL", ["Customers", "Vendors", "Items", "Sales orders", "Invoices", "Credit memos", "Customer payments", "Vendor bills", "Bill payments", "Journal entries", "SuiteQL"], "SuiteTalk REST record v1 and SuiteQL", ["Point the client at NETSUITE_API_URL instead of https://{account}.suitetalk.api.netsuite.com. Send record requests to NETSUITE_RECORD_URL and SuiteQL queries to NETSUITE_SUITEQL_URL.", "Sign OAuth 1.0 TBA requests with HMAC-SHA256, using NETSUITE_ACCOUNT_ID as the realm and NETSUITE_CONSUMER_KEY, NETSUITE_CONSUMER_SECRET, NETSUITE_TOKEN_ID and NETSUITE_TOKEN_SECRET; or send NETSUITE_ACCESS_TOKEN as a Bearer token.", "POST SuiteQL queries with Prefer: transient and a JSON body containing q. Record creates return 204 with a Location header."])
|
|
66001
66301
|
];
|
|
66002
66302
|
var starterSeeds = {
|
|
66003
66303
|
slack: slackStarterSeed,
|
|
@@ -66037,7 +66337,8 @@ var starterSeeds = {
|
|
|
66037
66337
|
"asana": asanaStarterSeed(),
|
|
66038
66338
|
"discord": discordStarterSeed(),
|
|
66039
66339
|
sentry: sentryStarterSeed,
|
|
66040
|
-
"airtable": airtableStarterSeed()
|
|
66340
|
+
"airtable": airtableStarterSeed(),
|
|
66341
|
+
netsuite: NetsuiteSeedSchema.parse(netsuiteStarterSeed)
|
|
66041
66342
|
};
|
|
66042
66343
|
|
|
66043
66344
|
// packages/core/src/sandbox.ts
|