gnosys 5.9.5 → 5.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +91 -771
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +403 -141
- package/dist/index.d.ts +3 -1
- package/dist/index.js +427 -348
- package/dist/lib/archive.d.ts +3 -4
- package/dist/lib/archive.js +0 -1
- package/dist/lib/ask.d.ts +3 -4
- package/dist/lib/ask.js +0 -1
- package/dist/lib/atomicWrite.d.ts +7 -0
- package/dist/lib/atomicWrite.js +46 -0
- package/dist/lib/attachments.d.ts +0 -1
- package/dist/lib/attachments.js +0 -1
- package/dist/lib/audioExtract.d.ts +0 -1
- package/dist/lib/audioExtract.js +0 -1
- package/dist/lib/audit.d.ts +0 -1
- package/dist/lib/audit.js +0 -1
- package/dist/lib/bootstrap.d.ts +1 -2
- package/dist/lib/bootstrap.js +0 -1
- package/dist/lib/centralize.d.ts +20 -0
- package/dist/lib/centralize.js +34 -0
- package/dist/lib/chat/SlashPalette.d.ts +2 -3
- package/dist/lib/chat/SlashPalette.js +0 -1
- package/dist/lib/chat/boot-splash.d.ts +1 -2
- package/dist/lib/chat/boot-splash.js +0 -1
- package/dist/lib/chat/choose.d.ts +0 -1
- package/dist/lib/chat/choose.js +0 -2
- package/dist/lib/chat/commands.d.ts +1 -2
- package/dist/lib/chat/commands.js +0 -1
- package/dist/lib/chat/components/CitationText.d.ts +1 -2
- package/dist/lib/chat/components/CitationText.js +0 -1
- package/dist/lib/chat/components/MarkdownRenderer.d.ts +0 -1
- package/dist/lib/chat/components/MarkdownRenderer.js +0 -1
- package/dist/lib/chat/components/ToolCallCard.d.ts +1 -2
- package/dist/lib/chat/components/ToolCallCard.js +0 -1
- package/dist/lib/chat/focus.d.ts +3 -3
- package/dist/lib/chat/focus.js +0 -1
- package/dist/lib/chat/index.d.ts +3 -4
- package/dist/lib/chat/index.js +2 -2
- package/dist/lib/chat/intent.d.ts +1 -17
- package/dist/lib/chat/intent.js +2 -3
- package/dist/lib/chat/llmTurn.d.ts +5 -6
- package/dist/lib/chat/llmTurn.js +0 -1
- package/dist/lib/chat/recall.d.ts +2 -3
- package/dist/lib/chat/recall.js +1 -2
- package/dist/lib/chat/render.d.ts +2 -3
- package/dist/lib/chat/render.js +0 -1
- package/dist/lib/chat/session.d.ts +0 -1
- package/dist/lib/chat/session.js +0 -1
- package/dist/lib/chat/theme.d.ts +0 -1
- package/dist/lib/chat/theme.js +0 -1
- package/dist/lib/chat/toolFence.d.ts +2 -2
- package/dist/lib/chat/toolFence.js +0 -1
- package/dist/lib/chat/tools.d.ts +0 -1
- package/dist/lib/chat/tools.js +0 -1
- package/dist/lib/chat/types.d.ts +0 -1
- package/dist/lib/chat/types.js +0 -1
- package/dist/lib/chat/write.d.ts +5 -5
- package/dist/lib/chat/write.js +0 -1
- package/dist/lib/chunkSplitter.d.ts +0 -1
- package/dist/lib/chunkSplitter.js +0 -1
- package/dist/lib/cleanup.d.ts +0 -1
- package/dist/lib/cleanup.js +0 -1
- package/dist/lib/config.d.ts +0 -1
- package/dist/lib/config.js +3 -3
- package/dist/lib/dashboard.d.ts +3 -4
- package/dist/lib/dashboard.js +5 -2
- package/dist/lib/db.d.ts +24 -1
- package/dist/lib/db.js +162 -16
- package/dist/lib/dbSearch.d.ts +3 -4
- package/dist/lib/dbSearch.js +0 -1
- package/dist/lib/dbWrite.d.ts +2 -3
- package/dist/lib/dbWrite.js +0 -1
- package/dist/lib/desktopNotify.d.ts +0 -1
- package/dist/lib/desktopNotify.js +0 -1
- package/dist/lib/docxExtract.d.ts +0 -1
- package/dist/lib/docxExtract.js +22 -1
- package/dist/lib/dream.d.ts +2 -3
- package/dist/lib/dream.js +2 -2
- package/dist/lib/embeddings.d.ts +0 -3
- package/dist/lib/embeddings.js +7 -3
- package/dist/lib/export.d.ts +6 -2
- package/dist/lib/export.js +24 -2
- package/dist/lib/exportProject.d.ts +4 -3
- package/dist/lib/exportProject.js +3 -1
- package/dist/lib/federated.d.ts +3 -3
- package/dist/lib/federated.js +6 -4
- package/dist/lib/fileDetect.d.ts +0 -1
- package/dist/lib/fileDetect.js +0 -1
- package/dist/lib/graph.d.ts +4 -4
- package/dist/lib/graph.js +0 -1
- package/dist/lib/heartbeat.d.ts +0 -13
- package/dist/lib/heartbeat.js +1 -2
- package/dist/lib/hybridSearch.d.ts +5 -21
- package/dist/lib/hybridSearch.js +0 -1
- package/dist/lib/idFormat.d.ts +0 -2
- package/dist/lib/idFormat.js +1 -2
- package/dist/lib/imageExtract.d.ts +0 -1
- package/dist/lib/imageExtract.js +0 -1
- package/dist/lib/import.d.ts +6 -5
- package/dist/lib/import.js +3 -33
- package/dist/lib/importProject.d.ts +4 -4
- package/dist/lib/importProject.js +1 -2
- package/dist/lib/ingest.d.ts +3 -4
- package/dist/lib/ingest.js +0 -1
- package/dist/lib/lensing.d.ts +1 -2
- package/dist/lib/lensing.js +0 -1
- package/dist/lib/llm.d.ts +6 -45
- package/dist/lib/llm.js +27 -9
- package/dist/lib/lock.d.ts +0 -1
- package/dist/lib/lock.js +0 -1
- package/dist/lib/log.d.ts +4 -0
- package/dist/lib/log.js +85 -0
- package/dist/lib/machineConfig.d.ts +86 -0
- package/dist/lib/machineConfig.js +157 -0
- package/dist/lib/machineMigrate.d.ts +38 -0
- package/dist/lib/machineMigrate.js +102 -0
- package/dist/lib/maintenance.d.ts +4 -5
- package/dist/lib/maintenance.js +0 -1
- package/dist/lib/mcpClientConfig.d.ts +20 -0
- package/dist/lib/mcpClientConfig.js +62 -0
- package/dist/lib/mcpHttp.d.ts +52 -0
- package/dist/lib/mcpHttp.js +227 -0
- package/dist/lib/migrate.d.ts +1 -2
- package/dist/lib/migrate.js +1 -1
- package/dist/lib/modelValidation.d.ts +0 -1
- package/dist/lib/modelValidation.js +0 -1
- package/dist/lib/multimodalIngest.d.ts +1 -2
- package/dist/lib/multimodalIngest.js +0 -1
- package/dist/lib/packageManager.d.ts +5 -0
- package/dist/lib/packageManager.js +30 -0
- package/dist/lib/paths.d.ts +11 -7
- package/dist/lib/paths.js +14 -2
- package/dist/lib/pdfExtract.d.ts +0 -1
- package/dist/lib/pdfExtract.js +0 -1
- package/dist/lib/portfolio.d.ts +1 -2
- package/dist/lib/portfolio.js +10 -3
- package/dist/lib/portfolioHtml.d.ts +1 -2
- package/dist/lib/portfolioHtml.js +0 -1
- package/dist/lib/preferences.d.ts +6 -2
- package/dist/lib/preferences.js +19 -1
- package/dist/lib/progress.d.ts +2 -2
- package/dist/lib/progress.js +0 -1
- package/dist/lib/projectIdentity.d.ts +1 -2
- package/dist/lib/projectIdentity.js +5 -5
- package/dist/lib/projectPaths.d.ts +60 -0
- package/dist/lib/projectPaths.js +99 -0
- package/dist/lib/projectScan.d.ts +40 -0
- package/dist/lib/projectScan.js +96 -0
- package/dist/lib/recall.d.ts +6 -6
- package/dist/lib/recall.js +0 -1
- package/dist/lib/remote.d.ts +3 -20
- package/dist/lib/remote.js +44 -2
- package/dist/lib/remoteWizard.d.ts +2 -3
- package/dist/lib/remoteWizard.js +0 -1
- package/dist/lib/resolver.d.ts +1 -2
- package/dist/lib/resolver.js +2 -3
- package/dist/lib/retry.d.ts +0 -1
- package/dist/lib/retry.js +1 -2
- package/dist/lib/rulesGen.d.ts +2 -8
- package/dist/lib/rulesGen.js +1 -2
- package/dist/lib/search.d.ts +1 -2
- package/dist/lib/search.js +1 -1
- package/dist/lib/searchTypes.d.ts +18 -0
- package/dist/lib/searchTypes.js +2 -0
- package/dist/lib/setup/coldStart.d.ts +0 -1
- package/dist/lib/setup/coldStart.js +0 -1
- package/dist/lib/setup/configSetRender.d.ts +0 -1
- package/dist/lib/setup/configSetRender.js +0 -1
- package/dist/lib/setup/dreamRender.d.ts +0 -1
- package/dist/lib/setup/dreamRender.js +0 -1
- package/dist/lib/setup/dreamState.d.ts +2 -2
- package/dist/lib/setup/dreamState.js +0 -1
- package/dist/lib/setup/modelsRender.d.ts +0 -1
- package/dist/lib/setup/modelsRender.js +0 -1
- package/dist/lib/setup/remoteRender.d.ts +0 -1
- package/dist/lib/setup/remoteRender.js +0 -1
- package/dist/lib/setup/routingRender.d.ts +0 -1
- package/dist/lib/setup/routingRender.js +0 -1
- package/dist/lib/setup/sections/ides.d.ts +1 -2
- package/dist/lib/setup/sections/ides.js +3 -2
- package/dist/lib/setup/sections/preferences.d.ts +1 -2
- package/dist/lib/setup/sections/preferences.js +3 -2
- package/dist/lib/setup/sections/routing.d.ts +1 -2
- package/dist/lib/setup/sections/routing.js +0 -1
- package/dist/lib/setup/storePath.d.ts +0 -1
- package/dist/lib/setup/storePath.js +0 -1
- package/dist/lib/setup/summary.d.ts +1 -2
- package/dist/lib/setup/summary.js +0 -1
- package/dist/lib/setup/syncProjectsRender.d.ts +0 -1
- package/dist/lib/setup/syncProjectsRender.js +0 -1
- package/dist/lib/setup/ui/diff.d.ts +0 -1
- package/dist/lib/setup/ui/diff.js +0 -1
- package/dist/lib/setup/ui/footer.d.ts +0 -1
- package/dist/lib/setup/ui/footer.js +0 -1
- package/dist/lib/setup/ui/header.d.ts +0 -1
- package/dist/lib/setup/ui/header.js +0 -1
- package/dist/lib/setup/ui/index.d.ts +0 -1
- package/dist/lib/setup/ui/index.js +0 -1
- package/dist/lib/setup/ui/menu.d.ts +0 -1
- package/dist/lib/setup/ui/menu.js +0 -1
- package/dist/lib/setup/ui/panel.d.ts +0 -1
- package/dist/lib/setup/ui/panel.js +0 -1
- package/dist/lib/setup/ui/prompt.d.ts +0 -1
- package/dist/lib/setup/ui/prompt.js +0 -1
- package/dist/lib/setup/ui/safePrompt.d.ts +0 -1
- package/dist/lib/setup/ui/safePrompt.js +0 -1
- package/dist/lib/setup/ui/spinner.d.ts +0 -1
- package/dist/lib/setup/ui/spinner.js +0 -1
- package/dist/lib/setup/ui/status.d.ts +0 -1
- package/dist/lib/setup/ui/status.js +0 -1
- package/dist/lib/setup/ui/table.d.ts +0 -1
- package/dist/lib/setup/ui/table.js +0 -1
- package/dist/lib/setup/ui/title.d.ts +0 -1
- package/dist/lib/setup/ui/title.js +0 -1
- package/dist/lib/setup/ui/tokens.d.ts +0 -1
- package/dist/lib/setup/ui/tokens.js +0 -1
- package/dist/lib/setup.d.ts +2 -31
- package/dist/lib/setup.js +13 -9
- package/dist/lib/staticSearch.d.ts +0 -1
- package/dist/lib/staticSearch.js +0 -1
- package/dist/lib/store.d.ts +0 -1
- package/dist/lib/store.js +0 -1
- package/dist/lib/structuredIngest.d.ts +0 -1
- package/dist/lib/structuredIngest.js +0 -1
- package/dist/lib/tags.d.ts +0 -1
- package/dist/lib/tags.js +0 -1
- package/dist/lib/timeline.d.ts +2 -3
- package/dist/lib/timeline.js +3 -4
- package/dist/lib/trace.d.ts +1 -16
- package/dist/lib/trace.js +0 -1
- package/dist/lib/upgrade.d.ts +0 -1
- package/dist/lib/upgrade.js +0 -1
- package/dist/lib/videoExtract.d.ts +0 -1
- package/dist/lib/videoExtract.js +0 -1
- package/dist/lib/webIndex.d.ts +1 -3
- package/dist/lib/webIndex.js +0 -1
- package/dist/lib/webIngest.d.ts +13 -1
- package/dist/lib/webIngest.js +98 -24
- package/dist/lib/wikilinks.d.ts +3 -3
- package/dist/lib/wikilinks.js +0 -1
- package/dist/postinstall.d.ts +0 -1
- package/dist/postinstall.js +0 -1
- package/dist/sandbox/client.d.ts +0 -1
- package/dist/sandbox/client.js +0 -1
- package/dist/sandbox/helper-template.d.ts +0 -1
- package/dist/sandbox/helper-template.js +0 -1
- package/dist/sandbox/manager.d.ts +0 -9
- package/dist/sandbox/manager.js +2 -3
- package/dist/sandbox/server.d.ts +2 -3
- package/dist/sandbox/server.js +7 -7
- package/docs/logo.svg +25 -0
- package/package.json +18 -6
- package/prompts/synthesize.md +2 -0
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/archive.d.ts.map +0 -1
- package/dist/lib/archive.js.map +0 -1
- package/dist/lib/ask.d.ts.map +0 -1
- package/dist/lib/ask.js.map +0 -1
- package/dist/lib/attachments.d.ts.map +0 -1
- package/dist/lib/attachments.js.map +0 -1
- package/dist/lib/audioExtract.d.ts.map +0 -1
- package/dist/lib/audioExtract.js.map +0 -1
- package/dist/lib/audit.d.ts.map +0 -1
- package/dist/lib/audit.js.map +0 -1
- package/dist/lib/bootstrap.d.ts.map +0 -1
- package/dist/lib/bootstrap.js.map +0 -1
- package/dist/lib/chat/SlashPalette.d.ts.map +0 -1
- package/dist/lib/chat/SlashPalette.js.map +0 -1
- package/dist/lib/chat/boot-splash.d.ts.map +0 -1
- package/dist/lib/chat/boot-splash.js.map +0 -1
- package/dist/lib/chat/choose.d.ts.map +0 -1
- package/dist/lib/chat/choose.js.map +0 -1
- package/dist/lib/chat/commands.d.ts.map +0 -1
- package/dist/lib/chat/commands.js.map +0 -1
- package/dist/lib/chat/components/CitationText.d.ts.map +0 -1
- package/dist/lib/chat/components/CitationText.js.map +0 -1
- package/dist/lib/chat/components/MarkdownRenderer.d.ts.map +0 -1
- package/dist/lib/chat/components/MarkdownRenderer.js.map +0 -1
- package/dist/lib/chat/components/ToolCallCard.d.ts.map +0 -1
- package/dist/lib/chat/components/ToolCallCard.js.map +0 -1
- package/dist/lib/chat/focus.d.ts.map +0 -1
- package/dist/lib/chat/focus.js.map +0 -1
- package/dist/lib/chat/index.d.ts.map +0 -1
- package/dist/lib/chat/index.js.map +0 -1
- package/dist/lib/chat/intent.d.ts.map +0 -1
- package/dist/lib/chat/intent.js.map +0 -1
- package/dist/lib/chat/llmTurn.d.ts.map +0 -1
- package/dist/lib/chat/llmTurn.js.map +0 -1
- package/dist/lib/chat/recall.d.ts.map +0 -1
- package/dist/lib/chat/recall.js.map +0 -1
- package/dist/lib/chat/render.d.ts.map +0 -1
- package/dist/lib/chat/render.js.map +0 -1
- package/dist/lib/chat/session.d.ts.map +0 -1
- package/dist/lib/chat/session.js.map +0 -1
- package/dist/lib/chat/theme.d.ts.map +0 -1
- package/dist/lib/chat/theme.js.map +0 -1
- package/dist/lib/chat/toolFence.d.ts.map +0 -1
- package/dist/lib/chat/toolFence.js.map +0 -1
- package/dist/lib/chat/tools.d.ts.map +0 -1
- package/dist/lib/chat/tools.js.map +0 -1
- package/dist/lib/chat/types.d.ts.map +0 -1
- package/dist/lib/chat/types.js.map +0 -1
- package/dist/lib/chat/write.d.ts.map +0 -1
- package/dist/lib/chat/write.js.map +0 -1
- package/dist/lib/chunkSplitter.d.ts.map +0 -1
- package/dist/lib/chunkSplitter.js.map +0 -1
- package/dist/lib/cleanup.d.ts.map +0 -1
- package/dist/lib/cleanup.js.map +0 -1
- package/dist/lib/config.d.ts.map +0 -1
- package/dist/lib/config.js.map +0 -1
- package/dist/lib/dashboard.d.ts.map +0 -1
- package/dist/lib/dashboard.js.map +0 -1
- package/dist/lib/db.d.ts.map +0 -1
- package/dist/lib/db.js.map +0 -1
- package/dist/lib/dbSearch.d.ts.map +0 -1
- package/dist/lib/dbSearch.js.map +0 -1
- package/dist/lib/dbWrite.d.ts.map +0 -1
- package/dist/lib/dbWrite.js.map +0 -1
- package/dist/lib/desktopNotify.d.ts.map +0 -1
- package/dist/lib/desktopNotify.js.map +0 -1
- package/dist/lib/docxExtract.d.ts.map +0 -1
- package/dist/lib/docxExtract.js.map +0 -1
- package/dist/lib/dream.d.ts.map +0 -1
- package/dist/lib/dream.js.map +0 -1
- package/dist/lib/embeddings.d.ts.map +0 -1
- package/dist/lib/embeddings.js.map +0 -1
- package/dist/lib/export.d.ts.map +0 -1
- package/dist/lib/export.js.map +0 -1
- package/dist/lib/exportProject.d.ts.map +0 -1
- package/dist/lib/exportProject.js.map +0 -1
- package/dist/lib/federated.d.ts.map +0 -1
- package/dist/lib/federated.js.map +0 -1
- package/dist/lib/fileDetect.d.ts.map +0 -1
- package/dist/lib/fileDetect.js.map +0 -1
- package/dist/lib/graph.d.ts.map +0 -1
- package/dist/lib/graph.js.map +0 -1
- package/dist/lib/heartbeat.d.ts.map +0 -1
- package/dist/lib/heartbeat.js.map +0 -1
- package/dist/lib/history.d.ts +0 -39
- package/dist/lib/history.d.ts.map +0 -1
- package/dist/lib/history.js +0 -112
- package/dist/lib/history.js.map +0 -1
- package/dist/lib/hybridSearch.d.ts.map +0 -1
- package/dist/lib/hybridSearch.js.map +0 -1
- package/dist/lib/idFormat.d.ts.map +0 -1
- package/dist/lib/idFormat.js.map +0 -1
- package/dist/lib/imageExtract.d.ts.map +0 -1
- package/dist/lib/imageExtract.js.map +0 -1
- package/dist/lib/import.d.ts.map +0 -1
- package/dist/lib/import.js.map +0 -1
- package/dist/lib/importProject.d.ts.map +0 -1
- package/dist/lib/importProject.js.map +0 -1
- package/dist/lib/ingest.d.ts.map +0 -1
- package/dist/lib/ingest.js.map +0 -1
- package/dist/lib/lensing.d.ts.map +0 -1
- package/dist/lib/lensing.js.map +0 -1
- package/dist/lib/llm.d.ts.map +0 -1
- package/dist/lib/llm.js.map +0 -1
- package/dist/lib/lock.d.ts.map +0 -1
- package/dist/lib/lock.js.map +0 -1
- package/dist/lib/maintenance.d.ts.map +0 -1
- package/dist/lib/maintenance.js.map +0 -1
- package/dist/lib/migrate.d.ts.map +0 -1
- package/dist/lib/migrate.js.map +0 -1
- package/dist/lib/modelValidation.d.ts.map +0 -1
- package/dist/lib/modelValidation.js.map +0 -1
- package/dist/lib/multimodalIngest.d.ts.map +0 -1
- package/dist/lib/multimodalIngest.js.map +0 -1
- package/dist/lib/paths.d.ts.map +0 -1
- package/dist/lib/paths.js.map +0 -1
- package/dist/lib/pdfExtract.d.ts.map +0 -1
- package/dist/lib/pdfExtract.js.map +0 -1
- package/dist/lib/portfolio.d.ts.map +0 -1
- package/dist/lib/portfolio.js.map +0 -1
- package/dist/lib/portfolioHtml.d.ts.map +0 -1
- package/dist/lib/portfolioHtml.js.map +0 -1
- package/dist/lib/preferences.d.ts.map +0 -1
- package/dist/lib/preferences.js.map +0 -1
- package/dist/lib/progress.d.ts.map +0 -1
- package/dist/lib/progress.js.map +0 -1
- package/dist/lib/projectIdentity.d.ts.map +0 -1
- package/dist/lib/projectIdentity.js.map +0 -1
- package/dist/lib/recall.d.ts.map +0 -1
- package/dist/lib/recall.js.map +0 -1
- package/dist/lib/remote.d.ts.map +0 -1
- package/dist/lib/remote.js.map +0 -1
- package/dist/lib/remoteWizard.d.ts.map +0 -1
- package/dist/lib/remoteWizard.js.map +0 -1
- package/dist/lib/resolver.d.ts.map +0 -1
- package/dist/lib/resolver.js.map +0 -1
- package/dist/lib/retry.d.ts.map +0 -1
- package/dist/lib/retry.js.map +0 -1
- package/dist/lib/rulesGen.d.ts.map +0 -1
- package/dist/lib/rulesGen.js.map +0 -1
- package/dist/lib/search.d.ts.map +0 -1
- package/dist/lib/search.js.map +0 -1
- package/dist/lib/setup/coldStart.d.ts.map +0 -1
- package/dist/lib/setup/coldStart.js.map +0 -1
- package/dist/lib/setup/configSetRender.d.ts.map +0 -1
- package/dist/lib/setup/configSetRender.js.map +0 -1
- package/dist/lib/setup/dreamRender.d.ts.map +0 -1
- package/dist/lib/setup/dreamRender.js.map +0 -1
- package/dist/lib/setup/dreamState.d.ts.map +0 -1
- package/dist/lib/setup/dreamState.js.map +0 -1
- package/dist/lib/setup/modelsRender.d.ts.map +0 -1
- package/dist/lib/setup/modelsRender.js.map +0 -1
- package/dist/lib/setup/remoteRender.d.ts.map +0 -1
- package/dist/lib/setup/remoteRender.js.map +0 -1
- package/dist/lib/setup/routingRender.d.ts.map +0 -1
- package/dist/lib/setup/routingRender.js.map +0 -1
- package/dist/lib/setup/sections/ides.d.ts.map +0 -1
- package/dist/lib/setup/sections/ides.js.map +0 -1
- package/dist/lib/setup/sections/preferences.d.ts.map +0 -1
- package/dist/lib/setup/sections/preferences.js.map +0 -1
- package/dist/lib/setup/sections/routing.d.ts.map +0 -1
- package/dist/lib/setup/sections/routing.js.map +0 -1
- package/dist/lib/setup/storePath.d.ts.map +0 -1
- package/dist/lib/setup/storePath.js.map +0 -1
- package/dist/lib/setup/summary.d.ts.map +0 -1
- package/dist/lib/setup/summary.js.map +0 -1
- package/dist/lib/setup/syncProjectsRender.d.ts.map +0 -1
- package/dist/lib/setup/syncProjectsRender.js.map +0 -1
- package/dist/lib/setup/ui/diff.d.ts.map +0 -1
- package/dist/lib/setup/ui/diff.js.map +0 -1
- package/dist/lib/setup/ui/footer.d.ts.map +0 -1
- package/dist/lib/setup/ui/footer.js.map +0 -1
- package/dist/lib/setup/ui/header.d.ts.map +0 -1
- package/dist/lib/setup/ui/header.js.map +0 -1
- package/dist/lib/setup/ui/index.d.ts.map +0 -1
- package/dist/lib/setup/ui/index.js.map +0 -1
- package/dist/lib/setup/ui/menu.d.ts.map +0 -1
- package/dist/lib/setup/ui/menu.js.map +0 -1
- package/dist/lib/setup/ui/panel.d.ts.map +0 -1
- package/dist/lib/setup/ui/panel.js.map +0 -1
- package/dist/lib/setup/ui/prompt.d.ts.map +0 -1
- package/dist/lib/setup/ui/prompt.js.map +0 -1
- package/dist/lib/setup/ui/safePrompt.d.ts.map +0 -1
- package/dist/lib/setup/ui/safePrompt.js.map +0 -1
- package/dist/lib/setup/ui/spinner.d.ts.map +0 -1
- package/dist/lib/setup/ui/spinner.js.map +0 -1
- package/dist/lib/setup/ui/status.d.ts.map +0 -1
- package/dist/lib/setup/ui/status.js.map +0 -1
- package/dist/lib/setup/ui/table.d.ts.map +0 -1
- package/dist/lib/setup/ui/table.js.map +0 -1
- package/dist/lib/setup/ui/title.d.ts.map +0 -1
- package/dist/lib/setup/ui/title.js.map +0 -1
- package/dist/lib/setup/ui/tokens.d.ts.map +0 -1
- package/dist/lib/setup/ui/tokens.js.map +0 -1
- package/dist/lib/setup.d.ts.map +0 -1
- package/dist/lib/setup.js.map +0 -1
- package/dist/lib/staticSearch.d.ts.map +0 -1
- package/dist/lib/staticSearch.js.map +0 -1
- package/dist/lib/store.d.ts.map +0 -1
- package/dist/lib/store.js.map +0 -1
- package/dist/lib/structuredIngest.d.ts.map +0 -1
- package/dist/lib/structuredIngest.js.map +0 -1
- package/dist/lib/tags.d.ts.map +0 -1
- package/dist/lib/tags.js.map +0 -1
- package/dist/lib/timeline.d.ts.map +0 -1
- package/dist/lib/timeline.js.map +0 -1
- package/dist/lib/trace.d.ts.map +0 -1
- package/dist/lib/trace.js.map +0 -1
- package/dist/lib/upgrade.d.ts.map +0 -1
- package/dist/lib/upgrade.js.map +0 -1
- package/dist/lib/videoExtract.d.ts.map +0 -1
- package/dist/lib/videoExtract.js.map +0 -1
- package/dist/lib/webIndex.d.ts.map +0 -1
- package/dist/lib/webIndex.js.map +0 -1
- package/dist/lib/webIngest.d.ts.map +0 -1
- package/dist/lib/webIngest.js.map +0 -1
- package/dist/lib/wikilinks.d.ts.map +0 -1
- package/dist/lib/wikilinks.js.map +0 -1
- package/dist/postinstall.d.ts.map +0 -1
- package/dist/postinstall.js.map +0 -1
- package/dist/sandbox/client.d.ts.map +0 -1
- package/dist/sandbox/client.js.map +0 -1
- package/dist/sandbox/helper-template.d.ts.map +0 -1
- package/dist/sandbox/helper-template.js.map +0 -1
- package/dist/sandbox/index.d.ts +0 -10
- package/dist/sandbox/index.d.ts.map +0 -1
- package/dist/sandbox/index.js +0 -10
- package/dist/sandbox/index.js.map +0 -1
- package/dist/sandbox/manager.d.ts.map +0 -1
- package/dist/sandbox/manager.js.map +0 -1
- package/dist/sandbox/server.d.ts.map +0 -1
- package/dist/sandbox/server.js.map +0 -1
package/dist/lib/chat/types.js
CHANGED
package/dist/lib/chat/write.d.ts
CHANGED
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
* tags.from-chat: ["true"]
|
|
12
12
|
* tags.source: ["remember" | "save-turn" | "auto" | "attach"]
|
|
13
13
|
*/
|
|
14
|
-
import { GnosysDB } from "../db.js";
|
|
15
|
-
import { GnosysConfig } from "../config.js";
|
|
16
|
-
import { Turn } from "./types.js";
|
|
17
|
-
|
|
14
|
+
import type { GnosysDB } from "../db.js";
|
|
15
|
+
import type { GnosysConfig } from "../config.js";
|
|
16
|
+
import type { Turn } from "./types.js";
|
|
17
|
+
type PromoteSource = "remember" | "save-turn" | "auto" | "attach";
|
|
18
18
|
export interface PromoteOptions {
|
|
19
19
|
/** Free-form text to save. */
|
|
20
20
|
content: string;
|
|
@@ -63,4 +63,4 @@ export interface AutoPromoteHint {
|
|
|
63
63
|
* Returns null when nothing matches.
|
|
64
64
|
*/
|
|
65
65
|
export declare function detectAutoPromote(userText: string): AutoPromoteHint | null;
|
|
66
|
-
|
|
66
|
+
export {};
|
package/dist/lib/chat/write.js
CHANGED
package/dist/lib/cleanup.d.ts
CHANGED
package/dist/lib/cleanup.js
CHANGED
package/dist/lib/config.d.ts
CHANGED
package/dist/lib/config.js
CHANGED
|
@@ -7,6 +7,7 @@ import fs from "fs/promises";
|
|
|
7
7
|
import path from "path";
|
|
8
8
|
import { execSync } from "child_process";
|
|
9
9
|
import { getGnosysHome } from "./paths.js";
|
|
10
|
+
import { atomicWriteFile } from "./atomicWrite.js";
|
|
10
11
|
// ─── LLM Provider Schemas ───────────────────────────────────────────────
|
|
11
12
|
const LLMProviderEnum = z.enum(["anthropic", "ollama", "groq", "openai", "lmstudio", "xai", "mistral", "custom"]);
|
|
12
13
|
const AnthropicConfigSchema = z.object({
|
|
@@ -534,7 +535,7 @@ export async function loadConfig(storePath) {
|
|
|
534
535
|
export async function writeConfig(storePath, config) {
|
|
535
536
|
const configPath = path.join(storePath, "gnosys.json");
|
|
536
537
|
const merged = GnosysConfigSchema.parse(config);
|
|
537
|
-
await
|
|
538
|
+
await atomicWriteFile(configPath, JSON.stringify(merged, null, 2) + "\n");
|
|
538
539
|
}
|
|
539
540
|
/**
|
|
540
541
|
* Update specific fields in gnosys.json without overwriting the whole file.
|
|
@@ -554,7 +555,7 @@ export async function updateConfig(storePath, updates) {
|
|
|
554
555
|
// Validate for shape/type errors. The validated object has defaults
|
|
555
556
|
// applied; we deliberately throw it away and persist `merged` instead.
|
|
556
557
|
const validated = GnosysConfigSchema.parse(merged);
|
|
557
|
-
await
|
|
558
|
+
await atomicWriteFile(configPath, JSON.stringify(merged, null, 2) + "\n");
|
|
558
559
|
return validated;
|
|
559
560
|
}
|
|
560
561
|
/**
|
|
@@ -617,4 +618,3 @@ export function generateConfigTemplate() {
|
|
|
617
618
|
* All supported provider names.
|
|
618
619
|
*/
|
|
619
620
|
export const ALL_PROVIDERS = ["anthropic", "ollama", "groq", "openai", "lmstudio", "xai", "mistral", "custom"];
|
|
620
|
-
//# sourceMappingURL=config.js.map
|
package/dist/lib/dashboard.d.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Gnosys Dashboard — Aggregated system status in a pretty terminal display.
|
|
3
3
|
* Combines memory stats, maintenance health, graph stats, and LLM routing.
|
|
4
4
|
*/
|
|
5
|
-
import { GnosysResolver } from "./resolver.js";
|
|
6
|
-
import { GnosysConfig, LLMProviderName } from "./config.js";
|
|
7
|
-
import { GnosysDB } from "./db.js";
|
|
5
|
+
import type { GnosysResolver } from "./resolver.js";
|
|
6
|
+
import { type GnosysConfig, type LLMProviderName } from "./config.js";
|
|
7
|
+
import type { GnosysDB } from "./db.js";
|
|
8
8
|
export interface DashboardData {
|
|
9
9
|
stores: Array<{
|
|
10
10
|
label: string;
|
|
@@ -92,4 +92,3 @@ export declare function formatDashboard(data: DashboardData): string;
|
|
|
92
92
|
* Format dashboard data as structured JSON for MCP tool consumption.
|
|
93
93
|
*/
|
|
94
94
|
export declare function formatDashboardJSON(data: DashboardData): string;
|
|
95
|
-
//# sourceMappingURL=dashboard.d.ts.map
|
package/dist/lib/dashboard.js
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
import { resolveTaskModel, ALL_PROVIDERS, } from "./config.js";
|
|
6
6
|
import { isProviderAvailable } from "./llm.js";
|
|
7
7
|
import { GnosysEmbeddings } from "./embeddings.js";
|
|
8
|
+
import { readMachineConfig } from "./machineConfig.js";
|
|
9
|
+
import { effectiveProjectPath } from "./projectPaths.js";
|
|
8
10
|
import fs from "fs/promises";
|
|
9
11
|
import path from "path";
|
|
10
12
|
/**
|
|
@@ -53,9 +55,11 @@ export async function collectDashboardData(resolver, config, version, gnosysDb)
|
|
|
53
55
|
let totalMemories = 0;
|
|
54
56
|
if (gnosysDb?.isAvailable() && gnosysDb?.isMigrated()) {
|
|
55
57
|
const projects = gnosysDb.getAllProjects();
|
|
58
|
+
const machine = readMachineConfig();
|
|
56
59
|
for (const p of projects) {
|
|
57
60
|
const count = gnosysDb.getMemoriesByProject(p.id).length;
|
|
58
|
-
|
|
61
|
+
const path = effectiveProjectPath(gnosysDb, p, machine) ?? "(not on this machine)";
|
|
62
|
+
storeData.push({ label: p.name, path, memoryCount: count });
|
|
59
63
|
totalMemories += count;
|
|
60
64
|
}
|
|
61
65
|
// Also count user/global-scoped memories that have no project_id
|
|
@@ -417,4 +421,3 @@ export function formatDashboard(data) {
|
|
|
417
421
|
export function formatDashboardJSON(data) {
|
|
418
422
|
return JSON.stringify(data, null, 2);
|
|
419
423
|
}
|
|
420
|
-
//# sourceMappingURL=dashboard.js.map
|
package/dist/lib/db.d.ts
CHANGED
|
@@ -40,12 +40,26 @@ export interface DbProject {
|
|
|
40
40
|
id: string;
|
|
41
41
|
name: string;
|
|
42
42
|
working_directory: string;
|
|
43
|
+
root_id?: string | null;
|
|
44
|
+
rel_path?: string | null;
|
|
43
45
|
user: string;
|
|
44
46
|
agent_rules_target: string | null;
|
|
45
47
|
obsidian_vault: string | null;
|
|
46
48
|
created: string;
|
|
47
49
|
modified: string;
|
|
48
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* v5.11: Per-machine project location override. One row per (project, machine)
|
|
53
|
+
* for projects that live OUTSIDE any named root (so root_id/rel_path can't
|
|
54
|
+
* resolve them). The composite primary key means each machine owns its own
|
|
55
|
+
* row — machines never clobber each other's path.
|
|
56
|
+
*/
|
|
57
|
+
export interface DbProjectLocation {
|
|
58
|
+
project_id: string;
|
|
59
|
+
machine_id: string;
|
|
60
|
+
abs_path: string;
|
|
61
|
+
modified: string;
|
|
62
|
+
}
|
|
49
63
|
export type MemoryScope = "project" | "user" | "global";
|
|
50
64
|
export interface DbRelationship {
|
|
51
65
|
source_id: string;
|
|
@@ -223,6 +237,13 @@ export declare class GnosysDB {
|
|
|
223
237
|
*/
|
|
224
238
|
getMemoriesByScope(scope: MemoryScope): DbMemory[];
|
|
225
239
|
insertProject(project: DbProject): void;
|
|
240
|
+
/** This machine's stored absolute path for a project, or null if none. */
|
|
241
|
+
getProjectLocation(projectId: string, machineId: string): DbProjectLocation | null;
|
|
242
|
+
/** All machines' stored locations for a project. */
|
|
243
|
+
getProjectLocations(projectId: string): DbProjectLocation[];
|
|
244
|
+
/** Record/replace this machine's path for a project (composite PK). */
|
|
245
|
+
setProjectLocation(loc: DbProjectLocation): void;
|
|
246
|
+
deleteProjectLocation(projectId: string, machineId: string): void;
|
|
226
247
|
getProject(id: string): DbProject | null;
|
|
227
248
|
getProjectByDirectory(dir: string): DbProject | null;
|
|
228
249
|
getAllProjects(): DbProject[];
|
|
@@ -291,6 +312,9 @@ export declare class GnosysDB {
|
|
|
291
312
|
transaction<T>(fn: () => T): T;
|
|
292
313
|
getMeta(key: string): string | null;
|
|
293
314
|
setMeta(key: string, value: string): void;
|
|
315
|
+
/** Remove a meta key. Used by v5.11 migrate to move machine-local values
|
|
316
|
+
* (machine_id, remote_path) out of the synced DB into machine.json. */
|
|
317
|
+
deleteMeta(key: string): void;
|
|
294
318
|
/**
|
|
295
319
|
* Get the machine ID designated to run dream cycles. Stored in gnosys_meta
|
|
296
320
|
* under `dream_machine_id`. Returns null if no machine is designated (dream
|
|
@@ -355,4 +379,3 @@ export declare class GnosysDB {
|
|
|
355
379
|
getSchemaVersion(): number;
|
|
356
380
|
}
|
|
357
381
|
export { fnv1a };
|
|
358
|
-
//# sourceMappingURL=db.d.ts.map
|
package/dist/lib/db.js
CHANGED
|
@@ -20,9 +20,11 @@ import path from "path";
|
|
|
20
20
|
import fs from "fs";
|
|
21
21
|
import { enableWAL } from "./lock.js";
|
|
22
22
|
import { getGnosysHome as getGnosysHomeImpl, getCentralDbPath as getCentralDbPathImpl } from "./paths.js";
|
|
23
|
+
import { readMachineConfig } from "./machineConfig.js";
|
|
24
|
+
import { logError } from "./log.js";
|
|
23
25
|
import { ulid } from "ulidx";
|
|
24
26
|
// ─── Schema ─────────────────────────────────────────────────────────────
|
|
25
|
-
const SCHEMA_VERSION =
|
|
27
|
+
const SCHEMA_VERSION = 4;
|
|
26
28
|
const SCHEMA_SQL = `
|
|
27
29
|
CREATE TABLE IF NOT EXISTS memories (
|
|
28
30
|
id TEXT PRIMARY KEY,
|
|
@@ -61,6 +63,8 @@ CREATE INDEX IF NOT EXISTS idx_memories_last_reinforced ON memories(last_reinfor
|
|
|
61
63
|
CREATE INDEX IF NOT EXISTS idx_memories_content_hash ON memories(content_hash);
|
|
62
64
|
CREATE INDEX IF NOT EXISTS idx_memories_project_id ON memories(project_id);
|
|
63
65
|
CREATE INDEX IF NOT EXISTS idx_memories_scope ON memories(scope);
|
|
66
|
+
CREATE INDEX IF NOT EXISTS idx_memories_modified ON memories(modified);
|
|
67
|
+
CREATE INDEX IF NOT EXISTS idx_memories_created ON memories(created);
|
|
64
68
|
|
|
65
69
|
CREATE VIRTUAL TABLE IF NOT EXISTS memories_fts USING fts5(
|
|
66
70
|
id,
|
|
@@ -112,10 +116,15 @@ CREATE INDEX IF NOT EXISTS idx_audit_timestamp ON audit_log(timestamp);
|
|
|
112
116
|
CREATE INDEX IF NOT EXISTS idx_audit_operation ON audit_log(operation);
|
|
113
117
|
CREATE INDEX IF NOT EXISTS idx_audit_trace ON audit_log(trace_id);
|
|
114
118
|
|
|
119
|
+
-- v5.11: working_directory is a machine-local display cache (not UNIQUE, not
|
|
120
|
+
-- identity). Portable identity is id (UUID); portable location is root_id +
|
|
121
|
+
-- rel_path resolved against this machine's roots (see machineConfig.ts).
|
|
115
122
|
CREATE TABLE IF NOT EXISTS projects (
|
|
116
123
|
id TEXT PRIMARY KEY,
|
|
117
124
|
name TEXT NOT NULL,
|
|
118
|
-
working_directory TEXT NOT NULL
|
|
125
|
+
working_directory TEXT NOT NULL DEFAULT '',
|
|
126
|
+
root_id TEXT,
|
|
127
|
+
rel_path TEXT,
|
|
119
128
|
user TEXT NOT NULL,
|
|
120
129
|
agent_rules_target TEXT,
|
|
121
130
|
obsidian_vault TEXT,
|
|
@@ -123,6 +132,15 @@ CREATE TABLE IF NOT EXISTS projects (
|
|
|
123
132
|
modified TEXT NOT NULL
|
|
124
133
|
);
|
|
125
134
|
|
|
135
|
+
-- v5.11: per-machine path override for projects outside any named root.
|
|
136
|
+
CREATE TABLE IF NOT EXISTS project_locations (
|
|
137
|
+
project_id TEXT NOT NULL,
|
|
138
|
+
machine_id TEXT NOT NULL,
|
|
139
|
+
abs_path TEXT NOT NULL,
|
|
140
|
+
modified TEXT NOT NULL,
|
|
141
|
+
PRIMARY KEY (project_id, machine_id)
|
|
142
|
+
);
|
|
143
|
+
|
|
126
144
|
CREATE TABLE IF NOT EXISTS gnosys_meta (
|
|
127
145
|
key TEXT PRIMARY KEY,
|
|
128
146
|
value TEXT NOT NULL,
|
|
@@ -183,8 +201,8 @@ const MEMORY_COLUMNS = new Set([
|
|
|
183
201
|
"project_id", "scope",
|
|
184
202
|
]);
|
|
185
203
|
const PROJECT_COLUMNS = new Set([
|
|
186
|
-
"name", "working_directory", "
|
|
187
|
-
"obsidian_vault", "created", "modified",
|
|
204
|
+
"name", "working_directory", "root_id", "rel_path", "user",
|
|
205
|
+
"agent_rules_target", "obsidian_vault", "created", "modified",
|
|
188
206
|
]);
|
|
189
207
|
// ─── FNV-1a hash (same as embeddings.ts) ────────────────────────────────
|
|
190
208
|
function fnv1a(str) {
|
|
@@ -241,9 +259,16 @@ export class GnosysDB {
|
|
|
241
259
|
}
|
|
242
260
|
const localDb = GnosysDB.openLocal();
|
|
243
261
|
// Check if remote is configured. If not, we're done — return local.
|
|
262
|
+
// v5.11: the remote connection is machine-local (machine.json), since the
|
|
263
|
+
// NAS mount path / Tailscale URL differs per machine. Prefer it; fall back
|
|
264
|
+
// to the legacy synced gnosys_meta value when machine.json has none.
|
|
244
265
|
let remotePath = null;
|
|
245
266
|
try {
|
|
246
|
-
|
|
267
|
+
const mc = readMachineConfig();
|
|
268
|
+
if (mc?.remote?.enabled && mc.remote.path) {
|
|
269
|
+
remotePath = mc.remote.path;
|
|
270
|
+
}
|
|
271
|
+
else if (localDb.isAvailable()) {
|
|
247
272
|
remotePath = localDb.getMeta("remote_path");
|
|
248
273
|
}
|
|
249
274
|
}
|
|
@@ -269,7 +294,10 @@ export class GnosysDB {
|
|
|
269
294
|
// Quiet fallback notice on stderr — visible to humans, doesn't pollute
|
|
270
295
|
// stdout that scripts/agents are piping. Only emitted when remote is
|
|
271
296
|
// CONFIGURED but unreachable (the user expected it to work).
|
|
272
|
-
|
|
297
|
+
logError(new Error(`remote unreachable (${remotePath}), using local cache`), {
|
|
298
|
+
module: "db",
|
|
299
|
+
op: "open",
|
|
300
|
+
});
|
|
273
301
|
return localDb;
|
|
274
302
|
}
|
|
275
303
|
// Remote is reachable — open it and return. Close local first since we
|
|
@@ -288,7 +316,13 @@ export class GnosysDB {
|
|
|
288
316
|
*/
|
|
289
317
|
static openLocal() {
|
|
290
318
|
const dir = GnosysDB.getGnosysHome();
|
|
291
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
319
|
+
fs.mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
320
|
+
try {
|
|
321
|
+
fs.chmodSync(dir, 0o700);
|
|
322
|
+
}
|
|
323
|
+
catch {
|
|
324
|
+
// best-effort (Windows / network FS)
|
|
325
|
+
}
|
|
292
326
|
return new GnosysDB(dir);
|
|
293
327
|
}
|
|
294
328
|
constructor(storePath, opts) {
|
|
@@ -300,9 +334,22 @@ export class GnosysDB {
|
|
|
300
334
|
const retryDelay = opts?.retryDelayMs ?? 500;
|
|
301
335
|
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
302
336
|
try {
|
|
303
|
-
fs.mkdirSync(storePath, { recursive: true });
|
|
337
|
+
fs.mkdirSync(storePath, { recursive: true, mode: 0o700 });
|
|
304
338
|
this.db = new Database(this.dbFilePath);
|
|
305
339
|
enableWAL(this.db);
|
|
340
|
+
try {
|
|
341
|
+
fs.chmodSync(storePath, 0o700);
|
|
342
|
+
fs.chmodSync(this.dbFilePath, 0o600);
|
|
343
|
+
for (const ext of ["-wal", "-shm"]) {
|
|
344
|
+
const sidecar = this.dbFilePath + ext;
|
|
345
|
+
if (fs.existsSync(sidecar)) {
|
|
346
|
+
fs.chmodSync(sidecar, 0o600);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
catch {
|
|
351
|
+
// best-effort (Windows / network FS)
|
|
352
|
+
}
|
|
306
353
|
this.db.pragma("foreign_keys = ON");
|
|
307
354
|
// Longer busy timeout for network shares (10s)
|
|
308
355
|
this.db.pragma("busy_timeout = 10000");
|
|
@@ -453,6 +500,13 @@ export class GnosysDB {
|
|
|
453
500
|
return new GnosysDB(dir);
|
|
454
501
|
}
|
|
455
502
|
applySchema() {
|
|
503
|
+
const currentVersion = this.db.pragma("user_version", { simple: true });
|
|
504
|
+
// Legacy DBs (user_version >= 1) must migrate before the full current
|
|
505
|
+
// schema is applied — SCHEMA_SQL creates indexes on columns (project_id,
|
|
506
|
+
// scope, …) that do not exist on v1/v2 databases yet.
|
|
507
|
+
if (currentVersion > 0 && currentVersion < SCHEMA_VERSION) {
|
|
508
|
+
this.migrateSchema(currentVersion);
|
|
509
|
+
}
|
|
456
510
|
// Apply main schema
|
|
457
511
|
this.db.exec(SCHEMA_SQL);
|
|
458
512
|
// Apply triggers (separate because of FTS5 delete syntax)
|
|
@@ -462,10 +516,11 @@ export class GnosysDB {
|
|
|
462
516
|
catch {
|
|
463
517
|
// Triggers may already exist — that's fine
|
|
464
518
|
}
|
|
465
|
-
//
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
519
|
+
// Fresh DBs (user_version 0) get the full schema first, then migrate
|
|
520
|
+
// to stamp user_version and apply any incremental steps idempotently.
|
|
521
|
+
const versionAfterSchema = this.db.pragma("user_version", { simple: true });
|
|
522
|
+
if (versionAfterSchema < SCHEMA_VERSION) {
|
|
523
|
+
this.migrateSchema(versionAfterSchema);
|
|
469
524
|
}
|
|
470
525
|
}
|
|
471
526
|
/**
|
|
@@ -535,6 +590,57 @@ export class GnosysDB {
|
|
|
535
590
|
// Column already exists — fine
|
|
536
591
|
}
|
|
537
592
|
}
|
|
593
|
+
if (fromVersion < 4) {
|
|
594
|
+
// v3 → v4 (v5.11): machine-portable project paths.
|
|
595
|
+
// Add root_id/rel_path and drop the UNIQUE constraint on
|
|
596
|
+
// working_directory (which forced a single path per project across all
|
|
597
|
+
// machines). SQLite can't drop a constraint in place, so rebuild the
|
|
598
|
+
// table — but only if the new shape isn't already present (a fresh DB
|
|
599
|
+
// gets it straight from SCHEMA_SQL above).
|
|
600
|
+
const cols = this.db.pragma("table_info(projects)");
|
|
601
|
+
const hasRelPath = cols.some((c) => c.name === "rel_path");
|
|
602
|
+
if (!hasRelPath) {
|
|
603
|
+
const rebuild = this.db.transaction(() => {
|
|
604
|
+
this.db.exec(`
|
|
605
|
+
CREATE TABLE projects_new (
|
|
606
|
+
id TEXT PRIMARY KEY,
|
|
607
|
+
name TEXT NOT NULL,
|
|
608
|
+
working_directory TEXT NOT NULL DEFAULT '',
|
|
609
|
+
root_id TEXT,
|
|
610
|
+
rel_path TEXT,
|
|
611
|
+
user TEXT NOT NULL,
|
|
612
|
+
agent_rules_target TEXT,
|
|
613
|
+
obsidian_vault TEXT,
|
|
614
|
+
created TEXT NOT NULL,
|
|
615
|
+
modified TEXT NOT NULL
|
|
616
|
+
)
|
|
617
|
+
`);
|
|
618
|
+
this.db.exec(`
|
|
619
|
+
INSERT INTO projects_new
|
|
620
|
+
(id, name, working_directory, user, agent_rules_target, obsidian_vault, created, modified)
|
|
621
|
+
SELECT id, name, working_directory, user, agent_rules_target, obsidian_vault, created, modified
|
|
622
|
+
FROM projects
|
|
623
|
+
`);
|
|
624
|
+
this.db.exec("DROP TABLE projects");
|
|
625
|
+
this.db.exec("ALTER TABLE projects_new RENAME TO projects");
|
|
626
|
+
});
|
|
627
|
+
rebuild();
|
|
628
|
+
}
|
|
629
|
+
try {
|
|
630
|
+
this.db.exec(`
|
|
631
|
+
CREATE TABLE IF NOT EXISTS project_locations (
|
|
632
|
+
project_id TEXT NOT NULL,
|
|
633
|
+
machine_id TEXT NOT NULL,
|
|
634
|
+
abs_path TEXT NOT NULL,
|
|
635
|
+
modified TEXT NOT NULL,
|
|
636
|
+
PRIMARY KEY (project_id, machine_id)
|
|
637
|
+
)
|
|
638
|
+
`);
|
|
639
|
+
}
|
|
640
|
+
catch {
|
|
641
|
+
// Table may already exist
|
|
642
|
+
}
|
|
643
|
+
}
|
|
538
644
|
this.db.pragma(`user_version = ${SCHEMA_VERSION}`);
|
|
539
645
|
}
|
|
540
646
|
isAvailable() {
|
|
@@ -725,9 +831,38 @@ export class GnosysDB {
|
|
|
725
831
|
return this.withRecovery(() => {
|
|
726
832
|
this.db.prepare(`
|
|
727
833
|
INSERT OR REPLACE INTO projects
|
|
728
|
-
(id, name, working_directory, user, agent_rules_target, obsidian_vault, created, modified)
|
|
729
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
730
|
-
`).run(project.id, project.name, project.working_directory, project.user, project.agent_rules_target || null, project.obsidian_vault || null, project.created, project.modified);
|
|
834
|
+
(id, name, working_directory, root_id, rel_path, user, agent_rules_target, obsidian_vault, created, modified)
|
|
835
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
836
|
+
`).run(project.id, project.name, project.working_directory, project.root_id ?? null, project.rel_path ?? null, project.user, project.agent_rules_target || null, project.obsidian_vault || null, project.created, project.modified);
|
|
837
|
+
});
|
|
838
|
+
}
|
|
839
|
+
// ─── Per-machine project locations (v5.11) ─────────────────────────
|
|
840
|
+
/** This machine's stored absolute path for a project, or null if none. */
|
|
841
|
+
getProjectLocation(projectId, machineId) {
|
|
842
|
+
return this.withRecovery(() => this.db
|
|
843
|
+
.prepare("SELECT * FROM project_locations WHERE project_id = ? AND machine_id = ?")
|
|
844
|
+
.get(projectId, machineId) || null);
|
|
845
|
+
}
|
|
846
|
+
/** All machines' stored locations for a project. */
|
|
847
|
+
getProjectLocations(projectId) {
|
|
848
|
+
return this.withRecovery(() => this.db
|
|
849
|
+
.prepare("SELECT * FROM project_locations WHERE project_id = ?")
|
|
850
|
+
.all(projectId));
|
|
851
|
+
}
|
|
852
|
+
/** Record/replace this machine's path for a project (composite PK). */
|
|
853
|
+
setProjectLocation(loc) {
|
|
854
|
+
return this.withRecovery(() => {
|
|
855
|
+
this.db.prepare(`
|
|
856
|
+
INSERT OR REPLACE INTO project_locations (project_id, machine_id, abs_path, modified)
|
|
857
|
+
VALUES (?, ?, ?, ?)
|
|
858
|
+
`).run(loc.project_id, loc.machine_id, loc.abs_path, loc.modified);
|
|
859
|
+
});
|
|
860
|
+
}
|
|
861
|
+
deleteProjectLocation(projectId, machineId) {
|
|
862
|
+
return this.withRecovery(() => {
|
|
863
|
+
this.db
|
|
864
|
+
.prepare("DELETE FROM project_locations WHERE project_id = ? AND machine_id = ?")
|
|
865
|
+
.run(projectId, machineId);
|
|
731
866
|
});
|
|
732
867
|
}
|
|
733
868
|
getProject(id) {
|
|
@@ -963,6 +1098,18 @@ export class GnosysDB {
|
|
|
963
1098
|
}
|
|
964
1099
|
}
|
|
965
1100
|
}
|
|
1101
|
+
/** Remove a meta key. Used by v5.11 migrate to move machine-local values
|
|
1102
|
+
* (machine_id, remote_path) out of the synced DB into machine.json. */
|
|
1103
|
+
deleteMeta(key) {
|
|
1104
|
+
if (!this.available)
|
|
1105
|
+
return;
|
|
1106
|
+
try {
|
|
1107
|
+
this.db.prepare("DELETE FROM gnosys_meta WHERE key = ?").run(key);
|
|
1108
|
+
}
|
|
1109
|
+
catch {
|
|
1110
|
+
// table may not exist — nothing to delete
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
966
1113
|
// ─── Dream state (v5.4.2) ───────────────────────────────────────────
|
|
967
1114
|
/**
|
|
968
1115
|
* Get the machine ID designated to run dream cycles. Stored in gnosys_meta
|
|
@@ -1105,4 +1252,3 @@ export class GnosysDB {
|
|
|
1105
1252
|
}
|
|
1106
1253
|
// ─── Migration Helper ─────────────────────────────────────────────────
|
|
1107
1254
|
export { fnv1a };
|
|
1108
|
-
//# sourceMappingURL=db.js.map
|
package/dist/lib/dbSearch.d.ts
CHANGED
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
* Implements the same result types so consumers (recall, hybridSearch, ask)
|
|
10
10
|
* work without modification.
|
|
11
11
|
*/
|
|
12
|
-
import { GnosysDB, DbMemory } from "./db.js";
|
|
13
|
-
import { SearchResult, DiscoverResult } from "./search.js";
|
|
14
|
-
import { HybridSearchResult, SearchMode } from "./
|
|
12
|
+
import type { GnosysDB, DbMemory } from "./db.js";
|
|
13
|
+
import type { SearchResult, DiscoverResult } from "./search.js";
|
|
14
|
+
import type { HybridSearchResult, SearchMode } from "./searchTypes.js";
|
|
15
15
|
export declare class GnosysDbSearch {
|
|
16
16
|
private db;
|
|
17
17
|
constructor(db: GnosysDB);
|
|
@@ -62,4 +62,3 @@ export declare class GnosysDbSearch {
|
|
|
62
62
|
*/
|
|
63
63
|
embeddingCount(): number;
|
|
64
64
|
}
|
|
65
|
-
//# sourceMappingURL=dbSearch.d.ts.map
|
package/dist/lib/dbSearch.js
CHANGED
package/dist/lib/dbWrite.d.ts
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* Once the Obsidian Export Bridge (Phase 7e) is complete, .md writes
|
|
14
14
|
* become optional — controlled by config.
|
|
15
15
|
*/
|
|
16
|
-
import { GnosysDB } from "./db.js";
|
|
17
|
-
import { MemoryFrontmatter } from "./store.js";
|
|
16
|
+
import type { GnosysDB } from "./db.js";
|
|
17
|
+
import { type MemoryFrontmatter } from "./store.js";
|
|
18
18
|
/**
|
|
19
19
|
* Sync a memory write to gnosys.db after it's been written to .md.
|
|
20
20
|
* Call this after GnosysStore.writeMemory() or updateMemory().
|
|
@@ -53,4 +53,3 @@ export declare function syncConfidenceToDb(db: GnosysDB, memoryId: string, newCo
|
|
|
53
53
|
* This supplements (and eventually replaces) the JSONL audit log.
|
|
54
54
|
*/
|
|
55
55
|
export declare function auditToDb(db: GnosysDB, operation: string, memoryId?: string, details?: Record<string, unknown>, durationMs?: number, traceId?: string): void;
|
|
56
|
-
//# sourceMappingURL=dbWrite.d.ts.map
|
package/dist/lib/dbWrite.js
CHANGED
package/dist/lib/docxExtract.js
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
* Both libraries are loaded via dynamic import so they stay optional.
|
|
7
7
|
*/
|
|
8
8
|
import * as fs from "fs/promises";
|
|
9
|
+
/** Reject DOCX archives whose entries decompress beyond this total (zip-bomb guard). */
|
|
10
|
+
const MAX_DECOMPRESSED_BYTES = 200 * 1024 * 1024;
|
|
9
11
|
// ─── Public API ─────────────────────────────────────────────────────────
|
|
10
12
|
/**
|
|
11
13
|
* Extract text from a DOCX file as markdown, split into section chunks.
|
|
@@ -25,6 +27,7 @@ export async function extractDocxText(filePath) {
|
|
|
25
27
|
const TurndownService = (await import("turndown")).default;
|
|
26
28
|
// Read the file and convert to HTML
|
|
27
29
|
const buffer = await fs.readFile(filePath);
|
|
30
|
+
await assertDocxDecompressedSizeWithinLimit(buffer);
|
|
28
31
|
const result = await mammoth.convertToHtml({ buffer });
|
|
29
32
|
const html = result.value;
|
|
30
33
|
if (!html || !html.trim()) {
|
|
@@ -77,4 +80,22 @@ export async function extractDocxText(filePath) {
|
|
|
77
80
|
}
|
|
78
81
|
return chunks;
|
|
79
82
|
}
|
|
80
|
-
|
|
83
|
+
/**
|
|
84
|
+
* Inspect ZIP central-directory metadata before decompression.
|
|
85
|
+
* Rejects archives whose total uncompressed payload exceeds the cap.
|
|
86
|
+
*/
|
|
87
|
+
async function assertDocxDecompressedSizeWithinLimit(buffer) {
|
|
88
|
+
const JSZip = (await import("jszip")).default;
|
|
89
|
+
const zip = await JSZip.loadAsync(buffer);
|
|
90
|
+
let total = 0;
|
|
91
|
+
zip.forEach((_relativePath, entry) => {
|
|
92
|
+
if (entry.dir)
|
|
93
|
+
return;
|
|
94
|
+
const data = entry._data;
|
|
95
|
+
const size = data?.uncompressedSize ?? 0;
|
|
96
|
+
total += size;
|
|
97
|
+
});
|
|
98
|
+
if (total > MAX_DECOMPRESSED_BYTES) {
|
|
99
|
+
throw new Error(`DOCX decompresses to ~${Math.floor(total / 1048576)}MB, exceeds the ${MAX_DECOMPRESSED_BYTES / 1048576}MB limit (possible zip bomb).`);
|
|
100
|
+
}
|
|
101
|
+
}
|
package/dist/lib/dream.d.ts
CHANGED
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
* - Off by default — must be explicitly enabled
|
|
18
18
|
* - Uses cheap/local LLM (configurable, defaults to Ollama)
|
|
19
19
|
*/
|
|
20
|
-
import { GnosysDB } from "./db.js";
|
|
21
|
-
import { GnosysConfig, LLMProviderName } from "./config.js";
|
|
20
|
+
import type { GnosysDB } from "./db.js";
|
|
21
|
+
import type { GnosysConfig, LLMProviderName } from "./config.js";
|
|
22
22
|
export interface DreamConfig {
|
|
23
23
|
/** Enable dream mode (default: false) */
|
|
24
24
|
enabled: boolean;
|
|
@@ -179,4 +179,3 @@ export declare class DreamScheduler {
|
|
|
179
179
|
* Format a dream report as human-readable text.
|
|
180
180
|
*/
|
|
181
181
|
export declare function formatDreamReport(report: DreamReport): string;
|
|
182
|
-
//# sourceMappingURL=dream.d.ts.map
|
package/dist/lib/dream.js
CHANGED
|
@@ -21,6 +21,7 @@ import os from "os";
|
|
|
21
21
|
import { getLLMProvider } from "./llm.js";
|
|
22
22
|
import { notifyDesktop } from "./desktopNotify.js";
|
|
23
23
|
import { syncConfidenceToDb, auditToDb } from "./dbWrite.js";
|
|
24
|
+
import { logError } from "./log.js";
|
|
24
25
|
/** Layer 4 alert threshold: fire desktop notification at this many consecutive provider failures. */
|
|
25
26
|
const DREAM_FAILURE_NOTIFY_THRESHOLD = 3;
|
|
26
27
|
export const DEFAULT_DREAM_CONFIG = {
|
|
@@ -739,7 +740,7 @@ export class DreamScheduler {
|
|
|
739
740
|
console.error(`[dream] Complete: ${report.decayUpdated} decay, ${report.summariesGenerated} summaries, ${report.reviewSuggestions.length} reviews, ${report.relationshipsDiscovered} relations (${(report.durationMs / 1000).toFixed(1)}s)`);
|
|
740
741
|
}
|
|
741
742
|
catch (err) {
|
|
742
|
-
|
|
743
|
+
logError(err, { module: "dream", op: "scheduler" });
|
|
743
744
|
}
|
|
744
745
|
finally {
|
|
745
746
|
this.running = false;
|
|
@@ -794,4 +795,3 @@ export function formatDreamReport(report) {
|
|
|
794
795
|
}
|
|
795
796
|
return lines.join("\n");
|
|
796
797
|
}
|
|
797
|
-
//# sourceMappingURL=dream.js.map
|
package/dist/lib/embeddings.d.ts
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* Model (~80 MB) is downloaded only on first use and cached.
|
|
5
5
|
* Embeddings are stored in SQLite as regeneratable sidecar data.
|
|
6
6
|
*/
|
|
7
|
-
declare const EMBEDDING_DIM = 384;
|
|
8
7
|
export declare class GnosysEmbeddings {
|
|
9
8
|
private pipeline;
|
|
10
9
|
private db;
|
|
@@ -80,5 +79,3 @@ export declare class GnosysEmbeddings {
|
|
|
80
79
|
};
|
|
81
80
|
close(): void;
|
|
82
81
|
}
|
|
83
|
-
export { EMBEDDING_DIM };
|
|
84
|
-
//# sourceMappingURL=embeddings.d.ts.map
|