openxiangda-skill-kit 2.0.6 → 2.0.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openxiangda-skill-kit",
3
- "version": "2.0.6",
3
+ "version": "2.0.7",
4
4
  "description": "OpenXiangda 2.0 中文 AI 技能的校验、分发与安装。",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -17,7 +17,7 @@
17
17
  "README.md"
18
18
  ],
19
19
  "dependencies": {
20
- "openxiangda-devkit-core": "2.3.0"
20
+ "openxiangda-devkit-core": "2.4.0"
21
21
  },
22
22
  "devDependencies": {
23
23
  "tsx": "4.23.12",
@@ -45,10 +45,27 @@ operation、事件消费者、人员提供器,然后运行 `pnpm openxiangda c
45
45
 
46
46
  只读前置条件使用 `record-exists` 或 `record-match`,它们不要求同记录 mutation,
47
47
  但仍执行 read capability、字段权限与行级授权。需要与数据库当前时间比较时使用
48
- `databaseNowAssertion('publishAt', 'lte')`;平台用一次 PostgreSQL transaction time
49
- 完成所有断言,并把该时间作为 `evaluatedAt` 存入幂等回执。相同幂等键重放不会重新
48
+ `databaseNowAssertion('publishAt', 'lte')`;平台在守卫行锁及写入前校验完成后,
49
+ 用一次 PostgreSQL `clock_timestamp()` 完成所有动态断言,并把该接受时刻作为
50
+ `evaluatedAt` 存入幂等回执。它不是最终提交时刻。相同幂等键重放不会重新
50
51
  读取当前时间。不得把 `Date.now()`、SQL 表达式、时区偏移或调用方时钟塞入断言。
51
52
 
53
+ 新建或更新的时间窗口使用 `operation-time`,直接引用本次操作提交的 datetime 字段:
54
+
55
+ ```ts
56
+ const guards = [
57
+ { kind: 'operation-time', operationIndex: 0, field: 'startsAt',
58
+ operator: 'gt', offsetMilliseconds: 0, errorCode: 'OPENXIANGDA_NOT_FUTURE' },
59
+ { kind: 'operation-time', operationIndex: 0, field: 'startsAt',
60
+ operator: 'lte', offsetMilliseconds: 2592000000, errorCode: 'OPENXIANGDA_TOO_FAR' },
61
+ ];
62
+ ```
63
+
64
+ 上述规则表示第一个 create/update 操作的 startsAt 必须晚于平台接受时刻,
65
+ 且最多提前 30 天。字段须已声明、可写,并在操作 data 中提供带 Z 或显式偏移的
66
+ ISO 时间字符串;不接受空值、嵌套路径、引用或表达式。offsetMilliseconds 是
67
+ 最多正负 366 天的整数,所有时间条件共享一个接受时刻。需要平台 Data API 1.1.0。
68
+
52
69
 
53
70
  ## 业务动作与普通查询 {#business-action}
54
71