@cerefox/memory 1.0.1 → 1.0.3
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/AGENT_QUICK_REFERENCE.md +2 -1
- package/dist/bin/cerefox.js +65 -45
- package/dist/frontend/assets/{index-D9FTvsV4.js → index-Csj-6UHY.js} +25 -25
- package/dist/frontend/assets/index-Csj-6UHY.js.map +1 -0
- package/dist/frontend/index.html +1 -1
- package/dist/server-assets/_shared/ef-meta/index.ts +11 -1
- package/dist/server-assets/_shared/mcp-tools/get-help-content.ts +2 -2
- package/dist/server-assets/_shared/mcp-tools/search.ts +15 -1
- package/dist/server-assets/db/rpcs.sql +124 -15
- package/dist/server-assets/db/schema.sql +1 -1
- package/docs/guides/cli.md +2 -2
- package/docs/guides/migration-1.0.md +1 -1
- package/docs/guides/operational-cost.md +1 -0
- package/package.json +4 -4
- package/dist/frontend/assets/index-D9FTvsV4.js.map +0 -1
package/AGENT_QUICK_REFERENCE.md
CHANGED
|
@@ -28,7 +28,8 @@ Cerefox is a persistent, shared knowledge base. You have **10 MCP tools** (9 of
|
|
|
28
28
|
7. **Deletes are soft (recoverable); purge is web-UI-only.** If you decide to delete, surface it to the user (`I soft-deleted X — recoverable from the Cerefox web UI trash`). You cannot un-do your own delete from agent code by design.
|
|
29
29
|
8. **Cross-doc links inside content**: **always use `[Text](document-uuid)`.** UUIDs are the only fully reliable link form — stable across title changes, never ambiguous, no encoding gotchas. Every `cerefox_search` result shows `[id: <uuid>]` after the title; grab it and use it. Title-based linking (`[Text](<Title With Spaces>)`) is fragile (breaks on colons, parens, ampersands, brackets — silently navigates to wrong page) — **don't write title-based links**; do an extra search to get the UUID instead. Repo-path forms (`[Text](docs/path.md)`) exist for repo-ingested files; don't construct manually. See `AGENT_GUIDE.md → Writing linkable content` for the full rule.
|
|
30
30
|
9. **Concurrency: content updates require `expected_content_hash`.** Pass the `content_hash` you read (shown by `cerefox_get_document`, `cerefox_search`, and `cerefox_metadata_search`) when updating a document. If it's stale you get a **conflict** — re-read the document, merge your changes into the latest content, retry with the new hash. **Never resolve a conflict by overwriting blindly** — the current content includes another writer's work. `last_write_wins: true` skips the check; use it ONLY when an external source of truth makes conflicts meaningless (file re-sync), never to silence a conflict.
|
|
31
|
-
10. **
|
|
31
|
+
10. **Search: prefer a few distinctive terms; heed `below confidence`.** When nothing clears the relevance threshold, `cerefox_search` returns the closest candidates prefixed with a `below confidence` warning instead of an empty set — that flag means **weak signal, not absent knowledge**: check the candidates' scores and titles before concluding the KB lacks the content. A truly empty response means nothing even weakly related exists.
|
|
32
|
+
11. **Project memberships — non-destructive by default**: on `cerefox_ingest` updates, **`project_name` (singular) is a non-destructive add** (ensures membership, preserves others). Use **`project_names` (list)** when you want to set the doc's full project set in one call (destructive replace). For metadata-only project changes without writing content, use **`cerefox_set_document_projects(document_id, project_names)`** — that tool is the destructive-replace contract made explicit. Never call `cerefox_set_document_projects` with a single name when you mean "add" — that would REMOVE the doc from all other projects. When in doubt, use `cerefox_ingest` with singular `project_name`.
|
|
32
33
|
|
|
33
34
|
## Update Workflow (ID-based -- preferred)
|
|
34
35
|
|
package/dist/bin/cerefox.js
CHANGED
|
@@ -7184,7 +7184,7 @@ var exports_meta = {};
|
|
|
7184
7184
|
__export(exports_meta, {
|
|
7185
7185
|
PKG_VERSION: () => PKG_VERSION
|
|
7186
7186
|
});
|
|
7187
|
-
var PKG_VERSION = "1.0.
|
|
7187
|
+
var PKG_VERSION = "1.0.3";
|
|
7188
7188
|
var init_meta = () => {};
|
|
7189
7189
|
|
|
7190
7190
|
// ../../node_modules/.bun/tslib@2.8.1/node_modules/tslib/tslib.js
|
|
@@ -54966,11 +54966,11 @@ var init_get_document = __esm(() => {
|
|
|
54966
54966
|
});
|
|
54967
54967
|
|
|
54968
54968
|
// ../../_shared/mcp-tools/get-help-content.ts
|
|
54969
|
-
var HELP_FULL = '# Cerefox Knowledge Base -- Agent Quick Reference\n\nCerefox is a persistent, shared knowledge base. You have **10 MCP tools** (9 of them have CLI equivalents — `cerefox_get_help` is MCP-only). For the full guide, search Cerefox for "How AI Agents Use Cerefox" or call `cerefox_get_help` to retrieve this content over MCP.\n\n## Tools\n\n| Tool | Purpose | Key params |\n|------|---------|------------|\n| `cerefox_search` | Find documents (hybrid FTS + semantic) | `query` (required), `project_name`, `metadata_filter`, `requestor` |\n| `cerefox_ingest` | Save or update a document | `title`, `content` (required), `document_id` (update by ID), `expected_content_hash` (**required on content updates** — see rule 9), `last_write_wins`, `update_if_exists`, `project_name` (single, non-destructive add on update), `project_names` (list, destructive replace on update), `metadata` (omit on update to keep existing tags; `{}` clears), `author` |\n| `cerefox_get_document` | Get full document by ID (header includes `content_hash` — the update token) | `document_id` (required) |\n| `cerefox_list_versions` | Version history of a document | `document_id` (required) |\n| `cerefox_metadata_search` | Find or list docs by metadata, project, or time (no text query) | `metadata_filter`, `project_name` (list a project\'s docs), `updated_since`, `include_content` — **at least one** of metadata_filter/project_name/updated_since/created_since |\n| `cerefox_list_metadata_keys` | Discover available metadata keys | (none required) |\n| `cerefox_list_projects` | List all projects | (none required) |\n| `cerefox_set_document_projects` | Set doc\'s project memberships to exactly the given list (destructive replace; metadata-only, no content change) | `document_id`, `project_names` (required) |\n| `cerefox_get_audit_log` | Query write operation history | `document_id`, `author`, `operation`, `since` |\n| `cerefox_get_help` | Retrieve Cerefox conventions (this reference) over MCP. **Call this whenever uncertain.** | `topic` (optional, case-insensitive H2 substring match) |\n\n## Essential Rules\n\n1. **Search before ingesting** -- check if the document exists first.\n2. **Prefer ID-based updates** -- pass `document_id` from search results for deterministic updates. Falls back to title-matching with `update_if_exists: true`.\n3. **Set `author`/`requestor`** to your name on every call (e.g., "Claude Code", "archiver"). On MCP, pass as parameters. On CLI, pass `--author`/`--author-type`/`--requestor` flags, or rely on `CEREFOX_AUTHOR_NAME`/`CEREFOX_AUTHOR_TYPE`/`CEREFOX_REQUESTOR_NAME` env vars set in the user\'s `.env`.\n4. **Use `document_id` from search results** `[id: uuid]` for get_document and list_versions.\n5. **Add metadata** -- at minimum `type` ("decision-log", "research", "design-doc") and `status` ("active", "draft").\n6. **Write structured Markdown** with H1/H2/H3 headings for good chunking and search.\n7. **Deletes are soft (recoverable); purge is web-UI-only.** If you decide to delete, surface it to the user (`I soft-deleted X — recoverable from the Cerefox web UI trash`). You cannot un-do your own delete from agent code by design.\n8. **Cross-doc links inside content**: **always use `[Text](document-uuid)`.** UUIDs are the only fully reliable link form — stable across title changes, never ambiguous, no encoding gotchas. Every `cerefox_search` result shows `[id: <uuid>]` after the title; grab it and use it. Title-based linking (`[Text](<Title With Spaces>)`) is fragile (breaks on colons, parens, ampersands, brackets — silently navigates to wrong page) — **don\'t write title-based links**; do an extra search to get the UUID instead. Repo-path forms (`[Text](docs/path.md)`) exist for repo-ingested files; don\'t construct manually. See `AGENT_GUIDE.md → Writing linkable content` for the full rule.\n9. **Concurrency: content updates require `expected_content_hash`.** Pass the `content_hash` you read (shown by `cerefox_get_document`, `cerefox_search`, and `cerefox_metadata_search`) when updating a document. If it\'s stale you get a **conflict** — re-read the document, merge your changes into the latest content, retry with the new hash. **Never resolve a conflict by overwriting blindly** — the current content includes another writer\'s work. `last_write_wins: true` skips the check; use it ONLY when an external source of truth makes conflicts meaningless (file re-sync), never to silence a conflict.\n10. **Project memberships — non-destructive by default**: on `cerefox_ingest` updates, **`project_name` (singular) is a non-destructive add** (ensures membership, preserves others). Use **`project_names` (list)** when you want to set the doc\'s full project set in one call (destructive replace). For metadata-only project changes without writing content, use **`cerefox_set_document_projects(document_id, project_names)`** — that tool is the destructive-replace contract made explicit. Never call `cerefox_set_document_projects` with a single name when you mean "add" — that would REMOVE the doc from all other projects. When in doubt, use `cerefox_ingest` with singular `project_name`.\n\n## Update Workflow (ID-based -- preferred)\n\n```\nsearch("topic") -> find doc [id: abc123] -> get_document(abc123) -> note its content_hash -> modify ->\ningest(title="Same Title", content="...", document_id="abc123",\n expected_content_hash="<the hash you read>", author="my-agent")\n```\n\nOn a **conflict** error: get_document again (fresh content + fresh hash) -> merge your changes -> retry with the new hash.\n\n## Update Workflow (title-based -- fallback)\n\n```\nsearch("topic") -> find doc (note its hash) -> modify ->\ningest(title="Same Title", content="...", update_if_exists=true,\n expected_content_hash="<the hash you read>", author="my-agent")\n```\n\n## Catch-Up Workflow\n\n```\nmetadata_search(metadata_filter={"type": "decision-log"}, updated_since="2026-03-28T00:00:00Z")\n```\n\n## CLI fallback (when MCP is unavailable)\n\nIf `cerefox_search` is not in your tool list, your user has likely installed the Cerefox CLI. The canonical invocation is plain **`cerefox <subcommand>`** (the TypeScript CLI, installed via `npm install -g @cerefox/memory`). It uses a resource-verb shape (`cerefox document get`, `cerefox project list`, …).\n\nSame operations, same conventions. Full reference: [`docs/guides/cli.md`](docs/guides/cli.md). CLI flag names match MCP parameter names exactly (e.g. `metadata_filter` ↔ `--metadata-filter`); common flags also have single-letter short forms (`-f`, `-p`, `-c`, `-m`, `-u`, `-a`, `-r`). Use the canonical long name (what `--help` shows) or its short form — there are no long-form aliases like `--filter` or `--count`.\n\n| MCP tool | CLI |\n|---|---|\n| `cerefox_search` | `cerefox search "<q>" --requestor "<your-name>"` |\n| `cerefox_ingest` (paste) | `printf \'...\' \\| cerefox document ingest --paste --title "<t>" --author "<your-name>" --author-type agent` |\n| `cerefox_ingest` (update by ID) | `printf \'...\' \\| cerefox document ingest --paste --title "<t>" --document-id "<uuid>" --expected-content-hash "<hash>" --author "<your-name>" --author-type agent` |\n| `cerefox_get_document` | `cerefox document get <id> --version-id <vid> --requestor "<your-name>"` |\n| `cerefox_list_versions` | `cerefox document version list <id> --requestor "<your-name>"` |\n| `cerefox_list_projects` | `cerefox project list --requestor "<your-name>"` |\n| `cerefox_list_metadata_keys` | `cerefox metadata keys` |\n| `cerefox_metadata_search` | `cerefox metadata search --metadata-filter \'<json>\' --requestor "<your-name>"` (list a project: `cerefox document list --project <name>`) |\n| `cerefox_set_document_projects` | `cerefox document set-projects <id> <name...> --author "<your-name>" --author-type agent` (or `--clear` to remove all) |\n| `cerefox_get_audit_log` | `cerefox audit list --requestor "<your-name>"` (add `--json` for scripted access) |\n| `cerefox_get_help` | `cerefox guides show agent-quick-reference` (or `cerefox guides list` for the full bundled-docs index) |\n\n**Set identity on every call**, exactly as you would on MCP:\n- Writes (`document ingest`, `document ingest-dir`): `--author "<your-name>" --author-type agent`\n- Reads: `--requestor "<your-name>"`\n\nOr have your user set `CEREFOX_AUTHOR_NAME` / `CEREFOX_AUTHOR_TYPE` / `CEREFOX_REQUESTOR_NAME` in their `.env` to apply defaults once.\n', HELP_SECTIONS, HELP_SECTION_HEADINGS;
|
|
54969
|
+
var HELP_FULL = '# Cerefox Knowledge Base -- Agent Quick Reference\n\nCerefox is a persistent, shared knowledge base. You have **10 MCP tools** (9 of them have CLI equivalents — `cerefox_get_help` is MCP-only). For the full guide, search Cerefox for "How AI Agents Use Cerefox" or call `cerefox_get_help` to retrieve this content over MCP.\n\n## Tools\n\n| Tool | Purpose | Key params |\n|------|---------|------------|\n| `cerefox_search` | Find documents (hybrid FTS + semantic) | `query` (required), `project_name`, `metadata_filter`, `requestor` |\n| `cerefox_ingest` | Save or update a document | `title`, `content` (required), `document_id` (update by ID), `expected_content_hash` (**required on content updates** — see rule 9), `last_write_wins`, `update_if_exists`, `project_name` (single, non-destructive add on update), `project_names` (list, destructive replace on update), `metadata` (omit on update to keep existing tags; `{}` clears), `author` |\n| `cerefox_get_document` | Get full document by ID (header includes `content_hash` — the update token) | `document_id` (required) |\n| `cerefox_list_versions` | Version history of a document | `document_id` (required) |\n| `cerefox_metadata_search` | Find or list docs by metadata, project, or time (no text query) | `metadata_filter`, `project_name` (list a project\'s docs), `updated_since`, `include_content` — **at least one** of metadata_filter/project_name/updated_since/created_since |\n| `cerefox_list_metadata_keys` | Discover available metadata keys | (none required) |\n| `cerefox_list_projects` | List all projects | (none required) |\n| `cerefox_set_document_projects` | Set doc\'s project memberships to exactly the given list (destructive replace; metadata-only, no content change) | `document_id`, `project_names` (required) |\n| `cerefox_get_audit_log` | Query write operation history | `document_id`, `author`, `operation`, `since` |\n| `cerefox_get_help` | Retrieve Cerefox conventions (this reference) over MCP. **Call this whenever uncertain.** | `topic` (optional, case-insensitive H2 substring match) |\n\n## Essential Rules\n\n1. **Search before ingesting** -- check if the document exists first.\n2. **Prefer ID-based updates** -- pass `document_id` from search results for deterministic updates. Falls back to title-matching with `update_if_exists: true`.\n3. **Set `author`/`requestor`** to your name on every call (e.g., "Claude Code", "archiver"). On MCP, pass as parameters. On CLI, pass `--author`/`--author-type`/`--requestor` flags, or rely on `CEREFOX_AUTHOR_NAME`/`CEREFOX_AUTHOR_TYPE`/`CEREFOX_REQUESTOR_NAME` env vars set in the user\'s `.env`.\n4. **Use `document_id` from search results** `[id: uuid]` for get_document and list_versions.\n5. **Add metadata** -- at minimum `type` ("decision-log", "research", "design-doc") and `status` ("active", "draft").\n6. **Write structured Markdown** with H1/H2/H3 headings for good chunking and search.\n7. **Deletes are soft (recoverable); purge is web-UI-only.** If you decide to delete, surface it to the user (`I soft-deleted X — recoverable from the Cerefox web UI trash`). You cannot un-do your own delete from agent code by design.\n8. **Cross-doc links inside content**: **always use `[Text](document-uuid)`.** UUIDs are the only fully reliable link form — stable across title changes, never ambiguous, no encoding gotchas. Every `cerefox_search` result shows `[id: <uuid>]` after the title; grab it and use it. Title-based linking (`[Text](<Title With Spaces>)`) is fragile (breaks on colons, parens, ampersands, brackets — silently navigates to wrong page) — **don\'t write title-based links**; do an extra search to get the UUID instead. Repo-path forms (`[Text](docs/path.md)`) exist for repo-ingested files; don\'t construct manually. See `AGENT_GUIDE.md → Writing linkable content` for the full rule.\n9. **Concurrency: content updates require `expected_content_hash`.** Pass the `content_hash` you read (shown by `cerefox_get_document`, `cerefox_search`, and `cerefox_metadata_search`) when updating a document. If it\'s stale you get a **conflict** — re-read the document, merge your changes into the latest content, retry with the new hash. **Never resolve a conflict by overwriting blindly** — the current content includes another writer\'s work. `last_write_wins: true` skips the check; use it ONLY when an external source of truth makes conflicts meaningless (file re-sync), never to silence a conflict.\n10. **Search: prefer a few distinctive terms; heed `below confidence`.** When nothing clears the relevance threshold, `cerefox_search` returns the closest candidates prefixed with a `below confidence` warning instead of an empty set — that flag means **weak signal, not absent knowledge**: check the candidates\' scores and titles before concluding the KB lacks the content. A truly empty response means nothing even weakly related exists.\n11. **Project memberships — non-destructive by default**: on `cerefox_ingest` updates, **`project_name` (singular) is a non-destructive add** (ensures membership, preserves others). Use **`project_names` (list)** when you want to set the doc\'s full project set in one call (destructive replace). For metadata-only project changes without writing content, use **`cerefox_set_document_projects(document_id, project_names)`** — that tool is the destructive-replace contract made explicit. Never call `cerefox_set_document_projects` with a single name when you mean "add" — that would REMOVE the doc from all other projects. When in doubt, use `cerefox_ingest` with singular `project_name`.\n\n## Update Workflow (ID-based -- preferred)\n\n```\nsearch("topic") -> find doc [id: abc123] -> get_document(abc123) -> note its content_hash -> modify ->\ningest(title="Same Title", content="...", document_id="abc123",\n expected_content_hash="<the hash you read>", author="my-agent")\n```\n\nOn a **conflict** error: get_document again (fresh content + fresh hash) -> merge your changes -> retry with the new hash.\n\n## Update Workflow (title-based -- fallback)\n\n```\nsearch("topic") -> find doc (note its hash) -> modify ->\ningest(title="Same Title", content="...", update_if_exists=true,\n expected_content_hash="<the hash you read>", author="my-agent")\n```\n\n## Catch-Up Workflow\n\n```\nmetadata_search(metadata_filter={"type": "decision-log"}, updated_since="2026-03-28T00:00:00Z")\n```\n\n## CLI fallback (when MCP is unavailable)\n\nIf `cerefox_search` is not in your tool list, your user has likely installed the Cerefox CLI. The canonical invocation is plain **`cerefox <subcommand>`** (the TypeScript CLI, installed via `npm install -g @cerefox/memory`). It uses a resource-verb shape (`cerefox document get`, `cerefox project list`, …).\n\nSame operations, same conventions. Full reference: [`docs/guides/cli.md`](docs/guides/cli.md). CLI flag names match MCP parameter names exactly (e.g. `metadata_filter` ↔ `--metadata-filter`); common flags also have single-letter short forms (`-f`, `-p`, `-c`, `-m`, `-u`, `-a`, `-r`). Use the canonical long name (what `--help` shows) or its short form — there are no long-form aliases like `--filter` or `--count`.\n\n| MCP tool | CLI |\n|---|---|\n| `cerefox_search` | `cerefox search "<q>" --requestor "<your-name>"` |\n| `cerefox_ingest` (paste) | `printf \'...\' \\| cerefox document ingest --paste --title "<t>" --author "<your-name>" --author-type agent` |\n| `cerefox_ingest` (update by ID) | `printf \'...\' \\| cerefox document ingest --paste --title "<t>" --document-id "<uuid>" --expected-content-hash "<hash>" --author "<your-name>" --author-type agent` |\n| `cerefox_get_document` | `cerefox document get <id> --version-id <vid> --requestor "<your-name>"` |\n| `cerefox_list_versions` | `cerefox document version list <id> --requestor "<your-name>"` |\n| `cerefox_list_projects` | `cerefox project list --requestor "<your-name>"` |\n| `cerefox_list_metadata_keys` | `cerefox metadata keys` |\n| `cerefox_metadata_search` | `cerefox metadata search --metadata-filter \'<json>\' --requestor "<your-name>"` (list a project: `cerefox document list --project <name>`) |\n| `cerefox_set_document_projects` | `cerefox document set-projects <id> <name...> --author "<your-name>" --author-type agent` (or `--clear` to remove all) |\n| `cerefox_get_audit_log` | `cerefox audit list --requestor "<your-name>"` (add `--json` for scripted access) |\n| `cerefox_get_help` | `cerefox guides show agent-quick-reference` (or `cerefox guides list` for the full bundled-docs index) |\n\n**Set identity on every call**, exactly as you would on MCP:\n- Writes (`document ingest`, `document ingest-dir`): `--author "<your-name>" --author-type agent`\n- Reads: `--requestor "<your-name>"`\n\nOr have your user set `CEREFOX_AUTHOR_NAME` / `CEREFOX_AUTHOR_TYPE` / `CEREFOX_REQUESTOR_NAME` in their `.env` to apply defaults once.\n', HELP_SECTIONS, HELP_SECTION_HEADINGS;
|
|
54970
54970
|
var init_get_help_content = __esm(() => {
|
|
54971
54971
|
HELP_SECTIONS = {
|
|
54972
54972
|
Tools: "## Tools\n\n| Tool | Purpose | Key params |\n|------|---------|------------|\n| `cerefox_search` | Find documents (hybrid FTS + semantic) | `query` (required), `project_name`, `metadata_filter`, `requestor` |\n| `cerefox_ingest` | Save or update a document | `title`, `content` (required), `document_id` (update by ID), `expected_content_hash` (**required on content updates** — see rule 9), `last_write_wins`, `update_if_exists`, `project_name` (single, non-destructive add on update), `project_names` (list, destructive replace on update), `metadata` (omit on update to keep existing tags; `{}` clears), `author` |\n| `cerefox_get_document` | Get full document by ID (header includes `content_hash` — the update token) | `document_id` (required) |\n| `cerefox_list_versions` | Version history of a document | `document_id` (required) |\n| `cerefox_metadata_search` | Find or list docs by metadata, project, or time (no text query) | `metadata_filter`, `project_name` (list a project's docs), `updated_since`, `include_content` — **at least one** of metadata_filter/project_name/updated_since/created_since |\n| `cerefox_list_metadata_keys` | Discover available metadata keys | (none required) |\n| `cerefox_list_projects` | List all projects | (none required) |\n| `cerefox_set_document_projects` | Set doc's project memberships to exactly the given list (destructive replace; metadata-only, no content change) | `document_id`, `project_names` (required) |\n| `cerefox_get_audit_log` | Query write operation history | `document_id`, `author`, `operation`, `since` |\n| `cerefox_get_help` | Retrieve Cerefox conventions (this reference) over MCP. **Call this whenever uncertain.** | `topic` (optional, case-insensitive H2 substring match) |",
|
|
54973
|
-
"Essential Rules": '## Essential Rules\n\n1. **Search before ingesting** -- check if the document exists first.\n2. **Prefer ID-based updates** -- pass `document_id` from search results for deterministic updates. Falls back to title-matching with `update_if_exists: true`.\n3. **Set `author`/`requestor`** to your name on every call (e.g., "Claude Code", "archiver"). On MCP, pass as parameters. On CLI, pass `--author`/`--author-type`/`--requestor` flags, or rely on `CEREFOX_AUTHOR_NAME`/`CEREFOX_AUTHOR_TYPE`/`CEREFOX_REQUESTOR_NAME` env vars set in the user\'s `.env`.\n4. **Use `document_id` from search results** `[id: uuid]` for get_document and list_versions.\n5. **Add metadata** -- at minimum `type` ("decision-log", "research", "design-doc") and `status` ("active", "draft").\n6. **Write structured Markdown** with H1/H2/H3 headings for good chunking and search.\n7. **Deletes are soft (recoverable); purge is web-UI-only.** If you decide to delete, surface it to the user (`I soft-deleted X — recoverable from the Cerefox web UI trash`). You cannot un-do your own delete from agent code by design.\n8. **Cross-doc links inside content**: **always use `[Text](document-uuid)`.** UUIDs are the only fully reliable link form — stable across title changes, never ambiguous, no encoding gotchas. Every `cerefox_search` result shows `[id: <uuid>]` after the title; grab it and use it. Title-based linking (`[Text](<Title With Spaces>)`) is fragile (breaks on colons, parens, ampersands, brackets — silently navigates to wrong page) — **don\'t write title-based links**; do an extra search to get the UUID instead. Repo-path forms (`[Text](docs/path.md)`) exist for repo-ingested files; don\'t construct manually. See `AGENT_GUIDE.md → Writing linkable content` for the full rule.\n9. **Concurrency: content updates require `expected_content_hash`.** Pass the `content_hash` you read (shown by `cerefox_get_document`, `cerefox_search`, and `cerefox_metadata_search`) when updating a document. If it\'s stale you get a **conflict** — re-read the document, merge your changes into the latest content, retry with the new hash. **Never resolve a conflict by overwriting blindly** — the current content includes another writer\'s work. `last_write_wins: true` skips the check; use it ONLY when an external source of truth makes conflicts meaningless (file re-sync), never to silence a conflict.\n10. **Project memberships — non-destructive by default**: on `cerefox_ingest` updates, **`project_name` (singular) is a non-destructive add** (ensures membership, preserves others). Use **`project_names` (list)** when you want to set the doc\'s full project set in one call (destructive replace). For metadata-only project changes without writing content, use **`cerefox_set_document_projects(document_id, project_names)`** — that tool is the destructive-replace contract made explicit. Never call `cerefox_set_document_projects` with a single name when you mean "add" — that would REMOVE the doc from all other projects. When in doubt, use `cerefox_ingest` with singular `project_name`.',
|
|
54973
|
+
"Essential Rules": '## Essential Rules\n\n1. **Search before ingesting** -- check if the document exists first.\n2. **Prefer ID-based updates** -- pass `document_id` from search results for deterministic updates. Falls back to title-matching with `update_if_exists: true`.\n3. **Set `author`/`requestor`** to your name on every call (e.g., "Claude Code", "archiver"). On MCP, pass as parameters. On CLI, pass `--author`/`--author-type`/`--requestor` flags, or rely on `CEREFOX_AUTHOR_NAME`/`CEREFOX_AUTHOR_TYPE`/`CEREFOX_REQUESTOR_NAME` env vars set in the user\'s `.env`.\n4. **Use `document_id` from search results** `[id: uuid]` for get_document and list_versions.\n5. **Add metadata** -- at minimum `type` ("decision-log", "research", "design-doc") and `status` ("active", "draft").\n6. **Write structured Markdown** with H1/H2/H3 headings for good chunking and search.\n7. **Deletes are soft (recoverable); purge is web-UI-only.** If you decide to delete, surface it to the user (`I soft-deleted X — recoverable from the Cerefox web UI trash`). You cannot un-do your own delete from agent code by design.\n8. **Cross-doc links inside content**: **always use `[Text](document-uuid)`.** UUIDs are the only fully reliable link form — stable across title changes, never ambiguous, no encoding gotchas. Every `cerefox_search` result shows `[id: <uuid>]` after the title; grab it and use it. Title-based linking (`[Text](<Title With Spaces>)`) is fragile (breaks on colons, parens, ampersands, brackets — silently navigates to wrong page) — **don\'t write title-based links**; do an extra search to get the UUID instead. Repo-path forms (`[Text](docs/path.md)`) exist for repo-ingested files; don\'t construct manually. See `AGENT_GUIDE.md → Writing linkable content` for the full rule.\n9. **Concurrency: content updates require `expected_content_hash`.** Pass the `content_hash` you read (shown by `cerefox_get_document`, `cerefox_search`, and `cerefox_metadata_search`) when updating a document. If it\'s stale you get a **conflict** — re-read the document, merge your changes into the latest content, retry with the new hash. **Never resolve a conflict by overwriting blindly** — the current content includes another writer\'s work. `last_write_wins: true` skips the check; use it ONLY when an external source of truth makes conflicts meaningless (file re-sync), never to silence a conflict.\n10. **Search: prefer a few distinctive terms; heed `below confidence`.** When nothing clears the relevance threshold, `cerefox_search` returns the closest candidates prefixed with a `below confidence` warning instead of an empty set — that flag means **weak signal, not absent knowledge**: check the candidates\' scores and titles before concluding the KB lacks the content. A truly empty response means nothing even weakly related exists.\n11. **Project memberships — non-destructive by default**: on `cerefox_ingest` updates, **`project_name` (singular) is a non-destructive add** (ensures membership, preserves others). Use **`project_names` (list)** when you want to set the doc\'s full project set in one call (destructive replace). For metadata-only project changes without writing content, use **`cerefox_set_document_projects(document_id, project_names)`** — that tool is the destructive-replace contract made explicit. Never call `cerefox_set_document_projects` with a single name when you mean "add" — that would REMOVE the doc from all other projects. When in doubt, use `cerefox_ingest` with singular `project_name`.',
|
|
54974
54974
|
"Update Workflow (ID-based -- preferred)": `## Update Workflow (ID-based -- preferred)
|
|
54975
54975
|
|
|
54976
54976
|
\`\`\`
|
|
@@ -55644,10 +55644,12 @@ async function handler9(supabase, args, ctx) {
|
|
|
55644
55644
|
if (accepted.length === 0)
|
|
55645
55645
|
return "No results found.";
|
|
55646
55646
|
const rows = accepted;
|
|
55647
|
+
const belowConfidence = rows.length > 0 && rows.every((r) => r.below_confidence === true);
|
|
55647
55648
|
const parts = rows.map((row) => {
|
|
55648
55649
|
const title = row.doc_title ?? "Untitled";
|
|
55649
55650
|
const docId = row.document_id ? ` [id: ${row.document_id}]` : "";
|
|
55650
|
-
const
|
|
55651
|
+
const rawScore = row.best_score ?? row.score;
|
|
55652
|
+
const score = rawScore != null ? ` (score: ${rawScore.toFixed(3)})` : "";
|
|
55651
55653
|
const partial = row.is_partial ? ` -- partial (${row.chunk_count} of ${(row.total_chars ?? 0).toLocaleString()} chars)` : "";
|
|
55652
55654
|
const hash = row.content_hash ? `
|
|
55653
55655
|
hash: ${row.content_hash}` : "";
|
|
@@ -55660,6 +55662,11 @@ ${row.full_content ?? ""}`;
|
|
|
55660
55662
|
---
|
|
55661
55663
|
|
|
55662
55664
|
`);
|
|
55665
|
+
if (belowConfidence) {
|
|
55666
|
+
output = `⚠ No results cleared the confidence threshold. Showing the closest ${rows.length} ` + `candidate(s) with scores — judge relevance yourself; a low score means weak signal, ` + `not necessarily absent knowledge.
|
|
55667
|
+
|
|
55668
|
+
` + output;
|
|
55669
|
+
}
|
|
55663
55670
|
if (truncated) {
|
|
55664
55671
|
output += `
|
|
55665
55672
|
|
|
@@ -59004,7 +59011,7 @@ var init_v4_mini = __esm(() => {
|
|
|
59004
59011
|
init_mini();
|
|
59005
59012
|
});
|
|
59006
59013
|
|
|
59007
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0
|
|
59014
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
|
|
59008
59015
|
function isZ4Schema(s) {
|
|
59009
59016
|
const schema = s;
|
|
59010
59017
|
return !!schema._zod;
|
|
@@ -59811,7 +59818,7 @@ var init_v4 = __esm(() => {
|
|
|
59811
59818
|
init_classic();
|
|
59812
59819
|
});
|
|
59813
59820
|
|
|
59814
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0
|
|
59821
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
59815
59822
|
var LATEST_PROTOCOL_VERSION = "2025-11-25", SUPPORTED_PROTOCOL_VERSIONS, RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task", JSONRPC_VERSION = "2.0", AssertObjectSchema, ProgressTokenSchema, CursorSchema, TaskCreationParamsSchema, TaskMetadataSchema, RelatedTaskMetadataSchema, RequestMetaSchema, BaseRequestParamsSchema, TaskAugmentedRequestParamsSchema, isTaskAugmentedRequestParams = (value) => TaskAugmentedRequestParamsSchema.safeParse(value).success, RequestSchema, NotificationsParamsSchema, NotificationSchema, ResultSchema, RequestIdSchema, JSONRPCRequestSchema, isJSONRPCRequest = (value) => JSONRPCRequestSchema.safeParse(value).success, JSONRPCNotificationSchema, isJSONRPCNotification = (value) => JSONRPCNotificationSchema.safeParse(value).success, JSONRPCResultResponseSchema, isJSONRPCResultResponse = (value) => JSONRPCResultResponseSchema.safeParse(value).success, ErrorCode, JSONRPCErrorResponseSchema, isJSONRPCErrorResponse = (value) => JSONRPCErrorResponseSchema.safeParse(value).success, JSONRPCMessageSchema, JSONRPCResponseSchema, EmptyResultSchema, CancelledNotificationParamsSchema, CancelledNotificationSchema, IconSchema, IconsSchema, BaseMetadataSchema, ImplementationSchema, FormElicitationCapabilitySchema, ElicitationCapabilitySchema, ClientTasksCapabilitySchema, ServerTasksCapabilitySchema, ClientCapabilitiesSchema, InitializeRequestParamsSchema, InitializeRequestSchema, ServerCapabilitiesSchema, InitializeResultSchema, InitializedNotificationSchema, PingRequestSchema, ProgressSchema, ProgressNotificationParamsSchema, ProgressNotificationSchema, PaginatedRequestParamsSchema, PaginatedRequestSchema, PaginatedResultSchema, TaskStatusSchema, TaskSchema, CreateTaskResultSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, GetTaskRequestSchema, GetTaskResultSchema, GetTaskPayloadRequestSchema, GetTaskPayloadResultSchema, ListTasksRequestSchema, ListTasksResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, ResourceContentsSchema, TextResourceContentsSchema, Base64Schema, BlobResourceContentsSchema, RoleSchema, AnnotationsSchema, ResourceSchema, ResourceTemplateSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ResourceRequestParamsSchema, ReadResourceRequestParamsSchema, ReadResourceRequestSchema, ReadResourceResultSchema, ResourceListChangedNotificationSchema, SubscribeRequestParamsSchema, SubscribeRequestSchema, UnsubscribeRequestParamsSchema, UnsubscribeRequestSchema, ResourceUpdatedNotificationParamsSchema, ResourceUpdatedNotificationSchema, PromptArgumentSchema, PromptSchema, ListPromptsRequestSchema, ListPromptsResultSchema, GetPromptRequestParamsSchema, GetPromptRequestSchema, TextContentSchema, ImageContentSchema, AudioContentSchema, ToolUseContentSchema, EmbeddedResourceSchema, ResourceLinkSchema, ContentBlockSchema, PromptMessageSchema, GetPromptResultSchema, PromptListChangedNotificationSchema, ToolAnnotationsSchema, ToolExecutionSchema, ToolSchema, ListToolsRequestSchema, ListToolsResultSchema, CallToolResultSchema, CompatibilityCallToolResultSchema, CallToolRequestParamsSchema, CallToolRequestSchema, ToolListChangedNotificationSchema, ListChangedOptionsBaseSchema, LoggingLevelSchema, SetLevelRequestParamsSchema, SetLevelRequestSchema, LoggingMessageNotificationParamsSchema, LoggingMessageNotificationSchema, ModelHintSchema, ModelPreferencesSchema, ToolChoiceSchema, ToolResultContentSchema, SamplingContentSchema, SamplingMessageContentBlockSchema, SamplingMessageSchema, CreateMessageRequestParamsSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CreateMessageResultWithToolsSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema, UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema, LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema, EnumSchemaSchema, PrimitiveSchemaDefinitionSchema, ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema, ElicitRequestParamsSchema, ElicitRequestSchema, ElicitationCompleteNotificationParamsSchema, ElicitationCompleteNotificationSchema, ElicitResultSchema, ResourceTemplateReferenceSchema, PromptReferenceSchema, CompleteRequestParamsSchema, CompleteRequestSchema, CompleteResultSchema, RootSchema, ListRootsRequestSchema, ListRootsResultSchema, RootsListChangedNotificationSchema, ClientRequestSchema, ClientNotificationSchema, ClientResultSchema, ServerRequestSchema, ServerNotificationSchema, ServerResultSchema, McpError, UrlElicitationRequiredError;
|
|
59816
59823
|
var init_types4 = __esm(() => {
|
|
59817
59824
|
init_v4();
|
|
@@ -60639,7 +60646,7 @@ var init_types4 = __esm(() => {
|
|
|
60639
60646
|
};
|
|
60640
60647
|
});
|
|
60641
60648
|
|
|
60642
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0
|
|
60649
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
|
|
60643
60650
|
function isTerminal(status) {
|
|
60644
60651
|
return status === "completed" || status === "failed" || status === "cancelled";
|
|
60645
60652
|
}
|
|
@@ -60857,7 +60864,7 @@ var init_esm = __esm(() => {
|
|
|
60857
60864
|
init_zodToJsonSchema();
|
|
60858
60865
|
});
|
|
60859
60866
|
|
|
60860
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0
|
|
60867
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
|
|
60861
60868
|
function getMethodLiteral(schema) {
|
|
60862
60869
|
const shape = getObjectShape(schema);
|
|
60863
60870
|
const methodSchema = shape?.method;
|
|
@@ -60882,7 +60889,7 @@ var init_zod_json_schema_compat = __esm(() => {
|
|
|
60882
60889
|
init_esm();
|
|
60883
60890
|
});
|
|
60884
60891
|
|
|
60885
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0
|
|
60892
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
|
|
60886
60893
|
class Protocol {
|
|
60887
60894
|
constructor(_options) {
|
|
60888
60895
|
this._options = _options;
|
|
@@ -68312,7 +68319,7 @@ var require_dist3 = __commonJS((exports, module) => {
|
|
|
68312
68319
|
exports.default = formatsPlugin;
|
|
68313
68320
|
});
|
|
68314
68321
|
|
|
68315
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0
|
|
68322
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
|
|
68316
68323
|
function createDefaultAjvInstance() {
|
|
68317
68324
|
const ajv = new import_ajv.default({
|
|
68318
68325
|
strict: false,
|
|
@@ -68355,7 +68362,7 @@ var init_ajv_provider = __esm(() => {
|
|
|
68355
68362
|
import_ajv_formats = __toESM(require_dist3(), 1);
|
|
68356
68363
|
});
|
|
68357
68364
|
|
|
68358
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0
|
|
68365
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js
|
|
68359
68366
|
class ExperimentalServerTasks {
|
|
68360
68367
|
constructor(_server) {
|
|
68361
68368
|
this._server = _server;
|
|
@@ -68436,7 +68443,7 @@ var init_server = __esm(() => {
|
|
|
68436
68443
|
init_types4();
|
|
68437
68444
|
});
|
|
68438
68445
|
|
|
68439
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0
|
|
68446
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js
|
|
68440
68447
|
function assertToolsCallTaskCapability(requests, method, entityName) {
|
|
68441
68448
|
if (!requests) {
|
|
68442
68449
|
throw new Error(`${entityName} does not support task creation (required for ${method})`);
|
|
@@ -68471,7 +68478,7 @@ function assertClientRequestTaskCapability(requests, method, entityName) {
|
|
|
68471
68478
|
}
|
|
68472
68479
|
}
|
|
68473
68480
|
|
|
68474
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0
|
|
68481
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
|
|
68475
68482
|
var Server;
|
|
68476
68483
|
var init_server2 = __esm(() => {
|
|
68477
68484
|
init_protocol();
|
|
@@ -68803,7 +68810,7 @@ var init_server2 = __esm(() => {
|
|
|
68803
68810
|
};
|
|
68804
68811
|
});
|
|
68805
68812
|
|
|
68806
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0
|
|
68813
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
|
|
68807
68814
|
class ReadBuffer {
|
|
68808
68815
|
constructor(options) {
|
|
68809
68816
|
this._maxBufferSize = options?.maxBufferSize ?? STDIO_DEFAULT_MAX_BUFFER_SIZE;
|
|
@@ -68846,7 +68853,7 @@ var init_stdio = __esm(() => {
|
|
|
68846
68853
|
STDIO_DEFAULT_MAX_BUFFER_SIZE = 10 * 1024 * 1024;
|
|
68847
68854
|
});
|
|
68848
68855
|
|
|
68849
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0
|
|
68856
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
68850
68857
|
import process9 from "node:process";
|
|
68851
68858
|
|
|
68852
68859
|
class StdioServerTransport {
|
|
@@ -74941,7 +74948,8 @@ import { homedir as homedir6 } from "node:os";
|
|
|
74941
74948
|
import { join as join9 } from "node:path";
|
|
74942
74949
|
|
|
74943
74950
|
// ../../_shared/ef-meta/index.ts
|
|
74944
|
-
var EF_VERSION = "1.0.
|
|
74951
|
+
var EF_VERSION = "1.0.3";
|
|
74952
|
+
var EF_LAST_CHANGED = "1.0.3";
|
|
74945
74953
|
|
|
74946
74954
|
// src/cli/util/checks.ts
|
|
74947
74955
|
init_config();
|
|
@@ -75458,6 +75466,13 @@ async function checkEdgeFunctionsCompat() {
|
|
|
75458
75466
|
hint: "Update the Edge Functions (see remediation below)."
|
|
75459
75467
|
};
|
|
75460
75468
|
case "above-min-but-old":
|
|
75469
|
+
if (compareSemver(deployed, EF_LAST_CHANGED) >= 0) {
|
|
75470
|
+
return {
|
|
75471
|
+
name: "edge functions",
|
|
75472
|
+
status: "ok",
|
|
75473
|
+
detail: `Deployed EF v${deployed} (≥ required v${compat.edgeFunctions.min}; ` + `matches the latest server-side changes — the newer bundled label ` + `v${EF_VERSION} is cosmetic).`
|
|
75474
|
+
};
|
|
75475
|
+
}
|
|
75461
75476
|
return {
|
|
75462
75477
|
name: "edge functions",
|
|
75463
75478
|
status: "skipped",
|
|
@@ -77509,6 +77524,11 @@ async function action29(query, options) {
|
|
|
77509
77524
|
println("No results found.");
|
|
77510
77525
|
return;
|
|
77511
77526
|
}
|
|
77527
|
+
const belowConfidence = accepted.length > 0 && accepted.every((r) => r.below_confidence === true);
|
|
77528
|
+
if (belowConfidence) {
|
|
77529
|
+
println(c.yellow(`⚠ No results cleared the confidence threshold — showing the closest ` + `${accepted.length} candidate(s). Judge relevance by the scores below.`));
|
|
77530
|
+
println("");
|
|
77531
|
+
}
|
|
77512
77532
|
for (const row of accepted) {
|
|
77513
77533
|
if (mode === "docs") {
|
|
77514
77534
|
const doc2 = row;
|
|
@@ -77884,15 +77904,15 @@ init_sync_self_docs();
|
|
|
77884
77904
|
// src/cli/commands/web.ts
|
|
77885
77905
|
init_cli_core();
|
|
77886
77906
|
|
|
77887
|
-
// ../../node_modules/.bun/@hono+node-server@2.0.12+
|
|
77907
|
+
// ../../node_modules/.bun/@hono+node-server@2.0.12+19b9adbcbc3b652f/node_modules/@hono/node-server/dist/constants-BLSFu_RU.mjs
|
|
77888
77908
|
var X_ALREADY_SENT = "x-hono-already-sent";
|
|
77889
77909
|
|
|
77890
|
-
// ../../node_modules/.bun/@hono+node-server@2.0.12+
|
|
77910
|
+
// ../../node_modules/.bun/@hono+node-server@2.0.12+19b9adbcbc3b652f/node_modules/@hono/node-server/dist/index.mjs
|
|
77891
77911
|
import { STATUS_CODES, createServer } from "node:http";
|
|
77892
77912
|
import { Http2ServerRequest, constants } from "node:http2";
|
|
77893
77913
|
import { Readable } from "node:stream";
|
|
77894
77914
|
|
|
77895
|
-
// ../../node_modules/.bun/hono@4.12.
|
|
77915
|
+
// ../../node_modules/.bun/hono@4.12.34/node_modules/hono/dist/helper/websocket/index.js
|
|
77896
77916
|
var WSContext = class {
|
|
77897
77917
|
#init;
|
|
77898
77918
|
constructor(init) {
|
|
@@ -77940,7 +77960,7 @@ var defineWebSocketHelper = (handler11) => {
|
|
|
77940
77960
|
};
|
|
77941
77961
|
};
|
|
77942
77962
|
|
|
77943
|
-
// ../../node_modules/.bun/@hono+node-server@2.0.12+
|
|
77963
|
+
// ../../node_modules/.bun/@hono+node-server@2.0.12+19b9adbcbc3b652f/node_modules/@hono/node-server/dist/index.mjs
|
|
77944
77964
|
var RequestError = class extends Error {
|
|
77945
77965
|
constructor(message, options) {
|
|
77946
77966
|
super(message, options);
|
|
@@ -79214,7 +79234,7 @@ var serve = (options, listeningListener) => {
|
|
|
79214
79234
|
return server;
|
|
79215
79235
|
};
|
|
79216
79236
|
|
|
79217
|
-
// ../../node_modules/.bun/@hono+node-server@2.0.12+
|
|
79237
|
+
// ../../node_modules/.bun/@hono+node-server@2.0.12+19b9adbcbc3b652f/node_modules/@hono/node-server/dist/utils/stream.mjs
|
|
79218
79238
|
import { Readable as Readable2 } from "node:stream";
|
|
79219
79239
|
import { versions as versions2 } from "node:process";
|
|
79220
79240
|
var pr54206Applied = () => {
|
|
@@ -79280,7 +79300,7 @@ var createStreamBody = (stream, useNativeReadableToWeb = useReadableToWeb) => {
|
|
|
79280
79300
|
});
|
|
79281
79301
|
};
|
|
79282
79302
|
|
|
79283
|
-
// ../../node_modules/.bun/hono@4.12.
|
|
79303
|
+
// ../../node_modules/.bun/hono@4.12.34/node_modules/hono/dist/utils/mime.js
|
|
79284
79304
|
var getMimeType = (filename, mimes = baseMimes) => {
|
|
79285
79305
|
const regexp = /\.([a-zA-Z0-9]+?)$/;
|
|
79286
79306
|
const match = filename.match(regexp);
|
|
@@ -79349,7 +79369,7 @@ var _baseMimes = {
|
|
|
79349
79369
|
};
|
|
79350
79370
|
var baseMimes = _baseMimes;
|
|
79351
79371
|
|
|
79352
|
-
// ../../node_modules/.bun/@hono+node-server@2.0.12+
|
|
79372
|
+
// ../../node_modules/.bun/@hono+node-server@2.0.12+19b9adbcbc3b652f/node_modules/@hono/node-server/dist/serve-static.mjs
|
|
79353
79373
|
import { createReadStream, existsSync as existsSync15, statSync as statSync5 } from "node:fs";
|
|
79354
79374
|
import { join as join13 } from "node:path";
|
|
79355
79375
|
var COMPRESSIBLE_CONTENT_TYPE_REGEX = /^\s*(?:text\/[^;\s]+|application\/(?:javascript|json|xml|xml-dtd|ecmascript|dart|postscript|rtf|tar|toml|vnd\.dart|vnd\.ms-fontobject|vnd\.ms-opentype|wasm|x-httpd-php|x-javascript|x-ns-proxy-autoconfig|x-sh|x-tar|x-virtualbox-hdd|x-virtualbox-ova|x-virtualbox-ovf|x-virtualbox-vbox|x-virtualbox-vdi|x-virtualbox-vhd|x-virtualbox-vmdk|x-www-form-urlencoded)|font\/(?:otf|ttf)|image\/(?:bmp|vnd\.adobe\.photoshop|vnd\.microsoft\.icon|vnd\.ms-dds|x-icon|x-ms-bmp)|message\/rfc822|model\/gltf-binary|x-shader\/x-fragment|x-shader\/x-vertex|[^;\s]+?\+(?:json|text|xml|yaml))(?:[;\s]|$)/i;
|
|
@@ -79511,7 +79531,7 @@ import { existsSync as existsSync19 } from "node:fs";
|
|
|
79511
79531
|
import { readFileSync as readFileSync17 } from "node:fs";
|
|
79512
79532
|
import { join as join17 } from "node:path";
|
|
79513
79533
|
|
|
79514
|
-
// ../../node_modules/.bun/hono@4.12.
|
|
79534
|
+
// ../../node_modules/.bun/hono@4.12.34/node_modules/hono/dist/compose.js
|
|
79515
79535
|
var compose = (middleware, onError, onNotFound) => {
|
|
79516
79536
|
return (context, next) => {
|
|
79517
79537
|
let index = -1;
|
|
@@ -79555,10 +79575,10 @@ var compose = (middleware, onError, onNotFound) => {
|
|
|
79555
79575
|
};
|
|
79556
79576
|
};
|
|
79557
79577
|
|
|
79558
|
-
// ../../node_modules/.bun/hono@4.12.
|
|
79578
|
+
// ../../node_modules/.bun/hono@4.12.34/node_modules/hono/dist/request/constants.js
|
|
79559
79579
|
var GET_MATCH_RESULT = /* @__PURE__ */ Symbol();
|
|
79560
79580
|
|
|
79561
|
-
// ../../node_modules/.bun/hono@4.12.
|
|
79581
|
+
// ../../node_modules/.bun/hono@4.12.34/node_modules/hono/dist/utils/buffer.js
|
|
79562
79582
|
var bufferToFormData = (arrayBuffer, contentType2) => {
|
|
79563
79583
|
const response = new Response(arrayBuffer, {
|
|
79564
79584
|
headers: {
|
|
@@ -79568,7 +79588,7 @@ var bufferToFormData = (arrayBuffer, contentType2) => {
|
|
|
79568
79588
|
return response.formData();
|
|
79569
79589
|
};
|
|
79570
79590
|
|
|
79571
|
-
// ../../node_modules/.bun/hono@4.12.
|
|
79591
|
+
// ../../node_modules/.bun/hono@4.12.34/node_modules/hono/dist/utils/body.js
|
|
79572
79592
|
var isRawRequest = (request) => ("headers" in request);
|
|
79573
79593
|
var parseBody = async (request, options = /* @__PURE__ */ Object.create(null)) => {
|
|
79574
79594
|
const { all = false, dot = false } = options;
|
|
@@ -79650,7 +79670,7 @@ var handleParsingNestedValues = (form, key, value) => {
|
|
|
79650
79670
|
});
|
|
79651
79671
|
};
|
|
79652
79672
|
|
|
79653
|
-
// ../../node_modules/.bun/hono@4.12.
|
|
79673
|
+
// ../../node_modules/.bun/hono@4.12.34/node_modules/hono/dist/utils/url.js
|
|
79654
79674
|
var splitPath = (path) => {
|
|
79655
79675
|
const paths = path.split("/");
|
|
79656
79676
|
if (paths[0] === "") {
|
|
@@ -79850,7 +79870,7 @@ var getQueryParams = (url, key) => {
|
|
|
79850
79870
|
};
|
|
79851
79871
|
var decodeURIComponent_ = decodeURIComponent;
|
|
79852
79872
|
|
|
79853
|
-
// ../../node_modules/.bun/hono@4.12.
|
|
79873
|
+
// ../../node_modules/.bun/hono@4.12.34/node_modules/hono/dist/request.js
|
|
79854
79874
|
var tryDecodeURIComponent = (str) => tryDecode2(str, decodeURIComponent_);
|
|
79855
79875
|
var HonoRequest = class {
|
|
79856
79876
|
raw;
|
|
@@ -79964,7 +79984,7 @@ var HonoRequest = class {
|
|
|
79964
79984
|
}
|
|
79965
79985
|
};
|
|
79966
79986
|
|
|
79967
|
-
// ../../node_modules/.bun/hono@4.12.
|
|
79987
|
+
// ../../node_modules/.bun/hono@4.12.34/node_modules/hono/dist/utils/html.js
|
|
79968
79988
|
var HtmlEscapedCallbackPhase = {
|
|
79969
79989
|
Stringify: 1,
|
|
79970
79990
|
BeforeStream: 2,
|
|
@@ -80002,7 +80022,7 @@ var resolveCallback = async (str, phase, preserveCallbacks, context, buffer2) =>
|
|
|
80002
80022
|
}
|
|
80003
80023
|
};
|
|
80004
80024
|
|
|
80005
|
-
// ../../node_modules/.bun/hono@4.12.
|
|
80025
|
+
// ../../node_modules/.bun/hono@4.12.34/node_modules/hono/dist/context.js
|
|
80006
80026
|
var TEXT_PLAIN = "text/plain; charset=UTF-8";
|
|
80007
80027
|
var setDefaultContentType = (contentType2, headers) => {
|
|
80008
80028
|
return {
|
|
@@ -80169,7 +80189,7 @@ var Context = class {
|
|
|
80169
80189
|
};
|
|
80170
80190
|
};
|
|
80171
80191
|
|
|
80172
|
-
// ../../node_modules/.bun/hono@4.12.
|
|
80192
|
+
// ../../node_modules/.bun/hono@4.12.34/node_modules/hono/dist/router.js
|
|
80173
80193
|
var METHOD_NAME_ALL = "ALL";
|
|
80174
80194
|
var METHOD_NAME_ALL_LOWERCASE = "all";
|
|
80175
80195
|
var METHODS = ["get", "post", "put", "delete", "options", "patch"];
|
|
@@ -80177,10 +80197,10 @@ var MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is
|
|
|
80177
80197
|
var UnsupportedPathError = class extends Error {
|
|
80178
80198
|
};
|
|
80179
80199
|
|
|
80180
|
-
// ../../node_modules/.bun/hono@4.12.
|
|
80200
|
+
// ../../node_modules/.bun/hono@4.12.34/node_modules/hono/dist/utils/constants.js
|
|
80181
80201
|
var COMPOSED_HANDLER = "__COMPOSED_HANDLER";
|
|
80182
80202
|
|
|
80183
|
-
// ../../node_modules/.bun/hono@4.12.
|
|
80203
|
+
// ../../node_modules/.bun/hono@4.12.34/node_modules/hono/dist/hono-base.js
|
|
80184
80204
|
var notFoundHandler = (c2) => {
|
|
80185
80205
|
return c2.text("404 Not Found", 404);
|
|
80186
80206
|
};
|
|
@@ -80404,7 +80424,7 @@ var Hono = class _Hono {
|
|
|
80404
80424
|
};
|
|
80405
80425
|
};
|
|
80406
80426
|
|
|
80407
|
-
// ../../node_modules/.bun/hono@4.12.
|
|
80427
|
+
// ../../node_modules/.bun/hono@4.12.34/node_modules/hono/dist/router/reg-exp-router/matcher.js
|
|
80408
80428
|
var emptyParam = [];
|
|
80409
80429
|
function match(method, path) {
|
|
80410
80430
|
const matchers = this.buildAllMatchers();
|
|
@@ -80425,7 +80445,7 @@ function match(method, path) {
|
|
|
80425
80445
|
return match2(method, path);
|
|
80426
80446
|
}
|
|
80427
80447
|
|
|
80428
|
-
// ../../node_modules/.bun/hono@4.12.
|
|
80448
|
+
// ../../node_modules/.bun/hono@4.12.34/node_modules/hono/dist/router/reg-exp-router/node.js
|
|
80429
80449
|
var LABEL_REG_EXP_STR = "[^/]+";
|
|
80430
80450
|
var ONLY_WILDCARD_REG_EXP_STR = ".*";
|
|
80431
80451
|
var TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)";
|
|
@@ -80529,7 +80549,7 @@ var Node = class _Node {
|
|
|
80529
80549
|
}
|
|
80530
80550
|
};
|
|
80531
80551
|
|
|
80532
|
-
// ../../node_modules/.bun/hono@4.12.
|
|
80552
|
+
// ../../node_modules/.bun/hono@4.12.34/node_modules/hono/dist/router/reg-exp-router/trie.js
|
|
80533
80553
|
var Trie = class {
|
|
80534
80554
|
#context = { varIndex: 0 };
|
|
80535
80555
|
#root = new Node;
|
|
@@ -80585,7 +80605,7 @@ var Trie = class {
|
|
|
80585
80605
|
}
|
|
80586
80606
|
};
|
|
80587
80607
|
|
|
80588
|
-
// ../../node_modules/.bun/hono@4.12.
|
|
80608
|
+
// ../../node_modules/.bun/hono@4.12.34/node_modules/hono/dist/router/reg-exp-router/router.js
|
|
80589
80609
|
var nullMatcher = [/^$/, [], /* @__PURE__ */ Object.create(null)];
|
|
80590
80610
|
var wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
|
|
80591
80611
|
function buildWildcardRegExp(path) {
|
|
@@ -80750,7 +80770,7 @@ var RegExpRouter = class {
|
|
|
80750
80770
|
}
|
|
80751
80771
|
};
|
|
80752
80772
|
|
|
80753
|
-
// ../../node_modules/.bun/hono@4.12.
|
|
80773
|
+
// ../../node_modules/.bun/hono@4.12.34/node_modules/hono/dist/router/reg-exp-router/prepared-router.js
|
|
80754
80774
|
var PreparedRegExpRouter = class {
|
|
80755
80775
|
name = "PreparedRegExpRouter";
|
|
80756
80776
|
#matchers;
|
|
@@ -80822,7 +80842,7 @@ var PreparedRegExpRouter = class {
|
|
|
80822
80842
|
match = match;
|
|
80823
80843
|
};
|
|
80824
80844
|
|
|
80825
|
-
// ../../node_modules/.bun/hono@4.12.
|
|
80845
|
+
// ../../node_modules/.bun/hono@4.12.34/node_modules/hono/dist/router/smart-router/router.js
|
|
80826
80846
|
var SmartRouter = class {
|
|
80827
80847
|
name = "SmartRouter";
|
|
80828
80848
|
#routers = [];
|
|
@@ -80877,7 +80897,7 @@ var SmartRouter = class {
|
|
|
80877
80897
|
}
|
|
80878
80898
|
};
|
|
80879
80899
|
|
|
80880
|
-
// ../../node_modules/.bun/hono@4.12.
|
|
80900
|
+
// ../../node_modules/.bun/hono@4.12.34/node_modules/hono/dist/router/trie-router/node.js
|
|
80881
80901
|
var emptyParams = /* @__PURE__ */ Object.create(null);
|
|
80882
80902
|
var hasChildren = (children) => {
|
|
80883
80903
|
for (const _ in children) {
|
|
@@ -81049,7 +81069,7 @@ var Node2 = class _Node2 {
|
|
|
81049
81069
|
}
|
|
81050
81070
|
};
|
|
81051
81071
|
|
|
81052
|
-
// ../../node_modules/.bun/hono@4.12.
|
|
81072
|
+
// ../../node_modules/.bun/hono@4.12.34/node_modules/hono/dist/router/trie-router/router.js
|
|
81053
81073
|
var TrieRouter = class {
|
|
81054
81074
|
name = "TrieRouter";
|
|
81055
81075
|
#node;
|
|
@@ -81071,7 +81091,7 @@ var TrieRouter = class {
|
|
|
81071
81091
|
}
|
|
81072
81092
|
};
|
|
81073
81093
|
|
|
81074
|
-
// ../../node_modules/.bun/hono@4.12.
|
|
81094
|
+
// ../../node_modules/.bun/hono@4.12.34/node_modules/hono/dist/hono.js
|
|
81075
81095
|
var Hono2 = class extends Hono {
|
|
81076
81096
|
constructor(options = {}) {
|
|
81077
81097
|
super(options);
|
|
@@ -81081,7 +81101,7 @@ var Hono2 = class extends Hono {
|
|
|
81081
81101
|
}
|
|
81082
81102
|
};
|
|
81083
81103
|
|
|
81084
|
-
// ../../node_modules/.bun/hono@4.12.
|
|
81104
|
+
// ../../node_modules/.bun/hono@4.12.34/node_modules/hono/dist/utils/color.js
|
|
81085
81105
|
function getColorEnabled() {
|
|
81086
81106
|
const { process: process10, Deno: Deno2 } = globalThis;
|
|
81087
81107
|
const isNoColor = typeof Deno2?.noColor === "boolean" ? Deno2.noColor : process10 !== undefined ? "NO_COLOR" in process10?.env : false;
|
|
@@ -81100,7 +81120,7 @@ async function getColorEnabledAsync() {
|
|
|
81100
81120
|
return !isNoColor;
|
|
81101
81121
|
}
|
|
81102
81122
|
|
|
81103
|
-
// ../../node_modules/.bun/hono@4.12.
|
|
81123
|
+
// ../../node_modules/.bun/hono@4.12.34/node_modules/hono/dist/middleware/logger/index.js
|
|
81104
81124
|
var humanize = (times) => {
|
|
81105
81125
|
const [delimiter, separator] = [",", "."];
|
|
81106
81126
|
const orderTimes = times.map((v) => v.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1" + delimiter));
|