@oscharko-dev/keiko 0.3.13 → 0.3.15

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 (232) hide show
  1. package/dist/ui/csp-hashes.json +6 -6
  2. package/dist/ui/static/404.html +1 -1
  3. package/dist/ui/static/__next.__PAGE__.txt +1 -1
  4. package/dist/ui/static/__next._full.txt +1 -1
  5. package/dist/ui/static/__next._head.txt +1 -1
  6. package/dist/ui/static/__next._index.txt +1 -1
  7. package/dist/ui/static/__next._tree.txt +1 -1
  8. package/dist/ui/static/_not-found/__next._full.txt +1 -1
  9. package/dist/ui/static/_not-found/__next._head.txt +1 -1
  10. package/dist/ui/static/_not-found/__next._index.txt +1 -1
  11. package/dist/ui/static/_not-found/__next._not-found.__PAGE__.txt +1 -1
  12. package/dist/ui/static/_not-found/__next._not-found.txt +1 -1
  13. package/dist/ui/static/_not-found/__next._tree.txt +1 -1
  14. package/dist/ui/static/_not-found.html +1 -1
  15. package/dist/ui/static/_not-found.txt +1 -1
  16. package/dist/ui/static/atlassian-connectors/__next._full.txt +1 -1
  17. package/dist/ui/static/atlassian-connectors/__next._head.txt +1 -1
  18. package/dist/ui/static/atlassian-connectors/__next._index.txt +1 -1
  19. package/dist/ui/static/atlassian-connectors/__next._tree.txt +1 -1
  20. package/dist/ui/static/atlassian-connectors/__next.atlassian-connectors.__PAGE__.txt +1 -1
  21. package/dist/ui/static/atlassian-connectors/__next.atlassian-connectors.txt +1 -1
  22. package/dist/ui/static/atlassian-connectors.html +1 -1
  23. package/dist/ui/static/atlassian-connectors.txt +1 -1
  24. package/dist/ui/static/index.html +1 -1
  25. package/dist/ui/static/index.txt +1 -1
  26. package/dist/ui/static/launch/__next._full.txt +1 -1
  27. package/dist/ui/static/launch/__next._head.txt +1 -1
  28. package/dist/ui/static/launch/__next._index.txt +1 -1
  29. package/dist/ui/static/launch/__next._tree.txt +1 -1
  30. package/dist/ui/static/launch/__next.launch.__PAGE__.txt +1 -1
  31. package/dist/ui/static/launch/__next.launch.txt +1 -1
  32. package/dist/ui/static/launch.html +1 -1
  33. package/dist/ui/static/launch.txt +1 -1
  34. package/dist/ui/static/local-knowledge/__next._full.txt +1 -1
  35. package/dist/ui/static/local-knowledge/__next._head.txt +1 -1
  36. package/dist/ui/static/local-knowledge/__next._index.txt +1 -1
  37. package/dist/ui/static/local-knowledge/__next._tree.txt +1 -1
  38. package/dist/ui/static/local-knowledge/__next.local-knowledge.__PAGE__.txt +1 -1
  39. package/dist/ui/static/local-knowledge/__next.local-knowledge.txt +1 -1
  40. package/dist/ui/static/local-knowledge/capsule/__next._full.txt +1 -1
  41. package/dist/ui/static/local-knowledge/capsule/__next._head.txt +1 -1
  42. package/dist/ui/static/local-knowledge/capsule/__next._index.txt +1 -1
  43. package/dist/ui/static/local-knowledge/capsule/__next._tree.txt +1 -1
  44. package/dist/ui/static/local-knowledge/capsule/__next.local-knowledge.capsule.__PAGE__.txt +1 -1
  45. package/dist/ui/static/local-knowledge/capsule/__next.local-knowledge.capsule.txt +1 -1
  46. package/dist/ui/static/local-knowledge/capsule/__next.local-knowledge.txt +1 -1
  47. package/dist/ui/static/local-knowledge/capsule.html +1 -1
  48. package/dist/ui/static/local-knowledge/capsule.txt +1 -1
  49. package/dist/ui/static/local-knowledge.html +1 -1
  50. package/dist/ui/static/local-knowledge.txt +1 -1
  51. package/node_modules/@oscharko-dev/keiko-cli/dist/ui.d.ts.map +1 -1
  52. package/node_modules/@oscharko-dev/keiko-cli/dist/ui.js +25 -6
  53. package/node_modules/@oscharko-dev/keiko-cli/package.json +13 -13
  54. package/node_modules/@oscharko-dev/keiko-connectors/package.json +3 -3
  55. package/node_modules/@oscharko-dev/keiko-contracts/dist/index.d.ts +2 -2
  56. package/node_modules/@oscharko-dev/keiko-contracts/dist/index.js +2 -2
  57. package/node_modules/@oscharko-dev/keiko-contracts/package.json +1 -1
  58. package/node_modules/@oscharko-dev/keiko-evaluations/package.json +9 -9
  59. package/node_modules/@oscharko-dev/keiko-evidence/dist/version.d.ts +1 -1
  60. package/node_modules/@oscharko-dev/keiko-evidence/dist/version.js +1 -1
  61. package/node_modules/@oscharko-dev/keiko-evidence/package.json +4 -4
  62. package/node_modules/@oscharko-dev/keiko-git/package.json +1 -1
  63. package/node_modules/@oscharko-dev/keiko-harness/dist/version.d.ts +1 -1
  64. package/node_modules/@oscharko-dev/keiko-harness/dist/version.js +1 -1
  65. package/node_modules/@oscharko-dev/keiko-harness/package.json +6 -6
  66. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/connector-pod.d.ts +2 -0
  67. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/connector-pod.d.ts.map +1 -1
  68. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/connector-pod.js +1 -0
  69. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/index.d.ts +1 -0
  70. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/index.d.ts.map +1 -1
  71. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/index.js +3 -0
  72. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/embedding-batcher.d.ts +1 -0
  73. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/embedding-batcher.d.ts.map +1 -1
  74. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/embedding-batcher.js +341 -62
  75. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/orchestrator.d.ts.map +1 -1
  76. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/orchestrator.js +586 -132
  77. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/types.d.ts +9 -0
  78. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/types.d.ts.map +1 -1
  79. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/knowledge-log.d.ts +20 -0
  80. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/knowledge-log.d.ts.map +1 -0
  81. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/knowledge-log.js +154 -0
  82. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/manual-pod-refresh.d.ts +2 -0
  83. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/manual-pod-refresh.d.ts.map +1 -1
  84. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/manual-pod-refresh.js +1 -0
  85. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/manual-pod.d.ts +2 -0
  86. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/manual-pod.d.ts.map +1 -1
  87. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/manual-pod.js +1 -0
  88. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/repository-pod.d.ts +2 -0
  89. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/repository-pod.d.ts.map +1 -1
  90. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/repository-pod.js +1 -0
  91. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/store.d.ts +2 -0
  92. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/store.d.ts.map +1 -1
  93. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/store.js +43 -1
  94. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/version.d.ts +1 -1
  95. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/version.js +1 -1
  96. package/node_modules/@oscharko-dev/keiko-local-knowledge/package.json +5 -5
  97. package/node_modules/@oscharko-dev/keiko-memory-capture/dist/version.d.ts +1 -1
  98. package/node_modules/@oscharko-dev/keiko-memory-capture/dist/version.js +1 -1
  99. package/node_modules/@oscharko-dev/keiko-memory-capture/package.json +3 -3
  100. package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/version.d.ts +1 -1
  101. package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/version.js +1 -1
  102. package/node_modules/@oscharko-dev/keiko-memory-consolidation/package.json +3 -3
  103. package/node_modules/@oscharko-dev/keiko-memory-governance/dist/version.d.ts +1 -1
  104. package/node_modules/@oscharko-dev/keiko-memory-governance/dist/version.js +1 -1
  105. package/node_modules/@oscharko-dev/keiko-memory-governance/package.json +3 -3
  106. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/version.d.ts +1 -1
  107. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/version.js +1 -1
  108. package/node_modules/@oscharko-dev/keiko-memory-retrieval/package.json +3 -3
  109. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/version.d.ts +1 -1
  110. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/version.js +1 -1
  111. package/node_modules/@oscharko-dev/keiko-memory-vault/package.json +3 -3
  112. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/gateway.d.ts +15 -2
  113. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/gateway.d.ts.map +1 -1
  114. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/gateway.js +147 -15
  115. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/http.d.ts +3 -0
  116. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/http.d.ts.map +1 -1
  117. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/http.js +188 -23
  118. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/observability.d.ts +27 -0
  119. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/observability.d.ts.map +1 -0
  120. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/observability.js +180 -0
  121. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/openai-embedding-adapter.d.ts +5 -0
  122. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/openai-embedding-adapter.d.ts.map +1 -1
  123. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/openai-embedding-adapter.js +339 -55
  124. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/resilience.d.ts +18 -5
  125. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/resilience.d.ts.map +1 -1
  126. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/resilience.js +141 -26
  127. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/version.d.ts +1 -1
  128. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/version.js +1 -1
  129. package/node_modules/@oscharko-dev/keiko-model-gateway/package.json +3 -3
  130. package/node_modules/@oscharko-dev/keiko-quality-intelligence/package.json +3 -3
  131. package/node_modules/@oscharko-dev/keiko-sandbox/package.json +2 -2
  132. package/node_modules/@oscharko-dev/keiko-sdk/package.json +9 -9
  133. package/node_modules/@oscharko-dev/keiko-security/dist/version.d.ts +1 -1
  134. package/node_modules/@oscharko-dev/keiko-security/dist/version.js +1 -1
  135. package/node_modules/@oscharko-dev/keiko-security/package.json +2 -2
  136. package/node_modules/@oscharko-dev/keiko-server/dist/atlassian/syncService.d.ts.map +1 -1
  137. package/node_modules/@oscharko-dev/keiko-server/dist/atlassian/syncService.js +4 -0
  138. package/node_modules/@oscharko-dev/keiko-server/dist/bounded-request-body.d.ts +1 -1
  139. package/node_modules/@oscharko-dev/keiko-server/dist/bounded-request-body.d.ts.map +1 -1
  140. package/node_modules/@oscharko-dev/keiko-server/dist/bounded-request-body.js +51 -3
  141. package/node_modules/@oscharko-dev/keiko-server/dist/diagnostics-log.d.ts.map +1 -1
  142. package/node_modules/@oscharko-dev/keiko-server/dist/diagnostics-log.js +77 -3
  143. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-instance-cache.d.ts.map +1 -1
  144. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-instance-cache.js +71 -11
  145. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-setup.d.ts.map +1 -1
  146. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-setup.js +9 -1
  147. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa.js +1 -1
  148. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-rerank-facade.d.ts.map +1 -1
  149. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-rerank-facade.js +37 -0
  150. package/node_modules/@oscharko-dev/keiko-server/dist/index.d.ts +1 -0
  151. package/node_modules/@oscharko-dev/keiko-server/dist/index.d.ts.map +1 -1
  152. package/node_modules/@oscharko-dev/keiko-server/dist/index.js +7 -0
  153. package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-handlers.d.ts.map +1 -1
  154. package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-handlers.js +158 -36
  155. package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-remediation-store.d.ts.map +1 -1
  156. package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-remediation-store.js +9 -1
  157. package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-remediation.d.ts.map +1 -1
  158. package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-remediation.js +10 -5
  159. package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-store-open.d.ts.map +1 -1
  160. package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-store-open.js +8 -2
  161. package/node_modules/@oscharko-dev/keiko-server/dist/manual/manual-pod-service.d.ts.map +1 -1
  162. package/node_modules/@oscharko-dev/keiko-server/dist/manual/manual-pod-service.js +3 -0
  163. package/node_modules/@oscharko-dev/keiko-server/dist/memory-embedding.d.ts.map +1 -1
  164. package/node_modules/@oscharko-dev/keiko-server/dist/memory-embedding.js +135 -36
  165. package/node_modules/@oscharko-dev/keiko-server/dist/observability/index.d.ts +3 -0
  166. package/node_modules/@oscharko-dev/keiko-server/dist/observability/index.d.ts.map +1 -0
  167. package/node_modules/@oscharko-dev/keiko-server/dist/observability/index.js +9 -0
  168. package/node_modules/@oscharko-dev/keiko-server/dist/observability/log-level.d.ts +13 -0
  169. package/node_modules/@oscharko-dev/keiko-server/dist/observability/log-level.d.ts.map +1 -0
  170. package/node_modules/@oscharko-dev/keiko-server/dist/observability/log-level.js +57 -0
  171. package/node_modules/@oscharko-dev/keiko-server/dist/observability/log-redaction.d.ts +20 -0
  172. package/node_modules/@oscharko-dev/keiko-server/dist/observability/log-redaction.d.ts.map +1 -0
  173. package/node_modules/@oscharko-dev/keiko-server/dist/observability/log-redaction.js +499 -0
  174. package/node_modules/@oscharko-dev/keiko-server/dist/observability/route-template.d.ts +4 -0
  175. package/node_modules/@oscharko-dev/keiko-server/dist/observability/route-template.d.ts.map +1 -0
  176. package/node_modules/@oscharko-dev/keiko-server/dist/observability/route-template.js +340 -0
  177. package/node_modules/@oscharko-dev/keiko-server/dist/observability/server-log.d.ts +49 -0
  178. package/node_modules/@oscharko-dev/keiko-server/dist/observability/server-log.d.ts.map +1 -0
  179. package/node_modules/@oscharko-dev/keiko-server/dist/observability/server-log.js +449 -0
  180. package/node_modules/@oscharko-dev/keiko-server/dist/observability/server-logger.d.ts +36 -0
  181. package/node_modules/@oscharko-dev/keiko-server/dist/observability/server-logger.d.ts.map +1 -0
  182. package/node_modules/@oscharko-dev/keiko-server/dist/observability/server-logger.js +190 -0
  183. package/node_modules/@oscharko-dev/keiko-server/dist/process-log-sink.d.ts +11 -0
  184. package/node_modules/@oscharko-dev/keiko-server/dist/process-log-sink.d.ts.map +1 -0
  185. package/node_modules/@oscharko-dev/keiko-server/dist/process-log-sink.js +48 -0
  186. package/node_modules/@oscharko-dev/keiko-server/dist/server.d.ts +2 -0
  187. package/node_modules/@oscharko-dev/keiko-server/dist/server.d.ts.map +1 -1
  188. package/node_modules/@oscharko-dev/keiko-server/dist/server.js +22 -4
  189. package/node_modules/@oscharko-dev/keiko-server/dist/store-handlers.d.ts.map +1 -1
  190. package/node_modules/@oscharko-dev/keiko-server/dist/store-handlers.js +7 -2
  191. package/node_modules/@oscharko-dev/keiko-server/package.json +21 -21
  192. package/node_modules/@oscharko-dev/keiko-tools/dist/version.d.ts +1 -1
  193. package/node_modules/@oscharko-dev/keiko-tools/dist/version.js +1 -1
  194. package/node_modules/@oscharko-dev/keiko-tools/package.json +5 -5
  195. package/node_modules/@oscharko-dev/keiko-verification/package.json +5 -5
  196. package/node_modules/@oscharko-dev/keiko-workflows/package.json +10 -10
  197. package/node_modules/@oscharko-dev/keiko-workspace/dist/version.d.ts +1 -1
  198. package/node_modules/@oscharko-dev/keiko-workspace/dist/version.js +1 -1
  199. package/node_modules/@oscharko-dev/keiko-workspace/package.json +3 -3
  200. package/package.json +25 -25
  201. package/release-impact.catalog.json +117 -7
  202. package/vendor/{oscharko-dev-keiko-cli-0.3.13.tgz → oscharko-dev-keiko-cli-0.3.15.tgz} +0 -0
  203. package/vendor/{oscharko-dev-keiko-connectors-0.3.13.tgz → oscharko-dev-keiko-connectors-0.3.15.tgz} +0 -0
  204. package/vendor/{oscharko-dev-keiko-contracts-0.3.13.tgz → oscharko-dev-keiko-contracts-0.3.15.tgz} +0 -0
  205. package/vendor/{oscharko-dev-keiko-evaluations-0.3.13.tgz → oscharko-dev-keiko-evaluations-0.3.15.tgz} +0 -0
  206. package/vendor/{oscharko-dev-keiko-evidence-0.3.13.tgz → oscharko-dev-keiko-evidence-0.3.15.tgz} +0 -0
  207. package/vendor/{oscharko-dev-keiko-git-0.3.13.tgz → oscharko-dev-keiko-git-0.3.15.tgz} +0 -0
  208. package/vendor/{oscharko-dev-keiko-harness-0.3.13.tgz → oscharko-dev-keiko-harness-0.3.15.tgz} +0 -0
  209. package/vendor/oscharko-dev-keiko-local-knowledge-0.3.15.tgz +0 -0
  210. package/vendor/{oscharko-dev-keiko-memory-capture-0.3.13.tgz → oscharko-dev-keiko-memory-capture-0.3.15.tgz} +0 -0
  211. package/vendor/{oscharko-dev-keiko-memory-consolidation-0.3.13.tgz → oscharko-dev-keiko-memory-consolidation-0.3.15.tgz} +0 -0
  212. package/vendor/oscharko-dev-keiko-memory-governance-0.3.15.tgz +0 -0
  213. package/vendor/{oscharko-dev-keiko-memory-retrieval-0.3.13.tgz → oscharko-dev-keiko-memory-retrieval-0.3.15.tgz} +0 -0
  214. package/vendor/{oscharko-dev-keiko-memory-vault-0.3.13.tgz → oscharko-dev-keiko-memory-vault-0.3.15.tgz} +0 -0
  215. package/vendor/oscharko-dev-keiko-model-gateway-0.3.15.tgz +0 -0
  216. package/vendor/{oscharko-dev-keiko-quality-intelligence-0.3.13.tgz → oscharko-dev-keiko-quality-intelligence-0.3.15.tgz} +0 -0
  217. package/vendor/{oscharko-dev-keiko-sandbox-0.3.13.tgz → oscharko-dev-keiko-sandbox-0.3.15.tgz} +0 -0
  218. package/vendor/oscharko-dev-keiko-sdk-0.3.15.tgz +0 -0
  219. package/vendor/{oscharko-dev-keiko-security-0.3.13.tgz → oscharko-dev-keiko-security-0.3.15.tgz} +0 -0
  220. package/vendor/oscharko-dev-keiko-server-0.3.15.tgz +0 -0
  221. package/vendor/{oscharko-dev-keiko-tools-0.3.13.tgz → oscharko-dev-keiko-tools-0.3.15.tgz} +0 -0
  222. package/vendor/{oscharko-dev-keiko-verification-0.3.13.tgz → oscharko-dev-keiko-verification-0.3.15.tgz} +0 -0
  223. package/vendor/{oscharko-dev-keiko-workflows-0.3.13.tgz → oscharko-dev-keiko-workflows-0.3.15.tgz} +0 -0
  224. package/vendor/{oscharko-dev-keiko-workspace-0.3.13.tgz → oscharko-dev-keiko-workspace-0.3.15.tgz} +0 -0
  225. package/vendor/oscharko-dev-keiko-local-knowledge-0.3.13.tgz +0 -0
  226. package/vendor/oscharko-dev-keiko-memory-governance-0.3.13.tgz +0 -0
  227. package/vendor/oscharko-dev-keiko-model-gateway-0.3.13.tgz +0 -0
  228. package/vendor/oscharko-dev-keiko-sdk-0.3.13.tgz +0 -0
  229. package/vendor/oscharko-dev-keiko-server-0.3.13.tgz +0 -0
  230. /package/dist/ui/static/_next/static/{iwhpaHGb663ka5R3lhZBj → 4j3JDaPBERRu_ZIgeR1VQ}/_buildManifest.js +0 -0
  231. /package/dist/ui/static/_next/static/{iwhpaHGb663ka5R3lhZBj → 4j3JDaPBERRu_ZIgeR1VQ}/_clientMiddlewareManifest.js +0 -0
  232. /package/dist/ui/static/_next/static/{iwhpaHGb663ka5R3lhZBj → 4j3JDaPBERRu_ZIgeR1VQ}/_ssgManifest.js +0 -0
@@ -0,0 +1,499 @@
1
+ // The single redaction choke point for the server activity log.
2
+ //
3
+ // Every field a caller supplies through `ServerLogEvent.extra` passes through `redactLogFields`
4
+ // before it is serialised. The policy is STRUCTURAL, not advisory: a caller cannot opt out, and
5
+ // the guards do not depend on the caller naming its fields honestly.
6
+ //
7
+ // Four independent layers, each of which alone stops a body/prompt/secret:
8
+ //
9
+ // 1. Type allowlist — only strings, finite numbers, booleans, arrays and plain objects survive.
10
+ // Errors, Buffers, Maps, class instances, functions, symbols, bigints and null are dropped,
11
+ // so an `extra: { error }` or `extra: { buffer }` can never serialise its payload.
12
+ // 2. Field-name denylist — names that mean "content" or "credential" in this product
13
+ // (body, prompt, text, message, apiKey, token, authorization, email, …) are replaced with a
14
+ // marker. Names are normalised (lowercased, separators stripped) so `api_key`, `api-key` and
15
+ // `apiKey` are the same name. Neighbouring evidence fields that merely CONTAIN a denied word
16
+ // (`promptTokens`, `strategyKey`, `requestBytes`, `probeName`) keep working — the match is on
17
+ // the whole name, never a substring.
18
+ // 3. Value guards — a surviving string is refused if it is longer than a short cap, carries any
19
+ // control character or newline, leaves printable ASCII (document text in any script), reads
20
+ // as prose (more than a few spaces), looks like a credential (sk-…, Bearer …, JWT, AWS key,
21
+ // PEM, credentialed URL, `password=…`, opaque high-entropy token), carries a personal
22
+ // identifier (an email address, a phone number, a national id), or has the structure of a
23
+ // filesystem path. Long strings are REPLACED, never truncated: a truncated prompt is still a
24
+ // leaked prompt. The text-shape guard is the one that closes the hole a name-based rule
25
+ // cannot — a SHORT body fragment under an innocuous field name the caller invented.
26
+ // 4. Shape caps — bounded nesting depth, bounded array length and a bounded field count, so a
27
+ // deep or wide structure cannot be used to smuggle content past the other three layers.
28
+ //
29
+ // Hashed identifiers (documentIdHash, capsuleIdDigest, dbPathHash) are the evidence that REPLACES
30
+ // a raw value, so the opaque-token guard must not refuse them — refusing them would push callers
31
+ // back to logging the original. That now falls out of the guard's own rule rather than needing an
32
+ // exemption: a digest is written in one case of one alphabet, and the guard asks for the mixed
33
+ // lowercase/uppercase/digit alphabet a randomly generated credential has.
34
+ //
35
+ // An absolute path is not passed through under any exemption. A request path is reduced to its
36
+ // route TEMPLATE by `route-template.ts` — literal route segments survive, every other segment is
37
+ // digested — and everything else that starts at the filesystem root is refused.
38
+ import { redactRoutePath } from "./route-template.js";
39
+ // A log field value is an identifier, a code, a host or a status — never prose. 160 characters is
40
+ // far above every legitimate value in the instrumentation surface and far below any body.
41
+ export const MAX_LOG_STRING_LENGTH = 160;
42
+ // Log field values are identifiers, codes, hosts, reasons and statuses. None of them is prose, and
43
+ // none of them contains more than a stray space. Prose does. This is what stops a SHORT body or
44
+ // prompt fragment smuggled under an innocuous field name — the length cap alone would let it
45
+ // through, and no name-based rule can, since the caller picks the name.
46
+ export const MAX_LOG_STRING_WHITESPACE = 3;
47
+ // The upper bound of printable ASCII. A log field value is an identifier, a code, a host, an
48
+ // error kind or a status, and every one of those is written in ASCII. Document text is not.
49
+ const MAX_IDENTIFIER_CHAR_CODE = 0x7e;
50
+ // `extra` itself is depth 0. Its own values may nest three more levels, which covers the deepest
51
+ // existing producer (a diagnostic record carrying a nested counts object) and nothing beyond it.
52
+ export const MAX_LOG_FIELD_DEPTH = 3;
53
+ export const MAX_LOG_ARRAY_LENGTH = 16;
54
+ export const MAX_LOG_FIELD_COUNT = 48;
55
+ export const REDACTED_KEY = "[redacted:key]";
56
+ export const REDACTED_LENGTH = "[redacted:length]";
57
+ export const REDACTED_SHAPE = "[redacted:shape]";
58
+ export const REDACTED_SECRET = "[redacted:secret]";
59
+ export const REDACTED_PATH = "[redacted:path]";
60
+ export const REDACTED_PERSONAL = "[redacted:personal]";
61
+ export const DROPPED_DEPTH = "[dropped:depth]";
62
+ // The identity of a log line: timestamp, severity and routing. An `extra` field may never spoof
63
+ // one, because every operator query and every alert keys on them. The remaining envelope fields
64
+ // (correlationId, durationMs, status, errorKind) are NOT reserved — an instrumentation site
65
+ // naturally carries `durationMs` or `httpStatus` in its field list, and dropping those would be a
66
+ // silent footgun. The formatter simply applies the envelope after `extra`, so the envelope wins
67
+ // when both are present and `extra` fills the gap when it is not.
68
+ const RESERVED_FIELD_NAMES = new Set(["ts", "level", "category", "op"]);
69
+ // Whole-name matches only, normalised to lowercase with `_` and `-` removed.
70
+ const DENIED_FIELD_NAMES = new Set([
71
+ // Content: anything that can carry a body, a prompt, model output or document text.
72
+ "answer",
73
+ "answers",
74
+ "args",
75
+ "argv",
76
+ "body",
77
+ "chunk",
78
+ "chunks",
79
+ "chunktext",
80
+ "comment",
81
+ "comments",
82
+ "completion",
83
+ "content",
84
+ "contents",
85
+ "data",
86
+ "description",
87
+ "doc",
88
+ "document",
89
+ "documents",
90
+ "documenttext",
91
+ "excerpt",
92
+ "input",
93
+ "inputs",
94
+ "message",
95
+ "messages",
96
+ "msg",
97
+ "note",
98
+ "notes",
99
+ "output",
100
+ "outputs",
101
+ "payload",
102
+ "preview",
103
+ "prompt",
104
+ "prompts",
105
+ "queries",
106
+ "query",
107
+ "querytext",
108
+ "raw",
109
+ "request",
110
+ "response",
111
+ "result",
112
+ "results",
113
+ "sample",
114
+ "snippet",
115
+ "snippets",
116
+ "sql",
117
+ "jql",
118
+ "summary",
119
+ "systemprompt",
120
+ "text",
121
+ "texts",
122
+ "title",
123
+ "userprompt",
124
+ "value",
125
+ "values",
126
+ // Diagnostics that carry a foreign error message or a process transcript.
127
+ "cause",
128
+ "err",
129
+ "error",
130
+ "exception",
131
+ "stack",
132
+ "stacktrace",
133
+ "stderr",
134
+ "stdout",
135
+ // Credentials and anything that authenticates.
136
+ "accesstoken",
137
+ "apikey",
138
+ "apikeys",
139
+ "auth",
140
+ "authheader",
141
+ "authorization",
142
+ "bearer",
143
+ "cert",
144
+ "certificate",
145
+ "cookie",
146
+ "cookies",
147
+ "credential",
148
+ "credentials",
149
+ "header",
150
+ "headers",
151
+ "idtoken",
152
+ "key",
153
+ "keys",
154
+ "passphrase",
155
+ "password",
156
+ "privatekey",
157
+ "publickey",
158
+ "pwd",
159
+ "salt",
160
+ "refreshtoken",
161
+ "secret",
162
+ "secrets",
163
+ "seed",
164
+ "sessiontoken",
165
+ "sig",
166
+ "signature",
167
+ "token",
168
+ "tokens",
169
+ // Filesystem and location strings, and process environment.
170
+ "absolutepath",
171
+ "connectionstring",
172
+ "cwd",
173
+ "dir",
174
+ "directory",
175
+ "dsn",
176
+ "endpointurl",
177
+ "env",
178
+ "environment",
179
+ "file",
180
+ "filename",
181
+ "filepath",
182
+ "files",
183
+ "homedir",
184
+ "href",
185
+ "location",
186
+ "uri",
187
+ "url",
188
+ "urls",
189
+ "workspacepath",
190
+ // Direct personal data.
191
+ "account",
192
+ "accountid",
193
+ "address",
194
+ "email",
195
+ "emails",
196
+ "familyname",
197
+ "fullname",
198
+ "givenname",
199
+ "mail",
200
+ "phone",
201
+ "phonenumber",
202
+ "ssn",
203
+ "user",
204
+ "userid",
205
+ "username",
206
+ "users",
207
+ ]);
208
+ // A field name is an identifier, not free text; anything else is dropped outright.
209
+ const FIELD_NAME_PATTERN = /^[A-Za-z_][A-Za-z0-9_.-]{0,63}$/;
210
+ const SECRET_PATTERNS = [
211
+ /^(?:sk|pk|rk|ak|sk-proj|sk-ant)-[a-z0-9_-]{8,}/i,
212
+ /^(?:ghp|gho|ghu|ghs|ghr|github_pat)_/,
213
+ /^xox[abprs]-/,
214
+ /^eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{4,}\./,
215
+ /^(?:bearer|basic|digest|token)\s+\S/i,
216
+ /AKIA[0-9A-Z]{16}/,
217
+ /-----BEGIN [A-Z ]*PRIVATE KEY-----/,
218
+ // A URL carrying userinfo credentials, e.g. https://user:pass@host/.
219
+ /^[a-z][a-z0-9+.-]*:\/\/[^/@\s:]+:[^/@\s]*@/i,
220
+ // A query string handing over a credential.
221
+ /[?&](?:api[_-]?key|access[_-]?token|token|secret|password|sig|signature)=/i,
222
+ // A credential written as `name=value` or `name: value` anywhere in the string.
223
+ /\b(?:api[_-]?key|access[_-]?token|token|secret|password|passwd|pwd|authorization)\s*[=:]\s*\S/i,
224
+ ];
225
+ // A serialised document announces itself in its first character. No log field value is ever a
226
+ // JSON object, a JSON array or a markup document, so this costs nothing legitimate and closes the
227
+ // compact-body route the prose guard cannot see (a minified JSON body has almost no spaces).
228
+ const STRUCTURED_PAYLOAD_PATTERN = /^\s*[[{<]/;
229
+ // A high-entropy credential and an ordinary long identifier are both long, and the rule this
230
+ // replaces could not tell them apart. It accepted any value that was 40+ characters drawn from
231
+ // `[A-Za-z0-9+/_=-]` — and `/` is in that alphabet, because base64 uses it. So EVERY request path
232
+ // of 40 characters or more, `/api/local-knowledge/capsules/cap-2f9c/sources/src-7c1a/root`
233
+ // included, was destroyed as `[redacted:secret]`, while a short customer-named route passed
234
+ // untouched: exactly backwards on both halves.
235
+ //
236
+ // The rule below describes what an opaque token IS, on two axes the old one conflated:
237
+ //
238
+ // * it is ONE UNBROKEN RUN, not a path. `/` and `.` end a run, so a path is measured segment by
239
+ // segment and no segment of a real route or a dotted identifier reaches the threshold.
240
+ // * it is HIGH ENTROPY. A randomly generated 40-character base64 token contains lowercase,
241
+ // uppercase and digits with overwhelming probability — missing any one class has probability
242
+ // below 1e-3 — while a hex digest, a padded placeholder, a repeated character and a long
243
+ // lowercase-and-hyphen slug each occupy a single case of a single alphabet.
244
+ //
245
+ // A run is scanned anywhere in the value, not just anchored at both ends, so a credential pasted
246
+ // into the middle of a longer field is caught where the anchored rule missed it.
247
+ export const OPAQUE_TOKEN_RUN_LENGTH = 40;
248
+ const OPAQUE_TOKEN_RUN_PATTERN = new RegExp(`[A-Za-z0-9+_=-]{${String(OPAQUE_TOKEN_RUN_LENGTH)},}`, "g");
249
+ const OPAQUE_TOKEN_ALPHABETS = [/[a-z]/, /[A-Z]/, /\d/];
250
+ // A personal identifier is not a credential and not prose, so neither of the guards above sees it:
251
+ // `contact: "jane.doe@example.com"` is short, space-free, ASCII and not credential-shaped. Only the
252
+ // field-name denylist stopped one, and a name-based rule is exactly what the value layer exists to
253
+ // backstop — the caller picks the name. These are the shapes that carry an identifiable person.
254
+ const PERSONAL_IDENTIFIER_PATTERNS = [
255
+ // An internationally formatted telephone number, ANYWHERE in the value. Anchoring this to the
256
+ // whole string let `tel:+14155550142` through: the digit run is far below the opaque-token
257
+ // length, so the secret guard does not see it either, and a phone number is exactly the kind of
258
+ // personal identifier this layer is the backstop for.
259
+ /(?:^|[^\d+])\+\d[\d ()./-]{6,}/,
260
+ // A national identification number written in the common grouped form (e.g. a US SSN).
261
+ /(?:^|[^\d-])\d{3}-\d{2}-\d{4}(?:[^\d-]|$)/,
262
+ ];
263
+ // PATH DETECTION IS STRUCTURAL, AND DEFAULTS TO REFUSING.
264
+ //
265
+ // It used to be an allowlist of first segments (`/Users`, `/home`, `/var`, …), which answered only
266
+ // the paths someone had thought of: `/Volumes/External/customer.db`, `/data/keiko/state`, and every
267
+ // RELATIVE path (`../../etc/passwd`, `packages/keiko-server/src/store.ts`) serialised verbatim. The
268
+ // rules below describe what a path IS instead, and an absolute value is refused unless it is
269
+ // recognisably a web route — unknown now fails closed rather than open.
270
+ const WINDOWS_PATH_PATTERN = /^(?:[A-Za-z]:[\\/]|\\\\)/;
271
+ const URI_SCHEME_PATTERN = /^[A-Za-z][A-Za-z0-9+.-]*:\/\//;
272
+ const HOME_PATH_PATTERN = /^~[/\\]/;
273
+ const FILE_URL_PATTERN = /^file:\/\//i;
274
+ // A backslash used as a separator between two segments; Windows paths that carry no drive letter.
275
+ const BACKSLASH_SEPARATOR_PATTERN = /^[^\\]+\\[^\\]/;
276
+ // An explicit relative marker, or a traversal segment anywhere in the value.
277
+ const RELATIVE_MARKER_PATTERN = /(?:^|[/\\])\.\.?(?:[/\\]|$)/;
278
+ // A separator whose final segment carries a file extension: `report.pdf`, `store.ts`,
279
+ // `index.sqlite3`. The extension must START with a letter so a versioned identifier that merely
280
+ // contains a dot (`openai/gpt-4.1`) is not mistaken for a file.
281
+ const EXTENSION_SEGMENT_PATTERN = /[/\\][^/\\]*\.[A-Za-z][A-Za-z0-9]{0,7}$/;
282
+ // A relative path of three or more segments. Two segments alone are left readable, because a media
283
+ // type (`text/plain`) and a namespaced identifier (`vendor/model`) have exactly that shape.
284
+ const DEEP_RELATIVE_PATH_PATTERN = /^[A-Za-z0-9._@-]+(?:\/[A-Za-z0-9._@-]+){2,}$/;
285
+ export function normalizeLogFieldName(name) {
286
+ return name.toLowerCase().replaceAll("_", "").replaceAll("-", "");
287
+ }
288
+ export function isDeniedLogFieldName(name) {
289
+ return DENIED_FIELD_NAMES.has(normalizeLogFieldName(name));
290
+ }
291
+ // Control characters are how a body announces itself: newlines, tabs, NUL. Latin prose announces
292
+ // itself with spaces. MOST OF THE WORLD'S PROSE ANNOUNCES ITSELF WITH NEITHER — Japanese, Chinese,
293
+ // Thai and Khmer separate nothing, and an HTML extractor routinely emits NBSP where a space
294
+ // belongs. Counting ASCII spaces therefore answered one script and passed a whole extracted
295
+ // document verbatim in every other, which is precisely the content this log must never carry.
296
+ //
297
+ // The guard is script-agnostic instead, and states the positive rule: a log field value is an
298
+ // ASCII identifier, code, host, error kind or status. A value that leaves printable ASCII is not
299
+ // one, whatever script it is written in; a value that stays inside it still gets the space budget,
300
+ // which is what catches short English body fragments. One bounded pass covers both, and it runs
301
+ // after the length cap so the scan is bounded by MAX_LOG_STRING_LENGTH.
302
+ function hasProseShape(value) {
303
+ let spaces = 0;
304
+ for (let index = 0; index < value.length; index += 1) {
305
+ const code = value.codePointAt(index) ?? 0;
306
+ if (code < 0x20 || code > MAX_IDENTIFIER_CHAR_CODE)
307
+ return true;
308
+ if (code === 0x20) {
309
+ spaces += 1;
310
+ if (spaces > MAX_LOG_STRING_WHITESPACE)
311
+ return true;
312
+ }
313
+ }
314
+ return false;
315
+ }
316
+ // A single run drawn from more than one alphabet. See OPAQUE_TOKEN_RUN_PATTERN for why both halves
317
+ // of this test are needed and what each one lets through on purpose.
318
+ function isHighEntropyRun(run) {
319
+ return OPAQUE_TOKEN_ALPHABETS.every((alphabet) => alphabet.test(run));
320
+ }
321
+ function hasOpaqueTokenRun(value) {
322
+ for (const match of value.matchAll(OPAQUE_TOKEN_RUN_PATTERN)) {
323
+ if (isHighEntropyRun(match[0]))
324
+ return true;
325
+ }
326
+ return false;
327
+ }
328
+ // Exported so the route-template reducer can refuse to digest a credential-shaped segment.
329
+ // A stable digest of a secret is worse than useless: it is an oracle that confirms a guess.
330
+ export function looksLikeSecret(value) {
331
+ if (SECRET_PATTERNS.some((pattern) => pattern.test(value)))
332
+ return true;
333
+ return hasOpaqueTokenRun(value);
334
+ }
335
+ // The email test is structural rather than a regular expression on purpose. Every regex form of
336
+ // it needs an unanchored run over a class that itself contains `.`, which the engine can match
337
+ // from many start positions — super-linear on adversarial input, in a guard whose whole job is to
338
+ // process values it does not trust. Scanning for `@` and validating its two sides is linear and
339
+ // has exactly one interpretation.
340
+ // Matches an email address anywhere in the value, with or without a `mailto:` scheme.
341
+ function containsEmailAddress(value) {
342
+ // EVERY `@`, not just the first. Checking only `indexOf("@")` fails OPEN: in
343
+ // `"x@ jane@example.com"` the first `@` has no valid domain, the guard returned false, and the
344
+ // real address behind it reached the log. A guard that gives up after one candidate is not a
345
+ // guard. The scan stays linear — each position is visited at most twice.
346
+ for (let at = value.indexOf("@"); at !== -1; at = value.indexOf("@", at + 1)) {
347
+ // A candidate with no local part or no domain is SKIPPED, never terminal: `"@@ a@b.co"` ends
348
+ // the scan at index 0 if the loop stops on the first unusable position.
349
+ if (at === 0 || at === value.length - 1)
350
+ continue;
351
+ if (isLocalPartChar(value.charAt(at - 1)) && hasDottedDomain(value, at + 1))
352
+ return true;
353
+ }
354
+ return false;
355
+ }
356
+ function isAsciiAlphanumeric(char) {
357
+ return ((char >= "0" && char <= "9") || (char >= "a" && char <= "z") || (char >= "A" && char <= "Z"));
358
+ }
359
+ const LOCAL_PART_EXTRA_CHARS = "._%+-";
360
+ function isLocalPartChar(char) {
361
+ return isAsciiAlphanumeric(char) || LOCAL_PART_EXTRA_CHARS.includes(char);
362
+ }
363
+ function isDomainLabelChar(char) {
364
+ return isAsciiAlphanumeric(char) || char === "-";
365
+ }
366
+ // A domain: at least one label character, then a dot, then at least one more label character.
367
+ function hasDottedDomain(value, start) {
368
+ let labelChars = 0;
369
+ let sawDot = false;
370
+ for (let index = start; index < value.length; index += 1) {
371
+ const char = value.charAt(index);
372
+ if (isDomainLabelChar(char)) {
373
+ labelChars += 1;
374
+ if (sawDot)
375
+ return true;
376
+ continue;
377
+ }
378
+ if (char !== "." || labelChars === 0)
379
+ return false;
380
+ sawDot = true;
381
+ }
382
+ return false;
383
+ }
384
+ function looksLikePersonalIdentifier(value) {
385
+ if (containsEmailAddress(value))
386
+ return true;
387
+ return PERSONAL_IDENTIFIER_PATTERNS.some((pattern) => pattern.test(value));
388
+ }
389
+ function hasPathPrefix(value) {
390
+ return (HOME_PATH_PATTERN.test(value) ||
391
+ WINDOWS_PATH_PATTERN.test(value) ||
392
+ FILE_URL_PATTERN.test(value));
393
+ }
394
+ function looksLikeFilesystemPath(value) {
395
+ if (hasPathPrefix(value))
396
+ return true;
397
+ // A URL is not a filesystem path. The endpoint reducers each package owns have already reduced
398
+ // the ones we log to scheme and host, and a credentialed one was refused by the secret guard two
399
+ // checks earlier — without this, a portless host (`https://api.openai.com`) would read as a file
400
+ // extension.
401
+ if (URI_SCHEME_PATTERN.test(value))
402
+ return false;
403
+ if (RELATIVE_MARKER_PATTERN.test(value) || BACKSLASH_SEPARATOR_PATTERN.test(value))
404
+ return true;
405
+ // No exemption for an absolute value any more. A request path is not returned to the caller here
406
+ // — `redactLogString` offers it to the route-template reducer, which keeps the declared literal
407
+ // segments and digests everything else. Whatever that reducer declines is refused as a path.
408
+ if (value.startsWith("/"))
409
+ return true;
410
+ return EXTENSION_SEGMENT_PATTERN.test(value) || DEEP_RELATIVE_PATH_PATTERN.test(value);
411
+ }
412
+ // The one place a string is judged. The length cap runs first so every later scan is bounded;
413
+ // the most specific verdict wins after that.
414
+ export function redactLogString(value) {
415
+ if (value.length > MAX_LOG_STRING_LENGTH)
416
+ return REDACTED_LENGTH;
417
+ if (looksLikeSecret(value))
418
+ return REDACTED_SECRET;
419
+ if (looksLikePersonalIdentifier(value))
420
+ return REDACTED_PERSONAL;
421
+ if (STRUCTURED_PAYLOAD_PATTERN.test(value))
422
+ return REDACTED_SHAPE;
423
+ if (hasProseShape(value))
424
+ return REDACTED_SHAPE;
425
+ // A path-shaped value gets exactly one chance to be something an operator may read: a request
426
+ // path this server actually serves, reduced to its route template. Anything the reducer declines
427
+ // — an unknown root, a traversal, a template that would not fit the string cap — is refused.
428
+ if (looksLikeFilesystemPath(value)) {
429
+ return redactRoutePath(value, MAX_LOG_STRING_LENGTH) ?? REDACTED_PATH;
430
+ }
431
+ return value;
432
+ }
433
+ function isPlainObject(value) {
434
+ const prototype = Object.getPrototypeOf(value);
435
+ return prototype === Object.prototype || prototype === null;
436
+ }
437
+ // Returns the sanitised value, or `undefined` when the value type is not on the allowlist and the
438
+ // field must be dropped entirely.
439
+ function redactLogValue(value, depth) {
440
+ if (typeof value === "string")
441
+ return redactLogString(value);
442
+ if (typeof value === "number")
443
+ return Number.isFinite(value) ? value : undefined;
444
+ if (typeof value === "boolean")
445
+ return value;
446
+ if (typeof value !== "object" || value === null)
447
+ return undefined;
448
+ if (depth <= 0)
449
+ return DROPPED_DEPTH;
450
+ if (Array.isArray(value))
451
+ return redactLogArray(value, depth - 1);
452
+ if (!isPlainObject(value))
453
+ return undefined;
454
+ return redactLogObject(value, depth - 1);
455
+ }
456
+ function redactLogArray(value, depth) {
457
+ const sanitized = [];
458
+ for (const element of value.slice(0, MAX_LOG_ARRAY_LENGTH)) {
459
+ const redacted = redactLogValue(element, depth);
460
+ if (redacted !== undefined)
461
+ sanitized.push(redacted);
462
+ }
463
+ return sanitized;
464
+ }
465
+ function redactLogObject(value, depth, reserved) {
466
+ const sanitized = {};
467
+ let accepted = 0;
468
+ for (const [name, fieldValue] of Object.entries(value)) {
469
+ if (accepted >= MAX_LOG_FIELD_COUNT)
470
+ break;
471
+ if (reserved?.has(name) === true)
472
+ continue;
473
+ if (!FIELD_NAME_PATTERN.test(name))
474
+ continue;
475
+ accepted += 1;
476
+ if (isDeniedLogFieldName(name)) {
477
+ sanitized[name] = REDACTED_KEY;
478
+ continue;
479
+ }
480
+ const redacted = redactLogValue(fieldValue, depth);
481
+ if (redacted !== undefined)
482
+ sanitized[name] = redacted;
483
+ }
484
+ return sanitized;
485
+ }
486
+ // Entry point. Anything that is not a plain object of fields yields no fields at all.
487
+ export function redactLogFields(extra) {
488
+ if (typeof extra !== "object" || extra === null)
489
+ return undefined;
490
+ if (Array.isArray(extra) || !isPlainObject(extra))
491
+ return undefined;
492
+ const sanitized = redactLogObject(extra, MAX_LOG_FIELD_DEPTH, RESERVED_FIELD_NAMES);
493
+ return Object.keys(sanitized).length === 0 ? undefined : sanitized;
494
+ }
495
+ // Envelope fields are narrow by type but still caller-supplied strings, so they take the same
496
+ // string guard. Used by the line formatter for `op`, `correlationId` and `errorKind`.
497
+ export function redactLogLabel(value) {
498
+ return redactLogString(value);
499
+ }
@@ -0,0 +1,4 @@
1
+ export declare const UI_ASSET_ROOT_SEGMENTS: ReadonlySet<string>;
2
+ export declare const API_ROUTE_LITERAL_SEGMENTS: ReadonlySet<string>;
3
+ export declare function redactRoutePath(pathname: string, maxLength: number): string | undefined;
4
+ //# sourceMappingURL=route-template.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route-template.d.ts","sourceRoot":"","sources":["../../src/observability/route-template.ts"],"names":[],"mappings":"AAuDA,eAAO,MAAM,sBAAsB,EAAE,WAAW,CAAC,MAAM,CAA0C,CAAC;AAIlG,eAAO,MAAM,0BAA0B,EAAE,WAAW,CAAC,MAAM,CA6OzD,CAAC;AAsCH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CASvF"}