@ai-setting/roy-agent-core 1.0.0
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/index.js +99145 -0
- package/package.json +114 -0
- package/src/config/config-component.test.ts +627 -0
- package/src/config/config-component.ts +906 -0
- package/src/config/config-parser.test.ts +319 -0
- package/src/config/config-parser.ts +203 -0
- package/src/config/decentralized-config.test.ts +740 -0
- package/src/config/env-key.ts +210 -0
- package/src/config/env-source.test.ts +252 -0
- package/src/config/env-source.ts +301 -0
- package/src/config/file-source.test.ts +357 -0
- package/src/config/file-source.ts +421 -0
- package/src/config/index.ts +24 -0
- package/src/config/protocol-resolver.test.ts +217 -0
- package/src/config/protocol-resolver.ts +228 -0
- package/src/env/agent/agent-component.abort.test.ts +511 -0
- package/src/env/agent/agent-component.record-session.test.ts +349 -0
- package/src/env/agent/agent-component.test.ts +1389 -0
- package/src/env/agent/agent-component.tool-error.test.ts +327 -0
- package/src/env/agent/agent-component.ts +1711 -0
- package/src/env/agent/agent-config-registration.test.ts +226 -0
- package/src/env/agent/agent-config-registration.ts +46 -0
- package/src/env/agent/agent-reminder-plugin.integration.test.ts +243 -0
- package/src/env/agent/index.ts +10 -0
- package/src/env/agent/summary-agent.parse-hint.test.ts +360 -0
- package/src/env/agent/summary-agent.ts +508 -0
- package/src/env/agent/types.ts +536 -0
- package/src/env/commands/commands-component.test.ts +364 -0
- package/src/env/commands/commands-component.ts +604 -0
- package/src/env/commands/commands-config-registration.test.ts +198 -0
- package/src/env/commands/commands-config-registration.ts +38 -0
- package/src/env/commands/index.ts +21 -0
- package/src/env/commands/parser.test.ts +203 -0
- package/src/env/commands/parser.ts +115 -0
- package/src/env/commands/types.ts +184 -0
- package/src/env/commands-prompt-integration.test.ts +243 -0
- package/src/env/component-env.test.ts +119 -0
- package/src/env/component.ts +335 -0
- package/src/env/constants.test.ts +72 -0
- package/src/env/constants.ts +123 -0
- package/src/env/debug/debug-component.test.ts +114 -0
- package/src/env/debug/debug-component.ts +547 -0
- package/src/env/debug/formatters/index.ts +9 -0
- package/src/env/debug/formatters/repl-formatter.test.ts +139 -0
- package/src/env/debug/formatters/repl-formatter.ts +358 -0
- package/src/env/debug/formatters/trace-formatter.test.ts +119 -0
- package/src/env/debug/formatters/trace-formatter.ts +191 -0
- package/src/env/debug/formatters/tree-formatter.test.ts +107 -0
- package/src/env/debug/formatters/tree-formatter.ts +325 -0
- package/src/env/debug/index.ts +38 -0
- package/src/env/debug/parser/regex-parser.test.ts +201 -0
- package/src/env/debug/parser/regex-parser.ts +196 -0
- package/src/env/debug/parser/span-builder.test.ts +241 -0
- package/src/env/debug/parser/span-builder.ts +386 -0
- package/src/env/debug/reader/log-reader.test.ts +170 -0
- package/src/env/debug/reader/log-reader.ts +186 -0
- package/src/env/debug/reader/span-db-reader.test.ts +118 -0
- package/src/env/debug/reader/span-db-reader.ts +201 -0
- package/src/env/debug/types.test.ts +187 -0
- package/src/env/debug/types.ts +171 -0
- package/src/env/environment-init.test.ts +183 -0
- package/src/env/environment-lifecycle.test.ts +516 -0
- package/src/env/environment-service.test.ts +332 -0
- package/src/env/environment.handle-query.test.ts +96 -0
- package/src/env/environment.test.ts +232 -0
- package/src/env/environment.ts +708 -0
- package/src/env/errors.test.ts +165 -0
- package/src/env/errors.ts +157 -0
- package/src/env/event-source/event-source-agent-handler.test.ts +193 -0
- package/src/env/event-source/event-source-agent-handler.ts +111 -0
- package/src/env/event-source/event-source-component.process-cleanup.test.ts +236 -0
- package/src/env/event-source/event-source-component.stop.test.ts +346 -0
- package/src/env/event-source/event-source-component.test.ts +1207 -0
- package/src/env/event-source/event-source-component.ts +1379 -0
- package/src/env/event-source/event-source-config-registration.test.ts +242 -0
- package/src/env/event-source/event-source-config-registration.ts +37 -0
- package/src/env/event-source/event-source-integration.test.ts +320 -0
- package/src/env/event-source/event-source-platform.test.ts +630 -0
- package/src/env/event-source/types.ts +298 -0
- package/src/env/hook/global-hook-manager.ts +162 -0
- package/src/env/hook/hook-manager.test.ts +374 -0
- package/src/env/hook/hook-manager.ts +309 -0
- package/src/env/hook/index.ts +38 -0
- package/src/env/hook/types.ts +138 -0
- package/src/env/index.ts +144 -0
- package/src/env/interface.ts +203 -0
- package/src/env/llm/hooks.test.ts +293 -0
- package/src/env/llm/hooks.ts +316 -0
- package/src/env/llm/index.ts +61 -0
- package/src/env/llm/invoke-threshold-check.test.ts +88 -0
- package/src/env/llm/invoke-timeout.test.ts +54 -0
- package/src/env/llm/invoke.test.ts +71 -0
- package/src/env/llm/invoke.ts +1039 -0
- package/src/env/llm/llm-config.test.ts +523 -0
- package/src/env/llm/llm.test.ts +233 -0
- package/src/env/llm/llm.ts +568 -0
- package/src/env/llm/provider.test.ts +182 -0
- package/src/env/llm/provider.ts +108 -0
- package/src/env/llm/transform.test.ts +251 -0
- package/src/env/llm/transform.ts +286 -0
- package/src/env/llm/types.test.ts +580 -0
- package/src/env/llm/types.ts +424 -0
- package/src/env/log-trace/decorator-otel.test.ts +182 -0
- package/src/env/log-trace/decorator.ts +230 -0
- package/src/env/log-trace/index.ts +79 -0
- package/src/env/log-trace/log-trace-component.test.ts +242 -0
- package/src/env/log-trace/log-trace-component.ts +497 -0
- package/src/env/log-trace/log-trace-config-registration.test.ts +348 -0
- package/src/env/log-trace/log-trace-config-registration.ts +45 -0
- package/src/env/log-trace/logger.test.ts +149 -0
- package/src/env/log-trace/logger.ts +522 -0
- package/src/env/log-trace/opentelemetry/cli-propagation.test.ts +147 -0
- package/src/env/log-trace/opentelemetry/cli-propagation.ts +194 -0
- package/src/env/log-trace/opentelemetry/integration.test.ts +668 -0
- package/src/env/log-trace/opentelemetry/mod.ts +25 -0
- package/src/env/log-trace/opentelemetry/propagation-env.test.ts +181 -0
- package/src/env/log-trace/opentelemetry/propagation-env.ts +136 -0
- package/src/env/log-trace/opentelemetry/propagation.test.ts +259 -0
- package/src/env/log-trace/opentelemetry/propagation.ts +215 -0
- package/src/env/log-trace/opentelemetry/tracer-provider-context.test.ts +166 -0
- package/src/env/log-trace/opentelemetry/tracer-provider.test.ts +379 -0
- package/src/env/log-trace/opentelemetry/tracer-provider.ts +612 -0
- package/src/env/log-trace/span-storage.test.ts +145 -0
- package/src/env/log-trace/span-storage.ts +230 -0
- package/src/env/log-trace/trace-context.test.ts +187 -0
- package/src/env/log-trace/trace-context.ts +162 -0
- package/src/env/log-trace/types.test.ts +63 -0
- package/src/env/log-trace/types.ts +172 -0
- package/src/env/mcp/README.md +244 -0
- package/src/env/mcp/__integration__/mcp-component.integration.test.ts +373 -0
- package/src/env/mcp/config.test.ts +74 -0
- package/src/env/mcp/config.ts +116 -0
- package/src/env/mcp/index.ts +41 -0
- package/src/env/mcp/loader.test.ts +161 -0
- package/src/env/mcp/loader.ts +209 -0
- package/src/env/mcp/mcp-component.test.ts +111 -0
- package/src/env/mcp/mcp-component.ts +358 -0
- package/src/env/mcp/mcp-config-registration.test.ts +304 -0
- package/src/env/mcp/mcp-config-registration.ts +50 -0
- package/src/env/mcp/scanner.test.ts +170 -0
- package/src/env/mcp/scanner.ts +246 -0
- package/src/env/mcp/tool/adapter.test.ts +520 -0
- package/src/env/mcp/tool/adapter.ts +521 -0
- package/src/env/mcp/tool/index.ts +5 -0
- package/src/env/mcp/types.test.ts +171 -0
- package/src/env/mcp/types.ts +79 -0
- package/src/env/memory/README.md +177 -0
- package/src/env/memory/built-in/index.ts +59 -0
- package/src/env/memory/built-in/recall-memory.ts +103 -0
- package/src/env/memory/built-in/record-memory.ts +148 -0
- package/src/env/memory/index.ts +20 -0
- package/src/env/memory/memory-component.test.ts +239 -0
- package/src/env/memory/memory-component.ts +503 -0
- package/src/env/memory/memory-config-registration.test.ts +67 -0
- package/src/env/memory/memory-config-registration.ts +48 -0
- package/src/env/memory/memory-config.ts +45 -0
- package/src/env/memory/memory-file.test.ts +268 -0
- package/src/env/memory/plugin/index.ts +48 -0
- package/src/env/memory/plugin/memory-agent.test.ts +249 -0
- package/src/env/memory/plugin/memory-agent.ts +365 -0
- package/src/env/memory/plugin/memory-manager.ts +198 -0
- package/src/env/memory/plugin/memory-plugin-agent.test.ts +145 -0
- package/src/env/memory/plugin/memory-plugin.ts +210 -0
- package/src/env/memory/plugin/plugin-simplified.test.ts +51 -0
- package/src/env/memory/plugin/recall-memory.test.ts +106 -0
- package/src/env/memory/plugin/recall-memory.ts +53 -0
- package/src/env/memory/plugin/types.ts +101 -0
- package/src/env/memory/tools/memory-agent-tools.ts +228 -0
- package/src/env/memory/types.ts +85 -0
- package/src/env/paths.ts +118 -0
- package/src/env/prompt/index.ts +18 -0
- package/src/env/prompt/memory-prompts.test.ts +91 -0
- package/src/env/prompt/prompt-component.test.ts +491 -0
- package/src/env/prompt/prompt-component.ts +619 -0
- package/src/env/prompt/prompt-config-registration.test.ts +213 -0
- package/src/env/prompt/prompt-config-registration.ts +39 -0
- package/src/env/prompt/prompts-index.ts +504 -0
- package/src/env/prompt/renderer.ts +67 -0
- package/src/env/prompt/types.ts +136 -0
- package/src/env/session/hooks.ts +18 -0
- package/src/env/session/index.ts +37 -0
- package/src/env/session/search-query-parser.test.ts +425 -0
- package/src/env/session/search-query-parser.ts +171 -0
- package/src/env/session/session-checkpoint.test.ts +523 -0
- package/src/env/session/session-component.extract-recent-messages.test.ts +209 -0
- package/src/env/session/session-component.test.ts +132 -0
- package/src/env/session/session-component.ts +1249 -0
- package/src/env/session/session-config-registration.test.ts +138 -0
- package/src/env/session/session-config-registration.ts +52 -0
- package/src/env/session/session-message-converter.test.ts +763 -0
- package/src/env/session/session-message-converter.ts +415 -0
- package/src/env/session/session-message-e2e.test.ts +448 -0
- package/src/env/session/session-search.test.ts +391 -0
- package/src/env/session/session-store.test.ts +362 -0
- package/src/env/session/session-store.ts +141 -0
- package/src/env/session/storage/index.ts +6 -0
- package/src/env/session/storage/memory.ts +502 -0
- package/src/env/session/storage/sqlite.ts +794 -0
- package/src/env/session/types.ts +742 -0
- package/src/env/skill/config.ts +39 -0
- package/src/env/skill/index.ts +6 -0
- package/src/env/skill/parser.test.ts +116 -0
- package/src/env/skill/parser.ts +77 -0
- package/src/env/skill/scanner.test.ts +211 -0
- package/src/env/skill/scanner.ts +119 -0
- package/src/env/skill/skill-component.test.ts +234 -0
- package/src/env/skill/skill-component.ts +352 -0
- package/src/env/skill/skill-config-registration.test.ts +60 -0
- package/src/env/skill/skill-config-registration.ts +43 -0
- package/src/env/skill/tool/index.ts +1 -0
- package/src/env/skill/tool/skill-tool.test.ts +100 -0
- package/src/env/skill/tool/skill-tool.ts +72 -0
- package/src/env/skill/types.ts +64 -0
- package/src/env/task/delegate/delegate-tool.test.ts +498 -0
- package/src/env/task/delegate/delegate-tool.ts +1014 -0
- package/src/env/task/delegate/index.ts +18 -0
- package/src/env/task/delegate/stop-tool.test.ts +140 -0
- package/src/env/task/delegate/stop-tool.ts +119 -0
- package/src/env/task/delegate/task-events.test.ts +178 -0
- package/src/env/task/delegate/task-events.ts +143 -0
- package/src/env/task/hooks/contexts.test.ts +92 -0
- package/src/env/task/hooks/contexts.ts +192 -0
- package/src/env/task/hooks/index.ts +23 -0
- package/src/env/task/hooks/task-hook-points.test.ts +32 -0
- package/src/env/task/hooks/task-hook-points.ts +54 -0
- package/src/env/task/index.ts +7 -0
- package/src/env/task/plugins/index.ts +13 -0
- package/src/env/task/plugins/task-plugin.test.ts +74 -0
- package/src/env/task/plugins/task-plugin.ts +89 -0
- package/src/env/task/plugins/task-tag-plugin.test.ts +377 -0
- package/src/env/task/plugins/task-tag-plugin.ts +319 -0
- package/src/env/task/plugins/task-workflow-extractor.integration.test.ts +226 -0
- package/src/env/task/plugins/workflow-extractor-agent.test.ts +107 -0
- package/src/env/task/plugins/workflow-extractor-agent.ts +225 -0
- package/src/env/task/storage/index.ts +6 -0
- package/src/env/task/storage/sqlite-task-store.test.ts +283 -0
- package/src/env/task/storage/sqlite-task-store.ts +903 -0
- package/src/env/task/storage/task-search.test.ts +291 -0
- package/src/env/task/tag-service.test.ts +198 -0
- package/src/env/task/tag-service.ts +264 -0
- package/src/env/task/task-component.test.ts +193 -0
- package/src/env/task/task-component.ts +658 -0
- package/src/env/task/task-config-registration.test.ts +57 -0
- package/src/env/task/task-config-registration.ts +37 -0
- package/src/env/task/task-types.test.ts +137 -0
- package/src/env/task/tools/complete-tool.ts +44 -0
- package/src/env/task/tools/create-tool.ts +49 -0
- package/src/env/task/tools/delete-tool.ts +43 -0
- package/src/env/task/tools/get-tool.ts +59 -0
- package/src/env/task/tools/index.ts +10 -0
- package/src/env/task/tools/list-tool.ts +40 -0
- package/src/env/task/tools/operation/create-tool.ts +48 -0
- package/src/env/task/tools/operation/delete-tool.ts +43 -0
- package/src/env/task/tools/operation/get-tool.ts +43 -0
- package/src/env/task/tools/operation/index.ts +9 -0
- package/src/env/task/tools/operation/list-tool.ts +40 -0
- package/src/env/task/tools/operation/operation-tools.test.ts +274 -0
- package/src/env/task/tools/operation/operation-types.ts +75 -0
- package/src/env/task/tools/operation/update-tool.ts +47 -0
- package/src/env/task/tools/task-tools.test.ts +203 -0
- package/src/env/task/tools/task-types.test.ts +75 -0
- package/src/env/task/tools/task-types.ts +68 -0
- package/src/env/task/tools/update-tool.ts +70 -0
- package/src/env/task/types.ts +160 -0
- package/src/env/tool/built-in/bash.ts +201 -0
- package/src/env/tool/built-in/echo.ts +29 -0
- package/src/env/tool/built-in/edit-file.test.ts +136 -0
- package/src/env/tool/built-in/edit-file.ts +92 -0
- package/src/env/tool/built-in/glob.test.ts +94 -0
- package/src/env/tool/built-in/glob.ts +65 -0
- package/src/env/tool/built-in/grep.test.ts +122 -0
- package/src/env/tool/built-in/grep.ts +108 -0
- package/src/env/tool/built-in/index.ts +44 -0
- package/src/env/tool/built-in/read-file.test.ts +84 -0
- package/src/env/tool/built-in/read-file.ts +75 -0
- package/src/env/tool/built-in/write-file.test.ts +119 -0
- package/src/env/tool/built-in/write-file.ts +68 -0
- package/src/env/tool/index.ts +24 -0
- package/src/env/tool/registry.test.ts +257 -0
- package/src/env/tool/registry.ts +167 -0
- package/src/env/tool/tool-component.test.ts +559 -0
- package/src/env/tool/tool-component.ts +563 -0
- package/src/env/tool/tool-config-registration.test.ts +249 -0
- package/src/env/tool/tool-config-registration.ts +46 -0
- package/src/env/tool/types.ts +267 -0
- package/src/env/tool/validator.test.ts +143 -0
- package/src/env/tool/validator.ts +44 -0
- package/src/env/types.ts +180 -0
- package/src/env/workflow/ask-user-tool-registration.test.ts +216 -0
- package/src/env/workflow/complex-workflow.integration.test.ts +1900 -0
- package/src/env/workflow/decorators/decorator-node.ts +229 -0
- package/src/env/workflow/decorators/decorator.test.ts +196 -0
- package/src/env/workflow/decorators/edge.ts +82 -0
- package/src/env/workflow/decorators/index.ts +31 -0
- package/src/env/workflow/decorators/node-as.ts +98 -0
- package/src/env/workflow/decorators/workflow.ts +54 -0
- package/src/env/workflow/engine/dag-manager.test.ts +570 -0
- package/src/env/workflow/engine/dag-manager.ts +594 -0
- package/src/env/workflow/engine/engine.ts +1422 -0
- package/src/env/workflow/engine/event-bus.test.ts +359 -0
- package/src/env/workflow/engine/event-bus.ts +156 -0
- package/src/env/workflow/engine/executor-agent-session.test.ts +84 -0
- package/src/env/workflow/engine/executor.test.ts +619 -0
- package/src/env/workflow/engine/executor.ts +593 -0
- package/src/env/workflow/engine/index.ts +24 -0
- package/src/env/workflow/engine/node-registry.test.ts +560 -0
- package/src/env/workflow/engine/node-registry.ts +289 -0
- package/src/env/workflow/engine/resume-removed.test.ts +22 -0
- package/src/env/workflow/engine/scheduler.test.ts +715 -0
- package/src/env/workflow/engine/scheduler.ts +318 -0
- package/src/env/workflow/engine/workflow-engine.test.ts +815 -0
- package/src/env/workflow/extractor/workflow-converter.ts +306 -0
- package/src/env/workflow/fixtures.ts +380 -0
- package/src/env/workflow/index.ts +38 -0
- package/src/env/workflow/integration/run-resume-unified.test.ts +186 -0
- package/src/env/workflow/integration/service-integration.test.ts +267 -0
- package/src/env/workflow/metadata/keys.ts +12 -0
- package/src/env/workflow/nodes/agent-component-adapter.test.ts +318 -0
- package/src/env/workflow/nodes/agent-component-adapter.ts +448 -0
- package/src/env/workflow/nodes/agent-node.test.ts +371 -0
- package/src/env/workflow/nodes/agent-node.ts +598 -0
- package/src/env/workflow/nodes/ask-user-node.ts +113 -0
- package/src/env/workflow/nodes/condition-node.ts +200 -0
- package/src/env/workflow/nodes/index.ts +9 -0
- package/src/env/workflow/nodes/merge-node.ts +141 -0
- package/src/env/workflow/nodes/skill-node.test.ts +253 -0
- package/src/env/workflow/nodes/skill-node.ts +393 -0
- package/src/env/workflow/nodes/tool-node.test.ts +251 -0
- package/src/env/workflow/nodes/tool-node.ts +493 -0
- package/src/env/workflow/nodes/workflow-llm-history.test.ts +455 -0
- package/src/env/workflow/nodes/workflow-node.test.ts +315 -0
- package/src/env/workflow/nodes/workflow-node.ts +311 -0
- package/src/env/workflow/service/index.ts +27 -0
- package/src/env/workflow/service/registry.test.ts +133 -0
- package/src/env/workflow/service/registry.ts +71 -0
- package/src/env/workflow/service/workflow-service.test.ts +310 -0
- package/src/env/workflow/service/workflow-service.ts +393 -0
- package/src/env/workflow/storage/index.ts +28 -0
- package/src/env/workflow/storage/mock-repositories.ts +385 -0
- package/src/env/workflow/storage/sqlite.test.ts +179 -0
- package/src/env/workflow/storage/sqlite.ts +163 -0
- package/src/env/workflow/storage/workflow-repo.test.ts +780 -0
- package/src/env/workflow/storage/workflow-repo.ts +342 -0
- package/src/env/workflow/tools/ask-user-tool.ts +82 -0
- package/src/env/workflow/tools/index.ts +26 -0
- package/src/env/workflow/tools/run-workflow.test.ts +352 -0
- package/src/env/workflow/tools/run-workflow.ts +214 -0
- package/src/env/workflow/types/context.ts +18 -0
- package/src/env/workflow/types/decorators-types.ts +198 -0
- package/src/env/workflow/types/event.test.ts +515 -0
- package/src/env/workflow/types/event.ts +193 -0
- package/src/env/workflow/types/index.ts +49 -0
- package/src/env/workflow/types/run.test.ts +437 -0
- package/src/env/workflow/types/run.ts +173 -0
- package/src/env/workflow/types/workflow-hil.ts +114 -0
- package/src/env/workflow/types/workflow-message.test.ts +138 -0
- package/src/env/workflow/types/workflow-message.ts +196 -0
- package/src/env/workflow/types/workflow-session.test.ts +95 -0
- package/src/env/workflow/types/workflow-session.ts +59 -0
- package/src/env/workflow/types/workflow.test.ts +495 -0
- package/src/env/workflow/types/workflow.ts +195 -0
- package/src/env/workflow/types_compat.ts +51 -0
- package/src/env/workflow/utils/create-workflow.ts +47 -0
- package/src/env/workflow/utils/execution-state.ts +245 -0
- package/src/env/workflow/utils/index.ts +18 -0
- package/src/env/workflow/utils/node-registry-helper.ts +58 -0
- package/src/env/workflow/utils/recovery-validator.test.ts +460 -0
- package/src/env/workflow/utils/recovery-validator.ts +377 -0
- package/src/env/workflow/utils/session-parser.test.ts +111 -0
- package/src/env/workflow/utils/session-parser.ts +94 -0
- package/src/env/workflow/utils/session-recovery.test.ts +334 -0
- package/src/env/workflow/utils/session-recovery.ts +188 -0
- package/src/env/workflow/utils/template-resolver.test.ts +258 -0
- package/src/env/workflow/utils/template-resolver.ts +436 -0
- package/src/env/workflow/utils/validation-rules.ts +149 -0
- package/src/env/workflow/workflow-component.ts +544 -0
- package/src/index.ts +422 -0
- package/src/utils/id.ts +21 -0
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
import { describe, test, expect, beforeEach, afterEach } from "bun:test";
|
|
2
|
+
import { MemorySessionStore } from "./storage/memory";
|
|
3
|
+
import { SQLiteSessionStore } from "./storage/sqlite";
|
|
4
|
+
import { join } from "path";
|
|
5
|
+
import * as fs from "fs";
|
|
6
|
+
|
|
7
|
+
// ============================================================================
|
|
8
|
+
// Test Utilities
|
|
9
|
+
// ============================================================================
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 创建临时数据库路径(每次测试使用唯一路径)
|
|
13
|
+
*/
|
|
14
|
+
function createTestDbPath(): string {
|
|
15
|
+
const timestamp = Date.now();
|
|
16
|
+
const random = Math.random().toString(36).substring(2, 8);
|
|
17
|
+
return join("/tmp", `test-sessions-${timestamp}-${random}.db`);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* 清理测试数据库文件
|
|
22
|
+
*/
|
|
23
|
+
async function cleanupTestDb(dbPath: string): Promise<void> {
|
|
24
|
+
try {
|
|
25
|
+
await fs.promises.unlink(dbPath);
|
|
26
|
+
} catch {
|
|
27
|
+
// 文件不存在,忽略
|
|
28
|
+
}
|
|
29
|
+
// 也清理可能的 WAL 和 SHM 文件
|
|
30
|
+
try {
|
|
31
|
+
await fs.promises.unlink(`${dbPath}-wal`);
|
|
32
|
+
} catch {}
|
|
33
|
+
try {
|
|
34
|
+
await fs.promises.unlink(`${dbPath}-shm`);
|
|
35
|
+
} catch {}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// ============================================================================
|
|
39
|
+
// SQLiteSessionStore Tests
|
|
40
|
+
// ============================================================================
|
|
41
|
+
|
|
42
|
+
describe("SQLiteSessionStore 基础功能", () => {
|
|
43
|
+
let store: SQLiteSessionStore;
|
|
44
|
+
let testDbPath: string;
|
|
45
|
+
|
|
46
|
+
beforeEach(async () => {
|
|
47
|
+
testDbPath = createTestDbPath();
|
|
48
|
+
store = new SQLiteSessionStore(testDbPath);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
afterEach(async () => {
|
|
52
|
+
await store.close();
|
|
53
|
+
await cleanupTestDb(testDbPath);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
describe("Session CRUD", () => {
|
|
57
|
+
test("应该创建新会话", async () => {
|
|
58
|
+
const session = await store.create({ title: "Test Session" });
|
|
59
|
+
|
|
60
|
+
expect(session.id).toMatch(/^session_/);
|
|
61
|
+
expect(session.title).toBe("Test Session");
|
|
62
|
+
expect(session.directory).toBe("/tmp");
|
|
63
|
+
expect(session.messageCount).toBe(0);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
test("应该获取会话", async () => {
|
|
67
|
+
const created = await store.create({ title: "Get Test" });
|
|
68
|
+
const retrieved = await store.get(created.id);
|
|
69
|
+
|
|
70
|
+
expect(retrieved).toBeDefined();
|
|
71
|
+
expect(retrieved?.id).toBe(created.id);
|
|
72
|
+
expect(retrieved?.title).toBe("Get Test");
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
test("获取不存在的会话应返回 undefined", async () => {
|
|
76
|
+
const result = await store.get("non-existent-id");
|
|
77
|
+
expect(result).toBeUndefined();
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
test("应该列出所有会话", async () => {
|
|
81
|
+
await store.create({ title: "Session 1" });
|
|
82
|
+
await store.create({ title: "Session 2" });
|
|
83
|
+
await store.create({ title: "Session 3" });
|
|
84
|
+
|
|
85
|
+
const sessions = await store.list();
|
|
86
|
+
expect(sessions.length).toBeGreaterThanOrEqual(3);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
test("应该更新会话标题", async () => {
|
|
90
|
+
const session = await store.create({ title: "Old Title" });
|
|
91
|
+
const updated = await store.update(session.id, { title: "New Title" });
|
|
92
|
+
|
|
93
|
+
expect(updated).toBe(true);
|
|
94
|
+
const retrieved = await store.get(session.id);
|
|
95
|
+
expect(retrieved?.title).toBe("New Title");
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
test("更新不存在的会话应返回 false", async () => {
|
|
99
|
+
const result = await store.update("non-existent-id", { title: "Test" });
|
|
100
|
+
expect(result).toBe(false);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
test("应该删除会话", async () => {
|
|
104
|
+
const session = await store.create({ title: "To Delete" });
|
|
105
|
+
const deleted = await store.delete(session.id);
|
|
106
|
+
|
|
107
|
+
expect(deleted).toBe(true);
|
|
108
|
+
const retrieved = await store.get(session.id);
|
|
109
|
+
expect(retrieved).toBeUndefined();
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
test("删除不存在的会话应返回 false", async () => {
|
|
113
|
+
const result = await store.delete("non-existent-id");
|
|
114
|
+
expect(result).toBe(false);
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
describe("Messages", () => {
|
|
119
|
+
test("应该添加消息到会话", async () => {
|
|
120
|
+
const session = await store.create({ title: "Messages Test" });
|
|
121
|
+
const messageId = await store.addMessage(session.id, {
|
|
122
|
+
role: "user",
|
|
123
|
+
content: "Hello, world!"
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
expect(messageId).toMatch(/^msg_/);
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
test("添加消息到不存在的会话应抛出错误", async () => {
|
|
130
|
+
await expect(
|
|
131
|
+
store.addMessage("non-existent", { role: "user", content: "Test" })
|
|
132
|
+
).rejects.toThrow("Session not found");
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
test("应该获取会话消息", async () => {
|
|
136
|
+
const session = await store.create({ title: "Get Messages Test" });
|
|
137
|
+
await store.addMessage(session.id, { role: "user", content: "Message 1" });
|
|
138
|
+
await store.addMessage(session.id, { role: "assistant", content: "Message 2" });
|
|
139
|
+
|
|
140
|
+
const messages = await store.getMessages(session.id);
|
|
141
|
+
expect(messages.length).toBe(2);
|
|
142
|
+
expect(messages[0].content).toBe("Message 1");
|
|
143
|
+
expect(messages[1].content).toBe("Message 2");
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
test("应该获取消息数量", async () => {
|
|
147
|
+
const session = await store.create({ title: "Count Test" });
|
|
148
|
+
await store.addMessage(session.id, { role: "user", content: "1" });
|
|
149
|
+
await store.addMessage(session.id, { role: "user", content: "2" });
|
|
150
|
+
await store.addMessage(session.id, { role: "user", content: "3" });
|
|
151
|
+
|
|
152
|
+
const count = await store.getMessageCount(session.id);
|
|
153
|
+
expect(count).toBe(3);
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
test("应该支持分页获取消息", async () => {
|
|
157
|
+
const session = await store.create({ title: "Pagination Test" });
|
|
158
|
+
for (let i = 0; i < 10; i++) {
|
|
159
|
+
await store.addMessage(session.id, { role: "user", content: `Message ${i}` });
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
const messages1 = await store.getMessages(session.id, 0, 3);
|
|
163
|
+
expect(messages1.length).toBe(3);
|
|
164
|
+
|
|
165
|
+
const messages2 = await store.getMessages(session.id, 3, 3);
|
|
166
|
+
expect(messages2.length).toBe(3);
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
describe("持久化", () => {
|
|
171
|
+
test("应该持久化会话数据", async () => {
|
|
172
|
+
// 创建并关闭
|
|
173
|
+
const session = await store.create({ title: "Persistence Test" });
|
|
174
|
+
await store.close();
|
|
175
|
+
|
|
176
|
+
// 重新创建 store(相同路径)
|
|
177
|
+
const store2 = new SQLiteSessionStore(testDbPath);
|
|
178
|
+
const retrieved = await store2.get(session.id);
|
|
179
|
+
|
|
180
|
+
expect(retrieved).toBeDefined();
|
|
181
|
+
expect(retrieved?.title).toBe("Persistence Test");
|
|
182
|
+
|
|
183
|
+
await store2.close();
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
test("应该持久化消息数据", async () => {
|
|
187
|
+
const session = await store.create({ title: "Messages Persistence Test" });
|
|
188
|
+
await store.addMessage(session.id, { role: "user", content: "Persisted message" });
|
|
189
|
+
await store.close();
|
|
190
|
+
|
|
191
|
+
const store2 = new SQLiteSessionStore(testDbPath);
|
|
192
|
+
const messages = await store2.getMessages(session.id);
|
|
193
|
+
|
|
194
|
+
expect(messages.length).toBe(1);
|
|
195
|
+
expect(messages[0].content).toBe("Persisted message");
|
|
196
|
+
|
|
197
|
+
await store2.close();
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
describe("close", () => {
|
|
202
|
+
test("close后应该清理内存缓存但保留持久化数据", async () => {
|
|
203
|
+
await store.create({ title: "Session 1" });
|
|
204
|
+
await store.create({ title: "Session 2" });
|
|
205
|
+
|
|
206
|
+
const sessionsBefore = await store.list();
|
|
207
|
+
expect(sessionsBefore.length).toBeGreaterThanOrEqual(2);
|
|
208
|
+
|
|
209
|
+
await store.close();
|
|
210
|
+
|
|
211
|
+
// SQLite close 后数据仍然持久化,重新打开可以读取
|
|
212
|
+
const store2 = new SQLiteSessionStore(testDbPath);
|
|
213
|
+
const sessionsAfter = await store2.list();
|
|
214
|
+
expect(sessionsAfter.length).toBeGreaterThanOrEqual(2);
|
|
215
|
+
await store2.close();
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
test("应该支持多次调用", async () => {
|
|
219
|
+
await store.create({ title: "Test" });
|
|
220
|
+
|
|
221
|
+
await store.close();
|
|
222
|
+
await store.close();
|
|
223
|
+
|
|
224
|
+
expect(true).toBe(true);
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
// ============================================================================
|
|
230
|
+
// MemorySessionStore Tests
|
|
231
|
+
// ============================================================================
|
|
232
|
+
|
|
233
|
+
describe("SessionStore 资源清理", () => {
|
|
234
|
+
let store: MemorySessionStore;
|
|
235
|
+
|
|
236
|
+
beforeEach(() => {
|
|
237
|
+
store = new MemorySessionStore();
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
describe("close", () => {
|
|
241
|
+
test("应该清理所有会话数据", async () => {
|
|
242
|
+
// 创建一些会话
|
|
243
|
+
await store.create({ title: "Session 1" });
|
|
244
|
+
await store.create({ title: "Session 2" });
|
|
245
|
+
|
|
246
|
+
// 验证有数据
|
|
247
|
+
const sessionsBefore = await store.list();
|
|
248
|
+
expect(sessionsBefore.length).toBe(2);
|
|
249
|
+
|
|
250
|
+
// 调用 close
|
|
251
|
+
await store.close();
|
|
252
|
+
|
|
253
|
+
// 验证数据已清理
|
|
254
|
+
const sessionsAfter = await store.list();
|
|
255
|
+
expect(sessionsAfter.length).toBe(0);
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
test("应该清理所有消息数据", async () => {
|
|
259
|
+
// 创建会话并添加消息
|
|
260
|
+
const session = await store.create({ title: "Test Session" });
|
|
261
|
+
await store.addMessage(session.id, { role: "user", content: "Hello" });
|
|
262
|
+
await store.addMessage(session.id, { role: "assistant", content: "Hi" });
|
|
263
|
+
|
|
264
|
+
// 验证有消息
|
|
265
|
+
const countBefore = await store.getMessageCount(session.id);
|
|
266
|
+
expect(countBefore).toBe(2);
|
|
267
|
+
|
|
268
|
+
// 调用 close
|
|
269
|
+
await store.close();
|
|
270
|
+
|
|
271
|
+
// 验证消息已清理
|
|
272
|
+
const countAfter = await store.getMessageCount(session.id);
|
|
273
|
+
expect(countAfter).toBe(0);
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
test("应该支持多次调用", async () => {
|
|
277
|
+
await store.create({ title: "Test" });
|
|
278
|
+
|
|
279
|
+
// 多次调用不应该报错
|
|
280
|
+
await store.close();
|
|
281
|
+
await store.close();
|
|
282
|
+
|
|
283
|
+
expect(true).toBe(true);
|
|
284
|
+
});
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
describe("getMessageIndexes", () => {
|
|
288
|
+
test("应该返回指定role的所有消息index", async () => {
|
|
289
|
+
const session = await store.create({ title: "Get Indexes Test" });
|
|
290
|
+
// user, assistant, user, assistant, user
|
|
291
|
+
await store.addMessage(session.id, { role: "user", content: "Msg 0" });
|
|
292
|
+
await store.addMessage(session.id, { role: "assistant", content: "Msg 1" });
|
|
293
|
+
await store.addMessage(session.id, { role: "user", content: "Msg 2" });
|
|
294
|
+
await store.addMessage(session.id, { role: "assistant", content: "Msg 3" });
|
|
295
|
+
await store.addMessage(session.id, { role: "user", content: "Msg 4" });
|
|
296
|
+
|
|
297
|
+
const userIndexes = await store.getMessageIndexes(session.id, "user");
|
|
298
|
+
expect(userIndexes).toEqual([0, 2, 4]);
|
|
299
|
+
|
|
300
|
+
const assistantIndexes = await store.getMessageIndexes(session.id, "assistant");
|
|
301
|
+
expect(assistantIndexes).toEqual([1, 3]);
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
test("应该返回空数组当没有匹配的消息", async () => {
|
|
305
|
+
const session = await store.create({ title: "No Match Test" });
|
|
306
|
+
await store.addMessage(session.id, { role: "user", content: "Msg 0" });
|
|
307
|
+
|
|
308
|
+
const systemIndexes = await store.getMessageIndexes(session.id, "system");
|
|
309
|
+
expect(systemIndexes).toEqual([]);
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
test("应该返回空数组当会话不存在", async () => {
|
|
313
|
+
const indexes = await store.getMessageIndexes("non-existent", "user");
|
|
314
|
+
expect(indexes).toEqual([]);
|
|
315
|
+
});
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
describe("getMessages with negative offset", () => {
|
|
319
|
+
test("应该支持负数offset从后往前取", async () => {
|
|
320
|
+
const session = await store.create({ title: "Negative Offset Test" });
|
|
321
|
+
// 添加 10 条消息
|
|
322
|
+
for (let i = 0; i < 10; i++) {
|
|
323
|
+
await store.addMessage(session.id, { role: "user", content: `Msg ${i}` });
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
// offset=-1, limit=5: 获取最新的 5 条
|
|
327
|
+
const messages1 = await store.getMessages(session.id, -1, 5);
|
|
328
|
+
expect(messages1.length).toBe(5);
|
|
329
|
+
expect(messages1[0].content).toBe("Msg 5"); // 第 6 条开始
|
|
330
|
+
expect(messages1[4].content).toBe("Msg 9"); // 最后一条
|
|
331
|
+
|
|
332
|
+
// offset=-2, limit=5: 获取倒数第 2 批 5 条
|
|
333
|
+
const messages2 = await store.getMessages(session.id, -2, 5);
|
|
334
|
+
expect(messages2.length).toBe(5);
|
|
335
|
+
expect(messages2[0].content).toBe("Msg 0"); // 第 1 条开始
|
|
336
|
+
expect(messages2[4].content).toBe("Msg 4"); // 第 5 条
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
test("负数offset超出范围应该返回空数组", async () => {
|
|
340
|
+
const session = await store.create({ title: "Negative Offset Overflow Test" });
|
|
341
|
+
await store.addMessage(session.id, { role: "user", content: "Msg 0" });
|
|
342
|
+
|
|
343
|
+
// offset=-10, limit=5: 超出范围
|
|
344
|
+
const messages = await store.getMessages(session.id, -10, 5);
|
|
345
|
+
expect(messages.length).toBe(1);
|
|
346
|
+
});
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
describe("SessionMetadata messageCount", () => {
|
|
350
|
+
test("应该在添加消息后更新metadata中的messageCount", async () => {
|
|
351
|
+
const session = await store.create({ title: "Message Count Test" });
|
|
352
|
+
expect(session.metadata?.messageCount).toBe(0);
|
|
353
|
+
|
|
354
|
+
await store.addMessage(session.id, { role: "user", content: "Msg 0" });
|
|
355
|
+
await store.addMessage(session.id, { role: "assistant", content: "Msg 1" });
|
|
356
|
+
await store.addMessage(session.id, { role: "user", content: "Msg 2" });
|
|
357
|
+
|
|
358
|
+
const updated = await store.get(session.id);
|
|
359
|
+
expect(updated?.metadata?.messageCount).toBe(3);
|
|
360
|
+
});
|
|
361
|
+
});
|
|
362
|
+
});
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Session Store Interface
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import type {
|
|
6
|
+
Session,
|
|
7
|
+
CreateSessionOptions,
|
|
8
|
+
UpdateSessionOptions,
|
|
9
|
+
ListSessionsOptions,
|
|
10
|
+
SessionMessage,
|
|
11
|
+
SessionCheckpoint, // (new)
|
|
12
|
+
GetMessagesOptions, // (new)
|
|
13
|
+
SearchMessagesOptions, // (new)
|
|
14
|
+
MessageMatch, // (new)
|
|
15
|
+
} from "./types";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Session Store Interface
|
|
19
|
+
* Defines the contract for session storage implementations
|
|
20
|
+
*/
|
|
21
|
+
export interface SessionStore {
|
|
22
|
+
// === Session CRUD ===
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Create a new session
|
|
26
|
+
*/
|
|
27
|
+
create(options: CreateSessionOptions): Promise<Session>;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Get a session by ID
|
|
31
|
+
*/
|
|
32
|
+
get(id: string): Promise<Session | undefined>;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* List sessions with optional filtering
|
|
36
|
+
*/
|
|
37
|
+
list(options?: ListSessionsOptions): Promise<Session[]>;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Update a session
|
|
41
|
+
*/
|
|
42
|
+
update(id: string, updates: UpdateSessionOptions): Promise<boolean>;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Delete a session
|
|
46
|
+
*/
|
|
47
|
+
delete(id: string): Promise<boolean>;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Get total session count (without pagination)
|
|
51
|
+
*/
|
|
52
|
+
getCount(): Promise<number>;
|
|
53
|
+
|
|
54
|
+
// === Messages ===
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Add a message to a session
|
|
58
|
+
*/
|
|
59
|
+
addMessage(
|
|
60
|
+
sessionId: string,
|
|
61
|
+
message: { role: string; content: string; parts?: unknown[]; metadata?: Record<string, unknown> }
|
|
62
|
+
): Promise<string>;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Get messages from a session
|
|
66
|
+
* @param sessionId - Session ID
|
|
67
|
+
* @param offset - Starting index
|
|
68
|
+
* @param limit - Number of messages to return
|
|
69
|
+
* @param options - Additional options (includeArchived, fromCheckpointId, reverse)
|
|
70
|
+
*/
|
|
71
|
+
getMessages(
|
|
72
|
+
sessionId: string,
|
|
73
|
+
offset?: number,
|
|
74
|
+
limit?: number,
|
|
75
|
+
options?: GetMessagesOptions
|
|
76
|
+
): Promise<SessionMessage[]>;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Get message indexes by role
|
|
80
|
+
* @param sessionId - Session ID
|
|
81
|
+
* @param role - Role to filter by
|
|
82
|
+
*/
|
|
83
|
+
getMessageIndexes(sessionId: string, role: string): Promise<number[]>;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Get message count for a session
|
|
87
|
+
* @param sessionId - Session ID
|
|
88
|
+
* @param includeArchived - Whether to include archived messages
|
|
89
|
+
*/
|
|
90
|
+
getMessageCount(sessionId: string, includeArchived?: boolean): Promise<number>;
|
|
91
|
+
|
|
92
|
+
// === Checkpoint Management [new] ===
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Save a checkpoint to session metadata
|
|
96
|
+
*/
|
|
97
|
+
saveCheckpoint(sessionId: string, checkpoint: SessionCheckpoint): Promise<void>;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Get all checkpoints for a session
|
|
101
|
+
*/
|
|
102
|
+
getCheckpoints(sessionId: string): Promise<SessionCheckpoint[]>;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Get a specific checkpoint
|
|
106
|
+
*/
|
|
107
|
+
getCheckpoint(sessionId: string, checkpointId: string): Promise<SessionCheckpoint | undefined>;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Delete a checkpoint and restore archived messages
|
|
111
|
+
*/
|
|
112
|
+
deleteCheckpoint(sessionId: string, checkpointId: string): Promise<boolean>;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Archive messages (mark as archived for compact)
|
|
116
|
+
* @returns Number of messages archived
|
|
117
|
+
*/
|
|
118
|
+
archiveMessages(sessionId: string, checkpointId: string, beforeIndex: number): Promise<number>;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Get active (non-archived) messages only
|
|
122
|
+
*/
|
|
123
|
+
getActiveMessages(sessionId: string, offset?: number, limit?: number): Promise<SessionMessage[]>;
|
|
124
|
+
|
|
125
|
+
// === Lifecycle ===
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Close and cleanup resources
|
|
129
|
+
*/
|
|
130
|
+
close(): Promise<void>;
|
|
131
|
+
|
|
132
|
+
// === Search [new] ===
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Search messages across all sessions
|
|
136
|
+
*
|
|
137
|
+
* @param options - Search options including query, session filter, time range
|
|
138
|
+
* @returns Array of message matches
|
|
139
|
+
*/
|
|
140
|
+
searchMessages(options: SearchMessagesOptions): Promise<MessageMatch[]>;
|
|
141
|
+
}
|