@earendil-works/chord 1.1.0 → 1.3.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 +78 -0
- package/README.md +79 -195
- package/dist/cell.d.ts +122 -0
- package/dist/cell.d.ts.map +1 -0
- package/dist/cell.js +356 -0
- package/dist/cell.js.map +1 -0
- package/dist/cluster.d.ts +27 -0
- package/dist/cluster.d.ts.map +1 -0
- package/dist/cluster.js +230 -0
- package/dist/cluster.js.map +1 -0
- package/dist/connection.d.ts +270 -0
- package/dist/connection.d.ts.map +1 -0
- package/dist/connection.js +1216 -0
- package/dist/connection.js.map +1 -0
- package/dist/context/index.d.ts +12 -1
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js.map +1 -1
- package/dist/contract.d.ts +208 -0
- package/dist/contract.d.ts.map +1 -0
- package/dist/contract.js +246 -0
- package/dist/contract.js.map +1 -0
- package/dist/declare.d.ts +33 -0
- package/dist/declare.d.ts.map +1 -0
- package/dist/declare.js +2 -0
- package/dist/declare.js.map +1 -0
- package/dist/delta/apply-immutable-trusted.js.map +1 -1
- package/dist/delta/diff.d.ts +1 -1
- package/dist/delta/diff.d.ts.map +1 -1
- package/dist/delta/diff.js.map +1 -1
- package/dist/delta/index.d.ts +4 -3
- package/dist/delta/index.d.ts.map +1 -1
- package/dist/delta/index.js +45 -0
- package/dist/delta/index.js.map +1 -1
- package/dist/delta/revision-validator.d.ts +1 -1
- package/dist/delta/revision-validator.d.ts.map +1 -1
- package/dist/delta/revision-validator.js.map +1 -1
- package/dist/delta/tracker.d.ts +1 -1
- package/dist/delta/tracker.d.ts.map +1 -1
- package/dist/delta/tracker.js +40 -4
- package/dist/delta/tracker.js.map +1 -1
- package/dist/errors.d.ts +28 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +59 -0
- package/dist/errors.js.map +1 -0
- package/dist/host.d.ts +348 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/host.js +1000 -0
- package/dist/host.js.map +1 -0
- package/dist/index.d.ts +17 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/json.d.ts +9 -1
- package/dist/json.d.ts.map +1 -1
- package/dist/json.js.map +1 -1
- package/dist/link.d.ts +107 -0
- package/dist/link.d.ts.map +1 -0
- package/dist/link.js +355 -0
- package/dist/link.js.map +1 -0
- package/dist/loader.d.ts +4 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +73 -0
- package/dist/loader.js.map +1 -0
- package/dist/manager.d.ts +115 -0
- package/dist/manager.d.ts.map +1 -0
- package/dist/manager.js +345 -0
- package/dist/manager.js.map +1 -0
- package/dist/node.d.ts +3 -4
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +3 -2
- package/dist/node.js.map +1 -1
- package/dist/object.d.ts +438 -0
- package/dist/object.d.ts.map +1 -0
- package/dist/object.js +1571 -0
- package/dist/object.js.map +1 -0
- package/dist/output.d.ts +85 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +350 -0
- package/dist/output.js.map +1 -0
- package/dist/publish.d.ts +5 -0
- package/dist/publish.d.ts.map +1 -0
- package/dist/publish.js +40 -0
- package/dist/publish.js.map +1 -0
- package/dist/registry.d.ts +25 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +6 -0
- package/dist/registry.js.map +1 -0
- package/dist/reload.d.ts +126 -0
- package/dist/reload.d.ts.map +1 -0
- package/dist/reload.js +653 -0
- package/dist/reload.js.map +1 -0
- package/dist/remote.d.ts +165 -0
- package/dist/remote.d.ts.map +1 -0
- package/dist/remote.js +612 -0
- package/dist/remote.js.map +1 -0
- package/dist/schema.d.ts +21 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +228 -0
- package/dist/schema.js.map +1 -0
- package/dist/state.d.ts +92 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/{services/state.js → state.js} +28 -138
- package/dist/state.js.map +1 -0
- package/dist/types.d.ts +69 -258
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/websocket.d.ts +15 -0
- package/dist/websocket.d.ts.map +1 -0
- package/dist/websocket.js +16 -0
- package/dist/websocket.js.map +1 -0
- package/dist/wire.d.ts +216 -0
- package/dist/wire.d.ts.map +1 -0
- package/dist/wire.js +165 -0
- package/dist/wire.js.map +1 -0
- package/docs/guide.md +814 -0
- package/docs/spec.md +288 -0
- package/docs/tutorial.md +931 -0
- package/package.json +14 -10
- package/src/delta/README.md +5 -3
- package/dist/api.d.ts +0 -20
- package/dist/api.d.ts.map +0 -1
- package/dist/api.js +0 -77
- package/dist/api.js.map +0 -1
- package/dist/bundler.d.ts +0 -6
- package/dist/bundler.d.ts.map +0 -1
- package/dist/bundler.js +0 -3
- package/dist/bundler.js.map +0 -1
- package/dist/facets/host.d.ts +0 -12
- package/dist/facets/host.d.ts.map +0 -1
- package/dist/facets/host.js +0 -763
- package/dist/facets/host.js.map +0 -1
- package/dist/facets/loader.d.ts +0 -3
- package/dist/facets/loader.d.ts.map +0 -1
- package/dist/facets/loader.js +0 -5
- package/dist/facets/loader.js.map +0 -1
- package/dist/node/bundle-loader.d.ts +0 -30
- package/dist/node/bundle-loader.d.ts.map +0 -1
- package/dist/node/bundle-loader.js +0 -377
- package/dist/node/bundle-loader.js.map +0 -1
- package/dist/node/bundle.d.ts +0 -26
- package/dist/node/bundle.d.ts.map +0 -1
- package/dist/node/bundle.js +0 -183
- package/dist/node/bundle.js.map +0 -1
- package/dist/node/manifest.d.ts +0 -36
- package/dist/node/manifest.d.ts.map +0 -1
- package/dist/node/manifest.js +0 -6
- package/dist/node/manifest.js.map +0 -1
- package/dist/node/package.d.ts +0 -15
- package/dist/node/package.d.ts.map +0 -1
- package/dist/node/package.js +0 -199
- package/dist/node/package.js.map +0 -1
- package/dist/services/consumer.d.ts +0 -11
- package/dist/services/consumer.d.ts.map +0 -1
- package/dist/services/consumer.js +0 -585
- package/dist/services/consumer.js.map +0 -1
- package/dist/services/errors.d.ts +0 -8
- package/dist/services/errors.d.ts.map +0 -1
- package/dist/services/errors.js +0 -22
- package/dist/services/errors.js.map +0 -1
- package/dist/services/handle.d.ts +0 -15
- package/dist/services/handle.d.ts.map +0 -1
- package/dist/services/handle.js +0 -101
- package/dist/services/handle.js.map +0 -1
- package/dist/services/instances.d.ts +0 -26
- package/dist/services/instances.d.ts.map +0 -1
- package/dist/services/instances.js +0 -140
- package/dist/services/instances.js.map +0 -1
- package/dist/services/loopback.d.ts +0 -5
- package/dist/services/loopback.d.ts.map +0 -1
- package/dist/services/loopback.js +0 -15
- package/dist/services/loopback.js.map +0 -1
- package/dist/services/provider.d.ts +0 -37
- package/dist/services/provider.d.ts.map +0 -1
- package/dist/services/provider.js +0 -521
- package/dist/services/provider.js.map +0 -1
- package/dist/services/state-codec.d.ts +0 -15
- package/dist/services/state-codec.d.ts.map +0 -1
- package/dist/services/state-codec.js +0 -133
- package/dist/services/state-codec.js.map +0 -1
- package/dist/services/state-internals.d.ts +0 -13
- package/dist/services/state-internals.d.ts.map +0 -1
- package/dist/services/state-internals.js +0 -10
- package/dist/services/state-internals.js.map +0 -1
- package/dist/services/state.d.ts +0 -28
- package/dist/services/state.d.ts.map +0 -1
- package/dist/services/state.js.map +0 -1
- package/dist/services/wire.d.ts +0 -63
- package/dist/services/wire.d.ts.map +0 -1
- package/dist/services/wire.js +0 -186
- package/dist/services/wire.js.map +0 -1
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Error codes callers see (guide table). A refused or aborted reload keeps the code of its cause. */
|
|
2
|
+
export declare const CHORD_ERROR_CODES: readonly ["aborted", "contract_mismatch", "forbidden", "gone", "invalid", "not_in_variant", "not_ready", "released", "superseded", "unavailable", "upgrade_conflict", "upgrade_required"];
|
|
3
|
+
export type ChordErrorCode = (typeof CHORD_ERROR_CODES)[number];
|
|
4
|
+
/**
|
|
5
|
+
* Finer cause inside a code, for logs and tests: e.g. `invalid` + `args`, `result`, `state`, `input`, `implementation`,
|
|
6
|
+
* `duplicate`, `cycle`, `read_only`, `not_host_lifetime`, `registry_conflict`; `unavailable` + `unknown_type`.
|
|
7
|
+
*/
|
|
8
|
+
export type ChordErrorReason = string;
|
|
9
|
+
export declare class ChordError extends Error {
|
|
10
|
+
readonly code: ChordErrorCode;
|
|
11
|
+
readonly reason: ChordErrorReason | undefined;
|
|
12
|
+
readonly retryable: boolean;
|
|
13
|
+
readonly details: unknown;
|
|
14
|
+
constructor(code: ChordErrorCode, message: string, options?: {
|
|
15
|
+
cause?: unknown;
|
|
16
|
+
details?: unknown;
|
|
17
|
+
reason?: ChordErrorReason;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
export declare const isChordError: (error: unknown, code?: ChordErrorCode) => error is ChordError;
|
|
21
|
+
/** For factories and methods refusing a principal: `throw forbidden()`. */
|
|
22
|
+
export declare const forbidden: (message?: string) => ChordError;
|
|
23
|
+
export declare const invalid: (reason: ChordErrorReason, message: string, details?: unknown) => ChordError;
|
|
24
|
+
/** Keeps a ChordError's code; anything else becomes `unavailable` with the original as cause. */
|
|
25
|
+
export declare const asChordError: (error: unknown, context: string) => ChordError;
|
|
26
|
+
/** Runs every step, then throws one error, or an AggregateError when several failed. */
|
|
27
|
+
export declare function runAll(steps: readonly (() => unknown)[], message: string): Promise<void>;
|
|
28
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,eAAO,MAAM,iBAAiB,YAC7B,SAAS,EACT,mBAAmB,EACnB,WAAW,EACX,MAAM,EACN,SAAS,EACT,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,kBAAkB,CACT,CAAC;AACX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAItC,qBAAa,UAAW,SAAQ,KAAK;IACpC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAC9C,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,YACC,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,gBAAgB,CAAA;KAAE,EAU3E;CACD;AAED,eAAO,MAAM,YAAY,UAAW,OAAO,SAAS,cAAc,KAAG,KAAK,IAAI,UACH,CAAC;AAE5E,2EAA2E;AAC3E,eAAO,MAAM,SAAS,wBAA4B,UAAkD,CAAC;AAErG,eAAO,MAAM,OAAO,WAAY,gBAAgB,WAAW,MAAM,YAAY,OAAO,KAAG,UAC/B,CAAC;AAEzD,iGAAiG;AACjG,eAAO,MAAM,YAAY,UAAW,OAAO,WAAW,MAAM,KAAG,UAK1D,CAAC;AAEN,wFAAwF;AACxF,wBAAsB,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAW9F"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/** Error codes callers see (guide table). A refused or aborted reload keeps the code of its cause. */
|
|
2
|
+
export const CHORD_ERROR_CODES = [
|
|
3
|
+
"aborted",
|
|
4
|
+
"contract_mismatch",
|
|
5
|
+
"forbidden",
|
|
6
|
+
"gone",
|
|
7
|
+
"invalid",
|
|
8
|
+
"not_in_variant",
|
|
9
|
+
"not_ready",
|
|
10
|
+
"released",
|
|
11
|
+
"superseded",
|
|
12
|
+
"unavailable",
|
|
13
|
+
"upgrade_conflict",
|
|
14
|
+
"upgrade_required",
|
|
15
|
+
];
|
|
16
|
+
const RETRYABLE = new Set(["superseded", "upgrade_conflict"]);
|
|
17
|
+
export class ChordError extends Error {
|
|
18
|
+
code;
|
|
19
|
+
reason;
|
|
20
|
+
retryable;
|
|
21
|
+
details;
|
|
22
|
+
constructor(code, message, options) {
|
|
23
|
+
super(`${code}${options?.reason ? `/${options.reason}` : ""}: ${message}`, {
|
|
24
|
+
cause: options?.cause,
|
|
25
|
+
});
|
|
26
|
+
this.name = "ChordError";
|
|
27
|
+
this.code = code;
|
|
28
|
+
this.reason = options?.reason;
|
|
29
|
+
this.retryable = RETRYABLE.has(code);
|
|
30
|
+
this.details = options?.details;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export const isChordError = (error, code) => error instanceof ChordError && (code === undefined || error.code === code);
|
|
34
|
+
/** For factories and methods refusing a principal: `throw forbidden()`. */
|
|
35
|
+
export const forbidden = (message = "forbidden") => new ChordError("forbidden", message);
|
|
36
|
+
export const invalid = (reason, message, details) => new ChordError("invalid", message, { reason, details });
|
|
37
|
+
/** Keeps a ChordError's code; anything else becomes `unavailable` with the original as cause. */
|
|
38
|
+
export const asChordError = (error, context) => error instanceof ChordError
|
|
39
|
+
? error
|
|
40
|
+
: new ChordError("unavailable", `${context}: ${error instanceof Error ? error.message : String(error)}`, {
|
|
41
|
+
cause: error,
|
|
42
|
+
});
|
|
43
|
+
/** Runs every step, then throws one error, or an AggregateError when several failed. */
|
|
44
|
+
export async function runAll(steps, message) {
|
|
45
|
+
const errors = [];
|
|
46
|
+
for (const step of steps) {
|
|
47
|
+
try {
|
|
48
|
+
await step();
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
errors.push(error);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (errors.length === 1)
|
|
55
|
+
throw errors[0];
|
|
56
|
+
if (errors.length > 1)
|
|
57
|
+
throw new AggregateError(errors, message);
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAChC,SAAS;IACT,mBAAmB;IACnB,WAAW;IACX,MAAM;IACN,SAAS;IACT,gBAAgB;IAChB,WAAW;IACX,UAAU;IACV,YAAY;IACZ,aAAa;IACb,kBAAkB;IAClB,kBAAkB;CACT,CAAC;AASX,MAAM,SAAS,GAAgC,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,kBAAkB,CAAC,CAAC,CAAC;AAE3F,MAAM,OAAO,UAAW,SAAQ,KAAK;IAC3B,IAAI,CAAiB;IACrB,MAAM,CAA+B;IACrC,SAAS,CAAU;IACnB,OAAO,CAAU;IAC1B,YACC,IAAoB,EACpB,OAAe,EACf,OAA2E;QAE3E,KAAK,CAAC,GAAG,IAAI,GAAG,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,OAAO,EAAE,EAAE;YAC1E,KAAK,EAAE,OAAO,EAAE,KAAK;SACrB,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,OAAO,EAAE,MAAM,CAAC;QAC9B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,CAAC,OAAO,GAAG,OAAO,EAAE,OAAO,CAAC;IACjC,CAAC;CACD;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAc,EAAE,IAAqB,EAAuB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;QAAE,MAAM,IAAI,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAClE,CAAC","sourcesContent":["/** Error codes callers see (guide table). A refused or aborted reload keeps the code of its cause. */\nexport const CHORD_ERROR_CODES = [\n\t\"aborted\",\n\t\"contract_mismatch\",\n\t\"forbidden\",\n\t\"gone\",\n\t\"invalid\",\n\t\"not_in_variant\",\n\t\"not_ready\",\n\t\"released\",\n\t\"superseded\",\n\t\"unavailable\",\n\t\"upgrade_conflict\",\n\t\"upgrade_required\",\n] as const;\nexport type ChordErrorCode = (typeof CHORD_ERROR_CODES)[number];\n\n/**\n * Finer cause inside a code, for logs and tests: e.g. `invalid` + `args`, `result`, `state`, `input`, `implementation`,\n * `duplicate`, `cycle`, `read_only`, `not_host_lifetime`, `registry_conflict`; `unavailable` + `unknown_type`.\n */\nexport type ChordErrorReason = string;\n\nconst RETRYABLE: ReadonlySet<ChordErrorCode> = new Set([\"superseded\", \"upgrade_conflict\"]);\n\nexport class ChordError extends Error {\n\treadonly code: ChordErrorCode;\n\treadonly reason: ChordErrorReason | undefined;\n\treadonly retryable: boolean;\n\treadonly details: unknown;\n\tconstructor(\n\t\tcode: ChordErrorCode,\n\t\tmessage: string,\n\t\toptions?: { cause?: unknown; details?: unknown; reason?: ChordErrorReason },\n\t) {\n\t\tsuper(`${code}${options?.reason ? `/${options.reason}` : \"\"}: ${message}`, {\n\t\t\tcause: options?.cause,\n\t\t});\n\t\tthis.name = \"ChordError\";\n\t\tthis.code = code;\n\t\tthis.reason = options?.reason;\n\t\tthis.retryable = RETRYABLE.has(code);\n\t\tthis.details = options?.details;\n\t}\n}\n\nexport const isChordError = (error: unknown, code?: ChordErrorCode): error is ChordError =>\n\terror instanceof ChordError && (code === undefined || error.code === code);\n\n/** For factories and methods refusing a principal: `throw forbidden()`. */\nexport const forbidden = (message = \"forbidden\"): ChordError => new ChordError(\"forbidden\", message);\n\nexport const invalid = (reason: ChordErrorReason, message: string, details?: unknown): ChordError =>\n\tnew ChordError(\"invalid\", message, { reason, details });\n\n/** Keeps a ChordError's code; anything else becomes `unavailable` with the original as cause. */\nexport const asChordError = (error: unknown, context: string): ChordError =>\n\terror instanceof ChordError\n\t\t? error\n\t\t: new ChordError(\"unavailable\", `${context}: ${error instanceof Error ? error.message : String(error)}`, {\n\t\t\t\tcause: error,\n\t\t\t});\n\n/** Runs every step, then throws one error, or an AggregateError when several failed. */\nexport async function runAll(steps: readonly (() => unknown)[], message: string): Promise<void> {\n\tconst errors: unknown[] = [];\n\tfor (const step of steps) {\n\t\ttry {\n\t\t\tawait step();\n\t\t} catch (error) {\n\t\t\terrors.push(error);\n\t\t}\n\t}\n\tif (errors.length === 1) throw errors[0];\n\tif (errors.length > 1) throw new AggregateError(errors, message);\n}\n"]}
|
package/dist/host.d.ts
ADDED
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
import { type AcceptOptions, Connection, type LinkOptions, type RelayRef } from "./connection.ts";
|
|
2
|
+
import { type AnyContract, type InputOf, type LocalContract, type LocalDef, type Ref, type RemoteContract, type RemoteDef } from "./contract.ts";
|
|
3
|
+
import type { Link } from "./link.ts";
|
|
4
|
+
import { type Decls, type Factory, type HostCore, ObjectImpl, type RefCore, type RefOwner, type ServeOptionsFor, type Service } from "./object.ts";
|
|
5
|
+
import type { Registry, RegistryTable, RegistryView } from "./registry.ts";
|
|
6
|
+
import { type ReloadOptions, type ReloadReport } from "./reload.ts";
|
|
7
|
+
import { RemoteBinding } from "./remote.ts";
|
|
8
|
+
import type { Ctx, GetOptions } from "./types.ts";
|
|
9
|
+
import type { Frame } from "./wire.ts";
|
|
10
|
+
/**
|
|
11
|
+
* Registers a factory for a type. Overloaded on the contract's definition (not the contract type) so TypeScript
|
|
12
|
+
* keeps literal `variant`s in factory returns. `P` is the app's principal type (see `createHost`).
|
|
13
|
+
*/
|
|
14
|
+
export interface Serve<P = unknown> {
|
|
15
|
+
<D extends RemoteDef>(type: RemoteContract<D>, factory: Factory<RemoteContract<D>, P>, options?: ServeOptionsFor<RemoteContract<D>>): void;
|
|
16
|
+
<D extends LocalDef>(type: LocalContract<D>, factory: Factory<LocalContract<D>, P>, options?: ServeOptionsFor<LocalContract<D>>): void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* What a facet's `setup` gets. `serve` registers types; `root` and `registry` give the facet's code that is not a
|
|
20
|
+
* Chord method, listener or task (Durable tools and hooks, callbacks of native libraries) access to its own host,
|
|
21
|
+
* so plugins never need a process-global host. Both may be kept and used after `setup` returns.
|
|
22
|
+
*/
|
|
23
|
+
export interface FacetApi<P = unknown> {
|
|
24
|
+
readonly serve: Serve<P>;
|
|
25
|
+
/** The host's name (`server`, `session:S1`, ...). */
|
|
26
|
+
readonly name: string;
|
|
27
|
+
/** Starts a root on the facet's host (in its current code version at call time). */
|
|
28
|
+
root<T>(fn: (ctx: Ctx<P>) => T | Promise<T>, options?: RootOptions<P>): Promise<T>;
|
|
29
|
+
/** The facet's host's registry view (`get(key, ctx)` reads the table of `ctx.codeVersion`). */
|
|
30
|
+
registry<V>(registry: Registry<V>): RegistryView<V>;
|
|
31
|
+
/**
|
|
32
|
+
* Aborted when this run of the facet is no longer installed: a reload that replaced or removed it committed, the reload
|
|
33
|
+
* that loaded it aborted, or the host closed. While a reload prepares, the installed and the candidate run are both
|
|
34
|
+
* live.
|
|
35
|
+
*/
|
|
36
|
+
readonly signal: AbortSignal;
|
|
37
|
+
}
|
|
38
|
+
/** What a facet module exports (default export): the code that serves its types on one host kind. */
|
|
39
|
+
export interface FacetDefinition<P = unknown> {
|
|
40
|
+
/** Contract tokens this facet consumes; checked against providers at reload. */
|
|
41
|
+
readonly uses?: readonly AnyContract[];
|
|
42
|
+
setup(api: FacetApi<P>): void;
|
|
43
|
+
}
|
|
44
|
+
/** A named facet. Modules are named by their URL; reloading a facet replaces everything it served. */
|
|
45
|
+
export interface Facet<P = unknown> extends FacetDefinition<P> {
|
|
46
|
+
readonly name: string;
|
|
47
|
+
}
|
|
48
|
+
/** `defineFacet<P>(…)`: an app passes its principal type, so factories and contexts see `P`. */
|
|
49
|
+
export declare const defineFacet: <P = unknown>(setup: (api: FacetApi<P>) => void, options?: {
|
|
50
|
+
readonly uses?: readonly AnyContract[];
|
|
51
|
+
}) => FacetDefinition<P>;
|
|
52
|
+
/** Imports facet modules (fresh copies on every call) and names them by module URL. */
|
|
53
|
+
export type FacetLoader = (modules: readonly (string | URL)[]) => Promise<Facet[]>;
|
|
54
|
+
/** A facet object, or a module (path or URL) whose default export is a FacetDefinition. */
|
|
55
|
+
export type PluginRef<P = unknown> = Facet<P> | string | URL;
|
|
56
|
+
/**
|
|
57
|
+
* `P` is the app's principal type: who a caller is, JSON-serializable. Chord never makes one up: the app supplies the
|
|
58
|
+
* host's own (`self`), the one its parent's own requests act as (`connect`), the ones links act as (`accept`) and the
|
|
59
|
+
* ones routed hosts act as (`Route.principal`).
|
|
60
|
+
*/
|
|
61
|
+
export interface HostOptions<P = unknown> {
|
|
62
|
+
readonly name?: string;
|
|
63
|
+
/**
|
|
64
|
+
* The principal of the host's own code: roots it starts, code inside its objects, and its `lifetime: "host"` objects.
|
|
65
|
+
* Compared by `principalKey`, so an equal principal from elsewhere reaches the same objects. Not used to infer `P`:
|
|
66
|
+
* pass the app's type as `createHost<P>(…)`.
|
|
67
|
+
*/
|
|
68
|
+
readonly self: NoInfer<P>;
|
|
69
|
+
/** Maps a principal to its object key (should include connection provenance and grant revision). */
|
|
70
|
+
readonly principalKey?: (principal: P) => string;
|
|
71
|
+
/** Validates every cell write and exposed state value against its schemas. */
|
|
72
|
+
readonly dev?: boolean;
|
|
73
|
+
/** Errors from background work (disposal, listeners, tasks). Defaults to console.error. */
|
|
74
|
+
readonly onError?: (error: unknown) => void;
|
|
75
|
+
/**
|
|
76
|
+
* Milliseconds a reload waits for an object's aborted tasks to finish before it starts their replacements anyway
|
|
77
|
+
* (reported). Default 5000.
|
|
78
|
+
*/
|
|
79
|
+
readonly taskStopDeadline?: number;
|
|
80
|
+
/**
|
|
81
|
+
* Milliseconds an activation (or a reload's prepare) waits for its references to be ready and hydrated, and an
|
|
82
|
+
* awaited `get` for its reference, before failing with `unavailable/ready_timeout`. Default 60000.
|
|
83
|
+
*/
|
|
84
|
+
readonly readyTimeout?: number;
|
|
85
|
+
/**
|
|
86
|
+
* Consumer-side linger of remote references: when the last reference to a remote object is released, its binding
|
|
87
|
+
* stays held, and hydrated, for `types[typeName]` milliseconds, so a reference taken again meanwhile costs nothing
|
|
88
|
+
* on the link. At most `cap` bindings (default 4) linger; beyond, the least recently released go first. Types not
|
|
89
|
+
* listed do not linger. (The provider's own `serve(…, { linger })` keeps its object after the last reference.)
|
|
90
|
+
*/
|
|
91
|
+
readonly linger?: {
|
|
92
|
+
readonly types?: Readonly<Record<string, number>>;
|
|
93
|
+
readonly cap?: number;
|
|
94
|
+
};
|
|
95
|
+
/** Needed for `load`/`reload` with modules; `nodeLoader` from loader.ts in Node. */
|
|
96
|
+
readonly loader?: FacetLoader;
|
|
97
|
+
/** `client` (browser): never a reload participant, never carries roots or code versions. Default `host`. */
|
|
98
|
+
readonly kind?: "host" | "client";
|
|
99
|
+
/** The link to this host's parent (server). Can also be set later with `connect`. */
|
|
100
|
+
readonly upstream?: {
|
|
101
|
+
readonly link: Link;
|
|
102
|
+
} & ConnectOptions<P>;
|
|
103
|
+
}
|
|
104
|
+
/** `connect` options: the link's, and the principal its parent's own requests act as. */
|
|
105
|
+
export interface ConnectOptions<P = unknown> extends LinkOptions {
|
|
106
|
+
/** What a request from the parent acts as when the parent does not forward its caller's principal (its own code). */
|
|
107
|
+
readonly principal: P;
|
|
108
|
+
}
|
|
109
|
+
/** Where requests for hosts named `prefix…` go (on the server). */
|
|
110
|
+
export interface Route<P = unknown> {
|
|
111
|
+
/** Checked before resolving (or spawning) and again after: grants may change meanwhile. */
|
|
112
|
+
authorize(principal: P, hostName: string): boolean | Promise<boolean>;
|
|
113
|
+
/** A link to the host, spawned if needed. */
|
|
114
|
+
resolve(hostName: string): Promise<Link>;
|
|
115
|
+
/** The principal the resolved host acts as when it calls back. */
|
|
116
|
+
readonly principal: (hostName: string) => P;
|
|
117
|
+
}
|
|
118
|
+
/** Fields a principal must have, equal (`deepEqual`), for an `invalidatePrincipal` pattern. */
|
|
119
|
+
export type PrincipalPattern<P> = P extends object ? {
|
|
120
|
+
readonly [K in keyof P]?: P[K];
|
|
121
|
+
} : Readonly<Record<string, unknown>>;
|
|
122
|
+
/** `invalidatePrincipal` matches: a predicate (this host only), or a pattern (fields that must be equal; propagates). */
|
|
123
|
+
export type PrincipalMatch<P = unknown> = ((principal: P) => boolean) | PrincipalPattern<P>;
|
|
124
|
+
export interface RootOptions<P = unknown> {
|
|
125
|
+
readonly principal?: P;
|
|
126
|
+
readonly signal?: AbortSignal;
|
|
127
|
+
/** Start the root in a retained code version (links carry code versions). Defaults to the current code version. */
|
|
128
|
+
readonly codeVersion?: number;
|
|
129
|
+
}
|
|
130
|
+
export interface LoadOptions {
|
|
131
|
+
/**
|
|
132
|
+
* Await the activation of the `lifetime: "host"` objects the facets serve (default true). False starts them but
|
|
133
|
+
* leaves readiness to `host.ready()` (a child host whose objects need its parent, which admits it only later).
|
|
134
|
+
*/
|
|
135
|
+
readonly awaitHostObjects?: boolean;
|
|
136
|
+
}
|
|
137
|
+
export interface Host<P = unknown> {
|
|
138
|
+
readonly name: string;
|
|
139
|
+
readonly codeVersion: number;
|
|
140
|
+
readonly previousCodeVersion: number | undefined;
|
|
141
|
+
readonly serve: Serve<P>;
|
|
142
|
+
/** Installs synchronously, then awaits this facet's host objects unless `awaitHostObjects` is false. */
|
|
143
|
+
install(facet: Facet<P>, options?: LoadOptions): Promise<void>;
|
|
144
|
+
/** Installs all facets before awaiting their host objects; referenced objects are created when first referenced. */
|
|
145
|
+
load(plugins: readonly PluginRef<P>[], options?: LoadOptions): Promise<void>;
|
|
146
|
+
/** Awaits the host objects present at call time, including those started by `serve` or deferred loads. */
|
|
147
|
+
ready(): Promise<void>;
|
|
148
|
+
/**
|
|
149
|
+
* A reference held until `release()`. Resolves once it is ready: live, with every state member of its variant
|
|
150
|
+
* (unless `state: false`). Rejects with the activation error, `aborted` (`signal`), or `unavailable/ready_timeout`
|
|
151
|
+
* after `readyTimeout`; the reference is released then.
|
|
152
|
+
*/
|
|
153
|
+
get<C extends AnyContract>(type: C, input: InputOf<C>, options?: GetOptions<P> & {
|
|
154
|
+
readonly signal?: AbortSignal;
|
|
155
|
+
}): Promise<Ref<C>>;
|
|
156
|
+
/**
|
|
157
|
+
* The same reference, synchronously, possibly still `loading`: for UI runtimes that render its status (hooks, a
|
|
158
|
+
* TUI watch). Its state members throw `not_ready` until it is live.
|
|
159
|
+
*/
|
|
160
|
+
hold<C extends AnyContract>(type: C, input: InputOf<C>, options?: GetOptions<P>): Ref<C>;
|
|
161
|
+
root<T>(fn: (ctx: Ctx<P>) => T | Promise<T>, options?: RootOptions<P>): Promise<T>;
|
|
162
|
+
registry<V>(registry: Registry<V>): RegistryView<V>;
|
|
163
|
+
/**
|
|
164
|
+
* Force-disposes every object whose principal matches (never the host's own principal), re-stamps or closes
|
|
165
|
+
* matching links, and propagates pattern matches to child hosts.
|
|
166
|
+
*/
|
|
167
|
+
invalidatePrincipal(match: PrincipalMatch<P>): Promise<void>;
|
|
168
|
+
/** Accepts a child link (a worker or a browser); requests on it act as `options.principal`. */
|
|
169
|
+
accept(link: Link, options: AcceptOptions<P>): void;
|
|
170
|
+
/**
|
|
171
|
+
* Sets (or replaces, after a reconnect) the link to this host's parent; remote references re-hold over it. The
|
|
172
|
+
* parent's own requests act as `options.principal`; requests it relays act as the principal it forwards.
|
|
173
|
+
*/
|
|
174
|
+
connect(link: Link, options: ConnectOptions<P>): void;
|
|
175
|
+
route(prefix: string, route: Route<P>): void;
|
|
176
|
+
/** Reloads the given facets (modules are re-imported); facets not listed keep running unchanged. */
|
|
177
|
+
reload(plugins: readonly PluginRef<P>[], options?: ReloadOptions): Promise<ReloadReport>;
|
|
178
|
+
close(): Promise<void>;
|
|
179
|
+
}
|
|
180
|
+
export interface CodeVersionState {
|
|
181
|
+
readonly id: number;
|
|
182
|
+
readonly services: Map<string, Service>;
|
|
183
|
+
tables: ReadonlyMap<string, RegistryTable<unknown>>;
|
|
184
|
+
/** Running roots with the number of their calls running here. */
|
|
185
|
+
readonly roots: Map<string, number>;
|
|
186
|
+
/** Aborts every root of this code version (forced retirement). */
|
|
187
|
+
readonly abort: AbortController;
|
|
188
|
+
}
|
|
189
|
+
/** A host whose principals are `P` (the app's type; `unknown` if not given). */
|
|
190
|
+
export declare function createHost<P = unknown>(options: HostOptions<P>): Host<P>;
|
|
191
|
+
export declare class HostImpl implements Host, HostCore {
|
|
192
|
+
#private;
|
|
193
|
+
readonly name: string;
|
|
194
|
+
readonly dev: boolean;
|
|
195
|
+
readonly principal: unknown;
|
|
196
|
+
inFactory: number;
|
|
197
|
+
failed: unknown;
|
|
198
|
+
readonly objects: Map<string, ObjectImpl>;
|
|
199
|
+
readonly codeVersions: Map<number, CodeVersionState>;
|
|
200
|
+
readonly facets: Map<string, Facet<unknown>>;
|
|
201
|
+
/** The host's own references to its `lifetime: "host"` objects, by type name. */
|
|
202
|
+
readonly hostObjects: Map<string, RefCore>;
|
|
203
|
+
readonly kind: "host" | "client";
|
|
204
|
+
readonly connections: Set<Connection>;
|
|
205
|
+
upstream: Connection | undefined;
|
|
206
|
+
/** Shared bindings of this host's remote references, by key (re-held after an upstream reconnect). */
|
|
207
|
+
readonly bindings: Map<string, RemoteBinding>;
|
|
208
|
+
/** Child facet modules by host-name prefix, from every committed cluster reload (for reconciling children). */
|
|
209
|
+
remoteModules: Record<string, string[]>;
|
|
210
|
+
/** Removal tombstones also reconcile children that connected during a transaction. */
|
|
211
|
+
remoteRemoved: Record<string, string[]>;
|
|
212
|
+
current: CodeVersionState;
|
|
213
|
+
previous: CodeVersionState | undefined;
|
|
214
|
+
/** The code version a running reload will commit; new types activated during prepare install their implementation for it. */
|
|
215
|
+
pending: CodeVersionState | undefined;
|
|
216
|
+
/** Activations of these types wait (reload gate). */
|
|
217
|
+
/** Types behind a reload gate: new objects of these types are rejected `upgrade_conflict` until commit/abort. */
|
|
218
|
+
gating: ReadonlySet<string> | undefined;
|
|
219
|
+
reloading: boolean;
|
|
220
|
+
readonly taskStopDeadline: number;
|
|
221
|
+
readonly readyTimeout: number;
|
|
222
|
+
constructor(options: HostOptions);
|
|
223
|
+
/** Whether `principal` is the host's own: the same key as `self`. */
|
|
224
|
+
isSelf(principal: unknown): boolean;
|
|
225
|
+
get codeVersion(): number;
|
|
226
|
+
get previousCodeVersion(): number | undefined;
|
|
227
|
+
/** Allocates the next code version id, or adopts one issued by the coordinating server. */
|
|
228
|
+
nextCodeVersionId(given?: number): number;
|
|
229
|
+
report(error: unknown): void;
|
|
230
|
+
readonly serve: Serve;
|
|
231
|
+
install(facet: Facet, options?: LoadOptions): Promise<void>;
|
|
232
|
+
load(plugins: readonly PluginRef[], options?: LoadOptions): Promise<void>;
|
|
233
|
+
ready(): Promise<void>;
|
|
234
|
+
/** Turns plugin references into facets, importing modules through the loader. */
|
|
235
|
+
resolve(plugins: readonly PluginRef[]): Promise<Facet[]>;
|
|
236
|
+
facetApi(serve: Serve, signal: AbortSignal): FacetApi;
|
|
237
|
+
/** The installed run of facet `name` is now `run` (or none): the run it replaces is aborted. */
|
|
238
|
+
facetRunChanged(name: string, run: AbortController | undefined): void;
|
|
239
|
+
serveInto(services: Map<string, Service>, service: Service): void;
|
|
240
|
+
startHostObject(service: Service): RefCore;
|
|
241
|
+
currentCodeVersion(): number;
|
|
242
|
+
hasCodeVersion(codeVersion: number): boolean;
|
|
243
|
+
retainedCodeVersions(): Iterable<readonly [number, ReadonlyMap<string, Service>]>;
|
|
244
|
+
pendingCodeVersion(): number | undefined;
|
|
245
|
+
/** The current code for a type; a type a running reload adds is served from the pending code version. */
|
|
246
|
+
service(typeName: string): Service | undefined;
|
|
247
|
+
addressOf(type: AnyContract, input: unknown, principal: unknown, candidate?: boolean): string;
|
|
248
|
+
acquire(type: AnyContract, input: unknown, options: GetOptions | undefined, owner: RefOwner, from?: ObjectImpl, candidate?: boolean): RefCore;
|
|
249
|
+
forget(object: ObjectImpl): void;
|
|
250
|
+
disposed(object: ObjectImpl): void;
|
|
251
|
+
touch(rootId: string, object: ObjectImpl): void;
|
|
252
|
+
root<T>(fn: (ctx: Ctx) => T | Promise<T>, options?: RootOptions): Promise<T>;
|
|
253
|
+
/**
|
|
254
|
+
* Runs `fn` inside root `rootId` of `codeVersion`. A root counts as running here (for retirement) while any of its
|
|
255
|
+
* calls runs here. A root that started here ends when its last call here settles, even if it went out and came back
|
|
256
|
+
* over a link meanwhile. A foreign root (started elsewhere, arriving `from` a link) keeps its leases on objects
|
|
257
|
+
* until every link it came over announced its end (`root_end`) or closed, so its re-entry stays grandfathered.
|
|
258
|
+
*/
|
|
259
|
+
joinRoot<T>(rootId: string, codeVersionId: number, fn: (ctx: Ctx) => T | Promise<T>, options?: {
|
|
260
|
+
readonly principal?: unknown;
|
|
261
|
+
readonly signal?: AbortSignal;
|
|
262
|
+
readonly from?: Connection;
|
|
263
|
+
}): Promise<T>;
|
|
264
|
+
/** Remembers that calls of `rootId` went out on `connection`, which must hear when the root ends. */
|
|
265
|
+
rootSent(rootId: string, connection: Connection): void;
|
|
266
|
+
/** A root ended (here, or announced by its origin): end its leases and tell the links it went out on. */
|
|
267
|
+
endRoot(rootId: string): void;
|
|
268
|
+
/**
|
|
269
|
+
* `from` announced the end of a foreign root (or closed). Honored only if the root came over `from`: a peer cannot
|
|
270
|
+
* end leases of roots it never carried. The root ends when no link that brought it remains.
|
|
271
|
+
*/
|
|
272
|
+
foreignRootEnded(rootId: string, from: Connection): void;
|
|
273
|
+
/**
|
|
274
|
+
* Retires the previous code version once no local roots of it remain. A child also waits for its parent to retire
|
|
275
|
+
* it: roots span hosts, and an old root on the server may still call in.
|
|
276
|
+
*/
|
|
277
|
+
maybeRetire(): void;
|
|
278
|
+
/** The previous code version has no roots left here and, on a child host, the parent has retired it. */
|
|
279
|
+
retirable(): boolean;
|
|
280
|
+
allowRetire(codeVersion: number): void;
|
|
281
|
+
/** Calls `watcher` whenever a root ends, the parent allows a retirement, or a code version retires. */
|
|
282
|
+
watchRetirement(watcher: () => void): () => void;
|
|
283
|
+
/**
|
|
284
|
+
* Tells a child that is now in step which code versions this host retired before: every id below the oldest one it
|
|
285
|
+
* retains (ids only grow). Without it, a child reconciled after those retirements would never hear a `retire` frame for
|
|
286
|
+
* its own previous code version and would wait for the retire deadline at every reload.
|
|
287
|
+
*/
|
|
288
|
+
announceRetired(connection: Connection): void;
|
|
289
|
+
/** Drops the previous code version: its implementations and the declarations only it used. */
|
|
290
|
+
retire(): void;
|
|
291
|
+
/**
|
|
292
|
+
* Drops an object's implementation for `codeVersion` and what only that implementation declared, in disposal order:
|
|
293
|
+
* resources close (reverse open order) before its references are released.
|
|
294
|
+
*/
|
|
295
|
+
retireImplementation(object: ObjectImpl, codeVersion: number): void;
|
|
296
|
+
registry<V>(registry: Registry<V>): RegistryView<V>;
|
|
297
|
+
/** Builds registry tables from (object, declarations) pairs. Throws registry_conflict. */
|
|
298
|
+
buildTables(entries: Iterable<readonly [ObjectImpl, Decls]>): Map<string, RegistryTable<unknown>>;
|
|
299
|
+
/** Live objects with their current declarations; objects waiting for a reload's commit only with `candidates`. */
|
|
300
|
+
liveDecls(candidates?: boolean): [ObjectImpl, Decls][];
|
|
301
|
+
checkRegistrations(object: ObjectImpl, decls: Decls): void;
|
|
302
|
+
registriesChanged(including?: ObjectImpl): void;
|
|
303
|
+
/** A commit failed midway: from now on this host admits no work (calls fail `unavailable/host_failed`). */
|
|
304
|
+
fail(error: unknown): void;
|
|
305
|
+
/** Installs tables for `codeVersion`; subscribers hear about changed tables of the current code version (all tables when `all`). */
|
|
306
|
+
installTables(codeVersion: CodeVersionState, tables: Map<string, RegistryTable<unknown>>, all?: boolean): void;
|
|
307
|
+
get<C extends AnyContract>(type: C, input: InputOf<C>, options?: GetOptions & {
|
|
308
|
+
readonly signal?: AbortSignal;
|
|
309
|
+
}): Promise<Ref<C>>;
|
|
310
|
+
hold<C extends AnyContract>(type: C, input: InputOf<C>, options?: GetOptions): Ref<C>;
|
|
311
|
+
invalidatePrincipal(match: PrincipalMatch): Promise<void>;
|
|
312
|
+
accept(link: Link, options: AcceptOptions): void;
|
|
313
|
+
connect(link: Link, options: ConnectOptions): void;
|
|
314
|
+
route(prefix: string, route: Route): void;
|
|
315
|
+
/**
|
|
316
|
+
* A child host announced its code version. In step: usable. Behind: fenced (nothing is routed to it) and reconciled
|
|
317
|
+
* by a reload of its modules to this host's code version, never by renumbering what it runs. Ahead: impossible,
|
|
318
|
+
* refused.
|
|
319
|
+
*/
|
|
320
|
+
peerHello(connection: Connection, codeVersion: number): void;
|
|
321
|
+
/** The host's reload slot was freed: children that said hello meanwhile are synced or reconciled now. */
|
|
322
|
+
reloadEnded(): void;
|
|
323
|
+
/** Resolves once no reload runs on this host. */
|
|
324
|
+
whenReloadEnded(): Promise<void>;
|
|
325
|
+
connectionClosed(connection: Connection): void;
|
|
326
|
+
/** The last reference to `binding` was released: it lingers if its type does (`HostOptions.linger`), else closes. */
|
|
327
|
+
bindingIdle(binding: RemoteBinding): void;
|
|
328
|
+
forgetBinding(binding: RemoteBinding): void;
|
|
329
|
+
/**
|
|
330
|
+
* Relays a reference from `relay.origin` to the host it names. Relaying needs a route: it is where authorization
|
|
331
|
+
* lives. The origin's authorization generation is re-checked after every await and right before forwarding, so a
|
|
332
|
+
* revocation during resolution wins.
|
|
333
|
+
*/
|
|
334
|
+
relay(relay: RelayRef): Promise<void>;
|
|
335
|
+
reload(plugins: readonly PluginRef[], options?: ReloadOptions): Promise<ReloadReport>;
|
|
336
|
+
onReloadFrame(connection: Connection, frame: Extract<Frame, {
|
|
337
|
+
t: "prepare" | "commit" | "abort";
|
|
338
|
+
}>): void;
|
|
339
|
+
rememberRemoteModules(remote: Readonly<Record<string, readonly string[]>> | undefined, remove: Readonly<Record<string, readonly string[]>> | undefined): void;
|
|
340
|
+
/** The code version id the next reload would commit. */
|
|
341
|
+
peekNextCodeVersion(): number;
|
|
342
|
+
/**
|
|
343
|
+
* Disposes every object, holders before what they reference (a resource's `close` may still use the objects its object
|
|
344
|
+
* references, local or remote), then closes the links.
|
|
345
|
+
*/
|
|
346
|
+
close(): Promise<void>;
|
|
347
|
+
}
|
|
348
|
+
//# sourceMappingURL=host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAE,UAAU,EAAE,KAAK,WAAW,EAAE,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAClG,OAAO,EACN,KAAK,WAAW,EAGhB,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,QAAQ,EAGb,KAAK,GAAG,EACR,KAAK,cAAc,EACnB,KAAK,SAAS,EAEd,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAGN,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,QAAQ,EAGb,UAAU,EACV,KAAK,OAAO,EAEZ,KAAK,QAAQ,EAEb,KAAK,eAAe,EACpB,KAAK,OAAO,EACZ,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAa,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAa,MAAM,aAAa,CAAC;AAEvD,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAEvC;;;GAGG;AACH,MAAM,WAAW,KAAK,CAAC,CAAC,GAAG,OAAO;IACjC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