@settlemint/dalp-cli 2.1.7-main.23396902236 → 2.1.7-main.23399598269
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dalp.js +995 -866
- package/package.json +3 -3
package/dist/dalp.js
CHANGED
|
@@ -31666,23 +31666,23 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
31666
31666
|
var { SCHEMES, getSchemeHandler } = require_schemes();
|
|
31667
31667
|
function normalize(uri, options) {
|
|
31668
31668
|
if (typeof uri === "string") {
|
|
31669
|
-
uri = serialize(
|
|
31669
|
+
uri = serialize(parse8(uri, options), options);
|
|
31670
31670
|
} else if (typeof uri === "object") {
|
|
31671
|
-
uri =
|
|
31671
|
+
uri = parse8(serialize(uri, options), options);
|
|
31672
31672
|
}
|
|
31673
31673
|
return uri;
|
|
31674
31674
|
}
|
|
31675
31675
|
function resolve(baseURI, relativeURI, options) {
|
|
31676
31676
|
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
31677
|
-
const resolved = resolveComponent(
|
|
31677
|
+
const resolved = resolveComponent(parse8(baseURI, schemelessOptions), parse8(relativeURI, schemelessOptions), schemelessOptions, true);
|
|
31678
31678
|
schemelessOptions.skipEscape = true;
|
|
31679
31679
|
return serialize(resolved, schemelessOptions);
|
|
31680
31680
|
}
|
|
31681
31681
|
function resolveComponent(base, relative, options, skipNormalization) {
|
|
31682
31682
|
const target = {};
|
|
31683
31683
|
if (!skipNormalization) {
|
|
31684
|
-
base =
|
|
31685
|
-
relative =
|
|
31684
|
+
base = parse8(serialize(base, options), options);
|
|
31685
|
+
relative = parse8(serialize(relative, options), options);
|
|
31686
31686
|
}
|
|
31687
31687
|
options = options || {};
|
|
31688
31688
|
if (!options.tolerant && relative.scheme) {
|
|
@@ -31734,13 +31734,13 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
31734
31734
|
function equal(uriA, uriB, options) {
|
|
31735
31735
|
if (typeof uriA === "string") {
|
|
31736
31736
|
uriA = unescape(uriA);
|
|
31737
|
-
uriA = serialize(normalizeComponentEncoding(
|
|
31737
|
+
uriA = serialize(normalizeComponentEncoding(parse8(uriA, options), true), { ...options, skipEscape: true });
|
|
31738
31738
|
} else if (typeof uriA === "object") {
|
|
31739
31739
|
uriA = serialize(normalizeComponentEncoding(uriA, true), { ...options, skipEscape: true });
|
|
31740
31740
|
}
|
|
31741
31741
|
if (typeof uriB === "string") {
|
|
31742
31742
|
uriB = unescape(uriB);
|
|
31743
|
-
uriB = serialize(normalizeComponentEncoding(
|
|
31743
|
+
uriB = serialize(normalizeComponentEncoding(parse8(uriB, options), true), { ...options, skipEscape: true });
|
|
31744
31744
|
} else if (typeof uriB === "object") {
|
|
31745
31745
|
uriB = serialize(normalizeComponentEncoding(uriB, true), { ...options, skipEscape: true });
|
|
31746
31746
|
}
|
|
@@ -31810,7 +31810,7 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
31810
31810
|
return uriTokens.join("");
|
|
31811
31811
|
}
|
|
31812
31812
|
var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
|
|
31813
|
-
function
|
|
31813
|
+
function parse8(uri, opts) {
|
|
31814
31814
|
const options = Object.assign({}, opts);
|
|
31815
31815
|
const parsed = {
|
|
31816
31816
|
scheme: undefined,
|
|
@@ -31904,7 +31904,7 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
31904
31904
|
resolveComponent,
|
|
31905
31905
|
equal,
|
|
31906
31906
|
serialize,
|
|
31907
|
-
parse:
|
|
31907
|
+
parse: parse8
|
|
31908
31908
|
};
|
|
31909
31909
|
module.exports = fastUri;
|
|
31910
31910
|
module.exports.default = fastUri;
|
|
@@ -36363,8 +36363,8 @@ var require_url = __commonJS((exports) => {
|
|
|
36363
36363
|
[/#/g, "%23"]
|
|
36364
36364
|
];
|
|
36365
36365
|
var urlDecodePatterns = [/%23/g, "#", /%24/g, "$", /%26/g, "&", /%2C/g, ",", /%40/g, "@"];
|
|
36366
|
-
var
|
|
36367
|
-
exports.parse =
|
|
36366
|
+
var parse8 = (u) => new URL(u);
|
|
36367
|
+
exports.parse = parse8;
|
|
36368
36368
|
function resolve(from, to) {
|
|
36369
36369
|
const fromUrl = new URL((0, convert_path_to_posix_1.default)(from), "https://aaa.nonexistanturl.com");
|
|
36370
36370
|
const resolvedUrl = new URL((0, convert_path_to_posix_1.default)(to), fromUrl);
|
|
@@ -37459,7 +37459,7 @@ var require_parse = __commonJS((exports) => {
|
|
|
37459
37459
|
var url2 = __importStar(require_url());
|
|
37460
37460
|
var plugins = __importStar(require_plugins());
|
|
37461
37461
|
var errors_js_1 = require_errors3();
|
|
37462
|
-
async function
|
|
37462
|
+
async function parse8(path, $refs, options) {
|
|
37463
37463
|
const hashIndex = path.indexOf("#");
|
|
37464
37464
|
let hash2 = "";
|
|
37465
37465
|
if (hashIndex >= 0) {
|
|
@@ -37535,7 +37535,7 @@ Parsed value is empty`);
|
|
|
37535
37535
|
function isEmpty(value) {
|
|
37536
37536
|
return value === undefined || typeof value === "object" && Object.keys(value).length === 0 || typeof value === "string" && value.trim().length === 0 || Buffer.isBuffer(value) && value.length === 0;
|
|
37537
37537
|
}
|
|
37538
|
-
exports.default =
|
|
37538
|
+
exports.default = parse8;
|
|
37539
37539
|
});
|
|
37540
37540
|
|
|
37541
37541
|
// ../../node_modules/.bun/@apidevtools+json-schema-ref-parser@14.2.1+851ea6eaa318e35d/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/json.js
|
|
@@ -41958,7 +41958,7 @@ var require_api = __commonJS((exports) => {
|
|
|
41958
41958
|
return getStringValue(token);
|
|
41959
41959
|
}
|
|
41960
41960
|
}
|
|
41961
|
-
function
|
|
41961
|
+
function parse8(text, options) {
|
|
41962
41962
|
options = Object.freeze({
|
|
41963
41963
|
...DEFAULT_OPTIONS$1,
|
|
41964
41964
|
...options
|
|
@@ -42212,7 +42212,7 @@ var require_api = __commonJS((exports) => {
|
|
|
42212
42212
|
}
|
|
42213
42213
|
exports.evaluate = evaluate;
|
|
42214
42214
|
exports.iterator = iterator;
|
|
42215
|
-
exports.parse =
|
|
42215
|
+
exports.parse = parse8;
|
|
42216
42216
|
exports.print = print;
|
|
42217
42217
|
exports.tokenize = tokenize;
|
|
42218
42218
|
exports.traverse = traverse;
|
|
@@ -47834,10 +47834,10 @@ var init_dist = __esm(() => {
|
|
|
47834
47834
|
init_string2();
|
|
47835
47835
|
});
|
|
47836
47836
|
|
|
47837
|
-
// ../../node_modules/.bun/incur@0.3.
|
|
47837
|
+
// ../../node_modules/.bun/incur@0.3.5+ea8cb298c1911149/node_modules/incur/dist/index.js
|
|
47838
47838
|
init_zod();
|
|
47839
47839
|
|
|
47840
|
-
// ../../node_modules/.bun/incur@0.3.
|
|
47840
|
+
// ../../node_modules/.bun/incur@0.3.5+ea8cb298c1911149/node_modules/incur/dist/Cli.js
|
|
47841
47841
|
var exports_Cli = {};
|
|
47842
47842
|
__export(exports_Cli, {
|
|
47843
47843
|
toCommands: () => toCommands,
|
|
@@ -47946,7 +47946,7 @@ function extractSegmentPart(segment, segmentTokenStart, segmentTokenCount, targe
|
|
|
47946
47946
|
return segment.slice(charStart, charEnd);
|
|
47947
47947
|
}
|
|
47948
47948
|
|
|
47949
|
-
// ../../node_modules/.bun/incur@0.3.
|
|
47949
|
+
// ../../node_modules/.bun/incur@0.3.5+ea8cb298c1911149/node_modules/incur/dist/Completions.js
|
|
47950
47950
|
function register(shell, name) {
|
|
47951
47951
|
switch (shell) {
|
|
47952
47952
|
case "bash":
|
|
@@ -48171,7 +48171,7 @@ let _incur_complete_${id} = {|spans|
|
|
|
48171
48171
|
}`;
|
|
48172
48172
|
}
|
|
48173
48173
|
|
|
48174
|
-
// ../../node_modules/.bun/incur@0.3.
|
|
48174
|
+
// ../../node_modules/.bun/incur@0.3.5+ea8cb298c1911149/node_modules/incur/dist/Errors.js
|
|
48175
48175
|
class BaseError extends Error {
|
|
48176
48176
|
name = "Incur.BaseError";
|
|
48177
48177
|
shortMessage;
|
|
@@ -48236,7 +48236,7 @@ function walk(error48, fn) {
|
|
|
48236
48236
|
return current;
|
|
48237
48237
|
}
|
|
48238
48238
|
|
|
48239
|
-
// ../../node_modules/.bun/incur@0.3.
|
|
48239
|
+
// ../../node_modules/.bun/incur@0.3.5+ea8cb298c1911149/node_modules/incur/dist/Fetch.js
|
|
48240
48240
|
var reservedFlags = new Set(["method", "body", "data", "header"]);
|
|
48241
48241
|
var reservedShort = { X: "method", d: "data", H: "header" };
|
|
48242
48242
|
function parseArgv(argv) {
|
|
@@ -48371,7 +48371,7 @@ async function parseResponse(response) {
|
|
|
48371
48371
|
};
|
|
48372
48372
|
}
|
|
48373
48373
|
|
|
48374
|
-
// ../../node_modules/.bun/incur@0.3.
|
|
48374
|
+
// ../../node_modules/.bun/incur@0.3.5+ea8cb298c1911149/node_modules/incur/dist/Filter.js
|
|
48375
48375
|
function parse5(expression) {
|
|
48376
48376
|
const paths = [];
|
|
48377
48377
|
const tokens = [];
|
|
@@ -49004,7 +49004,7 @@ var $stringify = publicApi.stringify;
|
|
|
49004
49004
|
var $visit = visit.visit;
|
|
49005
49005
|
var $visitAsync = visit.visitAsync;
|
|
49006
49006
|
|
|
49007
|
-
// ../../node_modules/.bun/incur@0.3.
|
|
49007
|
+
// ../../node_modules/.bun/incur@0.3.5+ea8cb298c1911149/node_modules/incur/dist/Formatter.js
|
|
49008
49008
|
function format2(value, fmt = "toon") {
|
|
49009
49009
|
if (value == null)
|
|
49010
49010
|
return "";
|
|
@@ -49100,8 +49100,453 @@ ${String(val)}`;
|
|
|
49100
49100
|
return kvTable(obj);
|
|
49101
49101
|
}
|
|
49102
49102
|
|
|
49103
|
-
// ../../node_modules/.bun/incur@0.3.
|
|
49103
|
+
// ../../node_modules/.bun/incur@0.3.5+ea8cb298c1911149/node_modules/incur/dist/Help.js
|
|
49104
49104
|
init_zod();
|
|
49105
|
+
|
|
49106
|
+
// ../../node_modules/.bun/incur@0.3.5+ea8cb298c1911149/node_modules/incur/dist/internal/command.js
|
|
49107
|
+
init_zod();
|
|
49108
|
+
|
|
49109
|
+
// ../../node_modules/.bun/incur@0.3.5+ea8cb298c1911149/node_modules/incur/dist/Parser.js
|
|
49110
|
+
function parse6(argv, options = {}) {
|
|
49111
|
+
const { args: argsSchema, options: optionsSchema, alias } = options;
|
|
49112
|
+
const aliasToName = new Map;
|
|
49113
|
+
if (alias)
|
|
49114
|
+
for (const [name, short] of Object.entries(alias))
|
|
49115
|
+
aliasToName.set(short, name);
|
|
49116
|
+
const knownOptions = new Set(optionsSchema ? Object.keys(optionsSchema.shape) : []);
|
|
49117
|
+
const kebabToCamel = new Map;
|
|
49118
|
+
for (const name of knownOptions) {
|
|
49119
|
+
const kebab = name.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`);
|
|
49120
|
+
if (kebab !== name)
|
|
49121
|
+
kebabToCamel.set(kebab, name);
|
|
49122
|
+
}
|
|
49123
|
+
const positionals = [];
|
|
49124
|
+
const rawOptions = {};
|
|
49125
|
+
let i = 0;
|
|
49126
|
+
while (i < argv.length) {
|
|
49127
|
+
const token = argv[i];
|
|
49128
|
+
if (token.startsWith("--no-") && token.length > 5) {
|
|
49129
|
+
const raw = token.slice(5);
|
|
49130
|
+
const name = kebabToCamel.get(raw) ?? raw;
|
|
49131
|
+
if (!knownOptions.has(name))
|
|
49132
|
+
throw new ParseError({ message: `Unknown flag: ${token}` });
|
|
49133
|
+
rawOptions[name] = false;
|
|
49134
|
+
i++;
|
|
49135
|
+
} else if (token.startsWith("--")) {
|
|
49136
|
+
const eqIdx = token.indexOf("=");
|
|
49137
|
+
if (eqIdx !== -1) {
|
|
49138
|
+
const raw = token.slice(2, eqIdx);
|
|
49139
|
+
const name = kebabToCamel.get(raw) ?? raw;
|
|
49140
|
+
if (!knownOptions.has(name))
|
|
49141
|
+
throw new ParseError({ message: `Unknown flag: --${raw}` });
|
|
49142
|
+
setOption(rawOptions, name, token.slice(eqIdx + 1), optionsSchema);
|
|
49143
|
+
i++;
|
|
49144
|
+
} else {
|
|
49145
|
+
const raw = token.slice(2);
|
|
49146
|
+
const name = kebabToCamel.get(raw) ?? raw;
|
|
49147
|
+
if (!knownOptions.has(name))
|
|
49148
|
+
throw new ParseError({ message: `Unknown flag: ${token}` });
|
|
49149
|
+
if (isCountOption(name, optionsSchema)) {
|
|
49150
|
+
rawOptions[name] = (rawOptions[name] ?? 0) + 1;
|
|
49151
|
+
i++;
|
|
49152
|
+
} else if (isBooleanOption2(name, optionsSchema)) {
|
|
49153
|
+
rawOptions[name] = true;
|
|
49154
|
+
i++;
|
|
49155
|
+
} else {
|
|
49156
|
+
const value = argv[i + 1];
|
|
49157
|
+
if (value === undefined)
|
|
49158
|
+
throw new ParseError({ message: `Missing value for flag: ${token}` });
|
|
49159
|
+
setOption(rawOptions, name, value, optionsSchema);
|
|
49160
|
+
i += 2;
|
|
49161
|
+
}
|
|
49162
|
+
}
|
|
49163
|
+
} else if (token.startsWith("-") && !token.startsWith("--") && token.length >= 2) {
|
|
49164
|
+
const chars = token.slice(1);
|
|
49165
|
+
for (let j = 0;j < chars.length; j++) {
|
|
49166
|
+
const short = chars[j];
|
|
49167
|
+
const name = aliasToName.get(short);
|
|
49168
|
+
if (!name)
|
|
49169
|
+
throw new ParseError({ message: `Unknown flag: -${short}` });
|
|
49170
|
+
const isLast = j === chars.length - 1;
|
|
49171
|
+
if (!isLast) {
|
|
49172
|
+
if (isCountOption(name, optionsSchema)) {
|
|
49173
|
+
rawOptions[name] = (rawOptions[name] ?? 0) + 1;
|
|
49174
|
+
} else if (isBooleanOption2(name, optionsSchema)) {
|
|
49175
|
+
rawOptions[name] = true;
|
|
49176
|
+
} else {
|
|
49177
|
+
throw new ParseError({
|
|
49178
|
+
message: `Non-boolean flag -${short} must be last in a stacked alias`
|
|
49179
|
+
});
|
|
49180
|
+
}
|
|
49181
|
+
} else if (isCountOption(name, optionsSchema)) {
|
|
49182
|
+
rawOptions[name] = (rawOptions[name] ?? 0) + 1;
|
|
49183
|
+
} else if (isBooleanOption2(name, optionsSchema)) {
|
|
49184
|
+
rawOptions[name] = true;
|
|
49185
|
+
} else {
|
|
49186
|
+
const value = argv[i + 1];
|
|
49187
|
+
if (value === undefined)
|
|
49188
|
+
throw new ParseError({ message: `Missing value for flag: -${short}` });
|
|
49189
|
+
setOption(rawOptions, name, value, optionsSchema);
|
|
49190
|
+
i++;
|
|
49191
|
+
}
|
|
49192
|
+
}
|
|
49193
|
+
i++;
|
|
49194
|
+
} else {
|
|
49195
|
+
positionals.push(token);
|
|
49196
|
+
i++;
|
|
49197
|
+
}
|
|
49198
|
+
}
|
|
49199
|
+
const rawArgs = {};
|
|
49200
|
+
if (argsSchema) {
|
|
49201
|
+
const keys = Object.keys(argsSchema.shape);
|
|
49202
|
+
for (let j = 0;j < keys.length; j++) {
|
|
49203
|
+
const key = keys[j];
|
|
49204
|
+
if (positionals[j] !== undefined) {
|
|
49205
|
+
rawArgs[key] = positionals[j];
|
|
49206
|
+
}
|
|
49207
|
+
}
|
|
49208
|
+
}
|
|
49209
|
+
const args = argsSchema ? zodParse(argsSchema, rawArgs) : {};
|
|
49210
|
+
if (optionsSchema) {
|
|
49211
|
+
for (const [name, value] of Object.entries(rawOptions)) {
|
|
49212
|
+
rawOptions[name] = coerce(value, name, optionsSchema);
|
|
49213
|
+
}
|
|
49214
|
+
}
|
|
49215
|
+
const parsedOptions = optionsSchema ? zodParse(optionsSchema, rawOptions) : {};
|
|
49216
|
+
return { args, options: parsedOptions };
|
|
49217
|
+
}
|
|
49218
|
+
function unwrap2(schema) {
|
|
49219
|
+
let s = schema;
|
|
49220
|
+
while (s.def?.innerType)
|
|
49221
|
+
s = s.def.innerType;
|
|
49222
|
+
return s;
|
|
49223
|
+
}
|
|
49224
|
+
function isBooleanOption2(name, schema) {
|
|
49225
|
+
if (!schema)
|
|
49226
|
+
return false;
|
|
49227
|
+
const field = schema.shape[name];
|
|
49228
|
+
if (!field)
|
|
49229
|
+
return false;
|
|
49230
|
+
return unwrap2(field).constructor.name === "ZodBoolean";
|
|
49231
|
+
}
|
|
49232
|
+
function isCountOption(name, schema) {
|
|
49233
|
+
if (!schema)
|
|
49234
|
+
return false;
|
|
49235
|
+
const field = schema.shape[name];
|
|
49236
|
+
if (!field)
|
|
49237
|
+
return false;
|
|
49238
|
+
return typeof field.meta === "function" && field.meta()?.count === true;
|
|
49239
|
+
}
|
|
49240
|
+
function isArrayOption(name, schema) {
|
|
49241
|
+
if (!schema)
|
|
49242
|
+
return false;
|
|
49243
|
+
const field = schema.shape[name];
|
|
49244
|
+
if (!field)
|
|
49245
|
+
return false;
|
|
49246
|
+
return unwrap2(field).constructor.name === "ZodArray";
|
|
49247
|
+
}
|
|
49248
|
+
function setOption(raw, name, value, schema) {
|
|
49249
|
+
if (isArrayOption(name, schema)) {
|
|
49250
|
+
const existing = raw[name];
|
|
49251
|
+
if (Array.isArray(existing)) {
|
|
49252
|
+
existing.push(value);
|
|
49253
|
+
} else {
|
|
49254
|
+
raw[name] = [value];
|
|
49255
|
+
}
|
|
49256
|
+
} else {
|
|
49257
|
+
raw[name] = value;
|
|
49258
|
+
}
|
|
49259
|
+
}
|
|
49260
|
+
function zodParse(schema, data) {
|
|
49261
|
+
try {
|
|
49262
|
+
return schema.parse(data);
|
|
49263
|
+
} catch (err) {
|
|
49264
|
+
const issues = err?.issues ?? err?.error?.issues ?? [];
|
|
49265
|
+
const fieldErrors = issues.map((issue2) => ({
|
|
49266
|
+
path: (issue2.path ?? []).join("."),
|
|
49267
|
+
expected: issue2.expected ?? "",
|
|
49268
|
+
received: issue2.received ?? "",
|
|
49269
|
+
message: issue2.message ?? ""
|
|
49270
|
+
}));
|
|
49271
|
+
throw new ValidationError({
|
|
49272
|
+
message: issues.map((i) => i.message).join("; ") || "Validation failed",
|
|
49273
|
+
fieldErrors,
|
|
49274
|
+
cause: err instanceof Error ? err : undefined
|
|
49275
|
+
});
|
|
49276
|
+
}
|
|
49277
|
+
}
|
|
49278
|
+
function parseEnv(schema, source = defaultEnvSource()) {
|
|
49279
|
+
const raw = {};
|
|
49280
|
+
for (const [key, field] of Object.entries(schema.shape)) {
|
|
49281
|
+
const value = source[key];
|
|
49282
|
+
if (value !== undefined)
|
|
49283
|
+
raw[key] = coerceEnv(value, field);
|
|
49284
|
+
}
|
|
49285
|
+
return zodParse(schema, raw);
|
|
49286
|
+
}
|
|
49287
|
+
function coerceEnv(value, field) {
|
|
49288
|
+
const inner = unwrap2(field);
|
|
49289
|
+
const typeName = inner.constructor.name;
|
|
49290
|
+
if (typeName === "ZodNumber")
|
|
49291
|
+
return Number(value);
|
|
49292
|
+
if (typeName === "ZodBoolean")
|
|
49293
|
+
return value === "true" || value === "1";
|
|
49294
|
+
return value;
|
|
49295
|
+
}
|
|
49296
|
+
function coerce(value, name, schema) {
|
|
49297
|
+
const field = schema.shape[name];
|
|
49298
|
+
if (!field)
|
|
49299
|
+
return value;
|
|
49300
|
+
const inner = unwrap2(field);
|
|
49301
|
+
const typeName = inner.constructor.name;
|
|
49302
|
+
if (typeName === "ZodNumber" && typeof value === "string") {
|
|
49303
|
+
return Number(value);
|
|
49304
|
+
}
|
|
49305
|
+
if (typeName === "ZodBoolean" && typeof value === "string") {
|
|
49306
|
+
return value === "true";
|
|
49307
|
+
}
|
|
49308
|
+
return value;
|
|
49309
|
+
}
|
|
49310
|
+
function defaultEnvSource() {
|
|
49311
|
+
if (typeof globalThis !== "undefined") {
|
|
49312
|
+
const g = globalThis;
|
|
49313
|
+
if (g.process?.env)
|
|
49314
|
+
return g.process.env;
|
|
49315
|
+
if (g.Deno?.env)
|
|
49316
|
+
return new Proxy({}, { get: (_, key) => g.Deno.env.get(key) });
|
|
49317
|
+
}
|
|
49318
|
+
return {};
|
|
49319
|
+
}
|
|
49320
|
+
|
|
49321
|
+
// ../../node_modules/.bun/incur@0.3.5+ea8cb298c1911149/node_modules/incur/dist/internal/command.js
|
|
49322
|
+
var sentinel = Symbol.for("incur.sentinel");
|
|
49323
|
+
async function execute(command, options) {
|
|
49324
|
+
const { argv, inputOptions, agent, format: format3, formatExplicit, name, path, version: version2, envSource = process.env, env: envSchema, vars: varsSchema, middlewares = [] } = options;
|
|
49325
|
+
const parseMode = options.parseMode ?? "argv";
|
|
49326
|
+
const varsMap = varsSchema ? varsSchema.parse({}) : {};
|
|
49327
|
+
let result;
|
|
49328
|
+
let streamConsumed;
|
|
49329
|
+
let resolveStreamConsumed;
|
|
49330
|
+
let resolveResultReady;
|
|
49331
|
+
const resultReady = new Promise((r) => {
|
|
49332
|
+
resolveResultReady = r;
|
|
49333
|
+
});
|
|
49334
|
+
const runCommand = async () => {
|
|
49335
|
+
let args;
|
|
49336
|
+
let parsedOptions;
|
|
49337
|
+
if (parseMode === "argv") {
|
|
49338
|
+
const parsed = parse6(argv, {
|
|
49339
|
+
alias: command.alias,
|
|
49340
|
+
args: command.args,
|
|
49341
|
+
options: command.options
|
|
49342
|
+
});
|
|
49343
|
+
args = parsed.args;
|
|
49344
|
+
parsedOptions = parsed.options;
|
|
49345
|
+
} else if (parseMode === "split") {
|
|
49346
|
+
const parsed = parse6(argv, { args: command.args });
|
|
49347
|
+
args = parsed.args;
|
|
49348
|
+
parsedOptions = command.options ? command.options.parse(inputOptions) : {};
|
|
49349
|
+
} else {
|
|
49350
|
+
const split = splitParams(inputOptions, command);
|
|
49351
|
+
args = command.args ? command.args.parse(split.args) : {};
|
|
49352
|
+
parsedOptions = command.options ? command.options.parse(split.options) : {};
|
|
49353
|
+
}
|
|
49354
|
+
const commandEnv = command.env ? parseEnv(command.env, envSource) : {};
|
|
49355
|
+
const okFn = (data, meta3 = {}) => ({ [sentinel]: "ok", data, cta: meta3.cta });
|
|
49356
|
+
const errorFn = (opts) => ({ [sentinel]: "error", ...opts });
|
|
49357
|
+
const raw = command.run({
|
|
49358
|
+
agent,
|
|
49359
|
+
args,
|
|
49360
|
+
env: commandEnv,
|
|
49361
|
+
error: errorFn,
|
|
49362
|
+
format: format3,
|
|
49363
|
+
formatExplicit,
|
|
49364
|
+
name,
|
|
49365
|
+
ok: okFn,
|
|
49366
|
+
options: parsedOptions,
|
|
49367
|
+
var: varsMap,
|
|
49368
|
+
version: version2
|
|
49369
|
+
});
|
|
49370
|
+
if (isAsyncGenerator(raw)) {
|
|
49371
|
+
if (middlewares.length > 0) {
|
|
49372
|
+
streamConsumed = new Promise((r) => {
|
|
49373
|
+
resolveStreamConsumed = r;
|
|
49374
|
+
});
|
|
49375
|
+
async function* wrapped() {
|
|
49376
|
+
try {
|
|
49377
|
+
yield* raw;
|
|
49378
|
+
} finally {
|
|
49379
|
+
resolveStreamConsumed();
|
|
49380
|
+
}
|
|
49381
|
+
}
|
|
49382
|
+
result = { stream: wrapped() };
|
|
49383
|
+
resolveResultReady();
|
|
49384
|
+
await streamConsumed;
|
|
49385
|
+
} else {
|
|
49386
|
+
result = { stream: raw };
|
|
49387
|
+
}
|
|
49388
|
+
return;
|
|
49389
|
+
}
|
|
49390
|
+
const awaited = await raw;
|
|
49391
|
+
if (isSentinel(awaited)) {
|
|
49392
|
+
if (awaited[sentinel] === "ok") {
|
|
49393
|
+
const ok = awaited;
|
|
49394
|
+
result = { ok: true, data: ok.data, ...ok.cta ? { cta: ok.cta } : undefined };
|
|
49395
|
+
} else {
|
|
49396
|
+
const err = awaited;
|
|
49397
|
+
result = {
|
|
49398
|
+
ok: false,
|
|
49399
|
+
error: {
|
|
49400
|
+
code: err.code,
|
|
49401
|
+
message: err.message,
|
|
49402
|
+
...err.retryable !== undefined ? { retryable: err.retryable } : undefined
|
|
49403
|
+
},
|
|
49404
|
+
...err.cta ? { cta: err.cta } : undefined,
|
|
49405
|
+
...err.exitCode !== undefined ? { exitCode: err.exitCode } : undefined
|
|
49406
|
+
};
|
|
49407
|
+
}
|
|
49408
|
+
return;
|
|
49409
|
+
}
|
|
49410
|
+
result = { ok: true, data: awaited };
|
|
49411
|
+
};
|
|
49412
|
+
try {
|
|
49413
|
+
const cliEnv = envSchema ? parseEnv(envSchema, envSource) : {};
|
|
49414
|
+
if (middlewares.length > 0) {
|
|
49415
|
+
const errorFn = (opts) => {
|
|
49416
|
+
result = {
|
|
49417
|
+
ok: false,
|
|
49418
|
+
error: {
|
|
49419
|
+
code: opts.code,
|
|
49420
|
+
message: opts.message,
|
|
49421
|
+
...opts.retryable !== undefined ? { retryable: opts.retryable } : undefined
|
|
49422
|
+
},
|
|
49423
|
+
...opts.cta ? { cta: opts.cta } : undefined,
|
|
49424
|
+
...opts.exitCode !== undefined ? { exitCode: opts.exitCode } : undefined
|
|
49425
|
+
};
|
|
49426
|
+
return;
|
|
49427
|
+
};
|
|
49428
|
+
const mwCtx = {
|
|
49429
|
+
agent,
|
|
49430
|
+
command: path,
|
|
49431
|
+
env: cliEnv,
|
|
49432
|
+
error: errorFn,
|
|
49433
|
+
format: format3,
|
|
49434
|
+
formatExplicit,
|
|
49435
|
+
name,
|
|
49436
|
+
set(key, value) {
|
|
49437
|
+
varsMap[key] = value;
|
|
49438
|
+
},
|
|
49439
|
+
var: varsMap,
|
|
49440
|
+
version: version2
|
|
49441
|
+
};
|
|
49442
|
+
const composed = middlewares.reduceRight((next, mw) => async () => {
|
|
49443
|
+
await mw(mwCtx, next);
|
|
49444
|
+
}, runCommand);
|
|
49445
|
+
const chainPromise = composed();
|
|
49446
|
+
await Promise.race([chainPromise, resultReady]);
|
|
49447
|
+
if (streamConsumed)
|
|
49448
|
+
return result;
|
|
49449
|
+
await chainPromise;
|
|
49450
|
+
} else {
|
|
49451
|
+
await runCommand();
|
|
49452
|
+
}
|
|
49453
|
+
} catch (error48) {
|
|
49454
|
+
if (error48 instanceof ValidationError)
|
|
49455
|
+
return {
|
|
49456
|
+
ok: false,
|
|
49457
|
+
error: {
|
|
49458
|
+
code: "VALIDATION_ERROR",
|
|
49459
|
+
message: error48.message,
|
|
49460
|
+
fieldErrors: error48.fieldErrors
|
|
49461
|
+
}
|
|
49462
|
+
};
|
|
49463
|
+
return {
|
|
49464
|
+
ok: false,
|
|
49465
|
+
error: {
|
|
49466
|
+
code: error48 instanceof IncurError ? error48.code : "UNKNOWN",
|
|
49467
|
+
message: error48 instanceof Error ? error48.message : String(error48),
|
|
49468
|
+
...error48 instanceof IncurError ? { retryable: error48.retryable } : undefined
|
|
49469
|
+
},
|
|
49470
|
+
...error48 instanceof IncurError && error48.exitCode !== undefined ? { exitCode: error48.exitCode } : undefined
|
|
49471
|
+
};
|
|
49472
|
+
}
|
|
49473
|
+
return result ?? { ok: true, data: undefined };
|
|
49474
|
+
}
|
|
49475
|
+
function splitParams(params, command) {
|
|
49476
|
+
const argKeys = new Set(command.args ? Object.keys(command.args.shape) : []);
|
|
49477
|
+
const a = {};
|
|
49478
|
+
const o = {};
|
|
49479
|
+
for (const [key, value] of Object.entries(params))
|
|
49480
|
+
if (argKeys.has(key))
|
|
49481
|
+
a[key] = value;
|
|
49482
|
+
else
|
|
49483
|
+
o[key] = value;
|
|
49484
|
+
return { args: a, options: o };
|
|
49485
|
+
}
|
|
49486
|
+
function isSentinel(value) {
|
|
49487
|
+
return typeof value === "object" && value !== null && sentinel in value;
|
|
49488
|
+
}
|
|
49489
|
+
function isAsyncGenerator(value) {
|
|
49490
|
+
return typeof value === "object" && value !== null && Symbol.asyncIterator in value && typeof value.next === "function";
|
|
49491
|
+
}
|
|
49492
|
+
function subcommand(def) {
|
|
49493
|
+
return def;
|
|
49494
|
+
}
|
|
49495
|
+
var shells = ["bash", "fish", "nushell", "zsh"];
|
|
49496
|
+
var builtinCommands = [
|
|
49497
|
+
{
|
|
49498
|
+
name: "completions",
|
|
49499
|
+
description: "Generate shell completion script",
|
|
49500
|
+
args: exports_external.object({
|
|
49501
|
+
shell: exports_external.enum(shells).describe("Shell to generate completions for")
|
|
49502
|
+
}),
|
|
49503
|
+
hint(name) {
|
|
49504
|
+
const rows = [
|
|
49505
|
+
["bash", `eval "$(${name} completions bash)"`, "# add to ~/.bashrc"],
|
|
49506
|
+
["fish", `${name} completions fish | source`, "# add to ~/.config/fish/config.fish"],
|
|
49507
|
+
["nushell", `see \`${name} completions nushell\``, "# add to config.nu"],
|
|
49508
|
+
["zsh", `eval "$(${name} completions zsh)"`, "# add to ~/.zshrc"]
|
|
49509
|
+
];
|
|
49510
|
+
const shellW = Math.max(...rows.map((r) => r[0].length));
|
|
49511
|
+
const cmdW = Math.max(...rows.map((r) => r[1].length));
|
|
49512
|
+
return `Setup:
|
|
49513
|
+
` + rows.map(([s, cmd, comment]) => ` ${s.padEnd(shellW)} ${cmd.padEnd(cmdW)} ${comment}`).join(`
|
|
49514
|
+
`);
|
|
49515
|
+
}
|
|
49516
|
+
},
|
|
49517
|
+
{
|
|
49518
|
+
name: "mcp",
|
|
49519
|
+
description: "Register as MCP server",
|
|
49520
|
+
subcommands: [
|
|
49521
|
+
subcommand({
|
|
49522
|
+
name: "add",
|
|
49523
|
+
description: "Register as MCP server",
|
|
49524
|
+
alias: { command: "c" },
|
|
49525
|
+
options: exports_external.object({
|
|
49526
|
+
agent: exports_external.string().optional().describe("Target a specific agent (e.g. claude-code, cursor)"),
|
|
49527
|
+
command: exports_external.string().optional().describe('Override the command agents will run (e.g. "pnpm my-cli --mcp")'),
|
|
49528
|
+
noGlobal: exports_external.boolean().optional().describe("Install to project instead of globally")
|
|
49529
|
+
})
|
|
49530
|
+
})
|
|
49531
|
+
]
|
|
49532
|
+
},
|
|
49533
|
+
{
|
|
49534
|
+
name: "skills",
|
|
49535
|
+
description: "Sync skill files to agents",
|
|
49536
|
+
subcommands: [
|
|
49537
|
+
subcommand({
|
|
49538
|
+
name: "add",
|
|
49539
|
+
description: "Sync skill files to agents",
|
|
49540
|
+
options: exports_external.object({
|
|
49541
|
+
depth: exports_external.number().optional().describe("Grouping depth for skill files (default: 1)"),
|
|
49542
|
+
noGlobal: exports_external.boolean().optional().describe("Install to project instead of globally")
|
|
49543
|
+
})
|
|
49544
|
+
})
|
|
49545
|
+
]
|
|
49546
|
+
}
|
|
49547
|
+
];
|
|
49548
|
+
|
|
49549
|
+
// ../../node_modules/.bun/incur@0.3.5+ea8cb298c1911149/node_modules/incur/dist/Help.js
|
|
49105
49550
|
function formatRoot(name, options = {}) {
|
|
49106
49551
|
const { aliases, description, version: version2, commands = [], root = false } = options;
|
|
49107
49552
|
const lines = [];
|
|
@@ -49214,7 +49659,8 @@ function formatCommand(name, options = {}) {
|
|
|
49214
49659
|
lines.push(` ${cmd.name}`);
|
|
49215
49660
|
}
|
|
49216
49661
|
}
|
|
49217
|
-
|
|
49662
|
+
if (!options.hideGlobalOptions)
|
|
49663
|
+
lines.push(...globalOptionsLines(root));
|
|
49218
49664
|
if (env) {
|
|
49219
49665
|
const entries = envEntries(env);
|
|
49220
49666
|
if (entries.length > 0) {
|
|
@@ -49241,8 +49687,11 @@ function buildSynopsis(name, args) {
|
|
|
49241
49687
|
if (!args)
|
|
49242
49688
|
return name;
|
|
49243
49689
|
const parts = [name];
|
|
49244
|
-
for (const [key, schema] of Object.entries(args.shape))
|
|
49245
|
-
|
|
49690
|
+
for (const [key, schema] of Object.entries(args.shape)) {
|
|
49691
|
+
const type = resolveTypeName(schema);
|
|
49692
|
+
const label = type.includes("|") ? type : key;
|
|
49693
|
+
parts.push(schema._zod.optout === "optional" ? `[${label}]` : `<${label}>`);
|
|
49694
|
+
}
|
|
49246
49695
|
return parts.join(" ");
|
|
49247
49696
|
}
|
|
49248
49697
|
function argsEntries(schema) {
|
|
@@ -49275,7 +49724,7 @@ function optionEntries(schema, alias) {
|
|
|
49275
49724
|
function resolveTypeName(schema) {
|
|
49276
49725
|
if (isCountSchema(schema))
|
|
49277
49726
|
return "count";
|
|
49278
|
-
const unwrapped =
|
|
49727
|
+
const unwrapped = unwrap3(schema);
|
|
49279
49728
|
if (unwrapped instanceof exports_external.ZodString)
|
|
49280
49729
|
return "string";
|
|
49281
49730
|
if (unwrapped instanceof exports_external.ZodNumber)
|
|
@@ -49301,13 +49750,13 @@ function isCountSchema(schema) {
|
|
|
49301
49750
|
const s = schema;
|
|
49302
49751
|
return typeof s?.meta === "function" && s.meta()?.count === true;
|
|
49303
49752
|
}
|
|
49304
|
-
function
|
|
49753
|
+
function unwrap3(schema) {
|
|
49305
49754
|
if (schema instanceof exports_external.ZodOptional)
|
|
49306
|
-
return
|
|
49755
|
+
return unwrap3(schema.unwrap());
|
|
49307
49756
|
if (schema instanceof exports_external.ZodDefault)
|
|
49308
|
-
return
|
|
49757
|
+
return unwrap3(schema.removeDefault());
|
|
49309
49758
|
if (schema instanceof exports_external.ZodNullable)
|
|
49310
|
-
return
|
|
49759
|
+
return unwrap3(schema.unwrap());
|
|
49311
49760
|
return schema;
|
|
49312
49761
|
}
|
|
49313
49762
|
function extractDefault(schema) {
|
|
@@ -49332,13 +49781,18 @@ function toKebab(str) {
|
|
|
49332
49781
|
function globalOptionsLines(root = false) {
|
|
49333
49782
|
const lines = [];
|
|
49334
49783
|
if (root) {
|
|
49335
|
-
const builtins =
|
|
49336
|
-
|
|
49337
|
-
|
|
49338
|
-
|
|
49339
|
-
|
|
49784
|
+
const builtins = builtinCommands.flatMap((b) => {
|
|
49785
|
+
if (!b.subcommands)
|
|
49786
|
+
return [{ name: b.name, desc: b.description }];
|
|
49787
|
+
if (b.subcommands.length === 1)
|
|
49788
|
+
return [
|
|
49789
|
+
{ name: `${b.name} ${b.subcommands[0].name}`, desc: b.subcommands[0].description }
|
|
49790
|
+
];
|
|
49791
|
+
const names = b.subcommands.map((s) => s.name).join(", ");
|
|
49792
|
+
return [{ name: b.name, desc: `${b.description} (${names})` }];
|
|
49793
|
+
});
|
|
49340
49794
|
const maxCmd = Math.max(...builtins.map((b) => b.name.length));
|
|
49341
|
-
lines.push("", "
|
|
49795
|
+
lines.push("", "Integrations:", ...builtins.map((b) => ` ${b.name}${" ".repeat(maxCmd - b.name.length)} ${b.desc}`));
|
|
49342
49796
|
}
|
|
49343
49797
|
const flags = [
|
|
49344
49798
|
{
|
|
@@ -49366,7 +49820,7 @@ function redact(value) {
|
|
|
49366
49820
|
return `••••${value.slice(-3)}`;
|
|
49367
49821
|
}
|
|
49368
49822
|
|
|
49369
|
-
// ../../node_modules/.bun/incur@0.3.
|
|
49823
|
+
// ../../node_modules/.bun/incur@0.3.5+ea8cb298c1911149/node_modules/incur/dist/internal/pm.js
|
|
49370
49824
|
function detectRunner() {
|
|
49371
49825
|
const userAgent = process.env.npm_config_user_agent ?? "";
|
|
49372
49826
|
const execPath = process.env.npm_execpath ?? "";
|
|
@@ -49377,7 +49831,7 @@ function detectRunner() {
|
|
|
49377
49831
|
return "npx";
|
|
49378
49832
|
}
|
|
49379
49833
|
|
|
49380
|
-
// ../../node_modules/.bun/incur@0.3.
|
|
49834
|
+
// ../../node_modules/.bun/incur@0.3.5+ea8cb298c1911149/node_modules/incur/dist/Mcp.js
|
|
49381
49835
|
init_mcp();
|
|
49382
49836
|
|
|
49383
49837
|
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.27.1/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
@@ -49473,7 +49927,7 @@ class StdioServerTransport {
|
|
|
49473
49927
|
}
|
|
49474
49928
|
}
|
|
49475
49929
|
|
|
49476
|
-
// ../../node_modules/.bun/incur@0.3.
|
|
49930
|
+
// ../../node_modules/.bun/incur@0.3.5+ea8cb298c1911149/node_modules/incur/dist/Schema.js
|
|
49477
49931
|
init_zod();
|
|
49478
49932
|
function toJsonSchema(schema) {
|
|
49479
49933
|
const result = exports_external.toJSONSchema(schema);
|
|
@@ -49481,7 +49935,7 @@ function toJsonSchema(schema) {
|
|
|
49481
49935
|
return result;
|
|
49482
49936
|
}
|
|
49483
49937
|
|
|
49484
|
-
// ../../node_modules/.bun/incur@0.3.
|
|
49938
|
+
// ../../node_modules/.bun/incur@0.3.5+ea8cb298c1911149/node_modules/incur/dist/Mcp.js
|
|
49485
49939
|
async function serve(name, version2, commands, options = {}) {
|
|
49486
49940
|
const server = new McpServer({ name, version: version2 });
|
|
49487
49941
|
for (const tool of collectTools(commands, [])) {
|
|
@@ -49492,11 +49946,19 @@ async function serve(name, version2, commands, options = {}) {
|
|
|
49492
49946
|
const hasInput = Object.keys(mergedShape).length > 0;
|
|
49493
49947
|
server.registerTool(tool.name, {
|
|
49494
49948
|
...tool.description ? { description: tool.description } : undefined,
|
|
49495
|
-
...hasInput ? { inputSchema: mergedShape } : undefined
|
|
49949
|
+
...hasInput ? { inputSchema: mergedShape } : undefined,
|
|
49950
|
+
...tool.outputSchema ? { outputSchema: tool.outputSchema } : undefined
|
|
49496
49951
|
}, async (...callArgs) => {
|
|
49497
49952
|
const params = hasInput ? callArgs[0] : {};
|
|
49498
49953
|
const extra = hasInput ? callArgs[1] : callArgs[0];
|
|
49499
|
-
return callTool(tool, params,
|
|
49954
|
+
return callTool(tool, params, {
|
|
49955
|
+
extra,
|
|
49956
|
+
name,
|
|
49957
|
+
version: version2,
|
|
49958
|
+
middlewares: options.middlewares,
|
|
49959
|
+
env: options.env,
|
|
49960
|
+
vars: options.vars
|
|
49961
|
+
});
|
|
49500
49962
|
});
|
|
49501
49963
|
}
|
|
49502
49964
|
const input = options.input ?? process.stdin;
|
|
@@ -49504,77 +49966,76 @@ async function serve(name, version2, commands, options = {}) {
|
|
|
49504
49966
|
const transport = new StdioServerTransport(input, output);
|
|
49505
49967
|
await server.connect(transport);
|
|
49506
49968
|
}
|
|
49507
|
-
async function callTool(tool, params,
|
|
49508
|
-
|
|
49509
|
-
|
|
49510
|
-
|
|
49511
|
-
|
|
49512
|
-
|
|
49513
|
-
|
|
49514
|
-
|
|
49515
|
-
|
|
49516
|
-
|
|
49517
|
-
|
|
49518
|
-
|
|
49519
|
-
|
|
49520
|
-
|
|
49521
|
-
|
|
49522
|
-
|
|
49523
|
-
|
|
49524
|
-
|
|
49525
|
-
|
|
49526
|
-
|
|
49527
|
-
|
|
49528
|
-
|
|
49529
|
-
|
|
49530
|
-
|
|
49531
|
-
|
|
49532
|
-
|
|
49533
|
-
isError: true
|
|
49534
|
-
};
|
|
49535
|
-
}
|
|
49969
|
+
async function callTool(tool, params, options = {}) {
|
|
49970
|
+
const allMiddleware = [
|
|
49971
|
+
...options.middlewares ?? [],
|
|
49972
|
+
...tool.middlewares ?? [],
|
|
49973
|
+
...tool.command.middleware ?? []
|
|
49974
|
+
];
|
|
49975
|
+
const result = await execute(tool.command, {
|
|
49976
|
+
agent: true,
|
|
49977
|
+
argv: [],
|
|
49978
|
+
env: options.env,
|
|
49979
|
+
format: "json",
|
|
49980
|
+
formatExplicit: true,
|
|
49981
|
+
inputOptions: params,
|
|
49982
|
+
middlewares: allMiddleware,
|
|
49983
|
+
name: options.name ?? tool.name,
|
|
49984
|
+
parseMode: "flat",
|
|
49985
|
+
path: tool.name,
|
|
49986
|
+
vars: options.vars,
|
|
49987
|
+
version: options.version
|
|
49988
|
+
});
|
|
49989
|
+
if ("stream" in result) {
|
|
49990
|
+
const chunks = [];
|
|
49991
|
+
const progressToken = options.extra?._meta?.progressToken;
|
|
49992
|
+
let i = 0;
|
|
49993
|
+
try {
|
|
49994
|
+
for await (const chunk of result.stream) {
|
|
49536
49995
|
chunks.push(chunk);
|
|
49537
|
-
if (progressToken !== undefined && extra?.sendNotification)
|
|
49538
|
-
await extra.sendNotification({
|
|
49996
|
+
if (progressToken !== undefined && options.extra?.sendNotification)
|
|
49997
|
+
await options.extra.sendNotification({
|
|
49539
49998
|
method: "notifications/progress",
|
|
49540
49999
|
params: { progressToken, progress: ++i, message: JSON.stringify(chunk) }
|
|
49541
50000
|
});
|
|
49542
50001
|
}
|
|
49543
|
-
|
|
49544
|
-
|
|
49545
|
-
|
|
49546
|
-
|
|
49547
|
-
|
|
49548
|
-
if (tagged[sentinel] === "error")
|
|
49549
|
-
return {
|
|
49550
|
-
content: [{ type: "text", text: tagged.message ?? "Command failed" }],
|
|
49551
|
-
isError: true
|
|
49552
|
-
};
|
|
49553
|
-
return { content: [{ type: "text", text: JSON.stringify(tagged.data ?? null) }] };
|
|
50002
|
+
} catch (err) {
|
|
50003
|
+
return {
|
|
50004
|
+
content: [{ type: "text", text: err instanceof Error ? err.message : String(err) }],
|
|
50005
|
+
isError: true
|
|
50006
|
+
};
|
|
49554
50007
|
}
|
|
49555
|
-
return { content: [{ type: "text", text: JSON.stringify(
|
|
49556
|
-
}
|
|
50008
|
+
return { content: [{ type: "text", text: JSON.stringify(chunks) }] };
|
|
50009
|
+
}
|
|
50010
|
+
if (!result.ok)
|
|
49557
50011
|
return {
|
|
49558
|
-
content: [{ type: "text", text:
|
|
50012
|
+
content: [{ type: "text", text: result.error.message ?? "Command failed" }],
|
|
49559
50013
|
isError: true
|
|
49560
50014
|
};
|
|
49561
|
-
|
|
49562
|
-
|
|
49563
|
-
|
|
49564
|
-
|
|
50015
|
+
const data = result.data ?? null;
|
|
50016
|
+
return {
|
|
50017
|
+
content: [{ type: "text", text: JSON.stringify(data) }],
|
|
50018
|
+
...data !== null && tool.outputSchema ? { structuredContent: data } : undefined
|
|
50019
|
+
};
|
|
49565
50020
|
}
|
|
49566
|
-
function collectTools(commands, prefix) {
|
|
50021
|
+
function collectTools(commands, prefix, parentMiddlewares = []) {
|
|
49567
50022
|
const result = [];
|
|
49568
50023
|
for (const [name, entry] of commands) {
|
|
49569
50024
|
const path = [...prefix, name];
|
|
49570
|
-
if ("_group" in entry && entry._group)
|
|
49571
|
-
|
|
49572
|
-
|
|
50025
|
+
if ("_group" in entry && entry._group) {
|
|
50026
|
+
const groupMw = [
|
|
50027
|
+
...parentMiddlewares,
|
|
50028
|
+
...entry.middlewares ?? []
|
|
50029
|
+
];
|
|
50030
|
+
result.push(...collectTools(entry.commands, path, groupMw));
|
|
50031
|
+
} else {
|
|
49573
50032
|
result.push({
|
|
49574
50033
|
name: path.join("_"),
|
|
49575
50034
|
description: entry.description,
|
|
49576
50035
|
inputSchema: buildToolSchema(entry.args, entry.options),
|
|
49577
|
-
|
|
50036
|
+
...entry.output ? { outputSchema: toJsonSchema(entry.output) } : undefined,
|
|
50037
|
+
command: entry,
|
|
50038
|
+
...parentMiddlewares.length > 0 ? { middlewares: parentMiddlewares } : undefined
|
|
49578
50039
|
});
|
|
49579
50040
|
}
|
|
49580
50041
|
}
|
|
@@ -49594,18 +50055,6 @@ function buildToolSchema(args, options) {
|
|
|
49594
50055
|
return { type: "object", properties, required: required2 };
|
|
49595
50056
|
return { type: "object", properties };
|
|
49596
50057
|
}
|
|
49597
|
-
function splitParams(params, command) {
|
|
49598
|
-
const argKeys = new Set(command.args ? Object.keys(command.args.shape) : []);
|
|
49599
|
-
const a = {};
|
|
49600
|
-
const o = {};
|
|
49601
|
-
for (const [key, value] of Object.entries(params)) {
|
|
49602
|
-
if (argKeys.has(key))
|
|
49603
|
-
a[key] = value;
|
|
49604
|
-
else
|
|
49605
|
-
o[key] = value;
|
|
49606
|
-
}
|
|
49607
|
-
return { args: a, options: o };
|
|
49608
|
-
}
|
|
49609
50058
|
|
|
49610
50059
|
// ../../node_modules/.bun/@readme+openapi-parser@6.0.0+ea8cb298c1911149/node_modules/@readme/openapi-parser/dist/chunk-IYQ77VVR.js
|
|
49611
50060
|
function isOpenAPI(schema) {
|
|
@@ -49702,7 +50151,7 @@ async function dereference(api2, options) {
|
|
|
49702
50151
|
return parser2.schema;
|
|
49703
50152
|
}
|
|
49704
50153
|
|
|
49705
|
-
// ../../node_modules/.bun/incur@0.3.
|
|
50154
|
+
// ../../node_modules/.bun/incur@0.3.5+ea8cb298c1911149/node_modules/incur/dist/Openapi.js
|
|
49706
50155
|
init_zod();
|
|
49707
50156
|
async function generateCommands(spec, fetch2, options = {}) {
|
|
49708
50157
|
const resolved = await dereference(structuredClone(spec));
|
|
@@ -49830,219 +50279,7 @@ function coerceIfNeeded(schema) {
|
|
|
49830
50279
|
return schema;
|
|
49831
50280
|
}
|
|
49832
50281
|
|
|
49833
|
-
// ../../node_modules/.bun/incur@0.3.
|
|
49834
|
-
function parse7(argv, options = {}) {
|
|
49835
|
-
const { args: argsSchema, options: optionsSchema, alias } = options;
|
|
49836
|
-
const aliasToName = new Map;
|
|
49837
|
-
if (alias)
|
|
49838
|
-
for (const [name, short] of Object.entries(alias))
|
|
49839
|
-
aliasToName.set(short, name);
|
|
49840
|
-
const knownOptions = new Set(optionsSchema ? Object.keys(optionsSchema.shape) : []);
|
|
49841
|
-
const kebabToCamel = new Map;
|
|
49842
|
-
for (const name of knownOptions) {
|
|
49843
|
-
const kebab = name.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`);
|
|
49844
|
-
if (kebab !== name)
|
|
49845
|
-
kebabToCamel.set(kebab, name);
|
|
49846
|
-
}
|
|
49847
|
-
const positionals = [];
|
|
49848
|
-
const rawOptions = {};
|
|
49849
|
-
let i = 0;
|
|
49850
|
-
while (i < argv.length) {
|
|
49851
|
-
const token = argv[i];
|
|
49852
|
-
if (token.startsWith("--no-") && token.length > 5) {
|
|
49853
|
-
const raw = token.slice(5);
|
|
49854
|
-
const name = kebabToCamel.get(raw) ?? raw;
|
|
49855
|
-
if (!knownOptions.has(name))
|
|
49856
|
-
throw new ParseError({ message: `Unknown flag: ${token}` });
|
|
49857
|
-
rawOptions[name] = false;
|
|
49858
|
-
i++;
|
|
49859
|
-
} else if (token.startsWith("--")) {
|
|
49860
|
-
const eqIdx = token.indexOf("=");
|
|
49861
|
-
if (eqIdx !== -1) {
|
|
49862
|
-
const raw = token.slice(2, eqIdx);
|
|
49863
|
-
const name = kebabToCamel.get(raw) ?? raw;
|
|
49864
|
-
if (!knownOptions.has(name))
|
|
49865
|
-
throw new ParseError({ message: `Unknown flag: --${raw}` });
|
|
49866
|
-
setOption(rawOptions, name, token.slice(eqIdx + 1), optionsSchema);
|
|
49867
|
-
i++;
|
|
49868
|
-
} else {
|
|
49869
|
-
const raw = token.slice(2);
|
|
49870
|
-
const name = kebabToCamel.get(raw) ?? raw;
|
|
49871
|
-
if (!knownOptions.has(name))
|
|
49872
|
-
throw new ParseError({ message: `Unknown flag: ${token}` });
|
|
49873
|
-
if (isCountOption(name, optionsSchema)) {
|
|
49874
|
-
rawOptions[name] = (rawOptions[name] ?? 0) + 1;
|
|
49875
|
-
i++;
|
|
49876
|
-
} else if (isBooleanOption2(name, optionsSchema)) {
|
|
49877
|
-
rawOptions[name] = true;
|
|
49878
|
-
i++;
|
|
49879
|
-
} else {
|
|
49880
|
-
const value = argv[i + 1];
|
|
49881
|
-
if (value === undefined)
|
|
49882
|
-
throw new ParseError({ message: `Missing value for flag: ${token}` });
|
|
49883
|
-
setOption(rawOptions, name, value, optionsSchema);
|
|
49884
|
-
i += 2;
|
|
49885
|
-
}
|
|
49886
|
-
}
|
|
49887
|
-
} else if (token.startsWith("-") && !token.startsWith("--") && token.length >= 2) {
|
|
49888
|
-
const chars = token.slice(1);
|
|
49889
|
-
for (let j = 0;j < chars.length; j++) {
|
|
49890
|
-
const short = chars[j];
|
|
49891
|
-
const name = aliasToName.get(short);
|
|
49892
|
-
if (!name)
|
|
49893
|
-
throw new ParseError({ message: `Unknown flag: -${short}` });
|
|
49894
|
-
const isLast = j === chars.length - 1;
|
|
49895
|
-
if (!isLast) {
|
|
49896
|
-
if (isCountOption(name, optionsSchema)) {
|
|
49897
|
-
rawOptions[name] = (rawOptions[name] ?? 0) + 1;
|
|
49898
|
-
} else if (isBooleanOption2(name, optionsSchema)) {
|
|
49899
|
-
rawOptions[name] = true;
|
|
49900
|
-
} else {
|
|
49901
|
-
throw new ParseError({
|
|
49902
|
-
message: `Non-boolean flag -${short} must be last in a stacked alias`
|
|
49903
|
-
});
|
|
49904
|
-
}
|
|
49905
|
-
} else if (isCountOption(name, optionsSchema)) {
|
|
49906
|
-
rawOptions[name] = (rawOptions[name] ?? 0) + 1;
|
|
49907
|
-
} else if (isBooleanOption2(name, optionsSchema)) {
|
|
49908
|
-
rawOptions[name] = true;
|
|
49909
|
-
} else {
|
|
49910
|
-
const value = argv[i + 1];
|
|
49911
|
-
if (value === undefined)
|
|
49912
|
-
throw new ParseError({ message: `Missing value for flag: -${short}` });
|
|
49913
|
-
setOption(rawOptions, name, value, optionsSchema);
|
|
49914
|
-
i++;
|
|
49915
|
-
}
|
|
49916
|
-
}
|
|
49917
|
-
i++;
|
|
49918
|
-
} else {
|
|
49919
|
-
positionals.push(token);
|
|
49920
|
-
i++;
|
|
49921
|
-
}
|
|
49922
|
-
}
|
|
49923
|
-
const rawArgs = {};
|
|
49924
|
-
if (argsSchema) {
|
|
49925
|
-
const keys = Object.keys(argsSchema.shape);
|
|
49926
|
-
for (let j = 0;j < keys.length; j++) {
|
|
49927
|
-
const key = keys[j];
|
|
49928
|
-
if (positionals[j] !== undefined) {
|
|
49929
|
-
rawArgs[key] = positionals[j];
|
|
49930
|
-
}
|
|
49931
|
-
}
|
|
49932
|
-
}
|
|
49933
|
-
const args = argsSchema ? zodParse(argsSchema, rawArgs) : {};
|
|
49934
|
-
if (optionsSchema) {
|
|
49935
|
-
for (const [name, value] of Object.entries(rawOptions)) {
|
|
49936
|
-
rawOptions[name] = coerce(value, name, optionsSchema);
|
|
49937
|
-
}
|
|
49938
|
-
}
|
|
49939
|
-
const parsedOptions = optionsSchema ? zodParse(optionsSchema, rawOptions) : {};
|
|
49940
|
-
return { args, options: parsedOptions };
|
|
49941
|
-
}
|
|
49942
|
-
function unwrap3(schema) {
|
|
49943
|
-
let s = schema;
|
|
49944
|
-
while (s.def?.innerType)
|
|
49945
|
-
s = s.def.innerType;
|
|
49946
|
-
return s;
|
|
49947
|
-
}
|
|
49948
|
-
function isBooleanOption2(name, schema) {
|
|
49949
|
-
if (!schema)
|
|
49950
|
-
return false;
|
|
49951
|
-
const field = schema.shape[name];
|
|
49952
|
-
if (!field)
|
|
49953
|
-
return false;
|
|
49954
|
-
return unwrap3(field).constructor.name === "ZodBoolean";
|
|
49955
|
-
}
|
|
49956
|
-
function isCountOption(name, schema) {
|
|
49957
|
-
if (!schema)
|
|
49958
|
-
return false;
|
|
49959
|
-
const field = schema.shape[name];
|
|
49960
|
-
if (!field)
|
|
49961
|
-
return false;
|
|
49962
|
-
return typeof field.meta === "function" && field.meta()?.count === true;
|
|
49963
|
-
}
|
|
49964
|
-
function isArrayOption(name, schema) {
|
|
49965
|
-
if (!schema)
|
|
49966
|
-
return false;
|
|
49967
|
-
const field = schema.shape[name];
|
|
49968
|
-
if (!field)
|
|
49969
|
-
return false;
|
|
49970
|
-
return unwrap3(field).constructor.name === "ZodArray";
|
|
49971
|
-
}
|
|
49972
|
-
function setOption(raw, name, value, schema) {
|
|
49973
|
-
if (isArrayOption(name, schema)) {
|
|
49974
|
-
const existing = raw[name];
|
|
49975
|
-
if (Array.isArray(existing)) {
|
|
49976
|
-
existing.push(value);
|
|
49977
|
-
} else {
|
|
49978
|
-
raw[name] = [value];
|
|
49979
|
-
}
|
|
49980
|
-
} else {
|
|
49981
|
-
raw[name] = value;
|
|
49982
|
-
}
|
|
49983
|
-
}
|
|
49984
|
-
function zodParse(schema, data) {
|
|
49985
|
-
try {
|
|
49986
|
-
return schema.parse(data);
|
|
49987
|
-
} catch (err) {
|
|
49988
|
-
const issues = err?.issues ?? err?.error?.issues ?? [];
|
|
49989
|
-
const fieldErrors = issues.map((issue2) => ({
|
|
49990
|
-
path: (issue2.path ?? []).join("."),
|
|
49991
|
-
expected: issue2.expected ?? "",
|
|
49992
|
-
received: issue2.received ?? "",
|
|
49993
|
-
message: issue2.message ?? ""
|
|
49994
|
-
}));
|
|
49995
|
-
throw new ValidationError({
|
|
49996
|
-
message: issues.map((i) => i.message).join("; ") || "Validation failed",
|
|
49997
|
-
fieldErrors,
|
|
49998
|
-
cause: err instanceof Error ? err : undefined
|
|
49999
|
-
});
|
|
50000
|
-
}
|
|
50001
|
-
}
|
|
50002
|
-
function parseEnv(schema, source = defaultEnvSource()) {
|
|
50003
|
-
const raw = {};
|
|
50004
|
-
for (const [key, field] of Object.entries(schema.shape)) {
|
|
50005
|
-
const value = source[key];
|
|
50006
|
-
if (value !== undefined)
|
|
50007
|
-
raw[key] = coerceEnv(value, field);
|
|
50008
|
-
}
|
|
50009
|
-
return zodParse(schema, raw);
|
|
50010
|
-
}
|
|
50011
|
-
function coerceEnv(value, field) {
|
|
50012
|
-
const inner = unwrap3(field);
|
|
50013
|
-
const typeName = inner.constructor.name;
|
|
50014
|
-
if (typeName === "ZodNumber")
|
|
50015
|
-
return Number(value);
|
|
50016
|
-
if (typeName === "ZodBoolean")
|
|
50017
|
-
return value === "true" || value === "1";
|
|
50018
|
-
return value;
|
|
50019
|
-
}
|
|
50020
|
-
function coerce(value, name, schema) {
|
|
50021
|
-
const field = schema.shape[name];
|
|
50022
|
-
if (!field)
|
|
50023
|
-
return value;
|
|
50024
|
-
const inner = unwrap3(field);
|
|
50025
|
-
const typeName = inner.constructor.name;
|
|
50026
|
-
if (typeName === "ZodNumber" && typeof value === "string") {
|
|
50027
|
-
return Number(value);
|
|
50028
|
-
}
|
|
50029
|
-
if (typeName === "ZodBoolean" && typeof value === "string") {
|
|
50030
|
-
return value === "true";
|
|
50031
|
-
}
|
|
50032
|
-
return value;
|
|
50033
|
-
}
|
|
50034
|
-
function defaultEnvSource() {
|
|
50035
|
-
if (typeof globalThis !== "undefined") {
|
|
50036
|
-
const g = globalThis;
|
|
50037
|
-
if (g.process?.env)
|
|
50038
|
-
return g.process.env;
|
|
50039
|
-
if (g.Deno?.env)
|
|
50040
|
-
return new Proxy({}, { get: (_, key) => g.Deno.env.get(key) });
|
|
50041
|
-
}
|
|
50042
|
-
return {};
|
|
50043
|
-
}
|
|
50044
|
-
|
|
50045
|
-
// ../../node_modules/.bun/incur@0.3.4+ea8cb298c1911149/node_modules/incur/dist/Skill.js
|
|
50282
|
+
// ../../node_modules/.bun/incur@0.3.5+ea8cb298c1911149/node_modules/incur/dist/Skill.js
|
|
50046
50283
|
import { createHash } from "node:crypto";
|
|
50047
50284
|
function index(name, commands, description) {
|
|
50048
50285
|
const lines = [`# ${name}`];
|
|
@@ -50119,7 +50356,7 @@ function renderGroup(cli, title, cmds, groups, prefix) {
|
|
|
50119
50356
|
if (childDescs.length > 0)
|
|
50120
50357
|
descParts.push(childDescs.join(", "));
|
|
50121
50358
|
const description = descParts.length > 0 ? `${descParts.join(". ")}. Run \`${title} --help\` for usage details.` : `Run \`${title} --help\` for usage details.`;
|
|
50122
|
-
const slug = title.replace(
|
|
50359
|
+
const slug = title.toLowerCase().replace(/[^a-z0-9-]+/g, "-").replace(/-{2,}/g, "-").replace(/^-|-$/g, "");
|
|
50123
50360
|
const fm = ["---", `name: ${slug}`];
|
|
50124
50361
|
fm.push(`description: ${description}`);
|
|
50125
50362
|
fm.push(`requires_bin: ${cli}`);
|
|
@@ -50296,7 +50533,7 @@ function resolveTypeName2(prop) {
|
|
|
50296
50533
|
return "unknown";
|
|
50297
50534
|
}
|
|
50298
50535
|
|
|
50299
|
-
// ../../node_modules/.bun/incur@0.3.
|
|
50536
|
+
// ../../node_modules/.bun/incur@0.3.5+ea8cb298c1911149/node_modules/incur/dist/SyncMcp.js
|
|
50300
50537
|
import { execFile } from "node:child_process";
|
|
50301
50538
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
50302
50539
|
import { homedir } from "node:os";
|
|
@@ -50380,13 +50617,13 @@ function exec(cmd, args) {
|
|
|
50380
50617
|
});
|
|
50381
50618
|
}
|
|
50382
50619
|
|
|
50383
|
-
// ../../node_modules/.bun/incur@0.3.
|
|
50620
|
+
// ../../node_modules/.bun/incur@0.3.5+ea8cb298c1911149/node_modules/incur/dist/SyncSkills.js
|
|
50384
50621
|
import fsSync from "node:fs";
|
|
50385
50622
|
import fs2 from "node:fs/promises";
|
|
50386
50623
|
import os2 from "node:os";
|
|
50387
50624
|
import path2 from "node:path";
|
|
50388
50625
|
|
|
50389
|
-
// ../../node_modules/.bun/incur@0.3.
|
|
50626
|
+
// ../../node_modules/.bun/incur@0.3.5+ea8cb298c1911149/node_modules/incur/dist/internal/agents.js
|
|
50390
50627
|
import * as fs from "node:fs";
|
|
50391
50628
|
import * as os from "node:os";
|
|
50392
50629
|
import * as path from "node:path";
|
|
@@ -50662,7 +50899,7 @@ function resolveParent(dir) {
|
|
|
50662
50899
|
}
|
|
50663
50900
|
}
|
|
50664
50901
|
|
|
50665
|
-
// ../../node_modules/.bun/incur@0.3.
|
|
50902
|
+
// ../../node_modules/.bun/incur@0.3.5+ea8cb298c1911149/node_modules/incur/dist/SyncSkills.js
|
|
50666
50903
|
async function sync(name, commands, options = {}) {
|
|
50667
50904
|
const { depth = 1, description, global = true } = options;
|
|
50668
50905
|
const cwd = options.cwd ?? (global ? resolvePackageRoot() : process.cwd());
|
|
@@ -50757,7 +50994,13 @@ function resolvePackageRoot() {
|
|
|
50757
50994
|
const bin = process.argv[1];
|
|
50758
50995
|
if (!bin)
|
|
50759
50996
|
return process.cwd();
|
|
50760
|
-
let dir = path2.dirname(
|
|
50997
|
+
let dir = path2.dirname((() => {
|
|
50998
|
+
try {
|
|
50999
|
+
return fsSync.realpathSync(bin);
|
|
51000
|
+
} catch {
|
|
51001
|
+
return process.execPath;
|
|
51002
|
+
}
|
|
51003
|
+
})());
|
|
50761
51004
|
const root = path2.parse(dir).root;
|
|
50762
51005
|
while (dir !== root) {
|
|
50763
51006
|
try {
|
|
@@ -50791,7 +51034,7 @@ function readHash(name) {
|
|
|
50791
51034
|
return readMeta(name)?.hash;
|
|
50792
51035
|
}
|
|
50793
51036
|
|
|
50794
|
-
// ../../node_modules/.bun/incur@0.3.
|
|
51037
|
+
// ../../node_modules/.bun/incur@0.3.5+ea8cb298c1911149/node_modules/incur/dist/Cli.js
|
|
50795
51038
|
function create(nameOrDefinition, definition) {
|
|
50796
51039
|
const name = typeof nameOrDefinition === "string" ? nameOrDefinition : nameOrDefinition.name;
|
|
50797
51040
|
const def = typeof nameOrDefinition === "string" ? definition ?? {} : nameOrDefinition;
|
|
@@ -50854,10 +51097,13 @@ function create(nameOrDefinition, definition) {
|
|
|
50854
51097
|
if (pending.length > 0)
|
|
50855
51098
|
await Promise.all(pending);
|
|
50856
51099
|
return fetchImpl(name, commands, req, {
|
|
51100
|
+
envSchema: def.env,
|
|
50857
51101
|
mcpHandler,
|
|
50858
51102
|
middlewares,
|
|
51103
|
+
name,
|
|
50859
51104
|
rootCommand: rootDef,
|
|
50860
|
-
vars: def.vars
|
|
51105
|
+
vars: def.vars,
|
|
51106
|
+
version: def.version
|
|
50861
51107
|
});
|
|
50862
51108
|
},
|
|
50863
51109
|
async serve(argv = process.argv.slice(2), serveOptions = {}) {
|
|
@@ -50897,7 +51143,12 @@ async function serveImpl(name, commands, argv, options = {}) {
|
|
|
50897
51143
|
const exit = options.exit ?? ((code) => process.exit(code));
|
|
50898
51144
|
const { verbose, format: formatFlag, formatExplicit, filterOutput, tokenLimit, tokenOffset, tokenCount, llms, llmsFull, mcp: mcpFlag, help, version: version2, schema, rest: filtered } = extractBuiltinFlags(argv);
|
|
50899
51145
|
if (mcpFlag) {
|
|
50900
|
-
await serve(name, options.version ?? "0.0.0", commands
|
|
51146
|
+
await serve(name, options.version ?? "0.0.0", commands, {
|
|
51147
|
+
middlewares: options.middlewares,
|
|
51148
|
+
env: options.envSchema,
|
|
51149
|
+
vars: options.vars,
|
|
51150
|
+
version: options.version
|
|
51151
|
+
});
|
|
50901
51152
|
return;
|
|
50902
51153
|
}
|
|
50903
51154
|
const completeShell = process.env.COMPLETE;
|
|
@@ -50911,6 +51162,26 @@ async function serveImpl(name, commands, argv, options = {}) {
|
|
|
50911
51162
|
} else {
|
|
50912
51163
|
const index2 = Number(process.env._COMPLETE_INDEX ?? words.length - 1);
|
|
50913
51164
|
const candidates = complete(commands, options.rootCommand, words, index2);
|
|
51165
|
+
const current = words[index2] ?? "";
|
|
51166
|
+
const nonFlags = words.slice(0, index2).filter((w) => !w.startsWith("-"));
|
|
51167
|
+
if (nonFlags.length <= 1) {
|
|
51168
|
+
for (const b of builtinCommands) {
|
|
51169
|
+
if (b.name.startsWith(current) && !candidates.some((c) => c.value === b.name))
|
|
51170
|
+
candidates.push({
|
|
51171
|
+
value: b.name,
|
|
51172
|
+
description: b.description,
|
|
51173
|
+
...b.subcommands ? { noSpace: true } : undefined
|
|
51174
|
+
});
|
|
51175
|
+
}
|
|
51176
|
+
} else if (nonFlags.length === 2) {
|
|
51177
|
+
const parent = nonFlags[nonFlags.length - 1];
|
|
51178
|
+
const builtin = builtinCommands.find((b) => b.name === parent && b.subcommands);
|
|
51179
|
+
if (builtin?.subcommands) {
|
|
51180
|
+
for (const sub of builtin.subcommands)
|
|
51181
|
+
if (sub.name.startsWith(current))
|
|
51182
|
+
candidates.push({ value: sub.name, description: sub.description });
|
|
51183
|
+
}
|
|
51184
|
+
}
|
|
50914
51185
|
const out = format(completeShell, candidates);
|
|
50915
51186
|
if (out)
|
|
50916
51187
|
stdout(out);
|
|
@@ -50987,39 +51258,21 @@ async function serveImpl(name, commands, argv, options = {}) {
|
|
|
50987
51258
|
return -1;
|
|
50988
51259
|
})();
|
|
50989
51260
|
if (completionsIdx !== -1 && filtered[completionsIdx] === "completions") {
|
|
50990
|
-
|
|
50991
|
-
|
|
50992
|
-
|
|
50993
|
-
|
|
50994
|
-
|
|
50995
|
-
|
|
50996
|
-
|
|
50997
|
-
|
|
50998
|
-
|
|
50999
|
-
" nushell",
|
|
51000
|
-
" zsh",
|
|
51001
|
-
"",
|
|
51002
|
-
"Setup:",
|
|
51003
|
-
...(() => {
|
|
51004
|
-
const rows = [
|
|
51005
|
-
["bash", `eval "$(${name} completions bash)"`, "# add to ~/.bashrc"],
|
|
51006
|
-
["zsh", `eval "$(${name} completions zsh)"`, "# add to ~/.zshrc"],
|
|
51007
|
-
["fish", `${name} completions fish | source`, "# add to ~/.config/fish/config.fish"],
|
|
51008
|
-
["nushell", `see \`${name} completions nushell\``, "# add to config.nu"]
|
|
51009
|
-
];
|
|
51010
|
-
const shellW = Math.max(...rows.map((r) => r[0].length));
|
|
51011
|
-
const cmdW = Math.max(...rows.map((r) => r[1].length));
|
|
51012
|
-
return rows.map(([shell2, cmd, comment]) => ` ${shell2.padEnd(shellW)} ${cmd.padEnd(cmdW)} ${comment}`);
|
|
51013
|
-
})()
|
|
51014
|
-
].join(`
|
|
51015
|
-
`));
|
|
51261
|
+
const shell = filtered[completionsIdx + 1];
|
|
51262
|
+
if (help || !shell) {
|
|
51263
|
+
const b = builtinCommands.find((c) => c.name === "completions");
|
|
51264
|
+
writeln(formatCommand(`${name} completions`, {
|
|
51265
|
+
args: b.args,
|
|
51266
|
+
description: b.description,
|
|
51267
|
+
hideGlobalOptions: true,
|
|
51268
|
+
hint: b.hint?.(name)
|
|
51269
|
+
}));
|
|
51016
51270
|
return;
|
|
51017
51271
|
}
|
|
51018
|
-
|
|
51019
|
-
if (!shell || !["bash", "fish", "nushell", "zsh"].includes(shell)) {
|
|
51272
|
+
if (!shells.includes(shell)) {
|
|
51020
51273
|
writeln(formatHumanError({
|
|
51021
51274
|
code: "INVALID_SHELL",
|
|
51022
|
-
message:
|
|
51275
|
+
message: `Unknown shell '${shell}'. Supported: ${shells.join(", ")}`
|
|
51023
51276
|
}));
|
|
51024
51277
|
exit(1);
|
|
51025
51278
|
return;
|
|
@@ -51030,18 +51283,15 @@ async function serveImpl(name, commands, argv, options = {}) {
|
|
|
51030
51283
|
return;
|
|
51031
51284
|
}
|
|
51032
51285
|
const skillsIdx = filtered[0] === "skills" ? 0 : filtered[0] === name && filtered[1] === "skills" ? 1 : -1;
|
|
51033
|
-
if (skillsIdx !== -1 && filtered[skillsIdx] === "skills"
|
|
51286
|
+
if (skillsIdx !== -1 && filtered[skillsIdx] === "skills") {
|
|
51287
|
+
if (filtered[skillsIdx + 1] !== "add") {
|
|
51288
|
+
const b = builtinCommands.find((c) => c.name === "skills");
|
|
51289
|
+
writeln(formatBuiltinHelp(name, b));
|
|
51290
|
+
return;
|
|
51291
|
+
}
|
|
51034
51292
|
if (help) {
|
|
51035
|
-
|
|
51036
|
-
|
|
51037
|
-
"",
|
|
51038
|
-
`Usage: ${name} skills add [options]`,
|
|
51039
|
-
"",
|
|
51040
|
-
"Options:",
|
|
51041
|
-
" --depth <number> Grouping depth for skill files (default: 1)",
|
|
51042
|
-
" --no-global Install to project instead of globally"
|
|
51043
|
-
].join(`
|
|
51044
|
-
`));
|
|
51293
|
+
const b = builtinCommands.find((c) => c.name === "skills");
|
|
51294
|
+
writeln(formatBuiltinSubcommandHelp(name, b, "add"));
|
|
51045
51295
|
return;
|
|
51046
51296
|
}
|
|
51047
51297
|
const rest2 = filtered.slice(skillsIdx + 2);
|
|
@@ -51051,7 +51301,7 @@ async function serveImpl(name, commands, argv, options = {}) {
|
|
|
51051
51301
|
const global = rest2.includes("--no-global") ? false : undefined;
|
|
51052
51302
|
try {
|
|
51053
51303
|
stdout("Syncing...");
|
|
51054
|
-
const
|
|
51304
|
+
const result2 = await sync(name, commands, {
|
|
51055
51305
|
cwd: options.sync?.cwd,
|
|
51056
51306
|
depth,
|
|
51057
51307
|
description: options.description,
|
|
@@ -51061,14 +51311,14 @@ async function serveImpl(name, commands, argv, options = {}) {
|
|
|
51061
51311
|
stdout("\r\x1B[K");
|
|
51062
51312
|
const lines = [];
|
|
51063
51313
|
const skillLabel = (s) => s.external || s.name === name ? s.name : `${name}-${s.name}`;
|
|
51064
|
-
const maxLen = Math.max(...
|
|
51065
|
-
for (const s of
|
|
51314
|
+
const maxLen = Math.max(...result2.skills.map((s) => skillLabel(s).length));
|
|
51315
|
+
for (const s of result2.skills) {
|
|
51066
51316
|
const label = skillLabel(s);
|
|
51067
51317
|
const padding = s.description ? `${" ".repeat(maxLen - label.length)} ${s.description}` : "";
|
|
51068
51318
|
lines.push(` ✓ ${label}${padding}`);
|
|
51069
51319
|
}
|
|
51070
51320
|
lines.push("");
|
|
51071
|
-
lines.push(`${
|
|
51321
|
+
lines.push(`${result2.skills.length} skill${result2.skills.length === 1 ? "" : "s"} synced`);
|
|
51072
51322
|
const suggestions = options.sync?.suggestions;
|
|
51073
51323
|
if (suggestions && suggestions.length > 0) {
|
|
51074
51324
|
lines.push("");
|
|
@@ -51081,9 +51331,9 @@ async function serveImpl(name, commands, argv, options = {}) {
|
|
|
51081
51331
|
writeln(lines.join(`
|
|
51082
51332
|
`));
|
|
51083
51333
|
if (verbose || formatExplicit) {
|
|
51084
|
-
const output = { skills:
|
|
51085
|
-
if (verbose &&
|
|
51086
|
-
output.agents =
|
|
51334
|
+
const output = { skills: result2.paths };
|
|
51335
|
+
if (verbose && result2.agents.length > 0)
|
|
51336
|
+
output.agents = result2.agents;
|
|
51087
51337
|
writeln(format2(output, formatExplicit ? formatFlag : "toon"));
|
|
51088
51338
|
}
|
|
51089
51339
|
} catch (err) {
|
|
@@ -51093,19 +51343,15 @@ async function serveImpl(name, commands, argv, options = {}) {
|
|
|
51093
51343
|
return;
|
|
51094
51344
|
}
|
|
51095
51345
|
const mcpIdx = filtered[0] === "mcp" ? 0 : filtered[0] === name && filtered[1] === "mcp" ? 1 : -1;
|
|
51096
|
-
if (mcpIdx !== -1 && filtered[mcpIdx] === "mcp"
|
|
51346
|
+
if (mcpIdx !== -1 && filtered[mcpIdx] === "mcp") {
|
|
51347
|
+
if (filtered[mcpIdx + 1] !== "add") {
|
|
51348
|
+
const b = builtinCommands.find((c) => c.name === "mcp");
|
|
51349
|
+
writeln(formatBuiltinHelp(name, b));
|
|
51350
|
+
return;
|
|
51351
|
+
}
|
|
51097
51352
|
if (help) {
|
|
51098
|
-
|
|
51099
|
-
|
|
51100
|
-
"",
|
|
51101
|
-
`Usage: ${name} mcp add [options]`,
|
|
51102
|
-
"",
|
|
51103
|
-
"Options:",
|
|
51104
|
-
' -c, --command <cmd> Override the command agents will run (e.g. "pnpm my-cli --mcp")',
|
|
51105
|
-
" --no-global Install to project instead of globally",
|
|
51106
|
-
" --agent <agent> Target a specific agent (e.g. claude-code, cursor)"
|
|
51107
|
-
].join(`
|
|
51108
|
-
`));
|
|
51353
|
+
const b = builtinCommands.find((c) => c.name === "mcp");
|
|
51354
|
+
writeln(formatBuiltinSubcommandHelp(name, b, "add"));
|
|
51109
51355
|
return;
|
|
51110
51356
|
}
|
|
51111
51357
|
const rest2 = filtered.slice(mcpIdx + 2);
|
|
@@ -51120,7 +51366,7 @@ async function serveImpl(name, commands, argv, options = {}) {
|
|
|
51120
51366
|
}
|
|
51121
51367
|
try {
|
|
51122
51368
|
stdout("Registering MCP server...");
|
|
51123
|
-
const
|
|
51369
|
+
const result2 = await register2(name, {
|
|
51124
51370
|
command: command2,
|
|
51125
51371
|
global,
|
|
51126
51372
|
agents
|
|
@@ -51128,8 +51374,8 @@ async function serveImpl(name, commands, argv, options = {}) {
|
|
|
51128
51374
|
stdout("\r\x1B[K");
|
|
51129
51375
|
const lines = [];
|
|
51130
51376
|
lines.push(`✓ Registered ${name} as MCP server`);
|
|
51131
|
-
if (
|
|
51132
|
-
lines.push(` Agents: ${
|
|
51377
|
+
if (result2.agents.length > 0)
|
|
51378
|
+
lines.push(` Agents: ${result2.agents.join(", ")}`);
|
|
51133
51379
|
lines.push("");
|
|
51134
51380
|
lines.push(`Agents can now use ${name} tools.`);
|
|
51135
51381
|
const suggestions = options.sync?.suggestions;
|
|
@@ -51142,7 +51388,7 @@ async function serveImpl(name, commands, argv, options = {}) {
|
|
|
51142
51388
|
writeln(lines.join(`
|
|
51143
51389
|
`));
|
|
51144
51390
|
if (verbose || formatExplicit)
|
|
51145
|
-
writeln(format2({ name, command:
|
|
51391
|
+
writeln(format2({ name, command: result2.command, agents: result2.agents }, formatExplicit ? formatFlag : "toon"));
|
|
51146
51392
|
} catch (err) {
|
|
51147
51393
|
writeln(format2({ code: "MCP_ADD_FAILED", message: err instanceof Error ? err.message : String(err) }, formatExplicit ? formatFlag : "toon"));
|
|
51148
51394
|
exit(1);
|
|
@@ -51275,16 +51521,16 @@ async function serveImpl(name, commands, argv, options = {}) {
|
|
|
51275
51521
|
}
|
|
51276
51522
|
const cmd = resolved.command;
|
|
51277
51523
|
const format4 = formatExplicit ? formatFlag : "toon";
|
|
51278
|
-
const
|
|
51524
|
+
const result2 = {};
|
|
51279
51525
|
if (cmd.args)
|
|
51280
|
-
|
|
51526
|
+
result2.args = toJsonSchema(cmd.args);
|
|
51281
51527
|
if (cmd.env)
|
|
51282
|
-
|
|
51528
|
+
result2.env = toJsonSchema(cmd.env);
|
|
51283
51529
|
if (cmd.options)
|
|
51284
|
-
|
|
51530
|
+
result2.options = toJsonSchema(cmd.options);
|
|
51285
51531
|
if (cmd.output)
|
|
51286
|
-
|
|
51287
|
-
writeln(format2(
|
|
51532
|
+
result2.output = toJsonSchema(cmd.output);
|
|
51533
|
+
writeln(format2(result2, format4));
|
|
51288
51534
|
return;
|
|
51289
51535
|
}
|
|
51290
51536
|
if ("help" in resolved) {
|
|
@@ -51456,8 +51702,8 @@ async function serveImpl(name, commands, argv, options = {}) {
|
|
|
51456
51702
|
try {
|
|
51457
51703
|
const cliEnv = options.envSchema ? parseEnv(options.envSchema, options.env ?? process.env) : {};
|
|
51458
51704
|
if (fetchMiddleware.length > 0) {
|
|
51459
|
-
const
|
|
51460
|
-
const errorFn = (opts) => ({ [
|
|
51705
|
+
const varsMap = options.vars ? options.vars.parse({}) : {};
|
|
51706
|
+
const errorFn = (opts) => ({ [sentinel2]: "error", ...opts });
|
|
51461
51707
|
const mwCtx = {
|
|
51462
51708
|
agent: !human,
|
|
51463
51709
|
command: path4,
|
|
@@ -51467,15 +51713,15 @@ async function serveImpl(name, commands, argv, options = {}) {
|
|
|
51467
51713
|
formatExplicit,
|
|
51468
51714
|
name,
|
|
51469
51715
|
set(key, value) {
|
|
51470
|
-
|
|
51716
|
+
varsMap[key] = value;
|
|
51471
51717
|
},
|
|
51472
|
-
var:
|
|
51718
|
+
var: varsMap,
|
|
51473
51719
|
version: options.version
|
|
51474
51720
|
};
|
|
51475
|
-
const handleMwSentinel = (
|
|
51476
|
-
if (!
|
|
51721
|
+
const handleMwSentinel = (result2) => {
|
|
51722
|
+
if (!isSentinel2(result2) || result2[sentinel2] !== "error")
|
|
51477
51723
|
return;
|
|
51478
|
-
const err =
|
|
51724
|
+
const err = result2;
|
|
51479
51725
|
const cta = formatCtaBlock(name, err.cta);
|
|
51480
51726
|
write({
|
|
51481
51727
|
ok: false,
|
|
@@ -51518,167 +51764,81 @@ async function serveImpl(name, commands, argv, options = {}) {
|
|
|
51518
51764
|
..."middlewares" in resolved ? resolved.middlewares ?? [] : [],
|
|
51519
51765
|
...command.middleware ?? []
|
|
51520
51766
|
];
|
|
51521
|
-
|
|
51522
|
-
|
|
51523
|
-
const
|
|
51524
|
-
|
|
51525
|
-
|
|
51526
|
-
|
|
51527
|
-
|
|
51528
|
-
|
|
51529
|
-
|
|
51530
|
-
|
|
51531
|
-
|
|
51532
|
-
|
|
51533
|
-
|
|
51534
|
-
|
|
51535
|
-
|
|
51536
|
-
|
|
51537
|
-
|
|
51538
|
-
|
|
51539
|
-
|
|
51540
|
-
|
|
51541
|
-
|
|
51542
|
-
|
|
51767
|
+
if (human)
|
|
51768
|
+
emitDeprecationWarnings(rest, command.options, command.alias);
|
|
51769
|
+
const result = await execute(command, {
|
|
51770
|
+
agent: !human,
|
|
51771
|
+
argv: rest,
|
|
51772
|
+
env: options.envSchema,
|
|
51773
|
+
envSource: options.env,
|
|
51774
|
+
format: format3,
|
|
51775
|
+
formatExplicit,
|
|
51776
|
+
inputOptions: {},
|
|
51777
|
+
middlewares: allMiddleware,
|
|
51778
|
+
name,
|
|
51779
|
+
path: path3,
|
|
51780
|
+
vars: options.vars,
|
|
51781
|
+
version: options.version
|
|
51782
|
+
});
|
|
51783
|
+
const duration3 = `${Math.round(performance.now() - start)}ms`;
|
|
51784
|
+
if ("stream" in result) {
|
|
51785
|
+
await handleStreaming(result.stream, {
|
|
51786
|
+
name,
|
|
51787
|
+
path: path3,
|
|
51788
|
+
start,
|
|
51543
51789
|
format: format3,
|
|
51544
51790
|
formatExplicit,
|
|
51545
|
-
|
|
51546
|
-
|
|
51547
|
-
|
|
51548
|
-
|
|
51549
|
-
|
|
51791
|
+
human,
|
|
51792
|
+
renderOutput,
|
|
51793
|
+
verbose,
|
|
51794
|
+
truncate,
|
|
51795
|
+
write,
|
|
51796
|
+
writeln,
|
|
51797
|
+
exit
|
|
51550
51798
|
});
|
|
51551
|
-
|
|
51552
|
-
|
|
51553
|
-
|
|
51554
|
-
|
|
51555
|
-
|
|
51556
|
-
|
|
51557
|
-
|
|
51558
|
-
|
|
51559
|
-
renderOutput,
|
|
51560
|
-
verbose,
|
|
51561
|
-
truncate,
|
|
51562
|
-
write,
|
|
51563
|
-
writeln,
|
|
51564
|
-
exit
|
|
51565
|
-
});
|
|
51566
|
-
return;
|
|
51567
|
-
}
|
|
51568
|
-
const awaited = await result;
|
|
51569
|
-
if (isSentinel(awaited)) {
|
|
51570
|
-
const cta = formatCtaBlock(name, awaited.cta);
|
|
51571
|
-
if (awaited[sentinel] === "ok") {
|
|
51572
|
-
write({
|
|
51573
|
-
ok: true,
|
|
51574
|
-
data: awaited.data,
|
|
51575
|
-
meta: {
|
|
51576
|
-
command: path3,
|
|
51577
|
-
duration: `${Math.round(performance.now() - start)}ms`,
|
|
51578
|
-
...cta ? { cta } : undefined
|
|
51579
|
-
}
|
|
51580
|
-
});
|
|
51581
|
-
} else {
|
|
51582
|
-
const err = awaited;
|
|
51583
|
-
write({
|
|
51584
|
-
ok: false,
|
|
51585
|
-
error: {
|
|
51586
|
-
code: err.code,
|
|
51587
|
-
message: err.message,
|
|
51588
|
-
...err.retryable !== undefined ? { retryable: err.retryable } : undefined
|
|
51589
|
-
},
|
|
51590
|
-
meta: {
|
|
51591
|
-
command: path3,
|
|
51592
|
-
duration: `${Math.round(performance.now() - start)}ms`,
|
|
51593
|
-
...cta ? { cta } : undefined
|
|
51594
|
-
}
|
|
51595
|
-
});
|
|
51596
|
-
exit(err.exitCode ?? 1);
|
|
51597
|
-
}
|
|
51598
|
-
} else {
|
|
51599
|
-
write({
|
|
51600
|
-
ok: true,
|
|
51601
|
-
data: awaited,
|
|
51602
|
-
meta: {
|
|
51603
|
-
command: path3,
|
|
51604
|
-
duration: `${Math.round(performance.now() - start)}ms`
|
|
51605
|
-
}
|
|
51606
|
-
});
|
|
51607
|
-
}
|
|
51608
|
-
};
|
|
51609
|
-
try {
|
|
51610
|
-
const cliEnv = options.envSchema ? parseEnv(options.envSchema, envSource) : {};
|
|
51611
|
-
if (allMiddleware.length > 0) {
|
|
51612
|
-
const errorFn = (opts) => {
|
|
51613
|
-
return { [sentinel]: "error", ...opts };
|
|
51614
|
-
};
|
|
51615
|
-
const mwCtx = {
|
|
51616
|
-
agent: !human,
|
|
51799
|
+
return;
|
|
51800
|
+
}
|
|
51801
|
+
if (result.ok) {
|
|
51802
|
+
const cta = formatCtaBlock(name, result.cta);
|
|
51803
|
+
write({
|
|
51804
|
+
ok: true,
|
|
51805
|
+
data: result.data,
|
|
51806
|
+
meta: {
|
|
51617
51807
|
command: path3,
|
|
51618
|
-
|
|
51619
|
-
|
|
51620
|
-
|
|
51621
|
-
|
|
51622
|
-
|
|
51623
|
-
|
|
51624
|
-
|
|
51625
|
-
|
|
51626
|
-
|
|
51627
|
-
|
|
51628
|
-
};
|
|
51629
|
-
|
|
51630
|
-
|
|
51631
|
-
return;
|
|
51632
|
-
const err = result;
|
|
51633
|
-
const cta = formatCtaBlock(name, err.cta);
|
|
51634
|
-
write({
|
|
51635
|
-
ok: false,
|
|
51636
|
-
error: {
|
|
51637
|
-
code: err.code,
|
|
51638
|
-
message: err.message,
|
|
51639
|
-
...err.retryable !== undefined ? { retryable: err.retryable } : undefined
|
|
51640
|
-
},
|
|
51641
|
-
meta: {
|
|
51642
|
-
command: path3,
|
|
51643
|
-
duration: `${Math.round(performance.now() - start)}ms`,
|
|
51644
|
-
...cta ? { cta } : undefined
|
|
51645
|
-
}
|
|
51646
|
-
});
|
|
51647
|
-
exit(err.exitCode ?? 1);
|
|
51648
|
-
};
|
|
51649
|
-
const composed = allMiddleware.reduceRight((next, mw) => async () => {
|
|
51650
|
-
handleMwSentinel(await mw(mwCtx, next));
|
|
51651
|
-
}, runCommand);
|
|
51652
|
-
await composed();
|
|
51653
|
-
} else {
|
|
51654
|
-
await runCommand();
|
|
51808
|
+
duration: duration3,
|
|
51809
|
+
...cta ? { cta } : undefined
|
|
51810
|
+
}
|
|
51811
|
+
});
|
|
51812
|
+
} else {
|
|
51813
|
+
const cta = formatCtaBlock(name, result.cta);
|
|
51814
|
+
if (human && !formatExplicit && result.error.fieldErrors) {
|
|
51815
|
+
writeln(formatHumanValidationError(name, path3, command, new ValidationError({
|
|
51816
|
+
message: result.error.message,
|
|
51817
|
+
fieldErrors: result.error.fieldErrors
|
|
51818
|
+
}), options.env));
|
|
51819
|
+
exit(1);
|
|
51820
|
+
return;
|
|
51655
51821
|
}
|
|
51656
|
-
|
|
51657
|
-
const errorOutput = {
|
|
51822
|
+
write({
|
|
51658
51823
|
ok: false,
|
|
51659
51824
|
error: {
|
|
51660
|
-
code:
|
|
51661
|
-
message:
|
|
51662
|
-
...
|
|
51663
|
-
...
|
|
51825
|
+
code: result.error.code,
|
|
51826
|
+
message: result.error.message,
|
|
51827
|
+
...result.error.retryable !== undefined ? { retryable: result.error.retryable } : undefined,
|
|
51828
|
+
...result.error.fieldErrors ? { fieldErrors: result.error.fieldErrors } : undefined
|
|
51664
51829
|
},
|
|
51665
51830
|
meta: {
|
|
51666
51831
|
command: path3,
|
|
51667
|
-
duration:
|
|
51832
|
+
duration: duration3,
|
|
51833
|
+
...cta ? { cta } : undefined
|
|
51668
51834
|
}
|
|
51669
|
-
};
|
|
51670
|
-
|
|
51671
|
-
writeln(formatHumanValidationError(name, path3, command, error48, options.env));
|
|
51672
|
-
exit(1);
|
|
51673
|
-
return;
|
|
51674
|
-
}
|
|
51675
|
-
write(errorOutput);
|
|
51676
|
-
exit(error48 instanceof IncurError ? error48.exitCode ?? 1 : 1);
|
|
51835
|
+
});
|
|
51836
|
+
exit(result.exitCode ?? 1);
|
|
51677
51837
|
}
|
|
51678
51838
|
}
|
|
51679
51839
|
function createMcpHttpHandler(name, version2) {
|
|
51680
51840
|
let transport;
|
|
51681
|
-
return async (req, commands) => {
|
|
51841
|
+
return async (req, commands, mcpOptions) => {
|
|
51682
51842
|
if (!transport) {
|
|
51683
51843
|
const { McpServer: McpServer2 } = await Promise.resolve().then(() => (init_mcp(), exports_mcp));
|
|
51684
51844
|
const { WebStandardStreamableHTTPServerTransport: WebStandardStreamableHTTPServerTransport2 } = await Promise.resolve().then(() => (init_webStandardStreamableHttp(), exports_webStandardStreamableHttp));
|
|
@@ -51694,7 +51854,13 @@ function createMcpHttpHandler(name, version2) {
|
|
|
51694
51854
|
...hasInput ? { inputSchema: mergedShape } : undefined
|
|
51695
51855
|
}, async (...callArgs) => {
|
|
51696
51856
|
const params = hasInput ? callArgs[0] : {};
|
|
51697
|
-
return callTool(tool, params
|
|
51857
|
+
return callTool(tool, params, {
|
|
51858
|
+
name,
|
|
51859
|
+
version: version2,
|
|
51860
|
+
middlewares: mcpOptions?.middlewares,
|
|
51861
|
+
env: mcpOptions?.env,
|
|
51862
|
+
vars: mcpOptions?.vars
|
|
51863
|
+
});
|
|
51698
51864
|
});
|
|
51699
51865
|
}
|
|
51700
51866
|
transport = new WebStandardStreamableHTTPServerTransport2({
|
|
@@ -51711,7 +51877,11 @@ async function fetchImpl(name, commands, req, options = {}) {
|
|
|
51711
51877
|
const url2 = new URL(req.url);
|
|
51712
51878
|
const segments = url2.pathname.split("/").filter(Boolean);
|
|
51713
51879
|
if (segments[0] === "mcp" && segments.length === 1 && options.mcpHandler)
|
|
51714
|
-
return options.mcpHandler(req, commands
|
|
51880
|
+
return options.mcpHandler(req, commands, {
|
|
51881
|
+
middlewares: options.middlewares,
|
|
51882
|
+
env: options.envSchema,
|
|
51883
|
+
vars: options.vars
|
|
51884
|
+
});
|
|
51715
51885
|
if (segments[0] === ".well-known" && segments[1] === "skills" && segments.length >= 3 && req.method === "GET") {
|
|
51716
51886
|
const groups = new Map;
|
|
51717
51887
|
const cmds = collectSkillCommands(commands, [], groups);
|
|
@@ -51791,7 +51961,11 @@ async function fetchImpl(name, commands, req, options = {}) {
|
|
|
51791
51961
|
if ("fetchGateway" in resolved)
|
|
51792
51962
|
return resolved.fetchGateway.fetch(req);
|
|
51793
51963
|
const { command, path: path3, rest } = resolved;
|
|
51794
|
-
|
|
51964
|
+
const groupMiddlewares = "middlewares" in resolved ? resolved.middlewares : [];
|
|
51965
|
+
return executeCommand(path3, command, rest, inputOptions, start, {
|
|
51966
|
+
...options,
|
|
51967
|
+
groupMiddlewares
|
|
51968
|
+
});
|
|
51795
51969
|
}
|
|
51796
51970
|
async function executeCommand(path3, command, rest, inputOptions, start, options) {
|
|
51797
51971
|
function jsonResponse(body, status) {
|
|
@@ -51800,153 +51974,86 @@ async function executeCommand(path3, command, rest, inputOptions, start, options
|
|
|
51800
51974
|
headers: { "content-type": "application/json" }
|
|
51801
51975
|
});
|
|
51802
51976
|
}
|
|
51803
|
-
const
|
|
51804
|
-
|
|
51805
|
-
|
|
51806
|
-
|
|
51807
|
-
|
|
51808
|
-
|
|
51809
|
-
|
|
51810
|
-
|
|
51811
|
-
|
|
51812
|
-
|
|
51813
|
-
|
|
51814
|
-
|
|
51815
|
-
|
|
51816
|
-
|
|
51817
|
-
|
|
51818
|
-
|
|
51819
|
-
|
|
51820
|
-
|
|
51821
|
-
|
|
51822
|
-
|
|
51823
|
-
|
|
51824
|
-
|
|
51825
|
-
|
|
51826
|
-
|
|
51827
|
-
|
|
51828
|
-
|
|
51829
|
-
|
|
51830
|
-
while (true) {
|
|
51831
|
-
const { value, done } = await result.next();
|
|
51832
|
-
if (done) {
|
|
51833
|
-
returnValue = value;
|
|
51834
|
-
break;
|
|
51835
|
-
}
|
|
51836
|
-
if (isSentinel(value) && value[sentinel] === "error") {
|
|
51837
|
-
const tagged = value;
|
|
51838
|
-
controller.enqueue(encoder.encode(JSON.stringify({
|
|
51839
|
-
type: "error",
|
|
51840
|
-
ok: false,
|
|
51841
|
-
error: { code: tagged.code, message: tagged.message }
|
|
51842
|
-
}) + `
|
|
51843
|
-
`));
|
|
51844
|
-
controller.close();
|
|
51845
|
-
return;
|
|
51846
|
-
}
|
|
51847
|
-
controller.enqueue(encoder.encode(JSON.stringify({ type: "chunk", data: value }) + `
|
|
51848
|
-
`));
|
|
51849
|
-
}
|
|
51850
|
-
const meta3 = { command: path3 };
|
|
51851
|
-
if (isSentinel(returnValue) && returnValue[sentinel] === "error") {
|
|
51852
|
-
const tagged = returnValue;
|
|
51853
|
-
controller.enqueue(encoder.encode(JSON.stringify({
|
|
51854
|
-
type: "error",
|
|
51855
|
-
ok: false,
|
|
51856
|
-
error: { code: tagged.code, message: tagged.message }
|
|
51857
|
-
}) + `
|
|
51977
|
+
const allMiddleware = [
|
|
51978
|
+
...options.middlewares ?? [],
|
|
51979
|
+
...options.groupMiddlewares ?? [],
|
|
51980
|
+
...command.middleware ?? []
|
|
51981
|
+
];
|
|
51982
|
+
const result = await execute(command, {
|
|
51983
|
+
agent: true,
|
|
51984
|
+
argv: rest,
|
|
51985
|
+
env: options.envSchema,
|
|
51986
|
+
format: "json",
|
|
51987
|
+
formatExplicit: true,
|
|
51988
|
+
inputOptions,
|
|
51989
|
+
middlewares: allMiddleware,
|
|
51990
|
+
name: options.name ?? path3,
|
|
51991
|
+
parseMode: "split",
|
|
51992
|
+
path: path3,
|
|
51993
|
+
vars: options.vars,
|
|
51994
|
+
version: options.version
|
|
51995
|
+
});
|
|
51996
|
+
const duration3 = `${Math.round(performance.now() - start)}ms`;
|
|
51997
|
+
if ("stream" in result) {
|
|
51998
|
+
const stream = new ReadableStream({
|
|
51999
|
+
async start(controller) {
|
|
52000
|
+
const encoder = new TextEncoder;
|
|
52001
|
+
try {
|
|
52002
|
+
for await (const value of result.stream) {
|
|
52003
|
+
controller.enqueue(encoder.encode(JSON.stringify({ type: "chunk", data: value }) + `
|
|
51858
52004
|
`));
|
|
51859
|
-
|
|
51860
|
-
|
|
52005
|
+
}
|
|
52006
|
+
controller.enqueue(encoder.encode(JSON.stringify({
|
|
52007
|
+
type: "done",
|
|
52008
|
+
ok: true,
|
|
52009
|
+
meta: { command: path3 }
|
|
52010
|
+
}) + `
|
|
51861
52011
|
`));
|
|
52012
|
+
} catch (error48) {
|
|
52013
|
+
controller.enqueue(encoder.encode(JSON.stringify({
|
|
52014
|
+
type: "error",
|
|
52015
|
+
ok: false,
|
|
52016
|
+
error: {
|
|
52017
|
+
code: "UNKNOWN",
|
|
52018
|
+
message: error48 instanceof Error ? error48.message : String(error48)
|
|
51862
52019
|
}
|
|
51863
|
-
}
|
|
51864
|
-
controller.enqueue(encoder.encode(JSON.stringify({
|
|
51865
|
-
type: "error",
|
|
51866
|
-
ok: false,
|
|
51867
|
-
error: {
|
|
51868
|
-
code: "UNKNOWN",
|
|
51869
|
-
message: error48 instanceof Error ? error48.message : String(error48)
|
|
51870
|
-
}
|
|
51871
|
-
}) + `
|
|
52020
|
+
}) + `
|
|
51872
52021
|
`));
|
|
51873
|
-
}
|
|
51874
|
-
controller.close();
|
|
51875
52022
|
}
|
|
51876
|
-
|
|
51877
|
-
|
|
51878
|
-
|
|
51879
|
-
|
|
51880
|
-
|
|
51881
|
-
|
|
51882
|
-
}
|
|
51883
|
-
|
|
51884
|
-
|
|
51885
|
-
|
|
51886
|
-
const tagged = awaited;
|
|
51887
|
-
if (tagged[sentinel_] === "error")
|
|
51888
|
-
response = jsonResponse({
|
|
51889
|
-
ok: false,
|
|
51890
|
-
error: { code: tagged.code, message: tagged.message },
|
|
51891
|
-
meta: { command: path3, duration: duration3 }
|
|
51892
|
-
}, 500);
|
|
51893
|
-
else
|
|
51894
|
-
response = jsonResponse({ ok: true, data: tagged.data, meta: { command: path3, duration: duration3 } }, 200);
|
|
51895
|
-
return;
|
|
51896
|
-
}
|
|
51897
|
-
response = jsonResponse({ ok: true, data: awaited, meta: { command: path3, duration: duration3 } }, 200);
|
|
51898
|
-
};
|
|
51899
|
-
try {
|
|
51900
|
-
const allMiddleware = options.middlewares ?? [];
|
|
51901
|
-
if (allMiddleware.length > 0) {
|
|
51902
|
-
const errorFn = (opts) => {
|
|
51903
|
-
const duration3 = `${Math.round(performance.now() - start)}ms`;
|
|
51904
|
-
response = jsonResponse({
|
|
51905
|
-
ok: false,
|
|
51906
|
-
error: { code: opts.code, message: opts.message },
|
|
51907
|
-
meta: { command: path3, duration: duration3 }
|
|
51908
|
-
}, 500);
|
|
51909
|
-
return;
|
|
51910
|
-
};
|
|
51911
|
-
const mwCtx = {
|
|
51912
|
-
agent: true,
|
|
51913
|
-
command: path3,
|
|
51914
|
-
env: {},
|
|
51915
|
-
error: errorFn,
|
|
51916
|
-
format: "json",
|
|
51917
|
-
formatExplicit: true,
|
|
51918
|
-
name: path3,
|
|
51919
|
-
set(key, value) {
|
|
51920
|
-
varsMap[key] = value;
|
|
51921
|
-
},
|
|
51922
|
-
var: varsMap,
|
|
51923
|
-
version: undefined
|
|
51924
|
-
};
|
|
51925
|
-
const composed = allMiddleware.reduceRight((next, mw) => async () => {
|
|
51926
|
-
await mw(mwCtx, next);
|
|
51927
|
-
}, runCommand);
|
|
51928
|
-
await composed();
|
|
51929
|
-
} else {
|
|
51930
|
-
await runCommand();
|
|
51931
|
-
}
|
|
51932
|
-
} catch (error48) {
|
|
51933
|
-
const duration3 = `${Math.round(performance.now() - start)}ms`;
|
|
51934
|
-
if (error48 instanceof ValidationError)
|
|
51935
|
-
return jsonResponse({
|
|
51936
|
-
ok: false,
|
|
51937
|
-
error: { code: "VALIDATION_ERROR", message: error48.message },
|
|
51938
|
-
meta: { command: path3, duration: duration3 }
|
|
51939
|
-
}, 400);
|
|
52023
|
+
controller.close();
|
|
52024
|
+
}
|
|
52025
|
+
});
|
|
52026
|
+
return new Response(stream, {
|
|
52027
|
+
status: 200,
|
|
52028
|
+
headers: { "content-type": "application/x-ndjson" }
|
|
52029
|
+
});
|
|
52030
|
+
}
|
|
52031
|
+
if (!result.ok) {
|
|
52032
|
+
const cta2 = formatCtaBlock(options.name ?? path3, result.cta);
|
|
51940
52033
|
return jsonResponse({
|
|
51941
52034
|
ok: false,
|
|
51942
52035
|
error: {
|
|
51943
|
-
code:
|
|
51944
|
-
message:
|
|
52036
|
+
code: result.error.code,
|
|
52037
|
+
message: result.error.message,
|
|
52038
|
+
...result.error.retryable !== undefined ? { retryable: result.error.retryable } : undefined
|
|
51945
52039
|
},
|
|
51946
|
-
meta: {
|
|
51947
|
-
|
|
52040
|
+
meta: {
|
|
52041
|
+
command: path3,
|
|
52042
|
+
duration: duration3,
|
|
52043
|
+
...cta2 ? { cta: cta2 } : undefined
|
|
52044
|
+
}
|
|
52045
|
+
}, result.error.code === "VALIDATION_ERROR" ? 400 : 500);
|
|
51948
52046
|
}
|
|
51949
|
-
|
|
52047
|
+
const cta = formatCtaBlock(options.name ?? path3, result.cta);
|
|
52048
|
+
return jsonResponse({
|
|
52049
|
+
ok: true,
|
|
52050
|
+
data: result.data,
|
|
52051
|
+
meta: {
|
|
52052
|
+
command: path3,
|
|
52053
|
+
duration: duration3,
|
|
52054
|
+
...cta ? { cta } : undefined
|
|
52055
|
+
}
|
|
52056
|
+
}, 200);
|
|
51950
52057
|
}
|
|
51951
52058
|
function formatHumanValidationError(cli, path3, command, error48, envSource) {
|
|
51952
52059
|
const lines = [];
|
|
@@ -52103,6 +52210,21 @@ function collectHelpCommands(commands) {
|
|
|
52103
52210
|
}
|
|
52104
52211
|
return result.sort((a, b) => a.name.localeCompare(b.name));
|
|
52105
52212
|
}
|
|
52213
|
+
function formatBuiltinHelp(cli, builtin) {
|
|
52214
|
+
return formatRoot(`${cli} ${builtin.name}`, {
|
|
52215
|
+
description: builtin.description,
|
|
52216
|
+
commands: builtin.subcommands?.map((s) => ({ name: s.name, description: s.description }))
|
|
52217
|
+
});
|
|
52218
|
+
}
|
|
52219
|
+
function formatBuiltinSubcommandHelp(cli, builtin, subName) {
|
|
52220
|
+
const sub = builtin.subcommands?.find((s) => s.name === subName);
|
|
52221
|
+
return formatCommand(`${cli} ${builtin.name} ${subName}`, {
|
|
52222
|
+
alias: sub?.alias,
|
|
52223
|
+
description: sub?.description,
|
|
52224
|
+
hideGlobalOptions: true,
|
|
52225
|
+
options: sub?.options
|
|
52226
|
+
});
|
|
52227
|
+
}
|
|
52106
52228
|
function formatFetchHelp(name, description) {
|
|
52107
52229
|
const lines = [];
|
|
52108
52230
|
if (description)
|
|
@@ -52133,7 +52255,7 @@ var toCommands = new WeakMap;
|
|
|
52133
52255
|
var toMiddlewares = new WeakMap;
|
|
52134
52256
|
var toRootDefinition = new WeakMap;
|
|
52135
52257
|
var toOutputPolicy = new WeakMap;
|
|
52136
|
-
var
|
|
52258
|
+
var sentinel2 = Symbol.for("incur.sentinel");
|
|
52137
52259
|
function formatHumanError(error48) {
|
|
52138
52260
|
const prefix = error48.code === "UNKNOWN" || error48.code === "COMMAND_NOT_FOUND" ? "Error" : `Error (${error48.code})`;
|
|
52139
52261
|
let out = `${prefix}: ${error48.message}`;
|
|
@@ -52156,11 +52278,8 @@ function formatHumanCta(cta) {
|
|
|
52156
52278
|
function hasRequiredArgs(args) {
|
|
52157
52279
|
return Object.values(args.shape).some((field) => field._zod.optout !== "optional");
|
|
52158
52280
|
}
|
|
52159
|
-
function
|
|
52160
|
-
return typeof value === "object" && value !== null &&
|
|
52161
|
-
}
|
|
52162
|
-
function isAsyncGenerator2(value) {
|
|
52163
|
-
return typeof value === "object" && value !== null && Symbol.asyncIterator in value && typeof value.next === "function";
|
|
52281
|
+
function isSentinel2(value) {
|
|
52282
|
+
return typeof value === "object" && value !== null && sentinel2 in value;
|
|
52164
52283
|
}
|
|
52165
52284
|
async function handleStreaming(generator, ctx) {
|
|
52166
52285
|
const useJsonl = ctx.format === "jsonl";
|
|
@@ -52174,9 +52293,9 @@ async function handleStreaming(generator, ctx) {
|
|
|
52174
52293
|
returnValue = value;
|
|
52175
52294
|
break;
|
|
52176
52295
|
}
|
|
52177
|
-
if (
|
|
52296
|
+
if (isSentinel2(value)) {
|
|
52178
52297
|
const tagged = value;
|
|
52179
|
-
if (tagged[
|
|
52298
|
+
if (tagged[sentinel2] === "error") {
|
|
52180
52299
|
if (useJsonl)
|
|
52181
52300
|
ctx.writeln(JSON.stringify({
|
|
52182
52301
|
type: "error",
|
|
@@ -52198,7 +52317,7 @@ async function handleStreaming(generator, ctx) {
|
|
|
52198
52317
|
else if (ctx.renderOutput)
|
|
52199
52318
|
ctx.writeln(ctx.truncate(format2(value, ctx.format)).text);
|
|
52200
52319
|
}
|
|
52201
|
-
if (
|
|
52320
|
+
if (isSentinel2(returnValue) && returnValue[sentinel2] === "error") {
|
|
52202
52321
|
const err = returnValue;
|
|
52203
52322
|
if (useJsonl)
|
|
52204
52323
|
ctx.writeln(JSON.stringify({
|
|
@@ -52215,7 +52334,7 @@ async function handleStreaming(generator, ctx) {
|
|
|
52215
52334
|
ctx.exit(err.exitCode ?? 1);
|
|
52216
52335
|
return;
|
|
52217
52336
|
}
|
|
52218
|
-
const cta =
|
|
52337
|
+
const cta = isSentinel2(returnValue) && returnValue[sentinel2] === "ok" ? formatCtaBlock(ctx.name, returnValue.cta) : undefined;
|
|
52219
52338
|
if (useJsonl)
|
|
52220
52339
|
ctx.writeln(JSON.stringify({
|
|
52221
52340
|
type: "done",
|
|
@@ -52255,9 +52374,9 @@ async function handleStreaming(generator, ctx) {
|
|
|
52255
52374
|
returnValue = value;
|
|
52256
52375
|
break;
|
|
52257
52376
|
}
|
|
52258
|
-
if (
|
|
52377
|
+
if (isSentinel2(value)) {
|
|
52259
52378
|
const tagged = value;
|
|
52260
|
-
if (tagged[
|
|
52379
|
+
if (tagged[sentinel2] === "error") {
|
|
52261
52380
|
ctx.write({
|
|
52262
52381
|
ok: false,
|
|
52263
52382
|
error: {
|
|
@@ -52276,7 +52395,7 @@ async function handleStreaming(generator, ctx) {
|
|
|
52276
52395
|
}
|
|
52277
52396
|
chunks.push(value);
|
|
52278
52397
|
}
|
|
52279
|
-
if (
|
|
52398
|
+
if (isSentinel2(returnValue) && returnValue[sentinel2] === "error") {
|
|
52280
52399
|
const err = returnValue;
|
|
52281
52400
|
ctx.write({
|
|
52282
52401
|
ok: false,
|
|
@@ -52293,7 +52412,7 @@ async function handleStreaming(generator, ctx) {
|
|
|
52293
52412
|
ctx.exit(err.exitCode ?? 1);
|
|
52294
52413
|
return;
|
|
52295
52414
|
}
|
|
52296
|
-
const cta =
|
|
52415
|
+
const cta = isSentinel2(returnValue) && returnValue[sentinel2] === "ok" ? formatCtaBlock(ctx.name, returnValue.cta) : undefined;
|
|
52297
52416
|
ctx.write({
|
|
52298
52417
|
ok: true,
|
|
52299
52418
|
data: chunks,
|
|
@@ -52513,7 +52632,7 @@ function emitDeprecationWarnings(argv, optionsSchema, alias) {
|
|
|
52513
52632
|
}
|
|
52514
52633
|
}
|
|
52515
52634
|
}
|
|
52516
|
-
// ../../node_modules/.bun/@orpc+shared@1.13.
|
|
52635
|
+
// ../../node_modules/.bun/@orpc+shared@1.13.9+460773ef8ff1e07c/node_modules/@orpc/shared/dist/index.mjs
|
|
52517
52636
|
function resolveMaybeOptionalOptions(rest) {
|
|
52518
52637
|
return rest[0] ?? {};
|
|
52519
52638
|
}
|
|
@@ -52522,7 +52641,7 @@ function toArray(value) {
|
|
|
52522
52641
|
}
|
|
52523
52642
|
var ORPC_NAME = "orpc";
|
|
52524
52643
|
var ORPC_SHARED_PACKAGE_NAME = "@orpc/shared";
|
|
52525
|
-
var ORPC_SHARED_PACKAGE_VERSION = "1.13.
|
|
52644
|
+
var ORPC_SHARED_PACKAGE_VERSION = "1.13.9";
|
|
52526
52645
|
|
|
52527
52646
|
class AbortError extends Error {
|
|
52528
52647
|
constructor(...rest) {
|
|
@@ -52876,9 +52995,9 @@ function tryDecodeURIComponent(value) {
|
|
|
52876
52995
|
return value;
|
|
52877
52996
|
}
|
|
52878
52997
|
}
|
|
52879
|
-
// ../../node_modules/.bun/@orpc+client@1.13.
|
|
52998
|
+
// ../../node_modules/.bun/@orpc+client@1.13.9+460773ef8ff1e07c/node_modules/@orpc/client/dist/shared/client.Bgxs8zrP.mjs
|
|
52880
52999
|
var ORPC_CLIENT_PACKAGE_NAME = "@orpc/client";
|
|
52881
|
-
var ORPC_CLIENT_PACKAGE_VERSION = "1.13.
|
|
53000
|
+
var ORPC_CLIENT_PACKAGE_VERSION = "1.13.9";
|
|
52882
53001
|
var COMMON_ORPC_ERROR_DEFS = {
|
|
52883
53002
|
BAD_REQUEST: {
|
|
52884
53003
|
status: 400,
|
|
@@ -53029,7 +53148,7 @@ function createORPCErrorFromJson(json2, options = {}) {
|
|
|
53029
53148
|
...json2
|
|
53030
53149
|
});
|
|
53031
53150
|
}
|
|
53032
|
-
// ../../node_modules/.bun/@orpc+standard-server@1.13.
|
|
53151
|
+
// ../../node_modules/.bun/@orpc+standard-server@1.13.9+460773ef8ff1e07c/node_modules/@orpc/standard-server/dist/index.mjs
|
|
53033
53152
|
class EventEncoderError extends TypeError {
|
|
53034
53153
|
}
|
|
53035
53154
|
|
|
@@ -53236,7 +53355,7 @@ function getFilenameFromContentDisposition(contentDisposition) {
|
|
|
53236
53355
|
}
|
|
53237
53356
|
}
|
|
53238
53357
|
|
|
53239
|
-
// ../../node_modules/.bun/@orpc+client@1.13.
|
|
53358
|
+
// ../../node_modules/.bun/@orpc+client@1.13.9+460773ef8ff1e07c/node_modules/@orpc/client/dist/shared/client.BLtwTQUg.mjs
|
|
53240
53359
|
function mapEventIterator(iterator, maps) {
|
|
53241
53360
|
const mapError = async (error48) => {
|
|
53242
53361
|
let mappedError = await maps.error(error48);
|
|
@@ -53272,7 +53391,7 @@ function mapEventIterator(iterator, maps) {
|
|
|
53272
53391
|
}
|
|
53273
53392
|
});
|
|
53274
53393
|
}
|
|
53275
|
-
// ../../node_modules/.bun/@orpc+client@1.13.
|
|
53394
|
+
// ../../node_modules/.bun/@orpc+client@1.13.9+460773ef8ff1e07c/node_modules/@orpc/client/dist/index.mjs
|
|
53276
53395
|
function resolveFriendlyClientOptions(options) {
|
|
53277
53396
|
return {
|
|
53278
53397
|
...options,
|
|
@@ -53298,7 +53417,7 @@ function createORPCClient(link, options = {}) {
|
|
|
53298
53417
|
return preventNativeAwait(recursive);
|
|
53299
53418
|
}
|
|
53300
53419
|
|
|
53301
|
-
// ../../node_modules/.bun/@orpc+contract@1.13.
|
|
53420
|
+
// ../../node_modules/.bun/@orpc+contract@1.13.9+460773ef8ff1e07c/node_modules/@orpc/contract/dist/shared/contract.D_dZrO__.mjs
|
|
53302
53421
|
class ValidationError2 extends Error {
|
|
53303
53422
|
issues;
|
|
53304
53423
|
data;
|
|
@@ -53346,7 +53465,7 @@ function isContractProcedure(item) {
|
|
|
53346
53465
|
return (typeof item === "object" || typeof item === "function") && item !== null && "~orpc" in item && typeof item["~orpc"] === "object" && item["~orpc"] !== null && "errorMap" in item["~orpc"] && "route" in item["~orpc"] && "meta" in item["~orpc"];
|
|
53347
53466
|
}
|
|
53348
53467
|
|
|
53349
|
-
// ../../node_modules/.bun/@orpc+contract@1.13.
|
|
53468
|
+
// ../../node_modules/.bun/@orpc+contract@1.13.9+460773ef8ff1e07c/node_modules/@orpc/contract/dist/plugins/index.mjs
|
|
53350
53469
|
class RequestValidationPluginError extends Error {
|
|
53351
53470
|
}
|
|
53352
53471
|
|
|
@@ -53420,7 +53539,7 @@ class ResponseValidationPlugin {
|
|
|
53420
53539
|
}
|
|
53421
53540
|
}
|
|
53422
53541
|
|
|
53423
|
-
// ../../node_modules/.bun/@orpc+standard-server-fetch@1.13.
|
|
53542
|
+
// ../../node_modules/.bun/@orpc+standard-server-fetch@1.13.9+460773ef8ff1e07c/node_modules/@orpc/standard-server-fetch/dist/index.mjs
|
|
53424
53543
|
function toEventIterator(stream, options = {}) {
|
|
53425
53544
|
const eventStream = stream?.pipeThrough(new TextDecoderStream).pipeThrough(new EventDecoderStream);
|
|
53426
53545
|
const reader = eventStream?.getReader();
|
|
@@ -53683,7 +53802,7 @@ function toStandardLazyResponse(response, options = {}) {
|
|
|
53683
53802
|
};
|
|
53684
53803
|
}
|
|
53685
53804
|
|
|
53686
|
-
// ../../node_modules/.bun/@orpc+client@1.13.
|
|
53805
|
+
// ../../node_modules/.bun/@orpc+client@1.13.9+460773ef8ff1e07c/node_modules/@orpc/client/dist/shared/client.TRDYYcFE.mjs
|
|
53687
53806
|
class CompositeStandardLinkPlugin {
|
|
53688
53807
|
plugins;
|
|
53689
53808
|
constructor(plugins = []) {
|
|
@@ -53813,7 +53932,7 @@ class StandardRPCSerializer {
|
|
|
53813
53932
|
}
|
|
53814
53933
|
}
|
|
53815
53934
|
|
|
53816
|
-
// ../../node_modules/.bun/@orpc+client@1.13.
|
|
53935
|
+
// ../../node_modules/.bun/@orpc+client@1.13.9+460773ef8ff1e07c/node_modules/@orpc/client/dist/adapters/fetch/index.mjs
|
|
53817
53936
|
class CompositeLinkFetchPlugin extends CompositeStandardLinkPlugin {
|
|
53818
53937
|
initRuntimeAdapter(options) {
|
|
53819
53938
|
for (const plugin of this.plugins) {
|
|
@@ -53840,7 +53959,7 @@ class LinkFetchClient {
|
|
|
53840
53959
|
return lazyResponse;
|
|
53841
53960
|
}
|
|
53842
53961
|
}
|
|
53843
|
-
// ../../node_modules/.bun/@orpc+contract@1.13.
|
|
53962
|
+
// ../../node_modules/.bun/@orpc+contract@1.13.9+460773ef8ff1e07c/node_modules/@orpc/contract/dist/index.mjs
|
|
53844
53963
|
function mergeMeta(meta1, meta22) {
|
|
53845
53964
|
return { ...meta1, ...meta22 };
|
|
53846
53965
|
}
|
|
@@ -54034,7 +54153,7 @@ init_zod();
|
|
|
54034
54153
|
init_zod();
|
|
54035
54154
|
init_zod();
|
|
54036
54155
|
init_zod();
|
|
54037
|
-
// ../../node_modules/.bun/viem@2.47.
|
|
54156
|
+
// ../../node_modules/.bun/viem@2.47.6+10bb0f8eb665a8bc/node_modules/viem/_esm/utils/data/isHex.js
|
|
54038
54157
|
function isHex(value2, { strict = true } = {}) {
|
|
54039
54158
|
if (!value2)
|
|
54040
54159
|
return false;
|
|
@@ -54043,17 +54162,17 @@ function isHex(value2, { strict = true } = {}) {
|
|
|
54043
54162
|
return strict ? /^0x[0-9a-fA-F]*$/.test(value2) : value2.startsWith("0x");
|
|
54044
54163
|
}
|
|
54045
54164
|
|
|
54046
|
-
// ../../node_modules/.bun/viem@2.47.
|
|
54165
|
+
// ../../node_modules/.bun/viem@2.47.6+10bb0f8eb665a8bc/node_modules/viem/_esm/utils/data/size.js
|
|
54047
54166
|
function size(value2) {
|
|
54048
54167
|
if (isHex(value2, { strict: false }))
|
|
54049
54168
|
return Math.ceil((value2.length - 2) / 2);
|
|
54050
54169
|
return value2.length;
|
|
54051
54170
|
}
|
|
54052
54171
|
|
|
54053
|
-
// ../../node_modules/.bun/viem@2.47.
|
|
54054
|
-
var version2 = "2.47.
|
|
54172
|
+
// ../../node_modules/.bun/viem@2.47.6+10bb0f8eb665a8bc/node_modules/viem/_esm/errors/version.js
|
|
54173
|
+
var version2 = "2.47.6";
|
|
54055
54174
|
|
|
54056
|
-
// ../../node_modules/.bun/viem@2.47.
|
|
54175
|
+
// ../../node_modules/.bun/viem@2.47.6+10bb0f8eb665a8bc/node_modules/viem/_esm/errors/base.js
|
|
54057
54176
|
var errorConfig = {
|
|
54058
54177
|
getDocsUrl: ({ docsBaseUrl, docsPath = "", docsSlug }) => docsPath ? `${docsBaseUrl ?? "https://viem.sh"}${docsPath}${docsSlug ? `#${docsSlug}` : ""}` : undefined,
|
|
54059
54178
|
version: `viem@${version2}`
|
|
@@ -54138,7 +54257,7 @@ function walk2(err, fn) {
|
|
|
54138
54257
|
return fn ? null : err;
|
|
54139
54258
|
}
|
|
54140
54259
|
|
|
54141
|
-
// ../../node_modules/.bun/viem@2.47.
|
|
54260
|
+
// ../../node_modules/.bun/viem@2.47.6+10bb0f8eb665a8bc/node_modules/viem/_esm/errors/address.js
|
|
54142
54261
|
class InvalidAddressError extends BaseError2 {
|
|
54143
54262
|
constructor({ address }) {
|
|
54144
54263
|
super(`Address "${address}" is invalid.`, {
|
|
@@ -54151,7 +54270,7 @@ class InvalidAddressError extends BaseError2 {
|
|
|
54151
54270
|
}
|
|
54152
54271
|
}
|
|
54153
54272
|
|
|
54154
|
-
// ../../node_modules/.bun/viem@2.47.
|
|
54273
|
+
// ../../node_modules/.bun/viem@2.47.6+10bb0f8eb665a8bc/node_modules/viem/_esm/utils/lru.js
|
|
54155
54274
|
class LruMap extends Map {
|
|
54156
54275
|
constructor(size2) {
|
|
54157
54276
|
super();
|
|
@@ -54165,24 +54284,26 @@ class LruMap extends Map {
|
|
|
54165
54284
|
}
|
|
54166
54285
|
get(key) {
|
|
54167
54286
|
const value2 = super.get(key);
|
|
54168
|
-
if (super.has(key)
|
|
54169
|
-
|
|
54287
|
+
if (super.has(key)) {
|
|
54288
|
+
super.delete(key);
|
|
54170
54289
|
super.set(key, value2);
|
|
54171
54290
|
}
|
|
54172
54291
|
return value2;
|
|
54173
54292
|
}
|
|
54174
54293
|
set(key, value2) {
|
|
54294
|
+
if (super.has(key))
|
|
54295
|
+
super.delete(key);
|
|
54175
54296
|
super.set(key, value2);
|
|
54176
54297
|
if (this.maxSize && this.size > this.maxSize) {
|
|
54177
|
-
const firstKey =
|
|
54178
|
-
if (firstKey)
|
|
54179
|
-
|
|
54298
|
+
const firstKey = super.keys().next().value;
|
|
54299
|
+
if (firstKey !== undefined)
|
|
54300
|
+
super.delete(firstKey);
|
|
54180
54301
|
}
|
|
54181
54302
|
return this;
|
|
54182
54303
|
}
|
|
54183
54304
|
}
|
|
54184
54305
|
|
|
54185
|
-
// ../../node_modules/.bun/viem@2.47.
|
|
54306
|
+
// ../../node_modules/.bun/viem@2.47.6+10bb0f8eb665a8bc/node_modules/viem/_esm/errors/data.js
|
|
54186
54307
|
class SliceOffsetOutOfBoundsError extends BaseError2 {
|
|
54187
54308
|
constructor({ offset, position, size: size2 }) {
|
|
54188
54309
|
super(`Slice ${position === "start" ? "starting" : "ending"} at offset "${offset}" is out-of-bounds (size: ${size2}).`, { name: "SliceOffsetOutOfBoundsError" });
|
|
@@ -54195,7 +54316,7 @@ class SizeExceedsPaddingSizeError extends BaseError2 {
|
|
|
54195
54316
|
}
|
|
54196
54317
|
}
|
|
54197
54318
|
|
|
54198
|
-
// ../../node_modules/.bun/viem@2.47.
|
|
54319
|
+
// ../../node_modules/.bun/viem@2.47.6+10bb0f8eb665a8bc/node_modules/viem/_esm/utils/data/pad.js
|
|
54199
54320
|
function pad(hexOrBytes, { dir, size: size2 = 32 } = {}) {
|
|
54200
54321
|
if (typeof hexOrBytes === "string")
|
|
54201
54322
|
return padHex(hexOrBytes, { dir, size: size2 });
|
|
@@ -54230,7 +54351,7 @@ function padBytes(bytes, { dir, size: size2 = 32 } = {}) {
|
|
|
54230
54351
|
return paddedBytes;
|
|
54231
54352
|
}
|
|
54232
54353
|
|
|
54233
|
-
// ../../node_modules/.bun/viem@2.47.
|
|
54354
|
+
// ../../node_modules/.bun/viem@2.47.6+10bb0f8eb665a8bc/node_modules/viem/_esm/errors/encoding.js
|
|
54234
54355
|
class IntegerOutOfRangeError extends BaseError2 {
|
|
54235
54356
|
constructor({ max, min, signed, size: size2, value: value2 }) {
|
|
54236
54357
|
super(`Number "${value2}" is not in safe ${size2 ? `${size2 * 8}-bit ${signed ? "signed" : "unsigned"} ` : ""}integer range ${max ? `(${min} to ${max})` : `(above ${min})`}`, { name: "IntegerOutOfRangeError" });
|
|
@@ -54242,7 +54363,7 @@ class SizeOverflowError extends BaseError2 {
|
|
|
54242
54363
|
}
|
|
54243
54364
|
}
|
|
54244
54365
|
|
|
54245
|
-
// ../../node_modules/.bun/viem@2.47.
|
|
54366
|
+
// ../../node_modules/.bun/viem@2.47.6+10bb0f8eb665a8bc/node_modules/viem/_esm/utils/encoding/fromHex.js
|
|
54246
54367
|
function assertSize(hexOrBytes, { size: size2 }) {
|
|
54247
54368
|
if (size(hexOrBytes) > size2)
|
|
54248
54369
|
throw new SizeOverflowError({
|
|
@@ -54251,7 +54372,7 @@ function assertSize(hexOrBytes, { size: size2 }) {
|
|
|
54251
54372
|
});
|
|
54252
54373
|
}
|
|
54253
54374
|
|
|
54254
|
-
// ../../node_modules/.bun/viem@2.47.
|
|
54375
|
+
// ../../node_modules/.bun/viem@2.47.6+10bb0f8eb665a8bc/node_modules/viem/_esm/utils/encoding/toHex.js
|
|
54255
54376
|
var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, "0"));
|
|
54256
54377
|
function toHex(value2, opts = {}) {
|
|
54257
54378
|
if (typeof value2 === "number" || typeof value2 === "bigint")
|
|
@@ -54317,7 +54438,7 @@ function stringToHex(value_, opts = {}) {
|
|
|
54317
54438
|
return bytesToHex(value2, opts);
|
|
54318
54439
|
}
|
|
54319
54440
|
|
|
54320
|
-
// ../../node_modules/.bun/viem@2.47.
|
|
54441
|
+
// ../../node_modules/.bun/viem@2.47.6+10bb0f8eb665a8bc/node_modules/viem/_esm/utils/encoding/toBytes.js
|
|
54321
54442
|
var encoder2 = /* @__PURE__ */ new TextEncoder;
|
|
54322
54443
|
function toBytes(value2, opts = {}) {
|
|
54323
54444
|
if (typeof value2 === "number" || typeof value2 === "bigint")
|
|
@@ -54661,7 +54782,7 @@ class Keccak extends Hash {
|
|
|
54661
54782
|
var gen = (suffix, blockLen, outputLen) => createHasher(() => new Keccak(blockLen, suffix, outputLen));
|
|
54662
54783
|
var keccak_256 = /* @__PURE__ */ (() => gen(1, 136, 256 / 8))();
|
|
54663
54784
|
|
|
54664
|
-
// ../../node_modules/.bun/viem@2.47.
|
|
54785
|
+
// ../../node_modules/.bun/viem@2.47.6+10bb0f8eb665a8bc/node_modules/viem/_esm/utils/hash/keccak256.js
|
|
54665
54786
|
function keccak256(value2, to_) {
|
|
54666
54787
|
const to = to_ || "hex";
|
|
54667
54788
|
const bytes = keccak_256(isHex(value2, { strict: false }) ? toBytes(value2) : value2);
|
|
@@ -54670,7 +54791,7 @@ function keccak256(value2, to_) {
|
|
|
54670
54791
|
return toHex(bytes);
|
|
54671
54792
|
}
|
|
54672
54793
|
|
|
54673
|
-
// ../../node_modules/.bun/viem@2.47.
|
|
54794
|
+
// ../../node_modules/.bun/viem@2.47.6+10bb0f8eb665a8bc/node_modules/viem/_esm/utils/address/getAddress.js
|
|
54674
54795
|
var checksumAddressCache = /* @__PURE__ */ new LruMap(8192);
|
|
54675
54796
|
function checksumAddress(address_, chainId) {
|
|
54676
54797
|
if (checksumAddressCache.has(`${address_}.${chainId}`))
|
|
@@ -54696,7 +54817,7 @@ function getAddress(address, chainId) {
|
|
|
54696
54817
|
return checksumAddress(address, chainId);
|
|
54697
54818
|
}
|
|
54698
54819
|
|
|
54699
|
-
// ../../node_modules/.bun/viem@2.47.
|
|
54820
|
+
// ../../node_modules/.bun/viem@2.47.6+10bb0f8eb665a8bc/node_modules/viem/_esm/utils/address/isAddress.js
|
|
54700
54821
|
var addressRegex = /^0x[a-fA-F0-9]{40}$/;
|
|
54701
54822
|
var isAddressCache = /* @__PURE__ */ new LruMap(8192);
|
|
54702
54823
|
function isAddress(address, options) {
|
|
@@ -54716,11 +54837,11 @@ function isAddress(address, options) {
|
|
|
54716
54837
|
isAddressCache.set(cacheKey, result);
|
|
54717
54838
|
return result;
|
|
54718
54839
|
}
|
|
54719
|
-
// ../../node_modules/.bun/viem@2.47.
|
|
54840
|
+
// ../../node_modules/.bun/viem@2.47.6+10bb0f8eb665a8bc/node_modules/viem/_esm/utils/hash/isHash.js
|
|
54720
54841
|
function isHash(hash3) {
|
|
54721
54842
|
return isHex(hash3) && size(hash3) === 32;
|
|
54722
54843
|
}
|
|
54723
|
-
// ../../node_modules/.bun/viem@2.47.
|
|
54844
|
+
// ../../node_modules/.bun/viem@2.47.6+10bb0f8eb665a8bc/node_modules/viem/_esm/utils/data/slice.js
|
|
54724
54845
|
function slice(value2, start, end, { strict } = {}) {
|
|
54725
54846
|
if (isHex(value2, { strict: false }))
|
|
54726
54847
|
return sliceHex(value2, start, end, {
|
|
@@ -54762,7 +54883,7 @@ function sliceHex(value_, start, end, { strict } = {}) {
|
|
|
54762
54883
|
return value2;
|
|
54763
54884
|
}
|
|
54764
54885
|
|
|
54765
|
-
// ../../node_modules/.bun/viem@2.47.
|
|
54886
|
+
// ../../node_modules/.bun/viem@2.47.6+10bb0f8eb665a8bc/node_modules/viem/_esm/utils/hash/hashSignature.js
|
|
54766
54887
|
var hash3 = (value2) => keccak256(toBytes(value2));
|
|
54767
54888
|
function hashSignature(sig) {
|
|
54768
54889
|
return hash3(sig);
|
|
@@ -54827,7 +54948,7 @@ function formatAbiItem(abiItem) {
|
|
|
54827
54948
|
return `fallback() external${abiItem.stateMutability === "payable" ? " payable" : ""}`;
|
|
54828
54949
|
return "receive() external payable";
|
|
54829
54950
|
}
|
|
54830
|
-
// ../../node_modules/.bun/viem@2.47.
|
|
54951
|
+
// ../../node_modules/.bun/viem@2.47.6+10bb0f8eb665a8bc/node_modules/viem/_esm/utils/hash/normalizeSignature.js
|
|
54831
54952
|
function normalizeSignature(signature) {
|
|
54832
54953
|
let active = true;
|
|
54833
54954
|
let current = "";
|
|
@@ -54871,7 +54992,7 @@ function normalizeSignature(signature) {
|
|
|
54871
54992
|
return result;
|
|
54872
54993
|
}
|
|
54873
54994
|
|
|
54874
|
-
// ../../node_modules/.bun/viem@2.47.
|
|
54995
|
+
// ../../node_modules/.bun/viem@2.47.6+10bb0f8eb665a8bc/node_modules/viem/_esm/utils/hash/toSignature.js
|
|
54875
54996
|
var toSignature = (def) => {
|
|
54876
54997
|
const def_ = (() => {
|
|
54877
54998
|
if (typeof def === "string")
|
|
@@ -54881,12 +55002,12 @@ var toSignature = (def) => {
|
|
|
54881
55002
|
return normalizeSignature(def_);
|
|
54882
55003
|
};
|
|
54883
55004
|
|
|
54884
|
-
// ../../node_modules/.bun/viem@2.47.
|
|
55005
|
+
// ../../node_modules/.bun/viem@2.47.6+10bb0f8eb665a8bc/node_modules/viem/_esm/utils/hash/toSignatureHash.js
|
|
54885
55006
|
function toSignatureHash(fn) {
|
|
54886
55007
|
return hashSignature(toSignature(fn));
|
|
54887
55008
|
}
|
|
54888
55009
|
|
|
54889
|
-
// ../../node_modules/.bun/viem@2.47.
|
|
55010
|
+
// ../../node_modules/.bun/viem@2.47.6+10bb0f8eb665a8bc/node_modules/viem/_esm/utils/hash/toFunctionSelector.js
|
|
54890
55011
|
var toFunctionSelector = (fn) => slice(toSignatureHash(fn), 0, 4);
|
|
54891
55012
|
// ../sdk/dist/index.js
|
|
54892
55013
|
init_zod();
|
|
@@ -57210,7 +57331,7 @@ function toArray2(value2) {
|
|
|
57210
57331
|
return Array.isArray(value2) ? value2 : value2 === undefined || value2 === null ? [] : [value2];
|
|
57211
57332
|
}
|
|
57212
57333
|
var ORPC_SHARED_PACKAGE_NAME2 = "@orpc/shared";
|
|
57213
|
-
var ORPC_SHARED_PACKAGE_VERSION2 = "1.13.
|
|
57334
|
+
var ORPC_SHARED_PACKAGE_VERSION2 = "1.13.9";
|
|
57214
57335
|
function once2(fn) {
|
|
57215
57336
|
let cached2;
|
|
57216
57337
|
return () => {
|
|
@@ -60476,7 +60597,7 @@ var withdrawExpired = v1Contract.route({
|
|
|
60476
60597
|
successDescription: "Expired settlement escrow refunded",
|
|
60477
60598
|
tags: TAGS
|
|
60478
60599
|
}).input(XvpWithdrawExpiredInputSchema).output(XvpWithdrawExpiredOutputSchema);
|
|
60479
|
-
var
|
|
60600
|
+
var execute2 = v1Contract.route({
|
|
60480
60601
|
method: "PUT",
|
|
60481
60602
|
path: "/xvp/execute",
|
|
60482
60603
|
description: "Execute an XvP settlement",
|
|
@@ -60985,7 +61106,7 @@ var preview = v1Contract.route({
|
|
|
60985
61106
|
successDescription: "Recovery preview retrieved successfully",
|
|
60986
61107
|
tags: TAGS2
|
|
60987
61108
|
}).input(RecoveryPreviewInputSchema).output(RecoveryPreviewOutputSchema);
|
|
60988
|
-
var
|
|
61109
|
+
var execute22 = v1Contract.route({
|
|
60989
61110
|
method: "POST",
|
|
60990
61111
|
path: "/identity-recovery/execute",
|
|
60991
61112
|
description: "Execute identity recovery for a user. Creates new wallet, deploys new OnchainID, " + "recovers identity and tokens on-chain, and revokes all security credentials. " + 'Requires identityManager role and type-to-confirm "RECOVER IDENTITY".',
|
|
@@ -78834,7 +78955,7 @@ var timestampSerializer = {
|
|
|
78834
78955
|
};
|
|
78835
78956
|
var package_default = {
|
|
78836
78957
|
name: "@settlemint/dalp-sdk",
|
|
78837
|
-
version: "2.1.7-main.
|
|
78958
|
+
version: "2.1.7-main.23399598269",
|
|
78838
78959
|
private: false,
|
|
78839
78960
|
description: "Fully typed SDK for the DALP tokenization platform API",
|
|
78840
78961
|
homepage: "https://settlemint.com",
|
|
@@ -78884,14 +79005,14 @@ var package_default = {
|
|
|
78884
79005
|
typecheck: "tsgo"
|
|
78885
79006
|
},
|
|
78886
79007
|
dependencies: {
|
|
78887
|
-
"@orpc/client": "1.13.
|
|
78888
|
-
"@orpc/contract": "1.13.
|
|
78889
|
-
"@orpc/openapi-client": "1.13.
|
|
79008
|
+
"@orpc/client": "1.13.9",
|
|
79009
|
+
"@orpc/contract": "1.13.9",
|
|
79010
|
+
"@orpc/openapi-client": "1.13.9",
|
|
78890
79011
|
"currency-codes": "2.2.0",
|
|
78891
79012
|
"date-fns": "4.1.0",
|
|
78892
79013
|
dnum: "2.17.0",
|
|
78893
79014
|
"iso-3166": "4.4.0",
|
|
78894
|
-
viem: "2.47.
|
|
79015
|
+
viem: "2.47.6",
|
|
78895
79016
|
zod: "4.3.6"
|
|
78896
79017
|
},
|
|
78897
79018
|
devDependencies: {
|
|
@@ -78977,7 +79098,7 @@ function createDalpClient(config3) {
|
|
|
78977
79098
|
// package.json
|
|
78978
79099
|
var package_default2 = {
|
|
78979
79100
|
name: "@settlemint/dalp-cli",
|
|
78980
|
-
version: "2.1.7-main.
|
|
79101
|
+
version: "2.1.7-main.23399598269",
|
|
78981
79102
|
private: false,
|
|
78982
79103
|
description: "CLI for the Digital Asset Lifecycle Platform — manage tokens, identities, compliance, and more from the command line.",
|
|
78983
79104
|
homepage: "https://settlemint.com",
|
|
@@ -79020,13 +79141,13 @@ var package_default2 = {
|
|
|
79020
79141
|
"@core/validation": "workspace:*",
|
|
79021
79142
|
"@dalp/auth": "workspace:*",
|
|
79022
79143
|
"@settlemint/dalp-sdk": "workspace:*",
|
|
79023
|
-
incur: "0.3.
|
|
79144
|
+
incur: "0.3.5"
|
|
79024
79145
|
},
|
|
79025
79146
|
devDependencies: {
|
|
79026
79147
|
"@arethetypeswrong/cli": "0.18.2",
|
|
79027
79148
|
"@tools/typescript-config": "workspace:*",
|
|
79028
79149
|
"@tools/vitest-config": "workspace:*",
|
|
79029
|
-
"@types/bun": "1.3.
|
|
79150
|
+
"@types/bun": "1.3.11",
|
|
79030
79151
|
publint: "0.3.18"
|
|
79031
79152
|
},
|
|
79032
79153
|
engines: {
|
|
@@ -82902,7 +83023,7 @@ var whoamiCommand = exports_Cli.create("whoami", {
|
|
|
82902
83023
|
}
|
|
82903
83024
|
});
|
|
82904
83025
|
|
|
82905
|
-
// ../../node_modules/.bun/@better-auth+api-key@1.5.5+
|
|
83026
|
+
// ../../node_modules/.bun/@better-auth+api-key@1.5.5+3d9e5b39184acf8d/node_modules/@better-auth/api-key/dist/error-codes-vwTWW2ez.mjs
|
|
82906
83027
|
init_error_codes();
|
|
82907
83028
|
var API_KEY_ERROR_CODES = defineErrorCodes({
|
|
82908
83029
|
INVALID_METADATA_TYPE: "metadata must be an object or undefined",
|
|
@@ -82938,7 +83059,7 @@ var API_KEY_ERROR_CODES = defineErrorCodes({
|
|
|
82938
83059
|
ORGANIZATION_PLUGIN_REQUIRED: "Organization plugin is required for organization-owned API keys. Please install and configure the organization plugin."
|
|
82939
83060
|
});
|
|
82940
83061
|
|
|
82941
|
-
// ../../node_modules/.bun/@better-auth+api-key@1.5.5+
|
|
83062
|
+
// ../../node_modules/.bun/@better-auth+api-key@1.5.5+3d9e5b39184acf8d/node_modules/@better-auth/api-key/dist/client.mjs
|
|
82942
83063
|
var apiKeyClient = () => {
|
|
82943
83064
|
return {
|
|
82944
83065
|
id: "api-key",
|
|
@@ -82952,7 +83073,7 @@ var apiKeyClient = () => {
|
|
|
82952
83073
|
};
|
|
82953
83074
|
};
|
|
82954
83075
|
|
|
82955
|
-
// ../../node_modules/.bun/@better-auth+passkey@1.5.5+
|
|
83076
|
+
// ../../node_modules/.bun/@better-auth+passkey@1.5.5+3d9e5b39184acf8d/node_modules/@better-auth/passkey/dist/error-codes-Dvu2mv33.mjs
|
|
82956
83077
|
init_error_codes();
|
|
82957
83078
|
var PASSKEY_ERROR_CODES = defineErrorCodes({
|
|
82958
83079
|
CHALLENGE_NOT_FOUND: "Challenge not found",
|
|
@@ -83370,7 +83491,7 @@ async function startAuthentication(options) {
|
|
|
83370
83491
|
authenticatorAttachment: toAuthenticatorAttachment(credential.authenticatorAttachment)
|
|
83371
83492
|
};
|
|
83372
83493
|
}
|
|
83373
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
83494
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/client/broadcast-channel.mjs
|
|
83374
83495
|
var kBroadcastChannel = Symbol.for("better-auth:broadcast-channel");
|
|
83375
83496
|
var now = () => Math.floor(Date.now() / 1000);
|
|
83376
83497
|
var WindowBroadcastChannel = class {
|
|
@@ -83418,7 +83539,7 @@ function getGlobalBroadcastChannel(name = "better-auth.message") {
|
|
|
83418
83539
|
return globalThis[kBroadcastChannel];
|
|
83419
83540
|
}
|
|
83420
83541
|
|
|
83421
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
83542
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/client/focus-manager.mjs
|
|
83422
83543
|
var kFocusManager = Symbol.for("better-auth:focus-manager");
|
|
83423
83544
|
var WindowFocusManager = class {
|
|
83424
83545
|
listeners = /* @__PURE__ */ new Set;
|
|
@@ -83450,7 +83571,7 @@ function getGlobalFocusManager() {
|
|
|
83450
83571
|
return globalThis[kFocusManager];
|
|
83451
83572
|
}
|
|
83452
83573
|
|
|
83453
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
83574
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/client/online-manager.mjs
|
|
83454
83575
|
var kOnlineManager = Symbol.for("better-auth:online-manager");
|
|
83455
83576
|
var WindowOnlineManager = class {
|
|
83456
83577
|
listeners = /* @__PURE__ */ new Set;
|
|
@@ -83484,7 +83605,7 @@ function getGlobalOnlineManager() {
|
|
|
83484
83605
|
return globalThis[kOnlineManager];
|
|
83485
83606
|
}
|
|
83486
83607
|
|
|
83487
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
83608
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/client/parser.mjs
|
|
83488
83609
|
var PROTO_POLLUTION_PATTERNS = {
|
|
83489
83610
|
proto: /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,
|
|
83490
83611
|
constructor: /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,
|
|
@@ -83710,7 +83831,7 @@ var onMount = ($store, initialize) => {
|
|
|
83710
83831
|
};
|
|
83711
83832
|
});
|
|
83712
83833
|
};
|
|
83713
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
83834
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/client/query.mjs
|
|
83714
83835
|
var isServer = () => typeof window === "undefined";
|
|
83715
83836
|
var useAuthQuery = (initializedAtom, path3, $fetch, options) => {
|
|
83716
83837
|
const value3 = atom({
|
|
@@ -83809,7 +83930,7 @@ var useAuthQuery = (initializedAtom, path3, $fetch, options) => {
|
|
|
83809
83930
|
return value3;
|
|
83810
83931
|
};
|
|
83811
83932
|
|
|
83812
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
83933
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/client/session-refresh.mjs
|
|
83813
83934
|
var now2 = () => Math.floor(Date.now() / 1000);
|
|
83814
83935
|
var FOCUS_REFETCH_RATE_LIMIT_SECONDS = 5;
|
|
83815
83936
|
function createSessionRefreshManager(opts) {
|
|
@@ -83943,7 +84064,7 @@ function createSessionRefreshManager(opts) {
|
|
|
83943
84064
|
};
|
|
83944
84065
|
}
|
|
83945
84066
|
|
|
83946
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
84067
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/utils/wildcard.mjs
|
|
83947
84068
|
function escapeRegExpChar(char) {
|
|
83948
84069
|
if (char === "-" || char === "^" || char === "$" || char === "+" || char === "." || char === "(" || char === ")" || char === "|" || char === "[" || char === "]" || char === "{" || char === "}" || char === "*" || char === "?" || char === "\\")
|
|
83949
84070
|
return `\\${char}`;
|
|
@@ -84041,7 +84162,7 @@ function wildcardMatch(pattern, options) {
|
|
|
84041
84162
|
return fn;
|
|
84042
84163
|
}
|
|
84043
84164
|
|
|
84044
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
84165
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/utils/url.mjs
|
|
84045
84166
|
init_env();
|
|
84046
84167
|
init_error2();
|
|
84047
84168
|
function checkHasPath(url2) {
|
|
@@ -84141,7 +84262,7 @@ function getHost(url2) {
|
|
|
84141
84262
|
}
|
|
84142
84263
|
}
|
|
84143
84264
|
|
|
84144
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
84265
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/client/fetch-plugins.mjs
|
|
84145
84266
|
var redirectPlugin = {
|
|
84146
84267
|
id: "redirect",
|
|
84147
84268
|
name: "Redirect",
|
|
@@ -84157,7 +84278,7 @@ var redirectPlugin = {
|
|
|
84157
84278
|
} }
|
|
84158
84279
|
};
|
|
84159
84280
|
|
|
84160
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
84281
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/client/session-atom.mjs
|
|
84161
84282
|
function getSessionAtom($fetch, options) {
|
|
84162
84283
|
const $signal = atom(false);
|
|
84163
84284
|
const session = useAuthQuery($signal, "/get-session", $fetch, { method: "GET" });
|
|
@@ -84813,7 +84934,7 @@ var betterFetch = async (url2, options) => {
|
|
|
84813
84934
|
};
|
|
84814
84935
|
};
|
|
84815
84936
|
|
|
84816
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
84937
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/client/config.mjs
|
|
84817
84938
|
var resolvePublicAuthUrl = (basePath) => {
|
|
84818
84939
|
if (typeof process === "undefined")
|
|
84819
84940
|
return;
|
|
@@ -84923,12 +85044,12 @@ var getClientConfig = (options, loadEnv) => {
|
|
|
84923
85044
|
};
|
|
84924
85045
|
};
|
|
84925
85046
|
|
|
84926
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
85047
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/utils/is-atom.mjs
|
|
84927
85048
|
function isAtom(value3) {
|
|
84928
85049
|
return typeof value3 === "object" && value3 !== null && "get" in value3 && typeof value3.get === "function" && "lc" in value3 && typeof value3.lc === "number";
|
|
84929
85050
|
}
|
|
84930
85051
|
|
|
84931
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
85052
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/client/proxy.mjs
|
|
84932
85053
|
function getMethod2(path3, knownPathMethods, args) {
|
|
84933
85054
|
const method = knownPathMethods[path3];
|
|
84934
85055
|
const { fetchOptions, query: _query, ...body } = args || {};
|
|
@@ -85010,7 +85131,7 @@ function createDynamicPathProxy(routes, client, knownPathMethods, atoms, atomLis
|
|
|
85010
85131
|
return createProxy();
|
|
85011
85132
|
}
|
|
85012
85133
|
|
|
85013
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
85134
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/client/vanilla.mjs
|
|
85014
85135
|
init_string2();
|
|
85015
85136
|
function createAuthClient(options) {
|
|
85016
85137
|
const { pluginPathMethods, pluginsActions, pluginsAtoms, $fetch, atomListeners, $store } = getClientConfig(options);
|
|
@@ -85025,7 +85146,7 @@ function createAuthClient(options) {
|
|
|
85025
85146
|
}, $fetch, pluginPathMethods, pluginsAtoms, atomListeners);
|
|
85026
85147
|
}
|
|
85027
85148
|
|
|
85028
|
-
// ../../node_modules/.bun/@better-auth+passkey@1.5.5+
|
|
85149
|
+
// ../../node_modules/.bun/@better-auth+passkey@1.5.5+3d9e5b39184acf8d/node_modules/@better-auth/passkey/dist/client.mjs
|
|
85029
85150
|
var getPasskeyActions = ($fetch, { $listPasskeys, $store }) => {
|
|
85030
85151
|
const signInPasskey = async (opts, options) => {
|
|
85031
85152
|
const response = await $fetch("/passkey/generate-authenticate-options", {
|
|
@@ -85172,7 +85293,7 @@ var passkeyClient = () => {
|
|
|
85172
85293
|
};
|
|
85173
85294
|
};
|
|
85174
85295
|
|
|
85175
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
85296
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/plugins/additional-fields/client.mjs
|
|
85176
85297
|
var inferAdditionalFields = (schema) => {
|
|
85177
85298
|
return {
|
|
85178
85299
|
id: "additional-fields-client",
|
|
@@ -85180,7 +85301,7 @@ var inferAdditionalFields = (schema) => {
|
|
|
85180
85301
|
};
|
|
85181
85302
|
};
|
|
85182
85303
|
|
|
85183
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
85304
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/plugins/admin/error-codes.mjs
|
|
85184
85305
|
init_error_codes();
|
|
85185
85306
|
var ADMIN_ERROR_CODES = defineErrorCodes({
|
|
85186
85307
|
FAILED_TO_CREATE_USER: "Failed to create user",
|
|
@@ -85206,7 +85327,7 @@ var ADMIN_ERROR_CODES = defineErrorCodes({
|
|
|
85206
85327
|
INVALID_ROLE_TYPE: "Invalid role type"
|
|
85207
85328
|
});
|
|
85208
85329
|
|
|
85209
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
85330
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/plugins/access/access.mjs
|
|
85210
85331
|
init_error2();
|
|
85211
85332
|
function role(statements) {
|
|
85212
85333
|
return {
|
|
@@ -85256,7 +85377,7 @@ function createAccessControl(s) {
|
|
|
85256
85377
|
};
|
|
85257
85378
|
}
|
|
85258
85379
|
|
|
85259
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
85380
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/plugins/admin/access/statement.mjs
|
|
85260
85381
|
var defaultStatements = {
|
|
85261
85382
|
user: [
|
|
85262
85383
|
"create",
|
|
@@ -85304,7 +85425,7 @@ var defaultRoles = {
|
|
|
85304
85425
|
user: userAc
|
|
85305
85426
|
};
|
|
85306
85427
|
|
|
85307
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
85428
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/plugins/admin/has-permission.mjs
|
|
85308
85429
|
var hasPermission = (input) => {
|
|
85309
85430
|
if (input.userId && input.options?.adminUserIds?.includes(input.userId))
|
|
85310
85431
|
return true;
|
|
@@ -85318,7 +85439,7 @@ var hasPermission = (input) => {
|
|
|
85318
85439
|
return false;
|
|
85319
85440
|
};
|
|
85320
85441
|
|
|
85321
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
85442
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/plugins/admin/client.mjs
|
|
85322
85443
|
var adminClient = (options) => {
|
|
85323
85444
|
const roles3 = {
|
|
85324
85445
|
admin: adminAc,
|
|
@@ -85346,7 +85467,7 @@ var adminClient = (options) => {
|
|
|
85346
85467
|
};
|
|
85347
85468
|
};
|
|
85348
85469
|
|
|
85349
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
85470
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/plugins/anonymous/error-codes.mjs
|
|
85350
85471
|
init_error_codes();
|
|
85351
85472
|
var ANONYMOUS_ERROR_CODES = defineErrorCodes({
|
|
85352
85473
|
INVALID_EMAIL_FORMAT: "Email was not generated in a valid format",
|
|
@@ -85358,7 +85479,7 @@ var ANONYMOUS_ERROR_CODES = defineErrorCodes({
|
|
|
85358
85479
|
DELETE_ANONYMOUS_USER_DISABLED: "Deleting anonymous users is disabled"
|
|
85359
85480
|
});
|
|
85360
85481
|
|
|
85361
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
85482
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/client/plugins/infer-plugin.mjs
|
|
85362
85483
|
var InferServerPlugin = () => {
|
|
85363
85484
|
return {
|
|
85364
85485
|
id: "infer-server-plugin",
|
|
@@ -85366,12 +85487,12 @@ var InferServerPlugin = () => {
|
|
|
85366
85487
|
};
|
|
85367
85488
|
};
|
|
85368
85489
|
|
|
85369
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
85490
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/plugins/custom-session/client.mjs
|
|
85370
85491
|
var customSessionClient = () => {
|
|
85371
85492
|
return InferServerPlugin();
|
|
85372
85493
|
};
|
|
85373
85494
|
|
|
85374
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
85495
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/plugins/device-authorization/client.mjs
|
|
85375
85496
|
var deviceAuthorizationClient = () => {
|
|
85376
85497
|
return {
|
|
85377
85498
|
id: "device-authorization",
|
|
@@ -85386,7 +85507,7 @@ var deviceAuthorizationClient = () => {
|
|
|
85386
85507
|
};
|
|
85387
85508
|
};
|
|
85388
85509
|
|
|
85389
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
85510
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/plugins/email-otp/error-codes.mjs
|
|
85390
85511
|
init_error_codes();
|
|
85391
85512
|
var EMAIL_OTP_ERROR_CODES = defineErrorCodes({
|
|
85392
85513
|
OTP_EXPIRED: "OTP expired",
|
|
@@ -85394,7 +85515,7 @@ var EMAIL_OTP_ERROR_CODES = defineErrorCodes({
|
|
|
85394
85515
|
TOO_MANY_ATTEMPTS: "Too many attempts"
|
|
85395
85516
|
});
|
|
85396
85517
|
|
|
85397
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
85518
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/plugins/generic-oauth/error-codes.mjs
|
|
85398
85519
|
init_error_codes();
|
|
85399
85520
|
var GENERIC_OAUTH_ERROR_CODES = defineErrorCodes({
|
|
85400
85521
|
INVALID_OAUTH_CONFIGURATION: "Invalid OAuth configuration",
|
|
@@ -85407,11 +85528,11 @@ var GENERIC_OAUTH_ERROR_CODES = defineErrorCodes({
|
|
|
85407
85528
|
ISSUER_MISSING: "OAuth issuer parameter missing. The authorization server did not include the required iss parameter (RFC 9207)."
|
|
85408
85529
|
});
|
|
85409
85530
|
|
|
85410
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
85531
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/plugins/multi-session/error-codes.mjs
|
|
85411
85532
|
init_error_codes();
|
|
85412
85533
|
var MULTI_SESSION_ERROR_CODES = defineErrorCodes({ INVALID_SESSION_TOKEN: "Invalid session token" });
|
|
85413
85534
|
|
|
85414
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
85535
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/plugins/organization/error-codes.mjs
|
|
85415
85536
|
init_error_codes();
|
|
85416
85537
|
var ORGANIZATION_ERROR_CODES = defineErrorCodes({
|
|
85417
85538
|
YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION: "You are not allowed to create a new organization",
|
|
@@ -85473,7 +85594,7 @@ var ORGANIZATION_ERROR_CODES = defineErrorCodes({
|
|
|
85473
85594
|
ROLE_IS_ASSIGNED_TO_MEMBERS: "Cannot delete a role that is assigned to members. Please reassign the members to a different role first"
|
|
85474
85595
|
});
|
|
85475
85596
|
|
|
85476
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
85597
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/plugins/organization/access/statement.mjs
|
|
85477
85598
|
var defaultStatements2 = {
|
|
85478
85599
|
organization: ["update", "delete"],
|
|
85479
85600
|
member: [
|
|
@@ -85548,7 +85669,7 @@ var defaultRoles2 = {
|
|
|
85548
85669
|
member: memberAc
|
|
85549
85670
|
};
|
|
85550
85671
|
|
|
85551
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
85672
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/plugins/organization/permission.mjs
|
|
85552
85673
|
var hasPermissionFn = (input, acRoles) => {
|
|
85553
85674
|
if (!input.permissions)
|
|
85554
85675
|
return false;
|
|
@@ -85564,7 +85685,7 @@ var hasPermissionFn = (input, acRoles) => {
|
|
|
85564
85685
|
return false;
|
|
85565
85686
|
};
|
|
85566
85687
|
|
|
85567
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
85688
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/plugins/organization/client.mjs
|
|
85568
85689
|
var clientSideHasPermission = (input) => {
|
|
85569
85690
|
return hasPermissionFn(input, input.options.roles || defaultRoles2);
|
|
85570
85691
|
};
|
|
@@ -85654,7 +85775,7 @@ var organizationClient = (options) => {
|
|
|
85654
85775
|
};
|
|
85655
85776
|
};
|
|
85656
85777
|
|
|
85657
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
85778
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/plugins/phone-number/error-codes.mjs
|
|
85658
85779
|
init_error_codes();
|
|
85659
85780
|
var PHONE_NUMBER_ERROR_CODES = defineErrorCodes({
|
|
85660
85781
|
INVALID_PHONE_NUMBER: "Invalid phone number",
|
|
@@ -85671,7 +85792,7 @@ var PHONE_NUMBER_ERROR_CODES = defineErrorCodes({
|
|
|
85671
85792
|
TOO_MANY_ATTEMPTS: "Too many attempts"
|
|
85672
85793
|
});
|
|
85673
85794
|
|
|
85674
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
85795
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/plugins/two-factor/error-code.mjs
|
|
85675
85796
|
init_error_codes();
|
|
85676
85797
|
var TWO_FACTOR_ERROR_CODES = defineErrorCodes({
|
|
85677
85798
|
OTP_NOT_ENABLED: "OTP not enabled",
|
|
@@ -85685,7 +85806,7 @@ var TWO_FACTOR_ERROR_CODES = defineErrorCodes({
|
|
|
85685
85806
|
INVALID_TWO_FACTOR_COOKIE: "Invalid two factor cookie"
|
|
85686
85807
|
});
|
|
85687
85808
|
|
|
85688
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
85809
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/plugins/two-factor/client.mjs
|
|
85689
85810
|
var twoFactorClient = (options) => {
|
|
85690
85811
|
return {
|
|
85691
85812
|
id: "two-factor",
|
|
@@ -85718,7 +85839,7 @@ var twoFactorClient = (options) => {
|
|
|
85718
85839
|
};
|
|
85719
85840
|
};
|
|
85720
85841
|
|
|
85721
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
85842
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/plugins/username/error-codes.mjs
|
|
85722
85843
|
init_error_codes();
|
|
85723
85844
|
var USERNAME_ERROR_CODES = defineErrorCodes({
|
|
85724
85845
|
INVALID_USERNAME_OR_PASSWORD: "Invalid username or password",
|
|
@@ -85731,7 +85852,7 @@ var USERNAME_ERROR_CODES = defineErrorCodes({
|
|
|
85731
85852
|
INVALID_DISPLAY_USERNAME: "Display username is invalid"
|
|
85732
85853
|
});
|
|
85733
85854
|
|
|
85734
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
85855
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/crypto/random.mjs
|
|
85735
85856
|
init_random();
|
|
85736
85857
|
var generateRandomString = createRandomStringGenerator("a-z", "0-9", "A-Z", "-_");
|
|
85737
85858
|
|
|
@@ -89509,7 +89630,7 @@ function decodeJwt(jwt2) {
|
|
|
89509
89630
|
throw new JWTInvalid("Invalid JWT Claims Set");
|
|
89510
89631
|
return result;
|
|
89511
89632
|
}
|
|
89512
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
89633
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/crypto/jwt.mjs
|
|
89513
89634
|
async function signJWT(payload, secret, expiresIn = 3600) {
|
|
89514
89635
|
return await new SignJWT(payload).setProtectedHeader({ alg: "HS256" }).setIssuedAt().setExpirationTime(Math.floor(Date.now() / 1000) + expiresIn).sign(new TextEncoder().encode(secret));
|
|
89515
89636
|
}
|
|
@@ -89657,7 +89778,7 @@ async function symmetricDecodeJWT(token, secret, salt) {
|
|
|
89657
89778
|
}
|
|
89658
89779
|
}
|
|
89659
89780
|
|
|
89660
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
89781
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/crypto/password.mjs
|
|
89661
89782
|
init_error2();
|
|
89662
89783
|
|
|
89663
89784
|
// ../../node_modules/.bun/@better-auth+utils@0.3.1/node_modules/@better-auth/utils/dist/hex.mjs
|
|
@@ -90629,7 +90750,7 @@ var _poly1305_aead = (xorStream) => (key, nonce3, AAD) => {
|
|
|
90629
90750
|
var chacha20poly1305 = /* @__PURE__ */ wrapCipher({ blockSize: 64, nonceLength: 12, tagLength: 16 }, _poly1305_aead(chacha20));
|
|
90630
90751
|
var xchacha20poly1305 = /* @__PURE__ */ wrapCipher({ blockSize: 64, nonceLength: 24, tagLength: 16 }, _poly1305_aead(xchacha20));
|
|
90631
90752
|
|
|
90632
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
90753
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/crypto/index.mjs
|
|
90633
90754
|
var ENVELOPE_PREFIX = "$ba$";
|
|
90634
90755
|
function parseEnvelope(data2) {
|
|
90635
90756
|
if (!data2.startsWith(ENVELOPE_PREFIX))
|
|
@@ -90684,7 +90805,7 @@ var symmetricDecrypt = async ({ key, data: data2 }) => {
|
|
|
90684
90805
|
throw new Error("Cannot decrypt legacy bare-hex payload: no legacy secret available. Set BETTER_AUTH_SECRET for backwards compatibility.");
|
|
90685
90806
|
};
|
|
90686
90807
|
|
|
90687
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
90808
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/utils/date.mjs
|
|
90688
90809
|
var getDate = (span, unit = "ms") => {
|
|
90689
90810
|
return new Date(Date.now() + (unit === "sec" ? span * 1000 : span));
|
|
90690
90811
|
};
|
|
@@ -90760,7 +90881,7 @@ var verificationSchema = coreSchema.extend({
|
|
|
90760
90881
|
identifier: string2()
|
|
90761
90882
|
});
|
|
90762
90883
|
|
|
90763
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
90884
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/db/schema.mjs
|
|
90764
90885
|
init_error2();
|
|
90765
90886
|
|
|
90766
90887
|
// ../../node_modules/.bun/@better-auth+core@1.5.5+9ce0b2c039e580c5/node_modules/@better-auth/core/dist/utils/db.mjs
|
|
@@ -90774,7 +90895,7 @@ function filterOutputFields(data2, additionalFields) {
|
|
|
90774
90895
|
}), {});
|
|
90775
90896
|
}
|
|
90776
90897
|
|
|
90777
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
90898
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/db/schema.mjs
|
|
90778
90899
|
var cache2 = /* @__PURE__ */ new WeakMap;
|
|
90779
90900
|
function getFields(options, modelName, mode) {
|
|
90780
90901
|
const cacheKey = `${modelName}:${mode}`;
|
|
@@ -90907,12 +91028,12 @@ function mergeSchema(schema, newSchema) {
|
|
|
90907
91028
|
return schema;
|
|
90908
91029
|
}
|
|
90909
91030
|
|
|
90910
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
91031
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/utils/is-promise.mjs
|
|
90911
91032
|
function isPromise(obj) {
|
|
90912
91033
|
return !!obj && (typeof obj === "object" || typeof obj === "function") && typeof obj.then === "function";
|
|
90913
91034
|
}
|
|
90914
91035
|
|
|
90915
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
91036
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/cookies/session-store.mjs
|
|
90916
91037
|
init_json();
|
|
90917
91038
|
init_zod();
|
|
90918
91039
|
var ALLOWED_COOKIE_SIZE = 4096;
|
|
@@ -91096,7 +91217,7 @@ var getSessionQuerySchema = optional(object({
|
|
|
91096
91217
|
disableRefresh: exports_coerce.boolean().meta({ description: "Disable session refresh. Useful for checking session status, without updating the session" }).optional()
|
|
91097
91218
|
}));
|
|
91098
91219
|
|
|
91099
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
91220
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/utils/time.mjs
|
|
91100
91221
|
var SEC = 1000;
|
|
91101
91222
|
var MIN = SEC * 60;
|
|
91102
91223
|
var HOUR = MIN * 60;
|
|
@@ -91105,7 +91226,7 @@ var WEEK = DAY * 7;
|
|
|
91105
91226
|
var MONTH = DAY * 30;
|
|
91106
91227
|
var YEAR = DAY * 365.25;
|
|
91107
91228
|
|
|
91108
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
91229
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/cookies/index.mjs
|
|
91109
91230
|
init_env();
|
|
91110
91231
|
init_error2();
|
|
91111
91232
|
init_json();
|
|
@@ -91161,7 +91282,7 @@ var createHMAC = (algorithm = "SHA-256", encoding = "none") => {
|
|
|
91161
91282
|
return hmac2;
|
|
91162
91283
|
};
|
|
91163
91284
|
|
|
91164
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
91285
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/cookies/index.mjs
|
|
91165
91286
|
async function setCookieCache(ctx, session, dontRememberMe) {
|
|
91166
91287
|
if (!ctx.context.options.session?.cookieCache?.enabled)
|
|
91167
91288
|
return;
|
|
@@ -91260,7 +91381,7 @@ function deleteSessionCookie(ctx, skipDontRememberMe) {
|
|
|
91260
91381
|
expireCookie(ctx, ctx.context.authCookies.dontRememberToken);
|
|
91261
91382
|
}
|
|
91262
91383
|
|
|
91263
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
91384
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/state.mjs
|
|
91264
91385
|
init_error2();
|
|
91265
91386
|
init_zod();
|
|
91266
91387
|
var stateDataSchema = looseObject({
|
|
@@ -91519,10 +91640,10 @@ var queueAfterTransactionHook = async (hook) => {
|
|
|
91519
91640
|
});
|
|
91520
91641
|
};
|
|
91521
91642
|
|
|
91522
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
91643
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/api/state/oauth.mjs
|
|
91523
91644
|
var { get: getOAuthState, set: setOAuthState } = defineRequestState(() => null);
|
|
91524
91645
|
|
|
91525
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
91646
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/oauth2/state.mjs
|
|
91526
91647
|
init_error2();
|
|
91527
91648
|
async function generateState(c, link, additionalData) {
|
|
91528
91649
|
const callbackURL = c.body?.callbackURL || c.context.options.baseURL;
|
|
@@ -91569,10 +91690,10 @@ async function parseState(c) {
|
|
|
91569
91690
|
return parsedData;
|
|
91570
91691
|
}
|
|
91571
91692
|
|
|
91572
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
91693
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/utils/hide-metadata.mjs
|
|
91573
91694
|
var HIDE_METADATA = { scope: "server" };
|
|
91574
91695
|
|
|
91575
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
91696
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/utils/is-api-error.mjs
|
|
91576
91697
|
init_error2();
|
|
91577
91698
|
|
|
91578
91699
|
// ../../node_modules/.bun/better-call@1.3.2+3c5d820c62823f0b/node_modules/better-call/dist/index.mjs
|
|
@@ -92120,12 +92241,12 @@ createMiddleware.create = (opts) => {
|
|
|
92120
92241
|
return fn;
|
|
92121
92242
|
};
|
|
92122
92243
|
|
|
92123
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
92244
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/utils/is-api-error.mjs
|
|
92124
92245
|
function isAPIError2(error48) {
|
|
92125
92246
|
return error48 instanceof APIError || error48 instanceof APIError2 || error48?.name === "APIError";
|
|
92126
92247
|
}
|
|
92127
92248
|
|
|
92128
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
92249
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/auth/trusted-origins.mjs
|
|
92129
92250
|
var matchesOriginPattern = (url2, pattern, settings) => {
|
|
92130
92251
|
if (url2.startsWith("/")) {
|
|
92131
92252
|
if (settings?.allowRelativePaths)
|
|
@@ -92144,7 +92265,7 @@ var matchesOriginPattern = (url2, pattern, settings) => {
|
|
|
92144
92265
|
return protocol === "http:" || protocol === "https:" || !protocol ? pattern === getOrigin(url2) : url2.startsWith(pattern);
|
|
92145
92266
|
};
|
|
92146
92267
|
|
|
92147
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
92268
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/api/middlewares/origin-check.mjs
|
|
92148
92269
|
init_error2();
|
|
92149
92270
|
|
|
92150
92271
|
// ../../node_modules/.bun/@better-auth+core@1.5.5+9ce0b2c039e580c5/node_modules/@better-auth/core/dist/utils/url.mjs
|
|
@@ -92199,7 +92320,7 @@ function deprecate(fn, message2, logger2) {
|
|
|
92199
92320
|
};
|
|
92200
92321
|
}
|
|
92201
92322
|
|
|
92202
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
92323
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/api/middlewares/origin-check.mjs
|
|
92203
92324
|
function shouldSkipCSRFForBackwardCompat(ctx) {
|
|
92204
92325
|
return ctx.context.skipOriginCheck === true && ctx.context.options.advanced?.disableCSRFCheck === undefined;
|
|
92205
92326
|
}
|
|
@@ -92334,7 +92455,7 @@ async function validateFormCsrf(ctx) {
|
|
|
92334
92455
|
}
|
|
92335
92456
|
}
|
|
92336
92457
|
|
|
92337
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
92458
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/utils/get-request-ip.mjs
|
|
92338
92459
|
init_env();
|
|
92339
92460
|
|
|
92340
92461
|
// ../../node_modules/.bun/@better-auth+core@1.5.5+9ce0b2c039e580c5/node_modules/@better-auth/core/dist/utils/ip.mjs
|
|
@@ -92411,7 +92532,7 @@ function normalizeIP(ip, options = {}) {
|
|
|
92411
92532
|
return normalizeIPv6(ip, options.ipv6Subnet || 64);
|
|
92412
92533
|
}
|
|
92413
92534
|
|
|
92414
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
92535
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/utils/get-request-ip.mjs
|
|
92415
92536
|
var LOCALHOST_IP = "127.0.0.1";
|
|
92416
92537
|
function getIp(req, options) {
|
|
92417
92538
|
if (options.advanced?.ipAddress?.disableIpTracking)
|
|
@@ -92431,13 +92552,13 @@ function getIp(req, options) {
|
|
|
92431
92552
|
return null;
|
|
92432
92553
|
}
|
|
92433
92554
|
|
|
92434
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
92555
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/api/rate-limiter/index.mjs
|
|
92435
92556
|
init_json();
|
|
92436
92557
|
|
|
92437
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
92558
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/api/state/should-session-refresh.mjs
|
|
92438
92559
|
var { get: getShouldSkipSessionRefresh, set: setShouldSkipSessionRefresh } = defineRequestState(() => false);
|
|
92439
92560
|
|
|
92440
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
92561
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/_virtual/_rolldown/runtime.mjs
|
|
92441
92562
|
var __defProp3 = Object.defineProperty;
|
|
92442
92563
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
92443
92564
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
@@ -92471,7 +92592,7 @@ var __copyProps = (to, from2, except, desc) => {
|
|
|
92471
92592
|
};
|
|
92472
92593
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
92473
92594
|
|
|
92474
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
92595
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/db/get-schema.mjs
|
|
92475
92596
|
function getSchema(config3) {
|
|
92476
92597
|
const tables = getAuthTables(config3);
|
|
92477
92598
|
const schema = {};
|
|
@@ -92506,7 +92627,7 @@ function getSchema(config3) {
|
|
|
92506
92627
|
return schema;
|
|
92507
92628
|
}
|
|
92508
92629
|
|
|
92509
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
92630
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/db/field-converter.mjs
|
|
92510
92631
|
function convertToDB(fields, values) {
|
|
92511
92632
|
const result = values.id ? { id: values.id } : {};
|
|
92512
92633
|
for (const key in fields) {
|
|
@@ -92527,7 +92648,7 @@ function convertFromDB(fields, values) {
|
|
|
92527
92648
|
return result;
|
|
92528
92649
|
}
|
|
92529
92650
|
|
|
92530
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
92651
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/db/with-hooks.mjs
|
|
92531
92652
|
function getWithHooks(adapter, ctx) {
|
|
92532
92653
|
const hooks = ctx.hooks;
|
|
92533
92654
|
async function createWithHooks(data2, model, customCreateFn) {
|
|
@@ -92700,7 +92821,7 @@ function getWithHooks(adapter, ctx) {
|
|
|
92700
92821
|
};
|
|
92701
92822
|
}
|
|
92702
92823
|
|
|
92703
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
92824
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/db/verification-token-storage.mjs
|
|
92704
92825
|
var defaultKeyHasher = async (identifier) => {
|
|
92705
92826
|
const hash4 = await createHash2("SHA-256").digest(new TextEncoder().encode(identifier));
|
|
92706
92827
|
return base64Url.encode(new Uint8Array(hash4), { padding: false });
|
|
@@ -92728,7 +92849,7 @@ function getStorageOption(identifier, config3) {
|
|
|
92728
92849
|
return config3;
|
|
92729
92850
|
}
|
|
92730
92851
|
|
|
92731
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
92852
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/db/internal-adapter.mjs
|
|
92732
92853
|
init_id2();
|
|
92733
92854
|
init_json();
|
|
92734
92855
|
function getTTLSeconds(expiresAt, now4 = Date.now()) {
|
|
@@ -93405,7 +93526,7 @@ var createInternalAdapter = (adapter, ctx) => {
|
|
|
93405
93526
|
};
|
|
93406
93527
|
};
|
|
93407
93528
|
|
|
93408
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
93529
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/db/to-zod.mjs
|
|
93409
93530
|
init_zod();
|
|
93410
93531
|
function toZodSchema({ fields, isClientSide }) {
|
|
93411
93532
|
const zodFields = Object.keys(fields).reduce((acc, key) => {
|
|
@@ -93434,7 +93555,7 @@ function toZodSchema({ fields, isClientSide }) {
|
|
|
93434
93555
|
}, {});
|
|
93435
93556
|
return object(zodFields);
|
|
93436
93557
|
}
|
|
93437
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
93558
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/db/index.mjs
|
|
93438
93559
|
var db_exports = /* @__PURE__ */ __exportAll({
|
|
93439
93560
|
convertFromDB: () => convertFromDB,
|
|
93440
93561
|
convertToDB: () => convertToDB,
|
|
@@ -93455,7 +93576,7 @@ var db_exports = /* @__PURE__ */ __exportAll({
|
|
|
93455
93576
|
});
|
|
93456
93577
|
__reExport(db_exports, exports_db);
|
|
93457
93578
|
|
|
93458
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
93579
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/api/routes/session.mjs
|
|
93459
93580
|
init_error2();
|
|
93460
93581
|
init_json();
|
|
93461
93582
|
init_zod();
|
|
@@ -93874,7 +93995,7 @@ var revokeOtherSessions = createAuthEndpoint("/revoke-other-sessions", {
|
|
|
93874
93995
|
return ctx.json({ status: true });
|
|
93875
93996
|
});
|
|
93876
93997
|
|
|
93877
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
93998
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/context/helpers.mjs
|
|
93878
93999
|
init_env();
|
|
93879
94000
|
async function getAwaitableValue(arr, item) {
|
|
93880
94001
|
if (!arr)
|
|
@@ -93886,7 +94007,7 @@ async function getAwaitableValue(arr, item) {
|
|
|
93886
94007
|
}
|
|
93887
94008
|
}
|
|
93888
94009
|
|
|
93889
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
94010
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/oauth2/utils.mjs
|
|
93890
94011
|
function isLikelyEncrypted(token) {
|
|
93891
94012
|
if (token.startsWith("$ba$"))
|
|
93892
94013
|
return true;
|
|
@@ -93914,7 +94035,7 @@ function setTokenUtil(token, ctx) {
|
|
|
93914
94035
|
return token;
|
|
93915
94036
|
}
|
|
93916
94037
|
|
|
93917
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
94038
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/api/routes/account.mjs
|
|
93918
94039
|
init_error2();
|
|
93919
94040
|
|
|
93920
94041
|
// ../../node_modules/.bun/@better-auth+core@1.5.5+9ce0b2c039e580c5/node_modules/@better-auth/core/dist/social-providers/apple.mjs
|
|
@@ -97023,7 +97144,7 @@ var socialProviders = {
|
|
|
97023
97144
|
var socialProviderList = Object.keys(socialProviders);
|
|
97024
97145
|
var SocialProviderListEnum = _enum2(socialProviderList).or(string2());
|
|
97025
97146
|
|
|
97026
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
97147
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/api/routes/account.mjs
|
|
97027
97148
|
init_zod();
|
|
97028
97149
|
var listUserAccounts = createAuthEndpoint("/list-accounts", {
|
|
97029
97150
|
method: "GET",
|
|
@@ -97539,7 +97660,7 @@ var accountInfo = createAuthEndpoint("/account-info", {
|
|
|
97539
97660
|
return ctx.json(info2);
|
|
97540
97661
|
});
|
|
97541
97662
|
|
|
97542
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
97663
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/api/routes/email-verification.mjs
|
|
97543
97664
|
init_error2();
|
|
97544
97665
|
init_zod();
|
|
97545
97666
|
async function createEmailVerificationToken(secret, email3, updateTo, expiresIn = 3600, extraPayload) {
|
|
@@ -97842,7 +97963,7 @@ var verifyEmail = createAuthEndpoint("/verify-email", {
|
|
|
97842
97963
|
});
|
|
97843
97964
|
});
|
|
97844
97965
|
|
|
97845
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
97966
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/oauth2/link-account.mjs
|
|
97846
97967
|
init_env();
|
|
97847
97968
|
async function handleOAuthUserInfo(c, opts) {
|
|
97848
97969
|
const { userInfo, account: account3, callbackURL, disableSignUp, overrideUserInfo } = opts;
|
|
@@ -97987,7 +98108,7 @@ Error: `, e);
|
|
|
97987
98108
|
};
|
|
97988
98109
|
}
|
|
97989
98110
|
|
|
97990
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
98111
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/api/routes/callback.mjs
|
|
97991
98112
|
init_json();
|
|
97992
98113
|
init_zod();
|
|
97993
98114
|
var schema = object({
|
|
@@ -98166,7 +98287,7 @@ var callbackOAuth = createAuthEndpoint("/callback/:id", {
|
|
|
98166
98287
|
throw c.redirect(toRedirectTo);
|
|
98167
98288
|
});
|
|
98168
98289
|
|
|
98169
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
98290
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/api/routes/error.mjs
|
|
98170
98291
|
init_env();
|
|
98171
98292
|
function sanitize(input) {
|
|
98172
98293
|
return input.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/&(?!amp;|lt;|gt;|quot;|#39;|#x[0-9a-fA-F]+;|#[0-9]+;)/g, "&");
|
|
@@ -98549,7 +98670,7 @@ var error48 = createAuthEndpoint("/error", {
|
|
|
98549
98670
|
return new Response(html(c.context.options, safeCode, safeDescription), { headers: { "Content-Type": "text/html" } });
|
|
98550
98671
|
});
|
|
98551
98672
|
|
|
98552
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
98673
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/api/routes/ok.mjs
|
|
98553
98674
|
var ok = createAuthEndpoint("/ok", {
|
|
98554
98675
|
method: "GET",
|
|
98555
98676
|
metadata: {
|
|
@@ -98573,7 +98694,7 @@ var ok = createAuthEndpoint("/ok", {
|
|
|
98573
98694
|
return ctx.json({ ok: true });
|
|
98574
98695
|
});
|
|
98575
98696
|
|
|
98576
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
98697
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/utils/password.mjs
|
|
98577
98698
|
init_error2();
|
|
98578
98699
|
async function validatePassword(ctx, data2) {
|
|
98579
98700
|
const credentialAccount = (await ctx.context.internalAdapter.findAccounts(data2.userId))?.find((account3) => account3.providerId === "credential");
|
|
@@ -98586,7 +98707,7 @@ async function validatePassword(ctx, data2) {
|
|
|
98586
98707
|
});
|
|
98587
98708
|
}
|
|
98588
98709
|
|
|
98589
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
98710
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/api/routes/password.mjs
|
|
98590
98711
|
init_error2();
|
|
98591
98712
|
init_id2();
|
|
98592
98713
|
init_zod();
|
|
@@ -98784,7 +98905,7 @@ var verifyPassword2 = createAuthEndpoint("/verify-password", {
|
|
|
98784
98905
|
return ctx.json({ status: true });
|
|
98785
98906
|
});
|
|
98786
98907
|
|
|
98787
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
98908
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/api/routes/sign-in.mjs
|
|
98788
98909
|
init_error2();
|
|
98789
98910
|
init_zod();
|
|
98790
98911
|
var socialSignInBodySchema = object({
|
|
@@ -98813,7 +98934,7 @@ var socialSignInBodySchema = object({
|
|
|
98813
98934
|
additionalData: record(string2(), any()).optional().meta({ description: "Additional data to be passed through the OAuth flow" })
|
|
98814
98935
|
});
|
|
98815
98936
|
|
|
98816
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
98937
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/api/routes/sign-out.mjs
|
|
98817
98938
|
var signOut = createAuthEndpoint("/sign-out", {
|
|
98818
98939
|
method: "POST",
|
|
98819
98940
|
operationId: "signOut",
|
|
@@ -98841,7 +98962,7 @@ var signOut = createAuthEndpoint("/sign-out", {
|
|
|
98841
98962
|
return ctx.json({ success: true });
|
|
98842
98963
|
});
|
|
98843
98964
|
|
|
98844
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
98965
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/api/routes/sign-up.mjs
|
|
98845
98966
|
init_env();
|
|
98846
98967
|
init_error2();
|
|
98847
98968
|
init_id2();
|
|
@@ -98855,12 +98976,12 @@ var signUpEmailBodySchema = object({
|
|
|
98855
98976
|
rememberMe: boolean2().optional()
|
|
98856
98977
|
}).and(record(string2(), any()));
|
|
98857
98978
|
|
|
98858
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
98979
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/api/routes/update-session.mjs
|
|
98859
98980
|
init_error2();
|
|
98860
98981
|
init_zod();
|
|
98861
98982
|
var updateSessionBodySchema = record(string2().meta({ description: "Field name must be a string" }), any());
|
|
98862
98983
|
|
|
98863
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
98984
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/api/routes/update-user.mjs
|
|
98864
98985
|
init_error2();
|
|
98865
98986
|
init_zod();
|
|
98866
98987
|
var updateUserBodySchema = record(string2().meta({ description: "Field name must be a string" }), any());
|
|
@@ -99286,7 +99407,7 @@ var changeEmail = createAuthEndpoint("/change-email", {
|
|
|
99286
99407
|
return ctx.json({ status: true });
|
|
99287
99408
|
});
|
|
99288
99409
|
|
|
99289
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
99410
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/api/to-auth-endpoints.mjs
|
|
99290
99411
|
init_env();
|
|
99291
99412
|
init_error2();
|
|
99292
99413
|
var defuReplaceArrays = createDefu((obj, key, value3) => {
|
|
@@ -99296,25 +99417,25 @@ var defuReplaceArrays = createDefu((obj, key, value3) => {
|
|
|
99296
99417
|
}
|
|
99297
99418
|
});
|
|
99298
99419
|
|
|
99299
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
99420
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/api/index.mjs
|
|
99300
99421
|
init_env();
|
|
99301
99422
|
init_error2();
|
|
99302
99423
|
|
|
99303
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
99424
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/db/adapter-base.mjs
|
|
99304
99425
|
init_env();
|
|
99305
99426
|
|
|
99306
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
99427
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/db/adapter-kysely.mjs
|
|
99307
99428
|
init_error2();
|
|
99308
99429
|
|
|
99309
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
99430
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/db/get-migration.mjs
|
|
99310
99431
|
init_env();
|
|
99311
99432
|
init_dist();
|
|
99312
99433
|
init_adapter();
|
|
99313
99434
|
|
|
99314
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
99435
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/context/secret-utils.mjs
|
|
99315
99436
|
init_error2();
|
|
99316
99437
|
|
|
99317
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
99438
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/context/create-context.mjs
|
|
99318
99439
|
init_env();
|
|
99319
99440
|
init_error2();
|
|
99320
99441
|
init_id2();
|
|
@@ -99323,14 +99444,14 @@ init_id2();
|
|
|
99323
99444
|
init_env();
|
|
99324
99445
|
init_random();
|
|
99325
99446
|
|
|
99326
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
99447
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/context/init.mjs
|
|
99327
99448
|
init_error2();
|
|
99328
99449
|
init_dist();
|
|
99329
99450
|
|
|
99330
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
99451
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/auth/base.mjs
|
|
99331
99452
|
init_error2();
|
|
99332
99453
|
|
|
99333
|
-
// ../../node_modules/.bun/better-auth@1.5.5+
|
|
99454
|
+
// ../../node_modules/.bun/better-auth@1.5.5+ecc9a47ca304ff9f/node_modules/better-auth/dist/index.mjs
|
|
99334
99455
|
init_env();
|
|
99335
99456
|
init_error2();
|
|
99336
99457
|
init_error_codes();
|
|
@@ -99415,16 +99536,24 @@ var walletTwoFactorClient = () => ({
|
|
|
99415
99536
|
});
|
|
99416
99537
|
|
|
99417
99538
|
// ../../packages/dalp/auth/src/utils/permissions.ts
|
|
99418
|
-
var
|
|
99419
|
-
...defaultStatements,
|
|
99420
|
-
...defaultStatements2,
|
|
99539
|
+
var dalPermissions = {
|
|
99421
99540
|
organization: ["update", "delete", "list"],
|
|
99422
99541
|
setting: ["read", "list", "upsert", "remove", "set-global-theme"],
|
|
99423
99542
|
system: ["read", "list", "create"],
|
|
99424
99543
|
exchangeRates: ["read", "list", "remove", "sync", "update"]
|
|
99425
99544
|
};
|
|
99426
|
-
var
|
|
99427
|
-
|
|
99545
|
+
var customPermissions = {
|
|
99546
|
+
...defaultStatements,
|
|
99547
|
+
...defaultStatements2,
|
|
99548
|
+
...dalPermissions
|
|
99549
|
+
};
|
|
99550
|
+
var narrowAccessControl = createAccessControl(customPermissions);
|
|
99551
|
+
var accessControl = createAccessControl({
|
|
99552
|
+
...defaultStatements,
|
|
99553
|
+
...defaultStatements2,
|
|
99554
|
+
...dalPermissions
|
|
99555
|
+
});
|
|
99556
|
+
var adminRole = narrowAccessControl.newRole({
|
|
99428
99557
|
...adminAc.statements,
|
|
99429
99558
|
...ownerAc.statements,
|
|
99430
99559
|
organization: ["update", "delete", "list"],
|
|
@@ -99432,14 +99561,14 @@ var adminRole = accessControl.newRole({
|
|
|
99432
99561
|
system: ["read", "list", "create"],
|
|
99433
99562
|
exchangeRates: ["read", "list", "remove", "sync", "update"]
|
|
99434
99563
|
});
|
|
99435
|
-
var ownerRole =
|
|
99564
|
+
var ownerRole = narrowAccessControl.newRole({
|
|
99436
99565
|
...ownerAc.statements,
|
|
99437
99566
|
user: ["list", "get", "update"],
|
|
99438
99567
|
setting: ["read", "list", "upsert", "remove"],
|
|
99439
99568
|
system: ["read", "list", "create"],
|
|
99440
99569
|
exchangeRates: ["read", "list"]
|
|
99441
99570
|
});
|
|
99442
|
-
var memberRole =
|
|
99571
|
+
var memberRole = narrowAccessControl.newRole({
|
|
99443
99572
|
...memberAc.statements,
|
|
99444
99573
|
setting: ["read", "list"],
|
|
99445
99574
|
system: ["read", "list"],
|