gnosys 5.10.0 → 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 +66 -0
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +289 -137
- 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 +0 -1
- package/dist/lib/db.d.ts +0 -1
- package/dist/lib/db.js +40 -8
- 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 +1 -2
- package/dist/lib/federated.js +0 -1
- 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 +2 -3
- package/dist/lib/machineConfig.js +14 -3
- package/dist/lib/machineMigrate.d.ts +0 -1
- package/dist/lib/machineMigrate.js +0 -1
- 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 +0 -7
- package/dist/lib/paths.js +1 -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 +0 -1
- 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 +2 -2
- package/dist/lib/projectPaths.js +0 -1
- package/dist/lib/projectScan.d.ts +2 -2
- package/dist/lib/projectScan.js +0 -1
- 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 +37 -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/machineConfig.d.ts.map +0 -1
- package/dist/lib/machineConfig.js.map +0 -1
- package/dist/lib/machineMigrate.d.ts.map +0 -1
- package/dist/lib/machineMigrate.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/projectPaths.d.ts.map +0 -1
- package/dist/lib/projectPaths.js.map +0 -1
- package/dist/lib/projectScan.d.ts.map +0 -1
- package/dist/lib/projectScan.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
package/dist/lib/db.d.ts
CHANGED
package/dist/lib/db.js
CHANGED
|
@@ -21,6 +21,7 @@ import fs from "fs";
|
|
|
21
21
|
import { enableWAL } from "./lock.js";
|
|
22
22
|
import { getGnosysHome as getGnosysHomeImpl, getCentralDbPath as getCentralDbPathImpl } from "./paths.js";
|
|
23
23
|
import { readMachineConfig } from "./machineConfig.js";
|
|
24
|
+
import { logError } from "./log.js";
|
|
24
25
|
import { ulid } from "ulidx";
|
|
25
26
|
// ─── Schema ─────────────────────────────────────────────────────────────
|
|
26
27
|
const SCHEMA_VERSION = 4;
|
|
@@ -62,6 +63,8 @@ CREATE INDEX IF NOT EXISTS idx_memories_last_reinforced ON memories(last_reinfor
|
|
|
62
63
|
CREATE INDEX IF NOT EXISTS idx_memories_content_hash ON memories(content_hash);
|
|
63
64
|
CREATE INDEX IF NOT EXISTS idx_memories_project_id ON memories(project_id);
|
|
64
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);
|
|
65
68
|
|
|
66
69
|
CREATE VIRTUAL TABLE IF NOT EXISTS memories_fts USING fts5(
|
|
67
70
|
id,
|
|
@@ -291,7 +294,10 @@ export class GnosysDB {
|
|
|
291
294
|
// Quiet fallback notice on stderr — visible to humans, doesn't pollute
|
|
292
295
|
// stdout that scripts/agents are piping. Only emitted when remote is
|
|
293
296
|
// CONFIGURED but unreachable (the user expected it to work).
|
|
294
|
-
|
|
297
|
+
logError(new Error(`remote unreachable (${remotePath}), using local cache`), {
|
|
298
|
+
module: "db",
|
|
299
|
+
op: "open",
|
|
300
|
+
});
|
|
295
301
|
return localDb;
|
|
296
302
|
}
|
|
297
303
|
// Remote is reachable — open it and return. Close local first since we
|
|
@@ -310,7 +316,13 @@ export class GnosysDB {
|
|
|
310
316
|
*/
|
|
311
317
|
static openLocal() {
|
|
312
318
|
const dir = GnosysDB.getGnosysHome();
|
|
313
|
-
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
|
+
}
|
|
314
326
|
return new GnosysDB(dir);
|
|
315
327
|
}
|
|
316
328
|
constructor(storePath, opts) {
|
|
@@ -322,9 +334,22 @@ export class GnosysDB {
|
|
|
322
334
|
const retryDelay = opts?.retryDelayMs ?? 500;
|
|
323
335
|
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
324
336
|
try {
|
|
325
|
-
fs.mkdirSync(storePath, { recursive: true });
|
|
337
|
+
fs.mkdirSync(storePath, { recursive: true, mode: 0o700 });
|
|
326
338
|
this.db = new Database(this.dbFilePath);
|
|
327
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
|
+
}
|
|
328
353
|
this.db.pragma("foreign_keys = ON");
|
|
329
354
|
// Longer busy timeout for network shares (10s)
|
|
330
355
|
this.db.pragma("busy_timeout = 10000");
|
|
@@ -475,6 +500,13 @@ export class GnosysDB {
|
|
|
475
500
|
return new GnosysDB(dir);
|
|
476
501
|
}
|
|
477
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
|
+
}
|
|
478
510
|
// Apply main schema
|
|
479
511
|
this.db.exec(SCHEMA_SQL);
|
|
480
512
|
// Apply triggers (separate because of FTS5 delete syntax)
|
|
@@ -484,10 +516,11 @@ export class GnosysDB {
|
|
|
484
516
|
catch {
|
|
485
517
|
// Triggers may already exist — that's fine
|
|
486
518
|
}
|
|
487
|
-
//
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
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);
|
|
491
524
|
}
|
|
492
525
|
}
|
|
493
526
|
/**
|
|
@@ -1219,4 +1252,3 @@ export class GnosysDB {
|
|
|
1219
1252
|
}
|
|
1220
1253
|
// ─── Migration Helper ─────────────────────────────────────────────────
|
|
1221
1254
|
export { fnv1a };
|
|
1222
|
-
//# 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
|
package/dist/lib/embeddings.js
CHANGED
|
@@ -45,7 +45,13 @@ export class GnosysEmbeddings {
|
|
|
45
45
|
// Dynamic import — keeps @huggingface/transformers out of the main bundle.
|
|
46
46
|
// dtype 'q8' replaces the v2-era `quantized: true` option (8-bit quantized,
|
|
47
47
|
// ~80 MB vs ~280 MB for fp32). Smaller is fine for sentence embeddings.
|
|
48
|
-
|
|
48
|
+
let pipeline;
|
|
49
|
+
try {
|
|
50
|
+
({ pipeline } = await import("@huggingface/transformers"));
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
throw new Error("Local embeddings require @huggingface/transformers. Install it with: npm install @huggingface/transformers");
|
|
54
|
+
}
|
|
49
55
|
this.pipeline = (await pipeline("feature-extraction", MODEL_NAME, {
|
|
50
56
|
dtype: "q8",
|
|
51
57
|
}));
|
|
@@ -227,5 +233,3 @@ export class GnosysEmbeddings {
|
|
|
227
233
|
this.db = null;
|
|
228
234
|
}
|
|
229
235
|
}
|
|
230
|
-
export { EMBEDDING_DIM };
|
|
231
|
-
//# sourceMappingURL=embeddings.js.map
|
package/dist/lib/export.d.ts
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* _graph/
|
|
19
19
|
* relationships.md (relationship index)
|
|
20
20
|
*/
|
|
21
|
-
import { GnosysDB } from "./db.js";
|
|
21
|
+
import type { GnosysDB } from "./db.js";
|
|
22
22
|
export interface ExportOptions {
|
|
23
23
|
/** Target directory for export (will be created if needed) */
|
|
24
24
|
targetDir: string;
|
|
@@ -38,6 +38,7 @@ export interface ExportOptions {
|
|
|
38
38
|
export interface ExportReport {
|
|
39
39
|
memoriesExported: number;
|
|
40
40
|
memoriesSkipped: number;
|
|
41
|
+
archivedExcluded: number;
|
|
41
42
|
summariesExported: number;
|
|
42
43
|
reviewsExported: boolean;
|
|
43
44
|
graphExported: boolean;
|
|
@@ -84,9 +85,12 @@ export declare class GnosysExporter {
|
|
|
84
85
|
* Slugify a title for use as a filename.
|
|
85
86
|
*/
|
|
86
87
|
private slugify;
|
|
88
|
+
/**
|
|
89
|
+
* Ensure a resolved file path stays within the export target directory.
|
|
90
|
+
*/
|
|
91
|
+
private assertWithin;
|
|
87
92
|
}
|
|
88
93
|
/**
|
|
89
94
|
* Format an export report as human-readable text.
|
|
90
95
|
*/
|
|
91
96
|
export declare function formatExportReport(report: ExportReport): string;
|
|
92
|
-
//# sourceMappingURL=export.d.ts.map
|
package/dist/lib/export.js
CHANGED
|
@@ -34,6 +34,7 @@ export class GnosysExporter {
|
|
|
34
34
|
const report = {
|
|
35
35
|
memoriesExported: 0,
|
|
36
36
|
memoriesSkipped: 0,
|
|
37
|
+
archivedExcluded: 0,
|
|
37
38
|
summariesExported: 0,
|
|
38
39
|
reviewsExported: false,
|
|
39
40
|
graphExported: false,
|
|
@@ -46,6 +47,10 @@ export class GnosysExporter {
|
|
|
46
47
|
const memories = activeOnly
|
|
47
48
|
? this.db.getActiveMemories()
|
|
48
49
|
: this.db.getAllMemories();
|
|
50
|
+
if (activeOnly) {
|
|
51
|
+
report.archivedExcluded =
|
|
52
|
+
this.db.getAllMemories().length - this.db.getActiveMemories().length;
|
|
53
|
+
}
|
|
49
54
|
const total = memories.length;
|
|
50
55
|
// Export each memory as a Markdown file
|
|
51
56
|
for (let i = 0; i < memories.length; i++) {
|
|
@@ -99,7 +104,8 @@ export class GnosysExporter {
|
|
|
99
104
|
* Returns true if exported, false if skipped (already exists).
|
|
100
105
|
*/
|
|
101
106
|
async exportMemory(mem, targetDir, overwrite) {
|
|
102
|
-
const
|
|
107
|
+
const safeCategory = this.slugify(mem.category) || "uncategorized";
|
|
108
|
+
const categoryDir = path.join(targetDir, safeCategory);
|
|
103
109
|
await fs.mkdir(categoryDir, { recursive: true });
|
|
104
110
|
const filename = this.slugify(mem.title) + ".md";
|
|
105
111
|
const filePath = path.join(categoryDir, filename);
|
|
@@ -142,6 +148,7 @@ export class GnosysExporter {
|
|
|
142
148
|
if (wikilinks.length > 0) {
|
|
143
149
|
content += `\n\n---\n\n## Related\n\n${wikilinks.join("\n")}`;
|
|
144
150
|
}
|
|
151
|
+
this.assertWithin(targetDir, filePath);
|
|
145
152
|
await fs.writeFile(filePath, content, "utf-8");
|
|
146
153
|
return true;
|
|
147
154
|
}
|
|
@@ -180,6 +187,7 @@ export class GnosysExporter {
|
|
|
180
187
|
"",
|
|
181
188
|
summary.content,
|
|
182
189
|
].join("\n");
|
|
190
|
+
this.assertWithin(targetDir, filePath);
|
|
183
191
|
await fs.writeFile(filePath, content, "utf-8");
|
|
184
192
|
exported++;
|
|
185
193
|
}
|
|
@@ -230,6 +238,7 @@ export class GnosysExporter {
|
|
|
230
238
|
// Skip malformed reviews
|
|
231
239
|
}
|
|
232
240
|
}
|
|
241
|
+
this.assertWithin(targetDir, filePath);
|
|
233
242
|
await fs.writeFile(filePath, lines.join("\n"), "utf-8");
|
|
234
243
|
return true;
|
|
235
244
|
}
|
|
@@ -278,6 +287,7 @@ export class GnosysExporter {
|
|
|
278
287
|
if (bySource.size === 0) {
|
|
279
288
|
lines.push("No relationships discovered yet. Run `gnosys dream` to discover relationships.");
|
|
280
289
|
}
|
|
290
|
+
this.assertWithin(targetDir, filePath);
|
|
281
291
|
await fs.writeFile(filePath, lines.join("\n"), "utf-8");
|
|
282
292
|
return true;
|
|
283
293
|
}
|
|
@@ -334,6 +344,16 @@ export class GnosysExporter {
|
|
|
334
344
|
.replace(/^-|-$/g, "")
|
|
335
345
|
.substring(0, 80);
|
|
336
346
|
}
|
|
347
|
+
/**
|
|
348
|
+
* Ensure a resolved file path stays within the export target directory.
|
|
349
|
+
*/
|
|
350
|
+
assertWithin(targetDir, filePath) {
|
|
351
|
+
const root = path.resolve(targetDir);
|
|
352
|
+
const resolved = path.resolve(filePath);
|
|
353
|
+
if (resolved !== root && !resolved.startsWith(root + path.sep)) {
|
|
354
|
+
throw new Error(`Refusing to write outside export dir: ${resolved}`);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
337
357
|
}
|
|
338
358
|
// ─── Format Helper ───────────────────────────────────────────────────────
|
|
339
359
|
/**
|
|
@@ -347,6 +367,9 @@ export function formatExportReport(report) {
|
|
|
347
367
|
lines.push(`Target: ${report.targetDir}`);
|
|
348
368
|
lines.push(`Memories exported: ${report.memoriesExported}`);
|
|
349
369
|
lines.push(`Memories skipped (already exist): ${report.memoriesSkipped}`);
|
|
370
|
+
if (report.archivedExcluded > 0) {
|
|
371
|
+
lines.push(`Archived excluded: ${report.archivedExcluded} — re-run with --all for a full export`);
|
|
372
|
+
}
|
|
350
373
|
lines.push(`Summaries exported: ${report.summariesExported}`);
|
|
351
374
|
lines.push(`Reviews exported: ${report.reviewsExported ? "yes" : "no"}`);
|
|
352
375
|
lines.push(`Graph exported: ${report.graphExported ? "yes" : "no"}`);
|
|
@@ -359,4 +382,3 @@ export function formatExportReport(report) {
|
|
|
359
382
|
}
|
|
360
383
|
return lines.join("\n");
|
|
361
384
|
}
|
|
362
|
-
//# sourceMappingURL=export.js.map
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* audit log, and metadata into a portable .json.gz file. Lossless round-trip
|
|
4
4
|
* with importProject.ts. Format version 1.
|
|
5
5
|
*/
|
|
6
|
-
import { GnosysDB, DbMemory, DbProject, DbRelationship, DbAuditEntry } from "./db.js";
|
|
6
|
+
import type { GnosysDB, DbMemory, DbProject, DbRelationship, DbAuditEntry } from "./db.js";
|
|
7
7
|
export declare const BUNDLE_FORMAT = "gnosys-project-bundle";
|
|
8
8
|
export declare const BUNDLE_VERSION = 1;
|
|
9
|
-
|
|
9
|
+
interface BundleManifest {
|
|
10
10
|
format: typeof BUNDLE_FORMAT;
|
|
11
11
|
version: number;
|
|
12
12
|
created: string;
|
|
@@ -38,6 +38,7 @@ export interface ExportProjectOptions {
|
|
|
38
38
|
export interface ExportProjectResult {
|
|
39
39
|
outputPath: string;
|
|
40
40
|
memoryCount: number;
|
|
41
|
+
archivedExcluded: number;
|
|
41
42
|
relationshipCount: number;
|
|
42
43
|
auditEntryCount: number;
|
|
43
44
|
uncompressedBytes: number;
|
|
@@ -48,4 +49,4 @@ export interface ExportProjectResult {
|
|
|
48
49
|
* Bundle is fully self-contained — embeddings are base64-encoded inline.
|
|
49
50
|
*/
|
|
50
51
|
export declare function exportProject(db: GnosysDB, opts: ExportProjectOptions): ExportProjectResult;
|
|
51
|
-
|
|
52
|
+
export {};
|
|
@@ -31,6 +31,8 @@ export function exportProject(db, opts) {
|
|
|
31
31
|
throw new Error(`Project not found: ${opts.projectId}`);
|
|
32
32
|
}
|
|
33
33
|
const rawMemories = db.getMemoriesByProject(opts.projectId, !!opts.includeArchived);
|
|
34
|
+
const totalIncludingArchived = db.getMemoriesByProject(opts.projectId, true).length;
|
|
35
|
+
const archivedExcluded = opts.includeArchived ? 0 : totalIncludingArchived - rawMemories.length;
|
|
34
36
|
const memories = rawMemories.map((m) => {
|
|
35
37
|
const { embedding: _embedding, ...rest } = m;
|
|
36
38
|
return {
|
|
@@ -63,10 +65,10 @@ export function exportProject(db, opts) {
|
|
|
63
65
|
return {
|
|
64
66
|
outputPath: opts.outputPath,
|
|
65
67
|
memoryCount: memories.length,
|
|
68
|
+
archivedExcluded,
|
|
66
69
|
relationshipCount: relationships.length,
|
|
67
70
|
auditEntryCount: audit_log.length,
|
|
68
71
|
uncompressedBytes: Buffer.byteLength(json, "utf-8"),
|
|
69
72
|
compressedBytes: compressed.length,
|
|
70
73
|
};
|
|
71
74
|
}
|
|
72
|
-
//# sourceMappingURL=exportProject.js.map
|
package/dist/lib/federated.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Tier boosting order: project (1.5x) > user (1.0x) > global (0.7x)
|
|
9
9
|
* Recency boost: memories accessed/modified in the last 24h get a 1.3x boost
|
|
10
10
|
*/
|
|
11
|
-
import { GnosysDB, DbMemory, MemoryScope } from "./db.js";
|
|
11
|
+
import type { GnosysDB, DbMemory, MemoryScope } from "./db.js";
|
|
12
12
|
import { type MachineConfig } from "./machineConfig.js";
|
|
13
13
|
export interface FederatedResult {
|
|
14
14
|
id: string;
|
|
@@ -111,4 +111,3 @@ export declare function getWorkingSet(db: GnosysDB, projectId: string, opts?: {
|
|
|
111
111
|
* Format the working set as a concise context block for agent consumption.
|
|
112
112
|
*/
|
|
113
113
|
export declare function formatWorkingSet(memories: DbMemory[]): string;
|
|
114
|
-
//# sourceMappingURL=federated.d.ts.map
|
package/dist/lib/federated.js
CHANGED
package/dist/lib/fileDetect.d.ts
CHANGED
package/dist/lib/fileDetect.js
CHANGED
package/dist/lib/graph.d.ts
CHANGED
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
* Fully regeneratable sidecar file. Parses all [[wikilinks]] from memories
|
|
4
4
|
* and builds a JSON graph with nodes, edges, and stats.
|
|
5
5
|
*/
|
|
6
|
-
import { GnosysResolver } from "./resolver.js";
|
|
7
|
-
|
|
6
|
+
import type { GnosysResolver } from "./resolver.js";
|
|
7
|
+
interface GraphNode {
|
|
8
8
|
id: string;
|
|
9
9
|
title: string;
|
|
10
10
|
edges: number;
|
|
11
11
|
outgoing: number;
|
|
12
12
|
incoming: number;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
interface GraphEdge {
|
|
15
15
|
source: string;
|
|
16
16
|
target: string;
|
|
17
17
|
label: string;
|
|
@@ -47,4 +47,4 @@ export declare function loadGraph(storePath: string): Promise<GraphJSON | null>;
|
|
|
47
47
|
* Format graph stats for display.
|
|
48
48
|
*/
|
|
49
49
|
export declare function formatGraphStats(stats: GraphStats): string;
|
|
50
|
-
|
|
50
|
+
export {};
|
package/dist/lib/graph.js
CHANGED