comisai 1.0.11 → 1.0.13

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 (255) hide show
  1. package/node_modules/@comis/agent/dist/model/operation-model-defaults.js +1 -0
  2. package/node_modules/@comis/agent/dist/session/comis-session-manager.js +9 -9
  3. package/node_modules/@comis/agent/package.json +1 -1
  4. package/node_modules/@comis/channels/package.json +1 -1
  5. package/node_modules/@comis/cli/package.json +1 -1
  6. package/node_modules/@comis/core/dist/event-bus/events-infra.d.ts +2 -0
  7. package/node_modules/@comis/core/package.json +1 -1
  8. package/node_modules/@comis/daemon/dist/wiring/setup-channels.js +12 -1
  9. package/node_modules/@comis/daemon/dist/wiring/setup-gateway.js +1 -0
  10. package/node_modules/@comis/daemon/dist/wiring/setup-schedulers.js +1 -0
  11. package/node_modules/@comis/daemon/package.json +1 -1
  12. package/node_modules/@comis/gateway/package.json +1 -1
  13. package/node_modules/@comis/infra/package.json +1 -1
  14. package/node_modules/@comis/memory/package.json +1 -1
  15. package/node_modules/@comis/scheduler/dist/cron/cron-types.d.ts +6 -0
  16. package/node_modules/@comis/scheduler/dist/cron/cron-types.js +2 -0
  17. package/node_modules/@comis/scheduler/package.json +1 -1
  18. package/node_modules/@comis/shared/package.json +1 -1
  19. package/node_modules/@comis/skills/dist/builtin/platform/gateway-tool.d.ts +1 -1
  20. package/node_modules/@comis/skills/package.json +1 -1
  21. package/package.json +18 -18
  22. package/node_modules/@comis/core/dist/approval/approval-gate.test.d.ts +0 -1
  23. package/node_modules/@comis/core/dist/approval/approval-gate.test.js +0 -1003
  24. package/node_modules/@comis/core/dist/bootstrap.test.d.ts +0 -1
  25. package/node_modules/@comis/core/dist/bootstrap.test.js +0 -150
  26. package/node_modules/@comis/core/dist/config/backup.test.d.ts +0 -1
  27. package/node_modules/@comis/core/dist/config/backup.test.js +0 -160
  28. package/node_modules/@comis/core/dist/config/env-substitution.test.d.ts +0 -1
  29. package/node_modules/@comis/core/dist/config/env-substitution.test.js +0 -259
  30. package/node_modules/@comis/core/dist/config/field-metadata.test.d.ts +0 -1
  31. package/node_modules/@comis/core/dist/config/field-metadata.test.js +0 -72
  32. package/node_modules/@comis/core/dist/config/git-manager.test.d.ts +0 -1
  33. package/node_modules/@comis/core/dist/config/git-manager.test.js +0 -1042
  34. package/node_modules/@comis/core/dist/config/immutable-keys.test.d.ts +0 -1
  35. package/node_modules/@comis/core/dist/config/immutable-keys.test.js +0 -283
  36. package/node_modules/@comis/core/dist/config/include-resolver.test.d.ts +0 -1
  37. package/node_modules/@comis/core/dist/config/include-resolver.test.js +0 -292
  38. package/node_modules/@comis/core/dist/config/layered.test.d.ts +0 -1
  39. package/node_modules/@comis/core/dist/config/layered.test.js +0 -211
  40. package/node_modules/@comis/core/dist/config/loader.test.d.ts +0 -1
  41. package/node_modules/@comis/core/dist/config/loader.test.js +0 -300
  42. package/node_modules/@comis/core/dist/config/migrate.test.d.ts +0 -1
  43. package/node_modules/@comis/core/dist/config/migrate.test.js +0 -244
  44. package/node_modules/@comis/core/dist/config/partial-validator.test.d.ts +0 -1
  45. package/node_modules/@comis/core/dist/config/partial-validator.test.js +0 -98
  46. package/node_modules/@comis/core/dist/config/schema-agent-model.test.d.ts +0 -1
  47. package/node_modules/@comis/core/dist/config/schema-agent-model.test.js +0 -279
  48. package/node_modules/@comis/core/dist/config/schema-agent-session.test.d.ts +0 -1
  49. package/node_modules/@comis/core/dist/config/schema-agent-session.test.js +0 -242
  50. package/node_modules/@comis/core/dist/config/schema-agent.test.d.ts +0 -1
  51. package/node_modules/@comis/core/dist/config/schema-agent.test.js +0 -645
  52. package/node_modules/@comis/core/dist/config/schema-channel.test.d.ts +0 -1
  53. package/node_modules/@comis/core/dist/config/schema-channel.test.js +0 -341
  54. package/node_modules/@comis/core/dist/config/schema-coalescer.test.d.ts +0 -1
  55. package/node_modules/@comis/core/dist/config/schema-coalescer.test.js +0 -51
  56. package/node_modules/@comis/core/dist/config/schema-context-engine.test.d.ts +0 -1
  57. package/node_modules/@comis/core/dist/config/schema-context-engine.test.js +0 -797
  58. package/node_modules/@comis/core/dist/config/schema-context-guard.test.d.ts +0 -1
  59. package/node_modules/@comis/core/dist/config/schema-context-guard.test.js +0 -111
  60. package/node_modules/@comis/core/dist/config/schema-daemon.test.d.ts +0 -1
  61. package/node_modules/@comis/core/dist/config/schema-daemon.test.js +0 -107
  62. package/node_modules/@comis/core/dist/config/schema-delivery-timing.test.d.ts +0 -1
  63. package/node_modules/@comis/core/dist/config/schema-delivery-timing.test.js +0 -51
  64. package/node_modules/@comis/core/dist/config/schema-documentation.test.d.ts +0 -1
  65. package/node_modules/@comis/core/dist/config/schema-documentation.test.js +0 -63
  66. package/node_modules/@comis/core/dist/config/schema-gateway.test.d.ts +0 -1
  67. package/node_modules/@comis/core/dist/config/schema-gateway.test.js +0 -219
  68. package/node_modules/@comis/core/dist/config/schema-gemini-cache.test.d.ts +0 -1
  69. package/node_modules/@comis/core/dist/config/schema-gemini-cache.test.js +0 -41
  70. package/node_modules/@comis/core/dist/config/schema-integrations.test.d.ts +0 -1
  71. package/node_modules/@comis/core/dist/config/schema-integrations.test.js +0 -92
  72. package/node_modules/@comis/core/dist/config/schema-lifecycle-reactions.test.d.ts +0 -1
  73. package/node_modules/@comis/core/dist/config/schema-lifecycle-reactions.test.js +0 -61
  74. package/node_modules/@comis/core/dist/config/schema-misc.test.d.ts +0 -1
  75. package/node_modules/@comis/core/dist/config/schema-misc.test.js +0 -394
  76. package/node_modules/@comis/core/dist/config/schema-observability.test.d.ts +0 -1
  77. package/node_modules/@comis/core/dist/config/schema-observability.test.js +0 -76
  78. package/node_modules/@comis/core/dist/config/schema-providers.test.d.ts +0 -1
  79. package/node_modules/@comis/core/dist/config/schema-providers.test.js +0 -294
  80. package/node_modules/@comis/core/dist/config/schema-queue.test.d.ts +0 -1
  81. package/node_modules/@comis/core/dist/config/schema-queue.test.js +0 -234
  82. package/node_modules/@comis/core/dist/config/schema-response-prefix.test.d.ts +0 -1
  83. package/node_modules/@comis/core/dist/config/schema-response-prefix.test.js +0 -36
  84. package/node_modules/@comis/core/dist/config/schema-security.test.d.ts +0 -1
  85. package/node_modules/@comis/core/dist/config/schema-security.test.js +0 -54
  86. package/node_modules/@comis/core/dist/config/schema-sender-trust-display.test.d.ts +0 -1
  87. package/node_modules/@comis/core/dist/config/schema-sender-trust-display.test.js +0 -60
  88. package/node_modules/@comis/core/dist/config/schema-serializer.test.d.ts +0 -1
  89. package/node_modules/@comis/core/dist/config/schema-serializer.test.js +0 -73
  90. package/node_modules/@comis/core/dist/config/schema-telegram-file-guard.test.d.ts +0 -1
  91. package/node_modules/@comis/core/dist/config/schema-telegram-file-guard.test.js +0 -39
  92. package/node_modules/@comis/core/dist/context/context.test.d.ts +0 -1
  93. package/node_modules/@comis/core/dist/context/context.test.js +0 -276
  94. package/node_modules/@comis/core/dist/domain/agent-response.test.d.ts +0 -1
  95. package/node_modules/@comis/core/dist/domain/agent-response.test.js +0 -159
  96. package/node_modules/@comis/core/dist/domain/credential-mapping.test.d.ts +0 -1
  97. package/node_modules/@comis/core/dist/domain/credential-mapping.test.js +0 -135
  98. package/node_modules/@comis/core/dist/domain/delivery-origin.test.d.ts +0 -1
  99. package/node_modules/@comis/core/dist/domain/delivery-origin.test.js +0 -68
  100. package/node_modules/@comis/core/dist/domain/execution-graph.test.d.ts +0 -1
  101. package/node_modules/@comis/core/dist/domain/execution-graph.test.js +0 -441
  102. package/node_modules/@comis/core/dist/domain/memory-entry.test.d.ts +0 -1
  103. package/node_modules/@comis/core/dist/domain/memory-entry.test.js +0 -193
  104. package/node_modules/@comis/core/dist/domain/normalized-message.test.d.ts +0 -1
  105. package/node_modules/@comis/core/dist/domain/normalized-message.test.js +0 -255
  106. package/node_modules/@comis/core/dist/domain/session-key.test.d.ts +0 -1
  107. package/node_modules/@comis/core/dist/domain/session-key.test.js +0 -291
  108. package/node_modules/@comis/core/dist/domain/subagent-context-config.test.d.ts +0 -1
  109. package/node_modules/@comis/core/dist/domain/subagent-context-config.test.js +0 -131
  110. package/node_modules/@comis/core/dist/domain/subagent-context-types.test.d.ts +0 -1
  111. package/node_modules/@comis/core/dist/domain/subagent-context-types.test.js +0 -182
  112. package/node_modules/@comis/core/dist/event-bus/bus.test.d.ts +0 -1
  113. package/node_modules/@comis/core/dist/event-bus/bus.test.js +0 -152
  114. package/node_modules/@comis/core/dist/event-bus/events-agent.test.d.ts +0 -1
  115. package/node_modules/@comis/core/dist/event-bus/events-agent.test.js +0 -409
  116. package/node_modules/@comis/core/dist/event-bus/events-channel.test.d.ts +0 -1
  117. package/node_modules/@comis/core/dist/event-bus/events-channel.test.js +0 -240
  118. package/node_modules/@comis/core/dist/event-bus/events-infra.test.d.ts +0 -1
  119. package/node_modules/@comis/core/dist/event-bus/events-infra.test.js +0 -416
  120. package/node_modules/@comis/core/dist/event-bus/events-messaging.test.d.ts +0 -1
  121. package/node_modules/@comis/core/dist/event-bus/events-messaging.test.js +0 -433
  122. package/node_modules/@comis/core/dist/event-bus/events.test.d.ts +0 -1
  123. package/node_modules/@comis/core/dist/event-bus/events.test.js +0 -93
  124. package/node_modules/@comis/core/dist/hooks/hook-runner-global.test.d.ts +0 -1
  125. package/node_modules/@comis/core/dist/hooks/hook-runner-global.test.js +0 -29
  126. package/node_modules/@comis/core/dist/hooks/hook-runner.test.d.ts +0 -1
  127. package/node_modules/@comis/core/dist/hooks/hook-runner.test.js +0 -490
  128. package/node_modules/@comis/core/dist/hooks/hook-strategies.test.d.ts +0 -1
  129. package/node_modules/@comis/core/dist/hooks/hook-strategies.test.js +0 -209
  130. package/node_modules/@comis/core/dist/hooks/integration.test.d.ts +0 -1
  131. package/node_modules/@comis/core/dist/hooks/integration.test.js +0 -235
  132. package/node_modules/@comis/core/dist/hooks/plugin-registry.test.d.ts +0 -1
  133. package/node_modules/@comis/core/dist/hooks/plugin-registry.test.js +0 -470
  134. package/node_modules/@comis/core/dist/load-env.test.d.ts +0 -1
  135. package/node_modules/@comis/core/dist/load-env.test.js +0 -21
  136. package/node_modules/@comis/core/dist/security/action-classifier.test.d.ts +0 -1
  137. package/node_modules/@comis/core/dist/security/action-classifier.test.js +0 -298
  138. package/node_modules/@comis/core/dist/security/audit-aggregator.test.d.ts +0 -1
  139. package/node_modules/@comis/core/dist/security/audit-aggregator.test.js +0 -128
  140. package/node_modules/@comis/core/dist/security/audit.test.d.ts +0 -1
  141. package/node_modules/@comis/core/dist/security/audit.test.js +0 -154
  142. package/node_modules/@comis/core/dist/security/canary-token.test.d.ts +0 -1
  143. package/node_modules/@comis/core/dist/security/canary-token.test.js +0 -45
  144. package/node_modules/@comis/core/dist/security/config-redaction.test.d.ts +0 -1
  145. package/node_modules/@comis/core/dist/security/config-redaction.test.js +0 -107
  146. package/node_modules/@comis/core/dist/security/external-content.test.d.ts +0 -1
  147. package/node_modules/@comis/core/dist/security/external-content.test.js +0 -210
  148. package/node_modules/@comis/core/dist/security/injection-patterns.test.d.ts +0 -1
  149. package/node_modules/@comis/core/dist/security/injection-patterns.test.js +0 -213
  150. package/node_modules/@comis/core/dist/security/injection-rate-limiter.test.d.ts +0 -1
  151. package/node_modules/@comis/core/dist/security/injection-rate-limiter.test.js +0 -194
  152. package/node_modules/@comis/core/dist/security/input-guard.test.d.ts +0 -1
  153. package/node_modules/@comis/core/dist/security/input-guard.test.js +0 -215
  154. package/node_modules/@comis/core/dist/security/input-security-guard.test.d.ts +0 -1
  155. package/node_modules/@comis/core/dist/security/input-security-guard.test.js +0 -215
  156. package/node_modules/@comis/core/dist/security/input-validator.test.d.ts +0 -1
  157. package/node_modules/@comis/core/dist/security/input-validator.test.js +0 -133
  158. package/node_modules/@comis/core/dist/security/log-sanitizer.test.d.ts +0 -1
  159. package/node_modules/@comis/core/dist/security/log-sanitizer.test.js +0 -260
  160. package/node_modules/@comis/core/dist/security/memory-write-validator.test.d.ts +0 -1
  161. package/node_modules/@comis/core/dist/security/memory-write-validator.test.js +0 -62
  162. package/node_modules/@comis/core/dist/security/output-guard.test.d.ts +0 -1
  163. package/node_modules/@comis/core/dist/security/output-guard.test.js +0 -397
  164. package/node_modules/@comis/core/dist/security/safe-path.test.d.ts +0 -1
  165. package/node_modules/@comis/core/dist/security/safe-path.test.js +0 -95
  166. package/node_modules/@comis/core/dist/security/scoped-secret-manager.test.d.ts +0 -1
  167. package/node_modules/@comis/core/dist/security/scoped-secret-manager.test.js +0 -231
  168. package/node_modules/@comis/core/dist/security/secret-access.test.d.ts +0 -1
  169. package/node_modules/@comis/core/dist/security/secret-access.test.js +0 -41
  170. package/node_modules/@comis/core/dist/security/secret-crypto.test.d.ts +0 -1
  171. package/node_modules/@comis/core/dist/security/secret-crypto.test.js +0 -113
  172. package/node_modules/@comis/core/dist/security/secret-manager.test.d.ts +0 -1
  173. package/node_modules/@comis/core/dist/security/secret-manager.test.js +0 -394
  174. package/node_modules/@comis/core/dist/security/secret-ref-resolver.test.d.ts +0 -1
  175. package/node_modules/@comis/core/dist/security/secret-ref-resolver.test.js +0 -268
  176. package/node_modules/@comis/core/dist/security/secrets-audit.test.d.ts +0 -10
  177. package/node_modules/@comis/core/dist/security/secrets-audit.test.js +0 -295
  178. package/node_modules/@comis/core/dist/security/ssrf-guard.test.d.ts +0 -1
  179. package/node_modules/@comis/core/dist/security/ssrf-guard.test.js +0 -127
  180. package/node_modules/@comis/core/dist/security/token-generator.test.d.ts +0 -1
  181. package/node_modules/@comis/core/dist/security/token-generator.test.js +0 -35
  182. package/node_modules/@comis/core/dist/tool-metadata.test.d.ts +0 -1
  183. package/node_modules/@comis/core/dist/tool-metadata.test.js +0 -112
  184. package/node_modules/@comis/memory/dist/compaction.test.d.ts +0 -1
  185. package/node_modules/@comis/memory/dist/compaction.test.js +0 -298
  186. package/node_modules/@comis/memory/dist/context-schema.test.d.ts +0 -1
  187. package/node_modules/@comis/memory/dist/context-schema.test.js +0 -246
  188. package/node_modules/@comis/memory/dist/context-store.test.d.ts +0 -1
  189. package/node_modules/@comis/memory/dist/context-store.test.js +0 -708
  190. package/node_modules/@comis/memory/dist/credential-mapping-schema.test.d.ts +0 -7
  191. package/node_modules/@comis/memory/dist/credential-mapping-schema.test.js +0 -73
  192. package/node_modules/@comis/memory/dist/credential-mapping-store.test.d.ts +0 -8
  193. package/node_modules/@comis/memory/dist/credential-mapping-store.test.js +0 -340
  194. package/node_modules/@comis/memory/dist/delivery-mirror-adapter.test.d.ts +0 -1
  195. package/node_modules/@comis/memory/dist/delivery-mirror-adapter.test.js +0 -165
  196. package/node_modules/@comis/memory/dist/delivery-queue-adapter.test.d.ts +0 -1
  197. package/node_modules/@comis/memory/dist/delivery-queue-adapter.test.js +0 -263
  198. package/node_modules/@comis/memory/dist/embedding-batch-indexer.test.d.ts +0 -1
  199. package/node_modules/@comis/memory/dist/embedding-batch-indexer.test.js +0 -202
  200. package/node_modules/@comis/memory/dist/embedding-cache-lru.test.d.ts +0 -1
  201. package/node_modules/@comis/memory/dist/embedding-cache-lru.test.js +0 -241
  202. package/node_modules/@comis/memory/dist/embedding-cache-sqlite.test.d.ts +0 -8
  203. package/node_modules/@comis/memory/dist/embedding-cache-sqlite.test.js +0 -678
  204. package/node_modules/@comis/memory/dist/embedding-cache.test.d.ts +0 -1
  205. package/node_modules/@comis/memory/dist/embedding-cache.test.js +0 -213
  206. package/node_modules/@comis/memory/dist/embedding-fingerprint.test.d.ts +0 -1
  207. package/node_modules/@comis/memory/dist/embedding-fingerprint.test.js +0 -87
  208. package/node_modules/@comis/memory/dist/embedding-hash.test.d.ts +0 -1
  209. package/node_modules/@comis/memory/dist/embedding-hash.test.js +0 -31
  210. package/node_modules/@comis/memory/dist/embedding-integration.test.d.ts +0 -8
  211. package/node_modules/@comis/memory/dist/embedding-integration.test.js +0 -232
  212. package/node_modules/@comis/memory/dist/embedding-provider-factory.test.d.ts +0 -1
  213. package/node_modules/@comis/memory/dist/embedding-provider-factory.test.js +0 -176
  214. package/node_modules/@comis/memory/dist/embedding-provider-local.test.d.ts +0 -8
  215. package/node_modules/@comis/memory/dist/embedding-provider-local.test.js +0 -76
  216. package/node_modules/@comis/memory/dist/embedding-provider-openai.test.d.ts +0 -8
  217. package/node_modules/@comis/memory/dist/embedding-provider-openai.test.js +0 -100
  218. package/node_modules/@comis/memory/dist/embedding-queue.test.d.ts +0 -1
  219. package/node_modules/@comis/memory/dist/embedding-queue.test.js +0 -236
  220. package/node_modules/@comis/memory/dist/hybrid-search.test.d.ts +0 -1
  221. package/node_modules/@comis/memory/dist/hybrid-search.test.js +0 -476
  222. package/node_modules/@comis/memory/dist/identity-link-store.test.d.ts +0 -1
  223. package/node_modules/@comis/memory/dist/identity-link-store.test.js +0 -88
  224. package/node_modules/@comis/memory/dist/memory-api.test.d.ts +0 -1
  225. package/node_modules/@comis/memory/dist/memory-api.test.js +0 -495
  226. package/node_modules/@comis/memory/dist/memory-concurrency.test.d.ts +0 -20
  227. package/node_modules/@comis/memory/dist/memory-concurrency.test.js +0 -222
  228. package/node_modules/@comis/memory/dist/named-graph-store.test.d.ts +0 -1
  229. package/node_modules/@comis/memory/dist/named-graph-store.test.js +0 -227
  230. package/node_modules/@comis/memory/dist/observability-store.test.d.ts +0 -1
  231. package/node_modules/@comis/memory/dist/observability-store.test.js +0 -704
  232. package/node_modules/@comis/memory/dist/row-mapper.test.d.ts +0 -1
  233. package/node_modules/@comis/memory/dist/row-mapper.test.js +0 -409
  234. package/node_modules/@comis/memory/dist/schema.test.d.ts +0 -1
  235. package/node_modules/@comis/memory/dist/schema.test.js +0 -240
  236. package/node_modules/@comis/memory/dist/secret-store-schema.test.d.ts +0 -7
  237. package/node_modules/@comis/memory/dist/secret-store-schema.test.js +0 -90
  238. package/node_modules/@comis/memory/dist/session-store.test.d.ts +0 -1
  239. package/node_modules/@comis/memory/dist/session-store.test.js +0 -262
  240. package/node_modules/@comis/memory/dist/setup-secrets.test.d.ts +0 -1
  241. package/node_modules/@comis/memory/dist/setup-secrets.test.js +0 -140
  242. package/node_modules/@comis/memory/dist/sqlite-memory-adapter.test.d.ts +0 -1
  243. package/node_modules/@comis/memory/dist/sqlite-memory-adapter.test.js +0 -888
  244. package/node_modules/@comis/memory/dist/sqlite-secret-store.test.d.ts +0 -8
  245. package/node_modules/@comis/memory/dist/sqlite-secret-store.test.js +0 -245
  246. package/node_modules/@comis/shared/dist/abort.test.d.ts +0 -1
  247. package/node_modules/@comis/shared/dist/abort.test.js +0 -71
  248. package/node_modules/@comis/shared/dist/result.test.d.ts +0 -1
  249. package/node_modules/@comis/shared/dist/result.test.js +0 -178
  250. package/node_modules/@comis/shared/dist/suppress-error.test.d.ts +0 -1
  251. package/node_modules/@comis/shared/dist/suppress-error.test.js +0 -50
  252. package/node_modules/@comis/shared/dist/timeout.test.d.ts +0 -1
  253. package/node_modules/@comis/shared/dist/timeout.test.js +0 -75
  254. package/node_modules/@comis/shared/dist/ttl-cache.test.d.ts +0 -1
  255. package/node_modules/@comis/shared/dist/ttl-cache.test.js +0 -81
@@ -1 +0,0 @@
1
- export {};
@@ -1,150 +0,0 @@
1
- import * as fs from "node:fs";
2
- import * as os from "node:os";
3
- import * as path from "node:path";
4
- import { describe, it, expect, afterEach } from "vitest";
5
- import { bootstrap } from "./bootstrap.js";
6
- describe("bootstrap", () => {
7
- const tmpDirs = [];
8
- const containers = [];
9
- function makeTmpDir() {
10
- const dir = fs.mkdtempSync(path.join(os.tmpdir(), "comis-bootstrap-"));
11
- tmpDirs.push(dir);
12
- return dir;
13
- }
14
- function writeYaml(dir, name, content) {
15
- const filePath = path.join(dir, name);
16
- fs.writeFileSync(filePath, content, "utf-8");
17
- return filePath;
18
- }
19
- afterEach(async () => {
20
- for (const container of containers) {
21
- await container.shutdown();
22
- }
23
- containers.length = 0;
24
- for (const dir of tmpDirs) {
25
- fs.rmSync(dir, { recursive: true, force: true });
26
- }
27
- tmpDirs.length = 0;
28
- });
29
- it("returns ok with AppContainer for valid config", () => {
30
- const dir = makeTmpDir();
31
- const configPath = writeYaml(dir, "config.yaml", "tenantId: test\nlogLevel: debug\n");
32
- const result = bootstrap({
33
- configPaths: [configPath],
34
- env: { API_KEY: "secret123" },
35
- });
36
- expect(result.ok).toBe(true);
37
- if (result.ok) {
38
- containers.push(result.value);
39
- expect(result.value.config).toBeDefined();
40
- expect(result.value.config.tenantId).toBe("test");
41
- expect(result.value.config.logLevel).toBe("debug");
42
- }
43
- });
44
- it("returns err for invalid config", () => {
45
- const dir = makeTmpDir();
46
- const configPath = writeYaml(dir, "bad.yaml", "logLevel: invalid_level\n");
47
- const result = bootstrap({
48
- configPaths: [configPath],
49
- env: {},
50
- });
51
- expect(result.ok).toBe(false);
52
- if (!result.ok) {
53
- expect(result.error.code).toBe("VALIDATION_ERROR");
54
- }
55
- });
56
- it("returns err for missing config file", () => {
57
- const result = bootstrap({
58
- configPaths: ["/does/not/exist.yaml"],
59
- env: {},
60
- });
61
- expect(result.ok).toBe(false);
62
- if (!result.ok) {
63
- expect(result.error.code).toBe("FILE_NOT_FOUND");
64
- }
65
- });
66
- it("container.config returns loaded config", () => {
67
- const dir = makeTmpDir();
68
- const configPath = writeYaml(dir, "config.yaml", "tenantId: my-tenant\n");
69
- const result = bootstrap({ configPaths: [configPath], env: {} });
70
- expect(result.ok).toBe(true);
71
- if (result.ok) {
72
- containers.push(result.value);
73
- expect(result.value.config.tenantId).toBe("my-tenant");
74
- expect(result.value.config.agents.default.name).toBe("Comis");
75
- }
76
- });
77
- it("container.eventBus is a TypedEventBus", () => {
78
- const dir = makeTmpDir();
79
- const configPath = writeYaml(dir, "config.yaml", "tenantId: evtest\n");
80
- const result = bootstrap({ configPaths: [configPath], env: {} });
81
- expect(result.ok).toBe(true);
82
- if (result.ok) {
83
- containers.push(result.value);
84
- // Verify it has TypedEventBus methods
85
- expect(typeof result.value.eventBus.on).toBe("function");
86
- expect(typeof result.value.eventBus.emit).toBe("function");
87
- expect(typeof result.value.eventBus.off).toBe("function");
88
- }
89
- });
90
- it("container.secretManager works with provided env", () => {
91
- const dir = makeTmpDir();
92
- const configPath = writeYaml(dir, "config.yaml", "tenantId: sectest\n");
93
- const result = bootstrap({
94
- configPaths: [configPath],
95
- env: { MY_SECRET: "s3cr3t", OTHER: "val" },
96
- });
97
- expect(result.ok).toBe(true);
98
- if (result.ok) {
99
- containers.push(result.value);
100
- expect(result.value.secretManager.get("MY_SECRET")).toBe("s3cr3t");
101
- expect(result.value.secretManager.has("OTHER")).toBe(true);
102
- expect(result.value.secretManager.get("MISSING")).toBeUndefined();
103
- }
104
- });
105
- it("container.shutdown cleans up without errors", async () => {
106
- const dir = makeTmpDir();
107
- const configPath = writeYaml(dir, "config.yaml", "tenantId: shuttest\n");
108
- const result = bootstrap({
109
- configPaths: [configPath],
110
- env: {},
111
- });
112
- expect(result.ok).toBe(true);
113
- if (result.ok) {
114
- // Shutdown should not throw
115
- await expect(result.value.shutdown()).resolves.toBeUndefined();
116
- // Double shutdown should also be safe
117
- await expect(result.value.shutdown()).resolves.toBeUndefined();
118
- }
119
- });
120
- it("applies defaults from minimal config content", () => {
121
- const dir = makeTmpDir();
122
- // Minimal config: empty object
123
- const configPath = writeYaml(dir, "minimal.yaml", "{}\n");
124
- const result = bootstrap({ configPaths: [configPath], env: {} });
125
- expect(result.ok).toBe(true);
126
- if (result.ok) {
127
- containers.push(result.value);
128
- const cfg = result.value.config;
129
- expect(cfg.tenantId).toBe("default");
130
- expect(cfg.logLevel).toBe("info");
131
- expect(cfg.dataDir).toBe(path.join(os.homedir(), ".comis"));
132
- expect(cfg.agents.default.name).toBe("Comis");
133
- expect(cfg.agents.default.maxSteps).toBe(150);
134
- expect(cfg.memory.walMode).toBe(true);
135
- expect(cfg.security.logRedaction).toBe(true);
136
- }
137
- });
138
- it("merges layered config files", () => {
139
- const dir = makeTmpDir();
140
- const base = writeYaml(dir, "base.yaml", "tenantId: base\nagents:\n default:\n name: BaseBot\n");
141
- const local = writeYaml(dir, "local.yaml", "tenantId: local\n");
142
- const result = bootstrap({ configPaths: [base, local], env: {} });
143
- expect(result.ok).toBe(true);
144
- if (result.ok) {
145
- containers.push(result.value);
146
- expect(result.value.config.tenantId).toBe("local");
147
- expect(result.value.config.agents.default.name).toBe("BaseBot");
148
- }
149
- });
150
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,160 +0,0 @@
1
- import { describe, it, expect } from "vitest";
2
- import { ok, err } from "@comis/shared";
3
- import { createTimestampedBackup } from "./backup.js";
4
- /**
5
- * Helper to build mock BackupDeps with a virtual filesystem.
6
- */
7
- function createMockDeps(files, opts) {
8
- const removed = [];
9
- return {
10
- removed,
11
- copyFile(src, dest) {
12
- if (opts?.copyFail) {
13
- return err({
14
- code: "BACKUP_ERROR",
15
- message: `Permission denied: ${dest}`,
16
- });
17
- }
18
- files.add(dest);
19
- return ok(undefined);
20
- },
21
- listDir(dirPath) {
22
- if (opts?.listDirFail) {
23
- return err({
24
- code: "BACKUP_ERROR",
25
- message: `Cannot list directory: ${dirPath}`,
26
- });
27
- }
28
- const contents = opts?.dirContents ?? [...files].map((f) => {
29
- const parts = f.split("/");
30
- return parts[parts.length - 1];
31
- });
32
- return ok(contents);
33
- },
34
- removeFile(filePath) {
35
- if (opts?.removeFail) {
36
- return err({
37
- code: "BACKUP_ERROR",
38
- message: `Cannot remove: ${filePath}`,
39
- });
40
- }
41
- removed.push(filePath);
42
- files.delete(filePath);
43
- return ok(undefined);
44
- },
45
- fileExists(filePath) {
46
- return files.has(filePath);
47
- },
48
- now() {
49
- return new Date("2026-02-12T14:30:00Z");
50
- },
51
- };
52
- }
53
- describe("config/backup", () => {
54
- describe("createTimestampedBackup", () => {
55
- it("copies source file to backup path with ISO timestamp", () => {
56
- const files = new Set(["/config/app.yaml"]);
57
- const deps = createMockDeps(files);
58
- const result = createTimestampedBackup("/config/app.yaml", deps);
59
- expect(result.ok).toBe(true);
60
- if (result.ok) {
61
- expect(result.value).toBe("/config/app.yaml.backup.20260212T143000Z");
62
- expect(files.has("/config/app.yaml.backup.20260212T143000Z")).toBe(true);
63
- }
64
- });
65
- it("uses compact ISO format without colons (filesystem-safe)", () => {
66
- const files = new Set(["/config/app.yaml"]);
67
- const deps = createMockDeps(files);
68
- const result = createTimestampedBackup("/config/app.yaml", deps);
69
- expect(result.ok).toBe(true);
70
- if (result.ok) {
71
- // No colons, dashes only in date part
72
- expect(result.value).toMatch(/\.backup\.\d{8}T\d{6}Z$/);
73
- }
74
- });
75
- it("returns Result with the backup file path on success", () => {
76
- const files = new Set(["/config/app.yaml"]);
77
- const deps = createMockDeps(files);
78
- const result = createTimestampedBackup("/config/app.yaml", deps);
79
- expect(result.ok).toBe(true);
80
- if (result.ok) {
81
- expect(typeof result.value).toBe("string");
82
- expect(result.value).toContain("app.yaml.backup.");
83
- }
84
- });
85
- it("returns ConfigError when source file does not exist", () => {
86
- const files = new Set();
87
- const deps = createMockDeps(files);
88
- const result = createTimestampedBackup("/config/missing.yaml", deps);
89
- expect(result.ok).toBe(false);
90
- if (!result.ok) {
91
- expect(result.error.code).toBe("BACKUP_ERROR");
92
- expect(result.error.message).toContain("missing.yaml");
93
- }
94
- });
95
- it("returns ConfigError when copy fails (e.g., permissions)", () => {
96
- const files = new Set(["/config/app.yaml"]);
97
- const deps = createMockDeps(files, { copyFail: true });
98
- const result = createTimestampedBackup("/config/app.yaml", deps);
99
- expect(result.ok).toBe(false);
100
- if (!result.ok) {
101
- expect(result.error.code).toBe("BACKUP_ERROR");
102
- expect(result.error.message).toContain("Permission denied");
103
- }
104
- });
105
- it("deletes oldest backups when count exceeds maxBackups (default 10)", () => {
106
- const files = new Set(["/config/app.yaml"]);
107
- // Simulate 10 existing backups + the new one that will be created
108
- const dirContents = [];
109
- for (let i = 0; i < 10; i++) {
110
- const ts = `202602${String(i + 1).padStart(2, "0")}T120000Z`;
111
- dirContents.push(`app.yaml.backup.${ts}`);
112
- }
113
- // The new backup created by the function (injected clock = 2026-02-12T14:30:00Z)
114
- dirContents.push("app.yaml.backup.20260212T143000Z");
115
- const deps = createMockDeps(files, { dirContents });
116
- const result = createTimestampedBackup("/config/app.yaml", deps);
117
- expect(result.ok).toBe(true);
118
- // 10 existing + 1 new = 11, should prune oldest 1
119
- expect(deps.removed.length).toBe(1);
120
- expect(deps.removed[0]).toContain("app.yaml.backup.20260201T120000Z");
121
- });
122
- it("only deletes files matching the backup naming pattern", () => {
123
- const files = new Set(["/config/app.yaml"]);
124
- const dirContents = [
125
- "app.yaml.backup.20260201T120000Z",
126
- "app.yaml.backup.20260202T120000Z",
127
- "app.yaml", // Not a backup file
128
- "other-file.txt", // Not a backup file
129
- "app.yaml.backup.20260203T120000Z",
130
- "app.yaml.backup.20260212T143000Z", // New backup from this call
131
- ];
132
- // 3 existing + 1 new = 4 backups, well under default 10
133
- const deps = createMockDeps(files, { dirContents });
134
- const result = createTimestampedBackup("/config/app.yaml", deps);
135
- expect(result.ok).toBe(true);
136
- // No backups should be deleted (only 4 backups, well under 10)
137
- expect(deps.removed.length).toBe(0);
138
- });
139
- it("maxBackups is configurable via options parameter", () => {
140
- const files = new Set(["/config/app.yaml"]);
141
- const dirContents = [];
142
- for (let i = 0; i < 5; i++) {
143
- const ts = `202602${String(i + 1).padStart(2, "0")}T120000Z`;
144
- dirContents.push(`app.yaml.backup.${ts}`);
145
- }
146
- // The new backup created by the function (injected clock = 2026-02-12T14:30:00Z)
147
- dirContents.push("app.yaml.backup.20260212T143000Z");
148
- const deps = createMockDeps(files, { dirContents });
149
- const result = createTimestampedBackup("/config/app.yaml", deps, {
150
- maxBackups: 3,
151
- });
152
- expect(result.ok).toBe(true);
153
- // 5 existing + 1 new = 6, maxBackups=3 → prune 3 oldest
154
- expect(deps.removed.length).toBe(3);
155
- expect(deps.removed[0]).toContain("20260201T120000Z");
156
- expect(deps.removed[1]).toContain("20260202T120000Z");
157
- expect(deps.removed[2]).toContain("20260203T120000Z");
158
- });
159
- });
160
- });
@@ -1,259 +0,0 @@
1
- import { describe, it, expect } from "vitest";
2
- import { substituteEnvVars, warnSuspiciousEnvValues } from "./env-substitution.js";
3
- /**
4
- * Helper: create a simple secret getter from a map.
5
- */
6
- function createSecretGetter(secrets) {
7
- return (key) => secrets[key];
8
- }
9
- describe("config/env-substitution", () => {
10
- describe("substituteEnvVars", () => {
11
- it("replaces simple ${VAR_NAME} with secret value", () => {
12
- const getSecret = createSecretGetter({ API_KEY: "sk-12345" });
13
- const obj = { apiKey: "${API_KEY}" };
14
- const result = substituteEnvVars(obj, getSecret);
15
- expect(result.ok).toBe(true);
16
- if (result.ok) {
17
- const val = result.value;
18
- expect(val.apiKey).toBe("sk-12345");
19
- }
20
- });
21
- it("replaces multiple ${VAR} references in one string", () => {
22
- const getSecret = createSecretGetter({
23
- HOST: "localhost",
24
- PORT: "3000",
25
- });
26
- const obj = { url: "${HOST}:${PORT}" };
27
- const result = substituteEnvVars(obj, getSecret);
28
- expect(result.ok).toBe(true);
29
- if (result.ok) {
30
- const val = result.value;
31
- expect(val.url).toBe("localhost:3000");
32
- }
33
- });
34
- it("handles mixed literal and ${VAR} text", () => {
35
- const getSecret = createSecretGetter({
36
- HOST: "api.example.com",
37
- PORT: "8443",
38
- });
39
- const obj = { endpoint: "https://${HOST}:${PORT}/api" };
40
- const result = substituteEnvVars(obj, getSecret);
41
- expect(result.ok).toBe(true);
42
- if (result.ok) {
43
- const val = result.value;
44
- expect(val.endpoint).toBe("https://api.example.com:8443/api");
45
- }
46
- });
47
- it("treats $${VAR} escape syntax as literal ${VAR} (no substitution)", () => {
48
- const getSecret = createSecretGetter({ VAR: "should-not-appear" });
49
- const obj = { literal: "$${VAR}" };
50
- const result = substituteEnvVars(obj, getSecret);
51
- expect(result.ok).toBe(true);
52
- if (result.ok) {
53
- const val = result.value;
54
- expect(val.literal).toBe("${VAR}");
55
- }
56
- });
57
- it("returns ENV_VAR_ERROR for missing variable", () => {
58
- const getSecret = createSecretGetter({});
59
- const obj = { missing: "${UNDEFINED_VAR}" };
60
- const result = substituteEnvVars(obj, getSecret, "config.yaml");
61
- expect(result.ok).toBe(false);
62
- if (!result.ok) {
63
- expect(result.error.code).toBe("ENV_VAR_ERROR");
64
- expect(result.error.message).toContain("UNDEFINED_VAR");
65
- expect(result.error.message).toContain("config.yaml");
66
- }
67
- });
68
- it("leaves non-string values untouched (numbers, booleans)", () => {
69
- const getSecret = createSecretGetter({});
70
- const obj = {
71
- count: 42,
72
- enabled: true,
73
- ratio: 3.14,
74
- nothing: null,
75
- };
76
- const result = substituteEnvVars(obj, getSecret);
77
- expect(result.ok).toBe(true);
78
- if (result.ok) {
79
- const val = result.value;
80
- expect(val.count).toBe(42);
81
- expect(val.enabled).toBe(true);
82
- expect(val.ratio).toBe(3.14);
83
- expect(val.nothing).toBe(null);
84
- }
85
- });
86
- it("recursively substitutes nested objects", () => {
87
- const getSecret = createSecretGetter({
88
- DB_HOST: "db.example.com",
89
- DB_PORT: "5432",
90
- DB_NAME: "comis",
91
- });
92
- const obj = {
93
- database: {
94
- host: "${DB_HOST}",
95
- port: "${DB_PORT}",
96
- connection: {
97
- name: "${DB_NAME}",
98
- },
99
- },
100
- };
101
- const result = substituteEnvVars(obj, getSecret);
102
- expect(result.ok).toBe(true);
103
- if (result.ok) {
104
- const val = result.value;
105
- const db = val.database;
106
- expect(db.host).toBe("db.example.com");
107
- expect(db.port).toBe("5432");
108
- const conn = db.connection;
109
- expect(conn.name).toBe("comis");
110
- }
111
- });
112
- it("substitutes string elements in arrays", () => {
113
- const getSecret = createSecretGetter({
114
- HOST1: "a.example.com",
115
- HOST2: "b.example.com",
116
- });
117
- const obj = {
118
- hosts: ["${HOST1}", "${HOST2}", "static.example.com"],
119
- };
120
- const result = substituteEnvVars(obj, getSecret);
121
- expect(result.ok).toBe(true);
122
- if (result.ok) {
123
- const val = result.value;
124
- expect(val.hosts).toEqual([
125
- "a.example.com",
126
- "b.example.com",
127
- "static.example.com",
128
- ]);
129
- }
130
- });
131
- it("preserves empty string when VAR resolves to empty string", () => {
132
- const getSecret = createSecretGetter({ EMPTY: "" });
133
- const obj = { value: "${EMPTY}" };
134
- const result = substituteEnvVars(obj, getSecret);
135
- expect(result.ok).toBe(true);
136
- if (result.ok) {
137
- const val = result.value;
138
- expect(val.value).toBe("");
139
- }
140
- });
141
- it("does not mutate the input object", () => {
142
- const getSecret = createSecretGetter({ VAR: "replaced" });
143
- const obj = { key: "${VAR}", nested: { inner: "${VAR}" } };
144
- const originalJson = JSON.stringify(obj);
145
- substituteEnvVars(obj, getSecret);
146
- expect(JSON.stringify(obj)).toBe(originalJson);
147
- });
148
- it("handles strings with no variable references", () => {
149
- const getSecret = createSecretGetter({});
150
- const obj = { plain: "no variables here" };
151
- const result = substituteEnvVars(obj, getSecret);
152
- expect(result.ok).toBe(true);
153
- if (result.ok) {
154
- const val = result.value;
155
- expect(val.plain).toBe("no variables here");
156
- }
157
- });
158
- it("handles mixed escape and substitution in same string", () => {
159
- const getSecret = createSecretGetter({ PORT: "3000" });
160
- const obj = { mixed: "port=$${PORT_LITERAL} actual=${PORT}" };
161
- const result = substituteEnvVars(obj, getSecret);
162
- expect(result.ok).toBe(true);
163
- if (result.ok) {
164
- const val = result.value;
165
- expect(val.mixed).toBe("port=${PORT_LITERAL} actual=3000");
166
- }
167
- });
168
- it("auto-corrects bare $VAR_NAME (without braces) when secret exists", () => {
169
- const getSecret = createSecretGetter({ GEMINI_API_KEY: "AIza-test-key" });
170
- const obj = { env: { GEMINI_API_KEY: "$GEMINI_API_KEY" } };
171
- const result = substituteEnvVars(obj, getSecret);
172
- expect(result.ok).toBe(true);
173
- if (result.ok) {
174
- const val = result.value;
175
- const env = val.env;
176
- expect(env.GEMINI_API_KEY).toBe("AIza-test-key");
177
- }
178
- });
179
- it("returns ENV_VAR_ERROR for bare $VAR_NAME when secret is missing", () => {
180
- const getSecret = createSecretGetter({});
181
- const obj = { key: "$MISSING_KEY" };
182
- const result = substituteEnvVars(obj, getSecret, "config.yaml");
183
- expect(result.ok).toBe(false);
184
- if (!result.ok) {
185
- expect(result.error.code).toBe("ENV_VAR_ERROR");
186
- expect(result.error.message).toContain("MISSING_KEY");
187
- expect(result.error.message).toContain("auto-corrected");
188
- }
189
- });
190
- it("does NOT auto-correct bare $VAR in mixed-content strings", () => {
191
- const getSecret = createSecretGetter({ HOME: "/usr/home" });
192
- // "$HOME/path" should NOT be treated as a bare var ref (it has trailing content)
193
- const obj = { path: "$HOME/path" };
194
- const result = substituteEnvVars(obj, getSecret);
195
- expect(result.ok).toBe(true);
196
- if (result.ok) {
197
- const val = result.value;
198
- // Should pass through unchanged (no ${} braces, not a whole-string match)
199
- expect(val.path).toBe("$HOME/path");
200
- }
201
- });
202
- });
203
- describe("warnSuspiciousEnvValues", () => {
204
- it("warns about bare $VAR in env records", () => {
205
- const config = {
206
- servers: [
207
- {
208
- name: "test",
209
- env: { API_KEY: "$MY_API_KEY" },
210
- },
211
- ],
212
- };
213
- const warnings = warnSuspiciousEnvValues(config, "integrations.mcp");
214
- expect(warnings).toHaveLength(1);
215
- expect(warnings[0].path).toContain("env.API_KEY");
216
- expect(warnings[0].hint).toContain("bare $VAR");
217
- });
218
- it("warns about [REDACTED] literal in env records", () => {
219
- const config = {
220
- servers: [
221
- {
222
- name: "test",
223
- env: { API_KEY: "[REDACTED]" },
224
- },
225
- ],
226
- };
227
- const warnings = warnSuspiciousEnvValues(config, "integrations.mcp");
228
- expect(warnings).toHaveLength(1);
229
- expect(warnings[0].hint).toContain("placeholder");
230
- });
231
- it("warns about raw API keys in env records", () => {
232
- const config = {
233
- servers: [{ name: "test", env: { KEY: "sk-abc123" } }],
234
- };
235
- const warnings = warnSuspiciousEnvValues(config, "integrations.mcp");
236
- expect(warnings).toHaveLength(1);
237
- expect(warnings[0].hint).toContain("raw API key");
238
- });
239
- it("does NOT warn about proper ${VAR} references", () => {
240
- const config = {
241
- servers: [
242
- {
243
- name: "test",
244
- env: { API_KEY: "${MY_API_KEY}" },
245
- },
246
- ],
247
- };
248
- const warnings = warnSuspiciousEnvValues(config, "integrations.mcp");
249
- expect(warnings).toHaveLength(0);
250
- });
251
- it("does NOT warn about non-env string fields", () => {
252
- const config = {
253
- servers: [{ name: "$not-an-env-ref", command: "npx" }],
254
- };
255
- const warnings = warnSuspiciousEnvValues(config, "integrations.mcp");
256
- expect(warnings).toHaveLength(0);
257
- });
258
- });
259
- });
@@ -1,72 +0,0 @@
1
- import { describe, it, expect } from "vitest";
2
- import { getFieldMetadata } from "./field-metadata.js";
3
- describe("config/field-metadata", () => {
4
- describe("getFieldMetadata", () => {
5
- it("returns metadata for all top-level config sections", () => {
6
- const metadata = getFieldMetadata();
7
- expect(metadata.length).toBeGreaterThan(0);
8
- // Should contain metadata entries for known top-level keys
9
- const paths = metadata.map((m) => m.path);
10
- // Top-level scalars
11
- expect(paths).toContain("tenantId");
12
- expect(paths).toContain("logLevel");
13
- expect(paths).toContain("dataDir");
14
- });
15
- it("each metadata entry has path, type, and immutable flag", () => {
16
- const metadata = getFieldMetadata();
17
- for (const entry of metadata) {
18
- expect(typeof entry.path).toBe("string");
19
- expect(entry.path.length).toBeGreaterThan(0);
20
- expect(typeof entry.type).toBe("string");
21
- expect(typeof entry.immutable).toBe("boolean");
22
- }
23
- });
24
- it("nested fields include dot-notation paths", () => {
25
- const metadata = getFieldMetadata("gateway");
26
- const paths = metadata.map((m) => m.path);
27
- // Gateway has a tls section with nested fields
28
- const nestedPaths = paths.filter((p) => p.includes("."));
29
- expect(nestedPaths.length).toBeGreaterThan(0);
30
- });
31
- it("immutable fields are correctly classified (security.* -> immutable: true)", () => {
32
- const metadata = getFieldMetadata("security");
33
- // All security fields should be immutable
34
- for (const entry of metadata) {
35
- expect(entry.immutable).toBe(true);
36
- }
37
- });
38
- it("mutable fields are classified (monitoring.* -> immutable: false)", () => {
39
- const metadata = getFieldMetadata("monitoring");
40
- // Monitoring fields should not be immutable
41
- for (const entry of metadata) {
42
- expect(entry.immutable).toBe(false);
43
- }
44
- });
45
- it("section filter returns only metadata for specified section", () => {
46
- const allMetadata = getFieldMetadata();
47
- const gatewayMetadata = getFieldMetadata("gateway");
48
- // Filtered result should be smaller than full result
49
- expect(gatewayMetadata.length).toBeLessThan(allMetadata.length);
50
- // All paths in filtered result should start with "gateway."
51
- for (const entry of gatewayMetadata) {
52
- expect(entry.path.startsWith("gateway.")).toBe(true);
53
- }
54
- });
55
- it("description field populated from Zod schema descriptions", () => {
56
- const metadata = getFieldMetadata();
57
- // At least some entries should have descriptions (from JSDoc .describe() on schemas)
58
- // tenantId has a description in the schema
59
- const tenantId = metadata.find((m) => m.path === "tenantId");
60
- expect(tenantId).toBeDefined();
61
- // Description may or may not be set depending on schema .describe() usage
62
- // But the field should exist on the object
63
- expect("description" in tenantId).toBe(true);
64
- });
65
- it("returns a sorted array", () => {
66
- const metadata = getFieldMetadata();
67
- const paths = metadata.map((m) => m.path);
68
- const sorted = [...paths].sort();
69
- expect(paths).toEqual(sorted);
70
- });
71
- });
72
- });