@mulmoclaude/core 5.14.0 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/assets/helps/custom-view.md +21 -0
- package/dist/collection/core/viewFields.d.ts +16 -0
- package/dist/collection/index.cjs +29 -0
- package/dist/collection/index.cjs.map +1 -1
- package/dist/collection/index.d.ts +1 -0
- package/dist/collection/index.js +28 -2
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/registry/server/index.cjs +2 -2
- package/dist/collection/registry/server/index.js +2 -2
- package/dist/collection/server/index.cjs +2 -2
- package/dist/collection/server/index.js +2 -2
- package/dist/collection-watchers/index.cjs +2 -2
- package/dist/collection-watchers/index.js +2 -2
- package/dist/{discovery-CYIV1J5l.cjs → discovery-BkCeYBf6.cjs} +26 -14
- package/dist/discovery-BkCeYBf6.cjs.map +1 -0
- package/dist/{discovery-duLlygnJ.js → discovery-DR4GNqrp.js} +26 -14
- package/dist/discovery-DR4GNqrp.js.map +1 -0
- package/dist/dist-734JaRYi.cjs.map +1 -1
- package/dist/dist-BmO4oSQy.js.map +1 -1
- package/dist/feeds/server/index.cjs +2 -2
- package/dist/feeds/server/index.js +2 -2
- package/dist/google/index.cjs +1 -1
- package/dist/google/index.js +1 -1
- package/dist/remote-host/index.cjs +1 -3
- package/dist/remote-host/index.d.ts +0 -3
- package/dist/remote-host/index.js +1 -1
- package/dist/remote-host/server/index.cjs +9 -4
- package/dist/remote-host/server/index.cjs.map +1 -1
- package/dist/remote-host/server/index.d.ts +1 -0
- package/dist/remote-host/server/index.js +6 -3
- package/dist/remote-host/server/index.js.map +1 -1
- package/dist/remote-host/server/paths.d.ts +4 -0
- package/dist/{remote-host-BW_eH-Nu.cjs → remote-host-11euEZKP.cjs} +1 -16
- package/dist/remote-host-11euEZKP.cjs.map +1 -0
- package/dist/{remote-host-CSeDNbE6.js → remote-host-TiMhcW1o.js} +2 -5
- package/dist/remote-host-TiMhcW1o.js.map +1 -0
- package/dist/{server-ByKWGQn2.cjs → server-CQ88wv71.cjs} +2 -2
- package/dist/{server-ByKWGQn2.cjs.map → server-CQ88wv71.cjs.map} +1 -1
- package/dist/{server-CA-alqqN.js → server-Dh7pgRRg.js} +2 -2
- package/dist/{server-CA-alqqN.js.map → server-Dh7pgRRg.js.map} +1 -1
- package/dist/workspace-setup/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/discovery-CYIV1J5l.cjs.map +0 -1
- package/dist/discovery-duLlygnJ.js.map +0 -1
- package/dist/remote-host-BW_eH-Nu.cjs.map +0 -1
- package/dist/remote-host-CSeDNbE6.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dist-734JaRYi.cjs","names":[],"sources":["../../common/dist/envCoerce.js","../../common/dist/index.js"],"sourcesContent":["// Env-var type coercion for ports and other integer settings.\n//\n// It started inside `server/system/env.ts` (#504-era), moved to\n// `server/utils/envCoerce.ts` when #2650 needed the SAME rule for `yarn dev`'s\n// Vite proxy — the proxy has to resolve `PORT` exactly as the backend does, or\n// the two point at different servers — and moved here when #3084 needed it for\n// the messaging bridges too. A second opinion about \"is this a port\" is that\n// bug one level down, so there is exactly one copy and every tier imports it.\n/**\n * `Number()`-based integer coercion with an optional range, falling back when the\n * value is absent, empty, non-integer, or out of range.\n *\n * `Number()` — not `parseInt` — on purpose: it is what the server has always used,\n * so `0x1f`, `1e3`, `+3100` and `3100.0` coerce exactly as they did, and a\n * whitespace-only value coerces to 0. Anything stricter here would silently\n * disagree with the backend.\n */\nexport function asInt(value, fallback, opts = {}) {\n if (value === undefined || value === \"\")\n return fallback;\n const parsed = Number(value);\n if (!Number.isInteger(parsed))\n return fallback;\n if (opts.min !== undefined && parsed < opts.min)\n return fallback;\n if (opts.max !== undefined && parsed > opts.max)\n return fallback;\n return parsed;\n}\n/** The port range the backend accepts, so both sides bound the value identically.\n * `min: 0` is deliberate — 0 asks the OS for an ephemeral port.\n *\n * `Required<IntRange>`, not `IntRange`: both bounds are always present here, and\n * saying so lets a caller compare against them (`port <= PORT_RANGE.max`) without\n * a non-null assertion. Still assignable wherever an `IntRange` is expected. */\nexport const PORT_RANGE = Object.freeze({ min: 0, max: 65_535 });\n","// General-purpose runtime type guards, shared across the MulmoClaude host,\n// bridges, and plugins. This is a leaf package — pure and dependency-free — so\n// any tier can import it without creating an uphill edge.\n//\n// These originated as `server/utils/types.ts` (#504), which centralised 40+\n// hand-written inline `typeof x === \"object\"` checks. They are promoted here so\n// the same guards stop being re-hand-written in every bridge and plugin too.\n/** Narrow `unknown` to a plain object (not null, not array). */\nexport function isRecord(value) {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n/** Narrow `unknown` to any object (not null, arrays allowed).\n * Use `isRecord` when you need to access string keys. */\nexport function isObj(value) {\n return typeof value === \"object\" && value !== null;\n}\n/** Non-empty string after trimming whitespace. */\nexport function isNonEmptyString(value) {\n return typeof value === \"string\" && value.trim().length > 0;\n}\n/** Record whose values are all strings. */\nexport function isStringRecord(value) {\n if (!isRecord(value))\n return false;\n return Object.values(value).every((val) => typeof val === \"string\");\n}\n/** String array (every element is a string). */\nexport function isStringArray(value) {\n return Array.isArray(value) && value.every((val) => typeof val === \"string\");\n}\n/** Absent, or a string — an optional string field. */\nexport function isOptionalString(value) {\n return value === undefined || typeof value === \"string\";\n}\n/** Absent, or a boolean — an optional boolean field. */\nexport function isOptionalBoolean(value) {\n return value === undefined || typeof value === \"boolean\";\n}\n/** An array of unknowns. Prefer this over a bare `Array.isArray` in typed code:\n * `Array.isArray(x: unknown)` narrows to `any[]`, silently reintroducing\n * `any`, whereas this keeps the element type `unknown`. */\nexport function isUnknownArray(value) {\n return Array.isArray(value);\n}\n/** Error-like object with a `code` property (e.g. Node.js fs errors). */\nexport function isErrorWithCode(value) {\n return isRecord(value) && typeof value.code === \"string\";\n}\n/** Check that a record has a specific key with a string value. */\nexport function hasStringProp(value, key) {\n return isRecord(value) && typeof value[key] === \"string\";\n}\n/** Check that a record has a specific key with a number value. */\nexport function hasNumberProp(value, key) {\n return isRecord(value) && typeof value[key] === \"number\";\n}\n/** Split a comma-separated env value into trimmed, non-empty entries.\n * `lowercase` folds case for identifiers compared case-insensitively\n * (JIDs, email addresses, hex pubkeys). Absent/empty input → empty list. */\nexport function parseCsvList(raw, opts) {\n return (raw ?? \"\")\n .split(\",\")\n .map((entry) => (opts?.lowercase ? entry.trim().toLowerCase() : entry.trim()))\n .filter(Boolean);\n}\n/** A comma-separated env value as a Set — the canonical allowlist shape,\n * where an empty set is the \"allow all\" sentinel (`set.size === 0`). */\nexport function parseCsvSet(raw, opts) {\n return new Set(parseCsvList(raw, opts));\n}\n/** Normalise an unknown thrown value into a human-readable string. Isomorphic\n * (host, bridges, plugins, Vue) — this is the single home for the helper that\n * #2217 could only consolidate for server code, since `@mulmoclaude/core/utils`\n * is server-only.\n *\n * A non-Error object with a non-empty string `details` (gRPC convention) or\n * `message` field surfaces that field — `details` wins — instead of the\n * `[object Object]` a bare `String(err)` would print; an empty-string field\n * falls through. `fallback` covers the error-boundary idiom where a thrown\n * non-Error should read as a descriptive message rather than `String(err)`\n * noise; omit it in logging contexts where `String(err)` is fine. */\nexport function errorMessage(err, fallback) {\n if (err instanceof Error)\n return err.message;\n if (hasStringProp(err, \"details\") && err.details)\n return err.details;\n if (hasStringProp(err, \"message\") && err.message)\n return err.message;\n if (fallback !== undefined)\n return fallback;\n return String(err);\n}\n/** `Date` → `YYYY-MM-DD` in UTC — for dates that must not shift with the\n * host's local timezone (tool-trace search dirs, API date keys). Isomorphic\n * single source (#2480): the host re-exports it from `server/utils/date.ts`,\n * x-plugin imports it directly. The `@receptron/task-scheduler` copy stays\n * local on purpose — that leaf package is published independently and kept\n * dependency-free. Wall-clock questions use the host's `toLocalIsoDate`. */\nexport function toUtcIsoDate(timestamp) {\n const year = timestamp.getUTCFullYear();\n const month = String(timestamp.getUTCMonth() + 1).padStart(2, \"0\");\n const day = String(timestamp.getUTCDate()).padStart(2, \"0\");\n return `${year}-${month}-${day}`;\n}\n// A Map, not an object literal: `{}[char]` reads through the prototype chain,\n// so a future caller widening the regex would silently get `[object Object]`\n// for keys like `constructor`.\nconst HTML_ESCAPES = new Map([\n [\"&\", \"&\"],\n [\"<\", \"<\"],\n [\">\", \">\"],\n ['\"', \""\"],\n [\"'\", \"'\"],\n]);\n/** HTML-escape text destined for markup or an attribute value — the fixed\n * five-character map, nothing more. Lives here rather than in\n * `@mulmoclaude/core/wiki` (#2483) because `@mulmoclaude/markdown-utils` is a\n * leaf that core depends on and so cannot import back up; core/wiki\n * re-exports this, keeping its consumers' import path unchanged.\n *\n * Escaping `&` first is what makes a single pass safe — the entities this\n * introduces contain none of the other four characters, so nothing is\n * double-escaped. Not a sanitiser: it neither strips tags nor validates URLs. */\nexport function escapeHtml(value) {\n return value.replace(/[&<>\"']/g, (char) => HTML_ESCAPES.get(char) ?? char);\n}\n/** Split a JWS compact serialization into its three segments, or `null` when the\n * token isn't well-formed. Pure string work, so the Node bridges and the\n * Cloudflare Workers relay — which decode the segments differently (`Buffer` vs\n * `atob`) — can still share this one guard.\n *\n * A JWS compact serialization is EXACTLY three segments. Both a short token and\n * a longer one (a five-segment JWE, or an attacker appending `.junk`) are\n * rejected outright — never parsed from their first three segments, which would\n * let the signed input disagree with the token. */\nexport function splitJwtSegments(token) {\n const [headerSegment, payloadSegment, signatureSegment, ...extraSegments] = token.split(\".\");\n if (headerSegment === undefined || payloadSegment === undefined || signatureSegment === undefined)\n return null;\n if (extraSegments.length > 0)\n return null;\n return { headerSegment, payloadSegment, signatureSegment };\n}\nexport { scanEnvOptions, snakeToLowerCamel } from \"./envScan.js\";\nexport { asInt, PORT_RANGE } from \"./envCoerce.js\";\n"],"mappings":"AAmC0B,OAAO,OAAO;CAAE,KAAK;CAAG,KAAK;AAAO,CAAC;;;AC3B/D,SAAgB,SAAS,OAAO;CAC5B,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC9E;;;AAGA,SAAgB,MAAM,OAAO;CACzB,OAAO,OAAO,UAAU,YAAY,UAAU;AAClD;;AAYA,SAAgB,cAAc,OAAO;CACjC,OAAO,MAAM,QAAQ,KAAK,KAAK,MAAM,OAAO,QAAQ,OAAO,QAAQ,QAAQ;AAC/E;;AAEA,SAAgB,iBAAiB,OAAO;CACpC,OAAO,UAAU,KAAA,KAAa,OAAO,UAAU;AACnD;;;;AAQA,SAAgB,eAAe,OAAO;CAClC,OAAO,MAAM,QAAQ,KAAK;AAC9B;;AAEA,SAAgB,gBAAgB,OAAO;CACnC,OAAO,SAAS,KAAK,KAAK,OAAO,MAAM,SAAS;AACpD;;AAEA,SAAgB,cAAc,OAAO,KAAK;CACtC,OAAO,SAAS,KAAK,KAAK,OAAO,MAAM,SAAS;AACpD;;AAEA,SAAgB,cAAc,OAAO,KAAK;CACtC,OAAO,SAAS,KAAK,KAAK,OAAO,MAAM,SAAS;AACpD;;;;;;;;;;;;AA0BA,SAAgB,aAAa,KAAK,UAAU;CACxC,IAAI,eAAe,OACf,OAAO,IAAI;CACf,IAAI,cAAc,KAAK,SAAS,KAAK,IAAI,SACrC,OAAO,IAAI;CACf,IAAI,cAAc,KAAK,SAAS,KAAK,IAAI,SACrC,OAAO,IAAI;CACf,IAAI,aAAa,KAAA,GACb,OAAO;CACX,OAAO,OAAO,GAAG;AACrB;AAgBA,IAAM,+BAAe,IAAI,IAAI;CACzB,CAAC,KAAK,OAAO;CACb,CAAC,KAAK,MAAM;CACZ,CAAC,KAAK,MAAM;CACZ,CAAC,MAAK,QAAQ;CACd,CAAC,KAAK,OAAO;AACjB,CAAC;;;;;;;;;;AAUD,SAAgB,WAAW,OAAO;CAC9B,OAAO,MAAM,QAAQ,aAAa,SAAS,aAAa,IAAI,IAAI,KAAK,IAAI;AAC7E"}
|
|
1
|
+
{"version":3,"file":"dist-734JaRYi.cjs","names":[],"sources":["../../common/dist/envCoerce.js","../../common/dist/index.js"],"sourcesContent":["// Env-var type coercion for ports and other integer settings.\n//\n// It started inside `server/system/env.ts` (#504-era), moved to\n// `server/utils/envCoerce.ts` when #2650 needed the SAME rule for `yarn dev`'s\n// Vite proxy — the proxy has to resolve `PORT` exactly as the backend does, or\n// the two point at different servers — and moved here when #3084 needed it for\n// the messaging bridges too. A second opinion about \"is this a port\" is that\n// bug one level down, so there is exactly one copy and every tier imports it.\n/**\n * `Number()`-based integer coercion with an optional range, falling back when the\n * value is absent, empty, non-integer, or out of range.\n *\n * `Number()` — not `parseInt` — on purpose: it is what the server has always used,\n * so `0x1f`, `1e3`, `+3100` and `3100.0` coerce exactly as they did, and a\n * whitespace-only value coerces to 0. Anything stricter here would silently\n * disagree with the backend.\n */\nexport function asInt(value, fallback, opts = {}) {\n if (value === undefined || value === \"\")\n return fallback;\n const parsed = Number(value);\n if (!Number.isInteger(parsed))\n return fallback;\n if (opts.min !== undefined && parsed < opts.min)\n return fallback;\n if (opts.max !== undefined && parsed > opts.max)\n return fallback;\n return parsed;\n}\n/** The port range the backend accepts, so both sides bound the value identically.\n * `min: 0` is deliberate — 0 asks the OS for an ephemeral port.\n *\n * `Required<IntRange>`, not `IntRange`: both bounds are always present here, and\n * saying so lets a caller compare against them (`port <= PORT_RANGE.max`) without\n * a non-null assertion. Still assignable wherever an `IntRange` is expected. */\nexport const PORT_RANGE = Object.freeze({ min: 0, max: 65_535 });\n","// General-purpose runtime type guards, shared across the MulmoClaude host,\n// bridges, and plugins. This is a leaf package — pure and dependency-free — so\n// any tier can import it without creating an uphill edge.\n//\n// These originated as `server/utils/types.ts` (#504), which centralised 40+\n// hand-written inline `typeof x === \"object\"` checks. They are promoted here so\n// the same guards stop being re-hand-written in every bridge and plugin too.\n/** Narrow `unknown` to a plain object (not null, not array). */\nexport function isRecord(value) {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n/** Narrow `unknown` to any object (not null, arrays allowed).\n * Use `isRecord` when you need to access string keys. */\nexport function isObj(value) {\n return typeof value === \"object\" && value !== null;\n}\n/** Non-empty string after trimming whitespace. */\nexport function isNonEmptyString(value) {\n return typeof value === \"string\" && value.trim().length > 0;\n}\n/** Record whose values are all strings. */\nexport function isStringRecord(value) {\n if (!isRecord(value))\n return false;\n return Object.values(value).every((val) => typeof val === \"string\");\n}\n/** String array (every element is a string). */\nexport function isStringArray(value) {\n return Array.isArray(value) && value.every((val) => typeof val === \"string\");\n}\n/** Absent, or a string — an optional string field. */\nexport function isOptionalString(value) {\n return value === undefined || typeof value === \"string\";\n}\n/** Absent, or a boolean — an optional boolean field. */\nexport function isOptionalBoolean(value) {\n return value === undefined || typeof value === \"boolean\";\n}\n/** An array of unknowns. Prefer this over a bare `Array.isArray` in typed code:\n * `Array.isArray(x: unknown)` narrows to `any[]`, silently reintroducing\n * `any`, whereas this keeps the element type `unknown`. */\nexport function isUnknownArray(value) {\n return Array.isArray(value);\n}\n/** Error-like object with a `code` property (e.g. Node.js fs errors). */\nexport function isErrorWithCode(value) {\n return isRecord(value) && typeof value.code === \"string\";\n}\n/** Check that a record has a specific key with a string value. */\nexport function hasStringProp(value, key) {\n return isRecord(value) && typeof value[key] === \"string\";\n}\n/** Check that a record has a specific key with a number value. */\nexport function hasNumberProp(value, key) {\n return isRecord(value) && typeof value[key] === \"number\";\n}\n/** Split a comma-separated env value into trimmed, non-empty entries.\n * `lowercase` folds case for identifiers compared case-insensitively\n * (JIDs, email addresses, hex pubkeys). Absent/empty input → empty list. */\nexport function parseCsvList(raw, opts) {\n return (raw ?? \"\")\n .split(\",\")\n .map((entry) => (opts?.lowercase ? entry.trim().toLowerCase() : entry.trim()))\n .filter(Boolean);\n}\n/** A comma-separated env value as a Set — the canonical allowlist shape,\n * where an empty set is the \"allow all\" sentinel (`set.size === 0`). */\nexport function parseCsvSet(raw, opts) {\n return new Set(parseCsvList(raw, opts));\n}\n/** Normalise an unknown thrown value into a human-readable string. Isomorphic\n * (host, bridges, plugins, Vue) — this is the single home for the helper that\n * #2217 could only consolidate for server code, since `@mulmoclaude/core/utils`\n * is server-only.\n *\n * A non-Error object with a non-empty string `details` (gRPC convention) or\n * `message` field surfaces that field — `details` wins — instead of the\n * `[object Object]` a bare `String(err)` would print; an empty-string field\n * falls through. `fallback` covers the error-boundary idiom where a thrown\n * non-Error should read as a descriptive message rather than `String(err)`\n * noise; omit it in logging contexts where `String(err)` is fine. */\nexport function errorMessage(err, fallback) {\n if (err instanceof Error)\n return err.message;\n if (hasStringProp(err, \"details\") && err.details)\n return err.details;\n if (hasStringProp(err, \"message\") && err.message)\n return err.message;\n if (fallback !== undefined)\n return fallback;\n return String(err);\n}\n/** `Date` → `YYYY-MM-DD` in UTC — for dates that must not shift with the\n * host's local timezone (tool-trace search dirs, API date keys). Isomorphic\n * single source (#2480): the host re-exports it from `server/utils/date.ts`,\n * x-plugin imports it directly. The `@receptron/task-scheduler` copy stays\n * local on purpose — that leaf package is published independently and kept\n * dependency-free. Wall-clock questions use the host's `toLocalIsoDate`. */\nexport function toUtcIsoDate(timestamp) {\n const year = timestamp.getUTCFullYear();\n const month = String(timestamp.getUTCMonth() + 1).padStart(2, \"0\");\n const day = String(timestamp.getUTCDate()).padStart(2, \"0\");\n return `${year}-${month}-${day}`;\n}\n// A Map, not an object literal: `{}[char]` reads through the prototype chain,\n// so a future caller widening the regex would silently get `[object Object]`\n// for keys like `constructor`.\nconst HTML_ESCAPES = new Map([\n [\"&\", \"&\"],\n [\"<\", \"<\"],\n [\">\", \">\"],\n ['\"', \""\"],\n [\"'\", \"'\"],\n]);\n/** HTML-escape text destined for markup or an attribute value — the fixed\n * five-character map, nothing more. Lives here rather than in\n * `@mulmoclaude/core/wiki` (#2483) because `@mulmoclaude/markdown-utils` is a\n * leaf that core depends on and so cannot import back up; core/wiki\n * re-exports this, keeping its consumers' import path unchanged.\n *\n * Escaping `&` first is what makes a single pass safe — the entities this\n * introduces contain none of the other four characters, so nothing is\n * double-escaped. Not a sanitiser: it neither strips tags nor validates URLs. */\nexport function escapeHtml(value) {\n return value.replace(/[&<>\"']/g, (char) => HTML_ESCAPES.get(char) ?? char);\n}\n/** Split a JWS compact serialization into its three segments, or `null` when the\n * token isn't well-formed. Pure string work, so the Node bridges and the\n * Cloudflare Workers relay — which decode the segments differently (`Buffer` vs\n * `atob`) — can still share this one guard.\n *\n * A JWS compact serialization is EXACTLY three segments. Both a short token and\n * a longer one (a five-segment JWE, or an attacker appending `.junk`) are\n * rejected outright — never parsed from their first three segments, which would\n * let the signed input disagree with the token. */\nexport function splitJwtSegments(token) {\n const [headerSegment, payloadSegment, signatureSegment, ...extraSegments] = token.split(\".\");\n if (headerSegment === undefined || payloadSegment === undefined || signatureSegment === undefined)\n return null;\n if (extraSegments.length > 0)\n return null;\n return { headerSegment, payloadSegment, signatureSegment };\n}\nexport { scanEnvOptions, snakeToLowerCamel } from \"./envScan.js\";\nexport { asInt, PORT_RANGE } from \"./envCoerce.js\";\nexport { mapWithConcurrency } from \"./concurrency.js\";\n"],"mappings":"AAmC0B,OAAO,OAAO;CAAE,KAAK;CAAG,KAAK;AAAO,CAAC;;;AC3B/D,SAAgB,SAAS,OAAO;CAC5B,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC9E;;;AAGA,SAAgB,MAAM,OAAO;CACzB,OAAO,OAAO,UAAU,YAAY,UAAU;AAClD;;AAYA,SAAgB,cAAc,OAAO;CACjC,OAAO,MAAM,QAAQ,KAAK,KAAK,MAAM,OAAO,QAAQ,OAAO,QAAQ,QAAQ;AAC/E;;AAEA,SAAgB,iBAAiB,OAAO;CACpC,OAAO,UAAU,KAAA,KAAa,OAAO,UAAU;AACnD;;;;AAQA,SAAgB,eAAe,OAAO;CAClC,OAAO,MAAM,QAAQ,KAAK;AAC9B;;AAEA,SAAgB,gBAAgB,OAAO;CACnC,OAAO,SAAS,KAAK,KAAK,OAAO,MAAM,SAAS;AACpD;;AAEA,SAAgB,cAAc,OAAO,KAAK;CACtC,OAAO,SAAS,KAAK,KAAK,OAAO,MAAM,SAAS;AACpD;;AAEA,SAAgB,cAAc,OAAO,KAAK;CACtC,OAAO,SAAS,KAAK,KAAK,OAAO,MAAM,SAAS;AACpD;;;;;;;;;;;;AA0BA,SAAgB,aAAa,KAAK,UAAU;CACxC,IAAI,eAAe,OACf,OAAO,IAAI;CACf,IAAI,cAAc,KAAK,SAAS,KAAK,IAAI,SACrC,OAAO,IAAI;CACf,IAAI,cAAc,KAAK,SAAS,KAAK,IAAI,SACrC,OAAO,IAAI;CACf,IAAI,aAAa,KAAA,GACb,OAAO;CACX,OAAO,OAAO,GAAG;AACrB;AAgBA,IAAM,+BAAe,IAAI,IAAI;CACzB,CAAC,KAAK,OAAO;CACb,CAAC,KAAK,MAAM;CACZ,CAAC,KAAK,MAAM;CACZ,CAAC,MAAK,QAAQ;CACd,CAAC,KAAK,OAAO;AACjB,CAAC;;;;;;;;;;AAUD,SAAgB,WAAW,OAAO;CAC9B,OAAO,MAAM,QAAQ,aAAa,SAAS,aAAa,IAAI,IAAI,KAAK,IAAI;AAC7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dist-BmO4oSQy.js","names":[],"sources":["../../common/dist/envCoerce.js","../../common/dist/index.js"],"sourcesContent":["// Env-var type coercion for ports and other integer settings.\n//\n// It started inside `server/system/env.ts` (#504-era), moved to\n// `server/utils/envCoerce.ts` when #2650 needed the SAME rule for `yarn dev`'s\n// Vite proxy — the proxy has to resolve `PORT` exactly as the backend does, or\n// the two point at different servers — and moved here when #3084 needed it for\n// the messaging bridges too. A second opinion about \"is this a port\" is that\n// bug one level down, so there is exactly one copy and every tier imports it.\n/**\n * `Number()`-based integer coercion with an optional range, falling back when the\n * value is absent, empty, non-integer, or out of range.\n *\n * `Number()` — not `parseInt` — on purpose: it is what the server has always used,\n * so `0x1f`, `1e3`, `+3100` and `3100.0` coerce exactly as they did, and a\n * whitespace-only value coerces to 0. Anything stricter here would silently\n * disagree with the backend.\n */\nexport function asInt(value, fallback, opts = {}) {\n if (value === undefined || value === \"\")\n return fallback;\n const parsed = Number(value);\n if (!Number.isInteger(parsed))\n return fallback;\n if (opts.min !== undefined && parsed < opts.min)\n return fallback;\n if (opts.max !== undefined && parsed > opts.max)\n return fallback;\n return parsed;\n}\n/** The port range the backend accepts, so both sides bound the value identically.\n * `min: 0` is deliberate — 0 asks the OS for an ephemeral port.\n *\n * `Required<IntRange>`, not `IntRange`: both bounds are always present here, and\n * saying so lets a caller compare against them (`port <= PORT_RANGE.max`) without\n * a non-null assertion. Still assignable wherever an `IntRange` is expected. */\nexport const PORT_RANGE = Object.freeze({ min: 0, max: 65_535 });\n","// General-purpose runtime type guards, shared across the MulmoClaude host,\n// bridges, and plugins. This is a leaf package — pure and dependency-free — so\n// any tier can import it without creating an uphill edge.\n//\n// These originated as `server/utils/types.ts` (#504), which centralised 40+\n// hand-written inline `typeof x === \"object\"` checks. They are promoted here so\n// the same guards stop being re-hand-written in every bridge and plugin too.\n/** Narrow `unknown` to a plain object (not null, not array). */\nexport function isRecord(value) {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n/** Narrow `unknown` to any object (not null, arrays allowed).\n * Use `isRecord` when you need to access string keys. */\nexport function isObj(value) {\n return typeof value === \"object\" && value !== null;\n}\n/** Non-empty string after trimming whitespace. */\nexport function isNonEmptyString(value) {\n return typeof value === \"string\" && value.trim().length > 0;\n}\n/** Record whose values are all strings. */\nexport function isStringRecord(value) {\n if (!isRecord(value))\n return false;\n return Object.values(value).every((val) => typeof val === \"string\");\n}\n/** String array (every element is a string). */\nexport function isStringArray(value) {\n return Array.isArray(value) && value.every((val) => typeof val === \"string\");\n}\n/** Absent, or a string — an optional string field. */\nexport function isOptionalString(value) {\n return value === undefined || typeof value === \"string\";\n}\n/** Absent, or a boolean — an optional boolean field. */\nexport function isOptionalBoolean(value) {\n return value === undefined || typeof value === \"boolean\";\n}\n/** An array of unknowns. Prefer this over a bare `Array.isArray` in typed code:\n * `Array.isArray(x: unknown)` narrows to `any[]`, silently reintroducing\n * `any`, whereas this keeps the element type `unknown`. */\nexport function isUnknownArray(value) {\n return Array.isArray(value);\n}\n/** Error-like object with a `code` property (e.g. Node.js fs errors). */\nexport function isErrorWithCode(value) {\n return isRecord(value) && typeof value.code === \"string\";\n}\n/** Check that a record has a specific key with a string value. */\nexport function hasStringProp(value, key) {\n return isRecord(value) && typeof value[key] === \"string\";\n}\n/** Check that a record has a specific key with a number value. */\nexport function hasNumberProp(value, key) {\n return isRecord(value) && typeof value[key] === \"number\";\n}\n/** Split a comma-separated env value into trimmed, non-empty entries.\n * `lowercase` folds case for identifiers compared case-insensitively\n * (JIDs, email addresses, hex pubkeys). Absent/empty input → empty list. */\nexport function parseCsvList(raw, opts) {\n return (raw ?? \"\")\n .split(\",\")\n .map((entry) => (opts?.lowercase ? entry.trim().toLowerCase() : entry.trim()))\n .filter(Boolean);\n}\n/** A comma-separated env value as a Set — the canonical allowlist shape,\n * where an empty set is the \"allow all\" sentinel (`set.size === 0`). */\nexport function parseCsvSet(raw, opts) {\n return new Set(parseCsvList(raw, opts));\n}\n/** Normalise an unknown thrown value into a human-readable string. Isomorphic\n * (host, bridges, plugins, Vue) — this is the single home for the helper that\n * #2217 could only consolidate for server code, since `@mulmoclaude/core/utils`\n * is server-only.\n *\n * A non-Error object with a non-empty string `details` (gRPC convention) or\n * `message` field surfaces that field — `details` wins — instead of the\n * `[object Object]` a bare `String(err)` would print; an empty-string field\n * falls through. `fallback` covers the error-boundary idiom where a thrown\n * non-Error should read as a descriptive message rather than `String(err)`\n * noise; omit it in logging contexts where `String(err)` is fine. */\nexport function errorMessage(err, fallback) {\n if (err instanceof Error)\n return err.message;\n if (hasStringProp(err, \"details\") && err.details)\n return err.details;\n if (hasStringProp(err, \"message\") && err.message)\n return err.message;\n if (fallback !== undefined)\n return fallback;\n return String(err);\n}\n/** `Date` → `YYYY-MM-DD` in UTC — for dates that must not shift with the\n * host's local timezone (tool-trace search dirs, API date keys). Isomorphic\n * single source (#2480): the host re-exports it from `server/utils/date.ts`,\n * x-plugin imports it directly. The `@receptron/task-scheduler` copy stays\n * local on purpose — that leaf package is published independently and kept\n * dependency-free. Wall-clock questions use the host's `toLocalIsoDate`. */\nexport function toUtcIsoDate(timestamp) {\n const year = timestamp.getUTCFullYear();\n const month = String(timestamp.getUTCMonth() + 1).padStart(2, \"0\");\n const day = String(timestamp.getUTCDate()).padStart(2, \"0\");\n return `${year}-${month}-${day}`;\n}\n// A Map, not an object literal: `{}[char]` reads through the prototype chain,\n// so a future caller widening the regex would silently get `[object Object]`\n// for keys like `constructor`.\nconst HTML_ESCAPES = new Map([\n [\"&\", \"&\"],\n [\"<\", \"<\"],\n [\">\", \">\"],\n ['\"', \""\"],\n [\"'\", \"'\"],\n]);\n/** HTML-escape text destined for markup or an attribute value — the fixed\n * five-character map, nothing more. Lives here rather than in\n * `@mulmoclaude/core/wiki` (#2483) because `@mulmoclaude/markdown-utils` is a\n * leaf that core depends on and so cannot import back up; core/wiki\n * re-exports this, keeping its consumers' import path unchanged.\n *\n * Escaping `&` first is what makes a single pass safe — the entities this\n * introduces contain none of the other four characters, so nothing is\n * double-escaped. Not a sanitiser: it neither strips tags nor validates URLs. */\nexport function escapeHtml(value) {\n return value.replace(/[&<>\"']/g, (char) => HTML_ESCAPES.get(char) ?? char);\n}\n/** Split a JWS compact serialization into its three segments, or `null` when the\n * token isn't well-formed. Pure string work, so the Node bridges and the\n * Cloudflare Workers relay — which decode the segments differently (`Buffer` vs\n * `atob`) — can still share this one guard.\n *\n * A JWS compact serialization is EXACTLY three segments. Both a short token and\n * a longer one (a five-segment JWE, or an attacker appending `.junk`) are\n * rejected outright — never parsed from their first three segments, which would\n * let the signed input disagree with the token. */\nexport function splitJwtSegments(token) {\n const [headerSegment, payloadSegment, signatureSegment, ...extraSegments] = token.split(\".\");\n if (headerSegment === undefined || payloadSegment === undefined || signatureSegment === undefined)\n return null;\n if (extraSegments.length > 0)\n return null;\n return { headerSegment, payloadSegment, signatureSegment };\n}\nexport { scanEnvOptions, snakeToLowerCamel } from \"./envScan.js\";\nexport { asInt, PORT_RANGE } from \"./envCoerce.js\";\n"],"mappings":"AAmC0B,OAAO,OAAO;CAAE,KAAK;CAAG,KAAK;AAAO,CAAC;;;AC3B/D,SAAgB,SAAS,OAAO;CAC5B,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC9E;;;AAGA,SAAgB,MAAM,OAAO;CACzB,OAAO,OAAO,UAAU,YAAY,UAAU;AAClD;;AAYA,SAAgB,cAAc,OAAO;CACjC,OAAO,MAAM,QAAQ,KAAK,KAAK,MAAM,OAAO,QAAQ,OAAO,QAAQ,QAAQ;AAC/E;;AAEA,SAAgB,iBAAiB,OAAO;CACpC,OAAO,UAAU,KAAA,KAAa,OAAO,UAAU;AACnD;;;;AAQA,SAAgB,eAAe,OAAO;CAClC,OAAO,MAAM,QAAQ,KAAK;AAC9B;;AAEA,SAAgB,gBAAgB,OAAO;CACnC,OAAO,SAAS,KAAK,KAAK,OAAO,MAAM,SAAS;AACpD;;AAEA,SAAgB,cAAc,OAAO,KAAK;CACtC,OAAO,SAAS,KAAK,KAAK,OAAO,MAAM,SAAS;AACpD;;AAEA,SAAgB,cAAc,OAAO,KAAK;CACtC,OAAO,SAAS,KAAK,KAAK,OAAO,MAAM,SAAS;AACpD;;;;;;;;;;;;AA0BA,SAAgB,aAAa,KAAK,UAAU;CACxC,IAAI,eAAe,OACf,OAAO,IAAI;CACf,IAAI,cAAc,KAAK,SAAS,KAAK,IAAI,SACrC,OAAO,IAAI;CACf,IAAI,cAAc,KAAK,SAAS,KAAK,IAAI,SACrC,OAAO,IAAI;CACf,IAAI,aAAa,KAAA,GACb,OAAO;CACX,OAAO,OAAO,GAAG;AACrB;AAgBA,IAAM,+BAAe,IAAI,IAAI;CACzB,CAAC,KAAK,OAAO;CACb,CAAC,KAAK,MAAM;CACZ,CAAC,KAAK,MAAM;CACZ,CAAC,MAAK,QAAQ;CACd,CAAC,KAAK,OAAO;AACjB,CAAC;;;;;;;;;;AAUD,SAAgB,WAAW,OAAO;CAC9B,OAAO,MAAM,QAAQ,aAAa,SAAS,aAAa,IAAI,IAAI,KAAK,IAAI;AAC7E"}
|
|
1
|
+
{"version":3,"file":"dist-BmO4oSQy.js","names":[],"sources":["../../common/dist/envCoerce.js","../../common/dist/index.js"],"sourcesContent":["// Env-var type coercion for ports and other integer settings.\n//\n// It started inside `server/system/env.ts` (#504-era), moved to\n// `server/utils/envCoerce.ts` when #2650 needed the SAME rule for `yarn dev`'s\n// Vite proxy — the proxy has to resolve `PORT` exactly as the backend does, or\n// the two point at different servers — and moved here when #3084 needed it for\n// the messaging bridges too. A second opinion about \"is this a port\" is that\n// bug one level down, so there is exactly one copy and every tier imports it.\n/**\n * `Number()`-based integer coercion with an optional range, falling back when the\n * value is absent, empty, non-integer, or out of range.\n *\n * `Number()` — not `parseInt` — on purpose: it is what the server has always used,\n * so `0x1f`, `1e3`, `+3100` and `3100.0` coerce exactly as they did, and a\n * whitespace-only value coerces to 0. Anything stricter here would silently\n * disagree with the backend.\n */\nexport function asInt(value, fallback, opts = {}) {\n if (value === undefined || value === \"\")\n return fallback;\n const parsed = Number(value);\n if (!Number.isInteger(parsed))\n return fallback;\n if (opts.min !== undefined && parsed < opts.min)\n return fallback;\n if (opts.max !== undefined && parsed > opts.max)\n return fallback;\n return parsed;\n}\n/** The port range the backend accepts, so both sides bound the value identically.\n * `min: 0` is deliberate — 0 asks the OS for an ephemeral port.\n *\n * `Required<IntRange>`, not `IntRange`: both bounds are always present here, and\n * saying so lets a caller compare against them (`port <= PORT_RANGE.max`) without\n * a non-null assertion. Still assignable wherever an `IntRange` is expected. */\nexport const PORT_RANGE = Object.freeze({ min: 0, max: 65_535 });\n","// General-purpose runtime type guards, shared across the MulmoClaude host,\n// bridges, and plugins. This is a leaf package — pure and dependency-free — so\n// any tier can import it without creating an uphill edge.\n//\n// These originated as `server/utils/types.ts` (#504), which centralised 40+\n// hand-written inline `typeof x === \"object\"` checks. They are promoted here so\n// the same guards stop being re-hand-written in every bridge and plugin too.\n/** Narrow `unknown` to a plain object (not null, not array). */\nexport function isRecord(value) {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n/** Narrow `unknown` to any object (not null, arrays allowed).\n * Use `isRecord` when you need to access string keys. */\nexport function isObj(value) {\n return typeof value === \"object\" && value !== null;\n}\n/** Non-empty string after trimming whitespace. */\nexport function isNonEmptyString(value) {\n return typeof value === \"string\" && value.trim().length > 0;\n}\n/** Record whose values are all strings. */\nexport function isStringRecord(value) {\n if (!isRecord(value))\n return false;\n return Object.values(value).every((val) => typeof val === \"string\");\n}\n/** String array (every element is a string). */\nexport function isStringArray(value) {\n return Array.isArray(value) && value.every((val) => typeof val === \"string\");\n}\n/** Absent, or a string — an optional string field. */\nexport function isOptionalString(value) {\n return value === undefined || typeof value === \"string\";\n}\n/** Absent, or a boolean — an optional boolean field. */\nexport function isOptionalBoolean(value) {\n return value === undefined || typeof value === \"boolean\";\n}\n/** An array of unknowns. Prefer this over a bare `Array.isArray` in typed code:\n * `Array.isArray(x: unknown)` narrows to `any[]`, silently reintroducing\n * `any`, whereas this keeps the element type `unknown`. */\nexport function isUnknownArray(value) {\n return Array.isArray(value);\n}\n/** Error-like object with a `code` property (e.g. Node.js fs errors). */\nexport function isErrorWithCode(value) {\n return isRecord(value) && typeof value.code === \"string\";\n}\n/** Check that a record has a specific key with a string value. */\nexport function hasStringProp(value, key) {\n return isRecord(value) && typeof value[key] === \"string\";\n}\n/** Check that a record has a specific key with a number value. */\nexport function hasNumberProp(value, key) {\n return isRecord(value) && typeof value[key] === \"number\";\n}\n/** Split a comma-separated env value into trimmed, non-empty entries.\n * `lowercase` folds case for identifiers compared case-insensitively\n * (JIDs, email addresses, hex pubkeys). Absent/empty input → empty list. */\nexport function parseCsvList(raw, opts) {\n return (raw ?? \"\")\n .split(\",\")\n .map((entry) => (opts?.lowercase ? entry.trim().toLowerCase() : entry.trim()))\n .filter(Boolean);\n}\n/** A comma-separated env value as a Set — the canonical allowlist shape,\n * where an empty set is the \"allow all\" sentinel (`set.size === 0`). */\nexport function parseCsvSet(raw, opts) {\n return new Set(parseCsvList(raw, opts));\n}\n/** Normalise an unknown thrown value into a human-readable string. Isomorphic\n * (host, bridges, plugins, Vue) — this is the single home for the helper that\n * #2217 could only consolidate for server code, since `@mulmoclaude/core/utils`\n * is server-only.\n *\n * A non-Error object with a non-empty string `details` (gRPC convention) or\n * `message` field surfaces that field — `details` wins — instead of the\n * `[object Object]` a bare `String(err)` would print; an empty-string field\n * falls through. `fallback` covers the error-boundary idiom where a thrown\n * non-Error should read as a descriptive message rather than `String(err)`\n * noise; omit it in logging contexts where `String(err)` is fine. */\nexport function errorMessage(err, fallback) {\n if (err instanceof Error)\n return err.message;\n if (hasStringProp(err, \"details\") && err.details)\n return err.details;\n if (hasStringProp(err, \"message\") && err.message)\n return err.message;\n if (fallback !== undefined)\n return fallback;\n return String(err);\n}\n/** `Date` → `YYYY-MM-DD` in UTC — for dates that must not shift with the\n * host's local timezone (tool-trace search dirs, API date keys). Isomorphic\n * single source (#2480): the host re-exports it from `server/utils/date.ts`,\n * x-plugin imports it directly. The `@receptron/task-scheduler` copy stays\n * local on purpose — that leaf package is published independently and kept\n * dependency-free. Wall-clock questions use the host's `toLocalIsoDate`. */\nexport function toUtcIsoDate(timestamp) {\n const year = timestamp.getUTCFullYear();\n const month = String(timestamp.getUTCMonth() + 1).padStart(2, \"0\");\n const day = String(timestamp.getUTCDate()).padStart(2, \"0\");\n return `${year}-${month}-${day}`;\n}\n// A Map, not an object literal: `{}[char]` reads through the prototype chain,\n// so a future caller widening the regex would silently get `[object Object]`\n// for keys like `constructor`.\nconst HTML_ESCAPES = new Map([\n [\"&\", \"&\"],\n [\"<\", \"<\"],\n [\">\", \">\"],\n ['\"', \""\"],\n [\"'\", \"'\"],\n]);\n/** HTML-escape text destined for markup or an attribute value — the fixed\n * five-character map, nothing more. Lives here rather than in\n * `@mulmoclaude/core/wiki` (#2483) because `@mulmoclaude/markdown-utils` is a\n * leaf that core depends on and so cannot import back up; core/wiki\n * re-exports this, keeping its consumers' import path unchanged.\n *\n * Escaping `&` first is what makes a single pass safe — the entities this\n * introduces contain none of the other four characters, so nothing is\n * double-escaped. Not a sanitiser: it neither strips tags nor validates URLs. */\nexport function escapeHtml(value) {\n return value.replace(/[&<>\"']/g, (char) => HTML_ESCAPES.get(char) ?? char);\n}\n/** Split a JWS compact serialization into its three segments, or `null` when the\n * token isn't well-formed. Pure string work, so the Node bridges and the\n * Cloudflare Workers relay — which decode the segments differently (`Buffer` vs\n * `atob`) — can still share this one guard.\n *\n * A JWS compact serialization is EXACTLY three segments. Both a short token and\n * a longer one (a five-segment JWE, or an attacker appending `.junk`) are\n * rejected outright — never parsed from their first three segments, which would\n * let the signed input disagree with the token. */\nexport function splitJwtSegments(token) {\n const [headerSegment, payloadSegment, signatureSegment, ...extraSegments] = token.split(\".\");\n if (headerSegment === undefined || payloadSegment === undefined || signatureSegment === undefined)\n return null;\n if (extraSegments.length > 0)\n return null;\n return { headerSegment, payloadSegment, signatureSegment };\n}\nexport { scanEnvOptions, snakeToLowerCamel } from \"./envScan.js\";\nexport { asInt, PORT_RANGE } from \"./envCoerce.js\";\nexport { mapWithConcurrency } from \"./concurrency.js\";\n"],"mappings":"AAmC0B,OAAO,OAAO;CAAE,KAAK;CAAG,KAAK;AAAO,CAAC;;;AC3B/D,SAAgB,SAAS,OAAO;CAC5B,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC9E;;;AAGA,SAAgB,MAAM,OAAO;CACzB,OAAO,OAAO,UAAU,YAAY,UAAU;AAClD;;AAYA,SAAgB,cAAc,OAAO;CACjC,OAAO,MAAM,QAAQ,KAAK,KAAK,MAAM,OAAO,QAAQ,OAAO,QAAQ,QAAQ;AAC/E;;AAEA,SAAgB,iBAAiB,OAAO;CACpC,OAAO,UAAU,KAAA,KAAa,OAAO,UAAU;AACnD;;;;AAQA,SAAgB,eAAe,OAAO;CAClC,OAAO,MAAM,QAAQ,KAAK;AAC9B;;AAEA,SAAgB,gBAAgB,OAAO;CACnC,OAAO,SAAS,KAAK,KAAK,OAAO,MAAM,SAAS;AACpD;;AAEA,SAAgB,cAAc,OAAO,KAAK;CACtC,OAAO,SAAS,KAAK,KAAK,OAAO,MAAM,SAAS;AACpD;;AAEA,SAAgB,cAAc,OAAO,KAAK;CACtC,OAAO,SAAS,KAAK,KAAK,OAAO,MAAM,SAAS;AACpD;;;;;;;;;;;;AA0BA,SAAgB,aAAa,KAAK,UAAU;CACxC,IAAI,eAAe,OACf,OAAO,IAAI;CACf,IAAI,cAAc,KAAK,SAAS,KAAK,IAAI,SACrC,OAAO,IAAI;CACf,IAAI,cAAc,KAAK,SAAS,KAAK,IAAI,SACrC,OAAO,IAAI;CACf,IAAI,aAAa,KAAA,GACb,OAAO;CACX,OAAO,OAAO,GAAG;AACrB;AAgBA,IAAM,+BAAe,IAAI,IAAI;CACzB,CAAC,KAAK,OAAO;CACb,CAAC,KAAK,MAAM;CACZ,CAAC,KAAK,MAAM;CACZ,CAAC,MAAK,QAAQ;CACd,CAAC,KAAK,OAAO;AACjB,CAAC;;;;;;;;;;AAUD,SAAgB,WAAW,OAAO;CAC9B,OAAO,MAAM,QAAQ,aAAa,SAAS,aAAa,IAAI,IAAI,KAAK,IAAI;AAC7E"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_rolldown_runtime = require("../../rolldown-runtime-CmQyd0Gu.cjs");
|
|
3
3
|
const require_dist = require("../../dist-734JaRYi.cjs");
|
|
4
|
+
const require_discovery = require("../../discovery-BkCeYBf6.cjs");
|
|
4
5
|
const require_root = require("../../root-9lRFeXbm.cjs");
|
|
5
6
|
const require_itemId = require("../../itemId-D2XAQ8RU.cjs");
|
|
6
7
|
const require_project = require("../../project-DDTIVEMU.cjs");
|
|
7
|
-
const
|
|
8
|
-
const require_server = require("../../server-ByKWGQn2.cjs");
|
|
8
|
+
const require_server = require("../../server-CQ88wv71.cjs");
|
|
9
9
|
const require_feeds_paths = require("../paths.cjs");
|
|
10
10
|
const require_ingestTypes = require("../../ingestTypes-CLDvn7kw.cjs");
|
|
11
11
|
const require_notifier = require("../../notifier-CRTk34EC.cjs");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { a as isErrorWithCode, c as isRecord$1, u as isUnknownArray } from "../../dist-BmO4oSQy.js";
|
|
2
|
+
import { W as resolveDataDir, _t as createForwardingLogger, d as storeFor, k as listItems, n as discoverCollections, q as safeSlugName, vt as createHostSlot } from "../../discovery-DR4GNqrp.js";
|
|
2
3
|
import { t as canonicalRoot } from "../../root-CqxPNSyK.js";
|
|
3
4
|
import { J as INGEST_KINDS, q as FEED_SCHEDULES } from "../../itemId-D_pSpa3U.js";
|
|
4
5
|
import { t as mergeIntoExisting } from "../../project-mU6-xLfy.js";
|
|
5
|
-
import {
|
|
6
|
-
import { F as buildCollectionActionSeedPrompt, I as promptPathsFor, z as readSkillTemplate } from "../../server-CA-alqqN.js";
|
|
6
|
+
import { F as buildCollectionActionSeedPrompt, I as promptPathsFor, z as readSkillTemplate } from "../../server-Dh7pgRRg.js";
|
|
7
7
|
import { FEEDS_DIR, feedDir, feedStatePath, feedsRoot, ingestStateDir, ingestStatePath } from "../paths.js";
|
|
8
8
|
import { n as DEFAULT_FEED_MAX_ITEMS, r as isFeedSchedule, t as AGENT_INGEST_KIND } from "../../ingestTypes-DuXuSBSn.js";
|
|
9
9
|
import { d as publish, n as clear } from "../../notifier-htdf4ekH.js";
|
package/dist/google/index.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_rolldown_runtime = require("../rolldown-runtime-CmQyd0Gu.cjs");
|
|
3
3
|
const require_dist = require("../dist-734JaRYi.cjs");
|
|
4
|
+
const require_discovery = require("../discovery-BkCeYBf6.cjs");
|
|
4
5
|
require("../errors-B9mCEVG9.cjs");
|
|
5
6
|
const require_text = require("../text-BQiyo5R9.cjs");
|
|
6
7
|
const require_root = require("../root-9lRFeXbm.cjs");
|
|
7
8
|
const require_utils_fetch = require("../utils/fetch.cjs");
|
|
8
9
|
const require_itemId = require("../itemId-D2XAQ8RU.cjs");
|
|
9
10
|
const require_project = require("../project-DDTIVEMU.cjs");
|
|
10
|
-
const require_discovery = require("../discovery-CYIV1J5l.cjs");
|
|
11
11
|
const require_paths = require("../paths-DUHAueEv.cjs");
|
|
12
12
|
let node_fs = require("node:fs");
|
|
13
13
|
let node_path = require("node:path");
|
package/dist/google/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { i as hasStringProp, t as errorMessage } from "../dist-BmO4oSQy.js";
|
|
2
|
+
import { _t as createForwardingLogger, d as storeFor, n as discoverCollections, rt as getWorkspaceRoot, vt as createHostSlot } from "../discovery-DR4GNqrp.js";
|
|
2
3
|
import "../errors-0QwjDxsv.js";
|
|
3
4
|
import { t as truncate } from "../text-BQAuwKVj.js";
|
|
4
5
|
import { r as writeFileAtomic } from "../root-CqxPNSyK.js";
|
|
5
6
|
import { fetchWithTimeout } from "../utils/fetch.js";
|
|
6
7
|
import { f as parseIsoDate, p as parseIsoDateTime } from "../itemId-D_pSpa3U.js";
|
|
7
8
|
import { t as mergeIntoExisting } from "../project-mU6-xLfy.js";
|
|
8
|
-
import { _t as createForwardingLogger, d as storeFor, n as discoverCollections, rt as getWorkspaceRoot, vt as createHostSlot } from "../discovery-duLlygnJ.js";
|
|
9
9
|
import { t as mulmoConfigDir } from "../paths-BMQNHdaJ.js";
|
|
10
10
|
import { promises } from "node:fs";
|
|
11
11
|
import path, { join } from "node:path";
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_remote_host = require("../remote-host-
|
|
2
|
+
const require_remote_host = require("../remote-host-11euEZKP.cjs");
|
|
3
3
|
exports.COMMAND_SCOPE_PARAM = require_remote_host.COMMAND_SCOPE_PARAM;
|
|
4
4
|
exports.REMOTE_HOST_PROTOCOL_VERSION = require_remote_host.REMOTE_HOST_PROTOCOL_VERSION;
|
|
5
5
|
exports.RUNNER_HEALTH_STATES = require_remote_host.RUNNER_HEALTH_STATES;
|
|
6
6
|
exports.buildHostPresence = require_remote_host.buildHostPresence;
|
|
7
7
|
exports.byCreatedAt = require_remote_host.byCreatedAt;
|
|
8
8
|
exports.coerceJsonObject = require_remote_host.coerceJsonObject;
|
|
9
|
-
exports.commandsCollection = require_remote_host.commandsCollection;
|
|
10
|
-
exports.hostDoc = require_remote_host.hostDoc;
|
|
11
9
|
exports.isExpired = require_remote_host.isExpired;
|
|
12
10
|
exports.isRunnerHealth = require_remote_host.isRunnerHealth;
|
|
13
11
|
exports.isRunnerHealthState = require_remote_host.isRunnerHealthState;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { CollectionReference, DocumentData, DocumentReference, Firestore } from 'firebase/firestore';
|
|
2
1
|
export type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
3
2
|
[key: string]: JsonValue;
|
|
4
3
|
};
|
|
@@ -102,7 +101,5 @@ export interface HostPresence {
|
|
|
102
101
|
label?: string;
|
|
103
102
|
}
|
|
104
103
|
export declare const buildHostPresence: (channel: Channel, handlers: CommandHandlers, online: boolean, machine?: HostMachine) => HostPresence;
|
|
105
|
-
export declare const commandsCollection: (firestore: Firestore, channel: Channel) => CollectionReference<DocumentData>;
|
|
106
|
-
export declare const hostDoc: (firestore: Firestore, channel: Channel) => DocumentReference<DocumentData>;
|
|
107
104
|
export { RUNNER_HEALTH_STATES, isRunnerHealth, isRunnerHealthState } from './health.js';
|
|
108
105
|
export type { RunnerHealth, RunnerHealthState } from './health.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as COMMAND_SCOPE_PARAM, n as REMOTE_HOST_PROTOCOL_VERSION,
|
|
1
|
+
export { t as COMMAND_SCOPE_PARAM, n as REMOTE_HOST_PROTOCOL_VERSION, l as RUNNER_HEALTH_STATES, r as buildHostPresence, i as byCreatedAt, a as coerceJsonObject, o as isExpired, u as isRunnerHealth, d as isRunnerHealthState, s as readCommandScope, c as toJsonObject } from "../remote-host-TiMhcW1o.js";
|
|
@@ -2,12 +2,15 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_dist = require("../../dist-734JaRYi.cjs");
|
|
3
3
|
require("../../errorMessage-D0kR547_.cjs");
|
|
4
4
|
const require_listen = require("../../listen-OmfLDX1l.cjs");
|
|
5
|
-
const require_remote_host = require("../../remote-host-
|
|
5
|
+
const require_remote_host = require("../../remote-host-11euEZKP.cjs");
|
|
6
6
|
let firebase_firestore = require("firebase/firestore");
|
|
7
7
|
let node_perf_hooks = require("node:perf_hooks");
|
|
8
8
|
let firebase_auth = require("firebase/auth");
|
|
9
9
|
let firebase_app = require("firebase/app");
|
|
10
10
|
let firebase_storage = require("firebase/storage");
|
|
11
|
+
// src/remote-host/server/paths.ts
|
|
12
|
+
var commandsCollection = (firestore, channel) => (0, firebase_firestore.collection)(firestore, "users", channel.uid, "hosts", channel.hostId, "commands");
|
|
13
|
+
var hostDoc = (firestore, channel) => (0, firebase_firestore.doc)(firestore, "users", channel.uid, "hosts", channel.hostId);
|
|
11
14
|
var isPlainObject = (value) => {
|
|
12
15
|
const proto = Object.getPrototypeOf(value);
|
|
13
16
|
return proto === Object.prototype || proto === null;
|
|
@@ -272,7 +275,7 @@ var listenForCommands = (queuedCommands, ctx, goOffline) => {
|
|
|
272
275
|
var heartbeatMs = (options) => options.heartbeatMs ?? 6e4;
|
|
273
276
|
var presenceStaleAfterMs = (options = {}) => heartbeatMs(options) * 3;
|
|
274
277
|
var buildPresenceBeat = (firestore, channel, handlers, options, onStale) => {
|
|
275
|
-
const presence =
|
|
278
|
+
const presence = hostDoc(firestore, channel);
|
|
276
279
|
const report = (message) => options.onEvent?.({
|
|
277
280
|
phase: "error",
|
|
278
281
|
method: "presence",
|
|
@@ -313,7 +316,7 @@ var startHostRunner = (firestore, channel, handlers, options = {}) => {
|
|
|
313
316
|
}
|
|
314
317
|
presence.announce(true);
|
|
315
318
|
run.beat = setInterval(presence.beat, heartbeatMs(options));
|
|
316
|
-
run.stopListening = listenForCommands((0, firebase_firestore.query)(
|
|
319
|
+
run.stopListening = listenForCommands((0, firebase_firestore.query)(commandsCollection(firestore, channel), (0, firebase_firestore.where)("status", "==", "queued")), {
|
|
317
320
|
firestore,
|
|
318
321
|
handlers,
|
|
319
322
|
options,
|
|
@@ -541,7 +544,7 @@ var presenceIsFresh = (data, now, staleAfterMs = PRESENCE_STALE_MS) => {
|
|
|
541
544
|
var createPresenceProbe = (deps) => {
|
|
542
545
|
const now = deps.now ?? Date.now;
|
|
543
546
|
return async () => {
|
|
544
|
-
return presenceIsFresh((await withTimeout((0, firebase_firestore.getDocFromServer)(
|
|
547
|
+
return presenceIsFresh((await withTimeout((0, firebase_firestore.getDocFromServer)(hostDoc(deps.firestore(), deps.channel)), deps.timeoutMs ?? PROBE_TIMEOUT_MS)).data(), now(), deps.staleAfterMs ?? PRESENCE_STALE_MS);
|
|
545
548
|
};
|
|
546
549
|
};
|
|
547
550
|
// src/remote-host/server/lifecycle.ts
|
|
@@ -799,12 +802,14 @@ exports.DEFAULT_HEARTBEAT_MS = DEFAULT_HEARTBEAT_MS;
|
|
|
799
802
|
exports.LISTEN_RETRY_WINDOW_MS = require_listen.LISTEN_RETRY_WINDOW_MS;
|
|
800
803
|
exports.PRESENCE_STALE_BEATS = PRESENCE_STALE_BEATS;
|
|
801
804
|
exports.PRESENCE_STALE_MS = PRESENCE_STALE_MS;
|
|
805
|
+
exports.commandsCollection = commandsCollection;
|
|
802
806
|
exports.createHostSessionPersistence = createHostSessionPersistence;
|
|
803
807
|
exports.createPresenceProbe = createPresenceProbe;
|
|
804
808
|
exports.createRemoteHost = createRemoteHost;
|
|
805
809
|
exports.createRemoteHostAuth = createRemoteHostAuth;
|
|
806
810
|
exports.createRemoteHostFirebase = createRemoteHostFirebase;
|
|
807
811
|
exports.createRemoteHostSession = createRemoteHostSession;
|
|
812
|
+
exports.hostDoc = hostDoc;
|
|
808
813
|
exports.isSeedableBlob = isSeedableBlob;
|
|
809
814
|
exports.presenceIsFresh = presenceIsFresh;
|
|
810
815
|
exports.presenceStaleAfterMs = presenceStaleAfterMs;
|