@lapis-notes/api 0.1.0 → 0.1.3
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 +39 -0
- package/README.md +5 -0
- package/dist/app-database-host.d.ts +1 -0
- package/dist/app-database-host.js +1 -0
- package/dist/browser-sync-security.d.ts +45 -0
- package/dist/browser-sync-security.js +189 -0
- package/dist/build-tools/vite.d.ts +15 -0
- package/dist/build-tools/vite.js +36 -0
- package/dist/cache.svelte.d.ts +1 -1
- package/dist/cache.svelte.js +4 -1
- package/dist/components/editor/editor.css +54 -2
- package/dist/components/editor/extensions/lint/lapis-lint-tooltip.svelte +18 -5
- package/dist/components/editor/extensions/lint/lint-tooltip-actions.d.ts +0 -2
- package/dist/components/editor/extensions/lint/lint-tooltip-actions.js +0 -14
- package/dist/components/editor/language-service/index.js +23 -2
- package/dist/components/icon/icon-list.svelte.d.ts +1 -1
- package/dist/components/select/select.svelte.d.ts +1 -1
- package/dist/context.svelte.d.ts +11 -1
- package/dist/context.svelte.js +38 -1
- package/dist/docs-api.d.ts +2 -0
- package/dist/docs-api.js +1 -0
- package/dist/generated/plugin-host-modules.schema.generated.d.ts +443 -13
- package/dist/generated/plugin-host-modules.schema.generated.js +970 -306
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/language-service/manager.d.ts +5 -0
- package/dist/language-service/manager.js +58 -14
- package/dist/lapis-extension.d.ts +1 -1
- package/dist/lapis-extension.js +12 -0
- package/dist/nostr-signer.d.ts +68 -0
- package/dist/nostr-signer.js +49 -0
- package/dist/plugin-asset-server.d.ts +1 -0
- package/dist/plugin-asset-server.js +3 -0
- package/dist/plugin-capability-facade.d.ts +1 -1
- package/dist/plugin-capability-facade.js +6 -0
- package/dist/plugin-distribution/catalog-media.d.ts +4 -0
- package/dist/plugin-distribution/catalog-media.js +40 -0
- package/dist/plugin-distribution/download-stats.d.ts +4 -0
- package/dist/plugin-distribution/download-stats.js +19 -0
- package/dist/plugin-distribution/index.d.ts +4 -0
- package/dist/plugin-distribution/index.js +4 -0
- package/dist/plugin-distribution/installer.d.ts +3 -0
- package/dist/plugin-distribution/installer.js +26 -3
- package/dist/plugin-distribution/manager.d.ts +71 -5
- package/dist/plugin-distribution/manager.js +376 -37
- package/dist/plugin-distribution/nostr-registry-adapter.d.ts +29 -0
- package/dist/plugin-distribution/nostr-registry-adapter.js +152 -0
- package/dist/plugin-distribution/plugin-bundle-verifier.d.ts +43 -0
- package/dist/plugin-distribution/plugin-bundle-verifier.js +64 -1
- package/dist/plugin-distribution/plugin-bundle.d.ts +14 -0
- package/dist/plugin-distribution/plugin-bundle.js +46 -7
- package/dist/plugin-distribution/plugin-markdown.d.ts +6 -0
- package/dist/plugin-distribution/plugin-markdown.js +94 -0
- package/dist/plugin-distribution/registry-client.d.ts +6 -1
- package/dist/plugin-distribution/registry-client.js +32 -10
- package/dist/plugin-distribution/registry-source-state.d.ts +15 -0
- package/dist/plugin-distribution/registry-source-state.js +42 -0
- package/dist/plugin-distribution/schemas.d.ts +2511 -2824
- package/dist/plugin-distribution/schemas.js +111 -42
- package/dist/plugin-distribution/types.d.ts +116 -5
- package/dist/plugin-distribution-host.d.ts +4 -0
- package/dist/plugin-distribution-host.js +2 -0
- package/dist/plugin-install-progress.js +1 -1
- package/dist/plugin-manager.d.ts +3 -0
- package/dist/plugin-manager.js +21 -13
- package/dist/plugin-settings.d.ts +21 -0
- package/dist/plugin-settings.js +41 -0
- package/dist/plugin.d.ts +13 -0
- package/dist/plugin.js +56 -0
- package/dist/registry-schema/catalog-v1.d.ts +4143 -0
- package/dist/registry-schema/catalog-v1.js +172 -0
- package/dist/registry-schema/catalog-v2.d.ts +5275 -0
- package/dist/registry-schema/catalog-v2.js +137 -0
- package/dist/registry-schema/index.d.ts +1 -0
- package/dist/registry-schema/index.js +1 -0
- package/dist/registry-schema/release-notes.d.ts +5 -0
- package/dist/registry-schema/release-notes.js +21 -0
- package/dist/server-host.d.ts +28 -0
- package/dist/server-host.js +17 -0
- package/dist/storage/app-database.d.ts +37 -2
- package/dist/storage/app-database.js +41 -1
- package/dist/storage/browser-coordinated-app-database.d.ts +3 -1
- package/dist/storage/browser-coordinated-app-database.js +8 -0
- package/dist/storage/browser.d.ts +4 -1
- package/dist/storage/browser.js +84 -0
- package/dist/storage/desktop-native.d.ts +4 -2
- package/dist/storage/desktop-native.js +90 -1
- package/dist/storage/fs.d.ts +17 -0
- package/dist/storage/index.d.ts +1 -0
- package/dist/storage/index.js +1 -0
- package/dist/storage/memory-vault-adapter.d.ts +3 -1
- package/dist/storage/memory-vault-adapter.js +60 -0
- package/dist/storage/remote-app-database.d.ts +19 -0
- package/dist/storage/remote-app-database.js +130 -0
- package/dist/storage/task-projection.d.ts +2 -1
- package/dist/storage/task-projection.js +7 -2
- package/dist/storage/turso-app-database.d.ts +3 -1
- package/dist/storage/turso-app-database.js +45 -0
- package/dist/storage/vault-session.js +11 -0
- package/dist/storage/vault-state.d.ts +1 -1
- package/dist/storage/vault.svelte.d.ts +3 -1
- package/dist/storage/vault.svelte.js +76 -3
- package/dist/sync-host-security.d.ts +285 -0
- package/dist/sync-host-security.js +2237 -0
- package/dist/sync-host.d.ts +179 -0
- package/dist/sync-host.js +769 -0
- package/dist/workspace.svelte.d.ts +1 -1
- package/dist/workspace.svelte.js +1 -1
- package/package.json +48 -10
|
@@ -2,7 +2,9 @@ import { EventDispatcher } from "../events";
|
|
|
2
2
|
import type { DataAdapter } from "../storage/fs";
|
|
3
3
|
import { type PluginBinaryFetch, type PluginInstallerManager } from "./installer";
|
|
4
4
|
import type { PluginBundleVerificationMode } from "./plugin-bundle-worker";
|
|
5
|
-
import
|
|
5
|
+
import { type ParsedNostrPluginBundle } from "./plugin-bundle";
|
|
6
|
+
import type { VerifiedPluginBundlePayload } from "./plugin-bundle-verifier";
|
|
7
|
+
import type { InstalledPluginRecord, PluginCatalogDetail, PluginCatalogEntry, PluginCatalogIndex, PluginCompatibilityResult, PluginDownloadStatsSummary, PluginPlatform, PluginProvenance, PluginRegistryChannel, PluginRevocationIndex, PluginRevocationRecord, PluginRegistrySource, PluginRegistrySourceKind, PluginRegistrySourceState, TrustedSigningKey } from "./types";
|
|
6
8
|
export type PluginInstallPhase = "resolving" | "fetching-catalog" | "fetching-release" | "verifying-signature" | "downloading-bundle" | "verifying-bundle" | "extracting-files" | "verifying-files" | "staging" | "installing" | "loading" | "enabling" | "complete" | "failed";
|
|
7
9
|
export interface PluginInstallProgressEvent {
|
|
8
10
|
pluginId: string;
|
|
@@ -64,9 +66,16 @@ export interface PluginDistributionManager {
|
|
|
64
66
|
refreshCatalog(options?: {
|
|
65
67
|
force?: boolean;
|
|
66
68
|
}): Promise<PluginCatalogIndex>;
|
|
69
|
+
getDownloadStats?(options?: {
|
|
70
|
+
force?: boolean;
|
|
71
|
+
}): Promise<PluginDownloadStatsSummary | null>;
|
|
72
|
+
listSources(): readonly PluginRegistrySourceState[];
|
|
73
|
+
setSourceEnabled(sourceId: string, enabled: boolean): Promise<void>;
|
|
67
74
|
search(query?: PluginSearchQuery): PluginCatalogEntry[];
|
|
68
75
|
getCatalogEntry(pluginId: string): PluginCatalogEntry | undefined;
|
|
69
|
-
getPluginDetail(pluginId: string
|
|
76
|
+
getPluginDetail(pluginId: string, options?: {
|
|
77
|
+
registryId?: string;
|
|
78
|
+
}): Promise<PluginCatalogDetail | null>;
|
|
70
79
|
install(pluginId: string, options?: InstallPluginOptions): Promise<InstalledPluginRecord>;
|
|
71
80
|
installBundle(bundle: ArrayBuffer | Uint8Array, options?: InstallPluginBundleOptions): Promise<InstalledPluginRecord>;
|
|
72
81
|
update(pluginId: string, version?: string, options?: UpdatePluginOptions): Promise<InstalledPluginRecord | null>;
|
|
@@ -76,6 +85,39 @@ export interface PluginDistributionManager {
|
|
|
76
85
|
listUpdates(): Promise<PluginUpdateInfo[]>;
|
|
77
86
|
addProgressListener(listener: PluginInstallProgressListener): () => void;
|
|
78
87
|
}
|
|
88
|
+
export interface PluginRegistryAdapterRefreshResult {
|
|
89
|
+
index: PluginCatalogIndex;
|
|
90
|
+
revocations?: PluginRevocationIndex;
|
|
91
|
+
/** Nostr adapters set this only after their configured relay quorum agrees. */
|
|
92
|
+
installReady: boolean;
|
|
93
|
+
stale?: boolean;
|
|
94
|
+
message?: string;
|
|
95
|
+
}
|
|
96
|
+
export interface PluginRegistryAdapter {
|
|
97
|
+
refresh(source: PluginRegistrySource, options?: {
|
|
98
|
+
force?: boolean;
|
|
99
|
+
}): Promise<PluginRegistryAdapterRefreshResult>;
|
|
100
|
+
getDetail(source: PluginRegistrySource, entry: PluginCatalogEntry): Promise<PluginCatalogDetail>;
|
|
101
|
+
getDownloadStats?(source: PluginRegistrySource, options?: {
|
|
102
|
+
force?: boolean;
|
|
103
|
+
}): Promise<PluginDownloadStatsSummary | null>;
|
|
104
|
+
/**
|
|
105
|
+
* Nostr adapters verify the portable proof and payload before returning it.
|
|
106
|
+
* The manager still applies compatibility, runtime, staging, and lifecycle
|
|
107
|
+
* checks through the normal installer.
|
|
108
|
+
*/
|
|
109
|
+
getVerifiedBundle?(source: PluginRegistrySource, entry: PluginCatalogEntry, detail: PluginCatalogDetail, version: string, options?: {
|
|
110
|
+
signal?: AbortSignal;
|
|
111
|
+
}): Promise<VerifiedPluginBundlePayload>;
|
|
112
|
+
/** Verify a self-contained offline Nostr bundle without claiming freshness. */
|
|
113
|
+
verifyOfflineBundle?(source: PluginRegistrySource, bundle: ParsedNostrPluginBundle, options?: {
|
|
114
|
+
signal?: AbortSignal;
|
|
115
|
+
}): Promise<VerifiedPluginBundlePayload>;
|
|
116
|
+
/** Revalidate a stored Nostr proof against a live install-ready source. */
|
|
117
|
+
revalidateInstalledProof?(source: PluginRegistrySource, record: InstalledPluginRecord, options?: {
|
|
118
|
+
signal?: AbortSignal;
|
|
119
|
+
}): Promise<NonNullable<InstalledPluginRecord["nostrProof"]>>;
|
|
120
|
+
}
|
|
79
121
|
export interface DefaultPluginDistributionManagerOptions {
|
|
80
122
|
adapter: DataAdapter;
|
|
81
123
|
appVersion: string;
|
|
@@ -86,6 +128,7 @@ export interface DefaultPluginDistributionManagerOptions {
|
|
|
86
128
|
fetch?: PluginBinaryFetch;
|
|
87
129
|
pluginManager?: PluginInstallerManager;
|
|
88
130
|
bundleVerification?: PluginBundleVerificationMode;
|
|
131
|
+
registryAdapters?: Partial<Record<PluginRegistrySourceKind, PluginRegistryAdapter>>;
|
|
89
132
|
}
|
|
90
133
|
export declare const DEFAULT_OFFICIAL_PLUGIN_REGISTRY_SOURCE: PluginRegistrySource;
|
|
91
134
|
export declare const DEFAULT_PLUGIN_REGISTRY_SOURCES: PluginRegistrySource[];
|
|
@@ -95,34 +138,57 @@ export declare class DefaultPluginDistributionManager extends EventDispatcher<{
|
|
|
95
138
|
}> implements PluginDistributionManager {
|
|
96
139
|
private readonly options;
|
|
97
140
|
private catalog;
|
|
98
|
-
private readonly
|
|
141
|
+
private readonly httpClients;
|
|
142
|
+
private readonly sourceCatalogs;
|
|
99
143
|
private readonly stateStore;
|
|
144
|
+
private readonly sourcePreferenceStore;
|
|
100
145
|
private readonly installer;
|
|
101
|
-
private
|
|
146
|
+
private registries;
|
|
102
147
|
private readonly trustedKeys;
|
|
148
|
+
private readonly registryAdapters;
|
|
149
|
+
private readonly sourceStates;
|
|
150
|
+
private readonly entrySources;
|
|
103
151
|
private installedIds;
|
|
104
152
|
private revocations;
|
|
153
|
+
private sourcePreferencesLoaded;
|
|
105
154
|
constructor(options: DefaultPluginDistributionManagerOptions);
|
|
106
155
|
refreshCatalog(_options?: {
|
|
107
156
|
force?: boolean;
|
|
108
157
|
}): Promise<PluginCatalogIndex>;
|
|
158
|
+
getDownloadStats(options?: {
|
|
159
|
+
force?: boolean;
|
|
160
|
+
}): Promise<PluginDownloadStatsSummary | null>;
|
|
161
|
+
listSources(): readonly PluginRegistrySourceState[];
|
|
162
|
+
setSourceEnabled(sourceId: string, enabled: boolean): Promise<void>;
|
|
109
163
|
search(query?: PluginSearchQuery): PluginCatalogEntry[];
|
|
110
164
|
getCatalogEntry(pluginId: string): PluginCatalogEntry | undefined;
|
|
111
|
-
getPluginDetail(pluginId: string
|
|
165
|
+
getPluginDetail(pluginId: string, options?: {
|
|
166
|
+
registryId?: string;
|
|
167
|
+
}): Promise<PluginCatalogDetail | null>;
|
|
112
168
|
install(pluginId: string, options?: InstallPluginOptions): Promise<InstalledPluginRecord>;
|
|
113
169
|
installBundle(bundle: ArrayBuffer | Uint8Array, options?: InstallPluginBundleOptions): Promise<InstalledPluginRecord>;
|
|
170
|
+
private verifyOfflineNostrBundle;
|
|
114
171
|
update(pluginId: string, version?: string, options?: UpdatePluginOptions): Promise<InstalledPluginRecord | null>;
|
|
115
172
|
uninstall(pluginId: string, options?: UninstallPluginOptions): Promise<void>;
|
|
116
173
|
listInstalled(): Promise<InstalledPluginRecord[]>;
|
|
117
174
|
getInstalled(pluginId: string): Promise<InstalledPluginRecord | null>;
|
|
118
175
|
listUpdates(): Promise<PluginUpdateInfo[]>;
|
|
119
176
|
addProgressListener(listener: PluginInstallProgressListener): () => void;
|
|
177
|
+
private httpClient;
|
|
178
|
+
private entryForSource;
|
|
179
|
+
private installedSource;
|
|
120
180
|
private requireEntry;
|
|
121
181
|
private sourceForEntry;
|
|
182
|
+
private sourceKind;
|
|
183
|
+
private adapterForSource;
|
|
122
184
|
private compatibilityInput;
|
|
123
185
|
private get platform();
|
|
124
186
|
private isWorkspaceTrusted;
|
|
187
|
+
private ensureSourcePreferencesLoaded;
|
|
188
|
+
private loadSourcePreferences;
|
|
189
|
+
private syncSourceStates;
|
|
125
190
|
private applyRevocationsToInstalled;
|
|
191
|
+
private revalidateInstalledNostrProofs;
|
|
126
192
|
private revocationFor;
|
|
127
193
|
private emitProgress;
|
|
128
194
|
}
|