@andre.li/memoark 0.3.1 → 0.3.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/README.en.md +388 -69
- package/README.md +674 -309
- package/README.zh-CN.md +816 -0
- package/bin/memoark.mjs +7 -2
- package/dist/adapters/store.d.ts.map +1 -1
- package/dist/adapters/store.js +6 -5
- package/dist/adapters/store.js.map +1 -1
- package/dist/cli-helpers.d.ts +12 -0
- package/dist/cli-helpers.d.ts.map +1 -0
- package/dist/cli-helpers.js +11 -0
- package/dist/cli-helpers.js.map +1 -0
- package/dist/cli.js +682 -126
- package/dist/cli.js.map +1 -1
- package/dist/collectors/feishu/chat-name-resolver.d.ts +33 -0
- package/dist/collectors/feishu/chat-name-resolver.d.ts.map +1 -0
- package/dist/collectors/feishu/chat-name-resolver.js +63 -0
- package/dist/collectors/feishu/chat-name-resolver.js.map +1 -0
- package/dist/collectors/feishu/collector.d.ts +4 -0
- package/dist/collectors/feishu/collector.d.ts.map +1 -1
- package/dist/collectors/feishu/collector.js +27 -4
- package/dist/collectors/feishu/collector.js.map +1 -1
- package/dist/collectors/feishu/docs/blocks.d.ts +25 -0
- package/dist/collectors/feishu/docs/blocks.d.ts.map +1 -0
- package/dist/collectors/feishu/docs/blocks.js +34 -0
- package/dist/collectors/feishu/docs/blocks.js.map +1 -0
- package/dist/collectors/feishu/docs/candidate.d.ts +17 -0
- package/dist/collectors/feishu/docs/candidate.d.ts.map +1 -0
- package/dist/collectors/feishu/docs/candidate.js +36 -0
- package/dist/collectors/feishu/docs/candidate.js.map +1 -0
- package/dist/collectors/feishu/docs/config.d.ts +41 -0
- package/dist/collectors/feishu/docs/config.d.ts.map +1 -0
- package/dist/collectors/feishu/docs/config.js +30 -0
- package/dist/collectors/feishu/docs/config.js.map +1 -0
- package/dist/collectors/feishu/docs/decision.d.ts +14 -0
- package/dist/collectors/feishu/docs/decision.d.ts.map +1 -0
- package/dist/collectors/feishu/docs/decision.js +43 -0
- package/dist/collectors/feishu/docs/decision.js.map +1 -0
- package/dist/collectors/feishu/docs/full-builder.d.ts +17 -0
- package/dist/collectors/feishu/docs/full-builder.d.ts.map +1 -0
- package/dist/collectors/feishu/docs/full-builder.js +136 -0
- package/dist/collectors/feishu/docs/full-builder.js.map +1 -0
- package/dist/collectors/feishu/docs/hash.d.ts +8 -0
- package/dist/collectors/feishu/docs/hash.d.ts.map +1 -0
- package/dist/collectors/feishu/docs/hash.js +15 -0
- package/dist/collectors/feishu/docs/hash.js.map +1 -0
- package/dist/collectors/feishu/docs/ingest.d.ts +54 -0
- package/dist/collectors/feishu/docs/ingest.d.ts.map +1 -0
- package/dist/collectors/feishu/docs/ingest.js +120 -0
- package/dist/collectors/feishu/docs/ingest.js.map +1 -0
- package/dist/collectors/feishu/docs/llm-json.d.ts +13 -0
- package/dist/collectors/feishu/docs/llm-json.d.ts.map +1 -0
- package/dist/collectors/feishu/docs/llm-json.js +40 -0
- package/dist/collectors/feishu/docs/llm-json.js.map +1 -0
- package/dist/collectors/feishu/docs/pointer-builder.d.ts +7 -0
- package/dist/collectors/feishu/docs/pointer-builder.d.ts.map +1 -0
- package/dist/collectors/feishu/docs/pointer-builder.js +11 -0
- package/dist/collectors/feishu/docs/pointer-builder.js.map +1 -0
- package/dist/collectors/feishu/docs/render.d.ts +8 -0
- package/dist/collectors/feishu/docs/render.d.ts.map +1 -0
- package/dist/collectors/feishu/docs/render.js +105 -0
- package/dist/collectors/feishu/docs/render.js.map +1 -0
- package/dist/collectors/feishu/docs/run.d.ts +37 -0
- package/dist/collectors/feishu/docs/run.d.ts.map +1 -0
- package/dist/collectors/feishu/docs/run.js +143 -0
- package/dist/collectors/feishu/docs/run.js.map +1 -0
- package/dist/collectors/feishu/docs/status.d.ts +16 -0
- package/dist/collectors/feishu/docs/status.d.ts.map +1 -0
- package/dist/collectors/feishu/docs/status.js +24 -0
- package/dist/collectors/feishu/docs/status.js.map +1 -0
- package/dist/collectors/feishu/docs/store-writer.d.ts +32 -0
- package/dist/collectors/feishu/docs/store-writer.d.ts.map +1 -0
- package/dist/collectors/feishu/docs/store-writer.js +71 -0
- package/dist/collectors/feishu/docs/store-writer.js.map +1 -0
- package/dist/collectors/feishu/docs/toc.d.ts +3 -0
- package/dist/collectors/feishu/docs/toc.d.ts.map +1 -0
- package/dist/collectors/feishu/docs/toc.js +19 -0
- package/dist/collectors/feishu/docs/toc.js.map +1 -0
- package/dist/collectors/feishu/docs/triggers.d.ts +7 -0
- package/dist/collectors/feishu/docs/triggers.d.ts.map +1 -0
- package/dist/collectors/feishu/docs/triggers.js +31 -0
- package/dist/collectors/feishu/docs/triggers.js.map +1 -0
- package/dist/collectors/feishu/docs/types.d.ts +109 -0
- package/dist/collectors/feishu/docs/types.d.ts.map +1 -0
- package/dist/collectors/feishu/docs/types.js +2 -0
- package/dist/collectors/feishu/docs/types.js.map +1 -0
- package/dist/collectors/feishu/docs/upgrade-queue.d.ts +19 -0
- package/dist/collectors/feishu/docs/upgrade-queue.d.ts.map +1 -0
- package/dist/collectors/feishu/docs/upgrade-queue.js +36 -0
- package/dist/collectors/feishu/docs/upgrade-queue.js.map +1 -0
- package/dist/collectors/feishu/docs/url-parser.d.ts +3 -0
- package/dist/collectors/feishu/docs/url-parser.d.ts.map +1 -0
- package/dist/collectors/feishu/docs/url-parser.js +39 -0
- package/dist/collectors/feishu/docs/url-parser.js.map +1 -0
- package/dist/collectors/feishu/docs/walkers.d.ts +24 -0
- package/dist/collectors/feishu/docs/walkers.d.ts.map +1 -0
- package/dist/collectors/feishu/docs/walkers.js +90 -0
- package/dist/collectors/feishu/docs/walkers.js.map +1 -0
- package/dist/collectors/feishu/docs/wiki-resolver.d.ts +15 -0
- package/dist/collectors/feishu/docs/wiki-resolver.d.ts.map +1 -0
- package/dist/collectors/feishu/docs/wiki-resolver.js +24 -0
- package/dist/collectors/feishu/docs/wiki-resolver.js.map +1 -0
- package/dist/collectors/feishu/lark-cli-client.d.ts +12 -0
- package/dist/collectors/feishu/lark-cli-client.d.ts.map +1 -1
- package/dist/collectors/feishu/lark-cli-client.js +37 -2
- package/dist/collectors/feishu/lark-cli-client.js.map +1 -1
- package/dist/collectors/feishu/lark-cli-identity-backend.d.ts +28 -0
- package/dist/collectors/feishu/lark-cli-identity-backend.d.ts.map +1 -0
- package/dist/collectors/feishu/lark-cli-identity-backend.js +110 -0
- package/dist/collectors/feishu/lark-cli-identity-backend.js.map +1 -0
- package/dist/collectors/feishu/self-open-id.d.ts +20 -0
- package/dist/collectors/feishu/self-open-id.d.ts.map +1 -0
- package/dist/collectors/feishu/self-open-id.js +31 -0
- package/dist/collectors/feishu/self-open-id.js.map +1 -0
- package/dist/collectors/feishu/sources/dm.d.ts.map +1 -1
- package/dist/collectors/feishu/sources/dm.js +4 -0
- package/dist/collectors/feishu/sources/dm.js.map +1 -1
- package/dist/collectors/feishu/sources/mail.d.ts.map +1 -1
- package/dist/collectors/feishu/sources/mail.js +18 -20
- package/dist/collectors/feishu/sources/mail.js.map +1 -1
- package/dist/collectors/feishu/sources/messages.d.ts +2 -0
- package/dist/collectors/feishu/sources/messages.d.ts.map +1 -1
- package/dist/collectors/feishu/sources/messages.js +28 -1
- package/dist/collectors/feishu/sources/messages.js.map +1 -1
- package/dist/collectors/feishu/types.d.ts +37 -3
- package/dist/collectors/feishu/types.d.ts.map +1 -1
- package/dist/collectors/feishu/types.js.map +1 -1
- package/dist/config-center/connection-checks.d.ts.map +1 -1
- package/dist/config-center/connection-checks.js +1 -1
- package/dist/config-center/connection-checks.js.map +1 -1
- package/dist/config-center/schema.d.ts.map +1 -1
- package/dist/config-center/schema.js +77 -0
- package/dist/config-center/schema.js.map +1 -1
- package/dist/consolidator/consolidator.d.ts +13 -1
- package/dist/consolidator/consolidator.d.ts.map +1 -1
- package/dist/consolidator/consolidator.js +12 -2
- package/dist/consolidator/consolidator.js.map +1 -1
- package/dist/core/canonicalize.js +5 -1
- package/dist/core/canonicalize.js.map +1 -1
- package/dist/core/config.d.ts +52 -9
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +86 -24
- package/dist/core/config.js.map +1 -1
- package/dist/core/env-validation.d.ts +9 -0
- package/dist/core/env-validation.d.ts.map +1 -0
- package/dist/core/env-validation.js +94 -0
- package/dist/core/env-validation.js.map +1 -0
- package/dist/core/identity-resolver.d.ts +24 -3
- package/dist/core/identity-resolver.d.ts.map +1 -1
- package/dist/core/identity-resolver.js +147 -2
- package/dist/core/identity-resolver.js.map +1 -1
- package/dist/core/person-identity.d.ts +124 -0
- package/dist/core/person-identity.d.ts.map +1 -0
- package/dist/core/person-identity.js +342 -0
- package/dist/core/person-identity.js.map +1 -0
- package/dist/core/person-slug.d.ts +21 -0
- package/dist/core/person-slug.d.ts.map +1 -0
- package/dist/core/person-slug.js +93 -0
- package/dist/core/person-slug.js.map +1 -0
- package/dist/core/pipeline-factory.d.ts +1 -1
- package/dist/core/pipeline-factory.d.ts.map +1 -1
- package/dist/core/pipeline-factory.js +8 -3
- package/dist/core/pipeline-factory.js.map +1 -1
- package/dist/core/pipeline.d.ts +16 -0
- package/dist/core/pipeline.d.ts.map +1 -1
- package/dist/core/pipeline.js +49 -1
- package/dist/core/pipeline.js.map +1 -1
- package/dist/core/resource-loader.d.ts +2 -0
- package/dist/core/resource-loader.d.ts.map +1 -0
- package/dist/core/resource-loader.js +12 -0
- package/dist/core/resource-loader.js.map +1 -0
- package/dist/core/schemas.d.ts +2981 -309
- package/dist/core/schemas.d.ts.map +1 -1
- package/dist/core/schemas.js +27 -0
- package/dist/core/schemas.js.map +1 -1
- package/dist/core/signal-scoring.d.ts.map +1 -1
- package/dist/core/signal-scoring.js +5 -1
- package/dist/core/signal-scoring.js.map +1 -1
- package/dist/core/source-ref.d.ts +4 -0
- package/dist/core/source-ref.d.ts.map +1 -0
- package/dist/core/source-ref.js +24 -0
- package/dist/core/source-ref.js.map +1 -0
- package/dist/core/state.d.ts +1 -1
- package/dist/core/state.d.ts.map +1 -1
- package/dist/core/state.js +3 -2
- package/dist/core/state.js.map +1 -1
- package/dist/core/types.d.ts +34 -6
- package/dist/core/types.d.ts.map +1 -1
- package/dist/daemon/reload-manager.d.ts +27 -0
- package/dist/daemon/reload-manager.d.ts.map +1 -0
- package/dist/daemon/reload-manager.js +67 -0
- package/dist/daemon/reload-manager.js.map +1 -0
- package/dist/daemon/scheduler.d.ts +9 -1
- package/dist/daemon/scheduler.d.ts.map +1 -1
- package/dist/daemon/scheduler.js +113 -38
- package/dist/daemon/scheduler.js.map +1 -1
- package/dist/daemon/serve-runtime.d.ts +31 -0
- package/dist/daemon/serve-runtime.d.ts.map +1 -0
- package/dist/daemon/serve-runtime.js +230 -0
- package/dist/daemon/serve-runtime.js.map +1 -0
- package/dist/embedded-assets.generated.d.ts.map +1 -1
- package/dist/embedded-assets.generated.js +3 -3
- package/dist/embedded-assets.generated.js.map +1 -1
- package/dist/extractors/playbook-extractor.d.ts +35 -0
- package/dist/extractors/playbook-extractor.d.ts.map +1 -0
- package/dist/extractors/playbook-extractor.js +98 -0
- package/dist/extractors/playbook-extractor.js.map +1 -0
- package/dist/extractors/prompts/examples/agent-session.md +257 -0
- package/dist/extractors/prompts/signal-extract.md +199 -0
- package/dist/extractors/prompts/system.md +45 -0
- package/dist/extractors/signal-extractor.d.ts +2 -1
- package/dist/extractors/signal-extractor.d.ts.map +1 -1
- package/dist/extractors/signal-extractor.js +99 -7
- package/dist/extractors/signal-extractor.js.map +1 -1
- package/dist/hooks/handlers.d.ts +21 -0
- package/dist/hooks/handlers.d.ts.map +1 -0
- package/dist/hooks/handlers.js +22 -0
- package/dist/hooks/handlers.js.map +1 -0
- package/dist/hooks/inject.d.ts +7 -0
- package/dist/hooks/inject.d.ts.map +1 -0
- package/dist/hooks/inject.js +18 -0
- package/dist/hooks/inject.js.map +1 -0
- package/dist/hooks/install.d.ts +14 -0
- package/dist/hooks/install.d.ts.map +1 -0
- package/dist/hooks/install.js +34 -0
- package/dist/hooks/install.js.map +1 -0
- package/dist/hooks/output.d.ts +19 -0
- package/dist/hooks/output.d.ts.map +1 -0
- package/dist/hooks/output.js +13 -0
- package/dist/hooks/output.js.map +1 -0
- package/dist/hooks/recall-client.d.ts +25 -0
- package/dist/hooks/recall-client.d.ts.map +1 -0
- package/dist/hooks/recall-client.js +56 -0
- package/dist/hooks/recall-client.js.map +1 -0
- package/dist/hooks/run-event.d.ts +13 -0
- package/dist/hooks/run-event.d.ts.map +1 -0
- package/dist/hooks/run-event.js +20 -0
- package/dist/hooks/run-event.js.map +1 -0
- package/dist/hooks/settings-edit.d.ts +10 -0
- package/dist/hooks/settings-edit.d.ts.map +1 -0
- package/dist/hooks/settings-edit.js +44 -0
- package/dist/hooks/settings-edit.js.map +1 -0
- package/dist/hooks/writeback.d.ts +12 -0
- package/dist/hooks/writeback.d.ts.map +1 -0
- package/dist/hooks/writeback.js +48 -0
- package/dist/hooks/writeback.js.map +1 -0
- package/dist/install/clients/claude-code.d.ts +3 -0
- package/dist/install/clients/claude-code.d.ts.map +1 -0
- package/dist/install/clients/claude-code.js +30 -0
- package/dist/install/clients/claude-code.js.map +1 -0
- package/dist/install/clients/claude-desktop.d.ts +3 -0
- package/dist/install/clients/claude-desktop.d.ts.map +1 -0
- package/dist/install/clients/claude-desktop.js +31 -0
- package/dist/install/clients/claude-desktop.js.map +1 -0
- package/dist/install/clients/codex.d.ts +3 -0
- package/dist/install/clients/codex.d.ts.map +1 -0
- package/dist/install/clients/codex.js +32 -0
- package/dist/install/clients/codex.js.map +1 -0
- package/dist/install/clients/cursor.d.ts +3 -0
- package/dist/install/clients/cursor.d.ts.map +1 -0
- package/dist/install/clients/cursor.js +35 -0
- package/dist/install/clients/cursor.js.map +1 -0
- package/dist/install/clients/hermes.d.ts +3 -0
- package/dist/install/clients/hermes.d.ts.map +1 -0
- package/dist/install/clients/hermes.js +35 -0
- package/dist/install/clients/hermes.js.map +1 -0
- package/dist/install/clients/index.d.ts +4 -0
- package/dist/install/clients/index.d.ts.map +1 -0
- package/dist/install/clients/index.js +18 -0
- package/dist/install/clients/index.js.map +1 -0
- package/dist/install/clients/windsurf.d.ts +3 -0
- package/dist/install/clients/windsurf.d.ts.map +1 -0
- package/dist/install/clients/windsurf.js +32 -0
- package/dist/install/clients/windsurf.js.map +1 -0
- package/dist/install/command.d.ts +14 -0
- package/dist/install/command.d.ts.map +1 -0
- package/dist/install/command.js +34 -0
- package/dist/install/command.js.map +1 -0
- package/dist/install/directive.d.ts +7 -0
- package/dist/install/directive.d.ts.map +1 -0
- package/dist/install/directive.js +31 -0
- package/dist/install/directive.js.map +1 -0
- package/dist/install/index.d.ts +26 -0
- package/dist/install/index.d.ts.map +1 -0
- package/dist/install/index.js +117 -0
- package/dist/install/index.js.map +1 -0
- package/dist/install/json-config.d.ts +11 -0
- package/dist/install/json-config.d.ts.map +1 -0
- package/dist/install/json-config.js +39 -0
- package/dist/install/json-config.js.map +1 -0
- package/dist/install/marked-block.d.ts +11 -0
- package/dist/install/marked-block.d.ts.map +1 -0
- package/dist/install/marked-block.js +34 -0
- package/dist/install/marked-block.js.map +1 -0
- package/dist/install/skill.d.ts +4 -0
- package/dist/install/skill.d.ts.map +1 -0
- package/dist/install/skill.js +61 -0
- package/dist/install/skill.js.map +1 -0
- package/dist/install/toml-config.d.ts +4 -0
- package/dist/install/toml-config.d.ts.map +1 -0
- package/dist/install/toml-config.js +51 -0
- package/dist/install/toml-config.js.map +1 -0
- package/dist/install/types.d.ts +37 -0
- package/dist/install/types.d.ts.map +1 -0
- package/dist/install/types.js +4 -0
- package/dist/install/types.js.map +1 -0
- package/dist/install/yaml-config.d.ts +4 -0
- package/dist/install/yaml-config.d.ts.map +1 -0
- package/dist/install/yaml-config.js +18 -0
- package/dist/install/yaml-config.js.map +1 -0
- package/dist/processors/privacy.d.ts +4 -1
- package/dist/processors/privacy.d.ts.map +1 -1
- package/dist/processors/privacy.js +5 -3
- package/dist/processors/privacy.js.map +1 -1
- package/dist/profile/accumulate.d.ts +28 -0
- package/dist/profile/accumulate.d.ts.map +1 -0
- package/dist/profile/accumulate.js +48 -0
- package/dist/profile/accumulate.js.map +1 -0
- package/dist/profile/behavior.d.ts +32 -0
- package/dist/profile/behavior.d.ts.map +1 -0
- package/dist/profile/behavior.js +122 -0
- package/dist/profile/behavior.js.map +1 -0
- package/dist/profile/four-color.d.ts +12 -0
- package/dist/profile/four-color.d.ts.map +1 -0
- package/dist/profile/four-color.js +39 -0
- package/dist/profile/four-color.js.map +1 -0
- package/dist/profile/profile-synth.d.ts +27 -0
- package/dist/profile/profile-synth.d.ts.map +1 -0
- package/dist/profile/profile-synth.js +174 -0
- package/dist/profile/profile-synth.js.map +1 -0
- package/dist/profile/types.d.ts +84 -0
- package/dist/profile/types.d.ts.map +1 -0
- package/dist/profile/types.js +11 -0
- package/dist/profile/types.js.map +1 -0
- package/dist/server/api.d.ts +8 -2
- package/dist/server/api.d.ts.map +1 -1
- package/dist/server/api.js +69 -34
- package/dist/server/api.js.map +1 -1
- package/dist/server/backfill-routes.d.ts.map +1 -1
- package/dist/server/backfill-routes.js +14 -1
- package/dist/server/backfill-routes.js.map +1 -1
- package/dist/server/chat-name-refresh-job.d.ts +33 -0
- package/dist/server/chat-name-refresh-job.d.ts.map +1 -0
- package/dist/server/chat-name-refresh-job.js +120 -0
- package/dist/server/chat-name-refresh-job.js.map +1 -0
- package/dist/server/chat-name-routes.d.ts +13 -0
- package/dist/server/chat-name-routes.d.ts.map +1 -0
- package/dist/server/chat-name-routes.js +81 -0
- package/dist/server/chat-name-routes.js.map +1 -0
- package/dist/server/config-routes.d.ts +2 -0
- package/dist/server/config-routes.d.ts.map +1 -1
- package/dist/server/config-routes.js +2 -1
- package/dist/server/config-routes.js.map +1 -1
- package/dist/server/mcp-http.d.ts +26 -0
- package/dist/server/mcp-http.d.ts.map +1 -0
- package/dist/server/mcp-http.js +102 -0
- package/dist/server/mcp-http.js.map +1 -0
- package/dist/server/mcp.d.ts +191 -25
- package/dist/server/mcp.d.ts.map +1 -1
- package/dist/server/mcp.js +1111 -68
- package/dist/server/mcp.js.map +1 -1
- package/dist/server/open-browser.d.ts +3 -0
- package/dist/server/open-browser.d.ts.map +1 -0
- package/dist/server/open-browser.js +12 -0
- package/dist/server/open-browser.js.map +1 -0
- package/dist/server/runtime.d.ts +13 -0
- package/dist/server/runtime.d.ts.map +1 -0
- package/dist/server/runtime.js +27 -0
- package/dist/server/runtime.js.map +1 -0
- package/dist/server/setup-server.d.ts.map +1 -1
- package/dist/server/setup-server.js +8 -11
- package/dist/server/setup-server.js.map +1 -1
- package/dist/setup/connection-tests.d.ts +1 -1
- package/dist/setup/connection-tests.d.ts.map +1 -1
- package/dist/setup/connection-tests.js +4 -2
- package/dist/setup/connection-tests.js.map +1 -1
- package/dist/setup/generate-config.d.ts.map +1 -1
- package/dist/setup/generate-config.js +31 -1
- package/dist/setup/generate-config.js.map +1 -1
- package/dist/setup/init-wizard.d.ts +1 -0
- package/dist/setup/init-wizard.d.ts.map +1 -1
- package/dist/setup/init-wizard.js +38 -21
- package/dist/setup/init-wizard.js.map +1 -1
- package/dist/setup/validate-config.d.ts +5 -1
- package/dist/setup/validate-config.d.ts.map +1 -1
- package/dist/setup/validate-config.js +18 -0
- package/dist/setup/validate-config.js.map +1 -1
- package/dist/store/data-dir-lock.d.ts +15 -0
- package/dist/store/data-dir-lock.d.ts.map +1 -0
- package/dist/store/data-dir-lock.js +96 -0
- package/dist/store/data-dir-lock.js.map +1 -0
- package/dist/store/database.d.ts +2 -0
- package/dist/store/database.d.ts.map +1 -1
- package/dist/store/database.js +23 -10
- package/dist/store/database.js.map +1 -1
- package/dist/store/graph.d.ts +22 -0
- package/dist/store/graph.d.ts.map +1 -1
- package/dist/store/graph.js +97 -7
- package/dist/store/graph.js.map +1 -1
- package/dist/store/migrations/index.d.ts.map +1 -1
- package/dist/store/migrations/index.js +52 -0
- package/dist/store/migrations/index.js.map +1 -1
- package/dist/store/pages.d.ts +7 -0
- package/dist/store/pages.d.ts.map +1 -1
- package/dist/store/pages.js +56 -1
- package/dist/store/pages.js.map +1 -1
- package/dist/store/person-behavior.d.ts +28 -0
- package/dist/store/person-behavior.d.ts.map +1 -0
- package/dist/store/person-behavior.js +127 -0
- package/dist/store/person-behavior.js.map +1 -0
- package/dist/store/pglite-assets.d.ts +15 -0
- package/dist/store/pglite-assets.d.ts.map +1 -0
- package/dist/store/pglite-assets.js +47 -0
- package/dist/store/pglite-assets.js.map +1 -0
- package/dist/store/query-rewrite.d.ts +28 -0
- package/dist/store/query-rewrite.d.ts.map +1 -0
- package/dist/store/query-rewrite.js +97 -0
- package/dist/store/query-rewrite.js.map +1 -0
- package/dist/store/schema.sql +107 -0
- package/dist/store/search.d.ts +36 -8
- package/dist/store/search.d.ts.map +1 -1
- package/dist/store/search.js +188 -76
- package/dist/store/search.js.map +1 -1
- package/dist/store/tags.d.ts.map +1 -1
- package/dist/store/tags.js +6 -2
- package/dist/store/tags.js.map +1 -1
- package/dist/store/timeline.d.ts +13 -1
- package/dist/store/timeline.d.ts.map +1 -1
- package/dist/store/timeline.js +134 -4
- package/dist/store/timeline.js.map +1 -1
- package/dist/store/trgm-search.d.ts +13 -0
- package/dist/store/trgm-search.d.ts.map +1 -0
- package/dist/store/trgm-search.js +53 -0
- package/dist/store/trgm-search.js.map +1 -0
- package/dist/store/wikilink.d.ts +17 -0
- package/dist/store/wikilink.d.ts.map +1 -0
- package/dist/store/wikilink.js +58 -0
- package/dist/store/wikilink.js.map +1 -0
- package/dist/sync/obsidian.d.ts.map +1 -1
- package/dist/sync/obsidian.js +5 -1
- package/dist/sync/obsidian.js.map +1 -1
- package/dist/synth/cache.d.ts +17 -0
- package/dist/synth/cache.d.ts.map +1 -0
- package/dist/synth/cache.js +67 -0
- package/dist/synth/cache.js.map +1 -0
- package/dist/synth/citations.d.ts +12 -0
- package/dist/synth/citations.d.ts.map +1 -0
- package/dist/synth/citations.js +28 -0
- package/dist/synth/citations.js.map +1 -0
- package/dist/synth/context.d.ts +10 -0
- package/dist/synth/context.d.ts.map +1 -0
- package/dist/synth/context.js +67 -0
- package/dist/synth/context.js.map +1 -0
- package/dist/synth/engine.d.ts +16 -0
- package/dist/synth/engine.d.ts.map +1 -0
- package/dist/synth/engine.js +111 -0
- package/dist/synth/engine.js.map +1 -0
- package/dist/synth/gaps.d.ts +17 -0
- package/dist/synth/gaps.d.ts.map +1 -0
- package/dist/synth/gaps.js +57 -0
- package/dist/synth/gaps.js.map +1 -0
- package/dist/synth/index.d.ts +6 -0
- package/dist/synth/index.d.ts.map +1 -0
- package/dist/synth/index.js +6 -0
- package/dist/synth/index.js.map +1 -0
- package/dist/synth/intent.d.ts +6 -0
- package/dist/synth/intent.d.ts.map +1 -0
- package/dist/synth/intent.js +13 -0
- package/dist/synth/intent.js.map +1 -0
- package/dist/synth/intents/daily-report.d.ts +7 -0
- package/dist/synth/intents/daily-report.d.ts.map +1 -0
- package/dist/synth/intents/daily-report.js +37 -0
- package/dist/synth/intents/daily-report.js.map +1 -0
- package/dist/synth/intents/index.d.ts +2 -0
- package/dist/synth/intents/index.d.ts.map +1 -0
- package/dist/synth/intents/index.js +12 -0
- package/dist/synth/intents/index.js.map +1 -0
- package/dist/synth/intents/person-strategy.d.ts +40 -0
- package/dist/synth/intents/person-strategy.d.ts.map +1 -0
- package/dist/synth/intents/person-strategy.js +66 -0
- package/dist/synth/intents/person-strategy.js.map +1 -0
- package/dist/synth/intents/recall.d.ts +8 -0
- package/dist/synth/intents/recall.d.ts.map +1 -0
- package/dist/synth/intents/recall.js +26 -0
- package/dist/synth/intents/recall.js.map +1 -0
- package/dist/synth/intents/troubleshoot.d.ts +11 -0
- package/dist/synth/intents/troubleshoot.d.ts.map +1 -0
- package/dist/synth/intents/troubleshoot.js +66 -0
- package/dist/synth/intents/troubleshoot.js.map +1 -0
- package/dist/synth/scope.d.ts +13 -0
- package/dist/synth/scope.d.ts.map +1 -0
- package/dist/synth/scope.js +139 -0
- package/dist/synth/scope.js.map +1 -0
- package/dist/synth/types.d.ts +117 -0
- package/dist/synth/types.d.ts.map +1 -0
- package/dist/synth/types.js +2 -0
- package/dist/synth/types.js.map +1 -0
- package/package.json +18 -6
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { missingFieldRule } from "../gaps.js";
|
|
2
|
+
/**
|
|
3
|
+
* Reorder `candidates` so that any slug present in `order` appears first, in the
|
|
4
|
+
* order given; candidates not in `order` keep their relative order and trail behind.
|
|
5
|
+
*/
|
|
6
|
+
function reorderBy(candidates, order) {
|
|
7
|
+
const rank = new Map();
|
|
8
|
+
order.forEach((slug, i) => {
|
|
9
|
+
rank.set(slug, i);
|
|
10
|
+
});
|
|
11
|
+
const ranked = [];
|
|
12
|
+
const rest = [];
|
|
13
|
+
for (const c of candidates) {
|
|
14
|
+
if (rank.has(c.slug))
|
|
15
|
+
ranked.push(c);
|
|
16
|
+
else
|
|
17
|
+
rest.push(c);
|
|
18
|
+
}
|
|
19
|
+
ranked.sort((a, b) => (rank.get(a.slug) ?? 0) - (rank.get(b.slug) ?? 0));
|
|
20
|
+
return [...ranked, ...rest];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Spec 11 §6: one-shot troubleshooting over playbook pages.
|
|
24
|
+
*
|
|
25
|
+
* Retrieval is scoped to `type=playbook`. Graph-edge ordering happens HERE (the
|
|
26
|
+
* LLM cannot see edges): the `sortCandidates` hook walks the `precedes` chain via
|
|
27
|
+
* `graph.getOrderedSequence` and pre-orders candidates before they are numbered.
|
|
28
|
+
* The systemPrompt only asks the model to follow the given numbering.
|
|
29
|
+
*/
|
|
30
|
+
export const troubleshootIntent = {
|
|
31
|
+
id: "troubleshoot",
|
|
32
|
+
format: "single",
|
|
33
|
+
staleDays: 0,
|
|
34
|
+
// types:["playbook"] is passed through by scope.ts to search.ts's `p.type = ANY($n)` filter.
|
|
35
|
+
buildScope: (args) => ({
|
|
36
|
+
query: args.query,
|
|
37
|
+
types: ["playbook"],
|
|
38
|
+
limit: 10,
|
|
39
|
+
}),
|
|
40
|
+
systemPrompt: "你是排查助手。下面是按排查顺序排好的 playbook 片段。" +
|
|
41
|
+
"请按片段给定的编号顺序组织排查步骤,并解释每步不同结果的含义。" +
|
|
42
|
+
"用 [n] 标注来源 playbook。信息不足时直说。",
|
|
43
|
+
expects: ["排查步骤"],
|
|
44
|
+
gapRules: [missingFieldRule],
|
|
45
|
+
// Graph-edge ordering at retrieval time; engine.ts calls this hook generically.
|
|
46
|
+
// Candidates arrive ranked by relevance, not by graph order. We walk the `precedes`
|
|
47
|
+
// chain from each candidate and adopt the longest chain that covers the most of them
|
|
48
|
+
// (so the chain head, wherever it sits in the relevance ranking, anchors the order).
|
|
49
|
+
async sortCandidates(candidates, stores) {
|
|
50
|
+
if (candidates.length <= 1)
|
|
51
|
+
return candidates;
|
|
52
|
+
const slugSet = new Set(candidates.map((c) => c.slug));
|
|
53
|
+
let best = [];
|
|
54
|
+
for (const c of candidates) {
|
|
55
|
+
const seq = (await stores.graph.getOrderedSequence(c.slug)).map((n) => n.slug);
|
|
56
|
+
const coverage = seq.filter((s) => slugSet.has(s)).length;
|
|
57
|
+
const bestCoverage = best.filter((s) => slugSet.has(s)).length;
|
|
58
|
+
if (coverage > bestCoverage)
|
|
59
|
+
best = seq;
|
|
60
|
+
}
|
|
61
|
+
if (best.length === 0)
|
|
62
|
+
return candidates;
|
|
63
|
+
return reorderBy(candidates, best);
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=troubleshoot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"troubleshoot.js","sourceRoot":"","sources":["../../../src/synth/intents/troubleshoot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAG9C;;;GAGG;AACH,SAAS,SAAS,CAAC,UAAgC,EAAE,KAAe;IAClE,MAAM,IAAI,GAAG,IAAI,GAAG,EAAkB,CAAC;IACvC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;QACxB,IAAI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U,CAAC,MAAM,IAAI,CAAC;YAAE,OAAO,UAAU,CAAC;QAC9C,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QACvD,IAAI,IAAI,GAAa,EAAE,CAAC;QACxB,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC;YAC3B,MAAM,GAAG,GAAG,CAAC,MAAM,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAC/E,MAAM,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;YAC1D,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;YAC/D,IAAI,QAAQ,GAAG,YAAY;gBAAE,IAAI,GAAG,GAAG,CAAC;QAC1C,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,UAAU,CAAC;QACzC,OAAO,SAAS,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IACrC,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { StoreContext } from "../server/api.js";
|
|
2
|
+
import type { AssembledCandidate, SynthScope } from "./types.js";
|
|
3
|
+
/** A retrieved candidate before ref numbering (assigned in context.assemble). */
|
|
4
|
+
export type RawCandidate = Omit<AssembledCandidate, "ref">;
|
|
5
|
+
/**
|
|
6
|
+
* Retrieve candidates for a synth scope (Spec 7 §3.3 step 3).
|
|
7
|
+
* Three modes (entity / time / query); candidates are returned unnumbered —
|
|
8
|
+
* ref assignment happens in context.assemble.
|
|
9
|
+
*/
|
|
10
|
+
export declare function retrieve(scope: SynthScope, _opts: {
|
|
11
|
+
poolByPage?: boolean;
|
|
12
|
+
}, stores: StoreContext): Promise<RawCandidate[]>;
|
|
13
|
+
//# sourceMappingURL=scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../src/synth/scope.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAEjE,iFAAiF;AACjF,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;AAqB3D;;;;GAIG;AACH,wBAAsB,QAAQ,CAC5B,KAAK,EAAE,UAAU,EACjB,KAAK,EAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,EAC/B,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,YAAY,EAAE,CAAC,CAazB"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
const DEFAULT_LIMIT = 30;
|
|
2
|
+
function sourceToString(source) {
|
|
3
|
+
if (!source)
|
|
4
|
+
return undefined;
|
|
5
|
+
return source.channel_name ?? source.channel ?? source.platform ?? undefined;
|
|
6
|
+
}
|
|
7
|
+
function dedupeBySlug(candidates) {
|
|
8
|
+
const seen = new Set();
|
|
9
|
+
const out = [];
|
|
10
|
+
for (const c of candidates) {
|
|
11
|
+
const key = `${c.slug}::${c.text}`;
|
|
12
|
+
if (seen.has(key))
|
|
13
|
+
continue;
|
|
14
|
+
seen.add(key);
|
|
15
|
+
out.push(c);
|
|
16
|
+
}
|
|
17
|
+
return out;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Retrieve candidates for a synth scope (Spec 7 §3.3 step 3).
|
|
21
|
+
* Three modes (entity / time / query); candidates are returned unnumbered —
|
|
22
|
+
* ref assignment happens in context.assemble.
|
|
23
|
+
*/
|
|
24
|
+
export async function retrieve(scope, _opts, stores) {
|
|
25
|
+
const limit = scope.limit ?? DEFAULT_LIMIT;
|
|
26
|
+
if (scope.query) {
|
|
27
|
+
return retrieveByQuery(scope, limit, stores);
|
|
28
|
+
}
|
|
29
|
+
if (scope.entity) {
|
|
30
|
+
return retrieveByEntity(scope, limit, stores);
|
|
31
|
+
}
|
|
32
|
+
if (scope.time) {
|
|
33
|
+
return retrieveByTime(scope, limit, stores);
|
|
34
|
+
}
|
|
35
|
+
return [];
|
|
36
|
+
}
|
|
37
|
+
async function retrieveByQuery(scope, limit, stores) {
|
|
38
|
+
const results = await stores.search.query(scope.query, {
|
|
39
|
+
poolByPage: true,
|
|
40
|
+
type: scope.types,
|
|
41
|
+
from: scope.time?.from,
|
|
42
|
+
to: scope.time?.to,
|
|
43
|
+
limit,
|
|
44
|
+
});
|
|
45
|
+
return results.map((r) => ({
|
|
46
|
+
slug: r.slug,
|
|
47
|
+
title: r.title,
|
|
48
|
+
type: r.type,
|
|
49
|
+
text: r.snippet || r.title,
|
|
50
|
+
source: sourceToString(r.provenance),
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
async function retrieveByEntity(scope, limit, stores) {
|
|
54
|
+
const candidates = [];
|
|
55
|
+
const typeSet = scope.types && scope.types.length > 0 ? new Set(scope.types) : undefined;
|
|
56
|
+
const backlinks = await stores.graph.getBacklinksEnriched(scope.entity);
|
|
57
|
+
for (const bl of backlinks) {
|
|
58
|
+
if (typeSet && !typeSet.has(bl.page.type))
|
|
59
|
+
continue;
|
|
60
|
+
const page = await stores.pages.getPage(bl.from_slug);
|
|
61
|
+
if (!page)
|
|
62
|
+
continue;
|
|
63
|
+
const source = (page.frontmatter.source ?? page.frontmatter.first_seen);
|
|
64
|
+
candidates.push({
|
|
65
|
+
slug: page.slug,
|
|
66
|
+
title: page.title,
|
|
67
|
+
type: page.type,
|
|
68
|
+
text: page.compiled_truth || page.title,
|
|
69
|
+
date: source?.timestamp ?? page.created_at,
|
|
70
|
+
source: sourceToString(source),
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
const timeline = await stores.timeline.getTimeline(scope.entity);
|
|
74
|
+
for (const entry of timeline) {
|
|
75
|
+
candidates.push({
|
|
76
|
+
slug: scope.entity,
|
|
77
|
+
title: entry.summary,
|
|
78
|
+
type: "timeline",
|
|
79
|
+
text: entry.detail ? `${entry.summary} — ${entry.detail}` : entry.summary,
|
|
80
|
+
date: entry.date,
|
|
81
|
+
source: sourceToString(entry.provenance),
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
return dedupeBySlug(candidates).slice(0, limit);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Cross-channel dedupe (Spec 9 §6): drop rows whose `frontmatter.source_hash`
|
|
88
|
+
* was already seen — the same source block surfaced under two slugs (e.g. a mail
|
|
89
|
+
* forwarded into a group). Rows without a source_hash are always kept. The first
|
|
90
|
+
* occurrence (DESC by signal_time) wins.
|
|
91
|
+
*/
|
|
92
|
+
function dedupeBySourceHash(rows) {
|
|
93
|
+
const seenHash = new Set();
|
|
94
|
+
const out = [];
|
|
95
|
+
for (const row of rows) {
|
|
96
|
+
if (row.source_hash) {
|
|
97
|
+
if (seenHash.has(row.source_hash))
|
|
98
|
+
continue;
|
|
99
|
+
seenHash.add(row.source_hash);
|
|
100
|
+
}
|
|
101
|
+
out.push(row);
|
|
102
|
+
}
|
|
103
|
+
return out;
|
|
104
|
+
}
|
|
105
|
+
async function retrieveByTime(scope, limit, stores) {
|
|
106
|
+
const time = scope.time;
|
|
107
|
+
const params = [time.from, time.to];
|
|
108
|
+
const conditions = [
|
|
109
|
+
`COALESCE(frontmatter->'source'->>'timestamp', frontmatter->'first_seen'->>'timestamp', created_at::text)::timestamptz >= $1::timestamptz`,
|
|
110
|
+
`COALESCE(frontmatter->'source'->>'timestamp', frontmatter->'first_seen'->>'timestamp', created_at::text)::timestamptz < ($2::date + interval '1 day')`,
|
|
111
|
+
];
|
|
112
|
+
if (scope.types && scope.types.length > 0) {
|
|
113
|
+
params.push(scope.types);
|
|
114
|
+
conditions.push(`type = ANY($${params.length}::text[])`);
|
|
115
|
+
}
|
|
116
|
+
params.push(limit);
|
|
117
|
+
const result = await stores.db.pg.query(`SELECT slug, title, type, compiled_truth,
|
|
118
|
+
COALESCE(frontmatter->'source'->>'timestamp', frontmatter->'first_seen'->>'timestamp', created_at::text) AS signal_time,
|
|
119
|
+
COALESCE(frontmatter->'source', frontmatter->'first_seen') AS source,
|
|
120
|
+
frontmatter->>'source_hash' AS source_hash
|
|
121
|
+
FROM pages
|
|
122
|
+
WHERE ${conditions.join(" AND ")}
|
|
123
|
+
ORDER BY signal_time DESC
|
|
124
|
+
LIMIT $${params.length}`, params);
|
|
125
|
+
return dedupeBySourceHash(result.rows).map((row) => {
|
|
126
|
+
const source = typeof row.source === "string"
|
|
127
|
+
? JSON.parse(row.source)
|
|
128
|
+
: (row.source ?? undefined);
|
|
129
|
+
return {
|
|
130
|
+
slug: row.slug,
|
|
131
|
+
title: row.title,
|
|
132
|
+
type: row.type,
|
|
133
|
+
text: row.compiled_truth || row.title,
|
|
134
|
+
date: row.signal_time ?? undefined,
|
|
135
|
+
source: sourceToString(source ?? undefined),
|
|
136
|
+
};
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=scope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope.js","sourceRoot":"","sources":["../../src/synth/scope.ts"],"names":[],"mappings":"AAOA,MAAM,aAAa,GAAG,EAAE,CAAC;AAEzB,SAAS,cAAc,CAAC,MAA6B;IACnD,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IAC9B,OAAO,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CA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AS,CAAC,CAAC;QAChC,OAAO;YACL,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,KAAK,EAAE,GAAG,CAAC,KAAK;YAChB,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,IAAI,EAAE,GAAG,CAAC,cAAc,IAAI,GAAG,CAAC,KAAK;YACrC,IAAI,EAAE,GAAG,CAAC,WAAW,IAAI,SAAS;YAClC,MAAM,EAAE,cAAc,CAAC,MAAM,IAAI,SAAS,CAAC;SAC5C,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { StoreContext } from "../server/api.js";
|
|
2
|
+
export interface SynthScope {
|
|
3
|
+
/** 围绕某实体(如 person/zhang-san)→ backlinks + timeline */
|
|
4
|
+
entity?: string;
|
|
5
|
+
/** 时间窗 → 跨渠道按 date 过滤 */
|
|
6
|
+
time?: {
|
|
7
|
+
from: string;
|
|
8
|
+
to: string;
|
|
9
|
+
};
|
|
10
|
+
/** 自由语义检索 → hybrid search */
|
|
11
|
+
query?: string;
|
|
12
|
+
/** 限定信号类型(透传到 search 的 `p.type = ANY(...)` 过滤) */
|
|
13
|
+
types?: string[];
|
|
14
|
+
/** 限定来源渠道,合法值与 timeline_entries.source 对齐 */
|
|
15
|
+
channels?: string[];
|
|
16
|
+
/** 候选上限(默认 30) */
|
|
17
|
+
limit?: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 合成调用选项:意图专属参数(如 daily_report 的 date、person_strategy 的 goal)经 extra 透传到 compose。
|
|
21
|
+
*/
|
|
22
|
+
export interface SynthOpts {
|
|
23
|
+
/** 透传给意图的 systemPrompt 拼装 */
|
|
24
|
+
extra?: Record<string, unknown>;
|
|
25
|
+
noCache?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface AssembledCandidate {
|
|
28
|
+
/** 引用编号,从 1 起,对应 answer 里的 [n] */
|
|
29
|
+
ref: number;
|
|
30
|
+
slug: string;
|
|
31
|
+
title: string;
|
|
32
|
+
type: string;
|
|
33
|
+
/** 喂给 LLM 的正文片段 */
|
|
34
|
+
text: string;
|
|
35
|
+
/** 信号日期(gap 计算用) */
|
|
36
|
+
date?: string;
|
|
37
|
+
/** provenance(frontmatter.source / links.provenance / timeline.provenance) */
|
|
38
|
+
source?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface AssembledContext {
|
|
41
|
+
scope: SynthScope;
|
|
42
|
+
candidates: AssembledCandidate[];
|
|
43
|
+
/** candidates 中 max(date),供 stale gap 用 */
|
|
44
|
+
latestDate?: string;
|
|
45
|
+
/**
|
|
46
|
+
* 非可引用的前置框架文本(如人物画像摘要);由意图的 buildPinnedContext 钩子产出,
|
|
47
|
+
* 置于候选之前喂 LLM。不分配 ref,引用仍指向 candidates。
|
|
48
|
+
*/
|
|
49
|
+
pinnedContext?: string;
|
|
50
|
+
}
|
|
51
|
+
export interface ComposeOutput {
|
|
52
|
+
/** 含 inline [n] 标记的 markdown */
|
|
53
|
+
answer: string;
|
|
54
|
+
}
|
|
55
|
+
export interface Citation {
|
|
56
|
+
/** 与 answer 里的 [n] 一一对应 */
|
|
57
|
+
ref: number;
|
|
58
|
+
slug: string;
|
|
59
|
+
title: string;
|
|
60
|
+
source?: string;
|
|
61
|
+
date?: string;
|
|
62
|
+
}
|
|
63
|
+
export interface Gap {
|
|
64
|
+
type: "stale" | "missing_field" | "contradiction";
|
|
65
|
+
message: string;
|
|
66
|
+
meta?: Record<string, unknown>;
|
|
67
|
+
}
|
|
68
|
+
export interface GapRule {
|
|
69
|
+
id: Gap["type"];
|
|
70
|
+
evaluate(ctx: AssembledContext, raw: ComposeOutput, intent: IntentTemplate): Gap[];
|
|
71
|
+
}
|
|
72
|
+
export interface SynthesisResult {
|
|
73
|
+
intent: string;
|
|
74
|
+
/** 始终非空 */
|
|
75
|
+
answer: string;
|
|
76
|
+
/** 仅 format="sections" 的意图产出 */
|
|
77
|
+
sections?: {
|
|
78
|
+
title: string;
|
|
79
|
+
body: string;
|
|
80
|
+
}[];
|
|
81
|
+
/** 仅保留被 answer 引用过的候选 */
|
|
82
|
+
citations: Citation[];
|
|
83
|
+
gaps: Gap[];
|
|
84
|
+
meta: {
|
|
85
|
+
model: string;
|
|
86
|
+
generated_at: string;
|
|
87
|
+
scope: SynthScope;
|
|
88
|
+
cached: boolean;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
export interface IntentTemplate {
|
|
92
|
+
id: string;
|
|
93
|
+
format: "single" | "sections";
|
|
94
|
+
buildScope(args: Record<string, unknown>): SynthScope;
|
|
95
|
+
systemPrompt: string;
|
|
96
|
+
/** missing_field gap:期望 answer 覆盖的要点 */
|
|
97
|
+
expects?: string[];
|
|
98
|
+
/** stale gap 阈值(缺省 14) */
|
|
99
|
+
staleDays?: number;
|
|
100
|
+
gapRules: GapRule[];
|
|
101
|
+
/** format="sections" 必填 */
|
|
102
|
+
parseSections?(answer: string): {
|
|
103
|
+
title: string;
|
|
104
|
+
body: string;
|
|
105
|
+
}[];
|
|
106
|
+
/**
|
|
107
|
+
* 可选钩子:产出 AssembledContext.pinnedContext(如 Spec 8 读 frontmatter.profile)。
|
|
108
|
+
* 通用层只调用、不感知具体意图。
|
|
109
|
+
*/
|
|
110
|
+
buildPinnedContext?(scope: SynthScope, stores: StoreContext): Promise<string | undefined>;
|
|
111
|
+
/**
|
|
112
|
+
* 可选钩子:重排候选(如 Spec 11 沿 precedes 链)。
|
|
113
|
+
* 通用层只调用、不感知具体意图。
|
|
114
|
+
*/
|
|
115
|
+
sortCandidates?(candidates: AssembledCandidate[], stores: StoreContext): Promise<AssembledCandidate[]>;
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/synth/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGrD,MA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1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,2BAA2B;IAC3B,aAAa,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAClE;;;OAGG;IACH,kBAAkB,CAAC,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC1F;;;OAGG;IACH,cAAc,CAAC,CACb,UAAU,EAAE,kBAAkB,EAAE,EAChC,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;CAClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/synth/types.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@andre.li/memoark",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "Local-first personal memory
|
|
3
|
+
"version": "0.3.2",
|
|
4
|
+
"description": "Local-first personal memory system — extracts signals from Feishu/Lark chats and AI-agent sessions into a private knowledge graph, served to any agent via MCP",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"memoark": "./bin/memoark.mjs"
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"access": "public"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
|
+
"setup": "bun install && cd web && bun install",
|
|
28
29
|
"dev": "bun src/cli.ts",
|
|
29
30
|
"test": "vitest run",
|
|
30
31
|
"test:watch": "vitest --watch",
|
|
@@ -32,6 +33,8 @@
|
|
|
32
33
|
"build": "node scripts/gen-embedded-assets.mjs && tsc && node scripts/post-build.mjs",
|
|
33
34
|
"compile": "node scripts/gen-embedded-assets.mjs && bun build --compile src/cli.ts --outfile dist-bin/memoark",
|
|
34
35
|
"typecheck": "tsc --noEmit",
|
|
36
|
+
"prepack": "mv README.md README.zh-CN.md && cp README.en.md README.md",
|
|
37
|
+
"postpack": "mv README.zh-CN.md README.md",
|
|
35
38
|
"prepublishOnly": "npm run build",
|
|
36
39
|
"lint": "biome check src/ tests/",
|
|
37
40
|
"lint:fix": "biome check --fix src/ tests/",
|
|
@@ -43,11 +46,13 @@
|
|
|
43
46
|
},
|
|
44
47
|
"dependencies": {
|
|
45
48
|
"@electric-sql/pglite": "^0.4.6",
|
|
49
|
+
"@hono/node-server": "^1.19.14",
|
|
46
50
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
47
51
|
"commander": "^11.1.0",
|
|
48
52
|
"hono": "^4.12.23",
|
|
49
53
|
"ink": "^7.0.5",
|
|
50
54
|
"openai": "^6.39.0",
|
|
55
|
+
"pinyin-pro": "^3.28.1",
|
|
51
56
|
"react": "^19.2.7",
|
|
52
57
|
"react-devtools-core": "^6.1.5",
|
|
53
58
|
"yaml": "^2.3.4",
|
|
@@ -63,22 +68,29 @@
|
|
|
63
68
|
"vitest": "^1.0.4"
|
|
64
69
|
},
|
|
65
70
|
"keywords": [
|
|
71
|
+
"mcp",
|
|
72
|
+
"agent-memory",
|
|
73
|
+
"local-first",
|
|
66
74
|
"knowledge-graph",
|
|
67
|
-
"
|
|
75
|
+
"feishu",
|
|
76
|
+
"lark",
|
|
68
77
|
"claude-code",
|
|
69
78
|
"codex",
|
|
70
79
|
"ai-agent",
|
|
80
|
+
"self-hosted",
|
|
81
|
+
"personal-knowledge-management",
|
|
82
|
+
"signal-extraction",
|
|
71
83
|
"conversation-mining",
|
|
84
|
+
"pglite",
|
|
72
85
|
"cli"
|
|
73
86
|
],
|
|
74
|
-
"author": "AndreLYL",
|
|
87
|
+
"author": "AndreLYL (https://github.com/AndreLYL)",
|
|
75
88
|
"license": "Apache-2.0",
|
|
76
89
|
"repository": {
|
|
77
90
|
"type": "git",
|
|
78
91
|
"url": "https://github.com/AndreLYL/memoark.git"
|
|
79
92
|
},
|
|
80
93
|
"engines": {
|
|
81
|
-
"node": ">=18.0.0"
|
|
82
|
-
"bun": ">=1.0.0"
|
|
94
|
+
"node": ">=18.0.0"
|
|
83
95
|
}
|
|
84
96
|
}
|