@deepseek-ai/dsh-host-plugin-inventory 0.1.6-alpha.1 → 0.1.6-alpha.2
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/lib/index.js +40 -24
- package/lib/typert.host.js +6 -4
- package/lib/typert.remote-client.js +6 -4
- package/lib/types/index.d.ts +12 -1
- package/lib/types/index.js +36 -24
- package/lib/types/types.d.ts +2 -0
- package/package.json +8 -8
package/lib/index.js
CHANGED
|
@@ -39,7 +39,11 @@ var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializ
|
|
|
39
39
|
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
40
40
|
done = true;
|
|
41
41
|
};
|
|
42
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* Brand an existing Loader-tree entry id at the owning boundary.
|
|
44
|
+
* @param value - the entry id as the Loader tree spells it.
|
|
45
|
+
* @returns the same id as the inventory's branded entry id.
|
|
46
|
+
*/
|
|
43
47
|
function pluginEntryId(value) {
|
|
44
48
|
return value;
|
|
45
49
|
}
|
|
@@ -106,30 +110,42 @@ let PluginInventoryGateway = (() => {
|
|
|
106
110
|
* compositions when a roster is composed.
|
|
107
111
|
*/
|
|
108
112
|
async list() {
|
|
109
|
-
|
|
110
|
-
for (const entry of this.ctx.loader.entries()) {
|
|
111
|
-
if (entry.options.group) continue;
|
|
112
|
-
entries.push({
|
|
113
|
-
entryId: pluginEntryId(entry.id),
|
|
114
|
-
moduleName: entry.options.name,
|
|
115
|
-
enabled: !entry.disabled,
|
|
116
|
-
fiberPhase: entry.fiber === void 0 ? null : FIBER_PHASE[entry.fiber.state]
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
const presets = this.ctx.get("agentPresets");
|
|
120
|
-
if (presets === void 0) return { entries };
|
|
121
|
-
return {
|
|
122
|
-
entries,
|
|
123
|
-
agentPresets: (await presets.compositionInventory()).map((composition) => ({
|
|
124
|
-
...composition,
|
|
125
|
-
rows: composition.rows.map(({ fiberState, ...row }) => ({
|
|
126
|
-
...row,
|
|
127
|
-
fiberPhase: fiberState === void 0 ? null : FIBER_PHASE[fiberState]
|
|
128
|
-
}))
|
|
129
|
-
}))
|
|
130
|
-
};
|
|
113
|
+
return readPluginInventory(this.ctx);
|
|
131
114
|
}
|
|
132
115
|
};
|
|
133
116
|
})();
|
|
117
|
+
/** Read current Loader entries and optional preset compositions.
|
|
118
|
+
* @param ctx Context with the Loader service.
|
|
119
|
+
* @returns Current inventory without a separate runtime cache.
|
|
120
|
+
*/
|
|
121
|
+
async function readPluginInventory(ctx) {
|
|
122
|
+
const entries = [];
|
|
123
|
+
for (const entry of ctx.loader.entries()) {
|
|
124
|
+
if (entry.options.group) continue;
|
|
125
|
+
entries.push({
|
|
126
|
+
entryId: pluginEntryId(entry.id),
|
|
127
|
+
moduleName: entry.options.name,
|
|
128
|
+
enabled: !entry.disabled,
|
|
129
|
+
fiberPhase: entry.fiber === void 0 ? null : FIBER_PHASE[entry.fiber.state]
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
const presets = ctx.get("agentPresets");
|
|
133
|
+
const management = ctx.get("pluginManager") === void 0 ? {} : { managementAvailable: true };
|
|
134
|
+
if (presets === void 0) return {
|
|
135
|
+
entries,
|
|
136
|
+
...management
|
|
137
|
+
};
|
|
138
|
+
return {
|
|
139
|
+
entries,
|
|
140
|
+
agentPresets: (await presets.compositionInventory()).map((composition) => ({
|
|
141
|
+
...composition,
|
|
142
|
+
rows: composition.rows.map(({ fiberState, ...row }) => ({
|
|
143
|
+
...row,
|
|
144
|
+
fiberPhase: fiberState === void 0 ? null : FIBER_PHASE[fiberState]
|
|
145
|
+
}))
|
|
146
|
+
})),
|
|
147
|
+
...management
|
|
148
|
+
};
|
|
149
|
+
}
|
|
134
150
|
//#endregion
|
|
135
|
-
export { PluginInventoryGateway, PluginInventoryGateway as default };
|
|
151
|
+
export { PluginInventoryGateway, PluginInventoryGateway as default, pluginEntryId, readPluginInventory };
|
package/lib/typert.host.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/* Generated by @deepseek-ai/dsh-typert-generator from FaceModel — do not edit. */
|
|
2
2
|
import { z } from 'zod'
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
let _deepseek_ai_dsh_host_plugin_inventory_pluginInventory_list_result$schema$value
|
|
5
|
+
const _deepseek_ai_dsh_host_plugin_inventory_pluginInventory_list_result$schema = () => (_deepseek_ai_dsh_host_plugin_inventory_pluginInventory_list_result$schema$value ??= z.object({
|
|
6
|
+
'managementAvailable': z.boolean().readonly().optional(),
|
|
5
7
|
'entries': z.array(z.object({
|
|
6
8
|
'entryId': z.intersection(z.string(), z.unknown()).readonly(),
|
|
7
9
|
'moduleName': z.string().readonly(),
|
|
@@ -22,7 +24,7 @@ const _deepseek_ai_dsh_host_plugin_inventory_pluginInventory_list_result$schema
|
|
|
22
24
|
'fiberPhase': z.union([z.literal(null), z.literal("pending"), z.literal("active"), z.literal("failed"), z.literal("loading"), z.literal("unloading")]).readonly(),
|
|
23
25
|
})).readonly(),
|
|
24
26
|
})).readonly().optional(),
|
|
25
|
-
})
|
|
27
|
+
}))
|
|
26
28
|
|
|
27
29
|
export const TYPERT = {
|
|
28
30
|
package: '@deepseek-ai/dsh-host-plugin-inventory',
|
|
@@ -41,9 +43,9 @@ export const TYPERT = {
|
|
|
41
43
|
result: {
|
|
42
44
|
mode: 'strict',
|
|
43
45
|
typeSymbol: '@deepseek-ai/dsh-host-plugin-inventory/types#PluginInventorySnapshot',
|
|
44
|
-
|
|
46
|
+
create: _deepseek_ai_dsh_host_plugin_inventory_pluginInventory_list_result$schema,
|
|
45
47
|
},
|
|
46
|
-
sourceLocation: {"file":"packages/host/plugin-inventory/src/index.ts","line":
|
|
48
|
+
sourceLocation: {"file":"packages/host/plugin-inventory/src/index.ts","line":70,"column":9},
|
|
47
49
|
},
|
|
48
50
|
],
|
|
49
51
|
model: {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
|
|
2
2
|
import { z } from 'zod'
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
let _deepseek_ai_dsh_host_plugin_inventory_pluginInventory_list_result$schema$value
|
|
5
|
+
const _deepseek_ai_dsh_host_plugin_inventory_pluginInventory_list_result$schema = () => (_deepseek_ai_dsh_host_plugin_inventory_pluginInventory_list_result$schema$value ??= z.object({
|
|
6
|
+
'managementAvailable': z.boolean().readonly().optional(),
|
|
5
7
|
'entries': z.array(z.object({
|
|
6
8
|
'entryId': z.intersection(z.string(), z.unknown()).readonly(),
|
|
7
9
|
'moduleName': z.string().readonly(),
|
|
@@ -22,7 +24,7 @@ const _deepseek_ai_dsh_host_plugin_inventory_pluginInventory_list_result$schema
|
|
|
22
24
|
'fiberPhase': z.union([z.literal(null), z.literal("pending"), z.literal("active"), z.literal("failed"), z.literal("loading"), z.literal("unloading")]).readonly(),
|
|
23
25
|
})).readonly(),
|
|
24
26
|
})).readonly().optional(),
|
|
25
|
-
})
|
|
27
|
+
}))
|
|
26
28
|
|
|
27
29
|
export const TYPERT_REMOTE = {
|
|
28
30
|
package: '@deepseek-ai/dsh-host-plugin-inventory',
|
|
@@ -38,9 +40,9 @@ export const TYPERT_REMOTE = {
|
|
|
38
40
|
result: {
|
|
39
41
|
mode: 'strict',
|
|
40
42
|
typeSymbol: '@deepseek-ai/dsh-host-plugin-inventory/types#PluginInventorySnapshot',
|
|
41
|
-
|
|
43
|
+
create: _deepseek_ai_dsh_host_plugin_inventory_pluginInventory_list_result$schema,
|
|
42
44
|
},
|
|
43
|
-
sourceLocation: {"file":"packages/host/plugin-inventory/src/index.ts","line":
|
|
45
|
+
sourceLocation: {"file":"packages/host/plugin-inventory/src/index.ts","line":70,"column":9},
|
|
44
46
|
},
|
|
45
47
|
],
|
|
46
48
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
/** Read-only projection of the current Cordis Loader plugin entries. */
|
|
2
2
|
import type { Context } from '@deepseek-ai/cordis';
|
|
3
3
|
import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
4
|
-
import type { PluginInventorySnapshot } from './types.ts';
|
|
4
|
+
import type { PluginEntryId, PluginInventorySnapshot } from './types.ts';
|
|
5
5
|
export type * from './types.ts';
|
|
6
|
+
/**
|
|
7
|
+
* Brand an existing Loader-tree entry id at the owning boundary.
|
|
8
|
+
* @param value - the entry id as the Loader tree spells it.
|
|
9
|
+
* @returns the same id as the inventory's branded entry id.
|
|
10
|
+
*/
|
|
11
|
+
export declare function pluginEntryId(value: string): PluginEntryId;
|
|
6
12
|
/** Remote-only service exposing the Loader's current non-group entry state. */
|
|
7
13
|
export declare class PluginInventoryGateway extends TypertRemoteService {
|
|
8
14
|
static inject: string[];
|
|
@@ -22,4 +28,9 @@ export declare class PluginInventoryGateway extends TypertRemoteService {
|
|
|
22
28
|
list(): Promise<PluginInventorySnapshot>;
|
|
23
29
|
}
|
|
24
30
|
export default PluginInventoryGateway;
|
|
31
|
+
/** Read current Loader entries and optional preset compositions.
|
|
32
|
+
* @param ctx Context with the Loader service.
|
|
33
|
+
* @returns Current inventory without a separate runtime cache.
|
|
34
|
+
*/
|
|
35
|
+
export declare function readPluginInventory(ctx: Context): Promise<PluginInventorySnapshot>;
|
|
25
36
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/types/index.js
CHANGED
|
@@ -34,8 +34,12 @@ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn,
|
|
|
34
34
|
done = true;
|
|
35
35
|
};
|
|
36
36
|
import { TypertRemoteService, Remote } from '@deepseek-ai/dsh-typert-protocol';
|
|
37
|
-
/**
|
|
38
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Brand an existing Loader-tree entry id at the owning boundary.
|
|
39
|
+
* @param value - the entry id as the Loader tree spells it.
|
|
40
|
+
* @returns the same id as the inventory's branded entry id.
|
|
41
|
+
*/
|
|
42
|
+
export function pluginEntryId(value) {
|
|
39
43
|
return value;
|
|
40
44
|
}
|
|
41
45
|
/** Runtime mirror: FiberState is a cross-package const enum. */
|
|
@@ -86,31 +90,39 @@ let PluginInventoryGateway = (() => {
|
|
|
86
90
|
* compositions when a roster is composed.
|
|
87
91
|
*/
|
|
88
92
|
async list() {
|
|
89
|
-
|
|
90
|
-
for (const entry of this.ctx.loader.entries()) {
|
|
91
|
-
if (entry.options.group)
|
|
92
|
-
continue;
|
|
93
|
-
entries.push({
|
|
94
|
-
entryId: pluginEntryId(entry.id),
|
|
95
|
-
moduleName: entry.options.name,
|
|
96
|
-
enabled: !entry.disabled,
|
|
97
|
-
fiberPhase: entry.fiber === undefined ? null : FIBER_PHASE[entry.fiber.state],
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
const presets = this.ctx.get('agentPresets');
|
|
101
|
-
if (presets === undefined)
|
|
102
|
-
return { entries };
|
|
103
|
-
const agentPresets = (await presets.compositionInventory()).map(composition => ({
|
|
104
|
-
...composition,
|
|
105
|
-
rows: composition.rows.map(({ fiberState, ...row }) => ({
|
|
106
|
-
...row,
|
|
107
|
-
fiberPhase: fiberState === undefined ? null : FIBER_PHASE[fiberState],
|
|
108
|
-
})),
|
|
109
|
-
}));
|
|
110
|
-
return { entries, agentPresets };
|
|
93
|
+
return readPluginInventory(this.ctx);
|
|
111
94
|
}
|
|
112
95
|
};
|
|
113
96
|
})();
|
|
114
97
|
export { PluginInventoryGateway };
|
|
115
98
|
export default PluginInventoryGateway;
|
|
99
|
+
/** Read current Loader entries and optional preset compositions.
|
|
100
|
+
* @param ctx Context with the Loader service.
|
|
101
|
+
* @returns Current inventory without a separate runtime cache.
|
|
102
|
+
*/
|
|
103
|
+
export async function readPluginInventory(ctx) {
|
|
104
|
+
const entries = [];
|
|
105
|
+
for (const entry of ctx.loader.entries()) {
|
|
106
|
+
if (entry.options.group)
|
|
107
|
+
continue;
|
|
108
|
+
entries.push({
|
|
109
|
+
entryId: pluginEntryId(entry.id),
|
|
110
|
+
moduleName: entry.options.name,
|
|
111
|
+
enabled: !entry.disabled,
|
|
112
|
+
fiberPhase: entry.fiber === undefined ? null : FIBER_PHASE[entry.fiber.state],
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
const presets = ctx.get('agentPresets');
|
|
116
|
+
const management = ctx.get('pluginManager') === undefined ? {} : { managementAvailable: true };
|
|
117
|
+
if (presets === undefined)
|
|
118
|
+
return { entries, ...management };
|
|
119
|
+
const agentPresets = (await presets.compositionInventory()).map(composition => ({
|
|
120
|
+
...composition,
|
|
121
|
+
rows: composition.rows.map(({ fiberState, ...row }) => ({
|
|
122
|
+
...row,
|
|
123
|
+
fiberPhase: fiberState === undefined ? null : FIBER_PHASE[fiberState],
|
|
124
|
+
})),
|
|
125
|
+
}));
|
|
126
|
+
return { entries, agentPresets, ...management };
|
|
127
|
+
}
|
|
116
128
|
//# sourceMappingURL=index.js.map
|
package/lib/types/types.d.ts
CHANGED
|
@@ -48,6 +48,8 @@ export interface AgentPresetPluginGroup {
|
|
|
48
48
|
}
|
|
49
49
|
/** Point-in-time inventory returned by the plugin inventory Remote. */
|
|
50
50
|
export interface PluginInventorySnapshot {
|
|
51
|
+
/** Whether this Host exposes persistent current-profile management. */
|
|
52
|
+
readonly managementAvailable?: boolean;
|
|
51
53
|
readonly entries: readonly PluginInventoryEntry[];
|
|
52
54
|
/**
|
|
53
55
|
* Per-preset compositions, present only when an agent-preset roster is
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-host-plugin-inventory",
|
|
3
3
|
"description": "Read-only Remote projection of current Cordis Loader plugin state",
|
|
4
|
-
"version": "0.1.6-alpha.
|
|
4
|
+
"version": "0.1.6-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"@deepseek-ai/cordis-plugin-loader": "^1.0.3",
|
|
51
|
-
"@deepseek-ai/dsh-agent-presets": "^0.1.6-alpha.
|
|
52
|
-
"@deepseek-ai/dsh-brand": "^0.1.6-alpha.
|
|
53
|
-
"@deepseek-ai/dsh-typert-protocol": "^0.1.6-alpha.
|
|
51
|
+
"@deepseek-ai/dsh-agent-presets": "^0.1.6-alpha.2",
|
|
52
|
+
"@deepseek-ai/dsh-brand": "^0.1.6-alpha.2",
|
|
53
|
+
"@deepseek-ai/dsh-typert-protocol": "^0.1.6-alpha.2",
|
|
54
54
|
"@deepseek-ai/cordis": "^4.0.2"
|
|
55
55
|
},
|
|
56
56
|
"peerDependenciesMeta": {
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@deepseek-ai/cordis-plugin-loader": "^1.0.3",
|
|
63
|
-
"@deepseek-ai/dsh-agent-presets": "^0.1.6-alpha.
|
|
64
|
-
"@deepseek-ai/dsh-brand": "^0.1.6-alpha.
|
|
65
|
-
"@deepseek-ai/
|
|
66
|
-
"@deepseek-ai/
|
|
63
|
+
"@deepseek-ai/dsh-agent-presets": "^0.1.6-alpha.2",
|
|
64
|
+
"@deepseek-ai/dsh-brand": "^0.1.6-alpha.2",
|
|
65
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
66
|
+
"@deepseek-ai/dsh-typert-protocol": "^0.1.6-alpha.2"
|
|
67
67
|
}
|
|
68
68
|
}
|