@hydraharness/harness-host-plugin-inventory 0.1.1-rc.5

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.
@@ -0,0 +1,230 @@
1
+ /** Runtime plugin inventory plus shared user-setting enablement controls. */
2
+ import { Service, type Context } from '@hydraharness/cordis';
3
+ import { TypertRemoteService } from '@hydraharness/harness-typert-protocol';
4
+ import type { ImportedPluginEntry, ImportedPluginSnapshot, PluginImportSource } from '@hydraharness/harness-plugin-runtime';
5
+ import type { HookRecordDefinitionRequest, HookRecordEnablementRequest, HookRecordSnapshot } from '@hydraharness/harness-hooks-registry';
6
+ import type { McpServerDefinitionRequest, McpServerEnablementRequest, McpServerSnapshot } from '@hydraharness/harness-mcp-registry';
7
+ import z from '@hydraharness/schemastery';
8
+ import type { AddPluginMarketplaceRequest, ImportedPluginMcpServerEnablementRequest, ImportedPluginMcpToolApprovalRequest, PluginEnablementRequest, PluginEnablementResult, PluginInventorySnapshot, PluginMarketplaceSnapshot, SetPluginMarketplaceEnablementRequest } from './types.ts';
9
+ export type * from './types.ts';
10
+ declare module '@hydraharness/cordis-plugin-loader' {
11
+ interface EntryOptions {
12
+ /** Optional composition-specific summary, overriding the package description. */
13
+ description?: string;
14
+ /** Optional composition-specific usage guidance, overriding package metadata. */
15
+ application?: string;
16
+ /** Core plugins change only on restart; omitted means normal. */
17
+ pluginType?: 'core' | 'normal';
18
+ /** Entries that implement one feature and share one Settings switch. */
19
+ pluginGroup?: string;
20
+ }
21
+ }
22
+ /** Inventory exclusions for entries owned by another composition plane. */
23
+ export interface Config {
24
+ /** Entry ids owned by another composition plane and omitted from this inventory. */
25
+ compositionEntryIds?: string[];
26
+ }
27
+ /** Remote-only service exposing the Loader's current non-group entry state. */
28
+ export declare class PluginInventoryGateway extends TypertRemoteService {
29
+ static inject: string[];
30
+ static Config: z<Config>;
31
+ private readonly compositionEntryIds;
32
+ private readonly settings;
33
+ private readonly marketplaceSettings;
34
+ private readonly defaultEnabled;
35
+ private readonly initialEnabled;
36
+ private readonly originalConfigs;
37
+ private readonly appliedSettings;
38
+ private restartEnablement;
39
+ private mutationTail;
40
+ constructor(ctx: Context, config?: Config);
41
+ protected [Service.init](): Promise<void>;
42
+ private rootInclude;
43
+ /** Project persisted OpenAI/Codex marketplace sources without exposing their entries here. */
44
+ private marketplaceSnapshot;
45
+ private moduleEntries;
46
+ /** One logical row per module, preferring the profile-owned entry. */
47
+ private representatives;
48
+ /** Whether changing this root entry must wait for the next profile boot. */
49
+ private isRestartOnly;
50
+ private isToggleable;
51
+ private enabled;
52
+ /** Desired state used by the switch; restart-only entries retain the live Loader state until reboot. */
53
+ private desiredEnabled;
54
+ /** Whether the currently loaded entry still differs from its persisted desired state. */
55
+ private restartRequired;
56
+ /** Resolve the active root Include to the profile directory the launcher owns. */
57
+ private profileDir;
58
+ /** Persist one restart-only root switch without changing the live Loader tree. */
59
+ private setRestartEnabled;
60
+ private isHmrWatchOnly;
61
+ private enqueue;
62
+ private restore;
63
+ /** Keep one configured instance active; HMR's disabled state remains watch-only. */
64
+ private updateModule;
65
+ private applySettings;
66
+ /**
67
+ * Read the Loader and optional preset roster directly on every call. Cordis's
68
+ * internal plugin/status events already maintain Entry.fiber and Fiber state,
69
+ * so a second Host cache would only add another lifecycle truth to synchronize.
70
+ * @returns Current Host entries followed by preset-owned leaf entries.
71
+ */
72
+ private hostEntries;
73
+ private presetEntries;
74
+ /**
75
+ * List Host entries and the optional preset-owned leaf entries.
76
+ * @returns the current inventory projection.
77
+ */
78
+ list(): Promise<PluginInventorySnapshot>;
79
+ /** Group only explicitly related entries, preferring a persistently editable owner. */
80
+ private inventoryGroups;
81
+ /**
82
+ * Persist a restart-only root state without live unload, or apply one normal
83
+ * module-wide live state and persist it in the shared settings document.
84
+ * @param request - target entry and desired enablement.
85
+ * @returns The fresh snapshot and whether this mutation needs a restart.
86
+ */
87
+ setEnabled(request: PluginEnablementRequest): Promise<PluginEnablementResult>;
88
+ /**
89
+ * Project every persisted OpenAI/Codex marketplace source.
90
+ * @returns OpenAI/Codex marketplace sources in persisted order.
91
+ */
92
+ listMarketplaces(): Promise<PluginMarketplaceSnapshot>;
93
+ /**
94
+ * Persist one validated OpenAI/Codex marketplace source, replacing any source of the same location.
95
+ * @param request - marketplace location with its optional Git ref and sparse paths.
96
+ * @returns The refreshed OpenAI/Codex marketplace source list.
97
+ */
98
+ addMarketplace(request: AddPluginMarketplaceRequest): Promise<PluginMarketplaceSnapshot>;
99
+ /**
100
+ * Enable or disable one marketplace slot, cascading to its imported plugins.
101
+ * @param request - marketplace source and its desired enablement.
102
+ * @returns The refreshed OpenAI/Codex marketplace source list.
103
+ */
104
+ setMarketplaceEnabled(request: SetPluginMarketplaceEnablementRequest): Promise<PluginMarketplaceSnapshot>;
105
+ /**
106
+ * Remove one persisted OpenAI/Codex marketplace source and uninstall its imported plugins.
107
+ * @param source - the persisted marketplace location to delete.
108
+ * @returns The refreshed OpenAI/Codex marketplace source list.
109
+ */
110
+ removeMarketplace(source: string): Promise<PluginMarketplaceSnapshot>;
111
+ /**
112
+ * Apply one lifecycle action to every plugin imported from this marketplace root.
113
+ * A no-op when the imported-plugin runtime is not part of this composition.
114
+ */
115
+ private cascadeMarketplacePlugins;
116
+ /**
117
+ * List source-qualified imported OpenAI/Codex plugin bundles.
118
+ * @returns Current imported-plugin projection.
119
+ */
120
+ listImportedPlugins(): Promise<ImportedPluginSnapshot>;
121
+ /**
122
+ * Stage a direct local/Git source or marketplace bundle through the shared runtime.
123
+ * @param source - Plugin source to import.
124
+ * @returns Current imported-plugin projection.
125
+ */
126
+ importPlugin(source: PluginImportSource): Promise<ImportedPluginSnapshot>;
127
+ /**
128
+ * Read one imported bundle by source-qualified identity or an unambiguous name.
129
+ * @param identityOrName - Source-qualified identity or unambiguous plugin name.
130
+ * @returns Current plugin projection.
131
+ */
132
+ infoPlugin(identityOrName: string): Promise<ImportedPluginEntry>;
133
+ /**
134
+ * Enable and load one imported bundle without changing native Hydra package state.
135
+ * @param identityOrName - Source-qualified identity or unambiguous plugin name.
136
+ * @returns Current imported-plugin projection.
137
+ */
138
+ enablePlugin(identityOrName: string): Promise<ImportedPluginSnapshot>;
139
+ /**
140
+ * Disable and deterministically unload one imported bundle.
141
+ * @param identityOrName - Source-qualified identity or unambiguous plugin name.
142
+ * @returns Current imported-plugin projection.
143
+ */
144
+ disablePlugin(identityOrName: string): Promise<ImportedPluginSnapshot>;
145
+ /**
146
+ * Change one imported plugin MCP server without changing hook trust.
147
+ * @param request - plugin identity, server name, and desired enablement.
148
+ * @returns Current imported-plugin projection.
149
+ */
150
+ setPluginMcpServerEnabled(request: ImportedPluginMcpServerEnablementRequest): Promise<ImportedPluginSnapshot>;
151
+ /**
152
+ * Set one imported MCP tool's approval mode without changing server enablement.
153
+ * @param request - Plugin identity, server, tool, and approval mode.
154
+ * @returns Current imported-plugin projection.
155
+ */
156
+ setPluginMcpToolApproval(request: ImportedPluginMcpToolApprovalRequest): Promise<ImportedPluginSnapshot>;
157
+ /**
158
+ * Trust only the current hook definitions; MCP/tool approval remains independent.
159
+ * @param identityOrName - Source-qualified identity or unambiguous plugin name.
160
+ * @returns Current imported-plugin projection.
161
+ */
162
+ trustPlugin(identityOrName: string): Promise<ImportedPluginSnapshot>;
163
+ /**
164
+ * Revoke hook trust without disabling other plugin components.
165
+ * @param identityOrName - Source-qualified identity or unambiguous plugin name.
166
+ * @returns Current imported-plugin projection.
167
+ */
168
+ untrustPlugin(identityOrName: string): Promise<ImportedPluginSnapshot>;
169
+ /**
170
+ * Remove one imported bundle and its writable plugin data.
171
+ * @param identityOrName - Source-qualified identity or unambiguous plugin name.
172
+ * @returns Current imported-plugin projection.
173
+ */
174
+ removePlugin(identityOrName: string): Promise<ImportedPluginSnapshot>;
175
+ /**
176
+ * List the user's own MCP server records with their live state.
177
+ * @returns Current MCP record projection.
178
+ */
179
+ listMcpServers(): Promise<McpServerSnapshot>;
180
+ /**
181
+ * Store one complete MCP server definition and converge its mount.
182
+ * @param request - Complete server definition.
183
+ * @returns Refreshed MCP record projection.
184
+ */
185
+ defineMcpServer(request: McpServerDefinitionRequest): Promise<McpServerSnapshot>;
186
+ /**
187
+ * Change one MCP record's desired state without touching its definition.
188
+ * @param request - Target record and desired state.
189
+ * @returns Refreshed MCP record projection.
190
+ */
191
+ setMcpServerEnabled(request: McpServerEnablementRequest): Promise<McpServerSnapshot>;
192
+ /**
193
+ * Remove one MCP record and unmount its server.
194
+ * @param name - Stored record name.
195
+ * @returns Refreshed MCP record projection.
196
+ */
197
+ removeMcpServer(name: string): Promise<McpServerSnapshot>;
198
+ /**
199
+ * List the user's own hook records with their live state.
200
+ * @returns Current hook record projection.
201
+ */
202
+ listHookRecords(): Promise<HookRecordSnapshot>;
203
+ /**
204
+ * Store one complete hook record definition and converge its bridge mount.
205
+ * @param request - Complete record definition.
206
+ * @returns Refreshed hook record projection.
207
+ */
208
+ defineHookRecord(request: HookRecordDefinitionRequest): Promise<HookRecordSnapshot>;
209
+ /**
210
+ * Change one hook record's desired state without touching its definition.
211
+ * @param request - Target record and desired state.
212
+ * @returns Refreshed hook record projection.
213
+ */
214
+ setHookRecordEnabled(request: HookRecordEnablementRequest): Promise<HookRecordSnapshot>;
215
+ /**
216
+ * Remove one hook record and unmount its bridge.
217
+ * @param name - Stored record name.
218
+ * @returns Refreshed hook record projection.
219
+ */
220
+ removeHookRecord(name: string): Promise<HookRecordSnapshot>;
221
+ private importedPlugins;
222
+ /** The MCP record registry is optional in compositions without user MCP servers. */
223
+ private mcpServers;
224
+ /** The hook record registry is optional in compositions without user hooks. */
225
+ private hookRecords;
226
+ /** Agent-preset ownership is optional in headless and non-roster compositions. */
227
+ private agentPresets;
228
+ }
229
+ export default PluginInventoryGateway;
230
+ //# sourceMappingURL=index.d.ts.map