@zhin.js/runtime 1.0.16 → 1.0.18
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/config-composer.d.ts
CHANGED
|
@@ -23,6 +23,8 @@ export declare class ConfigValidationError extends Error {
|
|
|
23
23
|
source?: string | undefined);
|
|
24
24
|
}
|
|
25
25
|
export declare class ConfigComposer {
|
|
26
|
+
private readonly inactivePluginInstanceKeys;
|
|
27
|
+
constructor(inactivePluginInstanceKeys?: readonly string[]);
|
|
26
28
|
compose(graph: ProjectGraph, input?: RuntimeConfigDocument,
|
|
27
29
|
/** Source config file name, annotated on ConfigValidationError. */
|
|
28
30
|
source?: string): Promise<ComposedConfig>;
|
package/lib/config-composer.js
CHANGED
|
@@ -36,6 +36,10 @@ export class ConfigValidationError extends Error {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
export class ConfigComposer {
|
|
39
|
+
inactivePluginInstanceKeys;
|
|
40
|
+
constructor(inactivePluginInstanceKeys = []) {
|
|
41
|
+
this.inactivePluginInstanceKeys = inactivePluginInstanceKeys;
|
|
42
|
+
}
|
|
39
43
|
async compose(graph, input = {},
|
|
40
44
|
/** Source config file name, annotated on ConfigValidationError. */
|
|
41
45
|
source) {
|
|
@@ -61,7 +65,10 @@ export class ConfigComposer {
|
|
|
61
65
|
type: 'object',
|
|
62
66
|
additionalProperties: false,
|
|
63
67
|
default: {},
|
|
64
|
-
properties: Object.fromEntries(
|
|
68
|
+
properties: Object.fromEntries([
|
|
69
|
+
...this.inactivePluginInstanceKeys.map((key) => [key, {}]),
|
|
70
|
+
...childSchemas.map(([key, schema]) => [key, withDefault(schema)]),
|
|
71
|
+
]),
|
|
65
72
|
},
|
|
66
73
|
},
|
|
67
74
|
});
|
|
@@ -23,6 +23,36 @@
|
|
|
23
23
|
"uniqueItems": true,
|
|
24
24
|
"description": "Authenticated Console principal ids allowed to publish shared Capability Packs.",
|
|
25
25
|
"x-descriptionZh": "允许发布共享 Capability Pack 的 Console 认证 principalId。"
|
|
26
|
+
},
|
|
27
|
+
"disclosure": {
|
|
28
|
+
"type": "object",
|
|
29
|
+
"additionalProperties": false,
|
|
30
|
+
"description": "Explicit P12 model processor contracts for Workroom disclosure bootstrap.",
|
|
31
|
+
"x-descriptionZh": "Workroom 披露初始化使用的显式 P12 模型处理方契约。",
|
|
32
|
+
"properties": {
|
|
33
|
+
"tenantId": { "type": "string", "minLength": 1 },
|
|
34
|
+
"modelProviders": {
|
|
35
|
+
"type": "object",
|
|
36
|
+
"additionalProperties": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"additionalProperties": false,
|
|
39
|
+
"required": ["endpoint", "processingRegions", "maxConfidentiality", "external", "noTraining", "loggingMode", "maximumRetentionSeconds", "allowsRedisclosure", "supportsDeletion"],
|
|
40
|
+
"properties": {
|
|
41
|
+
"endpoint": { "type": "string", "minLength": 1 },
|
|
42
|
+
"owner": { "type": "string", "minLength": 1 },
|
|
43
|
+
"trustDomain": { "type": "string", "minLength": 1 },
|
|
44
|
+
"processingRegions": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string", "minLength": 1 } },
|
|
45
|
+
"maxConfidentiality": { "type": "string", "enum": ["public", "project_internal", "confidential", "restricted"] },
|
|
46
|
+
"external": { "type": "boolean" },
|
|
47
|
+
"noTraining": { "type": "boolean" },
|
|
48
|
+
"loggingMode": { "type": "string", "enum": ["disabled", "metadata_only", "full"] },
|
|
49
|
+
"maximumRetentionSeconds": { "type": "integer", "minimum": 1 },
|
|
50
|
+
"allowsRedisclosure": { "type": "boolean" },
|
|
51
|
+
"supportsDeletion": { "type": "boolean" }
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
26
56
|
}
|
|
27
57
|
}
|
|
28
58
|
},
|
package/lib/project-graph.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export interface ProjectGraph {
|
|
|
20
20
|
}
|
|
21
21
|
export interface ProjectGraphServiceOptions {
|
|
22
22
|
readonly engineVersion?: string;
|
|
23
|
+
readonly disabledPluginInstanceKeys?: readonly string[];
|
|
23
24
|
}
|
|
24
25
|
export declare class ProjectGraphError extends Error {
|
|
25
26
|
constructor(message: string);
|
package/lib/project-graph.js
CHANGED
|
@@ -11,11 +11,15 @@ export class ProjectGraphError extends Error {
|
|
|
11
11
|
export class ProjectGraphService {
|
|
12
12
|
#resolver;
|
|
13
13
|
#engineVersion;
|
|
14
|
+
#disabledPluginInstanceKeys;
|
|
14
15
|
constructor(resolver, engineVersionOrOptions = runtimeEngineVersion) {
|
|
15
16
|
this.#resolver = resolver;
|
|
16
17
|
this.#engineVersion = typeof engineVersionOrOptions === 'string'
|
|
17
18
|
? engineVersionOrOptions
|
|
18
19
|
: (engineVersionOrOptions.engineVersion ?? runtimeEngineVersion);
|
|
20
|
+
this.#disabledPluginInstanceKeys = new Set(typeof engineVersionOrOptions === 'string'
|
|
21
|
+
? []
|
|
22
|
+
: (engineVersionOrOptions.disabledPluginInstanceKeys ?? []));
|
|
19
23
|
}
|
|
20
24
|
async inspect(projectRoot) {
|
|
21
25
|
const rootPackage = await this.#resolver.root(projectRoot);
|
|
@@ -58,6 +62,9 @@ export class ProjectGraphService {
|
|
|
58
62
|
pluginRefs = mergeChildPluginReferences(manifest.plugins, inheritedPlugins);
|
|
59
63
|
}
|
|
60
64
|
}
|
|
65
|
+
if (isRoot && this.#disabledPluginInstanceKeys.size > 0) {
|
|
66
|
+
pluginRefs = pluginRefs.filter((reference) => !this.#disabledPluginInstanceKeys.has(reference.instanceKey));
|
|
67
|
+
}
|
|
61
68
|
const featurePackages = new Set();
|
|
62
69
|
const features = await Promise.all(featureRefs.map(async (reference) => {
|
|
63
70
|
if (featurePackages.has(reference.package)) {
|
package/lib/root-runtime.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export interface RootRuntimeOptions {
|
|
|
21
21
|
readonly installResources?: RootResourceInstaller;
|
|
22
22
|
readonly isolation?: IsolatedPluginRuntimePort;
|
|
23
23
|
readonly onControlError?: ControlErrorHandler;
|
|
24
|
+
readonly disabledPluginInstanceKeys?: readonly string[];
|
|
24
25
|
}
|
|
25
26
|
export type RootHmrOptions = Omit<HmrCoordinatorOptions, 'modules' | 'ownership' | 'runtime'>;
|
|
26
27
|
export declare class RootRuntime {
|
package/lib/root-runtime.js
CHANGED
|
@@ -37,6 +37,7 @@ export class RootRuntime {
|
|
|
37
37
|
#configPatchTail = Promise.resolve();
|
|
38
38
|
#stopResult;
|
|
39
39
|
#controller;
|
|
40
|
+
#disabledPluginInstanceKeys;
|
|
40
41
|
constructor(options) {
|
|
41
42
|
this.#projectRoot = resolve(options.projectRoot);
|
|
42
43
|
this.#modules = options.modules;
|
|
@@ -50,6 +51,7 @@ export class RootRuntime {
|
|
|
50
51
|
this.#configDocument = structuredClone(options.config ?? {});
|
|
51
52
|
this.#installResources = options.installResources;
|
|
52
53
|
this.#isolation = options.isolation;
|
|
54
|
+
this.#disabledPluginInstanceKeys = Object.freeze([...(options.disabledPluginInstanceKeys ?? [])]);
|
|
53
55
|
this.#controller = new RootController(emptyState(), options.onControlError, Object.freeze({ ownership: SourceOwnershipIndex.empty() }));
|
|
54
56
|
}
|
|
55
57
|
get snapshot() {
|
|
@@ -187,7 +189,9 @@ export class RootRuntime {
|
|
|
187
189
|
}
|
|
188
190
|
async #inspectProject() {
|
|
189
191
|
const resolver = await NodePackageResolver.create(this.#projectRoot);
|
|
190
|
-
const graph = await new ProjectGraphService(resolver
|
|
192
|
+
const graph = await new ProjectGraphService(resolver, {
|
|
193
|
+
disabledPluginInstanceKeys: this.#disabledPluginInstanceKeys,
|
|
194
|
+
}).inspect(this.#projectRoot);
|
|
191
195
|
await this.#refreshConfigDocument();
|
|
192
196
|
if (this.#configResolver) {
|
|
193
197
|
return {
|
|
@@ -196,7 +200,8 @@ export class RootRuntime {
|
|
|
196
200
|
primaryConfigDocument: Object.freeze({}),
|
|
197
201
|
};
|
|
198
202
|
}
|
|
199
|
-
const composed = await new ConfigComposer(
|
|
203
|
+
const composed = await new ConfigComposer(this.#disabledPluginInstanceKeys)
|
|
204
|
+
.compose(graph, this.#configDocument);
|
|
200
205
|
return {
|
|
201
206
|
graph,
|
|
202
207
|
configResolver: this.#configViewResolver(composed.views),
|
|
@@ -243,8 +248,10 @@ export class RootRuntime {
|
|
|
243
248
|
let prepared;
|
|
244
249
|
signal.throwIfAborted();
|
|
245
250
|
const resolver = await NodePackageResolver.create(this.#projectRoot);
|
|
246
|
-
const graph = await new ProjectGraphService(resolver
|
|
247
|
-
|
|
251
|
+
const graph = await new ProjectGraphService(resolver, {
|
|
252
|
+
disabledPluginInstanceKeys: this.#disabledPluginInstanceKeys,
|
|
253
|
+
}).inspect(this.#projectRoot);
|
|
254
|
+
const planned = await new ConfigPatchPlanner(new ConfigComposer(this.#disabledPluginInstanceKeys)).plan(graph, currentDocument, patches);
|
|
248
255
|
plan = planned;
|
|
249
256
|
if (!planned.documentChanged)
|
|
250
257
|
return undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/runtime",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18",
|
|
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",
|
|
@@ -25,15 +25,15 @@
|
|
|
25
25
|
"@types/node": "^26.1.2",
|
|
26
26
|
"typescript": "^6.0.3",
|
|
27
27
|
"@zhin.js/adapter": "1.2.1",
|
|
28
|
-
"@zhin.js/command": "1.0.16",
|
|
29
28
|
"@zhin.js/agent-feature": "1.0.13",
|
|
29
|
+
"@zhin.js/command": "1.0.16",
|
|
30
30
|
"@zhin.js/component": "1.0.13",
|
|
31
|
-
"@zhin.js/mcp-feature": "1.0.13",
|
|
32
|
-
"@zhin.js/page": "1.0.13",
|
|
33
31
|
"@zhin.js/layout": "1.0.13",
|
|
34
|
-
"@zhin.js/
|
|
32
|
+
"@zhin.js/mcp-feature": "1.0.13",
|
|
35
33
|
"@zhin.js/middleware": "1.0.13",
|
|
34
|
+
"@zhin.js/page": "1.0.13",
|
|
36
35
|
"@zhin.js/prompt-section": "0.0.1",
|
|
36
|
+
"@zhin.js/skill": "1.0.13",
|
|
37
37
|
"@zhin.js/tool": "1.0.13"
|
|
38
38
|
},
|
|
39
39
|
"repository": {
|