@shardworks/nexus-arbor 0.1.184 → 0.1.186

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.
Files changed (2) hide show
  1. package/README.md +8 -3
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -50,9 +50,12 @@ The object returned by `createGuild()` — also accessible via `guild()` from `@
50
50
  | `home` | `string` | Absolute path to the guild root |
51
51
  | `apparatus<T>(name)` | `T` | Retrieve a started apparatus's `provides` API by plugin id. Throws if the apparatus has no `provides` |
52
52
  | `config<T>(pluginId)` | `T` | Read the plugin-specific configuration section from `guild.json` |
53
+ | `writeConfig<T>(pluginId, value)` | `void` | Write a plugin's configuration section to `guild.json` and persist to disk |
53
54
  | `guildConfig()` | `GuildConfig` | The full parsed `guild.json` |
54
55
  | `kits()` | `LoadedKit[]` | All loaded kits (snapshot copy) |
55
56
  | `apparatuses()` | `LoadedApparatus[]` | All loaded apparatus in start order (snapshot copy) |
57
+ | `failedPlugins()` | `FailedPlugin[]` | Plugins that failed to load, validate, or start (snapshot copy) |
58
+ | `startupWarnings()` | `string[]` | Advisory warnings collected during startup (missing recommends, unconsumed contributions) |
56
59
 
57
60
  ### `LoadedKit` and `LoadedApparatus`
58
61
 
@@ -87,8 +90,8 @@ Type guards: `isLoadedKit(p)` and `isLoadedApparatus(p)` from `@shardworks/nexus
87
90
  1. **Load** — imports all declared plugin packages from `node_modules`, discriminates kit vs. apparatus.
88
91
  2. **Validate** — checks `requires` declarations (apparatus and kit), detects circular apparatus dependencies. Fails loudly before any apparatus starts.
89
92
  3. **Warn** — advisory warnings for kit contributions that no apparatus `consumes`, and for missing `recommends`.
90
- 4. **Wire** — sets the `guild()` singleton. The `provides` map is populated progressively as each apparatus starts; dependency ordering guarantees declared deps are available.
91
- 5. **Start** — fires `plugin:initialized` for all kits, then calls `start(ctx)` on each apparatus in dependency-resolved order, firing `plugin:initialized` after each.
93
+ 4. **Wire** — collects all kit contributions (standalone kits and apparatus `supportKit` entries) into a flat `KitEntry[]`, then sets the `guild()` singleton. The `provides` map is populated progressively as each apparatus starts; dependency ordering guarantees declared deps are available.
94
+ 5. **Start** — calls `start(ctx)` on each apparatus in dependency-resolved order, firing `apparatus:started` after each. Once all apparatus have started, fires `phase:started` once.
92
95
 
93
96
  Apparatus start order is determined by topological sort on `apparatus.requires`. Circular dependencies throw with a descriptive error. Kit `requires` validate that the named apparatus is installed but do not affect start order (kits have no lifecycle).
94
97
 
@@ -101,9 +104,11 @@ Pure validation and ordering logic lives in `guild-lifecycle.ts`, separated from
101
104
  | Function | Description |
102
105
  |---|---|
103
106
  | `validateRequires(kits, apparatuses)` | Validates all `requires` declarations and detects circular dependencies |
107
+ | `filterFailedPlugins(kits, apparatuses, rootFailures)` | Removes plugins that transitively depend on any failed plugin; cascades until stable |
104
108
  | `topoSort(apparatuses)` | Topological sort by `requires` — determines apparatus start order |
109
+ | `wireKitEntries(kits, orderedApparatuses)` | Collects all kit contributions (standalone + apparatus supportKit) into a flat `KitEntry[]` |
105
110
  | `collectStartupWarnings(kits, apparatuses)` | Advisory warnings for unconsumed contributions and missing recommends |
106
- | `buildStartupContext(eventHandlers)` | Creates the `StartupContext` passed to `apparatus.start()` |
111
+ | `buildStartupContext(eventHandlers, kitEntries)` | Creates the `StartupContext` passed to `apparatus.start()` |
107
112
  | `fireEvent(eventHandlers, event, ...args)` | Fires lifecycle events to registered handlers |
108
113
 
109
114
  These are exported for testing but are not part of the consumer-facing API.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shardworks/nexus-arbor",
3
- "version": "0.1.184",
3
+ "version": "0.1.186",
4
4
  "license": "ISC",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,7 +16,7 @@
16
16
  }
17
17
  },
18
18
  "dependencies": {
19
- "@shardworks/nexus-core": "0.1.184"
19
+ "@shardworks/nexus-core": "0.1.186"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@types/node": "25.5.0"