codesift-mcp 0.15.5 → 0.19.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/auto-prune.d.ts +16 -0
- package/dist/cli/auto-prune.d.ts.map +1 -0
- package/dist/cli/auto-prune.js +87 -0
- package/dist/cli/auto-prune.js.map +1 -0
- package/dist/cli/commands-admin.d.ts.map +1 -1
- package/dist/cli/commands-admin.js +11 -0
- package/dist/cli/commands-admin.js.map +1 -1
- package/dist/cli/commands-daemon.d.ts.map +1 -1
- package/dist/cli/commands-daemon.js +41 -0
- package/dist/cli/commands-daemon.js.map +1 -1
- package/dist/cli/commands-index.d.ts.map +1 -1
- package/dist/cli/commands-index.js +8 -0
- package/dist/cli/commands-index.js.map +1 -1
- package/dist/cli/commands-maintenance.d.ts.map +1 -1
- package/dist/cli/commands-maintenance.js +173 -3
- package/dist/cli/commands-maintenance.js.map +1 -1
- package/dist/cli/embed-child.js +5 -1
- package/dist/cli/embed-child.js.map +1 -1
- package/dist/cli/hooks/pre-compact.d.ts.map +1 -1
- package/dist/cli/hooks/pre-compact.js +4 -0
- package/dist/cli/hooks/pre-compact.js.map +1 -1
- package/dist/cli/hooks/pre-tool-use.d.ts.map +1 -1
- package/dist/cli/hooks/pre-tool-use.js +5 -2
- package/dist/cli/hooks/pre-tool-use.js.map +1 -1
- package/dist/cli/hooks/session.d.ts.map +1 -1
- package/dist/cli/hooks/session.js +5 -0
- package/dist/cli/hooks/session.js.map +1 -1
- package/dist/cli/hooks/shared.d.ts.map +1 -1
- package/dist/cli/hooks/shared.js +6 -2
- package/dist/cli/hooks/shared.js.map +1 -1
- package/dist/cli/hooks/wiki.d.ts +13 -0
- package/dist/cli/hooks/wiki.d.ts.map +1 -1
- package/dist/cli/hooks/wiki.js +19 -2
- package/dist/cli/hooks/wiki.js.map +1 -1
- package/dist/cli/orphan-guard.d.ts +22 -0
- package/dist/cli/orphan-guard.d.ts.map +1 -1
- package/dist/cli/orphan-guard.js +30 -0
- package/dist/cli/orphan-guard.js.map +1 -1
- package/dist/cli/owner-only-file.d.ts +9 -0
- package/dist/cli/owner-only-file.d.ts.map +1 -1
- package/dist/cli/owner-only-file.js +40 -8
- package/dist/cli/owner-only-file.js.map +1 -1
- package/dist/cli/service.d.ts +32 -0
- package/dist/cli/service.d.ts.map +1 -1
- package/dist/cli/service.js +74 -4
- package/dist/cli/service.js.map +1 -1
- package/dist/cli/setup/claude.js +3 -3
- package/dist/cli/setup/claude.js.map +1 -1
- package/dist/cli/setup/codex-project-auto.d.ts +27 -0
- package/dist/cli/setup/codex-project-auto.d.ts.map +1 -0
- package/dist/cli/setup/codex-project-auto.js +98 -0
- package/dist/cli/setup/codex-project-auto.js.map +1 -0
- package/dist/cli/setup/codex.d.ts.map +1 -1
- package/dist/cli/setup/codex.js +105 -10
- package/dist/cli/setup/codex.js.map +1 -1
- package/dist/cli/setup/cursor.d.ts.map +1 -1
- package/dist/cli/setup/cursor.js +9 -1
- package/dist/cli/setup/cursor.js.map +1 -1
- package/dist/cli/setup/fs.d.ts +2 -0
- package/dist/cli/setup/fs.d.ts.map +1 -1
- package/dist/cli/setup/fs.js +4 -1
- package/dist/cli/setup/fs.js.map +1 -1
- package/dist/cli/setup/gemini.d.ts.map +1 -1
- package/dist/cli/setup/gemini.js +25 -4
- package/dist/cli/setup/gemini.js.map +1 -1
- package/dist/cli/setup/hooks.d.ts +10 -0
- package/dist/cli/setup/hooks.d.ts.map +1 -1
- package/dist/cli/setup/hooks.js +25 -3
- package/dist/cli/setup/hooks.js.map +1 -1
- package/dist/cli/setup/mcp.d.ts +37 -1
- package/dist/cli/setup/mcp.d.ts.map +1 -1
- package/dist/cli/setup/mcp.js +57 -4
- package/dist/cli/setup/mcp.js.map +1 -1
- package/dist/cli/setup/types.d.ts +19 -1
- package/dist/cli/setup/types.d.ts.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +30 -6
- package/dist/config.js.map +1 -1
- package/dist/formatters-core.d.ts +1 -0
- package/dist/formatters-core.d.ts.map +1 -1
- package/dist/formatters-core.js +8 -2
- package/dist/formatters-core.js.map +1 -1
- package/dist/formatters-shortening.d.ts.map +1 -1
- package/dist/formatters-shortening.js +8 -2
- package/dist/formatters-shortening.js.map +1 -1
- package/dist/instructions.d.ts +22 -1
- package/dist/instructions.d.ts.map +1 -1
- package/dist/instructions.js +61 -1
- package/dist/instructions.js.map +1 -1
- package/dist/lsp/lsp-client.d.ts +1 -1
- package/dist/lsp/lsp-client.d.ts.map +1 -1
- package/dist/lsp/lsp-client.js +2 -1
- package/dist/lsp/lsp-client.js.map +1 -1
- package/dist/lsp/lsp-manager.d.ts.map +1 -1
- package/dist/lsp/lsp-manager.js +10 -2
- package/dist/lsp/lsp-manager.js.map +1 -1
- package/dist/lsp/lsp-servers.d.ts +7 -0
- package/dist/lsp/lsp-servers.d.ts.map +1 -1
- package/dist/lsp/lsp-servers.js +82 -1
- package/dist/lsp/lsp-servers.js.map +1 -1
- package/dist/parser/parser-manager.d.ts.map +1 -1
- package/dist/parser/parser-manager.js +8 -2
- package/dist/parser/parser-manager.js.map +1 -1
- package/dist/register-tool-groups/core/symbols.d.ts.map +1 -1
- package/dist/register-tool-groups/core/symbols.js +71 -6
- package/dist/register-tool-groups/core/symbols.js.map +1 -1
- package/dist/register-tool-groups/meta.d.ts.map +1 -1
- package/dist/register-tool-groups/meta.js +23 -0
- package/dist/register-tool-groups/meta.js.map +1 -1
- package/dist/register-tools/discovery.d.ts +7 -0
- package/dist/register-tools/discovery.d.ts.map +1 -1
- package/dist/register-tools/discovery.js +8 -1
- package/dist/register-tools/discovery.js.map +1 -1
- package/dist/register-tools/runtime.d.ts +1 -1
- package/dist/register-tools/runtime.d.ts.map +1 -1
- package/dist/register-tools/runtime.js +9 -2
- package/dist/register-tools/runtime.js.map +1 -1
- package/dist/register-tools.d.ts +3 -1
- package/dist/register-tools.d.ts.map +1 -1
- package/dist/register-tools.js +7 -2
- package/dist/register-tools.js.map +1 -1
- package/dist/search/bm25-store.d.ts +16 -0
- package/dist/search/bm25-store.d.ts.map +1 -0
- package/dist/search/bm25-store.js +294 -0
- package/dist/search/bm25-store.js.map +1 -0
- package/dist/search/bm25.d.ts +52 -0
- package/dist/search/bm25.d.ts.map +1 -1
- package/dist/search/bm25.js +202 -34
- package/dist/search/bm25.js.map +1 -1
- package/dist/search/embed-gate.d.ts +17 -0
- package/dist/search/embed-gate.d.ts.map +1 -0
- package/dist/search/embed-gate.js +64 -0
- package/dist/search/embed-gate.js.map +1 -0
- package/dist/search/semantic.d.ts.map +1 -1
- package/dist/search/semantic.js +5 -2
- package/dist/search/semantic.js.map +1 -1
- package/dist/server-helpers/cache-report.d.ts +36 -0
- package/dist/server-helpers/cache-report.d.ts.map +1 -0
- package/dist/server-helpers/cache-report.js +26 -0
- package/dist/server-helpers/cache-report.js.map +1 -0
- package/dist/server-helpers/health-vitals.d.ts +45 -0
- package/dist/server-helpers/health-vitals.d.ts.map +1 -0
- package/dist/server-helpers/health-vitals.js +85 -0
- package/dist/server-helpers/health-vitals.js.map +1 -0
- package/dist/server-helpers/request-context.d.ts +34 -4
- package/dist/server-helpers/request-context.d.ts.map +1 -1
- package/dist/server-helpers/request-context.js +4 -0
- package/dist/server-helpers/request-context.js.map +1 -1
- package/dist/server-helpers/response-budget.d.ts +24 -0
- package/dist/server-helpers/response-budget.d.ts.map +1 -0
- package/dist/server-helpers/response-budget.js +29 -0
- package/dist/server-helpers/response-budget.js.map +1 -0
- package/dist/server-helpers/response-hints.d.ts.map +1 -1
- package/dist/server-helpers/response-hints.js +43 -0
- package/dist/server-helpers/response-hints.js.map +1 -1
- package/dist/server-helpers/shown-source.d.ts +59 -0
- package/dist/server-helpers/shown-source.d.ts.map +1 -0
- package/dist/server-helpers/shown-source.js +175 -0
- package/dist/server-helpers/shown-source.js.map +1 -0
- package/dist/server-helpers/stdio-envelope.d.ts +31 -0
- package/dist/server-helpers/stdio-envelope.d.ts.map +1 -0
- package/dist/server-helpers/stdio-envelope.js +67 -0
- package/dist/server-helpers/stdio-envelope.js.map +1 -0
- package/dist/server-helpers.d.ts +7 -0
- package/dist/server-helpers.d.ts.map +1 -1
- package/dist/server-helpers.js +51 -10
- package/dist/server-helpers.js.map +1 -1
- package/dist/server.d.ts +9 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +235 -51
- package/dist/server.js.map +1 -1
- package/dist/storage/_shared.d.ts +26 -1
- package/dist/storage/_shared.d.ts.map +1 -1
- package/dist/storage/_shared.js +74 -3
- package/dist/storage/_shared.js.map +1 -1
- package/dist/storage/index-migration.d.ts.map +1 -1
- package/dist/storage/index-migration.js +6 -2
- package/dist/storage/index-migration.js.map +1 -1
- package/dist/storage/index-store.d.ts +29 -0
- package/dist/storage/index-store.d.ts.map +1 -1
- package/dist/storage/index-store.js +112 -0
- package/dist/storage/index-store.js.map +1 -1
- package/dist/storage/registry.d.ts.map +1 -1
- package/dist/storage/registry.js +13 -1
- package/dist/storage/registry.js.map +1 -1
- package/dist/storage/session-state.d.ts +7 -0
- package/dist/storage/session-state.d.ts.map +1 -1
- package/dist/storage/session-state.js +3 -0
- package/dist/storage/session-state.js.map +1 -1
- package/dist/storage/shared-embedding-cache.d.ts.map +1 -1
- package/dist/storage/shared-embedding-cache.js +153 -2
- package/dist/storage/shared-embedding-cache.js.map +1 -1
- package/dist/storage/sqlite/accessors.d.ts +17 -0
- package/dist/storage/sqlite/accessors.d.ts.map +1 -1
- package/dist/storage/sqlite/accessors.js +20 -0
- package/dist/storage/sqlite/accessors.js.map +1 -1
- package/dist/storage/sqlite/connection.d.ts +20 -0
- package/dist/storage/sqlite/connection.d.ts.map +1 -1
- package/dist/storage/sqlite/connection.js +61 -0
- package/dist/storage/sqlite/connection.js.map +1 -1
- package/dist/storage/sqlite/index-io.d.ts +5 -0
- package/dist/storage/sqlite/index-io.d.ts.map +1 -1
- package/dist/storage/sqlite/index-io.js +98 -9
- package/dist/storage/sqlite/index-io.js.map +1 -1
- package/dist/storage/sqlite/meta.d.ts +7 -0
- package/dist/storage/sqlite/meta.d.ts.map +1 -1
- package/dist/storage/sqlite/meta.js.map +1 -1
- package/dist/storage/sqlite/queries.d.ts +66 -0
- package/dist/storage/sqlite/queries.d.ts.map +1 -0
- package/dist/storage/sqlite/queries.js +196 -0
- package/dist/storage/sqlite/queries.js.map +1 -0
- package/dist/storage/sqlite/schema.d.ts +2 -2
- package/dist/storage/sqlite/schema.d.ts.map +1 -1
- package/dist/storage/sqlite/schema.js +36 -0
- package/dist/storage/sqlite/schema.js.map +1 -1
- package/dist/storage/sqlite-index-store.d.ts +3 -1
- package/dist/storage/sqlite-index-store.d.ts.map +1 -1
- package/dist/storage/sqlite-index-store.js +4 -1
- package/dist/storage/sqlite-index-store.js.map +1 -1
- package/dist/storage/telemetry/uploader.js +1 -1
- package/dist/storage/telemetry/uploader.js.map +1 -1
- package/dist/storage/usage-tracker.d.ts +11 -0
- package/dist/storage/usage-tracker.d.ts.map +1 -1
- package/dist/storage/usage-tracker.js +18 -0
- package/dist/storage/usage-tracker.js.map +1 -1
- package/dist/tools/boundary-tools.js +2 -2
- package/dist/tools/boundary-tools.js.map +1 -1
- package/dist/tools/community-tools.d.ts +7 -0
- package/dist/tools/community-tools.d.ts.map +1 -1
- package/dist/tools/community-tools.js +31 -14
- package/dist/tools/community-tools.js.map +1 -1
- package/dist/tools/complexity-tools.d.ts.map +1 -1
- package/dist/tools/complexity-tools.js +65 -45
- package/dist/tools/complexity-tools.js.map +1 -1
- package/dist/tools/conversation-cache.d.ts +23 -3
- package/dist/tools/conversation-cache.d.ts.map +1 -1
- package/dist/tools/conversation-cache.js +141 -4
- package/dist/tools/conversation-cache.js.map +1 -1
- package/dist/tools/conversation-index-tools.d.ts +12 -0
- package/dist/tools/conversation-index-tools.d.ts.map +1 -1
- package/dist/tools/conversation-index-tools.js +316 -5
- package/dist/tools/conversation-index-tools.js.map +1 -1
- package/dist/tools/conversation-search-tools.d.ts +0 -5
- package/dist/tools/conversation-search-tools.d.ts.map +1 -1
- package/dist/tools/conversation-search-tools.js +78 -7
- package/dist/tools/conversation-search-tools.js.map +1 -1
- package/dist/tools/coupling-tools.d.ts +2 -2
- package/dist/tools/coupling-tools.d.ts.map +1 -1
- package/dist/tools/coupling-tools.js +8 -13
- package/dist/tools/coupling-tools.js.map +1 -1
- package/dist/tools/diff-tools.d.ts.map +1 -1
- package/dist/tools/diff-tools.js +8 -14
- package/dist/tools/diff-tools.js.map +1 -1
- package/dist/tools/explore-tools.d.ts +9 -0
- package/dist/tools/explore-tools.d.ts.map +1 -0
- package/dist/tools/explore-tools.js +177 -0
- package/dist/tools/explore-tools.js.map +1 -0
- package/dist/tools/git-exec.d.ts +42 -0
- package/dist/tools/git-exec.d.ts.map +1 -0
- package/dist/tools/git-exec.js +53 -0
- package/dist/tools/git-exec.js.map +1 -0
- package/dist/tools/graph-tools.d.ts +7 -0
- package/dist/tools/graph-tools.d.ts.map +1 -1
- package/dist/tools/graph-tools.js +41 -2
- package/dist/tools/graph-tools.js.map +1 -1
- package/dist/tools/hotspot-tools.d.ts +25 -0
- package/dist/tools/hotspot-tools.d.ts.map +1 -1
- package/dist/tools/hotspot-tools.js +24 -3
- package/dist/tools/hotspot-tools.js.map +1 -1
- package/dist/tools/impact-tools.d.ts.map +1 -1
- package/dist/tools/impact-tools.js +6 -9
- package/dist/tools/impact-tools.js.map +1 -1
- package/dist/tools/index-tools/file-indexer.d.ts +4 -0
- package/dist/tools/index-tools/file-indexer.d.ts.map +1 -1
- package/dist/tools/index-tools/file-indexer.js +155 -16
- package/dist/tools/index-tools/file-indexer.js.map +1 -1
- package/dist/tools/index-tools/folder-indexer.d.ts.map +1 -1
- package/dist/tools/index-tools/folder-indexer.js +5 -5
- package/dist/tools/index-tools/folder-indexer.js.map +1 -1
- package/dist/tools/index-tools/load-gate.d.ts +15 -0
- package/dist/tools/index-tools/load-gate.d.ts.map +1 -0
- package/dist/tools/index-tools/load-gate.js +57 -0
- package/dist/tools/index-tools/load-gate.js.map +1 -0
- package/dist/tools/index-tools/overload-guard.d.ts +16 -0
- package/dist/tools/index-tools/overload-guard.d.ts.map +1 -0
- package/dist/tools/index-tools/overload-guard.js +68 -0
- package/dist/tools/index-tools/overload-guard.js.map +1 -0
- package/dist/tools/index-tools/registry.d.ts +25 -1
- package/dist/tools/index-tools/registry.d.ts.map +1 -1
- package/dist/tools/index-tools/registry.js +149 -8
- package/dist/tools/index-tools/registry.js.map +1 -1
- package/dist/tools/index-tools/state.d.ts +35 -1
- package/dist/tools/index-tools/state.d.ts.map +1 -1
- package/dist/tools/index-tools/state.js +72 -0
- package/dist/tools/index-tools/state.js.map +1 -1
- package/dist/tools/index-tools/watcher.d.ts.map +1 -1
- package/dist/tools/index-tools/watcher.js +13 -5
- package/dist/tools/index-tools/watcher.js.map +1 -1
- package/dist/tools/index-tools/worktree-seed.d.ts +39 -1
- package/dist/tools/index-tools/worktree-seed.d.ts.map +1 -1
- package/dist/tools/index-tools/worktree-seed.js +154 -21
- package/dist/tools/index-tools/worktree-seed.js.map +1 -1
- package/dist/tools/index-tools.d.ts +2 -2
- package/dist/tools/index-tools.d.ts.map +1 -1
- package/dist/tools/index-tools.js +2 -2
- package/dist/tools/index-tools.js.map +1 -1
- package/dist/tools/insights-tools.d.ts.map +1 -1
- package/dist/tools/insights-tools.js +6 -3
- package/dist/tools/insights-tools.js.map +1 -1
- package/dist/tools/journal-generator-helpers.d.ts.map +1 -1
- package/dist/tools/journal-generator-helpers.js +3 -1
- package/dist/tools/journal-generator-helpers.js.map +1 -1
- package/dist/tools/patterns/execution.d.ts.map +1 -1
- package/dist/tools/patterns/execution.js +28 -10
- package/dist/tools/patterns/execution.js.map +1 -1
- package/dist/tools/review-diff/checks/coupling.js +1 -1
- package/dist/tools/review-diff/checks/coupling.js.map +1 -1
- package/dist/tools/secret-detectors.d.ts +10 -1
- package/dist/tools/secret-detectors.d.ts.map +1 -1
- package/dist/tools/secret-detectors.js +16 -2
- package/dist/tools/secret-detectors.js.map +1 -1
- package/dist/tools/secret-file-scanner.d.ts +3 -1
- package/dist/tools/secret-file-scanner.d.ts.map +1 -1
- package/dist/tools/secret-file-scanner.js +4 -2
- package/dist/tools/secret-file-scanner.js.map +1 -1
- package/dist/tools/secret-tools.d.ts.map +1 -1
- package/dist/tools/secret-tools.js +6 -3
- package/dist/tools/secret-tools.js.map +1 -1
- package/dist/tools/status-tools.d.ts +20 -0
- package/dist/tools/status-tools.d.ts.map +1 -1
- package/dist/tools/status-tools.js +46 -0
- package/dist/tools/status-tools.js.map +1 -1
- package/dist/tools/symbol-analysis-tools.d.ts.map +1 -1
- package/dist/tools/symbol-analysis-tools.js +27 -2
- package/dist/tools/symbol-analysis-tools.js.map +1 -1
- package/dist/tools/symbol-reference-tools.js +4 -4
- package/dist/tools/symbol-reference-tools.js.map +1 -1
- package/dist/tools/symbol-tool-internals.d.ts +10 -0
- package/dist/tools/symbol-tool-internals.d.ts.map +1 -1
- package/dist/tools/symbol-tool-internals.js +16 -1
- package/dist/tools/symbol-tool-internals.js.map +1 -1
- package/dist/tools/test-impact-tools.js +1 -1
- package/dist/tools/test-impact-tools.js.map +1 -1
- package/dist/tools/wiki-overview-sources.d.ts.map +1 -1
- package/dist/tools/wiki-overview-sources.js +3 -0
- package/dist/tools/wiki-overview-sources.js.map +1 -1
- package/dist/utils/import-graph/collect.d.ts +2 -3
- package/dist/utils/import-graph/collect.d.ts.map +1 -1
- package/dist/utils/import-graph/collect.js +73 -8
- package/dist/utils/import-graph/collect.js.map +1 -1
- package/dist/utils/import-graph/edge-accumulator.d.ts.map +1 -1
- package/dist/utils/import-graph/edge-accumulator.js +5 -0
- package/dist/utils/import-graph/edge-accumulator.js.map +1 -1
- package/dist/utils/import-graph/edge-cache.d.ts +15 -0
- package/dist/utils/import-graph/edge-cache.d.ts.map +1 -0
- package/dist/utils/import-graph/edge-cache.js +106 -0
- package/dist/utils/import-graph/edge-cache.js.map +1 -0
- package/dist/utils/import-graph/language-imports.d.ts +2 -2
- package/dist/utils/import-graph/language-imports.d.ts.map +1 -1
- package/dist/utils/import-graph/language-imports.js.map +1 -1
- package/dist/utils/import-graph/path-map.d.ts +2 -2
- package/dist/utils/import-graph/path-map.d.ts.map +1 -1
- package/dist/utils/import-graph/path-map.js.map +1 -1
- package/dist/utils/import-graph/python-php-edge-collectors.d.ts +2 -3
- package/dist/utils/import-graph/python-php-edge-collectors.d.ts.map +1 -1
- package/dist/utils/import-graph/python-php-edge-collectors.js.map +1 -1
- package/dist/utils/import-graph/source-edge-collector.d.ts +2 -3
- package/dist/utils/import-graph/source-edge-collector.d.ts.map +1 -1
- package/dist/utils/import-graph/types.d.ts +36 -1
- package/dist/utils/import-graph/types.d.ts.map +1 -1
- package/dist/utils/import-graph/typescript-edge-collector.d.ts +2 -3
- package/dist/utils/import-graph/typescript-edge-collector.d.ts.map +1 -1
- package/dist/utils/import-graph/typescript-edge-collector.js +6 -2
- package/dist/utils/import-graph/typescript-edge-collector.js.map +1 -1
- package/dist/utils/import-graph/workspace-alias.d.ts +2 -2
- package/dist/utils/import-graph/workspace-alias.d.ts.map +1 -1
- package/dist/utils/import-graph/workspace-alias.js.map +1 -1
- package/dist/utils/language-detect.d.ts +2 -4
- package/dist/utils/language-detect.d.ts.map +1 -1
- package/dist/utils/language-detect.js +26 -4
- package/dist/utils/language-detect.js.map +1 -1
- package/dist/utils/ts-imports.d.ts +16 -0
- package/dist/utils/ts-imports.d.ts.map +1 -1
- package/dist/utils/ts-imports.js +65 -3
- package/dist/utils/ts-imports.js.map +1 -1
- package/package.json +3 -3
- package/rules/codesift.md +19 -0
- package/rules/codesift.mdc +19 -0
- package/rules/codex.md +19 -0
- package/rules/gemini.md +19 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health-vitals.d.ts","sourceRoot":"","sources":["../../src/server-helpers/health-vitals.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,MAAM;IACrB,sFAAsF;IACtF,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAOD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,UAAU,GAAE,MAA2B,GAAG,IAAI,CAUzE;AAED,wBAAgB,UAAU,IAAI,IAAI,CAIjC;AAED,6DAA6D;AAC7D,wBAAgB,yBAAyB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAE1D;AAuBD,wBAAgB,UAAU,IAAI,MAAM,CAYnC;AAYD,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,IAAI,GAAG,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAStF"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { memoryUsage } from "node:process";
|
|
2
|
+
import { getHeapStatistics } from "node:v8";
|
|
3
|
+
let lagMs = 0;
|
|
4
|
+
let timer = null;
|
|
5
|
+
const SAMPLE_INTERVAL_MS = 500;
|
|
6
|
+
/**
|
|
7
|
+
* Sample the loop's lateness continuously, because measuring it inside the request would measure a
|
|
8
|
+
* loop that has, by definition, just reached our handler. The interesting value is how late the
|
|
9
|
+
* loop was while nobody was asking.
|
|
10
|
+
*/
|
|
11
|
+
export function startVitals(intervalMs = SAMPLE_INTERVAL_MS) {
|
|
12
|
+
if (timer)
|
|
13
|
+
return;
|
|
14
|
+
let expected = Date.now() + intervalMs;
|
|
15
|
+
timer = setInterval(() => {
|
|
16
|
+
const now = Date.now();
|
|
17
|
+
lagMs = Math.max(0, now - expected);
|
|
18
|
+
expected = now + intervalMs;
|
|
19
|
+
}, intervalMs);
|
|
20
|
+
// Must never hold the process open: a daemon told to exit exits.
|
|
21
|
+
timer.unref();
|
|
22
|
+
}
|
|
23
|
+
export function stopVitals() {
|
|
24
|
+
if (timer)
|
|
25
|
+
clearTimeout(timer);
|
|
26
|
+
timer = null;
|
|
27
|
+
lagMs = 0;
|
|
28
|
+
}
|
|
29
|
+
/** Exported for tests, which cannot wait 500 ms per case. */
|
|
30
|
+
export function setEventLoopLagForTesting(ms) {
|
|
31
|
+
lagMs = ms;
|
|
32
|
+
}
|
|
33
|
+
function heapLimitMb() {
|
|
34
|
+
// V8's OWN number, not a parse of how this process was started. `getHeapStatistics().heap_size_limit`
|
|
35
|
+
// is authoritative in every case — a flag in argv, a flag in NODE_OPTIONS, or no flag at all — and it
|
|
36
|
+
// costs nothing.
|
|
37
|
+
//
|
|
38
|
+
// The previous version read `process.execArgv` for `--max-old-space-size=` and, failing that,
|
|
39
|
+
// APPROXIMATED the default as `min(4096, max(2048, totalmem/32))`. Both halves were wrong somewhere:
|
|
40
|
+
//
|
|
41
|
+
// - `execArgv` is EMPTY when the flag arrives through NODE_OPTIONS, which is how the systemd user
|
|
42
|
+
// unit sets it on Linux (the macOS LaunchAgent puts it in argv, so that platform read correctly
|
|
43
|
+
// and this went unnoticed). Measured on a 187 GB Linux host: the daemon genuinely had 8,384 MB
|
|
44
|
+
// and /health reported 4,096 — so `heap_used_pct` was inflated 2x and `classifyVitals` would
|
|
45
|
+
// have declared memory pressure at half the real usage.
|
|
46
|
+
// - the approximation could not even produce the value its own comment named: V8's default on that
|
|
47
|
+
// class of machine is 4,288 MB, and `min(4096, …)` caps below it.
|
|
48
|
+
//
|
|
49
|
+
// Measured directly on that host: NODE_OPTIONS set -> heap_size_limit 8,384 MB with an empty
|
|
50
|
+
// execArgv; unset -> 4,288 MB. One call answers both.
|
|
51
|
+
return Math.round(getHeapStatistics().heap_size_limit / 1024 ** 2);
|
|
52
|
+
}
|
|
53
|
+
export function readVitals() {
|
|
54
|
+
const mem = memoryUsage();
|
|
55
|
+
const limit = heapLimitMb();
|
|
56
|
+
const usedMb = mem.heapUsed / 1024 ** 2;
|
|
57
|
+
return {
|
|
58
|
+
event_loop_lag_ms: Math.round(lagMs),
|
|
59
|
+
heap_used_mb: Math.round(usedMb),
|
|
60
|
+
heap_limit_mb: limit,
|
|
61
|
+
heap_used_pct: Math.round((usedMb / limit) * 100),
|
|
62
|
+
rss_mb: Math.round(mem.rss / 1024 ** 2),
|
|
63
|
+
uptime_s: Math.round(process.uptime()),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Degraded is NOT the same as dead, and conflating them is what made every one of those incidents
|
|
68
|
+
* look like "CodeSift is down" to an agent that could still have used it.
|
|
69
|
+
*
|
|
70
|
+
* `busy` keeps the 200: tool calls will be slow, the session should still load its tools and work.
|
|
71
|
+
* Only `stale` — code replaced under a running process, where every call genuinely fails — is a 503.
|
|
72
|
+
*/
|
|
73
|
+
const LAG_BUSY_MS = 2_000;
|
|
74
|
+
const HEAP_BUSY_PCT = 85;
|
|
75
|
+
export function classifyVitals(v) {
|
|
76
|
+
const reasons = [];
|
|
77
|
+
if (v.event_loop_lag_ms >= LAG_BUSY_MS) {
|
|
78
|
+
reasons.push(`event loop ${v.event_loop_lag_ms} ms late — requests are queueing behind blocking work`);
|
|
79
|
+
}
|
|
80
|
+
if (v.heap_used_pct >= HEAP_BUSY_PCT) {
|
|
81
|
+
reasons.push(`heap ${v.heap_used_mb}/${v.heap_limit_mb} MB (${v.heap_used_pct}%) — an OOM restart drops every in-flight call`);
|
|
82
|
+
}
|
|
83
|
+
return reasons.length > 0 ? { status: "busy", reasons } : { status: "ok", reasons };
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=health-vitals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health-vitals.js","sourceRoot":"","sources":["../../src/server-helpers/health-vitals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAiC5C,IAAI,KAAK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ACtF,CAAC"}
|
|
@@ -9,10 +9,25 @@
|
|
|
9
9
|
* answered `Repository "local/" not found`, because `resolveRepoFromCwd("/")`
|
|
10
10
|
* matches nothing and falls back to `local/` + basename("/") = "".
|
|
11
11
|
*
|
|
12
|
-
* So the CWD has to travel with the request rather than with the process.
|
|
13
|
-
*
|
|
14
|
-
* session's requests inside this context
|
|
15
|
-
* fall through to `process.cwd()`, exactly as before.
|
|
12
|
+
* So the CWD has to travel with the request rather than with the process. It
|
|
13
|
+
* travels in the URL: `setup <client> --http` writes `?cwd=<abs path>` and the
|
|
14
|
+
* daemon runs that session's requests inside this context. stdio callers get an
|
|
15
|
+
* empty store and fall through to `process.cwd()`, exactly as before.
|
|
16
|
+
*
|
|
17
|
+
* NOT from MCP roots. This comment used to say the daemon asks each client for
|
|
18
|
+
* its roots once per session; nothing implements that — `roots/list` appears
|
|
19
|
+
* nowhere in the server. The claim cost a reader a full investigation before the
|
|
20
|
+
* grep came back empty, which is why it is called out rather than quietly
|
|
21
|
+
* deleted.
|
|
22
|
+
*
|
|
23
|
+
* The consequence is structural and worth stating here, because it decides how
|
|
24
|
+
* many processes a machine runs: an HTTP entry is inherently PER-PROJECT, since
|
|
25
|
+
* one URL carries one directory. A client that keeps ONE GLOBAL MCP config
|
|
26
|
+
* therefore cannot use the shared daemon at all and falls back to stdio — one
|
|
27
|
+
* process per session. Measured on this machine: Claude Code, which stores MCP
|
|
28
|
+
* config per project, had 114 projects on the daemon; Codex, which has only
|
|
29
|
+
* ~/.codex/config.toml, had 36 stdio processes. Implementing `roots/list` is
|
|
30
|
+
* what would close that gap.
|
|
16
31
|
*
|
|
17
32
|
* AsyncLocalStorage rather than a parameter thread because the consumers sit
|
|
18
33
|
* deep under `wrapTool` — repo resolution, hint generation — and every one of
|
|
@@ -22,6 +37,19 @@
|
|
|
22
37
|
export interface RequestContext {
|
|
23
38
|
/** Directory the calling client is working in. */
|
|
24
39
|
cwd: string;
|
|
40
|
+
/**
|
|
41
|
+
* Which client is asking, from `?client=` in the URL.
|
|
42
|
+
*
|
|
43
|
+
* Needed because clients disagree about what a good tool list is, and one daemon answers all of
|
|
44
|
+
* them. Codex freezes its list at session start, so anything not offered up front is unreachable
|
|
45
|
+
* for the whole session; Claude Code refreshes on demand and measurably STOPS USING CodeSift when
|
|
46
|
+
* handed the full list (3e1ec6c, adoption down >90%). A single shared answer cannot satisfy both.
|
|
47
|
+
*
|
|
48
|
+
* It travels in the URL for the same reason `cwd` does: stateless serving has no session to have
|
|
49
|
+
* learned it, and the `initialized` notification lands on an instance that never saw `initialize`
|
|
50
|
+
* — measured, it arrives with an empty clientInfo.
|
|
51
|
+
*/
|
|
52
|
+
client?: string;
|
|
25
53
|
/**
|
|
26
54
|
* Aborted when the client-facing timeout fires.
|
|
27
55
|
*
|
|
@@ -45,6 +73,8 @@ export declare function runWithRequestContext<T>(ctx: RequestContext, fn: () =>
|
|
|
45
73
|
* process's otherwise. The fallback is what keeps stdio behaviour identical.
|
|
46
74
|
*/
|
|
47
75
|
export declare function currentCwd(): string;
|
|
76
|
+
/** Which client this request belongs to, when its URL said so. */
|
|
77
|
+
export declare function currentClient(): string | undefined;
|
|
48
78
|
/**
|
|
49
79
|
* The ambient cancellation signal, if a request is in scope.
|
|
50
80
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-context.d.ts","sourceRoot":"","sources":["../../src/server-helpers/request-context.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"request-context.d.ts","sourceRoot":"","sources":["../../src/server-helpers/request-context.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,MAAM,WAAW,cAAc;IAC7B,kDAAkD;IAClD,GAAG,EAAE,MAAM,CAAC;IACZ;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAID,8EAA8E;AAC9E,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,GAAG,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAE5E;AAED;;;GAGG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AAED,kEAAkE;AAClE,wBAAgB,aAAa,IAAI,MAAM,GAAG,SAAS,CAElD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,WAAW,GAAG,SAAS,CAE5D;AAED,2FAA2F;AAC3F,wBAAgB,qBAAqB,IAAI,cAAc,GAAG,SAAS,CAElE;AAED,8EAA8E;AAC9E,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C"}
|
|
@@ -11,6 +11,10 @@ export function runWithRequestContext(ctx, fn) {
|
|
|
11
11
|
export function currentCwd() {
|
|
12
12
|
return storage.getStore()?.cwd ?? process.cwd();
|
|
13
13
|
}
|
|
14
|
+
/** Which client this request belongs to, when its URL said so. */
|
|
15
|
+
export function currentClient() {
|
|
16
|
+
return storage.getStore()?.client;
|
|
17
|
+
}
|
|
14
18
|
/**
|
|
15
19
|
* The ambient cancellation signal, if a request is in scope.
|
|
16
20
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-context.js","sourceRoot":"","sources":["../../src/server-helpers/request-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"request-context.js","sourceRoot":"","sources":["../../src/server-helpers/request-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAwErD,MAAM,OAAO,GAAG,IAAI,iBAAiB,EAAkB,CAAC;AAExD,8EAA8E;AAC9E,MAAM,UAAU,qBAAqB,CAAI,GAAmB,EAAE,EAAW;IACvE,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,OAAO,CAAC,QAAQ,EAAE,EAAE,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;AAClD,CAAC;AAED,kEAAkE;AAClE,MAAM,UAAU,aAAa;IAC3B,OAAO,OAAO,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC;AACpC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO,OAAO,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC;AACpC,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,qBAAqB;IACnC,OAAO,OAAO,CAAC,QAAQ,EAAE,CAAC;AAC5B,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,iBAAiB;IAC/B,OAAO,OAAO,CAAC,QAAQ,EAAE,KAAK,SAAS,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The response ceiling, in one place.
|
|
3
|
+
*
|
|
4
|
+
* formatResponse cuts anything above it, and the shown-source ledger must know it too: a symbol
|
|
5
|
+
* body that the cap is about to drop was never delivered, so recording it as "shown" would later
|
|
6
|
+
* earn the agent an "unchanged" pointer for code it never received (found in review of 29b8025).
|
|
7
|
+
*/
|
|
8
|
+
import { CHARS_PER_TOKEN } from "../tools/search-tools/constants.js";
|
|
9
|
+
export { CHARS_PER_TOKEN };
|
|
10
|
+
/** Default hard cap on one tool response. */
|
|
11
|
+
export declare const MAX_RESPONSE_TOKENS = 30000;
|
|
12
|
+
/**
|
|
13
|
+
* Room the truncation notice needs (counts + saved-path line). The cap is a promise about what the
|
|
14
|
+
* agent receives, so the notice comes out of the budget instead of landing on top of it.
|
|
15
|
+
*/
|
|
16
|
+
export declare const TRUNCATION_NOTICE_RESERVE_CHARS = 600;
|
|
17
|
+
/**
|
|
18
|
+
* CODESIFT_MAX_RESPONSE_TOKENS lowers (or raises) the ceiling for hosts with a smaller tool-result
|
|
19
|
+
* budget; unparseable values and anything under 500 keep the default.
|
|
20
|
+
*/
|
|
21
|
+
export declare function resolveMaxResponseTokens(): number;
|
|
22
|
+
/** Characters of body text a response may carry before formatResponse starts cutting. */
|
|
23
|
+
export declare function responseBodyCharBudget(): number;
|
|
24
|
+
//# sourceMappingURL=response-budget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response-budget.d.ts","sourceRoot":"","sources":["../../src/server-helpers/response-budget.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAErE,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,6CAA6C;AAC7C,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAE1C;;;GAGG;AACH,eAAO,MAAM,+BAA+B,MAAM,CAAC;AAEnD;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAGjD;AAED,yFAAyF;AACzF,wBAAgB,sBAAsB,IAAI,MAAM,CAE/C"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The response ceiling, in one place.
|
|
3
|
+
*
|
|
4
|
+
* formatResponse cuts anything above it, and the shown-source ledger must know it too: a symbol
|
|
5
|
+
* body that the cap is about to drop was never delivered, so recording it as "shown" would later
|
|
6
|
+
* earn the agent an "unchanged" pointer for code it never received (found in review of 29b8025).
|
|
7
|
+
*/
|
|
8
|
+
import { CHARS_PER_TOKEN } from "../tools/search-tools/constants.js";
|
|
9
|
+
export { CHARS_PER_TOKEN };
|
|
10
|
+
/** Default hard cap on one tool response. */
|
|
11
|
+
export const MAX_RESPONSE_TOKENS = 30_000;
|
|
12
|
+
/**
|
|
13
|
+
* Room the truncation notice needs (counts + saved-path line). The cap is a promise about what the
|
|
14
|
+
* agent receives, so the notice comes out of the budget instead of landing on top of it.
|
|
15
|
+
*/
|
|
16
|
+
export const TRUNCATION_NOTICE_RESERVE_CHARS = 600;
|
|
17
|
+
/**
|
|
18
|
+
* CODESIFT_MAX_RESPONSE_TOKENS lowers (or raises) the ceiling for hosts with a smaller tool-result
|
|
19
|
+
* budget; unparseable values and anything under 500 keep the default.
|
|
20
|
+
*/
|
|
21
|
+
export function resolveMaxResponseTokens() {
|
|
22
|
+
const raw = Number(process.env["CODESIFT_MAX_RESPONSE_TOKENS"]);
|
|
23
|
+
return Number.isFinite(raw) && raw >= 500 ? Math.floor(raw) : MAX_RESPONSE_TOKENS;
|
|
24
|
+
}
|
|
25
|
+
/** Characters of body text a response may carry before formatResponse starts cutting. */
|
|
26
|
+
export function responseBodyCharBudget() {
|
|
27
|
+
return Math.floor(resolveMaxResponseTokens() * CHARS_PER_TOKEN) - TRUNCATION_NOTICE_RESERVE_CHARS;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=response-budget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response-budget.js","sourceRoot":"","sources":["../../src/server-helpers/response-budget.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAErE,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,6CAA6C;AAC7C,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAE1C;;;GAGG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,GAAG,CAAC;AAEnD;;;GAGG;AACH,MAAM,UAAU,wBAAwB;IACtC,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAChE,OAAO,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC;AACpF,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,sBAAsB;IACpC,OAAO,IAAI,CAAC,KAAK,CAAC,wBAAwB,EAAE,GAAG,eAAe,CAAC,GAAG,+BAA+B,CAAC;AACpG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response-hints.d.ts","sourceRoot":"","sources":["../../src/server-helpers/response-hints.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"response-hints.d.ts","sourceRoot":"","sources":["../../src/server-helpers/response-hints.ts"],"names":[],"mappings":"AAmBA,0EAA0E;AAC1E,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAkB3D;AAgJD,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI,EACjC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI,GACnC,IAAI,CAGN;AAmBD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAwK/G;AAED,wBAAgB,cAAc,IAAI,IAAI,CASrC"}
|
|
@@ -3,6 +3,8 @@ import { currentCwd } from "./request-context.js";
|
|
|
3
3
|
import { findWorkingTree, isAnswerFromWrongTree } from "../utils/worktree.js";
|
|
4
4
|
import { getCallCount, getSessionState } from "../storage/session-state.js";
|
|
5
5
|
const HIGH_CARDINALITY_THRESHOLD = 50;
|
|
6
|
+
/** How many distinct repo names H19 remembers having warned about. See `worktreeMismatchNote`. */
|
|
7
|
+
const H19_REPO_MEMORY_CAP = 200;
|
|
6
8
|
const BATCHABLE_TOOLS = new Set(["search_text", "search_symbols", "find_references", "get_symbol"]);
|
|
7
9
|
const SEQUENTIAL_HINT_THRESHOLD = 3;
|
|
8
10
|
let lastToolName = "";
|
|
@@ -84,11 +86,42 @@ function isTestAntipatternQuery(query) {
|
|
|
84
86
|
// H9 = question-word text query, use semantic search
|
|
85
87
|
// H19 = answering from a DIFFERENT git working tree than your CWD
|
|
86
88
|
// ---------------------------------------------------------------------------
|
|
89
|
+
/**
|
|
90
|
+
* True when the caller NAMED the tree it was answered from, rather than being handed it.
|
|
91
|
+
*
|
|
92
|
+
* `getRepoName` suffixes a LINKED worktree's registry name with `@<worktree>`, and a bare name
|
|
93
|
+
* never contains `@` — so the suffix is precisely the signal that the caller picked this tree on
|
|
94
|
+
* purpose. Resolution has already matched the string to that entry, so there is nothing to warn
|
|
95
|
+
* about: the answer describes the files that were asked for.
|
|
96
|
+
*
|
|
97
|
+
* This is what H19 was missing, and it dominated the hint. Measured on this machine over 14 days:
|
|
98
|
+
* 2,721 H19 firings, **2,678 of them (98.4%) on a repo named with the `@` suffix**, 0 on a path —
|
|
99
|
+
* and `search_text` calls carrying H19 came back EMPTY LESS often than calls without it (19.1% vs
|
|
100
|
+
* 23.8%), which is the opposite of what a wrong-tree answer looks like. The advice was wrong too:
|
|
101
|
+
* `index_folder(path=<cwd>)` addresses the caller's own tree, which is not the tree it asked about.
|
|
102
|
+
*
|
|
103
|
+
* The dangerous case is untouched, because it cannot carry a suffix: a BARE name resolving to the
|
|
104
|
+
* main checkout while the CWD is a linked worktree is exactly how an agent silently gets another
|
|
105
|
+
* checkout's files (ResearchShield: 4042 lines served for a file that was 1415 in the caller's own
|
|
106
|
+
* tree). An absolute path also keeps warning — it binds to any registered ancestor, which is the
|
|
107
|
+
* same hazard wearing different clothes.
|
|
108
|
+
*/
|
|
109
|
+
function callerNamedThisWorktree(repo, root) {
|
|
110
|
+
if (!repo.includes("@"))
|
|
111
|
+
return false;
|
|
112
|
+
return findWorkingTree(root)?.linked === true;
|
|
113
|
+
}
|
|
87
114
|
/**
|
|
88
115
|
* Build the H19 note when the resolved repo is a different working tree than
|
|
89
116
|
* the process CWD. Returns null in the ordinary case (same checkout), so this
|
|
90
117
|
* costs nothing on the hot path beyond one stat walk.
|
|
91
118
|
*
|
|
119
|
+
* Emitted at most ONCE per repo per session. It used to ride every single call, which is how one
|
|
120
|
+
* 26-hour session collected 932 copies of it — all 932 after that session's first `index_folder`,
|
|
121
|
+
* because the session was deliberately working across several trees of one repo from one CWD. A
|
|
122
|
+
* banner that repeats 932 times has stopped being information and is teaching the agent to skip
|
|
123
|
+
* hints; the honest form is to say it once and then be quiet.
|
|
124
|
+
*
|
|
92
125
|
* Best-effort by design: any failure resolving git or registry state yields no
|
|
93
126
|
* hint rather than a wrong one.
|
|
94
127
|
*/
|
|
@@ -101,6 +134,16 @@ function worktreeMismatchNote(args) {
|
|
|
101
134
|
const root = repoRootFor(repo);
|
|
102
135
|
if (!root || !isAnswerFromWrongTree(cwd, root))
|
|
103
136
|
return null;
|
|
137
|
+
if (callerNamedThisWorktree(repo, root))
|
|
138
|
+
return null;
|
|
139
|
+
const state = getSessionState();
|
|
140
|
+
if (state.h19EmittedFor.has(repo))
|
|
141
|
+
return null;
|
|
142
|
+
// Bounded: this process outlives every session in the shared daemon, and an unbounded Set keyed
|
|
143
|
+
// by caller-supplied strings is a leak with a friendly face. At the cap the hint simply repeats
|
|
144
|
+
// again, which is the safe direction to fail.
|
|
145
|
+
if (state.h19EmittedFor.size < H19_REPO_MEMORY_CAP)
|
|
146
|
+
state.h19EmittedFor.add(repo);
|
|
104
147
|
const tree = findWorkingTree(cwd);
|
|
105
148
|
const what = tree?.linked ? "a linked worktree" : "a different checkout";
|
|
106
149
|
return `⚡H19 answering from "${repo}" (${root}) but your CWD is ${what} (${tree?.root ?? cwd}) `
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response-hints.js","sourceRoot":"","sources":["../../src/server-helpers/response-hints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,eAAe,EAA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ACvB,aAAa,CAAC,KAAK,EAAE,CAAC;IACtB,0BAA0B,GAAG,KAAK,CAAC;IACnC,qBAAqB,GAAG,CAAC,CAAC;IAC1B,yBAAyB,CAAC,KAAK,EAAE,CAAC;IAClC,UAAU,GAAG,KAAK,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text every pointer starts with. The response cache must never store a response containing it:
|
|
3
|
+
* a cached pointer would be replayed after a compaction, telling the agent it holds code it lost.
|
|
4
|
+
*/
|
|
5
|
+
export declare const SHOWN_SOURCE_POINTER_MARK = "[source unchanged (";
|
|
6
|
+
export declare function compactionMarkerPath(): string;
|
|
7
|
+
/**
|
|
8
|
+
* Called by the PreCompact and SessionStart hooks: from now on, everything shown earlier counts as
|
|
9
|
+
* unseen. The timestamp is written as the file's CONTENT and read back from it, so both sides of
|
|
10
|
+
* the comparison come from Date.now() — mtime has a different clock and, on some filesystems,
|
|
11
|
+
* a coarser resolution.
|
|
12
|
+
*/
|
|
13
|
+
export declare function touchCompactionMarker(): void;
|
|
14
|
+
/**
|
|
15
|
+
* Turn the ledger on for this process. Only the stdio entry point calls this, and
|
|
16
|
+
* CODESIFT_DEDUP_SOURCE=0 keeps it off there too.
|
|
17
|
+
*/
|
|
18
|
+
export declare function enableShownSourceLedger(): void;
|
|
19
|
+
export declare function resetShownSourceLedgerForTesting(on?: boolean): void;
|
|
20
|
+
interface SourceBearing {
|
|
21
|
+
id: string;
|
|
22
|
+
source?: string | undefined;
|
|
23
|
+
file?: string;
|
|
24
|
+
name?: string;
|
|
25
|
+
start_line?: number;
|
|
26
|
+
}
|
|
27
|
+
/** What to render for one symbol, and how to record it once it is known to have been delivered. */
|
|
28
|
+
export interface ShownSourceView<T> {
|
|
29
|
+
symbol: T;
|
|
30
|
+
/** Pointer line to print under the header, or "" when the body is sent. */
|
|
31
|
+
note: string;
|
|
32
|
+
/** Record the body as shown. No-op for a pointer view and while the ledger is off. */
|
|
33
|
+
commit(): void;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The symbol to render: `source` replaced by a pointer when this exact body was already delivered
|
|
37
|
+
* in this conversation. Nothing is recorded here — see `commitDelivered`.
|
|
38
|
+
*/
|
|
39
|
+
export declare function elideShownSource<T extends SourceBearing>(sym: T, options?: {
|
|
40
|
+
force?: boolean;
|
|
41
|
+
}): ShownSourceView<T>;
|
|
42
|
+
/**
|
|
43
|
+
* Commit the views whose rendered text lands inside the response budget, in response order.
|
|
44
|
+
*
|
|
45
|
+
* The budget models the hard cap only. formatResponse's compact/counts cascade would rewrite a
|
|
46
|
+
* body away earlier, but it runs only for tools with a registered shortener, and none of the
|
|
47
|
+
* source-returning tools (get_symbol, get_symbols, find_and_show, get_context_bundle, explore) has
|
|
48
|
+
* one. Registering a shortener for any of them requires teaching this function about it first.
|
|
49
|
+
*
|
|
50
|
+
* `chars` is the length of that view's rendered block. Blocks past the budget are the ones
|
|
51
|
+
* formatResponse will cut, so they are not recorded — the agent will not have received them.
|
|
52
|
+
* Call only after the full response text has been built successfully.
|
|
53
|
+
*/
|
|
54
|
+
export declare function commitDelivered(parts: ReadonlyArray<{
|
|
55
|
+
view: ShownSourceView<unknown>;
|
|
56
|
+
chars: number;
|
|
57
|
+
}>, budgetChars?: number): void;
|
|
58
|
+
export {};
|
|
59
|
+
//# sourceMappingURL=shown-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shown-source.d.ts","sourceRoot":"","sources":["../../src/server-helpers/shown-source.ts"],"names":[],"mappings":"AAwCA;;;GAGG;AACH,eAAO,MAAM,yBAAyB,wBAAwB,CAAC;AAe/D,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAO5C;AAmBD;;;GAGG;AACH,wBAAgB,uBAAuB,IAAI,IAAI,CAE9C;AAED,wBAAgB,gCAAgC,CAAC,EAAE,UAAQ,GAAG,IAAI,CAGjE;AAED,UAAU,aAAa;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAaD,mGAAmG;AACnG,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,MAAM,EAAE,CAAC,CAAC;IACV,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAC;IACb,sFAAsF;IACtF,MAAM,IAAI,IAAI,CAAC;CAChB;AAWD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,aAAa,EACtD,GAAG,EAAE,CAAC,EACN,OAAO,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GAC5B,eAAe,CAAC,CAAC,CAAC,CAoCpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,aAAa,CAAC;IAAE,IAAI,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,EACvE,WAAW,GAAE,MAA6D,GACzE,IAAI,CAON"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Don't send the same source twice in one conversation.
|
|
3
|
+
*
|
|
4
|
+
* `get_symbol` / `get_symbols` / `find_and_show` / `get_context_bundle` return a symbol's full body
|
|
5
|
+
* every time it is asked for, and agents ask again — a method read to understand it, then again to
|
|
6
|
+
* edit it, then again inside a context bundle. Each repeat is a copy the model already holds.
|
|
7
|
+
* codegraph v1.6 answers a repeat with a pointer ("unchanged") instead; this is the same idea.
|
|
8
|
+
*
|
|
9
|
+
* Two conditions make a pointer the WRONG answer, and both are guarded:
|
|
10
|
+
*
|
|
11
|
+
* - **The conversation is not the process.** The shared HTTP daemon answers every client on the
|
|
12
|
+
* machine from one process, so "shown before" there means "shown to someone". The ledger is
|
|
13
|
+
* therefore off unless the stdio entry point turns it on — over stdio the process IS the session.
|
|
14
|
+
* - **The model no longer holds it.** Context compaction drops old tool results. The PreCompact
|
|
15
|
+
* hook touches `<dataDir>/compaction.marker`, and anything shown before the marker's mtime is
|
|
16
|
+
* treated as never shown. The marker is machine-wide, so a compaction in any session makes every
|
|
17
|
+
* session resend — the conservative direction. Entries also expire after a TTL, for hosts that
|
|
18
|
+
* compact without running hooks.
|
|
19
|
+
*
|
|
20
|
+
* A changed body (different hash) is always resent: the pointer claims "unchanged", so it may only
|
|
21
|
+
* be given when that is true.
|
|
22
|
+
*
|
|
23
|
+
* **Checking and recording are separate steps.** A body counts as shown only once the caller has
|
|
24
|
+
* built the whole response and knows the body survives it: `commit()` on each view, via
|
|
25
|
+
* `commitDelivered`, which skips anything the response cap is about to cut. Recording at check time
|
|
26
|
+
* (the first version) marked bodies as shown that formatting then failed on, that `explore` clipped,
|
|
27
|
+
* or that the cap truncated — and each of those earned a later "unchanged" pointer for code the agent
|
|
28
|
+
* never received.
|
|
29
|
+
*
|
|
30
|
+
* `/clear` in Claude Code keeps the stdio server alive, so a new conversation inherits the process.
|
|
31
|
+
* The SessionStart hook therefore touches the same marker as PreCompact: any fresh context resets.
|
|
32
|
+
*/
|
|
33
|
+
import { createHash } from "node:crypto";
|
|
34
|
+
import { readFileSync, statSync, writeFileSync, mkdirSync } from "node:fs";
|
|
35
|
+
import { join } from "node:path";
|
|
36
|
+
import { homedir } from "node:os";
|
|
37
|
+
import { responseBodyCharBudget } from "./response-budget.js";
|
|
38
|
+
const DEFAULT_TTL_MS = 30 * 60_000;
|
|
39
|
+
/**
|
|
40
|
+
* Text every pointer starts with. The response cache must never store a response containing it:
|
|
41
|
+
* a cached pointer would be replayed after a compaction, telling the agent it holds code it lost.
|
|
42
|
+
*/
|
|
43
|
+
export const SHOWN_SOURCE_POINTER_MARK = "[source unchanged (";
|
|
44
|
+
const MAX_ENTRIES = 5_000;
|
|
45
|
+
const ledger = new Map();
|
|
46
|
+
let enabled = false;
|
|
47
|
+
function dataDir() {
|
|
48
|
+
return process.env["CODESIFT_DATA_DIR"] ?? join(homedir(), ".codesift");
|
|
49
|
+
}
|
|
50
|
+
export function compactionMarkerPath() {
|
|
51
|
+
return join(dataDir(), "compaction.marker");
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Called by the PreCompact and SessionStart hooks: from now on, everything shown earlier counts as
|
|
55
|
+
* unseen. The timestamp is written as the file's CONTENT and read back from it, so both sides of
|
|
56
|
+
* the comparison come from Date.now() — mtime has a different clock and, on some filesystems,
|
|
57
|
+
* a coarser resolution.
|
|
58
|
+
*/
|
|
59
|
+
export function touchCompactionMarker() {
|
|
60
|
+
try {
|
|
61
|
+
mkdirSync(dataDir(), { recursive: true });
|
|
62
|
+
writeFileSync(compactionMarkerPath(), String(Date.now()));
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
// A hook must never fail the host's compaction; the TTL still bounds the damage.
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function lastCompactionAt() {
|
|
69
|
+
const path = compactionMarkerPath();
|
|
70
|
+
try {
|
|
71
|
+
const written = Number(readFileSync(path, "utf-8").trim());
|
|
72
|
+
if (Number.isFinite(written) && written > 0)
|
|
73
|
+
return written;
|
|
74
|
+
// Unparseable content (hand-touched file): fall back to mtime rather than to "never".
|
|
75
|
+
return statSync(path).mtimeMs;
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
return 0;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function ttlMs() {
|
|
82
|
+
const raw = Number(process.env["CODESIFT_SHOWN_SOURCE_TTL_MS"]);
|
|
83
|
+
return Number.isFinite(raw) && raw > 0 ? raw : DEFAULT_TTL_MS;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Turn the ledger on for this process. Only the stdio entry point calls this, and
|
|
87
|
+
* CODESIFT_DEDUP_SOURCE=0 keeps it off there too.
|
|
88
|
+
*/
|
|
89
|
+
export function enableShownSourceLedger() {
|
|
90
|
+
enabled = process.env["CODESIFT_DEDUP_SOURCE"] !== "0";
|
|
91
|
+
}
|
|
92
|
+
export function resetShownSourceLedgerForTesting(on = false) {
|
|
93
|
+
ledger.clear();
|
|
94
|
+
enabled = on;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Ledger key. NOT the raw id: tools hand back the same symbol as `repo:file:name:line` or as
|
|
98
|
+
* `file:name:line` depending on the lookup path (find_and_show vs get_symbols), so keying on the id
|
|
99
|
+
* made a body shown by one tool look unseen to the next.
|
|
100
|
+
*/
|
|
101
|
+
function ledgerKey(sym) {
|
|
102
|
+
return sym.file !== undefined && sym.name !== undefined && sym.start_line !== undefined
|
|
103
|
+
? `${sym.file}:${sym.name}:${sym.start_line}`
|
|
104
|
+
: sym.id;
|
|
105
|
+
}
|
|
106
|
+
const NOOP = () => { };
|
|
107
|
+
/**
|
|
108
|
+
* formatResponse prepends a savings line and response hints BEFORE the body, so the body's own
|
|
109
|
+
* budget is smaller than the cap by that much. Conservative: over-reserving only means a block near
|
|
110
|
+
* the edge is resent later, never that a cut block is claimed as delivered.
|
|
111
|
+
*/
|
|
112
|
+
const HINT_PREFIX_RESERVE_CHARS = 1_000;
|
|
113
|
+
/**
|
|
114
|
+
* The symbol to render: `source` replaced by a pointer when this exact body was already delivered
|
|
115
|
+
* in this conversation. Nothing is recorded here — see `commitDelivered`.
|
|
116
|
+
*/
|
|
117
|
+
export function elideShownSource(sym, options) {
|
|
118
|
+
if (!enabled || !sym.source)
|
|
119
|
+
return { symbol: sym, note: "", commit: NOOP };
|
|
120
|
+
const source = sym.source;
|
|
121
|
+
const hash = createHash("sha1").update(source).digest("hex");
|
|
122
|
+
const key = ledgerKey(sym);
|
|
123
|
+
const prior = ledger.get(key);
|
|
124
|
+
const stillHeld = prior !== undefined
|
|
125
|
+
&& prior.hash === hash
|
|
126
|
+
&& Date.now() - prior.shownAt < ttlMs()
|
|
127
|
+
&& prior.shownAt > lastCompactionAt();
|
|
128
|
+
if (stillHeld && !options?.force) {
|
|
129
|
+
const { source: _omitted, ...rest } = sym;
|
|
130
|
+
const lines = source.split("\n").length;
|
|
131
|
+
return {
|
|
132
|
+
symbol: rest,
|
|
133
|
+
note: ` ${SHOWN_SOURCE_POINTER_MARK}${lines} lines, id ${sym.id}) — already shown in this ` +
|
|
134
|
+
"conversation; repeat the call with full_source=true to resend it]",
|
|
135
|
+
commit: NOOP,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
return {
|
|
139
|
+
symbol: sym,
|
|
140
|
+
note: "",
|
|
141
|
+
commit: () => {
|
|
142
|
+
// Map preserves insertion order: delete-then-set moves the entry to the end, so the oldest
|
|
143
|
+
// entry is always first and eviction is a single iterator step.
|
|
144
|
+
ledger.delete(key);
|
|
145
|
+
ledger.set(key, { hash, shownAt: Date.now() });
|
|
146
|
+
if (ledger.size > MAX_ENTRIES) {
|
|
147
|
+
const oldest = ledger.keys().next().value;
|
|
148
|
+
if (oldest !== undefined)
|
|
149
|
+
ledger.delete(oldest);
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Commit the views whose rendered text lands inside the response budget, in response order.
|
|
156
|
+
*
|
|
157
|
+
* The budget models the hard cap only. formatResponse's compact/counts cascade would rewrite a
|
|
158
|
+
* body away earlier, but it runs only for tools with a registered shortener, and none of the
|
|
159
|
+
* source-returning tools (get_symbol, get_symbols, find_and_show, get_context_bundle, explore) has
|
|
160
|
+
* one. Registering a shortener for any of them requires teaching this function about it first.
|
|
161
|
+
*
|
|
162
|
+
* `chars` is the length of that view's rendered block. Blocks past the budget are the ones
|
|
163
|
+
* formatResponse will cut, so they are not recorded — the agent will not have received them.
|
|
164
|
+
* Call only after the full response text has been built successfully.
|
|
165
|
+
*/
|
|
166
|
+
export function commitDelivered(parts, budgetChars = responseBodyCharBudget() - HINT_PREFIX_RESERVE_CHARS) {
|
|
167
|
+
let used = 0;
|
|
168
|
+
for (const { view, chars } of parts) {
|
|
169
|
+
used += chars;
|
|
170
|
+
if (used > budgetChars)
|
|
171
|
+
return;
|
|
172
|
+
view.commit();
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=shown-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shown-source.js","sourceRoot":"","sources":["../../src/server-helpers/shown-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,MAAM,cAAc,GAAG,EAAE,GAAG,MAAM,CAAC;AAEnC;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,qBAAqB,CAAC;AAC/D,MAAM,WAAW,GAAG,KAAK,CAAC;AAO1B,MAAM,MAAM,GAAG,IAAI,GAAG,EAAsB,CAAC;AAC7C,IAAI,OAAO,GAAG,KAAK,CAAC;AAEpB,SAAS,OAAO;IACd,OAAO,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,WAAW,CAAC,CAAC;AAC1E,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,OAAO,IAAI,CAAC,OAAO,EAAE,EAAE,mBAAmB,CAAC,CAAC;AAC9C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB;IACnC,IAAI,CAAC;QACH,SAAS,CAAC,OAAO,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