@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
package/README.md
CHANGED
|
@@ -99,7 +99,7 @@ Node.js ≥ 22; Chrome / Edge 119, Firefox 121 or Safari 17.4 for browsers and W
|
|
|
99
99
|
- 文档站 / Documentation: https://tangerg.github.io/dougong/
|
|
100
100
|
- 仓库 / Repository: https://github.com/Tangerg/dougong
|
|
101
101
|
|
|
102
|
-
>
|
|
103
|
-
> Early
|
|
102
|
+
> 早期 0.x 开发阶段,当前不承诺向后兼容。
|
|
103
|
+
> Early 0.x development; no backward-compatibility promises yet.
|
|
104
104
|
|
|
105
105
|
MIT
|
package/dist/change-set.d.ts
CHANGED
|
@@ -24,16 +24,19 @@ export type ChangeOperation = {
|
|
|
24
24
|
readonly installation: InstallationRecord;
|
|
25
25
|
};
|
|
26
26
|
interface ChangePort {
|
|
27
|
-
create(plugin: NormalizedPlugin, config: unknown)
|
|
27
|
+
readonly create: (plugin: NormalizedPlugin, config: unknown) => {
|
|
28
28
|
readonly record: InstallationRecord;
|
|
29
|
-
readonly
|
|
29
|
+
readonly facade: Installation<AnyPlugin>;
|
|
30
30
|
};
|
|
31
|
-
resolve(installation: object)
|
|
32
|
-
execute(operations: ReadonlyArray<ChangeOperation>)
|
|
33
|
-
attach(installation: InstallationRecord)
|
|
34
|
-
discard(installation: InstallationRecord, error: unknown)
|
|
31
|
+
readonly resolve: (installation: object) => InstallationRecord;
|
|
32
|
+
readonly execute: (operations: ReadonlyArray<ChangeOperation>) => Promise<void>;
|
|
33
|
+
readonly attach: (installation: InstallationRecord) => void;
|
|
34
|
+
readonly discard: (installation: InstallationRecord, error: unknown) => void;
|
|
35
35
|
}
|
|
36
|
+
type DraftInstallationFactory = ChangePort["create"];
|
|
36
37
|
export declare function discardChangeSetDraft(draft: ChangeSetDraft, error: unknown): void;
|
|
38
|
+
/** Stages explicit ownership into a shared draft without widening the public ChangeSet API. */
|
|
39
|
+
export declare function stageChangeSetInstallation<Declaration extends AnyPlugin>(draft: ChangeSetDraft, plugin: Declaration, config: unknown, create: DraftInstallationFactory): Installation<Declaration>;
|
|
37
40
|
/**
|
|
38
41
|
* Rich one-shot draft for the canonical mutation path. It owns target
|
|
39
42
|
* uniqueness, Installation authority, sealing and commit idempotency before
|
|
@@ -45,6 +48,12 @@ export declare class ChangeSetDraft implements ChangeSet {
|
|
|
45
48
|
install<Declaration extends AnyPlugin>(plugin: Declaration, ...config: PluginConfigArguments<Declaration>): Installation<Declaration>;
|
|
46
49
|
update<Declaration extends AnyPlugin>(installation: Installation<Declaration>, update: InstallationUpdate<Declaration>): void;
|
|
47
50
|
remove<Declaration extends AnyPlugin>(installation: Installation<Declaration>): void;
|
|
51
|
+
/**
|
|
52
|
+
* Commit is idempotent by returning the same promise, so two callers awaiting
|
|
53
|
+
* one draft get one transaction rather than two. `committing` exists to catch
|
|
54
|
+
* the reentrant case — an `attach` hook that calls `commit()` again — which
|
|
55
|
+
* would otherwise submit the operation list twice.
|
|
56
|
+
*/
|
|
48
57
|
commit(): Promise<void>;
|
|
49
58
|
}
|
|
50
59
|
export {};
|
package/dist/change-set.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change-set.d.ts","sourceRoot":"","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Aa,CAAC,eAAe,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChF,QAAQ,CAAC,MAAM,EAAE,CAAC,YAAY,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC5D,QAAQ,CAAC,OAAO,EAAE,CAAC,YAAY,EAAE,kBAAkB,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9E;AAED,KAAK,wBAAwB,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;AAwBrD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,OAAO,QAE1E;AAED,+FAA+F;AAC/F,wBAAgB,0BAA0B,CAAC,WAAW,SAAS,SAAS,EACtE,KAAK,EAAE,cAAc,EACrB,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,wBAAwB,6BAKjC;AAED;;;;GAIG;AACH,qBAAa,cAAe,YAAW,SAAS;;gBAIlC,IAAI,EAAE,UAAU;IAS5B,OAAO,CAAC,WAAW,SAAS,SAAS,EACnC,MAAM,EAAE,WAAW,EACnB,GAAG,MAAM,EAAE,qBAAqB,CAAC,WAAW,CAAC,GAC5C,YAAY,CAAC,WAAW,CAAC;IAkB5B,MAAM,CAAC,WAAW,SAAS,SAAS,EAClC,YAAY,EAAE,YAAY,CAAC,WAAW,CAAC,EACvC,MAAM,EAAE,kBAAkB,CAAC,WAAW,CAAC;IA6BzC,MAAM,CAAC,WAAW,SAAS,SAAS,EAAE,YAAY,EAAE,YAAY,CAAC,WAAW,CAAC;IAK7E;;;;;OAKG;IACH,MAAM;CA4EP"}
|
package/dist/configuration.d.ts
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Resolves one Plugin config at the Standard Schema trust boundary.
|
|
4
|
+
*
|
|
5
|
+
* The validator is third-party code, so its return value is checked as
|
|
6
|
+
* untrusted input rather than trusted to match the spec. A validator that
|
|
7
|
+
* returns a string, or an object with neither `value` nor `issues`, is a bug in
|
|
8
|
+
* that library — it becomes a `TypeError` naming the Installation rather than an
|
|
9
|
+
* `undefined` config that fails somewhere inside `setup()`.
|
|
10
|
+
*
|
|
11
|
+
* A schema is optional. With none declared, the input passes through untouched:
|
|
12
|
+
* Core does not invent a validation step the Plugin author did not ask for.
|
|
13
|
+
*/
|
|
3
14
|
export declare function resolvePluginConfig(schema: StandardSchemaV1<unknown, unknown> | undefined, input: unknown, installationId: string): Promise<unknown>;
|
|
4
15
|
//# sourceMappingURL=configuration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../src/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG9D
|
|
1
|
+
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../src/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG9D;;;;;;;;;;;GAWG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,SAAS,EACtD,KAAK,EAAE,OAAO,EACd,cAAc,EAAE,MAAM,oBA6BvB"}
|
|
@@ -5,10 +5,10 @@ export declare class ContractRegistry {
|
|
|
5
5
|
get kinds(): ReadonlyMap<string, ContractKind>;
|
|
6
6
|
assertCompatible(contract: ContractIdentity): void;
|
|
7
7
|
remember(contract: ContractIdentity): void;
|
|
8
|
-
|
|
8
|
+
writer(candidateKinds: ReadonlyMap<string, ContractKind>): ContractRegistryWriter;
|
|
9
9
|
commit(kinds: ReadonlyMap<string, ContractKind>): void;
|
|
10
10
|
}
|
|
11
|
-
export declare class
|
|
11
|
+
export declare class ContractRegistryWriter {
|
|
12
12
|
#private;
|
|
13
13
|
constructor(registry: ContractRegistry, candidateKinds: ReadonlyMap<string, ContractKind>);
|
|
14
14
|
remember(contract: ContractIdentity): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract-registry.d.ts","sourceRoot":"","sources":["../src/contract-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"contract-registry.d.ts","sourceRoot":"","sources":["../src/contract-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAYlE,0EAA0E;AAC1E,qBAAa,gBAAgB;;IAG3B,IAAI,KAAK,IAAI,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,CAE7C;IAED,gBAAgB,CAAC,QAAQ,EAAE,gBAAgB;IAI3C,QAAQ,CAAC,QAAQ,EAAE,gBAAgB;IAInC,MAAM,CAAC,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC;IAIxD,MAAM,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC;CAIhD;AAYD,qBAAa,sBAAsB;;gBAGrB,QAAQ,EAAE,gBAAgB,EAAE,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC;IAKzF,QAAQ,CAAC,QAAQ,EAAE,gBAAgB;IAmBnC,MAAM;IAON,OAAO;CAGR;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE,QAAQ,EAAE,gBAAgB,QAGhG"}
|
package/dist/contracts.d.ts
CHANGED
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
declare const contractBrand: unique symbol;
|
|
2
2
|
declare const contractValueSlot: unique symbol;
|
|
3
3
|
declare const optionalBrand: unique symbol;
|
|
4
|
+
/**
|
|
5
|
+
* Holds `T` in a covariant and a contravariant position at once, which makes
|
|
6
|
+
* every Contract invariant in `T`. Without the contravariant half, `Service<Cat>`
|
|
7
|
+
* would be assignable to `Service<Animal>` and `host.get()` could hand back a
|
|
8
|
+
* value narrower than the token the caller passed in.
|
|
9
|
+
*/
|
|
4
10
|
interface ContractValueSlot<T> {
|
|
5
11
|
readonly value: T;
|
|
6
12
|
readonly accept: (value: T) => void;
|
|
7
13
|
}
|
|
8
14
|
export type ContractKind = "service" | "extensionPoint" | "event";
|
|
15
|
+
/** The erased half of a token: all a registry needs to key it, with no value type. */
|
|
9
16
|
export interface ContractIdentity {
|
|
10
17
|
readonly id: string;
|
|
11
18
|
readonly kind: ContractKind;
|
|
12
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Nominal marker. A structurally identical `{ id, kind }` literal is not a
|
|
22
|
+
* Contract, so a token has to come from `service()`, `event()` or
|
|
23
|
+
* `extensionPoint()` rather than from an object written at the call site.
|
|
24
|
+
*/
|
|
13
25
|
interface ContractBrand {
|
|
14
26
|
readonly [contractBrand]: true;
|
|
15
27
|
}
|
|
@@ -29,6 +41,11 @@ export interface ExtensionPoint<T> extends Contract<T, "extensionPoint"> {
|
|
|
29
41
|
}
|
|
30
42
|
export interface Event<T> extends Contract<T, "event"> {
|
|
31
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* `optional()` wraps rather than flags, so the required and optional forms of
|
|
46
|
+
* one Service stay distinct values. A Plugin cannot weaken a hard dependency by
|
|
47
|
+
* mutating a shared token.
|
|
48
|
+
*/
|
|
32
49
|
interface OptionalServiceIdentity {
|
|
33
50
|
readonly [optionalBrand]: true;
|
|
34
51
|
readonly kind: "optional";
|
|
@@ -38,8 +55,18 @@ export interface OptionalService<T> extends OptionalServiceIdentity {
|
|
|
38
55
|
readonly service: Service<T>;
|
|
39
56
|
readonly [contractValueSlot]: ContractValueSlot<T>;
|
|
40
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Everything a Plugin may name in `requires`. Events are absent on purpose: an
|
|
60
|
+
* Event is a transient fact reached through the Lifetime, never something whose
|
|
61
|
+
* presence the dependency graph can order.
|
|
62
|
+
*/
|
|
41
63
|
export type Requirement = ServiceIdentity | ExtensionPointIdentity | OptionalServiceIdentity;
|
|
42
64
|
export type ContractValue<T> = T extends Contract<infer Value, ContractKind> ? Value : never;
|
|
65
|
+
/**
|
|
66
|
+
* The brand is compile-time only, so a runtime check can be structural at best.
|
|
67
|
+
* This validates identity shape, not factory provenance. Declaration
|
|
68
|
+
* normalization takes an owned identity snapshot of accepted values.
|
|
69
|
+
*/
|
|
43
70
|
export declare function isContract(value: unknown, expected?: ContractKind): value is ContractIdentity;
|
|
44
71
|
export declare function assertContract(value: unknown, expected?: ContractKind): asserts value is ContractIdentity;
|
|
45
72
|
export declare function service<T>(id: string): Service<T>;
|
package/dist/contracts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAOA,OAAO,CAAC,MAAM,aAAa,EAAE,OAAO,MAAM,CAAC;AAC3C,OAAO,CAAC,MAAM,iBAAiB,EAAE,OAAO,MAAM,CAAC;AAC/C,OAAO,CAAC,MAAM,aAAa,EAAE,OAAO,MAAM,CAAC;AAE3C;;;;;GAKG;AACH,UAAU,iBAAiB,CAAC,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;IAClB,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;CACrC;AAED,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,gBAAgB,GAAG,OAAO,CAAC;AAElE,sFAAsF;AACtF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;CA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AAG,sBAAsB,GAAG,uBAAuB,CAAC;AAE7F,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,SAAS,QAAQ,CAAC,MAAM,KAAK,EAAE,YAAY,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC;AAgB7F;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,YAAY,GAAG,KAAK,IAAI,gBAAgB,CAY7F;AAED,wBAAgB,cAAc,CAC5B,KAAK,EAAE,OAAO,EACd,QAAQ,CAAC,EAAE,YAAY,GACtB,OAAO,CAAC,KAAK,IAAI,gBAAgB,CAGnC;AAQD,wBAAgB,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAEjD;AAED,wBAAgB,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAE7C;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,cAAc,CAAC,CAAC,CAAC,CAE/D;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAKjE;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,GACrC,KAAK,IAAI,eAAe,CAAC,CAAC,CAAC,CAI7B"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { Requirement } from './contracts';
|
|
2
2
|
import { disposeSymbol, Disposable, Publication, StagedResource } from './resource';
|
|
3
3
|
import { SnapshotView } from './snapshot-view';
|
|
4
|
+
/** A contributed entry the contributor may update or withdraw — nobody else can. */
|
|
4
5
|
export interface Contribution<T> extends Disposable {
|
|
5
6
|
readonly update: (value: T) => void;
|
|
6
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* The read side: a keyed map, not a list. Keys are `installationId/key`, so two
|
|
10
|
+
* Installations contributing under the same local key stay distinct, and a
|
|
11
|
+
* consumer can tell which Installation an entry came from.
|
|
12
|
+
*/
|
|
7
13
|
export type ContributionView<T> = SnapshotView<ReadonlyMap<string, T>>;
|
|
8
14
|
export type ContributionLeaseKind = "view" | "subscription";
|
|
9
15
|
type ExtensionPointIdentity = Extract<Requirement, {
|
|
@@ -22,15 +28,28 @@ declare class ContributionRecord<T> implements StagedResource<Contribution<T>> {
|
|
|
22
28
|
export declare class ContributionStore<T> {
|
|
23
29
|
#private;
|
|
24
30
|
constructor(invalidate: (store: ContributionStore<unknown>) => void, report: (error: unknown) => void, releaseIfUnused: (store: ContributionStore<unknown>) => void);
|
|
25
|
-
stage(
|
|
31
|
+
stage(installationId: string, key: string, value: T, release: (publication: Publication) => void): ContributionRecord<T>;
|
|
26
32
|
view(own: (resource: Disposable, kind: ContributionLeaseKind) => () => void): ContributionView<T>;
|
|
27
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* A stable view explicitly owned by the Host for graph-external consumers.
|
|
35
|
+
*
|
|
36
|
+
* Application code has no Lifetime to lease a view from, so this one is
|
|
37
|
+
* retained by the Host instead — which also pins the store open for as long as
|
|
38
|
+
* the Host lives. That is the trade: `host.contributions()` gives a handle that
|
|
39
|
+
* never goes stale, at the cost of a store that is no longer self-releasing.
|
|
40
|
+
*/
|
|
28
41
|
hostView(): ContributionView<T>;
|
|
29
42
|
snapshot(): ReadonlyMap<string, T>;
|
|
30
43
|
subscribe(listener: () => void, own: (resource: Disposable, kind: ContributionLeaseKind) => () => void): ContributionSubscription;
|
|
31
44
|
insert(id: string, contribution: ContributionRecord<T>, value: T): void;
|
|
32
45
|
update(id: string, contribution: ContributionRecord<T>, value: T): void;
|
|
33
46
|
removeContribution(id: string, contribution: ContributionRecord<T>, visibility: "staged" | "published"): void;
|
|
47
|
+
/**
|
|
48
|
+
* Rebuilds the published snapshot, and does nothing when the result would be
|
|
49
|
+
* equal by identity per key. A change that adds and removes the same entry —
|
|
50
|
+
* an Instance restarting with an identical contribution — therefore notifies
|
|
51
|
+
* nobody, instead of waking every observer to hand them what they already had.
|
|
52
|
+
*/
|
|
34
53
|
publishSnapshot(): void;
|
|
35
54
|
}
|
|
36
55
|
declare class ContributionSubscription implements Disposable {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contribution-store.d.ts","sourceRoot":"","sources":["../src/contribution-store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"contribution-store.d.ts","sourceRoot":"","sources":["../src/contribution-store.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AACnG,OAAO,EAAiD,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEnG,oFAAoF;AACpF,MAAM,WAAW,YAAY,CAAC,CAAC,CAAE,SAAQ,UAAU;IACjD,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;CACrC;AAED;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,YAAY,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;AAEvE,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,cAAc,CAAC;AAE5D,KAAK,sBAAsB,GAAG,OAAO,CAAC,WAAW,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAA;CAAE,CAAC,CAAC;AAwExF,cAAM,kBAAkB,CAAC,CAAC,CAAE,YAAW,cAAc,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;;IAGpE,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;gBAG/B,KAAK,EA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EAAE,MAAM,EACV,YAAY,EAAE,kBAAkB,CAAC,CAAC,CAAC,EACnC,UAAU,EAAE,QAAQ,GAAG,WAAW;IAgBpC;;;;;OAKG;IACH,eAAe;CAgDhB;AA4BD,cAAM,wBAAyB,YAAW,UAAU;;gBAQtC,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,IAAI;IAKzD,OAAO;IAWP,CAAC,aAAa,CAAC;CAGhB;AAED,qBAAa,oBAAoB;;gBAMnB,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI;IAI5C,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,KAAK,EAAE,sBAAsB,GAAG,iBAAiB,CAAC,CAAC,CAAC;IAgBrE,IAAI,CAAC,CAAC,GAAG,OAAO,EAAE,KAAK,EAAE,sBAAsB,GAAG,gBAAgB,CAAC,CAAC,CAAC;IAIrE,UAAU;IAQV,QAAQ;CA4BT"}
|
package/dist/diagnostics.d.ts
CHANGED
|
@@ -3,6 +3,11 @@ import { InstallationRecord } from './installation';
|
|
|
3
3
|
import { LifetimeSnapshot } from './lifetime';
|
|
4
4
|
import { LifecycleStatus } from './lifecycle-status';
|
|
5
5
|
import { SnapshotView } from './snapshot-view';
|
|
6
|
+
/**
|
|
7
|
+
* `changing` is the reason the read window is closed during a transaction.
|
|
8
|
+
* `host.get()` only answers while the status is `active`, so a Service lookup
|
|
9
|
+
* mid-change cannot observe a half-applied plan — it fails instead.
|
|
10
|
+
*/
|
|
6
11
|
export type HostStatus = "idle" | "starting" | "active" | "changing" | "stopping";
|
|
7
12
|
export interface InstallationSnapshot {
|
|
8
13
|
readonly id: string;
|
|
@@ -26,11 +31,24 @@ export interface HostSnapshot {
|
|
|
26
31
|
readonly installations: ReadonlyMap<string, InstallationSnapshot>;
|
|
27
32
|
readonly groups: ReadonlyMap<string, GroupSnapshot>;
|
|
28
33
|
}
|
|
29
|
-
|
|
34
|
+
interface HostDiagnosticSource {
|
|
35
|
+
readonly status: HostStatus;
|
|
36
|
+
readonly installations: Iterable<InstallationRecord>;
|
|
37
|
+
readonly groups: Iterable<GroupNode>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Immutable operational read model; never a service locator or control plane.
|
|
41
|
+
*
|
|
42
|
+
* Everything here is data or another read-only view. There is deliberately no
|
|
43
|
+
* way back: nothing in a snapshot can install, remove, or reach a live Instance.
|
|
44
|
+
* `revision` increments on every publish so a consumer can tell "nothing
|
|
45
|
+
* changed" from "changed back to an equal value".
|
|
46
|
+
*/
|
|
30
47
|
export declare class HostDiagnostics {
|
|
31
48
|
#private;
|
|
32
49
|
readonly view: SnapshotView<HostSnapshot>;
|
|
33
|
-
constructor(name: string,
|
|
34
|
-
publish(
|
|
50
|
+
constructor(name: string, read: () => HostDiagnosticSource, report: (error: unknown) => void);
|
|
51
|
+
publish(): void;
|
|
35
52
|
}
|
|
53
|
+
export {};
|
|
36
54
|
//# sourceMappingURL=diagnostics.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../src/diagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEvE,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAC;AAElF,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,C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AAY,CAAC,YAAY,CAAC,CAAC;gBAE9B,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,oBAAoB,EAAE,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI;IAS5F,OAAO;CAmDR"}
|
package/dist/engine.d.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { ExtensionPoint, OptionalService, Service } from './contracts';
|
|
2
2
|
import { InstallationGraph } from './installation-graph';
|
|
3
3
|
import { InstallationRecord } from './installation';
|
|
4
|
-
import {
|
|
4
|
+
import { InstanceCoordinatorPort } from './instance-coordinator';
|
|
5
|
+
/**
|
|
6
|
+
* A rolled-back transition is a returned value, not a thrown error: the Host
|
|
7
|
+
* still has to settle readiness for everything the attempt touched before the
|
|
8
|
+
* caller's rejection is raised. Only fail-closed — where no consistent state
|
|
9
|
+
* could be restored — throws out of `transition()`.
|
|
10
|
+
*/
|
|
5
11
|
export type TransitionOutcome = {
|
|
6
12
|
readonly kind: "committed";
|
|
7
13
|
readonly affected: ReadonlySet<InstallationRecord>;
|
|
@@ -10,23 +16,38 @@ export type TransitionOutcome = {
|
|
|
10
16
|
readonly affected: ReadonlySet<InstallationRecord>;
|
|
11
17
|
readonly error: unknown;
|
|
12
18
|
};
|
|
13
|
-
interface EngineOptions {
|
|
14
|
-
readonly hostName: string;
|
|
15
|
-
readonly logger: Logger;
|
|
16
|
-
readonly isInstalled: (installationId: string) => boolean;
|
|
17
|
-
readonly report: (error: unknown) => void;
|
|
18
|
-
}
|
|
19
19
|
type ServiceAvailability = "available" | "unavailable";
|
|
20
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* Owns the committed plan and its commit, rollback and fail-closed transitions.
|
|
22
|
+
*
|
|
23
|
+
* `#plan` is the single definition of "committed". It is assigned only after an
|
|
24
|
+
* activation succeeds and cleared whenever no consistent graph exists, so
|
|
25
|
+
* `hasCommittedPlan` is the honest answer to whether this Host can serve reads —
|
|
26
|
+
* there is no second flag that could disagree with it.
|
|
27
|
+
*/
|
|
21
28
|
export declare class Engine {
|
|
22
29
|
#private;
|
|
23
|
-
constructor(
|
|
30
|
+
constructor(port: InstanceCoordinatorPort);
|
|
24
31
|
get hasCommittedPlan(): boolean;
|
|
25
32
|
get<T>(requirement: Service<T> | OptionalService<T>, availability: ServiceAvailability): T | undefined;
|
|
26
33
|
contributions<T>(token: ExtensionPoint<T>): import('./contribution-store').ContributionView<T>;
|
|
27
34
|
buildPlan(installations: Iterable<InstallationRecord>): InstallationGraph;
|
|
28
35
|
start(plan: InstallationGraph): Promise<void>;
|
|
29
36
|
stop(): Promise<unknown[]>;
|
|
37
|
+
/**
|
|
38
|
+
* The whole transaction, in the order the steps have to happen.
|
|
39
|
+
*
|
|
40
|
+
* Configs resolve and Contract identities draft *before* anything stops,
|
|
41
|
+
* because those are the failures that can still be taken back for free — a
|
|
42
|
+
* schema rejection at this point costs nothing. Once the affected Instances
|
|
43
|
+
* are down, every remaining failure has a price, and the only question left is
|
|
44
|
+
* whether the previous state can be restored.
|
|
45
|
+
*
|
|
46
|
+
* The whole body runs inside one contribution batch, so contributions
|
|
47
|
+
* withdrawn by stopping Instances and added by starting ones become visible in
|
|
48
|
+
* a single step. Without it, an ExtensionPoint observer would see the set
|
|
49
|
+
* briefly empty in the middle of a successful change.
|
|
50
|
+
*/
|
|
30
51
|
transition(nextPlan: InstallationGraph, changed: ReadonlySet<InstallationRecord>, restoreDeclarations: () => void): Promise<TransitionOutcome>;
|
|
31
52
|
}
|
|
32
53
|
export {};
|
package/dist/engine.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,OAAO,EACb,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,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,CACd,QAAQ,EAAE,iBAAiB,EAC3B,OAAO,EAAE,WAAW,CAAC,kBAAkB,CAAC,EACxC,mBAAmB,EAAE,MAAM,IAAI,GAC9B,OAAO,CAAC,iBAAiB,CAAC;CA0J9B"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,12 +1,58 @@
|
|
|
1
1
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
2
2
|
export declare class DougongError extends Error {
|
|
3
|
-
readonly code: string;
|
|
4
3
|
name: string;
|
|
4
|
+
readonly code: string;
|
|
5
5
|
constructor(code: string, message: string, options?: ErrorOptions);
|
|
6
6
|
}
|
|
7
|
-
/**
|
|
7
|
+
/** Bounded diagnostic values, with no references to the failed object graph. */
|
|
8
|
+
export interface ErrorSnapshot {
|
|
9
|
+
readonly name: string;
|
|
10
|
+
readonly message: string;
|
|
11
|
+
readonly code?: string;
|
|
12
|
+
readonly stack?: string;
|
|
13
|
+
readonly cause?: ErrorSnapshot;
|
|
14
|
+
readonly errors?: ReadonlyArray<ErrorSnapshot>;
|
|
15
|
+
readonly manifestName?: string;
|
|
16
|
+
readonly denied?: ReadonlyArray<string>;
|
|
17
|
+
readonly issues?: ReadonlyArray<{
|
|
18
|
+
readonly message: string;
|
|
19
|
+
readonly path?: ReadonlyArray<string | number>;
|
|
20
|
+
}>;
|
|
21
|
+
readonly truncated?: true;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A terminal failure is a record, never a reconstruction of the original class.
|
|
25
|
+
* Operations still reject with their live error; retained terminal handles use
|
|
26
|
+
* this class so causes and custom fields cannot retain application resources.
|
|
27
|
+
*/
|
|
28
|
+
export declare class RecordedFailure extends Error {
|
|
29
|
+
readonly name = "RecordedFailure";
|
|
30
|
+
readonly code: string | undefined;
|
|
31
|
+
readonly snapshot: ErrorSnapshot;
|
|
32
|
+
constructor(error: Error);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Preserves explicit Error values and classifies non-Error rejection reasons.
|
|
36
|
+
*
|
|
37
|
+
* `throw "nope"` in a Plugin must not become an unnamed failure at the Host
|
|
38
|
+
* boundary, so a non-Error reason is wrapped in a coded Error with the original
|
|
39
|
+
* kept as `cause`. A real Error is returned untouched — Core never rewrites a
|
|
40
|
+
* failure a Plugin author deliberately threw.
|
|
41
|
+
*
|
|
42
|
+
* The private marker class is why re-normalizing is safe: a wrapper that already
|
|
43
|
+
* belongs to Core can be re-coded as it passes an outer boundary instead of
|
|
44
|
+
* being wrapped a second time.
|
|
45
|
+
*/
|
|
8
46
|
export declare function normalizeFailure(error: unknown, code: string, message: string): Error;
|
|
9
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* Classifies the exact signal reason or a conventional AbortError, but only
|
|
49
|
+
* after abort.
|
|
50
|
+
*
|
|
51
|
+
* This is the one place Core is allowed to stop propagating a failure, so the
|
|
52
|
+
* test is deliberately narrow. Checking `signal.aborted` first means an
|
|
53
|
+
* `AbortError` thrown by unrelated code on a live signal stays a real error, and
|
|
54
|
+
* only a cancellation that this Lifetime actually requested is treated as one.
|
|
55
|
+
*/
|
|
10
56
|
export declare function isCancellationReason(signal: AbortSignal, error: unknown): boolean;
|
|
11
57
|
export declare class ConfigValidationError extends DougongError {
|
|
12
58
|
name: string;
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,qBAAa,YAAa,SAAQ,KAAK;IAC5B,IAAI,SAAkB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAEV,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAQlE;AAED,gFAAgF;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C,gBAAgB,CAAC,KAAK,CAAC,CAAC;gBAE3C,MAAM,EAAE,aAAa,CAAC,gBAAgB,CAAC,KAAK,CAAC;CAQ1D"}
|
package/dist/event-hub.d.ts
CHANGED
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
import { Disposable, Publication, StagedResource } from './resource';
|
|
2
2
|
export type EventListener<T> = (payload: T) => unknown;
|
|
3
3
|
interface ListenerSlot<T> {
|
|
4
|
-
|
|
4
|
+
listener: EventListener<T> | undefined;
|
|
5
5
|
}
|
|
6
6
|
export declare class EventHub {
|
|
7
7
|
#private;
|
|
8
8
|
stage<T>(eventId: string, listener: EventListener<T>, release: (publication: Publication) => void): StagedResource<Disposable>;
|
|
9
9
|
add<T>(eventId: string, slot: ListenerSlot<T>): void;
|
|
10
10
|
delete<T>(eventId: string, slot: ListenerSlot<T>): void;
|
|
11
|
+
/**
|
|
12
|
+
* Every still-subscribed listener runs, then failures are aggregated. Three details, all
|
|
13
|
+
* deliberate:
|
|
14
|
+
*
|
|
15
|
+
* - the listener set is copied first; a new subscription does not join this
|
|
16
|
+
* emission. A disposed slot is skipped if its callback has not started;
|
|
17
|
+
* - each call is wrapped in a resolved promise, so a listener that throws
|
|
18
|
+
* synchronously is collected like one that rejects;
|
|
19
|
+
* - `allSettled`, so one broken listener cannot stop the others from being
|
|
20
|
+
* told. The emitter still learns about it — every error comes back.
|
|
21
|
+
*/
|
|
11
22
|
emit<T>(eventId: string, payload: T): Promise<void>;
|
|
12
23
|
}
|
|
13
24
|
export {};
|
package/dist/event-hub.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-hub.d.ts","sourceRoot":"","sources":["../src/event-hub.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"event-hub.d.ts","sourceRoot":"","sources":["../src/event-hub.ts"],"names":[],"mappings":"AAQA,OAAO,EAAiB,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAEnG,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,OAAO,CAAC;AAEvD,UAAU,YAAY,CAAC,CAAC;IACtB,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;CACxC;AAsED,qBAAa,QAAQ;;IAGnB,KAAK,CAAC,CAAC,EACL,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAC1B,OAAO,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,GAC1C,cAAc,CAAC,UAAU,CAAC;IAK7B,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;IAM7C,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;IAOhD;;;;;;;;;;OAUG;IACG,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;CAa1C"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One explicit transaction shared by every nested Group configure callback.
|
|
3
|
+
*
|
|
4
|
+
* Nested `group()` calls join the outer session instead of opening their own, so
|
|
5
|
+
* a whole tree of groups declared in one statement commits once. A failure
|
|
6
|
+
* anywhere in that tree fails the session, which is why `fail()` records the
|
|
7
|
+
* first error and later calls return it unchanged: the cause of a collapsed tree
|
|
8
|
+
* is the first thing that went wrong, not the last.
|
|
9
|
+
*/
|
|
10
|
+
export declare class GroupConfigurationSession<Draft> {
|
|
11
|
+
#private;
|
|
12
|
+
constructor(draft: Draft, discard: (draft: Draft, error: unknown) => void, normalize: (error: unknown) => Error);
|
|
13
|
+
get failure(): Error | undefined;
|
|
14
|
+
requireDraft(): Draft;
|
|
15
|
+
assertOpen(): void;
|
|
16
|
+
fail(error: unknown): Error;
|
|
17
|
+
seal(): Draft;
|
|
18
|
+
discard(error: unknown): void;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=group-configuration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-configuration.d.ts","sourceRoot":"","sources":["../src/group-configuration.ts"],"names":[],"mappings":"AAeA;;;;;;;;GAQG;AACH,qBAAa,yBAAyB,CAAC,KAAK;;gBAIxC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,EAC/C,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK;IAKtC,IAAI,OAAO,sBAEV;IAED,YAAY;IAOZ,UAAU;IAIV,IAAI,CAAC,KAAK,EAAE,OAAO;IAcnB,IAAI;IAQJ,OAAO,CAAC,KAAK,EAAE,OAAO;CAOvB"}
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { Group, Installation, PluginConfigArguments } from './host-api';
|
|
2
2
|
import { ChangeSetDraft, ChangeOperation } from './change-set';
|
|
3
|
-
import {
|
|
3
|
+
import { GroupNode } from './group';
|
|
4
|
+
import { GroupConfigurationSession } from './group-configuration';
|
|
4
5
|
import { InstallationRecord } from './installation';
|
|
5
6
|
import { LifecycleStatus } from './lifecycle-status';
|
|
6
7
|
import { AnyPlugin, NormalizedPlugin } from './plugin';
|
|
7
8
|
export interface GroupCoordinatorPort {
|
|
8
|
-
installations()
|
|
9
|
-
createDraft(group: GroupNode, plugin: NormalizedPlugin, config: unknown)
|
|
9
|
+
readonly installations: () => Iterable<InstallationRecord>;
|
|
10
|
+
readonly createDraft: (group: GroupNode, plugin: NormalizedPlugin, config: unknown) => {
|
|
10
11
|
readonly record: InstallationRecord;
|
|
11
|
-
readonly
|
|
12
|
+
readonly facade: Installation<AnyPlugin>;
|
|
12
13
|
};
|
|
13
|
-
resolveInstallation(installation: object)
|
|
14
|
-
executeChanges(group: GroupNode, operations: ReadonlyArray<ChangeOperation>)
|
|
15
|
-
attachInstallation(installation: InstallationRecord)
|
|
16
|
-
discardInstallation(installation: InstallationRecord, error: unknown)
|
|
17
|
-
runExclusive(operation: () => Promise<void>)
|
|
18
|
-
removeInstallations(operations: ReadonlyArray<ChangeOperation>)
|
|
19
|
-
notifyChanged()
|
|
14
|
+
readonly resolveInstallation: (installation: object) => InstallationRecord;
|
|
15
|
+
readonly executeChanges: (group: GroupNode, operations: ReadonlyArray<ChangeOperation>) => Promise<void>;
|
|
16
|
+
readonly attachInstallation: (installation: InstallationRecord) => void;
|
|
17
|
+
readonly discardInstallation: (installation: InstallationRecord, error: unknown) => void;
|
|
18
|
+
readonly runExclusive: (operation: () => Promise<void>) => Promise<void>;
|
|
19
|
+
readonly removeInstallations: (operations: ReadonlyArray<ChangeOperation>) => Promise<void>;
|
|
20
|
+
readonly notifyChanged: () => void;
|
|
20
21
|
}
|
|
21
|
-
declare class
|
|
22
|
+
declare class GroupFacade implements Group {
|
|
22
23
|
#private;
|
|
23
24
|
constructor(coordinator: GroupCoordinator, node: GroupNode, configuration?: GroupConfigurationSession<ChangeSetDraft>);
|
|
24
25
|
get id(): string;
|
|
@@ -27,18 +28,36 @@ declare class GroupImpl implements Group {
|
|
|
27
28
|
ready(): Promise<void>;
|
|
28
29
|
install<Declaration extends AnyPlugin>(plugin: Declaration, ...config: PluginConfigArguments<Declaration>): Installation<Declaration>;
|
|
29
30
|
change(): ChangeSetDraft;
|
|
30
|
-
group(name: string, configure: (group: Group) => void):
|
|
31
|
+
group(name: string, configure: (group: Group) => void): GroupFacade;
|
|
31
32
|
remove(): Promise<void>;
|
|
32
33
|
}
|
|
33
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* Owns the complete structural Group model and compiles it to Installation
|
|
36
|
+
* changes.
|
|
37
|
+
*
|
|
38
|
+
* Groups are structure, and the Engine only understands installations, so
|
|
39
|
+
* everything here ends as a `ChangeOperation` list. Removing a Group is not its
|
|
40
|
+
* own kind of command — it is the removal of every Installation the subtree
|
|
41
|
+
* contains, followed by detaching the nodes.
|
|
42
|
+
*
|
|
43
|
+
* Lifecycles and facades are held in WeakMaps keyed by node rather than as node
|
|
44
|
+
* fields, so `GroupNode` stays pure structure and a revoked facade releases both.
|
|
45
|
+
*/
|
|
34
46
|
export declare class GroupCoordinator {
|
|
35
47
|
#private;
|
|
36
48
|
readonly root: GroupNode;
|
|
37
49
|
constructor(rootName: string, port: GroupCoordinatorPort);
|
|
38
50
|
nodes(): GroupNode[];
|
|
39
51
|
install<Declaration extends AnyPlugin>(group: GroupNode, plugin: Declaration, ...config: PluginConfigArguments<Declaration>): Installation<Declaration>;
|
|
52
|
+
stageConfigurationInstall<Declaration extends AnyPlugin>(group: GroupNode, configuration: GroupConfigurationSession<ChangeSetDraft>, plugin: Declaration, ...config: PluginConfigArguments<Declaration>): Installation<Declaration>;
|
|
53
|
+
/**
|
|
54
|
+
* `deferred` tracking exists for `create()`. A Group being configured must not
|
|
55
|
+
* mark itself pending on each nested install, because the whole configuration
|
|
56
|
+
* commits once; the coordinator attaches that single operation to every node in
|
|
57
|
+
* the finished subtree instead.
|
|
58
|
+
*/
|
|
40
59
|
change(group: GroupNode, tracking?: "immediate" | "deferred"): ChangeSetDraft;
|
|
41
|
-
create(parent: GroupNode, name: string, configure: (group: Group) => void, inherited?: GroupConfigurationSession<ChangeSetDraft>):
|
|
60
|
+
create(parent: GroupNode, name: string, configure: (group: Group) => void, inherited?: GroupConfigurationSession<ChangeSetDraft>): GroupFacade;
|
|
42
61
|
ready(group: GroupNode): Promise<void>;
|
|
43
62
|
status(group: GroupNode): LifecycleStatus;
|
|
44
63
|
remove(group: GroupNode): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group-coordinator.d.ts","sourceRoot":"","sources":["../src/group-coordinator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAC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E,qBAAqB,CAAC,WAAW,CAAC,GAC5C,YAAY,CAAC,WAAW,CAAC;IAa5B;;;;;OAKG;IACH,MAAM,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,GAAE,WAAW,GAAG,UAAwB;IA+BzE,MAAM,CACJ,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,EACjC,SAAS,CAAC,EAAE,yBAAyB,CAAC,cAAc,CAAC;IAoDjD,KAAK,CAAC,KAAK,EAAE,SAAS;IAM5B,MAAM,CAAC,KAAK,EAAE,SAAS,GAAG,eAAe;IAKzC,MAAM,CAAC,KAAK,EAAE,SAAS;CAsExB"}
|
|
@@ -12,6 +12,19 @@ export declare class GroupLifecycle {
|
|
|
12
12
|
constructor(node: GroupNode, initialState: "new" | "established", notifyChanged: () => void);
|
|
13
13
|
status(contents: LifecycleStatus): LifecycleStatus;
|
|
14
14
|
ready(readyContents: () => Promise<void>): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* `preserveCommittedState` is the whole point of this class.
|
|
17
|
+
*
|
|
18
|
+
* A Group that has already committed something is established, and a later
|
|
19
|
+
* failed change does not un-establish it — the transaction rolled back, so the
|
|
20
|
+
* state the Group describes is still the one that was committed. Such a
|
|
21
|
+
* failure leaves the phase at `established` and does not rethrow, because the
|
|
22
|
+
* caller of the failed change already has the error.
|
|
23
|
+
*
|
|
24
|
+
* A Group whose *first* change fails never had a committed state, so it does
|
|
25
|
+
* become `failed` and the failure propagates: there is nothing to report but
|
|
26
|
+
* the failure.
|
|
27
|
+
*/
|
|
15
28
|
track(operation: Promise<void>): void;
|
|
16
29
|
release(): void;
|
|
17
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group-lifecycle.d.ts","sourceRoot":"","sources":["../src/group-lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAoB,MAAM,UAAU,CAAC;A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