@tbox.cn/app-toolkit 0.7.3 → 0.7.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.
- package/dist/index.d.ts +114 -114
- package/dist/index.js +1 -1
- package/package.json +2 -3
- package/src/assembly/app-manifest.ts +1 -1
- package/src/assembly/provider-catalog.ts +4 -4
- package/src/assembly/resolve-key.ts +1 -1
- package/src/assembly/walk-manifests.ts +8 -8
- package/src/core/contracts-expected.ts +1 -1
- package/src/core/contracts-resolver.ts +9 -9
- package/src/core/file-cache.ts +3 -3
- package/src/core/module-schema.ts +1 -1
- package/src/dto.ts +30 -30
- package/src/factory.ts +31 -31
- package/src/index.ts +1 -1
- package/src/integrations/credentials.ts +4 -4
- package/src/integrations/evaluate-app.ts +2 -2
- package/src/integrations/mock-bindings.ts +1 -1
- package/src/integrations/module-binding.ts +4 -4
- package/src/integrations/predicate-io.ts +1 -1
- package/src/integrations/predicate.ts +9 -9
- package/src/integrations/prune-bindings.ts +6 -6
- package/src/integrations/read.ts +3 -3
- package/src/integrations/write.ts +17 -17
- package/src/views/app.ts +3 -3
- package/src/views/credential-types.ts +1 -1
- package/src/views/credentials.ts +2 -2
- package/src/views/integration-schemas.ts +28 -28
- package/src/views/modules.ts +1 -1
- package/src/views/providers.ts +8 -8
- package/src/views/service-detail.ts +3 -3
- package/src/views/service-resolutions.ts +17 -17
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { z } from 'zod';
|
|
|
4
4
|
* tbox.module.json schema v1(001 §3.6 字段名,003 §4.1 schema v1 定版;v6 声明面翻转)。
|
|
5
5
|
* app-toolkit 单一校验源(自 CLI module-schema.ts 迁入;CLI 经 re-export 消费)。
|
|
6
6
|
*
|
|
7
|
-
* 迁移改造(ai-build
|
|
7
|
+
* 迁移改造(ai-build):
|
|
8
8
|
* - resourceNeedContribSchema 的 type 由 `z.enum(RESOURCE_TYPE_IDS)` 放宽为 `z.string()`——
|
|
9
9
|
* 词汇校验移谓词、经 contracts 动态解析取 RESOURCE_TYPE_IDS(比静态 enum 更忠实应用版本);
|
|
10
10
|
* - demand meta additive:serviceConsumeContribSchema 增 name?/description?(服务展示元数据,
|
|
@@ -687,7 +687,7 @@ interface FileCache {
|
|
|
687
687
|
read<T>(absolutePath: string, parse: (raw: string) => T): T | undefined;
|
|
688
688
|
/** 写后失效协议:paths 缺省全失效;指定路径仅失效对应条目 */
|
|
689
689
|
invalidate(paths?: readonly string[]): void;
|
|
690
|
-
/** 测试观测:parse
|
|
690
|
+
/** 测试观测:parse 执行计数(缓存命中不重 parse 断言用) */
|
|
691
691
|
readonly parseCount: number;
|
|
692
692
|
}
|
|
693
693
|
declare function createFileCache(): FileCache;
|
|
@@ -696,7 +696,7 @@ declare function createFileCache(): FileCache;
|
|
|
696
696
|
* 内联厂商声明(仅槽级 provider 字段可用;实例级 provider 恒字符串)。
|
|
697
697
|
* integrations.json 内直接声明供给,不经 provider 包 manifest。
|
|
698
698
|
* 未实施态语义:catalog/adapter 均无对应实现 → doctor warning + resolve 抛 PROVIDER_NOT_IMPLEMENTED
|
|
699
|
-
*
|
|
699
|
+
* (交互化的「先声明后实施」闭环)。
|
|
700
700
|
*/
|
|
701
701
|
interface InlineVendorDeclaration$1 {
|
|
702
702
|
/** 厂商名(= 档位名 = provider 包轴,如 'wanda') */
|
|
@@ -885,7 +885,7 @@ interface CatalogProviderEntry {
|
|
|
885
885
|
interface CatalogServiceEntry {
|
|
886
886
|
/** 可选槽(未配置不 error——doctor warning 级) */
|
|
887
887
|
optional: boolean;
|
|
888
|
-
/** manifest defaults
|
|
888
|
+
/** manifest defaults(页面预填缺省供给) */
|
|
889
889
|
defaults: Array<{
|
|
890
890
|
provider: string;
|
|
891
891
|
implementation: string;
|
|
@@ -895,10 +895,10 @@ interface CatalogServiceEntry {
|
|
|
895
895
|
}
|
|
896
896
|
/** loadProviderCatalog 产物:全应用 provider 供给与需求聚合(.tbox/app.json npmModules 真源) */
|
|
897
897
|
interface ProviderCatalog {
|
|
898
|
-
/** 嵌套形态:厂商级语义一跳、
|
|
898
|
+
/** 嵌套形态:厂商级语义一跳、 厂商→实现级联枚举天然序;migrate 反查表 = 本表自身 */
|
|
899
899
|
providers: Record<string, Record<string, CatalogProviderEntry>>;
|
|
900
900
|
services: Record<string, CatalogServiceEntry>;
|
|
901
|
-
/** credentialType
|
|
901
|
+
/** credentialType 直达索引(/doctor 单跳;同名共享单例先例) */
|
|
902
902
|
credentialTypes: Record<string, {
|
|
903
903
|
owner: string;
|
|
904
904
|
credentialSchema?: string;
|
|
@@ -907,7 +907,7 @@ interface ProviderCatalog {
|
|
|
907
907
|
/**
|
|
908
908
|
* catalog → 派生查表(展开 providers[vendor][impl].services 为
|
|
909
909
|
* `${provider}\u0000${service}` → implementation 清单)。
|
|
910
|
-
* 调用方在工厂构造期构建一次(SDK registry / CLI doctor 谓词 /
|
|
910
|
+
* 调用方在工厂构造期构建一次(SDK registry / CLI doctor 谓词 / 页面 state),求值期 O(1) 查表。
|
|
911
911
|
*/
|
|
912
912
|
declare function buildSupplyLookup(catalog: ProviderCatalog): SupplyLookup$1;
|
|
913
913
|
/** knowledge 资源声明(wire 形态;datasetId/ref 至少其一,并存时 datasetId 优先——resolver 层裁决) */
|
|
@@ -926,7 +926,7 @@ type ResourceSpec = KnowledgeResourceSpec;
|
|
|
926
926
|
/**
|
|
927
927
|
* contracts 期望面编译期锁(satisfies 语义防接口漂移——contracts 加名/改签名即编译红)。
|
|
928
928
|
* resolver 运行时产物按本接口逐命名导出存在性检查(evaluation/strictValidation 按在场降级)。
|
|
929
|
-
* contracts 恒 devDep 且限 import type——运行时全经 resolver 动态 import
|
|
929
|
+
* contracts 恒 devDep 且限 import type——运行时全经 resolver 动态 import(版本解耦)。
|
|
930
930
|
*/
|
|
931
931
|
interface EvaluationExports {
|
|
932
932
|
/** 求值单源(TIER0;v3 显式激活 vs v4 通配语义随应用版本;v6 第五参 ownerOf) */
|
|
@@ -946,7 +946,7 @@ interface EvaluationExports {
|
|
|
946
946
|
type ResolvedModule = Partial<EvaluationExports>;
|
|
947
947
|
|
|
948
948
|
/**
|
|
949
|
-
* contracts
|
|
949
|
+
* contracts 动态解析器(方案心脏):`resolveContractsForApp(appDir)`——
|
|
950
950
|
* 成员扫描 + 包根定位。沙箱内 toolkit 与目标应用版本解耦:求值与校验双面由
|
|
951
951
|
* 应用自己的 @tbox.cn/app-contracts 版本驱动。
|
|
952
952
|
*
|
|
@@ -978,7 +978,7 @@ interface ResolvedContracts {
|
|
|
978
978
|
evaluation: boolean;
|
|
979
979
|
/** 严格 zod 面可用(parseIntegrationsConfig 在场——≥0.9 门控判据) */
|
|
980
980
|
strictValidation: boolean;
|
|
981
|
-
/** v6 形状标记在场(OWNERSHIP_BINDING_V6——modules[owner] 绑定形状支持;标记门
|
|
981
|
+
/** v6 形状标记在场(OWNERSHIP_BINDING_V6——modules[owner] 绑定形状支持;标记门
|
|
982
982
|
* v5 contracts + v6 toolkit 偏斜 → 503 第四分支,防静默忽略 ownerOf) */
|
|
983
983
|
ownershipBindingV6: boolean;
|
|
984
984
|
/** 动态 import 产物(命名导出子集——Partial<EvaluationExports>) */
|
|
@@ -987,7 +987,7 @@ interface ResolvedContracts {
|
|
|
987
987
|
notes: string[];
|
|
988
988
|
}
|
|
989
989
|
/** 解析应用自己的 contracts(memoize + 轻探测指纹;绝不 throw——全缺席 → 未解析产物)。
|
|
990
|
-
*
|
|
990
|
+
* 命中判定 = 首个在册候选 + 命中候选双指纹(版本变更 / dist 物化 / 候选序变化 / 候选消失
|
|
991
991
|
* 全面可觉察——覆盖「build 后重试」长生命周期宿主与多候选走位两处 stale 边缘)。 */
|
|
992
992
|
declare function resolveContractsForApp(appDir: string): Promise<ResolvedContracts>;
|
|
993
993
|
/** 逃生舱(测试/宿主特殊场景——正常路径无需调用,Freshness Contract 自动;invalidate 逃生舱标注) */
|
|
@@ -996,10 +996,10 @@ declare function invalidateContractsResolver(appDir?: string): void;
|
|
|
996
996
|
/**
|
|
997
997
|
* integration-services 谓词单源(integrations v4;自 CLI doctor/integration-services.ts 迁入——
|
|
998
998
|
* doctor 第 19 条与 toolkit 工厂 evaluateIntegrationServices 共用此函数,单源不变)。
|
|
999
|
-
* 纯函数、零副作用、零 I/O——contracts 经 input.contracts 注入(resolver
|
|
999
|
+
* 纯函数、零副作用、零 I/O——contracts 经 input.contracts 注入(resolver 装配,版本解耦)。
|
|
1000
1000
|
*
|
|
1001
1001
|
* 结构化输出(H7 v4.3):IntegrationIssue { severity, code, message, service?, module?, instance? }——
|
|
1002
|
-
* 检查逻辑零改动(~24 处 push 机械加 code/定位字段;level→severity 字段同名随
|
|
1002
|
+
* 检查逻辑零改动(~24 处 push 机械加 code/定位字段;level→severity 字段同名随 班车,
|
|
1003
1003
|
* severity 取值恒等旧 level——doctor 门控行为等价)。
|
|
1004
1004
|
* **code 枚举单源 = 本文件头映射表(additive-only;api.md §5 表与本表同步)**:
|
|
1005
1005
|
* CREDENTIAL_FILE_MISSING #1 error effective credentialRef 引用凭据文件不在场
|
|
@@ -1024,9 +1024,9 @@ declare function invalidateContractsResolver(appDir?: string): void;
|
|
|
1024
1024
|
* RESOURCE_TYPE_UNKNOWN #15 error modules 资源节 type ∉ 词汇表
|
|
1025
1025
|
* RESOURCE_NOT_DECLARED #16 warning 资源键/资源 id ∉ 模块声明集
|
|
1026
1026
|
* MODULE_CONFIG_DEAD v6 error modules[m](未安装 ∨ owns=0)携带 provider/config
|
|
1027
|
-
* (统一吸收原「#16 升级」特例——
|
|
1027
|
+
* (统一吸收原「#16 升级」特例—— 一码一义)
|
|
1028
1028
|
* GLOBAL_FIELD_UNDECLARED #17 warning 全局层键过 #7 但 ∉ 引用厂商 x-tbox-global 并集(G 批;
|
|
1029
|
-
* 零声明厂商整体跳过——#7
|
|
1029
|
+
* 零声明厂商整体跳过——#7 同遍历双判定)
|
|
1030
1030
|
* ORPHANED_CREDENTIAL 写后对账 warning 凭据文件不再被引用(toolkit 写路径产出,非本谓词)
|
|
1031
1031
|
* (v6 退役:DOMAIN_KEY_UNMATCHED #14——domains 键随归属模型退场)
|
|
1032
1032
|
*
|
|
@@ -1058,7 +1058,7 @@ declare function invalidateContractsResolver(appDir?: string): void;
|
|
|
1058
1058
|
* zod 之外的第二道防线——doctor 读裸 JSON)
|
|
1059
1059
|
* MODULE_CONFIG_DEAD:modules[m] 携带 provider/config 且(m ∉ installedModuleIds ∨ ownership
|
|
1060
1060
|
* 无任何 service 归属 m)→ error(键级 #16 warning 与本检查可同节点共发——键级 vs 值级不同断言面)
|
|
1061
|
-
* #17(G 批):与 #7
|
|
1061
|
+
* #17(G 批):与 #7 同遍历双判定——键 ∈ schema properties 但 ∉ x-tbox-global 并集 →
|
|
1062
1062
|
* warning;引用厂商零全局声明(集空/缺席)→ 该厂商键整体跳过;检查序在 MODULE_CONFIG_DEAD 后
|
|
1063
1063
|
* #15-#16 modules 资源节对账(v5 延续):type ∉ RESOURCE_TYPE_IDS → error;键 ∉ 已装模块 id 集 /
|
|
1064
1064
|
* 资源 id ∉ 模块 manifest declare.resources 声明集 → warning
|
|
@@ -1170,13 +1170,13 @@ declare function evaluateIntegrationServices(input: IntegrationServicePredicateI
|
|
|
1170
1170
|
}): IntegrationServiceIssue[];
|
|
1171
1171
|
|
|
1172
1172
|
/**
|
|
1173
|
-
* walkManifests(appDir)
|
|
1173
|
+
* walkManifests(appDir)——单次遍历四产物(/;ai-build)。
|
|
1174
1174
|
*
|
|
1175
1175
|
* manifest 候选路径探测(packages/<id>/tbox.module.json 优先 → node_modules/<pkg>/tbox.module.json;
|
|
1176
1176
|
* tbox-app dev 真身经 .tbox-dev.local/dev-manifest.json redirects 独立 catalog 通道直达)一次遍历同时产出:
|
|
1177
1177
|
* 1. modules:已装模块清单(declared;demand meta name/description 透传)
|
|
1178
1178
|
* 2. catalog(富形态):providers 嵌套(vendor→impl→entry,per-service {implementation, credentialType}
|
|
1179
|
-
*
|
|
1179
|
+
* 保真——同厂商异构/多实现合法,/H1)+ 需求侧聚合
|
|
1180
1180
|
* 3. serviceSchemas:per-service schema 复合键表——键 `${provider}\u0000${service}`(H2,同一服务
|
|
1181
1181
|
* 多厂商供给各自 schema 零碰撞);多 impl 同 (provider, service) 异 schema → 声明序首个
|
|
1182
1182
|
* 4. vocabulary:所有携带 service-slots.json 的已装契约包该文件 `.slots` 键并集(fs 直读、
|
|
@@ -1184,21 +1184,21 @@ declare function evaluateIntegrationServices(input: IntegrationServicePredicateI
|
|
|
1184
1184
|
* ② 同包 src/service-slots.json(发布包 src 附带 / 模板 shim 链接)
|
|
1185
1185
|
* ③ 候选自身 {service-slots.json, src/service-slots.json}(local/codegen 全量副本——
|
|
1186
1186
|
* mall 生成应用主形态,不依赖 install);零缓存枚举,与 manifest 探测同机制;
|
|
1187
|
-
* 多行业 contracts-*
|
|
1187
|
+
* 多行业 contracts-* 天然扩展);缺席 → [](退化 demanded ∪ configured)
|
|
1188
1188
|
* 5. slotMeta:词汇 meta 节(per-service {name,description} 展示元数据——消费端兜底链
|
|
1189
1189
|
* 词汇 > demand > id,views/context resolveServiceDisplay 单源);多包发现序首声明胜出
|
|
1190
1190
|
* (与 catalog addSlots 同语义);contracts-mall 词汇锁保证 mall 域全量覆盖;缺席 → {}
|
|
1191
1191
|
* 6. ownership:service → moduleId 归属表(v6——declare.owns 聚合;install id 键控;
|
|
1192
1192
|
* 双 owner 冲突 → declarationIssues OWNERSHIP_CONFLICT + 先声明胜出)
|
|
1193
|
-
* 7. declarationIssues:声明面诊断(OWNERSHIP_CONFLICT / OLD_MANIFEST_KEY——
|
|
1193
|
+
* 7. declarationIssues:声明面诊断(OWNERSHIP_CONFLICT / OLD_MANIFEST_KEY—— 通道)
|
|
1194
1194
|
*
|
|
1195
|
-
* **约束(
|
|
1195
|
+
* **约束(FX-3/ 边界)**:目录枚举零缓存——readdir / node_modules 候选探测 / `.tbox/app.json` 读取 /
|
|
1196
1196
|
* dev-manifest 读取每次执行(枚举输入保持 fresh——agent 装卸模块下一笔即见);manifest/service-slots
|
|
1197
1197
|
* **文件内容**经 file-cache(`cache` 可选参——工厂/写内核传本实例 cache(stat 指纹自愈 + 写后失效);
|
|
1198
1198
|
* CLI 传 undefined 即全 fresh)。
|
|
1199
1199
|
* 宽松解析语义(坏文件静默 + 重复键首声明保留)零改动。
|
|
1200
1200
|
*/
|
|
1201
|
-
/** 声明面诊断(v6
|
|
1201
|
+
/** 声明面诊断(v6 通道——OWNERSHIP_CONFLICT / OLD_MANIFEST_KEY;error 级) */
|
|
1202
1202
|
type DeclarationIssue = {
|
|
1203
1203
|
severity: 'error';
|
|
1204
1204
|
code: 'OWNERSHIP_CONFLICT';
|
|
@@ -1297,7 +1297,7 @@ interface DiscoveredSlotSource {
|
|
|
1297
1297
|
* ③ 候选自身 {service-slots.json, src/service-slots.json}(local/codegen 全量副本——
|
|
1298
1298
|
* mall 生成应用主形态,stage rewriteExportsToSrc 展开后永驻 packages/*,不依赖 install)
|
|
1299
1299
|
* 词汇覆盖 = Set 并集(跳⓪ 不遮蔽真源新增);meta = 发现序首声明胜出(跳⓪ 最前 = 覆盖权)。
|
|
1300
|
-
* 同包双在场(异常态)root 优先。slots 与 meta 单次解析同产(目录枚举零缓存,
|
|
1300
|
+
* 同包双在场(异常态)root 优先。slots 与 meta 单次解析同产(目录枚举零缓存,
|
|
1301
1301
|
* FX-3:文件**内容**经 file-cache)。 */
|
|
1302
1302
|
declare function discoverContractPackages(appDir: string, cache?: FileCache): DiscoveredSlotSource[];
|
|
1303
1303
|
/** walkManifests 主体(单次遍历四产物;目录枚举零缓存——每次调用执行) */
|
|
@@ -1323,7 +1323,7 @@ declare function extractModuleIdFromSource(source: string): string | undefined;
|
|
|
1323
1323
|
declare function collectDeclaredModules(appDir: string): DeclaredModuleInfo[];
|
|
1324
1324
|
|
|
1325
1325
|
/**
|
|
1326
|
-
* 谓词装配单源(FX-2b
|
|
1326
|
+
* 谓词装配单源(FX-2b/):CLI doctor 规则 与 toolkit 工厂(求值轴 / SaveResult.issues)
|
|
1327
1327
|
* 共用同一 I/O 装配与供给/需求聚合——「面板 issues ≡ doctor issues」的机制保证。
|
|
1328
1328
|
*
|
|
1329
1329
|
* 迁移源:cli/src/doctor/schema-reader.ts(collectVendorSchemaProfiles,105 行)
|
|
@@ -1382,8 +1382,8 @@ declare function refToEnvKey(stem: string): string;
|
|
|
1382
1382
|
declare function buildPredicateAssembly(appDir: string, walk: WalkManifestsResult, integrations: Record<string, unknown>, env?: Readonly<Record<string, string | undefined>>): PredicateAssembly;
|
|
1383
1383
|
|
|
1384
1384
|
/**
|
|
1385
|
-
* 应用级 integrations 求值(cli-remove-prune-and-new
|
|
1386
|
-
* "装配+求值"序列的单源抽取(FX-2b/
|
|
1385
|
+
* 应用级 integrations 求值(cli-remove-prune-and-new.4):doctor integration-services 规则内
|
|
1386
|
+
* "装配+求值"序列的单源抽取(FX-2b/ 轨迹延续——此前 buildPredicateAssembly 已单源,本函数
|
|
1387
1387
|
* 将 walk→supplies→assembly→evaluate 全序列收口)。
|
|
1388
1388
|
*
|
|
1389
1389
|
* 消费方:
|
|
@@ -1396,13 +1396,13 @@ declare function buildPredicateAssembly(appDir: string, walk: WalkManifestsResul
|
|
|
1396
1396
|
declare function evaluateAppIntegrationIssues(appDir: string, integrations: Record<string, unknown>, contracts: ResolvedContracts, env?: Readonly<Record<string, string | undefined>>): Promise<IntegrationServiceIssue[]>;
|
|
1397
1397
|
|
|
1398
1398
|
/**
|
|
1399
|
-
* integrations.json 死绑定清理(cli-remove-prune-and-new
|
|
1399
|
+
* integrations.json 死绑定清理(cli-remove-prune-and-new 核心件)。
|
|
1400
1400
|
*
|
|
1401
1401
|
* 不变式:**删除判据 ≡ doctor integration-services 报错判据(构造性同源)**——消费 doctor 同一
|
|
1402
1402
|
* 共享求值器 evaluateAppIntegrationIssues 的结构化 issue,code 白名单
|
|
1403
1403
|
* {VENDOR_NOT_INSTALLED, BINDING_UNRESOLVED, MODULE_CONFIG_DEAD} + 守卫(绑定引用链候选
|
|
1404
1404
|
* provider ∈ installedVendors 即保留,排除活厂商错配)→ 删除域严格 = "供给载体消亡"。
|
|
1405
|
-
* v6:模块卸载 → modules[m] **整节点确定性清理**(provider+config+resources——
|
|
1405
|
+
* v6:模块卸载 → modules[m] **整节点确定性清理**(provider+config+resources——
|
|
1406
1406
|
* 模块消亡清理 vs 集成位编辑保全不矛盾;MODULE_CONFIG_DEAD 为判据源)。
|
|
1407
1407
|
*
|
|
1408
1408
|
* 由此推论(均已实证):需求侧孤儿绑定(demand 消失、供给在场)保留——doctor 判其合法;用户
|
|
@@ -1410,7 +1410,7 @@ declare function evaluateAppIntegrationIssues(appDir: string, integrations: Reco
|
|
|
1410
1410
|
* 刻意不进白名单,原样保留。
|
|
1411
1411
|
*
|
|
1412
1412
|
* 写侧三防线(镜像 write core):归一化(空节点删键)→ parseIntegrationsConfig
|
|
1413
|
-
* 严格校验(失败弃写)→ writeAtomic
|
|
1413
|
+
* 严格校验(失败弃写)→ writeAtomic。凭据孤儿只报告不清理(——与 DELETE 管线现行为一致)。
|
|
1414
1414
|
* 全空(无任何存活绑定)→ 删文件——ensureMockBindings(缺席即生成)在重装供给时再生闭环。
|
|
1415
1415
|
*
|
|
1416
1416
|
* 最佳努力语义:谓词不可用(contracts 未安装/降级、env 缺失、求值 throw)→ skipped 返回 +
|
|
@@ -1419,7 +1419,7 @@ declare function evaluateAppIntegrationIssues(appDir: string, integrations: Reco
|
|
|
1419
1419
|
interface PruneResult {
|
|
1420
1420
|
/** 被清除的绑定节点描述(remove 日志行,如 'root.provider=mock' / 'services.member.account') */
|
|
1421
1421
|
removed: string[];
|
|
1422
|
-
/**
|
|
1422
|
+
/** 孤儿凭据(只报告不清理——reconcileOrphanCredentials 产物 message) */
|
|
1423
1423
|
orphanCredentials: string[];
|
|
1424
1424
|
/** 跳过原因(正常路径 undefined;not-configured = integrations.json 缺席,兼容态零动作) */
|
|
1425
1425
|
skipped?: 'predicate-unavailable' | 'validation-failed' | 'not-configured';
|
|
@@ -1433,7 +1433,7 @@ declare function pruneIntegrationBindings(appDir: string): Promise<PruneResult>;
|
|
|
1433
1433
|
* **消费边界(O1——双键语义单点)**:仅 factory.ts 控制面七方法入口接入;
|
|
1434
1434
|
* views / write-core / CLI 恒 id-only 纯函数。
|
|
1435
1435
|
*
|
|
1436
|
-
*
|
|
1436
|
+
* **纯参数式**:configuredKeys 由调用方注入——零 integrations 依赖、零 IO,
|
|
1437
1437
|
* 解析输入恒为 walk 产物快照 + 调用方键集。
|
|
1438
1438
|
*/
|
|
1439
1439
|
/** 模块双键解析:id 精确 → 展示名(descriptor.name ?? id)唯一命中 → 404。 */
|
|
@@ -1462,7 +1462,7 @@ interface NpmModuleEntry {
|
|
|
1462
1462
|
/** 3-way merge 基线(codegen 模式) */
|
|
1463
1463
|
baseVersion?: string;
|
|
1464
1464
|
/**
|
|
1465
|
-
*
|
|
1465
|
+
* 条目类别(单一模板统一化):'ui-kit' = 壳 UI 组件包——create 全量继承后
|
|
1466
1466
|
* 不再承担保留判据(模板 manifest = 出厂装配真源);现职 = update 三方合并锚 +
|
|
1467
1467
|
* sync-agent-ui-kit 副本 identity 标记(由该脚本派生维护)。
|
|
1468
1468
|
*/
|
|
@@ -1559,7 +1559,7 @@ type ProviderServiceSchemasResult = {
|
|
|
1559
1559
|
};
|
|
1560
1560
|
|
|
1561
1561
|
/**
|
|
1562
|
-
* integrations.json 文件级读(
|
|
1562
|
+
* integrations.json 文件级读(read)。
|
|
1563
1563
|
* 严格校验面(≥0.9)在场 → contracts parseIntegrationsConfig(assertNoInlineSecrets →
|
|
1564
1564
|
* 旧键直切防线 → zod strict);缺席/降级 → 原文 JSON 透传(谓词宽松透传语义——
|
|
1565
1565
|
* doctor 读裸 JSON 先例;写路径门控在工厂边缘,读不阻断静态面)。
|
|
@@ -1577,12 +1577,12 @@ declare function readIntegrationsConfig(appDir: string, cache?: FileCache): Reco
|
|
|
1577
1577
|
declare function readIntegrationsStrict(appDir: string, cache?: FileCache): Promise<ReadIntegrationsResult>;
|
|
1578
1578
|
|
|
1579
1579
|
/**
|
|
1580
|
-
* 凭据双工件·写端(
|
|
1580
|
+
* 凭据双工件·写端(credentials;FX-1c 拆分—— 定序):
|
|
1581
1581
|
* credentials / credentialsByInstance(body 唯一非文件字段)→ **纯派生 plan(零 I/O)**
|
|
1582
1582
|
* → 消费方(write.ts)ref 回填节点(先于 no-diff 判定)→ 严格校验通过后 `writeCredentialArtifacts`
|
|
1583
1583
|
* 落盘(dryRun → 零写盘 + existsSync 预览)。同 stem 已在场 → 重写 + overwrote:true。
|
|
1584
1584
|
* 孤儿凭据 = **写后对账**(扫描文件全量 credentialRef 引用 vs 凭据目录全集 →
|
|
1585
|
-
* ORPHANED_CREDENTIAL warning——统一覆盖 DELETE 与 PUT
|
|
1585
|
+
* ORPHANED_CREDENTIAL warning——统一覆盖 DELETE 与 PUT 替换两类来源,只报告不自动清理)。
|
|
1586
1586
|
*/
|
|
1587
1587
|
interface CredentialInput {
|
|
1588
1588
|
type: string;
|
|
@@ -1610,16 +1610,16 @@ interface OrphanIssue {
|
|
|
1610
1610
|
}
|
|
1611
1611
|
/** 凭据工件在场探测(dryRun 预览与对账共用) */
|
|
1612
1612
|
declare function credentialArtifactExists(appDir: string, stem: string): boolean;
|
|
1613
|
-
/**
|
|
1613
|
+
/** 孤儿凭据写后对账:凭据目录全集 − integrations.json 全量引用 = 孤儿(只报告不清理) */
|
|
1614
1614
|
declare function reconcileOrphanCredentials(appDir: string): OrphanIssue[];
|
|
1615
1615
|
|
|
1616
1616
|
/**
|
|
1617
|
-
* 写核心(
|
|
1617
|
+
* 写核心(write;FX-1c 管线重排—— 九步定序 + D-B2 语义 + 输入扩位):
|
|
1618
1618
|
* PUT = 节点全量替换(三同构——body ≡ 文件节点;三 PUT 端点无例外)。
|
|
1619
1619
|
*
|
|
1620
1620
|
* 九步定序(applyApp / applyService 同构):
|
|
1621
|
-
* 1 输入约束(assertSafeNames 值位 + assertSafeInstanceKeys map
|
|
1622
|
-
* 2 合并 node → next;文件缺席 →
|
|
1621
|
+
* 1 输入约束(assertSafeNames 值位 + assertSafeInstanceKeys map 键位——)
|
|
1622
|
+
* 2 合并 node → next;文件缺席 → 骨架物化(语义翻转提示入 issues)
|
|
1623
1623
|
* 3 凭据校验链(type 匹配 400 + credentialSchema ajv 字段级——schema 缺席宽松;dryRun 也跑)
|
|
1624
1624
|
* 4 凭据 stem/ref **纯派生**(plan*——零 I/O)+ ref 回填节点(**先于 no-diff**:
|
|
1625
1625
|
* node 缺 ref + 带 credentials → 节点变化 → 全量写;node 已含同 ref → 节点不变 → 纯凭据写)
|
|
@@ -1628,12 +1628,12 @@ declare function reconcileOrphanCredentials(appDir: string): OrphanIssue[];
|
|
|
1628
1628
|
* 7 严格整文档校验(contracts parseIntegrationsConfig——触发 = !noDiff ∥ 有凭据输入)
|
|
1629
1629
|
* 8 凭据工件落盘(**后置于校验通过**——防「凭据已写 + zod 拒绝」不一致态;
|
|
1630
1630
|
* dryRun → writeCredentialArtifacts 零写盘 + existsSync 预览)
|
|
1631
|
-
* 9 finalize
|
|
1631
|
+
* 9 finalize:planned = 将触碰(files 预览单源——dryRun 响应 ≡ 同 body 真实写,files 逐字对称);
|
|
1632
1632
|
* written = 实写(!dryRun 派生,D-B2);restartScheduled = written && onApplied(凭据影响 boot 装配——
|
|
1633
1633
|
* 重启正当);写后缓存失效
|
|
1634
1634
|
* 归一化:N1 模块节点 {} → 删 domains[键];N3 服务节点 {} 不归一化(显式通配激活 = 合法 TIER0 态);
|
|
1635
1635
|
* N2 已随 ?instance= 退役。dryRun(PUT only):复读完整管线不落盘不排程。
|
|
1636
|
-
* DELETE:节点移除 + 孤儿凭据写后对账(覆盖 DELETE 与 PUT
|
|
1636
|
+
* DELETE:节点移除 + 孤儿凭据写后对账(覆盖 DELETE 与 PUT 替换两类来源,只报告不清理——)。
|
|
1637
1637
|
* 并发:进程内串行(per-factory promise chain 由工厂持有——本模块假设单飞调用)。
|
|
1638
1638
|
*/
|
|
1639
1639
|
interface SaveResult {
|
|
@@ -1675,7 +1675,7 @@ interface WriteCore {
|
|
|
1675
1675
|
declare function createWriteCore(appDir: string, opts?: WriteCoreOptions): WriteCore;
|
|
1676
1676
|
|
|
1677
1677
|
/**
|
|
1678
|
-
* mock 槽绑定生成器(自 CLI mock-bindings.ts 迁入;provider 拆包
|
|
1678
|
+
* mock 槽绑定生成器(自 CLI mock-bindings.ts 迁入;provider 拆包 收敛 · B 方案;integrations v4 零拓扑形态):
|
|
1679
1679
|
* 应用内 config/integrations.json 缺席时,从已装模块 manifest 的 local:true 槽派生全槽 mock 绑定。
|
|
1680
1680
|
*
|
|
1681
1681
|
* 语义边界(零改动迁移):
|
|
@@ -1694,7 +1694,7 @@ interface MockBindingsResult {
|
|
|
1694
1694
|
declare function ensureMockBindings(appDir: string): MockBindingsResult;
|
|
1695
1695
|
|
|
1696
1696
|
/**
|
|
1697
|
-
* 模块级联绑定单源(integrations v6 所有权模型——原 domain-binding.ts v4.4
|
|
1697
|
+
* 模块级联绑定单源(integrations v6 所有权模型——原 domain-binding.ts v4.4/ 重写)。
|
|
1698
1698
|
* integrations 层落位依据:谓词(同层)/ 写核(同层)/ views(下层可向上 import)三向消费
|
|
1699
1699
|
* 的唯一公共下层;import 前缀 guard 覆盖。
|
|
1700
1700
|
*
|
|
@@ -1706,7 +1706,7 @@ declare function ensureMockBindings(appDir: string): MockBindingsResult;
|
|
|
1706
1706
|
* registry 显式参 / 谓词 / 写守卫 / views 四消费方零第二实现)
|
|
1707
1707
|
* 来源层四层推导 = deriveBindingLayer(views/service-resolutions,模块级段改调本文件)
|
|
1708
1708
|
* 写通道可用性 = moduleOwnershipWritable —— configEditable 读标志 / applyModule 400 守卫
|
|
1709
|
-
* 共用(owns>0 唯一判据——多域归属合法化、共享键/多域判据随
|
|
1709
|
+
* 共用(owns>0 唯一判据——多域归属合法化、共享键/多域判据随 退役)
|
|
1710
1710
|
*/
|
|
1711
1711
|
/** 归属表构建(walk 单源直通——sdk 桥 re-export 消费;appDir 直入对齐 loadProviderCatalog
|
|
1712
1712
|
* 桥工效——模板装配第六行:`ownerOf: buildOwnershipMap(appDir)`)。 */
|
|
@@ -1718,7 +1718,7 @@ declare function resolveModuleBinding(config: Record<string, unknown> | null, mo
|
|
|
1718
1718
|
layer: 'module' | 'app' | null;
|
|
1719
1719
|
};
|
|
1720
1720
|
/** 模块集成位可写性(v6 判别联合——configEditable 读标志与 applyModule 写守卫共用单源):
|
|
1721
|
-
* owns>0
|
|
1721
|
+
* owns>0 唯一判据(多域/shared-key 判据随 v6 退役——服务归属唯一真源 = declare.owns)。 */
|
|
1722
1722
|
type ModuleOwnershipWritability = {
|
|
1723
1723
|
writable: true;
|
|
1724
1724
|
ownedServices: string[];
|
|
@@ -1728,7 +1728,7 @@ type ModuleOwnershipWritability = {
|
|
|
1728
1728
|
ownedServices: [];
|
|
1729
1729
|
};
|
|
1730
1730
|
declare function moduleOwnershipWritable(_walk: Pick<WalkManifestsResult, 'modules' | 'catalog' | 'ownership'>, mod: WalkModuleInfo): ModuleOwnershipWritability;
|
|
1731
|
-
/** 供给足迹(该厂商全部供给服务并集——应用级 integrationSchemas
|
|
1731
|
+
/** 供给足迹(该厂商全部供给服务并集——应用级 integrationSchemas 作用域) */
|
|
1732
1732
|
declare function providerFootprint(catalog: WalkCatalog, provider: string): string[];
|
|
1733
1733
|
|
|
1734
1734
|
/**
|
|
@@ -1797,7 +1797,7 @@ interface ModuleDeclaration {
|
|
|
1797
1797
|
hidden?: boolean;
|
|
1798
1798
|
}
|
|
1799
1799
|
/** 服务需求声明(模块 demand 单元 / 平台服务条目 / owned-not-consumed 投影条目——
|
|
1800
|
-
* v4.4
|
|
1800
|
+
* v4.4 双端点同型;defaults 唯一落位 ServiceDetail) */
|
|
1801
1801
|
interface ServiceDemand {
|
|
1802
1802
|
service: string;
|
|
1803
1803
|
/** manifest demand meta(v7 title→name);缺席 UI 回退 service id */
|
|
@@ -1833,12 +1833,12 @@ interface ModuleDetailView {
|
|
|
1833
1833
|
* 空判特例:consume 条目胜出[声明序原样、required = optional === false];owned-not-consumed
|
|
1834
1834
|
* 追加[ownedServices 排序序、Set 去重,required 恒 false]。卡片展开 + 编辑器静态上下文自足) */
|
|
1835
1835
|
services: ServiceDemand[];
|
|
1836
|
-
/** v4.4
|
|
1836
|
+
/** v4.4 include=serviceResolutions 内嵌(v6.1 键集 = owned ∪ demand 服务过滤 ≡ 批量 ?service= 语义;<0.9/形态异常 → null——永不 503) */
|
|
1837
1837
|
serviceResolutions?: ServiceResolutionsView | null;
|
|
1838
|
-
/** v4.4
|
|
1838
|
+
/** v4.4 include=integrationSchemas 层级富化(零归属/未绑定 → null) */
|
|
1839
1839
|
integrationSchemas?: LayerIntegrationSchemas | null;
|
|
1840
|
-
/** v4.6
|
|
1841
|
-
* 未知厂商/零足迹 → 非 null 空集 + unsupplied 回填——
|
|
1840
|
+
/** v4.6 include=integrationFieldRegistry 集成字段注册表(null 语义镜像 integrationSchemas;
|
|
1841
|
+
* 未知厂商/零足迹 → 非 null 空集 + unsupplied 回填—— 轴参假想计算同此) */
|
|
1842
1842
|
integrationFieldRegistry?: IntegrationFieldRegistryView | null;
|
|
1843
1843
|
}
|
|
1844
1844
|
/** 模块级厂商绑定解析(v6——静态文件事实;规则 ≡ 谓词 #7 模块层,resolveModuleBinding 单源) */
|
|
@@ -1848,7 +1848,7 @@ interface ModuleBinding {
|
|
|
1848
1848
|
/** 生效来源层(双缺 = null) */
|
|
1849
1849
|
layer: 'module' | 'app' | null;
|
|
1850
1850
|
}
|
|
1851
|
-
/** 层级 config schema 计算(v4.4
|
|
1851
|
+
/** 层级 config schema 计算(v4.4——静态轴富化,零 contracts) */
|
|
1852
1852
|
interface LayerIntegrationSchemas {
|
|
1853
1853
|
/** 层生效厂商(resolveModuleBinding 单源) */
|
|
1854
1854
|
provider: string;
|
|
@@ -1857,10 +1857,10 @@ interface LayerIntegrationSchemas {
|
|
|
1857
1857
|
configSchema: object | null;
|
|
1858
1858
|
}>;
|
|
1859
1859
|
}
|
|
1860
|
-
/** v4.6
|
|
1860
|
+
/** v4.6 集成字段注册表(层级表单服务端预计算——合并代数// 服务端单源;
|
|
1861
1861
|
* 消费 resolveLayerIntegrationSchemas 产物构造,禁旁路直取 serviceSchemas) */
|
|
1862
1862
|
interface IntegrationFieldRegistryView {
|
|
1863
|
-
/** echo:本注册表计算口径(假想时 =
|
|
1863
|
+
/** echo:本注册表计算口径(假想时 = 轴参值——) */
|
|
1864
1864
|
provider: string;
|
|
1865
1865
|
/** 作用域内 configSchema === null 的服务(UI「未提供参数模板」提示行) */
|
|
1866
1866
|
schemaless: string[];
|
|
@@ -1872,7 +1872,7 @@ interface IntegrationFieldRegistryView {
|
|
|
1872
1872
|
/** 逐 key 合并产物(首声明插入序 = scope 遍历序:app 字母序 / module ownedServices 序) */
|
|
1873
1873
|
fields: Array<{
|
|
1874
1874
|
key: string;
|
|
1875
|
-
/** null =
|
|
1875
|
+
/** null = 类型不可调和(/ 异构/ enum 不等——冲突折叠,客户端 RawJson 保真) */
|
|
1876
1876
|
schema: object | null;
|
|
1877
1877
|
/** required 聚合 = sources.some(s => s.required);conflict 字段照常聚合 */
|
|
1878
1878
|
sources: Array<{
|
|
@@ -1886,17 +1886,17 @@ interface IntegrationFieldRegistryView {
|
|
|
1886
1886
|
}
|
|
1887
1887
|
/** GET /app(应用静态视图:平台服务 + root 原值) */
|
|
1888
1888
|
interface AppView {
|
|
1889
|
-
/** 平台服务(v4.4
|
|
1889
|
+
/** 平台服务(v4.4 服务词汇 − 模块占用——与模块 demand 同型 ServiceDemand[];
|
|
1890
1890
|
* title/description 缺席 = UI 回退 service id;required 恒 false——平台服务无 demand 源) */
|
|
1891
1891
|
services: ServiceDemand[];
|
|
1892
1892
|
/** root 节点原值;文件缺席 = null */
|
|
1893
1893
|
integration: AppIntegrationNode | null;
|
|
1894
|
-
/** v4.4
|
|
1894
|
+
/** v4.4 include=serviceResolutions 内嵌(全量键集 ≡ 批量无参;<0.9/形态异常 → null——永不 503) */
|
|
1895
1895
|
serviceResolutions?: ServiceResolutionsView | null;
|
|
1896
|
-
/** v4.4
|
|
1896
|
+
/** v4.4 include=integrationSchemas 层级富化(root.provider 缺席 → null) */
|
|
1897
1897
|
integrationSchemas?: LayerIntegrationSchemas | null;
|
|
1898
|
-
/** v4.6
|
|
1899
|
-
* 未知厂商/零足迹 → 非 null 空集——
|
|
1898
|
+
/** v4.6 include=integrationFieldRegistry 集成字段注册表(root.provider 缺席且无轴参 → null;
|
|
1899
|
+
* 未知厂商/零足迹 → 非 null 空集—— 轴参假想计算同此) */
|
|
1900
1900
|
integrationFieldRegistry?: IntegrationFieldRegistryView | null;
|
|
1901
1901
|
}
|
|
1902
1902
|
/** GET /services/:service(服务静态单体) */
|
|
@@ -1910,34 +1910,34 @@ interface ServiceDetail extends ServiceDemand {
|
|
|
1910
1910
|
integration: ServiceIntegrationNode | null;
|
|
1911
1911
|
/** 供给该服务的厂商名单(catalog 静态切片——picker 数据源) */
|
|
1912
1912
|
suppliedBy: string[];
|
|
1913
|
-
/** v4.7
|
|
1913
|
+
/** v4.7 include=integrationSchemas 生效绑定富化(三态:null 全链未绑定 /
|
|
1914
1914
|
* 绑定无可计算 schema / 含 schema;malformed 节点 → null——不放行域级联) */
|
|
1915
1915
|
integrationSchemas?: ServiceIntegrationSchemas | null;
|
|
1916
1916
|
/** G 批:include=integrationFieldRegistry 服务轴注册表(loadServiceFieldRegistry——
|
|
1917
|
-
* 四分支链推导复用
|
|
1918
|
-
* v5.1
|
|
1917
|
+
* 四分支链推导复用 fields = 该 schema 全部字段带 global 旗标;null 语义镜像 。
|
|
1918
|
+
* v5.1 serviceProvider 轴参 = 假想重定向——仅表单投影按 X 计算,带非空轴参时
|
|
1919
1919
|
* registry 恒非 null(豁免链③不镜像实际态 null);同构 ≡ PUT 改写 provider 后实读) */
|
|
1920
1920
|
integrationFieldRegistry?: IntegrationFieldRegistryView | null;
|
|
1921
1921
|
}
|
|
1922
|
-
/** 服务级生效绑定 schema(v4.7
|
|
1922
|
+
/** 服务级生效绑定 schema(v4.7 静态轴富化——零 contracts,永不 503;实例层无条件排除:
|
|
1923
1923
|
* node 级口径 ≠ resolution 默认实例口径,api.md §4.4 注) */
|
|
1924
1924
|
interface ServiceIntegrationSchemas {
|
|
1925
1925
|
/** 生效厂商:显式(含内联声明名)?? modules[ownerOf].provider ?? root.provider;
|
|
1926
|
-
* v5.1
|
|
1926
|
+
* v5.1 serviceProvider 轴参在场时 = 假想短路值(非链解析产物) */
|
|
1927
1927
|
provider: string;
|
|
1928
1928
|
/** catalog 复合键(多 impl 声明序首个)> 内联 ref;miss(未知厂商/未供给/内联缺 ref)→ null(富化非门控) */
|
|
1929
1929
|
configSchema: object | null;
|
|
1930
1930
|
}
|
|
1931
1931
|
/** GET /service-resolutions(批量求值 · 唯一求值集合面) */
|
|
1932
1932
|
interface ServiceResolutionsView {
|
|
1933
|
-
/**
|
|
1933
|
+
/** contracts echo(仅求值轴两端点携带) */
|
|
1934
1934
|
contracts: ContractsResolution;
|
|
1935
1935
|
/** 键集 = 服务词汇 ∪ 已配置 ∪ 归属(v6.1 += 归属——owned 服务恒可求值;模块/平台/孤儿全量) */
|
|
1936
1936
|
resolutions: Record<string, ServiceResolutionEntry>;
|
|
1937
1937
|
/** 谓词全量(doctor 同源;恒全量——subset 消费方客户端过滤) */
|
|
1938
1938
|
issues: IntegrationIssue[];
|
|
1939
1939
|
}
|
|
1940
|
-
/** 求值摘要单元(行内嵌;
|
|
1940
|
+
/** 求值摘要单元(行内嵌; 单一形状) */
|
|
1941
1941
|
interface ServiceResolutionEntry {
|
|
1942
1942
|
/** 默认实例口径(normalizeInstances 委托) */
|
|
1943
1943
|
status: ServiceStatus;
|
|
@@ -1955,9 +1955,9 @@ interface ServiceResolutionEntry {
|
|
|
1955
1955
|
/** demand echo(OR 聚合);平台/孤儿恒 false;集成就绪判定单源(§7) */
|
|
1956
1956
|
required?: boolean;
|
|
1957
1957
|
}
|
|
1958
|
-
/** 求值完整结构(extends = 列表项 ⊂
|
|
1958
|
+
/** 求值完整结构(extends = 列表项 ⊂ 单体的编译期保证——) */
|
|
1959
1959
|
interface ServiceResolution extends ServiceResolutionEntry {
|
|
1960
|
-
/**
|
|
1960
|
+
/** 枚举规则(全实例逐一;默认实例求值 = 摘要基,不重复头部) */
|
|
1961
1961
|
instances: ResolvedInstance[];
|
|
1962
1962
|
inheritance: Array<{
|
|
1963
1963
|
layer: BindingLayer;
|
|
@@ -1990,7 +1990,7 @@ interface AppIntegrationNode {
|
|
|
1990
1990
|
}
|
|
1991
1991
|
/** AppIntegrationNode 键集单源(runtime const——write applyApp 全量替换白名单
|
|
1992
1992
|
* (缺席根键删除;services/modules 域不在其中;v6 domains 键退役)+ views/app 投影
|
|
1993
|
-
* (GET 预填 ≡ PUT body
|
|
1993
|
+
* (GET 预填 ≡ PUT body,/L1——文件含 services/modules 但 root 节点投影只含本键集)) */
|
|
1994
1994
|
declare const APP_INTEGRATION_NODE_KEYS: readonly ["provider", "config", "configByInstance", "credentialRef", "credentialRefByInstance", "instances", "defaultInstanceId"];
|
|
1995
1995
|
/** 模块集成位节点(v6——provider 绑定默认 + config 级联层;resources 不投影不写——
|
|
1996
1996
|
* 集成位编辑恒保全资源节,N2) */
|
|
@@ -2021,7 +2021,7 @@ interface ModuleResourceEcho {
|
|
|
2021
2021
|
type ModuleResourcesEcho = Record<string, ModuleResourceEcho>;
|
|
2022
2022
|
/** services[s] 整节点 */
|
|
2023
2023
|
interface ServiceIntegrationNode {
|
|
2024
|
-
/** 对象 = 自定义 API
|
|
2024
|
+
/** 对象 = 自定义 API(仅槽级) */
|
|
2025
2025
|
provider?: string | InlineVendorDeclaration;
|
|
2026
2026
|
/** 内联 provider 时必填 */
|
|
2027
2027
|
implementation?: string;
|
|
@@ -2090,7 +2090,7 @@ interface ProviderDetail {
|
|
|
2090
2090
|
/** 服务展示名(resolveServiceDisplay——词汇 > demand > id;恒发) */
|
|
2091
2091
|
name?: string;
|
|
2092
2092
|
description?: string;
|
|
2093
|
-
/** v4.4
|
|
2093
|
+
/** v4.4 include=integrationSchemas 切换态批量(纯 config——凭据结构归 /credential-types) */
|
|
2094
2094
|
integrationSchemas?: {
|
|
2095
2095
|
configSchema: object | null;
|
|
2096
2096
|
};
|
|
@@ -2105,7 +2105,7 @@ interface ProviderServiceDetail {
|
|
|
2105
2105
|
implementation: string;
|
|
2106
2106
|
credentialType: string;
|
|
2107
2107
|
}>;
|
|
2108
|
-
/** 厂商集成该服务的表单 schema(integration 域专属)——v4.4
|
|
2108
|
+
/** 厂商集成该服务的表单 schema(integration 域专属)——v4.4 纯 config(credentialSchema 删净) */
|
|
2109
2109
|
integrationSchemas: {
|
|
2110
2110
|
/** raw draft 2020-12 原文零转换;供给在场未声明 = null(mock 合法);解析自默认 impl */
|
|
2111
2111
|
configSchema: object | null;
|
|
@@ -2203,11 +2203,11 @@ declare function loadModulesView(snapshot: ViewSnapshot, opts?: {
|
|
|
2203
2203
|
declare function loadModuleDetailView(snapshot: ViewSnapshot, moduleId: string): ModuleDetailView;
|
|
2204
2204
|
|
|
2205
2205
|
/**
|
|
2206
|
-
* 应用静态投影(views/app;C4;FX-1c B10——root 节点投影修;v4.4
|
|
2206
|
+
* 应用静态投影(views/app;C4;FX-1c B10——root 节点投影修;v4.4——services 双端点同型)。
|
|
2207
2207
|
* /app = 平台服务 + root 节点原值(纯静态):services = 服务词汇 − 模块占用
|
|
2208
|
-
* (ServiceDemand[]——平台条目 required 恒 false、name/description
|
|
2208
|
+
* (ServiceDemand[]——平台条目 required 恒 false、name/description 缺席);
|
|
2209
2209
|
* 平台服务状态不在此(→ /service-resolutions);模块服务不在此(→ /modules/:m)。
|
|
2210
|
-
* integration = **root 节点投影**(APP_INTEGRATION_NODE_KEYS
|
|
2210
|
+
* integration = **root 节点投影**(APP_INTEGRATION_NODE_KEYS——/L1:GET 预填 ≡ PUT body;
|
|
2211
2211
|
* 文件另含 services/modules 域键,不进 root 节点投影——原实现整文件透传,
|
|
2212
2212
|
* PUT 回会级联写回域键);文件缺席 = null,文件在场 → 投影对象(可为空)。
|
|
2213
2213
|
*/
|
|
@@ -2215,68 +2215,68 @@ declare function loadAppView(snapshot: ViewSnapshot): AppView;
|
|
|
2215
2215
|
|
|
2216
2216
|
/**
|
|
2217
2217
|
* 服务静态单体投影(views/service-detail;C4)。求值数据不在此(→ /service-resolutions/:service)。
|
|
2218
|
-
* SERVICE_NOT_FOUND 判据 = 服务词汇 ∪
|
|
2218
|
+
* SERVICE_NOT_FOUND 判据 = 服务词汇 ∪ 已配置(——词汇成员零 demand/供给/config 仍 200)。
|
|
2219
2219
|
*/
|
|
2220
2220
|
declare function loadServiceDetailView(snapshot: ViewSnapshot, service: string): ServiceDetail;
|
|
2221
2221
|
|
|
2222
2222
|
/**
|
|
2223
|
-
* 供给轴投影(views/providers;C4
|
|
2223
|
+
* 供给轴投影(views/providers;C4)。供给关系三切片:
|
|
2224
2224
|
* 名单 = /providers(基本信息)· 足迹 = /providers/:p(implementations[] 保真)·
|
|
2225
|
-
* 表单 = /providers/:p/services/:s(组合单体——schema
|
|
2225
|
+
* 表单 = /providers/:p/services/:s(组合单体——schema 唯一暴露面)。
|
|
2226
2226
|
* 静态端点零求值(铁律 #3)。
|
|
2227
2227
|
*/
|
|
2228
2228
|
/** GET /providers:厂商基本信息(供给足迹不在本端点 → /providers/:p) */
|
|
2229
2229
|
declare function loadProvidersView(snapshot: ViewSnapshot): ProvidersView;
|
|
2230
2230
|
/** GET /providers/:provider:供给足迹(implementations 恒数组——H1 多实现钉版数据源;
|
|
2231
|
-
* v4.4
|
|
2231
|
+
* v4.4 include=integrationSchemas 切换态批量——services[s] += { configSchema }(纯 config)) */
|
|
2232
2232
|
declare function loadProviderDetailView(snapshot: ViewSnapshot, provider: string, include?: ReadonlySet<string>): ProviderDetail;
|
|
2233
|
-
/** 组合单体(GET /providers/:p/services/:s):catalog
|
|
2233
|
+
/** 组合单体(GET /providers/:p/services/:s):catalog 供给与槽级内联声明统一解析(/) */
|
|
2234
2234
|
declare function loadProviderServiceDetailView(snapshot: ViewSnapshot, provider: string, service: string): ProviderServiceDetail;
|
|
2235
2235
|
|
|
2236
|
-
/**
|
|
2236
|
+
/** 单源摘要函数:/service-resolutions map 值 ≡ /service-resolutions/:s 的 resolution 摘要基 */
|
|
2237
2237
|
declare function resolveServiceSummary(service: string, snapshot: ViewSnapshot): ServiceResolutionEntry;
|
|
2238
2238
|
/** 批量求值(键集 = resolutionKeys 单源:词汇 ∪ 需求侧 ∪ 已配置 ∪ 归属;?service= 过滤语义——未知键缺席;issues 恒全量) */
|
|
2239
2239
|
declare function loadServiceResolutionsView(snapshot: ViewSnapshot, issues: IntegrationIssue[], filter?: string[]): ServiceResolutionsView;
|
|
2240
|
-
/** 求值单体(完整结构 instances + inheritance + 过滤 issues;
|
|
2240
|
+
/** 求值单体(完整结构 instances + inheritance + 过滤 issues; extends 结构保证) */
|
|
2241
2241
|
declare function loadServiceResolutionDetail(service: string, snapshot: ViewSnapshot, allIssues: IntegrationIssue[]): ServiceResolutionDetail;
|
|
2242
2242
|
|
|
2243
2243
|
/**
|
|
2244
|
-
* 层级/服务级 config schema 计算视图(v4.4
|
|
2245
|
-
* config
|
|
2244
|
+
* 层级/服务级 config schema 计算视图(v4.4——静态轴富化,零 contracts 求值;v4.7 服务级)。
|
|
2245
|
+
* config 表单结构四形态同源:槽级组合单体(providers.ts)/ 层级内嵌(本文件——
|
|
2246
2246
|
* /app、/modules/:m include)/ 供给轴批量(providers.ts include——切换态)/ 服务级生效绑定
|
|
2247
2247
|
* (本文件 loadServiceIntegrationSchemas——/services/:s include)。
|
|
2248
2248
|
*
|
|
2249
|
-
*
|
|
2249
|
+
* 计算规则(裁决):禁交集——config 五层浅合并下「部分服务认识的字段」合法(谓词 #7
|
|
2250
2250
|
* 并集键集同依据);禁合成单一 schema——required/title 冲突的有损代数;产物 = 扁平映射,
|
|
2251
|
-
* 分组归客户端纯呈现。层级 schema =
|
|
2251
|
+
* 分组归客户端纯呈现。层级 schema = 表单引导**非写入门禁**(——写路径校验权威恒在谓词
|
|
2252
2252
|
* #7 键集 + ajv 凭据链;root 级口径差:#7 = 引用厂商并集,表单 = 层生效厂商单厂商作用域)。
|
|
2253
2253
|
*
|
|
2254
|
-
* v4.6(
|
|
2254
|
+
* v4.6(additive 精化):**原始投影**(loadApp/loadModuleIntegrationSchemas)原样保留
|
|
2255
2255
|
* 为诊断面 / registry 输入;**消费投影** = buildIntegrationFieldRegistry(字段级合并代数
|
|
2256
|
-
*
|
|
2256
|
+
* ——服务端单源,conflict 折叠 schema:null);**轴向假想绑定** = formProviderOf
|
|
2257
2257
|
* (override ?? 实际解析——双投影同源同口径,formViews 装配层一次计算两投影)。
|
|
2258
2258
|
* 单源三锚:层级 schema 计算 = resolveLayerIntegrationSchemas / 生效厂商解析 = formProviderOf /
|
|
2259
2259
|
* 合并代数 = buildIntegrationFieldRegistry。
|
|
2260
2260
|
*/
|
|
2261
2261
|
/** 核心纯函数:显式作用域(provider null → 整字段 null;services 逐项 resolveServiceConfigSchema
|
|
2262
|
-
* 复合解析——v4.7
|
|
2262
|
+
* 复合解析——v4.7 收口,零新读取路径;供给在场未声明 = null,mock 合法) */
|
|
2263
2263
|
declare function resolveLayerIntegrationSchemas(snapshot: ViewSnapshot, provider: string, services: readonly string[]): LayerIntegrationSchemas;
|
|
2264
2264
|
declare function resolveLayerIntegrationSchemas(snapshot: ViewSnapshot, provider: string | null, services: readonly string[]): LayerIntegrationSchemas | null;
|
|
2265
|
-
/**
|
|
2266
|
-
* fields 收集零过滤(布尔/非对象子 schema 入列,判定全权归 mergeFieldSources——
|
|
2265
|
+
/** registry 构造(纯函数——消费 resolveLayerIntegrationSchemas 产物,禁旁路直取 serviceSchemas)。
|
|
2266
|
+
* fields 收集零过滤(布尔/非对象子 schema 入列,判定全权归 mergeFieldSources—— 互证等式由
|
|
2267
2267
|
* 收集定义结构性闭合);schemaless 仅 configSchema === null(布尔/畸形整 schema 防御跳过——
|
|
2268
|
-
* 不入 schemaless、零参与聚合;
|
|
2268
|
+
* 不入 schemaless、零参与聚合; 运行时畸形,非契约面)。 */
|
|
2269
2269
|
declare function buildIntegrationFieldRegistry(layer: LayerIntegrationSchemas, o?: {
|
|
2270
2270
|
unsupplied?: string[];
|
|
2271
2271
|
}): IntegrationFieldRegistryView;
|
|
2272
|
-
/**
|
|
2272
|
+
/** 生效厂商解析单源(实际/假想同径):override(非空串)?? 实际解析。
|
|
2273
2273
|
* 空串归一(I3)单点;module 轴 v6 零归属 → null(override 不豁免——预览服务于保存)。 */
|
|
2274
2274
|
declare function formProviderOf(axis: 'app' | 'module', snapshot: ViewSnapshot, moduleId?: string, override?: string): string | null;
|
|
2275
2275
|
/** app 级 loader(v4.6 委托化——签名零改动,公开面保持;假想态归 loadAppFormViews override 参) */
|
|
2276
2276
|
declare function loadAppIntegrationSchemas(snapshot: ViewSnapshot): LayerIntegrationSchemas | null;
|
|
2277
2277
|
/** module 级 loader(v4.6 委托化——同上;多域/零域/共享键/未绑定 → 整字段 null,表单降级 = ExtraFields) */
|
|
2278
2278
|
declare function loadModuleIntegrationSchemas(snapshot: ViewSnapshot, moduleId: string): LayerIntegrationSchemas | null;
|
|
2279
|
-
/** 服务级 loader(v4.7
|
|
2279
|
+
/** 服务级 loader(v4.7):四分支穷举(node.provider = 文件 services[s].provider 逐字原值;
|
|
2280
2280
|
* 实例层无条件排除——node 级口径);非空三分支归约一次复合解析。
|
|
2281
2281
|
* ① undefined/'' → 模块级联(v6:modules[ownerOf[s]] → root 双缺 → 整字段 null)
|
|
2282
2282
|
* ② 非空 string → bare:catalog miss(未知厂商/未供给)→ configSchema:null 不 404(富化非门控)
|
|
@@ -2284,23 +2284,23 @@ declare function loadModuleIntegrationSchemas(snapshot: ViewSnapshot, moduleId:
|
|
|
2284
2284
|
* (H9 逃逸 400 照抛——readInlineSchema 共享路径)
|
|
2285
2285
|
* ④ 其余(null/数组/原始值/坏对象)→ 整字段 null(≡ 谓词 #5 INLINE_PROVIDER_INVALID 同判——
|
|
2286
2286
|
* 不放行域级联,防错误 schema 污染坏节点)
|
|
2287
|
-
* v5.1
|
|
2287
|
+
* v5.1 serviceProvider = 服务轴向假想绑定(缺席/空串 ≡ 按实际解析——I3 归一单点在此头部,
|
|
2288
2288
|
* registry 侧不重复归一);非空轴参 → 短路 bare 解析(镜像 formProviderOf「输入替换非分支复制」先例:
|
|
2289
2289
|
* 任一原分支改写 provider 为 X 后实读都进 bare 分支,同构承诺 by construction)。短路在节点读取之前——
|
|
2290
|
-
*
|
|
2290
|
+
* 豁免链三分支(与 四分支的有意分歧:预览与坏文件解耦):malformed(分支④)不污染假想 /
|
|
2291
2291
|
* 内联 ref 不读取(假想态无 H9 逃逸 400;catalog 命中的 manifest 声明路径照读,与节点声明的
|
|
2292
2292
|
* 用户可控路径不同性)/ 全链未绑定时假想仍非 null(服务轴恒可写,无 module 轴零归属对应物)。 */
|
|
2293
2293
|
declare function loadServiceIntegrationSchemas(snapshot: ViewSnapshot, service: string, serviceProvider?: string): ServiceIntegrationSchemas | null;
|
|
2294
|
-
/** G
|
|
2294
|
+
/** G 批:服务轴字段注册表(四分支链复用——消费 loadServiceIntegrationSchemas 单源;
|
|
2295
2295
|
* 伪层 {provider, services: {[s]: {configSchema}}} → buildIntegrationFieldRegistry——
|
|
2296
2296
|
* fields = 该 schema 全部字段带 global 旗标;configSchema null → schemaless=[service]
|
|
2297
|
-
* 非 null 空集;schemas 整体 null(全链未绑定/坏节点)→ registry null——镜像
|
|
2298
|
-
* v5.1
|
|
2297
|
+
* 非 null 空集;schemas 整体 null(全链未绑定/坏节点)→ registry null——镜像 语义)。
|
|
2298
|
+
* v5.1 serviceProvider = 服务轴向假想绑定,纯透传(I1 单源——归一与短路都在链函数头部;
|
|
2299
2299
|
* 轴参仅重定向表单层投影,global 旗标全量透传语义不变)。 */
|
|
2300
2300
|
declare function loadServiceFieldRegistry(snapshot: ViewSnapshot, service: string, serviceProvider?: string): IntegrationFieldRegistryView | null;
|
|
2301
2301
|
|
|
2302
2302
|
/**
|
|
2303
|
-
* 凭据状态轴投影(views/credentials;v4.4
|
|
2303
|
+
* 凭据状态轴投影(views/credentials;v4.4 独立端点 GET /credentials):
|
|
2304
2304
|
* 绑定位全量掩码回显——应用状态轴(随配置失效、零求值零 contracts、永不 503)。
|
|
2305
2305
|
* GET 永无真值(仅 ref/masked);掩码单源 maskCredentialValues;echoForRef 自
|
|
2306
2306
|
* service-resolutions 迁入共享(求值单体 instances[].credential 已删净——求值路径零凭据 I/O)。
|
|
@@ -2309,14 +2309,14 @@ declare function loadServiceFieldRegistry(snapshot: ViewSnapshot, service: strin
|
|
|
2309
2309
|
* app.byInstance = 注册表 ids ∩ 有 ref(无 ref 的注册实例不出现;未注册 ref 跳过不虚报)
|
|
2310
2310
|
* services[s].byInstance = 节点 instances map 全键(含 '*',无 ref 亦在场 → null)
|
|
2311
2311
|
* null 语义:credential/byInstance 值 = 「未就绪」(ref 缺席或文件缺失)——缺失诊断归谓词 #1
|
|
2312
|
-
* (CREDENTIAL_FILE_MISSING),echo = 状态回显、issues =
|
|
2312
|
+
* (CREDENTIAL_FILE_MISSING),echo = 状态回显、issues = 诊断定位(分工)。
|
|
2313
2313
|
*/
|
|
2314
2314
|
/** 凭据文件掩码回显(ref 非 secret:// 或文件缺席 → undefined——调用方映射 null) */
|
|
2315
2315
|
declare function echoForRef(appDir: string, ref: string | undefined): CredentialEcho | undefined;
|
|
2316
2316
|
declare function loadCredentialsView(snapshot: ViewSnapshot): CredentialsView;
|
|
2317
2317
|
|
|
2318
2318
|
/**
|
|
2319
|
-
* 供给轴凭据结构清单(views/credential-types;v4.4
|
|
2319
|
+
* 供给轴凭据结构清单(views/credential-types;v4.4 独立端点 GET /credential-types[?provider=]):
|
|
2320
2320
|
* 结构按 credentialType 键(wanda 全部槽共享同一 type 同一 schema 文件——(provider, service)
|
|
2321
2321
|
* 组合寻址是错位键);源 = catalog.credentialTypes(既有聚合产物零新读取路径,聚合条目携
|
|
2322
2322
|
* packageDir 供 schema 文件解析)。静态轴(稳定可缓存、永不 503)。
|
|
@@ -2328,8 +2328,8 @@ declare function loadCredentialTypesView(snapshot: ViewSnapshot, provider?: stri
|
|
|
2328
2328
|
/**
|
|
2329
2329
|
* createAppToolkit(C4 工厂;v4.4——24 方法 = 11 读(含 credentials/credential-types 双端点)
|
|
2330
2330
|
* + 4 写 + 9 迁移面;loadApp/loadModule/loadProvider 增 include 选项;v4.6——loadApp/loadModule
|
|
2331
|
-
* += 轴向假想绑定选项(appProvider/moduleProvider
|
|
2332
|
-
* v4.7——loadService 增 include 选项(服务级生效绑定 schema 单体);v5.1
|
|
2331
|
+
* += 轴向假想绑定选项(appProvider/moduleProvider);表单双投影经 formViews 单点装配;
|
|
2332
|
+
* v4.7——loadService 增 include 选项(服务级生效绑定 schema 单体);v5.1——loadService
|
|
2333
2333
|
* += serviceProvider 轴参(服务轴向假想绑定,三轴收口))。
|
|
2334
2334
|
* AppToolkit = AppToolkitRead & AppToolkitWrite & AppToolkitInternals——
|
|
2335
2335
|
* Read+Write = HTTP 直通面 additive 冻结(L1 端点↔方法 1:1,L3 命名镜像:Integration=节点级 /
|
|
@@ -2339,12 +2339,12 @@ declare function loadCredentialTypesView(snapshot: ViewSnapshot, provider?: stri
|
|
|
2339
2339
|
* ensureMockBindings / writeIntegrationsConfig / evaluateIntegrationServices 入口
|
|
2340
2340
|
* assertContractsUsable——strictValidation === false → 503 CONTRACTS_NOT_RESOLVED;静态方法不门控
|
|
2341
2341
|
* (永不 503——铁律 #3);**读求值轴(loadServiceResolutions/loadServiceResolution 及 include 装配)
|
|
2342
|
-
* v7 起不再 503**——contracts 不可用 → 200 降级骨架(evaluation-unavailable,doctor 分级/
|
|
2342
|
+
* v7 起不再 503**——contracts 不可用 → 200 降级骨架(evaluation-unavailable,doctor 分级/ 先例
|
|
2343
2343
|
* 对齐;依据链与裁决见 Agent Note evaluation-axis-degrade);**include 装配为条件分支非门控**
|
|
2344
|
-
* (
|
|
2344
|
+
* (null 分支退役——三条件门 + 内嵌轴同步降级,四面统一骨架);integrations/ views/ 机制层保持纯函数。
|
|
2345
2345
|
*
|
|
2346
|
-
* 并发:进程内写串行(per-factory promise chain)+ 原子写 +
|
|
2347
|
-
* onApplied
|
|
2346
|
+
* 并发:进程内写串行(per-factory promise chain)+ 原子写 + 写后本实例缓存即刻失效。
|
|
2347
|
+
* onApplied:toolkit 判定「需要重启」(实际落盘且非 dryRun/no-diff)→ 调用一次 +
|
|
2348
2348
|
* restartScheduled 回填——通知闭包非控制,执行者恒为宿主 RunManager;CLI 不传恒 false。
|
|
2349
2349
|
*/
|
|
2350
2350
|
interface AppToolkitOptions {
|
|
@@ -2359,18 +2359,18 @@ interface AppToolkitRead {
|
|
|
2359
2359
|
loadModules(o?: {
|
|
2360
2360
|
includeHidden?: boolean;
|
|
2361
2361
|
}): Promise<ModulesView>;
|
|
2362
|
-
/** v4.6
|
|
2362
|
+
/** v4.6 moduleProvider = 轴向假想绑定(缺席/空串 ≡ 按实际配置解析;需与表单 include 键同现)。
|
|
2363
2363
|
* moduleId = 双键(id 优先、唯一展示名兜底)。 */
|
|
2364
2364
|
loadModule(moduleId: string, o?: {
|
|
2365
2365
|
include?: string[];
|
|
2366
2366
|
moduleProvider?: string;
|
|
2367
2367
|
}): Promise<ModuleDetailView>;
|
|
2368
|
-
/** v4.6
|
|
2368
|
+
/** v4.6 appProvider = 轴向假想绑定(缺席/空串 ≡ 按实际配置解析;需与表单 include 键同现) */
|
|
2369
2369
|
loadApp(o?: {
|
|
2370
2370
|
include?: string[];
|
|
2371
2371
|
appProvider?: string;
|
|
2372
2372
|
}): Promise<AppView>;
|
|
2373
|
-
/** v5.1
|
|
2373
|
+
/** v5.1 serviceProvider = 服务轴向假想绑定(缺席/空串 ≡ 按实际配置解析;需与表单 include
|
|
2374
2374
|
* 键同现)——假想重定向仅表单双投影,integration/suppliedBy/defaults 恒实际态(I2) */
|
|
2375
2375
|
loadService(service: string, o?: {
|
|
2376
2376
|
include?: string[];
|
|
@@ -2383,9 +2383,9 @@ interface AppToolkitRead {
|
|
|
2383
2383
|
include?: string[];
|
|
2384
2384
|
}): Promise<ProviderDetail>;
|
|
2385
2385
|
loadProviderService(provider: string, service: string): Promise<ProviderServiceDetail>;
|
|
2386
|
-
/** GET /credentials(v4.4
|
|
2386
|
+
/** GET /credentials(v4.4——应用状态轴;零门控,永不 503) */
|
|
2387
2387
|
loadCredentials(): Promise<CredentialsView>;
|
|
2388
|
-
/** GET /credential-types[?provider=](v4.4
|
|
2388
|
+
/** GET /credential-types[?provider=](v4.4——供给轴静态;零门控,永不 503) */
|
|
2389
2389
|
loadCredentialTypes(provider?: string): Promise<CredentialTypesView>;
|
|
2390
2390
|
}
|
|
2391
2391
|
/** ── HTTP 直通面(4 写;body ≡ 文件节点全量替换;DELETE 无 dryRun/无 options)──
|