@tbox.cn/app-toolkit 0.1.0 → 0.3.0
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/README.md +2 -2
- package/dist/{chunk-VV3ERZXS.js → chunk-KPD3LUH4.js} +1 -1
- package/dist/contracts-resolver-E4SECBOG.js +1 -0
- package/dist/index.d.ts +234 -43
- package/dist/index.js +8 -8
- package/package.json +2 -2
- package/src/assembly/app-manifest.ts +6 -0
- package/src/assembly/provider-catalog.ts +6 -1
- package/src/assembly/walk-manifests.ts +2 -1
- package/src/core/contracts-resolver.ts +3 -2
- package/src/core/credential-format.ts +4 -2
- package/src/core/errors.ts +9 -3
- package/src/dto.ts +127 -15
- package/src/factory.ts +129 -16
- package/src/index.ts +15 -4
- package/src/integrations/credentials.ts +1 -1
- package/src/integrations/domain-binding.ts +81 -0
- package/src/integrations/predicate.ts +7 -6
- package/src/integrations/read.ts +23 -3
- package/src/integrations/write.ts +93 -34
- package/src/views/app.ts +7 -5
- package/src/views/context.ts +3 -6
- package/src/views/credential-types.ts +28 -0
- package/src/views/credentials.ts +57 -0
- package/src/views/integration-schemas.ts +226 -0
- package/src/views/modules.ts +33 -14
- package/src/views/providers.ts +37 -22
- package/src/views/service-detail.ts +3 -4
- package/src/views/service-resolutions.ts +31 -25
- package/tests/credentials-view.test.ts +152 -0
- package/tests/demo-app.ts +14 -1
- package/tests/file-cache.test.ts +3 -1
- package/tests/naming-alignment.test.ts +8 -5
- package/tests/vendor-schema-keywords.test.ts +101 -0
- package/tests/views.test.ts +1285 -13
- package/tests/write-core.test.ts +107 -8
- package/dist/contracts-resolver-QM4FBQQV.js +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @tbox.cn/app-toolkit
|
|
2
2
|
|
|
3
|
-
tbox 应用**工具面**包(与 `@tbox.cn/app-sdk` 运行面/工具面对仗:sdk 给运行的应用用,toolkit 给操作应用的工具用——
|
|
3
|
+
tbox 应用**工具面**包(与 `@tbox.cn/app-sdk` 运行面/工具面对仗:sdk 给运行的应用用,toolkit 给操作应用的工具用——24 个工厂方法全部以 appDir 为首参(v4.4))。
|
|
4
4
|
|
|
5
5
|
模块解析、集成配置求值/校验/写入内核。**contracts 求值与校验语义由应用自己的 `@tbox.cn/app-contracts` 版本动态驱动**(`core/contracts-resolver`)——沙箱镜像内 toolkit 与目标应用版本节奏解耦,呈现给用户的求值结果与写出的文件恒由应用自身 contracts 求值/校验。
|
|
6
6
|
|
|
@@ -41,7 +41,7 @@ views/ 视图装配:modules / app / service-detail / service-resolutio
|
|
|
41
41
|
| 层 | 载体 | 覆盖 |
|
|
42
42
|
|---|---|---|
|
|
43
43
|
| ① src 态守卫 | `tests/error-name-safety.test.ts` + 全测试矩阵(随 `pnpm -r test` 进根 verify 链) | 导出面/字面量约定/行为矩阵 |
|
|
44
|
-
| ② minified dist 冒烟 | `pnpm --filter @tbox.cn/app-toolkit smoke:dist`(`scripts/smoke-dist.mjs`——纯 node:
|
|
44
|
+
| ② minified dist 冒烟 | `pnpm --filter @tbox.cn/app-toolkit smoke:dist`(`scripts/smoke-dist.mjs`——纯 node:24 方法 typeof + AppToolkitError.name + resolver 命中 + file-cache 快测) | dist 产物直调(mangle 后) |
|
|
45
45
|
| ③ 发布形态门禁 | `pnpm --filter @tbox.cn/app-toolkit pack --check`(prepack 内建 build,tgz 内即 minified dist) | 打包完整性 |
|
|
46
46
|
| ④ 跨仓 file: tgz 联调 | agtcodingbox 联调(`file:` tgz 消费——真实宿主) | 消费面全链路 |
|
|
47
47
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as l,readdirSync as F,realpathSync as m}from"fs";import{join as c}from"path";import{pathToFileURL as w}from"url";import{existsSync as T,readFileSync as k,statSync as x}from"fs";function p(){let e=new Map,n=0;function r(t){if(!T(t))return null;let i=x(t);return`${i.mtimeMs}:${i.size}`}return{read(t,i){let o=r(t);if(o===null){e.delete(t);return}let s=e.get(t);if(s&&s.fingerprint===o)return s.value;n+=1;let a=i(k(t,"utf8"));return e.set(t,{fingerprint:o,value:a}),a},invalidate(t){if(t===void 0){e.clear();return}for(let i of t)e.delete(i)},get parseCount(){return n}}}var g=["resolveEffectiveService","buildSupplyLookup","moduleDomainOf","normalizeInstances","RESOURCE_TYPE_IDS"],M="parseIntegrationsConfig",v={version:null,evaluation:!1,strictValidation:!1,module:{},notes:[]};function C(e){let n=[e];for(let r of["apps","packages"]){let t=c(e,r);if(!l(t))continue;let i=F(t,{withFileTypes:!0}).filter(o=>o.isDirectory()).map(o=>o.name);r==="apps"?i.sort((o,s)=>o==="server"?-1:s==="server"?1:o.localeCompare(s)):i.sort((o,s)=>o.localeCompare(s));for(let o of i)n.push(c(t,o))}return n}var d=new Map,h=p();function y(e){return h.read(e,n=>{let r=JSON.parse(n);return typeof r.version=="string"?r.version:null})??null}function b(e){if(!l(e))return"gone";let n;try{n=m(e)}catch{n=e}return l(c(n,"dist","runtime.js"))?"dist":l(c(n,"src","runtime.ts"))?"src":"none"}function R(e){let n=c(e,"package.json");return{pkgPath:n,candidateDir:e,version:y(n),artifact:b(e)}}function E(e){for(let n of C(e)){let r=c(n,"node_modules","@tbox.cn","app-contracts"),t=c(r,"package.json");if(l(t))return{pkgPath:t,candidateDir:r,version:y(t),artifact:b(r)}}return null}function u(e){return e===null?"none":`${e.pkgPath}|${e.version??"null"}|${e.artifact}`}function $(e,n){let r=E(e);if(u(r)!==u(n.first))return!1;if(n.resolved===null)return!0;let t=r!==null&&r.candidateDir===n.resolved.candidateDir?r:R(n.resolved.candidateDir);return u(t)===u(n.resolved)}async function O(e,n){if(!l(e))return null;let r;try{r=m(e)}catch{return null}let i=[c(r,"dist","runtime.js"),c(r,"src","runtime.ts")].find(s=>l(s)),o=h.read(c(e,"package.json"),s=>{let a=JSON.parse(s);return typeof a.version=="string"?a.version:null})??null;if(i===void 0)return n.push(`contracts ${o??"(版本未知)"} 探测命中但无构建产物(dist/runtime.js 缺失)——workspace 源码态未构建:执行 pnpm --filter @tbox.cn/app-contracts build 后重试`),null;try{let s=o!==null?`?v=${encodeURIComponent(o)}`:"",a=await import(w(i).href+s),f=g.every(S=>a[S]!==void 0),P=a[M]!==void 0;return{version:o,evaluation:f,strictValidation:P,module:a,notes:f?[]:[`${i} 命中但求值面具名导出缺席(${g.join("/")})——契约包形态异常`]}}catch(s){return n.push(`contracts ${o??"(版本未知)"} 构建产物导入失败(${s instanceof Error?s.message:String(s)})——workspace 源码态未构建或产物损坏:执行 pnpm --filter @tbox.cn/app-contracts build 后重试`),null}}function U(e){let n=d.get(e);if(n&&$(e,n))return n.promise;let r=E(e),t={promise:Promise.resolve({...v}),first:r,resolved:r};return t.promise=(async()=>{let i=[];for(let o of C(e)){let s=c(o,"node_modules","@tbox.cn","app-contracts"),a=await O(s,i);if(a)return a.version!==null&&!a.strictValidation&&a.notes.push(`contracts ${a.version} 无严格校验面(需 ≥0.9)——升级应用 @tbox.cn/app-contracts 依赖后可用`),t.resolved=R(s),a}return t.resolved=null,i.length===0&&i.push("contracts 不可解析(未安装)——检查应用依赖安装后重试"),{...v,notes:i}})(),d.set(e,t),t.promise}function L(e){e===void 0?d.clear():d.delete(e)}export{p as a,U as b,L as c};
|
|
1
|
+
import{existsSync as l,readdirSync as F,realpathSync as m}from"fs";import{join as c}from"path";import{pathToFileURL as w}from"url";import{existsSync as T,readFileSync as k,statSync as x}from"fs";function p(){let e=new Map,n=0;function r(t){if(!T(t))return null;let i=x(t);return`${i.mtimeMs}:${i.size}`}return{read(t,i){let o=r(t);if(o===null){e.delete(t);return}let s=e.get(t);if(s&&s.fingerprint===o)return s.value;n+=1;let a=i(k(t,"utf8"));return e.set(t,{fingerprint:o,value:a}),a},invalidate(t){if(t===void 0){e.clear();return}for(let i of t)e.delete(i)},get parseCount(){return n}}}var g=["resolveEffectiveService","buildSupplyLookup","moduleDomainOf","normalizeInstances","RESOURCE_TYPE_IDS"],M="parseIntegrationsConfig",v={version:null,evaluation:!1,strictValidation:!1,module:{},notes:[]};function C(e){let n=[e];for(let r of["apps","packages"]){let t=c(e,r);if(!l(t))continue;let i=F(t,{withFileTypes:!0}).filter(o=>o.isDirectory()).map(o=>o.name);r==="apps"?i.sort((o,s)=>o==="server"?-1:s==="server"?1:o.localeCompare(s)):i.sort((o,s)=>o.localeCompare(s));for(let o of i)n.push(c(t,o))}return n}var d=new Map,h=p();function y(e){return h.read(e,n=>{let r=JSON.parse(n);return typeof r.version=="string"?r.version:null})??null}function b(e){if(!l(e))return"gone";let n;try{n=m(e)}catch{n=e}return l(c(n,"dist","runtime.js"))?"dist":l(c(n,"src","runtime.ts"))?"src":"none"}function R(e){let n=c(e,"package.json");return{pkgPath:n,candidateDir:e,version:y(n),artifact:b(e)}}function E(e){for(let n of C(e)){let r=c(n,"node_modules","@tbox.cn","app-contracts"),t=c(r,"package.json");if(l(t))return{pkgPath:t,candidateDir:r,version:y(t),artifact:b(r)}}return null}function u(e){return e===null?"none":`${e.pkgPath}|${e.version??"null"}|${e.artifact}`}function $(e,n){let r=E(e);if(u(r)!==u(n.first))return!1;if(n.resolved===null)return!0;let t=r!==null&&r.candidateDir===n.resolved.candidateDir?r:R(n.resolved.candidateDir);return u(t)===u(n.resolved)}async function O(e,n){if(!l(e))return null;let r;try{r=m(e)}catch{return null}let i=[c(r,"dist","runtime.js"),c(r,"src","runtime.ts")].find(s=>l(s)),o=h.read(c(e,"package.json"),s=>{let a=JSON.parse(s);return typeof a.version=="string"?a.version:null})??null;if(i===void 0)return n.push(`contracts ${o??"(版本未知)"} 探测命中但无构建产物(dist/runtime.js 缺失)——workspace 源码态未构建:执行 pnpm --filter @tbox.cn/app-contracts build 后重试`),null;try{let s=o!==null?`?v=${encodeURIComponent(o)}`:"",a=await import(w(i).href+s),f=g.every(S=>a[S]!==void 0),P=a[M]!==void 0;return{version:o,evaluation:f,strictValidation:P,module:a,notes:f?[]:[`${i} 命中但求值面具名导出缺席(${g.join("/")})——契约包形态异常`]}}catch(s){return n.push(`contracts ${o??"(版本未知)"} 构建产物导入失败(${s instanceof Error?s.message:String(s)})——workspace 源码态未构建或产物损坏:执行 pnpm --filter @tbox.cn/app-contracts build 后重试`),null}}function U(e){let n=d.get(e);if(n&&$(e,n))return n.promise;let r=E(e),t={promise:Promise.resolve({...v}),first:r,resolved:r};return t.promise=(async()=>{let i=[];for(let o of C(e)){let s=c(o,"node_modules","@tbox.cn","app-contracts"),a=await O(s,i);if(a)return a.version!==null&&!a.strictValidation&&a.notes.push(`contracts ${a.version} 无严格校验面(需 ≥0.9.0)——升级应用 @tbox.cn/app-contracts 依赖后可用`),t.resolved=R(s),a}return t.resolved=null,i.length===0&&i.push("contracts 不可解析(未安装)——检查应用依赖安装后重试"),{...v,notes:i}})(),d.set(e,t),t.promise}function L(e){e===void 0?d.clear():d.delete(e)}export{p as a,U as b,L as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as a,c as b}from"./chunk-KPD3LUH4.js";export{b as invalidateContractsResolver,a as resolveContractsForApp};
|
package/dist/index.d.ts
CHANGED
|
@@ -1171,6 +1171,7 @@ interface WalkCatalog {
|
|
|
1171
1171
|
}>;
|
|
1172
1172
|
credentialTypes: Record<string, {
|
|
1173
1173
|
owner: string;
|
|
1174
|
+
packageDir: string;
|
|
1174
1175
|
credentialSchema?: string;
|
|
1175
1176
|
}>;
|
|
1176
1177
|
}
|
|
@@ -1267,6 +1268,12 @@ interface NpmModuleEntry {
|
|
|
1267
1268
|
mode: ModuleMode;
|
|
1268
1269
|
/** 3-way merge 基线(codegen 模式) */
|
|
1269
1270
|
baseVersion?: string;
|
|
1271
|
+
/**
|
|
1272
|
+
* 条目类别(单一模板统一化 W2-4):'ui-kit' = 壳 UI 组件包——create 全量继承后
|
|
1273
|
+
* 不再承担保留判据(模板 manifest = 出厂装配真源);现职 = update 三方合并锚 +
|
|
1274
|
+
* sync-agent-ui-kit 副本 identity 标记(由该脚本派生维护)。
|
|
1275
|
+
*/
|
|
1276
|
+
kind?: 'ui-kit';
|
|
1270
1277
|
}
|
|
1271
1278
|
interface AppManifest {
|
|
1272
1279
|
templateVersion: string;
|
|
@@ -1428,8 +1435,9 @@ declare function reconcileOrphanCredentials(appDir: string): OrphanIssue[];
|
|
|
1428
1435
|
* 7 严格整文档校验(contracts parseIntegrationsConfig——触发 = !noDiff ∥ 有凭据输入)
|
|
1429
1436
|
* 8 凭据工件落盘(**后置于校验通过**——防「凭据已写 + zod 拒绝」不一致态;
|
|
1430
1437
|
* dryRun → writeCredentialArtifacts 零写盘 + existsSync 预览)
|
|
1431
|
-
* 9 finalize
|
|
1432
|
-
* restartScheduled = written && onApplied(凭据影响 boot
|
|
1438
|
+
* 9 finalize(D35):planned = 将触碰(files 预览单源——dryRun 响应 ≡ 同 body 真实写,files 逐字对称);
|
|
1439
|
+
* written = 实写(!dryRun 派生,D-B2);restartScheduled = written && onApplied(凭据影响 boot 装配——
|
|
1440
|
+
* 重启正当);写后缓存失效
|
|
1433
1441
|
* 归一化:N1 模块节点 {} → 删 domains[键];N3 服务节点 {} 不归一化(显式通配激活 = 合法 TIER0 态);
|
|
1434
1442
|
* N2 已随 ?instance= 退役。dryRun(PUT only):复读完整管线不落盘不排程。
|
|
1435
1443
|
* DELETE:节点移除 + 孤儿凭据写后对账(覆盖 DELETE 与 PUT 替换两类来源,只报告不清理——D9)。
|
|
@@ -1463,14 +1471,12 @@ interface WriteCore {
|
|
|
1463
1471
|
warmup(): Promise<void>;
|
|
1464
1472
|
/** PUT /app/integration(root 节点全集) */
|
|
1465
1473
|
applyApp(node: Record<string, unknown>, opts?: WriteOptions): SaveResult;
|
|
1466
|
-
/** PUT /modules/:module/integration(domains 换算;N1 {}
|
|
1474
|
+
/** PUT /modules/:module/integration(domains 换算;N1 {} 删域键;v4.4 D34 写守卫单源) */
|
|
1467
1475
|
applyModule(moduleId: string, node: Record<string, unknown>, opts?: WriteOptions): SaveResult;
|
|
1468
|
-
/** PUT /services/:service/integration(整节点含 instances map;N3 {}
|
|
1476
|
+
/** PUT /services/:service/integration(整节点含 instances map;N3 {} 不归一化;v4.4 A2 身份判据) */
|
|
1469
1477
|
applyService(service: string, node: Record<string, unknown>, opts?: WriteOptions): SaveResult;
|
|
1470
|
-
/** DELETE /services/:service/integration
|
|
1478
|
+
/** DELETE /services/:service/integration(恒整节点;幂等仅判据内成员;无预演) */
|
|
1471
1479
|
deleteService(service: string): SaveResult;
|
|
1472
|
-
/** 模块服务域键(module → domains 键 = 服务集派生域键集 upsert 位) */
|
|
1473
|
-
moduleDomainKey(moduleId: string): string | undefined;
|
|
1474
1480
|
}
|
|
1475
1481
|
declare function createWriteCore(appDir: string, opts?: WriteCoreOptions): WriteCore;
|
|
1476
1482
|
|
|
@@ -1511,7 +1517,10 @@ declare class AppToolkitError extends Error {
|
|
|
1511
1517
|
readonly fields?: string[];
|
|
1512
1518
|
constructor(code: AppToolkitErrorCode, httpStatus: number, message: string, fields?: string[]);
|
|
1513
1519
|
}
|
|
1514
|
-
/** CONTRACTS_NOT_RESOLVED
|
|
1520
|
+
/** CONTRACTS_NOT_RESOLVED message(N1 构建指引——api.md 错误信封示例)。
|
|
1521
|
+
* P-4:notes 优先——resolver 在全部不可解析路径均已 push 携带操作指引的 notes(导入失败/
|
|
1522
|
+
* 产物缺失/未安装/<0.9 升级);现行 version===null 分支会把 notes 内细分指引吞成通用文案。
|
|
1523
|
+
* 三分支保留为兜底(防御性——正常路径 notes 恒非空)。 */
|
|
1515
1524
|
declare function contractsNotResolvedMessage(contracts: {
|
|
1516
1525
|
version: string | null;
|
|
1517
1526
|
strictValidation: boolean;
|
|
@@ -1519,7 +1528,7 @@ declare function contractsNotResolvedMessage(contracts: {
|
|
|
1519
1528
|
}): string;
|
|
1520
1529
|
|
|
1521
1530
|
/**
|
|
1522
|
-
* DTO 全量(api.md §3 字段级单源落源——
|
|
1531
|
+
* DTO 全量(api.md §3 字段级单源落源——36 类型;演进 additive-only,铁律 #8)。
|
|
1523
1532
|
* agtcodingbox / tbox-ai-coding 经 `import type` 消费(L2 DTO 单源——API 层零类型镜像)。
|
|
1524
1533
|
* 词汇七概念:app / module / service / instance / provider / integration / resolution。
|
|
1525
1534
|
* 弃用词汇清单见 api.md §3 尾(component/slot/scope/configMode/…——防复活)。
|
|
@@ -1528,40 +1537,104 @@ declare function contractsNotResolvedMessage(contracts: {
|
|
|
1528
1537
|
type ServiceStatus = 'ok' | 'service-not-configured' | 'instance-not-found' | 'instance-disabled' | 'binding-unresolved';
|
|
1529
1538
|
/** 四配置层(instance 为 map 字段层) */
|
|
1530
1539
|
type BindingLayer = 'app' | 'module' | 'service' | 'instance';
|
|
1531
|
-
/** 纯模块清单(无 services——卡片展开走 /modules/:m
|
|
1540
|
+
/** 纯模块清单(无 services——卡片展开走 /modules/:m);provider 家族包不在清单
|
|
1541
|
+
* (供给/实施载体非可配置业务模块——供给轴归 /providers;判定 = install id / 包名
|
|
1542
|
+
* basename 去 scope 后 `provider-` 前缀;已装 provider 详情 GET /modules/:m 仍 200) */
|
|
1532
1543
|
interface ModulesView {
|
|
1533
1544
|
modules: ModuleDeclaration[];
|
|
1534
1545
|
}
|
|
1535
1546
|
interface ModuleDeclaration {
|
|
1536
|
-
/** install id(packages/ 目录名 / .tbox/app.json entry.id
|
|
1547
|
+
/** install id(packages/ 目录名 / .tbox/app.json entry.id)——恒业务模块(provider 家族不在本清单) */
|
|
1537
1548
|
id: string;
|
|
1538
1549
|
/** 包名 */
|
|
1539
1550
|
name: string;
|
|
1540
1551
|
title: string;
|
|
1541
1552
|
description: string;
|
|
1542
1553
|
}
|
|
1543
|
-
/** 服务需求声明(模块 demand
|
|
1554
|
+
/** 服务需求声明(模块 demand 单元 / 平台服务条目——v4.4 D29 双端点同型;defaults 唯一落位 ServiceDetail) */
|
|
1544
1555
|
interface ServiceDemand {
|
|
1545
1556
|
service: string;
|
|
1546
1557
|
/** manifest demand meta;缺席 UI 回退 service id */
|
|
1547
1558
|
title?: string;
|
|
1548
1559
|
description?: string;
|
|
1549
|
-
/** demand optional
|
|
1560
|
+
/** demand optional === false(多模块 OR 聚合见 resolution echo;平台服务条目恒 false) */
|
|
1550
1561
|
required: boolean;
|
|
1551
1562
|
}
|
|
1552
1563
|
/** GET /modules/:module(模块静态一站式 · PUT 读对偶) */
|
|
1553
1564
|
interface ModuleDetailView {
|
|
1554
|
-
/**
|
|
1565
|
+
/** v4.4 D34:demand 服务首段去重(排序;1..N;零域 = []) */
|
|
1566
|
+
domainKeys: string[];
|
|
1567
|
+
/** domains[换算键] 节点原值;未配置 = null;v4.4 D34:仅单域(writable)时在场——多域/零域/共享键无单键落点 */
|
|
1555
1568
|
integration: ModuleIntegrationNode | null;
|
|
1569
|
+
/** v4.4 D34:每域一条厂商绑定解析(单域 = 单元素;零域 = [];resolveDomainBinding 单源) */
|
|
1570
|
+
providerBindings: ProviderBinding[];
|
|
1571
|
+
/** v4.4 D34:单域 && 域键无跨模块共享(moduleDomainWritable 单源——读标志与写守卫共用) */
|
|
1572
|
+
configEditable: boolean;
|
|
1556
1573
|
/** 本模块 demand(卡片展开 + 编辑器静态上下文自足) */
|
|
1557
1574
|
services: ServiceDemand[];
|
|
1575
|
+
/** v4.4 D31:include=serviceResolutions 内嵌(demand 服务过滤 ≡ 批量 ?service= 语义;<0.9/形态异常 → null——永不 503) */
|
|
1576
|
+
serviceResolutions?: ServiceResolutionsView | null;
|
|
1577
|
+
/** v4.4 D32:include=integrationSchemas 层级富化(多域/零域/共享键/未绑定 → null) */
|
|
1578
|
+
integrationSchemas?: LayerIntegrationSchemas | null;
|
|
1579
|
+
/** v4.6 D36:include=integrationFieldRegistry 集成字段注册表(null 语义镜像 integrationSchemas;
|
|
1580
|
+
* 未知厂商/零足迹 → 非 null 空集 + unsupplied 回填——D37 轴参假想计算同此) */
|
|
1581
|
+
integrationFieldRegistry?: IntegrationFieldRegistryView | null;
|
|
1582
|
+
}
|
|
1583
|
+
/** 模块域厂商绑定解析(v4.4 D34——静态文件事实;规则 ≡ 谓词 #7 域级,resolveDomainBinding 单源) */
|
|
1584
|
+
interface ProviderBinding {
|
|
1585
|
+
/** 域键(= domainKeys 成员;多域模块每域一条) */
|
|
1586
|
+
domain: string;
|
|
1587
|
+
/** domains[domain].provider ?? root.provider(双缺 = null) */
|
|
1588
|
+
effective: string | null;
|
|
1589
|
+
/** 生效来源层(双缺 = null) */
|
|
1590
|
+
layer: 'module' | 'app' | null;
|
|
1591
|
+
}
|
|
1592
|
+
/** 层级 config schema 计算(v4.4 D32——静态轴富化,零 contracts) */
|
|
1593
|
+
interface LayerIntegrationSchemas {
|
|
1594
|
+
/** 层生效厂商(resolveDomainBinding 单源) */
|
|
1595
|
+
provider: string;
|
|
1596
|
+
/** 模块级 = 本模块 demand ∩ 该厂商供给;应用级 = 供给足迹全量(configSchema = raw draft 2020-12 原文;供给在场未声明 = null) */
|
|
1597
|
+
services: Record<string, {
|
|
1598
|
+
configSchema: object | null;
|
|
1599
|
+
}>;
|
|
1600
|
+
}
|
|
1601
|
+
/** v4.6 D36:集成字段注册表(层级表单服务端预计算——合并代数 R1/R2/R3 服务端单源;
|
|
1602
|
+
* 消费 resolveLayerIntegrationSchemas 产物构造,禁旁路直取 serviceSchemas) */
|
|
1603
|
+
interface IntegrationFieldRegistryView {
|
|
1604
|
+
/** echo:本注册表计算口径(假想时 = 轴参值——D37) */
|
|
1605
|
+
provider: string;
|
|
1606
|
+
/** 作用域内 configSchema === null 的服务(UI「未提供参数模板」提示行) */
|
|
1607
|
+
schemaless: string[];
|
|
1608
|
+
/** module 轴 = demand − 该厂商供给(Set 去重保序);app 轴恒 [](结构性:足迹 ⊆ 供给) */
|
|
1609
|
+
unsupplied: string[];
|
|
1610
|
+
/** 作用域内全部非 null schema 的 additionalProperties 均 ≠ false(聚合;空真) */
|
|
1611
|
+
additionalPropertiesAllowed: boolean;
|
|
1612
|
+
/** 逐 key 合并产物(首声明插入序 = scope 遍历序:app 字母序 / module demand 序) */
|
|
1613
|
+
fields: Array<{
|
|
1614
|
+
key: string;
|
|
1615
|
+
/** null = 类型不可调和(R3/R2 异构/R1 enum 不等——冲突折叠,客户端 RawJson 保真) */
|
|
1616
|
+
schema: object | null;
|
|
1617
|
+
/** required 聚合 = sources.some(s => s.required);conflict 字段照常聚合 */
|
|
1618
|
+
sources: Array<{
|
|
1619
|
+
service: string;
|
|
1620
|
+
required: boolean;
|
|
1621
|
+
}>;
|
|
1622
|
+
}>;
|
|
1558
1623
|
}
|
|
1559
1624
|
/** GET /app(应用静态视图:平台服务 + root 原值) */
|
|
1560
1625
|
interface AppView {
|
|
1561
|
-
/**
|
|
1562
|
-
|
|
1626
|
+
/** 平台服务(v4.4 D29:服务词汇 − 模块占用——与模块 demand 同型 ServiceDemand[];
|
|
1627
|
+
* title/description 缺席 = UI 回退 service id;required 恒 false——平台服务无 demand 源) */
|
|
1628
|
+
services: ServiceDemand[];
|
|
1563
1629
|
/** root 节点原值;文件缺席 = null */
|
|
1564
1630
|
integration: AppIntegrationNode | null;
|
|
1631
|
+
/** v4.4 D31:include=serviceResolutions 内嵌(全量键集 ≡ 批量无参;<0.9/形态异常 → null——永不 503) */
|
|
1632
|
+
serviceResolutions?: ServiceResolutionsView | null;
|
|
1633
|
+
/** v4.4 D32:include=integrationSchemas 层级富化(root.provider 缺席 → null) */
|
|
1634
|
+
integrationSchemas?: LayerIntegrationSchemas | null;
|
|
1635
|
+
/** v4.6 D36:include=integrationFieldRegistry 集成字段注册表(root.provider 缺席且无轴参 → null;
|
|
1636
|
+
* 未知厂商/零足迹 → 非 null 空集——D37 轴参假想计算同此) */
|
|
1637
|
+
integrationFieldRegistry?: IntegrationFieldRegistryView | null;
|
|
1565
1638
|
}
|
|
1566
1639
|
/** GET /services/:service(服务静态单体) */
|
|
1567
1640
|
interface ServiceDetail extends ServiceDemand {
|
|
@@ -1574,6 +1647,17 @@ interface ServiceDetail extends ServiceDemand {
|
|
|
1574
1647
|
integration: ServiceIntegrationNode | null;
|
|
1575
1648
|
/** 供给该服务的厂商名单(catalog 静态切片——picker 数据源) */
|
|
1576
1649
|
suppliedBy: string[];
|
|
1650
|
+
/** v4.7 D38:include=integrationSchemas 生效绑定富化(三态:null 全链未绑定 /
|
|
1651
|
+
* 绑定无可计算 schema / 含 schema;malformed 节点 → null——不放行域级联) */
|
|
1652
|
+
integrationSchemas?: ServiceIntegrationSchemas | null;
|
|
1653
|
+
}
|
|
1654
|
+
/** 服务级生效绑定 schema(v4.7 D38 静态轴富化——零 contracts,永不 503;实例层无条件排除:
|
|
1655
|
+
* node 级口径 ≠ resolution 默认实例口径,api.md §4.4 注) */
|
|
1656
|
+
interface ServiceIntegrationSchemas {
|
|
1657
|
+
/** 生效厂商:显式(含内联声明名)?? domains[首段].provider ?? root.provider */
|
|
1658
|
+
provider: string;
|
|
1659
|
+
/** catalog 复合键(多 impl 声明序首个)> 内联 ref;miss(未知厂商/未供给/内联缺 ref)→ null(富化非门控) */
|
|
1660
|
+
configSchema: object | null;
|
|
1577
1661
|
}
|
|
1578
1662
|
/** GET /service-resolutions(批量求值 · 唯一求值集合面) */
|
|
1579
1663
|
interface ServiceResolutionsView {
|
|
@@ -1591,6 +1675,9 @@ interface ServiceResolutionEntry {
|
|
|
1591
1675
|
statusMessage?: string;
|
|
1592
1676
|
/** 最特异声明层厂商名(跨层事实) */
|
|
1593
1677
|
provider?: string;
|
|
1678
|
+
/** v4.4:provider 来源声明层(默认实例口径,与 status 同轴);恒 = provider 字段来源层
|
|
1679
|
+
* (ok/binding-unresolved 取声明层;未配置双缺席);≡ 单体 inheritance 链逆序首个有 provider 的层 */
|
|
1680
|
+
layer?: BindingLayer;
|
|
1594
1681
|
/** provider 在场时在场:(provider, service) ∈ 供给关系 */
|
|
1595
1682
|
supplied?: boolean;
|
|
1596
1683
|
/** owner 模块 install id;平台服务/孤儿缺席 */
|
|
@@ -1678,8 +1765,6 @@ interface ResolvedInstance {
|
|
|
1678
1765
|
statusMessage?: string;
|
|
1679
1766
|
/** 该实例合并结果 */
|
|
1680
1767
|
effective?: EffectiveBinding;
|
|
1681
|
-
/** 掩码回显 */
|
|
1682
|
-
credential?: CredentialEcho;
|
|
1683
1768
|
}
|
|
1684
1769
|
/** GET /providers:厂商基本信息 */
|
|
1685
1770
|
interface ProvidersView {
|
|
@@ -1704,24 +1789,53 @@ interface ProviderDetail {
|
|
|
1704
1789
|
implementation: string;
|
|
1705
1790
|
credentialType: string;
|
|
1706
1791
|
}>;
|
|
1792
|
+
/** v4.4 F5:include=integrationSchemas 切换态批量(纯 config——凭据结构归 /credential-types) */
|
|
1793
|
+
integrationSchemas?: {
|
|
1794
|
+
configSchema: object | null;
|
|
1795
|
+
};
|
|
1707
1796
|
}>;
|
|
1708
1797
|
}
|
|
1709
1798
|
/** GET /providers/:p/services/:s:表单 schema 唯一暴露面 */
|
|
1710
1799
|
interface ProviderServiceDetail {
|
|
1711
1800
|
provider: string;
|
|
1712
1801
|
service: string;
|
|
1713
|
-
/** ★ 恒数组(通常 1
|
|
1802
|
+
/** ★ 恒数组(通常 1);credentialType 保留(/credential-types 寻址键) */
|
|
1714
1803
|
implementations: Array<{
|
|
1715
1804
|
implementation: string;
|
|
1716
1805
|
credentialType: string;
|
|
1717
1806
|
}>;
|
|
1718
|
-
/** 厂商集成该服务的表单 schema(integration
|
|
1807
|
+
/** 厂商集成该服务的表单 schema(integration 域专属)——v4.4 D33 纯 config(credentialSchema 删净) */
|
|
1719
1808
|
integrationSchemas: {
|
|
1720
1809
|
/** raw draft 2020-12 原文零转换;供给在场未声明 = null(mock 合法);解析自默认 impl */
|
|
1721
1810
|
configSchema: object | null;
|
|
1722
|
-
credentialSchema: object | null;
|
|
1723
1811
|
};
|
|
1724
1812
|
}
|
|
1813
|
+
/** GET /credentials:绑定位全量掩码回显(应用状态轴;GET 永无真值) */
|
|
1814
|
+
interface CredentialsView {
|
|
1815
|
+
/** root 位;byInstance 键集 = 注册表 ids ∩ 有 ref(无 ref 的注册实例不出现;未注册 ref 跳过不虚报) */
|
|
1816
|
+
app: CredentialBindingEcho;
|
|
1817
|
+
/** 键集 = 已配置服务;byInstance 键集 = 节点 instances map 全键(含 '*')——键域不对称 = 文件语义忠实镜像 */
|
|
1818
|
+
services: Record<string, CredentialBindingEcho>;
|
|
1819
|
+
}
|
|
1820
|
+
/** 一个形状两处(镜像文件层「标量 + ByInstance」模式) */
|
|
1821
|
+
interface CredentialBindingEcho {
|
|
1822
|
+
/** 本位 credentialRef(root.credentialRef / services[s].credentialRef);ref 缺席/文件缺失 → null */
|
|
1823
|
+
credential: CredentialEcho | null;
|
|
1824
|
+
/** 覆盖位(credentialRefByInstance / instances[k].credentialRef) */
|
|
1825
|
+
byInstance: Record<string, CredentialEcho | null>;
|
|
1826
|
+
}
|
|
1827
|
+
/** GET /credential-types[?provider=]:凭据结构清单(供给轴静态;?provider= 过滤语义 ≡ ?service=) */
|
|
1828
|
+
interface CredentialTypesView {
|
|
1829
|
+
types: CredentialTypeEntry[];
|
|
1830
|
+
}
|
|
1831
|
+
interface CredentialTypeEntry {
|
|
1832
|
+
/** '-' = 无凭据语义(mock/local——UI 判 '-' 不渲染凭据表单) */
|
|
1833
|
+
credentialType: string;
|
|
1834
|
+
/** 声明来源包名 */
|
|
1835
|
+
owner: string;
|
|
1836
|
+
/** raw draft 2020-12 原文;未声明 = null(ExtraFields 自由键值同轨) */
|
|
1837
|
+
credentialSchema: object | null;
|
|
1838
|
+
}
|
|
1725
1839
|
interface EffectiveBinding {
|
|
1726
1840
|
/** custom 时 provider = 内联声明厂商名 */
|
|
1727
1841
|
provider: string;
|
|
@@ -1761,7 +1875,7 @@ interface IntegrationIssue {
|
|
|
1761
1875
|
|
|
1762
1876
|
/**
|
|
1763
1877
|
* 视图装配共享上下文(五投影共用;目录枚举零缓存——walkManifests 每次调用执行)。
|
|
1764
|
-
* 域前缀换算(service →
|
|
1878
|
+
* 域前缀换算(service → 首点段)自 v4.4 F1 迁 integrations/domain-binding.ts(本文件 re-export 保导入路径)。
|
|
1765
1879
|
*/
|
|
1766
1880
|
interface ViewContext {
|
|
1767
1881
|
appDir: string;
|
|
@@ -1775,23 +1889,17 @@ interface ViewSnapshot {
|
|
|
1775
1889
|
contracts: ResolvedContracts;
|
|
1776
1890
|
}
|
|
1777
1891
|
|
|
1778
|
-
/**
|
|
1779
|
-
* 需求轴/模块静态投影(views/modules;C4)。静态端点结构性零求值(铁律 #3——
|
|
1780
|
-
* 无 resolution/issues/contracts 键,永不 503)。
|
|
1781
|
-
*/
|
|
1782
|
-
/** GET /modules:纯模块清单(demand 不在——卡片展开 = GET /modules/:m) */
|
|
1892
|
+
/** GET /modules:纯模块清单(demand 不在——卡片展开 = GET /modules/:m;provider 家族包不在清单) */
|
|
1783
1893
|
declare function loadModulesView(snapshot: ViewSnapshot): {
|
|
1784
1894
|
modules: ModuleDeclaration[];
|
|
1785
1895
|
};
|
|
1786
|
-
/** 域键换算(模块服务集派生域键集;单域 = 该域,多域/零域 = 模块 id——与 write.moduleDomainKey 同约定) */
|
|
1787
|
-
declare function moduleDomainKeyOf(services: ServiceDemand[], moduleId: string): string;
|
|
1788
1896
|
/** GET /modules/:module:模块静态一站式(integration 节点原值 + demand;PUT 读对偶) */
|
|
1789
1897
|
declare function loadModuleDetailView(snapshot: ViewSnapshot, moduleId: string): ModuleDetailView;
|
|
1790
1898
|
|
|
1791
1899
|
/**
|
|
1792
|
-
* 应用静态投影(views/app;C4;FX-1c B10——root
|
|
1793
|
-
* /app = 平台服务 + root
|
|
1794
|
-
*
|
|
1900
|
+
* 应用静态投影(views/app;C4;FX-1c B10——root 节点投影修;v4.4 D29——services 双端点同型)。
|
|
1901
|
+
* /app = 平台服务 + root 节点原值(纯静态):services = 服务词汇 − 模块占用
|
|
1902
|
+
* (ServiceDemand[]——平台条目 required 恒 false、title/description 缺席,D29);
|
|
1795
1903
|
* 平台服务状态不在此(→ /service-resolutions);模块服务不在此(→ /modules/:m)。
|
|
1796
1904
|
* integration = **root 节点投影**(APP_INTEGRATION_NODE_KEYS——D21/L1:GET 预填 ≡ PUT body;
|
|
1797
1905
|
* 文件另含 services/domains/modules 域键,不进 root 节点投影——原实现整文件透传,
|
|
@@ -1813,8 +1921,9 @@ declare function loadServiceDetailView(snapshot: ViewSnapshot, service: string):
|
|
|
1813
1921
|
*/
|
|
1814
1922
|
/** GET /providers:厂商基本信息(供给足迹不在本端点 → /providers/:p) */
|
|
1815
1923
|
declare function loadProvidersView(snapshot: ViewSnapshot): ProvidersView;
|
|
1816
|
-
/** GET /providers/:provider:供给足迹(implementations 恒数组——H1
|
|
1817
|
-
|
|
1924
|
+
/** GET /providers/:provider:供给足迹(implementations 恒数组——H1 多实现钉版数据源;
|
|
1925
|
+
* v4.4 F5:include=integrationSchemas 切换态批量——services[s] += { configSchema }(纯 config)) */
|
|
1926
|
+
declare function loadProviderDetailView(snapshot: ViewSnapshot, provider: string, include?: ReadonlySet<string>): ProviderDetail;
|
|
1818
1927
|
/** 组合单体(GET /providers/:p/services/:s):catalog 供给与槽级内联声明统一解析(P10/P11) */
|
|
1819
1928
|
declare function loadProviderServiceDetailView(snapshot: ViewSnapshot, provider: string, service: string): ProviderServiceDetail;
|
|
1820
1929
|
|
|
@@ -1826,15 +1935,81 @@ declare function loadServiceResolutionsView(snapshot: ViewSnapshot, issues: Inte
|
|
|
1826
1935
|
declare function loadServiceResolutionDetail(service: string, snapshot: ViewSnapshot, allIssues: IntegrationIssue[]): ServiceResolutionDetail;
|
|
1827
1936
|
|
|
1828
1937
|
/**
|
|
1829
|
-
*
|
|
1938
|
+
* 层级/服务级 config schema 计算视图(v4.4 D32——静态轴富化,零 contracts 求值;v4.7 D38 服务级)。
|
|
1939
|
+
* config 表单结构四形态同源(P10):槽级组合单体(providers.ts)/ 层级内嵌(本文件——
|
|
1940
|
+
* /app、/modules/:m include)/ 供给轴批量(providers.ts include——切换态)/ 服务级生效绑定
|
|
1941
|
+
* (本文件 loadServiceIntegrationSchemas——/services/:s include)。
|
|
1942
|
+
*
|
|
1943
|
+
* 计算规则(D32 裁决):禁交集——config 五层浅合并下「部分服务认识的字段」合法(谓词 #7
|
|
1944
|
+
* 并集键集同依据);禁合成单一 schema——required/title 冲突的有损代数;产物 = 扁平映射,
|
|
1945
|
+
* 分组归客户端纯呈现。层级 schema = 表单引导**非写入门禁**(P16——写路径校验权威恒在谓词
|
|
1946
|
+
* #7 键集 + ajv 凭据链;root 级口径差:#7 = 引用厂商并集,表单 = 层生效厂商单厂商作用域)。
|
|
1947
|
+
*
|
|
1948
|
+
* v4.6(D36/D37 additive 精化):**原始投影**(loadApp/loadModuleIntegrationSchemas)原样保留
|
|
1949
|
+
* 为诊断面 / registry 输入;**消费投影** = buildIntegrationFieldRegistry(字段级合并代数
|
|
1950
|
+
* R1/R2/R3 服务端单源,conflict 折叠 schema:null);**轴向假想绑定** = formProviderOf
|
|
1951
|
+
* (override ?? 实际解析——双投影同源同口径,formViews 装配层一次计算两投影)。
|
|
1952
|
+
* 单源三锚:层级 schema 计算 = resolveLayerIntegrationSchemas / 生效厂商解析 = formProviderOf /
|
|
1953
|
+
* 合并代数 = buildIntegrationFieldRegistry。
|
|
1954
|
+
*/
|
|
1955
|
+
/** 核心纯函数:显式作用域(provider null → 整字段 null;services 逐项 resolveServiceConfigSchema
|
|
1956
|
+
* 复合解析——v4.7 D38 收口,零新读取路径;供给在场未声明 = null,mock 合法) */
|
|
1957
|
+
declare function resolveLayerIntegrationSchemas(snapshot: ViewSnapshot, provider: string, services: readonly string[]): LayerIntegrationSchemas;
|
|
1958
|
+
declare function resolveLayerIntegrationSchemas(snapshot: ViewSnapshot, provider: string | null, services: readonly string[]): LayerIntegrationSchemas | null;
|
|
1959
|
+
/** app 级 loader(v4.6 委托化——签名零改动,公开面保持;假想态归 loadAppFormViews override 参) */
|
|
1960
|
+
declare function loadAppIntegrationSchemas(snapshot: ViewSnapshot): LayerIntegrationSchemas | null;
|
|
1961
|
+
/** module 级 loader(v4.6 委托化——同上;多域/零域/共享键/未绑定 → 整字段 null,表单降级 = ExtraFields) */
|
|
1962
|
+
declare function loadModuleIntegrationSchemas(snapshot: ViewSnapshot, moduleId: string): LayerIntegrationSchemas | null;
|
|
1963
|
+
/** 服务级 loader(v4.7 D38):四分支穷举(node.provider = 文件 services[s].provider 逐字原值;
|
|
1964
|
+
* 实例层无条件排除——node 级口径);非空三分支归约一次复合解析。
|
|
1965
|
+
* ① undefined/'' → resolveDomainBinding 域级联(域 + root 双缺 → 整字段 null)
|
|
1966
|
+
* ② 非空 string → bare:catalog miss(未知厂商/未供给)→ configSchema:null 不 404(富化非门控)
|
|
1967
|
+
* ③ 受控内联(isControlledInlineProvider 单源)→ 名 = p.provider;catalog 复合键 > p.configSchema ref
|
|
1968
|
+
* (H9 逃逸 400 照抛——readInlineSchema 共享路径)
|
|
1969
|
+
* ④ 其余(null/数组/原始值/坏对象)→ 整字段 null(≡ 谓词 #5 INLINE_PROVIDER_INVALID 同判——
|
|
1970
|
+
* 不放行域级联,防错误 schema 污染坏节点) */
|
|
1971
|
+
declare function loadServiceIntegrationSchemas(snapshot: ViewSnapshot, service: string): ServiceIntegrationSchemas | null;
|
|
1972
|
+
|
|
1973
|
+
/**
|
|
1974
|
+
* 凭据状态轴投影(views/credentials;v4.4 D33 独立端点 GET /credentials):
|
|
1975
|
+
* 绑定位全量掩码回显——应用状态轴(随配置失效、零求值零 contracts、永不 503)。
|
|
1976
|
+
* GET 永无真值(仅 ref/masked);掩码单源 maskCredentialValues;echoForRef 自
|
|
1977
|
+
* service-resolutions 迁入共享(求值单体 instances[].credential 已删净——求值路径零凭据 I/O)。
|
|
1978
|
+
*
|
|
1979
|
+
* 键集 = 文件语义忠实镜像(api.md §0「键域不对称」):
|
|
1980
|
+
* app.byInstance = 注册表 ids ∩ 有 ref(无 ref 的注册实例不出现;未注册 ref 跳过不虚报)
|
|
1981
|
+
* services[s].byInstance = 节点 instances map 全键(含 '*',无 ref 亦在场 → null)
|
|
1982
|
+
* null 语义:credential/byInstance 值 = 「未就绪」(ref 缺席或文件缺失)——缺失诊断归谓词 #1
|
|
1983
|
+
* (CREDENTIAL_FILE_MISSING),echo = 状态回显、issues = 诊断定位(P16 分工)。
|
|
1984
|
+
*/
|
|
1985
|
+
/** 凭据文件掩码回显(ref 非 secret:// 或文件缺席 → undefined——调用方映射 null) */
|
|
1986
|
+
declare function echoForRef(appDir: string, ref: string | undefined): CredentialEcho | undefined;
|
|
1987
|
+
declare function loadCredentialsView(snapshot: ViewSnapshot): CredentialsView;
|
|
1988
|
+
|
|
1989
|
+
/**
|
|
1990
|
+
* 供给轴凭据结构清单(views/credential-types;v4.4 D33 独立端点 GET /credential-types[?provider=]):
|
|
1991
|
+
* 结构按 credentialType 键(wanda 全部槽共享同一 type 同一 schema 文件——(provider, service)
|
|
1992
|
+
* 组合寻址是错位键);源 = catalog.credentialTypes(既有聚合产物零新读取路径,聚合条目携
|
|
1993
|
+
* packageDir 供 schema 文件解析)。静态轴(稳定可缓存、永不 503)。
|
|
1994
|
+
* ?provider= 过滤 ≡ ?service= 先例(过滤非寻址;未知 provider → 空 types 不 404)。
|
|
1995
|
+
* '-' = 无凭据语义(mock/local——UI 判 '-' 不渲染凭据表单);credentialSchema null = 未声明。
|
|
1996
|
+
*/
|
|
1997
|
+
declare function loadCredentialTypesView(snapshot: ViewSnapshot, provider?: string): CredentialTypesView;
|
|
1998
|
+
|
|
1999
|
+
/**
|
|
2000
|
+
* createAppToolkit(C4 工厂;v4.4——24 方法 = 11 读(含 credentials/credential-types 双端点)
|
|
2001
|
+
* + 4 写 + 9 迁移面;loadApp/loadModule/loadProvider 增 include 选项;v4.6——loadApp/loadModule
|
|
2002
|
+
* += 轴向假想绑定选项(appProvider/moduleProvider,D37);表单双投影经 formViews 单点装配;
|
|
2003
|
+
* v4.7——loadService 增 include 选项(服务级生效绑定 schema 单体))。
|
|
1830
2004
|
* AppToolkit = AppToolkitRead & AppToolkitWrite & AppToolkitInternals——
|
|
1831
2005
|
* Read+Write = HTTP 直通面 additive 冻结(L1 端点↔方法 1:1,L3 命名镜像:Integration=节点级 /
|
|
1832
2006
|
* Config=文件级);Internals = CLI/doctor/桥消费(自由演进)。
|
|
1833
2007
|
*
|
|
1834
2008
|
* **门控断言单点(policy at edge)**:求值(2)+ 写(4)+ ensureMockBindings / writeIntegrationsConfig /
|
|
1835
2009
|
* evaluateIntegrationServices 入口 assertContractsUsable——strictValidation === false → 503
|
|
1836
|
-
* CONTRACTS_NOT_RESOLVED
|
|
1837
|
-
*
|
|
2010
|
+
* CONTRACTS_NOT_RESOLVED;静态方法不门控(永不 503——铁律 #3);**include 装配为条件分支非门控**
|
|
2011
|
+
* (D31——serviceResolutions 按 evaluation && strictValidation 双条件装配,<0.9/形态异常 → null,
|
|
2012
|
+
* 静态端点永不 503;integrationSchemas 纯静态轴零 contracts);integrations/ views/ 机制层保持纯函数。
|
|
1838
2013
|
*
|
|
1839
2014
|
* 并发:进程内写串行(per-factory promise chain)+ 原子写 + 写后本实例缓存即刻失效(D26)。
|
|
1840
2015
|
* onApplied(D7):toolkit 判定「需要重启」(实际落盘且非 dryRun/no-diff)→ 调用一次 +
|
|
@@ -1844,17 +2019,33 @@ interface AppToolkitOptions {
|
|
|
1844
2019
|
/** 写成功(实际落盘且非 dryRun/no-diff)→ 调用一次(宿主闭包内防抖/守卫);CLI 不传恒 false */
|
|
1845
2020
|
onApplied?: () => void;
|
|
1846
2021
|
}
|
|
1847
|
-
/** ── HTTP 直通面(
|
|
2022
|
+
/** ── HTTP 直通面(11 读;L1 镜像律:方法名 = load + URL 资源段;query → 选项字段 L4)── */
|
|
1848
2023
|
interface AppToolkitRead {
|
|
1849
2024
|
loadModules(): Promise<ModulesView>;
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
2025
|
+
/** v4.6 D37:moduleProvider = 轴向假想绑定(缺席/空串 ≡ 按实际配置解析;需与表单 include 键同现) */
|
|
2026
|
+
loadModule(moduleId: string, o?: {
|
|
2027
|
+
include?: string[];
|
|
2028
|
+
moduleProvider?: string;
|
|
2029
|
+
}): Promise<ModuleDetailView>;
|
|
2030
|
+
/** v4.6 D37:appProvider = 轴向假想绑定(缺席/空串 ≡ 按实际配置解析;需与表单 include 键同现) */
|
|
2031
|
+
loadApp(o?: {
|
|
2032
|
+
include?: string[];
|
|
2033
|
+
appProvider?: string;
|
|
2034
|
+
}): Promise<AppView>;
|
|
2035
|
+
loadService(service: string, o?: {
|
|
2036
|
+
include?: string[];
|
|
2037
|
+
}): Promise<ServiceDetail>;
|
|
1853
2038
|
loadServiceResolutions(services?: string[]): Promise<ServiceResolutionsView>;
|
|
1854
2039
|
loadServiceResolution(service: string): Promise<ServiceResolutionDetail>;
|
|
1855
2040
|
loadProviders(): Promise<ProvidersView>;
|
|
1856
|
-
loadProvider(provider: string
|
|
2041
|
+
loadProvider(provider: string, o?: {
|
|
2042
|
+
include?: string[];
|
|
2043
|
+
}): Promise<ProviderDetail>;
|
|
1857
2044
|
loadProviderService(provider: string, service: string): Promise<ProviderServiceDetail>;
|
|
2045
|
+
/** GET /credentials(v4.4 D33——应用状态轴;零门控,永不 503) */
|
|
2046
|
+
loadCredentials(): Promise<CredentialsView>;
|
|
2047
|
+
/** GET /credential-types[?provider=](v4.4 D33——供给轴静态;零门控,永不 503) */
|
|
2048
|
+
loadCredentialTypes(provider?: string): Promise<CredentialTypesView>;
|
|
1858
2049
|
}
|
|
1859
2050
|
/** ── HTTP 直通面(4 写;body ≡ 文件节点全量替换;DELETE 无 dryRun/无 options)── */
|
|
1860
2051
|
interface AppToolkitWrite {
|
|
@@ -1906,4 +2097,4 @@ interface AppToolkitInternals {
|
|
|
1906
2097
|
type AppToolkit = AppToolkitRead & AppToolkitWrite & AppToolkitInternals;
|
|
1907
2098
|
declare function createAppToolkit(appDir: string, options?: AppToolkitOptions): AppToolkit;
|
|
1908
2099
|
|
|
1909
|
-
export { APP_INTEGRATION_NODE_KEYS, type AppIntegrationNode, type AppManifest, type AppManifestFull, type AppToolkit, AppToolkitError, type AppToolkitErrorCode, type AppToolkitInternals, type AppToolkitOptions, type AppToolkitRead, type AppToolkitWrite, type AppView, type AppliedCredential, type BindingLayer, type BridgeProviderCatalog, type CardContrib, type ContractsResolution, type CredentialEcho, type CredentialFile, type CredentialInput, type CredentialValues, type DeclaredModuleInfo, type EffectiveBinding, type EnvExpansionResult, type EvaluationExports, type FileCache, type InlineVendorDeclaration, type IntegrationIssue, type IntegrationServiceIssue, type IntegrationServicePredicateInput, type MiniappContainerEntry, type MockBindingsResult, type ModuleDeclaration, type ModuleDescriptor, type ModuleDetailView, type ModuleIntegrationNode, type ModuleMode, type ModulesView, type NpmModuleEntry, type OrphanIssue, type ParseModuleResult, type PlannedCredential, type PredicateAssembly, type PredicateContracts, type PredicateIoInputs, type ProviderDetail, type ProviderEntry, type ProviderServiceDetail, type ProviderServiceSchemas, type ProviderServiceSchemasResult, type ProviderSlotContrib, type ProvidersView, type ReadIntegrationsResult, type ResolvedContracts, type ResolvedInstance, type ResolvedModule, type ResourceNeedContrib, SAFE_NAME_PATTERN, type SaveResult, type ServiceDemand, type ServiceDetail, type ServiceInstanceNode, type ServiceIntegrationNode, type ServiceNeedContrib, type ServiceResolution, type ServiceResolutionDetail, type ServiceResolutionEntry, type ServiceResolutionsView, type ServiceStatus, type StemInput, type SupplyLookup, type ViewContext, type ViewSnapshot, type WalkCatalog, type WalkManifestsResult, type WalkModuleInfo, type WalkProviderEntry, type WriteCore, type WriteCoreOptions, type WriteOptions, assertValidModuleId, buildPredicateAssembly, checkInstanceKeys, collectDeclaredModules, contractsNotResolvedMessage, createAppToolkit, createFileCache, createWriteCore, credentialArtifactExists, deepEqual, deriveStem, ensureDir, ensureMockBindings, evaluateIntegrationServices, expandEnvVars, extractModuleIdFromSource, invalidateContractsResolver, isControlledInlineProvider, isValidModuleId, loadAppView, loadModuleDetailView, loadModulesView, loadProviderCatalog, loadProviderCatalogRaw, loadProviderDetailView, loadProviderServiceDetailView, loadProvidersView, loadServiceDetailView, loadServiceResolutionDetail, loadServiceResolutionsView, manifestPath, maskCredentialValues, moduleDependencySchema, moduleDescriptorSchema,
|
|
2100
|
+
export { APP_INTEGRATION_NODE_KEYS, type AppIntegrationNode, type AppManifest, type AppManifestFull, type AppToolkit, AppToolkitError, type AppToolkitErrorCode, type AppToolkitInternals, type AppToolkitOptions, type AppToolkitRead, type AppToolkitWrite, type AppView, type AppliedCredential, type BindingLayer, type BridgeProviderCatalog, type CardContrib, type ContractsResolution, type CredentialBindingEcho, type CredentialEcho, type CredentialFile, type CredentialInput, type CredentialTypeEntry, type CredentialTypesView, type CredentialValues, type CredentialsView, type DeclaredModuleInfo, type EffectiveBinding, type EnvExpansionResult, type EvaluationExports, type FileCache, type InlineVendorDeclaration, type IntegrationFieldRegistryView, type IntegrationIssue, type IntegrationServiceIssue, type IntegrationServicePredicateInput, type LayerIntegrationSchemas, type MiniappContainerEntry, type MockBindingsResult, type ModuleDeclaration, type ModuleDescriptor, type ModuleDetailView, type ModuleIntegrationNode, type ModuleMode, type ModulesView, type NpmModuleEntry, type OrphanIssue, type ParseModuleResult, type PlannedCredential, type PredicateAssembly, type PredicateContracts, type PredicateIoInputs, type ProviderBinding, type ProviderDetail, type ProviderEntry, type ProviderServiceDetail, type ProviderServiceSchemas, type ProviderServiceSchemasResult, type ProviderSlotContrib, type ProvidersView, type ReadIntegrationsResult, type ResolvedContracts, type ResolvedInstance, type ResolvedModule, type ResourceNeedContrib, SAFE_NAME_PATTERN, type SaveResult, type ServiceDemand, type ServiceDetail, type ServiceInstanceNode, type ServiceIntegrationNode, type ServiceIntegrationSchemas, type ServiceNeedContrib, type ServiceResolution, type ServiceResolutionDetail, type ServiceResolutionEntry, type ServiceResolutionsView, type ServiceStatus, type StemInput, type SupplyLookup, type ViewContext, type ViewSnapshot, type WalkCatalog, type WalkManifestsResult, type WalkModuleInfo, type WalkProviderEntry, type WriteCore, type WriteCoreOptions, type WriteOptions, assertValidModuleId, buildPredicateAssembly, checkInstanceKeys, collectDeclaredModules, contractsNotResolvedMessage, createAppToolkit, createFileCache, createWriteCore, credentialArtifactExists, deepEqual, deriveStem, echoForRef, ensureDir, ensureMockBindings, evaluateIntegrationServices, expandEnvVars, extractModuleIdFromSource, invalidateContractsResolver, isControlledInlineProvider, isValidModuleId, loadAppIntegrationSchemas, loadAppView, loadCredentialTypesView, loadCredentialsView, loadModuleDetailView, loadModuleIntegrationSchemas, loadModulesView, loadProviderCatalog, loadProviderCatalogRaw, loadProviderDetailView, loadProviderServiceDetailView, loadProvidersView, loadServiceDetailView, loadServiceIntegrationSchemas, loadServiceResolutionDetail, loadServiceResolutionsView, manifestPath, maskCredentialValues, moduleDependencySchema, moduleDescriptorSchema, pageContribSchema, parseModuleDescriptor, providerSlotContribSchema, readAppManifest, readAppManifestFull, readCredentialFile, readIntegrationsConfig, readIntegrationsStrict, reconcileOrphanCredentials, refToEnvKey, removeNpmModule, resolveContractsForApp, resolveContractsForApp as resolveContractsForAppExport, resolveLayerIntegrationSchemas, resolveServiceSummary, resourceNeedContribSchema, serviceNeedContribSchema, stemToFilePath, stemToRef, tabContribSchema, updateNpmModule, upsertMiniappContainer, upsertNpmModule, walkManifests, writeAppManifest, writeAtomic, writeCredentialFile };
|