@adep/runtime 0.3.13 → 0.3.14

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.
@@ -1,3 +1,4 @@
1
+ import type { ChainSpec } from '@adep/types';
1
2
  import type { CapabilityBundle } from '@adep/types';
2
3
  import type { ProjectDriver } from '../../db/project-driver';
3
4
  export interface CreateDbCapabilityOptions {
@@ -8,6 +9,8 @@ export interface CreateDbCapabilityOptions {
8
9
  */
9
10
  beforeWrite?: (driver: ProjectDriver) => Promise<void>;
10
11
  }
12
+ /** 链式能力的装配规格:FN worker 只按方法名清单构造客户端,不感知 db 细节。 */
13
+ export declare const CLOUD_DB_SPEC: ChainSpec;
11
14
  /**
12
15
  * 按驱动产出一组 `cloud.db` 能力。驱动已绑定项目库(连接层隔离,DB-001);
13
16
  * `projectId` 在装配期绑定,函数侧不可感知。内部无共享可变状态污染跨项目调用。
package/dist/index.js CHANGED
@@ -1139,10 +1139,14 @@ function createCloudDb(driver, options = {}) {
1139
1139
  var CLOUD_DB_SPEC = {
1140
1140
  kind: "cloud-db",
1141
1141
  rootMethod: "table",
1142
- stepMethods: ["select", "where", "orderBy", "limit", "offset"],
1143
- terminalMethods: ["get", "first", "count", "insert", "insertMany", "update", "delete"],
1142
+ // 规格清单必须与构建器公开方法面一致(防漂移门 spec-drift.test.ts 双向咬合):
1143
+ // - owned:DB-006 的 owned 声明(step);
1144
+ // - execute:BUG-4 统一执行入口(direct,宿主侧 DB_RPC.execute 分支早已在);
1145
+ // - upsert:DB-010 终端(漏登记过一次,真机 500,见 spec-drift.test.ts 头注释)。
1146
+ stepMethods: ["select", "where", "orderBy", "limit", "offset", "owned"],
1147
+ terminalMethods: ["get", "first", "count", "insert", "insertMany", "update", "delete", "upsert"],
1144
1148
  // CF-013:writeQuery 是 D1 shim 的写路径(INSERT/UPDATE/DELETE),与 query 并列直通方法。
1145
- directMethods: ["query", "writeQuery", "changes"],
1149
+ directMethods: ["query", "writeQuery", "execute", "changes"],
1146
1150
  transactionMethod: "transaction"
1147
1151
  };
1148
1152
  var WRITE_TERMINALS = /* @__PURE__ */ new Set(["insert", "insertMany", "update", "delete"]);
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "homepage": "https://adep.top",
9
9
  "bugs": "https://gitcode.com/yunqiang_wu/ai-yunke/issues",
10
- "version": "0.3.13",
10
+ "version": "0.3.14",
11
11
  "private": false,
12
12
  "type": "module",
13
13
  "sideEffects": false,