@sema-agent/settings-schema 12.2.1 → 13.0.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/CHANGELOG.md +223 -0
- package/README.md +41 -6
- package/conformance/VERSION +1 -1
- package/conformance/cases/c01-entry-salvage-then-typo/expected.json +1 -3
- package/conformance/cases/c03-literal-dotted-top-key/expected.json +4 -12
- package/conformance/cases/c10-record-key-secret-redacted-twice/expected.json +1 -3
- package/conformance/cases/c23-mixed-validity-models/expected.json +2 -6
- package/conformance/cases/c24-valid-entries-with-unknown-keys/expected.json +2 -6
- package/conformance/cases/c25-published-roundtrip-zero-warnings/expected.json +2 -6
- package/conformance/cases/c30-version-triple-a-first/expected.json +2 -6
- package/conformance/cases/c31-version-triple-b-changed/expected.json +2 -6
- package/conformance/cases/c32-version-triple-a-restored/expected.json +2 -6
- package/conformance/cases/c40-s712-identity-only-what-reads-out/expected.json +1 -3
- package/conformance/cases/c41-s792-encoded-pem-identity/expected.json +1 -3
- package/conformance/cases/c42-s792-unknown-key-secret-redacted/expected.json +2 -6
- package/conformance/cases/c43-s792-form-and-deep-encoded-pem/expected.json +1 -3
- package/conformance/cases/c44-s792-utf8-escape-glued-token/expected.json +1 -3
- package/conformance/cases/c45-s792-identity-bounds-and-decode-depth/expected.json +1 -3
- package/conformance/cases/c47-s811-roles-key-url-userinfo-withheld/expected.json +1 -3
- package/conformance/cases/c48-s935-model-headers-transported/expected.json +6 -18
- package/conformance/cases/c49-s935-model-headers-secret-entry-dropped/expected.json +1 -3
- package/conformance/cases/c69-deep-encoded-token-past-every-reading/expected.json +1 -3
- package/conformance/cases/c70-rewritten-token-in-front-of-encoded-pem-header/expected.json +1 -3
- package/conformance/cases/c72-dangling-reference-write-seat-refuses/expected.json +1 -3
- package/conformance/cases/c76-projects-entry-salvage-nested/expected.json +142 -0
- package/conformance/cases/c76-projects-entry-salvage-nested/input.json +54 -0
- package/conformance/cases/c76-projects-entry-salvage-nested/meta.json +6 -0
- package/conformance/cases/cc03-model-compat-unknown-subkey/expected.json +2 -6
- package/conformance/cases/cli01-model-name-nfc-vs-nfd/expected.json +1 -3
- package/conformance/cases/cli02-control-and-zero-width-chars/expected.json +1 -3
- package/conformance/cases/cli05-long-and-prefix-colliding-names/expected.json +6 -18
- package/conformance/cases/t01-absent-domain-key-not-null/expected.json +1 -3
- package/conformance/cases/t03-prototype-name-key-not-swallowed/expected.json +2 -6
- package/conformance/cases/t04-secret-literal-never-in-warning-value/expected.json +1 -3
- package/dist/config-fns.d.ts +94 -8
- package/dist/config-fns.js +254 -116
- package/dist/hooks-config.d.ts +235 -0
- package/dist/hooks-config.js +458 -0
- package/dist/hooks.d.ts +16 -154
- package/dist/hooks.js +17 -111
- package/dist/http-hook-allowlists.d.ts +63 -0
- package/dist/http-hook-allowlists.js +73 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +6 -1
- package/dist/mcp-server-policy.d.ts +75 -0
- package/dist/mcp-server-policy.js +84 -0
- package/dist/safety-merge-spec.d.ts +13 -3
- package/dist/safety-merge-spec.js +10 -3
- package/dist/settings-sources.d.ts +91 -0
- package/dist/settings-sources.js +107 -0
- package/dist/types.d.ts +6 -6
- package/dist/types.js +9 -5
- package/dist/ui-language.d.ts +40 -0
- package/dist/ui-language.js +37 -0
- package/dist/url-pattern.d.ts +33 -0
- package/dist/url-pattern.js +239 -0
- package/package.json +1 -1
|
@@ -41,9 +41,7 @@
|
|
|
41
41
|
"name": "claude-1m",
|
|
42
42
|
"provider": "anthropic",
|
|
43
43
|
"quotaWeight": 1,
|
|
44
|
-
"
|
|
45
|
-
"tier": "standard",
|
|
46
|
-
"vision": false
|
|
44
|
+
"tier": "standard"
|
|
47
45
|
},
|
|
48
46
|
{
|
|
49
47
|
"api": "openai-completions",
|
|
@@ -56,9 +54,7 @@
|
|
|
56
54
|
"name": "gw",
|
|
57
55
|
"provider": "openai",
|
|
58
56
|
"quotaWeight": 1,
|
|
59
|
-
"
|
|
60
|
-
"tier": "standard",
|
|
61
|
-
"vision": false
|
|
57
|
+
"tier": "standard"
|
|
62
58
|
},
|
|
63
59
|
{
|
|
64
60
|
"api": "openai-completions",
|
|
@@ -68,9 +64,7 @@
|
|
|
68
64
|
"name": "plain",
|
|
69
65
|
"provider": "openai",
|
|
70
66
|
"quotaWeight": 1,
|
|
71
|
-
"
|
|
72
|
-
"tier": "standard",
|
|
73
|
-
"vision": false
|
|
67
|
+
"tier": "standard"
|
|
74
68
|
}
|
|
75
69
|
],
|
|
76
70
|
"roles": {},
|
|
@@ -126,9 +120,7 @@
|
|
|
126
120
|
"name": "claude-1m",
|
|
127
121
|
"provider": "anthropic",
|
|
128
122
|
"quotaWeight": 1,
|
|
129
|
-
"
|
|
130
|
-
"tier": "standard",
|
|
131
|
-
"vision": false
|
|
123
|
+
"tier": "standard"
|
|
132
124
|
},
|
|
133
125
|
{
|
|
134
126
|
"api": "openai-completions",
|
|
@@ -141,9 +133,7 @@
|
|
|
141
133
|
"name": "gw",
|
|
142
134
|
"provider": "openai",
|
|
143
135
|
"quotaWeight": 1,
|
|
144
|
-
"
|
|
145
|
-
"tier": "standard",
|
|
146
|
-
"vision": false
|
|
136
|
+
"tier": "standard"
|
|
147
137
|
},
|
|
148
138
|
{
|
|
149
139
|
"api": "openai-completions",
|
|
@@ -153,9 +143,7 @@
|
|
|
153
143
|
"name": "plain",
|
|
154
144
|
"provider": "openai",
|
|
155
145
|
"quotaWeight": 1,
|
|
156
|
-
"
|
|
157
|
-
"tier": "standard",
|
|
158
|
-
"vision": false
|
|
146
|
+
"tier": "standard"
|
|
159
147
|
}
|
|
160
148
|
],
|
|
161
149
|
"roles": {},
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
{
|
|
2
|
+
"domains": {
|
|
3
|
+
"outcome": "effective",
|
|
4
|
+
"effective": {
|
|
5
|
+
"collab": {
|
|
6
|
+
"templates": []
|
|
7
|
+
},
|
|
8
|
+
"entitlement": {
|
|
9
|
+
"budgetGroups": [],
|
|
10
|
+
"groupBindings": [],
|
|
11
|
+
"subjects": [],
|
|
12
|
+
"tiers": []
|
|
13
|
+
},
|
|
14
|
+
"execution": {
|
|
15
|
+
"allowedLanes": [
|
|
16
|
+
"host"
|
|
17
|
+
],
|
|
18
|
+
"required": false
|
|
19
|
+
},
|
|
20
|
+
"governance": {},
|
|
21
|
+
"hosts": {
|
|
22
|
+
"hosts": []
|
|
23
|
+
},
|
|
24
|
+
"limits": {},
|
|
25
|
+
"mcp": {
|
|
26
|
+
"servers": []
|
|
27
|
+
},
|
|
28
|
+
"models": {
|
|
29
|
+
"atMention": {
|
|
30
|
+
"mode": "all"
|
|
31
|
+
},
|
|
32
|
+
"models": [],
|
|
33
|
+
"roles": {},
|
|
34
|
+
"tierGroups": []
|
|
35
|
+
},
|
|
36
|
+
"plugins": {
|
|
37
|
+
"plugins": []
|
|
38
|
+
},
|
|
39
|
+
"projects": {
|
|
40
|
+
"projects": {
|
|
41
|
+
"01890a5d-ac96-774b-bcce-b302099a8001": {
|
|
42
|
+
"defaultScopes": [
|
|
43
|
+
"proj"
|
|
44
|
+
],
|
|
45
|
+
"displayName": "one",
|
|
46
|
+
"gitRemotes": [],
|
|
47
|
+
"registeredAt": "2026-10-01T00:00:00.000Z",
|
|
48
|
+
"registeredBy": "alice"
|
|
49
|
+
},
|
|
50
|
+
"01890a5d-ac96-774b-bcce-b302099a8002": {
|
|
51
|
+
"contextItems": [
|
|
52
|
+
{
|
|
53
|
+
"kind": "folder",
|
|
54
|
+
"value": "/srv/two"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"kind": "note",
|
|
58
|
+
"value": "keep"
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"defaultScopes": [
|
|
62
|
+
"proj"
|
|
63
|
+
],
|
|
64
|
+
"displayName": "two",
|
|
65
|
+
"gitRemotes": [],
|
|
66
|
+
"registeredAt": "2026-10-01T00:00:00.000Z",
|
|
67
|
+
"registeredBy": "alice"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"prompts": {
|
|
72
|
+
"bindings": []
|
|
73
|
+
},
|
|
74
|
+
"rosters": {
|
|
75
|
+
"rosters": []
|
|
76
|
+
},
|
|
77
|
+
"scenarios": {
|
|
78
|
+
"scenarios": []
|
|
79
|
+
},
|
|
80
|
+
"skills": {
|
|
81
|
+
"skills": []
|
|
82
|
+
},
|
|
83
|
+
"systems": {
|
|
84
|
+
"systems": []
|
|
85
|
+
},
|
|
86
|
+
"workers": {
|
|
87
|
+
"workers": []
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"warnings": [
|
|
91
|
+
{
|
|
92
|
+
"domain": "projects",
|
|
93
|
+
"kind": "entry-dropped",
|
|
94
|
+
"path": [
|
|
95
|
+
"projects",
|
|
96
|
+
"01890a5d-ac96-774b-bcce-b302099a8002",
|
|
97
|
+
"contextItems",
|
|
98
|
+
1
|
|
99
|
+
],
|
|
100
|
+
"reasonCode": "entry-schema-invalid"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"domain": "projects",
|
|
104
|
+
"kind": "entry-dropped",
|
|
105
|
+
"path": [
|
|
106
|
+
"projects",
|
|
107
|
+
"01890a5d-ac96-774b-bcce-b302099a8003"
|
|
108
|
+
],
|
|
109
|
+
"reasonCode": "entry-schema-invalid"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"domain": "projects",
|
|
113
|
+
"keys": [
|
|
114
|
+
[
|
|
115
|
+
"projects",
|
|
116
|
+
"01890a5d-ac96-774b-bcce-b302099a8002",
|
|
117
|
+
"contextItems",
|
|
118
|
+
2,
|
|
119
|
+
"typo"
|
|
120
|
+
]
|
|
121
|
+
],
|
|
122
|
+
"kind": "unknown-keys-dropped"
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
"metadata": {
|
|
126
|
+
"version": 18,
|
|
127
|
+
"updatedAt": "2026-10-13T00:00:00.000Z"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"strictWrite": {
|
|
131
|
+
"outcome": "rejected",
|
|
132
|
+
"stage": "validate",
|
|
133
|
+
"why": "拒:读腿要逐条丢两条才读得进的文档,写入席整份拒 —— 写入席不替运维删他的条目(写路径永不抢救)。"
|
|
134
|
+
},
|
|
135
|
+
"wire": {
|
|
136
|
+
"derive": true
|
|
137
|
+
},
|
|
138
|
+
"localRoot": {
|
|
139
|
+
"derive": true,
|
|
140
|
+
"localVersion": 2617555914511015
|
|
141
|
+
}
|
|
142
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"version": 18,
|
|
4
|
+
"updatedAt": "2026-10-13T00:00:00.000Z"
|
|
5
|
+
},
|
|
6
|
+
"domains": {
|
|
7
|
+
"projects": {
|
|
8
|
+
"projects": {
|
|
9
|
+
"01890a5d-ac96-774b-bcce-b302099a8001": {
|
|
10
|
+
"displayName": "one",
|
|
11
|
+
"gitRemotes": [],
|
|
12
|
+
"defaultScopes": [
|
|
13
|
+
"proj"
|
|
14
|
+
],
|
|
15
|
+
"registeredBy": "alice",
|
|
16
|
+
"registeredAt": "2026-10-01T00:00:00.000Z"
|
|
17
|
+
},
|
|
18
|
+
"01890a5d-ac96-774b-bcce-b302099a8002": {
|
|
19
|
+
"displayName": "two",
|
|
20
|
+
"gitRemotes": [],
|
|
21
|
+
"defaultScopes": [
|
|
22
|
+
"proj"
|
|
23
|
+
],
|
|
24
|
+
"registeredBy": "alice",
|
|
25
|
+
"registeredAt": "2026-10-01T00:00:00.000Z",
|
|
26
|
+
"contextItems": [
|
|
27
|
+
{
|
|
28
|
+
"kind": "folder",
|
|
29
|
+
"value": "/srv/two"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"kind": "folder",
|
|
33
|
+
"value": "\\\\?\\C:\\x"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"kind": "note",
|
|
37
|
+
"value": "keep",
|
|
38
|
+
"typo": 1
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
"01890a5d-ac96-774b-bcce-b302099a8003": {
|
|
43
|
+
"displayName": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
44
|
+
"gitRemotes": [],
|
|
45
|
+
"defaultScopes": [
|
|
46
|
+
"proj"
|
|
47
|
+
],
|
|
48
|
+
"registeredBy": "alice",
|
|
49
|
+
"registeredAt": "2026-10-01T00:00:00.000Z"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contributor": "contract",
|
|
3
|
+
"claim": "12.3.0(S-1494)projects 逐条抢救 + 抢救递归:三条登记里第 2 条的第 1 个上下文条目是 Windows 长路径前缀形(12.2.1 起拒)、第 3 条 displayName 201 字。读腿:登记 1、2 在(2 的 contextItems 丢第 1 项,其余照用)、3 不在,两条 entry-dropped 分别点到嵌套那一格与整条登记;第 2 条第 2 项上的拼错键按**原文档**下标报(压缩后它是第 1 项)。严写腿整份拒。打的是三种读法分歧:projects 仍整域拒(12.2.x 读法,整个 scope 的项目停摆)/ 抢救只下到顶层(整条登记 2 连坐丢掉)/ 嵌套坐标报压缩后的下标。",
|
|
4
|
+
"firstRedOn": [],
|
|
5
|
+
"note": "firstRedOn 为空:historical 阶梯(≤ 2.1.0)不覆盖 11.3.0 的 projects 扩形;对 12.2.x 这一条会红(projects 整域拒),那一版不在入库的真跑证据里。"
|
|
6
|
+
}
|
|
@@ -42,9 +42,7 @@
|
|
|
42
42
|
"name": "m0",
|
|
43
43
|
"provider": "openai",
|
|
44
44
|
"quotaWeight": 1,
|
|
45
|
-
"
|
|
46
|
-
"tier": "standard",
|
|
47
|
-
"vision": false
|
|
45
|
+
"tier": "standard"
|
|
48
46
|
}
|
|
49
47
|
],
|
|
50
48
|
"roles": {},
|
|
@@ -101,9 +99,7 @@
|
|
|
101
99
|
"name": "m0",
|
|
102
100
|
"provider": "openai",
|
|
103
101
|
"quotaWeight": 1,
|
|
104
|
-
"
|
|
105
|
-
"tier": "standard",
|
|
106
|
-
"vision": false
|
|
102
|
+
"tier": "standard"
|
|
107
103
|
}
|
|
108
104
|
],
|
|
109
105
|
"roles": {},
|
|
@@ -38,9 +38,7 @@
|
|
|
38
38
|
"name": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
39
39
|
"provider": "openai",
|
|
40
40
|
"quotaWeight": 1,
|
|
41
|
-
"
|
|
42
|
-
"tier": "standard",
|
|
43
|
-
"vision": false
|
|
41
|
+
"tier": "standard"
|
|
44
42
|
},
|
|
45
43
|
{
|
|
46
44
|
"api": "openai-completions",
|
|
@@ -50,9 +48,7 @@
|
|
|
50
48
|
"name": "prefix-shared-name-aaaa",
|
|
51
49
|
"provider": "openai",
|
|
52
50
|
"quotaWeight": 1,
|
|
53
|
-
"
|
|
54
|
-
"tier": "standard",
|
|
55
|
-
"vision": false
|
|
51
|
+
"tier": "standard"
|
|
56
52
|
},
|
|
57
53
|
{
|
|
58
54
|
"api": "openai-completions",
|
|
@@ -62,9 +58,7 @@
|
|
|
62
58
|
"name": "prefix-shared-name-aaab",
|
|
63
59
|
"provider": "openai",
|
|
64
60
|
"quotaWeight": 1,
|
|
65
|
-
"
|
|
66
|
-
"tier": "standard",
|
|
67
|
-
"vision": false
|
|
61
|
+
"tier": "standard"
|
|
68
62
|
}
|
|
69
63
|
],
|
|
70
64
|
"roles": {},
|
|
@@ -117,9 +111,7 @@
|
|
|
117
111
|
"name": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
118
112
|
"provider": "openai",
|
|
119
113
|
"quotaWeight": 1,
|
|
120
|
-
"
|
|
121
|
-
"tier": "standard",
|
|
122
|
-
"vision": false
|
|
114
|
+
"tier": "standard"
|
|
123
115
|
},
|
|
124
116
|
{
|
|
125
117
|
"api": "openai-completions",
|
|
@@ -129,9 +121,7 @@
|
|
|
129
121
|
"name": "prefix-shared-name-aaaa",
|
|
130
122
|
"provider": "openai",
|
|
131
123
|
"quotaWeight": 1,
|
|
132
|
-
"
|
|
133
|
-
"tier": "standard",
|
|
134
|
-
"vision": false
|
|
124
|
+
"tier": "standard"
|
|
135
125
|
},
|
|
136
126
|
{
|
|
137
127
|
"api": "openai-completions",
|
|
@@ -141,9 +131,7 @@
|
|
|
141
131
|
"name": "prefix-shared-name-aaab",
|
|
142
132
|
"provider": "openai",
|
|
143
133
|
"quotaWeight": 1,
|
|
144
|
-
"
|
|
145
|
-
"tier": "standard",
|
|
146
|
-
"vision": false
|
|
134
|
+
"tier": "standard"
|
|
147
135
|
}
|
|
148
136
|
],
|
|
149
137
|
"roles": {},
|
|
@@ -38,9 +38,7 @@
|
|
|
38
38
|
"name": "m0",
|
|
39
39
|
"provider": "openai",
|
|
40
40
|
"quotaWeight": 1,
|
|
41
|
-
"
|
|
42
|
-
"tier": "standard",
|
|
43
|
-
"vision": false
|
|
41
|
+
"tier": "standard"
|
|
44
42
|
}
|
|
45
43
|
],
|
|
46
44
|
"roles": {},
|
|
@@ -115,9 +113,7 @@
|
|
|
115
113
|
"name": "m0",
|
|
116
114
|
"provider": "openai",
|
|
117
115
|
"quotaWeight": 1,
|
|
118
|
-
"
|
|
119
|
-
"tier": "standard",
|
|
120
|
-
"vision": false
|
|
116
|
+
"tier": "standard"
|
|
121
117
|
}
|
|
122
118
|
],
|
|
123
119
|
"roles": {},
|
package/dist/config-fns.d.ts
CHANGED
|
@@ -263,11 +263,16 @@ export declare function isReportableRefusalName(name: string): boolean;
|
|
|
263
263
|
* 摘要输入取 `JSON.stringify(name)`:UTF-8 编码会把孤立代理项换成 U+FFFD(`"\ud800"` / `"\ud801"` / `"\ufffd"` 三个不同的名同一串字节),
|
|
264
264
|
* JSON 串形逐个 UTF-16 码元保留(孤立代理项写成转义)—— 不同的名恒是不同的输入。 */
|
|
265
265
|
export declare function withheldNameToken(name: string): string;
|
|
266
|
-
/**
|
|
266
|
+
/** 抢救造成的**下标位移表**:被压缩过的数组 → 它压缩后每个位置的**原**下标(`kept[j]` = 压缩后第 j 条
|
|
267
267
|
* 在原文档里的下标)。纯数据,无行为。
|
|
268
268
|
*
|
|
269
|
-
*
|
|
270
|
-
*
|
|
269
|
+
* **键 = 那个数组在原文档里的全路径**,经 {@link formatConfigPath} 出门形(12.3.0,S-1494:抢救递归之后,被压缩的数组可以住在
|
|
270
|
+
* 幸存条目体内 —— `"projects.<id>.contextItems"`、`"items.2.subs"`)。顶层数组字段的全路径就是它的字段名(`"models"`),所以
|
|
271
|
+
* 12.2.x 及更早的表(`{ models: [0, 2] }`)形与义都不变。路径段是出门形(Record 键过脱敏器,与告警坐标同一道):两只不同的、
|
|
272
|
+
* 都被打码成同一串的 Record 键体内各有一个压缩数组时,那一格坐标本身就分不清是谁 —— 那个键不登记(不回写好过回写错)。
|
|
273
|
+
*
|
|
274
|
+
* 只登记**真发生过丢弃或位移**的数组 —— 没丢的数组没有位移,给它登记一份恒等映射只会把「有没有位移」
|
|
275
|
+
* 从表的**在场性**挪成表的**内容**,凭空多一层判据。Record 永不登记:它的条目按键寻址,丢一条
|
|
271
276
|
* 不动其余键的坐标。 */
|
|
272
277
|
export type EntryKeptIndex = Readonly<Record<string, readonly number[]>>;
|
|
273
278
|
/** {@link salvageEntries} 的结果。`raw` 是剔掉坏条目后的文档;**什么都没丢时返回原引用**
|
|
@@ -304,10 +309,19 @@ export interface EntrySalvageResult {
|
|
|
304
309
|
* 抛出来的文案可能带 secret。抢救是**尽力而为**的:抢不动就当没抢救(返回原引用),让既有的整域档位去裁,
|
|
305
310
|
* 绝不把解析拖下水、更不回显它的错误(与同文件 {@link droppedKeys} 逐字同纪律)。
|
|
306
311
|
*
|
|
307
|
-
*
|
|
312
|
+
* **递归**(12.3.0,S-1494):集合里的每一条,先对它自己按**同一个函数**抢救(它的 schema 若是带集合字段的对象 —— 从 schema 派生,
|
|
313
|
+
* 没有任何域专用分支),再拿抢救后的那一条去判整条。体内丢的子条目以父坐标为前缀上账(`["projects", <id>, "contextItems", 1]`),
|
|
314
|
+
* 体内压缩过的数组以全路径进位移表({@link EntryKeptIndex});整条最终仍判不过 ⇒ 整条丢,它体内的半路账一并作废(一条一个结论),
|
|
315
|
+
* 记账行的判决取**原文**的(拒句坐标是原文档的,不是抢救形里压缩过的下标)。
|
|
316
|
+
* 零幸存者律在**每一层**成立 —— 体内的集合全坏 ⇒ 不压成空集合,那一条照原样去判(于是整条丢):嵌套里同样有「空 = 不设限」的字段
|
|
317
|
+
* (`skills[].scenarios` / `mcp.servers[].allowTools` …),抢救成 `[]` 就是把限定范围放成全开。账按文档序排(父条目丢在哪个位置,
|
|
318
|
+
* 体内的子条目就排在哪个位置)。
|
|
319
|
+
*
|
|
320
|
+
* 边界(如实登记):① 只下钻**条目**(集合的元素 / 值),不下钻顶层的普通对象字段(`models.atMention` 不是条目);② raw 不是
|
|
308
321
|
* 纯 JSON 对象、字段值与 schema 形状对不上(schema 说数组、文档给对象)⇒ 原样返回,交给整域档位裁;
|
|
309
322
|
* ③ 域级判据(重名 / 悬空 ref)不在本函数视野内 —— 丢条目救不了它们,调用方据此回落整域档位;
|
|
310
|
-
* ④ 只认 `ZodArray` / `ZodRecord` 两种条目集合形 —— 别的形(元组等)不抢救,退回整域档位(保守方向)
|
|
323
|
+
* ④ 只认 `ZodArray` / `ZodRecord` 两种条目集合形 —— 别的形(元组等)不抢救,退回整域档位(保守方向);⑤ 递归深度止于 schema
|
|
324
|
+
* (本包没有自引用 schema);`z.lazy` 包着的 schema 不展开(`unwrapSchema` 不认它)⇒ 不下钻,那一条按原样判。
|
|
311
325
|
*/
|
|
312
326
|
export declare function salvageEntries(schema: z.ZodType, raw: unknown): EntrySalvageResult;
|
|
313
327
|
/**
|
|
@@ -362,7 +376,8 @@ export type EffectiveReadWarning = {
|
|
|
362
376
|
/** 一条**条目**没通过它自己的 entry schema,被单独丢掉了(域内其余条目照常生效)。`path` = 段坐标
|
|
363
377
|
* (`["models",3]` / `["roles","summarize"]`),与 `unknown-keys-dropped` 的坐标形同一套。逐条一发 —— 载荷是
|
|
364
378
|
* O(域里的条目数),与被读文档同阶,不放大,故不设条数上限(有上限的是**单条**告警里的键列表)。
|
|
365
|
-
* 2.0.0 起;只可能来自 {@link
|
|
379
|
+
* 2.0.0 起;只可能来自 {@link DOMAIN_ENTRY_SALVAGE} 判 `"salvage"` 的域(12.3.0 起该表单列;此前挂在 `DOMAIN_READ_FALLBACK` 的
|
|
380
|
+
* `"default"` 档上),闸域坏条目仍然整域读不进。`path` 可以落在幸存条目体内(12.3.0 递归:`["projects", <id>, "contextItems", 1]`)。
|
|
366
381
|
* **S-712**(additive):`identity` = 被丢条目原文里读得出的身份({@link DroppedEntryIdentity};
|
|
367
382
|
* 读不出 ⇒ 键缺席),消费方据此知道「丢的是谁」而不必拿坐标回读原文档。
|
|
368
383
|
* **S-1295**(additive):`reasonCode` = 为什么丢的机读闭集词({@link DROPPED_ENTRY_REASON_CODES}),消费方据此知道「为什么丢」
|
|
@@ -486,12 +501,34 @@ export declare const EXTENSION_NAMESPACES: Partial<Record<DomainName, ReadonlyAr
|
|
|
486
501
|
* 契约(`semaGPT_5` / `semaX-v2` 都是成员,后缀不设未声明的文法)。 */
|
|
487
502
|
export declare function isReservedExtensionKey(domain: DomainName, parent: ConfigPath, key: string): boolean;
|
|
488
503
|
/**
|
|
489
|
-
*
|
|
490
|
-
*
|
|
504
|
+
* **文档面**的域读函数:一域的严 parse + **静默剥键/静默承运两条告警**,**永不抢救**。`FileConfigStore.getDomain`(于是 `exportBundle`、
|
|
505
|
+
* `createSiblingResolver`)与一致性门写入席(`strictWrite` 腿)读它 —— 此前只有 effective 那条路径有门,而 `getDomain` 是 `exportBundle` 的读法
|
|
491
506
|
* (对抗复审 复审 round2 F3:导出一份被剥了键的域再导入 = 持久的配置丢失,而且全程无声)。
|
|
507
|
+
*
|
|
508
|
+
* 文档面回答「这份文档本身读不读得进」:读不进就抛(sanitized ZodError),一条条目都不替运维删 —— 写入席、导出、读改写的「现状」读的都是它。
|
|
509
|
+
* 视图面(「这份文档在生效配置里是什么」)是 {@link parseDomainSalvaged}:同一只内部体({@link readDomainDocument}),读不进时多一步逐条抢救。
|
|
492
510
|
*/
|
|
493
511
|
export declare function parseDomainLoud<K extends DomainName>(domain: K, raw: unknown, onWarning?: (w: EffectiveReadWarning) => void): DomainConfig[K];
|
|
512
|
+
/**
|
|
513
|
+
* **视图面**的域读函数(12.3.0,S-1494):与 {@link parseDomainLoud} 同一只内部体,整域读不进时按 {@link DOMAIN_ENTRY_SALVAGE} 逐条抢救。
|
|
514
|
+
* `buildEffective` 十六个域一处调它(`parseOr`);管理面要显示「生效配置里这个域是什么」时读它。
|
|
515
|
+
*
|
|
516
|
+
* 读法:
|
|
517
|
+
* 1. 整域 `parseDomain`;过 ⇒ 未知键两条告警按原文档坐标出门,返回 —— 与 {@link parseDomainLoud} 逐字同值同告警(好配置的路径一字不动)。
|
|
518
|
+
* 2. 不过,且 {@link DOMAIN_ENTRY_SALVAGE} 判该域 `"salvage"` ⇒ {@link salvageEntries}(递归到嵌套集合);丢了东西 ⇒ 拿压缩后的
|
|
519
|
+
* 文档再 `parseDomain` 一次。过 ⇒ 每条被丢条目一条 `entry-dropped`(它们本来就是原文档坐标),其余告警是对压缩文档的诊断,
|
|
520
|
+
* 过本层位移表({@link rebaseWarningPaths})回写成原文档坐标(坐标律 S-323b)。
|
|
521
|
+
* 3. 其余一切(`"none"` 档、什么都没丢、丢了仍读不进)⇒ **抛第 1 步的原错**,零告警 —— 一个域一个结论:没救活就不留「丢了某条」的半路叙述。
|
|
522
|
+
* 整域读不进之后是默认化还是抛,是调用方按 {@link DOMAIN_READ_FALLBACK} 的事(`buildEffective` 的 `parseOr`),本函数不读那张表。
|
|
523
|
+
*
|
|
524
|
+
* 写路径与导出面不调它:`parseDomain` / `validateDomain` / `writeDomainFile` 判整份文档,写入席与 `getDomain` / `exportBundle` 读 {@link parseDomainLoud}。
|
|
525
|
+
* 读改写(读存量、改、整份写回)的「现状」也不许读它 —— 抢救读出再写回,被丢的条目就成了删除。
|
|
526
|
+
*/
|
|
527
|
+
export declare function parseDomainSalvaged<K extends DomainName>(domain: K, raw: unknown, onWarning?: (w: EffectiveReadWarning) => void): DomainConfig[K];
|
|
494
528
|
/** Per-domain READ-corruption policy (0.8.1) — what buildEffective does when a stored domain no longer parses.
|
|
529
|
+
* **One question only** (12.3.0, S-1494): the domain as a whole is unreadable — after {@link parseDomainSalvaged} has tried
|
|
530
|
+
* whatever entry salvage {@link DOMAIN_ENTRY_SALVAGE} allows — so does the read default it or throw? Whether single bad
|
|
531
|
+
* entries may be dropped is the OTHER table's question; neither table reads the other.
|
|
495
532
|
* `"default"` = degrade to the schema default + warn (safe: the default only REMOVES capability, fail-closed).
|
|
496
533
|
* `"throw"` = keep fail-loud (defaulting would LOOSEN gates or destructively apply — worse than an outage,
|
|
497
534
|
* consumers fail-static on last-good). A `satisfies Record<DomainName,…>` forces every FUTURE domain to make
|
|
@@ -534,6 +571,55 @@ export declare const DOMAIN_READ_FALLBACK: {
|
|
|
534
571
|
readonly prompts: "default";
|
|
535
572
|
readonly limits: "throw";
|
|
536
573
|
};
|
|
574
|
+
/** Per-domain ENTRY-SALVAGE policy (12.3.0, S-1494) — may the view-face domain reader ({@link parseDomainSalvaged}) drop single bad
|
|
575
|
+
* entries (an array element, a Record value, and — recursively — a bad entry inside a surviving entry) and read the rest?
|
|
576
|
+
* **One question only**: what happens when the domain stays unreadable after that is {@link DOMAIN_READ_FALLBACK}'s question.
|
|
577
|
+
* `"salvage"` = drop each bad entry, name it (`entry-dropped`, coordinate + identity + reason word), keep the rest.
|
|
578
|
+
* `"none"` = never drop a single entry: the first bad entry makes the whole domain unreadable.
|
|
579
|
+
* A `satisfies Record<DomainName,…>` forces every FUTURE domain to answer this explicitly (compile error until classified).
|
|
580
|
+
*
|
|
581
|
+
* **View face only.** The document face never salvages: `parseDomain` / `validateDomain` / `writeDomainFile` judge the whole
|
|
582
|
+
* document, and {@link parseDomainLoud} — what the conformance write seat (`strictWrite` leg), `FileConfigStore.getDomain` and
|
|
583
|
+
* `exportBundle` read — throws on it. A write path that reads the stored "current" value through `parseDomainSalvaged` and writes
|
|
584
|
+
* it back would turn every dropped entry into a deletion — read-modify-write faces read the stored document with the document face.
|
|
585
|
+
*
|
|
586
|
+
* Per-domain rationale:
|
|
587
|
+
* - models/skills/mcp/plugins/scenarios/systems/collab/prompts: additive capability / content catalogs — a dropped entry is
|
|
588
|
+
* one capability gone (fail-closed). Inside a surviving entry the same holds: the nested collections these entries carry
|
|
589
|
+
* are allowlists / scopings (`allowTools`, `scenarios`, `rosters`, `callsWorkers`, …) where one entry fewer only NARROWS,
|
|
590
|
+
* and the zero-survivor law (never mint an empty collection — several of these read "empty = all") holds at every level.
|
|
591
|
+
* - hosts: a dropped host is one placement target fewer; a dropped label makes a host match fewer `placement.requires`.
|
|
592
|
+
* - projects: SALVAGE — a registration absent from the ledger = that project's claim is refused (fail-closed). Throwing the
|
|
593
|
+
* whole domain stops EVERY project of the scope, which protects nothing: one stored registration that a later, tighter
|
|
594
|
+
* schema refuses (12.2.1's UNC judgement on `contextItems[].value`) must not take the scope's other projects with it.
|
|
595
|
+
* Its whenUnreadable stance stays `"throw"` (a ledger that cannot be read at all is never defaulted — see
|
|
596
|
+
* {@link DOMAIN_READ_FALLBACK}).
|
|
597
|
+
* - rosters: NONE — a dropped roster makes resolveEffectiveForWorker fall back to the FULL models catalog for that worker
|
|
598
|
+
* (放权,不许).
|
|
599
|
+
* - workers: NONE — a dropped worker row reads as "this worker is no longer declared": the reconciler would retire it. The
|
|
600
|
+
* per-row tolerance this domain does have lives in `readWorkersRows` (rows are HELD with their original, never dropped).
|
|
601
|
+
* - governance: NONE — a dropped commandPolicy / approvalRequire row is a guardrail silently gone (放权,不许).
|
|
602
|
+
* - entitlement: NONE — a dropped tier / subject / binding / budget group changes who may do what (放权,不许).
|
|
603
|
+
* - execution: NONE — a dropped lane / public key changes the execution mandate (放权,不许).
|
|
604
|
+
* - limits: NONE — a dropped allowlist row changes a published ceiling (the domain is the one publishing seat of those ceilings). */
|
|
605
|
+
export declare const DOMAIN_ENTRY_SALVAGE: {
|
|
606
|
+
readonly models: "salvage";
|
|
607
|
+
readonly rosters: "none";
|
|
608
|
+
readonly skills: "salvage";
|
|
609
|
+
readonly mcp: "salvage";
|
|
610
|
+
readonly plugins: "salvage";
|
|
611
|
+
readonly scenarios: "salvage";
|
|
612
|
+
readonly systems: "salvage";
|
|
613
|
+
readonly collab: "salvage";
|
|
614
|
+
readonly workers: "none";
|
|
615
|
+
readonly hosts: "salvage";
|
|
616
|
+
readonly governance: "none";
|
|
617
|
+
readonly entitlement: "none";
|
|
618
|
+
readonly execution: "none";
|
|
619
|
+
readonly projects: "salvage";
|
|
620
|
+
readonly prompts: "salvage";
|
|
621
|
+
readonly limits: "none";
|
|
622
|
+
};
|
|
537
623
|
/** 一个读者向店要文档的口:配置域,以及墓碑表里的retired 域({@link RETIRED_DOMAINS})—— 后者只为让墓碑看见没迁的旧文档。 */
|
|
538
624
|
export type StoredDocumentReader = (d: DomainName | RetiredDomainName) => unknown;
|
|
539
625
|
/**
|