@geoly-ai/social-hub-core 0.0.5 → 0.0.6
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 +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/notification-sources/field-paths.d.ts +93 -0
- package/dist/notification-sources/field-paths.d.ts.map +1 -0
- package/dist/notification-sources/field-paths.js +86 -0
- package/dist/notification-sources/field-paths.js.map +1 -0
- package/dist/notification-sources/field-set.d.ts +46 -0
- package/dist/notification-sources/field-set.d.ts.map +1 -0
- package/dist/notification-sources/field-set.js +178 -0
- package/dist/notification-sources/field-set.js.map +1 -0
- package/dist/notification-sources/index.d.ts +13 -0
- package/dist/notification-sources/index.d.ts.map +1 -0
- package/dist/notification-sources/index.js +13 -0
- package/dist/notification-sources/index.js.map +1 -0
- package/dist/notification-sources/notification-sources.test.d.ts +2 -0
- package/dist/notification-sources/notification-sources.test.d.ts.map +1 -0
- package/dist/notification-sources/notification-sources.test.js +211 -0
- package/dist/notification-sources/notification-sources.test.js.map +1 -0
- package/dist/notification-sources/post-performance-node-runtime.d.ts +155 -0
- package/dist/notification-sources/post-performance-node-runtime.d.ts.map +1 -0
- package/dist/notification-sources/post-performance-node-runtime.js +158 -0
- package/dist/notification-sources/post-performance-node-runtime.js.map +1 -0
- package/dist/notification-sources/post-performance-node-runtime.test.d.ts +2 -0
- package/dist/notification-sources/post-performance-node-runtime.test.d.ts.map +1 -0
- package/dist/notification-sources/post-performance-node-runtime.test.js +182 -0
- package/dist/notification-sources/post-performance-node-runtime.test.js.map +1 -0
- package/dist/notification-sources/post-performance-node.d.ts +34 -0
- package/dist/notification-sources/post-performance-node.d.ts.map +1 -0
- package/dist/notification-sources/post-performance-node.js +437 -0
- package/dist/notification-sources/post-performance-node.js.map +1 -0
- package/dist/notification-sources/registry.d.ts +27 -0
- package/dist/notification-sources/registry.d.ts.map +1 -0
- package/dist/notification-sources/registry.js +222 -0
- package/dist/notification-sources/registry.js.map +1 -0
- package/dist/notification-sources/source-definition.d.ts +97 -0
- package/dist/notification-sources/source-definition.d.ts.map +1 -0
- package/dist/notification-sources/source-definition.js +30 -0
- package/dist/notification-sources/source-definition.js.map +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,eAAe,CAAC;AAG9B,cAAc,iCAAiC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -6,4 +6,7 @@ export * from "./openclaw-config.js";
|
|
|
6
6
|
export * from "./client-delivery-config.js";
|
|
7
7
|
export * from "./content-review-scoring.js";
|
|
8
8
|
export * from "./activity.js";
|
|
9
|
+
// 事件订阅通知能力:registry 是 db/worker/api 的暴露面推导单点,必须能跨包 import。
|
|
10
|
+
// core 的 exports map 只有 ".",没有 subpath,故在此 re-export(零依赖纯 TS,不引 node:*)。
|
|
11
|
+
export * from "./notification-sources/index.js";
|
|
9
12
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,eAAe,CAAC;AAC9B,2DAA2D;AAC3D,yEAAyE;AACzE,cAAc,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 事件订阅通知能力 —— Block 0:字段路径原语(代码侧 source registry 的地基)。
|
|
3
|
+
*
|
|
4
|
+
* 为什么放 `packages/core` 而不是 contracts:
|
|
5
|
+
* - 本文件是**纯 TS、零依赖**(core 没有 zod、没有 node:crypto),registry 框架要能被
|
|
6
|
+
* db / worker / api 直接引用做「暴露面推导」,不该被 zod 绑架。
|
|
7
|
+
* - contracts 侧(`packages/contracts/src/notifications.ts`)只负责 **wire 形状**(zod)。
|
|
8
|
+
* 两边各自 pin 同一份叶子路径清单,跨包一致性检查留给集成块(见设计文档 §12 验收点 A-38)。
|
|
9
|
+
*
|
|
10
|
+
* 铁律:字段路径是**开发者声明的 schema identifier**,不是用户输入。因此不做 trim /
|
|
11
|
+
* lowercase / NFKC 归一化——任何大小写或空白差异一律视为「未知字段」直接拒绝,
|
|
12
|
+
* 避免「后台保存的是 A、实际 hash 的是 B」。
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* 受限字段路径语法:ASCII 点号叶子路径,segment 必须小写字母开头 + 字母数字。
|
|
16
|
+
* 明确**不**支持:转义、索引(`a.0.b`)、非 ASCII、空 segment。
|
|
17
|
+
* 数组整体即叶子(如 `trigger.supersededNodes`),永不产生索引路径。
|
|
18
|
+
*/
|
|
19
|
+
export declare const NOTIFICATION_FIELD_PATH_PATTERN: RegExp;
|
|
20
|
+
export declare function isNotificationFieldPath(value: unknown): value is string;
|
|
21
|
+
/**
|
|
22
|
+
* 字段路径排序 comparator。
|
|
23
|
+
*
|
|
24
|
+
* ⚠️ 规范冻结为「按 **ASCII 字节字典序** 升序」,而不是含糊的「JS 默认排序」——
|
|
25
|
+
* JS 的 `<` 比较严格说是 UTF-16 code unit 序,与 code point 序在 BMP 外不一致。
|
|
26
|
+
* 由于路径语法已限制为 ASCII,三者在本域内结果相同;显式写出来是为了让
|
|
27
|
+
* 其它语言/其它层(SQL、Go agent)能一字不差地复现 fieldSetVersion。
|
|
28
|
+
*/
|
|
29
|
+
export declare function compareNotificationFieldPaths(left: string, right: string): 0 | 1 | -1;
|
|
30
|
+
/** 排序(不去重、不校验;调用方负责先 assert)。返回新数组。 */
|
|
31
|
+
export declare function sortNotificationFieldPaths(paths: readonly string[]): readonly string[];
|
|
32
|
+
/**
|
|
33
|
+
* 单条事件的触发形态(定义在本文件是为了让 {@link NotificationFieldDefinition.variants}
|
|
34
|
+
* 能强类型引用而不与 source-definition.ts 形成循环 import)。
|
|
35
|
+
* - `scheduled_node`:正常到点。
|
|
36
|
+
* - `catchup`:一次 overdue 折叠(多个错过的节点塌缩成一条,见设计文档 §7)。
|
|
37
|
+
*/
|
|
38
|
+
export declare const NOTIFICATION_TRIGGER_MODES: readonly ["scheduled_node", "catchup"];
|
|
39
|
+
export type NotificationTriggerMode = (typeof NOTIFICATION_TRIGGER_MODES)[number];
|
|
40
|
+
/** 字段敏感度。后台**永远不能**改这个值——它是代码侧声明的暴露面等级。 */
|
|
41
|
+
export declare const NOTIFICATION_FIELD_SENSITIVITIES: readonly ["public", "internal", "restricted"];
|
|
42
|
+
export type NotificationFieldSensitivity = (typeof NOTIFICATION_FIELD_SENSITIVITIES)[number];
|
|
43
|
+
/**
|
|
44
|
+
* 字段值形态(供后台展示与 agent 解析用;不是 zod 类型,wire 校验在 contracts)。
|
|
45
|
+
* `stringArray` 是「数组整体作为叶子」的唯一合法形态。
|
|
46
|
+
*/
|
|
47
|
+
export declare const NOTIFICATION_FIELD_VALUE_KINDS: readonly ["string", "uuid", "url", "datetime", "integer", "ratio", "enum", "stringArray"];
|
|
48
|
+
export type NotificationFieldValueKind = (typeof NOTIFICATION_FIELD_VALUE_KINDS)[number];
|
|
49
|
+
/**
|
|
50
|
+
* 单条 authz 需求。语义**恒为 AND**(一个字段声明多条 = 全部满足才可选/可发)。
|
|
51
|
+
* 不允许 OR——OR 会让「谁能看到什么」在不同调用方被解释成不同结果。
|
|
52
|
+
*/
|
|
53
|
+
export interface NotificationFieldPermission {
|
|
54
|
+
readonly resource: string;
|
|
55
|
+
readonly action: "list" | "read";
|
|
56
|
+
}
|
|
57
|
+
/** 便于书写与日志展示的 `resource:action` 串。 */
|
|
58
|
+
export declare function formatNotificationFieldPermission(permission: NotificationFieldPermission): string;
|
|
59
|
+
/**
|
|
60
|
+
* 字段声明(代码侧唯一真源;改任何一项都必须 bump sourceDefinitionVersion,
|
|
61
|
+
* 改 `valueKind`/`nullable` 还必须 bump payloadSchemaVersion)。
|
|
62
|
+
*/
|
|
63
|
+
export interface NotificationFieldDefinition {
|
|
64
|
+
/** 叶子路径,必须匹配 {@link NOTIFICATION_FIELD_PATH_PATTERN}。 */
|
|
65
|
+
readonly path: string;
|
|
66
|
+
readonly sensitivity: NotificationFieldSensitivity;
|
|
67
|
+
readonly valueKind: NotificationFieldValueKind;
|
|
68
|
+
/**
|
|
69
|
+
* true = 字段被选中后即使数据不可得也**必定出现**、值为 `null`
|
|
70
|
+
*(区别于「未选中 → key 完全不出现」)。
|
|
71
|
+
* 这是「browserEnvironment 解析不到仍然发事件」的表达方式。
|
|
72
|
+
*/
|
|
73
|
+
readonly nullable: boolean;
|
|
74
|
+
/** AND 语义;空数组 = 只要能读该 subscription 即可见。 */
|
|
75
|
+
readonly requiredPermissions: readonly NotificationFieldPermission[];
|
|
76
|
+
/**
|
|
77
|
+
* 字段依赖:选中本字段则**自动补入**这些字段(依赖闭包),
|
|
78
|
+
* 保证「有值但无法判断值的观测时间/来源」这类不可解释的暴露不会发生。
|
|
79
|
+
*/
|
|
80
|
+
readonly requires?: readonly string[];
|
|
81
|
+
/**
|
|
82
|
+
* 仅对这些 trigger variant 有意义(省略 = **所有** variant)。
|
|
83
|
+
* catchup 专属字段(winnerScheduleId 等)用它标注,避免污染正常节点事件。
|
|
84
|
+
* 强类型 + registry 自检双重把关:拼错成 `"catcup"` 会让字段进了 configuredFields
|
|
85
|
+
* 却在所有 variant 事件里消失(静默丢字段),必须在声明期就炸掉。
|
|
86
|
+
*/
|
|
87
|
+
readonly variants?: readonly NotificationTriggerMode[];
|
|
88
|
+
/** 后台展示用中文说明。 */
|
|
89
|
+
readonly description: string;
|
|
90
|
+
}
|
|
91
|
+
/** 建索引,供 O(1) 查找与未知路径拒绝。 */
|
|
92
|
+
export declare function indexNotificationFields(fields: readonly NotificationFieldDefinition[]): ReadonlyMap<string, NotificationFieldDefinition>;
|
|
93
|
+
//# sourceMappingURL=field-paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-paths.d.ts","sourceRoot":"","sources":["../../src/notification-sources/field-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,QACG,CAAC;AAEhD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAIvE;AAED;;;;;;;GAOG;AACH,wBAAgB,6BA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,CAAC,QAAQ,CAAC,EAAE,SAAS,uBAAuB,EAAE,CAAC;IACvD,iBAAiB;IACjB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,4BAA4B;AAC5B,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,SAAS,2BAA2B,EAAE,GAC7C,WAAW,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAYlD"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 事件订阅通知能力 —— Block 0:字段路径原语(代码侧 source registry 的地基)。
|
|
3
|
+
*
|
|
4
|
+
* 为什么放 `packages/core` 而不是 contracts:
|
|
5
|
+
* - 本文件是**纯 TS、零依赖**(core 没有 zod、没有 node:crypto),registry 框架要能被
|
|
6
|
+
* db / worker / api 直接引用做「暴露面推导」,不该被 zod 绑架。
|
|
7
|
+
* - contracts 侧(`packages/contracts/src/notifications.ts`)只负责 **wire 形状**(zod)。
|
|
8
|
+
* 两边各自 pin 同一份叶子路径清单,跨包一致性检查留给集成块(见设计文档 §12 验收点 A-38)。
|
|
9
|
+
*
|
|
10
|
+
* 铁律:字段路径是**开发者声明的 schema identifier**,不是用户输入。因此不做 trim /
|
|
11
|
+
* lowercase / NFKC 归一化——任何大小写或空白差异一律视为「未知字段」直接拒绝,
|
|
12
|
+
* 避免「后台保存的是 A、实际 hash 的是 B」。
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* 受限字段路径语法:ASCII 点号叶子路径,segment 必须小写字母开头 + 字母数字。
|
|
16
|
+
* 明确**不**支持:转义、索引(`a.0.b`)、非 ASCII、空 segment。
|
|
17
|
+
* 数组整体即叶子(如 `trigger.supersededNodes`),永不产生索引路径。
|
|
18
|
+
*/
|
|
19
|
+
export const NOTIFICATION_FIELD_PATH_PATTERN = /^[a-z][A-Za-z0-9]*(?:\.[a-z][A-Za-z0-9]*)*$/;
|
|
20
|
+
export function isNotificationFieldPath(value) {
|
|
21
|
+
return (typeof value === "string" && NOTIFICATION_FIELD_PATH_PATTERN.test(value));
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 字段路径排序 comparator。
|
|
25
|
+
*
|
|
26
|
+
* ⚠️ 规范冻结为「按 **ASCII 字节字典序** 升序」,而不是含糊的「JS 默认排序」——
|
|
27
|
+
* JS 的 `<` 比较严格说是 UTF-16 code unit 序,与 code point 序在 BMP 外不一致。
|
|
28
|
+
* 由于路径语法已限制为 ASCII,三者在本域内结果相同;显式写出来是为了让
|
|
29
|
+
* 其它语言/其它层(SQL、Go agent)能一字不差地复现 fieldSetVersion。
|
|
30
|
+
*/
|
|
31
|
+
export function compareNotificationFieldPaths(left, right) {
|
|
32
|
+
return left < right ? -1 : left > right ? 1 : 0;
|
|
33
|
+
}
|
|
34
|
+
/** 排序(不去重、不校验;调用方负责先 assert)。返回新数组。 */
|
|
35
|
+
export function sortNotificationFieldPaths(paths) {
|
|
36
|
+
return [...paths].sort(compareNotificationFieldPaths);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* 单条事件的触发形态(定义在本文件是为了让 {@link NotificationFieldDefinition.variants}
|
|
40
|
+
* 能强类型引用而不与 source-definition.ts 形成循环 import)。
|
|
41
|
+
* - `scheduled_node`:正常到点。
|
|
42
|
+
* - `catchup`:一次 overdue 折叠(多个错过的节点塌缩成一条,见设计文档 §7)。
|
|
43
|
+
*/
|
|
44
|
+
export const NOTIFICATION_TRIGGER_MODES = [
|
|
45
|
+
"scheduled_node",
|
|
46
|
+
"catchup",
|
|
47
|
+
];
|
|
48
|
+
/** 字段敏感度。后台**永远不能**改这个值——它是代码侧声明的暴露面等级。 */
|
|
49
|
+
export const NOTIFICATION_FIELD_SENSITIVITIES = [
|
|
50
|
+
"public",
|
|
51
|
+
"internal",
|
|
52
|
+
"restricted",
|
|
53
|
+
];
|
|
54
|
+
/**
|
|
55
|
+
* 字段值形态(供后台展示与 agent 解析用;不是 zod 类型,wire 校验在 contracts)。
|
|
56
|
+
* `stringArray` 是「数组整体作为叶子」的唯一合法形态。
|
|
57
|
+
*/
|
|
58
|
+
export const NOTIFICATION_FIELD_VALUE_KINDS = [
|
|
59
|
+
"string",
|
|
60
|
+
"uuid",
|
|
61
|
+
"url",
|
|
62
|
+
"datetime",
|
|
63
|
+
"integer",
|
|
64
|
+
"ratio",
|
|
65
|
+
"enum",
|
|
66
|
+
"stringArray",
|
|
67
|
+
];
|
|
68
|
+
/** 便于书写与日志展示的 `resource:action` 串。 */
|
|
69
|
+
export function formatNotificationFieldPermission(permission) {
|
|
70
|
+
return `${permission.resource}:${permission.action}`;
|
|
71
|
+
}
|
|
72
|
+
/** 建索引,供 O(1) 查找与未知路径拒绝。 */
|
|
73
|
+
export function indexNotificationFields(fields) {
|
|
74
|
+
const map = new Map();
|
|
75
|
+
for (const field of fields) {
|
|
76
|
+
if (!isNotificationFieldPath(field.path)) {
|
|
77
|
+
throw new Error(`invalid notification field path: ${field.path}`);
|
|
78
|
+
}
|
|
79
|
+
if (map.has(field.path)) {
|
|
80
|
+
throw new Error(`duplicate notification field path: ${field.path}`);
|
|
81
|
+
}
|
|
82
|
+
map.set(field.path, field);
|
|
83
|
+
}
|
|
84
|
+
return map;
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=field-paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-paths.js","sourceRoot":"","sources":["../../src/notification-sources/field-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAC1C,6CAA6C,CAAC;AAEhD,MAAM,UAAU,uBAAuB,CAAC,KAAc;IACpD,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ,IAAI,+BAA+B,CAAC,IAAI,CAAC,KAAK,CAAC,CACzE,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,6BAA6B,CAAC,IAAY,EAAE,KAAa;IACvE,OAAO,IAAI,G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E,CAAC;QACD,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 事件订阅通知能力 —— Block 0:字段集推导(暴露面的唯一计算入口)。
|
|
3
|
+
*
|
|
4
|
+
* 三个身份必须分清(Codex 复审 P0-1,设计文档 §5):
|
|
5
|
+
*
|
|
6
|
+
* configuredFields = 该 config **允许输出**的字段全集
|
|
7
|
+
* = commonRequired ∪ 全部 variantRequired ∪ selectedOptional ∪ 依赖闭包
|
|
8
|
+
* fieldSetVersion = sha256(canonical(configuredFields)) ← **配置级暴露政策身份**
|
|
9
|
+
* includedFields = 某条**具体事件**实际含有的叶子字段集合(⊆ configuredFields)
|
|
10
|
+
*
|
|
11
|
+
* 为什么 fieldSetVersion 不等于每条事件的 includedFields hash:catchup 事件比正常节点
|
|
12
|
+
* 多带折叠身份字段,若强求相等,同一份 config 就要有两个 fieldSetVersion,
|
|
13
|
+
* DTO 与 DB 都得双份。分开后 catchup / 字段依赖 / 配置切换的语义才自洽。
|
|
14
|
+
*/
|
|
15
|
+
import { type NotificationFieldDefinition, type NotificationTriggerMode } from "./field-paths.js";
|
|
16
|
+
import type { NodeEventSourceDefinition } from "./source-definition.js";
|
|
17
|
+
export declare class NotificationFieldSetError extends Error {
|
|
18
|
+
readonly reason: "unknown_field" | "duplicate_field" | "required_field_selected" | "required_field_not_declared" | "empty_field_set" | "configured_set_not_closed";
|
|
19
|
+
constructor(reason: "unknown_field" | "duplicate_field" | "required_field_selected" | "required_field_not_declared" | "empty_field_set" | "configured_set_not_closed", message: string);
|
|
20
|
+
}
|
|
21
|
+
/** required + optional 合并索引(source 声明期一次性建好;重复路径直接抛)。 */
|
|
22
|
+
export declare function indexSourceFields(definition: NodeEventSourceDefinition): ReadonlyMap<string, NotificationFieldDefinition>;
|
|
23
|
+
/**
|
|
24
|
+
* 后台勾选校验 —— **早拒**,绝不静默去重/静默丢弃。
|
|
25
|
+
* 拒绝理由(Codex 复审明确冻结):未知路径、重复路径、把 required 当 optional 勾选。
|
|
26
|
+
*/
|
|
27
|
+
export declare function assertSelectableFields(definition: NodeEventSourceDefinition, selectedFields: readonly string[]): void;
|
|
28
|
+
/**
|
|
29
|
+
* 推导**配置级**字段全集(fieldSetVersion 的输入)。
|
|
30
|
+
* 空 selectedFields 合法(结果仍含 required);空结果集非法(registry 声明有误)。
|
|
31
|
+
*/
|
|
32
|
+
export declare function deriveConfiguredFields(definition: NodeEventSourceDefinition, selectedFields: readonly string[]): readonly string[];
|
|
33
|
+
/**
|
|
34
|
+
* 推导**某条事件**的 includedFields。
|
|
35
|
+
* = configuredFields 中「适用于本 variant」的部分 ∪ 本 variant 的必填(再闭包一次)。
|
|
36
|
+
*
|
|
37
|
+
* 调用方(payload builder / DB 写入)**必须**用本函数的返回值,不得自造 includedFields —
|
|
38
|
+
* 否则「payload 多一个 restricted 字段 + includedFields 也多写一行」即可一起通过精确集校验。
|
|
39
|
+
*/
|
|
40
|
+
export declare function deriveIncludedFields(definition: NodeEventSourceDefinition, configuredFields: readonly string[], triggerMode: NotificationTriggerMode): readonly string[];
|
|
41
|
+
/**
|
|
42
|
+
* 汇总一组字段所需的全部 authz 权限(AND 语义,去重后稳定排序)。
|
|
43
|
+
* 权限不足 → **整个 subscription 403**,不做字段级动态脱敏(设计文档 §9)。
|
|
44
|
+
*/
|
|
45
|
+
export declare function collectRequiredPermissions(definition: NodeEventSourceDefinition, fields: readonly string[]): readonly string[];
|
|
46
|
+
//# sourceMappingURL=field-set.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-set.d.ts","sourceRoot":"","sources":["../../src/notification-sources/field-set.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAIL,KAAK,2BAA2B,EAChC,KAAK,uBAAuB,EAC7B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAExE,qBAAa,yBAA0B,SAAQ,KAAK;IAEhD,QAAQ,CAAC,MAAM,EACX,eAAe,GACf,iBAAiB,GACjB,yBAAyB,GACzB,6BAA6B,GAC7B,iBAAiB,GACjB,2BAA2B;gBANtB,MAAM,EACX,eAAe,GACf,iBAAiB,GACjB,yBAAyB,GACzB,6BAA6B,GAC7B,iBAAiB,GACjB,2BAA2B,EAC/B,OAAO,EAAE,MAAM;CAKlB;AAED,yDAAyD;AACzD,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,yBAAyB,GACpC,WAAW,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAKlD;AAwBD;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,yBAAyB,EACrC,cAAc,EAAE,SAAS,MAAM,EAAE,GAChC,IAAI,CAmCN;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,yBAAyB,EACrC,cAAc,EAAE,SAAS,MAAM,EAAE,GAChC,SAAS,MAAM,EAAE,CA0BnB;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,yBAAyB,EACrC,gBAAgB,EAAE,SAAS,MAAM,EAAE,EACnC,WAAW,EAAE,uBAAuB,GACnC,SAAS,MAAM,EAAE,CAuEnB;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,yBAAyB,EACrC,MAAM,EAAE,SAAS,MAAM,EAAE,GACxB,SAAS,MAAM,EAAE,CAgBnB"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 事件订阅通知能力 —— Block 0:字段集推导(暴露面的唯一计算入口)。
|
|
3
|
+
*
|
|
4
|
+
* 三个身份必须分清(Codex 复审 P0-1,设计文档 §5):
|
|
5
|
+
*
|
|
6
|
+
* configuredFields = 该 config **允许输出**的字段全集
|
|
7
|
+
* = commonRequired ∪ 全部 variantRequired ∪ selectedOptional ∪ 依赖闭包
|
|
8
|
+
* fieldSetVersion = sha256(canonical(configuredFields)) ← **配置级暴露政策身份**
|
|
9
|
+
* includedFields = 某条**具体事件**实际含有的叶子字段集合(⊆ configuredFields)
|
|
10
|
+
*
|
|
11
|
+
* 为什么 fieldSetVersion 不等于每条事件的 includedFields hash:catchup 事件比正常节点
|
|
12
|
+
* 多带折叠身份字段,若强求相等,同一份 config 就要有两个 fieldSetVersion,
|
|
13
|
+
* DTO 与 DB 都得双份。分开后 catchup / 字段依赖 / 配置切换的语义才自洽。
|
|
14
|
+
*/
|
|
15
|
+
import { compareNotificationFieldPaths, indexNotificationFields, isNotificationFieldPath, } from "./field-paths.js";
|
|
16
|
+
export class NotificationFieldSetError extends Error {
|
|
17
|
+
reason;
|
|
18
|
+
constructor(reason, message) {
|
|
19
|
+
super(message);
|
|
20
|
+
this.reason = reason;
|
|
21
|
+
this.name = "NotificationFieldSetError";
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/** required + optional 合并索引(source 声明期一次性建好;重复路径直接抛)。 */
|
|
25
|
+
export function indexSourceFields(definition) {
|
|
26
|
+
return indexNotificationFields([
|
|
27
|
+
...definition.requiredFields,
|
|
28
|
+
...definition.optionalFields,
|
|
29
|
+
]);
|
|
30
|
+
}
|
|
31
|
+
function closeOverRequires(seeds, index) {
|
|
32
|
+
const out = new Set();
|
|
33
|
+
const queue = [...seeds];
|
|
34
|
+
while (queue.length > 0) {
|
|
35
|
+
const path = queue.pop();
|
|
36
|
+
if (out.has(path))
|
|
37
|
+
continue;
|
|
38
|
+
const field = index.get(path);
|
|
39
|
+
if (!field) {
|
|
40
|
+
throw new NotificationFieldSetError("unknown_field", `unknown notification field path: ${path}`);
|
|
41
|
+
}
|
|
42
|
+
out.add(path);
|
|
43
|
+
for (const dep of field.requires ?? [])
|
|
44
|
+
queue.push(dep);
|
|
45
|
+
}
|
|
46
|
+
return out;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* 后台勾选校验 —— **早拒**,绝不静默去重/静默丢弃。
|
|
50
|
+
* 拒绝理由(Codex 复审明确冻结):未知路径、重复路径、把 required 当 optional 勾选。
|
|
51
|
+
*/
|
|
52
|
+
export function assertSelectableFields(definition, selectedFields) {
|
|
53
|
+
// 不可勾选 = common required ∪ **全部 variant required**。
|
|
54
|
+
// 后者也无条件进 configuredFields,允许勾选会让后台以为「取消勾选就不发」——
|
|
55
|
+
// 实际取不掉,是纯误导(Codex 二轮 P0)。
|
|
56
|
+
const requiredPaths = new Set([
|
|
57
|
+
...definition.requiredFields.map((f) => f.path),
|
|
58
|
+
...Object.values(definition.variants).flatMap((v) => v.requiredFields),
|
|
59
|
+
]);
|
|
60
|
+
const optionalPaths = new Set(definition.optionalFields
|
|
61
|
+
.map((f) => f.path)
|
|
62
|
+
.filter((p) => !requiredPaths.has(p)));
|
|
63
|
+
const seen = new Set();
|
|
64
|
+
for (const path of selectedFields) {
|
|
65
|
+
if (!isNotificationFieldPath(path) || !optionalPaths.has(path)) {
|
|
66
|
+
if (requiredPaths.has(path)) {
|
|
67
|
+
throw new NotificationFieldSetError("required_field_selected", `field is always included and must not be selected: ${path}`);
|
|
68
|
+
}
|
|
69
|
+
throw new NotificationFieldSetError("unknown_field", `unknown or non-selectable notification field path: ${path}`);
|
|
70
|
+
}
|
|
71
|
+
if (seen.has(path)) {
|
|
72
|
+
throw new NotificationFieldSetError("duplicate_field", `duplicate selected field path: ${path}`);
|
|
73
|
+
}
|
|
74
|
+
seen.add(path);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* 推导**配置级**字段全集(fieldSetVersion 的输入)。
|
|
79
|
+
* 空 selectedFields 合法(结果仍含 required);空结果集非法(registry 声明有误)。
|
|
80
|
+
*/
|
|
81
|
+
export function deriveConfiguredFields(definition, selectedFields) {
|
|
82
|
+
assertSelectableFields(definition, selectedFields);
|
|
83
|
+
const index = indexSourceFields(definition);
|
|
84
|
+
const seeds = [
|
|
85
|
+
...definition.requiredFields.map((f) => f.path),
|
|
86
|
+
...Object.values(definition.variants).flatMap((v) => v.requiredFields),
|
|
87
|
+
...selectedFields,
|
|
88
|
+
];
|
|
89
|
+
for (const path of seeds) {
|
|
90
|
+
if (!index.has(path)) {
|
|
91
|
+
throw new NotificationFieldSetError("required_field_not_declared", `variant/required field is not declared in the source catalog: ${path}`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
const closed = [...closeOverRequires(seeds, index)].sort(compareNotificationFieldPaths);
|
|
95
|
+
if (closed.length === 0) {
|
|
96
|
+
throw new NotificationFieldSetError("empty_field_set", `source ${definition.sourceId} produced an empty field set`);
|
|
97
|
+
}
|
|
98
|
+
return closed;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* 推导**某条事件**的 includedFields。
|
|
102
|
+
* = configuredFields 中「适用于本 variant」的部分 ∪ 本 variant 的必填(再闭包一次)。
|
|
103
|
+
*
|
|
104
|
+
* 调用方(payload builder / DB 写入)**必须**用本函数的返回值,不得自造 includedFields —
|
|
105
|
+
* 否则「payload 多一个 restricted 字段 + includedFields 也多写一行」即可一起通过精确集校验。
|
|
106
|
+
*/
|
|
107
|
+
export function deriveIncludedFields(definition, configuredFields, triggerMode) {
|
|
108
|
+
const index = indexSourceFields(definition);
|
|
109
|
+
const configured = new Set(configuredFields);
|
|
110
|
+
// fail-closed 前置:configuredFields 必须是**闭包完备**的合法配置集
|
|
111
|
+
//(含全部 common required,且每个字段的 requires 都已在集合内)。
|
|
112
|
+
// 否则后面的闭包会把缺失的依赖「补」进事件,产出**不被 fieldSetVersion 覆盖**的字段
|
|
113
|
+
//(Codex 二轮 P0:暴露面 fail-open)。
|
|
114
|
+
// common required + **全部** variant required 都必须在集合里:只校验当前 variant 的话,
|
|
115
|
+
// 一份损坏的 config 会在 scheduled_node 下侥幸通过、直到第一次 catchup 才爆。
|
|
116
|
+
for (const path of [
|
|
117
|
+
...definition.requiredFields.map((f) => f.path),
|
|
118
|
+
...Object.values(definition.variants).flatMap((v) => v.requiredFields),
|
|
119
|
+
]) {
|
|
120
|
+
if (!configured.has(path)) {
|
|
121
|
+
throw new NotificationFieldSetError("configured_set_not_closed", `configured field set is missing a required field: ${path}`);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
for (const path of configured) {
|
|
125
|
+
const field = index.get(path);
|
|
126
|
+
if (!field) {
|
|
127
|
+
throw new NotificationFieldSetError("unknown_field", `unknown notification field path: ${path}`);
|
|
128
|
+
}
|
|
129
|
+
for (const dep of field.requires ?? []) {
|
|
130
|
+
if (!configured.has(dep)) {
|
|
131
|
+
throw new NotificationFieldSetError("configured_set_not_closed", `configured field set is not dependency-closed: ${path} requires ${dep}`);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
const applicable = [];
|
|
136
|
+
for (const path of configured) {
|
|
137
|
+
const field = index.get(path);
|
|
138
|
+
if (!field) {
|
|
139
|
+
throw new NotificationFieldSetError("unknown_field", `unknown notification field path: ${path}`);
|
|
140
|
+
}
|
|
141
|
+
if (field.variants && !field.variants.includes(triggerMode))
|
|
142
|
+
continue;
|
|
143
|
+
applicable.push(path);
|
|
144
|
+
}
|
|
145
|
+
for (const path of definition.variants[triggerMode].requiredFields) {
|
|
146
|
+
if (!configured.has(path)) {
|
|
147
|
+
throw new NotificationFieldSetError("required_field_not_declared", `variant required field missing from configured set: ${path}`);
|
|
148
|
+
}
|
|
149
|
+
applicable.push(path);
|
|
150
|
+
}
|
|
151
|
+
const included = [...closeOverRequires(applicable, index)].sort(compareNotificationFieldPaths);
|
|
152
|
+
// 二次 fail-closed:闭包结果**必须** ⊆ configuredFields。
|
|
153
|
+
for (const path of included) {
|
|
154
|
+
if (!configured.has(path)) {
|
|
155
|
+
throw new NotificationFieldSetError("configured_set_not_closed", `derived included field escapes the configured set: ${path}`);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return included;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* 汇总一组字段所需的全部 authz 权限(AND 语义,去重后稳定排序)。
|
|
162
|
+
* 权限不足 → **整个 subscription 403**,不做字段级动态脱敏(设计文档 §9)。
|
|
163
|
+
*/
|
|
164
|
+
export function collectRequiredPermissions(definition, fields) {
|
|
165
|
+
const index = indexSourceFields(definition);
|
|
166
|
+
const out = new Set();
|
|
167
|
+
for (const path of fields) {
|
|
168
|
+
const field = index.get(path);
|
|
169
|
+
if (!field) {
|
|
170
|
+
throw new NotificationFieldSetError("unknown_field", `unknown notification field path: ${path}`);
|
|
171
|
+
}
|
|
172
|
+
for (const permission of field.requiredPermissions) {
|
|
173
|
+
out.add(`${permission.resource}:${permission.action}`);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return [...out].sort(compareNotificationFieldPaths);
|
|
177
|
+
}
|
|
178
|
+
//# sourceMappingURL=field-set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-set.js","sourceRoot":"","sources":["../../src/notification-sources/field-set.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EACL,6BAA6B,EAC7B,uBAAuB,EACvB,uBAAuB,GAGxB,MAAM,kBAAkB,CAAC;AAG1B,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IAEvC;IADX,YACW,MAMsB,EAC/B,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;QATN,WAAM,GAAN,MAAM,CAMgB;QAI/B,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;IAC1C,CAAC;CACF;AAED,yDAAyD;AACzD,MAAM,UAAU,iBAAiB,CAC/B,UAAqC;IAErC,OAAO,uBAAuB,CAAC;QAC7B,GAAG,UAAU,CAAC,cAAc;QAC5B,GAAG,UAAU,CAAC,cAAc;KAC7B,CAAC,CAAC;AACL,CAAC;AAED,SAAS,iBAAiB,CACxB,KAAwB,EACxB,KAAu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*
|
|
4
|
+
* ⚠️ Block 0 **不改** `packages/core/src/index.ts`(导出接线统一留给集成块),
|
|
5
|
+
* 后续块先用相对路径 `./notification-sources/index.js` 引用;集成块再 re-export。
|
|
6
|
+
*/
|
|
7
|
+
export * from "./field-paths.js";
|
|
8
|
+
export * from "./source-definition.js";
|
|
9
|
+
export * from "./field-set.js";
|
|
10
|
+
export * from "./post-performance-node.js";
|
|
11
|
+
export * from "./post-performance-node-runtime.js";
|
|
12
|
+
export * from "./registry.js";
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notification-sources/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC;AACnD,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 事件订阅通知能力 —— source registry 子模块入口。
|
|
3
|
+
*
|
|
4
|
+
* ⚠️ Block 0 **不改** `packages/core/src/index.ts`(导出接线统一留给集成块),
|
|
5
|
+
* 后续块先用相对路径 `./notification-sources/index.js` 引用;集成块再 re-export。
|
|
6
|
+
*/
|
|
7
|
+
export * from "./field-paths.js";
|
|
8
|
+
export * from "./source-definition.js";
|
|
9
|
+
export * from "./field-set.js";
|
|
10
|
+
export * from "./post-performance-node.js";
|
|
11
|
+
export * from "./post-performance-node-runtime.js";
|
|
12
|
+
export * from "./registry.js";
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/notification-sources/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC;AACnD,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-sources.test.d.ts","sourceRoot":"","sources":["../../src/notification-sources/notification-sources.test.ts"],"names":[],"mappings":""}
|