@mdfriday/foundry 26.4.20 → 26.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +236 -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 +310 -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 +24 -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 +20 -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 +40 -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/pricing.d.ts +64 -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/token-usage.d.ts +26 -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 +36 -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 +71 -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 +22 -0
- package/dist/types/internal/infrastructure/llm/openai-compatible-provider.d.ts +75 -0
- package/dist/types/internal/infrastructure/llm/provider-factory.d.ts +36 -0
- package/dist/types/internal/infrastructure/llm/provider.d.ts +90 -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
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wiki Service - Application Layer
|
|
3
|
+
*
|
|
4
|
+
* 重构后的应用服务,遵循 DDD 架构:
|
|
5
|
+
* - 持有 WikiFactory 和统一配置
|
|
6
|
+
* - 通过 Factory 创建和加载 KB
|
|
7
|
+
* - 调用 KB 聚合根的业务方法
|
|
8
|
+
* - 协调依赖,不包含业务逻辑
|
|
9
|
+
* - 配置在创建时一次性传入,避免重复
|
|
10
|
+
*/
|
|
11
|
+
import { KnowledgeBase, WikiFactory, ConversationMetadata, TokenUsage, CostBreakdown, MODEL_PRICING, ModelPricing } from '../domain/wiki';
|
|
12
|
+
import { WikiServiceConfig } from './wiki-service-config';
|
|
13
|
+
/**
|
|
14
|
+
* Ingest 可选配置(用于覆盖默认值)
|
|
15
|
+
*/
|
|
16
|
+
export interface IngestOptions {
|
|
17
|
+
temperature?: number;
|
|
18
|
+
/** LLM token 使用量回调:实体/概念提取完成后触发精确值(isEstimate: false) */
|
|
19
|
+
onIngestTokenUsage?: (usage: TokenUsage) => void;
|
|
20
|
+
/**
|
|
21
|
+
* 实时流式进度回调:每个 LLM chunk 到达时触发,携带累计 completionTokens 估算值。
|
|
22
|
+
* 提供此回调时,ingest 改用流式模式,实现逐 chunk 实时上报(isEstimate: true)。
|
|
23
|
+
*/
|
|
24
|
+
onIngestProgress?: (estimatedCompletionTokens: number) => void;
|
|
25
|
+
/** Embedding token 使用量回调:每次 embedding 调用完成后触发(构建索引时) */
|
|
26
|
+
onEmbeddingUsage?: (usage: TokenUsage) => void;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Query 可选配置(用于覆盖默认值)
|
|
30
|
+
*/
|
|
31
|
+
export interface QueryOptions {
|
|
32
|
+
temperature?: number;
|
|
33
|
+
maxResults?: number;
|
|
34
|
+
/** LLM token 使用量回调:在 LLM stream 完成时调用 */
|
|
35
|
+
onTokenUsage?: (usage: TokenUsage) => void;
|
|
36
|
+
/** Embedding token 使用量回调:query embedding 完成后调用 */
|
|
37
|
+
onEmbeddingUsage?: (usage: TokenUsage) => void;
|
|
38
|
+
}
|
|
39
|
+
export type { TokenUsage, CostBreakdown, ModelPricing };
|
|
40
|
+
export { MODEL_PRICING };
|
|
41
|
+
/**
|
|
42
|
+
* Ingest 结果
|
|
43
|
+
*/
|
|
44
|
+
export interface IngestResult {
|
|
45
|
+
success: boolean;
|
|
46
|
+
sourcePath: string;
|
|
47
|
+
extractedEntities: number;
|
|
48
|
+
extractedConcepts: number;
|
|
49
|
+
extractedConnections: number;
|
|
50
|
+
timeMs: number;
|
|
51
|
+
error?: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Query 结果
|
|
55
|
+
*/
|
|
56
|
+
export interface QueryResult {
|
|
57
|
+
entities: Array<{
|
|
58
|
+
id: string;
|
|
59
|
+
name: string;
|
|
60
|
+
type: string;
|
|
61
|
+
relevance: number;
|
|
62
|
+
}>;
|
|
63
|
+
concepts: Array<{
|
|
64
|
+
name: string;
|
|
65
|
+
definition: string;
|
|
66
|
+
relevance: number;
|
|
67
|
+
}>;
|
|
68
|
+
connections: Array<{
|
|
69
|
+
from: string;
|
|
70
|
+
to: string;
|
|
71
|
+
type: string;
|
|
72
|
+
description: string;
|
|
73
|
+
}>;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Lint 问题
|
|
77
|
+
*/
|
|
78
|
+
export interface LintIssue {
|
|
79
|
+
severity: 'error' | 'warning' | 'info';
|
|
80
|
+
type: string;
|
|
81
|
+
message: string;
|
|
82
|
+
location?: string;
|
|
83
|
+
suggestion?: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* WikiService - 应用服务(协调层)
|
|
87
|
+
*
|
|
88
|
+
* 职责:
|
|
89
|
+
* - 持有 Factory 和统一配置
|
|
90
|
+
* - 协调聚合根操作
|
|
91
|
+
* - 管理辅助操作(保存对话、构建索引等)
|
|
92
|
+
* - 不包含业务逻辑
|
|
93
|
+
*/
|
|
94
|
+
export declare class WikiService {
|
|
95
|
+
private factory;
|
|
96
|
+
private kb;
|
|
97
|
+
private readonly config;
|
|
98
|
+
constructor(factory: WikiFactory, config: WikiServiceConfig);
|
|
99
|
+
private get llmProvider();
|
|
100
|
+
private get embeddingProvider();
|
|
101
|
+
private get fileSystem();
|
|
102
|
+
private get pathService();
|
|
103
|
+
private get cryptoService();
|
|
104
|
+
private get conversationRepo();
|
|
105
|
+
/**
|
|
106
|
+
* 加载 KB
|
|
107
|
+
*
|
|
108
|
+
* 如果配置了 embedding,自动构建索引
|
|
109
|
+
*/
|
|
110
|
+
loadKB(): Promise<boolean>;
|
|
111
|
+
/**
|
|
112
|
+
* 保存 KB
|
|
113
|
+
*
|
|
114
|
+
* 同时保存 embedding index
|
|
115
|
+
*/
|
|
116
|
+
saveKB(): Promise<void>;
|
|
117
|
+
/**
|
|
118
|
+
* 获取当前 KB 的统计信息
|
|
119
|
+
*/
|
|
120
|
+
getStats(): {
|
|
121
|
+
entities: number;
|
|
122
|
+
concepts: number;
|
|
123
|
+
connections: number;
|
|
124
|
+
sources: number;
|
|
125
|
+
operations: number;
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* 获取 KnowledgeBase 实例(供高级用法)
|
|
129
|
+
*/
|
|
130
|
+
getKnowledgeBase(): KnowledgeBase;
|
|
131
|
+
/**
|
|
132
|
+
* Ingest 文件
|
|
133
|
+
*
|
|
134
|
+
* 协调聚合根的 ingestFromSource 方法
|
|
135
|
+
* 使用配置的默认值,允许可选覆盖
|
|
136
|
+
* Ingest 后自动更新 embedding
|
|
137
|
+
*/
|
|
138
|
+
ingestFile(filePath: string, options?: IngestOptions): Promise<IngestResult>;
|
|
139
|
+
/**
|
|
140
|
+
* 增量 Ingest 文件列表(业务逻辑在此封装)
|
|
141
|
+
*
|
|
142
|
+
* 规则:
|
|
143
|
+
* - 对每个文件调用 kb.isNewSource(path) 进行判断
|
|
144
|
+
* - 只对"全新文件"触发 ingestFile;已知文件直接跳过
|
|
145
|
+
* - 返回新增/跳过文件数量,供上层进度汇报
|
|
146
|
+
*
|
|
147
|
+
* @param files 待检查的文件路径列表(绝对路径)
|
|
148
|
+
* @param options ingest 选项(temperature 等)
|
|
149
|
+
* @param onFileProgress 每处理一个文件的回调(fileIndex, total, filePath, isNew)
|
|
150
|
+
*/
|
|
151
|
+
ingestFolderIncremental(files: string[], options?: IngestOptions, onFileProgress?: (fileIndex: number, total: number, filePath: string, isNew: boolean) => void | Promise<void>): Promise<{
|
|
152
|
+
newFiles: string[];
|
|
153
|
+
skippedFiles: string[];
|
|
154
|
+
extractedEntities: number;
|
|
155
|
+
extractedConcepts: number;
|
|
156
|
+
extractedConnections: number;
|
|
157
|
+
timeMs: number;
|
|
158
|
+
}>;
|
|
159
|
+
/**
|
|
160
|
+
* Query (同步)
|
|
161
|
+
*
|
|
162
|
+
* 协调聚合根的 query 方法
|
|
163
|
+
* 使用配置的默认值,允许可选覆盖
|
|
164
|
+
* KB 会自动使用内部的 Embedding Index
|
|
165
|
+
*/
|
|
166
|
+
query(question: string, options?: QueryOptions): Promise<QueryResult>;
|
|
167
|
+
/**
|
|
168
|
+
* Query (流式)
|
|
169
|
+
*
|
|
170
|
+
* 使用 LLM 流式生成答案
|
|
171
|
+
* 使用配置的默认值,允许可选覆盖
|
|
172
|
+
* 委托给 KB 的 queryStream 方法
|
|
173
|
+
* 通过 options.onTokenUsage 回调上报 token 使用量
|
|
174
|
+
*/
|
|
175
|
+
queryStream(question: string, options?: QueryOptions): AsyncGenerator<string, void, unknown>;
|
|
176
|
+
/**
|
|
177
|
+
* 生成所有 Wiki 页面
|
|
178
|
+
*
|
|
179
|
+
* 协调聚合根的 generateWikiPages 方法
|
|
180
|
+
*/
|
|
181
|
+
generateAllPages(): Promise<void>;
|
|
182
|
+
/**
|
|
183
|
+
* Lint 检查
|
|
184
|
+
*
|
|
185
|
+
* 调用聚合根的 lint 方法
|
|
186
|
+
*/
|
|
187
|
+
lint(): Promise<LintIssue[]>;
|
|
188
|
+
/**
|
|
189
|
+
* 估算 token 费用
|
|
190
|
+
*
|
|
191
|
+
* 无状态纯函数,不需要加载 KB。
|
|
192
|
+
* 根据 provider + model 在内置定价表中查找单价,计算输入/输出 token 的总成本。
|
|
193
|
+
*
|
|
194
|
+
* @param provider LLM 或 embedding 提供商名称(如 "openai", "deepseek", "ollama")
|
|
195
|
+
* @param model 模型名称(如 "gpt-4o")
|
|
196
|
+
* @param inputTokens 输入 token 数(promptTokens)
|
|
197
|
+
* @param outputTokens 输出 token 数(completionTokens)
|
|
198
|
+
* @returns 费用明细,或 undefined(找不到该 provider 的任何定价)
|
|
199
|
+
*/
|
|
200
|
+
calculateCost(provider: string, model: string, inputTokens: number, outputTokens: number): CostBreakdown | undefined;
|
|
201
|
+
/**
|
|
202
|
+
* 返回所有已知的模型定价数据(供 UI 展示定价表)
|
|
203
|
+
*/
|
|
204
|
+
getPricingTable(): ModelPricing[];
|
|
205
|
+
/**
|
|
206
|
+
* 查找单个模型的定价数据
|
|
207
|
+
*/
|
|
208
|
+
findModelPricing(provider: string, model: string): ModelPricing | undefined;
|
|
209
|
+
/**
|
|
210
|
+
* 为当前 KB 构建 Embedding Index
|
|
211
|
+
*
|
|
212
|
+
* 私有方法,由 loadKB 和 ingestFile 自动调用
|
|
213
|
+
*/
|
|
214
|
+
private buildEmbeddingIndexForKB;
|
|
215
|
+
/**
|
|
216
|
+
* 手动触发 Embedding Index 构建
|
|
217
|
+
*
|
|
218
|
+
* 供外部调用(如测试)
|
|
219
|
+
*/
|
|
220
|
+
buildEmbeddingIndex(): Promise<void>;
|
|
221
|
+
/**
|
|
222
|
+
* 保存对话结果为新的源文件
|
|
223
|
+
*/
|
|
224
|
+
saveConversation(question: string, answer: string, metadata?: {
|
|
225
|
+
sources?: string[];
|
|
226
|
+
retrieval?: {
|
|
227
|
+
entityCount: number;
|
|
228
|
+
conceptCount: number;
|
|
229
|
+
totalResults: number;
|
|
230
|
+
};
|
|
231
|
+
}): Promise<string>;
|
|
232
|
+
/**
|
|
233
|
+
* 列出所有保存的对话
|
|
234
|
+
*/
|
|
235
|
+
listConversations(): Promise<ConversationMetadata[]>;
|
|
236
|
+
}
|
|
@@ -1,24 +1,67 @@
|
|
|
1
1
|
import { WorkerTask, WorkerResponse } from './worker-main';
|
|
2
|
+
/**
|
|
3
|
+
* Worker 池配置
|
|
4
|
+
*/
|
|
2
5
|
export interface WorkerPoolConfig {
|
|
3
6
|
workerCount?: number;
|
|
4
7
|
maxQueueSize?: number;
|
|
5
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Worker 环境类型
|
|
11
|
+
*/
|
|
6
12
|
export type WorkerEnvironment = 'node' | 'browser';
|
|
13
|
+
/**
|
|
14
|
+
* Worker 池管理器
|
|
15
|
+
* 负责创建和管理 Worker 池,支持 Node.js 和浏览器环境
|
|
16
|
+
*/
|
|
7
17
|
export declare class WorkerPoolManager {
|
|
8
18
|
private pool;
|
|
9
19
|
private environment;
|
|
10
20
|
private workerCount;
|
|
11
21
|
constructor(config?: WorkerPoolConfig);
|
|
22
|
+
/**
|
|
23
|
+
* 检测当前运行环境
|
|
24
|
+
*
|
|
25
|
+
* 优先检测 Worker 支持能力,而不仅仅依赖 process 对象的存在
|
|
26
|
+
* 这样可以正确识别 Electron/Obsidian 环境(有 Node.js API 但只支持 Web Workers)
|
|
27
|
+
*/
|
|
12
28
|
private detectEnvironment;
|
|
29
|
+
/**
|
|
30
|
+
* 计算最佳 Worker 数量
|
|
31
|
+
*/
|
|
13
32
|
private calculateOptimalWorkerCount;
|
|
33
|
+
/**
|
|
34
|
+
* 初始化 Worker 池
|
|
35
|
+
*
|
|
36
|
+
* 包含回退机制:如果 Node.js Worker Threads 初始化失败,
|
|
37
|
+
* 自动回退到 Web Workers(用于 Electron/Obsidian 等环境)
|
|
38
|
+
*/
|
|
14
39
|
initialize(): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* 初始化 Node.js Worker 池
|
|
42
|
+
*/
|
|
15
43
|
private initializeNodePool;
|
|
44
|
+
/**
|
|
45
|
+
* 初始化浏览器 Worker 池
|
|
46
|
+
*
|
|
47
|
+
* 在浏览器环境中,我们不使用文件,而是直接传递函数给 workerpool
|
|
48
|
+
* workerpool 会自动将函数序列化并在 Worker 中执行
|
|
49
|
+
*/
|
|
16
50
|
private initializeBrowserPool;
|
|
51
|
+
/**
|
|
52
|
+
* 执行 Worker 任务
|
|
53
|
+
*/
|
|
17
54
|
exec(task: WorkerTask): Promise<WorkerResponse>;
|
|
55
|
+
/**
|
|
56
|
+
* 获取池统计信息
|
|
57
|
+
*/
|
|
18
58
|
getStats(): {
|
|
19
59
|
environment: WorkerEnvironment;
|
|
20
60
|
workerCount: number;
|
|
21
61
|
poolStats: any;
|
|
22
62
|
} | null;
|
|
63
|
+
/**
|
|
64
|
+
* 清理 Worker 池
|
|
65
|
+
*/
|
|
23
66
|
terminate(): Promise<void>;
|
|
24
67
|
}
|
|
@@ -1,14 +1,26 @@
|
|
|
1
1
|
import { PageTask } from '@pkg/page-filter';
|
|
2
|
+
/**
|
|
3
|
+
* Worker 任务类型
|
|
4
|
+
*/
|
|
2
5
|
export type WorkerTaskType = 'init' | 'process-batch' | 'stats' | 'cleanup';
|
|
6
|
+
/**
|
|
7
|
+
* Worker 任务
|
|
8
|
+
*/
|
|
3
9
|
export interface WorkerTask {
|
|
4
10
|
type: WorkerTaskType;
|
|
5
11
|
projDir?: string;
|
|
6
12
|
moduleDir?: string;
|
|
7
13
|
pageTasks?: PageTask[];
|
|
8
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Worker 响应
|
|
17
|
+
*/
|
|
9
18
|
export interface WorkerResponse {
|
|
10
19
|
success: boolean;
|
|
11
20
|
data?: any;
|
|
12
21
|
error?: string | undefined;
|
|
13
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* 处理 Worker 任务的主函数
|
|
25
|
+
*/
|
|
14
26
|
export declare function handleWorkerTask(task: WorkerTask): Promise<WorkerResponse>;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { PageTask } from '@pkg/page-filter';
|
|
2
|
+
/**
|
|
3
|
+
* 批量渲染结果
|
|
4
|
+
*/
|
|
2
5
|
export interface BatchRenderResult {
|
|
3
6
|
success: boolean;
|
|
4
7
|
processedCount: number;
|
|
@@ -6,14 +9,34 @@ export interface BatchRenderResult {
|
|
|
6
9
|
duration: number;
|
|
7
10
|
errors: string[];
|
|
8
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Worker 状态管理器
|
|
14
|
+
* 负责初始化和维护 Worker 的 SSG 环境
|
|
15
|
+
* 每个 Worker 初始化一次,然后复用来处理多个批次
|
|
16
|
+
*/
|
|
9
17
|
export declare class WorkerState {
|
|
10
18
|
private projDir;
|
|
11
19
|
private moduleDir;
|
|
12
20
|
private initialized;
|
|
13
21
|
constructor(projDir: string, moduleDir: string);
|
|
22
|
+
/**
|
|
23
|
+
* 初始化 Worker 环境(只执行一次)
|
|
24
|
+
*/
|
|
14
25
|
initialize(): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* 处理一个批次的页面任务
|
|
28
|
+
* 运行完整的 SSG 流程,但通过过滤器只处理指定任务
|
|
29
|
+
*
|
|
30
|
+
* @param pageTasks - 包含语言和路径信息的任务列表
|
|
31
|
+
*/
|
|
15
32
|
processBatch(pageTasks: PageTask[]): Promise<BatchRenderResult>;
|
|
33
|
+
/**
|
|
34
|
+
* 清理资源
|
|
35
|
+
*/
|
|
16
36
|
cleanup(): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* 获取统计信息
|
|
39
|
+
*/
|
|
17
40
|
getStats(): {
|
|
18
41
|
initialized: boolean;
|
|
19
42
|
projDir: string;
|
|
@@ -1,38 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Application Layer: Workspace Management Service
|
|
3
|
+
*
|
|
4
|
+
* 职责:
|
|
5
|
+
* - 协调多个 domain 之间的交互
|
|
6
|
+
* - 提供应用级服务(如 Identity 需要 Workspace 存储)
|
|
7
|
+
* - 不包含业务逻辑(业务逻辑在 Domain 层)
|
|
8
|
+
*/
|
|
1
9
|
import { WorkspaceFactory, Workspace, Project } from '@internal/domain/workspace';
|
|
10
|
+
/**
|
|
11
|
+
* Application Service Options
|
|
12
|
+
*/
|
|
2
13
|
export interface WorkspaceAppServiceOptions {
|
|
3
14
|
workspaceFactory: WorkspaceFactory;
|
|
4
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Workspace Application Service
|
|
18
|
+
*
|
|
19
|
+
* 提供应用层的 Workspace 服务
|
|
20
|
+
*/
|
|
5
21
|
export declare class WorkspaceAppService {
|
|
6
22
|
private workspaceFactory;
|
|
7
23
|
constructor(options: WorkspaceAppServiceOptions);
|
|
24
|
+
/**
|
|
25
|
+
* Load workspace from path
|
|
26
|
+
*/
|
|
8
27
|
loadWorkspace(path?: string): Promise<Workspace>;
|
|
28
|
+
/**
|
|
29
|
+
* Create new workspace
|
|
30
|
+
*/
|
|
9
31
|
createWorkspace(path: string, options?: Parameters<WorkspaceFactory['create']>[1]): Promise<Workspace>;
|
|
32
|
+
/**
|
|
33
|
+
* Save workspace
|
|
34
|
+
*/
|
|
10
35
|
saveWorkspace(workspace: Workspace): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Find workspace root
|
|
38
|
+
*/
|
|
11
39
|
findWorkspaceRoot(startPath?: string): Promise<string | null>;
|
|
40
|
+
/**
|
|
41
|
+
* Create project in workspace
|
|
42
|
+
*/
|
|
12
43
|
createProject(workspace: Workspace, name: string, options?: Parameters<WorkspaceFactory['createProject']>[2]): Promise<Project>;
|
|
44
|
+
/**
|
|
45
|
+
* Create project from existing folder
|
|
46
|
+
*
|
|
47
|
+
* 扫描文件夹结构,识别 content、content.{lang}、static 文件夹
|
|
48
|
+
* 创建项目并链接到源文件夹
|
|
49
|
+
*/
|
|
13
50
|
createProjectFromFolder(workspace: Workspace, name: string, sourceFolderPath: string, options?: Parameters<WorkspaceFactory['createProjectFromFolder']>[3]): Promise<Project>;
|
|
14
51
|
createProjectFromFile(workspace: Workspace, name: string, sourceFilePath: string, options?: Parameters<WorkspaceFactory['createProjectFromFile']>[3]): Promise<Project>;
|
|
52
|
+
/**
|
|
53
|
+
* Delete project from workspace
|
|
54
|
+
*/
|
|
15
55
|
deleteProject(workspace: Workspace, projectIdOrName: string, options?: Parameters<WorkspaceFactory['deleteProject']>[2]): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Load workspace and find project by name or path
|
|
58
|
+
* Common pattern used by many CLI commands
|
|
59
|
+
*
|
|
60
|
+
* 统一行为:
|
|
61
|
+
* 1. 如果传入 projectNameOrPath,先按项目名查找
|
|
62
|
+
* 2. 如果按名字找不到,尝试按路径查找(可能是绝对路径)
|
|
63
|
+
* 3. 如果没传入参数,使用当前目录查找
|
|
64
|
+
*/
|
|
16
65
|
loadWorkspaceAndProject(projectNameOrPath?: string, workspacePath?: string): Promise<{
|
|
17
66
|
workspace: Workspace;
|
|
18
67
|
project: Project;
|
|
19
68
|
}>;
|
|
69
|
+
/**
|
|
70
|
+
* Create snapshot for project
|
|
71
|
+
*/
|
|
20
72
|
createSnapshot(project: Project, snapshotName?: string): Promise<import("@internal/domain/workspace").SnapshotMetadata>;
|
|
73
|
+
/**
|
|
74
|
+
* List snapshots for project
|
|
75
|
+
*/
|
|
21
76
|
listSnapshots(project: Project): Promise<import("@internal/domain/workspace").SnapshotMetadata[]>;
|
|
77
|
+
/**
|
|
78
|
+
* Restore snapshot
|
|
79
|
+
*/
|
|
22
80
|
restoreSnapshot(project: Project, snapshotId: string, outputDir?: string): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Delete snapshot
|
|
83
|
+
*/
|
|
23
84
|
deleteSnapshot(project: Project, snapshotId: string): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Get snapshot metadata
|
|
87
|
+
*/
|
|
24
88
|
getSnapshot(project: Project, snapshotId: string): Promise<import("@internal/domain/workspace").SnapshotMetadata>;
|
|
89
|
+
/**
|
|
90
|
+
* Load a single project by path
|
|
91
|
+
*/
|
|
25
92
|
loadProject(projectPath: string): Promise<Project>;
|
|
93
|
+
/**
|
|
94
|
+
* Save a single project
|
|
95
|
+
*/
|
|
26
96
|
saveProject(project: Project): Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* Find project root from current directory
|
|
99
|
+
*/
|
|
27
100
|
findProjectRoot(startPath: string): Promise<string | null>;
|
|
101
|
+
/**
|
|
102
|
+
* Scan folder structure
|
|
103
|
+
*
|
|
104
|
+
* 扫描文件夹结构,识别 content、content.{lang}、static 文件夹
|
|
105
|
+
* 用于在创建项目前预览文件夹结构
|
|
106
|
+
*/
|
|
28
107
|
scanFolderStructure(folderPath: string): Promise<import("@internal/domain/workspace").FolderStructure>;
|
|
108
|
+
/**
|
|
109
|
+
* Create IdentityStorageProvider for a workspace
|
|
110
|
+
*
|
|
111
|
+
* 跨域协调:
|
|
112
|
+
* - Identity Domain 定义需要什么存储能力 (IdentityStorageProvider)
|
|
113
|
+
* - Workspace Domain 提供实现
|
|
114
|
+
* - Application Layer 负责组装
|
|
115
|
+
*/
|
|
29
116
|
createIdentityStorage(workspace: Workspace): import("../domain/identity").IdentityStorageProvider;
|
|
117
|
+
/**
|
|
118
|
+
* 设置项目的 baseURL 路径结构
|
|
119
|
+
* 在 public/ 目录下创建对应的 symlink 结构
|
|
120
|
+
*/
|
|
30
121
|
setupProjectBaseURLStructure(project: Project): Promise<{
|
|
31
122
|
serverRoot: string;
|
|
32
123
|
baseURL: string;
|
|
33
124
|
symlinkCreated: boolean;
|
|
34
125
|
}>;
|
|
126
|
+
/**
|
|
127
|
+
* 清理项目的 baseURL 路径结构
|
|
128
|
+
*/
|
|
35
129
|
cleanProjectBaseURLStructure(project: Project): Promise<void>;
|
|
130
|
+
/**
|
|
131
|
+
* 确保项目的 baseURL 路径结构正确
|
|
132
|
+
* 检查 baseURL 是否变化,如需要则重新创建
|
|
133
|
+
*/
|
|
36
134
|
ensureProjectBaseURLStructure(project: Project): Promise<{
|
|
37
135
|
serverRoot: string;
|
|
38
136
|
baseURL: string;
|
|
@@ -8,6 +8,10 @@ import { Language } from './language';
|
|
|
8
8
|
import { Taxonomy } from './taxonomy';
|
|
9
9
|
import { Dir } from "./dir";
|
|
10
10
|
import { Markdown } from './markdown';
|
|
11
|
+
/**
|
|
12
|
+
* Config entity that aggregates all configuration components
|
|
13
|
+
* Matches the golang version structure
|
|
14
|
+
*/
|
|
11
15
|
export declare class Config {
|
|
12
16
|
private configSourceFs;
|
|
13
17
|
private provider;
|
|
@@ -24,16 +28,52 @@ export declare class Config {
|
|
|
24
28
|
getProvider(): Provider;
|
|
25
29
|
theme(): string;
|
|
26
30
|
getDir(): Dir;
|
|
31
|
+
/**
|
|
32
|
+
* Get Root entity
|
|
33
|
+
*/
|
|
27
34
|
getRoot(): Root;
|
|
35
|
+
/**
|
|
36
|
+
* Get Module entity
|
|
37
|
+
*/
|
|
28
38
|
getModule(): Module;
|
|
39
|
+
/**
|
|
40
|
+
* Get Service entity
|
|
41
|
+
*/
|
|
29
42
|
getService(): Service;
|
|
43
|
+
/**
|
|
44
|
+
* Get Social entity
|
|
45
|
+
*/
|
|
30
46
|
getSocial(): Social;
|
|
47
|
+
/**
|
|
48
|
+
* Get Language entity (optional)
|
|
49
|
+
*/
|
|
31
50
|
getLanguage(): Language;
|
|
51
|
+
/**
|
|
52
|
+
* Get Taxonomy entity (optional)
|
|
53
|
+
*/
|
|
32
54
|
getTaxonomy(): Taxonomy;
|
|
55
|
+
/**
|
|
56
|
+
* Get Markdown entity
|
|
57
|
+
*/
|
|
33
58
|
getMarkdown(): Markdown;
|
|
59
|
+
/**
|
|
60
|
+
* Set Language entity
|
|
61
|
+
*/
|
|
34
62
|
setLanguage(language: Language): void;
|
|
63
|
+
/**
|
|
64
|
+
* Set Taxonomy entity
|
|
65
|
+
*/
|
|
35
66
|
setTaxonomy(taxonomy: Taxonomy): void;
|
|
67
|
+
/**
|
|
68
|
+
* Set Markdown entity
|
|
69
|
+
*/
|
|
36
70
|
setMarkdown(markdown: Markdown): void;
|
|
71
|
+
/**
|
|
72
|
+
* Validate the configuration
|
|
73
|
+
*/
|
|
37
74
|
validate(): boolean;
|
|
38
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Creates a new Config instance
|
|
78
|
+
*/
|
|
39
79
|
export declare function newConfig(configSourceFs: Fs, provider: Provider, root: Root, dir: Dir, module: Module, service: Service, social: Social, language: Language, taxonomy: Taxonomy, markdown: Markdown): Config;
|
|
@@ -1,23 +1,74 @@
|
|
|
1
1
|
import { LanguageConfig } from '../type';
|
|
2
|
+
/**
|
|
3
|
+
* Language entity holds language configuration
|
|
4
|
+
*/
|
|
2
5
|
export declare class Language {
|
|
3
6
|
private defaultLang;
|
|
4
7
|
private configs;
|
|
5
8
|
private indices;
|
|
6
9
|
constructor(configs: Record<string, LanguageConfig>);
|
|
10
|
+
/**
|
|
11
|
+
* Calculate default language based on weight (smallest weight wins)
|
|
12
|
+
*/
|
|
7
13
|
private calculateDefaultLanguage;
|
|
14
|
+
/**
|
|
15
|
+
* Get all language configurations
|
|
16
|
+
*/
|
|
8
17
|
languages(): LanguageConfig[];
|
|
18
|
+
/**
|
|
19
|
+
* Get default language
|
|
20
|
+
*/
|
|
9
21
|
defaultLanguage(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Check if a language is valid
|
|
24
|
+
*/
|
|
10
25
|
isLanguageValid(lang: string): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Get other language keys (excluding default)
|
|
28
|
+
*/
|
|
11
29
|
otherLanguageKeys(): string[];
|
|
30
|
+
/**
|
|
31
|
+
* Get relative directory for a language
|
|
32
|
+
*/
|
|
12
33
|
getRelDir(name: string, langKey: string): string;
|
|
34
|
+
/**
|
|
35
|
+
* Validate language configuration
|
|
36
|
+
*/
|
|
13
37
|
validate(): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Set language indices (ordered list)
|
|
40
|
+
*/
|
|
14
41
|
private setIndices;
|
|
42
|
+
/**
|
|
43
|
+
* Get language keys in order
|
|
44
|
+
*/
|
|
15
45
|
languageKeys(): string[];
|
|
46
|
+
/**
|
|
47
|
+
* Get language indexes
|
|
48
|
+
*/
|
|
16
49
|
languageIndexes(): number[];
|
|
50
|
+
/**
|
|
51
|
+
* Get language index by language code
|
|
52
|
+
*/
|
|
17
53
|
getLanguageIndex(lang: string): number;
|
|
54
|
+
/**
|
|
55
|
+
* Get language by index
|
|
56
|
+
*/
|
|
18
57
|
getLanguageByIndex(idx: number): string;
|
|
58
|
+
/**
|
|
59
|
+
* Get language name by language code
|
|
60
|
+
*/
|
|
19
61
|
getLanguageName(lang: string): string;
|
|
62
|
+
/**
|
|
63
|
+
* Get language configuration by language code
|
|
64
|
+
*/
|
|
20
65
|
getLanguageConfig(lang: string): LanguageConfig | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Get all language configurations
|
|
68
|
+
*/
|
|
21
69
|
getConfigs(): Record<string, LanguageConfig>;
|
|
22
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Create a new Language instance from provider data
|
|
73
|
+
*/
|
|
23
74
|
export declare function newLanguage(data: any): Language;
|