ship 1.4.32:Arcrun@eebb691

This commit is contained in:
ship
2026-08-10 14:25:55 +00:00
parent 595a7c607e
commit c698ad4e41
8 changed files with 34467 additions and 484 deletions
+19
View File
@@ -0,0 +1,19 @@
# Arcrun RAG — install bundles
Prebuilt worker/service bundles for the **Arcrun RAG** one-click installer.
Served via jsDelivr; fetched automatically during install — you never need to read this repo.
- `manifest.json` — schema `arcrun-rag-bundles/v1`6 components,逐顆見下)
- `arcrun-cypher-executor/`**arcrun-cypher-executor**
- `arcrun-kbdb/`**arcrun-kbdb**
- `arcrun-http-request/`**arcrun-http-request**
- `arcrun-code/`**arcrun-code**
- `tier2/ui/`**arcrun-rag-ui**
- `arcrun-mcp/`**arcrun-mcp**
- `daemon/` — 桌面 AppMacWindows)安裝檔
Built from `Arcrun@eebb691` by `installer/scripts/ship.mjs`arcrun-rag reporelease 1.4.32built 2026-08-10)。
⚠️ 這份檔案由出貨管線每次自動重寫(`installer/scripts/render-bundles-readme.mjs`)——
不要手動改這裡列的零件清單,要改就改 `installer/scripts/bundle-components.mjs`(唯一真相源,改一個地方兩條出貨路徑同時生效)。
+36 -36
View File
@@ -13,10 +13,10 @@ var __export = (target, all) => {
__defProp(target, name, { get: all[name], enumerable: true });
};
// ../../matrix/arcrun/registry/components/code/node_modules/@jitl/quickjs-ffi-types/dist/index.mjs
// ../arcrun/registry/components/code/node_modules/@jitl/quickjs-ffi-types/dist/index.mjs
var EvalFlags, IntrinsicsFlags, JSPromiseStateEnum, GetOwnPropertyNamesFlags, IsEqualOp;
var init_dist = __esm({
"../../matrix/arcrun/registry/components/code/node_modules/@jitl/quickjs-ffi-types/dist/index.mjs"() {
"../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({
}
});
// ../../matrix/arcrun/registry/components/code/node_modules/quickjs-emscripten-core/dist/chunk-JTKJZQYV.mjs
// ../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({
"../../matrix/arcrun/registry/components/code/node_modules/quickjs-emscripten-core/dist/chunk-JTKJZQYV.mjs"() {
"../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:`);
}
});
// ../../matrix/arcrun/registry/components/code/node_modules/quickjs-emscripten-core/dist/module-6F3E5H7Y.mjs
// ../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({
"../../matrix/arcrun/registry/components/code/node_modules/quickjs-emscripten-core/dist/module-6F3E5H7Y.mjs"() {
"../arcrun/registry/components/code/node_modules/quickjs-emscripten-core/dist/module-6F3E5H7Y.mjs"() {
init_chunk_JTKJZQYV();
}
});
// ../../matrix/arcrun/registry/components/code/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.mjs
// ../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({
"../../matrix/arcrun/registry/components/code/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.mjs"() {
"../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({
}
});
// ../../matrix/arcrun/registry/components/code/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.browser.mjs
// ../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({
"../../matrix/arcrun/registry/components/code/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.browser.mjs"() {
"../arcrun/registry/components/code/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.browser.mjs"() {
emscripten_module_browser_default = QuickJSRaw;
}
});
// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/compose.js
// ../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) => {
};
};
// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/request/constants.js
// ../arcrun/registry/components/code/node_modules/hono/dist/request/constants.js
var GET_MATCH_RESULT = /* @__PURE__ */ Symbol();
// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/utils/body.js
// ../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) => {
});
};
// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/utils/url.js
// ../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;
// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/request.js
// ../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 {
}
};
// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/utils/html.js
// ../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) =>
}
};
// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/context.js
// ../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 {
};
};
// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/router.js
// ../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 {
};
// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/utils/constants.js
// ../arcrun/registry/components/code/node_modules/hono/dist/utils/constants.js
var COMPOSED_HANDLER = "__COMPOSED_HANDLER";
// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/hono-base.js
// ../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 {
};
};
// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/router/reg-exp-router/matcher.js
// ../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);
}
// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/router/reg-exp-router/node.js
// ../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 {
}
};
// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/router/reg-exp-router/trie.js
// ../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 {
}
};
// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/router/reg-exp-router/router.js
// ../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 {
}
};
// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/router/smart-router/router.js
// ../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 {
}
};
// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/router/trie-router/node.js
// ../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 {
}
};
// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/router/trie-router/router.js
// ../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 {
}
};
// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/hono.js
// ../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 {
}
};
// ../../matrix/arcrun/registry/components/code/node_modules/hono/dist/middleware/cors/index.js
// ../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) => {
};
};
// ../../matrix/arcrun/registry/components/code/node_modules/quickjs-emscripten-core/dist/index.mjs
// ../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) {
} };
}
// ../../matrix/arcrun/registry/components/code/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.mjs
// ../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;
// ../../matrix/arcrun/registry/components/code/index.ts
// ../arcrun/registry/components/code/index.ts
import wasmModule from "./quickjs.wasm";
// ../../matrix/arcrun/registry/components/code/sandbox.mjs
// ../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 };
}
// ../../matrix/arcrun/registry/components/code/index.ts
// ../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 index_default = app;
var code_default = app;
export {
index_default as default
code_default as default
};
File diff suppressed because it is too large Load Diff
+269 -223
View File
@@ -1,7 +1,7 @@
// ../../matrix/arcrun/.component-builds/http_request/src/index.ts
// ../arcrun/.component-builds/http_request/src/index.ts
import componentWasm from "./component.wasm";
// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/compose.js
// ../arcrun/.component-builds/http_request/node_modules/hono/dist/compose.js
var compose = (middleware, onError, onNotFound) => {
return (context, next) => {
let index = -1;
@@ -45,21 +45,46 @@ var compose = (middleware, onError, onNotFound) => {
};
};
// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/request/constants.js
// ../arcrun/.component-builds/http_request/node_modules/hono/dist/request/constants.js
var GET_MATCH_RESULT = /* @__PURE__ */ Symbol();
// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/utils/body.js
// ../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;
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;
const headers = isRawRequest(request) ? request.headers : request.raw.headers;
const contentType = headers.get("Content-Type");
if (contentType?.startsWith("multipart/form-data") || contentType?.startsWith("application/x-www-form-urlencoded")) {
const mediaType = contentType?.split(";")[0].trim().toLowerCase();
if (mediaType === "multipart/form-data" || mediaType === "application/x-www-form-urlencoded") {
return parseFormData(request, { all, dot });
}
return {};
};
async function parseFormData(request, options) {
const formData = await request.formData();
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;
if (formData) {
return convertFormDataToBodyData(formData, options);
}
@@ -120,7 +145,7 @@ var handleParsingNestedValues = (form, key, value) => {
});
};
// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/utils/url.js
// ../arcrun/.component-builds/http_request/node_modules/hono/dist/utils/url.js
var splitPath = (path) => {
const paths = path.split("/");
if (paths[0] === "") {
@@ -242,18 +267,16 @@ 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 value.indexOf("%") !== -1 ? tryDecode(value, decodeURIComponent_) : value;
return tryDecodeURIComponent(value);
};
var _getQueryParam = (url, key, multiple) => {
let encoded;
if (!multiple && key && !/[%+]/.test(key)) {
if (!multiple && key && key.indexOf("%") === -1 && key.indexOf("+") === -1) {
let keyIndex2 = url.indexOf("?", 8);
if (keyIndex2 === -1) {
return void 0;
@@ -277,7 +300,7 @@ var _getQueryParam = (url, key, multiple) => {
return void 0;
}
}
const results = {};
const results = /* @__PURE__ */ Object.create(null);
encoded ??= /[%+]/.test(url);
let keyIndex = url.indexOf("?", 8);
while (keyIndex !== -1) {
@@ -324,8 +347,7 @@ var getQueryParams = (url, key) => {
};
var decodeURIComponent_ = decodeURIComponent;
// ../../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_);
// ../arcrun/.component-builds/http_request/node_modules/hono/dist/request.js
var HonoRequest = class {
/**
* `.raw` can get the raw Request object.
@@ -364,7 +386,6 @@ var HonoRequest = class {
this.raw = request;
this.path = path;
this.#matchResult = matchResult;
this.#validatedData = {};
}
param(key) {
return key ? this.#getDecodedParam(key) : this.#getAllDecodedParams();
@@ -372,7 +393,7 @@ var HonoRequest = class {
#getDecodedParam(key) {
const paramKey = this.#matchResult[0][this.routeIndex][1][key];
const param = this.#getParamValue(paramKey);
return param && /\%/.test(param) ? tryDecodeURIComponent(param) : param;
return param && tryDecodeURIComponent(param);
}
#getAllDecodedParams() {
const decoded = {};
@@ -380,7 +401,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] = /\%/.test(value) ? tryDecodeURIComponent(value) : value;
decoded[key] = tryDecodeURIComponent(value);
}
}
return decoded;
@@ -398,7 +419,7 @@ var HonoRequest = class {
if (name) {
return this.raw.headers.get(name) ?? void 0;
}
const headerData = {};
const headerData = /* @__PURE__ */ Object.create(null);
this.raw.headers.forEach((value, key) => {
headerData[key] = value;
});
@@ -413,8 +434,7 @@ var HonoRequest = class {
if (cachedBody) {
return cachedBody;
}
const anyCachedKey = Object.keys(bodyCache)[0];
if (anyCachedKey) {
for (const anyCachedKey in bodyCache) {
return bodyCache[anyCachedKey].then((body) => {
if (anyCachedKey === "json") {
body = JSON.stringify(body);
@@ -469,6 +489,21 @@ 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
@@ -502,10 +537,11 @@ 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.
@@ -592,7 +628,7 @@ var HonoRequest = class {
}
};
// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/utils/html.js
// ../arcrun/.component-builds/http_request/node_modules/hono/dist/utils/html.js
var HtmlEscapedCallbackPhase = {
Stringify: 1,
BeforeStream: 2,
@@ -634,7 +670,7 @@ var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) =>
}
};
// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/context.js
// ../arcrun/.component-builds/http_request/node_modules/hono/dist/context.js
var TEXT_PLAIN = "text/plain; charset=UTF-8";
var setDefaultContentType = (contentType, headers) => {
return {
@@ -907,11 +943,11 @@ var Context = class {
return Object.fromEntries(this.#var);
}
#newResponse(data, arg, headers) {
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") {
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") {
responseHeaders.append(key, value);
} else {
responseHeaders.set(key, value);
@@ -919,19 +955,34 @@ var Context = class {
}
}
if (headers) {
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);
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);
}
}
}
}
}
const status = typeof arg === "number" ? arg : arg?.status ?? this.#status;
return createResponseInstance(data, { status, headers: responseHeaders });
return createResponseInstance(data, {
status,
headers: responseHeaders ?? headers
});
}
newResponse = (...args) => this.#newResponse(...args);
/**
@@ -1041,18 +1092,18 @@ var Context = class {
};
};
// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/router.js
// ../arcrun/.component-builds/http_request/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"];
var METHODS = ["get", "post", "put", "delete", "options", "patch", "query"];
var MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is already built.";
var UnsupportedPathError = class extends Error {
};
// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/utils/constants.js
// ../arcrun/.component-builds/http_request/node_modules/hono/dist/utils/constants.js
var COMPOSED_HANDLER = "__COMPOSED_HANDLER";
// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/hono-base.js
// ../arcrun/.component-builds/http_request/node_modules/hono/dist/hono-base.js
var notFoundHandler = (c) => {
return c.text("404 Not Found", 404);
};
@@ -1071,6 +1122,7 @@ var Hono = class _Hono {
delete;
options;
patch;
query;
all;
on;
use;
@@ -1167,7 +1219,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);
subApp.#addRoute(r.method, r.path, handler, r.basePath);
});
return this;
}
@@ -1291,7 +1343,7 @@ var Hono = class _Hono {
const pathPrefixLength = mergedPath === "/" ? 0 : mergedPath.length;
return (request) => {
const url = new URL(request.url);
url.pathname = url.pathname.slice(pathPrefixLength) || "/";
url.pathname = this.getPath(request).slice(pathPrefixLength) || "/";
return new Request(url, request);
};
})();
@@ -1305,10 +1357,15 @@ var Hono = class _Hono {
this.#addRoute(METHOD_NAME_ALL, mergePath(path, "*"), handler);
return this;
}
#addRoute(method, path, handler) {
#addRoute(method, path, handler, baseRoutePath) {
method = method.toUpperCase();
path = mergePath(this._basePath, path);
const r = { basePath: this._basePath, path, method, handler };
const r = {
basePath: baseRoutePath !== void 0 ? mergePath(this._basePath, baseRoutePath) : this._basePath,
path,
method,
handler
};
this.router.add(method, path, [handler, r]);
this.routes.push(r);
}
@@ -1365,8 +1422,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} - context of execution
* @param {Env} env - env Object
* @param {ExecutionContext} executionCtx - context of execution
* @returns {Response | Promise<Response>} response of request
*
*/
@@ -1423,7 +1480,7 @@ var Hono = class _Hono {
};
};
// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/router/reg-exp-router/matcher.js
// ../arcrun/.component-builds/http_request/node_modules/hono/dist/router/reg-exp-router/matcher.js
var emptyParam = [];
function match(method, path) {
const matchers = this.buildAllMatchers();
@@ -1444,7 +1501,7 @@ function match(method, path) {
return match2(method, path);
}
// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/router/reg-exp-router/node.js
// ../arcrun/.component-builds/http_request/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 = "(?:|/.*)";
@@ -1458,7 +1515,7 @@ function compareKey(a, b) {
return 1;
}
if (a === ONLY_WILDCARD_REG_EXP_STR || a === TAIL_WILDCARD_REG_EXP_STR) {
return 1;
return b === TAIL_WILDCARD_REG_EXP_STR ? -1 : 1;
} else if (b === ONLY_WILDCARD_REG_EXP_STR || b === TAIL_WILDCARD_REG_EXP_STR) {
return -1;
}
@@ -1470,76 +1527,75 @@ 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, 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;
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;
}
}
regexpStr = regexpStr.replace(/^\((?!\?:)(?=[^)]+\)$)/, "(?:");
if (/\((?!\?:)/.test(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();
}
}
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++;
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();
}
}
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();
}
node = nextNode;
}
node.insert(restTokens, index, paramMap, context, pathErrorCheckOnly);
if (node.#index !== void 0) {
throw PATH_ERROR;
}
node.#index = isStatic ? -1 : index;
}
buildRegExpStr() {
const childKeys = Object.keys(this.#children).sort(compareKey);
const strList = childKeys.map((k) => {
const c = this.#children[k];
return (typeof c.#varIndex === "number" ? `(${k})@${c.#varIndex}` : regExpMetaChars.has(k) ? `\\${k}` : k) + c.buildRegExpStr();
});
if (typeof this.#index === "number") {
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) {
strList.unshift(`#${this.#index}`);
}
if (strList.length === 0) {
@@ -1552,16 +1608,24 @@ var Node = class _Node {
}
};
// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/router/reg-exp-router/trie.js
// ../arcrun/.component-builds/http_request/node_modules/hono/dist/router/reg-exp-router/trie.js
var Trie = class {
#context = { varIndex: 0 };
#root = new Node();
insert(path, index, pathErrorCheckOnly) {
#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;
}
const paramAssoc = [];
const groups = [];
let markedPath = path;
for (let i = 0; ; ) {
let replaced = false;
path = path.replace(/\{[^}]+\}/g, (m) => {
markedPath = markedPath.replace(/\{[^}]+\}/g, (m) => {
const mark = `@\\${i}`;
groups[i] = [mark, m];
i++;
@@ -1572,7 +1636,7 @@ var Trie = class {
break;
}
}
const tokens = path.match(/(?::[^\/]+)|(?:\/\*$)|./g) || [];
const tokens = markedPath.match(/(?::[^\/]+)|(?:\/\*$)|./g) || [];
for (let i = groups.length - 1; i >= 0; i--) {
const [mark] = groups[i];
for (let j = tokens.length - 1; j >= 0; j--) {
@@ -1582,8 +1646,8 @@ var Trie = class {
}
}
}
this.#root.insert(tokens, index, paramAssoc, this.#context, pathErrorCheckOnly);
return paramAssoc;
this.#root.insert(tokens, this.#index, paramAssoc, this.#context, false);
this.paths[path] = [this.#index++, paramAssoc];
}
buildRegExp() {
let regexp = this.#root.buildRegExpStr();
@@ -1608,8 +1672,7 @@ var Trie = class {
}
};
// ../../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)];
// ../arcrun/.component-builds/http_request/node_modules/hono/dist/router/reg-exp-router/router.js
var wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
function buildWildcardRegExp(path) {
return wildcardRegExpCache[path] ??= new RegExp(
@@ -1622,63 +1685,6 @@ 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;
@@ -1694,9 +1700,18 @@ 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;
@@ -1705,11 +1720,12 @@ 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);
});
});
}
@@ -1719,13 +1735,12 @@ var RegExpRouter = class {
const paramCount = (path.match(/\/:/g) || []).length;
if (/\*$/.test(path)) {
const re = buildWildcardRegExp(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) && !middleware[m][path]) {
this.#insertPath(m, path);
middleware[m][path] = findMiddleware(middleware[m], 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) => {
@@ -1747,9 +1762,12 @@ var RegExpRouter = class {
const path2 = paths[i];
Object.keys(routes).forEach((m) => {
if (method === METHOD_NAME_ALL || method === m) {
routes[m][path2] ||= [
...findMiddleware(middleware[m], path2) || findMiddleware(middleware[METHOD_NAME_ALL], path2) || []
];
if (!routes[m][path2]) {
this.#insertPath(m, path2);
routes[m][path2] = [
...findMiddleware(middleware[m], path2) || findMiddleware(middleware[METHOD_NAME_ALL], path2) || []
];
}
routes[m][path2].push([handler, paramCount - len + i + 1]);
}
});
@@ -1761,33 +1779,58 @@ var RegExpRouter = class {
Object.keys(this.#routes).concat(Object.keys(this.#middleware)).forEach((method) => {
matchers[method] ||= this.#buildMatcher(method);
});
this.#middleware = this.#routes = void 0;
this.#middleware = this.#routes = this.#tries = void 0;
clearWildcardRegExpCache();
return matchers;
}
#buildMatcher(method) {
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 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];
});
}
});
if (!hasOwnRoute) {
return null;
} else {
return buildMatcherFromPreprocessedRoutes(routes);
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];
}
};
// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/router/smart-router/router.js
// ../arcrun/.component-builds/http_request/node_modules/hono/dist/router/smart-router/router.js
var SmartRouter = class {
name = "SmartRouter";
#routers = [];
@@ -1842,7 +1885,7 @@ var SmartRouter = class {
}
};
// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/router/trie-router/node.js
// ../arcrun/.component-builds/http_request/node_modules/hono/dist/router/trie-router/node.js
var emptyParams = /* @__PURE__ */ Object.create(null);
var hasChildren = (children) => {
for (const _ in children) {
@@ -1976,9 +2019,18 @@ 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(/\//)?.length ?? 0;
const componentCount = m[0].match(/\//g)?.length ?? 0;
const targetCurNodes = curNodesQueue[componentCount] ||= [];
targetCurNodes.push(child);
}
@@ -2017,7 +2069,7 @@ var Node2 = class _Node2 {
}
};
// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/router/trie-router/router.js
// ../arcrun/.component-builds/http_request/node_modules/hono/dist/router/trie-router/router.js
var TrieRouter = class {
name = "TrieRouter";
#node;
@@ -2039,7 +2091,7 @@ var TrieRouter = class {
}
};
// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/hono.js
// ../arcrun/.component-builds/http_request/node_modules/hono/dist/hono.js
var Hono2 = class extends Hono {
/**
* Creates an instance of the Hono class.
@@ -2054,24 +2106,18 @@ var Hono2 = class extends Hono {
}
};
// ../../matrix/arcrun/.component-builds/http_request/node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/middleware/cors/index.js
// ../arcrun/.component-builds/http_request/node_modules/hono/dist/middleware/cors/index.js
var cors = (options) => {
const defaults = {
origin: "*",
allowMethods: ["GET", "HEAD", "PUT", "POST", "DELETE", "PATCH"],
allowHeaders: [],
exposeHeaders: []
};
const opts = {
...defaults,
origin: "*",
allowMethods: ["GET", "HEAD", "PUT", "POST", "DELETE", "PATCH", "QUERY"],
allowHeaders: [],
exposeHeaders: [],
...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;
@@ -2106,7 +2152,7 @@ var cors = (options) => {
set("Access-Control-Expose-Headers", opts.exposeHeaders.join(","));
}
if (c.req.method === "OPTIONS") {
if (opts.origin !== "*" || opts.credentials) {
if (opts.origin !== "*") {
set("Vary", "Origin");
}
if (opts.maxAge != null) {
@@ -2120,7 +2166,7 @@ var cors = (options) => {
if (!headers?.length) {
const requestHeaders = c.req.header("Access-Control-Request-Headers");
if (requestHeaders) {
headers = requestHeaders.split(/\s*,\s*/);
headers = requestHeaders.split(",").map((h) => h.trim());
}
}
if (headers?.length) {
@@ -2136,13 +2182,13 @@ var cors = (options) => {
});
}
await next();
if (opts.origin !== "*" || opts.credentials) {
if (opts.origin !== "*") {
c.header("Vary", "Origin", { append: true });
}
};
};
// ../../matrix/arcrun/cypher-executor/src/lib/wasi-shim.ts
// ../arcrun/cypher-executor/src/lib/wasi-shim.ts
var WASI_ESUCCESS = 0;
var WASI_ENOSYS = 76;
var FD_STDIN = 0;
@@ -2501,7 +2547,7 @@ function createWasiShim(stdinData, hostFunctions) {
return shim;
}
// ../../matrix/arcrun/.component-builds/http_request/src/index.ts
// ../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" }));
@@ -2522,7 +2568,7 @@ app.post("/", async (c) => {
);
}
});
var index_default = app;
var src_default = app;
async function runWasm(input) {
const hostFunctions = {
http_request: async (url, method, headersJson, body) => {
@@ -2568,5 +2614,5 @@ async function runWasm(input) {
return JSON.parse(stdout);
}
export {
index_default as default
src_default as default
};
+45 -40
View File
@@ -1,4 +1,4 @@
// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/compose.js
// ../arcrun/kbdb/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) => {
};
};
// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/request/constants.js
// ../arcrun/kbdb/node_modules/hono/dist/request/constants.js
var GET_MATCH_RESULT = /* @__PURE__ */ Symbol();
// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/utils/body.js
// ../arcrun/kbdb/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) => {
});
};
// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/utils/url.js
// ../arcrun/kbdb/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;
// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/request.js
// ../arcrun/kbdb/node_modules/hono/dist/request.js
var tryDecodeURIComponent = (str) => tryDecode(str, decodeURIComponent_);
var HonoRequest = class {
/**
@@ -604,7 +604,7 @@ var HonoRequest = class {
}
};
// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/utils/html.js
// ../arcrun/kbdb/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) =>
}
};
// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/context.js
// ../arcrun/kbdb/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 {
};
};
// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router.js
// ../arcrun/kbdb/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 {
};
// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/utils/constants.js
// ../arcrun/kbdb/node_modules/hono/dist/utils/constants.js
var COMPOSED_HANDLER = "__COMPOSED_HANDLER";
// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/hono-base.js
// ../arcrun/kbdb/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 {
};
};
// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router/reg-exp-router/matcher.js
// ../arcrun/kbdb/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);
}
// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router/reg-exp-router/node.js
// ../arcrun/kbdb/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 {
}
};
// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router/reg-exp-router/trie.js
// ../arcrun/kbdb/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 {
}
};
// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router/reg-exp-router/router.js
// ../arcrun/kbdb/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 {
}
};
// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router/smart-router/router.js
// ../arcrun/kbdb/node_modules/hono/dist/router/smart-router/router.js
var SmartRouter = class {
name = "SmartRouter";
#routers = [];
@@ -1859,7 +1859,7 @@ var SmartRouter = class {
}
};
// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router/trie-router/node.js
// ../arcrun/kbdb/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 {
}
};
// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router/trie-router/router.js
// ../arcrun/kbdb/node_modules/hono/dist/router/trie-router/router.js
var TrieRouter = class {
name = "TrieRouter";
#node;
@@ -2056,7 +2056,7 @@ var TrieRouter = class {
}
};
// ../../matrix/arcrun/kbdb/node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/hono.js
// ../arcrun/kbdb/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 {
}
};
// ../../matrix/arcrun/kbdb/src/actions/entry-crud.ts
// ../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 ?? [];
}
// ../../matrix/arcrun/kbdb/src/embed.ts
// ../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 = {}) {
}));
}
// ../../matrix/arcrun/kbdb/src/actions/credential-legacy-migration.ts
// ../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);
}
// ../../matrix/arcrun/kbdb/src/routes/entries.ts
// ../arcrun/kbdb/src/routes/entries.ts
var entryRoutes = new Hono2();
function fireAndForget(c, p) {
let ctx;
@@ -2739,16 +2739,21 @@ entryRoutes.patch("/:id", async (c) => {
return c.json({ success: true, entry });
});
entryRoutes.delete("/:id", async (c) => {
const id = c.req.param("id");
let vector_deleted = null;
if (embedEnabled(c.env)) {
c.executionCtx.waitUntil(c.env.VECTORIZE.deleteByIds([c.req.param("id")]).then(() => {
}).catch(() => {
}));
try {
await c.env.VECTORIZE.deleteByIds([id]);
vector_deleted = true;
} catch {
vector_deleted = false;
}
}
await deleteEntry(c.env.DB, c.req.param("id"));
return c.json({ success: true });
await deleteEntry(c.env.DB, id);
return c.json({ success: true, vector_deleted });
});
// ../../matrix/arcrun/kbdb/src/actions/record-crud.ts
// ../arcrun/kbdb/src/actions/record-crud.ts
function uid2(prefix) {
return `${prefix}_${crypto.randomUUID()}`;
}
@@ -2881,7 +2886,7 @@ async function deleteRecord(db, recordId) {
return true;
}
// ../../matrix/arcrun/kbdb/src/routes/templates.ts
// ../arcrun/kbdb/src/routes/templates.ts
var templateRoutes = new Hono2();
templateRoutes.post("/", async (c) => {
const body = await c.req.json().catch(() => null);
@@ -2907,7 +2912,7 @@ templateRoutes.patch("/:id", async (c) => {
return c.json({ success: true, template: tpl });
});
// ../../matrix/arcrun/kbdb/src/routes/records.ts
// ../arcrun/kbdb/src/routes/records.ts
var recordRoutes = new Hono2();
recordRoutes.post("/", async (c) => {
const body = await c.req.json().catch(() => null);
@@ -2972,7 +2977,7 @@ recordRoutes.delete("/:recordId", async (c) => {
return c.json({ success: true });
});
// ../../matrix/arcrun/kbdb/src/actions/recipe-stat.ts
// ../arcrun/kbdb/src/actions/recipe-stat.ts
function statId(canonicalId) {
return `recipestat:${canonicalId}`;
}
@@ -3011,7 +3016,7 @@ function emptyStat(canonicalId) {
return { canonical_id: canonicalId, success_count: 0, failure_count: 0, last_status: null, last_at: null };
}
// ../../matrix/arcrun/kbdb/src/routes/recipe-stats.ts
// ../arcrun/kbdb/src/routes/recipe-stats.ts
var recipeStatRoutes = new Hono2();
recipeStatRoutes.post("/record", async (c) => {
const body = await c.req.json().catch(() => null);
@@ -3027,7 +3032,7 @@ recipeStatRoutes.get("/:canonical_id", async (c) => {
return c.json({ success: true, stat });
});
// ../../matrix/arcrun/kbdb/src/routes/embed.ts
// ../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) => {
@@ -3060,7 +3065,7 @@ embedRoutes.get("/selftest", async (c) => {
return c.json({ success: true, ...result });
});
// ../../matrix/arcrun/kbdb/src/actions/library-map.ts
// ../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 = [
@@ -3359,7 +3364,7 @@ async function getLibraryMapDetail(db, library, owner_id) {
};
}
// ../../matrix/arcrun/kbdb/src/routes/map.ts
// ../arcrun/kbdb/src/routes/map.ts
var mapRoutes = new Hono2();
mapRoutes.post("/recompute", async (c) => {
const body = await c.req.json().catch(() => ({}));
@@ -3397,7 +3402,7 @@ mapRoutes.get("/:library", async (c) => {
return c.json({ success: true, map });
});
// ../../matrix/arcrun/kbdb/src/actions/execution-log.ts
// ../arcrun/kbdb/src/actions/execution-log.ts
var SUCCESS_MESSAGE_MAX = 200;
var FAILED_MESSAGE_MAX = 2e3;
var TARGET_MAX = 300;
@@ -3568,7 +3573,7 @@ async function cleanupExpiredLogs(db) {
return { deleted, checked_overrides: overrides.length };
}
// ../../matrix/arcrun/kbdb/src/routes/execution-log.ts
// ../arcrun/kbdb/src/routes/execution-log.ts
var executionLogRoutes = new Hono2();
executionLogRoutes.post("/record", async (c) => {
const body = await c.req.json().catch(() => null);
@@ -3622,7 +3627,7 @@ executionLogRoutes.post("/cleanup", async (c) => {
return c.json({ success: true, ...result });
});
// ../../matrix/arcrun/kbdb/src/index.ts
// ../arcrun/kbdb/src/index.ts
var app = new Hono2();
app.use("*", async (c, next) => {
const path = new URL(c.req.url).pathname;
@@ -3647,7 +3652,7 @@ app.route("/recipe-stats", recipeStatRoutes);
app.route("/execution-log", executionLogRoutes);
app.route("/embed", embedRoutes);
app.route("/map", mapRoutes);
var index_default = app;
var src_default = app;
export {
index_default as default
src_default as default
};
+33842
View File
File diff suppressed because it is too large Load Diff
+41 -17
View File
@@ -1,14 +1,14 @@
{
"schema": 1,
"built": "2026-08-10",
"source": "Arcrun@c4cee35",
"source": "Arcrun@eebb691",
"core": [
{
"name": "arcrun-cypher-executor",
"canonical": null,
"main_module": "worker.mjs",
"main_file": "arcrun-cypher-executor/worker.mjs",
"js_bytes": 563077,
"js_bytes": 561466,
"modules": [],
"compat_date": "2025-02-19",
"compat_flags": [
@@ -50,15 +50,15 @@
"services": 13
},
"warnings": [],
"sha256": "8db22e7845349146bf08fcb0bf691e6d0bf2d370e8c9310d59c859678d7f9a24",
"bytes": 563077
"sha256": "3608c7fa32978d899f33c8a1d7333e318b74961a8442ea51dfcec15eb8f0a3a7",
"bytes": 561466
},
{
"name": "arcrun-kbdb",
"canonical": null,
"main_module": "worker.mjs",
"main_file": "arcrun-kbdb/worker.mjs",
"js_bytes": 132590,
"js_bytes": 131757,
"modules": [],
"compat_date": "2025-02-19",
"compat_flags": [
@@ -79,15 +79,15 @@
}
},
"warnings": [],
"sha256": "5eec50d5846b3d36194d891a5dd846247e0832d8d18d591e42f5fb9ea87519fe",
"bytes": 132590
"sha256": "746ff6ef0d95f1219b087e7ffec009c43927672709e695c1338869845136b500",
"bytes": 131757
},
{
"name": "arcrun-http-request",
"canonical": "http_request",
"main_module": "worker.mjs",
"main_file": "arcrun-http-request/worker.mjs",
"js_bytes": 80519,
"js_bytes": 81652,
"modules": [
{
"name": "component.wasm",
@@ -111,15 +111,15 @@
}
},
"warnings": [],
"sha256": "8a175938bf1c98b8dce489ff3085a13f512a5bf18edd0d148233177ce8a20e21",
"bytes": 80519
"sha256": "fd09d013646512238ce825650ae1ba365f8240eae4e5aae1c72bcde97a772ef2",
"bytes": 81652
},
{
"name": "arcrun-code",
"canonical": "code",
"main_module": "worker.mjs",
"main_file": "arcrun-code/worker.mjs",
"js_bytes": 154438,
"js_bytes": 154096,
"modules": [
{
"name": "quickjs.wasm",
@@ -140,15 +140,39 @@
}
},
"warnings": [],
"sha256": "761acc054b6f01bc2c37dce3b5923cd40d4ac8ac986bc0452f36e16463299a74",
"bytes": 154438
"sha256": "12b86c277b13a03b0c0f53ccd438162c07d2d0c105568a56c90e7e95d4c273d4",
"bytes": 154096
},
{
"name": "arcrun-mcp",
"canonical": null,
"main_module": "worker.mjs",
"main_file": "arcrun-mcp/worker.mjs",
"js_bytes": 1174326,
"modules": [],
"compat_date": "2024-11-27",
"compat_flags": [
"nodejs_compat"
],
"requires": {
"kv": [
"OAUTH_KV"
],
"d1": [],
"vectorize": 0,
"ai": false,
"vars": {}
},
"warnings": [],
"sha256": "dc71ac23cd60f1207b969e8cca7e0fb402a282bc2daccdca19ca0a5e0ca682b3",
"bytes": 1174326
},
{
"name": "arcrun-rag-ui",
"tier": 2,
"main_file": "tier2/ui/index.js",
"main_module": "index.js",
"sha256": "b04d3f2efab9844a37853f767fedf7275ceefc7d3218a75c1494ea06e54bae40",
"sha256": "276883752c8e93c0be65cb2f0e7ce596125f6be7d2b05a34d6e3e8c7303e7d0d",
"compat_date": "2026-07-01",
"compat_flags": [],
"modules": [],
@@ -158,7 +182,7 @@
"ai": false,
"vars": {}
},
"bytes": 508088
"bytes": 509551
}
],
"daemon": {
@@ -178,8 +202,8 @@
"sha256": "782a3b2212884f789e1725f82046cf34ef6bb02e1a8b585cab8e4ae6c6e441ca"
}
},
"release": "1.4.30",
"release": "1.4.32",
"built_for": "oauth-installer-lazy-load",
"notes": [],
"fingerprint": "becca61c342094e9d699500518ffec65b142ed79042acac394d0fddd80488900"
"fingerprint": "dcb17d391c5d5597558c694e2b209da55ca080aade9f98da2ccf133beade1216"
}
+2 -2
View File
File diff suppressed because one or more lines are too long