@lapis-notes/api 0.1.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/CHANGELOG.md +9 -0
- package/LICENSE.md +4 -0
- package/README.md +43 -0
- package/dist/__tests__/data-adapter-conformance.js +205 -0
- package/dist/__tests__/lapis-runtime-manifest.js +32 -0
- package/dist/__tests__/svelte-internal-client.d.ts +3 -0
- package/dist/agent-result-views.d.ts +52 -0
- package/dist/agent-result-views.js +89 -0
- package/dist/agent-skills.d.ts +99 -0
- package/dist/agent-skills.js +182 -0
- package/dist/agent-tools.d.ts +92 -0
- package/dist/agent-tools.js +139 -0
- package/dist/app-database-host.d.ts +4 -0
- package/dist/app-database-host.js +4 -0
- package/dist/app-shell-plugin-persistence.d.ts +15 -0
- package/dist/app-shell-plugin-persistence.js +34 -0
- package/dist/app-url.d.ts +54 -0
- package/dist/app-url.js +269 -0
- package/dist/application-compatibility.d.ts +31 -0
- package/dist/application-compatibility.js +64 -0
- package/dist/application-state.svelte.d.ts +14 -0
- package/dist/application-state.svelte.js +30 -0
- package/dist/assets/lapis-logo.svg +471 -0
- package/dist/bases.d.ts +281 -0
- package/dist/bases.js +475 -0
- package/dist/cache.svelte.d.ts +569 -0
- package/dist/cache.svelte.js +1433 -0
- package/dist/command.svelte.d.ts +337 -0
- package/dist/command.svelte.js +571 -0
- package/dist/compat.d.ts +29 -0
- package/dist/compat.js +30 -0
- package/dist/components/configuration/configuration.css +199 -0
- package/dist/components/configuration/date-setting.svelte +71 -0
- package/dist/components/configuration/date-setting.svelte.d.ts +8 -0
- package/dist/components/configuration/list-setting.svelte +128 -0
- package/dist/components/configuration/list-setting.svelte.d.ts +13 -0
- package/dist/components/configuration/object-array-row-grip.svelte +78 -0
- package/dist/components/configuration/object-array-row-grip.svelte.d.ts +9 -0
- package/dist/components/configuration/object-array-row.svelte +163 -0
- package/dist/components/configuration/object-array-row.svelte.d.ts +19 -0
- package/dist/components/configuration/object-array-setting.svelte +196 -0
- package/dist/components/configuration/object-array-setting.svelte.d.ts +15 -0
- package/dist/components/configuration/object-array-table-dnd.d.ts +8 -0
- package/dist/components/configuration/object-array-table-dnd.js +10 -0
- package/dist/components/configuration/object-array-utils.d.ts +11 -0
- package/dist/components/configuration/object-array-utils.js +103 -0
- package/dist/components/configuration/object-grid-setting.svelte +79 -0
- package/dist/components/configuration/object-grid-setting.svelte.d.ts +10 -0
- package/dist/components/configuration/object-map-row.svelte +147 -0
- package/dist/components/configuration/object-map-row.svelte.d.ts +15 -0
- package/dist/components/configuration/object-map-setting.svelte +137 -0
- package/dist/components/configuration/object-map-setting.svelte.d.ts +14 -0
- package/dist/components/configuration/object-map-types.d.ts +5 -0
- package/dist/components/configuration/object-map-types.js +1 -0
- package/dist/components/configuration/options-combobox-setting.svelte +129 -0
- package/dist/components/configuration/options-combobox-setting.svelte.d.ts +12 -0
- package/dist/components/copy-button/button.svelte +93 -0
- package/dist/components/copy-button/button.svelte.d.ts +13 -0
- package/dist/components/copy-button/index.d.ts +2 -0
- package/dist/components/copy-button/index.js +2 -0
- package/dist/components/editor/editor.css +565 -0
- package/dist/components/editor/editor.d.ts +33 -0
- package/dist/components/editor/editor.js +132 -0
- package/dist/components/editor/editor.svelte +176 -0
- package/dist/components/editor/editor.svelte.d.ts +15 -0
- package/dist/components/editor/embedded-editor-surface.d.ts +12 -0
- package/dist/components/editor/embedded-editor-surface.js +22 -0
- package/dist/components/editor/embedded-editor-surface.svelte +115 -0
- package/dist/components/editor/embedded-editor-surface.svelte.d.ts +17 -0
- package/dist/components/editor/extensions/autocomplete/index.d.ts +2 -0
- package/dist/components/editor/extensions/autocomplete/index.js +2 -0
- package/dist/components/editor/extensions/autocomplete/lapis-code-mirror-autocomplete.d.ts +16 -0
- package/dist/components/editor/extensions/autocomplete/lapis-code-mirror-autocomplete.js +34 -0
- package/dist/components/editor/extensions/autocomplete/vault-completion-sources.d.ts +27 -0
- package/dist/components/editor/extensions/autocomplete/vault-completion-sources.js +55 -0
- package/dist/components/editor/extensions/class-highlighter/index.d.ts +1 -0
- package/dist/components/editor/extensions/class-highlighter/index.js +47 -0
- package/dist/components/editor/extensions/fold-gutter/index.d.ts +8 -0
- package/dist/components/editor/extensions/fold-gutter/index.js +40 -0
- package/dist/components/editor/extensions/gutter-line-style-sync/index.d.ts +2 -0
- package/dist/components/editor/extensions/gutter-line-style-sync/index.js +118 -0
- package/dist/components/editor/extensions/lint/index.d.ts +4 -0
- package/dist/components/editor/extensions/lint/index.js +4 -0
- package/dist/components/editor/extensions/lint/lapis-code-mirror-lint.d.ts +26 -0
- package/dist/components/editor/extensions/lint/lapis-code-mirror-lint.js +101 -0
- package/dist/components/editor/extensions/lint/lapis-lint-diagnostic-helpers.d.ts +8 -0
- package/dist/components/editor/extensions/lint/lapis-lint-diagnostic-helpers.js +7 -0
- package/dist/components/editor/extensions/lint/lapis-lint-diagnostic.d.ts +20 -0
- package/dist/components/editor/extensions/lint/lapis-lint-diagnostic.js +47 -0
- package/dist/components/editor/extensions/lint/lapis-lint-hover-tooltip.d.ts +9 -0
- package/dist/components/editor/extensions/lint/lapis-lint-hover-tooltip.js +373 -0
- package/dist/components/editor/extensions/lint/lapis-lint-inline-widget.d.ts +31 -0
- package/dist/components/editor/extensions/lint/lapis-lint-inline-widget.js +191 -0
- package/dist/components/editor/extensions/lint/lapis-lint-tooltip.svelte +176 -0
- package/dist/components/editor/extensions/lint/lapis-lint-tooltip.svelte.d.ts +15 -0
- package/dist/components/editor/extensions/lint/lint-tooltip-actions.d.ts +11 -0
- package/dist/components/editor/extensions/lint/lint-tooltip-actions.js +21 -0
- package/dist/components/editor/extensions/lint/mount-lint-tooltip.d.ts +16 -0
- package/dist/components/editor/extensions/lint/mount-lint-tooltip.js +60 -0
- package/dist/components/editor/extensions/search/dom.d.ts +2 -0
- package/dist/components/editor/extensions/search/dom.js +6 -0
- package/dist/components/editor/extensions/search/index.d.ts +35 -0
- package/dist/components/editor/extensions/search/index.js +44 -0
- package/dist/components/editor/extensions/search/search.svelte +335 -0
- package/dist/components/editor/extensions/search/search.svelte.d.ts +8 -0
- package/dist/components/editor/index.d.ts +9 -0
- package/dist/components/editor/index.js +9 -0
- package/dist/components/editor/language-service/dom.d.ts +1 -0
- package/dist/components/editor/language-service/dom.js +6 -0
- package/dist/components/editor/language-service/index.d.ts +28 -0
- package/dist/components/editor/language-service/index.js +342 -0
- package/dist/components/empty-view/empty-view.css +39 -0
- package/dist/components/empty-view/empty-view.svelte +26 -0
- package/dist/components/empty-view/empty-view.svelte.d.ts +9 -0
- package/dist/components/empty-view/index.d.ts +2 -0
- package/dist/components/empty-view/index.js +2 -0
- package/dist/components/icon/icon-list.css +74 -0
- package/dist/components/icon/icon-list.svelte +213 -0
- package/dist/components/icon/icon-list.svelte.d.ts +11 -0
- package/dist/components/icon/icon.svelte +15 -0
- package/dist/components/icon/icon.svelte.d.ts +7 -0
- package/dist/components/icon/index.d.ts +3 -0
- package/dist/components/icon/index.js +3 -0
- package/dist/components/menu/context-menu.svelte +89 -0
- package/dist/components/menu/context-menu.svelte.d.ts +11 -0
- package/dist/components/menu/drawer-menu.svelte +83 -0
- package/dist/components/menu/drawer-menu.svelte.d.ts +8 -0
- package/dist/components/menu/dropdown-menu.svelte +89 -0
- package/dist/components/menu/dropdown-menu.svelte.d.ts +11 -0
- package/dist/components/menu/index.d.ts +6 -0
- package/dist/components/menu/index.js +6 -0
- package/dist/components/menu/menu.css +139 -0
- package/dist/components/menu/menu.svelte +37 -0
- package/dist/components/menu/menu.svelte.d.ts +11 -0
- package/dist/components/menu/mobile-menu-query.svelte.d.ts +3 -0
- package/dist/components/menu/mobile-menu-query.svelte.js +21 -0
- package/dist/components/menu/popover-menu.svelte +90 -0
- package/dist/components/menu/popover-menu.svelte.d.ts +10 -0
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/select/index.js +2 -0
- package/dist/components/select/select.svelte +72 -0
- package/dist/components/select/select.svelte.d.ts +25 -0
- package/dist/configuration-option-source-providers.d.ts +17 -0
- package/dist/configuration-option-source-providers.js +59 -0
- package/dist/configuration-option-source-registry.d.ts +59 -0
- package/dist/configuration-option-source-registry.js +123 -0
- package/dist/configuration.svelte.d.ts +258 -0
- package/dist/configuration.svelte.js +887 -0
- package/dist/context-keys.svelte.d.ts +42 -0
- package/dist/context-keys.svelte.js +278 -0
- package/dist/context.svelte.d.ts +247 -0
- package/dist/context.svelte.js +540 -0
- package/dist/daily-document-provider.d.ts +38 -0
- package/dist/daily-document-provider.js +176 -0
- package/dist/design-core-button-types.d.ts +7 -0
- package/dist/design-core-button-types.js +1 -0
- package/dist/diagnostics.d.ts +93 -0
- package/dist/diagnostics.js +84 -0
- package/dist/dialog-portal.d.ts +3 -0
- package/dist/dialog-portal.js +3 -0
- package/dist/docs-api.d.ts +44 -0
- package/dist/docs-api.js +29 -0
- package/dist/editor-view-registry.d.ts +35 -0
- package/dist/editor-view-registry.js +112 -0
- package/dist/editor.svelte.d.ts +126 -0
- package/dist/editor.svelte.js +454 -0
- package/dist/embed-registry.d.ts +15 -0
- package/dist/embed-registry.js +16 -0
- package/dist/enhance.d.ts +111 -0
- package/dist/enhance.js +309 -0
- package/dist/events.d.ts +28 -0
- package/dist/events.js +49 -0
- package/dist/file-manager.d.ts +90 -0
- package/dist/file-manager.js +289 -0
- package/dist/file-tools/app-tools.d.ts +3 -0
- package/dist/file-tools/app-tools.js +242 -0
- package/dist/file-tools/index.d.ts +3 -0
- package/dist/file-tools/index.js +3 -0
- package/dist/file-tools/paths.d.ts +14 -0
- package/dist/file-tools/paths.js +33 -0
- package/dist/file-tools/vault-operations.d.ts +3 -0
- package/dist/file-tools/vault-operations.js +60 -0
- package/dist/generated/plugin-host-modules.schema.generated.d.ts +371 -0
- package/dist/generated/plugin-host-modules.schema.generated.js +374 -0
- package/dist/glob.d.ts +15 -0
- package/dist/glob.js +68 -0
- package/dist/history.svelte.d.ts +24 -0
- package/dist/history.svelte.js +74 -0
- package/dist/hooks/createVirtualizer.svelte.d.ts +7 -0
- package/dist/hooks/createVirtualizer.svelte.js +70 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/index.js +5 -0
- package/dist/hooks/is-mobile.svelte.d.ts +5 -0
- package/dist/hooks/is-mobile.svelte.js +23 -0
- package/dist/hooks/mountComponent.svelte.d.ts +7 -0
- package/dist/hooks/mountComponent.svelte.js +16 -0
- package/dist/hooks/use-text-highlight.d.ts +17 -0
- package/dist/hooks/use-text-highlight.js +82 -0
- package/dist/hooks/useBoundingRect.svelte.d.ts +11 -0
- package/dist/hooks/useBoundingRect.svelte.js +46 -0
- package/dist/icons/index.d.ts +57 -0
- package/dist/icons/index.js +288 -0
- package/dist/index.d.ts +87 -0
- package/dist/index.js +87 -0
- package/dist/language-service/index.d.ts +9 -0
- package/dist/language-service/index.js +7 -0
- package/dist/language-service/manager.d.ts +47 -0
- package/dist/language-service/manager.js +404 -0
- package/dist/language-service/types.d.ts +92 -0
- package/dist/language-service/types.js +1 -0
- package/dist/language-service/virtual-document.d.ts +11 -0
- package/dist/language-service/virtual-document.js +45 -0
- package/dist/language-service/worker-protocol.d.ts +63 -0
- package/dist/language-service/worker-protocol.js +1 -0
- package/dist/language-service/worker-provider.d.ts +9 -0
- package/dist/language-service/worker-provider.js +38 -0
- package/dist/lapis-extension.d.ts +244 -0
- package/dist/lapis-extension.js +591 -0
- package/dist/links.d.ts +34 -0
- package/dist/links.js +191 -0
- package/dist/loaders.d.ts +9 -0
- package/dist/loaders.js +59 -0
- package/dist/localization-manager.svelte.d.ts +56 -0
- package/dist/localization-manager.svelte.js +157 -0
- package/dist/logging.d.ts +172 -0
- package/dist/logging.js +352 -0
- package/dist/markdown-extension-registry.d.ts +31 -0
- package/dist/markdown-extension-registry.js +31 -0
- package/dist/markdown-file-surface-registry.d.ts +25 -0
- package/dist/markdown-file-surface-registry.js +23 -0
- package/dist/markdown.d.ts +205 -0
- package/dist/markdown.js +147 -0
- package/dist/menu-utils.d.ts +1 -0
- package/dist/menu-utils.js +47 -0
- package/dist/menu.svelte.d.ts +121 -0
- package/dist/menu.svelte.js +295 -0
- package/dist/metadata-value.d.ts +10 -0
- package/dist/metadata-value.js +173 -0
- package/dist/metadata.svelte.d.ts +106 -0
- package/dist/metadata.svelte.js +608 -0
- package/dist/notifications.d.ts +209 -0
- package/dist/notifications.js +338 -0
- package/dist/open-file.d.ts +23 -0
- package/dist/open-file.js +102 -0
- package/dist/platform.d.ts +86 -0
- package/dist/platform.js +86 -0
- package/dist/plugin-asset-server.d.ts +60 -0
- package/dist/plugin-asset-server.js +222 -0
- package/dist/plugin-assets.d.ts +4 -0
- package/dist/plugin-assets.js +3 -0
- package/dist/plugin-capability-facade.d.ts +104 -0
- package/dist/plugin-capability-facade.js +61 -0
- package/dist/plugin-dependency-resolver.d.ts +36 -0
- package/dist/plugin-dependency-resolver.js +54 -0
- package/dist/plugin-dependency-scanner.d.ts +9 -0
- package/dist/plugin-dependency-scanner.js +274 -0
- package/dist/plugin-distribution/canonical-json.d.ts +1 -0
- package/dist/plugin-distribution/canonical-json.js +40 -0
- package/dist/plugin-distribution/compatibility.d.ts +5 -0
- package/dist/plugin-distribution/compatibility.js +38 -0
- package/dist/plugin-distribution/errors.d.ts +11 -0
- package/dist/plugin-distribution/errors.js +13 -0
- package/dist/plugin-distribution/hashes.d.ts +2 -0
- package/dist/plugin-distribution/hashes.js +17 -0
- package/dist/plugin-distribution/index.d.ts +18 -0
- package/dist/plugin-distribution/index.js +18 -0
- package/dist/plugin-distribution/installed-plugin-state.d.ts +20 -0
- package/dist/plugin-distribution/installed-plugin-state.js +73 -0
- package/dist/plugin-distribution/installer.d.ts +89 -0
- package/dist/plugin-distribution/installer.js +395 -0
- package/dist/plugin-distribution/manager.d.ts +128 -0
- package/dist/plugin-distribution/manager.js +358 -0
- package/dist/plugin-distribution/path-safety.d.ts +2 -0
- package/dist/plugin-distribution/path-safety.js +20 -0
- package/dist/plugin-distribution/plugin-bundle-verifier.d.ts +28 -0
- package/dist/plugin-distribution/plugin-bundle-verifier.js +96 -0
- package/dist/plugin-distribution/plugin-bundle-worker.d.ts +34 -0
- package/dist/plugin-distribution/plugin-bundle-worker.js +99 -0
- package/dist/plugin-distribution/plugin-bundle.d.ts +16 -0
- package/dist/plugin-distribution/plugin-bundle.js +244 -0
- package/dist/plugin-distribution/plugin-bundle.worker.d.ts +1 -0
- package/dist/plugin-distribution/plugin-bundle.worker.js +38 -0
- package/dist/plugin-distribution/registry-cache.d.ts +26 -0
- package/dist/plugin-distribution/registry-cache.js +85 -0
- package/dist/plugin-distribution/registry-client.d.ts +36 -0
- package/dist/plugin-distribution/registry-client.js +115 -0
- package/dist/plugin-distribution/reserved-ids.d.ts +4 -0
- package/dist/plugin-distribution/reserved-ids.js +10 -0
- package/dist/plugin-distribution/runtime-validation.d.ts +14 -0
- package/dist/plugin-distribution/runtime-validation.js +388 -0
- package/dist/plugin-distribution/schemas.d.ts +4895 -0
- package/dist/plugin-distribution/schemas.js +299 -0
- package/dist/plugin-distribution/signing.d.ts +5 -0
- package/dist/plugin-distribution/signing.js +38 -0
- package/dist/plugin-distribution/types.d.ts +217 -0
- package/dist/plugin-distribution/types.js +1 -0
- package/dist/plugin-install-progress.d.ts +15 -0
- package/dist/plugin-install-progress.js +86 -0
- package/dist/plugin-manager.d.ts +306 -0
- package/dist/plugin-manager.js +2848 -0
- package/dist/plugin-runtime-entry.d.ts +19 -0
- package/dist/plugin-runtime-entry.js +135 -0
- package/dist/plugin.d.ts +350 -0
- package/dist/plugin.js +754 -0
- package/dist/popover.d.ts +20 -0
- package/dist/popover.js +32 -0
- package/dist/promise-worker.d.ts +22 -0
- package/dist/promise-worker.js +65 -0
- package/dist/prompt-confirm.d.ts +9 -0
- package/dist/prompt-confirm.js +33 -0
- package/dist/search-document-provider.d.ts +45 -0
- package/dist/search-document-provider.js +54 -0
- package/dist/search-query/index.d.ts +78 -0
- package/dist/search-query/index.js +426 -0
- package/dist/search-query/parser.d.ts +3 -0
- package/dist/search-query/parser.js +16 -0
- package/dist/search-query/parser.terms.js +26 -0
- package/dist/search-query/search-query.grammar +128 -0
- package/dist/search.d.ts +19 -0
- package/dist/search.js +104 -0
- package/dist/setting-section-layout.d.ts +19 -0
- package/dist/setting-section-layout.js +194 -0
- package/dist/settings.svelte.d.ts +474 -0
- package/dist/settings.svelte.js +1421 -0
- package/dist/source-text-file-view.d.ts +25 -0
- package/dist/source-text-file-view.js +78 -0
- package/dist/status-bar.svelte.d.ts +29 -0
- package/dist/status-bar.svelte.js +72 -0
- package/dist/storage/app-database.d.ts +860 -0
- package/dist/storage/app-database.js +2372 -0
- package/dist/storage/blob-store.d.ts +12 -0
- package/dist/storage/blob-store.js +1 -0
- package/dist/storage/browser-app-database-coordination.d.ts +35 -0
- package/dist/storage/browser-app-database-coordination.js +207 -0
- package/dist/storage/browser-coordinated-app-database.d.ts +109 -0
- package/dist/storage/browser-coordinated-app-database.js +704 -0
- package/dist/storage/browser.d.ts +153 -0
- package/dist/storage/browser.js +794 -0
- package/dist/storage/desktop-native.d.ts +184 -0
- package/dist/storage/desktop-native.js +415 -0
- package/dist/storage/fs.d.ts +188 -0
- package/dist/storage/fs.js +307 -0
- package/dist/storage/index-projection.d.ts +236 -0
- package/dist/storage/index-projection.js +402 -0
- package/dist/storage/index.d.ts +17 -0
- package/dist/storage/index.js +17 -0
- package/dist/storage/keyval.d.ts +94 -0
- package/dist/storage/keyval.js +199 -0
- package/dist/storage/memory-vault-adapter.d.ts +44 -0
- package/dist/storage/memory-vault-adapter.js +351 -0
- package/dist/storage/native-vault-bootstrap-kv.d.ts +22 -0
- package/dist/storage/native-vault-bootstrap-kv.js +96 -0
- package/dist/storage/path.d.ts +22 -0
- package/dist/storage/path.js +110 -0
- package/dist/storage/search-embedding-provider.d.ts +75 -0
- package/dist/storage/search-embedding-provider.js +446 -0
- package/dist/storage/search-embedding-worker.d.ts +1 -0
- package/dist/storage/search-embedding-worker.js +63 -0
- package/dist/storage/search-query-evaluator.d.ts +14 -0
- package/dist/storage/search-query-evaluator.js +678 -0
- package/dist/storage/task-projection.d.ts +152 -0
- package/dist/storage/task-projection.js +154 -0
- package/dist/storage/turso-app-database.d.ts +150 -0
- package/dist/storage/turso-app-database.js +2671 -0
- package/dist/storage/vault-session.d.ts +37 -0
- package/dist/storage/vault-session.js +196 -0
- package/dist/storage/vault-state.d.ts +74 -0
- package/dist/storage/vault-state.js +181 -0
- package/dist/storage/vault.svelte.d.ts +257 -0
- package/dist/storage/vault.svelte.js +661 -0
- package/dist/suggest.d.ts +193 -0
- package/dist/suggest.js +391 -0
- package/dist/tasks.d.ts +7 -0
- package/dist/tasks.js +18 -0
- package/dist/telemetry.d.ts +116 -0
- package/dist/telemetry.js +103 -0
- package/dist/utils.d.ts +55 -0
- package/dist/utils.js +314 -0
- package/dist/vault-api.d.ts +5 -0
- package/dist/vault-api.js +3 -0
- package/dist/vault-maintenance-commands.d.ts +5 -0
- package/dist/vault-maintenance-commands.js +32 -0
- package/dist/view.svelte.d.ts +215 -0
- package/dist/view.svelte.js +381 -0
- package/dist/vite-env.d.ts +2 -0
- package/dist/workspace-host-internal.d.ts +7 -0
- package/dist/workspace-host-internal.js +7 -0
- package/dist/workspace-host.d.ts +10 -0
- package/dist/workspace-host.js +14 -0
- package/dist/workspace-layout-commands.d.ts +3 -0
- package/dist/workspace-layout-commands.js +72 -0
- package/dist/workspace-layout-normalizer.d.ts +92 -0
- package/dist/workspace-layout-normalizer.js +301 -0
- package/dist/workspace-layouts.d.ts +7 -0
- package/dist/workspace-layouts.js +23 -0
- package/dist/workspace-trust.d.ts +32 -0
- package/dist/workspace-trust.js +72 -0
- package/dist/workspace.svelte.d.ts +796 -0
- package/dist/workspace.svelte.js +4380 -0
- package/package.json +240 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { type Readable } from "svelte/store";
|
|
2
|
+
export type TelemetryAttributeValue = string | number | boolean | null | undefined;
|
|
3
|
+
export type TelemetryAttributes = Record<string, TelemetryAttributeValue>;
|
|
4
|
+
export interface TelemetrySpanOptions {
|
|
5
|
+
attributes?: TelemetryAttributes;
|
|
6
|
+
parent?: TelemetrySpan | null;
|
|
7
|
+
slowThresholdMs?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface TelemetryMeasurementOptions extends TelemetrySpanOptions {
|
|
10
|
+
}
|
|
11
|
+
export interface TelemetrySpan {
|
|
12
|
+
readonly name: string;
|
|
13
|
+
readonly startedAt: number;
|
|
14
|
+
setAttribute(name: string, value: TelemetryAttributeValue): void;
|
|
15
|
+
addEvent(name: string, attributes?: TelemetryAttributes): void;
|
|
16
|
+
recordException(error: unknown, attributes?: TelemetryAttributes): void;
|
|
17
|
+
end(attributes?: TelemetryAttributes): void;
|
|
18
|
+
}
|
|
19
|
+
export interface TelemetryMeasurement {
|
|
20
|
+
name: string;
|
|
21
|
+
value: number;
|
|
22
|
+
unit?: string;
|
|
23
|
+
attributes?: TelemetryAttributes;
|
|
24
|
+
}
|
|
25
|
+
export interface TelemetryConfiguration {
|
|
26
|
+
enabled: boolean;
|
|
27
|
+
captureWebVitals: boolean;
|
|
28
|
+
debugLogging: boolean;
|
|
29
|
+
persistDiagnostics: boolean;
|
|
30
|
+
sampleRate: number;
|
|
31
|
+
slowSpanThresholdMs: number;
|
|
32
|
+
otlpEndpoint?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface TelemetryDiagnosticSpan {
|
|
35
|
+
id: number;
|
|
36
|
+
name: string;
|
|
37
|
+
durationMs: number;
|
|
38
|
+
capturedAt: number;
|
|
39
|
+
attributes: TelemetryAttributes;
|
|
40
|
+
}
|
|
41
|
+
export interface TelemetryDiagnosticTraceSpan {
|
|
42
|
+
id: string;
|
|
43
|
+
traceId: string;
|
|
44
|
+
parentSpanId: string | null;
|
|
45
|
+
name: string;
|
|
46
|
+
startedAt: number;
|
|
47
|
+
endedAt: number;
|
|
48
|
+
durationMs: number;
|
|
49
|
+
attributes: TelemetryAttributes;
|
|
50
|
+
isSlow: boolean;
|
|
51
|
+
status: "ok" | "error";
|
|
52
|
+
errorMessage?: string;
|
|
53
|
+
}
|
|
54
|
+
export interface TelemetryDiagnosticTrace {
|
|
55
|
+
id: string;
|
|
56
|
+
rootSpanId: string | null;
|
|
57
|
+
rootSpanName: string;
|
|
58
|
+
startedAt: number;
|
|
59
|
+
endedAt: number;
|
|
60
|
+
durationMs: number;
|
|
61
|
+
spanCount: number;
|
|
62
|
+
slowSpanCount: number;
|
|
63
|
+
spans: TelemetryDiagnosticTraceSpan[];
|
|
64
|
+
}
|
|
65
|
+
export interface TelemetryDiagnosticMeasurement {
|
|
66
|
+
id: number;
|
|
67
|
+
name: string;
|
|
68
|
+
value: number;
|
|
69
|
+
unit: string;
|
|
70
|
+
capturedAt: number;
|
|
71
|
+
attributes: TelemetryAttributes;
|
|
72
|
+
kind: "measurement" | "web-vital";
|
|
73
|
+
}
|
|
74
|
+
export interface TelemetryDiagnosticsSnapshot {
|
|
75
|
+
enabled: boolean;
|
|
76
|
+
debugLogging: boolean;
|
|
77
|
+
captureWebVitals: boolean;
|
|
78
|
+
sampleRate: number;
|
|
79
|
+
slowSpanThresholdMs: number;
|
|
80
|
+
otlpConfigured: boolean;
|
|
81
|
+
recentSlowSpans: TelemetryDiagnosticSpan[];
|
|
82
|
+
recentTraces: TelemetryDiagnosticTrace[];
|
|
83
|
+
recentMeasurements: TelemetryDiagnosticMeasurement[];
|
|
84
|
+
}
|
|
85
|
+
export declare function createTelemetryDiagnosticsSnapshot(overrides?: Partial<TelemetryDiagnosticsSnapshot>): TelemetryDiagnosticsSnapshot;
|
|
86
|
+
export declare function createTelemetryConfiguration(overrides?: Partial<TelemetryConfiguration>): TelemetryConfiguration;
|
|
87
|
+
export interface TelemetryService {
|
|
88
|
+
enabled: boolean;
|
|
89
|
+
readonly diagnostics: Readable<TelemetryDiagnosticsSnapshot>;
|
|
90
|
+
getConfiguration(): TelemetryConfiguration;
|
|
91
|
+
configure(config: Partial<TelemetryConfiguration>): void | Promise<void>;
|
|
92
|
+
clearDiagnostics(): void | Promise<void>;
|
|
93
|
+
startSpan(name: string, options?: TelemetrySpanOptions): TelemetrySpan;
|
|
94
|
+
measure<T>(name: string, callback: (span: TelemetrySpan) => T, options?: TelemetryMeasurementOptions): T;
|
|
95
|
+
measureAsync<T>(name: string, callback: (span: TelemetrySpan) => Promise<T>, options?: TelemetryMeasurementOptions): Promise<T>;
|
|
96
|
+
recordEvent(name: string, attributes?: TelemetryAttributes): void;
|
|
97
|
+
recordMeasurement(measurement: TelemetryMeasurement): void;
|
|
98
|
+
dispose?(): void;
|
|
99
|
+
}
|
|
100
|
+
export declare class NoopTelemetryService implements TelemetryService {
|
|
101
|
+
enabled: boolean;
|
|
102
|
+
readonly diagnostics: Readable<TelemetryDiagnosticsSnapshot>;
|
|
103
|
+
private readonly diagnosticsStore;
|
|
104
|
+
private config;
|
|
105
|
+
constructor(config?: Partial<TelemetryConfiguration>);
|
|
106
|
+
getConfiguration(): TelemetryConfiguration;
|
|
107
|
+
configure(config: Partial<TelemetryConfiguration>): void;
|
|
108
|
+
startSpan(name: string): TelemetrySpan;
|
|
109
|
+
measure<T>(name: string, callback: (span: TelemetrySpan) => T, _options?: TelemetryMeasurementOptions): T;
|
|
110
|
+
measureAsync<T>(name: string, callback: (span: TelemetrySpan) => Promise<T>, _options?: TelemetryMeasurementOptions): Promise<T>;
|
|
111
|
+
recordEvent(_name: string, _attributes?: TelemetryAttributes): void;
|
|
112
|
+
recordMeasurement(_measurement: TelemetryMeasurement): void;
|
|
113
|
+
dispose(): void;
|
|
114
|
+
private updateDiagnostics;
|
|
115
|
+
clearDiagnostics(): void;
|
|
116
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { writable } from "svelte/store";
|
|
2
|
+
export function createTelemetryDiagnosticsSnapshot(overrides = {}) {
|
|
3
|
+
return {
|
|
4
|
+
enabled: false,
|
|
5
|
+
debugLogging: false,
|
|
6
|
+
captureWebVitals: false,
|
|
7
|
+
sampleRate: 1,
|
|
8
|
+
slowSpanThresholdMs: 250,
|
|
9
|
+
otlpConfigured: false,
|
|
10
|
+
recentSlowSpans: [],
|
|
11
|
+
recentTraces: [],
|
|
12
|
+
recentMeasurements: [],
|
|
13
|
+
...overrides,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export function createTelemetryConfiguration(overrides = {}) {
|
|
17
|
+
return {
|
|
18
|
+
enabled: false,
|
|
19
|
+
captureWebVitals: false,
|
|
20
|
+
debugLogging: false,
|
|
21
|
+
persistDiagnostics: false,
|
|
22
|
+
sampleRate: 1,
|
|
23
|
+
slowSpanThresholdMs: 250,
|
|
24
|
+
...overrides,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
class NoopTelemetrySpan {
|
|
28
|
+
name;
|
|
29
|
+
startedAt = performance.now();
|
|
30
|
+
constructor(name) {
|
|
31
|
+
this.name = name;
|
|
32
|
+
}
|
|
33
|
+
setAttribute(_name, _value) { }
|
|
34
|
+
addEvent(_name, _attributes) { }
|
|
35
|
+
recordException(_error, _attributes) { }
|
|
36
|
+
end(_attributes) { }
|
|
37
|
+
}
|
|
38
|
+
export class NoopTelemetryService {
|
|
39
|
+
enabled = false;
|
|
40
|
+
diagnostics;
|
|
41
|
+
diagnosticsStore;
|
|
42
|
+
config;
|
|
43
|
+
constructor(config = {}) {
|
|
44
|
+
this.config = createTelemetryConfiguration(config);
|
|
45
|
+
this.enabled = this.config.enabled;
|
|
46
|
+
this.diagnosticsStore = writable(createTelemetryDiagnosticsSnapshot());
|
|
47
|
+
this.diagnostics = { subscribe: this.diagnosticsStore.subscribe };
|
|
48
|
+
this.updateDiagnostics();
|
|
49
|
+
}
|
|
50
|
+
getConfiguration() {
|
|
51
|
+
return { ...this.config };
|
|
52
|
+
}
|
|
53
|
+
configure(config) {
|
|
54
|
+
this.config = createTelemetryConfiguration({ ...this.config, ...config });
|
|
55
|
+
this.enabled = this.config.enabled;
|
|
56
|
+
this.updateDiagnostics();
|
|
57
|
+
}
|
|
58
|
+
startSpan(name) {
|
|
59
|
+
return new NoopTelemetrySpan(name);
|
|
60
|
+
}
|
|
61
|
+
measure(name, callback, _options) {
|
|
62
|
+
const span = this.startSpan(name);
|
|
63
|
+
try {
|
|
64
|
+
return callback(span);
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
span.recordException(error);
|
|
68
|
+
throw error;
|
|
69
|
+
}
|
|
70
|
+
finally {
|
|
71
|
+
span.end();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
async measureAsync(name, callback, _options) {
|
|
75
|
+
const span = this.startSpan(name);
|
|
76
|
+
try {
|
|
77
|
+
return await callback(span);
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
span.recordException(error);
|
|
81
|
+
throw error;
|
|
82
|
+
}
|
|
83
|
+
finally {
|
|
84
|
+
span.end();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
recordEvent(_name, _attributes) { }
|
|
88
|
+
recordMeasurement(_measurement) { }
|
|
89
|
+
dispose() { }
|
|
90
|
+
updateDiagnostics() {
|
|
91
|
+
this.diagnosticsStore.set(createTelemetryDiagnosticsSnapshot({
|
|
92
|
+
enabled: this.config.enabled,
|
|
93
|
+
debugLogging: this.config.debugLogging,
|
|
94
|
+
captureWebVitals: this.config.captureWebVitals,
|
|
95
|
+
sampleRate: this.config.sampleRate,
|
|
96
|
+
slowSpanThresholdMs: this.config.slowSpanThresholdMs,
|
|
97
|
+
otlpConfigured: !!this.config.otlpEndpoint,
|
|
98
|
+
}));
|
|
99
|
+
}
|
|
100
|
+
clearDiagnostics() {
|
|
101
|
+
this.updateDiagnostics();
|
|
102
|
+
}
|
|
103
|
+
}
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type ClassValue } from "clsx";
|
|
2
|
+
export declare const apiVersion = "1.12.3";
|
|
3
|
+
export interface Debouncer<T extends unknown[], V> {
|
|
4
|
+
(...args: [...T]): this;
|
|
5
|
+
cancel(): this;
|
|
6
|
+
run(): V | void;
|
|
7
|
+
}
|
|
8
|
+
export declare function debounce<T extends unknown[], V>(cb: (...args: [...T]) => V, timeout?: number, resetTimer?: boolean): Debouncer<T, V>;
|
|
9
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
|
10
|
+
export declare function uniqueId(salt?: string): string;
|
|
11
|
+
export declare function md5(inputString: string): string;
|
|
12
|
+
export declare function requireApiVersion(version: string): boolean;
|
|
13
|
+
export declare function arrayBufferToBase64(buffer: ArrayBuffer): string;
|
|
14
|
+
export declare function base64ToArrayBuffer(base64: string): ArrayBuffer;
|
|
15
|
+
export declare function arrayBufferToHex(buffer: ArrayBuffer): string;
|
|
16
|
+
export declare function hexToArrayBuffer(hex: string): ArrayBuffer;
|
|
17
|
+
export declare function getBlobArrayBuffer(blob: Blob): Promise<ArrayBuffer>;
|
|
18
|
+
export interface RequestUrlParam {
|
|
19
|
+
url: string;
|
|
20
|
+
method?: string;
|
|
21
|
+
body?: string | ArrayBuffer;
|
|
22
|
+
headers?: Record<string, string>;
|
|
23
|
+
contentType?: string;
|
|
24
|
+
throw?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface RequestUrlResponse {
|
|
27
|
+
status: number;
|
|
28
|
+
headers: Record<string, string>;
|
|
29
|
+
arrayBuffer: ArrayBuffer;
|
|
30
|
+
json: any;
|
|
31
|
+
text: string;
|
|
32
|
+
}
|
|
33
|
+
export type RequestUrlResponsePromise = Promise<RequestUrlResponse>;
|
|
34
|
+
export declare function requestUrl(request: RequestUrlParam | string): RequestUrlResponsePromise;
|
|
35
|
+
export declare function request(request: RequestUrlParam | string): Promise<string>;
|
|
36
|
+
export interface LinktextParts {
|
|
37
|
+
path: string;
|
|
38
|
+
subpath?: string;
|
|
39
|
+
}
|
|
40
|
+
export declare function parseLinktext(linktext: string): LinktextParts;
|
|
41
|
+
export declare function getLinkpath(linktext: string): string;
|
|
42
|
+
export declare function stripHeading(heading: string): string;
|
|
43
|
+
export declare function stripHeadingForLink(heading: string): string;
|
|
44
|
+
export declare function parseYaml(yaml: string): any;
|
|
45
|
+
export declare function stringifyYaml(data: Record<string, any>): string;
|
|
46
|
+
export declare function htmlToMarkdown(html: string): string;
|
|
47
|
+
interface TooltipOptions {
|
|
48
|
+
placement?: "bottom" | "right" | "left" | "top";
|
|
49
|
+
classes?: string[];
|
|
50
|
+
delay?: number;
|
|
51
|
+
gap?: number;
|
|
52
|
+
}
|
|
53
|
+
export declare function setTooltip(el: HTMLElement, tooltip: string, options?: TooltipOptions): void;
|
|
54
|
+
export declare function displayTooltip(el: HTMLElement, tooltip: string, options?: TooltipOptions): void;
|
|
55
|
+
export {};
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
3
|
+
export const apiVersion = "1.12.3";
|
|
4
|
+
export function debounce(cb, timeout = 0, resetTimer = true) {
|
|
5
|
+
let timer = null;
|
|
6
|
+
let lastArgs = null;
|
|
7
|
+
let lastThis;
|
|
8
|
+
const clear = () => {
|
|
9
|
+
if (timer !== null) {
|
|
10
|
+
clearTimeout(timer);
|
|
11
|
+
timer = null;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
const invoke = () => {
|
|
15
|
+
if (!lastArgs)
|
|
16
|
+
return;
|
|
17
|
+
const args = lastArgs;
|
|
18
|
+
const thisArg = lastThis;
|
|
19
|
+
lastArgs = null;
|
|
20
|
+
lastThis = undefined;
|
|
21
|
+
clear();
|
|
22
|
+
return cb.apply(thisArg, args);
|
|
23
|
+
};
|
|
24
|
+
const debounced = function (...args) {
|
|
25
|
+
lastArgs = args;
|
|
26
|
+
lastThis = this;
|
|
27
|
+
if (resetTimer || timer === null) {
|
|
28
|
+
clear();
|
|
29
|
+
timer = setTimeout(invoke, timeout);
|
|
30
|
+
}
|
|
31
|
+
return debounced;
|
|
32
|
+
};
|
|
33
|
+
debounced.cancel = () => {
|
|
34
|
+
clear();
|
|
35
|
+
lastArgs = null;
|
|
36
|
+
lastThis = undefined;
|
|
37
|
+
return debounced;
|
|
38
|
+
};
|
|
39
|
+
debounced.run = () => invoke();
|
|
40
|
+
return debounced;
|
|
41
|
+
}
|
|
42
|
+
export function cn(...inputs) {
|
|
43
|
+
return twMerge(clsx("mod-tw", inputs));
|
|
44
|
+
}
|
|
45
|
+
export function uniqueId(salt = "") {
|
|
46
|
+
return md5(`${salt}:${Date.now().toString(36) + Math.random().toString(36)}`);
|
|
47
|
+
}
|
|
48
|
+
export function md5(inputString) {
|
|
49
|
+
const hc = "0123456789abcdef";
|
|
50
|
+
function rh(n) {
|
|
51
|
+
let s = "";
|
|
52
|
+
for (let j = 0; j <= 3; j++) {
|
|
53
|
+
s +=
|
|
54
|
+
hc.charAt((n >> (j * 8 + 4)) & 0x0f) + hc.charAt((n >> (j * 8)) & 0x0f);
|
|
55
|
+
}
|
|
56
|
+
return s;
|
|
57
|
+
}
|
|
58
|
+
function ad(x, y) {
|
|
59
|
+
const l = (x & 0xffff) + (y & 0xffff);
|
|
60
|
+
const m = (x >> 16) + (y >> 16) + (l >> 16);
|
|
61
|
+
return (m << 16) | (l & 0xffff);
|
|
62
|
+
}
|
|
63
|
+
function rl(n, c) {
|
|
64
|
+
return (n << c) | (n >>> (32 - c));
|
|
65
|
+
}
|
|
66
|
+
function cm(q, a, b, x, s, t) {
|
|
67
|
+
return ad(rl(ad(ad(a, q), ad(x, t)), s), b);
|
|
68
|
+
}
|
|
69
|
+
function ff(a, b, c, d, x, s, t) {
|
|
70
|
+
return cm((b & c) | (~b & d), a, b, x, s, t);
|
|
71
|
+
}
|
|
72
|
+
function gg(a, b, c, d, x, s, t) {
|
|
73
|
+
return cm((b & d) | (c & ~d), a, b, x, s, t);
|
|
74
|
+
}
|
|
75
|
+
function hh(a, b, c, d, x, s, t) {
|
|
76
|
+
return cm(b ^ c ^ d, a, b, x, s, t);
|
|
77
|
+
}
|
|
78
|
+
function ii(a, b, c, d, x, s, t) {
|
|
79
|
+
return cm(c ^ (b | ~d), a, b, x, s, t);
|
|
80
|
+
}
|
|
81
|
+
function sb(x) {
|
|
82
|
+
const nblk = ((x.length + 8) >> 6) + 1;
|
|
83
|
+
const blks = Array(nblk * 16).fill(0);
|
|
84
|
+
for (let i = 0; i < x.length; i++) {
|
|
85
|
+
blks[i >> 2] |= x.charCodeAt(i) << ((i % 4) * 8);
|
|
86
|
+
}
|
|
87
|
+
blks[x.length >> 2] |= 0x80 << ((x.length % 4) * 8);
|
|
88
|
+
blks[nblk * 16 - 2] = x.length * 8;
|
|
89
|
+
return blks;
|
|
90
|
+
}
|
|
91
|
+
const x = sb(inputString);
|
|
92
|
+
let a = 1732584193;
|
|
93
|
+
let b = -271733879;
|
|
94
|
+
let c = -1732584194;
|
|
95
|
+
let d = 271733878;
|
|
96
|
+
for (let i = 0; i < x.length; i += 16) {
|
|
97
|
+
const olda = a;
|
|
98
|
+
const oldb = b;
|
|
99
|
+
const oldc = c;
|
|
100
|
+
const oldd = d;
|
|
101
|
+
a = ff(a, b, c, d, x[i + 0], 7, -680876936);
|
|
102
|
+
d = ff(d, a, b, c, x[i + 1], 12, -389564586);
|
|
103
|
+
c = ff(c, d, a, b, x[i + 2], 17, 606105819);
|
|
104
|
+
b = ff(b, c, d, a, x[i + 3], 22, -1044525330);
|
|
105
|
+
a = ff(a, b, c, d, x[i + 4], 7, -176418897);
|
|
106
|
+
d = ff(d, a, b, c, x[i + 5], 12, 1200080426);
|
|
107
|
+
c = ff(c, d, a, b, x[i + 6], 17, -1473231341);
|
|
108
|
+
b = ff(b, c, d, a, x[i + 7], 22, -45705983);
|
|
109
|
+
a = ff(a, b, c, d, x[i + 8], 7, 1770035416);
|
|
110
|
+
d = ff(d, a, b, c, x[i + 9], 12, -1958414417);
|
|
111
|
+
c = ff(c, d, a, b, x[i + 10], 17, -42063);
|
|
112
|
+
b = ff(b, c, d, a, x[i + 11], 22, -1990404162);
|
|
113
|
+
a = ff(a, b, c, d, x[i + 12], 7, 1804603682);
|
|
114
|
+
d = ff(d, a, b, c, x[i + 13], 12, -40341101);
|
|
115
|
+
c = ff(c, d, a, b, x[i + 14], 17, -1502002290);
|
|
116
|
+
b = ff(b, c, d, a, x[i + 15], 22, 1236535329);
|
|
117
|
+
a = gg(a, b, c, d, x[i + 1], 5, -165796510);
|
|
118
|
+
d = gg(d, a, b, c, x[i + 6], 9, -1069501632);
|
|
119
|
+
c = gg(c, d, a, b, x[i + 11], 14, 643717713);
|
|
120
|
+
b = gg(b, c, d, a, x[i + 0], 20, -373897302);
|
|
121
|
+
a = gg(a, b, c, d, x[i + 5], 5, -701558691);
|
|
122
|
+
d = gg(d, a, b, c, x[i + 10], 9, 38016083);
|
|
123
|
+
c = gg(c, d, a, b, x[i + 15], 14, -660478335);
|
|
124
|
+
b = gg(b, c, d, a, x[i + 4], 20, -405537848);
|
|
125
|
+
a = gg(a, b, c, d, x[i + 9], 5, 568446438);
|
|
126
|
+
d = gg(d, a, b, c, x[i + 14], 9, -1019803690);
|
|
127
|
+
c = gg(c, d, a, b, x[i + 3], 14, -187363961);
|
|
128
|
+
b = gg(b, c, d, a, x[i + 8], 20, 1163531501);
|
|
129
|
+
a = gg(a, b, c, d, x[i + 13], 5, -1444681467);
|
|
130
|
+
d = gg(d, a, b, c, x[i + 2], 9, -51403784);
|
|
131
|
+
c = gg(c, d, a, b, x[i + 7], 14, 1735328473);
|
|
132
|
+
b = gg(b, c, d, a, x[i + 12], 20, -1926607734);
|
|
133
|
+
a = hh(a, b, c, d, x[i + 5], 4, -378558);
|
|
134
|
+
d = hh(d, a, b, c, x[i + 8], 11, -2022574463);
|
|
135
|
+
c = hh(c, d, a, b, x[i + 11], 16, 1839030562);
|
|
136
|
+
b = hh(b, c, d, a, x[i + 14], 23, -35309556);
|
|
137
|
+
a = hh(a, b, c, d, x[i + 1], 4, -1530992060);
|
|
138
|
+
d = hh(d, a, b, c, x[i + 4], 11, 1272893353);
|
|
139
|
+
c = hh(c, d, a, b, x[i + 7], 16, -155497632);
|
|
140
|
+
b = hh(b, c, d, a, x[i + 10], 23, -1094730640);
|
|
141
|
+
a = hh(a, b, c, d, x[i + 13], 4, 681279174);
|
|
142
|
+
d = hh(d, a, b, c, x[i + 0], 11, -358537222);
|
|
143
|
+
c = hh(c, d, a, b, x[i + 3], 16, -722521979);
|
|
144
|
+
b = hh(b, c, d, a, x[i + 6], 23, 76029189);
|
|
145
|
+
a = hh(a, b, c, d, x[i + 9], 4, -640364487);
|
|
146
|
+
d = hh(d, a, b, c, x[i + 12], 11, -421815835);
|
|
147
|
+
c = hh(c, d, a, b, x[i + 15], 16, 530742520);
|
|
148
|
+
b = hh(b, c, d, a, x[i + 2], 23, -995338651);
|
|
149
|
+
a = ii(a, b, c, d, x[i + 0], 6, -198630844);
|
|
150
|
+
d = ii(d, a, b, c, x[i + 7], 10, 1126891415);
|
|
151
|
+
c = ii(c, d, a, b, x[i + 14], 15, -1416354905);
|
|
152
|
+
b = ii(b, c, d, a, x[i + 5], 21, -57434055);
|
|
153
|
+
a = ii(a, b, c, d, x[i + 12], 6, 1700485571);
|
|
154
|
+
d = ii(d, a, b, c, x[i + 3], 10, -1894986606);
|
|
155
|
+
c = ii(c, d, a, b, x[i + 10], 15, -1051523);
|
|
156
|
+
b = ii(b, c, d, a, x[i + 1], 21, -2054922799);
|
|
157
|
+
a = ii(a, b, c, d, x[i + 8], 6, 1873313359);
|
|
158
|
+
d = ii(d, a, b, c, x[i + 15], 10, -30611744);
|
|
159
|
+
c = ii(c, d, a, b, x[i + 6], 15, -1560198380);
|
|
160
|
+
b = ii(b, c, d, a, x[i + 13], 21, 1309151649);
|
|
161
|
+
a = ii(a, b, c, d, x[i + 4], 6, -145523070);
|
|
162
|
+
d = ii(d, a, b, c, x[i + 11], 10, -1120210379);
|
|
163
|
+
c = ii(c, d, a, b, x[i + 2], 15, 718787259);
|
|
164
|
+
b = ii(b, c, d, a, x[i + 9], 21, -343485551);
|
|
165
|
+
a = ad(a, olda);
|
|
166
|
+
b = ad(b, oldb);
|
|
167
|
+
c = ad(c, oldc);
|
|
168
|
+
d = ad(d, oldd);
|
|
169
|
+
}
|
|
170
|
+
return rh(a) + rh(b) + rh(c) + rh(d);
|
|
171
|
+
}
|
|
172
|
+
export function requireApiVersion(version) {
|
|
173
|
+
const current = apiVersion.split(".").map(Number);
|
|
174
|
+
const required = version.split(".").map(Number);
|
|
175
|
+
for (let i = 0; i < Math.max(current.length, required.length); i++) {
|
|
176
|
+
const a = current[i] ?? 0;
|
|
177
|
+
const b = required[i] ?? 0;
|
|
178
|
+
if (a > b)
|
|
179
|
+
return true;
|
|
180
|
+
if (a < b)
|
|
181
|
+
return false;
|
|
182
|
+
}
|
|
183
|
+
return true;
|
|
184
|
+
}
|
|
185
|
+
export function arrayBufferToBase64(buffer) {
|
|
186
|
+
const bytes = new Uint8Array(buffer);
|
|
187
|
+
let binary = "";
|
|
188
|
+
bytes.forEach((byte) => {
|
|
189
|
+
binary += String.fromCharCode(byte);
|
|
190
|
+
});
|
|
191
|
+
return btoa(binary);
|
|
192
|
+
}
|
|
193
|
+
export function base64ToArrayBuffer(base64) {
|
|
194
|
+
const binary = atob(base64);
|
|
195
|
+
const bytes = new Uint8Array(binary.length);
|
|
196
|
+
for (let i = 0; i < binary.length; i++) {
|
|
197
|
+
bytes[i] = binary.charCodeAt(i);
|
|
198
|
+
}
|
|
199
|
+
return bytes.buffer;
|
|
200
|
+
}
|
|
201
|
+
export function arrayBufferToHex(buffer) {
|
|
202
|
+
return [...new Uint8Array(buffer)]
|
|
203
|
+
.map((byte) => byte.toString(16).padStart(2, "0"))
|
|
204
|
+
.join("");
|
|
205
|
+
}
|
|
206
|
+
export function hexToArrayBuffer(hex) {
|
|
207
|
+
const bytes = new Uint8Array(hex.length / 2);
|
|
208
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
209
|
+
bytes[i] = parseInt(hex.slice(i * 2, i * 2 + 2), 16);
|
|
210
|
+
}
|
|
211
|
+
return bytes.buffer;
|
|
212
|
+
}
|
|
213
|
+
export function getBlobArrayBuffer(blob) {
|
|
214
|
+
return blob.arrayBuffer();
|
|
215
|
+
}
|
|
216
|
+
export async function requestUrl(request) {
|
|
217
|
+
const params = typeof request === "string" ? { url: request } : request;
|
|
218
|
+
const headers = new Headers(params.headers);
|
|
219
|
+
if (params.contentType) {
|
|
220
|
+
headers.set("content-type", params.contentType);
|
|
221
|
+
}
|
|
222
|
+
const response = await fetch(params.url, {
|
|
223
|
+
method: params.method,
|
|
224
|
+
headers,
|
|
225
|
+
body: params.body,
|
|
226
|
+
});
|
|
227
|
+
if (params.throw !== false && !response.ok) {
|
|
228
|
+
throw new Error(`Request failed: ${response.status} ${response.statusText}`);
|
|
229
|
+
}
|
|
230
|
+
const arrayBuffer = await response.arrayBuffer();
|
|
231
|
+
const text = new TextDecoder().decode(arrayBuffer);
|
|
232
|
+
let json = null;
|
|
233
|
+
try {
|
|
234
|
+
json = text ? JSON.parse(text) : null;
|
|
235
|
+
}
|
|
236
|
+
catch { }
|
|
237
|
+
return {
|
|
238
|
+
status: response.status,
|
|
239
|
+
headers: Object.fromEntries(response.headers.entries()),
|
|
240
|
+
arrayBuffer,
|
|
241
|
+
json,
|
|
242
|
+
text,
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
export function request(request) {
|
|
246
|
+
return requestUrl(request).then((response) => response.text);
|
|
247
|
+
}
|
|
248
|
+
export function parseLinktext(linktext) {
|
|
249
|
+
const [path, ...subpath] = linktext.split("#");
|
|
250
|
+
return {
|
|
251
|
+
path,
|
|
252
|
+
subpath: subpath.length ? `#${subpath.join("#")}` : undefined,
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
export function getLinkpath(linktext) {
|
|
256
|
+
return parseLinktext(linktext).path;
|
|
257
|
+
}
|
|
258
|
+
export function stripHeading(heading) {
|
|
259
|
+
return heading.replace(/^#+\s*/, "").trim();
|
|
260
|
+
}
|
|
261
|
+
export function stripHeadingForLink(heading) {
|
|
262
|
+
return stripHeading(heading)
|
|
263
|
+
.replace(/[[\]#|]/g, "")
|
|
264
|
+
.replace(/\s+/g, " ")
|
|
265
|
+
.trim();
|
|
266
|
+
}
|
|
267
|
+
export function parseYaml(yaml) {
|
|
268
|
+
const result = {};
|
|
269
|
+
for (const line of yaml.split(/\r?\n/)) {
|
|
270
|
+
const match = /^([^:#][^:]*):\s*(.*)$/.exec(line);
|
|
271
|
+
if (!match)
|
|
272
|
+
continue;
|
|
273
|
+
const value = match[2].trim();
|
|
274
|
+
if (value === "true" || value === "false") {
|
|
275
|
+
result[match[1].trim()] = value === "true";
|
|
276
|
+
}
|
|
277
|
+
else if (/^-?\d+(\.\d+)?$/.test(value)) {
|
|
278
|
+
result[match[1].trim()] = Number(value);
|
|
279
|
+
}
|
|
280
|
+
else if (value.startsWith("[") && value.endsWith("]")) {
|
|
281
|
+
result[match[1].trim()] = value
|
|
282
|
+
.slice(1, -1)
|
|
283
|
+
.split(",")
|
|
284
|
+
.map((item) => item.trim())
|
|
285
|
+
.filter(Boolean);
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
result[match[1].trim()] = value.replace(/^['"]|['"]$/g, "");
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
return result;
|
|
292
|
+
}
|
|
293
|
+
export function stringifyYaml(data) {
|
|
294
|
+
return Object.entries(data)
|
|
295
|
+
.map(([key, value]) => {
|
|
296
|
+
if (Array.isArray(value)) {
|
|
297
|
+
return `${key}: [${value.join(", ")}]`;
|
|
298
|
+
}
|
|
299
|
+
return `${key}: ${value}`;
|
|
300
|
+
})
|
|
301
|
+
.join("\n");
|
|
302
|
+
}
|
|
303
|
+
export function htmlToMarkdown(html) {
|
|
304
|
+
const el = document.createElement("div");
|
|
305
|
+
el.innerHTML = html;
|
|
306
|
+
return el.textContent ?? "";
|
|
307
|
+
}
|
|
308
|
+
export function setTooltip(el, tooltip, options) {
|
|
309
|
+
el.dataset.tooltip = tooltip;
|
|
310
|
+
el.dataset.tooltipPosition = options?.placement ?? "top";
|
|
311
|
+
}
|
|
312
|
+
export function displayTooltip(el, tooltip, options) {
|
|
313
|
+
setTooltip(el, tooltip, options);
|
|
314
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { TAbstractFile, TFile, TFolder } from "./storage/fs";
|
|
2
|
+
export type { DataAdapter, DataWriteOptions, ListedFiles, Stat, VaultAdapter, } from "./storage/fs";
|
|
3
|
+
export { MemoryVaultAdapter } from "./storage/memory-vault-adapter";
|
|
4
|
+
export type { MemoryVaultAdapterOptions } from "./storage/memory-vault-adapter";
|
|
5
|
+
export { Vault } from "./storage/vault.svelte";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { App } from "./context.svelte";
|
|
2
|
+
export declare const REBUILD_VAULT_CACHE_COMMAND_ID = "app:rebuild-vault-cache";
|
|
3
|
+
export declare const REBUILD_GENERATED_STATE_COMMAND_ID = "app:rebuild-generated-state";
|
|
4
|
+
export declare const SEARCH_REBUILD_INDEX_COMMAND_ID = "search:rebuild-search-index";
|
|
5
|
+
export declare function installVaultMaintenanceCommands(app: App): void;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export const REBUILD_VAULT_CACHE_COMMAND_ID = "app:rebuild-vault-cache";
|
|
2
|
+
export const REBUILD_GENERATED_STATE_COMMAND_ID = "app:rebuild-generated-state";
|
|
3
|
+
export const SEARCH_REBUILD_INDEX_COMMAND_ID = "search:rebuild-search-index";
|
|
4
|
+
export function installVaultMaintenanceCommands(app) {
|
|
5
|
+
app.commands.registerCommand({
|
|
6
|
+
id: REBUILD_VAULT_CACHE_COMMAND_ID,
|
|
7
|
+
name: "Rebuild vault cache",
|
|
8
|
+
title: "Rebuild vault cache",
|
|
9
|
+
category: "Vault",
|
|
10
|
+
icon: "refresh-cw",
|
|
11
|
+
sourcePlugin: "app",
|
|
12
|
+
callback: () => {
|
|
13
|
+
void app.metadataCache.rebuild();
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
app.commands.registerCommand({
|
|
17
|
+
id: REBUILD_GENERATED_STATE_COMMAND_ID,
|
|
18
|
+
name: "Rebuild generated metadata and search state",
|
|
19
|
+
title: "Rebuild generated metadata and search state",
|
|
20
|
+
category: "Vault",
|
|
21
|
+
icon: "database-zap",
|
|
22
|
+
sourcePlugin: "app",
|
|
23
|
+
callback: async () => {
|
|
24
|
+
await app.metadataCache.rebuild();
|
|
25
|
+
if (app.commands.getCommand(SEARCH_REBUILD_INDEX_COMMAND_ID)) {
|
|
26
|
+
await app.commands.executeCommand(SEARCH_REBUILD_INDEX_COMMAND_ID);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
await app.appDatabase.rebuildSearchIndex();
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
}
|