@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,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Playbook-aware extractor (Spec 11 §五).
|
|
3
|
+
*
|
|
4
|
+
* Two-part flow attached to the SignalExtractor stage of the pipeline:
|
|
5
|
+
*
|
|
6
|
+
* 1. pre-classify (`classifyPlaybook`): a lightweight rule-based check — does this
|
|
7
|
+
* block describe a troubleshooting *procedure*? Cheap keyword heuristics; an
|
|
8
|
+
* optional LLM second-check refines borderline cases.
|
|
9
|
+
* 2. playbook extraction (`extractPlaybookDraft`): on a hit, ask the LLM to emit the
|
|
10
|
+
* §四 markdown structure (适用场景 / 步骤 / 命中→含义分支 / 关联 `[[rel:slug]]`) and
|
|
11
|
+
* write a `type=playbook` *draft* page (`frontmatter.confidence = "inferred"`,
|
|
12
|
+
* tag `draft`). The page body IS the compiled_truth (text/markdown, not JSON).
|
|
13
|
+
*
|
|
14
|
+
* Draft pages await human confirmation (→ `confidence: confirmed`). Wikilinks in the
|
|
15
|
+
* body auto-wire hierarchy/order edges via Spec 10 on putPage.
|
|
16
|
+
*/
|
|
17
|
+
import type { ConversationBlock } from "../core/types.js";
|
|
18
|
+
import type { LLMProvider } from "./providers/types.js";
|
|
19
|
+
/**
|
|
20
|
+
* Rule-based pre-classify: is `text` a troubleshooting procedure? Zero-LLM, cheap.
|
|
21
|
+
* Requires at least two distinct signals (keyword hits and/or a conditional branch)
|
|
22
|
+
* so ordinary chatter that merely mentions one keyword is not misclassified.
|
|
23
|
+
*/
|
|
24
|
+
export declare function classifyPlaybook(text: string): boolean;
|
|
25
|
+
/** Minimal store surface the playbook extractor needs (a PageStore-compatible `putPage`). */
|
|
26
|
+
export interface PlaybookPageWriter {
|
|
27
|
+
putPage(slug: string, content: string): Promise<unknown>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Run the playbook extraction branch: LLM produces §四 markdown, write a draft
|
|
31
|
+
* `type=playbook` page. Returns the written slug, or null when the LLM produced no
|
|
32
|
+
* usable body. Never throws on empty output.
|
|
33
|
+
*/
|
|
34
|
+
export declare function extractPlaybookDraft(block: ConversationBlock, provider: LLMProvider, pages: PlaybookPageWriter): Promise<string | null>;
|
|
35
|
+
//# sourceMappingURL=playbook-extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playbook-extractor.d.ts","sourceRoot":"","sources":["../../src/extractors/playbook-extractor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAc,MAAM,kBAAkB,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAOxD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAQtD;AAwCD,6FAA6F;AAC7F,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1D;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,iBAAiB,EACxB,QAAQ,EAAE,WAAW,EACrB,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA4BxB"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Playbook-aware extractor (Spec 11 §五).
|
|
3
|
+
*
|
|
4
|
+
* Two-part flow attached to the SignalExtractor stage of the pipeline:
|
|
5
|
+
*
|
|
6
|
+
* 1. pre-classify (`classifyPlaybook`): a lightweight rule-based check — does this
|
|
7
|
+
* block describe a troubleshooting *procedure*? Cheap keyword heuristics; an
|
|
8
|
+
* optional LLM second-check refines borderline cases.
|
|
9
|
+
* 2. playbook extraction (`extractPlaybookDraft`): on a hit, ask the LLM to emit the
|
|
10
|
+
* §四 markdown structure (适用场景 / 步骤 / 命中→含义分支 / 关联 `[[rel:slug]]`) and
|
|
11
|
+
* write a `type=playbook` *draft* page (`frontmatter.confidence = "inferred"`,
|
|
12
|
+
* tag `draft`). The page body IS the compiled_truth (text/markdown, not JSON).
|
|
13
|
+
*
|
|
14
|
+
* Draft pages await human confirmation (→ `confidence: confirmed`). Wikilinks in the
|
|
15
|
+
* body auto-wire hierarchy/order edges via Spec 10 on putPage.
|
|
16
|
+
*/
|
|
17
|
+
import { createHash } from "node:crypto";
|
|
18
|
+
// Rule keywords that signal a troubleshooting / runbook flow (Spec 11 §五 A).
|
|
19
|
+
const PLAYBOOK_KEYWORDS = ["排查", "步骤", "grep", "日志", "runbook", "playbook"];
|
|
20
|
+
// "如果……则" conditional-branch pattern.
|
|
21
|
+
const CONDITIONAL_RE = /如果[\s\S]{0,40}?则/;
|
|
22
|
+
/**
|
|
23
|
+
* Rule-based pre-classify: is `text` a troubleshooting procedure? Zero-LLM, cheap.
|
|
24
|
+
* Requires at least two distinct signals (keyword hits and/or a conditional branch)
|
|
25
|
+
* so ordinary chatter that merely mentions one keyword is not misclassified.
|
|
26
|
+
*/
|
|
27
|
+
export function classifyPlaybook(text) {
|
|
28
|
+
const lower = text.toLowerCase();
|
|
29
|
+
let hits = 0;
|
|
30
|
+
for (const kw of PLAYBOOK_KEYWORDS) {
|
|
31
|
+
if (lower.includes(kw.toLowerCase()))
|
|
32
|
+
hits++;
|
|
33
|
+
}
|
|
34
|
+
if (CONDITIONAL_RE.test(text))
|
|
35
|
+
hits++;
|
|
36
|
+
return hits >= 2;
|
|
37
|
+
}
|
|
38
|
+
const PLAYBOOK_EXTRACT_PROMPT = [
|
|
39
|
+
"你是排查手册(playbook)抽取器。下面是一段排查类对话/文档。",
|
|
40
|
+
"请把它整理为 markdown 排查手册,严格使用以下结构:",
|
|
41
|
+
"## 适用场景\n(一句话描述何时用)",
|
|
42
|
+
"## 步骤\n(有序步骤;命中某结果时用 `- 命中 X → 含义/下一步` 表达分支)",
|
|
43
|
+
"## 关联\n(用 [[part_of:problem-class/...]] / [[precedes:playbook/...]] 标注层级与顺序,可省略)",
|
|
44
|
+
"只输出 markdown 正文,不要额外解释,不要代码围栏,不要 frontmatter。",
|
|
45
|
+
].join("\n\n");
|
|
46
|
+
function formatConversation(messages) {
|
|
47
|
+
return messages
|
|
48
|
+
.map((m) => `[${new Date(m.timestamp).toISOString()}] ${m.contact}: ${m.content}`)
|
|
49
|
+
.join("\n");
|
|
50
|
+
}
|
|
51
|
+
function kebabCase(str) {
|
|
52
|
+
const ascii = str
|
|
53
|
+
.toLowerCase()
|
|
54
|
+
.replace(/[^a-z0-9一-鿿]+/g, "-")
|
|
55
|
+
.replace(/^-+|-+$/g, "");
|
|
56
|
+
if (ascii.length >= 3)
|
|
57
|
+
return ascii;
|
|
58
|
+
const hash = createHash("sha256").update(str).digest("hex").slice(0, 12);
|
|
59
|
+
return ascii ? `${ascii}-${hash}` : hash;
|
|
60
|
+
}
|
|
61
|
+
/** Derive a playbook title from the first non-empty line / first messages of the block. */
|
|
62
|
+
function deriveTitle(block) {
|
|
63
|
+
const firstContent = block.messages[0]?.content ?? "";
|
|
64
|
+
const firstLine = firstContent.split("\n").find((l) => l.trim().length > 0) ?? "playbook";
|
|
65
|
+
// Trim to a reasonable title length; strip trailing punctuation.
|
|
66
|
+
return (firstLine
|
|
67
|
+
.trim()
|
|
68
|
+
.replace(/[::。.\s]+$/, "")
|
|
69
|
+
.slice(0, 40) || "playbook");
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Run the playbook extraction branch: LLM produces §四 markdown, write a draft
|
|
73
|
+
* `type=playbook` page. Returns the written slug, or null when the LLM produced no
|
|
74
|
+
* usable body. Never throws on empty output.
|
|
75
|
+
*/
|
|
76
|
+
export async function extractPlaybookDraft(block, provider, pages) {
|
|
77
|
+
const conversation = formatConversation(block.messages);
|
|
78
|
+
const body = (await provider.chat([
|
|
79
|
+
{ role: "system", content: PLAYBOOK_EXTRACT_PROMPT },
|
|
80
|
+
{ role: "user", content: conversation },
|
|
81
|
+
], { responseFormat: "text", temperature: 0.2 })).trim();
|
|
82
|
+
if (!body)
|
|
83
|
+
return null;
|
|
84
|
+
const title = deriveTitle(block);
|
|
85
|
+
const slug = `playbook/${kebabCase(title)}`;
|
|
86
|
+
const frontmatter = [
|
|
87
|
+
"---",
|
|
88
|
+
`title: ${title}`,
|
|
89
|
+
"type: playbook",
|
|
90
|
+
"confidence: inferred",
|
|
91
|
+
"tags:",
|
|
92
|
+
" - draft",
|
|
93
|
+
"---",
|
|
94
|
+
].join("\n");
|
|
95
|
+
await pages.putPage(slug, `${frontmatter}\n${body}`);
|
|
96
|
+
return slug;
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=playbook-extractor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playbook-extractor.js","sourceRoot":"","sources":["../../src/extractors/playbook-extractor.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
# Example: Agent Session Extraction
|
|
2
|
+
|
|
3
|
+
## Input Conversation
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
[2024-01-15T10:00:00Z] → Alice: We need to migrate from sessions to JWT for the auth system
|
|
7
|
+
[2024-01-15T10:01:30Z] ← Bob: Makes sense for scaling. I can start this week.
|
|
8
|
+
[2024-01-15T10:02:15Z] → Alice: Perfect. Let's use the HS256 algorithm initially.
|
|
9
|
+
[2024-01-15T10:03:00Z] ← Bob: Got it. Should we add refresh tokens too?
|
|
10
|
+
[2024-01-15T10:03:45Z] → Alice: Yes, 7-day access tokens and 30-day refresh tokens.
|
|
11
|
+
[2024-01-15T10:04:30Z] ← Bob: I'll document the decision in the wiki before implementing.
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Output JSON
|
|
15
|
+
|
|
16
|
+
```json
|
|
17
|
+
{
|
|
18
|
+
"source": {
|
|
19
|
+
"platform": "slack",
|
|
20
|
+
"channel": "#engineering",
|
|
21
|
+
"timestamp": "2024-01-15T10:00:00Z",
|
|
22
|
+
"thread_id": "thread-auth-migration",
|
|
23
|
+
"raw_hash": "abc123def456",
|
|
24
|
+
"quote": "We need to migrate from sessions to JWT for the auth system"
|
|
25
|
+
},
|
|
26
|
+
"entities": [
|
|
27
|
+
{
|
|
28
|
+
"slug": "person/alice",
|
|
29
|
+
"name": "Alice",
|
|
30
|
+
"type": "person",
|
|
31
|
+
"context": "Engineering lead discussing auth migration",
|
|
32
|
+
"confidence": "direct"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"slug": "person/bob",
|
|
36
|
+
"name": "Bob",
|
|
37
|
+
"type": "person",
|
|
38
|
+
"context": "Developer implementing JWT auth system",
|
|
39
|
+
"confidence": "direct"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"slug": "project/auth-system",
|
|
43
|
+
"name": "Auth System",
|
|
44
|
+
"type": "project",
|
|
45
|
+
"context": "Authentication system being migrated to JWT",
|
|
46
|
+
"confidence": "direct"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"slug": "tool/jwt",
|
|
50
|
+
"name": "JWT (JSON Web Tokens)",
|
|
51
|
+
"type": "tool",
|
|
52
|
+
"context": "Token-based authentication mechanism replacing sessions",
|
|
53
|
+
"confidence": "direct"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"slug": "concept/refresh-tokens",
|
|
57
|
+
"name": "Refresh Tokens",
|
|
58
|
+
"type": "concept",
|
|
59
|
+
"context": "30-day tokens for obtaining new access tokens",
|
|
60
|
+
"confidence": "direct"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"timeline": [
|
|
64
|
+
{
|
|
65
|
+
"date": "2024-01-15",
|
|
66
|
+
"summary": "Decision to migrate from sessions to JWT authentication",
|
|
67
|
+
"entities": ["person/alice", "person/bob", "project/auth-system", "tool/jwt"],
|
|
68
|
+
"source": {
|
|
69
|
+
"platform": "slack",
|
|
70
|
+
"channel": "#engineering",
|
|
71
|
+
"timestamp": "2024-01-15T10:00:00Z",
|
|
72
|
+
"thread_id": "thread-auth-migration",
|
|
73
|
+
"raw_hash": "abc123def456",
|
|
74
|
+
"quote": "We need to migrate from sessions to JWT for the auth system"
|
|
75
|
+
},
|
|
76
|
+
"confidence": "direct"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"date": "2024-01-15",
|
|
80
|
+
"summary": "Bob commits to starting JWT migration this week",
|
|
81
|
+
"entities": ["person/bob", "project/auth-system"],
|
|
82
|
+
"source": {
|
|
83
|
+
"platform": "slack",
|
|
84
|
+
"channel": "#engineering",
|
|
85
|
+
"timestamp": "2024-01-15T10:01:30Z",
|
|
86
|
+
"thread_id": "thread-auth-migration",
|
|
87
|
+
"raw_hash": "abc123def456",
|
|
88
|
+
"quote": "Makes sense for scaling. I can start this week."
|
|
89
|
+
},
|
|
90
|
+
"confidence": "direct"
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
"links": [
|
|
94
|
+
{
|
|
95
|
+
"from": "person/bob",
|
|
96
|
+
"to": "project/auth-system",
|
|
97
|
+
"type": "works_on",
|
|
98
|
+
"context": "Bob is implementing the JWT migration for auth system",
|
|
99
|
+
"confidence": "direct"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"from": "project/auth-system",
|
|
103
|
+
"to": "tool/jwt",
|
|
104
|
+
"type": "depends_on",
|
|
105
|
+
"context": "Auth system will use JWT for token-based authentication",
|
|
106
|
+
"confidence": "direct"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"from": "person/alice",
|
|
110
|
+
"to": "project/auth-system",
|
|
111
|
+
"type": "works_on",
|
|
112
|
+
"context": "Alice is leading the auth system migration decision",
|
|
113
|
+
"confidence": "paraphrased"
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
"decisions": [
|
|
117
|
+
{
|
|
118
|
+
"summary": "Migrate authentication from sessions to JWT",
|
|
119
|
+
"reasoning": "Better for scaling across multiple instances",
|
|
120
|
+
"alternatives": ["Keep session-based auth", "Use OAuth2"],
|
|
121
|
+
"entities": ["project/auth-system", "tool/jwt"],
|
|
122
|
+
"date": "2024-01-15",
|
|
123
|
+
"confidence": "direct",
|
|
124
|
+
"source": {
|
|
125
|
+
"platform": "slack",
|
|
126
|
+
"channel": "#engineering",
|
|
127
|
+
"timestamp": "2024-01-15T10:00:00Z",
|
|
128
|
+
"thread_id": "thread-auth-migration",
|
|
129
|
+
"raw_hash": "abc123def456",
|
|
130
|
+
"quote": "We need to migrate from sessions to JWT for the auth system"
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"summary": "Use HS256 algorithm for JWT signing",
|
|
135
|
+
"entities": ["tool/jwt"],
|
|
136
|
+
"date": "2024-01-15",
|
|
137
|
+
"confidence": "direct",
|
|
138
|
+
"source": {
|
|
139
|
+
"platform": "slack",
|
|
140
|
+
"channel": "#engineering",
|
|
141
|
+
"timestamp": "2024-01-15T10:02:15Z",
|
|
142
|
+
"thread_id": "thread-auth-migration",
|
|
143
|
+
"raw_hash": "abc123def456",
|
|
144
|
+
"quote": "Let's use the HS256 algorithm initially."
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"summary": "Token expiration: 7-day access tokens, 30-day refresh tokens",
|
|
149
|
+
"entities": ["tool/jwt", "concept/refresh-tokens"],
|
|
150
|
+
"date": "2024-01-15",
|
|
151
|
+
"confidence": "direct",
|
|
152
|
+
"source": {
|
|
153
|
+
"platform": "slack",
|
|
154
|
+
"channel": "#engineering",
|
|
155
|
+
"timestamp": "2024-01-15T10:03:45Z",
|
|
156
|
+
"thread_id": "thread-auth-migration",
|
|
157
|
+
"raw_hash": "abc123def456",
|
|
158
|
+
"quote": "Yes, 7-day access tokens and 30-day refresh tokens."
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
],
|
|
162
|
+
"tasks": [
|
|
163
|
+
{
|
|
164
|
+
"title": "Implement JWT-based authentication",
|
|
165
|
+
"status": "open",
|
|
166
|
+
"owner": "person/bob",
|
|
167
|
+
"project": "project/auth-system",
|
|
168
|
+
"valid_at": "2024-01-15T10:01:30Z",
|
|
169
|
+
"source": {
|
|
170
|
+
"platform": "slack",
|
|
171
|
+
"channel": "#engineering",
|
|
172
|
+
"timestamp": "2024-01-15T10:01:30Z",
|
|
173
|
+
"thread_id": "thread-auth-migration",
|
|
174
|
+
"raw_hash": "abc123def456",
|
|
175
|
+
"quote": "I can start this week."
|
|
176
|
+
},
|
|
177
|
+
"confidence": "direct"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"title": "Document JWT migration decision in wiki",
|
|
181
|
+
"status": "open",
|
|
182
|
+
"owner": "person/bob",
|
|
183
|
+
"project": "project/auth-system",
|
|
184
|
+
"valid_at": "2024-01-15T10:04:30Z",
|
|
185
|
+
"source": {
|
|
186
|
+
"platform": "slack",
|
|
187
|
+
"channel": "#engineering",
|
|
188
|
+
"timestamp": "2024-01-15T10:04:30Z",
|
|
189
|
+
"thread_id": "thread-auth-migration",
|
|
190
|
+
"raw_hash": "abc123def456",
|
|
191
|
+
"quote": "I'll document the decision in the wiki before implementing."
|
|
192
|
+
},
|
|
193
|
+
"confidence": "direct"
|
|
194
|
+
}
|
|
195
|
+
],
|
|
196
|
+
"discoveries": [
|
|
197
|
+
{
|
|
198
|
+
"summary": "Session-based auth doesn't scale well across multiple instances",
|
|
199
|
+
"type": "insight",
|
|
200
|
+
"entities": ["project/auth-system"],
|
|
201
|
+
"source": {
|
|
202
|
+
"platform": "slack",
|
|
203
|
+
"channel": "#engineering",
|
|
204
|
+
"timestamp": "2024-01-15T10:01:30Z",
|
|
205
|
+
"thread_id": "thread-auth-migration",
|
|
206
|
+
"raw_hash": "abc123def456",
|
|
207
|
+
"quote": "Makes sense for scaling."
|
|
208
|
+
},
|
|
209
|
+
"confidence": "paraphrased"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"summary": "Document architectural decisions before implementation",
|
|
213
|
+
"type": "procedure",
|
|
214
|
+
"entities": ["person/bob"],
|
|
215
|
+
"source": {
|
|
216
|
+
"platform": "slack",
|
|
217
|
+
"channel": "#engineering",
|
|
218
|
+
"timestamp": "2024-01-15T10:04:30Z",
|
|
219
|
+
"thread_id": "thread-auth-migration",
|
|
220
|
+
"raw_hash": "abc123def456",
|
|
221
|
+
"quote": "I'll document the decision in the wiki before implementing."
|
|
222
|
+
},
|
|
223
|
+
"confidence": "direct"
|
|
224
|
+
}
|
|
225
|
+
],
|
|
226
|
+
"knowledge": [
|
|
227
|
+
{
|
|
228
|
+
"topic": "jwt-token-expiration",
|
|
229
|
+
"content": "Access tokens should be short-lived (minutes to hours) while refresh tokens can be longer-lived (days to weeks) to balance security with user experience",
|
|
230
|
+
"source_type": "teaching",
|
|
231
|
+
"related_entities": ["tool/jwt", "concept/refresh-tokens"],
|
|
232
|
+
"source": {
|
|
233
|
+
"platform": "slack",
|
|
234
|
+
"channel": "#engineering",
|
|
235
|
+
"timestamp": "2024-01-15T10:03:45Z",
|
|
236
|
+
"thread_id": "thread-auth-migration",
|
|
237
|
+
"raw_hash": "abc123def456",
|
|
238
|
+
"quote": "Yes, 7-day access tokens and 30-day refresh tokens."
|
|
239
|
+
},
|
|
240
|
+
"confidence": "paraphrased"
|
|
241
|
+
}
|
|
242
|
+
]
|
|
243
|
+
}
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
## Key Takeaways from This Example
|
|
247
|
+
|
|
248
|
+
1. **Entity consistency**: Same person/project mentioned multiple times uses the same slug
|
|
249
|
+
2. **Confidence levels**: Most are "direct" (explicit), some "paraphrased" (clear implication)
|
|
250
|
+
3. **Rich context**: Each signal includes enough context to understand it standalone
|
|
251
|
+
4. **Quotes**: All under 300 chars, capturing the key statement
|
|
252
|
+
5. **Links**: Connect entities with specific relationship types
|
|
253
|
+
6. **Timeline**: Events ordered chronologically with clear summaries
|
|
254
|
+
7. **Decisions**: Capture not just what was decided, but why and what alternatives existed
|
|
255
|
+
8. **Tasks**: Include owner, status, and timing information
|
|
256
|
+
9. **Discoveries**: Extract both insights (learnings) and procedures (how-to)
|
|
257
|
+
10. **Knowledge**: Extract reusable facts that stand alone without the original conversation context
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# Signal Extraction Task
|
|
2
|
+
|
|
3
|
+
Extract structured signals from the provided conversation block following the schema below.
|
|
4
|
+
|
|
5
|
+
## Output Schema
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
interface ExtractionResult {
|
|
9
|
+
source: SourceRef;
|
|
10
|
+
entities: Entity[];
|
|
11
|
+
timeline: TimelineEntry[];
|
|
12
|
+
links: Link[];
|
|
13
|
+
decisions: Decision[];
|
|
14
|
+
tasks: TaskSignal[];
|
|
15
|
+
discoveries: Discovery[];
|
|
16
|
+
knowledge: Knowledge[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface SourceRef {
|
|
20
|
+
platform: string; // e.g., "slack", "claude-code"
|
|
21
|
+
channel: string; // e.g., "#general", "session-123"
|
|
22
|
+
timestamp: string; // ISO 8601
|
|
23
|
+
message_id?: string;
|
|
24
|
+
thread_id?: string;
|
|
25
|
+
file_path?: string;
|
|
26
|
+
line_range?: { start: number; end: number };
|
|
27
|
+
attachment_id?: string;
|
|
28
|
+
url?: string;
|
|
29
|
+
raw_hash: string; // generated by system
|
|
30
|
+
quote: string; // ≤ 300 chars, most relevant excerpt
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface Entity {
|
|
34
|
+
slug: string; // Format: {type}/{kebab-name}
|
|
35
|
+
name: string; // Display name
|
|
36
|
+
type: 'person' | 'project' | 'organization' | 'tool' | 'concept';
|
|
37
|
+
context: string; // Brief description
|
|
38
|
+
confidence: 'direct' | 'paraphrased' | 'inferred' | 'speculative';
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
interface TimelineEntry {
|
|
42
|
+
date: string; // ISO 8601 or partial (YYYY-MM, YYYY)
|
|
43
|
+
summary: string; // Event description
|
|
44
|
+
entities: string[]; // Slugs of involved entities
|
|
45
|
+
source: SourceRef;
|
|
46
|
+
confidence: 'direct' | 'paraphrased' | 'inferred' | 'speculative';
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
interface Link {
|
|
50
|
+
from: string; // Entity slug
|
|
51
|
+
to: string; // Entity slug
|
|
52
|
+
type: 'works_on' | 'works_at' | 'reports_to' | 'collaborates' | 'depends_on' | 'mentions' | 'custom';
|
|
53
|
+
context: string; // Description of relationship
|
|
54
|
+
confidence: 'direct' | 'paraphrased' | 'inferred' | 'speculative';
|
|
55
|
+
source: SourceRef;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
interface Decision {
|
|
59
|
+
summary: string; // What was decided
|
|
60
|
+
reasoning?: string; // Why (if mentioned)
|
|
61
|
+
alternatives?: string[]; // Other options considered
|
|
62
|
+
entities: string[]; // Slugs of entities involved
|
|
63
|
+
date: string; // ISO 8601
|
|
64
|
+
valid_at?: string; // When decision takes effect
|
|
65
|
+
invalid_at?: string; // When decision expires/superseded
|
|
66
|
+
confidence: 'direct' | 'paraphrased' | 'inferred' | 'speculative';
|
|
67
|
+
source: SourceRef;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
interface TaskSignal {
|
|
71
|
+
title: string; // Task description
|
|
72
|
+
status: 'open' | 'in_progress' | 'done' | 'cancelled';
|
|
73
|
+
owner?: string; // Entity slug
|
|
74
|
+
project?: string; // Entity slug
|
|
75
|
+
due_date?: string; // ISO 8601
|
|
76
|
+
valid_at?: string; // When task was created
|
|
77
|
+
invalid_at?: string; // When task was closed
|
|
78
|
+
source: SourceRef;
|
|
79
|
+
confidence: 'direct' | 'paraphrased' | 'inferred' | 'speculative';
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
interface Discovery {
|
|
83
|
+
summary: string; // Brief insight
|
|
84
|
+
detail?: string; // Extended explanation
|
|
85
|
+
type: 'procedure' | 'preference' | 'pattern' | 'insight';
|
|
86
|
+
entities: string[]; // Slugs of related entities
|
|
87
|
+
source: SourceRef;
|
|
88
|
+
confidence: 'direct' | 'paraphrased' | 'inferred' | 'speculative';
|
|
89
|
+
}
|
|
90
|
+
interface Knowledge {
|
|
91
|
+
topic: string; // kebab-case topic tag: "react-hooks", "feishu-api"
|
|
92
|
+
content: string; // Decontextualized knowledge statement
|
|
93
|
+
source_type: 'conversation' | 'document' | 'teaching';
|
|
94
|
+
related_entities: string[]; // Entity slugs (may reference entities not in this block)
|
|
95
|
+
valid_at?: string; // ISO 8601, when knowledge becomes valid
|
|
96
|
+
invalid_at?: string; // ISO 8601, when knowledge expires
|
|
97
|
+
source: SourceRef;
|
|
98
|
+
confidence: 'direct' | 'paraphrased' | 'inferred' | 'speculative';
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Extraction Rules
|
|
103
|
+
|
|
104
|
+
### Entity Slugs
|
|
105
|
+
- Format: `{type}/{kebab-case-name}`
|
|
106
|
+
- Examples: `person/alice-smith`, `project/auth-system`, `tool/github-actions`
|
|
107
|
+
- Be consistent: same entity = same slug across all signals
|
|
108
|
+
- For people: use recognizable name (first name + last initial if ambiguous)
|
|
109
|
+
- For projects/tools: use official name or widely-used abbreviation
|
|
110
|
+
|
|
111
|
+
### Quotes
|
|
112
|
+
- Maximum 300 characters
|
|
113
|
+
- Select the most informative excerpt
|
|
114
|
+
- Don't fabricate - copy exact text (can trim with "...")
|
|
115
|
+
- Should stand alone and convey key context
|
|
116
|
+
|
|
117
|
+
### Confidence Levels
|
|
118
|
+
- **direct**: Explicitly stated ("Alice will lead the auth project")
|
|
119
|
+
- **paraphrased**: Clear implication with different wording ("Alice is taking charge of authentication")
|
|
120
|
+
- **inferred**: Reasonable deduction ("Alice keeps talking about auth, likely leading it")
|
|
121
|
+
- **speculative**: Uncertain but possible ("Alice might be involved based on previous mentions")
|
|
122
|
+
|
|
123
|
+
### Dates
|
|
124
|
+
- Prefer ISO 8601: `2024-01-15T10:30:00Z`
|
|
125
|
+
- Partial dates OK: `2024-01` (month), `2024` (year)
|
|
126
|
+
- Relative dates: resolve to absolute if possible ("last Tuesday" → `2024-01-09`)
|
|
127
|
+
- Uncertain dates: use best estimate with lower confidence
|
|
128
|
+
|
|
129
|
+
### Empty Results
|
|
130
|
+
- If no signals found, return empty arrays for all categories
|
|
131
|
+
- Still include valid `source` with platform, channel, timestamp, and quote
|
|
132
|
+
|
|
133
|
+
### Knowledge vs Discovery
|
|
134
|
+
|
|
135
|
+
Knowledge (知识): Decontextualized, reusable facts or concepts
|
|
136
|
+
✓ "React useEffect runs twice in StrictMode during development"
|
|
137
|
+
✓ "Feishu API global rate limit is 50 QPS"
|
|
138
|
+
✓ "TCP three-way handshake prevents stale connection requests"
|
|
139
|
+
|
|
140
|
+
Discovery (发现): Scene-bound, time-bound findings
|
|
141
|
+
✓ "Today's integration test found 5s latency on this endpoint"
|
|
142
|
+
✓ "Root cause of this bug is a race condition"
|
|
143
|
+
✓ "Local Docker DNS resolution is broken"
|
|
144
|
+
|
|
145
|
+
Rules:
|
|
146
|
+
1. Remove time/scene info — is the statement still valid and valuable? Yes → Knowledge
|
|
147
|
+
2. Could this be a FAQ or documentation entry as-is? Yes → Knowledge
|
|
148
|
+
3. If uncertain, prefer Discovery (conservative)
|
|
149
|
+
|
|
150
|
+
### Knowledge vs Decision
|
|
151
|
+
|
|
152
|
+
Knowledge: Norms, facts, concepts — objective, verifiable
|
|
153
|
+
✓ "Feishu API global rate limit is 50 QPS"
|
|
154
|
+
✓ "Go goroutine initial stack size is 2KB"
|
|
155
|
+
|
|
156
|
+
Decision: Team/project choices, commitments — subjective, has an owner
|
|
157
|
+
✓ "All services will use OpenTelemetry going forward"
|
|
158
|
+
✓ "We decided to replace MySQL with PostgreSQL"
|
|
159
|
+
|
|
160
|
+
Rules:
|
|
161
|
+
1. Has an explicit decision-maker or team commitment? → Decision
|
|
162
|
+
2. Would this statement hold true for a different team/project? → Knowledge
|
|
163
|
+
3. If uncertain, look for verbs like "decided", "chose", "switched to" → Decision
|
|
164
|
+
|
|
165
|
+
### Knowledge source_type
|
|
166
|
+
|
|
167
|
+
- `conversation`: Extracted from group/private chat messages
|
|
168
|
+
- `document`: Extracted from cloud document content
|
|
169
|
+
- `teaching`: Someone actively explaining/teaching (systematic explanation of principles, steps, processes)
|
|
170
|
+
|
|
171
|
+
### Knowledge topic
|
|
172
|
+
|
|
173
|
+
- Output kebab-case ASCII when possible: "react-hooks", "feishu-api"
|
|
174
|
+
- For Chinese topics, translate to English: "飞书API" → "feishu-api"
|
|
175
|
+
- The system normalizes non-conforming topics automatically
|
|
176
|
+
|
|
177
|
+
### Knowledge confidence
|
|
178
|
+
|
|
179
|
+
- Knowledge should rarely be `speculative`. The system may skip speculative Knowledge entries.
|
|
180
|
+
- Prefer `direct` or `paraphrased` for factual statements.
|
|
181
|
+
|
|
182
|
+
### Language Policy
|
|
183
|
+
|
|
184
|
+
- Structural fields (slug, topic, type, status) → English ASCII, kebab-case
|
|
185
|
+
- Natural language fields (name, summary, content, context, detail,
|
|
186
|
+
reasoning, quote) → **SAME LANGUAGE as the source material**
|
|
187
|
+
- If the conversation is in Chinese, write summaries in Chinese
|
|
188
|
+
- If the conversation mixes languages, use the dominant language
|
|
189
|
+
- quote field MUST be verbatim from the original text, never translated
|
|
190
|
+
- slug for Chinese person names: use pinyin
|
|
191
|
+
(e.g., "李应龙" → "person/li-yinglong")
|
|
192
|
+
|
|
193
|
+
## Example
|
|
194
|
+
|
|
195
|
+
See `examples/agent-session.md` for a complete example with diverse signal types.
|
|
196
|
+
|
|
197
|
+
## Your Task
|
|
198
|
+
|
|
199
|
+
Process the conversation block provided below and output ONLY valid JSON matching ExtractionResult schema.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# System Prompt: Signal Extraction
|
|
2
|
+
|
|
3
|
+
You are a signal extraction system designed to identify and structure meaningful information from conversations and text. Always respond with valid JSON.
|
|
4
|
+
|
|
5
|
+
## Your Role
|
|
6
|
+
|
|
7
|
+
Extract structured signals from conversation blocks, including:
|
|
8
|
+
- **Entities**: People, projects, organizations, tools, concepts
|
|
9
|
+
- **Timeline entries**: Events, milestones, decisions with dates
|
|
10
|
+
- **Links**: Relationships between entities
|
|
11
|
+
- **Decisions**: Choices made with reasoning
|
|
12
|
+
- **Tasks**: Action items and their status
|
|
13
|
+
- **Discoveries**: Insights, patterns, procedures, preferences
|
|
14
|
+
- **Knowledge**: Decontextualized, reusable facts or concepts that stand on their own without needing the original context
|
|
15
|
+
|
|
16
|
+
## Core Principles
|
|
17
|
+
|
|
18
|
+
1. **Accuracy over completeness**: Only extract what you can confidently identify
|
|
19
|
+
2. **Context preservation**: Include sufficient context to understand the signal standalone
|
|
20
|
+
3. **Confidence levels**: Mark confidence appropriately (direct/paraphrased/inferred/speculative)
|
|
21
|
+
4. **Quote discipline**: Keep quotes under 300 characters, select the most relevant excerpt
|
|
22
|
+
5. **Slug format**: Use `{type}/{kebab-case-name}` (e.g., `person/alice-smith`, `project/auth-system`)
|
|
23
|
+
|
|
24
|
+
## Confidence Levels
|
|
25
|
+
|
|
26
|
+
- **direct**: Explicitly stated in the text ("Alice will work on the auth system")
|
|
27
|
+
- **paraphrased**: Clearly implied, just different words ("Alice is taking the auth project")
|
|
28
|
+
- **inferred**: Reasonable deduction from context ("Alice mentioned auth again, likely working on it")
|
|
29
|
+
- **speculative**: Possible but uncertain ("Alice might be involved in auth based on previous context")
|
|
30
|
+
|
|
31
|
+
## Output Format
|
|
32
|
+
|
|
33
|
+
Always output valid JSON matching the ExtractionResultSchema. Include all required fields.
|
|
34
|
+
Empty arrays are valid (no signals found is acceptable).
|
|
35
|
+
|
|
36
|
+
## Quality Standards
|
|
37
|
+
|
|
38
|
+
- Entities must have clear, searchable slugs
|
|
39
|
+
- Timeline entries must have valid ISO 8601 dates or partial dates (YYYY-MM, YYYY)
|
|
40
|
+
- Links must connect existing entity slugs
|
|
41
|
+
- Decisions must capture reasoning, not just conclusions
|
|
42
|
+
- Tasks must have realistic status (open/in_progress/done/cancelled)
|
|
43
|
+
- Discoveries must be actionable insights, not obvious facts
|
|
44
|
+
|
|
45
|
+
You will be provided with conversation context and expected to return structured JSON.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* 4. Retries once on validation failure with error feedback
|
|
9
9
|
* 5. Returns BlockResult (ok/failed) - never returns empty on failure
|
|
10
10
|
*/
|
|
11
|
-
import type { BlockResult, CanonicalisedBlock, ConversationBlock } from "../core/types.js";
|
|
11
|
+
import type { BlockResult, CanonicalisedBlock, ConversationBlock, SourceRef } from "../core/types.js";
|
|
12
12
|
import type { LLMProvider } from "./providers/types.js";
|
|
13
13
|
/**
|
|
14
14
|
* Signal Extractor interface
|
|
@@ -22,6 +22,7 @@ export interface SignalExtractor {
|
|
|
22
22
|
* Exported for unit testing.
|
|
23
23
|
*/
|
|
24
24
|
export declare function buildEntityHintsSection(text: string): string;
|
|
25
|
+
export declare function buildSourceRef(input: ConversationBlock | CanonicalisedBlock): SourceRef;
|
|
25
26
|
/**
|
|
26
27
|
* Create a signal extractor with the given LLM provider
|
|
27
28
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signal-extractor.d.ts","sourceRoot":"","sources":["../../src/extractors/signal-extractor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"signal-extractor.d.ts","sourceRoot":"","sources":["../../src/extractors/signal-extractor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EAGjB,SAAS,EAEV,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAsDrE;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,KAAK,EAAE,kBAAkB,GAAG,iBAAiB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;CAC9E;AAWD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAkB5D;AA6ED,wBAAgB,cAAc,CAAC,KAAK,EAAE,iBAAiB,GAAG,kBAAkB,GAAG,SAAS,CAuDvF;AA2BD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,WAAW,GAAG,eAAe,CAwH5E"}
|