@wendoo/bridge-app 0.2.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/README.md +44 -0
- package/dist/app-bridge.d.ts +77 -0
- package/dist/app-bridge.d.ts.map +1 -0
- package/dist/app-bridge.js +205 -0
- package/dist/app-environment-host.d.ts +524 -0
- package/dist/app-environment-host.d.ts.map +1 -0
- package/dist/app-environment-host.js +1560 -0
- package/dist/brain-diagnostics.d.ts +47 -0
- package/dist/brain-diagnostics.d.ts.map +1 -0
- package/dist/brain-diagnostics.js +100 -0
- package/dist/bridge-project.d.ts +32 -0
- package/dist/bridge-project.d.ts.map +1 -0
- package/dist/bridge-project.js +69 -0
- package/dist/compilation.d.ts +145 -0
- package/dist/compilation.d.ts.map +1 -0
- package/dist/compilation.js +404 -0
- package/dist/core-extension.d.ts +10 -0
- package/dist/core-extension.d.ts.map +1 -0
- package/dist/core-extension.js +9 -0
- package/dist/embedded-extension-id-gate.d.ts +38 -0
- package/dist/embedded-extension-id-gate.d.ts.map +1 -0
- package/dist/embedded-extension-id-gate.js +55 -0
- package/dist/embedded-extension-loader.d.ts +33 -0
- package/dist/embedded-extension-loader.d.ts.map +1 -0
- package/dist/embedded-extension-loader.js +90 -0
- package/dist/embedded-extension-vite-plugin.d.ts +34 -0
- package/dist/embedded-extension-vite-plugin.d.ts.map +1 -0
- package/dist/embedded-extension-vite-plugin.js +39 -0
- package/dist/embedded-extensions.d.ts +293 -0
- package/dist/embedded-extensions.d.ts.map +1 -0
- package/dist/embedded-extensions.js +526 -0
- package/dist/extension-catalog.d.ts +243 -0
- package/dist/extension-catalog.d.ts.map +1 -0
- package/dist/extension-catalog.js +408 -0
- package/dist/extension-install-log.d.ts +54 -0
- package/dist/extension-install-log.d.ts.map +1 -0
- package/dist/extension-install-log.js +22 -0
- package/dist/extension-install.d.ts +162 -0
- package/dist/extension-install.d.ts.map +1 -0
- package/dist/extension-install.js +412 -0
- package/dist/extension-report-presenter.d.ts +40 -0
- package/dist/extension-report-presenter.d.ts.map +1 -0
- package/dist/extension-report-presenter.js +36 -0
- package/dist/fetched-extension-snapshots.d.ts +66 -0
- package/dist/fetched-extension-snapshots.d.ts.map +1 -0
- package/dist/fetched-extension-snapshots.js +137 -0
- package/dist/folder-host-session.d.ts +85 -0
- package/dist/folder-host-session.d.ts.map +1 -0
- package/dist/folder-host-session.js +210 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/library-offer.d.ts +60 -0
- package/dist/library-offer.d.ts.map +1 -0
- package/dist/library-offer.js +47 -0
- package/dist/library-uninstall-guard.d.ts +66 -0
- package/dist/library-uninstall-guard.d.ts.map +1 -0
- package/dist/library-uninstall-guard.js +103 -0
- package/dist/manifest-files.d.ts +53 -0
- package/dist/manifest-files.d.ts.map +1 -0
- package/dist/manifest-files.js +242 -0
- package/dist/node.d.ts +4 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +2 -0
- package/dist/project-file-bridge.d.ts +10 -0
- package/dist/project-file-bridge.d.ts.map +1 -0
- package/dist/project-file-bridge.js +87 -0
- package/dist/user-tile-registration.d.ts +89 -0
- package/dist/user-tile-registration.d.ts.map +1 -0
- package/dist/user-tile-registration.js +100 -0
- package/dist/vfs-asset-url-provider.d.ts +22 -0
- package/dist/vfs-asset-url-provider.d.ts.map +1 -0
- package/dist/vfs-asset-url-provider.js +52 -0
- package/dist/workspace-folder-project-store.d.ts +125 -0
- package/dist/workspace-folder-project-store.d.ts.map +1 -0
- package/dist/workspace-folder-project-store.js +400 -0
- package/package.json +103 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ExtensionInstallReport } from "./extension-install.js";
|
|
2
|
+
/**
|
|
3
|
+
* The kind of transaction a report is presented for: `install` and `uninstall`
|
|
4
|
+
* act on one named library; `refresh` re-runs the current map (retry, update,
|
|
5
|
+
* or load-time move application) and names no single library.
|
|
6
|
+
*/
|
|
7
|
+
export type ExtensionTransactionFlavor = "install" | "uninstall" | "refresh";
|
|
8
|
+
/**
|
|
9
|
+
* The toast surface an extension transaction reports through. Payloads carry
|
|
10
|
+
* concept-level data only -- a display name, a stable code -- and never
|
|
11
|
+
* diagnostics.
|
|
12
|
+
*/
|
|
13
|
+
export interface ExtensionTransactionToasts {
|
|
14
|
+
/** The transaction was refused; nothing changed. Carries the refusal's stable code when it has one. */
|
|
15
|
+
failed(refusal: {
|
|
16
|
+
code?: string;
|
|
17
|
+
message: string;
|
|
18
|
+
}): void;
|
|
19
|
+
/** The transaction committed; names the affected library by display name. */
|
|
20
|
+
confirmed(libraryName: string): void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Present an extension transaction's report through a toast surface. A refusal
|
|
24
|
+
* surfaces as `failed`. A commit of an `install` or `uninstall` transaction
|
|
25
|
+
* confirms with the library's display name; a `refresh` commit presents
|
|
26
|
+
* nothing. A commit toasts nothing about its outcome in either direction:
|
|
27
|
+
* standing problems and their resolution live on the brain badges.
|
|
28
|
+
*
|
|
29
|
+
* @param options.report - The transaction's report; absent presents nothing.
|
|
30
|
+
* @param options.flavor - The transaction kind.
|
|
31
|
+
* @param options.libraryName - Display name of the affected library; required for install and uninstall.
|
|
32
|
+
* @param options.toasts - The toast surface to present through.
|
|
33
|
+
*/
|
|
34
|
+
export declare function presentExtensionTransaction(options: {
|
|
35
|
+
report: ExtensionInstallReport | undefined;
|
|
36
|
+
flavor: ExtensionTransactionFlavor;
|
|
37
|
+
libraryName?: string;
|
|
38
|
+
toasts: ExtensionTransactionToasts;
|
|
39
|
+
}): void;
|
|
40
|
+
//# sourceMappingURL=extension-report-presenter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-report-presenter.d.ts","sourceRoot":"","sources":["../src/extension-report-presenter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAErE;;;;GAIG;AACH,MAAM,MAAM,0BAA0B,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;AAE7E;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IACzC,uGAAuG;IACvG,MAAM,CAAC,OAAO,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC1D,6EAA6E;IAC7E,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE;IACnD,MAAM,EAAE,sBAAsB,GAAG,SAAS,CAAC;IAC3C,MAAM,EAAE,0BAA0B,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,0BAA0B,CAAC;CACpC,GAAG,IAAI,CAuBP"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Present an extension transaction's report through a toast surface. A refusal
|
|
3
|
+
* surfaces as `failed`. A commit of an `install` or `uninstall` transaction
|
|
4
|
+
* confirms with the library's display name; a `refresh` commit presents
|
|
5
|
+
* nothing. A commit toasts nothing about its outcome in either direction:
|
|
6
|
+
* standing problems and their resolution live on the brain badges.
|
|
7
|
+
*
|
|
8
|
+
* @param options.report - The transaction's report; absent presents nothing.
|
|
9
|
+
* @param options.flavor - The transaction kind.
|
|
10
|
+
* @param options.libraryName - Display name of the affected library; required for install and uninstall.
|
|
11
|
+
* @param options.toasts - The toast surface to present through.
|
|
12
|
+
*/
|
|
13
|
+
export function presentExtensionTransaction(options) {
|
|
14
|
+
const { report, flavor, toasts } = options;
|
|
15
|
+
if (!report) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (!report.committed) {
|
|
19
|
+
const refusal = report.refusal;
|
|
20
|
+
switch (refusal.kind) {
|
|
21
|
+
case "fetch":
|
|
22
|
+
toasts.failed({ code: refusal.error.code, message: refusal.error.message });
|
|
23
|
+
break;
|
|
24
|
+
case "store":
|
|
25
|
+
toasts.failed({ code: refusal.code, message: refusal.message });
|
|
26
|
+
break;
|
|
27
|
+
case "cycle":
|
|
28
|
+
toasts.failed({ message: refusal.message });
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (flavor !== "refresh") {
|
|
34
|
+
toasts.confirmed(options.libraryName ?? "");
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { FetchedExtensionSnapshot, FileContent } from "@wendoo/app-host";
|
|
2
|
+
import type { FolderInstalledExtensionMetadata } from "@wendoo/bridge-protocol";
|
|
3
|
+
import type { FetchedExtensionContentMap } from "./embedded-extensions.js";
|
|
4
|
+
/** App-data key holding a project's installed fetched-extension snapshots. */
|
|
5
|
+
export declare const INSTALLED_EXTENSIONS_APP_DATA_KEY = "installed-extensions";
|
|
6
|
+
/**
|
|
7
|
+
* One installed fetched dependency's persisted snapshot: the content of the
|
|
8
|
+
* dependency together with the reference and resolved routing specifier it
|
|
9
|
+
* was fetched at. The project store carries these records so `.libraries/`
|
|
10
|
+
* regenerates on load without reaching the network.
|
|
11
|
+
*/
|
|
12
|
+
export interface InstalledExtensionSnapshot {
|
|
13
|
+
/** The manifest reference the snapshot was installed from, as written. */
|
|
14
|
+
readonly reference: string;
|
|
15
|
+
/**
|
|
16
|
+
* The immutable routing specifier the content was fetched at: the
|
|
17
|
+
* reference's `@` pin as written, or the commit SHA a `#branch` reference
|
|
18
|
+
* resolved to.
|
|
19
|
+
*/
|
|
20
|
+
readonly specifier: string;
|
|
21
|
+
/** Extension-relative path (no leading slash) mapped to base64 content bytes. */
|
|
22
|
+
readonly files: Readonly<Record<string, string>>;
|
|
23
|
+
}
|
|
24
|
+
/** A project's installed fetched-extension snapshots, keyed by `<owner>/<repo>` coordinate. */
|
|
25
|
+
export type InstalledExtensionSnapshots = Readonly<Record<string, InstalledExtensionSnapshot>>;
|
|
26
|
+
/** Build the persisted snapshot record for a fetched extension snapshot. */
|
|
27
|
+
export declare function installedSnapshotFromFetched(snapshot: FetchedExtensionSnapshot): InstalledExtensionSnapshot;
|
|
28
|
+
/** Decode a stored snapshot's files into the origin-relative content map resolution consumes (leading-slash paths). */
|
|
29
|
+
export declare function decodeInstalledSnapshotFiles(snapshot: InstalledExtensionSnapshot): Map<string, FileContent>;
|
|
30
|
+
/**
|
|
31
|
+
* Build the fetched-content map resolution consumes from a project's stored
|
|
32
|
+
* snapshot records, keyed by each record's reference.
|
|
33
|
+
*/
|
|
34
|
+
export declare function fetchedContentFromSnapshots(snapshots: InstalledExtensionSnapshots): FetchedExtensionContentMap;
|
|
35
|
+
/**
|
|
36
|
+
* Parse a project's stored snapshot records from their app-data text. Returns
|
|
37
|
+
* an empty record when the text is absent or malformed; individual malformed
|
|
38
|
+
* entries are dropped.
|
|
39
|
+
*/
|
|
40
|
+
export declare function parseInstalledExtensionSnapshots(raw: string | undefined): InstalledExtensionSnapshots;
|
|
41
|
+
/** Serialize a project's snapshot records to their app-data text. */
|
|
42
|
+
export declare function serializeInstalledExtensionSnapshots(snapshots: InstalledExtensionSnapshots): string;
|
|
43
|
+
/**
|
|
44
|
+
* Extract each snapshot record's install provenance, keyed by `<owner>/<repo>`
|
|
45
|
+
* origin.
|
|
46
|
+
*/
|
|
47
|
+
export declare function installedExtensionMetadataFromSnapshots(snapshots: InstalledExtensionSnapshots): Record<string, FolderInstalledExtensionMetadata>;
|
|
48
|
+
/**
|
|
49
|
+
* Parse an installed-extensions metadata record from its JSON text. Returns an
|
|
50
|
+
* empty record when the text is absent or malformed; individual malformed
|
|
51
|
+
* entries are dropped.
|
|
52
|
+
*/
|
|
53
|
+
export declare function parseInstalledExtensionMetadata(raw: string | undefined): Record<string, FolderInstalledExtensionMetadata>;
|
|
54
|
+
/**
|
|
55
|
+
* Rebuild a project's installed snapshot records from a materialized
|
|
56
|
+
* installed-extensions tree and its recorded install provenance. For each
|
|
57
|
+
* origin in `metadata`, the tree's files under
|
|
58
|
+
* `.libraries/<owner>/<repo>/` become the record's content at the recorded
|
|
59
|
+
* reference and specifier; an origin with no files in the tree yields no
|
|
60
|
+
* record.
|
|
61
|
+
*
|
|
62
|
+
* @param metadata - Install provenance per origin, as recorded beside the tree.
|
|
63
|
+
* @param treeFiles - Project-relative path/content pairs of the tree's files.
|
|
64
|
+
*/
|
|
65
|
+
export declare function reconstructInstalledSnapshotsFromTree(metadata: Readonly<Record<string, FolderInstalledExtensionMetadata>>, treeFiles: ReadonlyArray<[string, FileContent]>): InstalledExtensionSnapshots;
|
|
66
|
+
//# sourceMappingURL=fetched-extension-snapshots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetched-extension-snapshots.d.ts","sourceRoot":"","sources":["../src/fetched-extension-snapshots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE9E,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,yBAAyB,CAAC;AAEhF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAE3E,8EAA8E;AAC9E,eAAO,MAAM,iCAAiC,yBAAyB,CAAC;AAExE;;;;;GAKG;AACH,MAAM,WAAW,0BAA0B;IACzC,0EAA0E;IAC1E,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,iFAAiF;IACjF,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAClD;AAED,+FAA+F;AAC/F,MAAM,MAAM,2BAA2B,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAC,CAAC;AAE/F,4EAA4E;AAC5E,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,wBAAwB,GAAG,0BAA0B,CAM3G;AAED,uHAAuH;AACvH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,0BAA0B,GAAG,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAM3G;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,2BAA2B,GAAG,0BAA0B,CAM9G;AAaD;;;;GAIG;AACH,wBAAgB,gCAAgC,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,2BAA2B,CAgBrG;AAED,qEAAqE;AACrE,wBAAgB,oCAAoC,CAAC,SAAS,EAAE,2BAA2B,GAAG,MAAM,CAEnG;AAED;;;GAGG;AACH,wBAAgB,uCAAuC,CACrD,SAAS,EAAE,2BAA2B,GACrC,MAAM,CAAC,MAAM,EAAE,gCAAgC,CAAC,CAMlD;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC7C,GAAG,EAAE,MAAM,GAAG,SAAS,GACtB,MAAM,CAAC,MAAM,EAAE,gCAAgC,CAAC,CAgBlD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qCAAqC,CACnD,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,gCAAgC,CAAC,CAAC,EACpE,SAAS,EAAE,aAAa,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,GAC9C,2BAA2B,CAe7B"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { base64ToBytes, bytesToBase64, fileContentFromBytes, fileContentToBytes } from "@wendoo/app-host";
|
|
2
|
+
import { EXTENSIONS_TREE_PATH } from "@wendoo/bridge-protocol";
|
|
3
|
+
/** App-data key holding a project's installed fetched-extension snapshots. */
|
|
4
|
+
export const INSTALLED_EXTENSIONS_APP_DATA_KEY = "installed-extensions";
|
|
5
|
+
/** Build the persisted snapshot record for a fetched extension snapshot. */
|
|
6
|
+
export function installedSnapshotFromFetched(snapshot) {
|
|
7
|
+
const files = {};
|
|
8
|
+
for (const file of snapshot.files) {
|
|
9
|
+
files[file.path] = bytesToBase64(file.content);
|
|
10
|
+
}
|
|
11
|
+
return { reference: snapshot.reference, specifier: snapshot.specifier, files };
|
|
12
|
+
}
|
|
13
|
+
/** Decode a stored snapshot's files into the origin-relative content map resolution consumes (leading-slash paths). */
|
|
14
|
+
export function decodeInstalledSnapshotFiles(snapshot) {
|
|
15
|
+
const files = new Map();
|
|
16
|
+
for (const [path, data] of Object.entries(snapshot.files)) {
|
|
17
|
+
files.set(path.startsWith("/") ? path : `/${path}`, fileContentFromBytes(base64ToBytes(data)));
|
|
18
|
+
}
|
|
19
|
+
return files;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Build the fetched-content map resolution consumes from a project's stored
|
|
23
|
+
* snapshot records, keyed by each record's reference.
|
|
24
|
+
*/
|
|
25
|
+
export function fetchedContentFromSnapshots(snapshots) {
|
|
26
|
+
const content = new Map();
|
|
27
|
+
for (const snapshot of Object.values(snapshots)) {
|
|
28
|
+
content.set(snapshot.reference, decodeInstalledSnapshotFiles(snapshot));
|
|
29
|
+
}
|
|
30
|
+
return content;
|
|
31
|
+
}
|
|
32
|
+
function isRecord(value) {
|
|
33
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
34
|
+
}
|
|
35
|
+
function isInstalledExtensionSnapshot(value) {
|
|
36
|
+
if (!isRecord(value))
|
|
37
|
+
return false;
|
|
38
|
+
if (typeof value.reference !== "string" || typeof value.specifier !== "string")
|
|
39
|
+
return false;
|
|
40
|
+
if (!isRecord(value.files))
|
|
41
|
+
return false;
|
|
42
|
+
return Object.values(value.files).every((entry) => typeof entry === "string");
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Parse a project's stored snapshot records from their app-data text. Returns
|
|
46
|
+
* an empty record when the text is absent or malformed; individual malformed
|
|
47
|
+
* entries are dropped.
|
|
48
|
+
*/
|
|
49
|
+
export function parseInstalledExtensionSnapshots(raw) {
|
|
50
|
+
if (raw === undefined)
|
|
51
|
+
return {};
|
|
52
|
+
let parsed;
|
|
53
|
+
try {
|
|
54
|
+
parsed = JSON.parse(raw);
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
return {};
|
|
58
|
+
}
|
|
59
|
+
if (!isRecord(parsed))
|
|
60
|
+
return {};
|
|
61
|
+
const snapshots = {};
|
|
62
|
+
for (const [coordinate, entry] of Object.entries(parsed)) {
|
|
63
|
+
if (isInstalledExtensionSnapshot(entry)) {
|
|
64
|
+
snapshots[coordinate] = entry;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return snapshots;
|
|
68
|
+
}
|
|
69
|
+
/** Serialize a project's snapshot records to their app-data text. */
|
|
70
|
+
export function serializeInstalledExtensionSnapshots(snapshots) {
|
|
71
|
+
return JSON.stringify(snapshots);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Extract each snapshot record's install provenance, keyed by `<owner>/<repo>`
|
|
75
|
+
* origin.
|
|
76
|
+
*/
|
|
77
|
+
export function installedExtensionMetadataFromSnapshots(snapshots) {
|
|
78
|
+
const metadata = {};
|
|
79
|
+
for (const [origin, snapshot] of Object.entries(snapshots)) {
|
|
80
|
+
metadata[origin] = { reference: snapshot.reference, specifier: snapshot.specifier };
|
|
81
|
+
}
|
|
82
|
+
return metadata;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Parse an installed-extensions metadata record from its JSON text. Returns an
|
|
86
|
+
* empty record when the text is absent or malformed; individual malformed
|
|
87
|
+
* entries are dropped.
|
|
88
|
+
*/
|
|
89
|
+
export function parseInstalledExtensionMetadata(raw) {
|
|
90
|
+
if (raw === undefined)
|
|
91
|
+
return {};
|
|
92
|
+
let parsed;
|
|
93
|
+
try {
|
|
94
|
+
parsed = JSON.parse(raw);
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
return {};
|
|
98
|
+
}
|
|
99
|
+
if (!isRecord(parsed))
|
|
100
|
+
return {};
|
|
101
|
+
const metadata = {};
|
|
102
|
+
for (const [origin, entry] of Object.entries(parsed)) {
|
|
103
|
+
if (isRecord(entry) && typeof entry.reference === "string" && typeof entry.specifier === "string") {
|
|
104
|
+
metadata[origin] = { reference: entry.reference, specifier: entry.specifier };
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return metadata;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Rebuild a project's installed snapshot records from a materialized
|
|
111
|
+
* installed-extensions tree and its recorded install provenance. For each
|
|
112
|
+
* origin in `metadata`, the tree's files under
|
|
113
|
+
* `.libraries/<owner>/<repo>/` become the record's content at the recorded
|
|
114
|
+
* reference and specifier; an origin with no files in the tree yields no
|
|
115
|
+
* record.
|
|
116
|
+
*
|
|
117
|
+
* @param metadata - Install provenance per origin, as recorded beside the tree.
|
|
118
|
+
* @param treeFiles - Project-relative path/content pairs of the tree's files.
|
|
119
|
+
*/
|
|
120
|
+
export function reconstructInstalledSnapshotsFromTree(metadata, treeFiles) {
|
|
121
|
+
const snapshots = {};
|
|
122
|
+
for (const [origin, provenance] of Object.entries(metadata)) {
|
|
123
|
+
const prefix = `${EXTENSIONS_TREE_PATH}/${origin}/`;
|
|
124
|
+
const files = {};
|
|
125
|
+
let hasFiles = false;
|
|
126
|
+
for (const [path, content] of treeFiles) {
|
|
127
|
+
if (!path.startsWith(prefix))
|
|
128
|
+
continue;
|
|
129
|
+
files[path.slice(prefix.length)] = bytesToBase64(fileContentToBytes(content));
|
|
130
|
+
hasFiles = true;
|
|
131
|
+
}
|
|
132
|
+
if (!hasFiles)
|
|
133
|
+
continue;
|
|
134
|
+
snapshots[origin] = { reference: provenance.reference, specifier: provenance.specifier, files };
|
|
135
|
+
}
|
|
136
|
+
return snapshots;
|
|
137
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { FileContent, ProjectFileChange, ProjectStore } from "@wendoo/app-host";
|
|
2
|
+
import type { CompileDiagnosticEntry, CompileDiagnosticsPayload, FolderAppMessage, FolderHostMessage, FolderInstalledExtensionMetadata, FolderSessionErrorCode } from "@wendoo/bridge-protocol";
|
|
3
|
+
import type { FolderAppDataCodec, WorkspaceFolderStoreErrorCode } from "./workspace-folder-project-store.js";
|
|
4
|
+
export type { FolderAppDataCodec } from "./workspace-folder-project-store.js";
|
|
5
|
+
/**
|
|
6
|
+
* Transport carrying folder-session messages between the app and its host.
|
|
7
|
+
* Message order is preserved in both directions.
|
|
8
|
+
*/
|
|
9
|
+
export interface FolderHostPort {
|
|
10
|
+
/** Send one message to the host. */
|
|
11
|
+
postMessage(message: FolderAppMessage): void;
|
|
12
|
+
/** Subscribe to messages from the host. Returns an unsubscribe function. */
|
|
13
|
+
onMessage(listener: (message: FolderHostMessage) => void): () => void;
|
|
14
|
+
}
|
|
15
|
+
/** Error raised by a folder session: a host-reported or client-detected fault. */
|
|
16
|
+
export declare class FolderSessionError extends Error {
|
|
17
|
+
/** Stable machine-readable error code. */
|
|
18
|
+
readonly code: FolderSessionErrorCode | WorkspaceFolderStoreErrorCode;
|
|
19
|
+
constructor(code: FolderSessionErrorCode | WorkspaceFolderStoreErrorCode, message: string);
|
|
20
|
+
}
|
|
21
|
+
/** Options for {@link connectFolderHostSession}. */
|
|
22
|
+
export interface FolderHostSessionOptions {
|
|
23
|
+
/** Transport to the folder-session host. */
|
|
24
|
+
port: FolderHostPort;
|
|
25
|
+
/** App name keying this app's chunk in the manifest's `app` map. */
|
|
26
|
+
appName: string;
|
|
27
|
+
/** Translator between app-data entries and this app's manifest chunk. */
|
|
28
|
+
appDataCodec?: FolderAppDataCodec;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A connected folder session: the host-backed project store, the project
|
|
32
|
+
* identity, and the app-side ends of the diagnostics and external-change
|
|
33
|
+
* channels.
|
|
34
|
+
*/
|
|
35
|
+
export interface FolderHostSession {
|
|
36
|
+
/** Store persisting the host-provided project to its workspace folder. */
|
|
37
|
+
readonly store: ProjectStore;
|
|
38
|
+
/** Stable opaque id of the host-provided project. */
|
|
39
|
+
readonly projectId: string;
|
|
40
|
+
/** Publish compile diagnostics for one file to the host. */
|
|
41
|
+
publishDiagnostics(payload: CompileDiagnosticsPayload): void;
|
|
42
|
+
/**
|
|
43
|
+
* Publish the app's full compiler-controlled file set and the install
|
|
44
|
+
* provenance of its fetched dependencies to the host.
|
|
45
|
+
*/
|
|
46
|
+
publishCompilerControlledFiles(files: ReadonlyMap<string, FileContent>, installedExtensions: Readonly<Record<string, FolderInstalledExtensionMetadata>>): void;
|
|
47
|
+
/**
|
|
48
|
+
* Write a text file to the root of a removable volume mounted on the host
|
|
49
|
+
* machine, replacing any existing file with the same name. Resolves when
|
|
50
|
+
* the write completes; rejects with {@link FolderSessionError} carrying
|
|
51
|
+
* `REMOVABLE_VOLUME_NOT_FOUND` when no volume named `volumeName` is
|
|
52
|
+
* mounted, or `WRITE_FAILED` when the write fails.
|
|
53
|
+
*/
|
|
54
|
+
writeRemovableVolumeFile(volumeName: string, filename: string, contents: string): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Ask the host to open a self-contained HTML document in the user's default
|
|
57
|
+
* external application (the system browser). Resolves when the host has
|
|
58
|
+
* opened it; rejects with {@link FolderSessionError} when the host cannot
|
|
59
|
+
* write or open it.
|
|
60
|
+
*/
|
|
61
|
+
openExternalDocument(html: string): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Subscribe to project file changes observed on disk outside the app. Each
|
|
64
|
+
* change has already been absorbed by the session's store; apply it to the
|
|
65
|
+
* live project file system. Changes received before the first listener
|
|
66
|
+
* attaches are replayed to it. Returns an unsubscribe function.
|
|
67
|
+
*/
|
|
68
|
+
onExternalChange(listener: (change: ProjectFileChange) => void): () => void;
|
|
69
|
+
/** Detach from the port. */
|
|
70
|
+
dispose(): void;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Open a folder session over `port`: performs the hello/welcome handshake,
|
|
74
|
+
* verifies the protocol version, and builds the workspace-folder project
|
|
75
|
+
* store from the delivered manifest. Rejects with {@link FolderSessionError}
|
|
76
|
+
* when the host refuses or speaks a different protocol version.
|
|
77
|
+
*/
|
|
78
|
+
export declare function connectFolderHostSession(options: FolderHostSessionOptions): Promise<FolderHostSession>;
|
|
79
|
+
/**
|
|
80
|
+
* Build a compile-diagnostics publisher for a folder session: publishes each
|
|
81
|
+
* file's diagnostics with a per-file version, and publishes an empty list for
|
|
82
|
+
* a file whose previously reported diagnostics have cleared.
|
|
83
|
+
*/
|
|
84
|
+
export declare function createFolderCompileDiagnosticsPublisher(session: FolderHostSession): (files: ReadonlyMap<string, readonly CompileDiagnosticEntry[]>) => void;
|
|
85
|
+
//# sourceMappingURL=folder-host-session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"folder-host-session.d.ts","sourceRoot":"","sources":["../src/folder-host-session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAuB,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAE1G,OAAO,KAAK,EACV,sBAAsB,EACtB,yBAAyB,EAGzB,gBAAgB,EAChB,iBAAiB,EACjB,gCAAgC,EAChC,sBAAsB,EAEvB,MAAM,yBAAyB,CAAC;AAUjC,OAAO,KAAK,EAAE,kBAAkB,EAAE,6BAA6B,EAAE,MAAM,qCAAqC,CAAC;AAG7G,YAAY,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAE9E;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,oCAAoC;IACpC,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC7C,4EAA4E;IAC5E,SAAS,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;CACvE;AAED,kFAAkF;AAClF,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,0CAA0C;IAC1C,QAAQ,CAAC,IAAI,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,wBAAgB,uCAAuC,CACrD,OAAO,EAAE,iBAAiB,GACzB,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,sBAAsB,EAAE,CAAC,KAAK,IAAI,CA8BzE"}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { fileContentFromWire, fileContentText, fileContentToWire } from "@wendoo/app-host";
|
|
2
|
+
import { FOLDER_SESSION_PROTOCOL_VERSION, FolderSessionErrorCode as FolderSessionErrorCodes, INSTALLED_EXTENSIONS_METADATA_PATH, } from "@wendoo/bridge-protocol";
|
|
3
|
+
import { parseInstalledExtensionMetadata, reconstructInstalledSnapshotsFromTree, } from "./fetched-extension-snapshots.js";
|
|
4
|
+
import { WorkspaceFolderProjectStore } from "./workspace-folder-project-store.js";
|
|
5
|
+
/** Error raised by a folder session: a host-reported or client-detected fault. */
|
|
6
|
+
export class FolderSessionError extends Error {
|
|
7
|
+
/** Stable machine-readable error code. */
|
|
8
|
+
code;
|
|
9
|
+
constructor(code, message) {
|
|
10
|
+
super(message);
|
|
11
|
+
this.name = "FolderSessionError";
|
|
12
|
+
this.code = code;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Open a folder session over `port`: performs the hello/welcome handshake,
|
|
17
|
+
* verifies the protocol version, and builds the workspace-folder project
|
|
18
|
+
* store from the delivered manifest. Rejects with {@link FolderSessionError}
|
|
19
|
+
* when the host refuses or speaks a different protocol version.
|
|
20
|
+
*/
|
|
21
|
+
export async function connectFolderHostSession(options) {
|
|
22
|
+
const rpc = new FolderPortRpc(options.port);
|
|
23
|
+
const welcome = await rpc.request({
|
|
24
|
+
type: "folder:hello",
|
|
25
|
+
payload: { protocolVersion: FOLDER_SESSION_PROTOCOL_VERSION },
|
|
26
|
+
});
|
|
27
|
+
if (welcome.type !== "folder:welcome") {
|
|
28
|
+
rpc.dispose();
|
|
29
|
+
throw new FolderSessionError(FolderSessionErrorCodes.INVALID_PAYLOAD, `Expected folder:welcome, received ${welcome.type}`);
|
|
30
|
+
}
|
|
31
|
+
const payload = welcome.payload;
|
|
32
|
+
if (payload.protocolVersion !== FOLDER_SESSION_PROTOCOL_VERSION) {
|
|
33
|
+
rpc.dispose();
|
|
34
|
+
throw new FolderSessionError(FolderSessionErrorCodes.PROTOCOL_VERSION_MISMATCH, `Host speaks folder-session protocol version ${payload.protocolVersion}; this app speaks ${FOLDER_SESSION_PROTOCOL_VERSION}`);
|
|
35
|
+
}
|
|
36
|
+
const store = new WorkspaceFolderProjectStore({
|
|
37
|
+
rpc: {
|
|
38
|
+
sendChange: async (change) => {
|
|
39
|
+
await rpc.request({ type: "folder:change", payload: change });
|
|
40
|
+
},
|
|
41
|
+
writeManifest: async (content) => {
|
|
42
|
+
await rpc.request({ type: "folder:manifestWrite", payload: { content } });
|
|
43
|
+
},
|
|
44
|
+
loadFiles: async () => {
|
|
45
|
+
const reply = await rpc.request({ type: "folder:loadFiles" });
|
|
46
|
+
const snapshot = new Map();
|
|
47
|
+
if (reply.type === "folder:files") {
|
|
48
|
+
for (const [path, entry] of reply.payload.entries) {
|
|
49
|
+
snapshot.set(path, entry);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return snapshot;
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
projectId: payload.projectId,
|
|
56
|
+
manifestContent: payload.manifest.content,
|
|
57
|
+
appName: options.appName,
|
|
58
|
+
appDataCodec: options.appDataCodec,
|
|
59
|
+
installedExtensionSnapshots: reconstructSnapshotsFromWelcome(payload.extensionsCache),
|
|
60
|
+
});
|
|
61
|
+
const externalChangeListeners = new Set();
|
|
62
|
+
const bufferedExternalChanges = [];
|
|
63
|
+
rpc.onExternalChange((notification) => {
|
|
64
|
+
const change = store.absorbExternalChange(notification);
|
|
65
|
+
if (externalChangeListeners.size === 0) {
|
|
66
|
+
bufferedExternalChanges.push(change);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
for (const listener of externalChangeListeners) {
|
|
70
|
+
listener(change);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
return {
|
|
74
|
+
store,
|
|
75
|
+
projectId: payload.projectId,
|
|
76
|
+
publishDiagnostics(payload) {
|
|
77
|
+
options.port.postMessage({ type: "folder:diagnostics", payload });
|
|
78
|
+
},
|
|
79
|
+
publishCompilerControlledFiles(files, installedExtensions) {
|
|
80
|
+
options.port.postMessage({
|
|
81
|
+
type: "folder:compilerFiles",
|
|
82
|
+
payload: {
|
|
83
|
+
files: [...files].map(([path, content]) => [path, fileContentToWire(content)]),
|
|
84
|
+
installedExtensions,
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
},
|
|
88
|
+
async writeRemovableVolumeFile(volumeName, filename, contents) {
|
|
89
|
+
await rpc.request({ type: "folder:volumeWrite", payload: { volumeName, filename, contents } });
|
|
90
|
+
},
|
|
91
|
+
async openExternalDocument(html) {
|
|
92
|
+
await rpc.request({ type: "folder:openExternalDocument", payload: { html } });
|
|
93
|
+
},
|
|
94
|
+
onExternalChange(listener) {
|
|
95
|
+
externalChangeListeners.add(listener);
|
|
96
|
+
if (bufferedExternalChanges.length > 0) {
|
|
97
|
+
const replay = bufferedExternalChanges.splice(0);
|
|
98
|
+
for (const change of replay) {
|
|
99
|
+
listener(change);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return () => {
|
|
103
|
+
externalChangeListeners.delete(listener);
|
|
104
|
+
};
|
|
105
|
+
},
|
|
106
|
+
dispose() {
|
|
107
|
+
rpc.dispose();
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Build a compile-diagnostics publisher for a folder session: publishes each
|
|
113
|
+
* file's diagnostics with a per-file version, and publishes an empty list for
|
|
114
|
+
* a file whose previously reported diagnostics have cleared.
|
|
115
|
+
*/
|
|
116
|
+
export function createFolderCompileDiagnosticsPublisher(session) {
|
|
117
|
+
const versions = new Map();
|
|
118
|
+
const previousDiagnosticFiles = new Set();
|
|
119
|
+
const publish = (file, diagnostics) => {
|
|
120
|
+
const version = (versions.get(file) ?? 0) + 1;
|
|
121
|
+
versions.set(file, version);
|
|
122
|
+
session.publishDiagnostics({ file, version, diagnostics: [...diagnostics] });
|
|
123
|
+
};
|
|
124
|
+
return (files) => {
|
|
125
|
+
const currentFiles = new Set();
|
|
126
|
+
for (const [file, diagnostics] of files) {
|
|
127
|
+
currentFiles.add(file);
|
|
128
|
+
if (diagnostics.length > 0 || previousDiagnosticFiles.has(file)) {
|
|
129
|
+
publish(file, diagnostics);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
for (const file of previousDiagnosticFiles) {
|
|
133
|
+
if (!currentFiles.has(file)) {
|
|
134
|
+
publish(file, []);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
previousDiagnosticFiles.clear();
|
|
138
|
+
for (const [file, diagnostics] of files) {
|
|
139
|
+
if (diagnostics.length > 0) {
|
|
140
|
+
previousDiagnosticFiles.add(file);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Rebuild the installed snapshot records from the welcome's on-disk
|
|
147
|
+
* installed-extensions tree offer. Returns `undefined` when the offer is
|
|
148
|
+
* absent or carries no metadata record.
|
|
149
|
+
*/
|
|
150
|
+
function reconstructSnapshotsFromWelcome(extensionsCache) {
|
|
151
|
+
if (!extensionsCache) {
|
|
152
|
+
return undefined;
|
|
153
|
+
}
|
|
154
|
+
const files = extensionsCache.map(([path, payload]) => [path, fileContentFromWire(payload)]);
|
|
155
|
+
const metadataEntry = files.find(([path]) => path === INSTALLED_EXTENSIONS_METADATA_PATH);
|
|
156
|
+
const metadata = parseInstalledExtensionMetadata(fileContentText(metadataEntry?.[1] ?? ""));
|
|
157
|
+
if (Object.keys(metadata).length === 0) {
|
|
158
|
+
return undefined;
|
|
159
|
+
}
|
|
160
|
+
return reconstructInstalledSnapshotsFromTree(metadata, files);
|
|
161
|
+
}
|
|
162
|
+
/** Request/reply and event demultiplexer over a {@link FolderHostPort}. */
|
|
163
|
+
class FolderPortRpc {
|
|
164
|
+
port;
|
|
165
|
+
unsubscribe;
|
|
166
|
+
pending = new Map();
|
|
167
|
+
externalChangeListeners = new Set();
|
|
168
|
+
nextRequestId = 1;
|
|
169
|
+
constructor(port) {
|
|
170
|
+
this.port = port;
|
|
171
|
+
this.unsubscribe = port.onMessage((message) => {
|
|
172
|
+
this.handleMessage(message);
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
request(message) {
|
|
176
|
+
const id = `folder-request-${this.nextRequestId++}`;
|
|
177
|
+
return new Promise((resolve, reject) => {
|
|
178
|
+
this.pending.set(id, { resolve, reject });
|
|
179
|
+
this.port.postMessage({ ...message, id });
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
onExternalChange(listener) {
|
|
183
|
+
this.externalChangeListeners.add(listener);
|
|
184
|
+
}
|
|
185
|
+
dispose() {
|
|
186
|
+
this.unsubscribe();
|
|
187
|
+
this.pending.clear();
|
|
188
|
+
}
|
|
189
|
+
handleMessage(message) {
|
|
190
|
+
if (message.id !== undefined && this.pending.has(message.id)) {
|
|
191
|
+
const entry = this.pending.get(message.id);
|
|
192
|
+
this.pending.delete(message.id);
|
|
193
|
+
if (!entry) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
if (message.type === "folder:error") {
|
|
197
|
+
entry.reject(new FolderSessionError(message.payload.code, message.payload.message));
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
entry.resolve(message);
|
|
201
|
+
}
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
if (message.type === "folder:externalChange") {
|
|
205
|
+
for (const listener of this.externalChangeListeners) {
|
|
206
|
+
listener(message.payload);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export type { InMemoryProjectFileSystemOptions } from "@wendoo/app-host";
|
|
2
|
+
export { createInMemoryProjectFileSystem, WENDOO_JSON_PATH } from "@wendoo/app-host";
|
|
3
|
+
export type { FolderAppMessage, FolderHostMessage, FolderInstalledExtensionMetadata, } from "@wendoo/bridge-protocol";
|
|
4
|
+
export { FOLDER_HOST_MODE_FOLDER, FOLDER_HOST_MODE_GLOBAL, FOLDER_HOST_MODE_URL_PARAM, FolderSessionErrorCode, } from "@wendoo/bridge-protocol";
|
|
5
|
+
export type { AppBridge, AppBridgeFeature, AppBridgeFeatureContext, AppBridgeFeatureStatus, AppBridgeOptions, AppBridgeSnapshot, AppBridgeState, DiagnosticEntry, ProjectFileChange, ProjectFileSnapshot, ProjectFileSystem, } from "./app-bridge.js";
|
|
6
|
+
export { createAppBridge } from "./app-bridge.js";
|
|
7
|
+
export type { AppEnvironmentHostOptions, CatalogMovesOutcome, WorkspaceCompileDiagnostic, } from "./app-environment-host.js";
|
|
8
|
+
export { AppEnvironmentHost } from "./app-environment-host.js";
|
|
9
|
+
export type { BrainDiagnosticEntry, TileCompileDiagnosticsLookup } from "./brain-diagnostics.js";
|
|
10
|
+
export { collectBrainErrorDiagnostics, collectBrainTileCompileDiagnostics } from "./brain-diagnostics.js";
|
|
11
|
+
export { CORE_LIB_COORDINATE, CORE_LIB_REFERENCE } from "./core-extension.js";
|
|
12
|
+
export type { EmbeddedExtensionIdViolation } from "./embedded-extension-id-gate.js";
|
|
13
|
+
export { findEmbeddedExtensionsMissingStableIds, formatEmbeddedExtensionIdViolations, } from "./embedded-extension-id-gate.js";
|
|
14
|
+
export type { EmbeddedExtension, EmbeddedExtensionFile, ExtensionResolutionConflictWarning, ExtensionResolutionSources, ExtensionResolutionWarning, ExtensionResolutionWarningKind, FetchedExtensionContentMap, ResolvedExtensions, ResolvedOriginProvenance, } from "./embedded-extensions.js";
|
|
15
|
+
export { CatalogMoveWarningCode, createCatalogMoveVersionLookup, ExtensionResolutionCycleError, resolveProjectExtensions, } from "./embedded-extensions.js";
|
|
16
|
+
export type { ExtensionActionResult, ExtensionCatalogEntry, ExtensionCatalogOffer, ExtensionCatalogShelfEntry, ExtensionFetchFailures, PlatformStackLayer, } from "./extension-catalog.js";
|
|
17
|
+
export { buildExtensionCatalog, buildExtensionCatalogOffers, buildExtensionCatalogShelf, deriveProjectPlatformStack, ExtensionActionResultCode, installEmbeddedExtension, installExtensionReference, isExtensionCompatible, satisfiesRange, uninstallExtension, } from "./extension-catalog.js";
|
|
18
|
+
export type { ExtensionFetchClosureResult, ExtensionInstallOutcome, ExtensionInstallOutcomeKind, ExtensionInstallProblem, ExtensionInstallRefusal, ExtensionInstallReport, ProjectDiagnosticsState, } from "./extension-install.js";
|
|
19
|
+
export { collectExtensionFetchClosure, diffProjectDiagnostics, floatingPinsFromSnapshots, movedClosureHasMissingContent, typecheckBrainProblems, } from "./extension-install.js";
|
|
20
|
+
export type { ExtensionInstallLogEvent } from "./extension-install-log.js";
|
|
21
|
+
export { appendExtensionInstallLog, EXTENSION_INSTALL_LOG_APP_DATA_KEY, parseExtensionInstallLog, } from "./extension-install-log.js";
|
|
22
|
+
export type { ExtensionTransactionFlavor, ExtensionTransactionToasts } from "./extension-report-presenter.js";
|
|
23
|
+
export { presentExtensionTransaction } from "./extension-report-presenter.js";
|
|
24
|
+
export type { InstalledExtensionSnapshot, InstalledExtensionSnapshots, } from "./fetched-extension-snapshots.js";
|
|
25
|
+
export { decodeInstalledSnapshotFiles, fetchedContentFromSnapshots, INSTALLED_EXTENSIONS_APP_DATA_KEY, installedExtensionMetadataFromSnapshots, installedSnapshotFromFetched, parseInstalledExtensionMetadata, parseInstalledExtensionSnapshots, reconstructInstalledSnapshotsFromTree, serializeInstalledExtensionSnapshots, } from "./fetched-extension-snapshots.js";
|
|
26
|
+
export type { FolderHostPort, FolderHostSession, FolderHostSessionOptions } from "./folder-host-session.js";
|
|
27
|
+
export { connectFolderHostSession, createFolderCompileDiagnosticsPublisher, FolderSessionError, } from "./folder-host-session.js";
|
|
28
|
+
export type { LibraryInstallAttempt, LibraryOfferInstallSurface, LibraryOfferToasts } from "./library-offer.js";
|
|
29
|
+
export { addOfferedLibrary } from "./library-offer.js";
|
|
30
|
+
export type { LibraryUninstallGuardOutcome, LibraryUninstallImpact, UninstallGuardBrain, } from "./library-uninstall-guard.js";
|
|
31
|
+
export { collectLibraryUninstallImpact, runGuardedLibraryUninstall } from "./library-uninstall-guard.js";
|
|
32
|
+
export type { TileCompileDiagnostics, UserTileApplyResult, UserTileMetadata } from "./user-tile-registration.js";
|
|
33
|
+
export { applyCompiledUserTiles, collectMetadataFromCompile } from "./user-tile-registration.js";
|
|
34
|
+
export type { VfsAssetUrlProvider, VfsAssetUrlProviderOptions } from "./vfs-asset-url-provider.js";
|
|
35
|
+
export { createVfsAssetUrlProvider } from "./vfs-asset-url-provider.js";
|
|
36
|
+
export type { FolderAppDataCodec, WorkspaceFolderProjectStoreOptions, WorkspaceFolderRpc, } from "./workspace-folder-project-store.js";
|
|
37
|
+
export { WORKSPACE_FOLDER_PROJECT_COLLECTION_ID, WorkspaceFolderProjectStore, WorkspaceFolderStoreError, WorkspaceFolderStoreErrorCode, } from "./workspace-folder-project-store.js";
|
|
38
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,gCAAgC,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,+BAA+B,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACrF,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,gCAAgC,GACjC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,uBAAuB,EACvB,sBAA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