@dougongjs/core 0.3.0 → 0.5.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/README.md +2 -2
- package/dist/change-set.d.ts +15 -6
- package/dist/change-set.d.ts.map +1 -1
- package/dist/configuration.d.ts +12 -1
- package/dist/configuration.d.ts.map +1 -1
- package/dist/contract-registry.d.ts +2 -2
- package/dist/contract-registry.d.ts.map +1 -1
- package/dist/contracts.d.ts +27 -0
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contribution-store.d.ts +21 -2
- package/dist/contribution-store.d.ts.map +1 -1
- package/dist/diagnostics.d.ts +21 -3
- package/dist/diagnostics.d.ts.map +1 -1
- package/dist/engine.d.ts +30 -9
- package/dist/engine.d.ts.map +1 -1
- package/dist/errors.d.ts +49 -3
- package/dist/errors.d.ts.map +1 -1
- package/dist/event-hub.d.ts +12 -1
- package/dist/event-hub.d.ts.map +1 -1
- package/dist/group-configuration.d.ts +20 -0
- package/dist/group-configuration.d.ts.map +1 -0
- package/dist/group-coordinator.d.ts +34 -15
- package/dist/group-coordinator.d.ts.map +1 -1
- package/dist/group-lifecycle.d.ts +13 -0
- package/dist/group-lifecycle.d.ts.map +1 -1
- package/dist/group.d.ts +5 -11
- package/dist/group.d.ts.map +1 -1
- package/dist/host-api.d.ts +35 -1
- package/dist/host-api.d.ts.map +1 -1
- package/dist/host.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1053 -647
- package/dist/installation-graph.d.ts +8 -1
- package/dist/installation-graph.d.ts.map +1 -1
- package/dist/installation-registry.d.ts +7 -2
- package/dist/installation-registry.d.ts.map +1 -1
- package/dist/installation.d.ts +19 -1
- package/dist/installation.d.ts.map +1 -1
- package/dist/instance-coordinator.d.ts +64 -0
- package/dist/instance-coordinator.d.ts.map +1 -0
- package/dist/lifecycle-status.d.ts.map +1 -1
- package/dist/lifetime-diagnostics.d.ts +7 -1
- package/dist/lifetime-diagnostics.d.ts.map +1 -1
- package/dist/lifetime.d.ts +44 -8
- package/dist/lifetime.d.ts.map +1 -1
- package/dist/plugin.d.ts +28 -2
- package/dist/plugin.d.ts.map +1 -1
- package/dist/readonly-map.d.ts +8 -1
- package/dist/readonly-map.d.ts.map +1 -1
- package/dist/record.d.ts +16 -1
- package/dist/record.d.ts.map +1 -1
- package/dist/resource.d.ts +6 -0
- package/dist/resource.d.ts.map +1 -1
- package/dist/serial-queue.d.ts +7 -1
- package/dist/serial-queue.d.ts.map +1 -1
- package/dist/snapshot-view.d.ts +2 -0
- package/dist/snapshot-view.d.ts.map +1 -1
- package/dist/sync-result.d.ts +3 -0
- package/dist/sync-result.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/runtime.d.ts +0 -36
- package/dist/runtime.d.ts.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ContractKind } from './contracts';
|
|
2
|
-
import { InstallationRecord } from './installation';
|
|
2
|
+
import { InstallationDeclaration, InstallationRecord } from './installation';
|
|
3
3
|
/** Immutable validated dependency plan over one Host-wide installation graph. */
|
|
4
4
|
export declare class InstallationGraph {
|
|
5
5
|
#private;
|
|
@@ -10,8 +10,15 @@ export declare class InstallationGraph {
|
|
|
10
10
|
readonly contractKinds: ReadonlyMap<string, ContractKind>;
|
|
11
11
|
private constructor();
|
|
12
12
|
static build(source: Iterable<InstallationRecord>, committedKinds: ReadonlyMap<string, ContractKind>): InstallationGraph;
|
|
13
|
+
declarationFor(installation: InstallationRecord): InstallationDeclaration;
|
|
13
14
|
providerFor(installation: InstallationRecord, serviceId: string): InstallationRecord | undefined;
|
|
14
15
|
provider(serviceId: string): InstallationRecord | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Transitive dependents in *both* plans. A Service being replaced has old
|
|
18
|
+
* consumers that must stop and new ones that must start, and only the union
|
|
19
|
+
* covers both — expanding in the current plan alone would leave an Instance
|
|
20
|
+
* running against a dependency that no longer exists.
|
|
21
|
+
*/
|
|
15
22
|
affectedByTransitionTo(other: InstallationGraph, changed: ReadonlySet<InstallationRecord>): Set<InstallationRecord>;
|
|
16
23
|
}
|
|
17
24
|
//# sourceMappingURL=installation-graph.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installation-graph.d.ts","sourceRoot":"","sources":["../src/installation-graph.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"installation-graph.d.ts","sourceRoot":"","sources":["../src/installation-graph.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,OAAO,KAAK,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAWlF,iFAAiF;AACjF,qBAAa,iBAAiB;;IAS1B,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,kBAAkB,CAAC;IACjD,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;IACjE,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,kBAAkB,CAAC;IAC3D,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,kBAAkB,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACrF,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC;IAN3D,OAAO;IAaP,MAAM,CAAC,KAAK,CACV,MAAM,EAAE,QAAQ,CAAC,kBAAkB,CAAC,EACpC,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC;IA2BnD,cAAc,CAAC,YAAY,EAAE,kBAAkB;IAM/C,WAAW,CAAC,YAAY,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM;IAI/D,QAAQ,CAAC,SAAS,EAAE,MAAM;IAI1B;;;;;OAKG;IACH,sBAAsB,CAAC,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,WAAW,CAAC,kBAAkB,CAAC;CAmB1F"}
|
|
@@ -11,7 +11,6 @@ interface InstallationRegistryPort {
|
|
|
11
11
|
readonly remove: (installation: InstallationRecord, facade: AnyInstallation) => Promise<void>;
|
|
12
12
|
}
|
|
13
13
|
interface InstallationCapture {
|
|
14
|
-
readonly id: string;
|
|
15
14
|
readonly installation: InstallationRecord;
|
|
16
15
|
readonly declaration: InstallationDeclaration;
|
|
17
16
|
}
|
|
@@ -24,10 +23,16 @@ export declare class InstallationRegistry {
|
|
|
24
23
|
contains(installation: InstallationRecord): boolean;
|
|
25
24
|
create(group: GroupNode, plugin: NormalizedPlugin, config: unknown): {
|
|
26
25
|
record: InstallationRecord;
|
|
27
|
-
|
|
26
|
+
facade: AnyInstallation;
|
|
28
27
|
};
|
|
29
28
|
resolve(value: object): InstallationRecord;
|
|
30
29
|
attach(installation: InstallationRecord): void;
|
|
30
|
+
/**
|
|
31
|
+
* Validates the whole batch, then applies the whole batch. The two loops are
|
|
32
|
+
* not a style choice: a rejected operation halfway through a single loop would
|
|
33
|
+
* leave the earlier ones already written, and this method has no way to undo
|
|
34
|
+
* them. Checking first means `apply` either changes everything or nothing.
|
|
35
|
+
*/
|
|
31
36
|
apply(operations: ReadonlyArray<ChangeOperation>): void;
|
|
32
37
|
settleChanges(operations: ReadonlyArray<ChangeOperation>, active: boolean): void;
|
|
33
38
|
settleReadiness(records: Iterable<InstallationRecord>): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installation-registry.d.ts","sourceRoot":"","sources":["../src/installation-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,kBA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
27
27
|
get status(): LifecycleStatus;
|
|
28
28
|
/** Whether the owning ChangeSet has granted this Installation Host authority. */
|
|
29
|
-
get
|
|
29
|
+
get hasAuthority(): boolean;
|
|
30
30
|
get instance(): Instance | undefined;
|
|
31
31
|
get error(): Error | undefined;
|
|
32
32
|
get group(): GroupNode;
|
|
@@ -34,12 +34,30 @@ export declare class InstallationRecord {
|
|
|
34
34
|
replaceDeclaration(declaration: InstallationDeclaration): void;
|
|
35
35
|
ready(): Promise<void>;
|
|
36
36
|
unavailableError(): Error;
|
|
37
|
+
/**
|
|
38
|
+
* Binds `ready()` to the change currently in flight.
|
|
39
|
+
*
|
|
40
|
+
* The `attempt` token is the point: a second change can start before the
|
|
41
|
+
* first one's promise settles, and only the latest attempt is allowed to clear
|
|
42
|
+
* the barrier. Without it, a stale resolution would report readiness for an
|
|
43
|
+
* attempt that has already been superseded.
|
|
44
|
+
*
|
|
45
|
+
* A rejection is rethrown only when this Installation did not end up active.
|
|
46
|
+
* A change that failed elsewhere in the batch but left this one running is not
|
|
47
|
+
* this Installation's failure to report.
|
|
48
|
+
*/
|
|
37
49
|
trackReadiness(operation: Promise<void>): void;
|
|
38
50
|
activate(instance: Instance): void;
|
|
39
51
|
settleReady(): void;
|
|
40
52
|
beginStopping(): boolean;
|
|
41
53
|
deactivate(): void;
|
|
42
54
|
fail(error: unknown): Error;
|
|
55
|
+
/**
|
|
56
|
+
* For an Installation that never made it into the graph. Unlike `fail()`, this
|
|
57
|
+
* is terminal: readiness settles immediately, the attachment is dropped, and
|
|
58
|
+
* the reason is kept as a RecordedFailure rather than the live Error. The handle the
|
|
59
|
+
* caller already holds stays usable and reports why it is dead.
|
|
60
|
+
*/
|
|
43
61
|
discard(error: unknown): void;
|
|
44
62
|
remove(): void;
|
|
45
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../src/installation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ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AE,OAAO,GACd,uBAAuB,CAEzB;AAuBD;;;;GAIG;AACH,qBAAa,kBAAkB;;IAa3B,QAAQ,CAAC,EAAE,EAAE,MAAM;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM;IATxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;gBAQd,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,EACtB,KAAK,EAAE,SAAS,EAChB,WAAW,EAAE,uBAAuB;IAMtC,MAAM,CAAC,aAAa,EAAE,MAAM,IAAI;IAMhC,IAAI,MAAM,IAAI,eAAe,CAE5B;IAED,iFAAiF;IACjF,IAAI,YAAY,YAEf;IAED,IAAI,QAAQ,yBAGX;IAED,IAAI,KAAK,sBASR;IAED,IAAI,KAAK,cAER;IAED,IAAI,WAAW,4BAEd;IAED,kBAAkB,CAAC,WAAW,EAAE,uBAAuB;IAIvD,KAAK;IAML,gBAAgB;IAUhB;;;;;;;;;;;OAWG;IACH,cAAc,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC;IA2CvC,QAAQ,CAAC,QAAQ,EAAE,QAAQ;IAI3B,WAAW;IAkBX,aAAa;IAOb,UAAU;IAIV,IAAI,CAAC,KAAK,EAAE,OAAO;IAInB;;;;;OAKG;IACH,OAAO,CAAC,KAAK,EAAE,OAAO;IAuBtB,MAAM;CAwBP"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { ContractRegistryWriter } from './contract-registry';
|
|
2
|
+
import { ExtensionPoint } from './contracts';
|
|
3
|
+
import { ContributionView } from './contribution-store';
|
|
4
|
+
import { InstallationGraph } from './installation-graph';
|
|
5
|
+
import { InstallationRecord } from './installation';
|
|
6
|
+
import { Logger } from './lifetime';
|
|
7
|
+
export interface InstanceCoordinatorPort {
|
|
8
|
+
readonly hostName: string;
|
|
9
|
+
readonly logger: Logger;
|
|
10
|
+
readonly isInstalled: (installationId: string) => boolean;
|
|
11
|
+
readonly report: (error: unknown) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare class IncompleteActivationCleanupError extends AggregateError {
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Owns live Instances and the capabilities reachable from their Lifetimes.
|
|
17
|
+
*
|
|
18
|
+
* The only place in Core where `setup()` is called and where a Service value
|
|
19
|
+
* exists as a value. Above this line everything is declarations and plans; below
|
|
20
|
+
* it there are running objects.
|
|
21
|
+
*
|
|
22
|
+
* Activation is prepare-then-commit, per layer. Every Instance in a layer is
|
|
23
|
+
* built first, and only once the whole layer succeeds does any of it become
|
|
24
|
+
* visible. That is why a failing sibling cannot be observed by one that
|
|
25
|
+
* succeeded, and why cleanup after a failed layer can still reach everything the
|
|
26
|
+
* layer created.
|
|
27
|
+
*/
|
|
28
|
+
export declare class InstanceCoordinator {
|
|
29
|
+
#private;
|
|
30
|
+
constructor(port: InstanceCoordinatorPort);
|
|
31
|
+
readService(provider: InstallationRecord, serviceId: string): {
|
|
32
|
+
found: true;
|
|
33
|
+
value: unknown;
|
|
34
|
+
} | {
|
|
35
|
+
found: false;
|
|
36
|
+
value?: never;
|
|
37
|
+
};
|
|
38
|
+
contributions<T>(token: ExtensionPoint<T>): ContributionView<T>;
|
|
39
|
+
captureConfigs(installations: Iterable<InstallationRecord>): Map<InstallationRecord, unknown>;
|
|
40
|
+
resetActivationState(): void;
|
|
41
|
+
commitActivationOrder(order: ReadonlyArray<InstallationRecord>): void;
|
|
42
|
+
deactivateAll(): Promise<unknown[]>;
|
|
43
|
+
activate(plan: InstallationGraph, installations: ReadonlySet<InstallationRecord>, configs: ReadonlyMap<InstallationRecord, unknown>, contracts: ContractRegistryWriter): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Stops in reverse activation order, sequentially, and collects every failure
|
|
46
|
+
* instead of stopping at the first. A dependent must be gone before the
|
|
47
|
+
* Service it consumed, and one Instance that refuses to shut down cleanly must
|
|
48
|
+
* not leave the rest running — its error is returned, not thrown.
|
|
49
|
+
*/
|
|
50
|
+
deactivate(installations: ReadonlySet<InstallationRecord>): Promise<unknown[]>;
|
|
51
|
+
/**
|
|
52
|
+
* Runs one operation with contribution publication deferred to its end, so a
|
|
53
|
+
* change that withdraws and adds contributions is observed once rather than as
|
|
54
|
+
* an intermediate state.
|
|
55
|
+
*
|
|
56
|
+
* Publication happens even when the operation failed, because contributions
|
|
57
|
+
* withdrawn by Instances that did stop must not stay visible. If both the
|
|
58
|
+
* operation and the publication fail, both errors are reported — the
|
|
59
|
+
* publication failure must not hide the reason the change failed, and the
|
|
60
|
+
* operation failure must not hide a store left inconsistent.
|
|
61
|
+
*/
|
|
62
|
+
withContributionBatch<T>(operation: () => Promise<T>): Promise<T>;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=instance-coordinator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instance-coordinator.d.ts","sourceRoot":"","sources":["../src/instance-coordinator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAA8B,KAAK,cAAc,EAAoB,MAAM,aAAa,CAAC;AAChG,OAAO,EAAwB,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGnF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAY,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAkD,KAAK,MAAM,EAAE,MAAM,YAAY,CAAC;AAazF,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC;IAC1D,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAC3C;AAED,qBAAa,gCAAiC,SAAQ,cAAc;CAAG;AAEvE;;;;;;;;;;;;GAYG;AACH,qBAAa,mBAAmB;;gBAUlB,IAAI,EAAE,uBAAuB;IAQzC,WAAW,CAAC,QAAQ,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM;;;;;;;IAO3D,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC;IAIzC,cAAc,CAAC,aAAa,EAAE,QAAQ,CAAC,kBAAkB,CAAC;IAS1D,oBAAoB;IAKpB,qBAAqB,CAAC,KAAK,EAAE,aAAa,CAAC,kBAAkB,CAAC;IAI9D,aAAa;IAIP,QAAQ,CACZ,IAAI,EAAE,iBAAiB,EACvB,aAAa,EAAE,WAAW,CAAC,kBAAkB,CAAC,EAC9C,OAAO,EAAE,WAAW,CAAC,kBAAkB,EAAE,OAAO,CAAC,EACjD,SAAS,EAAE,sBAAsB;IAgEnC;;;;;OAKG;IACG,UAAU,CAAC,aAAa,EAAE,WAAW,CAAC,kBAAkB,CAAC;IAwB/D;;;;;;;;;;OAUG;IACG,qBAAqB,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC;CAoP3D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle-status.d.ts","sourceRoot":"","sources":["../src/lifecycle-status.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lifecycle-status.d.ts","sourceRoot":"","sources":["../src/lifecycle-status.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAC"}
|
|
@@ -13,7 +13,13 @@ export interface LifetimeSnapshot {
|
|
|
13
13
|
readonly children: ReadonlyArray<LifetimeSnapshot>;
|
|
14
14
|
}
|
|
15
15
|
export type LifetimeResourceKind = "cleanups" | "tasks" | "listeners" | "contributions" | "contributionViews" | "subscriptions";
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Internal state that mirrors a Lifetime without retaining any owned resource.
|
|
18
|
+
*
|
|
19
|
+
* Counts, not references. A diagnostics tree that held the listeners and tasks
|
|
20
|
+
* it describes would keep them alive precisely because someone was watching, so
|
|
21
|
+
* a node knows how many of each kind exist and nothing about what they are.
|
|
22
|
+
*/
|
|
17
23
|
export interface LifetimeDiagnosticNode {
|
|
18
24
|
readonly label: string;
|
|
19
25
|
readonly counts: Record<LifetimeResourceKind, number>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifetime-diagnostics.d.ts","sourceRoot":"","sources":["../src/lifetime-diagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEvE,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,CAAC;AAEhE,gEAAgE;AAChE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;CACpD;AAED,MAAM,MAAM,oBAAoB,GAC9B,UAAU,GAAG,OAAO,GAAG,WAAW,GAAG,eAAe,GAAG,mBAAmB,GAAG,eAAe,CAAC;AAE/F
|
|
1
|
+
{"version":3,"file":"lifetime-diagnostics.d.ts","sourceRoot":"","sources":["../src/lifetime-diagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,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M,EAAE,sBAAsB,EAAE,KAAK,EAAE,sBAAsB;IAMpE,MAAM,CAAC,MAAM,EAAE,sBAAsB,EAAE,KAAK,EAAE,sBAAsB;IAKpE,MAAM,CAAC,IAAI,EAAE,sBAAsB,EAAE,IAAI,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC;IAU9E,cAAc,CAAC,IAAI,EAAE,sBAAsB;IAM3C,UAAU;CAMX"}
|
package/dist/lifetime.d.ts
CHANGED
|
@@ -10,6 +10,11 @@ export interface Logger {
|
|
|
10
10
|
readonly warn: (message: unknown, ...details: unknown[]) => void;
|
|
11
11
|
readonly error: (message: unknown, ...details: unknown[]) => void;
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Structural, so `console` and any four-method object both qualify without
|
|
15
|
+
* importing a Dougong type. The try/catch is for hostile getters: a validator
|
|
16
|
+
* must not throw the very error it was asked to prevent.
|
|
17
|
+
*/
|
|
13
18
|
export declare function isLogger(value: unknown): value is Logger;
|
|
14
19
|
export interface InstanceMeta {
|
|
15
20
|
readonly hostName: string;
|
|
@@ -23,6 +28,12 @@ export interface Task<T = void> extends AsyncDisposable {
|
|
|
23
28
|
export type Cleanup = () => unknown;
|
|
24
29
|
export type BackgroundTask<T> = (signal: AbortSignal) => T | PromiseLike<T>;
|
|
25
30
|
type EventArguments<T> = [T] extends [void] ? [payload?: T] : [payload: T];
|
|
31
|
+
/**
|
|
32
|
+
* The complete set of things an Instance can do. Seven members, each returning
|
|
33
|
+
* something the Lifetime already owns — there is no `register()` that takes a
|
|
34
|
+
* resource from elsewhere, which is why ownership is structural rather than a
|
|
35
|
+
* convention Plugin authors have to follow.
|
|
36
|
+
*/
|
|
26
37
|
export interface LifetimeOperations {
|
|
27
38
|
readonly signal: AbortSignal;
|
|
28
39
|
readonly cleanup: (dispose: Cleanup) => AsyncDisposable;
|
|
@@ -35,11 +46,11 @@ export interface LifetimeOperations {
|
|
|
35
46
|
export interface LifetimeContext extends LifetimeOperations, AsyncDisposable {
|
|
36
47
|
}
|
|
37
48
|
export interface LifetimePort {
|
|
38
|
-
stageOn<T>(
|
|
39
|
-
emit<T>(
|
|
40
|
-
stageContribution<T>(
|
|
41
|
-
writeLog(level: keyof Logger, message: unknown, meta: InstanceMeta, details: readonly unknown[])
|
|
42
|
-
report(error: unknown)
|
|
49
|
+
readonly stageOn: <T>(installationId: string, token: Event<T>, listener: EventListener<T>, release: (publication: Publication) => void) => StagedResource<Disposable>;
|
|
50
|
+
readonly emit: <T>(installationId: string, token: Event<T>, payload: T) => Promise<void>;
|
|
51
|
+
readonly stageContribution: <T>(installationId: string, token: ExtensionPoint<T>, key: string, value: T, release: (publication: Publication) => void) => StagedResource<Contribution<T>>;
|
|
52
|
+
readonly writeLog: (level: keyof Logger, message: unknown, meta: InstanceMeta, details: readonly unknown[]) => void;
|
|
53
|
+
readonly report: (error: unknown) => void;
|
|
43
54
|
}
|
|
44
55
|
interface LifetimeOptions {
|
|
45
56
|
readonly parentSignal?: AbortSignal;
|
|
@@ -59,12 +70,21 @@ declare class CleanupRecord implements AsyncDisposable {
|
|
|
59
70
|
export declare class Lifetime implements LifetimeContext {
|
|
60
71
|
#private;
|
|
61
72
|
readonly handle: LifetimeContext;
|
|
62
|
-
constructor(port: LifetimePort,
|
|
73
|
+
constructor(port: LifetimePort, installationId: string, options?: LifetimeOptions);
|
|
63
74
|
get signal(): AbortSignal;
|
|
64
75
|
get diagnostics(): import('./snapshot-view').SnapshotView<import('./lifetime-diagnostics').LifetimeSnapshot>;
|
|
65
|
-
/** A facade whose only
|
|
76
|
+
/** A facade whose only InstanceCoordinator edge disappears when this Lifetime terminates. */
|
|
66
77
|
contextLogger(meta: InstanceMeta): Logger;
|
|
67
78
|
cleanup(dispose: Cleanup): CleanupRecord;
|
|
79
|
+
/**
|
|
80
|
+
* A child scope. It inherits this Lifetime's signal, so cancellation flows
|
|
81
|
+
* down, and its declaration phase, so a child created during `setup()` also
|
|
82
|
+
* stages rather than publishing immediately.
|
|
83
|
+
*
|
|
84
|
+
* Disposing a child detaches it from both the resource set and the diagnostics
|
|
85
|
+
* tree. A Plugin can therefore use child lifetimes as a unit of work — one per
|
|
86
|
+
* open document, per connection — without the parent growing.
|
|
87
|
+
*/
|
|
68
88
|
lifetime(label: string): LifetimeContext;
|
|
69
89
|
spawn<T>(task: BackgroundTask<T>): Task<T>;
|
|
70
90
|
on<T>(token: Event<T>, listener: EventListener<T>): Disposable;
|
|
@@ -74,8 +94,24 @@ export declare class Lifetime implements LifetimeContext {
|
|
|
74
94
|
ownLease(resource: Disposable, kind: ContributionLeaseKind): () => boolean;
|
|
75
95
|
/** Releases a temporary startup cancellation edge after its layer commits. */
|
|
76
96
|
detachStartupSignal(): void;
|
|
77
|
-
/**
|
|
97
|
+
/**
|
|
98
|
+
* Atomically makes all declarations staged during setup visible.
|
|
99
|
+
*
|
|
100
|
+
* Children publish too, recursively, so a Lifetime created inside `setup()`
|
|
101
|
+
* becomes visible with its parent rather than being stranded staged. Called by
|
|
102
|
+
* the InstanceCoordinator once the whole activation layer has succeeded —
|
|
103
|
+
* which is what makes "no half-built Instance is observable" true.
|
|
104
|
+
*/
|
|
78
105
|
publish(): void;
|
|
106
|
+
/**
|
|
107
|
+
* Disposal is idempotent and joinable: concurrent callers share one completion
|
|
108
|
+
* promise, so a Lifetime disposed by both its owner and a `using` block runs
|
|
109
|
+
* its teardown once.
|
|
110
|
+
*
|
|
111
|
+
* The three-stage order is the module header's; see it for why. Errors from
|
|
112
|
+
* every stage accumulate and are aggregated at the end, so one failing cleanup
|
|
113
|
+
* neither hides the others nor prevents them from running.
|
|
114
|
+
*/
|
|
79
115
|
dispose(): Promise<void>;
|
|
80
116
|
[asyncDisposeSymbol](): Promise<void>;
|
|
81
117
|
}
|
package/dist/lifetime.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifetime.d.ts","sourceRoot":"","sources":["../src/lifetime.ts"],"names":[],"mappings":"
|
|
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AE,CAAC;IAc7D,8EAA8E;IAC9E,QAAQ,CAAC,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,qBAAqB;IAM1D,8EAA8E;IAC9E,mBAAmB;IAMnB;;;;;;;OAOG;IACH,OAAO;IAWP;;;;;;;;OAQG;IACH,OAAO;IAwEP,CAAC,kBAAkB,CAAC;CA0BrB"}
|
package/dist/plugin.d.ts
CHANGED
|
@@ -5,6 +5,11 @@ import { InstanceMeta, LifetimeOperations, Logger } from './lifetime';
|
|
|
5
5
|
import { Awaitable } from './resource';
|
|
6
6
|
export type { Awaitable } from './resource';
|
|
7
7
|
export type Requirements = Readonly<Record<string, Requirement>>;
|
|
8
|
+
/**
|
|
9
|
+
* Only Services can be provided. An ExtensionPoint is an open set that many
|
|
10
|
+
* Installations contribute to, and an Event has no owner at all, so neither is
|
|
11
|
+
* something one Plugin can claim to supply.
|
|
12
|
+
*/
|
|
8
13
|
export type Provisions = Readonly<Record<string, Extract<Requirement, {
|
|
9
14
|
readonly kind: "service";
|
|
10
15
|
}>>>;
|
|
@@ -16,7 +21,21 @@ export type ResolvedRequirements<T extends Requirements> = {
|
|
|
16
21
|
export type ProvidedServices<T extends Provisions> = {
|
|
17
22
|
readonly [Key in keyof T]: ServiceValue<T[Key]>;
|
|
18
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* A Plugin that provides nothing returns `void`; one that provides Services must
|
|
26
|
+
* return exactly them. Forgetting a provided Service is therefore a compile
|
|
27
|
+
* error, not a `SERVICE_NOT_RETURNED` at activation time.
|
|
28
|
+
*/
|
|
19
29
|
type SetupOutput<T extends Provisions> = keyof T extends never ? void : ProvidedServices<T>;
|
|
30
|
+
/**
|
|
31
|
+
* Everything one Instance can reach, and nothing more. Resolved requirements
|
|
32
|
+
* arrive under the same aliases they were declared with, alongside the Lifetime
|
|
33
|
+
* operations that own whatever `setup()` creates.
|
|
34
|
+
*
|
|
35
|
+
* There is no Host, no registry and no parent here. A Plugin's dependencies are
|
|
36
|
+
* exactly what it declared — which is what makes a declaration readable in
|
|
37
|
+
* isolation.
|
|
38
|
+
*/
|
|
20
39
|
export type PluginContext<T extends Requirements = Requirements> = LifetimeOperations & ResolvedRequirements<T> & {
|
|
21
40
|
readonly meta: InstanceMeta;
|
|
22
41
|
readonly log: Logger;
|
|
@@ -49,10 +68,17 @@ export type InstanceContext = LifetimeOperations & Readonly<Record<string, unkno
|
|
|
49
68
|
export interface NormalizedPlugin {
|
|
50
69
|
readonly name: string;
|
|
51
70
|
readonly config?: StandardSchemaV1<unknown, unknown>;
|
|
52
|
-
readonly requires
|
|
53
|
-
readonly provides
|
|
71
|
+
readonly requires: Requirements;
|
|
72
|
+
readonly provides: Provisions;
|
|
54
73
|
readonly setup: (context: InstanceContext, config: unknown) => Awaitable<void | Readonly<Record<string, unknown>>>;
|
|
55
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* Validates and freezes a Plugin declaration.
|
|
77
|
+
*
|
|
78
|
+
* The `NoInfer` wrappers on the return type stop a caller's annotation from
|
|
79
|
+
* widening the inferred generics back out, which would let `setup()` see a
|
|
80
|
+
* looser context than the declaration actually promises.
|
|
81
|
+
*/
|
|
56
82
|
export declare function definePlugin<Config = void, Requires extends Requirements = {}, Provides extends Provisions = {}, ConfigInput = Config>(plugin: Plugin<Config, Requires, Provides, ConfigInput>): Plugin<NoInfer<Config>, NoInfer<Requires>, NoInfer<Provides>, NoInfer<ConfigInput>>;
|
|
57
83
|
/** The sole boundary that validates a public Plugin and erases authoring-only generics. */
|
|
58
84
|
export declare function normalizePlugin(plugin: AnyPlugin): NormalizedPlugin;
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,W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AI,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;CAC1D;AAwBD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,MAAM,GAAG,IAAI,EACb,QAAQ,SAAS,YAAY,GAAG,EAAE,EAClC,QAAQ,SAAS,UAAU,GAAG,EAAE,EAChC,WAAW,GAAG,MAAM,EAEpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,CAAC,GACtD,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,CAErF;AA+JD,2FAA2F;AAC3F,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,gBAAgB,CAInE"}
|
package/dist/readonly-map.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* A structural snapshot that exposes no mutating Map methods.
|
|
3
|
+
*
|
|
4
|
+
* `ReadonlyMap` is only a compile-time view — casting a live `Map` to it still
|
|
5
|
+
* hands out an object whose `set` and `delete` are one cast away. This copies on
|
|
6
|
+
* construction and freezes itself, so a published snapshot cannot be edited by
|
|
7
|
+
* whoever received it, and cannot change under a reader afterwards.
|
|
8
|
+
*/
|
|
2
9
|
export declare class ReadonlyMapSnapshot<Key, Value> implements ReadonlyMap<Key, Value> {
|
|
3
10
|
#private;
|
|
4
11
|
constructor(values?: ReadonlyMap<Key, Value> | Iterable<readonly [Key, Value]>);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readonly-map.d.ts","sourceRoot":"","sources":["../src/readonly-map.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"readonly-map.d.ts","sourceRoot":"","sources":["../src/readonly-map.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qBAAa,mBAAmB,CAAC,GAAG,EAAE,KAAK,CAAE,YAAW,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC;;gBAGjE,MAAM,GAAE,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,QAAQ,CAAC,SAAS,CAAC,GAAG,EAAE,KAAK,CAAC,CAAM;IAYlF,IAAI,IAAI,WAEP;IAED,GAAG,CAAC,GAAG,EAAE,GAAG;IAIZ,GAAG,CAAC,GAAG,EAAE,GAAG;IAIZ,OAAO,CACL,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,IAAI,EACxE,OAAO,CAAC,EAAE,OAAO;IAKnB,OAAO;IAIP,IAAI;IAIJ,MAAM;IAIN,CAAC,MAAM,CAAC,QAAQ,CAAC;CAGlB"}
|
package/dist/record.d.ts
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
interface PlainRecordOptions {
|
|
2
|
+
/** When present, any key outside this set is rejected instead of ignored. */
|
|
2
3
|
readonly fields?: ReadonlySet<string>;
|
|
4
|
+
/** Lets a caller raise its own coded error instead of a bare `TypeError`. */
|
|
3
5
|
readonly createError?: (message: string) => Error;
|
|
4
6
|
}
|
|
5
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Validates declaration bags without reading through their prototype chain.
|
|
9
|
+
*
|
|
10
|
+
* Every option object Core accepts passes through here. The checks look
|
|
11
|
+
* paranoid, and each one closes a way for a declaration to lie:
|
|
12
|
+
*
|
|
13
|
+
* - a non-`Object.prototype` prototype could answer for keys it does not own;
|
|
14
|
+
* - a non-enumerable or symbol key would escape the field allowlist;
|
|
15
|
+
* - a getter (`{ get name() {...} }`) would return a different value on the
|
|
16
|
+
* second read, so validation would not describe what gets stored.
|
|
17
|
+
*
|
|
18
|
+
* Rejecting an unknown field rather than ignoring it turns a typo — `permissions`
|
|
19
|
+
* for `authorizer` — into an error at the call site instead of silence.
|
|
20
|
+
*/
|
|
6
21
|
export declare function assertPlainRecord(value: unknown, label: string, options?: PlainRecordOptions): asserts value is object;
|
|
7
22
|
export {};
|
|
8
23
|
//# sourceMappingURL=record.d.ts.map
|
package/dist/record.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../src/record.ts"],"names":[],"mappings":"AAAA,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACtC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,KAAK,CAAC;CACnD;AAED
|
|
1
|
+
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../src/record.ts"],"names":[],"mappings":"AAAA,UAAU,kBAAkB;IAC1B,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACtC,6EAA6E;IAC7E,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,KAAK,CAAC;CACnD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,KAAK,IAAI,MAAM,CAoBzB"}
|
package/dist/resource.d.ts
CHANGED
|
@@ -16,9 +16,15 @@ export interface AsyncDisposable {
|
|
|
16
16
|
[Symbol.asyncDispose](): Promise<void>;
|
|
17
17
|
}
|
|
18
18
|
export type Resource = Disposable | AsyncDisposable;
|
|
19
|
+
/**
|
|
20
|
+
* A resource created in one step and made visible in another. Declarations made
|
|
21
|
+
* during `setup()` stage first and publish only once their whole layer
|
|
22
|
+
* activates, so no half-built Instance is ever observable.
|
|
23
|
+
*/
|
|
19
24
|
export interface Publication extends Disposable {
|
|
20
25
|
publish(): void;
|
|
21
26
|
}
|
|
27
|
+
/** A Publication paired with the public handle its owner hands to Plugin code. */
|
|
22
28
|
export interface StagedResource<T extends Disposable> extends Publication {
|
|
23
29
|
readonly handle: T;
|
|
24
30
|
}
|
package/dist/resource.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;AAE9C,mGAAmG;AACnG,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,OAAO,GACrB,OAAO,CAAC,aAAa,IAAI,OAAO,OAAO,CAAC,aAAa,CAIvD;AAED,8FAA8F;AAC9F,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,IAAI,EAAE,gBAAgB,GAAG,qBAAqB,UAG/C;AAID,yEAAyE;AACzE,eAAO,MAAM,aAAa,EAAE,OAAO,MAAM,CAAC,OAGhB,CAAC;AAC3B,0EAA0E;AAC1E,eAAO,MAAM,kBAAkB,EAAE,OAAO,MAAM,CAAC,YAGhB,CAAC;AAMhC,MAAM,WAAW,UAAU;IACzB,OAAO,IAAI,IAAI,CAAC;IAChB,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxC;AAED,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,eAAe,CAAC;AAEpD;;;;GAIG;AACH,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,kFAAkF;AAClF,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,UAAU,CAAE,SAAQ,WAAW;IACvE,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;CACpB"}
|
package/dist/serial-queue.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Serial execution where each caller keeps its own result and failures do not
|
|
3
|
+
* poison the tail.
|
|
4
|
+
*
|
|
5
|
+
* This is the Host's command boundary: one queue is the reason two concurrent
|
|
6
|
+
* `install()` calls cannot interleave their transactions.
|
|
7
|
+
*/
|
|
2
8
|
export declare class SerialQueue {
|
|
3
9
|
#private;
|
|
4
10
|
get settled(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serial-queue.d.ts","sourceRoot":"","sources":["../src/serial-queue.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"serial-queue.d.ts","sourceRoot":"","sources":["../src/serial-queue.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,qBAAa,WAAW;;IAGtB,IAAI,OAAO,kBAEV;IAED,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;CAcxD"}
|
package/dist/snapshot-view.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export interface SnapshotView<T> {
|
|
|
3
3
|
get(): T;
|
|
4
4
|
subscribe(listener: () => void): Disposable;
|
|
5
5
|
}
|
|
6
|
+
/** Internal synchronous commit boundary for related snapshots. */
|
|
7
|
+
export declare function batchSnapshotNotifications(operation: () => void): void;
|
|
6
8
|
/** Synchronous writer for immutable operational snapshots. */
|
|
7
9
|
export declare class SnapshotPublisher<T> implements Disposable {
|
|
8
10
|
#private;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot-view.d.ts","sourceRoot":"","sources":["../src/snapshot-view.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"snapshot-view.d.ts","sourceRoot":"","sources":["../src/snapshot-view.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAG5D,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,GAAG,IAAI,CAAC,CAAC;IACT,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,UAAU,CAAC;CAC7C;AAwBD,kEAAkE;AAClE,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,MAAM,IAAI,QAmB/D;AA6BD,8DAA8D;AAC9D,qBAAa,iBAAiB,CAAC,CAAC,CAAE,YAAW,UAAU;;gBAMzC,IAAI,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI;IAU3D,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,CAG3B;IAEH,UAAU;IAOV,OAAO;IAiBP,CAAC,aAAa,CAAC;CAgChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-result.d.ts","sourceRoot":"","sources":["../src/sync-result.ts"],"names":[],"mappings":"AAaA,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAQvE;AAID,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAAC,OAAO,CAAC,CAGxE"}
|
package/package.json
CHANGED
package/dist/runtime.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { ContractRegistryDraft } from './contract-registry';
|
|
2
|
-
import { ExtensionPoint } from './contracts';
|
|
3
|
-
import { ContributionView } from './contribution-store';
|
|
4
|
-
import { InstallationGraph } from './installation-graph';
|
|
5
|
-
import { InstallationRecord } from './installation';
|
|
6
|
-
import { Logger } from './lifetime';
|
|
7
|
-
interface RuntimeOptions {
|
|
8
|
-
readonly hostName: string;
|
|
9
|
-
readonly logger: Logger;
|
|
10
|
-
readonly isInstalled: (installationId: string) => boolean;
|
|
11
|
-
readonly report: (error: unknown) => void;
|
|
12
|
-
}
|
|
13
|
-
export declare class IncompleteActivationCleanupError extends AggregateError {
|
|
14
|
-
}
|
|
15
|
-
/** Owns live Instances and the capabilities reachable from their Lifetimes. */
|
|
16
|
-
export declare class Runtime {
|
|
17
|
-
#private;
|
|
18
|
-
constructor(options: RuntimeOptions);
|
|
19
|
-
readService(provider: InstallationRecord, serviceId: string): {
|
|
20
|
-
found: true;
|
|
21
|
-
value: unknown;
|
|
22
|
-
} | {
|
|
23
|
-
found: false;
|
|
24
|
-
value?: never;
|
|
25
|
-
};
|
|
26
|
-
contributions<T>(token: ExtensionPoint<T>): ContributionView<T>;
|
|
27
|
-
captureConfigs(installations: Iterable<InstallationRecord>): Map<InstallationRecord, unknown>;
|
|
28
|
-
resetActivationState(): void;
|
|
29
|
-
commitActivationOrder(order: ReadonlyArray<InstallationRecord>): void;
|
|
30
|
-
deactivateAll(): Promise<unknown[]>;
|
|
31
|
-
activate(plan: InstallationGraph, installations: ReadonlySet<InstallationRecord>, configs: ReadonlyMap<InstallationRecord, unknown>, contracts: ContractRegistryDraft): Promise<void>;
|
|
32
|
-
deactivate(installations: ReadonlySet<InstallationRecord>): Promise<unknown[]>;
|
|
33
|
-
withContributionBatch<T>(operation: () => Promise<T>): Promise<T>;
|
|
34
|
-
}
|
|
35
|
-
export {};
|
|
36
|
-
//# sourceMappingURL=runtime.d.ts.map
|
package/dist/runtime.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAA8B,KAAK,cAAc,EAAoB,MAAM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