@tbox.cn/app-contracts 0.11.0 → 0.12.1
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/dist/cards.d.ts +8 -0
- package/dist/providers.d.ts +34 -25
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +35 -22
- package/package.json +1 -1
- package/tests/integrations-config-parity.test.ts +11 -0
- package/tests/integrations-config.test.ts +15 -4
package/dist/cards.d.ts
CHANGED
|
@@ -38,6 +38,14 @@ export interface CardMeta<TSchema extends ZodTypeAny = ZodTypeAny> {
|
|
|
38
38
|
samples?: CardSample<zInfer<TSchema>>[];
|
|
39
39
|
/** 卡片数据契约版本(一期启用;缺省视为 1) */
|
|
40
40
|
schemaVersion?: number;
|
|
41
|
+
/**
|
|
42
|
+
* 不出卡标记(additive,缺席合法):当前不在任何出卡链路(工具暂停/下线、流水改文本事实等)。
|
|
43
|
+
* - 仅影响 dev 卡片预览目录(/_tbox/api/cards 默认过滤,?includeHidden=true 可见并携带徽标);
|
|
44
|
+
* - 注册态完整(dataSchema/动作/渲染器照常)——非 CardRegistry.disable(provider 能力边界,
|
|
45
|
+
* 物理不注册、破坏 doctor 一致性);与 CardAction.hidden(动作不进按钮条)语义无关;
|
|
46
|
+
* - 标记原因须写明类型:暂停型(工具恢复时移除标记)或永久型(注明决策出处)。
|
|
47
|
+
*/
|
|
48
|
+
hidden?: boolean;
|
|
41
49
|
/** 历史快照 schema 迁移:oldData → 新版本数据(001 §7.4) */
|
|
42
50
|
migrate?: (oldData: unknown, oldVersion: number) => Record<string, unknown>;
|
|
43
51
|
/**
|
package/dist/providers.d.ts
CHANGED
|
@@ -158,14 +158,17 @@ export interface ConfiguredService {
|
|
|
158
158
|
instances?: Record<string, ServiceInstanceConfig>;
|
|
159
159
|
}
|
|
160
160
|
/**
|
|
161
|
-
*
|
|
162
|
-
*
|
|
161
|
+
* 模块资源配置(integrations v6:modules 节 = 模块集成位——provider 绑定默认 + config
|
|
162
|
+
* 级联层 + v5 资源节三键合一;键 = install id(.tbox/app.json entry.id / packages/ 目录名;
|
|
163
|
+
* 仓内家族包恒等 manifest name 属规约)。provider/config 至少其一(空节点无意义)。
|
|
163
164
|
*/
|
|
164
|
-
export interface
|
|
165
|
-
/**
|
|
165
|
+
export interface ModuleConfig {
|
|
166
|
+
/** 模块级默认厂商(v6 绑定组继承层——作用于该模块 declare.owns 的全部服务槽) */
|
|
166
167
|
provider?: string;
|
|
167
|
-
/**
|
|
168
|
+
/** 模块级共享配置(config 五层级联第三层:root ByInstance 之后、slot 之前) */
|
|
168
169
|
config?: Record<string, unknown>;
|
|
170
|
+
/** resourceId → 类型化资源声明(resourceId 词汇真源 = 模块 manifest declare.resources) */
|
|
171
|
+
resources?: Record<string, ResourceSpec>;
|
|
169
172
|
}
|
|
170
173
|
/**
|
|
171
174
|
* 部署实例(业务主体拓扑条目;root instances 注册表元素——v4 参考表)。
|
|
@@ -213,15 +216,12 @@ export interface IntegrationsConfig {
|
|
|
213
216
|
credentialRef?: string;
|
|
214
217
|
/** 部署级 per-instance 默认凭据表(键 = instanceId;商户级凭据主写位) */
|
|
215
218
|
credentialRefByInstance?: Record<string, string>;
|
|
216
|
-
/** 模块域全局层(键 = moduleDomainOf(service);无 ByInstance——全链唯一 ByInstance 层恒 root) */
|
|
217
|
-
domains?: Record<string, DomainConfig>;
|
|
218
219
|
/** 部署实例注册表(参考表);缺席 = 无参考表;空数组非法(zod 拒——无表 = 键缺席唯一写法) */
|
|
219
220
|
instances?: DeploymentInstance[];
|
|
220
221
|
/** 默认实例 id(单实例免填;∈instances ids;无表时独立在场 = 动态默认形态) */
|
|
221
222
|
defaultInstanceId?: string | null;
|
|
222
|
-
/**
|
|
223
|
-
*
|
|
224
|
-
* 无 per-instance 层(扩展位词汇预选 resourcesByInstance——instances 词恒属 services 激活语义) */
|
|
223
|
+
/** 模块集成位(v6:provider 绑定默认 + config 级联层 + v5 资源节三键合一;
|
|
224
|
+
* 顶层 domains 键已退役——旧键经 zod 防线拒收并指引 migrate 至 modules[owner]) */
|
|
225
225
|
modules?: Record<string, ModuleConfig>;
|
|
226
226
|
services: Record<string, ConfiguredService>;
|
|
227
227
|
}
|
|
@@ -229,7 +229,7 @@ export interface IntegrationsConfig {
|
|
|
229
229
|
export interface EffectiveService {
|
|
230
230
|
provider: string | InlineVendorDeclaration;
|
|
231
231
|
implementation: string;
|
|
232
|
-
/** 五层浅合并一层:root.config → root.configByInstance[k] →
|
|
232
|
+
/** 五层浅合并一层:root.config → root.configByInstance[k] → modules[owner].config → slot.config → inst.config */
|
|
233
233
|
config: Readonly<Record<string, unknown>>;
|
|
234
234
|
credentialRef?: string;
|
|
235
235
|
}
|
|
@@ -252,26 +252,40 @@ export type EffectiveServiceResolution = {
|
|
|
252
252
|
* ('*' 字面量与 doctor 谓词文件内联一致;语义由双侧包测试交叉锁死。)
|
|
253
253
|
*/
|
|
254
254
|
export declare const WILDCARD_INSTANCE_KEY = "*";
|
|
255
|
-
/**
|
|
255
|
+
/**
|
|
256
|
+
* integrations v6 形状标记:resolveEffectiveService 接受 ownerOf 第五参、modules 节承载
|
|
257
|
+
* provider/config(模块所有权模型)。app-toolkit assertContractsUsable 经出口在场性探测
|
|
258
|
+
* 本标记——v5 contracts + v6 toolkit 偏斜组合 → 503 第四分支(P1 标记门;防静默忽略 ownerOf)。
|
|
259
|
+
*/
|
|
260
|
+
export declare const OWNERSHIP_BINDING_V6: true;
|
|
261
|
+
/**
|
|
262
|
+
* 槽位域前缀(首个点号前段;无点号取整串)。**v6 起退出级联**(modules[ownerOf] 取代
|
|
263
|
+
* domains 键控)——保留导出仅供词汇组织用途(guard/doctor 诊断消息按域聚合展示)。
|
|
264
|
+
* 域 ≠ 模块名(auth 域由登录链消费);归属语义唯一真源 = 模块 manifest declare.owns。
|
|
265
|
+
* @deprecated 级联键控已退役(v6 ownership 模型);新消费方禁用——归属查询走 ownerOf。
|
|
266
|
+
*/
|
|
256
267
|
export declare function moduleDomainOf(service: string): string;
|
|
257
268
|
/** 派生查表(buildSupplyLookup 产物):键 `${provider}\u0000${service}` → implementation 清单('id@version')。 */
|
|
258
269
|
export type SupplyLookup = Record<string, readonly string[]>;
|
|
259
270
|
/**
|
|
260
271
|
* 级联细则(一句话:层序优先于 scope 特异度;层内 per-instance 胜标量):
|
|
261
|
-
* - 绑定组(provider + implementation):最特异层整组取(inst > slot >
|
|
272
|
+
* - 绑定组(provider + implementation):最特异层整组取(inst > slot > modules[owner] > root)——
|
|
262
273
|
* 独立 `??` 继承会产生跨层非法组合(inst.provider=wanda + 继承 slot 的 joycity impl),
|
|
263
274
|
* 故组不可拆;组内 implementation 缺席 → supplies 派生(唯一命中;
|
|
264
275
|
* 零命中/歧义/未注入查表 → binding-unresolved);双字段显式在场 = 显式即真值(不派生,
|
|
265
276
|
* 存量全显式文件零影响)。内联声明仅槽级且必带 implementation(防御分支兜底)。
|
|
266
|
-
* -
|
|
267
|
-
*
|
|
268
|
-
*
|
|
277
|
+
* - ownerOf(v6):service → moduleId 归属表(buildOwnershipMap 产物,装配期显式注入)。
|
|
278
|
+
* 服务无主 → 跳过 modules 层(≡ 平台槽语义);ownerOf 缺席且文件含 modules 级
|
|
279
|
+
* 绑定/配置 → binding-unresolved fail-visible(装配偏斜防线——防静默丢模块层语义)。
|
|
280
|
+
* - config 五层浅合并:root.config → root.configByInstance[k] → modules[owner].config →
|
|
281
|
+
* slot.config → inst.config(service 标量胜 root ByInstance[k]——层序优先于 scope 特异度;
|
|
282
|
+
* modules[owner].config 恒参与该模块 owns 全部服务槽,与绑定来源层无关)
|
|
269
283
|
* - credentialRef:inst ?? slot ?? root.credentialRefByInstance[k] ?? root.credentialRef(v3 零改动;
|
|
270
|
-
*
|
|
284
|
+
* module 层无 credentialRef——链位预留 slot 后、root ByInstance 前)
|
|
271
285
|
* 不抛领域错误;status 由 SDK registry 映射 PROVIDER_* 错误码
|
|
272
286
|
* (binding-unresolved → PROVIDER_BINDING_UNRESOLVED;hasProviderBinding 点查 status !== 'ok' → false)。
|
|
273
287
|
*/
|
|
274
|
-
export declare function resolveEffectiveService(integrations: IntegrationsConfig, service: string, instanceId: string, supplies?: SupplyLookup): EffectiveServiceResolution;
|
|
288
|
+
export declare function resolveEffectiveService(integrations: IntegrationsConfig, service: string, instanceId: string, supplies?: SupplyLookup, ownerOf?: Record<string, string>): EffectiveServiceResolution;
|
|
275
289
|
/**
|
|
276
290
|
* root 部署实例注册表归一化(v4 wire → 消费形态单源):
|
|
277
291
|
* - instances 缺席 = 空表(无参考表——wanda 动态形态;空数组已在 zod 拒,此处纯防御);
|
|
@@ -282,7 +296,7 @@ export declare function resolveEffectiveService(integrations: IntegrationsConfig
|
|
|
282
296
|
*/
|
|
283
297
|
export declare function normalizeInstances(config: Pick<IntegrationsConfig, 'instances' | 'defaultInstanceId'>): NormalizedInstances;
|
|
284
298
|
/**
|
|
285
|
-
* provider manifest 单槽供给声明(tbox.module.json
|
|
299
|
+
* provider manifest 单槽供给声明(tbox.module.json declare.providers.slots 元素)。
|
|
286
300
|
* provider = 厂商名(= 档位名 = provider 包轴);implementation = 'id@version' 形态。
|
|
287
301
|
*/
|
|
288
302
|
export interface ProviderManifestSlot {
|
|
@@ -320,7 +334,7 @@ export interface CatalogProviderEntry {
|
|
|
320
334
|
/** 供给槽清单(service id) */
|
|
321
335
|
services: string[];
|
|
322
336
|
}
|
|
323
|
-
/** catalog 需求侧聚合条目(模块 manifest
|
|
337
|
+
/** catalog 需求侧聚合条目(模块 manifest declare.consumes 元素聚合;services 键 = service id) */
|
|
324
338
|
export interface CatalogServiceEntry {
|
|
325
339
|
/** 可选槽(未配置不 error——doctor warning 级) */
|
|
326
340
|
optional: boolean;
|
|
@@ -367,8 +381,3 @@ export interface KnowledgeResourceSpec {
|
|
|
367
381
|
}
|
|
368
382
|
/** 资源声明(discriminated by type;SDK zod / CLI doctor / 未来 app-toolkit 共用 wire 形状) */
|
|
369
383
|
export type ResourceSpec = KnowledgeResourceSpec;
|
|
370
|
-
/** 模块资源配置(modules 节元素;strict 单字段——provider/config/instances 进 modules 即非法,防与 domains 双写位) */
|
|
371
|
-
export interface ModuleConfig {
|
|
372
|
-
/** resourceId → 类型化资源声明(resourceId 词汇真源 = 模块 manifest contributes.resources) */
|
|
373
|
-
resources: Record<string, ResourceSpec>;
|
|
374
|
-
}
|
package/dist/runtime.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
export { EventType } from '@ag-ui/core';
|
|
7
7
|
export { TBOX_CARD_EVENT_NAME, TBOX_CARD_UPDATE_EVENT_NAME, TBOX_NOTICE_EVENT_NAME, } from './cards';
|
|
8
8
|
export { AUTH_ERROR_CODES, authCodeToStatus } from './identity';
|
|
9
|
-
export { stableSerializeScope, PROVIDER_ERROR_CODES, resolveEffectiveService, WILDCARD_INSTANCE_KEY, moduleDomainOf, buildSupplyLookup, normalizeInstances, isExpectedProviderAbsence, RESOURCE_TYPE_IDS, } from './providers';
|
|
9
|
+
export { stableSerializeScope, PROVIDER_ERROR_CODES, resolveEffectiveService, WILDCARD_INSTANCE_KEY, moduleDomainOf, buildSupplyLookup, normalizeInstances, isExpectedProviderAbsence, RESOURCE_TYPE_IDS, OWNERSHIP_BINDING_V6, } from './providers';
|
|
10
10
|
export { parseIntegrationsConfig } from './integrations-config';
|
|
11
11
|
export { assertNoInlineSecrets } from './no-inline-secrets';
|
|
12
12
|
export { defineContextSlot } from './context-slot';
|
package/dist/runtime.js
CHANGED
|
@@ -78,6 +78,7 @@ function isExpectedProviderAbsence(e) {
|
|
|
78
78
|
return code === PROVIDER_ERROR_CODES.SERVICE_NOT_CONFIGURED || code === PROVIDER_ERROR_CODES.INSTANCE_NOT_FOUND || code === PROVIDER_ERROR_CODES.INSTANCE_DISABLED;
|
|
79
79
|
}
|
|
80
80
|
var WILDCARD_INSTANCE_KEY = "*";
|
|
81
|
+
var OWNERSHIP_BINDING_V6 = true;
|
|
81
82
|
function moduleDomainOf(service) {
|
|
82
83
|
const i = service.indexOf(".");
|
|
83
84
|
return i === -1 ? service : service.slice(0, i);
|
|
@@ -85,20 +86,33 @@ function moduleDomainOf(service) {
|
|
|
85
86
|
function unresolved(service, instanceId, detail) {
|
|
86
87
|
return { status: "binding-unresolved", message: `${service}@${instanceId}\uFF1A${detail}` };
|
|
87
88
|
}
|
|
88
|
-
function
|
|
89
|
+
function hasModuleBindingNodes(integrations) {
|
|
90
|
+
return Object.values(integrations.modules ?? {}).some(
|
|
91
|
+
(m) => m.provider != null || m.config != null
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
function resolveEffectiveService(integrations, service, instanceId, supplies, ownerOf) {
|
|
89
95
|
const slot = integrations.services[service];
|
|
90
96
|
if (!slot) return { status: "service-not-configured" };
|
|
91
97
|
const instances = slot.instances ?? { [WILDCARD_INSTANCE_KEY]: {} };
|
|
92
98
|
const inst = instances[instanceId] ?? instances[WILDCARD_INSTANCE_KEY];
|
|
93
99
|
if (!inst) return { status: "instance-not-found" };
|
|
94
100
|
if (inst.enabled === false) return { status: "instance-disabled" };
|
|
95
|
-
|
|
96
|
-
|
|
101
|
+
if (ownerOf == null && hasModuleBindingNodes(integrations)) {
|
|
102
|
+
return unresolved(
|
|
103
|
+
service,
|
|
104
|
+
instanceId,
|
|
105
|
+
"integrations.json \u542B modules \u7EA7\u7ED1\u5B9A/\u914D\u7F6E\uFF0C\u4F46\u88C5\u914D\u671F\u672A\u6CE8\u5165 ownership map\uFF08buildOwnershipMap \u4EA7\u7269\u7ECF createIntegrationsRegistry ownerOf \u6CE8\u5165\uFF09\u2014\u2014\u5347\u7EA7\u88C5\u914D\u9762"
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
const owner = ownerOf?.[service];
|
|
109
|
+
const mod = owner != null ? integrations.modules?.[owner] : void 0;
|
|
110
|
+
const head = inst.provider != null ? { src: "instance", provider: inst.provider, impl: inst.implementation } : slot.provider != null ? { src: "slot", provider: slot.provider, impl: slot.implementation } : mod?.provider != null ? { src: "module", provider: mod.provider, impl: void 0 } : integrations.provider != null ? { src: "root", provider: integrations.provider, impl: void 0 } : void 0;
|
|
97
111
|
if (!head) {
|
|
98
112
|
return unresolved(
|
|
99
113
|
service,
|
|
100
114
|
instanceId,
|
|
101
|
-
"\u65E0\u4EFB\u4F55\u5C42 provider \u58F0\u660E\uFF08root/
|
|
115
|
+
"\u65E0\u4EFB\u4F55\u5C42 provider \u58F0\u660E\uFF08root/modules/\u69FD\u7EA7/\u5B9E\u4F8B\u7EA7\uFF09\u2014\u2014\u914D\u7F6E\u7ED1\u5B9A\u6216 provider use \u8865\u58F0\u660E"
|
|
102
116
|
);
|
|
103
117
|
}
|
|
104
118
|
let implementation = head.impl;
|
|
@@ -133,7 +147,7 @@ function resolveEffectiveService(integrations, service, instanceId, supplies) {
|
|
|
133
147
|
const config = {
|
|
134
148
|
...integrations.config,
|
|
135
149
|
...integrations.configByInstance?.[instanceId] ?? {},
|
|
136
|
-
...
|
|
150
|
+
...mod?.config ?? {},
|
|
137
151
|
...slot.config,
|
|
138
152
|
...inst.config
|
|
139
153
|
};
|
|
@@ -194,12 +208,6 @@ var inlineVendorSchema = z.strictObject({
|
|
|
194
208
|
credentialType: z.string().min(1),
|
|
195
209
|
configSchema: z.string().optional()
|
|
196
210
|
});
|
|
197
|
-
var domainSchema = z.strictObject({
|
|
198
|
-
provider: z.string().min(1).optional(),
|
|
199
|
-
config: z.record(z.string(), z.unknown()).optional()
|
|
200
|
-
}).refine((d) => d.provider !== void 0 || d.config !== void 0, {
|
|
201
|
-
message: "\u57DF\u914D\u7F6E provider/config \u81F3\u5C11\u5176\u4E00"
|
|
202
|
-
});
|
|
203
211
|
var instanceSchema = z.strictObject({
|
|
204
212
|
provider: z.string().optional(),
|
|
205
213
|
implementation: z.string().optional(),
|
|
@@ -236,7 +244,11 @@ var resourceSpecSchema = z.discriminatedUnion("type", [knowledgeSpecSchema]).ref
|
|
|
236
244
|
message: "knowledge \u8D44\u6E90 datasetId/ref \u81F3\u5C11\u5176\u4E00"
|
|
237
245
|
});
|
|
238
246
|
var moduleConfigSchema = z.strictObject({
|
|
239
|
-
|
|
247
|
+
provider: z.string().min(1).optional(),
|
|
248
|
+
config: z.record(z.string(), z.unknown()).optional(),
|
|
249
|
+
resources: z.record(z.string(), resourceSpecSchema).optional()
|
|
250
|
+
}).refine((m) => m.provider !== void 0 || m.config !== void 0 || m.resources !== void 0, {
|
|
251
|
+
message: "modules \u8282\u70B9 provider/config/resources \u81F3\u5C11\u5176\u4E00\uFF08\u7A7A\u8282\u70B9\u65E0\u610F\u4E49\u2014\u2014\u5220\u9664\u8BE5\u952E\uFF09"
|
|
240
252
|
});
|
|
241
253
|
var integrationsSchema = z.strictObject({
|
|
242
254
|
provider: z.string().min(1).optional(),
|
|
@@ -244,7 +256,6 @@ var integrationsSchema = z.strictObject({
|
|
|
244
256
|
configByInstance: z.record(z.string(), z.record(z.string(), z.unknown())).optional(),
|
|
245
257
|
credentialRef: z.string().optional(),
|
|
246
258
|
credentialRefByInstance: z.record(z.string(), z.string()).optional(),
|
|
247
|
-
domains: z.record(z.string(), domainSchema).optional(),
|
|
248
259
|
instances: z.array(deploymentInstanceSchema).optional(),
|
|
249
260
|
defaultInstanceId: z.string().min(1).nullable().optional(),
|
|
250
261
|
modules: z.record(z.string(), moduleConfigSchema).optional(),
|
|
@@ -285,19 +296,20 @@ var integrationsSchema = z.strictObject({
|
|
|
285
296
|
});
|
|
286
297
|
}
|
|
287
298
|
});
|
|
288
|
-
var
|
|
289
|
-
|
|
299
|
+
var LEGACY_KEY_MESSAGES = {
|
|
300
|
+
configByScope: "\u8BF7\u66F4\u540D configByInstance\uFF08scope\u2192instance \u8BCD\u6C47\u76F4\u5207\uFF0C\u65E7\u952E\u4E0D\u518D\u63A5\u53D7\uFF09",
|
|
301
|
+
credentialRefByScope: "\u8BF7\u66F4\u540D credentialRefByInstance\uFF08scope\u2192instance \u8BCD\u6C47\u76F4\u5207\uFF0C\u65E7\u952E\u4E0D\u518D\u63A5\u53D7\uFF09",
|
|
302
|
+
domains: "v6 \u5DF2\u9000\u5F79\u2014\u2014\u5F52\u5C5E\u8BED\u4E49\u8FC1\u79FB\u81F3\u6A21\u5757 manifest declare.owns + modules[owner] \u96C6\u6210\u4F4D\uFF08provider migrate \u81EA\u52A8\u8FC1\u79FB\uFF0C\u6216\u624B\u6539\uFF1Adomains.<d> \u2192 modules[<ownerId>]\uFF09"
|
|
303
|
+
};
|
|
304
|
+
function assertNoLegacyKeys(raw) {
|
|
290
305
|
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return;
|
|
291
|
-
const
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
throw new Error(
|
|
295
|
-
`integrations.json \u542B 0.9.0 \u5DF2\u66F4\u540D\u5B57\u6BB5\uFF1A${legacy.join("\u3001")}\u2014\u2014\u8BF7\u66F4\u540D configByInstance / credentialRefByInstance\uFF08scope\u2192instance \u8BCD\u6C47\u76F4\u5207\uFF0C\u65E7\u952E\u4E0D\u518D\u63A5\u53D7\uFF09`
|
|
296
|
-
);
|
|
306
|
+
for (const k of Object.keys(raw)) {
|
|
307
|
+
const msg = LEGACY_KEY_MESSAGES[k];
|
|
308
|
+
if (msg) throw new Error(`integrations.json \u542B\u5DF2\u9000\u5F79\u5B57\u6BB5\uFF1A${k}\u2014\u2014${msg}`);
|
|
297
309
|
}
|
|
298
310
|
}
|
|
299
311
|
function parseIntegrationsConfig(raw) {
|
|
300
|
-
|
|
312
|
+
assertNoLegacyKeys(raw);
|
|
301
313
|
assertNoInlineSecrets(raw);
|
|
302
314
|
return integrationsSchema.parse(raw);
|
|
303
315
|
}
|
|
@@ -523,6 +535,7 @@ export {
|
|
|
523
535
|
MEMORY_RECORD_PREVIEW_MAX_CHARS,
|
|
524
536
|
MEMORY_REMINDER_ATTR,
|
|
525
537
|
MEMORY_TOOL_CALL_NAME,
|
|
538
|
+
OWNERSHIP_BINDING_V6,
|
|
526
539
|
PRE_TOOL_CALL_NAME,
|
|
527
540
|
PRE_TOOL_NAME_PATTERN,
|
|
528
541
|
PROVIDER_ERROR_CODES,
|
package/package.json
CHANGED
|
@@ -73,9 +73,20 @@ describe('integrations-config 迁移等价锁(C1-5)', () => {
|
|
|
73
73
|
).toThrow(/credentialRefByInstance/);
|
|
74
74
|
});
|
|
75
75
|
|
|
76
|
+
it('P5b v6 顶层 domains 键退役 → 拒绝 + migrate 指引(集成位迁 modules[owner])', () => {
|
|
77
|
+
expect(() =>
|
|
78
|
+
parseIntegrationsConfig({
|
|
79
|
+
services: {},
|
|
80
|
+
domains: { member: { provider: 'wanda', config: { baseUrl: 'x' } } },
|
|
81
|
+
}),
|
|
82
|
+
).toThrow(/modules\[<ownerId>\]/);
|
|
83
|
+
});
|
|
84
|
+
|
|
76
85
|
it('P4 搬移完整性:assertNoInlineSecrets 与 parse 同源自 contracts 公开面', async () => {
|
|
77
86
|
const mod = await import('../src/index');
|
|
78
87
|
expect(typeof mod.parseIntegrationsConfig).toBe('function');
|
|
79
88
|
expect(typeof mod.assertNoInlineSecrets).toBe('function');
|
|
89
|
+
// v6 形状标记(P1 标记门探测目标):出口在场性
|
|
90
|
+
expect(mod.OWNERSHIP_BINDING_V6).toBe(true);
|
|
80
91
|
});
|
|
81
92
|
});
|
|
@@ -215,9 +215,21 @@ describe('parseIntegrationsConfig v5:modules 节(资源绑定轴)', () =>
|
|
|
215
215
|
expect(() => parseIntegrationsConfig(raw)).toThrow();
|
|
216
216
|
});
|
|
217
217
|
|
|
218
|
-
it('
|
|
218
|
+
it('模块层 provider 键合法(v6 反转:modules = 集成位——provider/config/resources 三键)', () => {
|
|
219
219
|
const raw = withModules({ 'module-a': { resources: {}, provider: 'wanda' } });
|
|
220
|
-
|
|
220
|
+
const cfg = parseIntegrationsConfig(raw);
|
|
221
|
+
expect(cfg.modules?.['module-a']?.provider).toBe('wanda');
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
it('模块层 config 键合法(v6 级联第三层)', () => {
|
|
225
|
+
const raw = withModules({ 'module-a': { config: { baseUrl: 'https://x' } } });
|
|
226
|
+
const cfg = parseIntegrationsConfig(raw);
|
|
227
|
+
expect(cfg.modules?.['module-a']?.config).toEqual({ baseUrl: 'https://x' });
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
it('空节点拒(provider/config/resources 至少其一)', () => {
|
|
231
|
+
const raw = withModules({ 'module-a': {} });
|
|
232
|
+
expect(() => parseIntegrationsConfig(raw)).toThrow(/至少其一/);
|
|
221
233
|
});
|
|
222
234
|
|
|
223
235
|
it('模块层混入 instances 键 → 拒(词边界:instances 恒属 services 激活语义)', () => {
|
|
@@ -246,8 +258,7 @@ describe('parseIntegrationsConfig v5:modules 节(资源绑定轴)', () =>
|
|
|
246
258
|
});
|
|
247
259
|
});
|
|
248
260
|
|
|
249
|
-
describe('assertNoInlineSecrets(011 L2 迁移;自 component-config.test.ts 移入)', () => {
|
|
250
|
-
it('豁免集 credentialType/credentialRef/credentialVersion/credentialRefByInstance 不拒', () => {
|
|
261
|
+
describe('assertNoInlineSecrets(011 L2 迁移;自 component-config.test.ts 移入)', () => { it('豁免集 credentialType/credentialRef/credentialVersion/credentialRefByInstance 不拒', () => {
|
|
251
262
|
expect(() =>
|
|
252
263
|
assertNoInlineSecrets({
|
|
253
264
|
providerInstances: [
|