@sema-agent/settings-schema 14.6.0 → 14.7.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.
Files changed (65) hide show
  1. package/CHANGELOG.md +266 -0
  2. package/README.md +31 -3
  3. package/conformance/VERSION +1 -1
  4. package/conformance/cases/c84-sandbox-git-block-carried-verbatim/expected.json +153 -0
  5. package/conformance/cases/c84-sandbox-git-block-carried-verbatim/input.json +23 -0
  6. package/conformance/cases/c84-sandbox-git-block-carried-verbatim/meta.json +5 -0
  7. package/conformance/cases/c85-sandbox-git-refused-block-still-carried/expected.json +153 -0
  8. package/conformance/cases/c85-sandbox-git-refused-block-still-carried/input.json +23 -0
  9. package/conformance/cases/c85-sandbox-git-refused-block-still-carried/meta.json +5 -0
  10. package/dist/api/auth-bridge.d.ts +16 -2
  11. package/dist/api/auth-bridge.js +59 -24
  12. package/dist/api/credentials.d.ts +281 -0
  13. package/dist/api/credentials.js +149 -0
  14. package/dist/api/scopes.js +5 -1
  15. package/dist/config-d-file.js +33 -15
  16. package/dist/config-fns.js +142 -78
  17. package/dist/conformance/canonical.js +4 -4
  18. package/dist/conformance/contract-adapter.js +26 -1
  19. package/dist/conformance/corpus.js +4 -4
  20. package/dist/conformance/derive.js +2 -2
  21. package/dist/conformance/run.js +43 -6
  22. package/dist/cross-session.d.ts +4 -4
  23. package/dist/declared-capture.d.ts +41 -0
  24. package/dist/declared-capture.js +344 -0
  25. package/dist/file-edit.js +11 -15
  26. package/dist/fleet.d.ts +11 -0
  27. package/dist/fleet.js +59 -26
  28. package/dist/hash.d.ts +0 -9
  29. package/dist/hash.js +64 -7
  30. package/dist/hooks-config.js +18 -3
  31. package/dist/http-hook-allowlists.d.ts +22 -9
  32. package/dist/http-hook-allowlists.js +169 -91
  33. package/dist/index.d.ts +2 -0
  34. package/dist/index.js +2 -0
  35. package/dist/mcp-request-entry.d.ts +9 -7
  36. package/dist/mcp-request-entry.js +89 -82
  37. package/dist/one-time-migrations.js +207 -95
  38. package/dist/own-key-read.d.ts +247 -0
  39. package/dist/own-key-read.js +449 -0
  40. package/dist/plain-json-object.d.ts +11 -1
  41. package/dist/plain-json-object.js +37 -1
  42. package/dist/remote-exec.js +9 -1
  43. package/dist/safety-merge-spec.js +50 -37
  44. package/dist/sandbox-git.d.ts +64 -0
  45. package/dist/sandbox-git.js +89 -0
  46. package/dist/scheduler-store.js +19 -11
  47. package/dist/settings-units.js +14 -12
  48. package/dist/types.d.ts +6 -2
  49. package/dist/types.js +11 -6
  50. package/dist/url-shape.d.ts +16 -0
  51. package/dist/url-shape.js +18 -0
  52. package/dist/web-admin-credential.js +5 -2
  53. package/dist/web-admin-session-url.js +2 -2
  54. package/dist/worker-row-verdict.d.ts +11 -0
  55. package/dist/worker-row-verdict.js +51 -1
  56. package/dist/workers-rows.js +38 -10
  57. package/dist/zod-unwrap.d.ts +6 -0
  58. package/dist/zod-unwrap.js +14 -7
  59. package/docs/API-SURFACE.md +35 -4
  60. package/docs/CONSUMER-INTEGRATION.md +178 -0
  61. package/llms-full.txt +23 -4
  62. package/llms.txt +3 -2
  63. package/package.json +1 -1
  64. package/dist/definition-copy.d.ts +0 -23
  65. package/dist/definition-copy.js +0 -52
@@ -1,23 +0,0 @@
1
- /**
2
- * 包内私有(不进主桶、不进 exports 表):**定义语义的复制**。读不可信的串数组、写读出来的副本,都不许走 `[[Set]]` 与继承的成员 ——
3
- * `Object.prototype` / `Array.prototype` 上被污染的数字键(getter / setter)、`get` / `set` 键、数组实例上被替换的 `Symbol.iterator`,
4
- * 在下标赋值、`push`、展开、描述符对象字面量上各有一条路能把条目吞掉、替换或抛出去。本模块是这件事的唯一读法,读者只调它:
5
- * · {@link captureStringArray}:一份串数组的捕获副本(按下标、`hasOwn`、一次读、非串即坏、`defineProperty` 写入);
6
- * · {@link dataDescriptor}:写副本用的描述符,零原型(`{ value, writable, enumerable, configurable }` 字面量继承 `Object.prototype`,
7
- * `Object.prototype.get` / `set` 被污染时它会被读成访问器描述符)。
8
- * 零 import。
9
- */
10
- /** 数据属性描述符(可写 / 可枚举 / 可配置),**零原型**:不继承 `Object.prototype` 上被污染的 `get` / `set` 等键,也不靠对象字面量。 */
11
- export declare function dataDescriptor(value: unknown): PropertyDescriptor;
12
- /**
13
- * 一份**串数组的捕获副本**;不是串数组 ⇒ `undefined`(调用方据此读成坏形 —— 名单读成 `[]` 并点名,`args` 丢键并进 `lost`)。
14
- * **取值 + 检视 + 复制整段在一个 try 里**,`length` 与每个元素都只读一次(检视与后续使用不会读到两个答案):
15
- * · 不是数组,或 `length` 不是安全非负整数(读成字符串的 Proxy 等)⇒ 坏形,不按 `length` 物化;
16
- * · 逐下标先问 `Object.hasOwn` 再读 —— 洞(不是自有下标)⇒ 坏形,不顺原型链读到 `Object.prototype` / `Array.prototype` 上的数字键(数据属性或访问器);
17
- * · 条目不是串 ⇒ 坏形;遇到第一个坏处就退出(`length` 很大的稀疏数组立即判坏形);
18
- * · 副本用 `Object.defineProperty` + {@link dataDescriptor} 写(`push` / 下标赋值是 `[[Set]]`,会命中继承的数字键 setter、吞掉条目);
19
- * · 不走迭代协议(展开 / `for…of` 会让数组实例上被替换的 `Symbol.iterator` 供出别的条目);
20
- * · 读 `length` / 元素时抛(getter、Proxy 陷阱)⇒ 坏形,不抛出去。
21
- * 交出去的是**副本**(不是调用方数组的原引用):调用方之后改原数组,副本不变。
22
- */
23
- export declare function captureStringArray(v: unknown): string[] | undefined;
@@ -1,52 +0,0 @@
1
- /**
2
- * 包内私有(不进主桶、不进 exports 表):**定义语义的复制**。读不可信的串数组、写读出来的副本,都不许走 `[[Set]]` 与继承的成员 ——
3
- * `Object.prototype` / `Array.prototype` 上被污染的数字键(getter / setter)、`get` / `set` 键、数组实例上被替换的 `Symbol.iterator`,
4
- * 在下标赋值、`push`、展开、描述符对象字面量上各有一条路能把条目吞掉、替换或抛出去。本模块是这件事的唯一读法,读者只调它:
5
- * · {@link captureStringArray}:一份串数组的捕获副本(按下标、`hasOwn`、一次读、非串即坏、`defineProperty` 写入);
6
- * · {@link dataDescriptor}:写副本用的描述符,零原型(`{ value, writable, enumerable, configurable }` 字面量继承 `Object.prototype`,
7
- * `Object.prototype.get` / `set` 被污染时它会被读成访问器描述符)。
8
- * 零 import。
9
- */
10
- /** 数据属性描述符(可写 / 可枚举 / 可配置),**零原型**:不继承 `Object.prototype` 上被污染的 `get` / `set` 等键,也不靠对象字面量。 */
11
- export function dataDescriptor(value) {
12
- const descriptor = Object.create(null);
13
- descriptor.value = value;
14
- descriptor.writable = true;
15
- descriptor.enumerable = true;
16
- descriptor.configurable = true;
17
- return descriptor;
18
- }
19
- /**
20
- * 一份**串数组的捕获副本**;不是串数组 ⇒ `undefined`(调用方据此读成坏形 —— 名单读成 `[]` 并点名,`args` 丢键并进 `lost`)。
21
- * **取值 + 检视 + 复制整段在一个 try 里**,`length` 与每个元素都只读一次(检视与后续使用不会读到两个答案):
22
- * · 不是数组,或 `length` 不是安全非负整数(读成字符串的 Proxy 等)⇒ 坏形,不按 `length` 物化;
23
- * · 逐下标先问 `Object.hasOwn` 再读 —— 洞(不是自有下标)⇒ 坏形,不顺原型链读到 `Object.prototype` / `Array.prototype` 上的数字键(数据属性或访问器);
24
- * · 条目不是串 ⇒ 坏形;遇到第一个坏处就退出(`length` 很大的稀疏数组立即判坏形);
25
- * · 副本用 `Object.defineProperty` + {@link dataDescriptor} 写(`push` / 下标赋值是 `[[Set]]`,会命中继承的数字键 setter、吞掉条目);
26
- * · 不走迭代协议(展开 / `for…of` 会让数组实例上被替换的 `Symbol.iterator` 供出别的条目);
27
- * · 读 `length` / 元素时抛(getter、Proxy 陷阱)⇒ 坏形,不抛出去。
28
- * 交出去的是**副本**(不是调用方数组的原引用):调用方之后改原数组,副本不变。
29
- */
30
- export function captureStringArray(v) {
31
- try {
32
- if (!Array.isArray(v))
33
- return undefined;
34
- const source = v;
35
- const n = source.length;
36
- if (typeof n !== "number" || !Number.isSafeInteger(n) || n < 0)
37
- return undefined;
38
- const copy = [];
39
- for (let i = 0; i < n; i++) {
40
- if (!Object.hasOwn(source, i))
41
- return undefined;
42
- const entry = source[i];
43
- if (typeof entry !== "string")
44
- return undefined;
45
- Object.defineProperty(copy, i, dataDescriptor(entry));
46
- }
47
- return copy;
48
- }
49
- catch {
50
- return undefined;
51
- }
52
- }