@oscharko-dev/keiko 0.3.14 → 0.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui/csp-hashes.json +12 -12
- package/dist/ui/static/404.html +1 -1
- package/dist/ui/static/__next.__PAGE__.txt +2 -2
- package/dist/ui/static/__next._full.txt +3 -3
- package/dist/ui/static/__next._head.txt +1 -1
- package/dist/ui/static/__next._index.txt +1 -1
- package/dist/ui/static/__next._tree.txt +1 -1
- package/dist/ui/static/_next/static/chunks/06zt_mdjfd0l1.js +1 -0
- package/dist/ui/static/_next/static/chunks/0bhehe35iyqjr.js +1 -0
- package/dist/ui/static/_next/static/chunks/0ebqhb4-lqo3_.js +1 -0
- package/dist/ui/static/_next/static/chunks/0kllmzwq3m4t6.js +1 -0
- package/dist/ui/static/_next/static/chunks/0loqi-w3in9hh.js +7 -0
- package/dist/ui/static/_next/static/chunks/{2lz9ujlsm75kc.js → 0nthfqbd4m5rn.js} +1 -1
- package/dist/ui/static/_next/static/chunks/{0npbfd_er47xu.js → 0te_d7ls2ozkc.js} +1 -1
- package/dist/ui/static/_next/static/chunks/{167niw9we0b7n.js → 0u5u7e3fbq3rx.js} +1 -1
- package/dist/ui/static/_next/static/chunks/{2wbqxdm82mc6g.js → 0wxc3q97-jil3.js} +1 -1
- package/dist/ui/static/_next/static/chunks/{0kefabslo9zpa.js → 1-p5-rt-7uxi_.js} +1 -1
- package/dist/ui/static/_next/static/chunks/{1_m1z_f54hkji.js → 12te-wibzf1gs.js} +1 -1
- package/dist/ui/static/_next/static/chunks/{2uj0n49ihyt_7.js → 15sh7n1wjfckc.js} +1 -1
- package/dist/ui/static/_next/static/chunks/{1q2fca11xb2x0.js → 16gc6p4mobbkd.js} +1 -1
- package/dist/ui/static/_next/static/chunks/{0rvhrleg8f98b.js → 1749gpptuos4d.js} +1 -1
- package/dist/ui/static/_next/static/chunks/{3-4iik5ytvbed.js → 18o-euqluhpfn.js} +1 -1
- package/dist/ui/static/_next/static/chunks/1a35cd2uz40rm.js +1 -0
- package/dist/ui/static/_next/static/chunks/1fdowulgpx-tu.js +1 -0
- package/dist/ui/static/_next/static/chunks/{2jztaj4km0-p1.js → 1gg0sjnr8ce0_.js} +1 -1
- package/dist/ui/static/_next/static/chunks/1isat9t7mn8mx.js +1 -0
- package/dist/ui/static/_next/static/chunks/1nminehwt46sj.js +5 -0
- package/dist/ui/static/_next/static/chunks/1t1vm08xtco3a.js +1 -0
- package/dist/ui/static/_next/static/chunks/{40pywkvvth6qk.js → 1tu5p76jk6tu8.js} +1 -1
- package/dist/ui/static/_next/static/chunks/1upn5gu7c_j2v.js +1 -0
- package/dist/ui/static/_next/static/chunks/{0x8zukfn36b67.js → 1vq07gr__1fql.js} +1 -1
- package/dist/ui/static/_next/static/chunks/1wj5_uetggavn.js +1 -0
- package/dist/ui/static/_next/static/chunks/1xoioc6pnmeb3.js +1 -0
- package/dist/ui/static/_next/static/chunks/{339a2jjs3kjwj.js → 1xy001hdmhglo.js} +1 -1
- package/dist/ui/static/_next/static/chunks/{06zsbt3vzj_fx.js → 1za1-6o9oz1k5.js} +1 -1
- package/dist/ui/static/_next/static/chunks/{2skeghhuyv_c4.js → 299tu7y81dxk5.js} +1 -1
- package/dist/ui/static/_next/static/chunks/2d9gg91izncw0.js +1 -0
- package/dist/ui/static/_next/static/chunks/2evpuk4qo0lx3.js +1 -0
- package/dist/ui/static/_next/static/chunks/2fxkefwnb8y51.js +1 -0
- package/dist/ui/static/_next/static/chunks/{36z66lssar4oh.js → 2oqlt-9yz4qtf.js} +1 -1
- package/dist/ui/static/_next/static/chunks/2uu6q4bct_8uw.js +1 -0
- package/dist/ui/static/_next/static/chunks/2xi5lcexfddf9.js +1 -0
- package/dist/ui/static/_next/static/chunks/{1we__nb0syt11.js → 2y1e1t_x6totm.js} +1 -1
- package/dist/ui/static/_next/static/chunks/{001y_5k3kms8o.js → 339wsi27r9-nw.js} +1 -1
- package/dist/ui/static/_next/static/chunks/3b2-z8pj0i91u.js +1 -0
- package/dist/ui/static/_next/static/chunks/3ba_mrp8s5-2v.js +1 -0
- package/dist/ui/static/_next/static/chunks/{2bzjr2ai0a8hq.js → 3cuvu8nxos4fw.js} +1 -1
- package/dist/ui/static/_next/static/chunks/{43fq84z1snp1a.js → 3j-m1jy0sfg3x.js} +1 -1
- package/dist/ui/static/_next/static/chunks/3rqegw8x3e8l1.js +1 -0
- package/dist/ui/static/_next/static/chunks/{3mmcvq93ws1o_.js → 3yhyg862owqrl.js} +1 -1
- package/dist/ui/static/_not-found/__next._full.txt +1 -1
- package/dist/ui/static/_not-found/__next._head.txt +1 -1
- package/dist/ui/static/_not-found/__next._index.txt +1 -1
- package/dist/ui/static/_not-found/__next._not-found.__PAGE__.txt +1 -1
- package/dist/ui/static/_not-found/__next._not-found.txt +1 -1
- package/dist/ui/static/_not-found/__next._tree.txt +1 -1
- package/dist/ui/static/_not-found.html +1 -1
- package/dist/ui/static/_not-found.txt +1 -1
- package/dist/ui/static/atlassian-connectors/__next._full.txt +5 -5
- package/dist/ui/static/atlassian-connectors/__next._head.txt +1 -1
- package/dist/ui/static/atlassian-connectors/__next._index.txt +1 -1
- package/dist/ui/static/atlassian-connectors/__next._tree.txt +1 -1
- package/dist/ui/static/atlassian-connectors/__next.atlassian-connectors.__PAGE__.txt +2 -2
- package/dist/ui/static/atlassian-connectors/__next.atlassian-connectors.txt +2 -2
- package/dist/ui/static/atlassian-connectors.html +1 -1
- package/dist/ui/static/atlassian-connectors.txt +5 -5
- package/dist/ui/static/index.html +1 -1
- package/dist/ui/static/index.txt +3 -3
- package/dist/ui/static/launch/__next._full.txt +3 -3
- package/dist/ui/static/launch/__next._head.txt +1 -1
- package/dist/ui/static/launch/__next._index.txt +1 -1
- package/dist/ui/static/launch/__next._tree.txt +1 -1
- package/dist/ui/static/launch/__next.launch.__PAGE__.txt +2 -2
- package/dist/ui/static/launch/__next.launch.txt +1 -1
- package/dist/ui/static/launch.html +1 -1
- package/dist/ui/static/launch.txt +3 -3
- package/dist/ui/static/local-knowledge/__next._full.txt +3 -3
- package/dist/ui/static/local-knowledge/__next._head.txt +1 -1
- package/dist/ui/static/local-knowledge/__next._index.txt +1 -1
- package/dist/ui/static/local-knowledge/__next._tree.txt +1 -1
- package/dist/ui/static/local-knowledge/__next.local-knowledge.__PAGE__.txt +2 -2
- package/dist/ui/static/local-knowledge/__next.local-knowledge.txt +1 -1
- package/dist/ui/static/local-knowledge/capsule/__next._full.txt +5 -5
- package/dist/ui/static/local-knowledge/capsule/__next._head.txt +1 -1
- package/dist/ui/static/local-knowledge/capsule/__next._index.txt +1 -1
- package/dist/ui/static/local-knowledge/capsule/__next._tree.txt +1 -1
- package/dist/ui/static/local-knowledge/capsule/__next.local-knowledge.capsule.__PAGE__.txt +2 -2
- package/dist/ui/static/local-knowledge/capsule/__next.local-knowledge.capsule.txt +2 -2
- package/dist/ui/static/local-knowledge/capsule/__next.local-knowledge.txt +1 -1
- package/dist/ui/static/local-knowledge/capsule.html +1 -1
- package/dist/ui/static/local-knowledge/capsule.txt +5 -5
- package/dist/ui/static/local-knowledge.html +1 -1
- package/dist/ui/static/local-knowledge.txt +3 -3
- package/node_modules/@oscharko-dev/keiko-cli/dist/audit.d.ts +31 -2
- package/node_modules/@oscharko-dev/keiko-cli/dist/audit.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-cli/dist/audit.js +91 -13
- package/node_modules/@oscharko-dev/keiko-cli/dist/process-guards.d.ts +5 -1
- package/node_modules/@oscharko-dev/keiko-cli/dist/process-guards.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-cli/dist/process-guards.js +134 -22
- package/node_modules/@oscharko-dev/keiko-cli/dist/repair.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-cli/dist/repair.js +1 -0
- package/node_modules/@oscharko-dev/keiko-cli/dist/runner.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-cli/dist/runner.js +4 -0
- package/node_modules/@oscharko-dev/keiko-cli/dist/state-paths.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-cli/dist/state-paths.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-cli/dist/state-paths.js +35 -14
- package/node_modules/@oscharko-dev/keiko-cli/dist/support-analyze.d.ts +46 -0
- package/node_modules/@oscharko-dev/keiko-cli/dist/support-analyze.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-cli/dist/support-analyze.js +373 -0
- package/node_modules/@oscharko-dev/keiko-cli/dist/support-export.d.ts +91 -0
- package/node_modules/@oscharko-dev/keiko-cli/dist/support-export.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-cli/dist/support-export.js +306 -0
- package/node_modules/@oscharko-dev/keiko-cli/dist/support.d.ts +38 -0
- package/node_modules/@oscharko-dev/keiko-cli/dist/support.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-cli/dist/support.js +338 -0
- package/node_modules/@oscharko-dev/keiko-cli/dist/ui.d.ts +20 -2
- package/node_modules/@oscharko-dev/keiko-cli/dist/ui.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-cli/dist/ui.js +279 -18
- package/node_modules/@oscharko-dev/keiko-cli/package.json +13 -13
- package/node_modules/@oscharko-dev/keiko-connectors/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-contracts/dist/diagnostics.d.ts +15 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/diagnostics.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/diagnostics.js +121 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/index.d.ts +7 -2
- package/node_modules/@oscharko-dev/keiko-contracts/dist/index.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/index.js +11 -2
- package/node_modules/@oscharko-dev/keiko-contracts/dist/observability.d.ts +22 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/observability.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/observability.js +46 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/store-fingerprint.d.ts +40 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/store-fingerprint.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/store-fingerprint.js +123 -0
- package/node_modules/@oscharko-dev/keiko-contracts/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-evaluations/package.json +9 -9
- package/node_modules/@oscharko-dev/keiko-evidence/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-evidence/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-evidence/package.json +4 -4
- package/node_modules/@oscharko-dev/keiko-git/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-harness/dist/adapters.d.ts +5 -5
- package/node_modules/@oscharko-dev/keiko-harness/dist/adapters.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-harness/dist/adapters.js +3 -0
- package/node_modules/@oscharko-dev/keiko-harness/dist/ports.d.ts +3 -3
- package/node_modules/@oscharko-dev/keiko-harness/dist/ports.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-harness/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-harness/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-harness/package.json +6 -6
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/connector-pod.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/connector-pod.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/connector-pod.js +1 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/index.d.ts +2 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/index.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/index.js +4 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/embedding-batcher.d.ts +1 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/embedding-batcher.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/embedding-batcher.js +341 -62
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/orchestrator.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/orchestrator.js +601 -132
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/types.d.ts +9 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/types.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/knowledge-log.d.ts +20 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/knowledge-log.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/knowledge-log.js +155 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/manual-pod-refresh.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/manual-pod-refresh.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/manual-pod-refresh.js +1 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/manual-pod.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/manual-pod.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/manual-pod.js +1 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/repository-pod.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/repository-pod.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/repository-pod.js +33 -3
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/local-vector-index-port.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/local-vector-index-port.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/local-vector-index-port.js +25 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/usearch-ann-index.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/usearch-ann-index.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/usearch-ann-index.js +21 -3
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/vector-index.d.ts +3 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/vector-index.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/vector-index.js +2 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/store-content-encryption.d.ts +4 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/store-content-encryption.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/store-content-encryption.js +41 -6
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/store.d.ts +13 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/store.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/store.js +118 -3
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/package.json +5 -5
- package/node_modules/@oscharko-dev/keiko-memory-capture/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-capture/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-capture/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-consolidation/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-memory-governance/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-governance/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-governance/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-retrieval/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/cipher.d.ts +12 -0
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/cipher.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/cipher.js +32 -0
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/db.d.ts +12 -2
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/db.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/db.js +171 -7
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/index.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/index.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/index.js +17 -0
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/migrate-encrypt.d.ts +25 -1
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/migrate-encrypt.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/migrate-encrypt.js +56 -4
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/schema.d.ts +2 -1
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/schema.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/schema.js +15 -4
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/vault-log.d.ts +30 -0
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/vault-log.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/vault-log.js +139 -0
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/vault.d.ts +21 -1
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/vault.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/vault.js +37 -8
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-vault/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/gateway.d.ts +18 -2
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/gateway.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/gateway.js +216 -18
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/http.d.ts +3 -0
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/http.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/http.js +188 -23
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/index.d.ts +4 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/index.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/index.js +14 -0
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/observability.d.ts +27 -0
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/observability.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/observability.js +193 -0
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/openai-adapter.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/openai-adapter.js +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/openai-embedding-adapter.d.ts +5 -0
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/openai-embedding-adapter.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/openai-embedding-adapter.js +286 -68
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/replay.d.ts +15 -0
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/replay.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/replay.js +88 -0
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/resilience.d.ts +23 -5
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/resilience.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/resilience.js +160 -27
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-quality-intelligence/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-sandbox/package.json +2 -2
- package/node_modules/@oscharko-dev/keiko-sdk/package.json +9 -9
- package/node_modules/@oscharko-dev/keiko-security/dist/errors/gateway.d.ts +2 -1
- package/node_modules/@oscharko-dev/keiko-security/dist/errors/gateway.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-security/dist/errors/gateway.js +13 -1
- package/node_modules/@oscharko-dev/keiko-security/dist/index.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-security/dist/index.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-security/dist/index.js +1 -0
- package/node_modules/@oscharko-dev/keiko-security/dist/log-port.d.ts +20 -0
- package/node_modules/@oscharko-dev/keiko-security/dist/log-port.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-security/dist/log-port.js +130 -0
- package/node_modules/@oscharko-dev/keiko-security/dist/macos-keychain.d.ts +10 -0
- package/node_modules/@oscharko-dev/keiko-security/dist/macos-keychain.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-security/dist/macos-keychain.js +43 -1
- package/node_modules/@oscharko-dev/keiko-security/dist/secret-vault.d.ts +22 -1
- package/node_modules/@oscharko-dev/keiko-security/dist/secret-vault.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-security/dist/secret-vault.js +53 -10
- package/node_modules/@oscharko-dev/keiko-security/dist/sqlite-corruption.d.ts +3 -0
- package/node_modules/@oscharko-dev/keiko-security/dist/sqlite-corruption.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-security/dist/sqlite-corruption.js +12 -3
- package/node_modules/@oscharko-dev/keiko-security/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-security/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-security/package.json +2 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/atlassian/credentialVault.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/atlassian/credentialVault.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/atlassian/credentialVault.js +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/atlassian/syncRoutes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/atlassian/syncRoutes.js +4 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/atlassian/syncService.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/atlassian/syncService.js +4 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/atlassian/wiring.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/atlassian/wiring.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/atlassian/wiring.js +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/atlassian/writeActionRoutes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/atlassian/writeActionRoutes.js +4 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/bounded-request-body.d.ts +5 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/bounded-request-body.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/bounded-request-body.js +131 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/browser.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/browser.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/browser.js +10 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-compaction-evidence.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-compaction-evidence.js +9 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-compaction-model-summary.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-compaction-model-summary.js +26 -12
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-handlers.d.ts +15 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-handlers.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-handlers.js +122 -28
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-stream-handlers.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-stream-handlers.js +50 -36
- package/node_modules/@oscharko-dev/keiko-server/dist/client-diagnostics-routes.d.ts +5 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/client-diagnostics-routes.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/client-diagnostics-routes.js +150 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-context/codingContextRoutes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-context/codingContextRoutes.js +3 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRuntimeComposition.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRuntimeComposition.js +20 -6
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-sidecar-gateway.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-sidecar-gateway.js +8 -6
- package/node_modules/@oscharko-dev/keiko-server/dist/conversation-attachment-store.d.ts +9 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/conversation-attachment-store.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/conversation-attachment-store.js +2 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/correlation.d.ts +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/correlation.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/correlation.js +9 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/credentialPersistence.d.ts +5 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/credentialPersistence.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/credentialPersistence.js +19 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/credentialVault.d.ts +9 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/credentialVault.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/credentialVault.js +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/deps.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/deps.js +32 -5
- package/node_modules/@oscharko-dev/keiko-server/dist/diagnostics-log.d.ts +15 -4
- package/node_modules/@oscharko-dev/keiko-server/dist/diagnostics-log.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/diagnostics-log.js +288 -99
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/completionRoutes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/completionRoutes.js +3 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/hotExitStore.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/hotExitStore.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/hotExitStore.js +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/inlineCompletionRoutes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/inlineCompletionRoutes.js +3 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/localHistory/localHistoryCapture.d.ts +2 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/localHistory/localHistoryCapture.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/localHistory/localHistoryCapture.js +8 -4
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/localHistory/localHistoryStore.d.ts +9 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/localHistory/localHistoryStore.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/localHistory/localHistoryStore.js +2 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/patchApplyRoutes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/patchApplyRoutes.js +3 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/files.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/files.js +24 -14
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-error-diagnostic.d.ts +8 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-error-diagnostic.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-error-diagnostic.js +26 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-instance-cache.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-instance-cache.js +71 -11
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-readiness.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-readiness.js +7 -29
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-setup.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-setup.js +36 -13
- package/node_modules/@oscharko-dev/keiko-server/dist/gitDelivery/mutationEvidenceLedger.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/gitDelivery/mutationEvidenceLedger.js +17 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/gitDelivery/syncEvidence.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/gitDelivery/syncEvidence.js +10 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/gitRoutes.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/gitRoutes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/gitRoutes.js +20 -8
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-entailment-judge.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-entailment-judge.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-entailment-judge.js +2 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-entailment-stage.js +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-hybrid.d.ts +2 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-hybrid.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-hybrid.js +3 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-multi-source.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-multi-source.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-multi-source.js +2 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa.js +67 -43
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-rerank-facade.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-rerank-facade.js +37 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/index.d.ts +6 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/index.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/index.js +38 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-grounded-qa.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-grounded-qa.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-grounded-qa.js +22 -10
- package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-handlers.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-handlers.js +158 -36
- package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-remediation-store.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-remediation-store.js +9 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-remediation.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-remediation.js +10 -5
- package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-store-open.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-store-open.js +8 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/localKnowledgeKeyProvider.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/localKnowledgeKeyProvider.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/localKnowledgeKeyProvider.js +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/manual/manual-pod-service.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/manual/manual-pod-service.js +3 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/memory-audit-handler.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/memory-audit-handler.js +13 -6
- package/node_modules/@oscharko-dev/keiko-server/dist/memory-conflict-advisory.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/memory-conflict-advisory.js +37 -23
- package/node_modules/@oscharko-dev/keiko-server/dist/memory-consolidation-handlers.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/memory-consolidation-handlers.js +10 -55
- package/node_modules/@oscharko-dev/keiko-server/dist/memory-conv-handlers.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/memory-conv-handlers.js +11 -56
- package/node_modules/@oscharko-dev/keiko-server/dist/memory-embedding.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/memory-embedding.js +135 -36
- package/node_modules/@oscharko-dev/keiko-server/dist/memory-handlers.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/memory-handlers.js +32 -62
- package/node_modules/@oscharko-dev/keiko-server/dist/memory-maintenance-handlers.d.ts +3 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/memory-maintenance-handlers.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/memory-maintenance-handlers.js +19 -11
- package/node_modules/@oscharko-dev/keiko-server/dist/memory-retrieval-signals.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/memory-retrieval-signals.js +40 -23
- package/node_modules/@oscharko-dev/keiko-server/dist/memory-salience.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/memory-salience.js +45 -27
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/error-classification.d.ts +25 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/error-classification.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/error-classification.js +115 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/index.d.ts +3 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/index.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/index.js +9 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/log-level.d.ts +13 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/log-level.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/log-level.js +57 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/log-redaction.d.ts +22 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/log-redaction.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/log-redaction.js +698 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/route-template.d.ts +4 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/route-template.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/route-template.js +342 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/server-log.d.ts +58 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/server-log.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/server-log.js +605 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/server-logger.d.ts +37 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/server-logger.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/server-logger.js +199 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/stack-frames.d.ts +5 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/stack-frames.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/stack-frames.js +261 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/process-log-sink.d.ts +11 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/process-log-sink.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/process-log-sink.js +48 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/index.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/index.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/index.js +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figmaSnapshotAdapter.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figmaSnapshotAdapter.js +3 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figmaSnapshotOrchestration.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figmaSnapshotOrchestration.js +13 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figmaSnapshotRoutes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figmaSnapshotRoutes.js +13 -4
- package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/generationPort.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/generationPort.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/generationPort.js +6 -5
- package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/handoffRoutes.js +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/judgePort.d.ts +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/judgePort.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/judgePort.js +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/modelPolicyRoutes.d.ts +2 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/modelPolicyRoutes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/modelPolicyRoutes.js +43 -67
- package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/reCheckRoutes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/reCheckRoutes.js +10 -7
- package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/runExecution.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/runExecution.js +8 -8
- package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/runRoutes.js +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/relationship-activity-broadcast.d.ts +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/relationship-activity-broadcast.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/relationship-activity-broadcast.js +7 -5
- package/node_modules/@oscharko-dev/keiko-server/dist/relationship-handlers.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/relationship-handlers.js +39 -41
- package/node_modules/@oscharko-dev/keiko-server/dist/request-cancellation.d.ts +6 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/request-cancellation.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/request-cancellation.js +18 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/routes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/routes.js +8 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/run-engine.d.ts +2 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/run-engine.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/run-engine.js +34 -22
- package/node_modules/@oscharko-dev/keiko-server/dist/run-handlers.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/run-handlers.js +10 -6
- package/node_modules/@oscharko-dev/keiko-server/dist/server.d.ts +11 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/server.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/server.js +168 -32
- package/node_modules/@oscharko-dev/keiko-server/dist/sse-write.d.ts +27 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/sse-write.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/sse-write.js +110 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/sse.d.ts +2 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/sse.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/sse.js +13 -6
- package/node_modules/@oscharko-dev/keiko-server/dist/store/db.d.ts +15 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/store/db.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/store/db.js +190 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/store/index.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/store/index.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/store/index.js +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/store-fingerprints.d.ts +29 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/store-fingerprints.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/store-fingerprints.js +135 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/store-handlers.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/store-handlers.js +7 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/terminal-routes.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/terminal-routes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/terminal-routes.js +10 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/update-remediation-routes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/update-remediation-routes.js +3 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/update-remediation.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/update-remediation.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/update-remediation.js +27 -24
- package/node_modules/@oscharko-dev/keiko-server/dist/voice-handlers.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/voice-handlers.js +2 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/voice-live-dictation.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/voice-live-dictation.js +15 -6
- package/node_modules/@oscharko-dev/keiko-server/dist/voice-realtime.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/voice-realtime.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/voice-realtime.js +14 -5
- package/node_modules/@oscharko-dev/keiko-server/dist/workspace-index-provider.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/workspace-index-provider.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/workspace-index-provider.js +24 -11
- package/node_modules/@oscharko-dev/keiko-server/package.json +21 -21
- package/node_modules/@oscharko-dev/keiko-tools/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-tools/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-tools/package.json +5 -5
- package/node_modules/@oscharko-dev/keiko-verification/package.json +5 -5
- package/node_modules/@oscharko-dev/keiko-workflows/package.json +10 -10
- package/node_modules/@oscharko-dev/keiko-workspace/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/package.json +3 -3
- package/package.json +27 -25
- package/release-impact.catalog.json +121 -8
- package/vendor/oscharko-dev-keiko-cli-0.3.16.tgz +0 -0
- package/vendor/{oscharko-dev-keiko-connectors-0.3.14.tgz → oscharko-dev-keiko-connectors-0.3.16.tgz} +0 -0
- package/vendor/oscharko-dev-keiko-contracts-0.3.16.tgz +0 -0
- package/vendor/{oscharko-dev-keiko-evaluations-0.3.14.tgz → oscharko-dev-keiko-evaluations-0.3.16.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-evidence-0.3.14.tgz → oscharko-dev-keiko-evidence-0.3.16.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-git-0.3.14.tgz → oscharko-dev-keiko-git-0.3.16.tgz} +0 -0
- package/vendor/oscharko-dev-keiko-harness-0.3.16.tgz +0 -0
- package/vendor/oscharko-dev-keiko-local-knowledge-0.3.16.tgz +0 -0
- package/vendor/{oscharko-dev-keiko-memory-capture-0.3.14.tgz → oscharko-dev-keiko-memory-capture-0.3.16.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-memory-consolidation-0.3.14.tgz → oscharko-dev-keiko-memory-consolidation-0.3.16.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-memory-governance-0.3.14.tgz → oscharko-dev-keiko-memory-governance-0.3.16.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-memory-retrieval-0.3.14.tgz → oscharko-dev-keiko-memory-retrieval-0.3.16.tgz} +0 -0
- package/vendor/oscharko-dev-keiko-memory-vault-0.3.16.tgz +0 -0
- package/vendor/oscharko-dev-keiko-model-gateway-0.3.16.tgz +0 -0
- package/vendor/{oscharko-dev-keiko-quality-intelligence-0.3.14.tgz → oscharko-dev-keiko-quality-intelligence-0.3.16.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-sandbox-0.3.14.tgz → oscharko-dev-keiko-sandbox-0.3.16.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-sdk-0.3.14.tgz → oscharko-dev-keiko-sdk-0.3.16.tgz} +0 -0
- package/vendor/oscharko-dev-keiko-security-0.3.16.tgz +0 -0
- package/vendor/oscharko-dev-keiko-server-0.3.16.tgz +0 -0
- package/vendor/{oscharko-dev-keiko-tools-0.3.14.tgz → oscharko-dev-keiko-tools-0.3.16.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-verification-0.3.14.tgz → oscharko-dev-keiko-verification-0.3.16.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-workflows-0.3.14.tgz → oscharko-dev-keiko-workflows-0.3.16.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-workspace-0.3.14.tgz → oscharko-dev-keiko-workspace-0.3.16.tgz} +0 -0
- package/dist/ui/static/_next/static/chunks/03la2o0tcodk_.js +0 -1
- package/dist/ui/static/_next/static/chunks/089ft_ee-2y20.js +0 -1
- package/dist/ui/static/_next/static/chunks/09ifk61aybcwe.js +0 -1
- package/dist/ui/static/_next/static/chunks/0iwjev0wot4b0.js +0 -1
- package/dist/ui/static/_next/static/chunks/0lorosh9iyl5i.js +0 -7
- package/dist/ui/static/_next/static/chunks/0q76qswp80ci1.js +0 -1
- package/dist/ui/static/_next/static/chunks/130bqt0eb54h4.js +0 -1
- package/dist/ui/static/_next/static/chunks/1pcygmx7pvpwp.js +0 -4
- package/dist/ui/static/_next/static/chunks/1s1u4fx4mdurk.js +0 -1
- package/dist/ui/static/_next/static/chunks/1wnmpolx-w3e0.js +0 -1
- package/dist/ui/static/_next/static/chunks/23jcx3s74h89k.js +0 -1
- package/dist/ui/static/_next/static/chunks/26sy339azhbd8.js +0 -1
- package/dist/ui/static/_next/static/chunks/2c9gq9vpyd9sm.js +0 -1
- package/dist/ui/static/_next/static/chunks/2iqsdgq5z7zi-.js +0 -1
- package/dist/ui/static/_next/static/chunks/2iuxjus3qppec.js +0 -1
- package/dist/ui/static/_next/static/chunks/2t0ktf1dxwv0_.js +0 -1
- package/dist/ui/static/_next/static/chunks/2wvo7q19g065e.js +0 -1
- package/dist/ui/static/_next/static/chunks/2xgtm8mmbv8mx.js +0 -1
- package/dist/ui/static/_next/static/chunks/32h72gk6uqdr0.js +0 -1
- package/dist/ui/static/_next/static/chunks/3ljwwkelljh81.js +0 -1
- package/dist/ui/static/_next/static/chunks/3pukrjhzlxlur.js +0 -1
- package/vendor/oscharko-dev-keiko-cli-0.3.14.tgz +0 -0
- package/vendor/oscharko-dev-keiko-contracts-0.3.14.tgz +0 -0
- package/vendor/oscharko-dev-keiko-harness-0.3.14.tgz +0 -0
- package/vendor/oscharko-dev-keiko-local-knowledge-0.3.14.tgz +0 -0
- package/vendor/oscharko-dev-keiko-memory-vault-0.3.14.tgz +0 -0
- package/vendor/oscharko-dev-keiko-model-gateway-0.3.14.tgz +0 -0
- package/vendor/oscharko-dev-keiko-security-0.3.14.tgz +0 -0
- package/vendor/oscharko-dev-keiko-server-0.3.14.tgz +0 -0
- /package/dist/ui/static/_next/static/{y54UtqSyUZo4acoo_2Vb4 → nV-Flxo4itfIzasbhujy9}/_buildManifest.js +0 -0
- /package/dist/ui/static/_next/static/{y54UtqSyUZo4acoo_2Vb4 → nV-Flxo4itfIzasbhujy9}/_clientMiddlewareManifest.js +0 -0
- /package/dist/ui/static/_next/static/{y54UtqSyUZo4acoo_2Vb4 → nV-Flxo4itfIzasbhujy9}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,605 @@
|
|
|
1
|
+
// Server activity log — one JSON line per operation into `<stateDir>/logs/server.log`, with
|
|
2
|
+
// day-based rotation and a rolling 7-day retention. Written unconditionally, no env-var opt-in:
|
|
3
|
+
// operators facing a stuck run must not have to know a magic switch to see what the process is
|
|
4
|
+
// doing. Redaction stays strict — endpoints, sizes, HTTP statuses, error kinds and correlation
|
|
5
|
+
// ids only; request bodies, response bodies, tokens, api-keys and user text never appear, and
|
|
6
|
+
// that is enforced structurally by `log-redaction.ts` rather than by caller discipline.
|
|
7
|
+
//
|
|
8
|
+
// WHY THE WRITE IS SYNCHRONOUS (and stays that way)
|
|
9
|
+
//
|
|
10
|
+
// The failure this log exists to diagnose is a process that stops making progress: a six-minute
|
|
11
|
+
// wall inside an embedding batch, a wedged proxy CONNECT, a migration holding a transaction. A
|
|
12
|
+
// write-behind queue is exactly wrong for that shape — the lines an operator needs are the last
|
|
13
|
+
// ones before the wedge, and those are the ones a queue still holds when the event loop stops
|
|
14
|
+
// turning or the process is killed. Synchronous append is the only mode where "the line is in the
|
|
15
|
+
// file" and "the operation happened" cannot come apart.
|
|
16
|
+
//
|
|
17
|
+
// The cost is bounded and pinned by COUNTING, not by timing. The sink holds ONE append-mode
|
|
18
|
+
// descriptor open for the life of the file, so a line costs a single `write(2)` rather than the
|
|
19
|
+
// open/write/close triple `appendFileSync` pays per call. `server-log.test.ts` asserts exactly
|
|
20
|
+
// that over a burst — one `openSync`, one `writeSync` per line, and a file whose size is the SUM of
|
|
21
|
+
// each line's own byte length (lines are no longer byte-identical once `seq` is in the envelope: its
|
|
22
|
+
// digit width grows at each power-of-ten boundary the burst crosses) — so a regression to per-write
|
|
23
|
+
// open/close, or to a quadratic format path, fails the suite deterministically instead of showing up
|
|
24
|
+
// as latency in production. A wall-clock budget would measure the runner's disk instead, and go red
|
|
25
|
+
// on a diff that never touched this file.
|
|
26
|
+
//
|
|
27
|
+
// Levels are the volume control instead: an event below the configured threshold returns before
|
|
28
|
+
// any string or JSON work happens at all (`KEIKO_LOG_LEVEL`, default `info`).
|
|
29
|
+
import { randomUUID } from "node:crypto";
|
|
30
|
+
import { closeSync, existsSync, linkSync, mkdirSync, openSync, readdirSync, renameSync, unlinkSync, writeSync, } from "node:fs";
|
|
31
|
+
import { join, resolve as resolvePath } from "node:path";
|
|
32
|
+
import { classifyErrorKind } from "@oscharko-dev/keiko-contracts";
|
|
33
|
+
import { isValidCorrelationId } from "../correlation.js";
|
|
34
|
+
import { contentFreeErrorClass, machineToken, safeProperty } from "./error-classification.js";
|
|
35
|
+
import { DEFAULT_SERVER_LOG_LEVEL, resolveServerLogThreshold, serverLogLevelEnabled, } from "./log-level.js";
|
|
36
|
+
import { redactLogFields, redactLogLabel } from "./log-redaction.js";
|
|
37
|
+
export { DEFAULT_SERVER_LOG_LEVEL, SERVER_LOG_LEVELS, SERVER_LOG_LEVEL_ENV, isServerLogLevel, isServerLogThreshold, parseServerLogThreshold, resolveServerLogThreshold, serverLogLevelEnabled, serverLogLevelRank, } from "./log-level.js";
|
|
38
|
+
export { MAX_LOG_ARRAY_LENGTH, MAX_LOG_FIELD_COUNT, MAX_LOG_FIELD_DEPTH, MAX_LOG_STRING_LENGTH, REDACTED_KEY, REDACTED_LENGTH, REDACTED_PATH, REDACTED_PERSONAL, REDACTED_SECRET, REDACTED_SHAPE, DROPPED_DEPTH, DROPPED_LENGTH, closeReasonVocabulary, isDeniedLogFieldName, normalizeLogFieldName, redactLogFields, redactLogLabel, redactLogString, } from "./log-redaction.js";
|
|
39
|
+
export { redactRoutePath } from "./route-template.js";
|
|
40
|
+
// Bumped only on a breaking change to the line FORMAT (a reserved field renamed, removed, or
|
|
41
|
+
// retyped) — never on an additive change, which is what every wave of this schema so far has been.
|
|
42
|
+
export const SERVER_LOG_SCHEMA_VERSION = 2;
|
|
43
|
+
// One instance id per process, computed once from a single `randomUUID()` call so every line this
|
|
44
|
+
// process ever writes carries the SAME value. A pid alone is not a process-identity key: the OS
|
|
45
|
+
// reuses pids across restarts, so two different process lifetimes can share one in a rotated
|
|
46
|
+
// multi-day file. `pid` + `instanceId` together, never `pid` alone, is what an agent joins on.
|
|
47
|
+
const INSTANCE_ID = randomUUID().replaceAll("-", "").slice(0, 8);
|
|
48
|
+
// Exposed so a future consumer (the CLI's support-bundle manifest) can name the same instance the
|
|
49
|
+
// running process is stamping onto its own lines, without recomputing or guessing at the value.
|
|
50
|
+
export function serverLogInstanceId() {
|
|
51
|
+
return INSTANCE_ID;
|
|
52
|
+
}
|
|
53
|
+
export const DEFAULT_LOG_RETENTION_DAYS = 7;
|
|
54
|
+
// A hard ceiling on one serialised line. Every field guard runs first, so reaching this means a
|
|
55
|
+
// caller passed an unexpected shape; the line is replaced rather than written, so one pathological
|
|
56
|
+
// event cannot fill a disk or blow a log shipper's line limit.
|
|
57
|
+
export const MAX_LOG_LINE_BYTES = 8192;
|
|
58
|
+
const NULL_SINK = {
|
|
59
|
+
write(_event) {
|
|
60
|
+
// Explicit noop for tests and for environments without a state directory.
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
export function nullServerLogSink() {
|
|
64
|
+
return NULL_SINK;
|
|
65
|
+
}
|
|
66
|
+
// Turns an unknown thrown value into a content-free classification: a coded error's `code`, else
|
|
67
|
+
// its content-free CLASS, else `unknown`. The MESSAGE is never read — that is the whole point, and
|
|
68
|
+
// it is why instrumentation sites should call this instead of `String(error)`. It lives here rather
|
|
69
|
+
// than beside the logger because the file sink below classifies its own failures too, and this
|
|
70
|
+
// module is the one both sides already depend on.
|
|
71
|
+
//
|
|
72
|
+
// Delegates to `error-classification.ts`'s `safeProperty`/`machineToken`/`contentFreeErrorClass`
|
|
73
|
+
// (ADR-0173 D11) instead of maintaining a second, less-hardened regex-based reader: this used to
|
|
74
|
+
// read `code`/`name` off a plain cast with no try/catch, so a hostile `code`/`name` accessor that
|
|
75
|
+
// THROWS on read (rather than merely returning prose) crashed classification itself; the shared
|
|
76
|
+
// helpers already wrap every reflective read.
|
|
77
|
+
//
|
|
78
|
+
// `code` is read off ANY object, `Error` or not — this function's contract has always been "read
|
|
79
|
+
// the field if it is there", and gating that read on `instanceof Error` would silently drop a
|
|
80
|
+
// conforming `code` carried by a plain thrown object (e.g. `{ code: "SQLITE_BUSY" }`), which the
|
|
81
|
+
// pre-hardening reader classified correctly.
|
|
82
|
+
//
|
|
83
|
+
// The `Error`-vs-not split matters only for the FALLBACK once `code` is absent or non-conforming.
|
|
84
|
+
// An actual `Error` instance goes through `contentFreeErrorClass`, which trusts `.name` only for a
|
|
85
|
+
// specific, curated set of built-ins and otherwise reads the CODE-DECLARED class off the
|
|
86
|
+
// prototype — `.name` is a plain mutable own property a hostile thrown value can load with
|
|
87
|
+
// request-derived text, and `diagnostics-log.test.ts`'s "degrades an overridden name on a plain
|
|
88
|
+
// Error and never serializes it" pins exactly this for every producer that shares this leaf, this
|
|
89
|
+
// function included. A non-`Error` object has no declared class to recover, so its own `.name` is
|
|
90
|
+
// read through the same shape gate (`classifyErrorKind`) every other package's reducer already
|
|
91
|
+
// applies — restoring the pre-hardening reader's fidelity for that shape without reopening the
|
|
92
|
+
// `Error`-name hardening above. Either branch still floors on the fixed string `"unknown"` for a
|
|
93
|
+
// non-conforming candidate, pinned by `server-logger.test.ts`.
|
|
94
|
+
export function errorKindOf(error) {
|
|
95
|
+
if (typeof error !== "object" || error === null)
|
|
96
|
+
return "unknown";
|
|
97
|
+
const code = machineToken(safeProperty(error, "code"));
|
|
98
|
+
if (code !== undefined)
|
|
99
|
+
return code;
|
|
100
|
+
if (error instanceof Error)
|
|
101
|
+
return contentFreeErrorClass(error);
|
|
102
|
+
return classifyErrorKind(safeProperty(error, "name")) ?? "unknown";
|
|
103
|
+
}
|
|
104
|
+
// LAST-RESORT FAILURE NOTICE
|
|
105
|
+
//
|
|
106
|
+
// Every layer below the caller swallows its own failures on purpose: a log line is evidence about
|
|
107
|
+
// an operation and must never become a new failure mode for it. Swallowed SILENTLY, though, a
|
|
108
|
+
// permanently broken log looks exactly like a quiet system — which is the precise silence this
|
|
109
|
+
// module exists to end, and the reason four releases shipped against a stuck indexing run.
|
|
110
|
+
//
|
|
111
|
+
// So a failure is reported once, on an INDEPENDENT channel: stderr, never the sink that just
|
|
112
|
+
// failed. A full disk cannot be diagnosed by writing to the disk. The notice carries the same
|
|
113
|
+
// body-free shape as a log line — a classification, the op, the correlation id — and is throttled,
|
|
114
|
+
// because the failures this catches sit inside per-item loops: a broken descriptor must not turn
|
|
115
|
+
// one flood into another. Suppressed notices are counted and reported on the next one, so the
|
|
116
|
+
// throttle never hides the SCALE of the failure, only its repetition.
|
|
117
|
+
const LOG_FAILURE_NOTICE_OP = "server-log.write-failed";
|
|
118
|
+
export const LOG_FAILURE_NOTICE_WINDOW_MS = 60_000;
|
|
119
|
+
const failureNotice = { lastAt: null, suppressed: 0 };
|
|
120
|
+
// Tests reset this so one suite's notice cannot silence the next suite's assertion; the server
|
|
121
|
+
// resets it on shutdown for the same reason. Either caller is clearing `suppressed` — a count that
|
|
122
|
+
// otherwise only ever surfaces on the NEXT unthrottled failure — so a suppressed count sitting here
|
|
123
|
+
// when the reset runs is flushed to stderr first: without this, a clean shutdown (or a suite that
|
|
124
|
+
// never sees another failure) would clear the counter with nothing ever having reported it, and
|
|
125
|
+
// `reportServerLogFailure`'s "suppressed notices are counted and reported on the next one" promise
|
|
126
|
+
// would be broken for whatever window was still open.
|
|
127
|
+
export function resetServerLogFailureNotices() {
|
|
128
|
+
if (failureNotice.suppressed > 0) {
|
|
129
|
+
emitShutdownFlushNotice(failureNotice.suppressed, Date.now());
|
|
130
|
+
}
|
|
131
|
+
failureNotice.lastAt = null;
|
|
132
|
+
failureNotice.suppressed = 0;
|
|
133
|
+
}
|
|
134
|
+
function noticeIsThrottled(now) {
|
|
135
|
+
const last = failureNotice.lastAt;
|
|
136
|
+
if (last === null)
|
|
137
|
+
return false;
|
|
138
|
+
const elapsed = now - last;
|
|
139
|
+
// A backwards system-clock adjustment must not silence the notice for a minute: an elapsed time
|
|
140
|
+
// we cannot trust fails toward visibility.
|
|
141
|
+
return elapsed >= 0 && elapsed < LOG_FAILURE_NOTICE_WINDOW_MS;
|
|
142
|
+
}
|
|
143
|
+
export function reportServerLogFailure(error, context = {}) {
|
|
144
|
+
const now = Date.now();
|
|
145
|
+
if (noticeIsThrottled(now)) {
|
|
146
|
+
failureNotice.suppressed += 1;
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
const suppressed = failureNotice.suppressed;
|
|
150
|
+
failureNotice.lastAt = now;
|
|
151
|
+
failureNotice.suppressed = 0;
|
|
152
|
+
emitFailureNotice(error, context, suppressed, now);
|
|
153
|
+
}
|
|
154
|
+
// Shared by every stderr notice this module emits: a diagnostic that cannot itself be delivered
|
|
155
|
+
// must not fail the operation (or the shutdown) it was describing. When stderr itself is
|
|
156
|
+
// unavailable (a closed descriptor, a broken pipe, ...) the notice still reaches an operator
|
|
157
|
+
// through an INDEPENDENT channel — `process.emitWarning` dispatches the 'warning' event
|
|
158
|
+
// synchronously to any listener, which fires even when stderr is closed; Node's own default
|
|
159
|
+
// handler happens to also print to stderr, but that is Node's problem to swallow, not this
|
|
160
|
+
// module's. This is genuinely the last channel: if a 'warning' listener itself throws, or every
|
|
161
|
+
// stream this process owns is gone, the notice is lost.
|
|
162
|
+
function writeStderrNotice(notice) {
|
|
163
|
+
try {
|
|
164
|
+
process.stderr.write(`${JSON.stringify(notice)}\n`);
|
|
165
|
+
}
|
|
166
|
+
catch {
|
|
167
|
+
emitLogNoticeFailedWarning(notice);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
function emitLogNoticeFailedWarning(notice) {
|
|
171
|
+
try {
|
|
172
|
+
process.emitWarning("keiko server log notice could not be written to stderr", {
|
|
173
|
+
code: "KEIKO_LOG_NOTICE_FAILED",
|
|
174
|
+
// Named `noticeOp`, not `op`: this is a description of a notice, not a log event, and the
|
|
175
|
+
// op-catalog generator indexes every `op:` property in product code.
|
|
176
|
+
detail: JSON.stringify({
|
|
177
|
+
noticeOp: notice.op,
|
|
178
|
+
failedOp: notice.failedOp,
|
|
179
|
+
correlationId: notice.correlationId,
|
|
180
|
+
errorKind: notice.errorKind,
|
|
181
|
+
suppressedNotices: notice.suppressedNotices,
|
|
182
|
+
}),
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
catch {
|
|
186
|
+
// No channel left to report through; nothing further to do.
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
function emitFailureNotice(error, context, suppressed, now) {
|
|
190
|
+
const notice = {
|
|
191
|
+
ts: new Date(now).toISOString(),
|
|
192
|
+
level: "error",
|
|
193
|
+
category: "diagnostic",
|
|
194
|
+
op: LOG_FAILURE_NOTICE_OP,
|
|
195
|
+
errorKind: errorKindOf(error),
|
|
196
|
+
};
|
|
197
|
+
if (context.op !== undefined)
|
|
198
|
+
notice.failedOp = redactLogLabel(context.op);
|
|
199
|
+
if (context.correlationId !== undefined) {
|
|
200
|
+
notice.correlationId = redactLogLabel(context.correlationId);
|
|
201
|
+
}
|
|
202
|
+
if (suppressed > 0)
|
|
203
|
+
notice.suppressedNotices = suppressed;
|
|
204
|
+
writeStderrNotice(notice);
|
|
205
|
+
}
|
|
206
|
+
// The last-resort flush: whatever `suppressed` count was still sitting unreported when the notice
|
|
207
|
+
// state was reset (a clean process shutdown, or a suite boundary) is announced here, ONCE, before
|
|
208
|
+
// `resetServerLogFailureNotices` clears it. This has the same body-free shape as a throttled
|
|
209
|
+
// failure notice, plus `reason` so a reader can tell "reported because another failure arrived"
|
|
210
|
+
// from "reported because the counter was about to be cleared with nothing else coming."
|
|
211
|
+
//
|
|
212
|
+
// This still cannot promise EXACT accounting across every possible exit: a hard kill (SIGKILL,
|
|
213
|
+
// power loss, or any crash the process never gets to handle) skips this flush entirely, same as it
|
|
214
|
+
// skips every other cleanup path. The `seq` gap for such a window still marks that a write failed;
|
|
215
|
+
// only the count of how many is not recoverable after that kind of exit.
|
|
216
|
+
function emitShutdownFlushNotice(suppressed, now) {
|
|
217
|
+
writeStderrNotice({
|
|
218
|
+
ts: new Date(now).toISOString(),
|
|
219
|
+
level: "error",
|
|
220
|
+
category: "diagnostic",
|
|
221
|
+
op: LOG_FAILURE_NOTICE_OP,
|
|
222
|
+
reason: "shutdown-flush",
|
|
223
|
+
suppressedNotices: suppressed,
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
function eventLevel(event) {
|
|
227
|
+
return event.level ?? DEFAULT_SERVER_LOG_LEVEL;
|
|
228
|
+
}
|
|
229
|
+
function finiteOrUndefined(value) {
|
|
230
|
+
return typeof value === "number" && Number.isFinite(value) ? value : undefined;
|
|
231
|
+
}
|
|
232
|
+
function applyEnvelopeFields(record, event) {
|
|
233
|
+
if (event.correlationId !== undefined)
|
|
234
|
+
record.correlationId = redactLogLabel(event.correlationId);
|
|
235
|
+
// Shape-guarded, not merely redacted: a `parentCorrelationId` that does not fit
|
|
236
|
+
// `isValidCorrelationId`'s shape is dropped outright rather than written under a marker — an
|
|
237
|
+
// unshaped value here is evidence of a producer bug, never content worth preserving a trace of.
|
|
238
|
+
if (event.parentCorrelationId !== undefined && isValidCorrelationId(event.parentCorrelationId)) {
|
|
239
|
+
record.parentCorrelationId = redactLogLabel(event.parentCorrelationId);
|
|
240
|
+
}
|
|
241
|
+
const durationMs = finiteOrUndefined(event.durationMs);
|
|
242
|
+
if (durationMs !== undefined)
|
|
243
|
+
record.durationMs = durationMs;
|
|
244
|
+
const status = finiteOrUndefined(event.status);
|
|
245
|
+
if (status !== undefined)
|
|
246
|
+
record.status = status;
|
|
247
|
+
if (event.errorKind !== undefined)
|
|
248
|
+
record.errorKind = redactLogLabel(event.errorKind);
|
|
249
|
+
}
|
|
250
|
+
// `ts`, `schemaVersion`, `pid`, `instanceId`, `seq`, `level`, `category` and `op` are written first
|
|
251
|
+
// and are reserved inside `redactLogFields`, so `extra` cannot spoof the identity of a line. The
|
|
252
|
+
// remaining envelope fields are applied AFTER `extra` so an explicit `durationMs`/`status`/
|
|
253
|
+
// `errorKind` on the event wins, while an instrumentation site that carries the same name in its
|
|
254
|
+
// field list still gets it logged.
|
|
255
|
+
//
|
|
256
|
+
// `identity` is optional so the in-memory buffered sink (tests only) can format a line without a
|
|
257
|
+
// process/sequence context; the file sink below always supplies one, so every line that actually
|
|
258
|
+
// reaches disk carries the full v2 envelope.
|
|
259
|
+
export function formatServerLogLine(event, now = new Date(), identity) {
|
|
260
|
+
const record = { ts: now.toISOString() };
|
|
261
|
+
if (identity !== undefined) {
|
|
262
|
+
record.schemaVersion = identity.schemaVersion;
|
|
263
|
+
record.pid = identity.pid;
|
|
264
|
+
record.instanceId = identity.instanceId;
|
|
265
|
+
record.seq = identity.seq;
|
|
266
|
+
}
|
|
267
|
+
record.level = eventLevel(event);
|
|
268
|
+
record.category = event.category;
|
|
269
|
+
record.op = redactLogLabel(event.op);
|
|
270
|
+
const extra = redactLogFields(event.extra);
|
|
271
|
+
if (extra !== undefined)
|
|
272
|
+
Object.assign(record, extra);
|
|
273
|
+
applyEnvelopeFields(record, event);
|
|
274
|
+
const line = `${JSON.stringify(record)}\n`;
|
|
275
|
+
// One byte measurement on the happy path; the second only on the line that is being replaced.
|
|
276
|
+
return serverLogLineWithinCap(line) ? line : oversizedLine(record, serverLogLineBytes(line));
|
|
277
|
+
}
|
|
278
|
+
// The cap is a cap on BYTES, because the write below encodes UTF-8 and a log shipper's line limit
|
|
279
|
+
// counts bytes. `line.length` counts UTF-16 code units, so comparing it against the cap admitted a
|
|
280
|
+
// line up to three times the stated size — and multi-byte text is exactly what makes a line
|
|
281
|
+
// oversized in the first place, since a document body is the only thing that gets there.
|
|
282
|
+
//
|
|
283
|
+
// The value guards in `log-redaction.ts` currently refuse a non-ASCII field value outright, so in
|
|
284
|
+
// today's wiring the two counts agree. That is a second layer, not a reason to measure the wrong
|
|
285
|
+
// thing here: this module's cap must hold on its own for whatever a future producer, or a relaxed
|
|
286
|
+
// value guard, puts on a line.
|
|
287
|
+
export function serverLogLineBytes(line) {
|
|
288
|
+
return Buffer.byteLength(line, "utf8");
|
|
289
|
+
}
|
|
290
|
+
export function serverLogLineWithinCap(line) {
|
|
291
|
+
return serverLogLineBytes(line) <= MAX_LOG_LINE_BYTES;
|
|
292
|
+
}
|
|
293
|
+
function oversizedLine(record, lineBytes) {
|
|
294
|
+
// The identity fields ride along when present: an agent joining lines by (pid, instanceId, seq)
|
|
295
|
+
// must not see a gap in that join key just because the ORIGINAL event happened to be oversized.
|
|
296
|
+
const replacement = { ts: record.ts };
|
|
297
|
+
if (record.schemaVersion !== undefined)
|
|
298
|
+
replacement.schemaVersion = record.schemaVersion;
|
|
299
|
+
if (record.pid !== undefined)
|
|
300
|
+
replacement.pid = record.pid;
|
|
301
|
+
if (record.instanceId !== undefined)
|
|
302
|
+
replacement.instanceId = record.instanceId;
|
|
303
|
+
if (record.seq !== undefined)
|
|
304
|
+
replacement.seq = record.seq;
|
|
305
|
+
replacement.level = record.level;
|
|
306
|
+
replacement.category = record.category;
|
|
307
|
+
replacement.op = record.op;
|
|
308
|
+
replacement.errorKind = "log-line-oversized";
|
|
309
|
+
replacement.droppedLineBytes = lineBytes;
|
|
310
|
+
return `${JSON.stringify(replacement)}\n`;
|
|
311
|
+
}
|
|
312
|
+
// PROCESS-WIDE `seq` ALLOCATOR — one counter, one module, for the life of the process.
|
|
313
|
+
//
|
|
314
|
+
// It must NOT live on `ActiveLog`. Two independent state directories in the same process (a CLI
|
|
315
|
+
// pointed at a workspace-local state dir, and the server logger's own default) each resolve to a
|
|
316
|
+
// DIFFERENT `ActiveLog`; a counter kept per `ActiveLog` restarts at 1 for each one, so two lines
|
|
317
|
+
// written moments apart — one to each directory — can carry the identical `(pid, instanceId, seq)`
|
|
318
|
+
// tuple. That tuple is the join key ADR-0173 (D2) promises an agent a total, gap-free order on, and
|
|
319
|
+
// a duplicate breaks the promise regardless of how many log directories the process happens to
|
|
320
|
+
// have open. One allocator shared by every `ActiveLog`, every rotation, and every sink built on top
|
|
321
|
+
// of any of them is what keeps the tuple unique process-wide.
|
|
322
|
+
//
|
|
323
|
+
// Claimed as soon as an event clears the level gate, in `createFileSinkFacade.write`, BEFORE the
|
|
324
|
+
// write is attempted — never rolled back if that write then throws. The alternative, claiming only
|
|
325
|
+
// after a successful write, would let two callers racing the same failure both observe the same
|
|
326
|
+
// pre-failure counter value and then both claim the number that follows it, silently reusing a
|
|
327
|
+
// sequence number for two different lines. A gap is not a bug in this counter: it is the evidence
|
|
328
|
+
// that a line was not persisted, and `reportServerLogFailure`'s suppressed-notice count accounts
|
|
329
|
+
// for the writes a gap represents. Monotonic per process; a gap marks a line the sink could not
|
|
330
|
+
// persist.
|
|
331
|
+
let nextProcessSeq = 1;
|
|
332
|
+
function allocateServerLogSeq() {
|
|
333
|
+
const seq = nextProcessSeq;
|
|
334
|
+
nextProcessSeq += 1;
|
|
335
|
+
return seq;
|
|
336
|
+
}
|
|
337
|
+
function todayUtc(now = new Date()) {
|
|
338
|
+
return now.toISOString().slice(0, 10);
|
|
339
|
+
}
|
|
340
|
+
function closeHandle(active) {
|
|
341
|
+
if (active.handle === null)
|
|
342
|
+
return;
|
|
343
|
+
try {
|
|
344
|
+
closeSync(active.handle);
|
|
345
|
+
}
|
|
346
|
+
catch {
|
|
347
|
+
// A descriptor we can no longer close is a descriptor we must stop using either way.
|
|
348
|
+
}
|
|
349
|
+
active.handle = null;
|
|
350
|
+
}
|
|
351
|
+
// Throws rather than returning null: a descriptor we cannot open is a failure an operator has to
|
|
352
|
+
// hear about, and the caller's catch is the one place that both closes and reports.
|
|
353
|
+
function ensureHandle(active) {
|
|
354
|
+
if (active.handle !== null)
|
|
355
|
+
return active.handle;
|
|
356
|
+
active.handle = openSync(active.currentPath, "a", 0o600);
|
|
357
|
+
return active.handle;
|
|
358
|
+
}
|
|
359
|
+
function errorCode(error) {
|
|
360
|
+
if (typeof error !== "object" || error === null || !("code" in error))
|
|
361
|
+
return "";
|
|
362
|
+
const { code } = error;
|
|
363
|
+
return typeof code === "string" ? code : "";
|
|
364
|
+
}
|
|
365
|
+
// Names old files with their calendar day, e.g. `server-2026-08-20.log`, and keeps at most
|
|
366
|
+
// `retentionDays` of them. A fresh install starts empty. This is the whole rotation policy.
|
|
367
|
+
function rotateIfNeeded(active) {
|
|
368
|
+
const day = todayUtc();
|
|
369
|
+
if (day === active.currentDay)
|
|
370
|
+
return;
|
|
371
|
+
closeHandle(active);
|
|
372
|
+
// A successful archive means the file we were mid-record in is no longer the file we append to,
|
|
373
|
+
// so the partial-record debt does not travel to the fresh one.
|
|
374
|
+
if (archiveCurrentDay(active))
|
|
375
|
+
active.pendingNewline = false;
|
|
376
|
+
active.currentDay = day;
|
|
377
|
+
pruneOldFiles(active.directory, active.retentionDays);
|
|
378
|
+
}
|
|
379
|
+
// Rotation has to be atomic ACROSS PROCESSES, not merely within one. `renameSync` REPLACES an
|
|
380
|
+
// existing destination, so two Keiko processes sharing a state directory that both reach the UTC
|
|
381
|
+
// boundary destroy the finished day: the first archives it, the second renames its own fresh file
|
|
382
|
+
// over that archive. An `existsSync` guard does not close that window — it is a check, and the
|
|
383
|
+
// window is between the check and the rename. The in-process registry below cannot help either;
|
|
384
|
+
// by construction it coordinates only one process.
|
|
385
|
+
//
|
|
386
|
+
// `link(2)` has no such window: it fails with EEXIST when the destination already exists, so
|
|
387
|
+
// exactly one process can ever create `server-<day>.log`. The loser leaves the archive alone and
|
|
388
|
+
// only advances its own day; only the winner unlinks the current path, so a fresh file another
|
|
389
|
+
// process is already appending to can never be moved on top of a finished day.
|
|
390
|
+
// `link(2)` reports "not supported by this filesystem" through these. EPERM is ambiguous — it is
|
|
391
|
+
// also plain permission denial — but the state directory is created by this process at 0700, so a
|
|
392
|
+
// permission failure on it is not the reachable case, and treating it as unsupported keeps
|
|
393
|
+
// removable-media installs rotating.
|
|
394
|
+
const NO_HARD_LINK_SUPPORT = new Set(["EPERM", "ENOSYS", "EOPNOTSUPP", "ENOTSUP"]);
|
|
395
|
+
function archiveCurrentDay(active) {
|
|
396
|
+
const rolled = join(active.directory, `server-${active.currentDay}.log`);
|
|
397
|
+
try {
|
|
398
|
+
linkSync(active.currentPath, rolled);
|
|
399
|
+
}
|
|
400
|
+
catch (error) {
|
|
401
|
+
const code = errorCode(error);
|
|
402
|
+
// EEXIST: a peer already archived this day, and leaving its file untouched is the whole point.
|
|
403
|
+
// ENOENT: there is nothing to archive (a fresh install, or a peer that has already moved it).
|
|
404
|
+
if (code === "EEXIST" || code === "ENOENT")
|
|
405
|
+
return false;
|
|
406
|
+
// ONLY "this filesystem has no hard links" may fall back to the destination-replacing rename.
|
|
407
|
+
// EACCES, EMLINK, EIO and friends are real failures, and for them the safe outcome is to NOT
|
|
408
|
+
// rotate: one file growing is a nuisance, overwriting a peer's finished archive is data loss.
|
|
409
|
+
// Choose the nuisance. Without this narrowing the fallback re-opened the exact race the
|
|
410
|
+
// hard-link rotation exists to close.
|
|
411
|
+
if (!NO_HARD_LINK_SUPPORT.has(code))
|
|
412
|
+
return false;
|
|
413
|
+
return archiveWithoutHardLinks(active, rolled);
|
|
414
|
+
}
|
|
415
|
+
return unlinkCurrentPath(active);
|
|
416
|
+
}
|
|
417
|
+
// A filesystem that cannot hard-link at all (FAT/exFAT under a state directory on removable
|
|
418
|
+
// media). No atomic primitive is left, so this falls back to the guarded rename rather than never
|
|
419
|
+
// rotating and letting one file grow without bound — the cross-process window exists only here,
|
|
420
|
+
// and only where nothing better is available.
|
|
421
|
+
function archiveWithoutHardLinks(active, rolled) {
|
|
422
|
+
if (existsSync(rolled) || !existsSync(active.currentPath))
|
|
423
|
+
return false;
|
|
424
|
+
try {
|
|
425
|
+
renameSync(active.currentPath, rolled);
|
|
426
|
+
return true;
|
|
427
|
+
}
|
|
428
|
+
catch {
|
|
429
|
+
// Windows file-busy and friends: keep appending to the current file — rotation is a
|
|
430
|
+
// convenience, not a correctness requirement.
|
|
431
|
+
return false;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
function unlinkCurrentPath(active) {
|
|
435
|
+
try {
|
|
436
|
+
unlinkSync(active.currentPath);
|
|
437
|
+
return true;
|
|
438
|
+
}
|
|
439
|
+
catch {
|
|
440
|
+
// The archive is written, which is the part that matters. This process keeps appending to the
|
|
441
|
+
// still-linked current file, and the next boundary finds the archive present and leaves it be.
|
|
442
|
+
return false;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
function pruneOldFiles(directory, retentionDays) {
|
|
446
|
+
try {
|
|
447
|
+
const entries = readdirSync(directory).filter((name) => /^server-\d{4}-\d{2}-\d{2}\.log$/.test(name));
|
|
448
|
+
if (entries.length <= retentionDays)
|
|
449
|
+
return;
|
|
450
|
+
// Explicit collator, not the default lexicographic sort: the names are ISO-dated, so the
|
|
451
|
+
// ordering decides which files rotation deletes.
|
|
452
|
+
entries.sort((left, right) => left.localeCompare(right, "en-US"));
|
|
453
|
+
for (const stale of entries.slice(0, entries.length - retentionDays)) {
|
|
454
|
+
try {
|
|
455
|
+
unlinkSync(join(directory, stale));
|
|
456
|
+
}
|
|
457
|
+
catch {
|
|
458
|
+
// Best effort; a locked file will be retried on the next rotation.
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
catch {
|
|
463
|
+
// Directory unreadable is not a reason to fail the server; the next write recreates it.
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
// The descriptor is opened `a`, so every write is an atomic O_APPEND write at the current end of
|
|
467
|
+
// file. Inside one process the registry above already gives every sink on a file the same
|
|
468
|
+
// descriptor; O_APPEND is what additionally makes it safe for a SECOND Keiko process sharing the
|
|
469
|
+
// same state directory, which no in-process registry can coordinate. `writeSync` may still report
|
|
470
|
+
// a short write, so loop until the whole line has landed.
|
|
471
|
+
//
|
|
472
|
+
// A descriptor that reports ZERO bytes has stopped accepting them: looping would spin, and simply
|
|
473
|
+
// returning would leave a partial JSON record behind whose bytes then merge with the NEXT record —
|
|
474
|
+
// one stalled line silently costing two, and a reader that splits on newlines losing both. So the
|
|
475
|
+
// stall throws: the caller closes the descriptor, and the line is dropped. A dropped line is the
|
|
476
|
+
// honest outcome; a truncated one is not, because it damages a record that was never in trouble.
|
|
477
|
+
function writeAll(handle, payload) {
|
|
478
|
+
let offset = 0;
|
|
479
|
+
while (offset < payload.length) {
|
|
480
|
+
const written = writeSync(handle, payload, offset, payload.length - offset);
|
|
481
|
+
if (written <= 0)
|
|
482
|
+
throw new Error("activity log descriptor accepted no bytes");
|
|
483
|
+
offset += written;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
// The bytes a stalled write already handed to the kernel cannot be recalled, so the damage is
|
|
487
|
+
// bounded from the other side: the ActiveLog remembers that the file ends mid-record and the next
|
|
488
|
+
// record opens with a newline. That is deterministic — unlike writing a terminator, which asks a
|
|
489
|
+
// descriptor that is refusing bytes to accept one more.
|
|
490
|
+
function writeRecord(active, handle, line) {
|
|
491
|
+
const payload = Buffer.from(active.pendingNewline ? `\n${line}` : line, "utf8");
|
|
492
|
+
// Cleared only once the whole record has landed; a throw from `writeAll` leaves it set.
|
|
493
|
+
active.pendingNewline = true;
|
|
494
|
+
writeAll(handle, payload);
|
|
495
|
+
active.pendingNewline = false;
|
|
496
|
+
}
|
|
497
|
+
// The process-wide registry that makes the file sink a singleton per resolved log directory. Every
|
|
498
|
+
// consumer of the same file shares one descriptor and one rotation state; the threshold stays
|
|
499
|
+
// per-consumer, because that is a caller's own volume control and cannot lose data.
|
|
500
|
+
const activeLogs = new Map();
|
|
501
|
+
function resolveActiveLog(directory, retentionDays) {
|
|
502
|
+
const key = resolvePath(directory);
|
|
503
|
+
const existing = activeLogs.get(key);
|
|
504
|
+
// The first caller's retention wins: a second sink on the same file is the same file, and two
|
|
505
|
+
// retention policies over one directory is not a thing that can be honoured anyway.
|
|
506
|
+
if (existing !== undefined)
|
|
507
|
+
return existing;
|
|
508
|
+
const created = {
|
|
509
|
+
directory,
|
|
510
|
+
currentPath: join(directory, "server.log"),
|
|
511
|
+
retentionDays,
|
|
512
|
+
currentDay: todayUtc(),
|
|
513
|
+
handle: null,
|
|
514
|
+
pendingNewline: false,
|
|
515
|
+
};
|
|
516
|
+
activeLogs.set(key, created);
|
|
517
|
+
return created;
|
|
518
|
+
}
|
|
519
|
+
// Closes every open activity-log descriptor. Called by the server logger's shutdown/reset path,
|
|
520
|
+
// and by tests so a suite does not leave descriptors behind. A subsequent write reopens: closing
|
|
521
|
+
// releases an OS resource, it never disables the log.
|
|
522
|
+
//
|
|
523
|
+
// The registry entries themselves are KEPT. Dropping them would let a sink created after a
|
|
524
|
+
// shutdown build a second ActiveLog over a file some retained sink still writes to — which is the
|
|
525
|
+
// two-rotation-states data loss this registry exists to make impossible.
|
|
526
|
+
export function closeFileServerLogSinks() {
|
|
527
|
+
for (const active of activeLogs.values())
|
|
528
|
+
closeHandle(active);
|
|
529
|
+
}
|
|
530
|
+
export function createFileServerLogSink(stateDir, options = {}) {
|
|
531
|
+
const directory = join(stateDir, "logs");
|
|
532
|
+
try {
|
|
533
|
+
mkdirSync(directory, { recursive: true, mode: 0o700 });
|
|
534
|
+
}
|
|
535
|
+
catch {
|
|
536
|
+
// If we cannot create the directory we return a null sink rather than crashing the
|
|
537
|
+
// server; the caller keeps running and the operator sees a missing file, not a hang.
|
|
538
|
+
return NULL_SINK;
|
|
539
|
+
}
|
|
540
|
+
const active = resolveActiveLog(directory, options.retentionDays ?? DEFAULT_LOG_RETENTION_DAYS);
|
|
541
|
+
const threshold = options.level ?? resolveServerLogThreshold(options.env ?? process.env);
|
|
542
|
+
return createFileSinkFacade(active, threshold);
|
|
543
|
+
}
|
|
544
|
+
// Split out so `createFileServerLogSink` stays inside the 50-line ceiling.
|
|
545
|
+
function createFileSinkFacade(active, threshold) {
|
|
546
|
+
return {
|
|
547
|
+
write(event) {
|
|
548
|
+
// The threshold check comes before any formatting: a filtered event costs one comparison.
|
|
549
|
+
if (!serverLogLevelEnabled(eventLevel(event), threshold))
|
|
550
|
+
return;
|
|
551
|
+
try {
|
|
552
|
+
rotateIfNeeded(active);
|
|
553
|
+
// Claimed as soon as the event clears the gate, before the write is attempted: see
|
|
554
|
+
// `allocateServerLogSeq` for why a dropped write must not roll this number back.
|
|
555
|
+
const seq = allocateServerLogSeq();
|
|
556
|
+
const identity = {
|
|
557
|
+
schemaVersion: SERVER_LOG_SCHEMA_VERSION,
|
|
558
|
+
pid: process.pid,
|
|
559
|
+
instanceId: INSTANCE_ID,
|
|
560
|
+
seq,
|
|
561
|
+
};
|
|
562
|
+
writeRecord(active, ensureHandle(active), formatServerLogLine(event, undefined, identity));
|
|
563
|
+
}
|
|
564
|
+
catch (error) {
|
|
565
|
+
// Writing must never take the server down; a full disk, a permission change or a file
|
|
566
|
+
// removed under us drops the line and forces a reopen on the next write. It does NOT drop
|
|
567
|
+
// the fact that it happened: a log that has stopped working is exactly the condition an
|
|
568
|
+
// operator cannot infer from the absence of lines.
|
|
569
|
+
closeHandle(active);
|
|
570
|
+
reportServerLogFailure(error, { op: event.op, correlationId: event.correlationId });
|
|
571
|
+
}
|
|
572
|
+
},
|
|
573
|
+
flush() {
|
|
574
|
+
// `writeSync` leaves nothing in user space, so a flush is already complete on return.
|
|
575
|
+
},
|
|
576
|
+
close() {
|
|
577
|
+
// The descriptor belongs to the shared ActiveLog, so this releases it for every sink on the
|
|
578
|
+
// file. That is correct for a shutdown path and harmless otherwise: the next write reopens.
|
|
579
|
+
closeHandle(active);
|
|
580
|
+
},
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
// Test-only helper: buffered sink that keeps every event in memory so tests can assert on
|
|
584
|
+
// order and content without touching the filesystem. It captures RAW events and applies no
|
|
585
|
+
// threshold of its own, so a test can tell "the logger filtered this" from "the sink did".
|
|
586
|
+
//
|
|
587
|
+
// "Test-only" is enforced by where it is reachable from, not by the comment: it is exported from
|
|
588
|
+
// this module and from the in-package `observability/` barrel that every keiko-server test imports,
|
|
589
|
+
// and deliberately NOT from the package's public entry point. Nothing outside this package has a
|
|
590
|
+
// use for it, and a packaged export is a promise that has to be kept.
|
|
591
|
+
export function createBufferedServerLogSink() {
|
|
592
|
+
const events = [];
|
|
593
|
+
return {
|
|
594
|
+
events,
|
|
595
|
+
write(event) {
|
|
596
|
+
events.push(event);
|
|
597
|
+
},
|
|
598
|
+
lines() {
|
|
599
|
+
return events.map((event) => formatServerLogLine(event));
|
|
600
|
+
},
|
|
601
|
+
clear() {
|
|
602
|
+
events.length = 0;
|
|
603
|
+
},
|
|
604
|
+
};
|
|
605
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ServerLogLevel, ServerLogThreshold } from "./log-level.js";
|
|
2
|
+
import type { ServerLogCategory, ServerLogSink } from "./server-log.js";
|
|
3
|
+
export type ServerLogContext = Readonly<Record<string, unknown>>;
|
|
4
|
+
export interface ServerLogEventInput {
|
|
5
|
+
readonly category?: ServerLogCategory | undefined;
|
|
6
|
+
readonly op: string;
|
|
7
|
+
readonly correlationId?: string | undefined;
|
|
8
|
+
readonly parentCorrelationId?: string | undefined;
|
|
9
|
+
readonly durationMs?: number | undefined;
|
|
10
|
+
readonly status?: number | undefined;
|
|
11
|
+
readonly errorKind?: string | undefined;
|
|
12
|
+
readonly extra?: Readonly<Record<string, unknown>> | undefined;
|
|
13
|
+
}
|
|
14
|
+
export type ServerLogEventSource = ServerLogEventInput | (() => ServerLogEventInput);
|
|
15
|
+
export interface ServerLogger {
|
|
16
|
+
readonly level: ServerLogThreshold;
|
|
17
|
+
readonly isLevelEnabled: (level: ServerLogLevel) => boolean;
|
|
18
|
+
readonly debug: (source: ServerLogEventSource) => void;
|
|
19
|
+
readonly info: (source: ServerLogEventSource) => void;
|
|
20
|
+
readonly warn: (source: ServerLogEventSource) => void;
|
|
21
|
+
readonly error: (source: ServerLogEventSource) => void;
|
|
22
|
+
readonly log: (level: ServerLogLevel, source: ServerLogEventSource) => void;
|
|
23
|
+
readonly child: (context: ServerLogContext) => ServerLogger;
|
|
24
|
+
}
|
|
25
|
+
export interface ServerLoggerOptions {
|
|
26
|
+
readonly sink: ServerLogSink;
|
|
27
|
+
readonly level?: ServerLogThreshold | undefined;
|
|
28
|
+
readonly context?: ServerLogContext | undefined;
|
|
29
|
+
}
|
|
30
|
+
export declare function createServerLogger(options: ServerLoggerOptions): ServerLogger;
|
|
31
|
+
export declare function nullServerLogger(): ServerLogger;
|
|
32
|
+
export declare function startLogTimer(): () => number;
|
|
33
|
+
export declare function getServerLogger(): ServerLogger;
|
|
34
|
+
export declare function setServerLogger(logger: ServerLogger): void;
|
|
35
|
+
export declare function shutdownServerLogging(): void;
|
|
36
|
+
export declare function resetServerLogger(): void;
|
|
37
|
+
//# sourceMappingURL=server-logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-logger.d.ts","sourceRoot":"","sources":["../../src/observability/server-logger.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAQzE,OAAO,KAAK,EACV,iBAAiB,EAGjB,aAAa,EACd,MAAM,iBAAiB,CAAC;AAKzB,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAIjE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,QAAQ,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAClD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAG5C,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClD,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;CAChE;AAGD,MAAM,MAAM,oBAAoB,GAAG,mBAAmB,GAAG,CAAC,MAAM,mBAAmB,CAAC,CAAC;AAErF,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAC;IACnC,QAAQ,CAAC,cAAc,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,OAAO,CAAC;IAC5D,QAAQ,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACvD,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACtD,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACtD,QAAQ,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACvD,QAAQ,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC5E,QAAQ,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,YAAY,CAAC;CAC7D;AAsFD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAChD,QAAQ,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;CACjD;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,YAAY,CAK7E;AA0DD,wBAAgB,gBAAgB,IAAI,YAAY,CAE/C;AAID,wBAAgB,aAAa,IAAI,MAAM,MAAM,CAG5C;AAqBD,wBAAgB,eAAe,IAAI,YAAY,CAG9C;AAGD,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAE1D;AAOD,wBAAgB,qBAAqB,IAAI,IAAI,CAM5C;AAID,wBAAgB,iBAAiB,IAAI,IAAI,CAExC"}
|