diff --git a/README.md b/README.md index 9ed88be..02070d5 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Served via jsDelivr; fetched automatically during install — you never need to - `arcrun-mcp/` — **arcrun-mcp** - `daemon/` — 桌面 App(Mac/Windows)安裝檔 -Built from `Arcrun@eebb691` by `installer/scripts/ship.mjs`(arcrun-rag repo,release 1.4.32,built 2026-08-10)。 +Built from `Arcrun@eebb691` by `installer/scripts/ship.mjs`(arcrun-rag repo,release 1.4.33,built 2026-08-10)。 ⚠️ 這份檔案由出貨管線每次自動重寫(`installer/scripts/render-bundles-readme.mjs`)—— 不要手動改這裡列的零件清單,要改就改 `installer/scripts/bundle-components.mjs`(唯一真相源,改一個地方兩條出貨路徑同時生效)。 diff --git a/arcrun-code/worker.mjs b/arcrun-code/worker.mjs index df3bc27..3281c7c 100644 --- a/arcrun-code/worker.mjs +++ b/arcrun-code/worker.mjs @@ -13,10 +13,10 @@ var __export = (target, all) => { __defProp(target, name, { get: all[name], enumerable: true }); }; -// ../arcrun/registry/components/code/node_modules/@jitl/quickjs-ffi-types/dist/index.mjs +// ../../matrix/arcrun/registry/components/code/node_modules/@jitl/quickjs-ffi-types/dist/index.mjs var EvalFlags, IntrinsicsFlags, JSPromiseStateEnum, GetOwnPropertyNamesFlags, IsEqualOp; var init_dist = __esm({ - "../arcrun/registry/components/code/node_modules/@jitl/quickjs-ffi-types/dist/index.mjs"() { + "../../matrix/arcrun/registry/components/code/node_modules/@jitl/quickjs-ffi-types/dist/index.mjs"() { EvalFlags = { JS_EVAL_TYPE_GLOBAL: 0, JS_EVAL_TYPE_MODULE: 1, JS_EVAL_TYPE_DIRECT: 2, JS_EVAL_TYPE_INDIRECT: 3, JS_EVAL_TYPE_MASK: 3, JS_EVAL_FLAG_STRICT: 8, JS_EVAL_FLAG_STRIP: 16, JS_EVAL_FLAG_COMPILE_ONLY: 32, JS_EVAL_FLAG_BACKTRACE_BARRIER: 64 }; IntrinsicsFlags = { BaseObjects: 1, Date: 2, Eval: 4, StringNormalize: 8, RegExp: 16, RegExpCompiler: 32, JSON: 64, Proxy: 128, MapSet: 256, TypedArrays: 512, Promise: 1024, BigInt: 2048, BigFloat: 4096, BigDecimal: 8192, OperatorOverloading: 16384, BignumExt: 32768 }; JSPromiseStateEnum = { Pending: 0, Fulfilled: 1, Rejected: 2 }; @@ -25,7 +25,7 @@ var init_dist = __esm({ } }); -// ../arcrun/registry/components/code/node_modules/quickjs-emscripten-core/dist/chunk-JTKJZQYV.mjs +// ../../matrix/arcrun/registry/components/code/node_modules/quickjs-emscripten-core/dist/chunk-JTKJZQYV.mjs function debugLog(...args) { QTS_DEBUG && console.log("quickjs-emscripten:", ...args); } @@ -109,7 +109,7 @@ function applyModuleEvalRuntimeOptions(runtime, options) { } var __defProp2, __export2, QTS_DEBUG, errors_exports, QuickJSUnwrapError, QuickJSWrongOwner, QuickJSUseAfterFree, QuickJSNotImplemented, QuickJSAsyncifyError, QuickJSAsyncifySuspended, QuickJSMemoryLeakDetected, QuickJSEmscriptenModuleError, QuickJSUnknownIntrinsic, QuickJSPromisePending, QuickJSEmptyGetOwnPropertyNames, AwaitYield, UsingDisposable, SymbolDispose, prototypeAsAny, Lifetime, StaticLifetime, WeakLifetime, Scope, AbstractDisposableResult, DisposableSuccess, DisposableFail, DisposableResult, QuickJSDeferredPromise, ModuleMemory, DefaultIntrinsics, QuickJSIterator, ContextMemory, QuickJSContext, QuickJSRuntime, QuickJSEmscriptenModuleCallbacks, QuickJSModuleCallbacks, QuickJSWASMModule; var init_chunk_JTKJZQYV = __esm({ - "../arcrun/registry/components/code/node_modules/quickjs-emscripten-core/dist/chunk-JTKJZQYV.mjs"() { + "../../matrix/arcrun/registry/components/code/node_modules/quickjs-emscripten-core/dist/chunk-JTKJZQYV.mjs"() { init_dist(); init_dist(); __defProp2 = Object.defineProperty; @@ -1041,7 +1041,7 @@ Attempted to suspend at:`); } }); -// ../arcrun/registry/components/code/node_modules/quickjs-emscripten-core/dist/module-6F3E5H7Y.mjs +// ../../matrix/arcrun/registry/components/code/node_modules/quickjs-emscripten-core/dist/module-6F3E5H7Y.mjs var module_6F3E5H7Y_exports = {}; __export(module_6F3E5H7Y_exports, { QuickJSModuleCallbacks: () => QuickJSModuleCallbacks, @@ -1050,19 +1050,19 @@ __export(module_6F3E5H7Y_exports, { applyModuleEvalRuntimeOptions: () => applyModuleEvalRuntimeOptions }); var init_module_6F3E5H7Y = __esm({ - "../arcrun/registry/components/code/node_modules/quickjs-emscripten-core/dist/module-6F3E5H7Y.mjs"() { + "../../matrix/arcrun/registry/components/code/node_modules/quickjs-emscripten-core/dist/module-6F3E5H7Y.mjs"() { init_chunk_JTKJZQYV(); } }); -// ../arcrun/registry/components/code/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.mjs +// ../../matrix/arcrun/registry/components/code/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.mjs var ffi_exports = {}; __export(ffi_exports, { QuickJSFFI: () => QuickJSFFI }); var QuickJSFFI; var init_ffi = __esm({ - "../arcrun/registry/components/code/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.mjs"() { + "../../matrix/arcrun/registry/components/code/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.mjs"() { QuickJSFFI = class { constructor(module) { this.module = module; @@ -1140,7 +1140,7 @@ var init_ffi = __esm({ } }); -// ../arcrun/registry/components/code/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.browser.mjs +// ../../matrix/arcrun/registry/components/code/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.browser.mjs var emscripten_module_browser_exports = {}; __export(emscripten_module_browser_exports, { default: () => emscripten_module_browser_default @@ -1587,12 +1587,12 @@ async function QuickJSRaw(moduleArg = {}) { } var emscripten_module_browser_default; var init_emscripten_module_browser = __esm({ - "../arcrun/registry/components/code/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.browser.mjs"() { + "../../matrix/arcrun/registry/components/code/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.browser.mjs"() { emscripten_module_browser_default = QuickJSRaw; } }); -// ../arcrun/registry/components/code/node_modules/hono/dist/compose.js +// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/compose.js var compose = (middleware, onError, onNotFound) => { return (context, next) => { let index = -1; @@ -1636,10 +1636,10 @@ var compose = (middleware, onError, onNotFound) => { }; }; -// ../arcrun/registry/components/code/node_modules/hono/dist/request/constants.js +// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/request/constants.js var GET_MATCH_RESULT = /* @__PURE__ */ Symbol(); -// ../arcrun/registry/components/code/node_modules/hono/dist/utils/body.js +// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/utils/body.js var parseBody = async (request, options = /* @__PURE__ */ Object.create(null)) => { const { all = false, dot = false } = options; const headers = request instanceof HonoRequest ? request.raw.headers : request.headers; @@ -1711,7 +1711,7 @@ var handleParsingNestedValues = (form, key, value) => { }); }; -// ../arcrun/registry/components/code/node_modules/hono/dist/utils/url.js +// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/utils/url.js var splitPath = (path) => { const paths = path.split("/"); if (paths[0] === "") { @@ -1915,7 +1915,7 @@ var getQueryParams = (url, key) => { }; var decodeURIComponent_ = decodeURIComponent; -// ../arcrun/registry/components/code/node_modules/hono/dist/request.js +// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/request.js var tryDecodeURIComponent = (str) => tryDecode(str, decodeURIComponent_); var HonoRequest = class { /** @@ -2198,7 +2198,7 @@ var HonoRequest = class { } }; -// ../arcrun/registry/components/code/node_modules/hono/dist/utils/html.js +// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/utils/html.js var HtmlEscapedCallbackPhase = { Stringify: 1, BeforeStream: 2, @@ -2240,7 +2240,7 @@ var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) => } }; -// ../arcrun/registry/components/code/node_modules/hono/dist/context.js +// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/context.js var TEXT_PLAIN = "text/plain; charset=UTF-8"; var setDefaultContentType = (contentType, headers) => { return { @@ -2647,7 +2647,7 @@ var Context = class { }; }; -// ../arcrun/registry/components/code/node_modules/hono/dist/router.js +// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/router.js var METHOD_NAME_ALL = "ALL"; var METHOD_NAME_ALL_LOWERCASE = "all"; var METHODS = ["get", "post", "put", "delete", "options", "patch"]; @@ -2655,10 +2655,10 @@ var MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is var UnsupportedPathError = class extends Error { }; -// ../arcrun/registry/components/code/node_modules/hono/dist/utils/constants.js +// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/utils/constants.js var COMPOSED_HANDLER = "__COMPOSED_HANDLER"; -// ../arcrun/registry/components/code/node_modules/hono/dist/hono-base.js +// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/hono-base.js var notFoundHandler = (c) => { return c.text("404 Not Found", 404); }; @@ -3034,7 +3034,7 @@ var Hono = class _Hono { }; }; -// ../arcrun/registry/components/code/node_modules/hono/dist/router/reg-exp-router/matcher.js +// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/router/reg-exp-router/matcher.js var emptyParam = []; function match(method, path) { const matchers = this.buildAllMatchers(); @@ -3055,7 +3055,7 @@ function match(method, path) { return match2(method, path); } -// ../arcrun/registry/components/code/node_modules/hono/dist/router/reg-exp-router/node.js +// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/router/reg-exp-router/node.js var LABEL_REG_EXP_STR = "[^/]+"; var ONLY_WILDCARD_REG_EXP_STR = ".*"; var TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)"; @@ -3163,7 +3163,7 @@ var Node = class _Node { } }; -// ../arcrun/registry/components/code/node_modules/hono/dist/router/reg-exp-router/trie.js +// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/router/reg-exp-router/trie.js var Trie = class { #context = { varIndex: 0 }; #root = new Node(); @@ -3219,7 +3219,7 @@ var Trie = class { } }; -// ../arcrun/registry/components/code/node_modules/hono/dist/router/reg-exp-router/router.js +// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/router/reg-exp-router/router.js var nullMatcher = [/^$/, [], /* @__PURE__ */ Object.create(null)]; var wildcardRegExpCache = /* @__PURE__ */ Object.create(null); function buildWildcardRegExp(path) { @@ -3398,7 +3398,7 @@ var RegExpRouter = class { } }; -// ../arcrun/registry/components/code/node_modules/hono/dist/router/smart-router/router.js +// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/router/smart-router/router.js var SmartRouter = class { name = "SmartRouter"; #routers = []; @@ -3453,7 +3453,7 @@ var SmartRouter = class { } }; -// ../arcrun/registry/components/code/node_modules/hono/dist/router/trie-router/node.js +// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/router/trie-router/node.js var emptyParams = /* @__PURE__ */ Object.create(null); var hasChildren = (children) => { for (const _ in children) { @@ -3628,7 +3628,7 @@ var Node2 = class _Node2 { } }; -// ../arcrun/registry/components/code/node_modules/hono/dist/router/trie-router/router.js +// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/router/trie-router/router.js var TrieRouter = class { name = "TrieRouter"; #node; @@ -3650,7 +3650,7 @@ var TrieRouter = class { } }; -// ../arcrun/registry/components/code/node_modules/hono/dist/hono.js +// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/hono.js var Hono2 = class extends Hono { /** * Creates an instance of the Hono class. @@ -3665,7 +3665,7 @@ var Hono2 = class extends Hono { } }; -// ../arcrun/registry/components/code/node_modules/hono/dist/middleware/cors/index.js +// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/middleware/cors/index.js var cors = (options) => { const opts = { origin: "*", @@ -3747,7 +3747,7 @@ var cors = (options) => { }; }; -// ../arcrun/registry/components/code/node_modules/quickjs-emscripten-core/dist/index.mjs +// ../../matrix/arcrun/registry/components/code/node_modules/quickjs-emscripten-core/dist/index.mjs init_chunk_JTKJZQYV(); init_dist(); async function newQuickJSWASMModuleFromVariant(variantOrPromise) { @@ -3810,14 +3810,14 @@ function newMockExtensions(log) { } }; } -// ../arcrun/registry/components/code/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.mjs +// ../../matrix/arcrun/registry/components/code/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.mjs var variant = { type: "sync", importFFI: () => Promise.resolve().then(() => (init_ffi(), ffi_exports)).then((mod) => mod.QuickJSFFI), importModuleLoader: () => Promise.resolve().then(() => (init_emscripten_module_browser(), emscripten_module_browser_exports)).then((mod) => mod.default) }; var src_default = variant; -// ../arcrun/registry/components/code/index.ts +// ../../matrix/arcrun/registry/components/code/index.ts import wasmModule from "./quickjs.wasm"; -// ../arcrun/registry/components/code/sandbox.mjs +// ../../matrix/arcrun/registry/components/code/sandbox.mjs var _variant = null; function setVariant(v) { _variant = v; @@ -3987,7 +3987,7 @@ function err(message, error_type) { return { success: false, error: message, error_type }; } -// ../arcrun/registry/components/code/index.ts +// ../../matrix/arcrun/registry/components/code/index.ts setVariant(newVariant(src_default, { wasmModule })); var app = new Hono2(); app.use("*", cors()); @@ -4012,7 +4012,7 @@ app.post("/", async (c) => { ); } }); -var code_default = app; +var index_default = app; export { - code_default as default + index_default as default }; diff --git a/arcrun-cypher-executor/worker.mjs b/arcrun-cypher-executor/worker.mjs index a87dd8d..4e55fef 100644 --- a/arcrun-cypher-executor/worker.mjs +++ b/arcrun-cypher-executor/worker.mjs @@ -13,10 +13,10 @@ var __export = (target, all) => { __defProp(target, name, { get: all[name], enumerable: true }); }; -// ../arcrun/cypher-executor/node_modules/hono/dist/compose.js +// ../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/compose.js var compose; var init_compose = __esm({ - "../arcrun/cypher-executor/node_modules/hono/dist/compose.js"() { + "../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/compose.js"() { compose = (middleware, onError, onNotFound) => { return (context, next) => { let index = -1; @@ -62,21 +62,21 @@ var init_compose = __esm({ } }); -// ../arcrun/cypher-executor/node_modules/hono/dist/http-exception.js +// ../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/http-exception.js var init_http_exception = __esm({ - "../arcrun/cypher-executor/node_modules/hono/dist/http-exception.js"() { + "../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/http-exception.js"() { } }); -// ../arcrun/cypher-executor/node_modules/hono/dist/request/constants.js +// ../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/request/constants.js var GET_MATCH_RESULT; var init_constants = __esm({ - "../arcrun/cypher-executor/node_modules/hono/dist/request/constants.js"() { + "../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/request/constants.js"() { GET_MATCH_RESULT = /* @__PURE__ */ Symbol(); } }); -// ../arcrun/cypher-executor/node_modules/hono/dist/utils/body.js +// ../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/utils/body.js async function parseFormData(request, options) { const formData = await request.formData(); if (formData) { @@ -107,7 +107,7 @@ function convertFormDataToBodyData(formData, options) { } var parseBody, handleParsingAllValues, handleParsingNestedValues; var init_body = __esm({ - "../arcrun/cypher-executor/node_modules/hono/dist/utils/body.js"() { + "../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/utils/body.js"() { init_request(); parseBody = async (request, options = /* @__PURE__ */ Object.create(null)) => { const { all = false, dot = false } = options; @@ -154,10 +154,10 @@ var init_body = __esm({ } }); -// ../arcrun/cypher-executor/node_modules/hono/dist/utils/url.js +// ../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/utils/url.js var splitPath, splitRoutingPath, extractGroupsFromPath, replaceGroupMarks, patternCache, getPattern, tryDecode, tryDecodeURI, getPath, getPathNoStrict, mergePath, checkOptionalParameter, _decodeURI, _getQueryParam, getQueryParam, getQueryParams, decodeURIComponent_; var init_url = __esm({ - "../arcrun/cypher-executor/node_modules/hono/dist/utils/url.js"() { + "../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/utils/url.js"() { splitPath = (path) => { const paths = path.split("/"); if (paths[0] === "") { @@ -363,10 +363,10 @@ var init_url = __esm({ } }); -// ../arcrun/cypher-executor/node_modules/hono/dist/request.js +// ../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/request.js var tryDecodeURIComponent, HonoRequest; var init_request = __esm({ - "../arcrun/cypher-executor/node_modules/hono/dist/request.js"() { + "../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/request.js"() { init_http_exception(); init_constants(); init_body(); @@ -515,21 +515,6 @@ var init_request = __esm({ arrayBuffer() { return this.#cachedBody("arrayBuffer"); } - /** - * `.bytes()` parses the request body as a `Uint8Array`. - * - * @see {@link https://hono.dev/docs/api/request#bytes} - * - * @example - * ```ts - * app.post('/entry', async (c) => { - * const body = await c.req.bytes() - * }) - * ``` - */ - bytes() { - return this.#cachedBody("arrayBuffer").then((buffer) => new Uint8Array(buffer)); - } /** * Parses the request body as a `Blob`. * @example @@ -655,10 +640,10 @@ var init_request = __esm({ } }); -// ../arcrun/cypher-executor/node_modules/hono/dist/utils/html.js +// ../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/utils/html.js var HtmlEscapedCallbackPhase, raw, resolveCallback; var init_html = __esm({ - "../arcrun/cypher-executor/node_modules/hono/dist/utils/html.js"() { + "../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/utils/html.js"() { HtmlEscapedCallbackPhase = { Stringify: 1, BeforeStream: 2, @@ -702,10 +687,10 @@ var init_html = __esm({ } }); -// ../arcrun/cypher-executor/node_modules/hono/dist/context.js +// ../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/context.js var TEXT_PLAIN, setDefaultContentType, createResponseInstance, Context; var init_context = __esm({ - "../arcrun/cypher-executor/node_modules/hono/dist/context.js"() { + "../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/context.js"() { init_request(); init_html(); TEXT_PLAIN = "text/plain; charset=UTF-8"; @@ -1116,10 +1101,10 @@ var init_context = __esm({ } }); -// ../arcrun/cypher-executor/node_modules/hono/dist/router.js +// ../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router.js var METHOD_NAME_ALL, METHOD_NAME_ALL_LOWERCASE, METHODS, MESSAGE_MATCHER_IS_ALREADY_BUILT, UnsupportedPathError; var init_router = __esm({ - "../arcrun/cypher-executor/node_modules/hono/dist/router.js"() { + "../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router.js"() { METHOD_NAME_ALL = "ALL"; METHOD_NAME_ALL_LOWERCASE = "all"; METHODS = ["get", "post", "put", "delete", "options", "patch"]; @@ -1129,18 +1114,18 @@ var init_router = __esm({ } }); -// ../arcrun/cypher-executor/node_modules/hono/dist/utils/constants.js +// ../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/utils/constants.js var COMPOSED_HANDLER; var init_constants2 = __esm({ - "../arcrun/cypher-executor/node_modules/hono/dist/utils/constants.js"() { + "../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/utils/constants.js"() { COMPOSED_HANDLER = "__COMPOSED_HANDLER"; } }); -// ../arcrun/cypher-executor/node_modules/hono/dist/hono-base.js +// ../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/hono-base.js var notFoundHandler, errorHandler, Hono; var init_hono_base = __esm({ - "../arcrun/cypher-executor/node_modules/hono/dist/hono-base.js"() { + "../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/hono-base.js"() { init_compose(); init_context(); init_router(); @@ -1260,7 +1245,7 @@ var init_hono_base = __esm({ handler = async (c, next) => (await compose([], app2.errorHandler)(c, () => r.handler(c, next))).res; handler[COMPOSED_HANDLER] = r.handler; } - subApp.#addRoute(r.method, r.path, handler, r.basePath); + subApp.#addRoute(r.method, r.path, handler); }); return this; } @@ -1384,7 +1369,7 @@ var init_hono_base = __esm({ const pathPrefixLength = mergedPath === "/" ? 0 : mergedPath.length; return (request) => { const url = new URL(request.url); - url.pathname = this.getPath(request).slice(pathPrefixLength) || "/"; + url.pathname = url.pathname.slice(pathPrefixLength) || "/"; return new Request(url, request); }; })(); @@ -1398,15 +1383,10 @@ var init_hono_base = __esm({ this.#addRoute(METHOD_NAME_ALL, mergePath(path, "*"), handler); return this; } - #addRoute(method, path, handler, baseRoutePath) { + #addRoute(method, path, handler) { method = method.toUpperCase(); path = mergePath(this._basePath, path); - const r = { - basePath: baseRoutePath !== void 0 ? mergePath(this._basePath, baseRoutePath) : this._basePath, - path, - method, - handler - }; + const r = { basePath: this._basePath, path, method, handler }; this.router.add(method, path, [handler, r]); this.routes.push(r); } @@ -1523,7 +1503,7 @@ var init_hono_base = __esm({ } }); -// ../arcrun/cypher-executor/node_modules/hono/dist/router/reg-exp-router/matcher.js +// ../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router/reg-exp-router/matcher.js function match(method, path) { const matchers = this.buildAllMatchers(); const match2 = ((method2, path2) => { @@ -1544,13 +1524,13 @@ function match(method, path) { } var emptyParam; var init_matcher = __esm({ - "../arcrun/cypher-executor/node_modules/hono/dist/router/reg-exp-router/matcher.js"() { + "../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router/reg-exp-router/matcher.js"() { init_router(); emptyParam = []; } }); -// ../arcrun/cypher-executor/node_modules/hono/dist/router/reg-exp-router/node.js +// ../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router/reg-exp-router/node.js function compareKey(a, b) { if (a.length === 1) { return b.length === 1 ? a < b ? -1 : 1 : -1; @@ -1572,7 +1552,7 @@ function compareKey(a, b) { } var LABEL_REG_EXP_STR, ONLY_WILDCARD_REG_EXP_STR, TAIL_WILDCARD_REG_EXP_STR, PATH_ERROR, regExpMetaChars, Node; var init_node = __esm({ - "../arcrun/cypher-executor/node_modules/hono/dist/router/reg-exp-router/node.js"() { + "../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router/reg-exp-router/node.js"() { LABEL_REG_EXP_STR = "[^/]+"; ONLY_WILDCARD_REG_EXP_STR = ".*"; TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)"; @@ -1663,10 +1643,10 @@ var init_node = __esm({ } }); -// ../arcrun/cypher-executor/node_modules/hono/dist/router/reg-exp-router/trie.js +// ../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router/reg-exp-router/trie.js var Trie; var init_trie = __esm({ - "../arcrun/cypher-executor/node_modules/hono/dist/router/reg-exp-router/trie.js"() { + "../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router/reg-exp-router/trie.js"() { init_node(); Trie = class { #context = { varIndex: 0 }; @@ -1725,7 +1705,7 @@ var init_trie = __esm({ } }); -// ../arcrun/cypher-executor/node_modules/hono/dist/router/reg-exp-router/router.js +// ../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router/reg-exp-router/router.js function buildWildcardRegExp(path) { return wildcardRegExpCache[path] ??= new RegExp( path === "*" ? "" : `^${path.replace( @@ -1807,7 +1787,7 @@ function findMiddleware(middleware, path) { } var nullMatcher, wildcardRegExpCache, RegExpRouter; var init_router2 = __esm({ - "../arcrun/cypher-executor/node_modules/hono/dist/router/reg-exp-router/router.js"() { + "../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router/reg-exp-router/router.js"() { init_router(); init_url(); init_matcher(); @@ -1914,27 +1894,27 @@ var init_router2 = __esm({ } }); -// ../arcrun/cypher-executor/node_modules/hono/dist/router/reg-exp-router/prepared-router.js +// ../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router/reg-exp-router/prepared-router.js var init_prepared_router = __esm({ - "../arcrun/cypher-executor/node_modules/hono/dist/router/reg-exp-router/prepared-router.js"() { + "../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router/reg-exp-router/prepared-router.js"() { init_router(); init_matcher(); init_router2(); } }); -// ../arcrun/cypher-executor/node_modules/hono/dist/router/reg-exp-router/index.js +// ../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router/reg-exp-router/index.js var init_reg_exp_router = __esm({ - "../arcrun/cypher-executor/node_modules/hono/dist/router/reg-exp-router/index.js"() { + "../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router/reg-exp-router/index.js"() { init_router2(); init_prepared_router(); } }); -// ../arcrun/cypher-executor/node_modules/hono/dist/router/smart-router/router.js +// ../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router/smart-router/router.js var SmartRouter; var init_router3 = __esm({ - "../arcrun/cypher-executor/node_modules/hono/dist/router/smart-router/router.js"() { + "../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router/smart-router/router.js"() { init_router(); SmartRouter = class { name = "SmartRouter"; @@ -1992,17 +1972,17 @@ var init_router3 = __esm({ } }); -// ../arcrun/cypher-executor/node_modules/hono/dist/router/smart-router/index.js +// ../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router/smart-router/index.js var init_smart_router = __esm({ - "../arcrun/cypher-executor/node_modules/hono/dist/router/smart-router/index.js"() { + "../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router/smart-router/index.js"() { init_router3(); } }); -// ../arcrun/cypher-executor/node_modules/hono/dist/router/trie-router/node.js +// ../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router/trie-router/node.js var emptyParams, hasChildren, Node2; var init_node2 = __esm({ - "../arcrun/cypher-executor/node_modules/hono/dist/router/trie-router/node.js"() { + "../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router/trie-router/node.js"() { init_router(); init_url(); emptyParams = /* @__PURE__ */ Object.create(null); @@ -2181,10 +2161,10 @@ var init_node2 = __esm({ } }); -// ../arcrun/cypher-executor/node_modules/hono/dist/router/trie-router/router.js +// ../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router/trie-router/router.js var TrieRouter; var init_router4 = __esm({ - "../arcrun/cypher-executor/node_modules/hono/dist/router/trie-router/router.js"() { + "../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router/trie-router/router.js"() { init_url(); init_node2(); TrieRouter = class { @@ -2210,17 +2190,17 @@ var init_router4 = __esm({ } }); -// ../arcrun/cypher-executor/node_modules/hono/dist/router/trie-router/index.js +// ../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router/trie-router/index.js var init_trie_router = __esm({ - "../arcrun/cypher-executor/node_modules/hono/dist/router/trie-router/index.js"() { + "../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router/trie-router/index.js"() { init_router4(); } }); -// ../arcrun/cypher-executor/node_modules/hono/dist/hono.js +// ../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/hono.js var Hono2; var init_hono = __esm({ - "../arcrun/cypher-executor/node_modules/hono/dist/hono.js"() { + "../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/hono.js"() { init_hono_base(); init_reg_exp_router(); init_smart_router(); @@ -2241,15 +2221,14 @@ var init_hono = __esm({ } }); -// ../arcrun/cypher-executor/node_modules/hono/dist/index.js +// ../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/index.js var init_dist = __esm({ - "../arcrun/cypher-executor/node_modules/hono/dist/index.js"() { + "../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/index.js"() { init_hono(); - init_context(); } }); -// ../arcrun/cypher-executor/src/types.ts +// ../../matrix/arcrun/cypher-executor/src/types.ts async function kvGetNodeOutput(store, nodeId) { try { const val = await store.kv.get(`${store.runId}:node:${nodeId}`, "json"); @@ -2270,7 +2249,7 @@ async function kvSetNodeOutput(store, nodeId, output) { } var WorkflowPaused, ExecutionError; var init_types = __esm({ - "../arcrun/cypher-executor/src/types.ts"() { + "../../matrix/arcrun/cypher-executor/src/types.ts"() { "use strict"; WorkflowPaused = class extends Error { task_id; @@ -2301,7 +2280,7 @@ var init_types = __esm({ } }); -// ../arcrun/cypher-executor/src/lib/hash.ts +// ../../matrix/arcrun/cypher-executor/src/lib/hash.ts async function deriveRecipeHash(canonicalId) { return "rec_" + await sha256Prefix(canonicalId); } @@ -2317,12 +2296,12 @@ async function sha256Prefix(input) { return Array.from(new Uint8Array(buf)).map((b) => b.toString(16).padStart(2, "0")).join("").slice(0, 8); } var init_hash = __esm({ - "../arcrun/cypher-executor/src/lib/hash.ts"() { + "../../matrix/arcrun/cypher-executor/src/lib/hash.ts"() { "use strict"; } }); -// ../arcrun/cypher-executor/src/routes/recipes.ts +// ../../matrix/arcrun/cypher-executor/src/routes/recipes.ts async function installRecipeRecord(kv, recipe) { const uuid = recipe.uuid; const { canonical_id, hash_id } = recipe; @@ -2382,7 +2361,7 @@ async function resolveAuthRecipe(service, kv) { } var recipesRouter, kIdxCanonical, kIdxInstalled; var init_recipes = __esm({ - "../arcrun/cypher-executor/src/routes/recipes.ts"() { + "../../matrix/arcrun/cypher-executor/src/routes/recipes.ts"() { "use strict"; init_dist(); init_hash(); @@ -2670,10 +2649,10 @@ var init_recipes = __esm({ } }); -// ../arcrun/cypher-executor/src/lib/constants.ts +// ../../matrix/arcrun/cypher-executor/src/lib/constants.ts var VALID_EDGE_TYPES, SEMANTIC_EDGE_MAP, BUILTIN_COMPONENTS; var init_constants3 = __esm({ - "../arcrun/cypher-executor/src/lib/constants.ts"() { + "../../matrix/arcrun/cypher-executor/src/lib/constants.ts"() { "use strict"; VALID_EDGE_TYPES = /* @__PURE__ */ new Set([ // 現有 @@ -2733,7 +2712,7 @@ var init_constants3 = __esm({ } }); -// ../arcrun/cypher-executor/src/lib/recipe-payload.ts +// ../../matrix/arcrun/cypher-executor/src/lib/recipe-payload.ts function getPath2(obj, path) { let cur = obj; for (const part of path.split(".")) { @@ -2807,12 +2786,12 @@ function sanitize(input, map) { return s.trim(); } var init_recipe_payload = __esm({ - "../arcrun/cypher-executor/src/lib/recipe-payload.ts"() { + "../../matrix/arcrun/cypher-executor/src/lib/recipe-payload.ts"() { "use strict"; } }); -// ../arcrun/cypher-executor/src/lib/component-loader.ts +// ../../matrix/arcrun/cypher-executor/src/lib/component-loader.ts function wasmWorkerUrl(canonicalId, subdomain) { const kebab = canonicalId.replace(/_/g, "-"); return `https://arcrun-${kebab}.${subdomain}.workers.dev`; @@ -3050,7 +3029,7 @@ async function readBodyOnce(res) { } var WASM_HTTP_RUNNER_IDS, LOGIC_BINDING_MAP; var init_component_loader = __esm({ - "../arcrun/cypher-executor/src/lib/component-loader.ts"() { + "../../matrix/arcrun/cypher-executor/src/lib/component-loader.ts"() { "use strict"; init_constants3(); init_hash(); @@ -3094,7 +3073,7 @@ var init_component_loader = __esm({ } }); -// ../arcrun/cypher-executor/src/lib/wasi-shim.ts +// ../../matrix/arcrun/cypher-executor/src/lib/wasi-shim.ts async function routedKvGet(env, apiKey, key) { if (key.startsWith("auth_recipe:")) { return env.RECIPES.get(key); @@ -3141,12 +3120,12 @@ function createArcrunHostFunctions(env, apiKey) { }; } var init_wasi_shim = __esm({ - "../arcrun/cypher-executor/src/lib/wasi-shim.ts"() { + "../../matrix/arcrun/cypher-executor/src/lib/wasi-shim.ts"() { "use strict"; } }); -// ../arcrun/cypher-executor/src/routes/kbdb-proxy.ts +// ../../matrix/arcrun/cypher-executor/src/routes/kbdb-proxy.ts function kbdbBase(env) { const base = (env.KBDB_BASE_URL ?? "https://arcrun-kbdb.uncle6-me.workers.dev").replace(/\/$/, ""); const headers = { "Content-Type": "application/json" }; @@ -3162,7 +3141,7 @@ function graphBase(env) { } var kbdbProxyRouter, NEED_KEY; var init_kbdb_proxy = __esm({ - "../arcrun/cypher-executor/src/routes/kbdb-proxy.ts"() { + "../../matrix/arcrun/cypher-executor/src/routes/kbdb-proxy.ts"() { "use strict"; init_dist(); kbdbProxyRouter = new Hono2(); @@ -3327,7 +3306,7 @@ var init_kbdb_proxy = __esm({ } }); -// ../arcrun/cypher-executor/src/routes/credentials.ts +// ../../matrix/arcrun/cypher-executor/src/routes/credentials.ts async function deriveSecretRef(apiKey, name) { const hash8 = await sha256Prefix(apiKey); return `CRED_${name.toUpperCase()}_${hash8.toUpperCase()}`; @@ -3522,7 +3501,7 @@ async function writeCredential(env, apiKey, name, value, service, sensitivityRaw } var credentialsRouter, CYPHER_SCRIPT_NAME, CREDENTIAL_ENTRY_TYPE, DIR_CACHE_TTL_MS, dirCache; var init_credentials = __esm({ - "../arcrun/cypher-executor/src/routes/credentials.ts"() { + "../../matrix/arcrun/cypher-executor/src/routes/credentials.ts"() { "use strict"; init_dist(); init_hash(); @@ -3634,7 +3613,7 @@ var init_credentials = __esm({ } }); -// ../arcrun/cypher-executor/src/actions/auth-dispatcher.ts +// ../../matrix/arcrun/cypher-executor/src/actions/auth-dispatcher.ts async function resolveSecretsFromNewHome(env, apiKey, names) { const resolved = {}; if (names.length === 0) return resolved; @@ -3755,7 +3734,7 @@ async function resolveCredentialRefs(data, env, apiKey) { } var SUPPORTED_PRIMITIVES, AUTH_PRIMITIVE_IDS, CREDENTIAL_REF; var init_auth_dispatcher = __esm({ - "../arcrun/cypher-executor/src/actions/auth-dispatcher.ts"() { + "../../matrix/arcrun/cypher-executor/src/actions/auth-dispatcher.ts"() { "use strict"; init_recipes(); init_component_loader(); @@ -3772,7 +3751,7 @@ var init_auth_dispatcher = __esm({ } }); -// ../arcrun/cypher-executor/node_modules/zod/lib/index.mjs +// ../../matrix/arcrun/cypher-executor/node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/index.mjs function setErrorMap(map) { overrideErrorMap = map; } @@ -3954,7 +3933,7 @@ function custom(check, params = {}, fatal) { } var util, objectUtil, ZodParsedType, getParsedType, ZodIssueCode, quotelessJson, ZodError, errorMap, overrideErrorMap, makeIssue, EMPTY_PATH, ParseStatus, INVALID, DIRTY, OK, isAborted, isDirty, isValid, isAsync, errorUtil, _ZodEnum_cache, _ZodNativeEnum_cache, ParseInputLazyPath, handleResult, ZodType, cuidRegex, cuid2Regex, ulidRegex, uuidRegex, nanoidRegex, durationRegex, emailRegex, _emojiRegex, emojiRegex, ipv4Regex, ipv6Regex, base64Regex, dateRegexSource, dateRegex, ZodString, ZodNumber, ZodBigInt, ZodBoolean, ZodDate, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodArray, ZodObject, ZodUnion, getDiscriminator, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodFunction, ZodLazy, ZodLiteral, ZodEnum, ZodNativeEnum, ZodPromise, ZodEffects, ZodOptional, ZodNullable, ZodDefault, ZodCatch, ZodNaN, BRAND, ZodBranded, ZodPipeline, ZodReadonly, late, ZodFirstPartyTypeKind, instanceOfType, stringType, numberType, nanType, bigIntType, booleanType, dateType, symbolType, undefinedType, nullType, anyType, unknownType, neverType, voidType, arrayType, objectType, strictObjectType, unionType, discriminatedUnionType, intersectionType, tupleType, recordType, mapType, setType, functionType, lazyType, literalType, enumType, nativeEnumType, promiseType, effectsType, optionalType, nullableType, preprocessType, pipelineType, ostring, onumber, oboolean, coerce, NEVER, z; var init_lib = __esm({ - "../arcrun/cypher-executor/node_modules/zod/lib/index.mjs"() { + "../../matrix/arcrun/cypher-executor/node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/index.mjs"() { (function(util2) { util2.assertEqual = (val) => val; function assertIs(_arg) { @@ -7684,10 +7663,10 @@ var init_lib = __esm({ } }); -// ../arcrun/cypher-executor/src/lib/prompt-recipe-schema.ts +// ../../matrix/arcrun/cypher-executor/src/lib/prompt-recipe-schema.ts var TransformSchema, KBDBBlockFragmentSchema, KVFragmentSchema, FragmentSchema, InputSchema, PromptAssemblySchema, OutputSpecSchema, PromptRecipeSchema; var init_prompt_recipe_schema = __esm({ - "../arcrun/cypher-executor/src/lib/prompt-recipe-schema.ts"() { + "../../matrix/arcrun/cypher-executor/src/lib/prompt-recipe-schema.ts"() { "use strict"; init_lib(); TransformSchema = z.string().regex(/^[a-z_]+(:.+)?$/, "transform \u5FC5\u9808\u70BA name \u6216 name:arg \u683C\u5F0F"); @@ -7750,7 +7729,7 @@ var init_prompt_recipe_schema = __esm({ } }); -// ../arcrun/cypher-executor/src/lib/recipe-loader.ts +// ../../matrix/arcrun/cypher-executor/src/lib/recipe-loader.ts async function loadPromptRecipe(recipeRef, recipesKv) { const key = recipeRef.startsWith("prompt_recipe:") ? recipeRef : `prompt_recipe:${recipeRef}`; const raw2 = await recipesKv.get(key); @@ -7775,7 +7754,7 @@ async function loadPromptRecipe(recipeRef, recipesKv) { } var RecipeLoadError; var init_recipe_loader = __esm({ - "../arcrun/cypher-executor/src/lib/recipe-loader.ts"() { + "../../matrix/arcrun/cypher-executor/src/lib/recipe-loader.ts"() { "use strict"; init_prompt_recipe_schema(); RecipeLoadError = class extends Error { @@ -7788,7 +7767,7 @@ var init_recipe_loader = __esm({ } }); -// ../arcrun/cypher-executor/src/lib/recipe-transforms.ts +// ../../matrix/arcrun/cypher-executor/src/lib/recipe-transforms.ts function applyTransform(value, spec) { const colonIdx = spec.indexOf(":"); const name = colonIdx === -1 ? spec : spec.slice(0, colonIdx); @@ -7799,7 +7778,7 @@ function applyTransform(value, spec) { } var transforms; var init_recipe_transforms = __esm({ - "../arcrun/cypher-executor/src/lib/recipe-transforms.ts"() { + "../../matrix/arcrun/cypher-executor/src/lib/recipe-transforms.ts"() { "use strict"; transforms = { json_array: (v) => JSON.stringify(v ?? []), @@ -7833,7 +7812,7 @@ var init_recipe_transforms = __esm({ } }); -// ../arcrun/cypher-executor/src/lib/recipe-expander.ts +// ../../matrix/arcrun/cypher-executor/src/lib/recipe-expander.ts function getByPath(ctx, path) { const parts = path.split("."); let cur = ctx; @@ -7910,14 +7889,14 @@ ${user}`; }; } var init_recipe_expander = __esm({ - "../arcrun/cypher-executor/src/lib/recipe-expander.ts"() { + "../../matrix/arcrun/cypher-executor/src/lib/recipe-expander.ts"() { "use strict"; init_recipe_loader(); init_recipe_transforms(); } }); -// ../arcrun/cypher-executor/src/lib/paused-runs.ts +// ../../matrix/arcrun/cypher-executor/src/lib/paused-runs.ts async function readIndex(kv, apiKey) { const raw2 = await kv.get(`${IDX_PREFIX}${apiKey}`); if (!raw2) return []; @@ -8006,7 +7985,7 @@ function parseRecipeOutput(result, format, requiredFields) { } var KEY_PREFIX, IDX_PREFIX, TTL_SECONDS; var init_paused_runs = __esm({ - "../arcrun/cypher-executor/src/lib/paused-runs.ts"() { + "../../matrix/arcrun/cypher-executor/src/lib/paused-runs.ts"() { "use strict"; KEY_PREFIX = "paused_run:"; IDX_PREFIX = "paused_idx:"; @@ -8014,7 +7993,7 @@ var init_paused_runs = __esm({ } }); -// ../arcrun/cypher-executor/src/lib/magic-vars.ts +// ../../matrix/arcrun/cypher-executor/src/lib/magic-vars.ts function isoWeekNumber(d) { const target = new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate())); const dayNum = (target.getUTCDay() + 6) % 7; @@ -8076,12 +8055,12 @@ function buildMagicVars(now2 = /* @__PURE__ */ new Date()) { }; } var init_magic_vars = __esm({ - "../arcrun/cypher-executor/src/lib/magic-vars.ts"() { + "../../matrix/arcrun/cypher-executor/src/lib/magic-vars.ts"() { "use strict"; } }); -// ../arcrun/cypher-executor/src/lib/telemetry.ts +// ../../matrix/arcrun/cypher-executor/src/lib/telemetry.ts async function hashApiKey(apiKey) { if (!apiKey) return "anon"; const encoder = new TextEncoder(); @@ -8136,12 +8115,12 @@ function recordTelemetry(env, apiKey, record, ctx) { } } var init_telemetry = __esm({ - "../arcrun/cypher-executor/src/lib/telemetry.ts"() { + "../../matrix/arcrun/cypher-executor/src/lib/telemetry.ts"() { "use strict"; } }); -// ../arcrun/cypher-executor/src/graph-executor.ts +// ../../matrix/arcrun/cypher-executor/src/graph-executor.ts function propagateCtx(context, upstreamResult, upstreamNodeId) { const baseCtx = typeof context === "object" && context !== null ? context : {}; const baseResult = typeof upstreamResult === "object" && upstreamResult !== null ? upstreamResult : {}; @@ -8252,7 +8231,7 @@ function getIterableFromContext(context, key) { } var GraphExecutor; var init_graph_executor = __esm({ - "../arcrun/cypher-executor/src/graph-executor.ts"() { + "../../matrix/arcrun/cypher-executor/src/graph-executor.ts"() { "use strict"; init_types(); init_auth_dispatcher(); @@ -8685,10 +8664,10 @@ var init_graph_executor = __esm({ } }); -// ../arcrun/cypher-executor/src/lib/schemas.ts +// ../../matrix/arcrun/cypher-executor/src/lib/schemas.ts var graphSchema, executeSchema; var init_schemas = __esm({ - "../arcrun/cypher-executor/src/lib/schemas.ts"() { + "../../matrix/arcrun/cypher-executor/src/lib/schemas.ts"() { "use strict"; init_lib(); graphSchema = z.object({ @@ -8718,7 +8697,7 @@ var init_schemas = __esm({ } }); -// ../arcrun/cypher-executor/src/actions/execution-evaluator.ts +// ../../matrix/arcrun/cypher-executor/src/actions/execution-evaluator.ts function componentVerdictsFromTrace(nodes, trace) { const componentByNodeId = /* @__PURE__ */ new Map(); for (const n of nodes) { @@ -8762,13 +8741,13 @@ async function recordComponentStats(env, nodes, trace) { } } var init_execution_evaluator = __esm({ - "../arcrun/cypher-executor/src/actions/execution-evaluator.ts"() { + "../../matrix/arcrun/cypher-executor/src/actions/execution-evaluator.ts"() { "use strict"; init_component_loader(); } }); -// ../arcrun/cypher-executor/src/actions/webhook-handlers.ts +// ../../matrix/arcrun/cypher-executor/src/actions/webhook-handlers.ts var webhook_handlers_exports = {}; __export(webhook_handlers_exports, { executeWebhookGraph: () => executeWebhookGraph, @@ -8875,7 +8854,7 @@ async function executeWebhookGraph(env, graph, triggerContext, token, apiKey, ct } } var init_webhook_handlers = __esm({ - "../arcrun/cypher-executor/src/actions/webhook-handlers.ts"() { + "../../matrix/arcrun/cypher-executor/src/actions/webhook-handlers.ts"() { "use strict"; init_types(); init_graph_executor(); @@ -8886,21 +8865,27 @@ var init_webhook_handlers = __esm({ } }); -// ../arcrun/cypher-executor/src/index.ts +// ../../matrix/arcrun/cypher-executor/src/index.ts init_dist(); -// ../arcrun/cypher-executor/node_modules/hono/dist/middleware/cors/index.js +// ../../matrix/arcrun/cypher-executor/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/middleware/cors/index.js var cors = (options) => { - const opts = { + const defaults = { origin: "*", allowMethods: ["GET", "HEAD", "PUT", "POST", "DELETE", "PATCH"], allowHeaders: [], - exposeHeaders: [], + exposeHeaders: [] + }; + const opts = { + ...defaults, ...options }; const findAllowOrigin = ((optsOrigin) => { if (typeof optsOrigin === "string") { if (optsOrigin === "*") { + if (opts.credentials) { + return (origin) => origin || null; + } return () => optsOrigin; } else { return (origin) => optsOrigin === origin ? origin : null; @@ -8935,7 +8920,7 @@ var cors = (options) => { set("Access-Control-Expose-Headers", opts.exposeHeaders.join(",")); } if (c.req.method === "OPTIONS") { - if (opts.origin !== "*") { + if (opts.origin !== "*" || opts.credentials) { set("Vary", "Origin"); } if (opts.maxAge != null) { @@ -8965,13 +8950,13 @@ var cors = (options) => { }); } await next(); - if (opts.origin !== "*") { + if (opts.origin !== "*" || opts.credentials) { c.header("Vary", "Origin", { append: true }); } }; }; -// ../arcrun/cypher-executor/src/lib/cron-match.ts +// ../../matrix/arcrun/cypher-executor/src/lib/cron-match.ts function matchField(expr, value, min, max) { if (expr === "*") return true; for (const part of expr.split(",")) { @@ -9020,7 +9005,7 @@ function extractCronExpr(graph) { return null; } -// ../arcrun/cypher-executor/src/lib/cron-index.ts +// ../../matrix/arcrun/cypher-executor/src/lib/cron-index.ts var CRON_INDEX_KEY = "cron-idx:_all"; function cronEntryKey(apiKey, name) { return `${apiKey}:${name}`; @@ -9053,7 +9038,7 @@ async function updateCronIndexEntry(kv, apiKey, name, cronExpr) { await kv.put(CRON_INDEX_KEY, JSON.stringify(index)); } -// ../arcrun/cypher-executor/src/scheduled.ts +// ../../matrix/arcrun/cypher-executor/src/scheduled.ts init_webhook_handlers(); init_kbdb_proxy(); async function handleScheduled(controller, env, ctx) { @@ -9106,10 +9091,10 @@ async function handleScheduled(controller, env, ctx) { } } -// ../arcrun/cypher-executor/src/routes/health.ts +// ../../matrix/arcrun/cypher-executor/src/routes/health.ts init_dist(); -// ../arcrun/cypher-executor/src/lib/portal-auth-store.ts +// ../../matrix/arcrun/cypher-executor/src/lib/portal-auth-store.ts init_credentials(); var AUTH_STORE_PREFIX = "ARCRUN_AUTH_STORE"; var SHARD_MAX_BYTES = 4600; @@ -9274,7 +9259,7 @@ function authStoreStatus(env) { }; } -// ../arcrun/cypher-executor/src/routes/health.ts +// ../../matrix/arcrun/cypher-executor/src/routes/health.ts var healthRouter = new Hono2(); healthRouter.get("/health", (c) => { const bundleVersion = c.env.ARCRUN_BUNDLE_VERSION; @@ -9293,14 +9278,14 @@ healthRouter.get( }) ); -// ../arcrun/cypher-executor/src/routes/execute.ts +// ../../matrix/arcrun/cypher-executor/src/routes/execute.ts init_dist(); init_types(); init_graph_executor(); init_schemas(); init_component_loader(); -// ../arcrun/cypher-executor/src/actions/execution-logger.ts +// ../../matrix/arcrun/cypher-executor/src/actions/execution-logger.ts init_kbdb_proxy(); function extractTarget(input) { if (!input) return void 0; @@ -9328,7 +9313,7 @@ async function writeExecutionVerdict(env, workflowId, nodes, verdict, durationMs } } -// ../arcrun/cypher-executor/src/routes/execute.ts +// ../../matrix/arcrun/cypher-executor/src/routes/execute.ts var executeRouter = new Hono2(); executeRouter.post("/execute", async (c) => { const body = await c.req.json(); @@ -9373,17 +9358,17 @@ executeRouter.post("/execute", async (c) => { } }); -// ../arcrun/cypher-executor/src/routes/cypher.ts +// ../../matrix/arcrun/cypher-executor/src/routes/cypher.ts init_dist(); -// ../arcrun/cypher-executor/src/actions/cypher-handlers.ts +// ../../matrix/arcrun/cypher-executor/src/actions/cypher-handlers.ts init_types(); init_graph_executor(); init_schemas(); init_component_loader(); init_execution_evaluator(); -// ../arcrun/cypher-executor/src/actions/triplet-parser.ts +// ../../matrix/arcrun/cypher-executor/src/actions/triplet-parser.ts init_constants3(); function parseTriplets(rawTriplets) { const edges = []; @@ -9424,11 +9409,11 @@ function toEdgeType(label) { return SEMANTIC_EDGE_MAP[label] ?? SEMANTIC_EDGE_MAP[upper] ?? "PIPE"; } -// ../arcrun/cypher-executor/src/actions/search-nodes.ts +// ../../matrix/arcrun/cypher-executor/src/actions/search-nodes.ts init_component_loader(); init_recipes(); -// ../arcrun/cypher-executor/src/lib/branch-hints.ts +// ../../matrix/arcrun/cypher-executor/src/lib/branch-hints.ts var BRANCH_HINTS = { if_control: { branch_field: "data.branch", @@ -9457,7 +9442,7 @@ function branchHintFor(componentId) { return BRANCH_HINTS[componentId.toLowerCase()]; } -// ../arcrun/cypher-executor/src/actions/search-nodes.ts +// ../../matrix/arcrun/cypher-executor/src/actions/search-nodes.ts async function searchNodes(parsed, config, env, mode = "discover", target) { const nodeResults = {}; const missingNodes = []; @@ -9890,7 +9875,7 @@ async function searchSimilarComponents(registryBase, nodeName) { return [...count.entries()].sort((a, b) => b[1] - a[1]).slice(0, 3).map(([id]) => id); } -// ../arcrun/cypher-executor/src/actions/graph-builder.ts +// ../../matrix/arcrun/cypher-executor/src/actions/graph-builder.ts function buildExecutionGraph(parsed, nodeResults, graphId, graphName, config) { const nodes = [...parsed.nodeNames].map((name) => { const nr = nodeResults[name]; @@ -9927,7 +9912,7 @@ function buildExecutionGraph(parsed, nodeResults, graphId, graphName, config) { return { id: graphId, name: graphName, nodes, edges }; } -// ../arcrun/cypher-executor/src/actions/cypher-handlers.ts +// ../../matrix/arcrun/cypher-executor/src/actions/cypher-handlers.ts async function handleCypherSearch(triplets, env, mode = "discover", target) { const parsed = parseTriplets(triplets); if (!parsed) { @@ -9991,10 +9976,10 @@ async function handleCypherExecute(triplets, context, graphId, graphName, config } } -// ../arcrun/cypher-executor/src/actions/target-search.ts +// ../../matrix/arcrun/cypher-executor/src/actions/target-search.ts init_component_loader(); -// ../arcrun/cypher-executor/src/lib/workflow-search.ts +// ../../matrix/arcrun/cypher-executor/src/lib/workflow-search.ts async function fetchTenantWorkflowSearch(env, apiKey, q, mode = "semantic") { const base = (env.KBDB_BASE_URL ?? "https://arcrun-kbdb.uncle6-me.workers.dev").replace(/\/$/, ""); const headers = { "Content-Type": "application/json" }; @@ -10010,7 +9995,7 @@ async function fetchTenantWorkflowSearch(env, apiKey, q, mode = "semantic") { return fetch(`${base}/entries/search?${params.toString()}`, { headers }); } -// ../arcrun/cypher-executor/src/actions/target-search.ts +// ../../matrix/arcrun/cypher-executor/src/actions/target-search.ts async function searchByTarget(target, query, env, apiKey) { if (target === "component") { const sub = env.WORKER_SUBDOMAIN; @@ -10080,7 +10065,7 @@ async function searchByTarget(target, query, env, apiKey) { return { ok: true, body: { target, query, ...body } }; } -// ../arcrun/cypher-executor/src/routes/cypher.ts +// ../../matrix/arcrun/cypher-executor/src/routes/cypher.ts var cypherRouter = new Hono2(); var VALID_TARGETS = /* @__PURE__ */ new Set(["component", "recipe", "workflow"]); cypherRouter.post("/cypher/search", async (c) => { @@ -10173,7 +10158,7 @@ cypherRouter.post("/cypher/execute", async (c) => { } }); -// ../arcrun/cypher-executor/src/routes/validate.ts +// ../../matrix/arcrun/cypher-executor/src/routes/validate.ts init_dist(); init_schemas(); init_telemetry(); @@ -10210,10 +10195,10 @@ validateRouter.post("/validate", async (c) => { return c.json({ valid: true, nodeCount: parsed.data.nodes.length, edgeCount: parsed.data.edges.length }); }); -// ../arcrun/cypher-executor/src/routes/docs.ts +// ../../matrix/arcrun/cypher-executor/src/routes/docs.ts init_dist(); -// ../arcrun/cypher-executor/src/lib/openapi.ts +// ../../matrix/arcrun/cypher-executor/src/lib/openapi.ts var OPENAPI_SPEC = { openapi: "3.0.3", info: { @@ -10521,7 +10506,7 @@ var OPENAPI_SPEC = { } }; -// ../arcrun/cypher-executor/src/routes/docs.ts +// ../../matrix/arcrun/cypher-executor/src/routes/docs.ts var docsRouter = new Hono2(); docsRouter.get("/openapi.json", (c) => { return c.json(OPENAPI_SPEC); @@ -10564,11 +10549,11 @@ docsRouter.get("/docs", (c) => { return c.html(htmlStr); }); -// ../arcrun/cypher-executor/src/routes/webhooks.ts +// ../../matrix/arcrun/cypher-executor/src/routes/webhooks.ts init_dist(); init_webhook_handlers(); -// ../arcrun/cypher-executor/src/actions/webhook-graph-resolver.ts +// ../../matrix/arcrun/cypher-executor/src/actions/webhook-graph-resolver.ts init_schemas(); async function resolveWebhookGraph(body, description, env) { if (Array.isArray(body.triplets) && body.triplets.length > 0) { @@ -10611,7 +10596,7 @@ async function resolveWebhookGraph(body, description, env) { return { resolvedGraph: {}, error: "\u9700\u63D0\u4F9B graph \u7269\u4EF6\u6216 triplets \u9663\u5217" }; } -// ../arcrun/cypher-executor/src/routes/webhooks.ts +// ../../matrix/arcrun/cypher-executor/src/routes/webhooks.ts var webhooksRouter = new Hono2(); webhooksRouter.post("/webhooks", async (c) => { const body = await c.req.json().catch(() => null); @@ -10664,7 +10649,7 @@ webhooksRouter.post("/webhooks/:token/trigger", async (c) => { return c.json(result, result.success ? 200 : 500); }); -// ../arcrun/cypher-executor/src/routes/webhooks-crud.ts +// ../../matrix/arcrun/cypher-executor/src/routes/webhooks-crud.ts init_dist(); init_webhook_handlers(); var webhooksCrudRouter = new Hono2(); @@ -10723,7 +10708,7 @@ webhooksCrudRouter.delete("/webhooks/:token", async (c) => { return c.json({ deleted: true, token }); }); -// ../arcrun/cypher-executor/src/routes/webhooks-list.ts +// ../../matrix/arcrun/cypher-executor/src/routes/webhooks-list.ts init_dist(); init_webhook_handlers(); var webhooksListRouter = new Hono2(); @@ -10748,11 +10733,11 @@ webhooksListRouter.get("/webhooks", async (c) => { return c.json({ webhooks, total: webhooks.length }); }); -// ../arcrun/cypher-executor/src/index.ts +// ../../matrix/arcrun/cypher-executor/src/index.ts init_recipes(); init_credentials(); -// ../arcrun/cypher-executor/src/routes/webhooks-named.ts +// ../../matrix/arcrun/cypher-executor/src/routes/webhooks-named.ts init_dist(); init_webhook_handlers(); init_telemetry(); @@ -11104,7 +11089,7 @@ webhooksNamedRouter.delete("/webhooks/named/:name", async (c) => { return c.json({ deleted: true, name }); }); -// ../arcrun/cypher-executor/src/routes/auth.ts +// ../../matrix/arcrun/cypher-executor/src/routes/auth.ts init_dist(); init_credentials(); var authRouter = new Hono2(); @@ -11434,7 +11419,7 @@ authRouter.delete("/me/api-key", async (c) => { }); }); -// ../arcrun/cypher-executor/src/routes/resume.ts +// ../../matrix/arcrun/cypher-executor/src/routes/resume.ts init_dist(); init_types(); init_graph_executor(); @@ -11504,7 +11489,7 @@ resumeRouter.post("/workflows/resume", async (c) => { } }); -// ../arcrun/cypher-executor/src/routes/executions.ts +// ../../matrix/arcrun/cypher-executor/src/routes/executions.ts init_dist(); init_paused_runs(); init_kbdb_proxy(); @@ -11633,12 +11618,12 @@ executionsRouter.get("/workflows/:name/executions", async (c) => { }); }); -// ../arcrun/cypher-executor/src/routes/init-seed.ts +// ../../matrix/arcrun/cypher-executor/src/routes/init-seed.ts init_dist(); init_hash(); init_recipes(); -// ../arcrun/cypher-executor/src/lib/api-recipe-seeds.ts +// ../../matrix/arcrun/cypher-executor/src/lib/api-recipe-seeds.ts var API_RECIPE_SEEDS = [ // ── KBDB(Supabase 模式,auth_service=kbdb static_key)── { @@ -11767,7 +11752,7 @@ var API_RECIPE_SEEDS = [ } ]; -// ../arcrun/cypher-executor/src/lib/auth-recipe-seeds.ts +// ../../matrix/arcrun/cypher-executor/src/lib/auth-recipe-seeds.ts var now = Date.now(); var AUTH_RECIPE_SEEDS = [ // ── Static Key 類 ────────────────────────────────────────────────────────── @@ -12470,11 +12455,11 @@ var AUTH_RECIPE_SEEDS = [ } ]; -// ../arcrun/cypher-executor/src/routes/portal.ts +// ../../matrix/arcrun/cypher-executor/src/routes/portal.ts init_dist(); init_kbdb_proxy(); -// ../arcrun/cypher-executor/src/routes/console-auth.ts +// ../../matrix/arcrun/cypher-executor/src/routes/console-auth.ts init_dist(); var consoleAuthRouter = new Hono2(); var CREDS_KEY = "console:credentials"; @@ -12641,7 +12626,7 @@ consoleAuthRouter.post("/console/logout", async (c) => { return c.json({ success: true }); }); -// ../arcrun/cypher-executor/src/lib/portal-auth.ts +// ../../matrix/arcrun/cypher-executor/src/lib/portal-auth.ts var PBKDF2_ALGO_PREFIX = "pbkdf2-sha256"; var PBKDF2_ITERATIONS = 1e5; function b64encode(bytes) { @@ -12709,7 +12694,7 @@ function generatePassword(length = 16) { return out; } -// ../arcrun/cypher-executor/src/lib/portal-seeds.ts +// ../../matrix/arcrun/cypher-executor/src/lib/portal-seeds.ts var PORTAL_TEMPLATE_SEEDS = [ { // design §2.1:portal 同仁帳號。password_hash 存 KDF 輸出(pbkdf2-sha256$…,D-6), @@ -12758,7 +12743,7 @@ var PORTAL_TEMPLATE_SEEDS = [ } ]; -// ../arcrun/cypher-executor/src/routes/portal.ts +// ../../matrix/arcrun/cypher-executor/src/routes/portal.ts init_credentials(); var portalRouter = new Hono2(); var SESSION_PREFIX2 = "portal_sess:"; @@ -13935,7 +13920,7 @@ portalRouter.get( }) ); -// ../arcrun/cypher-executor/src/routes/init-seed.ts +// ../../matrix/arcrun/cypher-executor/src/routes/init-seed.ts var initSeedRouter = new Hono2(); initSeedRouter.post("/init/seed", async (c) => { const now2 = Date.now(); @@ -14008,14 +13993,14 @@ initSeedRouter.post("/init/seed", async (c) => { ); }); -// ../arcrun/cypher-executor/src/index.ts +// ../../matrix/arcrun/cypher-executor/src/index.ts init_kbdb_proxy(); -// ../arcrun/cypher-executor/src/routes/console-dashboard.ts +// ../../matrix/arcrun/cypher-executor/src/routes/console-dashboard.ts init_dist(); init_kbdb_proxy(); -// ../arcrun/cypher-executor/src/lib/taipei-time.ts +// ../../matrix/arcrun/cypher-executor/src/lib/taipei-time.ts var TAIPEI_OFFSET_MS = 8 * 3600 * 1e3; function taipeiDayKey(ms) { return new Date(ms + TAIPEI_OFFSET_MS).toISOString().slice(0, 10); @@ -14030,7 +14015,7 @@ var TAIPEI_CLIENT_JS = [ "function taipeiMonthDay(ms) { var d = new Date(ms + TAIPEI_OFFSET_MS); return { month: d.getUTCMonth() + 1, day: d.getUTCDate() }; }" ].join("\n"); -// ../arcrun/cypher-executor/src/lib/console-dashboard-model.ts +// ../../matrix/arcrun/cypher-executor/src/lib/console-dashboard-model.ts function parseCreatedAtMs(s) { if (s === null || s === void 0 || s === "") return null; if (typeof s === "number") return s < 1e12 ? s * 1e3 : s; @@ -14260,7 +14245,7 @@ function reviveWaitingAges(model, fetchedAtMs, nowMs) { return { ...model, updated_ago_minutes: ago, stale: ago > 48 * 60 }; } -// ../arcrun/cypher-executor/src/lib/console-triage-model.ts +// ../../matrix/arcrun/cypher-executor/src/lib/console-triage-model.ts var TIER_ALIASES = { ai: "ai", collab: "collab", @@ -14345,7 +14330,7 @@ function buildTriageModel(todoEntries, inboxEntries) { return { items, projects, counts }; } -// ../arcrun/cypher-executor/src/routes/console-dashboard.ts +// ../../matrix/arcrun/cypher-executor/src/routes/console-dashboard.ts var consoleDashboardRouter = new Hono2(); var STALE_MINUTES = 240; var JUDGE_START_HOUR = 9; @@ -14682,7 +14667,7 @@ consoleDashboardRouter.post("/console/triage-check", async (c) => { return c.json({ success: true, entry_id: entryId, action, status: action === "restore" ? "new" : "done" }); }); -// ../arcrun/cypher-executor/src/routes/portal-data.ts +// ../../matrix/arcrun/cypher-executor/src/routes/portal-data.ts init_dist(); init_kbdb_proxy(); init_webhook_handlers(); @@ -15090,7 +15075,7 @@ portalDataRouter.get( }) ); -// ../arcrun/cypher-executor/src/index.ts +// ../../matrix/arcrun/cypher-executor/src/index.ts var app = new Hono2(); var STATIC_ORIGINS = ["https://arcrun.dev", "https://www.arcrun.dev"]; app.use("*", cors({ @@ -15129,10 +15114,10 @@ app.route("/", consoleAuthRouter); app.route("/", consoleDashboardRouter); app.route("/", portalRouter); app.route("/", portalDataRouter); -var src_default = { +var index_default = { fetch: app.fetch, scheduled: handleScheduled }; export { - src_default as default + index_default as default }; diff --git a/arcrun-http-request/worker.mjs b/arcrun-http-request/worker.mjs index 470d4d8..f4aaed0 100644 --- a/arcrun-http-request/worker.mjs +++ b/arcrun-http-request/worker.mjs @@ -1,7 +1,7 @@ -// ../arcrun/.component-builds/http_request/src/index.ts +// ../../matrix/arcrun/.component-builds/http_request/src/index.ts import componentWasm from "./component.wasm"; -// ../arcrun/.component-builds/http_request/node_modules/hono/dist/compose.js +// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/compose.js var compose = (middleware, onError, onNotFound) => { return (context, next) => { let index = -1; @@ -45,46 +45,21 @@ var compose = (middleware, onError, onNotFound) => { }; }; -// ../arcrun/.component-builds/http_request/node_modules/hono/dist/request/constants.js +// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/request/constants.js var GET_MATCH_RESULT = /* @__PURE__ */ Symbol(); -// ../arcrun/.component-builds/http_request/node_modules/hono/dist/utils/buffer.js -var bufferToFormData = (arrayBuffer, contentType) => { - const response = new Response(arrayBuffer, { - headers: { - // Normalize the media type (case-insensitive) while keeping parameters like the boundary - "Content-Type": contentType.replace(/^[^;]+/, (mediaType) => mediaType.toLowerCase()) - } - }); - return response.formData(); -}; - -// ../arcrun/.component-builds/http_request/node_modules/hono/dist/utils/body.js -var isRawRequest = (request) => "headers" in request; +// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/utils/body.js var parseBody = async (request, options = /* @__PURE__ */ Object.create(null)) => { const { all = false, dot = false } = options; - const headers = isRawRequest(request) ? request.headers : request.raw.headers; + const headers = request instanceof HonoRequest ? request.raw.headers : request.headers; const contentType = headers.get("Content-Type"); - const mediaType = contentType?.split(";")[0].trim().toLowerCase(); - if (mediaType === "multipart/form-data" || mediaType === "application/x-www-form-urlencoded") { + if (contentType?.startsWith("multipart/form-data") || contentType?.startsWith("application/x-www-form-urlencoded")) { return parseFormData(request, { all, dot }); } return {}; }; async function parseFormData(request, options) { - if (!isRawRequest(request) && request.bodyCache.formData) { - return convertFormDataToBodyData( - await request.bodyCache.formData, - options - ); - } - const headers = isRawRequest(request) ? request.headers : request.raw.headers; - const arrayBuffer = await request.arrayBuffer(); - const formDataPromise = bufferToFormData(arrayBuffer, headers.get("Content-Type") || ""); - if (!isRawRequest(request)) { - request.bodyCache.formData = formDataPromise; - } - const formData = await formDataPromise; + const formData = await request.formData(); if (formData) { return convertFormDataToBodyData(formData, options); } @@ -145,7 +120,7 @@ var handleParsingNestedValues = (form, key, value) => { }); }; -// ../arcrun/.component-builds/http_request/node_modules/hono/dist/utils/url.js +// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/utils/url.js var splitPath = (path) => { const paths = path.split("/"); if (paths[0] === "") { @@ -267,16 +242,18 @@ var checkOptionalParameter = (path) => { }); return results.filter((v, i, a) => a.indexOf(v) === i); }; -var tryDecodeURIComponent = (str) => str.indexOf("%") !== -1 ? tryDecode(str, decodeURIComponent_) : str; var _decodeURI = (value) => { + if (!/[%+]/.test(value)) { + return value; + } if (value.indexOf("+") !== -1) { value = value.replace(/\+/g, " "); } - return tryDecodeURIComponent(value); + return value.indexOf("%") !== -1 ? tryDecode(value, decodeURIComponent_) : value; }; var _getQueryParam = (url, key, multiple) => { let encoded; - if (!multiple && key && key.indexOf("%") === -1 && key.indexOf("+") === -1) { + if (!multiple && key && !/[%+]/.test(key)) { let keyIndex2 = url.indexOf("?", 8); if (keyIndex2 === -1) { return void 0; @@ -300,7 +277,7 @@ var _getQueryParam = (url, key, multiple) => { return void 0; } } - const results = /* @__PURE__ */ Object.create(null); + const results = {}; encoded ??= /[%+]/.test(url); let keyIndex = url.indexOf("?", 8); while (keyIndex !== -1) { @@ -347,7 +324,8 @@ var getQueryParams = (url, key) => { }; var decodeURIComponent_ = decodeURIComponent; -// ../arcrun/.component-builds/http_request/node_modules/hono/dist/request.js +// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/request.js +var tryDecodeURIComponent = (str) => tryDecode(str, decodeURIComponent_); var HonoRequest = class { /** * `.raw` can get the raw Request object. @@ -386,6 +364,7 @@ var HonoRequest = class { this.raw = request; this.path = path; this.#matchResult = matchResult; + this.#validatedData = {}; } param(key) { return key ? this.#getDecodedParam(key) : this.#getAllDecodedParams(); @@ -393,7 +372,7 @@ var HonoRequest = class { #getDecodedParam(key) { const paramKey = this.#matchResult[0][this.routeIndex][1][key]; const param = this.#getParamValue(paramKey); - return param && tryDecodeURIComponent(param); + return param && /\%/.test(param) ? tryDecodeURIComponent(param) : param; } #getAllDecodedParams() { const decoded = {}; @@ -401,7 +380,7 @@ var HonoRequest = class { for (const key of keys) { const value = this.#getParamValue(this.#matchResult[0][this.routeIndex][1][key]); if (value !== void 0) { - decoded[key] = tryDecodeURIComponent(value); + decoded[key] = /\%/.test(value) ? tryDecodeURIComponent(value) : value; } } return decoded; @@ -419,7 +398,7 @@ var HonoRequest = class { if (name) { return this.raw.headers.get(name) ?? void 0; } - const headerData = /* @__PURE__ */ Object.create(null); + const headerData = {}; this.raw.headers.forEach((value, key) => { headerData[key] = value; }); @@ -434,7 +413,8 @@ var HonoRequest = class { if (cachedBody) { return cachedBody; } - for (const anyCachedKey in bodyCache) { + const anyCachedKey = Object.keys(bodyCache)[0]; + if (anyCachedKey) { return bodyCache[anyCachedKey].then((body) => { if (anyCachedKey === "json") { body = JSON.stringify(body); @@ -489,21 +469,6 @@ var HonoRequest = class { arrayBuffer() { return this.#cachedBody("arrayBuffer"); } - /** - * `.bytes()` parses the request body as a `Uint8Array`. - * - * @see {@link https://hono.dev/docs/api/request#bytes} - * - * @example - * ```ts - * app.post('/entry', async (c) => { - * const body = await c.req.bytes() - * }) - * ``` - */ - bytes() { - return this.#cachedBody("arrayBuffer").then((buffer) => new Uint8Array(buffer)); - } /** * Parses the request body as a `Blob`. * @example @@ -537,11 +502,10 @@ var HonoRequest = class { * @param data - The validated data to add. */ addValidatedData(target, data) { - ; - (this.#validatedData ??= {})[target] = data; + this.#validatedData[target] = data; } valid(target) { - return this.#validatedData?.[target]; + return this.#validatedData[target]; } /** * `.url()` can get the request url strings. @@ -628,7 +592,7 @@ var HonoRequest = class { } }; -// ../arcrun/.component-builds/http_request/node_modules/hono/dist/utils/html.js +// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/utils/html.js var HtmlEscapedCallbackPhase = { Stringify: 1, BeforeStream: 2, @@ -670,7 +634,7 @@ var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) => } }; -// ../arcrun/.component-builds/http_request/node_modules/hono/dist/context.js +// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/context.js var TEXT_PLAIN = "text/plain; charset=UTF-8"; var setDefaultContentType = (contentType, headers) => { return { @@ -943,11 +907,11 @@ var Context = class { return Object.fromEntries(this.#var); } #newResponse(data, arg, headers) { - let responseHeaders = this.#res ? new Headers(this.#res.headers) : this.#preparedHeaders; - if (typeof arg === "object" && arg.headers) { - responseHeaders ??= new Headers(); - for (const [key, value] of new Headers(arg.headers)) { - if (key === "set-cookie") { + const responseHeaders = this.#res ? new Headers(this.#res.headers) : this.#preparedHeaders ?? new Headers(); + if (typeof arg === "object" && "headers" in arg) { + const argHeaders = arg.headers instanceof Headers ? arg.headers : new Headers(arg.headers); + for (const [key, value] of argHeaders) { + if (key.toLowerCase() === "set-cookie") { responseHeaders.append(key, value); } else { responseHeaders.set(key, value); @@ -955,34 +919,19 @@ var Context = class { } } if (headers) { - if (!responseHeaders) { - let count = 0; - for (const k in headers) { - if (++count > 1 || typeof headers[k] !== "string") { - responseHeaders = new Headers(); - break; - } - } - } - if (responseHeaders) { - for (const k in headers) { - const v = headers[k]; - if (typeof v === "string") { - responseHeaders.set(k, v); - } else { - responseHeaders.delete(k); - for (const v2 of v) { - responseHeaders.append(k, v2); - } + for (const [k, v] of Object.entries(headers)) { + if (typeof v === "string") { + responseHeaders.set(k, v); + } else { + responseHeaders.delete(k); + for (const v2 of v) { + responseHeaders.append(k, v2); } } } } const status = typeof arg === "number" ? arg : arg?.status ?? this.#status; - return createResponseInstance(data, { - status, - headers: responseHeaders ?? headers - }); + return createResponseInstance(data, { status, headers: responseHeaders }); } newResponse = (...args) => this.#newResponse(...args); /** @@ -1092,18 +1041,18 @@ var Context = class { }; }; -// ../arcrun/.component-builds/http_request/node_modules/hono/dist/router.js +// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/router.js var METHOD_NAME_ALL = "ALL"; var METHOD_NAME_ALL_LOWERCASE = "all"; -var METHODS = ["get", "post", "put", "delete", "options", "patch", "query"]; +var METHODS = ["get", "post", "put", "delete", "options", "patch"]; var MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is already built."; var UnsupportedPathError = class extends Error { }; -// ../arcrun/.component-builds/http_request/node_modules/hono/dist/utils/constants.js +// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/utils/constants.js var COMPOSED_HANDLER = "__COMPOSED_HANDLER"; -// ../arcrun/.component-builds/http_request/node_modules/hono/dist/hono-base.js +// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/hono-base.js var notFoundHandler = (c) => { return c.text("404 Not Found", 404); }; @@ -1122,7 +1071,6 @@ var Hono = class _Hono { delete; options; patch; - query; all; on; use; @@ -1219,7 +1167,7 @@ var Hono = class _Hono { handler = async (c, next) => (await compose([], app2.errorHandler)(c, () => r.handler(c, next))).res; handler[COMPOSED_HANDLER] = r.handler; } - subApp.#addRoute(r.method, r.path, handler, r.basePath); + subApp.#addRoute(r.method, r.path, handler); }); return this; } @@ -1343,7 +1291,7 @@ var Hono = class _Hono { const pathPrefixLength = mergedPath === "/" ? 0 : mergedPath.length; return (request) => { const url = new URL(request.url); - url.pathname = this.getPath(request).slice(pathPrefixLength) || "/"; + url.pathname = url.pathname.slice(pathPrefixLength) || "/"; return new Request(url, request); }; })(); @@ -1357,15 +1305,10 @@ var Hono = class _Hono { this.#addRoute(METHOD_NAME_ALL, mergePath(path, "*"), handler); return this; } - #addRoute(method, path, handler, baseRoutePath) { + #addRoute(method, path, handler) { method = method.toUpperCase(); path = mergePath(this._basePath, path); - const r = { - basePath: baseRoutePath !== void 0 ? mergePath(this._basePath, baseRoutePath) : this._basePath, - path, - method, - handler - }; + const r = { basePath: this._basePath, path, method, handler }; this.router.add(method, path, [handler, r]); this.routes.push(r); } @@ -1422,8 +1365,8 @@ var Hono = class _Hono { * @see {@link https://hono.dev/docs/api/hono#fetch} * * @param {Request} request - request Object of request - * @param {Env} env - env Object - * @param {ExecutionContext} executionCtx - context of execution + * @param {Env} Env - env Object + * @param {ExecutionContext} - context of execution * @returns {Response | Promise} response of request * */ @@ -1480,7 +1423,7 @@ var Hono = class _Hono { }; }; -// ../arcrun/.component-builds/http_request/node_modules/hono/dist/router/reg-exp-router/matcher.js +// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/router/reg-exp-router/matcher.js var emptyParam = []; function match(method, path) { const matchers = this.buildAllMatchers(); @@ -1501,7 +1444,7 @@ function match(method, path) { return match2(method, path); } -// ../arcrun/.component-builds/http_request/node_modules/hono/dist/router/reg-exp-router/node.js +// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/router/reg-exp-router/node.js var LABEL_REG_EXP_STR = "[^/]+"; var ONLY_WILDCARD_REG_EXP_STR = ".*"; var TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)"; @@ -1515,7 +1458,7 @@ function compareKey(a, b) { return 1; } if (a === ONLY_WILDCARD_REG_EXP_STR || a === TAIL_WILDCARD_REG_EXP_STR) { - return b === TAIL_WILDCARD_REG_EXP_STR ? -1 : 1; + return 1; } else if (b === ONLY_WILDCARD_REG_EXP_STR || b === TAIL_WILDCARD_REG_EXP_STR) { return -1; } @@ -1527,75 +1470,76 @@ function compareKey(a, b) { return a.length === b.length ? a < b ? -1 : 1 : b.length - a.length; } var Node = class _Node { - // handler index of a dynamic path, or -1 for a static path terminal #index; #varIndex; #children = /* @__PURE__ */ Object.create(null); - insert(tokens, index, paramMap, context, isStatic) { - let node = this; - for (let i = 0, len = tokens.length; i < len; i++) { - const token = tokens[i]; - const pattern = token.length === 1 ? token === "*" ? i === len - 1 ? ["", "", ONLY_WILDCARD_REG_EXP_STR] : ["", "", LABEL_REG_EXP_STR] : null : token === "/*" ? ["", "", TAIL_WILDCARD_REG_EXP_STR] : token.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/); - let nextNode; - if (pattern) { - const name = pattern[1]; - let regexpStr = pattern[2] || LABEL_REG_EXP_STR; - if (name && pattern[2]) { - if (regexpStr === ".*") { - throw PATH_ERROR; - } - regexpStr = regexpStr.replace(/^\((?!\?:)(?=[^)]+\)$)/, "(?:"); - if (/\((?!\?:)/.test(regexpStr)) { - throw PATH_ERROR; - } - if (regexpStr.length === 1 && regExpMetaChars.has(regexpStr)) { - throw PATH_ERROR; - } + insert(tokens, index, paramMap, context, pathErrorCheckOnly) { + if (tokens.length === 0) { + if (this.#index !== void 0) { + throw PATH_ERROR; + } + if (pathErrorCheckOnly) { + return; + } + this.#index = index; + return; + } + const [token, ...restTokens] = tokens; + const pattern = token === "*" ? restTokens.length === 0 ? ["", "", ONLY_WILDCARD_REG_EXP_STR] : ["", "", LABEL_REG_EXP_STR] : token === "/*" ? ["", "", TAIL_WILDCARD_REG_EXP_STR] : token.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/); + let node; + if (pattern) { + const name = pattern[1]; + let regexpStr = pattern[2] || LABEL_REG_EXP_STR; + if (name && pattern[2]) { + if (regexpStr === ".*") { + throw PATH_ERROR; } - nextNode = node.#children[regexpStr]; - if (!nextNode) { - if (regexpStr !== ONLY_WILDCARD_REG_EXP_STR && regexpStr !== TAIL_WILDCARD_REG_EXP_STR) { - for (const k in node.#children) { - if ( - // a single-char pattern coexists with single-char literals as a literal does - (regexpStr.length > 1 || k.length > 1) && k !== ONLY_WILDCARD_REG_EXP_STR && k !== TAIL_WILDCARD_REG_EXP_STR - ) { - throw PATH_ERROR; - } - } - } - nextNode = node.#children[regexpStr] = new _Node(); - } - if (name !== "") { - nextNode.#varIndex ??= context.varIndex++; - paramMap.push([name, nextNode.#varIndex]); - } - } else { - nextNode = node.#children[token]; - if (!nextNode) { - for (const k in node.#children) { - if (k.length > 1 && k !== ONLY_WILDCARD_REG_EXP_STR && k !== TAIL_WILDCARD_REG_EXP_STR) { - throw PATH_ERROR; - } - } - nextNode = node.#children[token] = new _Node(); + regexpStr = regexpStr.replace(/^\((?!\?:)(?=[^)]+\)$)/, "(?:"); + if (/\((?!\?:)/.test(regexpStr)) { + throw PATH_ERROR; } } - node = nextNode; + node = this.#children[regexpStr]; + if (!node) { + if (Object.keys(this.#children).some( + (k) => k !== ONLY_WILDCARD_REG_EXP_STR && k !== TAIL_WILDCARD_REG_EXP_STR + )) { + throw PATH_ERROR; + } + if (pathErrorCheckOnly) { + return; + } + node = this.#children[regexpStr] = new _Node(); + if (name !== "") { + node.#varIndex = context.varIndex++; + } + } + if (!pathErrorCheckOnly && name !== "") { + paramMap.push([name, node.#varIndex]); + } + } else { + node = this.#children[token]; + if (!node) { + if (Object.keys(this.#children).some( + (k) => k.length > 1 && k !== ONLY_WILDCARD_REG_EXP_STR && k !== TAIL_WILDCARD_REG_EXP_STR + )) { + throw PATH_ERROR; + } + if (pathErrorCheckOnly) { + return; + } + node = this.#children[token] = new _Node(); + } } - if (node.#index !== void 0) { - throw PATH_ERROR; - } - node.#index = isStatic ? -1 : index; + node.insert(restTokens, index, paramMap, context, pathErrorCheckOnly); } buildRegExpStr() { const childKeys = Object.keys(this.#children).sort(compareKey); const strList = childKeys.map((k) => { const c = this.#children[k]; - const childStr = c.buildRegExpStr(); - return childStr === "" ? "" : (typeof c.#varIndex === "number" ? `(${k})@${c.#varIndex}` : regExpMetaChars.has(k) ? `\\${k}` : k) + childStr; - }).filter(Boolean); - if (typeof this.#index === "number" && this.#index !== -1) { + return (typeof c.#varIndex === "number" ? `(${k})@${c.#varIndex}` : regExpMetaChars.has(k) ? `\\${k}` : k) + c.buildRegExpStr(); + }); + if (typeof this.#index === "number") { strList.unshift(`#${this.#index}`); } if (strList.length === 0) { @@ -1608,24 +1552,16 @@ var Node = class _Node { } }; -// ../arcrun/.component-builds/http_request/node_modules/hono/dist/router/reg-exp-router/trie.js +// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/router/reg-exp-router/trie.js var Trie = class { #context = { varIndex: 0 }; #root = new Node(); - #index = 0; - // dynamic path -> [handler index, param assoc]; static paths are not registered - paths = /* @__PURE__ */ Object.create(null); - insert(path, isStatic) { - if (isStatic) { - this.#root.insert(path.split(""), 0, [], this.#context, true); - return; - } + insert(path, index, pathErrorCheckOnly) { const paramAssoc = []; const groups = []; - let markedPath = path; for (let i = 0; ; ) { let replaced = false; - markedPath = markedPath.replace(/\{[^}]+\}/g, (m) => { + path = path.replace(/\{[^}]+\}/g, (m) => { const mark = `@\\${i}`; groups[i] = [mark, m]; i++; @@ -1636,7 +1572,7 @@ var Trie = class { break; } } - const tokens = markedPath.match(/(?::[^\/]+)|(?:\/\*$)|./g) || []; + const tokens = path.match(/(?::[^\/]+)|(?:\/\*$)|./g) || []; for (let i = groups.length - 1; i >= 0; i--) { const [mark] = groups[i]; for (let j = tokens.length - 1; j >= 0; j--) { @@ -1646,8 +1582,8 @@ var Trie = class { } } } - this.#root.insert(tokens, this.#index, paramAssoc, this.#context, false); - this.paths[path] = [this.#index++, paramAssoc]; + this.#root.insert(tokens, index, paramAssoc, this.#context, pathErrorCheckOnly); + return paramAssoc; } buildRegExp() { let regexp = this.#root.buildRegExpStr(); @@ -1672,7 +1608,8 @@ var Trie = class { } }; -// ../arcrun/.component-builds/http_request/node_modules/hono/dist/router/reg-exp-router/router.js +// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/router/reg-exp-router/router.js +var nullMatcher = [/^$/, [], /* @__PURE__ */ Object.create(null)]; var wildcardRegExpCache = /* @__PURE__ */ Object.create(null); function buildWildcardRegExp(path) { return wildcardRegExpCache[path] ??= new RegExp( @@ -1685,6 +1622,63 @@ function buildWildcardRegExp(path) { function clearWildcardRegExpCache() { wildcardRegExpCache = /* @__PURE__ */ Object.create(null); } +function buildMatcherFromPreprocessedRoutes(routes) { + const trie = new Trie(); + const handlerData = []; + if (routes.length === 0) { + return nullMatcher; + } + const routesWithStaticPathFlag = routes.map( + (route) => [!/\*|\/:/.test(route[0]), ...route] + ).sort( + ([isStaticA, pathA], [isStaticB, pathB]) => isStaticA ? 1 : isStaticB ? -1 : pathA.length - pathB.length + ); + const staticMap = /* @__PURE__ */ Object.create(null); + for (let i = 0, j = -1, len = routesWithStaticPathFlag.length; i < len; i++) { + const [pathErrorCheckOnly, path, handlers] = routesWithStaticPathFlag[i]; + if (pathErrorCheckOnly) { + staticMap[path] = [handlers.map(([h]) => [h, /* @__PURE__ */ Object.create(null)]), emptyParam]; + } else { + j++; + } + let paramAssoc; + try { + paramAssoc = trie.insert(path, j, pathErrorCheckOnly); + } catch (e) { + throw e === PATH_ERROR ? new UnsupportedPathError(path) : e; + } + if (pathErrorCheckOnly) { + continue; + } + handlerData[j] = handlers.map(([h, paramCount]) => { + const paramIndexMap = /* @__PURE__ */ Object.create(null); + paramCount -= 1; + for (; paramCount >= 0; paramCount--) { + const [key, value] = paramAssoc[paramCount]; + paramIndexMap[key] = value; + } + return [h, paramIndexMap]; + }); + } + const [regexp, indexReplacementMap, paramReplacementMap] = trie.buildRegExp(); + for (let i = 0, len = handlerData.length; i < len; i++) { + for (let j = 0, len2 = handlerData[i].length; j < len2; j++) { + const map = handlerData[i][j]?.[1]; + if (!map) { + continue; + } + const keys = Object.keys(map); + for (let k = 0, len3 = keys.length; k < len3; k++) { + map[keys[k]] = paramReplacementMap[map[keys[k]]]; + } + } + } + const handlerMap = []; + for (const i in indexReplacementMap) { + handlerMap[i] = handlerData[indexReplacementMap[i]]; + } + return [regexp, handlerMap, staticMap]; +} function findMiddleware(middleware, path) { if (!middleware) { return void 0; @@ -1700,18 +1694,9 @@ var RegExpRouter = class { name = "RegExpRouter"; #middleware; #routes; - #tries; constructor() { this.#middleware = { [METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) }; this.#routes = { [METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) }; - this.#tries = { [METHOD_NAME_ALL]: new Trie() }; - } - #insertPath(method, path) { - try { - this.#tries[method].insert(path, !/\*|\/:/.test(path)); - } catch (e) { - throw e === PATH_ERROR ? new UnsupportedPathError(path) : e; - } } add(method, path, handler) { const middleware = this.#middleware; @@ -1720,12 +1705,11 @@ var RegExpRouter = class { throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT); } if (!middleware[method]) { - this.#tries[method] = new Trie(); + ; [middleware, routes].forEach((handlerMap) => { handlerMap[method] = /* @__PURE__ */ Object.create(null); Object.keys(handlerMap[METHOD_NAME_ALL]).forEach((p) => { handlerMap[method][p] = [...handlerMap[METHOD_NAME_ALL][p]]; - this.#insertPath(method, p); }); }); } @@ -1735,12 +1719,13 @@ var RegExpRouter = class { const paramCount = (path.match(/\/:/g) || []).length; if (/\*$/.test(path)) { const re = buildWildcardRegExp(path); - Object.keys(middleware).forEach((m) => { - if ((method === METHOD_NAME_ALL || method === m) && !middleware[m][path]) { - this.#insertPath(m, path); - middleware[m][path] = findMiddleware(middleware[m], path) || findMiddleware(middleware[METHOD_NAME_ALL], path) || []; - } - }); + if (method === METHOD_NAME_ALL) { + Object.keys(middleware).forEach((m) => { + middleware[m][path] ||= findMiddleware(middleware[m], path) || findMiddleware(middleware[METHOD_NAME_ALL], path) || []; + }); + } else { + middleware[method][path] ||= findMiddleware(middleware[method], path) || findMiddleware(middleware[METHOD_NAME_ALL], path) || []; + } Object.keys(middleware).forEach((m) => { if (method === METHOD_NAME_ALL || method === m) { Object.keys(middleware[m]).forEach((p) => { @@ -1762,12 +1747,9 @@ var RegExpRouter = class { const path2 = paths[i]; Object.keys(routes).forEach((m) => { if (method === METHOD_NAME_ALL || method === m) { - if (!routes[m][path2]) { - this.#insertPath(m, path2); - routes[m][path2] = [ - ...findMiddleware(middleware[m], path2) || findMiddleware(middleware[METHOD_NAME_ALL], path2) || [] - ]; - } + routes[m][path2] ||= [ + ...findMiddleware(middleware[m], path2) || findMiddleware(middleware[METHOD_NAME_ALL], path2) || [] + ]; routes[m][path2].push([handler, paramCount - len + i + 1]); } }); @@ -1779,58 +1761,33 @@ var RegExpRouter = class { Object.keys(this.#routes).concat(Object.keys(this.#middleware)).forEach((method) => { matchers[method] ||= this.#buildMatcher(method); }); - this.#middleware = this.#routes = this.#tries = void 0; + this.#middleware = this.#routes = void 0; clearWildcardRegExpCache(); return matchers; } #buildMatcher(method) { - const middleware = this.#middleware[method]; - const routes = this.#routes[method]; - const trie = this.#tries[method]; - const staticMap = /* @__PURE__ */ Object.create(null); - const handlerData = []; - [middleware, routes].forEach((r) => { - for (const path in r) { - const handlers = r[path]; - const pathData = trie.paths[path]; - if (!pathData) { - staticMap[path] = [handlers.map(([h]) => [h, /* @__PURE__ */ Object.create(null)]), emptyParam]; - continue; - } - const paramAssoc = pathData[1]; - handlerData[pathData[0]] = handlers.map(([h, paramCount]) => { - const paramIndexMap = /* @__PURE__ */ Object.create(null); - paramCount -= 1; - for (; paramCount >= 0; paramCount--) { - const [key, value] = paramAssoc[paramCount]; - paramIndexMap[key] = value; - } - return [h, paramIndexMap]; - }); + const routes = []; + let hasOwnRoute = method === METHOD_NAME_ALL; + [this.#middleware, this.#routes].forEach((r) => { + const ownRoute = r[method] ? Object.keys(r[method]).map((path) => [path, r[method][path]]) : []; + if (ownRoute.length !== 0) { + hasOwnRoute ||= true; + routes.push(...ownRoute); + } else if (method !== METHOD_NAME_ALL) { + routes.push( + ...Object.keys(r[METHOD_NAME_ALL]).map((path) => [path, r[METHOD_NAME_ALL][path]]) + ); } }); - const [regexp, indexReplacementMap, paramReplacementMap] = trie.buildRegExp(); - for (let i = 0, len = handlerData.length; i < len; i++) { - for (let j = 0, len2 = handlerData[i].length; j < len2; j++) { - const map = handlerData[i][j]?.[1]; - if (!map) { - continue; - } - const keys = Object.keys(map); - for (let k = 0, len3 = keys.length; k < len3; k++) { - map[keys[k]] = paramReplacementMap[map[keys[k]]]; - } - } + if (!hasOwnRoute) { + return null; + } else { + return buildMatcherFromPreprocessedRoutes(routes); } - const handlerMap = []; - for (const i in indexReplacementMap) { - handlerMap[i] = handlerData[indexReplacementMap[i]]; - } - return [regexp, handlerMap, staticMap]; } }; -// ../arcrun/.component-builds/http_request/node_modules/hono/dist/router/smart-router/router.js +// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/router/smart-router/router.js var SmartRouter = class { name = "SmartRouter"; #routers = []; @@ -1885,7 +1842,7 @@ var SmartRouter = class { } }; -// ../arcrun/.component-builds/http_request/node_modules/hono/dist/router/trie-router/node.js +// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/router/trie-router/node.js var emptyParams = /* @__PURE__ */ Object.create(null); var hasChildren = (children) => { for (const _ in children) { @@ -2019,18 +1976,9 @@ var Node2 = class _Node2 { if (m) { params[name] = m[0]; this.#pushHandlerSets(handlerSets, child, method, node.#params, params); - if (m[0].length === restPathString.length && child.#children["*"]) { - this.#pushHandlerSets( - handlerSets, - child.#children["*"], - method, - node.#params, - params - ); - } if (hasChildren(child.#children)) { child.#params = params; - const componentCount = m[0].match(/\//g)?.length ?? 0; + const componentCount = m[0].match(/\//)?.length ?? 0; const targetCurNodes = curNodesQueue[componentCount] ||= []; targetCurNodes.push(child); } @@ -2069,7 +2017,7 @@ var Node2 = class _Node2 { } }; -// ../arcrun/.component-builds/http_request/node_modules/hono/dist/router/trie-router/router.js +// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/router/trie-router/router.js var TrieRouter = class { name = "TrieRouter"; #node; @@ -2091,7 +2039,7 @@ var TrieRouter = class { } }; -// ../arcrun/.component-builds/http_request/node_modules/hono/dist/hono.js +// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/hono.js var Hono2 = class extends Hono { /** * Creates an instance of the Hono class. @@ -2106,18 +2054,24 @@ var Hono2 = class extends Hono { } }; -// ../arcrun/.component-builds/http_request/node_modules/hono/dist/middleware/cors/index.js +// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/middleware/cors/index.js var cors = (options) => { - const opts = { + const defaults = { origin: "*", - allowMethods: ["GET", "HEAD", "PUT", "POST", "DELETE", "PATCH", "QUERY"], + allowMethods: ["GET", "HEAD", "PUT", "POST", "DELETE", "PATCH"], allowHeaders: [], - exposeHeaders: [], + exposeHeaders: [] + }; + const opts = { + ...defaults, ...options }; const findAllowOrigin = ((optsOrigin) => { if (typeof optsOrigin === "string") { if (optsOrigin === "*") { + if (opts.credentials) { + return (origin) => origin || null; + } return () => optsOrigin; } else { return (origin) => optsOrigin === origin ? origin : null; @@ -2152,7 +2106,7 @@ var cors = (options) => { set("Access-Control-Expose-Headers", opts.exposeHeaders.join(",")); } if (c.req.method === "OPTIONS") { - if (opts.origin !== "*") { + if (opts.origin !== "*" || opts.credentials) { set("Vary", "Origin"); } if (opts.maxAge != null) { @@ -2166,7 +2120,7 @@ var cors = (options) => { if (!headers?.length) { const requestHeaders = c.req.header("Access-Control-Request-Headers"); if (requestHeaders) { - headers = requestHeaders.split(",").map((h) => h.trim()); + headers = requestHeaders.split(/\s*,\s*/); } } if (headers?.length) { @@ -2182,13 +2136,13 @@ var cors = (options) => { }); } await next(); - if (opts.origin !== "*") { + if (opts.origin !== "*" || opts.credentials) { c.header("Vary", "Origin", { append: true }); } }; }; -// ../arcrun/cypher-executor/src/lib/wasi-shim.ts +// ../../matrix/arcrun/cypher-executor/src/lib/wasi-shim.ts var WASI_ESUCCESS = 0; var WASI_ENOSYS = 76; var FD_STDIN = 0; @@ -2547,7 +2501,7 @@ function createWasiShim(stdinData, hostFunctions) { return shim; } -// ../arcrun/.component-builds/http_request/src/index.ts +// ../../matrix/arcrun/.component-builds/http_request/src/index.ts var app = new Hono2(); app.use("*", cors()); app.get("/", (c) => c.json({ ok: true, component: "http_request" })); @@ -2568,7 +2522,7 @@ app.post("/", async (c) => { ); } }); -var src_default = app; +var index_default = app; async function runWasm(input) { const hostFunctions = { http_request: async (url, method, headersJson, body) => { @@ -2614,5 +2568,5 @@ async function runWasm(input) { return JSON.parse(stdout); } export { - src_default as default + index_default as default }; diff --git a/arcrun-kbdb/worker.mjs b/arcrun-kbdb/worker.mjs index 188aa9d..5be6533 100644 --- a/arcrun-kbdb/worker.mjs +++ b/arcrun-kbdb/worker.mjs @@ -1,4 +1,4 @@ -// ../arcrun/kbdb/node_modules/hono/dist/compose.js +// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/compose.js var compose = (middleware, onError, onNotFound) => { return (context, next) => { let index = -1; @@ -42,10 +42,10 @@ var compose = (middleware, onError, onNotFound) => { }; }; -// ../arcrun/kbdb/node_modules/hono/dist/request/constants.js +// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/request/constants.js var GET_MATCH_RESULT = /* @__PURE__ */ Symbol(); -// ../arcrun/kbdb/node_modules/hono/dist/utils/body.js +// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/utils/body.js var parseBody = async (request, options = /* @__PURE__ */ Object.create(null)) => { const { all = false, dot = false } = options; const headers = request instanceof HonoRequest ? request.raw.headers : request.headers; @@ -117,7 +117,7 @@ var handleParsingNestedValues = (form, key, value) => { }); }; -// ../arcrun/kbdb/node_modules/hono/dist/utils/url.js +// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/utils/url.js var splitPath = (path) => { const paths = path.split("/"); if (paths[0] === "") { @@ -321,7 +321,7 @@ var getQueryParams = (url, key) => { }; var decodeURIComponent_ = decodeURIComponent; -// ../arcrun/kbdb/node_modules/hono/dist/request.js +// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/request.js var tryDecodeURIComponent = (str) => tryDecode(str, decodeURIComponent_); var HonoRequest = class { /** @@ -604,7 +604,7 @@ var HonoRequest = class { } }; -// ../arcrun/kbdb/node_modules/hono/dist/utils/html.js +// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/utils/html.js var HtmlEscapedCallbackPhase = { Stringify: 1, BeforeStream: 2, @@ -646,7 +646,7 @@ var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) => } }; -// ../arcrun/kbdb/node_modules/hono/dist/context.js +// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/context.js var TEXT_PLAIN = "text/plain; charset=UTF-8"; var setDefaultContentType = (contentType, headers) => { return { @@ -1053,7 +1053,7 @@ var Context = class { }; }; -// ../arcrun/kbdb/node_modules/hono/dist/router.js +// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router.js var METHOD_NAME_ALL = "ALL"; var METHOD_NAME_ALL_LOWERCASE = "all"; var METHODS = ["get", "post", "put", "delete", "options", "patch"]; @@ -1061,10 +1061,10 @@ var MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is var UnsupportedPathError = class extends Error { }; -// ../arcrun/kbdb/node_modules/hono/dist/utils/constants.js +// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/utils/constants.js var COMPOSED_HANDLER = "__COMPOSED_HANDLER"; -// ../arcrun/kbdb/node_modules/hono/dist/hono-base.js +// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/hono-base.js var notFoundHandler = (c) => { return c.text("404 Not Found", 404); }; @@ -1440,7 +1440,7 @@ var Hono = class _Hono { }; }; -// ../arcrun/kbdb/node_modules/hono/dist/router/reg-exp-router/matcher.js +// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router/reg-exp-router/matcher.js var emptyParam = []; function match(method, path) { const matchers = this.buildAllMatchers(); @@ -1461,7 +1461,7 @@ function match(method, path) { return match2(method, path); } -// ../arcrun/kbdb/node_modules/hono/dist/router/reg-exp-router/node.js +// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router/reg-exp-router/node.js var LABEL_REG_EXP_STR = "[^/]+"; var ONLY_WILDCARD_REG_EXP_STR = ".*"; var TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)"; @@ -1569,7 +1569,7 @@ var Node = class _Node { } }; -// ../arcrun/kbdb/node_modules/hono/dist/router/reg-exp-router/trie.js +// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router/reg-exp-router/trie.js var Trie = class { #context = { varIndex: 0 }; #root = new Node(); @@ -1625,7 +1625,7 @@ var Trie = class { } }; -// ../arcrun/kbdb/node_modules/hono/dist/router/reg-exp-router/router.js +// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router/reg-exp-router/router.js var nullMatcher = [/^$/, [], /* @__PURE__ */ Object.create(null)]; var wildcardRegExpCache = /* @__PURE__ */ Object.create(null); function buildWildcardRegExp(path) { @@ -1804,7 +1804,7 @@ var RegExpRouter = class { } }; -// ../arcrun/kbdb/node_modules/hono/dist/router/smart-router/router.js +// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router/smart-router/router.js var SmartRouter = class { name = "SmartRouter"; #routers = []; @@ -1859,7 +1859,7 @@ var SmartRouter = class { } }; -// ../arcrun/kbdb/node_modules/hono/dist/router/trie-router/node.js +// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router/trie-router/node.js var emptyParams = /* @__PURE__ */ Object.create(null); var hasChildren = (children) => { for (const _ in children) { @@ -2034,7 +2034,7 @@ var Node2 = class _Node2 { } }; -// ../arcrun/kbdb/node_modules/hono/dist/router/trie-router/router.js +// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router/trie-router/router.js var TrieRouter = class { name = "TrieRouter"; #node; @@ -2056,7 +2056,7 @@ var TrieRouter = class { } }; -// ../arcrun/kbdb/node_modules/hono/dist/hono.js +// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/hono.js var Hono2 = class extends Hono { /** * Creates an instance of the Hono class. @@ -2071,7 +2071,7 @@ var Hono2 = class extends Hono { } }; -// ../arcrun/kbdb/src/actions/entry-crud.ts +// ../../matrix/arcrun/kbdb/src/actions/entry-crud.ts function uid(prefix) { return `${prefix}_${crypto.randomUUID()}`; } @@ -2263,7 +2263,7 @@ async function searchEntries(db, q, owner_id, entry_type, limit = 50, library, s return res.results ?? []; } -// ../arcrun/kbdb/src/embed.ts +// ../../matrix/arcrun/kbdb/src/embed.ts var DEFAULT_EMBED_MODEL = "@cf/baai/bge-m3"; var MIN_SCORE_ABS_FLOOR = 0.45; var MIN_SCORE_TOP_RATIO = 0.8; @@ -2472,7 +2472,7 @@ async function semanticSearch(env, q, opts = {}) { })); } -// ../arcrun/kbdb/src/actions/credential-legacy-migration.ts +// ../../matrix/arcrun/kbdb/src/actions/credential-legacy-migration.ts async function legacyCredentialsTableExists(db) { const row = await db.prepare(`SELECT 1 AS x FROM sqlite_master WHERE type = 'table' AND name = 'credentials'`).first(); return row !== null; @@ -2502,7 +2502,7 @@ async function migrateLegacyCredentialsForOwner(db, ownerId) { return (after?.n ?? 0) - (before?.n ?? 0); } -// ../arcrun/kbdb/src/routes/entries.ts +// ../../matrix/arcrun/kbdb/src/routes/entries.ts var entryRoutes = new Hono2(); function fireAndForget(c, p) { let ctx; @@ -2753,7 +2753,7 @@ entryRoutes.delete("/:id", async (c) => { return c.json({ success: true, vector_deleted }); }); -// ../arcrun/kbdb/src/actions/record-crud.ts +// ../../matrix/arcrun/kbdb/src/actions/record-crud.ts function uid2(prefix) { return `${prefix}_${crypto.randomUUID()}`; } @@ -2886,7 +2886,7 @@ async function deleteRecord(db, recordId) { return true; } -// ../arcrun/kbdb/src/routes/templates.ts +// ../../matrix/arcrun/kbdb/src/routes/templates.ts var templateRoutes = new Hono2(); templateRoutes.post("/", async (c) => { const body = await c.req.json().catch(() => null); @@ -2912,7 +2912,7 @@ templateRoutes.patch("/:id", async (c) => { return c.json({ success: true, template: tpl }); }); -// ../arcrun/kbdb/src/routes/records.ts +// ../../matrix/arcrun/kbdb/src/routes/records.ts var recordRoutes = new Hono2(); recordRoutes.post("/", async (c) => { const body = await c.req.json().catch(() => null); @@ -2977,7 +2977,7 @@ recordRoutes.delete("/:recordId", async (c) => { return c.json({ success: true }); }); -// ../arcrun/kbdb/src/actions/recipe-stat.ts +// ../../matrix/arcrun/kbdb/src/actions/recipe-stat.ts function statId(canonicalId) { return `recipestat:${canonicalId}`; } @@ -3016,7 +3016,7 @@ function emptyStat(canonicalId) { return { canonical_id: canonicalId, success_count: 0, failure_count: 0, last_status: null, last_at: null }; } -// ../arcrun/kbdb/src/routes/recipe-stats.ts +// ../../matrix/arcrun/kbdb/src/routes/recipe-stats.ts var recipeStatRoutes = new Hono2(); recipeStatRoutes.post("/record", async (c) => { const body = await c.req.json().catch(() => null); @@ -3032,7 +3032,7 @@ recipeStatRoutes.get("/:canonical_id", async (c) => { return c.json({ success: true, stat }); }); -// ../arcrun/kbdb/src/routes/embed.ts +// ../../matrix/arcrun/kbdb/src/routes/embed.ts var embedRoutes = new Hono2(); var OFF_HINT = "\u8A9E\u7FA9\u88DC\u5D4C\u9700\u5148\u958B embed \u6A21\u7D44\uFF08Vectorize+AI binding\uFF09\u3002\u53EB CC\u300C\u5E6B\u6211\u958B\u8A9E\u7FA9\u67E5\u8A62\u300D\uFF08\u8A2D kbdb_embed:true + redeploy \u6CE8\u5165 binding\uFF09\u5F8C\u518D\u547C\u53EB\u672C\u7AEF\u9EDE\u3002"; embedRoutes.post("/backfill", async (c) => { @@ -3065,7 +3065,7 @@ embedRoutes.get("/selftest", async (c) => { return c.json({ success: true, ...result }); }); -// ../arcrun/kbdb/src/actions/library-map.ts +// ../../matrix/arcrun/kbdb/src/actions/library-map.ts var LIBRARY_MAP_TEMPLATE_ID = "tpl-library-map"; var LIBRARY_MAP_TEMPLATE_NAME = "library_map"; var LIBRARY_MAP_SLOTS = [ @@ -3364,7 +3364,7 @@ async function getLibraryMapDetail(db, library, owner_id) { }; } -// ../arcrun/kbdb/src/routes/map.ts +// ../../matrix/arcrun/kbdb/src/routes/map.ts var mapRoutes = new Hono2(); mapRoutes.post("/recompute", async (c) => { const body = await c.req.json().catch(() => ({})); @@ -3402,7 +3402,7 @@ mapRoutes.get("/:library", async (c) => { return c.json({ success: true, map }); }); -// ../arcrun/kbdb/src/actions/execution-log.ts +// ../../matrix/arcrun/kbdb/src/actions/execution-log.ts var SUCCESS_MESSAGE_MAX = 200; var FAILED_MESSAGE_MAX = 2e3; var TARGET_MAX = 300; @@ -3573,7 +3573,7 @@ async function cleanupExpiredLogs(db) { return { deleted, checked_overrides: overrides.length }; } -// ../arcrun/kbdb/src/routes/execution-log.ts +// ../../matrix/arcrun/kbdb/src/routes/execution-log.ts var executionLogRoutes = new Hono2(); executionLogRoutes.post("/record", async (c) => { const body = await c.req.json().catch(() => null); @@ -3627,7 +3627,7 @@ executionLogRoutes.post("/cleanup", async (c) => { return c.json({ success: true, ...result }); }); -// ../arcrun/kbdb/src/index.ts +// ../../matrix/arcrun/kbdb/src/index.ts var app = new Hono2(); app.use("*", async (c, next) => { const path = new URL(c.req.url).pathname; @@ -3652,7 +3652,7 @@ app.route("/recipe-stats", recipeStatRoutes); app.route("/execution-log", executionLogRoutes); app.route("/embed", embedRoutes); app.route("/map", mapRoutes); -var src_default = app; +var index_default = app; export { - src_default as default + index_default as default }; diff --git a/arcrun-mcp/worker.mjs b/arcrun-mcp/worker.mjs index a525bc1..7a9a887 100644 --- a/arcrun-mcp/worker.mjs +++ b/arcrun-mcp/worker.mjs @@ -32,9 +32,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge mod )); -// ../arcrun/mcp/node_modules/ajv/dist/compile/codegen/code.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/code.js var require_code = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/compile/codegen/code.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/code.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0; @@ -186,9 +186,9 @@ var require_code = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/compile/codegen/scope.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/scope.js var require_scope = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/compile/codegen/scope.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/scope.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0; @@ -331,9 +331,9 @@ var require_scope = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/compile/codegen/index.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/index.js var require_codegen = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/compile/codegen/index.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.or = exports.and = exports.not = exports.CodeGen = exports.operators = exports.varKinds = exports.ValueScopeName = exports.ValueScope = exports.Scope = exports.Name = exports.regexpCode = exports.stringify = exports.getProperty = exports.nil = exports.strConcat = exports.str = exports._ = void 0; @@ -1051,9 +1051,9 @@ var require_codegen = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/compile/util.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/util.js var require_util = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/compile/util.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/util.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.checkStrictMode = exports.getErrorPath = exports.Type = exports.useFunc = exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = void 0; @@ -1218,9 +1218,9 @@ var require_util = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/compile/names.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/names.js var require_names = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/compile/names.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/names.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); @@ -1257,9 +1257,9 @@ var require_names = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/compile/errors.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/errors.js var require_errors = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/compile/errors.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/errors.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = void 0; @@ -1379,9 +1379,9 @@ var require_errors = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/compile/validate/boolSchema.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/boolSchema.js var require_boolSchema = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/compile/validate/boolSchema.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/boolSchema.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.boolOrEmptySchema = exports.topBoolOrEmptySchema = void 0; @@ -1430,9 +1430,9 @@ var require_boolSchema = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/compile/rules.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/rules.js var require_rules = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/compile/rules.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/rules.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getRules = exports.isJSONType = void 0; @@ -1461,9 +1461,9 @@ var require_rules = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/compile/validate/applicability.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/applicability.js var require_applicability = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/compile/validate/applicability.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/applicability.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = void 0; @@ -1484,9 +1484,9 @@ var require_applicability = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/compile/validate/dataType.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/dataType.js var require_dataType = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/compile/validate/dataType.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/dataType.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = void 0; @@ -1668,9 +1668,9 @@ var require_dataType = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/compile/validate/defaults.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/defaults.js var require_defaults = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/compile/validate/defaults.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/defaults.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.assignDefaults = void 0; @@ -1705,9 +1705,9 @@ var require_defaults = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/code.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/code.js var require_code2 = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/code.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/code.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.validateUnion = exports.validateArray = exports.usePattern = exports.callValidateCode = exports.schemaProperties = exports.allSchemaProperties = exports.noPropertyInData = exports.propertyInData = exports.isOwnProperty = exports.hasPropFunc = exports.reportMissingProp = exports.checkMissingProp = exports.checkReportMissingProp = void 0; @@ -1838,9 +1838,9 @@ var require_code2 = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/compile/validate/keyword.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/keyword.js var require_keyword = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/compile/validate/keyword.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/keyword.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.validateKeywordUsage = exports.validSchemaType = exports.funcKeywordCode = exports.macroKeywordCode = void 0; @@ -1956,9 +1956,9 @@ var require_keyword = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/compile/validate/subschema.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/subschema.js var require_subschema = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/compile/validate/subschema.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/subschema.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.extendSubschemaMode = exports.extendSubschemaData = exports.getSubschema = void 0; @@ -2039,9 +2039,9 @@ var require_subschema = __commonJS({ } }); -// ../arcrun/mcp/node_modules/fast-deep-equal/index.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js var require_fast_deep_equal = __commonJS({ - "../arcrun/mcp/node_modules/fast-deep-equal/index.js"(exports, module) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js"(exports, module) { "use strict"; module.exports = function equal(a, b) { if (a === b) return true; @@ -2074,9 +2074,9 @@ var require_fast_deep_equal = __commonJS({ } }); -// ../arcrun/mcp/node_modules/json-schema-traverse/index.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js var require_json_schema_traverse = __commonJS({ - "../arcrun/mcp/node_modules/json-schema-traverse/index.js"(exports, module) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js"(exports, module) { "use strict"; var traverse = module.exports = function(schema4, opts, cb) { if (typeof opts == "function") { @@ -2162,9 +2162,9 @@ var require_json_schema_traverse = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/compile/resolve.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/resolve.js var require_resolve = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/compile/resolve.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/resolve.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getSchemaRefs = exports.resolveUrl = exports.normalizeId = exports._getFullPath = exports.getFullPath = exports.inlineRef = void 0; @@ -2318,9 +2318,9 @@ var require_resolve = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/compile/validate/index.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/index.js var require_validate = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/compile/validate/index.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getData = exports.KeywordCxt = exports.validateFunctionCode = void 0; @@ -2826,9 +2826,9 @@ var require_validate = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/runtime/validation_error.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/validation_error.js var require_validation_error = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/runtime/validation_error.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/validation_error.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var ValidationError = class extends Error { @@ -2842,9 +2842,9 @@ var require_validation_error = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/compile/ref_error.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/ref_error.js var require_ref_error = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/compile/ref_error.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/ref_error.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var resolve_1 = require_resolve(); @@ -2859,9 +2859,9 @@ var require_ref_error = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/compile/index.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/index.js var require_compile = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/compile/index.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.resolveSchema = exports.getCompilingSchema = exports.resolveRef = exports.compileSchema = exports.SchemaEnv = void 0; @@ -3083,9 +3083,9 @@ var require_compile = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/refs/data.json +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/data.json var require_data = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/refs/data.json"(exports, module) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/data.json"(exports, module) { module.exports = { $id: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", description: "Meta-schema for $data reference (JSON AnySchema extension proposal)", @@ -3102,15 +3102,12 @@ var require_data = __commonJS({ } }); -// ../arcrun/mcp/node_modules/fast-uri/lib/utils.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/utils.js var require_utils = __commonJS({ - "../arcrun/mcp/node_modules/fast-uri/lib/utils.js"(exports, module) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/utils.js"(exports, module) { "use strict"; var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu); var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u); - var isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu); - var isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu); - var isPathCharacter = RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu); function stringArrayToHexStripped(input) { let acc = ""; let code = 0; @@ -3303,77 +3300,27 @@ var require_utils = __commonJS({ } return output.join(""); } - var HOST_DELIMS = { "@": "%40", "/": "%2F", "?": "%3F", "#": "%23", ":": "%3A" }; - var HOST_DELIM_RE = /[@/?#:]/g; - var HOST_DELIM_NO_COLON_RE = /[@/?#]/g; - function reescapeHostDelimiters(host, isIP) { - const re = isIP ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE; - re.lastIndex = 0; - return host.replace(re, (ch) => HOST_DELIMS[ch]); - } - function normalizePercentEncoding(input, decodeUnreserved = false) { - if (input.indexOf("%") === -1) { - return input; + function normalizeComponentEncoding(component, esc3) { + const func = esc3 !== true ? escape : unescape; + if (component.scheme !== void 0) { + component.scheme = func(component.scheme); } - let output = ""; - for (let i = 0; i < input.length; i++) { - if (input[i] === "%" && i + 2 < input.length) { - const hex = input.slice(i + 1, i + 3); - if (isHexPair(hex)) { - const normalizedHex = hex.toUpperCase(); - const decoded = String.fromCharCode(parseInt(normalizedHex, 16)); - if (decodeUnreserved && isUnreserved(decoded)) { - output += decoded; - } else { - output += "%" + normalizedHex; - } - i += 2; - continue; - } - } - output += input[i]; + if (component.userinfo !== void 0) { + component.userinfo = func(component.userinfo); } - return output; - } - function normalizePathEncoding(input) { - let output = ""; - for (let i = 0; i < input.length; i++) { - if (input[i] === "%" && i + 2 < input.length) { - const hex = input.slice(i + 1, i + 3); - if (isHexPair(hex)) { - const normalizedHex = hex.toUpperCase(); - const decoded = String.fromCharCode(parseInt(normalizedHex, 16)); - if (decoded !== "." && isUnreserved(decoded)) { - output += decoded; - } else { - output += "%" + normalizedHex; - } - i += 2; - continue; - } - } - if (isPathCharacter(input[i])) { - output += input[i]; - } else { - output += escape(input[i]); - } + if (component.host !== void 0) { + component.host = func(component.host); } - return output; - } - function escapePreservingEscapes(input) { - let output = ""; - for (let i = 0; i < input.length; i++) { - if (input[i] === "%" && i + 2 < input.length) { - const hex = input.slice(i + 1, i + 3); - if (isHexPair(hex)) { - output += "%" + hex.toUpperCase(); - i += 2; - continue; - } - } - output += escape(input[i]); + if (component.path !== void 0) { + component.path = func(component.path); } - return output; + if (component.query !== void 0) { + component.query = func(component.query); + } + if (component.fragment !== void 0) { + component.fragment = func(component.fragment); + } + return component; } function recomposeAuthority(component) { const uriTokens = []; @@ -3388,7 +3335,7 @@ var require_utils = __commonJS({ if (ipV6res.isIPV6 === true) { host = `[${ipV6res.escapedHost}]`; } else { - host = reescapeHostDelimiters(host, false); + host = component.host; } } uriTokens.push(host); @@ -3402,10 +3349,7 @@ var require_utils = __commonJS({ module.exports = { nonSimpleDomain, recomposeAuthority, - reescapeHostDelimiters, - normalizePercentEncoding, - normalizePathEncoding, - escapePreservingEscapes, + normalizeComponentEncoding, removeDotSegments, isIPv4, isUUID, @@ -3415,9 +3359,9 @@ var require_utils = __commonJS({ } }); -// ../arcrun/mcp/node_modules/fast-uri/lib/schemes.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/schemes.js var require_schemes = __commonJS({ - "../arcrun/mcp/node_modules/fast-uri/lib/schemes.js"(exports, module) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/schemes.js"(exports, module) { "use strict"; var { isUUID } = require_utils(); var URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu; @@ -3625,16 +3569,16 @@ var require_schemes = __commonJS({ } }); -// ../arcrun/mcp/node_modules/fast-uri/index.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/index.js var require_fast_uri = __commonJS({ - "../arcrun/mcp/node_modules/fast-uri/index.js"(exports, module) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/index.js"(exports, module) { "use strict"; - var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils(); + var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizeComponentEncoding, isIPv4, nonSimpleDomain } = require_utils(); var { SCHEMES, getSchemeHandler } = require_schemes(); function normalize(uri, options) { if (typeof uri === "string") { uri = /** @type {T} */ - normalizeString(uri, options); + serialize(parse4(uri, options), options); } else if (typeof uri === "object") { uri = /** @type {T} */ parse4(serialize(uri, options), options); @@ -3643,12 +3587,7 @@ var require_fast_uri = __commonJS({ } function resolve(baseURI, relativeURI, options) { const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" }; - const { parsed: baseParsed, malformedAuthorityOrPort: baseMalformed } = parseWithStatus(baseURI, schemelessOptions); - const { parsed: relativeParsed, malformedAuthorityOrPort: relativeMalformed } = parseWithStatus(relativeURI, schemelessOptions); - if (baseMalformed || relativeMalformed) { - throw new Error(baseParsed.error || relativeParsed.error || "URI is malformed."); - } - const resolved = resolveComponent(baseParsed, relativeParsed, schemelessOptions, true); + const resolved = resolveComponent(parse4(baseURI, schemelessOptions), parse4(relativeURI, schemelessOptions), schemelessOptions, true); schemelessOptions.skipEscape = true; return serialize(resolved, schemelessOptions); } @@ -3706,9 +3645,19 @@ var require_fast_uri = __commonJS({ return target; } function equal(uriA, uriB, options) { - const normalizedA = normalizeComparableURI(uriA, options); - const normalizedB = normalizeComparableURI(uriB, options); - return normalizedA !== void 0 && normalizedB !== void 0 && normalizedA.toLowerCase() === normalizedB.toLowerCase(); + if (typeof uriA === "string") { + uriA = unescape(uriA); + uriA = serialize(normalizeComponentEncoding(parse4(uriA, options), true), { ...options, skipEscape: true }); + } else if (typeof uriA === "object") { + uriA = serialize(normalizeComponentEncoding(uriA, true), { ...options, skipEscape: true }); + } + if (typeof uriB === "string") { + uriB = unescape(uriB); + uriB = serialize(normalizeComponentEncoding(parse4(uriB, options), true), { ...options, skipEscape: true }); + } else if (typeof uriB === "object") { + uriB = serialize(normalizeComponentEncoding(uriB, true), { ...options, skipEscape: true }); + } + return uriA.toLowerCase() === uriB.toLowerCase(); } function serialize(cmpts, opts) { const component = { @@ -3733,12 +3682,12 @@ var require_fast_uri = __commonJS({ if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options); if (component.path !== void 0) { if (!options.skipEscape) { - component.path = escapePreservingEscapes(component.path); + component.path = escape(component.path); if (component.scheme !== void 0) { component.path = component.path.split("%3A").join(":"); } } else { - component.path = normalizePercentEncoding(component.path); + component.path = unescape(component.path); } } if (options.reference !== "suffix" && component.scheme) { @@ -3773,18 +3722,7 @@ var require_fast_uri = __commonJS({ return uriTokens.join(""); } var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u; - var AUTHORITY_PREFIX = /^(?:[^#/:?]+:)?\/\/([^/?#]*)/; - var AUTHORITY_INTRODUCER_REGION = /^(?:[^#/:?]+:)?([/\\\t\n\r]*)/; - function getParseError(parsed, matches) { - if (matches[2] !== void 0 && parsed.path && parsed.path[0] !== "/") { - return 'URI path must start with "/" when authority is present.'; - } - if (typeof parsed.port === "number" && (parsed.port < 0 || parsed.port > 65535)) { - return "URI port is malformed."; - } - return void 0; - } - function parseWithStatus(uri, opts) { + function parse4(uri, opts) { const options = Object.assign({}, opts); const parsed = { scheme: void 0, @@ -3795,7 +3733,6 @@ var require_fast_uri = __commonJS({ query: void 0, fragment: void 0 }; - let malformedAuthorityOrPort = false; let isIP = false; if (options.reference === "suffix") { if (options.scheme) { @@ -3804,25 +3741,6 @@ var require_fast_uri = __commonJS({ uri = "//" + uri; } } - const authorityMatch = uri.match(AUTHORITY_PREFIX); - if (authorityMatch !== null && authorityMatch[1].indexOf("\\") !== -1) { - parsed.error = "URI authority must not contain a literal backslash."; - malformedAuthorityOrPort = true; - } - const introducerMatch = uri.match(AUTHORITY_INTRODUCER_REGION); - if (introducerMatch !== null) { - const region = introducerMatch[1]; - const normalizedRegion = region.replace(/[\t\n\r]/g, ""); - if (normalizedRegion.length >= 2) { - if (normalizedRegion.slice(0, 2) !== "//") { - parsed.error = parsed.error || "URI authority must not contain a literal backslash."; - malformedAuthorityOrPort = true; - } else if (region.length !== normalizedRegion.length) { - parsed.error = parsed.error || "URI authority introducer must not contain whitespace."; - malformedAuthorityOrPort = true; - } - } - } const matches = uri.match(URI_PARSE); if (matches) { parsed.scheme = matches[1]; @@ -3835,11 +3753,6 @@ var require_fast_uri = __commonJS({ if (isNaN(parsed.port)) { parsed.port = matches[5]; } - const parseError = getParseError(parsed, matches); - if (parseError !== void 0) { - parsed.error = parsed.error || parseError; - malformedAuthorityOrPort = true; - } if (parsed.host) { const ipv4result = isIPv4(parsed.host); if (ipv4result === false) { @@ -3866,7 +3779,7 @@ var require_fast_uri = __commonJS({ if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) { if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) { try { - parsed.host = new URL("http://" + parsed.host).hostname; + parsed.host = URL.domainToASCII(parsed.host.toLowerCase()); } catch (e) { parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e; } @@ -3878,18 +3791,14 @@ var require_fast_uri = __commonJS({ parsed.scheme = unescape(parsed.scheme); } if (parsed.host !== void 0) { - parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP); + parsed.host = unescape(parsed.host); } } if (parsed.path) { - parsed.path = normalizePathEncoding(parsed.path); + parsed.path = escape(unescape(parsed.path)); } if (parsed.fragment) { - try { - parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment)); - } catch { - parsed.error = parsed.error || "URI malformed"; - } + parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment)); } } if (schemeHandler && schemeHandler.parse) { @@ -3898,29 +3807,7 @@ var require_fast_uri = __commonJS({ } else { parsed.error = parsed.error || "URI can not be parsed."; } - return { parsed, malformedAuthorityOrPort }; - } - function parse4(uri, opts) { - return parseWithStatus(uri, opts).parsed; - } - function normalizeString(uri, opts) { - return normalizeStringWithStatus(uri, opts).normalized; - } - function normalizeStringWithStatus(uri, opts) { - const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts); - return { - normalized: malformedAuthorityOrPort ? uri : serialize(parsed, opts), - malformedAuthorityOrPort - }; - } - function normalizeComparableURI(uri, opts) { - if (typeof uri === "string") { - const { normalized, malformedAuthorityOrPort } = normalizeStringWithStatus(uri, opts); - return malformedAuthorityOrPort ? void 0 : normalized; - } - if (typeof uri === "object") { - return serialize(uri, opts); - } + return parsed; } var fastUri = { SCHEMES, @@ -3937,9 +3824,9 @@ var require_fast_uri = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/runtime/uri.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/uri.js var require_uri = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/runtime/uri.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/uri.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var uri = require_fast_uri(); @@ -3948,9 +3835,9 @@ var require_uri = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/core.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/core.js var require_core = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/core.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/core.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0; @@ -4060,7 +3947,7 @@ var require_core = __commonJS({ constructor(opts = {}) { this.schemas = {}; this.refs = {}; - this.formats = /* @__PURE__ */ Object.create(null); + this.formats = {}; this._compilations = /* @__PURE__ */ new Set(); this._loading = {}; this._cache = /* @__PURE__ */ new Map(); @@ -4559,9 +4446,9 @@ var require_core = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/core/id.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/id.js var require_id = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/core/id.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/id.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var def = { @@ -4574,9 +4461,9 @@ var require_id = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/core/ref.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/ref.js var require_ref = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/core/ref.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/ref.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.callRef = exports.getValidate = void 0; @@ -4696,9 +4583,9 @@ var require_ref = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/core/index.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/index.js var require_core2 = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/core/index.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var id_1 = require_id(); @@ -4717,9 +4604,9 @@ var require_core2 = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js var require_limitNumber = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/validation/limitNumber.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); @@ -4749,9 +4636,9 @@ var require_limitNumber = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js var require_multipleOf = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/validation/multipleOf.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); @@ -4777,9 +4664,9 @@ var require_multipleOf = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/runtime/ucs2length.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/ucs2length.js var require_ucs2length = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/runtime/ucs2length.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/ucs2length.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function ucs2length(str) { @@ -4803,9 +4690,9 @@ var require_ucs2length = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/validation/limitLength.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js var require_limitLength = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/validation/limitLength.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); @@ -4835,9 +4722,9 @@ var require_limitLength = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/validation/pattern.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/pattern.js var require_pattern = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/validation/pattern.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/pattern.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var code_1 = require_code2(); @@ -4872,9 +4759,9 @@ var require_pattern = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js var require_limitProperties = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/validation/limitProperties.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); @@ -4901,9 +4788,9 @@ var require_limitProperties = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/validation/required.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/required.js var require_required = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/validation/required.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/required.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var code_1 = require_code2(); @@ -4983,9 +4870,9 @@ var require_required = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/validation/limitItems.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js var require_limitItems = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/validation/limitItems.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); @@ -5012,9 +4899,9 @@ var require_limitItems = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/runtime/equal.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/equal.js var require_equal = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/runtime/equal.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/equal.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var equal = require_fast_deep_equal(); @@ -5023,9 +4910,9 @@ var require_equal = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js var require_uniqueItems = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var dataType_1 = require_dataType(); @@ -5090,9 +4977,9 @@ var require_uniqueItems = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/validation/const.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/const.js var require_const = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/validation/const.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/const.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); @@ -5119,9 +5006,9 @@ var require_const = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/validation/enum.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/enum.js var require_enum = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/validation/enum.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/enum.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); @@ -5168,9 +5055,9 @@ var require_enum = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/validation/index.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/index.js var require_validation = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/validation/index.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var limitNumber_1 = require_limitNumber(); @@ -5206,9 +5093,9 @@ var require_validation = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js var require_additionalItems = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.validateAdditionalItems = void 0; @@ -5259,9 +5146,9 @@ var require_additionalItems = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/items.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items.js var require_items = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/items.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.validateTuple = void 0; @@ -5316,9 +5203,9 @@ var require_items = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js var require_prefixItems = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var items_1 = require_items(); @@ -5333,9 +5220,9 @@ var require_prefixItems = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/items2020.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js var require_items2020 = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/items2020.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); @@ -5368,9 +5255,9 @@ var require_items2020 = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/contains.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/contains.js var require_contains = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/contains.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/contains.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); @@ -5462,9 +5349,9 @@ var require_contains = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js var require_dependencies = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/dependencies.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = void 0; @@ -5556,9 +5443,9 @@ var require_dependencies = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js var require_propertyNames = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); @@ -5599,9 +5486,9 @@ var require_propertyNames = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js var require_additionalProperties = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var code_1 = require_code2(); @@ -5705,9 +5592,9 @@ var require_additionalProperties = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/properties.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/properties.js var require_properties = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/properties.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/properties.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var validate_1 = require_validate(); @@ -5763,9 +5650,9 @@ var require_properties = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js var require_patternProperties = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var code_1 = require_code2(); @@ -5837,9 +5724,9 @@ var require_patternProperties = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/not.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/not.js var require_not = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/not.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/not.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var util_1 = require_util(); @@ -5868,9 +5755,9 @@ var require_not = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js var require_anyOf = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/anyOf.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var code_1 = require_code2(); @@ -5885,9 +5772,9 @@ var require_anyOf = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js var require_oneOf = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/oneOf.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); @@ -5943,9 +5830,9 @@ var require_oneOf = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/allOf.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js var require_allOf = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/allOf.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var util_1 = require_util(); @@ -5970,9 +5857,9 @@ var require_allOf = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/if.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/if.js var require_if = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/if.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/if.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); @@ -6039,9 +5926,9 @@ var require_if = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js var require_thenElse = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/thenElse.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var util_1 = require_util(); @@ -6057,9 +5944,9 @@ var require_thenElse = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/index.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/index.js var require_applicator = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/applicator/index.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var additionalItems_1 = require_additionalItems(); @@ -6105,9 +5992,9 @@ var require_applicator = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/format/format.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/format.js var require_format = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/format/format.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/format.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); @@ -6195,9 +6082,9 @@ var require_format = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/format/index.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/index.js var require_format2 = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/format/index.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var format_1 = require_format(); @@ -6206,9 +6093,9 @@ var require_format2 = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/metadata.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/metadata.js var require_metadata = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/metadata.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/metadata.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.contentVocabulary = exports.metadataVocabulary = void 0; @@ -6229,9 +6116,9 @@ var require_metadata = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/draft7.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/draft7.js var require_draft7 = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/draft7.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/draft7.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var core_1 = require_core2(); @@ -6251,9 +6138,9 @@ var require_draft7 = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/discriminator/types.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/types.js var require_types = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/discriminator/types.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/types.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DiscrError = void 0; @@ -6265,9 +6152,9 @@ var require_types = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/vocabularies/discriminator/index.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/index.js var require_discriminator = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/vocabularies/discriminator/index.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); @@ -6370,9 +6257,9 @@ var require_discriminator = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/refs/json-schema-draft-07.json +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-draft-07.json var require_json_schema_draft_07 = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/refs/json-schema-draft-07.json"(exports, module) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-draft-07.json"(exports, module) { module.exports = { $schema: "http://json-schema.org/draft-07/schema#", $id: "http://json-schema.org/draft-07/schema#", @@ -6527,9 +6414,9 @@ var require_json_schema_draft_07 = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv/dist/ajv.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/ajv.js var require_ajv = __commonJS({ - "../arcrun/mcp/node_modules/ajv/dist/ajv.js"(exports, module) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/ajv.js"(exports, module) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv = void 0; @@ -6597,9 +6484,9 @@ var require_ajv = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv-formats/dist/formats.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/formats.js var require_formats = __commonJS({ - "../arcrun/mcp/node_modules/ajv-formats/dist/formats.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/formats.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.formatNames = exports.fastFormats = exports.fullFormats = void 0; @@ -6800,9 +6687,9 @@ var require_formats = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv-formats/dist/limit.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/limit.js var require_limit = __commonJS({ - "../arcrun/mcp/node_modules/ajv-formats/dist/limit.js"(exports) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/limit.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.formatLimitDefinition = void 0; @@ -6872,9 +6759,9 @@ var require_limit = __commonJS({ } }); -// ../arcrun/mcp/node_modules/ajv-formats/dist/index.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/index.js var require_dist = __commonJS({ - "../arcrun/mcp/node_modules/ajv-formats/dist/index.js"(exports, module) { + "../../matrix/arcrun/mcp/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/index.js"(exports, module) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var formats_1 = require_formats(); @@ -6914,111 +6801,7 @@ var require_dist = __commonJS({ } }); -// ../arcrun/mcp/node_modules/content-type/index.js -var require_content_type = __commonJS({ - "../arcrun/mcp/node_modules/content-type/index.js"(exports) { - "use strict"; - var PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g; - var TEXT_REGEXP = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/; - var TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/; - var QESC_REGEXP = /\\([\u000b\u0020-\u00ff])/g; - var QUOTE_REGEXP = /([\\"])/g; - var TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/; - exports.format = format; - exports.parse = parse4; - function format(obj) { - if (!obj || typeof obj !== "object") { - throw new TypeError("argument obj is required"); - } - var parameters = obj.parameters; - var type = obj.type; - if (!type || !TYPE_REGEXP.test(type)) { - throw new TypeError("invalid type"); - } - var string4 = type; - if (parameters && typeof parameters === "object") { - var param; - var params = Object.keys(parameters).sort(); - for (var i = 0; i < params.length; i++) { - param = params[i]; - if (!TOKEN_REGEXP.test(param)) { - throw new TypeError("invalid parameter name"); - } - string4 += "; " + param + "=" + qstring(parameters[param]); - } - } - return string4; - } - function parse4(string4) { - if (!string4) { - throw new TypeError("argument string is required"); - } - var header = typeof string4 === "object" ? getcontenttype(string4) : string4; - if (typeof header !== "string") { - throw new TypeError("argument string is required to be a string"); - } - var index = header.indexOf(";"); - var type = index !== -1 ? header.slice(0, index).trim() : header.trim(); - if (!TYPE_REGEXP.test(type)) { - throw new TypeError("invalid media type"); - } - var obj = new ContentType(type.toLowerCase()); - if (index !== -1) { - var key; - var match2; - var value; - PARAM_REGEXP.lastIndex = index; - while (match2 = PARAM_REGEXP.exec(header)) { - if (match2.index !== index) { - throw new TypeError("invalid parameter format"); - } - index += match2[0].length; - key = match2[1].toLowerCase(); - value = match2[2]; - if (value.charCodeAt(0) === 34) { - value = value.slice(1, -1); - if (value.indexOf("\\") !== -1) { - value = value.replace(QESC_REGEXP, "$1"); - } - } - obj.parameters[key] = value; - } - if (index !== header.length) { - throw new TypeError("invalid parameter format"); - } - } - return obj; - } - function getcontenttype(obj) { - var header; - if (typeof obj.getHeader === "function") { - header = obj.getHeader("content-type"); - } else if (typeof obj.headers === "object") { - header = obj.headers && obj.headers["content-type"]; - } - if (typeof header !== "string") { - throw new TypeError("content-type header is missing from object"); - } - return header; - } - function qstring(val) { - var str = String(val); - if (TOKEN_REGEXP.test(str)) { - return str; - } - if (str.length > 0 && !TEXT_REGEXP.test(str)) { - throw new TypeError("invalid parameter value"); - } - return '"' + str.replace(QUOTE_REGEXP, "\\$1") + '"'; - } - function ContentType(type) { - this.parameters = /* @__PURE__ */ Object.create(null); - this.type = type; - } - } -}); - -// ../arcrun/mcp/node_modules/hono/dist/compose.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/compose.js var compose = (middleware, onError, onNotFound) => { return (context, next) => { let index = -1; @@ -7062,46 +6845,21 @@ var compose = (middleware, onError, onNotFound) => { }; }; -// ../arcrun/mcp/node_modules/hono/dist/request/constants.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/request/constants.js var GET_MATCH_RESULT = /* @__PURE__ */ Symbol(); -// ../arcrun/mcp/node_modules/hono/dist/utils/buffer.js -var bufferToFormData = (arrayBuffer, contentType2) => { - const response = new Response(arrayBuffer, { - headers: { - // Normalize the media type (case-insensitive) while keeping parameters like the boundary - "Content-Type": contentType2.replace(/^[^;]+/, (mediaType) => mediaType.toLowerCase()) - } - }); - return response.formData(); -}; - -// ../arcrun/mcp/node_modules/hono/dist/utils/body.js -var isRawRequest = (request) => "headers" in request; +// ../../matrix/arcrun/mcp/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/utils/body.js var parseBody = async (request, options = /* @__PURE__ */ Object.create(null)) => { const { all = false, dot = false } = options; - const headers = isRawRequest(request) ? request.headers : request.raw.headers; - const contentType2 = headers.get("Content-Type"); - const mediaType = contentType2?.split(";")[0].trim().toLowerCase(); - if (mediaType === "multipart/form-data" || mediaType === "application/x-www-form-urlencoded") { + const headers = request instanceof HonoRequest ? request.raw.headers : request.headers; + const contentType = headers.get("Content-Type"); + if (contentType?.startsWith("multipart/form-data") || contentType?.startsWith("application/x-www-form-urlencoded")) { return parseFormData(request, { all, dot }); } return {}; }; async function parseFormData(request, options) { - if (!isRawRequest(request) && request.bodyCache.formData) { - return convertFormDataToBodyData( - await request.bodyCache.formData, - options - ); - } - const headers = isRawRequest(request) ? request.headers : request.raw.headers; - const arrayBuffer = await request.arrayBuffer(); - const formDataPromise = bufferToFormData(arrayBuffer, headers.get("Content-Type") || ""); - if (!isRawRequest(request)) { - request.bodyCache.formData = formDataPromise; - } - const formData = await formDataPromise; + const formData = await request.formData(); if (formData) { return convertFormDataToBodyData(formData, options); } @@ -7162,7 +6920,7 @@ var handleParsingNestedValues = (form, key, value) => { }); }; -// ../arcrun/mcp/node_modules/hono/dist/utils/url.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/utils/url.js var splitPath = (path) => { const paths = path.split("/"); if (paths[0] === "") { @@ -7284,16 +7042,18 @@ var checkOptionalParameter = (path) => { }); return results.filter((v, i, a) => a.indexOf(v) === i); }; -var tryDecodeURIComponent = (str) => str.indexOf("%") !== -1 ? tryDecode(str, decodeURIComponent_) : str; var _decodeURI = (value) => { + if (!/[%+]/.test(value)) { + return value; + } if (value.indexOf("+") !== -1) { value = value.replace(/\+/g, " "); } - return tryDecodeURIComponent(value); + return value.indexOf("%") !== -1 ? tryDecode(value, decodeURIComponent_) : value; }; var _getQueryParam = (url, key, multiple) => { let encoded; - if (!multiple && key && key.indexOf("%") === -1 && key.indexOf("+") === -1) { + if (!multiple && key && !/[%+]/.test(key)) { let keyIndex2 = url.indexOf("?", 8); if (keyIndex2 === -1) { return void 0; @@ -7317,7 +7077,7 @@ var _getQueryParam = (url, key, multiple) => { return void 0; } } - const results = /* @__PURE__ */ Object.create(null); + const results = {}; encoded ??= /[%+]/.test(url); let keyIndex = url.indexOf("?", 8); while (keyIndex !== -1) { @@ -7364,7 +7124,8 @@ var getQueryParams = (url, key) => { }; var decodeURIComponent_ = decodeURIComponent; -// ../arcrun/mcp/node_modules/hono/dist/request.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/request.js +var tryDecodeURIComponent = (str) => tryDecode(str, decodeURIComponent_); var HonoRequest = class { /** * `.raw` can get the raw Request object. @@ -7403,6 +7164,7 @@ var HonoRequest = class { this.raw = request; this.path = path; this.#matchResult = matchResult; + this.#validatedData = {}; } param(key) { return key ? this.#getDecodedParam(key) : this.#getAllDecodedParams(); @@ -7410,7 +7172,7 @@ var HonoRequest = class { #getDecodedParam(key) { const paramKey = this.#matchResult[0][this.routeIndex][1][key]; const param = this.#getParamValue(paramKey); - return param && tryDecodeURIComponent(param); + return param && /\%/.test(param) ? tryDecodeURIComponent(param) : param; } #getAllDecodedParams() { const decoded = {}; @@ -7418,7 +7180,7 @@ var HonoRequest = class { for (const key of keys) { const value = this.#getParamValue(this.#matchResult[0][this.routeIndex][1][key]); if (value !== void 0) { - decoded[key] = tryDecodeURIComponent(value); + decoded[key] = /\%/.test(value) ? tryDecodeURIComponent(value) : value; } } return decoded; @@ -7436,7 +7198,7 @@ var HonoRequest = class { if (name) { return this.raw.headers.get(name) ?? void 0; } - const headerData = /* @__PURE__ */ Object.create(null); + const headerData = {}; this.raw.headers.forEach((value, key) => { headerData[key] = value; }); @@ -7451,7 +7213,8 @@ var HonoRequest = class { if (cachedBody) { return cachedBody; } - for (const anyCachedKey in bodyCache) { + const anyCachedKey = Object.keys(bodyCache)[0]; + if (anyCachedKey) { return bodyCache[anyCachedKey].then((body) => { if (anyCachedKey === "json") { body = JSON.stringify(body); @@ -7506,21 +7269,6 @@ var HonoRequest = class { arrayBuffer() { return this.#cachedBody("arrayBuffer"); } - /** - * `.bytes()` parses the request body as a `Uint8Array`. - * - * @see {@link https://hono.dev/docs/api/request#bytes} - * - * @example - * ```ts - * app.post('/entry', async (c) => { - * const body = await c.req.bytes() - * }) - * ``` - */ - bytes() { - return this.#cachedBody("arrayBuffer").then((buffer) => new Uint8Array(buffer)); - } /** * Parses the request body as a `Blob`. * @example @@ -7554,11 +7302,10 @@ var HonoRequest = class { * @param data - The validated data to add. */ addValidatedData(target, data) { - ; - (this.#validatedData ??= {})[target] = data; + this.#validatedData[target] = data; } valid(target) { - return this.#validatedData?.[target]; + return this.#validatedData[target]; } /** * `.url()` can get the request url strings. @@ -7645,7 +7392,7 @@ var HonoRequest = class { } }; -// ../arcrun/mcp/node_modules/hono/dist/utils/html.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/utils/html.js var HtmlEscapedCallbackPhase = { Stringify: 1, BeforeStream: 2, @@ -7687,11 +7434,11 @@ var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) => } }; -// ../arcrun/mcp/node_modules/hono/dist/context.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/context.js var TEXT_PLAIN = "text/plain; charset=UTF-8"; -var setDefaultContentType = (contentType2, headers) => { +var setDefaultContentType = (contentType, headers) => { return { - "Content-Type": contentType2, + "Content-Type": contentType, ...headers }; }; @@ -7960,11 +7707,11 @@ var Context = class { return Object.fromEntries(this.#var); } #newResponse(data, arg, headers) { - let responseHeaders = this.#res ? new Headers(this.#res.headers) : this.#preparedHeaders; - if (typeof arg === "object" && arg.headers) { - responseHeaders ??= new Headers(); - for (const [key, value] of new Headers(arg.headers)) { - if (key === "set-cookie") { + const responseHeaders = this.#res ? new Headers(this.#res.headers) : this.#preparedHeaders ?? new Headers(); + if (typeof arg === "object" && "headers" in arg) { + const argHeaders = arg.headers instanceof Headers ? arg.headers : new Headers(arg.headers); + for (const [key, value] of argHeaders) { + if (key.toLowerCase() === "set-cookie") { responseHeaders.append(key, value); } else { responseHeaders.set(key, value); @@ -7972,34 +7719,19 @@ var Context = class { } } if (headers) { - if (!responseHeaders) { - let count = 0; - for (const k in headers) { - if (++count > 1 || typeof headers[k] !== "string") { - responseHeaders = new Headers(); - break; - } - } - } - if (responseHeaders) { - for (const k in headers) { - const v = headers[k]; - if (typeof v === "string") { - responseHeaders.set(k, v); - } else { - responseHeaders.delete(k); - for (const v2 of v) { - responseHeaders.append(k, v2); - } + for (const [k, v] of Object.entries(headers)) { + if (typeof v === "string") { + responseHeaders.set(k, v); + } else { + responseHeaders.delete(k); + for (const v2 of v) { + responseHeaders.append(k, v2); } } } } const status = typeof arg === "number" ? arg : arg?.status ?? this.#status; - return createResponseInstance(data, { - status, - headers: responseHeaders ?? headers - }); + return createResponseInstance(data, { status, headers: responseHeaders }); } newResponse = (...args) => this.#newResponse(...args); /** @@ -8109,18 +7841,18 @@ var Context = class { }; }; -// ../arcrun/mcp/node_modules/hono/dist/router.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router.js var METHOD_NAME_ALL = "ALL"; var METHOD_NAME_ALL_LOWERCASE = "all"; -var METHODS = ["get", "post", "put", "delete", "options", "patch", "query"]; +var METHODS = ["get", "post", "put", "delete", "options", "patch"]; var MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is already built."; var UnsupportedPathError = class extends Error { }; -// ../arcrun/mcp/node_modules/hono/dist/utils/constants.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/utils/constants.js var COMPOSED_HANDLER = "__COMPOSED_HANDLER"; -// ../arcrun/mcp/node_modules/hono/dist/hono-base.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/hono-base.js var notFoundHandler = (c) => { return c.text("404 Not Found", 404); }; @@ -8139,7 +7871,6 @@ var Hono = class _Hono { delete; options; patch; - query; all; on; use; @@ -8236,7 +7967,7 @@ var Hono = class _Hono { handler = async (c, next) => (await compose([], app2.errorHandler)(c, () => r.handler(c, next))).res; handler[COMPOSED_HANDLER] = r.handler; } - subApp.#addRoute(r.method, r.path, handler, r.basePath); + subApp.#addRoute(r.method, r.path, handler); }); return this; } @@ -8360,7 +8091,7 @@ var Hono = class _Hono { const pathPrefixLength = mergedPath === "/" ? 0 : mergedPath.length; return (request) => { const url = new URL(request.url); - url.pathname = this.getPath(request).slice(pathPrefixLength) || "/"; + url.pathname = url.pathname.slice(pathPrefixLength) || "/"; return new Request(url, request); }; })(); @@ -8374,15 +8105,10 @@ var Hono = class _Hono { this.#addRoute(METHOD_NAME_ALL, mergePath(path, "*"), handler); return this; } - #addRoute(method, path, handler, baseRoutePath) { + #addRoute(method, path, handler) { method = method.toUpperCase(); path = mergePath(this._basePath, path); - const r = { - basePath: baseRoutePath !== void 0 ? mergePath(this._basePath, baseRoutePath) : this._basePath, - path, - method, - handler - }; + const r = { basePath: this._basePath, path, method, handler }; this.router.add(method, path, [handler, r]); this.routes.push(r); } @@ -8439,8 +8165,8 @@ var Hono = class _Hono { * @see {@link https://hono.dev/docs/api/hono#fetch} * * @param {Request} request - request Object of request - * @param {Env} env - env Object - * @param {ExecutionContext} executionCtx - context of execution + * @param {Env} Env - env Object + * @param {ExecutionContext} - context of execution * @returns {Response | Promise} response of request * */ @@ -8497,7 +8223,7 @@ var Hono = class _Hono { }; }; -// ../arcrun/mcp/node_modules/hono/dist/router/reg-exp-router/matcher.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router/reg-exp-router/matcher.js var emptyParam = []; function match(method, path) { const matchers = this.buildAllMatchers(); @@ -8518,7 +8244,7 @@ function match(method, path) { return match2(method, path); } -// ../arcrun/mcp/node_modules/hono/dist/router/reg-exp-router/node.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router/reg-exp-router/node.js var LABEL_REG_EXP_STR = "[^/]+"; var ONLY_WILDCARD_REG_EXP_STR = ".*"; var TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)"; @@ -8532,7 +8258,7 @@ function compareKey(a, b) { return 1; } if (a === ONLY_WILDCARD_REG_EXP_STR || a === TAIL_WILDCARD_REG_EXP_STR) { - return b === TAIL_WILDCARD_REG_EXP_STR ? -1 : 1; + return 1; } else if (b === ONLY_WILDCARD_REG_EXP_STR || b === TAIL_WILDCARD_REG_EXP_STR) { return -1; } @@ -8544,75 +8270,76 @@ function compareKey(a, b) { return a.length === b.length ? a < b ? -1 : 1 : b.length - a.length; } var Node = class _Node { - // handler index of a dynamic path, or -1 for a static path terminal #index; #varIndex; #children = /* @__PURE__ */ Object.create(null); - insert(tokens, index, paramMap, context, isStatic) { - let node = this; - for (let i = 0, len = tokens.length; i < len; i++) { - const token = tokens[i]; - const pattern = token.length === 1 ? token === "*" ? i === len - 1 ? ["", "", ONLY_WILDCARD_REG_EXP_STR] : ["", "", LABEL_REG_EXP_STR] : null : token === "/*" ? ["", "", TAIL_WILDCARD_REG_EXP_STR] : token.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/); - let nextNode; - if (pattern) { - const name = pattern[1]; - let regexpStr = pattern[2] || LABEL_REG_EXP_STR; - if (name && pattern[2]) { - if (regexpStr === ".*") { - throw PATH_ERROR; - } - regexpStr = regexpStr.replace(/^\((?!\?:)(?=[^)]+\)$)/, "(?:"); - if (/\((?!\?:)/.test(regexpStr)) { - throw PATH_ERROR; - } - if (regexpStr.length === 1 && regExpMetaChars.has(regexpStr)) { - throw PATH_ERROR; - } + insert(tokens, index, paramMap, context, pathErrorCheckOnly) { + if (tokens.length === 0) { + if (this.#index !== void 0) { + throw PATH_ERROR; + } + if (pathErrorCheckOnly) { + return; + } + this.#index = index; + return; + } + const [token, ...restTokens] = tokens; + const pattern = token === "*" ? restTokens.length === 0 ? ["", "", ONLY_WILDCARD_REG_EXP_STR] : ["", "", LABEL_REG_EXP_STR] : token === "/*" ? ["", "", TAIL_WILDCARD_REG_EXP_STR] : token.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/); + let node; + if (pattern) { + const name = pattern[1]; + let regexpStr = pattern[2] || LABEL_REG_EXP_STR; + if (name && pattern[2]) { + if (regexpStr === ".*") { + throw PATH_ERROR; } - nextNode = node.#children[regexpStr]; - if (!nextNode) { - if (regexpStr !== ONLY_WILDCARD_REG_EXP_STR && regexpStr !== TAIL_WILDCARD_REG_EXP_STR) { - for (const k in node.#children) { - if ( - // a single-char pattern coexists with single-char literals as a literal does - (regexpStr.length > 1 || k.length > 1) && k !== ONLY_WILDCARD_REG_EXP_STR && k !== TAIL_WILDCARD_REG_EXP_STR - ) { - throw PATH_ERROR; - } - } - } - nextNode = node.#children[regexpStr] = new _Node(); - } - if (name !== "") { - nextNode.#varIndex ??= context.varIndex++; - paramMap.push([name, nextNode.#varIndex]); - } - } else { - nextNode = node.#children[token]; - if (!nextNode) { - for (const k in node.#children) { - if (k.length > 1 && k !== ONLY_WILDCARD_REG_EXP_STR && k !== TAIL_WILDCARD_REG_EXP_STR) { - throw PATH_ERROR; - } - } - nextNode = node.#children[token] = new _Node(); + regexpStr = regexpStr.replace(/^\((?!\?:)(?=[^)]+\)$)/, "(?:"); + if (/\((?!\?:)/.test(regexpStr)) { + throw PATH_ERROR; } } - node = nextNode; + node = this.#children[regexpStr]; + if (!node) { + if (Object.keys(this.#children).some( + (k) => k !== ONLY_WILDCARD_REG_EXP_STR && k !== TAIL_WILDCARD_REG_EXP_STR + )) { + throw PATH_ERROR; + } + if (pathErrorCheckOnly) { + return; + } + node = this.#children[regexpStr] = new _Node(); + if (name !== "") { + node.#varIndex = context.varIndex++; + } + } + if (!pathErrorCheckOnly && name !== "") { + paramMap.push([name, node.#varIndex]); + } + } else { + node = this.#children[token]; + if (!node) { + if (Object.keys(this.#children).some( + (k) => k.length > 1 && k !== ONLY_WILDCARD_REG_EXP_STR && k !== TAIL_WILDCARD_REG_EXP_STR + )) { + throw PATH_ERROR; + } + if (pathErrorCheckOnly) { + return; + } + node = this.#children[token] = new _Node(); + } } - if (node.#index !== void 0) { - throw PATH_ERROR; - } - node.#index = isStatic ? -1 : index; + node.insert(restTokens, index, paramMap, context, pathErrorCheckOnly); } buildRegExpStr() { const childKeys = Object.keys(this.#children).sort(compareKey); const strList = childKeys.map((k) => { const c = this.#children[k]; - const childStr = c.buildRegExpStr(); - return childStr === "" ? "" : (typeof c.#varIndex === "number" ? `(${k})@${c.#varIndex}` : regExpMetaChars.has(k) ? `\\${k}` : k) + childStr; - }).filter(Boolean); - if (typeof this.#index === "number" && this.#index !== -1) { + return (typeof c.#varIndex === "number" ? `(${k})@${c.#varIndex}` : regExpMetaChars.has(k) ? `\\${k}` : k) + c.buildRegExpStr(); + }); + if (typeof this.#index === "number") { strList.unshift(`#${this.#index}`); } if (strList.length === 0) { @@ -8625,24 +8352,16 @@ var Node = class _Node { } }; -// ../arcrun/mcp/node_modules/hono/dist/router/reg-exp-router/trie.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router/reg-exp-router/trie.js var Trie = class { #context = { varIndex: 0 }; #root = new Node(); - #index = 0; - // dynamic path -> [handler index, param assoc]; static paths are not registered - paths = /* @__PURE__ */ Object.create(null); - insert(path, isStatic) { - if (isStatic) { - this.#root.insert(path.split(""), 0, [], this.#context, true); - return; - } + insert(path, index, pathErrorCheckOnly) { const paramAssoc = []; const groups = []; - let markedPath = path; for (let i = 0; ; ) { let replaced = false; - markedPath = markedPath.replace(/\{[^}]+\}/g, (m) => { + path = path.replace(/\{[^}]+\}/g, (m) => { const mark = `@\\${i}`; groups[i] = [mark, m]; i++; @@ -8653,7 +8372,7 @@ var Trie = class { break; } } - const tokens = markedPath.match(/(?::[^\/]+)|(?:\/\*$)|./g) || []; + const tokens = path.match(/(?::[^\/]+)|(?:\/\*$)|./g) || []; for (let i = groups.length - 1; i >= 0; i--) { const [mark] = groups[i]; for (let j = tokens.length - 1; j >= 0; j--) { @@ -8663,8 +8382,8 @@ var Trie = class { } } } - this.#root.insert(tokens, this.#index, paramAssoc, this.#context, false); - this.paths[path] = [this.#index++, paramAssoc]; + this.#root.insert(tokens, index, paramAssoc, this.#context, pathErrorCheckOnly); + return paramAssoc; } buildRegExp() { let regexp = this.#root.buildRegExpStr(); @@ -8689,7 +8408,8 @@ var Trie = class { } }; -// ../arcrun/mcp/node_modules/hono/dist/router/reg-exp-router/router.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router/reg-exp-router/router.js +var nullMatcher = [/^$/, [], /* @__PURE__ */ Object.create(null)]; var wildcardRegExpCache = /* @__PURE__ */ Object.create(null); function buildWildcardRegExp(path) { return wildcardRegExpCache[path] ??= new RegExp( @@ -8702,6 +8422,63 @@ function buildWildcardRegExp(path) { function clearWildcardRegExpCache() { wildcardRegExpCache = /* @__PURE__ */ Object.create(null); } +function buildMatcherFromPreprocessedRoutes(routes) { + const trie = new Trie(); + const handlerData = []; + if (routes.length === 0) { + return nullMatcher; + } + const routesWithStaticPathFlag = routes.map( + (route) => [!/\*|\/:/.test(route[0]), ...route] + ).sort( + ([isStaticA, pathA], [isStaticB, pathB]) => isStaticA ? 1 : isStaticB ? -1 : pathA.length - pathB.length + ); + const staticMap = /* @__PURE__ */ Object.create(null); + for (let i = 0, j = -1, len = routesWithStaticPathFlag.length; i < len; i++) { + const [pathErrorCheckOnly, path, handlers] = routesWithStaticPathFlag[i]; + if (pathErrorCheckOnly) { + staticMap[path] = [handlers.map(([h]) => [h, /* @__PURE__ */ Object.create(null)]), emptyParam]; + } else { + j++; + } + let paramAssoc; + try { + paramAssoc = trie.insert(path, j, pathErrorCheckOnly); + } catch (e) { + throw e === PATH_ERROR ? new UnsupportedPathError(path) : e; + } + if (pathErrorCheckOnly) { + continue; + } + handlerData[j] = handlers.map(([h, paramCount]) => { + const paramIndexMap = /* @__PURE__ */ Object.create(null); + paramCount -= 1; + for (; paramCount >= 0; paramCount--) { + const [key, value] = paramAssoc[paramCount]; + paramIndexMap[key] = value; + } + return [h, paramIndexMap]; + }); + } + const [regexp, indexReplacementMap, paramReplacementMap] = trie.buildRegExp(); + for (let i = 0, len = handlerData.length; i < len; i++) { + for (let j = 0, len2 = handlerData[i].length; j < len2; j++) { + const map2 = handlerData[i][j]?.[1]; + if (!map2) { + continue; + } + const keys = Object.keys(map2); + for (let k = 0, len3 = keys.length; k < len3; k++) { + map2[keys[k]] = paramReplacementMap[map2[keys[k]]]; + } + } + } + const handlerMap = []; + for (const i in indexReplacementMap) { + handlerMap[i] = handlerData[indexReplacementMap[i]]; + } + return [regexp, handlerMap, staticMap]; +} function findMiddleware(middleware, path) { if (!middleware) { return void 0; @@ -8717,18 +8494,9 @@ var RegExpRouter = class { name = "RegExpRouter"; #middleware; #routes; - #tries; constructor() { this.#middleware = { [METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) }; this.#routes = { [METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) }; - this.#tries = { [METHOD_NAME_ALL]: new Trie() }; - } - #insertPath(method, path) { - try { - this.#tries[method].insert(path, !/\*|\/:/.test(path)); - } catch (e) { - throw e === PATH_ERROR ? new UnsupportedPathError(path) : e; - } } add(method, path, handler) { const middleware = this.#middleware; @@ -8737,12 +8505,11 @@ var RegExpRouter = class { throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT); } if (!middleware[method]) { - this.#tries[method] = new Trie(); + ; [middleware, routes].forEach((handlerMap) => { handlerMap[method] = /* @__PURE__ */ Object.create(null); Object.keys(handlerMap[METHOD_NAME_ALL]).forEach((p) => { handlerMap[method][p] = [...handlerMap[METHOD_NAME_ALL][p]]; - this.#insertPath(method, p); }); }); } @@ -8752,12 +8519,13 @@ var RegExpRouter = class { const paramCount = (path.match(/\/:/g) || []).length; if (/\*$/.test(path)) { const re = buildWildcardRegExp(path); - Object.keys(middleware).forEach((m) => { - if ((method === METHOD_NAME_ALL || method === m) && !middleware[m][path]) { - this.#insertPath(m, path); - middleware[m][path] = findMiddleware(middleware[m], path) || findMiddleware(middleware[METHOD_NAME_ALL], path) || []; - } - }); + if (method === METHOD_NAME_ALL) { + Object.keys(middleware).forEach((m) => { + middleware[m][path] ||= findMiddleware(middleware[m], path) || findMiddleware(middleware[METHOD_NAME_ALL], path) || []; + }); + } else { + middleware[method][path] ||= findMiddleware(middleware[method], path) || findMiddleware(middleware[METHOD_NAME_ALL], path) || []; + } Object.keys(middleware).forEach((m) => { if (method === METHOD_NAME_ALL || method === m) { Object.keys(middleware[m]).forEach((p) => { @@ -8779,12 +8547,9 @@ var RegExpRouter = class { const path2 = paths[i]; Object.keys(routes).forEach((m) => { if (method === METHOD_NAME_ALL || method === m) { - if (!routes[m][path2]) { - this.#insertPath(m, path2); - routes[m][path2] = [ - ...findMiddleware(middleware[m], path2) || findMiddleware(middleware[METHOD_NAME_ALL], path2) || [] - ]; - } + routes[m][path2] ||= [ + ...findMiddleware(middleware[m], path2) || findMiddleware(middleware[METHOD_NAME_ALL], path2) || [] + ]; routes[m][path2].push([handler, paramCount - len + i + 1]); } }); @@ -8796,58 +8561,33 @@ var RegExpRouter = class { Object.keys(this.#routes).concat(Object.keys(this.#middleware)).forEach((method) => { matchers[method] ||= this.#buildMatcher(method); }); - this.#middleware = this.#routes = this.#tries = void 0; + this.#middleware = this.#routes = void 0; clearWildcardRegExpCache(); return matchers; } #buildMatcher(method) { - const middleware = this.#middleware[method]; - const routes = this.#routes[method]; - const trie = this.#tries[method]; - const staticMap = /* @__PURE__ */ Object.create(null); - const handlerData = []; - [middleware, routes].forEach((r) => { - for (const path in r) { - const handlers = r[path]; - const pathData = trie.paths[path]; - if (!pathData) { - staticMap[path] = [handlers.map(([h]) => [h, /* @__PURE__ */ Object.create(null)]), emptyParam]; - continue; - } - const paramAssoc = pathData[1]; - handlerData[pathData[0]] = handlers.map(([h, paramCount]) => { - const paramIndexMap = /* @__PURE__ */ Object.create(null); - paramCount -= 1; - for (; paramCount >= 0; paramCount--) { - const [key, value] = paramAssoc[paramCount]; - paramIndexMap[key] = value; - } - return [h, paramIndexMap]; - }); + const routes = []; + let hasOwnRoute = method === METHOD_NAME_ALL; + [this.#middleware, this.#routes].forEach((r) => { + const ownRoute = r[method] ? Object.keys(r[method]).map((path) => [path, r[method][path]]) : []; + if (ownRoute.length !== 0) { + hasOwnRoute ||= true; + routes.push(...ownRoute); + } else if (method !== METHOD_NAME_ALL) { + routes.push( + ...Object.keys(r[METHOD_NAME_ALL]).map((path) => [path, r[METHOD_NAME_ALL][path]]) + ); } }); - const [regexp, indexReplacementMap, paramReplacementMap] = trie.buildRegExp(); - for (let i = 0, len = handlerData.length; i < len; i++) { - for (let j = 0, len2 = handlerData[i].length; j < len2; j++) { - const map2 = handlerData[i][j]?.[1]; - if (!map2) { - continue; - } - const keys = Object.keys(map2); - for (let k = 0, len3 = keys.length; k < len3; k++) { - map2[keys[k]] = paramReplacementMap[map2[keys[k]]]; - } - } + if (!hasOwnRoute) { + return null; + } else { + return buildMatcherFromPreprocessedRoutes(routes); } - const handlerMap = []; - for (const i in indexReplacementMap) { - handlerMap[i] = handlerData[indexReplacementMap[i]]; - } - return [regexp, handlerMap, staticMap]; } }; -// ../arcrun/mcp/node_modules/hono/dist/router/smart-router/router.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router/smart-router/router.js var SmartRouter = class { name = "SmartRouter"; #routers = []; @@ -8902,7 +8642,7 @@ var SmartRouter = class { } }; -// ../arcrun/mcp/node_modules/hono/dist/router/trie-router/node.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router/trie-router/node.js var emptyParams = /* @__PURE__ */ Object.create(null); var hasChildren = (children) => { for (const _ in children) { @@ -9036,18 +8776,9 @@ var Node2 = class _Node2 { if (m) { params[name] = m[0]; this.#pushHandlerSets(handlerSets, child, method, node.#params, params); - if (m[0].length === restPathString.length && child.#children["*"]) { - this.#pushHandlerSets( - handlerSets, - child.#children["*"], - method, - node.#params, - params - ); - } if (hasChildren(child.#children)) { child.#params = params; - const componentCount = m[0].match(/\//g)?.length ?? 0; + const componentCount = m[0].match(/\//)?.length ?? 0; const targetCurNodes = curNodesQueue[componentCount] ||= []; targetCurNodes.push(child); } @@ -9086,7 +8817,7 @@ var Node2 = class _Node2 { } }; -// ../arcrun/mcp/node_modules/hono/dist/router/trie-router/router.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router/trie-router/router.js var TrieRouter = class { name = "TrieRouter"; #node; @@ -9108,7 +8839,7 @@ var TrieRouter = class { } }; -// ../arcrun/mcp/node_modules/hono/dist/hono.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/hono.js var Hono2 = class extends Hono { /** * Creates an instance of the Hono class. @@ -9123,18 +8854,24 @@ var Hono2 = class extends Hono { } }; -// ../arcrun/mcp/node_modules/hono/dist/middleware/cors/index.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/middleware/cors/index.js var cors = (options) => { - const opts = { + const defaults = { origin: "*", - allowMethods: ["GET", "HEAD", "PUT", "POST", "DELETE", "PATCH", "QUERY"], + allowMethods: ["GET", "HEAD", "PUT", "POST", "DELETE", "PATCH"], allowHeaders: [], - exposeHeaders: [], + exposeHeaders: [] + }; + const opts = { + ...defaults, ...options }; const findAllowOrigin = ((optsOrigin) => { if (typeof optsOrigin === "string") { if (optsOrigin === "*") { + if (opts.credentials) { + return (origin) => origin || null; + } return () => optsOrigin; } else { return (origin) => optsOrigin === origin ? origin : null; @@ -9169,7 +8906,7 @@ var cors = (options) => { set2("Access-Control-Expose-Headers", opts.exposeHeaders.join(",")); } if (c.req.method === "OPTIONS") { - if (opts.origin !== "*") { + if (opts.origin !== "*" || opts.credentials) { set2("Vary", "Origin"); } if (opts.maxAge != null) { @@ -9183,7 +8920,7 @@ var cors = (options) => { if (!headers?.length) { const requestHeaders = c.req.header("Access-Control-Request-Headers"); if (requestHeaders) { - headers = requestHeaders.split(",").map((h) => h.trim()); + headers = requestHeaders.split(/\s*,\s*/); } } if (headers?.length) { @@ -9199,13 +8936,13 @@ var cors = (options) => { }); } await next(); - if (opts.origin !== "*") { + if (opts.origin !== "*" || opts.credentials) { c.header("Vary", "Origin", { append: true }); } }; }; -// ../arcrun/mcp/src/oauth/crypto.ts +// ../../matrix/arcrun/mcp/src/oauth/crypto.ts function base64UrlEncode(bytes) { let bin = ""; for (const b of bytes) bin += String.fromCharCode(b); @@ -9243,7 +8980,7 @@ async function verifyPkceS256(codeVerifier, codeChallenge, method) { return constantTimeEqual(computed, codeChallenge); } -// ../arcrun/mcp/src/oauth/store.ts +// ../../matrix/arcrun/mcp/src/oauth/store.ts var CODE_PREFIX = "oauth:code:"; var TOKEN_PREFIX = "oauth:tok:"; var AUTH_CODE_TTL_SECONDS = 600; @@ -9279,7 +9016,7 @@ async function getAccessToken(kv, token) { } } -// ../arcrun/mcp/src/oauth/metadata.ts +// ../../matrix/arcrun/mcp/src/oauth/metadata.ts function originOf(reqUrl) { const u = new URL(reqUrl); return `${u.protocol.toLowerCase()}//${u.host.toLowerCase()}`; @@ -9333,7 +9070,7 @@ function wwwAuthenticateHeader(origin, error2) { return h; } -// ../arcrun/mcp/src/middleware/partner-auth.ts +// ../../matrix/arcrun/mcp/src/middleware/partner-auth.ts async function partnerAuthMiddleware(c, next) { const origin = originOf(c.req.url); const unauthorized = (desc, error2) => c.json({ error: "unauthorized", error_description: desc }, 401, { @@ -9393,7 +9130,7 @@ async function partnerAuthMiddleware(c, next) { return unauthorized("Bearer token not recognized; complete OAuth to obtain an access token", "invalid_token"); } -// ../arcrun/mcp/node_modules/zod/v3/external.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.js var external_exports = {}; __export(external_exports, { BRAND: () => BRAND, @@ -9505,7 +9242,7 @@ __export(external_exports, { void: () => voidType }); -// ../arcrun/mcp/node_modules/zod/v3/helpers/util.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js var util; (function(util2) { util2.assertEqual = (_) => { @@ -9639,7 +9376,7 @@ var getParsedType = (data) => { } }; -// ../arcrun/mcp/node_modules/zod/v3/ZodError.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js var ZodIssueCode = util.arrayToEnum([ "invalid_type", "invalid_literal", @@ -9757,7 +9494,7 @@ ZodError.create = (issues) => { return error2; }; -// ../arcrun/mcp/node_modules/zod/v3/locales/en.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js var errorMap = (issue2, _ctx) => { let message; switch (issue2.code) { @@ -9860,7 +9597,7 @@ var errorMap = (issue2, _ctx) => { }; var en_default = errorMap; -// ../arcrun/mcp/node_modules/zod/v3/errors.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js var overrideErrorMap = en_default; function setErrorMap(map2) { overrideErrorMap = map2; @@ -9869,7 +9606,7 @@ function getErrorMap() { return overrideErrorMap; } -// ../arcrun/mcp/node_modules/zod/v3/helpers/parseUtil.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js var makeIssue = (params) => { const { data, path, errorMaps, issueData } = params; const fullPath = [...path, ...issueData.path || []]; @@ -9979,14 +9716,14 @@ var isDirty = (x) => x.status === "dirty"; var isValid = (x) => x.status === "valid"; var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise; -// ../arcrun/mcp/node_modules/zod/v3/helpers/errorUtil.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js var errorUtil; (function(errorUtil2) { errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {}; errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message; })(errorUtil || (errorUtil = {})); -// ../arcrun/mcp/node_modules/zod/v3/types.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js var ParseInputLazyPath = class { constructor(parent, value, path, key) { this._cachedPath = []; @@ -13434,7 +13171,7 @@ var coerce = { }; var NEVER = INVALID; -// ../arcrun/mcp/node_modules/zod/v4/core/core.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/core.js var NEVER2 = Object.freeze({ status: "aborted" }); @@ -13493,7 +13230,7 @@ function config(newConfig) { return globalConfig; } -// ../arcrun/mcp/node_modules/zod/v4/core/util.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/util.js var util_exports = {}; __export(util_exports, { BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES, @@ -14014,7 +13751,7 @@ var Class = class { } }; -// ../arcrun/mcp/node_modules/zod/v4/core/errors.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/errors.js var initializer = (inst, def) => { inst.name = "$ZodError"; Object.defineProperty(inst, "_zod", { @@ -14089,7 +13826,7 @@ function formatError(error2, _mapper) { return fieldErrors; } -// ../arcrun/mcp/node_modules/zod/v4/core/parse.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/parse.js var _parse = (_Err) => (schema4, value, _ctx, _params) => { const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false }; const result = schema4._zod.run({ value, issues: [] }, ctx); @@ -14141,7 +13878,7 @@ var _safeParseAsync = (_Err) => async (schema4, value, _ctx) => { }; var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError); -// ../arcrun/mcp/node_modules/zod/v4/core/regexes.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/regexes.js var cuid = /^[cC][^\s-]{8,}$/; var cuid2 = /^[0-9a-z]+$/; var ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/; @@ -14199,7 +13936,7 @@ var _null = /null/i; var lowercase = /^[^A-Z]*$/; var uppercase = /^[^a-z]*$/; -// ../arcrun/mcp/node_modules/zod/v4/core/checks.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/checks.js var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => { var _a; inst._zod ?? (inst._zod = {}); @@ -14584,7 +14321,7 @@ var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (ins }; }); -// ../arcrun/mcp/node_modules/zod/v4/core/doc.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/doc.js var Doc = class { constructor(args = []) { this.content = []; @@ -14620,14 +14357,14 @@ var Doc = class { } }; -// ../arcrun/mcp/node_modules/zod/v4/core/versions.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/versions.js var version = { major: 4, minor: 0, patch: 0 }; -// ../arcrun/mcp/node_modules/zod/v4/core/schemas.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/schemas.js var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => { var _a; inst ?? (inst = {}); @@ -15865,7 +15602,7 @@ function handleRefineResult(result, payload, input, inst) { } } -// ../arcrun/mcp/node_modules/zod/v4/locales/en.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/locales/en.js var parsedType = (data) => { const t = typeof data; switch (t) { @@ -15983,7 +15720,7 @@ function en_default2() { }; } -// ../arcrun/mcp/node_modules/zod/v4/core/registries.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/registries.js var $ZodRegistry = class { constructor() { this._map = /* @__PURE__ */ new Map(); @@ -16031,7 +15768,7 @@ function registry() { } var globalRegistry = /* @__PURE__ */ registry(); -// ../arcrun/mcp/node_modules/zod/v4/core/api.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/api.js function _string(Class2, params) { return new Class2({ type: "string", @@ -16470,7 +16207,7 @@ function _refine(Class2, fn, _params) { return schema4; } -// ../arcrun/mcp/node_modules/zod/v4/core/to-json-schema.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/to-json-schema.js var JSONSchemaGenerator = class { constructor(params) { this.counter = 0; @@ -17237,7 +16974,7 @@ function isTransforming(_schema, _ctx) { throw new Error(`Unknown schema type: ${def.type}`); } -// ../arcrun/mcp/node_modules/zod/v4/mini/schemas.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/mini/schemas.js var ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => { if (!inst._zod) throw new Error("Uninitialized schema in ZodMiniType."); @@ -17283,7 +17020,7 @@ function object(shape, params) { return new ZodMiniObject(def); } -// ../arcrun/mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js function isZ4Schema(s) { const schema4 = s; return !!schema4._zod; @@ -17367,33 +17104,17 @@ function normalizeObjectSchema(schema4) { } return void 0; } -function getDotPath(path) { - if (path.length === 0) { - return "object root"; - } - return path.reduce((acc, seg, index) => { - if (index === 0) { - return String(seg); - } - if (typeof seg === "number") { - return `${acc}[${seg}]`; - } - return `${acc}.${seg}`; - }, ""); -} function getParseErrorMessage(error2) { if (error2 && typeof error2 === "object") { - if ("issues" in error2 && Array.isArray(error2.issues) && error2.issues.length > 0) { - return error2.issues.map((i) => { - if (!i.path?.length) { - return i.message; - } - return `${i.message} at ${getDotPath(i.path)}`; - }).join("\n"); - } if ("message" in error2 && typeof error2.message === "string") { return error2.message; } + if ("issues" in error2 && Array.isArray(error2.issues) && error2.issues.length > 0) { + const firstIssue = error2.issues[0]; + if (firstIssue && typeof firstIssue === "object" && "message" in firstIssue) { + return String(firstIssue.message); + } + } try { return JSON.stringify(error2); } catch { @@ -17443,7 +17164,7 @@ function getLiteralValue(schema4) { return void 0; } -// ../arcrun/mcp/node_modules/zod/v4/classic/iso.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/iso.js var iso_exports2 = {}; __export(iso_exports2, { ZodISODate: () => ZodISODate, @@ -17484,7 +17205,7 @@ function duration2(params) { return _isoDuration(ZodISODuration, params); } -// ../arcrun/mcp/node_modules/zod/v4/classic/errors.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/errors.js var initializer2 = (inst, issues) => { $ZodError.init(inst, issues); inst.name = "ZodError"; @@ -17518,13 +17239,13 @@ var ZodRealError = $constructor("ZodError", initializer2, { Parent: Error }); -// ../arcrun/mcp/node_modules/zod/v4/classic/parse.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/parse.js var parse2 = /* @__PURE__ */ _parse(ZodRealError); var parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError); var safeParse3 = /* @__PURE__ */ _safeParse(ZodRealError); var safeParseAsync3 = /* @__PURE__ */ _safeParseAsync(ZodRealError); -// ../arcrun/mcp/node_modules/zod/v4/classic/schemas.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/schemas.js var ZodType2 = /* @__PURE__ */ $constructor("ZodType", (inst, def) => { $ZodType.init(inst, def); inst.def = def; @@ -18135,10 +17856,10 @@ function preprocess(fn, schema4) { return pipe(transform(fn), schema4); } -// ../arcrun/mcp/node_modules/zod/v4/classic/external.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/external.js config(en_default2()); -// ../arcrun/mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js var LATEST_PROTOCOL_VERSION = "2025-11-25"; var DEFAULT_NEGOTIATED_PROTOCOL_VERSION = "2025-03-26"; var SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"]; @@ -19671,12 +19392,12 @@ var UrlElicitationRequiredError = class extends McpError { } }; -// ../arcrun/mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js function isTerminal(status) { return status === "completed" || status === "failed" || status === "cancelled"; } -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/Options.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Options.js var ignoreOverride = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to use"); var defaultOptions = { name: void 0, @@ -19710,7 +19431,7 @@ var getDefaultOptions = (options) => typeof options === "string" ? { ...options }; -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/Refs.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Refs.js var getRefs = (options) => { const _options = getDefaultOptions(options); const currentPath = _options.name !== void 0 ? [..._options.basePath, _options.definitionPath, _options.name] : _options.basePath; @@ -19731,7 +19452,7 @@ var getRefs = (options) => { }; }; -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/errorMessages.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/errorMessages.js function addErrorMessage(res, key, errorMessage, refs) { if (!refs?.errorMessages) return; @@ -19747,7 +19468,7 @@ function setResponseValueAndErrors(res, key, value, errorMessage, refs) { addErrorMessage(res, key, errorMessage, refs); } -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js var getRelativePath = (pathA, pathB) => { let i = 0; for (; i < pathA.length && i < pathB.length; i++) { @@ -19757,7 +19478,7 @@ var getRelativePath = (pathA, pathB) => { return [(pathA.length - i).toString(), ...pathB.slice(i)].join("/"); }; -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/any.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/any.js function parseAnyDef(refs) { if (refs.target !== "openAi") { return {}; @@ -19773,7 +19494,7 @@ function parseAnyDef(refs) { }; } -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/array.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/array.js function parseArrayDef(def, refs) { const res = { type: "array" @@ -19797,7 +19518,7 @@ function parseArrayDef(def, refs) { return res; } -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js function parseBigintDef(def, refs) { const res = { type: "integer", @@ -19843,24 +19564,24 @@ function parseBigintDef(def, refs) { return res; } -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js function parseBooleanDef() { return { type: "boolean" }; } -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js function parseBrandedDef(_def, refs) { return parseDef(_def.type._def, refs); } -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js var parseCatchDef = (def, refs) => { return parseDef(def.innerType._def, refs); }; -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/date.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/date.js function parseDateDef(def, refs, overrideDateStrategy) { const strategy = overrideDateStrategy ?? refs.dateStrategy; if (Array.isArray(strategy)) { @@ -19919,7 +19640,7 @@ var integerDateParser = (def, refs) => { return res; }; -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/default.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/default.js function parseDefaultDef(_def, refs) { return { ...parseDef(_def.innerType._def, refs), @@ -19927,12 +19648,12 @@ function parseDefaultDef(_def, refs) { }; } -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js function parseEffectsDef(_def, refs) { return refs.effectStrategy === "input" ? parseDef(_def.schema._def, refs) : parseAnyDef(refs); } -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js function parseEnumDef(def) { return { type: "string", @@ -19940,7 +19661,7 @@ function parseEnumDef(def) { }; } -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js var isJsonSchema7AllOfType = (type) => { if ("type" in type && type.type === "string") return false; @@ -19982,7 +19703,7 @@ function parseIntersectionDef(def, refs) { } : void 0; } -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js function parseLiteralDef(def, refs) { const parsedType2 = typeof def.value; if (parsedType2 !== "bigint" && parsedType2 !== "number" && parsedType2 !== "boolean" && parsedType2 !== "string") { @@ -20002,7 +19723,7 @@ function parseLiteralDef(def, refs) { }; } -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/string.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/string.js var emojiRegex2 = void 0; var zodPatterns = { /** @@ -20327,7 +20048,7 @@ function stringifyRegExpWithFlags(regex, refs) { return pattern; } -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/record.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/record.js function parseRecordDef(def, refs) { if (refs.target === "openAi") { console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."); @@ -20379,7 +20100,7 @@ function parseRecordDef(def, refs) { return schema4; } -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/map.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/map.js function parseMapDef(def, refs) { if (refs.mapStrategy === "record") { return parseRecordDef(def, refs); @@ -20404,7 +20125,7 @@ function parseMapDef(def, refs) { }; } -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js function parseNativeEnumDef(def) { const object3 = def.values; const actualKeys = Object.keys(def.values).filter((key) => { @@ -20418,7 +20139,7 @@ function parseNativeEnumDef(def) { }; } -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/never.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/never.js function parseNeverDef(refs) { return refs.target === "openAi" ? void 0 : { not: parseAnyDef({ @@ -20428,7 +20149,7 @@ function parseNeverDef(refs) { }; } -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/null.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/null.js function parseNullDef(refs) { return refs.target === "openApi3" ? { enum: ["null"], @@ -20438,7 +20159,7 @@ function parseNullDef(refs) { }; } -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/union.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/union.js var primitiveMappings = { ZodString: "string", ZodNumber: "number", @@ -20506,7 +20227,7 @@ var asAnyOf = (def, refs) => { return anyOf.length ? { anyOf } : void 0; }; -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js function parseNullableDef(def, refs) { if (["ZodString", "ZodNumber", "ZodBigInt", "ZodBoolean", "ZodNull"].includes(def.innerType._def.typeName) && (!def.innerType._def.checks || !def.innerType._def.checks.length)) { if (refs.target === "openApi3") { @@ -20538,7 +20259,7 @@ function parseNullableDef(def, refs) { return base && { anyOf: [base, { type: "null" }] }; } -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/number.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/number.js function parseNumberDef(def, refs) { const res = { type: "number" @@ -20587,7 +20308,7 @@ function parseNumberDef(def, refs) { return res; } -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/object.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/object.js function parseObjectDef(def, refs) { const forceOptionalIntoNullable = refs.target === "openAi"; const result = { @@ -20657,7 +20378,7 @@ function safeIsOptional(schema4) { } } -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js var parseOptionalDef = (def, refs) => { if (refs.currentPath.toString() === refs.propertyPath?.toString()) { return parseDef(def.innerType._def, refs); @@ -20676,7 +20397,7 @@ var parseOptionalDef = (def, refs) => { } : parseAnyDef(refs); }; -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js var parsePipelineDef = (def, refs) => { if (refs.pipeStrategy === "input") { return parseDef(def.in._def, refs); @@ -20696,12 +20417,12 @@ var parsePipelineDef = (def, refs) => { }; }; -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js function parsePromiseDef(def, refs) { return parseDef(def.type._def, refs); } -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/set.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/set.js function parseSetDef(def, refs) { const items = parseDef(def.valueType._def, { ...refs, @@ -20721,7 +20442,7 @@ function parseSetDef(def, refs) { return schema4; } -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js function parseTupleDef(def, refs) { if (def.rest) { return { @@ -20749,24 +20470,24 @@ function parseTupleDef(def, refs) { } } -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js function parseUndefinedDef(refs) { return { not: parseAnyDef(refs) }; } -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js function parseUnknownDef(refs) { return parseAnyDef(refs); } -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js var parseReadonlyDef = (def, refs) => { return parseDef(def.innerType._def, refs); }; -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/selectParser.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/selectParser.js var selectParser = (def, typeName, refs) => { switch (typeName) { case ZodFirstPartyTypeKind.ZodString: @@ -20842,7 +20563,7 @@ var selectParser = (def, typeName, refs) => { } }; -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/parseDef.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parseDef.js function parseDef(def, refs, forceResolution = false) { const seenItem = refs.seen.get(def); if (refs.override) { @@ -20898,7 +20619,7 @@ var addMeta = (def, refs, jsonSchema) => { return jsonSchema; }; -// ../arcrun/mcp/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js var zodToJsonSchema = (schema4, options) => { const refs = getRefs(options); let definitions = typeof options === "object" && options.definitions ? Object.entries(options.definitions).reduce((acc, [name2, schema5]) => ({ @@ -20960,7 +20681,7 @@ var zodToJsonSchema = (schema4, options) => { return combined; }; -// ../arcrun/mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js function mapMiniTarget(t) { if (!t) return "draft-7"; @@ -21002,7 +20723,7 @@ function parseWithCompat(schema4, data) { return result.data; } -// ../arcrun/mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js var DEFAULT_REQUEST_TIMEOUT_MSEC = 6e4; var Protocol = class { constructor(_options) { @@ -21956,7 +21677,7 @@ function mergeCapabilities(base, additional) { return result; } -// ../arcrun/mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js var import_ajv = __toESM(require_ajv(), 1); var import_ajv_formats = __toESM(require_dist(), 1); function createDefaultAjvInstance() { @@ -22024,7 +21745,7 @@ var AjvJsonSchemaValidator = class { } }; -// ../arcrun/mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js var ExperimentalServerTasks = class { constructor(_server) { this._server = _server; @@ -22237,7 +21958,7 @@ var ExperimentalServerTasks = class { } }; -// ../arcrun/mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js function assertToolsCallTaskCapability(requests, method, entityName) { if (!requests) { throw new Error(`${entityName} does not support task creation (required for ${method})`); @@ -22272,7 +21993,7 @@ function assertClientRequestTaskCapability(requests, method, entityName) { } } -// ../arcrun/mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js var Server = class extends Protocol { /** * Initializes this server with the given name and version information. @@ -22338,7 +22059,16 @@ var Server = class extends Protocol { if (!methodSchema) { throw new Error("Schema is missing a method literal"); } - const methodValue = getLiteralValue(methodSchema); + let methodValue; + if (isZ4Schema(methodSchema)) { + const v4Schema = methodSchema; + const v4Def = v4Schema._zod?.def; + methodValue = v4Def?.value ?? v4Schema.value; + } else { + const v3Schema = methodSchema; + const legacyDef = v3Schema._def; + methodValue = legacyDef?.value ?? v3Schema.value; + } if (typeof methodValue !== "string") { throw new Error("Schema method literal must be a string"); } @@ -22643,7 +22373,7 @@ var Server = class extends Protocol { } }; -// ../arcrun/mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js var COMPLETABLE_SYMBOL = /* @__PURE__ */ Symbol.for("mcp.completable"); function isCompletable(schema4) { return !!schema4 && typeof schema4 === "object" && COMPLETABLE_SYMBOL in schema4; @@ -22657,7 +22387,7 @@ var McpZodTypeKind; McpZodTypeKind2["Completable"] = "McpCompletable"; })(McpZodTypeKind || (McpZodTypeKind = {})); -// ../arcrun/mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js var TOOL_NAME_REGEX = /^[A-Za-z0-9._-]{1,128}$/; function validateToolName(name) { const warnings = []; @@ -22715,7 +22445,7 @@ function validateAndWarnToolName(name) { return result.isValid; } -// ../arcrun/mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js var ExperimentalMcpServerTasks = class { constructor(_mcpServer) { this._mcpServer = _mcpServer; @@ -22730,7 +22460,7 @@ var ExperimentalMcpServerTasks = class { } }; -// ../arcrun/mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js var McpServer = class { constructor(serverInfo, options) { this._registeredResources = {}; @@ -23522,54 +23252,17 @@ var EMPTY_COMPLETION_RESULT = { } }; -// ../arcrun/mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/mediaType.js -var import_content_type = __toESM(require_content_type(), 1); -function mediaTypeEssence(header) { - if (!header) { - return void 0; - } - try { - return import_content_type.default.parse(header).type; - } catch { - const essence = (header.split(";", 1)[0] ?? "").trim().toLowerCase(); - if (essence === "" || header.slice(essence.length).includes(",")) { - return void 0; - } - return essence; - } -} -function isJsonContentType(header) { - if (header === "application/json") { - return true; - } - return mediaTypeEssence(header) === "application/json"; -} - -// ../arcrun/mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sseKeepAlive.js -var DEFAULT_SSE_KEEP_ALIVE_MS = 15e3; -var MAX_TIMER_DELAY_MS = 2 ** 31 - 1; -function armSseKeepAlive(intervalMs, onTick) { - if (!Number.isFinite(intervalMs) || intervalMs < 1) { - return void 0; - } - const timer = setInterval(onTick, Math.min(intervalMs, MAX_TIMER_DELAY_MS)); - timer.unref?.(); - return timer; -} - -// ../arcrun/mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.js var WebStandardStreamableHTTPServerTransport = class { constructor(options = {}) { this._started = false; this._hasHandledRequest = false; this._streamMapping = /* @__PURE__ */ new Map(); this._requestToStreamMapping = /* @__PURE__ */ new Map(); - this._resumableStreams = /* @__PURE__ */ new Set(); this._requestResponseMap = /* @__PURE__ */ new Map(); this._initialized = false; this._enableJsonResponse = false; this._standaloneSseStreamId = "_GET_stream"; - this._closed = false; this.sessionIdGenerator = options.sessionIdGenerator; this._enableJsonResponse = options.enableJsonResponse ?? false; this._eventStore = options.eventStore; @@ -23579,27 +23272,6 @@ var WebStandardStreamableHTTPServerTransport = class { this._allowedOrigins = options.allowedOrigins; this._enableDnsRebindingProtection = options.enableDnsRebindingProtection ?? false; this._retryInterval = options.retryInterval; - this._keepAliveMs = options.keepAliveMs ?? DEFAULT_SSE_KEEP_ALIVE_MS; - } - /** - * Arms a keep-alive interval for an SSE stream that periodically writes an SSE - * comment frame so intermediaries and idle timeouts don't kill the connection. - * The returned timer is owned by the stream it was armed for: the stream's - * cancel/cleanup callbacks must clear it. The interval clears itself if a - * write fails (stream already closed/cancelled). - */ - startKeepAlive(controller, encoder) { - if (this._closed) - return void 0; - const timer = armSseKeepAlive(this._keepAliveMs, () => { - try { - controller.enqueue(encoder.encode(": keepalive\n\n")); - } catch { - if (timer !== void 0) - clearInterval(timer); - } - }); - return timer; } /** * Starts the transport. This is required by the Transport interface but is a no-op @@ -23662,9 +23334,6 @@ var WebStandardStreamableHTTPServerTransport = class { * Returns a Response object (Web Standard) */ async handleRequest(req, options) { - if (this._closed) { - return this.createJsonErrorResponse(404, -32001, "Session not found"); - } if (!this.sessionIdGenerator && this._hasHandledRequest) { throw new Error("Stateless transport cannot be reused across requests. Create a new transport per request."); } @@ -23709,7 +23378,6 @@ data: `; } controller.enqueue(encoder.encode(primingEvent)); - this._resumableStreams.add(streamId); } /** * Handles GET requests for SSE stream @@ -23740,25 +23408,18 @@ data: } const encoder = new TextEncoder(); let streamController; - let keepAliveTimer = void 0; const readable = new ReadableStream({ start: (controller) => { streamController = controller; }, cancel: () => { - if (keepAliveTimer !== void 0) { - clearInterval(keepAliveTimer); - } - if (this._streamMapping.get(this._standaloneSseStreamId)?.controller === streamController) { - this._streamMapping.delete(this._standaloneSseStreamId); - } + this._streamMapping.delete(this._standaloneSseStreamId); } }); const headers = { "Content-Type": "text/event-stream", "Cache-Control": "no-cache, no-transform", - Connection: "keep-alive", - "X-Accel-Buffering": "no" + Connection: "keep-alive" }; if (this.sessionId !== void 0) { headers["mcp-session-id"] = this.sessionId; @@ -23767,9 +23428,6 @@ data: controller: streamController, encoder, cleanup: () => { - if (keepAliveTimer !== void 0) { - clearInterval(keepAliveTimer); - } this._streamMapping.delete(this._standaloneSseStreamId); try { streamController.close(); @@ -23777,7 +23435,6 @@ data: } } }); - keepAliveTimer = this.startKeepAlive(streamController, encoder); return new Response(readable, { headers }); } /** @@ -23805,33 +23462,21 @@ data: const headers = { "Content-Type": "text/event-stream", "Cache-Control": "no-cache, no-transform", - Connection: "keep-alive", - "X-Accel-Buffering": "no" + Connection: "keep-alive" }; if (this.sessionId !== void 0) { headers["mcp-session-id"] = this.sessionId; } const encoder = new TextEncoder(); let streamController; - let keepAliveTimer = void 0; - let replayedStreamId = void 0; - let cancelled = false; const readable = new ReadableStream({ start: (controller) => { streamController = controller; }, cancel: () => { - cancelled = true; - if (keepAliveTimer !== void 0) { - clearInterval(keepAliveTimer); - } - if (replayedStreamId !== void 0 && this._streamMapping.get(replayedStreamId)?.controller === streamController) { - this._streamMapping.delete(replayedStreamId); - } } }); - const replayedEventIds = /* @__PURE__ */ new Set(); - replayedStreamId = await this._eventStore.replayEventsAfter(lastEventId, { + const replayedStreamId = await this._eventStore.replayEventsAfter(lastEventId, { send: async (eventId, message) => { const success = this.writeSSEEvent(streamController, encoder, message, eventId); if (!success) { @@ -23840,27 +23485,13 @@ data: streamController.close(); } catch { } - } else { - replayedEventIds.add(eventId); } } }); - if (this._closed || cancelled) { - try { - streamController.close(); - } catch { - } - return this.createJsonErrorResponse(404, -32001, "Session not found"); - } - this._streamMapping.get(replayedStreamId)?.cleanup(); this._streamMapping.set(replayedStreamId, { controller: streamController, encoder, - replayedEventIds, cleanup: () => { - if (keepAliveTimer !== void 0) { - clearInterval(keepAliveTimer); - } this._streamMapping.delete(replayedStreamId); try { streamController.close(); @@ -23868,8 +23499,6 @@ data: } } }); - this._resumableStreams.add(replayedStreamId); - keepAliveTimer = this.startKeepAlive(streamController, encoder); return new Response(readable, { headers }); } catch (error2) { this.onerror?.(error2); @@ -23928,7 +23557,7 @@ data: return this.createJsonErrorResponse(406, -32e3, "Not Acceptable: Client must accept both application/json and text/event-stream"); } const ct = req.headers.get("content-type"); - if (!isJsonContentType(ct)) { + if (!ct || !ct.includes("application/json")) { this.onerror?.(new Error("Unsupported Media Type: Content-Type must be application/json")); return this.createJsonErrorResponse(415, -32e3, "Unsupported Media Type: Content-Type must be application/json"); } @@ -23958,9 +23587,6 @@ data: this.onerror?.(new Error("Parse error: Invalid JSON-RPC message")); return this.createJsonErrorResponse(400, -32700, "Parse error: Invalid JSON-RPC message"); } - if (this._closed) { - return this.createJsonErrorResponse(404, -32001, "Session not found"); - } const isInitializationRequest = messages.some(isInitializeRequest); if (isInitializationRequest) { if (this._initialized && this.sessionId !== void 0) { @@ -23987,9 +23613,6 @@ data: return protocolError; } } - if (this._closed) { - return this.createJsonErrorResponse(404, -32001, "Session not found"); - } const hasRequests = messages.some(isJSONRPCRequest); if (!hasRequests) { for (const message of messages) { @@ -24020,25 +23643,18 @@ data: } const encoder = new TextEncoder(); let streamController; - let keepAliveTimer = void 0; const readable = new ReadableStream({ start: (controller) => { streamController = controller; }, cancel: () => { - if (keepAliveTimer !== void 0) { - clearInterval(keepAliveTimer); - } - if (this._streamMapping.get(streamId)?.controller === streamController) { - this._streamMapping.delete(streamId); - } + this._streamMapping.delete(streamId); } }); const headers = { "Content-Type": "text/event-stream", - "Cache-Control": "no-cache, no-transform", - Connection: "keep-alive", - "X-Accel-Buffering": "no" + "Cache-Control": "no-cache", + Connection: "keep-alive" }; if (this.sessionId !== void 0) { headers["mcp-session-id"] = this.sessionId; @@ -24049,9 +23665,6 @@ data: controller: streamController, encoder, cleanup: () => { - if (keepAliveTimer !== void 0) { - clearInterval(keepAliveTimer); - } this._streamMapping.delete(streamId); try { streamController.close(); @@ -24062,33 +23675,19 @@ data: this._requestToStreamMapping.set(message.id, streamId); } } - try { - await this.writePrimingEvent(streamController, encoder, streamId, clientProtocolVersion); - for (const message of messages) { - let closeSSEStream; - let closeStandaloneSSEStream; - if (isJSONRPCRequest(message) && this._eventStore && clientProtocolVersion >= "2025-11-25") { - closeSSEStream = () => { - this.closeSSEStream(message.id); - }; - closeStandaloneSSEStream = () => { - this.closeStandaloneSSEStream(); - }; - } - this.onmessage?.(message, { authInfo: options?.authInfo, requestInfo, closeSSEStream, closeStandaloneSSEStream }); + await this.writePrimingEvent(streamController, encoder, streamId, clientProtocolVersion); + for (const message of messages) { + let closeSSEStream; + let closeStandaloneSSEStream; + if (isJSONRPCRequest(message) && this._eventStore && clientProtocolVersion >= "2025-11-25") { + closeSSEStream = () => { + this.closeSSEStream(message.id); + }; + closeStandaloneSSEStream = () => { + this.closeStandaloneSSEStream(); + }; } - } catch (error2) { - this._streamMapping.get(streamId)?.cleanup(); - this._resumableStreams.delete(streamId); - for (const message of messages) { - if (isJSONRPCRequest(message)) { - this._requestToStreamMapping.delete(message.id); - } - } - throw error2; - } - if (this._streamMapping.get(streamId)?.controller === streamController) { - keepAliveTimer = this.startKeepAlive(streamController, encoder); + this.onmessage?.(message, { authInfo: options?.authInfo, requestInfo, closeSSEStream, closeStandaloneSSEStream }); } return new Response(readable, { status: 200, headers }); } catch (error2) { @@ -24108,12 +23707,9 @@ data: if (protocolError) { return protocolError; } - try { - await Promise.resolve(this._onsessionclosed?.(this.sessionId)); - return new Response(null, { status: 200 }); - } finally { - await this.close(); - } + await Promise.resolve(this._onsessionclosed?.(this.sessionId)); + await this.close(); + return new Response(null, { status: 200 }); } /** * Validates session ID for non-initialization requests. @@ -24160,16 +23756,11 @@ data: return void 0; } async close() { - if (this._closed) { - return; - } - this._closed = true; this._streamMapping.forEach(({ cleanup }) => { cleanup(); }); this._streamMapping.clear(); this._requestResponseMap.clear(); - this._resumableStreams.clear(); this.onclose?.(); } /** @@ -24213,7 +23804,7 @@ data: if (standaloneSse === void 0) { return; } - if (standaloneSse.controller && standaloneSse.encoder && (eventId === void 0 || !standaloneSse.replayedEventIds?.has(eventId))) { + if (standaloneSse.controller && standaloneSse.encoder) { this.writeSSEEvent(standaloneSse.controller, standaloneSse.encoder, message, eventId); } return; @@ -24222,19 +23813,13 @@ data: if (!streamId) { throw new Error(`No connection established for request ID: ${String(requestId)}`); } - let stream = this._streamMapping.get(streamId); - if (!this._enableJsonResponse) { + const stream = this._streamMapping.get(streamId); + if (!this._enableJsonResponse && stream?.controller && stream?.encoder) { let eventId; if (this._eventStore) { eventId = await this._eventStore.storeEvent(streamId, message); - stream = this._streamMapping.get(streamId); - } - if (stream?.controller && stream?.encoder && (eventId === void 0 || !stream.replayedEventIds?.has(eventId))) { - const written = this.writeSSEEvent(stream.controller, stream.encoder, message, eventId); - if (written && eventId !== void 0) { - this._resumableStreams.add(streamId); - } } + this.writeSSEEvent(stream.controller, stream.encoder, message, eventId); } if (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) { this._requestResponseMap.set(requestId, message); @@ -24242,25 +23827,6 @@ data: const allResponsesReady = relatedIds.every((id) => this._requestResponseMap.has(id)); if (allResponsesReady) { if (!stream) { - if (this._closed) { - for (const id of relatedIds) { - this._requestResponseMap.delete(id); - this._requestToStreamMapping.delete(id); - } - return; - } - if (!this._enableJsonResponse && this._eventStore && this._resumableStreams.has(streamId)) { - for (const id of relatedIds) { - this._requestResponseMap.delete(id); - this._requestToStreamMapping.delete(id); - } - this._resumableStreams.delete(streamId); - return; - } - for (const id of relatedIds) { - this._requestResponseMap.delete(id); - this._requestToStreamMapping.delete(id); - } throw new Error(`No connection established for request ID: ${String(requestId)}`); } if (this._enableJsonResponse && stream.resolveJson) { @@ -24283,18 +23849,17 @@ data: this._requestResponseMap.delete(id); this._requestToStreamMapping.delete(id); } - this._resumableStreams.delete(streamId); } } } }; -// ../arcrun/mcp/src/brand.ts +// ../../matrix/arcrun/mcp/src/brand.ts var envPrefix = globalThis.process?.env?.ARCRUN_TOOL_PREFIX; var TOOL_PREFIX = envPrefix || "arcrun"; var toolName = (suffix) => `${TOOL_PREFIX}_${suffix}`; -// ../arcrun/mcp/src/tools/arcrun_search_components.ts +// ../../matrix/arcrun/mcp/src/tools/arcrun_search_components.ts function registerSearchComponents(server, env, orgNamespace) { server.tool( toolName("search_components"), @@ -24363,7 +23928,7 @@ ${JSON.stringify(results, null, 2)}` ); } -// ../arcrun/mcp/src/tools/arcrun_search_workflows.ts +// ../../matrix/arcrun/mcp/src/tools/arcrun_search_workflows.ts function registerSearchWorkflows(server, env, orgNamespace, partnerToken) { server.tool( toolName("search_workflows"), @@ -24424,7 +23989,7 @@ ${JSON.stringify(entries, null, 2)}${hintLine}` ); } -// ../arcrun/mcp/src/lib/kbdb-client.ts +// ../../matrix/arcrun/mcp/src/lib/kbdb-client.ts function kbdbFetch(env, path, init) { const headers = new Headers(init?.headers || {}); if (env.KBDB_INTERNAL_TOKEN) { @@ -24433,7 +23998,7 @@ function kbdbFetch(env, path, init) { return env.KBDB.fetch(`http://kbdb${path}`, { ...init, headers }); } -// ../arcrun/mcp/src/tools/arcrun_list_components.ts +// ../../matrix/arcrun/mcp/src/tools/arcrun_list_components.ts function registerListComponents(server, env, orgNamespace) { server.tool( toolName("list_components"), @@ -24469,7 +24034,7 @@ function registerListComponents(server, env, orgNamespace) { ); } -// ../arcrun/mcp/src/tools/arcrun_get_component.ts +// ../../matrix/arcrun/mcp/src/tools/arcrun_get_component.ts function registerGetComponent(server, env, orgNamespace) { server.tool( toolName("get_component"), @@ -24518,7 +24083,7 @@ function registerGetComponent(server, env, orgNamespace) { ); } -// ../arcrun/mcp/src/tools/arcrun_create_tag.ts +// ../../matrix/arcrun/mcp/src/tools/arcrun_create_tag.ts function registerCreateTag(server, env, orgNamespace) { server.tool( toolName("create_tag"), @@ -24561,7 +24126,7 @@ function registerCreateTag(server, env, orgNamespace) { ); } -// ../arcrun/mcp/src/tools/arcrun_list_tags.ts +// ../../matrix/arcrun/mcp/src/tools/arcrun_list_tags.ts function registerListTags(server, env, orgNamespace) { server.tool( toolName("list_tags"), @@ -24585,7 +24150,7 @@ function registerListTags(server, env, orgNamespace) { ); } -// ../arcrun/mcp/src/tools/arcrun_delete_tag.ts +// ../../matrix/arcrun/mcp/src/tools/arcrun_delete_tag.ts function registerDeleteTag(server, env, orgNamespace) { server.tool( toolName("delete_tag"), @@ -24612,7 +24177,7 @@ function registerDeleteTag(server, env, orgNamespace) { ); } -// ../arcrun/mcp/src/tools/arcrun_tag_resource.ts +// ../../matrix/arcrun/mcp/src/tools/arcrun_tag_resource.ts function registerTagResource(server, env, orgNamespace) { server.tool( toolName("tag_resource"), @@ -24666,7 +24231,7 @@ function registerTagResource(server, env, orgNamespace) { ); } -// ../arcrun/mcp/src/tools/arcrun_untag_resource.ts +// ../../matrix/arcrun/mcp/src/tools/arcrun_untag_resource.ts function registerUntagResource(server, env, orgNamespace) { server.tool( toolName("untag_resource"), @@ -24705,7 +24270,7 @@ function registerUntagResource(server, env, orgNamespace) { ); } -// ../arcrun/mcp/src/tools/arcrun_get_gui_context.ts +// ../../matrix/arcrun/mcp/src/tools/arcrun_get_gui_context.ts function registerGetGuiContext(server, env, orgNamespace) { server.tool( toolName("get_gui_context"), @@ -24764,7 +24329,7 @@ function registerGetGuiContext(server, env, orgNamespace) { ); } -// ../arcrun/mcp/src/tools/arcrun_report_feedback.ts +// ../../matrix/arcrun/mcp/src/tools/arcrun_report_feedback.ts var ISSUE_TYPES = [ "success_story", // 順利完成,值得記錄這個 pattern @@ -24891,7 +24456,7 @@ function registerReportFeedback(server, env, orgNamespace) { ); } -// ../arcrun/mcp/src/lib/cypher-client.ts +// ../../matrix/arcrun/mcp/src/lib/cypher-client.ts async function cypherFetch(env, path, opts) { if (!env.CYPHER_EXECUTOR) { throw new Error("CYPHER_EXECUTOR service binding not configured"); @@ -24941,7 +24506,7 @@ function successResponse(data, hints) { }; } -// ../arcrun/mcp/src/tools/arcrun_introspection.ts +// ../../matrix/arcrun/mcp/src/tools/arcrun_introspection.ts var apiKeyDesc = "\u4F60 (\u7528\u6236) \u7684 arcrun api_key (ak_xxx)\u3002\u5F9E https://arcrun.dev/me \u53D6\u5F97\u3002\u6CE8\u610F\uFF1A\u8DDF MCP \u9023\u7DDA\u7528\u7684 pk_live token \u662F\u4E0D\u540C\u5C64 auth \u2014 pk_live \u7D66 MCP \u7528\uFF0Cak_xxx \u7D66 workflow \u64CD\u4F5C\u7528"; function registerValidateYaml(server, env) { server.tool( @@ -25123,7 +24688,7 @@ function registerAllIntrospectionTools(server, env) { registerListRecentExecutions(server, env); } -// ../arcrun/mcp/node_modules/yaml/browser/dist/nodes/identity.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/nodes/identity.js var ALIAS = /* @__PURE__ */ Symbol.for("yaml.alias"); var DOC = /* @__PURE__ */ Symbol.for("yaml.document"); var MAP = /* @__PURE__ */ Symbol.for("yaml.map"); @@ -25159,7 +24724,7 @@ function isNode(node) { } var hasAnchor = (node) => (isScalar(node) || isCollection(node)) && !!node.anchor; -// ../arcrun/mcp/node_modules/yaml/browser/dist/visit.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/visit.js var BREAK = /* @__PURE__ */ Symbol("break visit"); var SKIP = /* @__PURE__ */ Symbol("skip children"); var REMOVE = /* @__PURE__ */ Symbol("remove node"); @@ -25309,7 +24874,7 @@ function replaceNode(key, path, node) { } } -// ../arcrun/mcp/node_modules/yaml/browser/dist/doc/directives.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/doc/directives.js var escapeChars = { "!": "%21", ",": "%2C", @@ -25472,7 +25037,7 @@ var Directives = class _Directives { Directives.defaultYaml = { explicit: false, version: "1.2" }; Directives.defaultTags = { "!!": "tag:yaml.org,2002:" }; -// ../arcrun/mcp/node_modules/yaml/browser/dist/doc/anchors.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/doc/anchors.js function anchorIsValid(anchor) { if (/[\x00-\x19\s,[\]{}]/.test(anchor)) { const sa = JSON.stringify(anchor); @@ -25531,7 +25096,7 @@ function createNodeAnchors(doc, prefix) { }; } -// ../arcrun/mcp/node_modules/yaml/browser/dist/doc/applyReviver.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/doc/applyReviver.js function applyReviver(reviver, obj, key, val) { if (val && typeof val === "object") { if (Array.isArray(val)) { @@ -25575,7 +25140,7 @@ function applyReviver(reviver, obj, key, val) { return reviver.call(obj, key, val); } -// ../arcrun/mcp/node_modules/yaml/browser/dist/nodes/toJS.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/nodes/toJS.js function toJS(value, arg, ctx) { if (Array.isArray(value)) return value.map((v, i) => toJS(v, String(i), ctx)); @@ -25598,7 +25163,7 @@ function toJS(value, arg, ctx) { return value; } -// ../arcrun/mcp/node_modules/yaml/browser/dist/nodes/Node.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/nodes/Node.js var NodeBase = class { constructor(type) { Object.defineProperty(this, NODE_TYPE, { value: type }); @@ -25630,7 +25195,7 @@ var NodeBase = class { } }; -// ../arcrun/mcp/node_modules/yaml/browser/dist/nodes/Alias.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/nodes/Alias.js var Alias = class extends NodeBase { constructor(source) { super(ALIAS); @@ -25735,7 +25300,7 @@ function getAliasCount(doc, node, anchors) { return 1; } -// ../arcrun/mcp/node_modules/yaml/browser/dist/nodes/Scalar.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/nodes/Scalar.js var isScalarValue = (value) => !value || typeof value !== "function" && typeof value !== "object"; var Scalar = class extends NodeBase { constructor(value) { @@ -25755,7 +25320,7 @@ Scalar.PLAIN = "PLAIN"; Scalar.QUOTE_DOUBLE = "QUOTE_DOUBLE"; Scalar.QUOTE_SINGLE = "QUOTE_SINGLE"; -// ../arcrun/mcp/node_modules/yaml/browser/dist/doc/createNode.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/doc/createNode.js var defaultTagPrefix = "tag:yaml.org,2002:"; function findTagObject(value, tagName, tags) { if (tagName) { @@ -25821,7 +25386,7 @@ function createNode(value, tagName, ctx) { return node; } -// ../arcrun/mcp/node_modules/yaml/browser/dist/nodes/Collection.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/nodes/Collection.js function collectionFromPath(schema4, path, value) { let v = value; for (let i = path.length - 1; i >= 0; --i) { @@ -25953,7 +25518,7 @@ var Collection = class extends NodeBase { } }; -// ../arcrun/mcp/node_modules/yaml/browser/dist/stringify/stringifyComment.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/stringify/stringifyComment.js var stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, "#"); function indentComment(comment, indent) { if (/^\n+$/.test(comment)) @@ -25962,7 +25527,7 @@ function indentComment(comment, indent) { } var lineComment = (str, indent, comment) => str.endsWith("\n") ? indentComment(comment, indent) : comment.includes("\n") ? "\n" + indentComment(comment, indent) : (str.endsWith(" ") ? "" : " ") + comment; -// ../arcrun/mcp/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/stringify/foldFlowLines.js var FOLD_FLOW = "flow"; var FOLD_BLOCK = "block"; var FOLD_QUOTED = "quoted"; @@ -26089,7 +25654,7 @@ function consumeMoreIndentedLines(text, i, indent) { return end; } -// ../arcrun/mcp/node_modules/yaml/browser/dist/stringify/stringifyString.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/stringify/stringifyString.js var getFoldOptions = (ctx, isBlock2) => ({ indentAtStart: isBlock2 ? ctx.indent.length : ctx.indentAtStart, lineWidth: ctx.options.lineWidth, @@ -26364,7 +25929,7 @@ function stringifyString(item, ctx, onComment, onChompKeep) { return res; } -// ../arcrun/mcp/node_modules/yaml/browser/dist/stringify/stringify.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/stringify/stringify.js function createStringifyContext(doc, options) { const opt = Object.assign({ blockQuote: true, @@ -26477,7 +26042,7 @@ function stringify(item, ctx, onComment, onChompKeep) { ${ctx.indent}${str}`; } -// ../arcrun/mcp/node_modules/yaml/browser/dist/stringify/stringifyPair.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/stringify/stringifyPair.js function stringifyPair({ key, value }, ctx, onComment, onChompKeep) { const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx; let keyComment = isNode(key) && key.comment || null; @@ -26600,14 +26165,14 @@ ${ctx.indent}`; return str; } -// ../arcrun/mcp/node_modules/yaml/browser/dist/log.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/log.js function warn(logLevel, warning) { if (logLevel === "debug" || logLevel === "warn") { console.warn(warning); } } -// ../arcrun/mcp/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js var MERGE_KEY = "<<"; var merge2 = { identify: (value) => value === MERGE_KEY || typeof value === "symbol" && value.description === MERGE_KEY, @@ -26657,7 +26222,7 @@ function resolveAliasValue(ctx, value) { return ctx && isAlias(value) ? value.resolve(ctx.doc, ctx) : value; } -// ../arcrun/mcp/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js function addPairToJSMap(ctx, map2, { key, value }) { if (isNode(key) && key.addToJSMap) key.addToJSMap(ctx, map2, value); @@ -26710,7 +26275,7 @@ function stringifyKey(key, jsKey, ctx) { return JSON.stringify(jsKey); } -// ../arcrun/mcp/node_modules/yaml/browser/dist/nodes/Pair.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/nodes/Pair.js function createPair(key, value, ctx) { const k = createNode(key, void 0, ctx); const v = createNode(value, void 0, ctx); @@ -26739,7 +26304,7 @@ var Pair = class _Pair { } }; -// ../arcrun/mcp/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/stringify/stringifyCollection.js function stringifyCollection(collection, ctx, options) { const flow = ctx.inFlow ?? collection.flow; const stringify4 = flow ? stringifyFlowCollection : stringifyBlockCollection; @@ -26881,7 +26446,7 @@ function addCommentBefore({ indent, options: { commentString } }, lines, comment } } -// ../arcrun/mcp/node_modules/yaml/browser/dist/nodes/YAMLMap.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/nodes/YAMLMap.js function findPair(items, key) { const k = isScalar(key) ? key.value : key; for (const it of items) { @@ -27012,7 +26577,7 @@ var YAMLMap = class extends Collection { } }; -// ../arcrun/mcp/node_modules/yaml/browser/dist/schema/common/map.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/common/map.js var map = { collection: "map", default: true, @@ -27026,7 +26591,7 @@ var map = { createNode: (schema4, obj, ctx) => YAMLMap.from(schema4, obj, ctx) }; -// ../arcrun/mcp/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/nodes/YAMLSeq.js var YAMLSeq = class extends Collection { static get tagName() { return "tag:yaml.org,2002:seq"; @@ -27130,7 +26695,7 @@ function asItemIndex(key) { return typeof idx === "number" && Number.isInteger(idx) && idx >= 0 ? idx : null; } -// ../arcrun/mcp/node_modules/yaml/browser/dist/schema/common/seq.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/common/seq.js var seq = { collection: "seq", default: true, @@ -27144,7 +26709,7 @@ var seq = { createNode: (schema4, obj, ctx) => YAMLSeq.from(schema4, obj, ctx) }; -// ../arcrun/mcp/node_modules/yaml/browser/dist/schema/common/string.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/common/string.js var string3 = { identify: (value) => typeof value === "string", default: true, @@ -27156,7 +26721,7 @@ var string3 = { } }; -// ../arcrun/mcp/node_modules/yaml/browser/dist/schema/common/null.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/common/null.js var nullTag = { identify: (value) => value == null, createNode: () => new Scalar(null), @@ -27167,7 +26732,7 @@ var nullTag = { stringify: ({ source }, ctx) => typeof source === "string" && nullTag.test.test(source) ? source : ctx.options.nullStr }; -// ../arcrun/mcp/node_modules/yaml/browser/dist/schema/core/bool.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/core/bool.js var boolTag = { identify: (value) => typeof value === "boolean", default: true, @@ -27184,7 +26749,7 @@ var boolTag = { } }; -// ../arcrun/mcp/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/stringify/stringifyNumber.js function stringifyNumber({ format, minFractionDigits, tag, value }) { if (typeof value === "bigint") return String(value); @@ -27205,7 +26770,7 @@ function stringifyNumber({ format, minFractionDigits, tag, value }) { return n; } -// ../arcrun/mcp/node_modules/yaml/browser/dist/schema/core/float.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/core/float.js var floatNaN = { identify: (value) => typeof value === "number", default: true, @@ -27241,7 +26806,7 @@ var float = { stringify: stringifyNumber }; -// ../arcrun/mcp/node_modules/yaml/browser/dist/schema/core/int.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/core/int.js var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value); var intResolve = (str, offset, radix, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str.substring(offset), radix); function intStringify(node, radix, prefix) { @@ -27277,7 +26842,7 @@ var intHex = { stringify: (node) => intStringify(node, 16, "0x") }; -// ../arcrun/mcp/node_modules/yaml/browser/dist/schema/core/schema.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/core/schema.js var schema = [ map, seq, @@ -27292,7 +26857,7 @@ var schema = [ float ]; -// ../arcrun/mcp/node_modules/yaml/browser/dist/schema/json/schema.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/json/schema.js function intIdentify2(value) { return typeof value === "bigint" || Number.isInteger(value); } @@ -27350,7 +26915,7 @@ var jsonError = { }; var schema2 = [map, seq].concat(jsonScalars, jsonError); -// ../arcrun/mcp/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js var binary = { identify: (value) => value instanceof Uint8Array, // Buffer inherits from Uint8Array @@ -27403,7 +26968,7 @@ var binary = { } }; -// ../arcrun/mcp/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js function resolvePairs(seq2, onError) { if (isSeq(seq2)) { for (let i = 0; i < seq2.items.length; ++i) { @@ -27469,7 +27034,7 @@ var pairs = { createNode: createPairs }; -// ../arcrun/mcp/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js var YAMLOMap = class _YAMLOMap extends YAMLSeq { constructor() { super(); @@ -27535,7 +27100,7 @@ var omap = { createNode: (schema4, iterable, ctx) => YAMLOMap.from(schema4, iterable, ctx) }; -// ../arcrun/mcp/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js function boolStringify({ value, source }, ctx) { const boolObj = value ? trueTag : falseTag; if (source && boolObj.test.test(source)) @@ -27559,7 +27124,7 @@ var falseTag = { stringify: boolStringify }; -// ../arcrun/mcp/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js var floatNaN2 = { identify: (value) => typeof value === "number", default: true, @@ -27598,7 +27163,7 @@ var float2 = { stringify: stringifyNumber }; -// ../arcrun/mcp/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js var intIdentify3 = (value) => typeof value === "bigint" || Number.isInteger(value); function intResolve2(str, offset, radix, { intAsBigInt }) { const sign = str[0]; @@ -27667,7 +27232,7 @@ var intHex2 = { stringify: (node) => intStringify2(node, 16, "0x") }; -// ../arcrun/mcp/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js var YAMLSet = class _YAMLSet extends YAMLMap { constructor(schema4) { super(schema4); @@ -27746,7 +27311,7 @@ var set = { } }; -// ../arcrun/mcp/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js function parseSexagesimal(str, asBigInt) { const sign = str[0]; const parts = sign === "-" || sign === "+" ? str.substring(1) : str; @@ -27825,7 +27390,7 @@ var timestamp = { stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\.000Z$/, "") ?? "" }; -// ../arcrun/mcp/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js var schema3 = [ map, seq, @@ -27850,7 +27415,7 @@ var schema3 = [ timestamp ]; -// ../arcrun/mcp/node_modules/yaml/browser/dist/schema/tags.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/tags.js var schemas = /* @__PURE__ */ new Map([ ["core", schema], ["failsafe", [map, seq, string3]], @@ -27921,7 +27486,7 @@ function getTags(customTags, schemaName, addMergeTag) { }, []); } -// ../arcrun/mcp/node_modules/yaml/browser/dist/schema/Schema.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/Schema.js var sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0; var Schema = class _Schema { constructor({ compat, customTags, merge: merge3, resolveKnownTags, schema: schema4, sortMapEntries, toStringDefaults }) { @@ -27942,7 +27507,7 @@ var Schema = class _Schema { } }; -// ../arcrun/mcp/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/stringify/stringifyDocument.js function stringifyDocument(doc, options) { const lines = []; let hasDirectives = options.directives === true; @@ -28013,7 +27578,7 @@ function stringifyDocument(doc, options) { return lines.join("\n") + "\n"; } -// ../arcrun/mcp/node_modules/yaml/browser/dist/doc/Document.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/doc/Document.js var Document = class _Document { constructor(value, replacer, options) { this.commentBefore = null; @@ -28305,7 +27870,7 @@ function assertCollection(contents) { throw new Error("Expected a YAML collection as document contents"); } -// ../arcrun/mcp/node_modules/yaml/browser/dist/errors.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/errors.js var YAMLError = class extends Error { constructor(name, pos, code, message) { super(); @@ -28361,7 +27926,7 @@ ${pointer} } }; -// ../arcrun/mcp/node_modules/yaml/browser/dist/compose/resolve-props.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/resolve-props.js function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) { let spaceBefore = false; let atNewline = startOnNewline; @@ -28489,7 +28054,7 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIn }; } -// ../arcrun/mcp/node_modules/yaml/browser/dist/compose/util-contains-newline.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/util-contains-newline.js function containsNewline(key) { if (!key) return null; @@ -28525,7 +28090,7 @@ function containsNewline(key) { } } -// ../arcrun/mcp/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js function flowIndentCheck(indent, fc, onError) { if (fc?.type === "flow-collection") { const end = fc.end[0]; @@ -28536,7 +28101,7 @@ function flowIndentCheck(indent, fc, onError) { } } -// ../arcrun/mcp/node_modules/yaml/browser/dist/compose/util-map-includes.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/util-map-includes.js function mapIncludes(ctx, items, search) { const { uniqueKeys } = ctx.options; if (uniqueKeys === false) @@ -28545,7 +28110,7 @@ function mapIncludes(ctx, items, search) { return items.some((pair) => isEqual(pair.key, search)); } -// ../arcrun/mcp/node_modules/yaml/browser/dist/compose/resolve-block-map.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/resolve-block-map.js var startColMsg = "All mapping items must start at the same column"; function resolveBlockMap({ composeNode: composeNode2, composeEmptyNode: composeEmptyNode2 }, ctx, bm, onError, tag) { const NodeClass = tag?.nodeClass ?? YAMLMap; @@ -28641,7 +28206,7 @@ function resolveBlockMap({ composeNode: composeNode2, composeEmptyNode: composeE return map2; } -// ../arcrun/mcp/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/resolve-block-seq.js function resolveBlockSeq({ composeNode: composeNode2, composeEmptyNode: composeEmptyNode2 }, ctx, bs, onError, tag) { const NodeClass = tag?.nodeClass ?? YAMLSeq; const seq2 = new NodeClass(ctx.schema); @@ -28683,7 +28248,7 @@ function resolveBlockSeq({ composeNode: composeNode2, composeEmptyNode: composeE return seq2; } -// ../arcrun/mcp/node_modules/yaml/browser/dist/compose/resolve-end.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/resolve-end.js function resolveEnd(end, offset, reqSpace, onError) { let comment = ""; if (end) { @@ -28720,7 +28285,7 @@ function resolveEnd(end, offset, reqSpace, onError) { return { comment, offset }; } -// ../arcrun/mcp/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js var blockMsg = "Block collections are not allowed within flow collections"; var isBlock = (token) => token && (token.type === "block-map" || token.type === "block-seq"); function resolveFlowCollection({ composeNode: composeNode2, composeEmptyNode: composeEmptyNode2 }, ctx, fc, onError, tag) { @@ -28900,7 +28465,7 @@ function resolveFlowCollection({ composeNode: composeNode2, composeEmptyNode: co return coll; } -// ../arcrun/mcp/node_modules/yaml/browser/dist/compose/compose-collection.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/compose-collection.js function resolveCollection(CN2, ctx, token, onError, tagName, tag) { const coll = token.type === "block-map" ? resolveBlockMap(CN2, ctx, token, onError, tag) : token.type === "block-seq" ? resolveBlockSeq(CN2, ctx, token, onError, tag) : resolveFlowCollection(CN2, ctx, token, onError, tag); const Coll = coll.constructor; @@ -28952,7 +28517,7 @@ function composeCollection(CN2, ctx, token, props, onError) { return node; } -// ../arcrun/mcp/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js function resolveBlockScalar(ctx, scalar, onError) { const start = scalar.offset; const header = parseBlockScalarHeader(scalar, ctx.options.strict, onError); @@ -29128,7 +28693,7 @@ function splitLines(source) { return lines; } -// ../arcrun/mcp/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js function resolveFlowScalar(scalar, strict, onError) { const { offset, type, source, end } = scalar; let _type; @@ -29340,7 +28905,7 @@ function parseCharCode(source, offset, length, onError) { } } -// ../arcrun/mcp/node_modules/yaml/browser/dist/compose/compose-scalar.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/compose-scalar.js function composeScalar(ctx, token, tagToken, onError) { const { value, type, comment, range } = token.type === "block-scalar" ? resolveBlockScalar(ctx, token, onError) : resolveFlowScalar(token, ctx.options.strict, onError); const tagName = tagToken ? ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg)) : null; @@ -29411,7 +28976,7 @@ function findScalarTagByTest({ atKey, directives, schema: schema4 }, value, toke return tag; } -// ../arcrun/mcp/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js function emptyScalarPosition(offset, before, pos) { if (before) { pos ?? (pos = before.length); @@ -29435,7 +29000,7 @@ function emptyScalarPosition(offset, before, pos) { return offset; } -// ../arcrun/mcp/node_modules/yaml/browser/dist/compose/compose-node.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/compose-node.js var CN = { composeNode, composeEmptyNode }; function composeNode(ctx, token, props, onError) { const atKey = ctx.atKey; @@ -29528,7 +29093,7 @@ function composeAlias({ options }, { offset, source, end }, onError) { return alias; } -// ../arcrun/mcp/node_modules/yaml/browser/dist/compose/compose-doc.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/compose-doc.js function composeDoc(options, directives, { offset, start, value, end }, onError) { const opts = Object.assign({ _directives: directives }, options); const doc = new Document(void 0, opts); @@ -29561,7 +29126,7 @@ function composeDoc(options, directives, { offset, start, value, end }, onError) return doc; } -// ../arcrun/mcp/node_modules/yaml/browser/dist/compose/composer.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/composer.js function getErrorPos(src) { if (typeof src === "number") return [src, src + 1]; @@ -29754,7 +29319,7 @@ ${end.comment}` : end.comment; } }; -// ../arcrun/mcp/node_modules/yaml/browser/dist/parse/cst-visit.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/parse/cst-visit.js var BREAK2 = /* @__PURE__ */ Symbol("break visit"); var SKIP2 = /* @__PURE__ */ Symbol("skip children"); var REMOVE2 = /* @__PURE__ */ Symbol("remove item"); @@ -29810,7 +29375,7 @@ function _visit(path, item, visitor) { return typeof ctrl === "function" ? ctrl(item, path) : ctrl; } -// ../arcrun/mcp/node_modules/yaml/browser/dist/parse/cst.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/parse/cst.js var BOM = "\uFEFF"; var DOCUMENT = ""; var FLOW_END = ""; @@ -29875,7 +29440,7 @@ function tokenType(source) { return null; } -// ../arcrun/mcp/node_modules/yaml/browser/dist/parse/lexer.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/parse/lexer.js function isEmpty(ch) { switch (ch) { case void 0: @@ -30457,7 +30022,7 @@ var Lexer = class { } }; -// ../arcrun/mcp/node_modules/yaml/browser/dist/parse/line-counter.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/parse/line-counter.js var LineCounter = class { constructor() { this.lineStarts = []; @@ -30482,7 +30047,7 @@ var LineCounter = class { } }; -// ../arcrun/mcp/node_modules/yaml/browser/dist/parse/parser.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/parse/parser.js function includesToken(list, type) { for (let i = 0; i < list.length; ++i) if (list[i].type === type) @@ -31345,7 +30910,7 @@ var Parser = class { } }; -// ../arcrun/mcp/node_modules/yaml/browser/dist/public-api.js +// ../../matrix/arcrun/mcp/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/public-api.js function parseOptions(options) { const prettyErrors = options.prettyErrors !== false; const lineCounter = options.lineCounter || prettyErrors && new LineCounter() || null; @@ -31390,7 +30955,7 @@ function parse3(src, reviver, options) { return doc.toJS(Object.assign({ reviver: _reviver }, options)); } -// ../arcrun/mcp/src/tools/arcrun_workflow_crud.ts +// ../../matrix/arcrun/mcp/src/tools/arcrun_workflow_crud.ts var apiKeyDesc2 = "\u4F60\uFF08\u7528\u6236\uFF09\u7684 arcrun api_key (ak_xxx)\u3002\u5F9E https://arcrun.dev/me \u53D6\u5F97"; function registerPushWorkflow(server, env) { server.tool( @@ -31692,7 +31257,7 @@ function registerAllWorkflowCrudTools(server, env) { registerRunWorkflow(server, env); } -// ../arcrun/mcp/src/tools/arcrun_skills_examples.ts +// ../../matrix/arcrun/mcp/src/tools/arcrun_skills_examples.ts async function kbdbList(env, entryType, limit = 100) { const resp = await kbdbFetch(env, `/entries?entry_type=${encodeURIComponent(entryType)}&limit=${limit}`); if (!resp.ok) throw new Error(`KBDB list entry_type=${entryType} HTTP ${resp.status}`); @@ -31945,7 +31510,7 @@ function registerAllSkillExampleTools(server, env) { registerSearchExamples(server, env); } -// ../arcrun/mcp/src/tools/arcrun_recipe.ts +// ../../matrix/arcrun/mcp/src/tools/arcrun_recipe.ts var apiKeyDesc3 = "\u4F60\uFF08\u7528\u6236\uFF09\u7684 arcrun api_key (ak_xxx)\u3002\u5F9E https://arcrun.dev/me \u53D6\u5F97"; function registerAllRecipeTools(server, env) { registerRecipeSearch(server, env); @@ -32143,7 +31708,7 @@ function registerRecipeDelete(server, env) { ); } -// ../arcrun/mcp/src/tools/kbdb_data.ts +// ../../matrix/arcrun/mcp/src/tools/kbdb_data.ts function registerAllKbdbDataTools(server, env) { registerCreateTemplate(server, env); registerListTemplates(server, env); @@ -32298,7 +31863,7 @@ function registerSearch(server, env) { ); } -// ../arcrun/mcp/src/tools/kbdb_graph.ts +// ../../matrix/arcrun/mcp/src/tools/kbdb_graph.ts var GRAPH_NEIGHBORS_WORKFLOW = "graph_neighbors"; var INSTALL_HINTS = [ `graph \u67E5\u8A62\u7531\u300C${GRAPH_NEIGHBORS_WORKFLOW}\u300Dworkflow \u627F\u8F09\uFF08\u8584\u6BBC\u8A2D\u8A08\uFF0CMCP \u672C\u8EAB\u4E0D\u7B97\u5716\uFF09`, @@ -32399,7 +31964,7 @@ function registerGraphNeighbors(server, env, orgNamespace) { ); } -// ../arcrun/mcp/src/lib/library-map.ts +// ../../matrix/arcrun/mcp/src/lib/library-map.ts function parseSlotArray(raw2) { if (Array.isArray(raw2)) return raw2; if (typeof raw2 === "string") { @@ -32466,7 +32031,7 @@ async function buildLibraryMapInstructions(env) { return text; } -// ../arcrun/mcp/src/tools/kbdb_map.ts +// ../../matrix/arcrun/mcp/src/tools/kbdb_map.ts var RECOMPUTE_HINTS = [ "\u5730\u5716\u6BCF\u6B21\u67E5\u8A62\u90FD\u6703\u81EA\u52D5\u6838\u5C0D\u5373\u6642\u4E09\u5143\u7D44\u6578\u4E26\u91CD\u7B97\u904E\u671F\u7684\u5EAB\uFF0C\u4E0D\u5FC5\u624B\u52D5\u8655\u7406", "\u5C11\u898B\u60C5\u6CC1\uFF08\u820A\u4E09\u5143\u7D44\u6C92\u6709 library \u6A19\u8A18\uFF09\u624D\u9700\u8981\u624B\u52D5\uFF1APOST /map/recompute?library=<\u5EAB\u540D>\uFF08\u53EF\u5E36 body {narrative, source_prefix}\uFF09" @@ -32552,7 +32117,7 @@ function registerGetMap(server, env) { ); } -// ../arcrun/mcp/src/tools/arcrun_whoami.ts +// ../../matrix/arcrun/mcp/src/tools/arcrun_whoami.ts function registerWhoami(server, env, orgNamespace) { server.tool( toolName("whoami"), @@ -32572,7 +32137,7 @@ function registerWhoami(server, env, orgNamespace) { ); } -// ../arcrun/mcp/src/tools/registry.ts +// ../../matrix/arcrun/mcp/src/tools/registry.ts function registerAllTools(server, env, orgNamespace, partnerToken) { registerSearchComponents(server, env, orgNamespace); registerSearchWorkflows(server, env, orgNamespace, partnerToken); @@ -32595,7 +32160,7 @@ function registerAllTools(server, env, orgNamespace, partnerToken) { registerWhoami(server, env, orgNamespace); } -// ../arcrun/mcp/src/mcp-handler.ts +// ../../matrix/arcrun/mcp/src/mcp-handler.ts async function handleMcpRequest(request, env, orgNamespace, partnerToken) { const mapInstructions = await buildLibraryMapInstructions(env); const startHere = [ @@ -32643,7 +32208,7 @@ ${mapInstructions}` : startHere; return transport.handleRequest(request); } -// ../arcrun/mcp/src/pages/inspector.ts +// ../../matrix/arcrun/mcp/src/pages/inspector.ts var inspectorHtml = ` @@ -33303,7 +32868,7 @@ var inspectorHtml = ` `; -// ../arcrun/mcp/src/oauth/consent.ts +// ../../matrix/arcrun/mcp/src/oauth/consent.ts function esc2(s) { return s.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'"); } @@ -33366,7 +32931,7 @@ function consentPage(p, error2) { `; } -// ../arcrun/mcp/src/oauth/routes.ts +// ../../matrix/arcrun/mcp/src/oauth/routes.ts var DEFAULT_TOKEN_TTL = 2592e3; var DEFAULT_REDIRECT_HOSTS = ["claude.ai", "claude.com", "anthropic.com"]; var CORS_JSON = { @@ -33625,7 +33190,7 @@ function registerOAuthRoutes(app2) { }); } -// ../arcrun/mcp/src/index.ts +// ../../matrix/arcrun/mcp/src/index.ts var _app = new Hono2(); registerOAuthRoutes(_app); _app.get("/health", (c) => c.json({ @@ -33827,16 +33392,7 @@ app.post("/", partnerAuthMiddleware, async (c) => { const partnerToken = c.get("partner_token"); return handleMcpRequest(c.req.raw, c.env, orgNamespace, partnerToken); }); -var src_default = _app; +var index_default = _app; export { - src_default as default + index_default as default }; -/*! Bundled license information: - -content-type/index.js: - (*! - * content-type - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - *) -*/ diff --git a/manifest.json b/manifest.json index 108c349..59ba021 100644 --- a/manifest.json +++ b/manifest.json @@ -8,7 +8,7 @@ "canonical": null, "main_module": "worker.mjs", "main_file": "arcrun-cypher-executor/worker.mjs", - "js_bytes": 561466, + "js_bytes": 564132, "modules": [], "compat_date": "2025-02-19", "compat_flags": [ @@ -50,15 +50,15 @@ "services": 13 }, "warnings": [], - "sha256": "3608c7fa32978d899f33c8a1d7333e318b74961a8442ea51dfcec15eb8f0a3a7", - "bytes": 561466 + "sha256": "b9ff5f63430accd2d345389481dcd72fc3a57a6c3b3f856e67c6c750028501b2", + "bytes": 564132 }, { "name": "arcrun-kbdb", "canonical": null, "main_module": "worker.mjs", "main_file": "arcrun-kbdb/worker.mjs", - "js_bytes": 131757, + "js_bytes": 132667, "modules": [], "compat_date": "2025-02-19", "compat_flags": [ @@ -79,15 +79,15 @@ } }, "warnings": [], - "sha256": "746ff6ef0d95f1219b087e7ffec009c43927672709e695c1338869845136b500", - "bytes": 131757 + "sha256": "b9b95766282ef409c882174c59445cdffd2f6c238f669cefe37f128c7c7b2762", + "bytes": 132667 }, { "name": "arcrun-http-request", "canonical": "http_request", "main_module": "worker.mjs", "main_file": "arcrun-http-request/worker.mjs", - "js_bytes": 81652, + "js_bytes": 80519, "modules": [ { "name": "component.wasm", @@ -111,15 +111,15 @@ } }, "warnings": [], - "sha256": "fd09d013646512238ce825650ae1ba365f8240eae4e5aae1c72bcde97a772ef2", - "bytes": 81652 + "sha256": "8a175938bf1c98b8dce489ff3085a13f512a5bf18edd0d148233177ce8a20e21", + "bytes": 80519 }, { "name": "arcrun-code", "canonical": "code", "main_module": "worker.mjs", "main_file": "arcrun-code/worker.mjs", - "js_bytes": 154096, + "js_bytes": 154438, "modules": [ { "name": "quickjs.wasm", @@ -140,15 +140,15 @@ } }, "warnings": [], - "sha256": "12b86c277b13a03b0c0f53ccd438162c07d2d0c105568a56c90e7e95d4c273d4", - "bytes": 154096 + "sha256": "761acc054b6f01bc2c37dce3b5923cd40d4ac8ac986bc0452f36e16463299a74", + "bytes": 154438 }, { "name": "arcrun-mcp", "canonical": null, "main_module": "worker.mjs", "main_file": "arcrun-mcp/worker.mjs", - "js_bytes": 1174326, + "js_bytes": 1172208, "modules": [], "compat_date": "2024-11-27", "compat_flags": [ @@ -164,8 +164,8 @@ "vars": {} }, "warnings": [], - "sha256": "dc71ac23cd60f1207b969e8cca7e0fb402a282bc2daccdca19ca0a5e0ca682b3", - "bytes": 1174326 + "sha256": "886ba67cd1b99f710f4f439845967b4a92542e716d52fe5ea21e623c33016cdd", + "bytes": 1172208 }, { "name": "arcrun-rag-ui", @@ -202,8 +202,8 @@ "sha256": "782a3b2212884f789e1725f82046cf34ef6bb02e1a8b585cab8e4ae6c6e441ca" } }, - "release": "1.4.32", + "release": "1.4.33", "built_for": "oauth-installer-lazy-load", "notes": [], - "fingerprint": "dcb17d391c5d5597558c694e2b209da55ca080aade9f98da2ccf133beade1216" + "fingerprint": "4fb344a0466fb8ca13480d1f71e012f2858d08683e580e35e612097864fbdacc" }