theorum 0.1.2 → 0.1.4

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 (150) hide show
  1. package/README.md +83 -27
  2. package/deno.json +57 -0
  3. package/deno.lock +469 -0
  4. package/docs/AGENT_PROFILE_CONTRACT.md +45 -18
  5. package/docs/CLI_SPEC.md +2 -2
  6. package/docs/SECRETS.md +27 -22
  7. package/mod.ts +95 -0
  8. package/package.json +37 -29
  9. package/src/cli/commands/profile.ts +57 -0
  10. package/src/cli/commands/run.ts +66 -0
  11. package/src/cli/commands/test.ts +195 -0
  12. package/src/cli/index.ts +161 -0
  13. package/src/cli/matrix/fixtures.ts +96 -0
  14. package/src/cli/matrix/synthesizer.ts +240 -0
  15. package/src/guardrails/error.ts +142 -0
  16. package/src/guardrails/injection.ts +254 -0
  17. package/src/guardrails/mod.ts +40 -0
  18. package/src/guardrails/quota.ts +87 -0
  19. package/src/guardrails/sanitize.ts +165 -0
  20. package/src/guardrails/sensitive.ts +96 -0
  21. package/src/host/mint-trace.ts +54 -0
  22. package/src/host/mod.ts +20 -0
  23. package/src/host/reply.ts +32 -0
  24. package/src/kernel/engine/assert.ts +29 -0
  25. package/src/kernel/engine/boundary.ts +75 -0
  26. package/src/kernel/engine/delta.ts +440 -0
  27. package/src/kernel/engine/hash.ts +11 -0
  28. package/src/kernel/engine/record.ts +8 -0
  29. package/src/kernel/engine/repair.ts +56 -0
  30. package/src/kernel/engine/runner/gates.ts +338 -0
  31. package/src/kernel/engine/runner/mod.ts +135 -0
  32. package/src/kernel/engine/runner/state.ts +31 -0
  33. package/src/kernel/engine/runner/steps.ts +183 -0
  34. package/src/kernel/engine/runner/stream.ts +83 -0
  35. package/src/kernel/engine/runner/tokens.ts +47 -0
  36. package/src/kernel/engine/runner/tools.ts +266 -0
  37. package/src/kernel/engine/runner.ts +7 -0
  38. package/src/kernel/engine/tree.ts +18 -0
  39. package/src/kernel/mod.ts +39 -0
  40. package/src/kernel/registry/attachments.ts +195 -0
  41. package/src/kernel/registry/catalog.ts +181 -0
  42. package/src/kernel/registry/ingress.ts +223 -0
  43. package/src/kernel/registry/profiles.ts +165 -0
  44. package/src/kernel/registry/provider-request.ts +31 -0
  45. package/src/kernel/registry/resolve.ts +290 -0
  46. package/src/kernel/registry/schemas.ts +29 -0
  47. package/src/kernel/registry/tools.ts +45 -0
  48. package/src/kernel/registry/vault.ts +26 -0
  49. package/src/kernel/types.ts +576 -0
  50. package/{esm/src/observability/mod.js → src/observability/mod.ts} +11 -2
  51. package/src/observability/spans.ts +70 -0
  52. package/src/observability/trace-attach.ts +96 -0
  53. package/src/observability/trace-record.ts +254 -0
  54. package/src/observability/trace-usage.ts +36 -0
  55. package/src/observability/trace.ts +143 -0
  56. package/src/presets/google.ts +147 -0
  57. package/src/presets/mod.ts +24 -0
  58. package/src/providers/create-provider.ts +64 -0
  59. package/src/providers/gemini-tape.ts +59 -0
  60. package/src/providers/google-tap.ts +57 -0
  61. package/src/providers/interactions.ts +182 -0
  62. package/src/providers/keys.ts +182 -0
  63. package/src/providers/mod.ts +12 -0
  64. package/src/providers/openrouter-mod.ts +16 -0
  65. package/src/providers/openrouter-payload.ts +232 -0
  66. package/src/providers/openrouter.ts +758 -0
  67. package/src/providers/pcm.ts +37 -0
  68. package/src/providers/provider.ts +206 -0
  69. package/src/providers/speech.ts +180 -0
  70. package/src/providers/sse.ts +59 -0
  71. package/esm/_dnt.polyfills.d.ts +0 -11
  72. package/esm/_dnt.polyfills.js +0 -15
  73. package/esm/_dnt.shims.d.ts +0 -5
  74. package/esm/_dnt.shims.js +0 -61
  75. package/esm/mod.d.ts +0 -37
  76. package/esm/mod.js +0 -35
  77. package/esm/package.json +0 -3
  78. package/esm/src/guardrails/error.d.ts +0 -35
  79. package/esm/src/guardrails/error.js +0 -116
  80. package/esm/src/guardrails/injection.d.ts +0 -12
  81. package/esm/src/guardrails/injection.js +0 -220
  82. package/esm/src/guardrails/keys.d.ts +0 -12
  83. package/esm/src/guardrails/keys.js +0 -132
  84. package/esm/src/guardrails/mod.d.ts +0 -14
  85. package/esm/src/guardrails/mod.js +0 -14
  86. package/esm/src/guardrails/sanitize.d.ts +0 -22
  87. package/esm/src/guardrails/sanitize.js +0 -133
  88. package/esm/src/guardrails/sensitive.d.ts +0 -12
  89. package/esm/src/guardrails/sensitive.js +0 -88
  90. package/esm/src/kernel/engine/boundary.d.ts +0 -10
  91. package/esm/src/kernel/engine/boundary.js +0 -55
  92. package/esm/src/kernel/engine/delta.d.ts +0 -8
  93. package/esm/src/kernel/engine/delta.js +0 -362
  94. package/esm/src/kernel/engine/hash.d.ts +0 -1
  95. package/esm/src/kernel/engine/hash.js +0 -9
  96. package/esm/src/kernel/engine/record.d.ts +0 -2
  97. package/esm/src/kernel/engine/record.js +0 -7
  98. package/esm/src/kernel/engine/repair.d.ts +0 -9
  99. package/esm/src/kernel/engine/repair.js +0 -38
  100. package/esm/src/kernel/engine/runner.d.ts +0 -14
  101. package/esm/src/kernel/engine/runner.js +0 -731
  102. package/esm/src/kernel/engine/tree.d.ts +0 -2
  103. package/esm/src/kernel/engine/tree.js +0 -17
  104. package/esm/src/kernel/mod.d.ts +0 -16
  105. package/esm/src/kernel/mod.js +0 -15
  106. package/esm/src/kernel/registry/catalog.d.ts +0 -24
  107. package/esm/src/kernel/registry/catalog.js +0 -213
  108. package/esm/src/kernel/registry/profiles.d.ts +0 -36
  109. package/esm/src/kernel/registry/profiles.js +0 -111
  110. package/esm/src/kernel/registry/resolve.d.ts +0 -20
  111. package/esm/src/kernel/registry/resolve.js +0 -235
  112. package/esm/src/kernel/registry/schemas.d.ts +0 -14
  113. package/esm/src/kernel/registry/schemas.js +0 -23
  114. package/esm/src/kernel/registry/tools.d.ts +0 -12
  115. package/esm/src/kernel/registry/tools.js +0 -36
  116. package/esm/src/kernel/types.d.ts +0 -497
  117. package/esm/src/kernel/types.js +0 -10
  118. package/esm/src/observability/mod.d.ts +0 -12
  119. package/esm/src/observability/spans.d.ts +0 -16
  120. package/esm/src/observability/spans.js +0 -56
  121. package/esm/src/observability/trace-attach.d.ts +0 -16
  122. package/esm/src/observability/trace-attach.js +0 -81
  123. package/esm/src/observability/trace-record.d.ts +0 -112
  124. package/esm/src/observability/trace-record.js +0 -140
  125. package/esm/src/observability/trace-usage.d.ts +0 -3
  126. package/esm/src/observability/trace-usage.js +0 -32
  127. package/esm/src/observability/trace.d.ts +0 -23
  128. package/esm/src/observability/trace.js +0 -121
  129. package/esm/src/providers/attachments.d.ts +0 -17
  130. package/esm/src/providers/attachments.js +0 -156
  131. package/esm/src/providers/gemini-tape.d.ts +0 -3
  132. package/esm/src/providers/gemini-tape.js +0 -46
  133. package/esm/src/providers/google-tap.d.ts +0 -3
  134. package/esm/src/providers/google-tap.js +0 -48
  135. package/esm/src/providers/interactions.d.ts +0 -5
  136. package/esm/src/providers/interactions.js +0 -127
  137. package/esm/src/providers/media.d.ts +0 -5
  138. package/esm/src/providers/media.js +0 -125
  139. package/esm/src/providers/mod.d.ts +0 -15
  140. package/esm/src/providers/mod.js +0 -13
  141. package/esm/src/providers/openrouter-payload.d.ts +0 -24
  142. package/esm/src/providers/openrouter-payload.js +0 -177
  143. package/esm/src/providers/openrouter.d.ts +0 -17
  144. package/esm/src/providers/openrouter.js +0 -332
  145. package/esm/src/providers/provider.d.ts +0 -13
  146. package/esm/src/providers/provider.js +0 -123
  147. package/esm/src/providers/sse.d.ts +0 -7
  148. package/esm/src/providers/sse.js +0 -53
  149. package/esm/src/providers/tts.d.ts +0 -24
  150. package/esm/src/providers/tts.js +0 -144
package/deno.lock ADDED
@@ -0,0 +1,469 @@
1
+ {
2
+ "version": "5",
3
+ "specifiers": {
4
+ "jsr:@david/code-block-writer@^13.0.3": "13.0.3",
5
+ "jsr:@deno/dnt@*": "0.43.2",
6
+ "jsr:@deno/dnt@0.43.2": "0.43.2",
7
+ "jsr:@std/assert@1": "1.0.19",
8
+ "jsr:@std/fmt@1": "1.0.10",
9
+ "jsr:@std/fs@1": "1.0.24",
10
+ "jsr:@std/internal@^1.0.12": "1.0.14",
11
+ "jsr:@std/internal@^1.0.14": "1.0.14",
12
+ "jsr:@std/path@1": "1.1.6",
13
+ "jsr:@std/path@^1.1.5": "1.1.6",
14
+ "jsr:@ts-morph/bootstrap@0.29": "0.29.0",
15
+ "jsr:@ts-morph/common@0.29": "0.29.0",
16
+ "npm:@ast-grep/cli@0.41": "0.41.1",
17
+ "npm:@biomejs/biome@^2.5.8": "2.5.10",
18
+ "npm:@openrouter/ai-sdk-provider@1.5.4": "1.5.4_ai@5.0.244__zod@4.4.3_zod@4.4.3",
19
+ "npm:ai@5.0.244": "5.0.244_zod@4.4.3",
20
+ "npm:fallow@3.17.0": "3.17.0"
21
+ },
22
+ "jsr": {
23
+ "@david/code-block-writer@13.0.3": {
24
+ "integrity": "f98c77d320f5957899a61bfb7a9bead7c6d83ad1515daee92dbacc861e13bb7f"
25
+ },
26
+ "@deno/dnt@0.43.2": {
27
+ "integrity": "8068703a782f389d9fcb4ead32809ca666d3b088262a23f1d9016cbc9af5d37f",
28
+ "dependencies": [
29
+ "jsr:@david/code-block-writer",
30
+ "jsr:@std/fmt",
31
+ "jsr:@std/fs",
32
+ "jsr:@std/path@1",
33
+ "jsr:@ts-morph/bootstrap"
34
+ ]
35
+ },
36
+ "@std/assert@1.0.19": {
37
+ "integrity": "eaada96ee120cb980bc47e040f82814d786fe8162ecc53c91d8df60b8755991e",
38
+ "dependencies": [
39
+ "jsr:@std/internal@^1.0.12"
40
+ ]
41
+ },
42
+ "@std/fmt@1.0.10": {
43
+ "integrity": "90dfba288802ac6de82fb31d0917eb9e4450b9925b954d5e51fc29ac07419db5"
44
+ },
45
+ "@std/fs@1.0.24": {
46
+ "integrity": "f3061b45b81673a2bece689da041df32d174be064c89eb6397fb5718d3fb7877",
47
+ "dependencies": [
48
+ "jsr:@std/internal@^1.0.14",
49
+ "jsr:@std/path@^1.1.5"
50
+ ]
51
+ },
52
+ "@std/internal@1.0.14": {
53
+ "integrity": "291516b3d4c35024d6ffbc0a9df5bf4c64116e05b50012cf846710152d2ffdf7"
54
+ },
55
+ "@std/path@1.1.6": {
56
+ "integrity": "c68485c2a4dfbb5ae3cc74fae4e8c4e5d874cf8a8ed12927917235c758b46cbe",
57
+ "dependencies": [
58
+ "jsr:@std/internal@^1.0.14"
59
+ ]
60
+ },
61
+ "@ts-morph/bootstrap@0.29.0": {
62
+ "integrity": "69f9b1b42b03423308a9f623f924174181ef20f6f2a8771799f216f561b9b7a6",
63
+ "dependencies": [
64
+ "jsr:@ts-morph/common"
65
+ ]
66
+ },
67
+ "@ts-morph/common@0.29.0": {
68
+ "integrity": "14e8f44c5e4297628cf756aed071787dc026c493e36c1cc29ce49dc95e493f8f",
69
+ "dependencies": [
70
+ "jsr:@std/fs",
71
+ "jsr:@std/path@1"
72
+ ]
73
+ }
74
+ },
75
+ "npm": {
76
+ "@ai-sdk/gateway@2.0.139_zod@4.4.3": {
77
+ "integrity": "sha512-cunSy/lp6q48sOudMEnlWsCTITBg02LP0ZeLW5DophMH90IWxSm5DAspiTEfoS04UEZiZKKtrlNhmatI0ZK8Vg==",
78
+ "dependencies": [
79
+ "@ai-sdk/provider",
80
+ "@ai-sdk/provider-utils",
81
+ "@vercel/oidc",
82
+ "zod"
83
+ ]
84
+ },
85
+ "@ai-sdk/provider-utils@3.0.32_zod@4.4.3": {
86
+ "integrity": "sha512-izgUo50kamJMwoYCXoFwVccuJeyYp0y1+twf0FfpEz7kdQBloZLZbgLYUOUpannLWrV7xYSJR48BQJIQFbFiAQ==",
87
+ "dependencies": [
88
+ "@ai-sdk/provider",
89
+ "@standard-schema/spec",
90
+ "eventsource-parser",
91
+ "undici",
92
+ "zod"
93
+ ]
94
+ },
95
+ "@ai-sdk/provider@2.0.3": {
96
+ "integrity": "sha512-h88OPkavHTiN9tMn2l5awAznGB0lXzjcLhgR1/rvjB2zlLprsNxbM2tt6OJsHUxduLC3klq0/eqaSf6fX5XVww==",
97
+ "dependencies": [
98
+ "json-schema"
99
+ ]
100
+ },
101
+ "@ast-grep/cli-darwin-arm64@0.41.1": {
102
+ "integrity": "sha512-30lrXtyDB+16WS89Bk8sufA5TVUczyQye4PoIYLxZr+PRbPW7thpxHwBwGWL6QvPvUtlElrCe4seA1CEwFxeFA==",
103
+ "os": ["darwin"],
104
+ "cpu": ["arm64"]
105
+ },
106
+ "@ast-grep/cli-darwin-x64@0.41.1": {
107
+ "integrity": "sha512-jRft57aWRgqYgLXooWxS9Nx5mb5JJ/KQIwEqacWkcmDZEdEui7oG50//6y4/vU5WRcS1n6oB2Vs7WBvTh3/Ypg==",
108
+ "os": ["darwin"],
109
+ "cpu": ["x64"]
110
+ },
111
+ "@ast-grep/cli-linux-arm64-gnu@0.41.1": {
112
+ "integrity": "sha512-1XUL+8u+Xs1FoM2W6F4v8pRa2aQQcp5CZXBG8uy9n8FhwsQtrhBclJ2Vr9g/zzswHQT1293mnP5TOk1wlYZq6w==",
113
+ "os": ["linux"],
114
+ "cpu": ["arm64"]
115
+ },
116
+ "@ast-grep/cli-linux-x64-gnu@0.41.1": {
117
+ "integrity": "sha512-oSsbXzbcl4hnRAw7b1bTFZapx9s+O8ToJJKI44oJAb7xKIG3Rubn2IMBOFvMvjjWEEax8PpS2IocgdB8nUAcbA==",
118
+ "os": ["linux"],
119
+ "cpu": ["x64"]
120
+ },
121
+ "@ast-grep/cli-win32-arm64-msvc@0.41.1": {
122
+ "integrity": "sha512-jTMNqjXnQUhInMB1X06sxWZJv/6pd4/iYSyk8RR5kdulnuNzoGEB9KYbm6ojxktPtMfZpb+7eShQLqqy/dG6Ag==",
123
+ "os": ["win32"],
124
+ "cpu": ["arm64"]
125
+ },
126
+ "@ast-grep/cli-win32-ia32-msvc@0.41.1": {
127
+ "integrity": "sha512-mCTyr6/KQneKk0iYaWup4ywW5buNcFqL6TrJVfU0tkd38fu/RtJ5zywr978vVvFxsY+urRU0qkrmtQqXQNwDFA==",
128
+ "os": ["win32"],
129
+ "cpu": ["ia32"]
130
+ },
131
+ "@ast-grep/cli-win32-x64-msvc@0.41.1": {
132
+ "integrity": "sha512-AUbR67UKWsfgyy3SWQq258ZB0xSlaAe15Gl5hPu5tbUu4HTt6rKrUCTEEubYgbNdPPZWtxjobjFjMsDTWfnrug==",
133
+ "os": ["win32"],
134
+ "cpu": ["x64"]
135
+ },
136
+ "@ast-grep/cli@0.41.1": {
137
+ "integrity": "sha512-6oSuzF1Ra0d9jdcmflRIR1DHcicI7TYVxaaV/hajV51J49r6C+1BA2H9G+e47lH4sDEXUS9KWLNGNvXa/Gqs5A==",
138
+ "dependencies": [
139
+ "detect-libc"
140
+ ],
141
+ "optionalDependencies": [
142
+ "@ast-grep/cli-darwin-arm64",
143
+ "@ast-grep/cli-darwin-x64",
144
+ "@ast-grep/cli-linux-arm64-gnu",
145
+ "@ast-grep/cli-linux-x64-gnu",
146
+ "@ast-grep/cli-win32-arm64-msvc",
147
+ "@ast-grep/cli-win32-ia32-msvc",
148
+ "@ast-grep/cli-win32-x64-msvc"
149
+ ],
150
+ "scripts": true,
151
+ "bin": true
152
+ },
153
+ "@biomejs/biome@2.5.10": {
154
+ "integrity": "sha512-WRKXARA3kTuiV5sxqTpobJ/I0MVd4vk3pOL6wnp5az4LntFIhWTj1RWZq3DI9PCEN3lXcqy7p5aqUHzvq8AXyQ==",
155
+ "optionalDependencies": [
156
+ "@biomejs/cli-darwin-arm64",
157
+ "@biomejs/cli-darwin-x64",
158
+ "@biomejs/cli-linux-arm64",
159
+ "@biomejs/cli-linux-arm64-musl",
160
+ "@biomejs/cli-linux-x64",
161
+ "@biomejs/cli-linux-x64-musl",
162
+ "@biomejs/cli-win32-arm64",
163
+ "@biomejs/cli-win32-x64"
164
+ ],
165
+ "bin": true
166
+ },
167
+ "@biomejs/cli-darwin-arm64@2.5.10": {
168
+ "integrity": "sha512-ItCrxKK6SXVT6flYs0qIuBd4AA3TTTl4d66Re6YI2FuGZnN85NmuYNzkiTJUyYw8qBLv69L5zTUB6uyWd++h3Q==",
169
+ "os": ["darwin"],
170
+ "cpu": ["arm64"]
171
+ },
172
+ "@biomejs/cli-darwin-x64@2.5.10": {
173
+ "integrity": "sha512-yLsPU9pAmtChXDu8vhKAzErqe+LeeYuwuUB2FZMkRitsmdodxsYRa9KHrFispsUHzzOu+9HB3nP/TQxyia+Sjw==",
174
+ "os": ["darwin"],
175
+ "cpu": ["x64"]
176
+ },
177
+ "@biomejs/cli-linux-arm64-musl@2.5.10": {
178
+ "integrity": "sha512-t1QAKZwQJRB4dvgJSgFiQ4BNfNPChg69BNonz854qLVxnjT3UvDzQg9mbkTJRu35ZqU0Rw10A73J8Urgbg2RPw==",
179
+ "os": ["linux"],
180
+ "cpu": ["arm64"]
181
+ },
182
+ "@biomejs/cli-linux-arm64@2.5.10": {
183
+ "integrity": "sha512-VG8uQW/86a1roLaIFvtIbEigxIdzdJ190oGyg1tV7VYeQtOS+x10sflk7WbuXgw91EtZX5DlIIIej1YqkNLlcg==",
184
+ "os": ["linux"],
185
+ "cpu": ["arm64"]
186
+ },
187
+ "@biomejs/cli-linux-x64-musl@2.5.10": {
188
+ "integrity": "sha512-pgDDqp9JybHm2I0KRgzN6i4+lt8xu4iqxUwLzglUMmOmyRTU1AYBGKzh9sNMOtIjah7xoWvKHlLVetvyifzoiQ==",
189
+ "os": ["linux"],
190
+ "cpu": ["x64"]
191
+ },
192
+ "@biomejs/cli-linux-x64@2.5.10": {
193
+ "integrity": "sha512-4O6T0eq2heoHZN0a9UX+rWQoxXEBaKf+lRi2hbsGlHneUz9BWXM76nEWMK7Eeq8gzMxR1khQB6BFpAASpeXqGg==",
194
+ "os": ["linux"],
195
+ "cpu": ["x64"]
196
+ },
197
+ "@biomejs/cli-win32-arm64@2.5.10": {
198
+ "integrity": "sha512-pxAbxduPO4xq/Cvgaa2lOrs9BB0hEXmmDqfMNP4ZOffGOkUrD1/QGw9UAMpFQpX2P8MqTIIRuQKcmetum4Oa6A==",
199
+ "os": ["win32"],
200
+ "cpu": ["arm64"]
201
+ },
202
+ "@biomejs/cli-win32-x64@2.5.10": {
203
+ "integrity": "sha512-M+2dgBsl3lXRiTfgPVc2p3anS4Tocojke4rzFLScZ2Y/wmF+36dRb1iHCLiyGqOzQGyTplZH1HnEYviiAqi3nA==",
204
+ "os": ["win32"],
205
+ "cpu": ["x64"]
206
+ },
207
+ "@fallow-cli/darwin-arm64@3.17.0": {
208
+ "integrity": "sha512-u9O4aQaTSdaZaa4MAVEZEiwOx6QQzChymyQPrxV6KvDcVbcl0oYSekJKdvN4gEqUY8ClMze9gWS1tbn/W3N4dQ==",
209
+ "os": ["darwin"],
210
+ "cpu": ["arm64"]
211
+ },
212
+ "@fallow-cli/darwin-x64@3.17.0": {
213
+ "integrity": "sha512-l3tZJovnCa8j+im4qTl4GVSfrx4gisJYeHDwb5TbcdTGaWYz42gHriAaz5MhOR8S24q3xRegX8QrI8PA4XXU4g==",
214
+ "os": ["darwin"],
215
+ "cpu": ["x64"]
216
+ },
217
+ "@fallow-cli/linux-arm64-gnu@3.17.0": {
218
+ "integrity": "sha512-IAjS6qR4tHcRo1y5lzYT6mktN/ATPyPNrJ6yjwTORwwQV1YfMO58A5zGBfJlPBY+lUmaMZ9w37ftvH9a2AS4dQ==",
219
+ "os": ["linux"],
220
+ "cpu": ["arm64"]
221
+ },
222
+ "@fallow-cli/linux-arm64-musl@3.17.0": {
223
+ "integrity": "sha512-Oe1dvk5Wt5Bmnxfc6HufJTaFY9SEwDVrZpnSdVQlv+nvz7DzrTK1r91cR3Ip477ANSLa9XD/MHPMpfqqo0dlZg==",
224
+ "os": ["linux"],
225
+ "cpu": ["arm64"]
226
+ },
227
+ "@fallow-cli/linux-x64-gnu@3.17.0": {
228
+ "integrity": "sha512-XgLU2a51zuky7gifjVDHuiJGToAReDsVCDcyDF84TQz/h3bqO0iRkpDL8dh7+HODku84+EffpK5ZHY19n6Ij0w==",
229
+ "os": ["linux"],
230
+ "cpu": ["x64"]
231
+ },
232
+ "@fallow-cli/linux-x64-musl@3.17.0": {
233
+ "integrity": "sha512-GnDZx2kbLKKdYAp05NSKv6CZHgzEKvhRd0btCKFMMpUEhdzmr4uh2Qb4UzKDBg/q2r1EhkzN4b/qC+tbFCmtwA==",
234
+ "os": ["linux"],
235
+ "cpu": ["x64"]
236
+ },
237
+ "@fallow-cli/win32-arm64-msvc@3.17.0": {
238
+ "integrity": "sha512-u9n5WzPuKuC1PKegKQknWtngAUJ2szQaRXsbY54s7UMqeFNyC+W04LV5D+sEZywU7L0kzL+Kck9LxFLXBQcgvA==",
239
+ "os": ["win32"],
240
+ "cpu": ["arm64"]
241
+ },
242
+ "@fallow-cli/win32-x64-msvc@3.17.0": {
243
+ "integrity": "sha512-/OcyxHuCKabzQ9hKIjM/CFJ9fr30n0Mw5MK6nzi5rn26mbYUgh073UZq4FONOpPJ/FqHtC726rxpgBtR4qS+gg==",
244
+ "os": ["win32"],
245
+ "cpu": ["x64"]
246
+ },
247
+ "@fastify/busboy@2.1.1": {
248
+ "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA=="
249
+ },
250
+ "@openrouter/ai-sdk-provider@1.5.4_ai@5.0.244__zod@4.4.3_zod@4.4.3": {
251
+ "integrity": "sha512-xrSQPUIH8n9zuyYZR0XK7Ba0h2KsjJcMkxnwaYfmv13pKs3sDkjPzVPPhlhzqBGddHb5cFEwJ9VFuFeDcxCDSw==",
252
+ "dependencies": [
253
+ "@openrouter/sdk",
254
+ "ai",
255
+ "zod"
256
+ ]
257
+ },
258
+ "@openrouter/sdk@0.1.27": {
259
+ "integrity": "sha512-RH//L10bSmc81q25zAZudiI4kNkLgxF2E+WU42vghp3N6TEvZ6F0jK7uT3tOxkEn91gzmMw9YVmDENy7SJsajQ==",
260
+ "dependencies": [
261
+ "zod"
262
+ ]
263
+ },
264
+ "@opentelemetry/api@1.9.0": {
265
+ "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg=="
266
+ },
267
+ "@standard-schema/spec@1.1.0": {
268
+ "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w=="
269
+ },
270
+ "@typescript/typescript-aix-ppc64@7.0.2": {
271
+ "integrity": "sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==",
272
+ "os": ["aix"],
273
+ "cpu": ["ppc64"]
274
+ },
275
+ "@typescript/typescript-darwin-arm64@7.0.2": {
276
+ "integrity": "sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==",
277
+ "os": ["darwin"],
278
+ "cpu": ["arm64"]
279
+ },
280
+ "@typescript/typescript-darwin-x64@7.0.2": {
281
+ "integrity": "sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==",
282
+ "os": ["darwin"],
283
+ "cpu": ["x64"]
284
+ },
285
+ "@typescript/typescript-freebsd-arm64@7.0.2": {
286
+ "integrity": "sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==",
287
+ "os": ["freebsd"],
288
+ "cpu": ["arm64"]
289
+ },
290
+ "@typescript/typescript-freebsd-x64@7.0.2": {
291
+ "integrity": "sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==",
292
+ "os": ["freebsd"],
293
+ "cpu": ["x64"]
294
+ },
295
+ "@typescript/typescript-linux-arm64@7.0.2": {
296
+ "integrity": "sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==",
297
+ "os": ["linux"],
298
+ "cpu": ["arm64"]
299
+ },
300
+ "@typescript/typescript-linux-arm@7.0.2": {
301
+ "integrity": "sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==",
302
+ "os": ["linux"],
303
+ "cpu": ["arm"]
304
+ },
305
+ "@typescript/typescript-linux-loong64@7.0.2": {
306
+ "integrity": "sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==",
307
+ "os": ["linux"],
308
+ "cpu": ["loong64"]
309
+ },
310
+ "@typescript/typescript-linux-mips64el@7.0.2": {
311
+ "integrity": "sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==",
312
+ "os": ["linux"],
313
+ "cpu": ["mips64el"]
314
+ },
315
+ "@typescript/typescript-linux-ppc64@7.0.2": {
316
+ "integrity": "sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==",
317
+ "os": ["linux"],
318
+ "cpu": ["ppc64"]
319
+ },
320
+ "@typescript/typescript-linux-riscv64@7.0.2": {
321
+ "integrity": "sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==",
322
+ "os": ["linux"],
323
+ "cpu": ["riscv64"]
324
+ },
325
+ "@typescript/typescript-linux-s390x@7.0.2": {
326
+ "integrity": "sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==",
327
+ "os": ["linux"],
328
+ "cpu": ["s390x"]
329
+ },
330
+ "@typescript/typescript-linux-x64@7.0.2": {
331
+ "integrity": "sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==",
332
+ "os": ["linux"],
333
+ "cpu": ["x64"]
334
+ },
335
+ "@typescript/typescript-netbsd-arm64@7.0.2": {
336
+ "integrity": "sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==",
337
+ "os": ["netbsd"],
338
+ "cpu": ["arm64"]
339
+ },
340
+ "@typescript/typescript-netbsd-x64@7.0.2": {
341
+ "integrity": "sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==",
342
+ "os": ["netbsd"],
343
+ "cpu": ["x64"]
344
+ },
345
+ "@typescript/typescript-openbsd-arm64@7.0.2": {
346
+ "integrity": "sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==",
347
+ "os": ["openbsd"],
348
+ "cpu": ["arm64"]
349
+ },
350
+ "@typescript/typescript-openbsd-x64@7.0.2": {
351
+ "integrity": "sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==",
352
+ "os": ["openbsd"],
353
+ "cpu": ["x64"]
354
+ },
355
+ "@typescript/typescript-sunos-x64@7.0.2": {
356
+ "integrity": "sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==",
357
+ "os": ["sunos"],
358
+ "cpu": ["x64"]
359
+ },
360
+ "@typescript/typescript-win32-arm64@7.0.2": {
361
+ "integrity": "sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==",
362
+ "os": ["win32"],
363
+ "cpu": ["arm64"]
364
+ },
365
+ "@typescript/typescript-win32-x64@7.0.2": {
366
+ "integrity": "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==",
367
+ "os": ["win32"],
368
+ "cpu": ["x64"]
369
+ },
370
+ "@vercel/oidc@3.1.0": {
371
+ "integrity": "sha512-Fw28YZpRnA3cAHHDlkt7xQHiJ0fcL+NRcIqsocZQUSmbzeIKRpwttJjik5ZGanXP+vlA4SbTg+AbA3bP363l+w=="
372
+ },
373
+ "ai@5.0.244_zod@4.4.3": {
374
+ "integrity": "sha512-7hEVPeQdUS6EgScL4BOKwtV7uNxFJgYu80OFfhnl8wfH5NCMFW+WJEwp/UjdPgxgnhBxhNcn9MrANlC0Hp77tw==",
375
+ "dependencies": [
376
+ "@ai-sdk/gateway",
377
+ "@ai-sdk/provider",
378
+ "@ai-sdk/provider-utils",
379
+ "@opentelemetry/api",
380
+ "zod"
381
+ ]
382
+ },
383
+ "detect-libc@2.1.2": {
384
+ "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ=="
385
+ },
386
+ "eventsource-parser@3.1.1": {
387
+ "integrity": "sha512-EKN1vKAMcZ8MlYMpaNuxN6R9yakzH6uajHcHVTqWJzvu5pWw9DyhbP35HH8MVBQ+dZjAfDxk+A8NiR9KWaXiyQ=="
388
+ },
389
+ "fallow-type-aware@3.17.0": {
390
+ "integrity": "sha512-DFtZUK5oqP56tSsrBWPzjrTIwPPxwlBV8QoSaGghMru347Nqj8ZBY6u9HFa/TIPcxvFU/zIZMRF8xS/XAWQTzg==",
391
+ "dependencies": [
392
+ "typescript"
393
+ ],
394
+ "bin": true
395
+ },
396
+ "fallow@3.17.0": {
397
+ "integrity": "sha512-tbLuvsPq3I2CzpoF/9MgSQ7hWzOqlj3avFUAmCr1J9OERE6z714SlDmA38NVvNy/zuK/70utXB3/b33xC9z29g==",
398
+ "dependencies": [
399
+ "detect-libc"
400
+ ],
401
+ "optionalDependencies": [
402
+ "@fallow-cli/darwin-arm64",
403
+ "@fallow-cli/darwin-x64",
404
+ "@fallow-cli/linux-arm64-gnu",
405
+ "@fallow-cli/linux-arm64-musl",
406
+ "@fallow-cli/linux-x64-gnu",
407
+ "@fallow-cli/linux-x64-musl",
408
+ "@fallow-cli/win32-arm64-msvc",
409
+ "@fallow-cli/win32-x64-msvc",
410
+ "fallow-type-aware"
411
+ ],
412
+ "bin": true
413
+ },
414
+ "json-schema@0.4.0": {
415
+ "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA=="
416
+ },
417
+ "typescript@7.0.2": {
418
+ "integrity": "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==",
419
+ "optionalDependencies": [
420
+ "@typescript/typescript-aix-ppc64",
421
+ "@typescript/typescript-darwin-arm64",
422
+ "@typescript/typescript-darwin-x64",
423
+ "@typescript/typescript-freebsd-arm64",
424
+ "@typescript/typescript-freebsd-x64",
425
+ "@typescript/typescript-linux-arm",
426
+ "@typescript/typescript-linux-arm64",
427
+ "@typescript/typescript-linux-loong64",
428
+ "@typescript/typescript-linux-mips64el",
429
+ "@typescript/typescript-linux-ppc64",
430
+ "@typescript/typescript-linux-riscv64",
431
+ "@typescript/typescript-linux-s390x",
432
+ "@typescript/typescript-linux-x64",
433
+ "@typescript/typescript-netbsd-arm64",
434
+ "@typescript/typescript-netbsd-x64",
435
+ "@typescript/typescript-openbsd-arm64",
436
+ "@typescript/typescript-openbsd-x64",
437
+ "@typescript/typescript-sunos-x64",
438
+ "@typescript/typescript-win32-arm64",
439
+ "@typescript/typescript-win32-x64"
440
+ ],
441
+ "bin": true
442
+ },
443
+ "undici@5.29.0": {
444
+ "integrity": "sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==",
445
+ "dependencies": [
446
+ "@fastify/busboy"
447
+ ]
448
+ },
449
+ "zod@4.4.3": {
450
+ "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ=="
451
+ }
452
+ },
453
+ "workspace": {
454
+ "dependencies": [
455
+ "jsr:@std/assert@1",
456
+ "npm:@openrouter/ai-sdk-provider@1.5.4",
457
+ "npm:ai@5.0.244"
458
+ ],
459
+ "packageJson": {
460
+ "dependencies": [
461
+ "npm:@ast-grep/cli@0.41",
462
+ "npm:@biomejs/biome@^2.5.8",
463
+ "npm:@openrouter/ai-sdk-provider@1.5.4",
464
+ "npm:ai@5.0.244",
465
+ "npm:fallow@3.17.0"
466
+ ]
467
+ }
468
+ }
469
+ }
@@ -6,10 +6,12 @@ Every profile strictly namespaces its capabilities across 6 functional domains:
6
6
  1. `identity` — Persona, display handle, and static base system prompts.
7
7
  2. `model` — Protocol, provider backend, model whitelist, thinking level, and controls.
8
8
  3. `tools` — Tool access ceiling.
9
- 4. `inputs` — Strict ingress constraints, file limits, and routing slots.
10
- 5. `outputs` — Structured schemas, voice, media, streaming, and validation/auto-repair.
9
+ 4. `inputs` — Strict ingress constraints (text, attachments, voice), file limits, and routing slots.
10
+ 5. `outputs` — Structured schemas, image, speech, streaming, and validation/auto-repair.
11
11
  6. `guardrails` — Rate limits, canary leak detection, content safety, and outbound disclosure policies.
12
12
 
13
+ **Vocabulary:** Ingress audio is `inputs.voice`. Generated audio is `outputs.speech` (TTS voice id is `outputs.speech.voice`). Wire container formats for speech (`pcm` / `mp3`) may live in the kernel; vendor voice catalogs and image aspect/size vocabularies live in presets/apps.
14
+
13
15
  ---
14
16
 
15
17
  ## 1. Authoring Shape
@@ -20,17 +22,30 @@ profiles. The minimum useful profile is:
20
22
  ```typescript
21
23
  defineProfile({
22
24
  id: 'host.agent',
23
- model: { allow: ['your-model-id'] },
25
+ model: {
26
+ allow: ['your-model-id'],
27
+ config: {
28
+ 'your-model-id': {
29
+ apiId: 'provider-native-model-id',
30
+ thinking: { on: 'high', off: 'minimal' },
31
+ thinkingLevels: ['minimal', 'low', 'medium', 'high'],
32
+ summaries: { on: 'auto', off: 'none' },
33
+ maxOutputTokens: 8192,
34
+ temperature: 1,
35
+ keyBuiltins: [],
36
+ },
37
+ },
38
+ },
24
39
  });
25
40
  ```
26
41
 
27
- Everything except `id` and `model.allow` is optional at authoring time:
42
+ Everything except `id`, `model.allow`, and `model.config` is optional at authoring time:
28
43
 
29
44
  ```typescript
30
45
  export type ProfileDefinition = {
31
46
  id: ProfileId;
32
47
  identity?: Partial<Profile['identity']>;
33
- model: Partial<Profile['model']> & Pick<Profile['model'], 'allow'>;
48
+ model: Partial<Profile['model']> & Pick<Profile['model'], 'allow' | 'config'>;
34
49
  tools?: Partial<Profile['tools']>;
35
50
  inputs?: Partial<Profile['inputs']>;
36
51
  outputs?: Partial<Profile['outputs']>;
@@ -61,6 +76,8 @@ export interface Profile {
61
76
  protocol: 'geminiInteractions' | 'openAi';
62
77
  provider: 'google' | 'openrouter';
63
78
  allow: ModelId[];
79
+ /** Host-owned wire config for every id in `allow`. */
80
+ config: Record<ModelId, ModelSpec>;
64
81
  select?: Record<string, ModelId>;
65
82
  thinking?: ThinkingLevel | Record<string, ThinkingLevel>;
66
83
  controls?: ControlId[];
@@ -85,11 +102,13 @@ export interface Profile {
85
102
  slots?: Record<string, string[]>;
86
103
  };
87
104
 
88
- /** 5. Outputs (Structured output, voice, media, validation, streaming) */
105
+ /** 5. Outputs (Structured output, image, speech, validation, streaming) */
89
106
  outputs: {
90
107
  structured?: StructuredSchemaId | StructuredBySlot | null;
91
- media?: boolean;
92
- voice?: ProfileVoiceSpec;
108
+ /** Pins for an image-role profile. Model id lives on `model`. */
109
+ image?: ProfileImageSpec;
110
+ /** Pins for a speech-role profile. Model id lives on `model`. */
111
+ speech?: ProfileSpeechSpec;
93
112
  validation?: ProfileValidationSpec;
94
113
  streaming?: ProfileStreamingSpec;
95
114
  };
@@ -118,39 +137,47 @@ export interface Profile {
118
137
  ### `model`
119
138
  - `model.protocol`: Wire framing protocol (`'geminiInteractions'` for Google Interactions API, `'openAi'` for OpenAI/OpenRouter compatible chat completions API).
120
139
  - `model.provider`: Provider execution backend (`'google'` or `'openrouter'`).
121
- - `model.allow`: Whitelist of allowable `ModelId`s for this profile.
122
- - `model.select`: Named model mappings (e.g. `{ fast: 'gemini35FlashLite', deep: 'gemini31ProPreview' }`).
123
- - `model.thinking`: Pinned thinking level (`'minimal' | 'low' | 'medium' | 'high'`) when not user-controllable.
140
+ - `model.allow`: Whitelist of host-defined `ModelId`s for this profile. THEORUM does not ship model names.
141
+ - `model.config`: Host-owned `ModelSpec` map keyed by the same ids as `allow` / `select` (`apiId`, thinking levels, tokens, `keyBuiltins`, optional per-model `key`, etc.).
142
+ - `model.select`: Named model mappings (e.g. `{ fast: 'flash', deep: 'pro' }` ids are host-defined).
143
+ - `model.thinking`: Pinned thinking level (`'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'`) when not user-controllable. Each model’s accepted subset is declared on `ModelSpec.thinkingLevels`.
124
144
  - `model.controls`: User-togglable controls on this profile (e.g. `['thinking']`).
125
145
  - `model.maxSteps`: Step limit on autonomous tool loops (1 = one-shot; >1 = autonomous tool loop).
126
- - `model.key`: Gemini free bucket quota pool (`'freeA' | 'freeB' | 'freeC'`).
146
+ - `model.key`: Default Gemini vault slot for this profile (`'freeA' | 'freeB' | 'freeC'`). Overflow uses `'paid'`.
147
+
148
+ ### `ModelSpec` (host-owned, per id in `config`)
149
+ - `apiId` / optional `openRouterId`: Provider-native wire ids.
150
+ - `keyBuiltins`: Builtins that may use `profile.model.key`. Any other enabled builtin selects the overflow vault slot. Host policy — THEORUM does not infer tool pricing.
151
+ - `key`: Optional vault slot override for this model (e.g. pin an image model to `'paid'`). When set, wins over profile key and builtin routing.
127
152
 
128
153
  ### `tools`
129
154
  - `tools.allow`: Whitelist of tool IDs permitted to run under this profile. Calls to unlisted tools are blocked at the kernel boundary.
155
+ - Harness tools (`askUser`) ship with THEORUM and are always in the catalog.
156
+ - Provider builtins (e.g. Google search/maps/urlContext) are registered by optional presets such as `theorum/presets/google` via `registerGooglePreset()`.
130
157
 
131
158
  ### `inputs`
132
159
  - `inputs.text`: Boolean flag accepting user text input.
133
160
  - `inputs.attachments`: Allowed mime types for uploaded file attachments.
134
- - `inputs.voice`: Allowed mime types for recorded audio clips.
161
+ - `inputs.voice`: Allowed mime types for recorded audio clips (ingress only).
135
162
  - `inputs.maxFiles`: Maximum number of files permitted per message.
136
163
  - `inputs.maxBytes`: Maximum byte size permitted per single file.
137
164
  - `inputs.maxTurnBytes`: Maximum total byte size permitted across all files in one turn.
138
165
  - `inputs.limitsByMime`: Granular per-MIME byte limits (e.g. `{ 'application/pdf': 50 * 1024 * 1024, 'video/*': 100 * 1024 * 1024 }`).
139
- - `inputs.slots`: Allowed values for dynamic routing slots.
166
+ - `inputs.slots`: Allowed values for dynamic routing slots. Image-role overrides use `slots.aspectRatio` / `slots.size`.
140
167
 
141
168
  ### `outputs`
142
169
  - `outputs.structured`: Structured JSON schema specification (or slot-based schema routing).
143
- - `outputs.media`: Flag enabling native image generation output.
144
- - `outputs.voice`: Voice specification for TTS (`voice.voice`, `voice.responseFormat: 'pcm' | 'mp3'`).
170
+ - `outputs.image`: Pins for an image-role profile (`aspectRatio`, `size`, `mimeType`, optional `allowsGrounding`, `maxInputImages`). The image model itself is selected via `model.allow` / `model.config`. Slot overrides use `slots.aspectRatio` / `slots.size` when the profile lists allowlists under `inputs.slots`. Adapters map `size` to provider wire keys (e.g. Google Interactions `imageSize`).
171
+ - `outputs.speech`: Pins for a speech-role profile (`voice`, optional `format: 'pcm' | 'mp3'`). The speech model itself is selected via `model.allow` / `model.config`. Bind with `createProvider(profile, …)` — same door as chat/image. `geminiInteractions` uses Interactions (`response_format: audio` + `speech_config`); `openAi`/`openrouter` speech roles use `/audio/speech` with the same `openRouter` credentials. `format: 'pcm'` (default) yields WAV media on both. `format: 'mp3'` is only valid on `openAi` speech — Interactions rejects it at resolve.
145
172
  - `outputs.validation`: In-harness auto-correction validator (`validate`, optional `extract`, `maxRetries`, `repairGuidance`). If `extract` is omitted, the structured output itself is validated.
146
- - `outputs.streaming`: SSE streaming behaviors (`streamThoughts`, `gateMedia`).
173
+ - `outputs.streaming`: SSE streaming behaviors (`streamThoughts`, `gateMedia`). `gateMedia` controls whether stream `media` events are held until validation/egress — unrelated to a profile output flag.
147
174
 
148
175
  ### `guardrails`
149
176
  - `guardrails.quota.perDay`: Optional daily turn quota enforced per client IP. If omitted, quota enforcement is explicitly `not_configured`.
150
177
  - `guardrails.canary`: Enable unique token canary leak interception (default `true`).
151
178
  - `guardrails.sanitizeInput`: Run prompt injection / jailbreak redaction on ingress text (default `true`).
152
179
  - `guardrails.redactSensitive`: Redact SSN, credit cards, IP addresses, API keys from inputs (default `true`).
153
- - `guardrails.egress`: Generic outbound disclosure control engine (`enforce`, `onBlock: 'reject_to_agent' | 'refuse_to_user'`, `maxRetries`, `repairGuidance`). Runs deterministic auto-repair loops for chat or immediate in-character refusal for voice.
180
+ - `guardrails.egress`: Generic outbound disclosure control engine (`enforce`, `onBlock: 'reject_to_agent' | 'refuse_to_user'`, `maxRetries`, `repairGuidance`). Runs deterministic auto-repair loops for chat or immediate in-character refusal when blocking egress on voice-input turns.
154
181
 
155
182
  ### Per-turn Interactions state
156
183
  - `TurnRequest.input`: Optional turn input object. If omitted, Theorum normalizes it to an empty input and still runs the profile/provider turn.
package/docs/CLI_SPEC.md CHANGED
@@ -48,7 +48,7 @@ theorum test --all [--lite] [--concurrency 4]
48
48
  | `--lite` | `boolean` | Minimal single-turn connectivity ping (fast mode, tools off, text only) |
49
49
  | `--matrix` | `boolean` | Generate and execute all valid permutations for the profile |
50
50
  | `--attachment` | `string[]` | Path(s) to custom attachment files (PNG, PDF, CSV, etc.) |
51
- | `--voice` | `string` | Path to custom voice audio (WAV, PCM) |
51
+ | `--voice` | `string` | Path to custom voice input audio (WAV, PCM) |
52
52
  | `--search` | `boolean` | Force Google Search tool on |
53
53
  | `--map` | `boolean` | Force Google Maps tool on |
54
54
  | `--mode` | `'fast' \| 'smart'` | Force reasoning / model speed tier |
@@ -112,7 +112,7 @@ interface SynthesizedTurn {
112
112
  - If profile supports `smart` mode $\to$ select `smart` (highest pinned thinking tokens).
113
113
  - Otherwise $\to$ use default profile model.
114
114
  2. **Multimodal Fixtures**:
115
- - If `inputs.voice === true` $\to$ inject synthetic 16kHz PCM/WAV speech fixture.
115
+ - If `inputs.voice` is set $\to$ inject synthetic 16kHz PCM/WAV voice-input fixture.
116
116
  - If `inputs.attachments === true` $\to$ inject synthetic test document/image matching allowed MIME types within byte ceilings (`maxBytes`).
117
117
  3. **Tool Resolution & Conflict Handling**:
118
118
  - Turn on all allowed tools in `profile.tools.allow`.