@zhin.js/runtime 1.0.2 → 1.0.4

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.
@@ -6,6 +6,7 @@ import { FeatureProjector, composeGenerationHandoffs } from './feature-projector
6
6
  import { NodeDiscoveryHost } from './node-discovery-host.js';
7
7
  import { PluginScopeAssembler, } from './plugin-scope-assembler.js';
8
8
  import { SourceOwnershipIndex } from './source-ownership.js';
9
+ import { addCapabilitySlot, featureSetupAliases, mergeSetupCapabilities, } from './setup-capabilities.js';
9
10
  import { TopologyTransactionPlanner, collapseRoots, graphNodes, graphOrder, isWithin, } from './topology-transaction.js';
10
11
  /** Prepares manifest topology changes without rebuilding stable Plugin Scopes. */
11
12
  export class TopologyGenerationPreparer {
@@ -47,6 +48,7 @@ export class TopologyGenerationPreparer {
47
48
  config: current.config,
48
49
  resources: current.resources,
49
50
  }, this.isolation);
51
+ plugins.installSetupFeatureAliases(featureSetupAliases(featureTopology.providers.values()));
50
52
  const setupRoots = collapseRoots([
51
53
  ...plan.addedPluginRoots,
52
54
  ...plan.replacedPluginRoots,
@@ -56,7 +58,7 @@ export class TopologyGenerationPreparer {
56
58
  ...plan.replacedPluginRoots,
57
59
  ]);
58
60
  plugins.removeSubtrees(removalRoots);
59
- const projectionDisposers = [];
61
+ const projectionDisposers = new Map();
60
62
  try {
61
63
  for (const root of setupRoots) {
62
64
  const node = nextNodes.get(root);
@@ -68,6 +70,7 @@ export class TopologyGenerationPreparer {
68
70
  // remove, move, or reorder operations.
69
71
  plugins.synchronizeTree(this.graph.root);
70
72
  const capabilities = await this.#prepareCapabilities(current, plan, setupRoots, featureTopology);
73
+ mergeSetupCapabilities(capabilities, plugins.setupCapabilities(), featureTopology.providers, featureTopology.rootsByFeature);
71
74
  const projected = await new FeatureProjector(featureTopology.providers.values()).project(current.generation + 1, {
72
75
  root: current.root,
73
76
  tree: plugins.tree,
@@ -75,7 +78,9 @@ export class TopologyGenerationPreparer {
75
78
  resources: plugins.resources,
76
79
  capabilities,
77
80
  });
78
- projectionDisposers.push(...projected.disposers);
81
+ for (const [feature, dispose] of projected.disposers) {
82
+ projectionDisposers.set(feature, dispose);
83
+ }
79
84
  const snapshot = createSnapshotView(current.generation + 1, projected.state);
80
85
  const ownership = SourceOwnershipIndex.fromGeneration(this.graph, snapshot, featureTopology.featureIdsByPackageRoot);
81
86
  const replacements = new Map(plugins.createdScopeDisposers());
@@ -98,7 +103,7 @@ export class TopologyGenerationPreparer {
98
103
  };
99
104
  }
100
105
  catch (error) {
101
- await rollback(plugins.createdScopeDisposers().map(([, dispose]) => dispose), projectionDisposers, error);
106
+ await rollback(plugins.createdScopeDisposers().map(([, dispose]) => dispose), [...projectionDisposers.values()], error);
102
107
  throw error;
103
108
  }
104
109
  }
@@ -177,7 +182,7 @@ export class TopologyGenerationPreparer {
177
182
  if (!provider)
178
183
  throw new Error(`Missing Feature provider for ${feature}`);
179
184
  for (const slot of await discovery.discover(provider, selected)) {
180
- capabilities.set(slot.id, slot);
185
+ addCapabilitySlot(capabilities, slot);
181
186
  }
182
187
  }
183
188
  return capabilities;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhin.js/runtime",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Static Plugin graph, generation transaction and HMR Root runtime for Zhin.js",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -18,22 +18,22 @@
18
18
  "dependencies": {
19
19
  "ajv": "8.18.0",
20
20
  "semver": "7.8.5",
21
- "@zhin.js/feature-kit": "1.0.2",
22
- "@zhin.js/plugin-runtime": "1.1.0"
21
+ "@zhin.js/feature-kit": "1.0.4",
22
+ "@zhin.js/plugin-runtime": "1.1.1"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/node": "^26.1.0",
26
26
  "typescript": "^6.0.3",
27
- "@zhin.js/adapter": "1.1.0",
28
- "@zhin.js/command": "1.0.2",
29
- "@zhin.js/agent-feature": "1.0.2",
30
- "@zhin.js/component": "1.0.2",
31
- "@zhin.js/layout": "1.0.2",
32
- "@zhin.js/mcp-feature": "1.0.2",
33
- "@zhin.js/middleware": "1.0.2",
34
- "@zhin.js/tool": "1.0.2",
35
- "@zhin.js/page": "1.0.2",
36
- "@zhin.js/skill": "1.0.2"
27
+ "@zhin.js/adapter": "1.1.2",
28
+ "@zhin.js/agent-feature": "1.0.4",
29
+ "@zhin.js/command": "1.0.4",
30
+ "@zhin.js/component": "1.0.4",
31
+ "@zhin.js/layout": "1.0.4",
32
+ "@zhin.js/mcp-feature": "1.0.4",
33
+ "@zhin.js/middleware": "1.0.4",
34
+ "@zhin.js/page": "1.0.4",
35
+ "@zhin.js/skill": "1.0.4",
36
+ "@zhin.js/tool": "1.0.4"
37
37
  },
38
38
  "repository": {
39
39
  "type": "git",