@mdfriday/foundry 26.4.20 → 26.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/obsidian/mobile.js +1 -1
- package/dist/cjs/worker/pool-manager.js +2 -2
- package/dist/cjs/worker/worker-node.js +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/obsidian/mobile.js +1 -1
- package/dist/types/internal/application/batch-task-queue.d.ts +17 -0
- package/dist/types/internal/application/container.d.ts +66 -0
- package/dist/types/internal/application/identity.d.ts +173 -0
- package/dist/types/internal/application/incremental-build-coordinator.d.ts +28 -0
- package/dist/types/internal/application/incremental-ssg.d.ts +4 -0
- package/dist/types/internal/application/index.d.ts +5 -4
- package/dist/types/internal/application/publish.d.ts +37 -0
- package/dist/types/internal/application/ssg-parallel.d.ts +6 -0
- package/dist/types/internal/application/ssg.d.ts +15 -0
- package/dist/types/internal/application/wiki-service-config.d.ts +65 -0
- package/dist/types/internal/application/wiki-service.d.ts +199 -0
- package/dist/types/internal/application/worker/pool-manager.d.ts +43 -0
- package/dist/types/internal/application/worker/worker-browser.d.ts +6 -0
- package/dist/types/internal/application/worker/worker-main.d.ts +12 -0
- package/dist/types/internal/application/worker/worker-state.d.ts +23 -0
- package/dist/types/internal/application/workspace.d.ts +98 -0
- package/dist/types/internal/domain/config/entity/config.d.ts +40 -0
- package/dist/types/internal/domain/config/entity/language.d.ts +51 -0
- package/dist/types/internal/domain/config/entity/markdown.d.ts +36 -0
- package/dist/types/internal/domain/config/entity/module.d.ts +36 -0
- package/dist/types/internal/domain/config/entity/root.d.ts +39 -0
- package/dist/types/internal/domain/config/entity/service.d.ts +36 -0
- package/dist/types/internal/domain/config/entity/social.d.ts +43 -0
- package/dist/types/internal/domain/config/entity/taxonomy.d.ts +39 -0
- package/dist/types/internal/domain/config/factory/config.d.ts +3 -0
- package/dist/types/internal/domain/config/factory/loader.d.ts +24 -0
- package/dist/types/internal/domain/config/factory/provider.d.ts +10 -0
- package/dist/types/internal/domain/config/factory/sourcedescriptor.d.ts +12 -0
- package/dist/types/internal/domain/config/type.d.ts +56 -0
- package/dist/types/internal/domain/config/vo/language.d.ts +6 -0
- package/dist/types/internal/domain/config/vo/markdown.d.ts +13 -0
- package/dist/types/internal/domain/config/vo/module.d.ts +9 -0
- package/dist/types/internal/domain/config/vo/root.d.ts +6 -0
- package/dist/types/internal/domain/config/vo/service.d.ts +6 -0
- package/dist/types/internal/domain/config/vo/social.d.ts +16 -0
- package/dist/types/internal/domain/config/vo/taxonomy.d.ts +12 -0
- package/dist/types/internal/domain/content/entity/content.d.ts +36 -0
- package/dist/types/internal/domain/content/entity/page.d.ts +23 -0
- package/dist/types/internal/domain/content/entity/pagebuilder.d.ts +83 -0
- package/dist/types/internal/domain/content/entity/pagecollector.d.ts +3 -0
- package/dist/types/internal/domain/content/entity/pagecontent.d.ts +14 -0
- package/dist/types/internal/domain/content/entity/pagemap.d.ts +69 -0
- package/dist/types/internal/domain/content/entity/pagesource.d.ts +52 -0
- package/dist/types/internal/domain/content/entity/pagetrees.d.ts +12 -0
- package/dist/types/internal/domain/content/entity/paginator.d.ts +19 -0
- package/dist/types/internal/domain/content/entity/section.d.ts +15 -0
- package/dist/types/internal/domain/content/entity/shortcode.d.ts +39 -0
- package/dist/types/internal/domain/content/entity/standalone.d.ts +9 -0
- package/dist/types/internal/domain/content/entity/taxonomy.d.ts +15 -0
- package/dist/types/internal/domain/content/entity/term.d.ts +6 -0
- package/dist/types/internal/domain/content/entity/translator.d.ts +22 -0
- package/dist/types/internal/domain/content/type.d.ts +6 -0
- package/dist/types/internal/domain/content/vo/classifier.d.ts +24 -0
- package/dist/types/internal/domain/content/vo/frontmatter.d.ts +65 -0
- package/dist/types/internal/domain/content/vo/kind.d.ts +10 -0
- package/dist/types/internal/domain/fs/entity/basefs.d.ts +23 -0
- package/dist/types/internal/domain/fs/entity/fs.d.ts +13 -0
- package/dist/types/internal/domain/fs/entity/originfs.d.ts +6 -0
- package/dist/types/internal/domain/fs/entity/overlaydir.d.ts +44 -0
- package/dist/types/internal/domain/fs/entity/overlayfs.d.ts +79 -0
- package/dist/types/internal/domain/fs/entity/service.d.ts +15 -0
- package/dist/types/internal/domain/fs/factory/fs.d.ts +4 -0
- package/dist/types/internal/domain/fs/type.d.ts +95 -0
- package/dist/types/internal/domain/fs/vo/dir.d.ts +41 -0
- package/dist/types/internal/domain/fs/vo/file.d.ts +28 -0
- package/dist/types/internal/domain/fs/vo/fileinfo.d.ts +23 -0
- package/dist/types/internal/domain/fs/vo/filemeta.d.ts +45 -0
- package/dist/types/internal/domain/fs/vo/filesystemscollector.d.ts +17 -0
- package/dist/types/internal/domain/fs/vo/filevitural.d.ts +8 -0
- package/dist/types/internal/domain/fs/vo/osfs.d.ts +12 -0
- package/dist/types/internal/domain/fs/vo/overlay-factory.d.ts +4 -0
- package/dist/types/internal/domain/fs/vo/overlayfs-factory.d.ts +42 -0
- package/dist/types/internal/domain/fs/vo/overlayoptions.d.ts +44 -0
- package/dist/types/internal/domain/fs/vo/static-copier.d.ts +22 -0
- package/dist/types/internal/domain/fs/vo/walkway.d.ts +22 -0
- package/dist/types/internal/domain/identity/entity/user.d.ts +100 -0
- package/dist/types/internal/domain/identity/factory/user-factory.d.ts +183 -0
- package/dist/types/internal/domain/identity/repository/index.d.ts +30 -0
- package/dist/types/internal/domain/identity/type.d.ts +17 -0
- package/dist/types/internal/domain/identity/value-object/device.d.ts +26 -0
- package/dist/types/internal/domain/identity/value-object/email.d.ts +29 -0
- package/dist/types/internal/domain/identity/value-object/license.d.ts +91 -0
- package/dist/types/internal/domain/identity/value-object/server-config.d.ts +37 -0
- package/dist/types/internal/domain/identity/value-object/sync-config.d.ts +47 -0
- package/dist/types/internal/domain/identity/value-object/token.d.ts +35 -0
- package/dist/types/internal/domain/markdown/entity/markdown.d.ts +41 -0
- package/dist/types/internal/domain/markdown/factory/it/config.d.ts +60 -0
- package/dist/types/internal/domain/markdown/factory/it/index.d.ts +21 -1
- package/dist/types/internal/domain/markdown/factory/it/parserresult.d.ts +3 -0
- package/dist/types/internal/domain/markdown/factory/it/plugins/callout-plugin.d.ts +40 -0
- package/dist/types/internal/domain/markdown/factory/it/plugins/latex-plugin.d.ts +23 -0
- package/dist/types/internal/domain/markdown/factory/it/plugins/mermaid-plugin.d.ts +24 -0
- package/dist/types/internal/domain/markdown/factory/it/plugins/tag-plugin.d.ts +71 -0
- package/dist/types/internal/domain/markdown/factory/it/plugins/wikilink-plugin.d.ts +28 -0
- package/dist/types/internal/domain/markdown/factory/it/plugins/wikilink.d.ts +31 -0
- package/dist/types/internal/domain/markdown/factory/it/tableofcontents.d.ts +21 -0
- package/dist/types/internal/domain/markdown/factory/it/util/path.d.ts +11 -0
- package/dist/types/internal/domain/markdown/factory/it/util/slugger-fallback.d.ts +6 -0
- package/dist/types/internal/domain/markdown/type.d.ts +159 -0
- package/dist/types/internal/domain/markdown/vo/config.d.ts +48 -0
- package/dist/types/internal/domain/markdown/vo/content.d.ts +92 -0
- package/dist/types/internal/domain/markdown/vo/context.d.ts +9 -0
- package/dist/types/internal/domain/markdown/vo/highlight.d.ts +15 -0
- package/dist/types/internal/domain/markdown/vo/pageparser.d.ts +9 -0
- package/dist/types/internal/domain/markdown/vo/parseinfo.d.ts +36 -0
- package/dist/types/internal/domain/markdown/vo/parserresult.d.ts +6 -0
- package/dist/types/internal/domain/markdown/vo/shortcode.d.ts +31 -1
- package/dist/types/internal/domain/markdown/vo/tableofcontents.d.ts +21 -0
- package/dist/types/internal/domain/module/entity/lang.d.ts +12 -0
- package/dist/types/internal/domain/module/entity/module.d.ts +73 -0
- package/dist/types/internal/domain/module/factory/module.d.ts +6 -0
- package/dist/types/internal/domain/module/type.d.ts +58 -0
- package/dist/types/internal/domain/module/vo/cache.d.ts +48 -0
- package/dist/types/internal/domain/module/vo/httpclient.d.ts +14 -0
- package/dist/types/internal/domain/module/vo/module.d.ts +76 -0
- package/dist/types/internal/domain/module/vo/mount.d.ts +39 -0
- package/dist/types/internal/domain/module/vo/themes.d.ts +38 -0
- package/dist/types/internal/domain/module/vo/zipextractor.d.ts +31 -0
- package/dist/types/internal/domain/paths/entity/path.d.ts +28 -0
- package/dist/types/internal/domain/paths/factory/pathfactory.d.ts +82 -0
- package/dist/types/internal/domain/paths/type.d.ts +132 -0
- package/dist/types/internal/domain/paths/vo/pathcomponents.d.ts +94 -0
- package/dist/types/internal/domain/paths/vo/pathparser.d.ts +77 -0
- package/dist/types/internal/domain/publish/entity/publisher.d.ts +26 -0
- package/dist/types/internal/domain/publish/factory/publisher-factory.d.ts +17 -0
- package/dist/types/internal/domain/publish/repository/http-client.d.ts +21 -0
- package/dist/types/internal/domain/publish/repository/manifest-repository.d.ts +27 -0
- package/dist/types/internal/domain/publish/type.d.ts +49 -0
- package/dist/types/internal/domain/publish/value-object/ftp-publisher.d.ts +30 -0
- package/dist/types/internal/domain/publish/value-object/mdfriday-publisher.d.ts +57 -0
- package/dist/types/internal/domain/publish/value-object/netlify-publisher.d.ts +55 -0
- package/dist/types/internal/domain/publish/value-object/publish-config.d.ts +38 -0
- package/dist/types/internal/domain/publish/value-object/publish-manifest.d.ts +50 -0
- package/dist/types/internal/domain/resources/entity/http.d.ts +11 -0
- package/dist/types/internal/domain/resources/entity/integrity.d.ts +4 -0
- package/dist/types/internal/domain/resources/entity/minifier.d.ts +4 -0
- package/dist/types/internal/domain/resources/entity/publisher.d.ts +24 -0
- package/dist/types/internal/domain/resources/entity/resource.d.ts +4 -0
- package/dist/types/internal/domain/resources/entity/resources.d.ts +40 -0
- package/dist/types/internal/domain/resources/entity/template.d.ts +4 -0
- package/dist/types/internal/domain/resources/factory/resource.d.ts +4 -0
- package/dist/types/internal/domain/site/entity/language.d.ts +55 -0
- package/dist/types/internal/domain/site/entity/menu-builder.d.ts +50 -0
- package/dist/types/internal/domain/site/entity/navigation.d.ts +8 -0
- package/dist/types/internal/domain/site/entity/page.d.ts +88 -0
- package/dist/types/internal/domain/site/entity/pagegraph.d.ts +85 -0
- package/dist/types/internal/domain/site/entity/pager.d.ts +6 -0
- package/dist/types/internal/domain/site/entity/publisher.d.ts +26 -0
- package/dist/types/internal/domain/site/entity/ref.d.ts +27 -0
- package/dist/types/internal/domain/site/entity/site.d.ts +178 -0
- package/dist/types/internal/domain/site/factory/navigation-factory.d.ts +6 -0
- package/dist/types/internal/domain/site/factory/site.d.ts +4 -0
- package/dist/types/internal/domain/site/service/html-link-processor.d.ts +44 -0
- package/dist/types/internal/domain/site/type.d.ts +100 -0
- package/dist/types/internal/domain/site/valueobject/author.d.ts +16 -0
- package/dist/types/internal/domain/site/valueobject/baseurl.d.ts +39 -0
- package/dist/types/internal/domain/site/valueobject/menu.d.ts +49 -0
- package/dist/types/internal/domain/site/valueobject/organization.d.ts +37 -0
- package/dist/types/internal/domain/site/valueobject/path.d.ts +50 -0
- package/dist/types/internal/domain/site/valueobject/version.d.ts +14 -0
- package/dist/types/internal/domain/template/entity/executor.d.ts +22 -0
- package/dist/types/internal/domain/template/entity/lookup.d.ts +55 -0
- package/dist/types/internal/domain/template/entity/parser.d.ts +40 -0
- package/dist/types/internal/domain/template/entity/template.d.ts +87 -0
- package/dist/types/internal/domain/template/factory/template.d.ts +61 -0
- package/dist/types/internal/domain/template/type.d.ts +109 -0
- package/dist/types/internal/domain/template/vo/baseof.d.ts +47 -0
- package/dist/types/internal/domain/template/vo/info.d.ts +28 -0
- package/dist/types/internal/domain/template/vo/namespace.d.ts +91 -0
- package/dist/types/internal/domain/template/vo/registry.d.ts +160 -0
- package/dist/types/internal/domain/wiki/entity/concept.d.ts +31 -0
- package/dist/types/internal/domain/wiki/entity/connection.d.ts +29 -0
- package/dist/types/internal/domain/wiki/entity/conversation.d.ts +65 -0
- package/dist/types/internal/domain/wiki/entity/embedding-index.d.ts +60 -0
- package/dist/types/internal/domain/wiki/entity/entity.d.ts +32 -0
- package/dist/types/internal/domain/wiki/entity/knowledge-base.d.ts +292 -0
- package/dist/types/internal/domain/wiki/entity/operation-log.d.ts +82 -0
- package/dist/types/internal/domain/wiki/factory/wiki-factory.d.ts +41 -0
- package/dist/types/internal/domain/wiki/index.d.ts +22 -0
- package/dist/types/internal/domain/wiki/repository/conversation-repository.interface.d.ts +29 -0
- package/dist/types/internal/domain/wiki/repository/crypto-service.d.ts +16 -0
- package/dist/types/internal/domain/wiki/repository/embedding-provider.d.ts +12 -0
- package/dist/types/internal/domain/wiki/repository/file-system.d.ts +43 -0
- package/dist/types/internal/domain/wiki/repository/index.d.ts +14 -0
- package/dist/types/internal/domain/wiki/repository/kb-repository.interface.d.ts +30 -0
- package/dist/types/internal/domain/wiki/repository/llm-http-client.d.ts +40 -0
- package/dist/types/internal/domain/wiki/repository/llm-provider.d.ts +34 -0
- package/dist/types/internal/domain/wiki/repository/path-service.d.ts +32 -0
- package/dist/types/internal/domain/wiki/repository/wiki-page-repository.interface.d.ts +49 -0
- package/dist/types/internal/domain/wiki/value-object/connection-type.d.ts +24 -0
- package/dist/types/internal/domain/wiki/value-object/content-annotator.d.ts +61 -0
- package/dist/types/internal/domain/wiki/value-object/entity-id.d.ts +17 -0
- package/dist/types/internal/domain/wiki/value-object/entity-type.d.ts +24 -0
- package/dist/types/internal/domain/wiki/value-object/extraction-parser.d.ts +27 -0
- package/dist/types/internal/domain/wiki/value-object/extraction-result.d.ts +32 -0
- package/dist/types/internal/domain/wiki/value-object/retrieval.d.ts +228 -0
- package/dist/types/internal/domain/wiki/value-object/source-record.d.ts +17 -0
- package/dist/types/internal/domain/wiki/value-object/wiki-config.d.ts +40 -0
- package/dist/types/internal/domain/wiki/value-object/wiki-index-generator.d.ts +31 -0
- package/dist/types/internal/domain/wiki/value-object/wiki-page-renderer.d.ts +42 -0
- package/dist/types/internal/domain/workspace/entity/authentication.d.ts +29 -0
- package/dist/types/internal/domain/workspace/entity/project.d.ts +173 -0
- package/dist/types/internal/domain/workspace/entity/workspace.d.ts +85 -0
- package/dist/types/internal/domain/workspace/factory/workspace-factory.d.ts +107 -0
- package/dist/types/internal/domain/workspace/repository/file-system.d.ts +241 -0
- package/dist/types/internal/domain/workspace/repository/index.d.ts +6 -0
- package/dist/types/internal/domain/workspace/repository.d.ts +72 -0
- package/dist/types/internal/domain/workspace/type.d.ts +18 -0
- package/dist/types/internal/domain/workspace/value-object/folder-structure.d.ts +41 -0
- package/dist/types/internal/domain/workspace/value-object/project-metadata.d.ts +36 -0
- package/dist/types/internal/domain/workspace/value-object/workspace-metadata.d.ts +7 -0
- package/dist/types/internal/infrastructure/embedding/embedding-provider.interface.d.ts +33 -0
- package/dist/types/internal/infrastructure/embedding/index.d.ts +5 -0
- package/dist/types/internal/infrastructure/embedding/ollama-embedding-provider.d.ts +24 -0
- package/dist/types/internal/infrastructure/http/netlify-http-client.d.ts +20 -0
- package/dist/types/internal/infrastructure/http/node-http-client.d.ts +3 -0
- package/dist/types/internal/infrastructure/index.d.ts +8 -0
- package/dist/types/internal/infrastructure/llm/fetch-http-client.d.ts +24 -0
- package/dist/types/internal/infrastructure/llm/index.d.ts +6 -0
- package/dist/types/internal/infrastructure/llm/llm-config.d.ts +80 -0
- package/dist/types/internal/infrastructure/llm/lmstudio-provider.d.ts +55 -0
- package/dist/types/internal/infrastructure/llm/node-llm-http-client.d.ts +21 -0
- package/dist/types/internal/infrastructure/llm/ollama-provider.d.ts +17 -0
- package/dist/types/internal/infrastructure/llm/openai-compatible-provider.d.ts +70 -0
- package/dist/types/internal/infrastructure/llm/provider-factory.d.ts +36 -0
- package/dist/types/internal/infrastructure/llm/provider.d.ts +77 -0
- package/dist/types/internal/infrastructure/node/index.d.ts +11 -0
- package/dist/types/internal/infrastructure/node/node-conversation-repository.d.ts +21 -0
- package/dist/types/internal/infrastructure/node/node-crypto-service.d.ts +10 -0
- package/dist/types/internal/infrastructure/node/node-file-system.d.ts +29 -0
- package/dist/types/internal/infrastructure/node/node-kb-repository.d.ts +18 -0
- package/dist/types/internal/infrastructure/node/node-path-service.d.ts +14 -0
- package/dist/types/internal/infrastructure/node/node-wiki-page-repository.d.ts +25 -0
- package/dist/types/internal/infrastructure/persistence/node-file-system.d.ts +8 -0
- package/dist/types/internal/infrastructure/persistence/node-manifest-repository.d.ts +31 -0
- package/dist/types/internal/infrastructure/persistence/node-snapshot-repository.d.ts +28 -0
- package/dist/types/internal/infrastructure/persistence/node-workspace-repository.d.ts +9 -0
- package/dist/types/pkg/cahce/cache.d.ts +56 -0
- package/dist/types/pkg/lang/data.d.ts +21 -0
- package/dist/types/pkg/lang/index.d.ts +46 -0
- package/dist/types/pkg/lang/service.d.ts +49 -0
- package/dist/types/pkg/lang/types.d.ts +29 -0
- package/dist/types/pkg/log/http.d.ts +16 -0
- package/dist/types/pkg/log/manager.d.ts +57 -0
- package/dist/types/pkg/maps/scratch.d.ts +25 -0
- package/dist/types/pkg/md/parser/item.d.ts +3 -3
- package/dist/types/pkg/media/type.d.ts +19 -0
- package/dist/types/pkg/page-filter/index.d.ts +29 -0
- package/dist/types/pkg/paths/index.d.ts +9 -0
- package/dist/types/pkg/text/index.d.ts +4 -0
- package/dist/types/pkg/web/server/livereload-server.d.ts +7 -0
- package/dist/types/pkg/web/watcher/content-file-watcher.d.ts +3 -0
- package/package.json +21 -15
- package/dist/types/index.d.ts +0 -20
- package/dist/types/internal/interfaces/obsidian/adapters/identity-adapter.d.ts +0 -5
- package/dist/types/internal/interfaces/obsidian/adapters/index.d.ts +0 -2
- package/dist/types/internal/interfaces/obsidian/adapters/workspace-adapter.d.ts +0 -8
- package/dist/types/internal/interfaces/obsidian/desktop/adapters/identity-adapter.d.ts +0 -6
- package/dist/types/internal/interfaces/obsidian/desktop/adapters/index.d.ts +0 -2
- package/dist/types/internal/interfaces/obsidian/desktop/adapters/workspace-adapter.d.ts +0 -12
- package/dist/types/internal/interfaces/obsidian/desktop/container.d.ts +0 -7
- package/dist/types/internal/interfaces/obsidian/desktop/index.d.ts +0 -22
- package/dist/types/internal/interfaces/obsidian/index.d.ts +0 -7
- package/dist/types/internal/interfaces/obsidian/mobile/adapters/identity-adapter.d.ts +0 -9
- package/dist/types/internal/interfaces/obsidian/mobile/adapters/index.d.ts +0 -2
- package/dist/types/internal/interfaces/obsidian/mobile/adapters/workspace-adapter.d.ts +0 -13
- package/dist/types/internal/interfaces/obsidian/mobile/config-types.d.ts +0 -13
- package/dist/types/internal/interfaces/obsidian/mobile/container.d.ts +0 -6
- package/dist/types/internal/interfaces/obsidian/mobile/index.d.ts +0 -16
- package/dist/types/internal/interfaces/obsidian/mobile.d.ts +0 -2
- package/dist/types/internal/interfaces/obsidian/services/auth.service.d.ts +0 -11
- package/dist/types/internal/interfaces/obsidian/services/build.service.d.ts +0 -9
- package/dist/types/internal/interfaces/obsidian/services/config.service.d.ts +0 -31
- package/dist/types/internal/interfaces/obsidian/services/domain.service.d.ts +0 -15
- package/dist/types/internal/interfaces/obsidian/services/license.service.d.ts +0 -22
- package/dist/types/internal/interfaces/obsidian/services/project.service.d.ts +0 -17
- package/dist/types/internal/interfaces/obsidian/services/publish.service.d.ts +0 -11
- package/dist/types/internal/interfaces/obsidian/services/serve.service.d.ts +0 -18
- package/dist/types/internal/interfaces/obsidian/services/workspace.service.d.ts +0 -10
- package/dist/types/internal/interfaces/obsidian/types/auth.d.ts +0 -27
- package/dist/types/internal/interfaces/obsidian/types/build.d.ts +0 -23
- package/dist/types/internal/interfaces/obsidian/types/config.d.ts +0 -16
- package/dist/types/internal/interfaces/obsidian/types/domain.d.ts +0 -46
- package/dist/types/internal/interfaces/obsidian/types/index.d.ts +0 -9
- package/dist/types/internal/interfaces/obsidian/types/license.d.ts +0 -87
- package/dist/types/internal/interfaces/obsidian/types/project.d.ts +0 -56
- package/dist/types/internal/interfaces/obsidian/types/publish.d.ts +0 -33
- package/dist/types/internal/interfaces/obsidian/types/serve.d.ts +0 -46
- package/dist/types/internal/interfaces/obsidian/types/workspace.d.ts +0 -27
- package/dist/types/pkg/log/browser-manager.d.ts +0 -20
- package/dist/types/pkg/log/browser.d.ts +0 -25
- package/dist/types/pkg/media/buildin.d.ts +0 -3
|
@@ -1,8 +1,28 @@
|
|
|
1
1
|
import { HttpClient, HttpResponse } from '@internal/domain/publish/repository/http-client';
|
|
2
|
+
/**
|
|
3
|
+
* Node.js HTTP Client for Netlify API
|
|
4
|
+
*
|
|
5
|
+
* 使用 native fetch 实现
|
|
6
|
+
*/
|
|
2
7
|
export declare class NetlifyHttpClient implements HttpClient {
|
|
8
|
+
/**
|
|
9
|
+
* POST JSON data
|
|
10
|
+
*/
|
|
3
11
|
postJSON(url: string, data: any, headers?: Record<string, string>): Promise<HttpResponse>;
|
|
12
|
+
/**
|
|
13
|
+
* POST multipart form data
|
|
14
|
+
*/
|
|
4
15
|
postMultipart(url: string, formData: Record<string, any>, headers?: Record<string, string>): Promise<HttpResponse>;
|
|
16
|
+
/**
|
|
17
|
+
* PUT binary data
|
|
18
|
+
*/
|
|
5
19
|
putBinary(url: string, data: Buffer | Uint8Array, headers?: Record<string, string>): Promise<HttpResponse>;
|
|
20
|
+
/**
|
|
21
|
+
* GET request
|
|
22
|
+
*/
|
|
6
23
|
get(url: string, headers?: Record<string, string>): Promise<HttpResponse>;
|
|
24
|
+
/**
|
|
25
|
+
* Create HttpResponse from fetch Response
|
|
26
|
+
*/
|
|
7
27
|
private createResponse;
|
|
8
28
|
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { HttpClient, HttpResponse } from '@internal/domain/identity/repository';
|
|
2
|
+
/**
|
|
3
|
+
* Node.js HTTP Client implementation using native fetch
|
|
4
|
+
*/
|
|
2
5
|
export declare class NodeHttpClient implements HttpClient {
|
|
3
6
|
post(url: string, data: any, headers?: Record<string, string>): Promise<HttpResponse>;
|
|
4
7
|
postForm(url: string, data: Record<string, string>): Promise<HttpResponse>;
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Infrastructure Layer Exports
|
|
3
|
+
*
|
|
4
|
+
* Provides concrete implementations of domain repositories
|
|
5
|
+
*/
|
|
1
6
|
export { NodeWorkspaceRepository, NodeProjectRepository, } from './persistence/node-workspace-repository';
|
|
2
7
|
export { NodeSnapshotRepository } from './persistence/node-snapshot-repository';
|
|
3
8
|
export { NodeFileSystemRepository } from './persistence/node-file-system';
|
|
4
9
|
export { NodeManifestRepository } from './persistence/node-manifest-repository';
|
|
5
10
|
export { NodeHttpClient } from './http/node-http-client';
|
|
6
11
|
export { NetlifyHttpClient } from './http/netlify-http-client';
|
|
12
|
+
export * from './llm';
|
|
13
|
+
export * from './embedding';
|
|
14
|
+
export * from './node';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fetch HTTP Client Implementation
|
|
3
|
+
*
|
|
4
|
+
* 基于浏览器/Node.js 原生 fetch API 的 LLMHttpClient 实现
|
|
5
|
+
*
|
|
6
|
+
* 用途:
|
|
7
|
+
* - 默认实现:当外部未提供 httpClient 时使用
|
|
8
|
+
* - Node.js 环境:CLI、测试等场景
|
|
9
|
+
* - 浏览器环境:支持 CORS 的场景
|
|
10
|
+
*
|
|
11
|
+
* 注意:
|
|
12
|
+
* - Obsidian 环境中访问本地服务(如 LM Studio)会遇到 CORS 问题
|
|
13
|
+
* - Obsidian Plugin 应该提供自定义实现(使用 Electron net 模块)
|
|
14
|
+
*/
|
|
15
|
+
import type { LLMHttpClient, LLMHttpRequest, LLMHttpResponse } from '@internal/domain/wiki/repository/llm-http-client';
|
|
16
|
+
export declare class FetchHttpClient implements LLMHttpClient {
|
|
17
|
+
fetch(request: LLMHttpRequest): Promise<LLMHttpResponse>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 创建默认的 HTTP Client
|
|
21
|
+
*
|
|
22
|
+
* @returns FetchHttpClient 实例
|
|
23
|
+
*/
|
|
24
|
+
export declare function createDefaultLLMHttpClient(): LLMHttpClient;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LLM 服务配置
|
|
3
|
+
*
|
|
4
|
+
* 统一管理不同的 LLM 服务配置:
|
|
5
|
+
* - 本地服务(LM Studio, Ollama)
|
|
6
|
+
* - 云端服务(OpenAI, GLM, DeepSeek, Moonshot)
|
|
7
|
+
* - Embedding 服务(可选,独立配置)
|
|
8
|
+
*/
|
|
9
|
+
export type LLMServiceType = 'lmstudio' | 'ollama' | 'openai' | 'glm' | 'deepseek' | 'moonshot' | 'custom';
|
|
10
|
+
export interface LLMServiceConfig {
|
|
11
|
+
/**
|
|
12
|
+
* 服务类型
|
|
13
|
+
*/
|
|
14
|
+
type: LLMServiceType;
|
|
15
|
+
/**
|
|
16
|
+
* Base URL
|
|
17
|
+
*/
|
|
18
|
+
baseURL: string;
|
|
19
|
+
/**
|
|
20
|
+
* API Key (optional)
|
|
21
|
+
*/
|
|
22
|
+
apiKey?: string;
|
|
23
|
+
/**
|
|
24
|
+
* 默认模型名称
|
|
25
|
+
*/
|
|
26
|
+
defaultModel?: string;
|
|
27
|
+
/**
|
|
28
|
+
* 自定义 headers
|
|
29
|
+
*/
|
|
30
|
+
customHeaders?: Record<string, string>;
|
|
31
|
+
}
|
|
32
|
+
export interface EmbeddingServiceConfig {
|
|
33
|
+
/**
|
|
34
|
+
* 服务类型
|
|
35
|
+
* 注意:moonshot 不官方提供 embedding 服务,请谨慎使用
|
|
36
|
+
*/
|
|
37
|
+
type: 'lmstudio' | 'ollama' | 'openai' | 'glm' | 'deepseek' | 'moonshot' | 'custom' | 'none';
|
|
38
|
+
/**
|
|
39
|
+
* Base URL
|
|
40
|
+
*/
|
|
41
|
+
baseURL?: string;
|
|
42
|
+
/**
|
|
43
|
+
* API Key (optional)
|
|
44
|
+
*/
|
|
45
|
+
apiKey?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Embedding 模型名称
|
|
48
|
+
*/
|
|
49
|
+
model?: string;
|
|
50
|
+
}
|
|
51
|
+
export interface WikiLLMConfig {
|
|
52
|
+
/**
|
|
53
|
+
* 主 LLM 服务(用于知识提取和查询)
|
|
54
|
+
*/
|
|
55
|
+
llm: LLMServiceConfig;
|
|
56
|
+
/**
|
|
57
|
+
* Embedding 服务(用于语义检索,可选)
|
|
58
|
+
*/
|
|
59
|
+
embedding?: EmbeddingServiceConfig;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* 预设配置
|
|
63
|
+
*/
|
|
64
|
+
export declare const LLM_PRESETS: Record<string, LLMServiceConfig>;
|
|
65
|
+
export declare const EMBEDDING_PRESETS: Record<string, EmbeddingServiceConfig>;
|
|
66
|
+
/**
|
|
67
|
+
* 从环境变量加载配置
|
|
68
|
+
*/
|
|
69
|
+
export declare function loadLLMConfigFromEnv(): WikiLLMConfig;
|
|
70
|
+
/**
|
|
71
|
+
* 验证配置
|
|
72
|
+
*/
|
|
73
|
+
export declare function validateLLMConfig(config: WikiLLMConfig): {
|
|
74
|
+
valid: boolean;
|
|
75
|
+
errors: string[];
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* 打印配置信息(隐藏敏感信息)
|
|
79
|
+
*/
|
|
80
|
+
export declare function printLLMConfig(config: WikiLLMConfig): string;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenAI-Compatible Embedding + LLM Provider
|
|
3
|
+
*
|
|
4
|
+
* 实现了所有兼容 OpenAI API 的服务的 Embedding 能力:
|
|
5
|
+
* - LM Studio (本地, http://localhost:1234/v1)
|
|
6
|
+
* - OpenAI (https://api.openai.com/v1)
|
|
7
|
+
* - GLM/智谱 (https://open.bigmodel.cn/api/paas/v4)
|
|
8
|
+
* - DeepSeek (https://api.deepseek.com/v1)
|
|
9
|
+
* - Moonshot (https://api.moonshot.cn/v1)
|
|
10
|
+
* - 其他兼容服务 (custom)
|
|
11
|
+
*
|
|
12
|
+
* Embedding API 格式: POST /embeddings { model, input }
|
|
13
|
+
* Chat API 格式: POST /chat/completions (SSE 或非流式)
|
|
14
|
+
*
|
|
15
|
+
* 导出别名 OpenAICompatibleEmbeddingProvider,推荐新代码使用此名称。
|
|
16
|
+
* LMStudioProvider 保留为兼容旧代码。
|
|
17
|
+
*/
|
|
18
|
+
import { ILLMProvider, LLMConfig, LLMStreamChunk } from './provider';
|
|
19
|
+
import { IEmbeddingProvider } from '../embedding/embedding-provider.interface';
|
|
20
|
+
import type { LLMHttpClient } from '@internal/domain/wiki/repository/llm-http-client';
|
|
21
|
+
/**
|
|
22
|
+
* OpenAI-compatible provider for both Chat Completions and Embeddings.
|
|
23
|
+
*
|
|
24
|
+
* Exported as both `OpenAICompatibleEmbeddingProvider` (preferred) and
|
|
25
|
+
* the legacy `LMStudioProvider` alias.
|
|
26
|
+
*/
|
|
27
|
+
export declare class OpenAICompatibleEmbeddingProvider implements ILLMProvider, IEmbeddingProvider {
|
|
28
|
+
private baseURL;
|
|
29
|
+
private apiKey?;
|
|
30
|
+
readonly name: string;
|
|
31
|
+
private embeddingModel;
|
|
32
|
+
private httpClient;
|
|
33
|
+
constructor(baseURL?: string, embeddingModel?: string, httpClient?: LLMHttpClient, apiKey?: string | undefined, providerName?: string);
|
|
34
|
+
/** Infer a readable name from the base URL (for error messages). */
|
|
35
|
+
private inferProviderName;
|
|
36
|
+
/** Build Authorization header when an API key is configured. */
|
|
37
|
+
private buildHeaders;
|
|
38
|
+
complete(prompt: string, config: LLMConfig, signal?: AbortSignal): AsyncIterable<LLMStreamChunk>;
|
|
39
|
+
completeSync(prompt: string, config: LLMConfig, signal?: AbortSignal): Promise<string>;
|
|
40
|
+
/**
|
|
41
|
+
* Domain IEmbeddingProvider contract: generateEmbedding(text, model).
|
|
42
|
+
* Bridges to the infrastructure embed() method.
|
|
43
|
+
*/
|
|
44
|
+
generateEmbedding(text: string, model: string): Promise<number[]>;
|
|
45
|
+
embed(request: {
|
|
46
|
+
text: string;
|
|
47
|
+
model?: string;
|
|
48
|
+
signal?: AbortSignal;
|
|
49
|
+
}): Promise<number[]>;
|
|
50
|
+
embedBatch(texts: string[]): Promise<number[][]>;
|
|
51
|
+
healthCheck(): Promise<boolean>;
|
|
52
|
+
}
|
|
53
|
+
/** @deprecated Use OpenAICompatibleEmbeddingProvider instead */
|
|
54
|
+
export declare const LMStudioProvider: typeof OpenAICompatibleEmbeddingProvider;
|
|
55
|
+
export type LMStudioProvider = OpenAICompatibleEmbeddingProvider;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node.js LLM HTTP Client Implementation
|
|
3
|
+
*
|
|
4
|
+
* 基于 Node.js 原生 fetch API 的 LLMHttpClient 实现
|
|
5
|
+
* 用于测试和 CLI 环境
|
|
6
|
+
*
|
|
7
|
+
* 注意:这是 FetchHttpClient 的别名,用于明确表示 Node.js 环境
|
|
8
|
+
*/
|
|
9
|
+
import { FetchHttpClient } from './fetch-http-client';
|
|
10
|
+
import type { LLMHttpClient } from '@internal/domain/wiki/repository/llm-http-client';
|
|
11
|
+
/**
|
|
12
|
+
* Node.js HTTP Client for LLM
|
|
13
|
+
*
|
|
14
|
+
* 使用原生 fetch API(Node.js 18+ 内置支持)
|
|
15
|
+
*/
|
|
16
|
+
export declare class NodeLLMHttpClient extends FetchHttpClient implements LLMHttpClient {
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* 创建 Node.js LLM HTTP Client
|
|
20
|
+
*/
|
|
21
|
+
export declare function createNodeLLMHttpClient(): LLMHttpClient;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ollama Provider Implementation
|
|
3
|
+
*
|
|
4
|
+
* Ollama 本地模型服务
|
|
5
|
+
* 默认端口: http://localhost:11434
|
|
6
|
+
*/
|
|
7
|
+
import { ILLMProvider, LLMConfig, LLMStreamChunk } from './provider';
|
|
8
|
+
export declare class OllamaProvider implements ILLMProvider {
|
|
9
|
+
private baseURL;
|
|
10
|
+
readonly name = "Ollama";
|
|
11
|
+
constructor(baseURL?: string);
|
|
12
|
+
complete(prompt: string, config: LLMConfig, signal?: AbortSignal): AsyncIterable<LLMStreamChunk>;
|
|
13
|
+
private completeWithChat;
|
|
14
|
+
private completeWithGenerate;
|
|
15
|
+
completeSync(prompt: string, config: LLMConfig, signal?: AbortSignal): Promise<string>;
|
|
16
|
+
healthCheck(): Promise<boolean>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 通用 OpenAI-Compatible Provider
|
|
3
|
+
*
|
|
4
|
+
* 支持所有兼容 OpenAI API 的服务:
|
|
5
|
+
* - OpenAI
|
|
6
|
+
* - GLM (智谱AI)
|
|
7
|
+
* - DeepSeek
|
|
8
|
+
* - Moonshot (Kimi)
|
|
9
|
+
* - LM Studio
|
|
10
|
+
* - Ollama (通过 OpenAI API)
|
|
11
|
+
* - 其他兼容服务
|
|
12
|
+
*/
|
|
13
|
+
import { ILLMProvider, LLMConfig, LLMStreamChunk } from './provider';
|
|
14
|
+
import type { LLMHttpClient } from '@internal/domain/wiki/repository/llm-http-client';
|
|
15
|
+
export interface OpenAICompatibleConfig {
|
|
16
|
+
/**
|
|
17
|
+
* API Base URL
|
|
18
|
+
* - OpenAI: https://api.openai.com/v1
|
|
19
|
+
* - GLM: https://open.bigmodel.cn/api/paas/v4
|
|
20
|
+
* - DeepSeek: https://api.deepseek.com/v1
|
|
21
|
+
* - Moonshot: https://api.moonshot.cn/v1
|
|
22
|
+
* - LM Studio: http://localhost:1234/v1
|
|
23
|
+
*/
|
|
24
|
+
baseURL: string;
|
|
25
|
+
/**
|
|
26
|
+
* API Key (optional for local services)
|
|
27
|
+
*/
|
|
28
|
+
apiKey?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Provider name for error messages
|
|
31
|
+
*/
|
|
32
|
+
providerName?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Default model name
|
|
35
|
+
*/
|
|
36
|
+
defaultModel?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Custom headers
|
|
39
|
+
*/
|
|
40
|
+
customHeaders?: Record<string, string>;
|
|
41
|
+
/**
|
|
42
|
+
* HTTP Client (optional, defaults to fetch)
|
|
43
|
+
*/
|
|
44
|
+
httpClient?: LLMHttpClient;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* OpenAI-Compatible Provider
|
|
48
|
+
*
|
|
49
|
+
* 通用实现,支持所有兼容 OpenAI Chat Completion API 的服务
|
|
50
|
+
*/
|
|
51
|
+
export declare class OpenAICompatibleProvider implements ILLMProvider {
|
|
52
|
+
readonly name: string;
|
|
53
|
+
private baseURL;
|
|
54
|
+
private apiKey?;
|
|
55
|
+
private defaultModel?;
|
|
56
|
+
private customHeaders;
|
|
57
|
+
private httpClient;
|
|
58
|
+
constructor(config: OpenAICompatibleConfig);
|
|
59
|
+
complete(prompt: string, config: LLMConfig, signal?: AbortSignal): AsyncIterable<LLMStreamChunk>;
|
|
60
|
+
completeSync(prompt: string, config: LLMConfig, signal?: AbortSignal): Promise<string>;
|
|
61
|
+
healthCheck(): Promise<boolean>;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* 预设配置工厂函数
|
|
65
|
+
*/
|
|
66
|
+
export declare function createOpenAIProvider(apiKey: string, model?: string, httpClient?: LLMHttpClient): OpenAICompatibleProvider;
|
|
67
|
+
export declare function createGLMProvider(apiKey: string, model?: string, httpClient?: LLMHttpClient): OpenAICompatibleProvider;
|
|
68
|
+
export declare function createDeepSeekProvider(apiKey: string, model?: string, httpClient?: LLMHttpClient): OpenAICompatibleProvider;
|
|
69
|
+
export declare function createMoonshotProvider(apiKey: string, model?: string, httpClient?: LLMHttpClient): OpenAICompatibleProvider;
|
|
70
|
+
export declare function createLMStudioProvider(baseURL?: string, model?: string, httpClient?: LLMHttpClient): OpenAICompatibleProvider;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LLM Provider Factory
|
|
3
|
+
*
|
|
4
|
+
* 根据配置创建对应的 Provider 实例
|
|
5
|
+
*/
|
|
6
|
+
import { ILLMProvider } from './provider';
|
|
7
|
+
import { IEmbeddingProvider } from '../embedding/embedding-provider.interface';
|
|
8
|
+
import { LLMServiceConfig, EmbeddingServiceConfig } from './llm-config';
|
|
9
|
+
import type { LLMHttpClient } from '@internal/domain/wiki/repository/llm-http-client';
|
|
10
|
+
/**
|
|
11
|
+
* 创建 LLM Provider
|
|
12
|
+
*/
|
|
13
|
+
export declare function createLLMProvider(config: LLMServiceConfig, httpClient?: LLMHttpClient): ILLMProvider;
|
|
14
|
+
/**
|
|
15
|
+
* 创建 Embedding Provider
|
|
16
|
+
*
|
|
17
|
+
* 除 Ollama 外,所有服务均使用 OpenAI 兼容的 /embeddings 端点
|
|
18
|
+
* (由 OpenAICompatibleEmbeddingProvider 实现)。
|
|
19
|
+
*
|
|
20
|
+
* 各服务默认 embedding 模型:
|
|
21
|
+
* lmstudio → text-embedding-nomic-embed-text-v2-moe
|
|
22
|
+
* ollama → nomic-embed-text (Ollama 原生 /api/embeddings)
|
|
23
|
+
* openai → text-embedding-3-small
|
|
24
|
+
* glm → embedding-3
|
|
25
|
+
* deepseek → deepseek-embedding (需确认模型名称是否可用)
|
|
26
|
+
* moonshot → moonshot-v1-embedding (非官方,请自行确认)
|
|
27
|
+
* custom → 由调用方指定
|
|
28
|
+
*/
|
|
29
|
+
export declare function createEmbeddingProvider(config?: EmbeddingServiceConfig, httpClient?: LLMHttpClient): IEmbeddingProvider | null;
|
|
30
|
+
/**
|
|
31
|
+
* 健康检查所有配置的服务
|
|
32
|
+
*/
|
|
33
|
+
export declare function healthCheckServices(llmProvider: ILLMProvider, embeddingProvider?: IEmbeddingProvider | null): Promise<{
|
|
34
|
+
llm: boolean;
|
|
35
|
+
embedding: boolean | null;
|
|
36
|
+
}>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LLM Provider Abstraction
|
|
3
|
+
*
|
|
4
|
+
* 提供统一的 LLM 调用接口,支持多种 Provider
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* LLM 流式响应块
|
|
8
|
+
*/
|
|
9
|
+
export interface LLMStreamChunk {
|
|
10
|
+
text: string;
|
|
11
|
+
done: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* LLM 配置
|
|
15
|
+
*/
|
|
16
|
+
export interface LLMConfig {
|
|
17
|
+
model: string;
|
|
18
|
+
temperature?: number;
|
|
19
|
+
maxTokens?: number;
|
|
20
|
+
apiKey?: string;
|
|
21
|
+
baseURL?: string;
|
|
22
|
+
systemMessage?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* LLM Provider 统一接口
|
|
26
|
+
*/
|
|
27
|
+
export interface ILLMProvider {
|
|
28
|
+
/**
|
|
29
|
+
* 流式完成
|
|
30
|
+
* @param prompt 提示词
|
|
31
|
+
* @param config LLM 配置
|
|
32
|
+
* @param signal 取消信号
|
|
33
|
+
*/
|
|
34
|
+
complete(prompt: string, config: LLMConfig, signal?: AbortSignal): AsyncIterable<LLMStreamChunk>;
|
|
35
|
+
/**
|
|
36
|
+
* 非流式完成(等待完整响应)
|
|
37
|
+
* @param prompt 提示词
|
|
38
|
+
* @param config LLM 配置
|
|
39
|
+
* @param signal 取消信号
|
|
40
|
+
*/
|
|
41
|
+
completeSync(prompt: string, config: LLMConfig, signal?: AbortSignal): Promise<string>;
|
|
42
|
+
/**
|
|
43
|
+
* 健康检查
|
|
44
|
+
*/
|
|
45
|
+
healthCheck(): Promise<boolean>;
|
|
46
|
+
/**
|
|
47
|
+
* Provider 名称
|
|
48
|
+
*/
|
|
49
|
+
readonly name: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* LLM 错误基类
|
|
53
|
+
*/
|
|
54
|
+
export declare class LLMError extends Error {
|
|
55
|
+
readonly provider: string;
|
|
56
|
+
constructor(message: string, provider: string);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* LLM 连接错误
|
|
60
|
+
*/
|
|
61
|
+
export declare class LLMConnectError extends LLMError {
|
|
62
|
+
constructor(provider: string, cause?: Error);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* LLM HTTP 错误
|
|
66
|
+
*/
|
|
67
|
+
export declare class LLMHttpError extends LLMError {
|
|
68
|
+
readonly status: number;
|
|
69
|
+
readonly statusText: string;
|
|
70
|
+
constructor(provider: string, status: number, statusText: string);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* LLM 取消错误
|
|
74
|
+
*/
|
|
75
|
+
export declare class LLMAbortError extends LLMError {
|
|
76
|
+
constructor(provider: string);
|
|
77
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node.js Infrastructure Implementations
|
|
3
|
+
*
|
|
4
|
+
* 统一导出所有 Node.js 环境的实现类
|
|
5
|
+
*/
|
|
6
|
+
export * from './node-file-system';
|
|
7
|
+
export * from './node-path-service';
|
|
8
|
+
export * from './node-crypto-service';
|
|
9
|
+
export * from './node-conversation-repository';
|
|
10
|
+
export * from './node-kb-repository';
|
|
11
|
+
export * from './node-wiki-page-repository';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node.js Conversation Repository Implementation
|
|
3
|
+
*
|
|
4
|
+
* 使用 IFileSystem 接口进行文件操作
|
|
5
|
+
* 调用 Conversation Entity 的方法来格式化内容
|
|
6
|
+
*/
|
|
7
|
+
import { IConversationRepository, SaveConversationOptions } from '../../domain/wiki/repository';
|
|
8
|
+
import { Conversation } from '../../domain/wiki/entity/conversation';
|
|
9
|
+
import { IFileSystem } from '../../domain/wiki/repository';
|
|
10
|
+
import { IPathService } from '../../domain/wiki/repository';
|
|
11
|
+
export declare class NodeConversationRepository implements IConversationRepository {
|
|
12
|
+
private readonly baseDir;
|
|
13
|
+
private readonly fileSystem;
|
|
14
|
+
private readonly pathService;
|
|
15
|
+
constructor(baseDir: string, fileSystem: IFileSystem, pathService: IPathService);
|
|
16
|
+
save(conversation: Conversation, options?: SaveConversationOptions): Promise<string>;
|
|
17
|
+
list(): Promise<Conversation[]>;
|
|
18
|
+
exists(conversationId: string): Promise<boolean>;
|
|
19
|
+
getFilePath(conversationId: string): string;
|
|
20
|
+
private ensureDirectory;
|
|
21
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node.js Crypto Service Implementation
|
|
3
|
+
*
|
|
4
|
+
* 实现 Domain 层定义的 ICryptoService 接口
|
|
5
|
+
*/
|
|
6
|
+
import { ICryptoService } from '@internal/domain/wiki/repository';
|
|
7
|
+
export declare class NodeCryptoService implements ICryptoService {
|
|
8
|
+
hash(content: string, algorithm: 'sha256' | 'md5'): string;
|
|
9
|
+
randomUUID(): string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node.js File System Implementation
|
|
3
|
+
*
|
|
4
|
+
* 实现 Domain 层定义的 IFileSystem 接口
|
|
5
|
+
*/
|
|
6
|
+
import { IFileSystem, FileStats } from '@internal/domain/wiki/repository';
|
|
7
|
+
export declare class NodeFileSystem implements IFileSystem {
|
|
8
|
+
readFile(path: string, encoding: string): Promise<string>;
|
|
9
|
+
writeFile(path: string, content: string, encoding: string): Promise<void>;
|
|
10
|
+
stat(path: string): Promise<FileStats>;
|
|
11
|
+
exists(path: string): Promise<boolean>;
|
|
12
|
+
mkdir(path: string, options?: {
|
|
13
|
+
recursive?: boolean;
|
|
14
|
+
}): Promise<void>;
|
|
15
|
+
readdir(path: string): Promise<string[]>;
|
|
16
|
+
unlink(path: string): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Synchronous version of exists (for backward compatibility)
|
|
19
|
+
*/
|
|
20
|
+
existsSync(path: string): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Synchronous version of readFile (for backward compatibility)
|
|
23
|
+
*/
|
|
24
|
+
readFileSync(path: string, encoding: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* Synchronous version of stat (for backward compatibility)
|
|
27
|
+
*/
|
|
28
|
+
statSync(path: string): FileStats;
|
|
29
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node.js JSON Knowledge Base Repository
|
|
3
|
+
*
|
|
4
|
+
* 使用 IFileSystem 和 IPathService 进行平台无关的文件操作
|
|
5
|
+
*/
|
|
6
|
+
import { IKBRepository, IFileSystem, IPathService } from '../../domain/wiki/repository';
|
|
7
|
+
import { KnowledgeBase } from '../../domain/wiki';
|
|
8
|
+
export declare class NodeKBRepository implements IKBRepository {
|
|
9
|
+
private readonly filePath;
|
|
10
|
+
private readonly fileSystem;
|
|
11
|
+
private readonly pathService;
|
|
12
|
+
constructor(filePath: string, fileSystem: IFileSystem, pathService: IPathService);
|
|
13
|
+
load(): Promise<KnowledgeBase | null>;
|
|
14
|
+
exists(): Promise<boolean>;
|
|
15
|
+
save(kb: KnowledgeBase): Promise<void>;
|
|
16
|
+
getLastModified(): Promise<number>;
|
|
17
|
+
getSize(): Promise<number>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node.js Path Service Implementation
|
|
3
|
+
*
|
|
4
|
+
* 实现 Domain 层定义的 IPathService 接口
|
|
5
|
+
*/
|
|
6
|
+
import { IPathService } from '@internal/domain/wiki/repository';
|
|
7
|
+
export declare class NodePathService implements IPathService {
|
|
8
|
+
join(...paths: string[]): string;
|
|
9
|
+
basename(p: string, ext?: string): string;
|
|
10
|
+
dirname(p: string): string;
|
|
11
|
+
relative(from: string, to: string): string;
|
|
12
|
+
resolve(...paths: string[]): string;
|
|
13
|
+
extname(p: string): string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node.js Markdown Wiki Page Repository
|
|
3
|
+
*
|
|
4
|
+
* 使用 IFileSystem 和 IPathService 进行平台无关的文件操作
|
|
5
|
+
*/
|
|
6
|
+
import { IWikiPageRepository, IFileSystem, IPathService } from '../../domain/wiki/repository';
|
|
7
|
+
export declare class NodeWikiPageRepository implements IWikiPageRepository {
|
|
8
|
+
private readonly baseDir;
|
|
9
|
+
private readonly fileSystem;
|
|
10
|
+
private readonly pathService;
|
|
11
|
+
private readonly wikiDir;
|
|
12
|
+
constructor(baseDir: string, fileSystem: IFileSystem, pathService: IPathService);
|
|
13
|
+
writePage(relativePath: string, content: string): Promise<void>;
|
|
14
|
+
deletePage(relativePath: string): Promise<void>;
|
|
15
|
+
writePages(pages: Map<string, string>): Promise<void>;
|
|
16
|
+
listPages(directory: string): Promise<string[]>;
|
|
17
|
+
appendToLog(entry: string): Promise<void>;
|
|
18
|
+
updateIndex(content: string): Promise<void>;
|
|
19
|
+
updateGlossary(content: string): Promise<void>;
|
|
20
|
+
exists(relativePath: string): Promise<boolean>;
|
|
21
|
+
/**
|
|
22
|
+
* 递归列出所有 .md 文件
|
|
23
|
+
*/
|
|
24
|
+
private listMarkdownFiles;
|
|
25
|
+
}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node.js FileSystem Implementation
|
|
3
|
+
*
|
|
4
|
+
* 实现 FileSystemRepository 接口
|
|
5
|
+
*/
|
|
1
6
|
import { FileSystemRepository, FolderScanResult, FolderStructure, SymlinkResult } from '@internal/domain/workspace/repository/file-system';
|
|
7
|
+
/**
|
|
8
|
+
* Node.js FileSystem Repository Implementation
|
|
9
|
+
*/
|
|
2
10
|
export declare class NodeFileSystemRepository implements FileSystemRepository {
|
|
3
11
|
exists(filePath: string): Promise<boolean>;
|
|
4
12
|
isDirectory(filePath: string): Promise<boolean>;
|
|
@@ -1,11 +1,42 @@
|
|
|
1
1
|
import { ManifestRepository } from '@internal/domain/publish';
|
|
2
2
|
import { PublishManifest } from '@internal/domain/publish';
|
|
3
|
+
/**
|
|
4
|
+
* Node.js Manifest Repository Implementation
|
|
5
|
+
*
|
|
6
|
+
* 使用文件系统存储 manifest
|
|
7
|
+
*/
|
|
3
8
|
export declare class NodeManifestRepository implements ManifestRepository {
|
|
9
|
+
/**
|
|
10
|
+
* Load manifest from file
|
|
11
|
+
*/
|
|
4
12
|
loadManifest(projectPath: string, publishMethod: 'ftp' | 'netlify' | 'mdfriday', suffix?: string): Promise<PublishManifest | null>;
|
|
13
|
+
/**
|
|
14
|
+
* Save manifest to file
|
|
15
|
+
*/
|
|
5
16
|
saveManifest(projectPath: string, manifest: PublishManifest, suffix?: string): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Generate manifest by scanning directory
|
|
19
|
+
*/
|
|
6
20
|
generateManifest(projectId: string, publicDir: string, publishMethod: 'ftp' | 'netlify' | 'mdfriday', remoteConfig?: any): Promise<PublishManifest>;
|
|
21
|
+
/**
|
|
22
|
+
* Delete manifest file
|
|
23
|
+
*/
|
|
7
24
|
deleteManifest(projectPath: string, publishMethod: 'ftp' | 'netlify' | 'mdfriday', suffix?: string): Promise<boolean>;
|
|
25
|
+
/**
|
|
26
|
+
* Get manifest file path
|
|
27
|
+
*
|
|
28
|
+
* @param projectPath
|
|
29
|
+
* @param publishMethod
|
|
30
|
+
* @param suffix - Optional suffix for manifest filename (e.g., 'free', 'custom')
|
|
31
|
+
* For mdfriday with different deploymentTypes
|
|
32
|
+
*/
|
|
8
33
|
private getManifestPath;
|
|
34
|
+
/**
|
|
35
|
+
* Recursively scan directory and collect file info
|
|
36
|
+
*/
|
|
9
37
|
private scanDirectory;
|
|
38
|
+
/**
|
|
39
|
+
* Calculate file hash (MD5 or SHA1)
|
|
40
|
+
*/
|
|
10
41
|
private calculateFileHash;
|
|
11
42
|
}
|