@pyric/cli 0.1.0-alpha.20 → 0.1.0-alpha.22

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 (502) hide show
  1. package/README.md +64 -89
  2. package/dist/assurance/.generated/conformance-verdicts.d.ts +238 -1
  3. package/dist/assurance/.generated/conformance-verdicts.d.ts.map +1 -1
  4. package/dist/assurance/.generated/conformance-verdicts.js +238 -1
  5. package/dist/assurance/.generated/conformance-verdicts.js.map +1 -1
  6. package/dist/bridge/client/dispatch.d.ts +25 -19
  7. package/dist/bridge/client/dispatch.d.ts.map +1 -1
  8. package/dist/bridge/client/dispatch.js +41 -48
  9. package/dist/bridge/client/dispatch.js.map +1 -1
  10. package/dist/bridge/client/tool-family-factories.d.ts +26 -0
  11. package/dist/bridge/client/tool-family-factories.d.ts.map +1 -0
  12. package/dist/bridge/client/tool-family-factories.js +10 -0
  13. package/dist/bridge/client/tool-family-factories.js.map +1 -0
  14. package/dist/bridge/server/mcp-contract.d.ts +7 -6
  15. package/dist/bridge/server/mcp-contract.d.ts.map +1 -1
  16. package/dist/bridge/server/mcp-contract.js +9 -48
  17. package/dist/bridge/server/mcp-contract.js.map +1 -1
  18. package/dist/bridge/server/peer.d.ts +11 -1
  19. package/dist/bridge/server/peer.d.ts.map +1 -1
  20. package/dist/bridge/server/peer.js +22 -1
  21. package/dist/bridge/server/peer.js.map +1 -1
  22. package/dist/bridge/server/tool-family-factories.d.ts +30 -0
  23. package/dist/bridge/server/tool-family-factories.d.ts.map +1 -0
  24. package/dist/bridge/server/tool-family-factories.js +22 -0
  25. package/dist/bridge/server/tool-family-factories.js.map +1 -0
  26. package/dist/bridge/server/tool-metadata.d.ts +17 -18
  27. package/dist/bridge/server/tool-metadata.d.ts.map +1 -1
  28. package/dist/bridge/server/tool-metadata.js +24 -59
  29. package/dist/bridge/server/tool-metadata.js.map +1 -1
  30. package/dist/bridge/tool-families.d.ts +48 -0
  31. package/dist/bridge/tool-families.d.ts.map +1 -0
  32. package/dist/bridge/tool-families.generated.d.ts +32 -0
  33. package/dist/bridge/tool-families.generated.d.ts.map +1 -0
  34. package/dist/bridge/tool-families.generated.js +15 -0
  35. package/dist/bridge/tool-families.generated.js.map +1 -0
  36. package/dist/bridge/tool-families.js +51 -0
  37. package/dist/bridge/tool-families.js.map +1 -0
  38. package/dist/bridge/tool-family-records/conformance.d.ts +7 -0
  39. package/dist/bridge/tool-family-records/conformance.d.ts.map +1 -0
  40. package/dist/bridge/tool-family-records/conformance.js +6 -0
  41. package/dist/bridge/tool-family-records/conformance.js.map +1 -0
  42. package/dist/bridge/tool-family-records/firestore-data.d.ts +7 -0
  43. package/dist/bridge/tool-family-records/firestore-data.d.ts.map +1 -0
  44. package/dist/bridge/tool-family-records/firestore-data.js +15 -0
  45. package/dist/bridge/tool-family-records/firestore-data.js.map +1 -0
  46. package/dist/bridge/tool-family-records/firestore-inspect.d.ts +7 -0
  47. package/dist/bridge/tool-family-records/firestore-inspect.d.ts.map +1 -0
  48. package/dist/bridge/tool-family-records/firestore-inspect.js +6 -0
  49. package/dist/bridge/tool-family-records/firestore-inspect.js.map +1 -0
  50. package/dist/bridge/tool-family-records/firestore-rules.d.ts +7 -0
  51. package/dist/bridge/tool-family-records/firestore-rules.d.ts.map +1 -0
  52. package/dist/bridge/tool-family-records/firestore-rules.js +15 -0
  53. package/dist/bridge/tool-family-records/firestore-rules.js.map +1 -0
  54. package/dist/bridge/tool-family-records/firestore-simulator.d.ts +7 -0
  55. package/dist/bridge/tool-family-records/firestore-simulator.d.ts.map +1 -0
  56. package/dist/bridge/tool-family-records/firestore-simulator.js +16 -0
  57. package/dist/bridge/tool-family-records/firestore-simulator.js.map +1 -0
  58. package/dist/bridge/tool-family-records/rtdb-inspection.d.ts +7 -0
  59. package/dist/bridge/tool-family-records/rtdb-inspection.d.ts.map +1 -0
  60. package/dist/bridge/tool-family-records/rtdb-inspection.js +6 -0
  61. package/dist/bridge/tool-family-records/rtdb-inspection.js.map +1 -0
  62. package/dist/bundler/externals.d.ts +37 -0
  63. package/dist/bundler/externals.d.ts.map +1 -0
  64. package/dist/bundler/externals.js +52 -0
  65. package/dist/bundler/externals.js.map +1 -0
  66. package/dist/bundler/index.d.ts +17 -0
  67. package/dist/bundler/index.d.ts.map +1 -0
  68. package/dist/bundler/index.js +17 -0
  69. package/dist/bundler/index.js.map +1 -0
  70. package/dist/cli/inlined-sdk-scanner.d.ts +6 -0
  71. package/dist/cli/inlined-sdk-scanner.d.ts.map +1 -0
  72. package/dist/cli/inlined-sdk-scanner.js +82 -0
  73. package/dist/cli/inlined-sdk-scanner.js.map +1 -0
  74. package/dist/cli/sandbox-interlock.d.ts +97 -0
  75. package/dist/cli/sandbox-interlock.d.ts.map +1 -0
  76. package/dist/cli/sandbox-interlock.js +112 -0
  77. package/dist/cli/sandbox-interlock.js.map +1 -0
  78. package/dist/cli/sandbox-runner.d.ts +20 -12
  79. package/dist/cli/sandbox-runner.d.ts.map +1 -1
  80. package/dist/cli/sandbox-runner.js +24 -21
  81. package/dist/cli/sandbox-runner.js.map +1 -1
  82. package/dist/cli/serve.d.ts +6 -10
  83. package/dist/cli/serve.d.ts.map +1 -1
  84. package/dist/cli/serve.js +57 -77
  85. package/dist/cli/serve.js.map +1 -1
  86. package/dist/cli/unsupported-runtime.d.ts +27 -0
  87. package/dist/cli/unsupported-runtime.d.ts.map +1 -0
  88. package/dist/cli/unsupported-runtime.js +63 -0
  89. package/dist/cli/unsupported-runtime.js.map +1 -0
  90. package/dist/conformance/.generated/can-i-use-browser.d.ts +1 -1
  91. package/dist/conformance/.generated/can-i-use-browser.d.ts.map +1 -1
  92. package/dist/conformance/.generated/can-i-use-browser.js +1 -1
  93. package/dist/conformance/.generated/can-i-use-browser.js.map +1 -1
  94. package/dist/conformance/.generated/can-i-use.d.ts +1 -1
  95. package/dist/conformance/.generated/can-i-use.d.ts.map +1 -1
  96. package/dist/conformance/.generated/can-i-use.js +1 -1
  97. package/dist/conformance/.generated/can-i-use.js.map +1 -1
  98. package/dist/conformance/.generated/conformance-docs.d.ts.map +1 -1
  99. package/dist/conformance/.generated/conformance-docs.js +1 -1
  100. package/dist/conformance/.generated/conformance-docs.js.map +1 -1
  101. package/dist/functions-rtdb/child.d.ts +37 -0
  102. package/dist/functions-rtdb/child.d.ts.map +1 -1
  103. package/dist/functions-rtdb/child.js +90 -21
  104. package/dist/functions-rtdb/child.js.map +1 -1
  105. package/dist/functions-rtdb/development-runtime.d.ts +3 -0
  106. package/dist/functions-rtdb/development-runtime.d.ts.map +1 -1
  107. package/dist/functions-rtdb/development-runtime.js +1 -0
  108. package/dist/functions-rtdb/development-runtime.js.map +1 -1
  109. package/dist/google-endpoints.d.ts +67 -0
  110. package/dist/google-endpoints.d.ts.map +1 -0
  111. package/dist/google-endpoints.js +119 -0
  112. package/dist/google-endpoints.js.map +1 -0
  113. package/dist/next/runtime-env.d.ts.map +1 -1
  114. package/dist/next/runtime-env.js +5 -0
  115. package/dist/next/runtime-env.js.map +1 -1
  116. package/dist/next/with-pyric.d.ts +1 -1
  117. package/dist/next/with-pyric.js +1 -1
  118. package/dist/register/beacon.d.ts +69 -0
  119. package/dist/register/beacon.d.ts.map +1 -0
  120. package/dist/register/beacon.js +199 -0
  121. package/dist/register/beacon.js.map +1 -0
  122. package/dist/register/index.d.ts.map +1 -1
  123. package/dist/register/index.js +65 -6
  124. package/dist/register/index.js.map +1 -1
  125. package/dist/register/net-guard.d.ts +110 -0
  126. package/dist/register/net-guard.d.ts.map +1 -0
  127. package/dist/register/net-guard.js +462 -0
  128. package/dist/register/net-guard.js.map +1 -0
  129. package/dist/serve/ai-diagnostics-relay.d.ts +63 -0
  130. package/dist/serve/ai-diagnostics-relay.d.ts.map +1 -0
  131. package/dist/serve/ai-diagnostics-relay.js +125 -0
  132. package/dist/serve/ai-diagnostics-relay.js.map +1 -0
  133. package/dist/serve/ai-proxy.d.ts +92 -0
  134. package/dist/serve/ai-proxy.d.ts.map +1 -0
  135. package/dist/serve/ai-proxy.js +269 -0
  136. package/dist/serve/ai-proxy.js.map +1 -0
  137. package/dist/serve/ai-status.d.ts +44 -0
  138. package/dist/serve/ai-status.d.ts.map +1 -0
  139. package/dist/serve/ai-status.js +77 -0
  140. package/dist/serve/ai-status.js.map +1 -0
  141. package/dist/serve/ai-terminal-blocks.d.ts +97 -0
  142. package/dist/serve/ai-terminal-blocks.d.ts.map +1 -0
  143. package/dist/serve/ai-terminal-blocks.js +128 -0
  144. package/dist/serve/ai-terminal-blocks.js.map +1 -0
  145. package/dist/serve/ai-terminal-text.d.ts +36 -0
  146. package/dist/serve/ai-terminal-text.d.ts.map +1 -0
  147. package/dist/serve/ai-terminal-text.js +48 -0
  148. package/dist/serve/ai-terminal-text.js.map +1 -0
  149. package/dist/serve/beacon-route.d.ts +53 -0
  150. package/dist/serve/beacon-route.d.ts.map +1 -0
  151. package/dist/serve/beacon-route.js +101 -0
  152. package/dist/serve/beacon-route.js.map +1 -0
  153. package/dist/serve/entries/active-auth-registry.d.ts +16 -0
  154. package/dist/serve/entries/active-auth-registry.d.ts.map +1 -0
  155. package/dist/serve/entries/active-auth-registry.js +48 -0
  156. package/dist/serve/entries/active-auth-registry.js.map +1 -0
  157. package/dist/serve/entries/active-auth.d.ts +18 -0
  158. package/dist/serve/entries/active-auth.d.ts.map +1 -0
  159. package/dist/serve/entries/active-auth.js +84 -0
  160. package/dist/serve/entries/active-auth.js.map +1 -0
  161. package/dist/serve/entries/auth-helper-core.d.ts +1 -0
  162. package/dist/serve/entries/auth-helper-core.d.ts.map +1 -1
  163. package/dist/serve/entries/auth-helper-core.js +4 -0
  164. package/dist/serve/entries/auth-helper-core.js.map +1 -1
  165. package/dist/serve/entries/auth-helper-dom.d.ts.map +1 -1
  166. package/dist/serve/entries/auth-helper-dom.js +28 -2
  167. package/dist/serve/entries/auth-helper-dom.js.map +1 -1
  168. package/dist/serve/entries/auth.d.ts.map +1 -1
  169. package/dist/serve/entries/auth.js +8 -0
  170. package/dist/serve/entries/auth.js.map +1 -1
  171. package/dist/serve/entries/bridge-url.d.ts +1 -1
  172. package/dist/serve/entries/bridge-url.js +1 -1
  173. package/dist/serve/entries/init.d.ts.map +1 -1
  174. package/dist/serve/entries/init.js +70 -4
  175. package/dist/serve/entries/init.js.map +1 -1
  176. package/dist/serve/entries/runtime.d.ts.map +1 -1
  177. package/dist/serve/entries/runtime.js +9 -0
  178. package/dist/serve/entries/runtime.js.map +1 -1
  179. package/dist/serve/namespace.d.ts +14 -5
  180. package/dist/serve/namespace.d.ts.map +1 -1
  181. package/dist/serve/namespace.js +57 -124
  182. package/dist/serve/namespace.js.map +1 -1
  183. package/dist/serve/runtime/chip-config.d.ts.map +1 -1
  184. package/dist/serve/runtime/chip-config.js +16 -2
  185. package/dist/serve/runtime/chip-config.js.map +1 -1
  186. package/dist/serve/runtime/chip-dialog.d.ts +18 -0
  187. package/dist/serve/runtime/chip-dialog.d.ts.map +1 -0
  188. package/dist/serve/runtime/chip-dialog.js +315 -0
  189. package/dist/serve/runtime/chip-dialog.js.map +1 -0
  190. package/dist/serve/runtime/chip-install.d.ts +2 -0
  191. package/dist/serve/runtime/chip-install.d.ts.map +1 -1
  192. package/dist/serve/runtime/chip-install.js +9 -4
  193. package/dist/serve/runtime/chip-install.js.map +1 -1
  194. package/dist/serve/runtime/chip-user-search.d.ts +16 -0
  195. package/dist/serve/runtime/chip-user-search.d.ts.map +1 -0
  196. package/dist/serve/runtime/chip-user-search.js +354 -0
  197. package/dist/serve/runtime/chip-user-search.js.map +1 -0
  198. package/dist/serve/runtime/chip.d.ts +10 -0
  199. package/dist/serve/runtime/chip.d.ts.map +1 -1
  200. package/dist/serve/runtime/chip.js +118 -15
  201. package/dist/serve/runtime/chip.js.map +1 -1
  202. package/dist/serve/runtime/identity.d.ts +17 -0
  203. package/dist/serve/runtime/identity.d.ts.map +1 -0
  204. package/dist/serve/runtime/identity.js +10 -0
  205. package/dist/serve/runtime/identity.js.map +1 -0
  206. package/dist/serve/sandbox-session.d.ts +7 -0
  207. package/dist/serve/sandbox-session.d.ts.map +1 -1
  208. package/dist/serve/sandbox-session.js +2 -0
  209. package/dist/serve/sandbox-session.js.map +1 -1
  210. package/dist/serve/site-ui/_astro/{RulesCodeEditor.XtDmHOlN.js → RulesCodeEditor.DsTAsKIa.js} +1 -1
  211. package/dist/serve/site-ui/_astro/app.CMmTxyhL.js +1 -0
  212. package/dist/serve/site-ui/_astro/app.DhALsVii.js +115 -0
  213. package/dist/serve/site-ui/_astro/{chess-showcase.B72XYeoh.js → chess-showcase.Bn_pP6UJ.js} +2 -2
  214. package/dist/serve/site-ui/_astro/{example-runtime.C25_lx6Z.js → example-runtime.CXopTGv7.js} +1 -1
  215. package/dist/serve/site-ui/_astro/sandbox-controls.rOuZTOUG.js +510 -0
  216. package/dist/serve/site-ui/_astro/{seed.Co0yUJY5.js → seed.lywYbXZ0.js} +2 -2
  217. package/dist/serve/site-ui/_astro/writes.BsPBG3dp.js +653 -0
  218. package/dist/serve/site-ui/auth/index.html +1 -1
  219. package/dist/serve/site-ui/docs/_rhythm/index.html +1 -1
  220. package/dist/serve/site-ui/docs/agent/set-up-your-agent/index.html +1 -1
  221. package/dist/serve/site-ui/docs/agent/watch-and-review/index.html +1 -1
  222. package/dist/serve/site-ui/docs/agent/work-with-an-agent/index.html +1 -1
  223. package/dist/serve/site-ui/docs/ai-compat/index.html +1 -1
  224. package/dist/serve/site-ui/docs/api-reference/index.html +8 -1
  225. package/dist/serve/site-ui/docs/api-reference.md +7 -0
  226. package/dist/serve/site-ui/docs/app-compat/index.html +1 -1
  227. package/dist/serve/site-ui/docs/auth-compat/index.html +3 -3
  228. package/dist/serve/site-ui/docs/auth-compat.md +2 -2
  229. package/dist/serve/site-ui/docs/build/ai-logic/index.html +6 -1
  230. package/dist/serve/site-ui/docs/build/ai-logic.md +6 -0
  231. package/dist/serve/site-ui/docs/build/authentication/index.html +2 -2
  232. package/dist/serve/site-ui/docs/build/authentication.md +1 -1
  233. package/dist/serve/site-ui/docs/build/cloud-firestore/index.html +4 -2
  234. package/dist/serve/site-ui/docs/build/cloud-firestore.md +4 -0
  235. package/dist/serve/site-ui/docs/build/cloud-messaging/index.html +1 -1
  236. package/dist/serve/site-ui/docs/build/cloud-storage/index.html +1 -1
  237. package/dist/serve/site-ui/docs/build/realtime-database/index.html +1 -1
  238. package/dist/serve/site-ui/docs/conformance-scores/index.html +14 -2
  239. package/dist/serve/site-ui/docs/conformance-scores.md +13 -1
  240. package/dist/serve/site-ui/docs/create-pyric-reference-api/index.html +1 -1
  241. package/dist/serve/site-ui/docs/database-compat/index.html +44 -44
  242. package/dist/serve/site-ui/docs/database-compat.md +43 -43
  243. package/dist/serve/site-ui/docs/examples/chess/index.html +1 -1
  244. package/dist/serve/site-ui/docs/examples/index.html +1 -1
  245. package/dist/serve/site-ui/docs/firestore-compat/index.html +4 -4
  246. package/dist/serve/site-ui/docs/firestore-compat.md +3 -3
  247. package/dist/serve/site-ui/docs/firestore-flutter-compat/index.html +319 -0
  248. package/dist/serve/site-ui/docs/firestore-flutter-compat.md +344 -0
  249. package/dist/serve/site-ui/docs/firestore-kotlin-compat/index.html +319 -0
  250. package/dist/serve/site-ui/docs/firestore-kotlin-compat.md +344 -0
  251. package/dist/serve/site-ui/docs/firestore-swift-compat/index.html +490 -0
  252. package/dist/serve/site-ui/docs/firestore-swift-compat.md +517 -0
  253. package/dist/serve/site-ui/docs/functions-rtdb-compat/index.html +1 -1
  254. package/dist/serve/site-ui/docs/get-started/backend-bundlers/index.html +105 -0
  255. package/dist/serve/site-ui/docs/get-started/backend-bundlers.md +165 -0
  256. package/dist/serve/site-ui/docs/get-started/flutter/index.html +98 -0
  257. package/dist/serve/site-ui/docs/get-started/flutter.md +105 -0
  258. package/dist/serve/site-ui/docs/get-started/how-the-swap-works/index.html +1 -1
  259. package/dist/serve/site-ui/docs/get-started/nextjs/index.html +1 -1
  260. package/dist/serve/site-ui/docs/get-started/start-building/index.html +1 -1
  261. package/dist/serve/site-ui/docs/get-started/vite/index.html +1 -1
  262. package/dist/serve/site-ui/docs/index.json +3211 -1471
  263. package/dist/serve/site-ui/docs/messaging-compat/index.html +1 -1
  264. package/dist/serve/site-ui/docs/observe/resolve-runtime-status/index.html +4 -3
  265. package/dist/serve/site-ui/docs/observe/resolve-runtime-status.md +3 -1
  266. package/dist/serve/site-ui/docs/observe/see-whats-happening/index.html +1 -1
  267. package/dist/serve/site-ui/docs/observe/shape-your-data/index.html +1 -1
  268. package/dist/serve/site-ui/docs/observe/switch-and-impersonate-identities/index.html +110 -0
  269. package/dist/serve/site-ui/docs/observe/switch-and-impersonate-identities.md +134 -0
  270. package/dist/serve/site-ui/docs/overview/index.html +1 -1
  271. package/dist/serve/site-ui/docs/pyric-admin-app-reference-api/index.html +1 -1
  272. package/dist/serve/site-ui/docs/pyric-admin-auth-reference-api/index.html +1 -1
  273. package/dist/serve/site-ui/docs/pyric-admin-database-reference-api/index.html +1 -1
  274. package/dist/serve/site-ui/docs/pyric-admin-firestore-reference-api/index.html +1 -1
  275. package/dist/serve/site-ui/docs/pyric-admin-messaging-reference-api/index.html +1 -1
  276. package/dist/serve/site-ui/docs/pyric-admin-reference-api/index.html +1 -1
  277. package/dist/serve/site-ui/docs/pyric-admin-storage-reference-api/index.html +1 -1
  278. package/dist/serve/site-ui/docs/pyric-ai-reference-api/index.html +1 -1
  279. package/dist/serve/site-ui/docs/pyric-ai-scripting-reference-api/index.html +1 -1
  280. package/dist/serve/site-ui/docs/pyric-analytics-reference-api/index.html +124 -0
  281. package/dist/serve/site-ui/docs/pyric-analytics-reference-api.md +287 -0
  282. package/dist/serve/site-ui/docs/pyric-app-check-reference-api/index.html +87 -0
  283. package/dist/serve/site-ui/docs/pyric-app-check-reference-api.md +199 -0
  284. package/dist/serve/site-ui/docs/pyric-app-reference-api/index.html +1 -1
  285. package/dist/serve/site-ui/docs/pyric-auth-reference-api/index.html +6 -2
  286. package/dist/serve/site-ui/docs/pyric-auth-reference-api.md +2 -1
  287. package/dist/serve/site-ui/docs/pyric-cli-assurance-browser-reference-api/index.html +1 -1
  288. package/dist/serve/site-ui/docs/pyric-cli-assurance-reference-api/index.html +1 -1
  289. package/dist/serve/site-ui/docs/pyric-cli-bridge-client-reference-api/index.html +2 -2
  290. package/dist/serve/site-ui/docs/pyric-cli-bridge-client-reference-api.md +1 -1
  291. package/dist/serve/site-ui/docs/pyric-cli-bridge-reference-api/index.html +1 -1
  292. package/dist/serve/site-ui/docs/pyric-cli-bundler-reference-api/index.html +56 -0
  293. package/dist/serve/site-ui/docs/pyric-cli-bundler-reference-api.md +72 -0
  294. package/dist/serve/site-ui/docs/pyric-cli-conformance-browser-reference-api/index.html +4 -1
  295. package/dist/serve/site-ui/docs/pyric-cli-conformance-browser-reference-api.md +3 -0
  296. package/dist/serve/site-ui/docs/pyric-cli-conformance-docs-reference-api/index.html +1 -1
  297. package/dist/serve/site-ui/docs/pyric-cli-conformance-reference-api/index.html +4 -1
  298. package/dist/serve/site-ui/docs/pyric-cli-conformance-reference-api.md +3 -0
  299. package/dist/serve/site-ui/docs/pyric-cli-credentials-node-reference-api/index.html +1 -1
  300. package/dist/serve/site-ui/docs/pyric-cli-discover-reference-api/index.html +1 -1
  301. package/dist/serve/site-ui/docs/pyric-cli-next-reference-api/index.html +2 -2
  302. package/dist/serve/site-ui/docs/pyric-cli-next-reference-api.md +1 -1
  303. package/dist/serve/site-ui/docs/pyric-cli-register-app-bridge-reference-api/index.html +1 -1
  304. package/dist/serve/site-ui/docs/pyric-cli-register-reference-api/index.html +1 -1
  305. package/dist/serve/site-ui/docs/pyric-cli-remote-reference-api/index.html +34 -9
  306. package/dist/serve/site-ui/docs/pyric-cli-remote-reference-api.md +16 -8
  307. package/dist/serve/site-ui/docs/pyric-cli-serve-worker-reference-api/index.html +133 -93
  308. package/dist/serve/site-ui/docs/pyric-cli-serve-worker-reference-api.md +61 -1
  309. package/dist/serve/site-ui/docs/pyric-cli-verify-reference-api/index.html +2 -2
  310. package/dist/serve/site-ui/docs/pyric-cli-verify-reference-api.md +1 -1
  311. package/dist/serve/site-ui/docs/pyric-cli-vite-reference-api/index.html +2 -2
  312. package/dist/serve/site-ui/docs/pyric-cli-vite-reference-api.md +2 -2
  313. package/dist/serve/site-ui/docs/pyric-database-reference-api/index.html +2 -2
  314. package/dist/serve/site-ui/docs/pyric-database-reference-api.md +1 -1
  315. package/dist/serve/site-ui/docs/pyric-firestore-lite-reference-api/index.html +559 -0
  316. package/dist/serve/site-ui/docs/pyric-firestore-lite-reference-api.md +1240 -0
  317. package/dist/serve/site-ui/docs/pyric-firestore-reference-api/index.html +40 -11
  318. package/dist/serve/site-ui/docs/pyric-firestore-reference-api.md +18 -8
  319. package/dist/serve/site-ui/docs/pyric-functions-reference-api/index.html +67 -0
  320. package/dist/serve/site-ui/docs/pyric-functions-reference-api.md +149 -0
  321. package/dist/serve/site-ui/docs/pyric-messaging-reference-api/index.html +1 -1
  322. package/dist/serve/site-ui/docs/pyric-messaging-sw-reference-api/index.html +1 -1
  323. package/dist/serve/site-ui/docs/pyric-performance-reference-api/index.html +35 -0
  324. package/dist/serve/site-ui/docs/pyric-performance-reference-api.md +69 -0
  325. package/dist/serve/site-ui/docs/pyric-remote-config-reference-api/index.html +132 -0
  326. package/dist/serve/site-ui/docs/pyric-remote-config-reference-api.md +307 -0
  327. package/dist/serve/site-ui/docs/pyric-rules-reference-api/index.html +1 -1
  328. package/dist/serve/site-ui/docs/pyric-sandbox-database-reference-api/index.html +52 -17
  329. package/dist/serve/site-ui/docs/pyric-sandbox-database-reference-api.md +48 -9
  330. package/dist/serve/site-ui/docs/pyric-sandbox-firestore-reference-api/index.html +1 -1
  331. package/dist/serve/site-ui/docs/pyric-sandbox-reference-api/index.html +239 -49
  332. package/dist/serve/site-ui/docs/pyric-sandbox-reference-api.md +148 -31
  333. package/dist/serve/site-ui/docs/pyric-storage-reference-api/index.html +22 -4
  334. package/dist/serve/site-ui/docs/pyric-storage-reference-api.md +25 -3
  335. package/dist/serve/site-ui/docs/pyric-ui-agents-reference-api/index.html +26 -96
  336. package/dist/serve/site-ui/docs/pyric-ui-agents-reference-api.md +20 -51
  337. package/dist/serve/site-ui/docs/pyric-ui-auth-hooks-reference-api/index.html +1 -1
  338. package/dist/serve/site-ui/docs/pyric-ui-auth-reference-api/index.html +2 -2
  339. package/dist/serve/site-ui/docs/pyric-ui-auth-reference-api.md +1 -1
  340. package/dist/serve/site-ui/docs/pyric-ui-events-hooks-reference-api/index.html +1 -1
  341. package/dist/serve/site-ui/docs/pyric-ui-events-reference-api/index.html +1 -1
  342. package/dist/serve/site-ui/docs/pyric-ui-firestore-hooks-reference-api/index.html +1 -1
  343. package/dist/serve/site-ui/docs/pyric-ui-firestore-reference-api/index.html +2 -2
  344. package/dist/serve/site-ui/docs/pyric-ui-firestore-reference-api.md +1 -1
  345. package/dist/serve/site-ui/docs/pyric-ui-primitives-reference-api/index.html +124 -26
  346. package/dist/serve/site-ui/docs/pyric-ui-primitives-reference-api.md +58 -5
  347. package/dist/serve/site-ui/docs/pyric-ui-rtdb-reference-api/index.html +1 -1
  348. package/dist/serve/site-ui/docs/pyric-ui-rules-hooks-reference-api/index.html +1 -1
  349. package/dist/serve/site-ui/docs/pyric-ui-rules-reference-api/index.html +1 -1
  350. package/dist/serve/site-ui/docs/pyric-ui-storage-hooks-reference-api/index.html +1 -1
  351. package/dist/serve/site-ui/docs/pyric-ui-storage-reference-api/index.html +4 -5
  352. package/dist/serve/site-ui/docs/pyric-ui-storage-reference-api.md +3 -4
  353. package/dist/serve/site-ui/docs/pyric-ui-traffic-hooks-reference-api/index.html +1 -1
  354. package/dist/serve/site-ui/docs/pyric-ui-traffic-reference-api/index.html +1 -1
  355. package/dist/serve/site-ui/docs/reference/cli/index.html +6 -3
  356. package/dist/serve/site-ui/docs/reference/cli.md +8 -2
  357. package/dist/serve/site-ui/docs/rules-compat/index.html +10 -2
  358. package/dist/serve/site-ui/docs/rules-compat.md +9 -1
  359. package/dist/serve/site-ui/docs/secure/audit-your-rules/index.html +1 -1
  360. package/dist/serve/site-ui/docs/secure/firestore-rules-limits/index.html +1 -1
  361. package/dist/serve/site-ui/docs/secure/read-a-denial/index.html +1 -1
  362. package/dist/serve/site-ui/docs/secure/rtdb-rules-in-typescript/index.html +1 -1
  363. package/dist/serve/site-ui/docs/secure/rules-standard-library/index.html +1 -1
  364. package/dist/serve/site-ui/docs/secure/secure-it-with-rules/index.html +1 -1
  365. package/dist/serve/site-ui/docs/secure/simulate-and-lint/index.html +1 -1
  366. package/dist/serve/site-ui/docs/secure/write-a-rules-test-suite/index.html +1 -1
  367. package/dist/serve/site-ui/docs/ship/ship-to-production/index.html +1 -1
  368. package/dist/serve/site-ui/docs/ship/test-in-node/index.html +1 -1
  369. package/dist/serve/site-ui/docs/storage-compat/index.html +13 -13
  370. package/dist/serve/site-ui/docs/storage-compat.md +12 -12
  371. package/dist/serve/site-ui/docs/trust/how-we-know-it-matches-firebase/index.html +1 -1
  372. package/dist/serve/site-ui/docs/trust/rules-standard-library/index.html +1 -1
  373. package/dist/serve/site-ui/docs/trust/versioning-and-compatibility/index.html +1 -1
  374. package/dist/serve/site-ui/docs/tutorial/index.html +1 -1
  375. package/dist/serve/site-ui/examples/chess/index.html +1 -1
  376. package/dist/serve/site-ui/firestore/index.html +1 -1
  377. package/dist/serve/site-ui/llms.txt +13 -0
  378. package/dist/serve/site-ui/rtdb/index.html +1 -1
  379. package/dist/serve/site-ui/settings/index.html +1 -1
  380. package/dist/serve/site-ui/storage/index.html +1 -1
  381. package/dist/serve/site-ui/studio/index.html +1 -1
  382. package/dist/serve/site-ui/traffic/index.html +1 -1
  383. package/dist/serve/studio/disk-workspace.d.ts.map +1 -1
  384. package/dist/serve/studio/disk-workspace.js +64 -2
  385. package/dist/serve/studio/disk-workspace.js.map +1 -1
  386. package/dist/serve/vite-plugin.d.ts +7 -7
  387. package/dist/serve/vite-plugin.js +1 -1
  388. package/dist/serve/vite-plugin.js.map +1 -1
  389. package/dist/serve/vite-sandbox-generation.d.ts.map +1 -1
  390. package/dist/serve/vite-sandbox-generation.js +12 -0
  391. package/dist/serve/vite-sandbox-generation.js.map +1 -1
  392. package/dist/serve/worker/client/auth.js +1 -2
  393. package/dist/serve/worker/client/auth.js.map +1 -1
  394. package/dist/serve/worker/client/core.d.ts +21 -1
  395. package/dist/serve/worker/client/core.d.ts.map +1 -1
  396. package/dist/serve/worker/client/core.js +79 -3
  397. package/dist/serve/worker/client/core.js.map +1 -1
  398. package/dist/serve/worker/client.d.ts +1 -1
  399. package/dist/serve/worker/client.d.ts.map +1 -1
  400. package/dist/serve/worker/client.js +1 -1
  401. package/dist/serve/worker/client.js.map +1 -1
  402. package/dist/serve/worker/context-resolver.d.ts +30 -0
  403. package/dist/serve/worker/context-resolver.d.ts.map +1 -0
  404. package/dist/serve/worker/context-resolver.js +44 -0
  405. package/dist/serve/worker/context-resolver.js.map +1 -0
  406. package/dist/serve/worker/entry.js +23 -19
  407. package/dist/serve/worker/entry.js.map +1 -1
  408. package/dist/serve/worker/host/core.d.ts +1 -0
  409. package/dist/serve/worker/host/core.d.ts.map +1 -1
  410. package/dist/serve/worker/host/core.js +12 -6
  411. package/dist/serve/worker/host/core.js.map +1 -1
  412. package/dist/serve/worker/host/storage.js +2 -2
  413. package/dist/serve/worker/host-auth.js +1 -2
  414. package/dist/serve/worker/host-auth.js.map +1 -1
  415. package/dist/serve/worker/index.d.ts +1 -1
  416. package/dist/serve/worker/index.d.ts.map +1 -1
  417. package/dist/serve/worker/index.js +2 -2
  418. package/dist/serve/worker/index.js.map +1 -1
  419. package/dist/serve/worker/port-lifecycle.d.ts +18 -0
  420. package/dist/serve/worker/port-lifecycle.d.ts.map +1 -0
  421. package/dist/serve/worker/port-lifecycle.js +28 -0
  422. package/dist/serve/worker/port-lifecycle.js.map +1 -0
  423. package/dist/serve/worker/serve-init.d.ts.map +1 -1
  424. package/dist/serve/worker/serve-init.js +8 -2
  425. package/dist/serve/worker/serve-init.js.map +1 -1
  426. package/dist/verify/fixture.d.ts +1 -1
  427. package/package.json +16 -5
  428. package/src/assurance/.generated/conformance-verdicts.ts +238 -1
  429. package/src/bridge/client/dispatch.ts +52 -56
  430. package/src/bridge/client/tool-family-factories.ts +34 -0
  431. package/src/bridge/server/mcp-contract.ts +15 -59
  432. package/src/bridge/server/peer.ts +24 -1
  433. package/src/bridge/server/tool-family-factories.ts +40 -0
  434. package/src/bridge/server/tool-metadata.ts +29 -61
  435. package/src/bridge/tool-families.generated.ts +17 -0
  436. package/src/bridge/tool-families.ts +87 -0
  437. package/src/bridge/tool-family-records/conformance.ts +6 -0
  438. package/src/bridge/tool-family-records/firestore-data.ts +15 -0
  439. package/src/bridge/tool-family-records/firestore-inspect.ts +6 -0
  440. package/src/bridge/tool-family-records/firestore-rules.ts +15 -0
  441. package/src/bridge/tool-family-records/firestore-simulator.ts +16 -0
  442. package/src/bridge/tool-family-records/rtdb-inspection.ts +6 -0
  443. package/src/bundler/externals.ts +55 -0
  444. package/src/bundler/index.ts +21 -0
  445. package/src/cli/cli.test.ts +0 -44
  446. package/src/cli/inlined-sdk-scanner.ts +77 -0
  447. package/src/cli/sandbox-interlock.ts +167 -0
  448. package/src/cli/sandbox-runner.ts +37 -26
  449. package/src/cli/serve.ts +68 -69
  450. package/src/cli/unsupported-runtime.ts +68 -0
  451. package/src/conformance/.generated/can-i-use-browser.ts +2 -2
  452. package/src/conformance/.generated/can-i-use.ts +2 -2
  453. package/src/conformance/.generated/conformance-docs.ts +1 -1
  454. package/src/functions-rtdb/child.ts +115 -21
  455. package/src/functions-rtdb/development-runtime.ts +4 -0
  456. package/src/google-endpoints.ts +155 -0
  457. package/src/next/runtime-env.ts +5 -0
  458. package/src/next/with-pyric.ts +1 -1
  459. package/src/register/beacon.ts +232 -0
  460. package/src/register/index.ts +68 -6
  461. package/src/register/net-guard.ts +567 -0
  462. package/src/serve/ai-diagnostics-relay.ts +243 -0
  463. package/src/serve/ai-proxy.ts +327 -0
  464. package/src/serve/ai-status.ts +109 -0
  465. package/src/serve/ai-terminal-blocks.ts +210 -0
  466. package/src/serve/ai-terminal-text.ts +52 -0
  467. package/src/serve/beacon-route.ts +141 -0
  468. package/src/serve/entries/active-auth-registry.ts +56 -0
  469. package/src/serve/entries/active-auth.ts +100 -0
  470. package/src/serve/entries/auth-helper-core.ts +5 -0
  471. package/src/serve/entries/auth-helper-dom.ts +26 -2
  472. package/src/serve/entries/auth.ts +8 -0
  473. package/src/serve/entries/bridge-url.ts +1 -1
  474. package/src/serve/entries/init.ts +78 -3
  475. package/src/serve/entries/runtime.ts +10 -0
  476. package/src/serve/namespace.ts +73 -140
  477. package/src/serve/runtime/chip-config.ts +16 -2
  478. package/src/serve/runtime/chip-dialog.ts +366 -0
  479. package/src/serve/runtime/chip-install.ts +10 -4
  480. package/src/serve/runtime/chip-user-search.ts +391 -0
  481. package/src/serve/runtime/chip.ts +140 -15
  482. package/src/serve/runtime/identity.ts +26 -0
  483. package/src/serve/sandbox-session.ts +9 -0
  484. package/src/serve/studio/disk-workspace.ts +76 -2
  485. package/src/serve/vite-plugin.ts +8 -8
  486. package/src/serve/vite-sandbox-generation.ts +15 -0
  487. package/src/serve/worker/client/auth.ts +1 -1
  488. package/src/serve/worker/client/core.ts +80 -3
  489. package/src/serve/worker/client.ts +1 -1
  490. package/src/serve/worker/context-resolver.ts +60 -0
  491. package/src/serve/worker/entry.ts +22 -18
  492. package/src/serve/worker/host/core.ts +9 -7
  493. package/src/serve/worker/host/storage.ts +2 -2
  494. package/src/serve/worker/host-auth.ts +1 -1
  495. package/src/serve/worker/index.ts +4 -1
  496. package/src/serve/worker/port-lifecycle.ts +45 -0
  497. package/src/serve/worker/serve-init.ts +9 -2
  498. package/src/verify/fixture.ts +1 -1
  499. package/dist/serve/site-ui/_astro/app.B52xr-DK.js +0 -1
  500. package/dist/serve/site-ui/_astro/app.DWBraPUw.js +0 -12
  501. package/dist/serve/site-ui/_astro/sandbox-controls.DEpnKg-O.js +0 -1169
  502. package/dist/serve/site-ui/_astro/writes.rpjrFzmu.js +0 -102
@@ -67,6 +67,7 @@ factories; consumers don't construct it directly.
67
67
  new SandboxContextImpl(
68
68
  sandbox: Sandbox,
69
69
  auth: {
70
+ tenant?: string;
70
71
  token?: Record<string, unknown>;
71
72
  uid: string;
72
73
  },
@@ -78,7 +79,8 @@ new SandboxContextImpl(
78
79
  | Parameter | Type |
79
80
  | :------ | :------ |
80
81
  | `sandbox` | [`Sandbox`](pyric-firestore-reference-api.md#sandbox) |
81
- | `auth` | \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} |
82
+ | `auth` | \{ `tenant?`: `string`; `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} |
83
+ | `auth.tenant?` | `string` |
82
84
  | `auth.token?` | `Record`\<`string`, `unknown`\> |
83
85
  | `auth.uid?` | `string` |
84
86
  | `operationContext?` | [`OperationContext`](#operationcontext-2) |
@@ -91,7 +93,8 @@ new SandboxContextImpl(
91
93
 
92
94
  | Property | Modifier | Type | Description |
93
95
  | :------ | :------ | :------ | :------ |
94
- | <a id="auth"></a> `auth` | `readonly` | \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} | The identity rules evaluate under for operations through this context. |
96
+ | <a id="auth"></a> `auth` | `readonly` | \{ `tenant?`: `string`; `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} | The identity rules evaluate under for operations through this context. |
97
+ | `auth.tenant?` | `public` | `string` | - |
95
98
  | `auth.token?` | `public` | `Record`\<`string`, `unknown`\> | - |
96
99
  | `auth.uid` | `public` | `string` | - |
97
100
  | <a id="operationcontext"></a> `operationContext` | `readonly` | [`OperationContext`](#operationcontext-2) | Immutable provenance bound to every operation issued through this handle. |
@@ -105,6 +108,7 @@ new SandboxContextImpl(
105
108
 
106
109
  ```ts
107
110
  withAuth(auth: {
111
+ tenant?: string;
108
112
  token?: Record<string, unknown>;
109
113
  uid: string;
110
114
  }): SandboxContext;
@@ -118,7 +122,8 @@ optional plan identity.
118
122
 
119
123
  | Parameter | Type |
120
124
  | :------ | :------ |
121
- | `auth` | \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} |
125
+ | `auth` | \{ `tenant?`: `string`; `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} |
126
+ | `auth.tenant?` | `string` |
122
127
  | `auth.token?` | `Record`\<`string`, `unknown`\> |
123
128
  | `auth.uid` | `string` |
124
129
 
@@ -289,7 +294,8 @@ reference traces.
289
294
 
290
295
  | Property | Modifier | Type | Description |
291
296
  | :------ | :------ | :------ | :------ |
292
- | <a id="auth-1"></a> `auth?` | `public` | \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} | Auth identity that was active when the denial fired. |
297
+ | <a id="auth-1"></a> `auth?` | `public` | \{ `tenant?`: `string`; `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} | Auth identity that was active when the denial fired. |
298
+ | `auth.tenant?` | `public` | `string` | - |
293
299
  | `auth.token?` | `public` | `Record`\<`string`, `unknown`\> | - |
294
300
  | `auth.uid` | `public` | `string` | - |
295
301
  | <a id="failedfields"></a> `failedFields?` | `public` | `string`[] | Field paths in `request.resource.data` that the rule referenced and that failed. |
@@ -331,7 +337,8 @@ frame either way.
331
337
 
332
338
  | Property | Type |
333
339
  | :------ | :------ |
334
- | <a id="auth-2"></a> `auth?` | \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} |
340
+ | <a id="auth-2"></a> `auth?` | \{ `tenant?`: `string`; `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} |
341
+ | `auth.tenant?` | `string` |
335
342
  | `auth.token?` | `Record`\<`string`, `unknown`\> |
336
343
  | `auth.uid` | `string` |
337
344
  | <a id="code"></a> `code` | `"permission-denied"` |
@@ -380,7 +387,8 @@ on the errored phase only.
380
387
  | Property | Type | Description |
381
388
  | :------ | :------ | :------ |
382
389
  | <a id="at"></a> `at` | `number` | - |
383
- | <a id="auth-3"></a> `auth` | \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} | - |
390
+ | <a id="auth-3"></a> `auth` | \{ `tenant?`: `string`; `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} | - |
391
+ | `auth.tenant?` | `string` | - |
384
392
  | `auth.token?` | `Record`\<`string`, `unknown`\> | - |
385
393
  | `auth.uid` | `string` | - |
386
394
  | <a id="error"></a> `error?` | \{ `code`: `"permission-denied"`; `message`: `string`; `reasons?`: `string`[]; \} | Populated on `listener_errored` only. |
@@ -414,7 +422,8 @@ are deliberately not assignable to this local-only interface.
414
422
  | :------ | :------ | :------ | :------ |
415
423
  | <a id="local_sandbox"></a> `[LOCAL_SANDBOX]` | `readonly` | `true` | - |
416
424
  | <a id="admin"></a> `admin` | `readonly` | `SandboxAdmin` | Admin-plane access (rule-bypass reads). Identity-agnostic by design — admin reads aren't gated on auth, so they live on the sandbox, not on a context. See SandboxAdmin. |
417
- | <a id="currentuser"></a> `currentUser` | `public` | \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} | Current authenticated user across the sandbox. Mutated by `pyric/auth`'s `signInAnonymously` / `signInWithEmailAndPassword` / `signOut` / `sandbox.setUser`. Read per-call by service factories (e.g. a future `getFirestore(sandbox)` overload) so they see auth state changes without re-binding handles. Defaults to `null` (anonymous / signed out). **Independent of `withAuth({uid})`** — `withAuth` still produces a frozen [SandboxContext](pyric-firestore-reference-api.md#sandboxcontext) that carries its own identity for the runner's test code (the existing pattern: explicit identity per service call). `currentUser` exists for the `pyric/auth` mirror, where consumer app code drives identity through a stateful `Auth` handle rather than naming it per call. |
425
+ | <a id="currentuser"></a> `currentUser` | `public` | \{ `tenant?`: `string`; `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} | Current authenticated user across the sandbox. Mutated by `pyric/auth`'s `signInAnonymously` / `signInWithEmailAndPassword` / `signOut` / `sandbox.setUser`. Read per-call by service factories (e.g. a future `getFirestore(sandbox)` overload) so they see auth state changes without re-binding handles. Defaults to `null` (anonymous / signed out). **Independent of `withAuth({uid})`** — `withAuth` still produces a frozen [SandboxContext](pyric-firestore-reference-api.md#sandboxcontext) that carries its own identity for the runner's test code (the existing pattern: explicit identity per service call). `currentUser` exists for the `pyric/auth` mirror, where consumer app code drives identity through a stateful `Auth` handle rather than naming it per call. |
426
+ | `currentUser.tenant?` | `public` | `string` | - |
418
427
  | `currentUser.token?` | `public` | `Record`\<`string`, `unknown`\> | - |
419
428
  | `currentUser.uid` | `public` | `string` | - |
420
429
 
@@ -665,6 +674,7 @@ a service this one lacks).
665
674
 
666
675
  ```ts
667
676
  onCurrentUserChanged(cb: (user: {
677
+ tenant?: string;
668
678
  token?: Record<string, unknown>;
669
679
  uid: string;
670
680
  }) => void): () => void;
@@ -686,7 +696,7 @@ their errors.
686
696
 
687
697
  | Parameter | Type |
688
698
  | :------ | :------ |
689
- | `cb` | (`user`: \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \}) => `void` |
699
+ | `cb` | (`user`: \{ `tenant?`: `string`; `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \}) => `void` |
690
700
 
691
701
  ###### Returns
692
702
 
@@ -941,6 +951,7 @@ paths to data. Future services will add their own keys.
941
951
 
942
952
  ```ts
943
953
  withAuth(auth: {
954
+ tenant?: string;
944
955
  token?: Record<string, unknown>;
945
956
  uid: string;
946
957
  }): SandboxContext;
@@ -960,7 +971,8 @@ unambiguous.
960
971
 
961
972
  | Parameter | Type |
962
973
  | :------ | :------ |
963
- | `auth` | \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} |
974
+ | `auth` | \{ `tenant?`: `string`; `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} |
975
+ | `auth.tenant?` | `string` |
964
976
  | `auth.token?` | `Record`\<`string`, `unknown`\> |
965
977
  | `auth.uid` | `string` |
966
978
 
@@ -1009,7 +1021,8 @@ as a user, while an app or agent may use an admin lens.
1009
1021
  | Property | Modifier | Type |
1010
1022
  | :------ | :------ | :------ |
1011
1023
  | <a id="at-1"></a> `at` | `readonly` | `number` |
1012
- | <a id="auth-4"></a> `auth` | `readonly` | \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} |
1024
+ | <a id="auth-4"></a> `auth` | `readonly` | \{ `tenant?`: `string`; `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} |
1025
+ | `auth.tenant?` | `public` | `string` |
1013
1026
  | `auth.token?` | `public` | `Record`\<`string`, `unknown`\> |
1014
1027
  | `auth.uid` | `public` | `string` |
1015
1028
  | <a id="context"></a> `context` | `readonly` | [`OperationContext`](#operationcontext-2) |
@@ -1017,7 +1030,7 @@ as a user, while an app or agent may use an admin lens.
1017
1030
  | <a id="id-1"></a> `id` | `readonly` | `string` |
1018
1031
  | <a id="method"></a> `method` | `readonly` | `string` |
1019
1032
  | <a id="path"></a> `path?` | `readonly` | `string` |
1020
- | <a id="result"></a> `result?` | `readonly` | `"unsupported"` \| `"error"` \| `"allow"` \| `"deny"` \| `"not-applicable"` |
1033
+ | <a id="result"></a> `result?` | `readonly` | `"allow"` \| `"deny"` \| `"unsupported"` \| `"error"` \| `"not-applicable"` |
1021
1034
  | <a id="rules-1"></a> `rules` | `readonly` | [`RulesDisposition`](#rulesdisposition-3) |
1022
1035
  | <a id="service-1"></a> `service` | `readonly` | [`EventService`](#eventservice) |
1023
1036
 
@@ -1339,10 +1352,11 @@ dispatch on [isRemoteSandbox](#isremotesandbox) and use [channel](#channel) inst
1339
1352
  | <a id="remote_sandbox"></a> `[REMOTE_SANDBOX]` | `readonly` | `true` | - |
1340
1353
  | <a id="admin-1"></a> `admin` | `readonly` | `SandboxAdmin` | Admin-plane access (rule-bypass reads). Identity-agnostic by design — admin reads aren't gated on auth, so they live on the sandbox, not on a context. See SandboxAdmin. |
1341
1354
  | <a id="channel"></a> `channel` | `readonly` | [`RemoteSandboxChannel`](#remotesandboxchannel-1) | The raw worker op/sub relay channel. |
1342
- | <a id="currentuser-1"></a> `currentUser` | `public` | \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} | Current authenticated user across the sandbox. Mutated by `pyric/auth`'s `signInAnonymously` / `signInWithEmailAndPassword` / `signOut` / `sandbox.setUser`. Read per-call by service factories (e.g. a future `getFirestore(sandbox)` overload) so they see auth state changes without re-binding handles. Defaults to `null` (anonymous / signed out). **Independent of `withAuth({uid})`** — `withAuth` still produces a frozen [SandboxContext](pyric-firestore-reference-api.md#sandboxcontext) that carries its own identity for the runner's test code (the existing pattern: explicit identity per service call). `currentUser` exists for the `pyric/auth` mirror, where consumer app code drives identity through a stateful `Auth` handle rather than naming it per call. |
1355
+ | <a id="currentuser-1"></a> `currentUser` | `public` | \{ `tenant?`: `string`; `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} | Current authenticated user across the sandbox. Mutated by `pyric/auth`'s `signInAnonymously` / `signInWithEmailAndPassword` / `signOut` / `sandbox.setUser`. Read per-call by service factories (e.g. a future `getFirestore(sandbox)` overload) so they see auth state changes without re-binding handles. Defaults to `null` (anonymous / signed out). **Independent of `withAuth({uid})`** — `withAuth` still produces a frozen [SandboxContext](pyric-firestore-reference-api.md#sandboxcontext) that carries its own identity for the runner's test code (the existing pattern: explicit identity per service call). `currentUser` exists for the `pyric/auth` mirror, where consumer app code drives identity through a stateful `Auth` handle rather than naming it per call. |
1356
+ | `currentUser.tenant?` | `public` | `string` | - |
1343
1357
  | `currentUser.token?` | `public` | `Record`\<`string`, `unknown`\> | - |
1344
1358
  | `currentUser.uid` | `public` | `string` | - |
1345
- | <a id="serveurl"></a> `serveUrl` | `readonly` | `string` | Base URL of the `pyric dev` this handle is attached to (used in error guidance: "open <serveUrl> in a browser and retry"). |
1359
+ | <a id="serveurl"></a> `serveUrl` | `readonly` | `string` | Base URL of the `pyric sandbox` this handle is attached to (used in error guidance: "open <serveUrl> in a browser and retry"). |
1346
1360
 
1347
1361
  #### Methods
1348
1362
 
@@ -1591,6 +1605,7 @@ a service this one lacks).
1591
1605
 
1592
1606
  ```ts
1593
1607
  onCurrentUserChanged(cb: (user: {
1608
+ tenant?: string;
1594
1609
  token?: Record<string, unknown>;
1595
1610
  uid: string;
1596
1611
  }) => void): () => void;
@@ -1612,7 +1627,7 @@ their errors.
1612
1627
 
1613
1628
  | Parameter | Type |
1614
1629
  | :------ | :------ |
1615
- | `cb` | (`user`: \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \}) => `void` |
1630
+ | `cb` | (`user`: \{ `tenant?`: `string`; `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \}) => `void` |
1616
1631
 
1617
1632
  ###### Returns
1618
1633
 
@@ -1867,6 +1882,7 @@ paths to data. Future services will add their own keys.
1867
1882
 
1868
1883
  ```ts
1869
1884
  withAuth(auth: {
1885
+ tenant?: string;
1870
1886
  token?: Record<string, unknown>;
1871
1887
  uid: string;
1872
1888
  }): SandboxContext;
@@ -1886,7 +1902,8 @@ unambiguous.
1886
1902
 
1887
1903
  | Parameter | Type |
1888
1904
  | :------ | :------ |
1889
- | `auth` | \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} |
1905
+ | `auth` | \{ `tenant?`: `string`; `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} |
1906
+ | `auth.tenant?` | `string` |
1890
1907
  | `auth.token?` | `Record`\<`string`, `unknown`\> |
1891
1908
  | `auth.uid` | `string` |
1892
1909
 
@@ -1999,7 +2016,7 @@ Options accepted by the ambient remote-sandbox factory.
1999
2016
 
2000
2017
  | Property | Type | Description |
2001
2018
  | :------ | :------ | :------ |
2002
- | <a id="url"></a> `url?` | `string` | Explicit `pyric dev` base URL (from `PYRIC_SANDBOX=remote:<url>`). When omitted the factory discovers the running host itself (the `.pyric/serve.json` locator protocol). |
2019
+ | <a id="url"></a> `url?` | `string` | Explicit `pyric sandbox` base URL (from `PYRIC_SANDBOX=remote:<url>`). When omitted the factory discovers the running host itself (the `.pyric/serve.json` locator protocol). |
2003
2020
 
2004
2021
  ***
2005
2022
 
@@ -2067,7 +2084,8 @@ traffic-monitor-decision.md for the field-by-field rationale.
2067
2084
  | Property | Type | Description |
2068
2085
  | :------ | :------ | :------ |
2069
2086
  | <a id="at-2"></a> `at` | `number` | Wall-clock at op start, ms since epoch. |
2070
- | <a id="auth-5"></a> `auth` | \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} | - |
2087
+ | <a id="auth-5"></a> `auth` | \{ `tenant?`: `string`; `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} | - |
2088
+ | `auth.tenant?` | `string` | - |
2071
2089
  | `auth.token?` | `Record`\<`string`, `unknown`\> | - |
2072
2090
  | `auth.uid` | `string` | - |
2073
2091
  | <a id="detail"></a> `detail?` | \{ `admin?`: `boolean`; \} & `Record`\<`string`, `unknown`\> | Free-form operation metadata. `admin: true` marks a rules-bypassing setup/admin operation so fixture tooling can exclude it from protected behavior while still preserving it as replay context. |
@@ -2092,7 +2110,7 @@ traffic-monitor-decision.md for the field-by-field rationale.
2092
2110
  | <a id="resourcebefore"></a> `resourceBefore?` | \{ `data`: `Record`\<`string`, `unknown`\>; `exists`: `boolean`; \} | Existing document state before the write (or read target for get). |
2093
2111
  | `resourceBefore.data` | `Record`\<`string`, `unknown`\> | - |
2094
2112
  | `resourceBefore.exists` | `boolean` | - |
2095
- | <a id="result-1"></a> `result` | `"unsupported"` \| `"allow"` \| `"deny"` | `'unsupported'` fires when the simulator hit an unmodelled feature and the sandbox upgraded it (today: thrown as SimulatorUnsupportedError, surfaced here as a discrete result so the panel can show it distinctly from a real denial). |
2113
+ | <a id="result-1"></a> `result` | `"allow"` \| `"deny"` \| `"unsupported"` | `'unsupported'` fires when the simulator hit an unmodelled feature and the sandbox upgraded it (today: thrown as SimulatorUnsupportedError, surfaced here as a discrete result so the panel can show it distinctly from a real denial). |
2096
2114
  | <a id="rulesdisposition"></a> `rulesDisposition?` | [`RulesDisposition`](#rulesdisposition-3) | Canonical statement of whether Security Rules evaluated this request. Added by the sandbox event recorder when an older emitter omits it. |
2097
2115
  | <a id="triggeredby"></a> `triggeredBy?` | \{ `method`: `string`; `path`: `string`; \} | For listener re-evals: the originating user op that triggered this re-evaluation. Absent on the initial-snapshot fire. |
2098
2116
  | `triggeredBy.method` | `string` | - |
@@ -2113,7 +2131,8 @@ these service adapters instead of filtering Firestore-only `write` events.
2113
2131
  | Property | Type |
2114
2132
  | :------ | :------ |
2115
2133
  | <a id="at-3"></a> `at` | `number` |
2116
- | <a id="auth-6"></a> `auth` | \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} |
2134
+ | <a id="auth-6"></a> `auth` | \{ `tenant?`: `string`; `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} |
2135
+ | `auth.tenant?` | `string` |
2117
2136
  | `auth.token?` | `Record`\<`string`, `unknown`\> |
2118
2137
  | `auth.uid` | `string` |
2119
2138
  | <a id="data"></a> `data?` | `unknown` |
@@ -2159,7 +2178,8 @@ service listeners the same debuggable surface.
2159
2178
  | Property | Type |
2160
2179
  | :------ | :------ |
2161
2180
  | <a id="at-4"></a> `at` | `number` |
2162
- | <a id="auth-7"></a> `auth` | \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} |
2181
+ | <a id="auth-7"></a> `auth` | \{ `tenant?`: `string`; `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} |
2182
+ | `auth.tenant?` | `string` |
2163
2183
  | `auth.token?` | `Record`\<`string`, `unknown`\> |
2164
2184
  | `auth.uid` | `string` |
2165
2185
  | <a id="detail-2"></a> `detail?` | `Record`\<`string`, `unknown`\> |
@@ -2173,7 +2193,7 @@ service listeners the same debuggable surface.
2173
2193
  | <a id="phase"></a> `phase` | `"attach"` \| `"detach"` \| `"delivery"` \| `"suppressed"` \| `"errored"` |
2174
2194
  | <a id="reason"></a> `reason?` | `string` |
2175
2195
  | <a id="reasons-3"></a> `reasons?` | `string`[] |
2176
- | <a id="result-2"></a> `result?` | `"unsupported"` \| `"error"` \| `"allow"` \| `"deny"` |
2196
+ | <a id="result-2"></a> `result?` | `"allow"` \| `"deny"` \| `"unsupported"` \| `"error"` |
2177
2197
  | <a id="rules-2"></a> `rules?` | \{ `engine`: `"firestore"` \| `"rtdb"` \| `"storage"`; `errorCode?`: `string`; `matchedPath?`: `string`; `matchedRule?`: `string`; `operations?`: `string`[]; `pathVariableBindings?`: `Record`\<`string`, `string`\>; `reason?`: `string`; `ruleIndex?`: `number`; \} |
2178
2198
  | `rules.engine` | `"firestore"` \| `"rtdb"` \| `"storage"` |
2179
2199
  | `rules.errorCode?` | `string` |
@@ -2216,7 +2236,8 @@ their state is a Firestore document.
2216
2236
  | Property | Type | Description |
2217
2237
  | :------ | :------ | :------ |
2218
2238
  | <a id="at-5"></a> `at` | `number` | - |
2219
- | <a id="auth-8"></a> `auth` | \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} | - |
2239
+ | <a id="auth-8"></a> `auth` | \{ `tenant?`: `string`; `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} | - |
2240
+ | `auth.tenant?` | `string` | - |
2220
2241
  | `auth.token?` | `Record`\<`string`, `unknown`\> | - |
2221
2242
  | `auth.uid` | `string` | - |
2222
2243
  | <a id="detail-3"></a> `detail?` | `Record`\<`string`, `unknown`\> | - |
@@ -2239,7 +2260,7 @@ their state is a Firestore document.
2239
2260
  | <a id="resourcebefore-1"></a> `resourceBefore?` | \{ `data`: `unknown`; `exists`: `boolean`; \} | - |
2240
2261
  | `resourceBefore.data` | `unknown` | - |
2241
2262
  | `resourceBefore.exists` | `boolean` | - |
2242
- | <a id="result-3"></a> `result` | `"unsupported"` \| `"error"` \| `"allow"` \| `"deny"` \| `"not-applicable"` | - |
2263
+ | <a id="result-3"></a> `result` | `"allow"` \| `"deny"` \| `"unsupported"` \| `"error"` \| `"not-applicable"` | - |
2243
2264
  | <a id="rules-3"></a> `rules?` | \{ `engine`: `"firestore"` \| `"rtdb"` \| `"storage"`; `errorCode?`: `string`; `matchedPath?`: `string`; `matchedRule?`: `string`; `operations?`: `string`[]; `pathVariableBindings?`: `Record`\<`string`, `string`\>; `reason?`: `string`; `ruleIndex?`: `number`; \} | - |
2244
2265
  | `rules.engine` | `"firestore"` \| `"rtdb"` \| `"storage"` | - |
2245
2266
  | `rules.errorCode?` | `string` | - |
@@ -2288,7 +2309,8 @@ Canonical non-rules operational failure.
2288
2309
  | Property | Type |
2289
2310
  | :------ | :------ |
2290
2311
  | <a id="at-6"></a> `at` | `number` |
2291
- | <a id="auth-9"></a> `auth` | \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} |
2312
+ | <a id="auth-9"></a> `auth` | \{ `tenant?`: `string`; `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} |
2313
+ | `auth.tenant?` | `string` |
2292
2314
  | `auth.token?` | `Record`\<`string`, `unknown`\> |
2293
2315
  | `auth.uid` | `string` |
2294
2316
  | <a id="detail-4"></a> `detail?` | `Record`\<`string`, `unknown`\> |
@@ -2359,14 +2381,15 @@ diff `before`→`after` when both are present.
2359
2381
  | :------ | :------ | :------ |
2360
2382
  | <a id="after"></a> `after?` | `unknown` | Best-effort serializable snapshot of the state AFTER the mutation. Absent on deletes / sign-outs (nothing remains). |
2361
2383
  | <a id="at-7"></a> `at` | `number` | - |
2362
- | <a id="auth-10"></a> `auth` | \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} | Identity in effect when the op ran (the service's `request.auth` equivalent). `null` for admin/anonymous-driven mutations (e.g. `sandbox.createUser`, an unauthenticated RTDB write). |
2384
+ | <a id="auth-10"></a> `auth` | \{ `tenant?`: `string`; `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} | Identity in effect when the op ran (the service's `request.auth` equivalent). `null` for admin/anonymous-driven mutations (e.g. `sandbox.createUser`, an unauthenticated RTDB write). |
2385
+ | `auth.tenant?` | `string` | - |
2363
2386
  | `auth.token?` | `Record`\<`string`, `unknown`\> | - |
2364
2387
  | `auth.uid` | `string` | - |
2365
2388
  | <a id="before"></a> `before?` | `unknown` | Best-effort serializable snapshot of the state BEFORE the mutation. Absent when there was no prior state (a create) or it isn't cheap to capture. |
2366
2389
  | <a id="detail-5"></a> `detail?` | `Record`\<`string`, `unknown`\> | Free-form, service-specific extras a consumer may surface without re-deriving (e.g. storage `{ size, contentType }`, rtdb `{ committed }` for a transaction). Kept loose on purpose — it's a display hint, not a contract. |
2367
2390
  | <a id="id-7"></a> `id` | `string` | - |
2368
2391
  | <a id="kind-6"></a> `kind` | `"service_mutation"` | - |
2369
- | <a id="op-2"></a> `op` | `string` | Service-scoped operation name. Stable, lowercase, snake/kebab-free: - auth: `user_create` | `user_update` | `user_delete` | `users_clear` | `sign_in` | `sign_out` - storage: `object_put` | `object_delete` | `metadata_update` - rtdb: `set` | `update` | `remove` | `transaction` - ai: `generate_content` | `stream_generate_content` | `count_tokens` | `request_rejected` New ops can be added without a breaking change (consumers switch with a default branch). |
2392
+ | <a id="op-2"></a> `op` | `string` | Service-scoped operation name. Stable, lowercase, snake/kebab-free: - auth: `user_create` | `user_update` | `user_delete` | `users_clear` | `sign_in` | `sign_out` - storage: `object_put` | `object_delete` | `metadata_update` - rtdb: `set` | `update` | `remove` | `transaction` - ai: `generate_content` | `stream_generate_content` | `count_tokens` | `request_rejected` | `response_blocked` | `model_substituted` New ops can be added without a breaking change (consumers switch with a default branch). |
2370
2393
  | <a id="path-5"></a> `path?` | `string` | The thing mutated, in the service's own addressing scheme: - auth: the user `uid` (or `'*'` for a clear-all). Absent for a sign-out with no prior user. - storage: the object `fullPath` (e.g. `avatars/alice.png`). - rtdb: the database path (e.g. `/rooms/r1/messages`), or for a multi-path `update` the ref path the call targeted. |
2371
2394
  | <a id="service-6"></a> `service` | `"rtdb"` \| `"auth"` \| `"storage"` \| `"messaging"` \| `"ai"` | Which service performed the mutation. Always one of the non-Firestore services — Firestore rides its own `request`/`write` path. (The provenance `service` field on the stamped event mirrors this; it is set redundantly here so a consumer matching purely on `kind` still gets the discriminator without reaching into provenance.) |
2372
2395
 
@@ -2414,7 +2437,8 @@ scenario produces large snapshots.
2414
2437
  | :------ | :------ | :------ |
2415
2438
  | <a id="addedcount"></a> `addedCount` | `number` | - |
2416
2439
  | <a id="at-9"></a> `at` | `number` | - |
2417
- | <a id="auth-11"></a> `auth` | \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} | - |
2440
+ | <a id="auth-11"></a> `auth` | \{ `tenant?`: `string`; `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} | - |
2441
+ | `auth.tenant?` | `string` | - |
2418
2442
  | `auth.token?` | `Record`\<`string`, `unknown`\> | - |
2419
2443
  | `auth.uid` | `string` | - |
2420
2444
  | <a id="id-9"></a> `id` | `string` | - |
@@ -2456,7 +2480,8 @@ scenario surfaces them.
2456
2480
 
2457
2481
  | Property | Type |
2458
2482
  | :------ | :------ |
2459
- | <a id="auth-12"></a> `auth?` | \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} |
2483
+ | <a id="auth-12"></a> `auth?` | \{ `tenant?`: `string`; `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} |
2484
+ | `auth.tenant?` | `string` |
2460
2485
  | `auth.token?` | `Record`\<`string`, `unknown`\> |
2461
2486
  | `auth.uid` | `string` |
2462
2487
  | <a id="code-1"></a> `code` | `"permission-denied"` |
@@ -2490,7 +2515,8 @@ them.
2490
2515
  | Property | Type | Description |
2491
2516
  | :------ | :------ | :------ |
2492
2517
  | <a id="at-10"></a> `at` | `number` | - |
2493
- | <a id="auth-13"></a> `auth` | \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} | - |
2518
+ | <a id="auth-13"></a> `auth` | \{ `tenant?`: `string`; `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} | - |
2519
+ | `auth.tenant?` | `string` | - |
2494
2520
  | `auth.token?` | `Record`\<`string`, `unknown`\> | - |
2495
2521
  | `auth.uid` | `string` | - |
2496
2522
  | <a id="id-10"></a> `id` | `string` | - |
@@ -2526,7 +2552,7 @@ the defaults provide a ready-to-use configuration for browser environments.
2526
2552
 
2527
2553
  Minimal web-storage-like contract the session persistence controller
2528
2554
  reads/writes. Matches the `localStorage` / `sessionStorage` browser
2529
- API subset that `pyric dev`'s `SessionStore` already uses, so
2555
+ API subset that `pyric sandbox`'s `SessionStore` already uses, so
2530
2556
  browsers pass real storages and tests pass in-memory Map-backed fakes.
2531
2557
 
2532
2558
  Why the minimal subset (get/set/remove) instead of the full
@@ -2618,7 +2644,8 @@ sentinel/auto-id capture lands.
2618
2644
  | Property | Type | Description |
2619
2645
  | :------ | :------ | :------ |
2620
2646
  | <a id="at-11"></a> `at` | `number` | - |
2621
- | <a id="auth-14"></a> `auth` | \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} | - |
2647
+ | <a id="auth-14"></a> `auth` | \{ `tenant?`: `string`; `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} | - |
2648
+ | `auth.tenant?` | `string` | - |
2622
2649
  | `auth.token?` | `Record`\<`string`, `unknown`\> | - |
2623
2650
  | `auth.uid` | `string` | - |
2624
2651
  | <a id="autoid"></a> `autoId?` | `string` | Minted document ID when this write came from `collection.add()` / `LocalEnvironment.createWithAutoId`. The replay engine aliases the path's last segment to a fresh mint on replay (rather than preserving the original auto-ID). |
@@ -2650,6 +2677,7 @@ type AuthLens =
2650
2677
  }
2651
2678
  | {
2652
2679
  mode: "as";
2680
+ tenant?: string;
2653
2681
  token?: Record<string, unknown>;
2654
2682
  uid: string;
2655
2683
  }
@@ -3277,6 +3305,66 @@ than into process-local state.
3277
3305
 
3278
3306
  ***
3279
3307
 
3308
+ <a id="normalizeauthstate"></a>
3309
+
3310
+ ### normalizeAuthState()
3311
+
3312
+ ```ts
3313
+ function normalizeAuthState(auth: {
3314
+ tenant?: string;
3315
+ token?: Record<string, unknown>;
3316
+ uid: string;
3317
+ }): {
3318
+ tenant?: string;
3319
+ token?: Record<string, unknown>;
3320
+ uid: string;
3321
+ };
3322
+ ```
3323
+
3324
+ Normalize AuthState during SandboxContextImpl context assembly.
3325
+ Automatically projects top-level `tenant` into `token.firebase.tenant`
3326
+ while preserving custom claims and explicit nested token overrides.
3327
+ Never mutates original input.
3328
+
3329
+ #### Parameters
3330
+
3331
+ | Parameter | Type |
3332
+ | :------ | :------ |
3333
+ | `auth` | \{ `tenant?`: `string`; `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} |
3334
+ | `auth.tenant?` | `string` |
3335
+ | `auth.token?` | `Record`\<`string`, `unknown`\> |
3336
+ | `auth.uid` | `string` |
3337
+
3338
+ #### Returns
3339
+
3340
+ ```ts
3341
+ {
3342
+ tenant?: string;
3343
+ token?: Record<string, unknown>;
3344
+ uid: string;
3345
+ }
3346
+ ```
3347
+
3348
+ ##### tenant?
3349
+
3350
+ ```ts
3351
+ optional tenant: string;
3352
+ ```
3353
+
3354
+ ##### token?
3355
+
3356
+ ```ts
3357
+ optional token: Record<string, unknown>;
3358
+ ```
3359
+
3360
+ ##### uid
3361
+
3362
+ ```ts
3363
+ uid: string;
3364
+ ```
3365
+
3366
+ ***
3367
+
3280
3368
  <a id="operationcontextfor"></a>
3281
3369
 
3282
3370
  ### operationContextFor()
@@ -3528,6 +3616,35 @@ Project either traffic event family into the canonical record.
3528
3616
 
3529
3617
  [`OperationRecord`](#operationrecord)
3530
3618
 
3619
+ ***
3620
+
3621
+ <a id="validateauthstate"></a>
3622
+
3623
+ ### validateAuthState()
3624
+
3625
+ ```ts
3626
+ function validateAuthState(auth: unknown): asserts auth is { tenant?: string; token?: Record<string, unknown>; uid: string };
3627
+ ```
3628
+
3629
+ Reject `undefined` and other clearly-malformed inputs at the
3630
+ `withAuth` call site. `null` is valid (anonymous);
3631
+ `{ uid: 'someUid' }` is valid; everything else throws so the
3632
+ mistake surfaces at the boundary instead of leaking into rule
3633
+ eval as a confusing denial.
3634
+
3635
+ Shared between `Sandbox.withAuth` and `SandboxContext.withAuth`
3636
+ so both entries enforce the same validation.
3637
+
3638
+ #### Parameters
3639
+
3640
+ | Parameter | Type |
3641
+ | :------ | :------ |
3642
+ | `auth` | `unknown` |
3643
+
3644
+ #### Returns
3645
+
3646
+ `asserts auth is { tenant?: string; token?: Record<string, unknown>; uid: string }`
3647
+
3531
3648
  ## References
3532
3649
 
3533
3650
  <a id="authstate"></a>