@getcliqio/cliq-sdk 0.0.0-stage → 1.15.33

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 (338) hide show
  1. package/README.md +28 -2
  2. package/dist/agent_api.d.ts +39 -0
  3. package/dist/agent_api.d.ts.map +1 -0
  4. package/dist/agent_api.js +105 -0
  5. package/dist/agent_api.js.map +1 -0
  6. package/dist/agent_manifest.d.ts +162 -0
  7. package/dist/agent_manifest.d.ts.map +1 -0
  8. package/dist/agent_manifest.js +242 -0
  9. package/dist/agent_manifest.js.map +1 -0
  10. package/dist/agent_payloads.d.ts +103 -0
  11. package/dist/agent_payloads.d.ts.map +1 -0
  12. package/dist/agent_payloads.js +56 -0
  13. package/dist/agent_payloads.js.map +1 -0
  14. package/dist/agents/base_agent.d.ts +113 -0
  15. package/dist/agents/base_agent.d.ts.map +1 -0
  16. package/dist/agents/base_agent.js +413 -0
  17. package/dist/agents/base_agent.js.map +1 -0
  18. package/dist/agents/cli_agent.d.ts +98 -0
  19. package/dist/agents/cli_agent.d.ts.map +1 -0
  20. package/dist/agents/cli_agent.js +303 -0
  21. package/dist/agents/cli_agent.js.map +1 -0
  22. package/dist/agents/cli_rehydrate.d.ts +29 -0
  23. package/dist/agents/cli_rehydrate.d.ts.map +1 -0
  24. package/dist/agents/cli_rehydrate.js +32 -0
  25. package/dist/agents/cli_rehydrate.js.map +1 -0
  26. package/dist/agents/connector_agent.d.ts +20 -0
  27. package/dist/agents/connector_agent.d.ts.map +1 -0
  28. package/dist/agents/connector_agent.js +110 -0
  29. package/dist/agents/connector_agent.js.map +1 -0
  30. package/dist/agents/event_artifacts.d.ts +33 -0
  31. package/dist/agents/event_artifacts.d.ts.map +1 -0
  32. package/dist/agents/event_artifacts.js +73 -0
  33. package/dist/agents/event_artifacts.js.map +1 -0
  34. package/dist/agents/gate_agent.d.ts +40 -0
  35. package/dist/agents/gate_agent.d.ts.map +1 -0
  36. package/dist/agents/gate_agent.js +121 -0
  37. package/dist/agents/gate_agent.js.map +1 -0
  38. package/dist/agents/index.d.ts +32 -0
  39. package/dist/agents/index.d.ts.map +1 -0
  40. package/dist/agents/index.js +26 -0
  41. package/dist/agents/index.js.map +1 -0
  42. package/dist/agents/llm_agent.d.ts +109 -0
  43. package/dist/agents/llm_agent.d.ts.map +1 -0
  44. package/dist/agents/llm_agent.js +285 -0
  45. package/dist/agents/llm_agent.js.map +1 -0
  46. package/dist/agents/llm_contract.d.ts +7 -0
  47. package/dist/agents/llm_contract.d.ts.map +1 -0
  48. package/dist/agents/llm_contract.js +7 -0
  49. package/dist/agents/llm_contract.js.map +1 -0
  50. package/dist/agents/standard_agent.d.ts +15 -0
  51. package/dist/agents/standard_agent.d.ts.map +1 -0
  52. package/dist/agents/standard_agent.js +34 -0
  53. package/dist/agents/standard_agent.js.map +1 -0
  54. package/dist/agents/turn_result.d.ts +67 -0
  55. package/dist/agents/turn_result.d.ts.map +1 -0
  56. package/dist/agents/turn_result.js +81 -0
  57. package/dist/agents/turn_result.js.map +1 -0
  58. package/dist/agents/types.d.ts +314 -0
  59. package/dist/agents/types.d.ts.map +1 -0
  60. package/dist/agents/types.js +20 -0
  61. package/dist/agents/types.js.map +1 -0
  62. package/dist/builtin_teams/hello_hug.d.ts +9 -0
  63. package/dist/builtin_teams/hello_hug.d.ts.map +1 -0
  64. package/dist/builtin_teams/hello_hug.js +68 -0
  65. package/dist/builtin_teams/hello_hug.js.map +1 -0
  66. package/dist/builtin_teams/hello_world.d.ts +8 -0
  67. package/dist/builtin_teams/hello_world.d.ts.map +1 -0
  68. package/dist/builtin_teams/hello_world.js +65 -0
  69. package/dist/builtin_teams/hello_world.js.map +1 -0
  70. package/dist/builtin_teams/hug_example.d.ts +10 -0
  71. package/dist/builtin_teams/hug_example.d.ts.map +1 -0
  72. package/dist/builtin_teams/hug_example.js +94 -0
  73. package/dist/builtin_teams/hug_example.js.map +1 -0
  74. package/dist/builtin_teams/index.d.ts +12 -0
  75. package/dist/builtin_teams/index.d.ts.map +1 -0
  76. package/dist/builtin_teams/index.js +18 -0
  77. package/dist/builtin_teams/index.js.map +1 -0
  78. package/dist/builtin_teams/types.d.ts +29 -0
  79. package/dist/builtin_teams/types.d.ts.map +1 -0
  80. package/dist/builtin_teams/types.js +3 -0
  81. package/dist/builtin_teams/types.js.map +1 -0
  82. package/dist/core_api_client.d.ts +48 -0
  83. package/dist/core_api_client.d.ts.map +1 -0
  84. package/dist/core_api_client.js +132 -0
  85. package/dist/core_api_client.js.map +1 -0
  86. package/dist/daemon_wire.d.ts +122 -0
  87. package/dist/daemon_wire.d.ts.map +1 -0
  88. package/dist/daemon_wire.js +105 -0
  89. package/dist/daemon_wire.js.map +1 -0
  90. package/dist/events/catalog.d.ts +40 -0
  91. package/dist/events/catalog.d.ts.map +1 -0
  92. package/dist/events/catalog.js +76 -0
  93. package/dist/events/catalog.js.map +1 -0
  94. package/dist/http_daemon_client.d.ts +136 -0
  95. package/dist/http_daemon_client.d.ts.map +1 -0
  96. package/dist/http_daemon_client.js +192 -0
  97. package/dist/http_daemon_client.js.map +1 -0
  98. package/dist/hug/ask.d.ts +160 -0
  99. package/dist/hug/ask.d.ts.map +1 -0
  100. package/dist/hug/ask.js +318 -0
  101. package/dist/hug/ask.js.map +1 -0
  102. package/dist/hug/attach.d.ts +60 -0
  103. package/dist/hug/attach.d.ts.map +1 -0
  104. package/dist/hug/attach.js +103 -0
  105. package/dist/hug/attach.js.map +1 -0
  106. package/dist/hug/bridge/index.d.ts +16 -0
  107. package/dist/hug/bridge/index.d.ts.map +1 -0
  108. package/dist/hug/bridge/index.js +13 -0
  109. package/dist/hug/bridge/index.js.map +1 -0
  110. package/dist/hug/bridge/messages.d.ts +559 -0
  111. package/dist/hug/bridge/messages.d.ts.map +1 -0
  112. package/dist/hug/bridge/messages.js +165 -0
  113. package/dist/hug/bridge/messages.js.map +1 -0
  114. package/dist/hug/client.d.ts +70 -0
  115. package/dist/hug/client.d.ts.map +1 -0
  116. package/dist/hug/client.js +144 -0
  117. package/dist/hug/client.js.map +1 -0
  118. package/dist/hug/context.d.ts +54 -0
  119. package/dist/hug/context.d.ts.map +1 -0
  120. package/dist/hug/context.js +27 -0
  121. package/dist/hug/context.js.map +1 -0
  122. package/dist/hug/define.d.ts +116 -0
  123. package/dist/hug/define.d.ts.map +1 -0
  124. package/dist/hug/define.js +119 -0
  125. package/dist/hug/define.js.map +1 -0
  126. package/dist/hug/definitions/approval.d.ts +216 -0
  127. package/dist/hug/definitions/approval.d.ts.map +1 -0
  128. package/dist/hug/definitions/approval.js +50 -0
  129. package/dist/hug/definitions/approval.js.map +1 -0
  130. package/dist/hug/definitions/common.d.ts +122 -0
  131. package/dist/hug/definitions/common.d.ts.map +1 -0
  132. package/dist/hug/definitions/common.js +70 -0
  133. package/dist/hug/definitions/common.js.map +1 -0
  134. package/dist/hug/definitions/form.d.ts +197 -0
  135. package/dist/hug/definitions/form.d.ts.map +1 -0
  136. package/dist/hug/definitions/form.js +29 -0
  137. package/dist/hug/definitions/form.js.map +1 -0
  138. package/dist/hug/definitions/index.d.ts +10 -0
  139. package/dist/hug/definitions/index.d.ts.map +1 -0
  140. package/dist/hug/definitions/index.js +8 -0
  141. package/dist/hug/definitions/index.js.map +1 -0
  142. package/dist/hug/errors.d.ts +30 -0
  143. package/dist/hug/errors.d.ts.map +1 -0
  144. package/dist/hug/errors.js +46 -0
  145. package/dist/hug/errors.js.map +1 -0
  146. package/dist/hug/file_checks.d.ts +41 -0
  147. package/dist/hug/file_checks.d.ts.map +1 -0
  148. package/dist/hug/file_checks.js +105 -0
  149. package/dist/hug/file_checks.js.map +1 -0
  150. package/dist/hug/files.d.ts +137 -0
  151. package/dist/hug/files.d.ts.map +1 -0
  152. package/dist/hug/files.js +283 -0
  153. package/dist/hug/files.js.map +1 -0
  154. package/dist/hug/hug_bundle.d.ts +70 -0
  155. package/dist/hug/hug_bundle.d.ts.map +1 -0
  156. package/dist/hug/hug_bundle.js +299 -0
  157. package/dist/hug/hug_bundle.js.map +1 -0
  158. package/dist/hug/hug_catalog.d.ts +38 -0
  159. package/dist/hug/hug_catalog.d.ts.map +1 -0
  160. package/dist/hug/hug_catalog.js +67 -0
  161. package/dist/hug/hug_catalog.js.map +1 -0
  162. package/dist/hug/hug_definitions.d.ts +32 -0
  163. package/dist/hug/hug_definitions.d.ts.map +1 -0
  164. package/dist/hug/hug_definitions.js +74 -0
  165. package/dist/hug/hug_definitions.js.map +1 -0
  166. package/dist/hug/index.d.ts +37 -0
  167. package/dist/hug/index.d.ts.map +1 -0
  168. package/dist/hug/index.js +23 -0
  169. package/dist/hug/index.js.map +1 -0
  170. package/dist/hug/llm.d.ts +106 -0
  171. package/dist/hug/llm.d.ts.map +1 -0
  172. package/dist/hug/llm.js +250 -0
  173. package/dist/hug/llm.js.map +1 -0
  174. package/dist/hug/policies.d.ts +65 -0
  175. package/dist/hug/policies.d.ts.map +1 -0
  176. package/dist/hug/policies.js +80 -0
  177. package/dist/hug/policies.js.map +1 -0
  178. package/dist/hug/problems.d.ts +35 -0
  179. package/dist/hug/problems.d.ts.map +1 -0
  180. package/dist/hug/problems.js +53 -0
  181. package/dist/hug/problems.js.map +1 -0
  182. package/dist/hug/requested_inputs.d.ts +190 -0
  183. package/dist/hug/requested_inputs.d.ts.map +1 -0
  184. package/dist/hug/requested_inputs.js +220 -0
  185. package/dist/hug/requested_inputs.js.map +1 -0
  186. package/dist/hug/schema_for_inputs.d.ts +20 -0
  187. package/dist/hug/schema_for_inputs.d.ts.map +1 -0
  188. package/dist/hug/schema_for_inputs.js +95 -0
  189. package/dist/hug/schema_for_inputs.js.map +1 -0
  190. package/dist/hug/session.d.ts +113 -0
  191. package/dist/hug/session.d.ts.map +1 -0
  192. package/dist/hug/session.js +210 -0
  193. package/dist/hug/session.js.map +1 -0
  194. package/dist/hug/types.d.ts +141 -0
  195. package/dist/hug/types.d.ts.map +1 -0
  196. package/dist/hug/types.js +80 -0
  197. package/dist/hug/types.js.map +1 -0
  198. package/dist/index.d.ts +72 -0
  199. package/dist/index.d.ts.map +1 -0
  200. package/dist/index.js +54 -0
  201. package/dist/index.js.map +1 -0
  202. package/dist/logging.d.ts +172 -0
  203. package/dist/logging.d.ts.map +1 -0
  204. package/dist/logging.js +306 -0
  205. package/dist/logging.js.map +1 -0
  206. package/dist/mcp.d.ts +119 -0
  207. package/dist/mcp.d.ts.map +1 -0
  208. package/dist/mcp.js +259 -0
  209. package/dist/mcp.js.map +1 -0
  210. package/dist/mcp_client.d.ts +145 -0
  211. package/dist/mcp_client.d.ts.map +1 -0
  212. package/dist/mcp_client.js +374 -0
  213. package/dist/mcp_client.js.map +1 -0
  214. package/dist/paths.d.ts +20 -0
  215. package/dist/paths.d.ts.map +1 -0
  216. package/dist/paths.js +20 -0
  217. package/dist/paths.js.map +1 -0
  218. package/dist/protocol/factory.d.ts +32 -0
  219. package/dist/protocol/factory.d.ts.map +1 -0
  220. package/dist/protocol/factory.js +31 -0
  221. package/dist/protocol/factory.js.map +1 -0
  222. package/dist/protocol/framing.d.ts +35 -0
  223. package/dist/protocol/framing.d.ts.map +1 -0
  224. package/dist/protocol/framing.js +73 -0
  225. package/dist/protocol/framing.js.map +1 -0
  226. package/dist/protocol/index.d.ts +13 -0
  227. package/dist/protocol/index.d.ts.map +1 -0
  228. package/dist/protocol/index.js +13 -0
  229. package/dist/protocol/index.js.map +1 -0
  230. package/dist/protocol/types/agent.d.ts +42 -0
  231. package/dist/protocol/types/agent.d.ts.map +1 -0
  232. package/dist/protocol/types/agent.js +9 -0
  233. package/dist/protocol/types/agent.js.map +1 -0
  234. package/dist/protocol/types/cliq_core.d.ts +79 -0
  235. package/dist/protocol/types/cliq_core.d.ts.map +1 -0
  236. package/dist/protocol/types/cliq_core.js +17 -0
  237. package/dist/protocol/types/cliq_core.js.map +1 -0
  238. package/dist/protocol/types/foundations.d.ts +41 -0
  239. package/dist/protocol/types/foundations.d.ts.map +1 -0
  240. package/dist/protocol/types/foundations.js +10 -0
  241. package/dist/protocol/types/foundations.js.map +1 -0
  242. package/dist/protocol/types/index.d.ts +32 -0
  243. package/dist/protocol/types/index.d.ts.map +1 -0
  244. package/dist/protocol/types/index.js +27 -0
  245. package/dist/protocol/types/index.js.map +1 -0
  246. package/dist/protocol/types/messages.d.ts +827 -0
  247. package/dist/protocol/types/messages.d.ts.map +1 -0
  248. package/dist/protocol/types/messages.js +117 -0
  249. package/dist/protocol/types/messages.js.map +1 -0
  250. package/dist/protocol/types/pipeline.d.ts +122 -0
  251. package/dist/protocol/types/pipeline.d.ts.map +1 -0
  252. package/dist/protocol/types/pipeline.js +16 -0
  253. package/dist/protocol/types/pipeline.js.map +1 -0
  254. package/dist/protocol/types/schemas.d.ts +814 -0
  255. package/dist/protocol/types/schemas.d.ts.map +1 -0
  256. package/dist/protocol/types/schemas.js +772 -0
  257. package/dist/protocol/types/schemas.js.map +1 -0
  258. package/dist/protocol/types/team.d.ts +42 -0
  259. package/dist/protocol/types/team.d.ts.map +1 -0
  260. package/dist/protocol/types/team.js +15 -0
  261. package/dist/protocol/types/team.js.map +1 -0
  262. package/dist/protocol/types/workspace.d.ts +46 -0
  263. package/dist/protocol/types/workspace.d.ts.map +1 -0
  264. package/dist/protocol/types/workspace.js +9 -0
  265. package/dist/protocol/types/workspace.js.map +1 -0
  266. package/dist/settings_keys.d.ts +12 -0
  267. package/dist/settings_keys.d.ts.map +1 -0
  268. package/dist/settings_keys.js +35 -0
  269. package/dist/settings_keys.js.map +1 -0
  270. package/dist/tcp/client.d.ts +15 -0
  271. package/dist/tcp/client.d.ts.map +1 -0
  272. package/dist/tcp/client.js +28 -0
  273. package/dist/tcp/client.js.map +1 -0
  274. package/dist/tcp/connection.d.ts +79 -0
  275. package/dist/tcp/connection.d.ts.map +1 -0
  276. package/dist/tcp/connection.js +153 -0
  277. package/dist/tcp/connection.js.map +1 -0
  278. package/dist/tcp/index.d.ts +10 -0
  279. package/dist/tcp/index.d.ts.map +1 -0
  280. package/dist/tcp/index.js +7 -0
  281. package/dist/tcp/index.js.map +1 -0
  282. package/dist/tcp/server.d.ts +31 -0
  283. package/dist/tcp/server.d.ts.map +1 -0
  284. package/dist/tcp/server.js +54 -0
  285. package/dist/tcp/server.js.map +1 -0
  286. package/dist/team/bundle.d.ts +88 -0
  287. package/dist/team/bundle.d.ts.map +1 -0
  288. package/dist/team/bundle.js +214 -0
  289. package/dist/team/bundle.js.map +1 -0
  290. package/dist/team/identity.d.ts +31 -0
  291. package/dist/team/identity.d.ts.map +1 -0
  292. package/dist/team/identity.js +83 -0
  293. package/dist/team/identity.js.map +1 -0
  294. package/dist/team/index.d.ts +13 -0
  295. package/dist/team/index.d.ts.map +1 -0
  296. package/dist/team/index.js +8 -0
  297. package/dist/team/index.js.map +1 -0
  298. package/dist/team/lint_bundle.d.ts +16 -0
  299. package/dist/team/lint_bundle.d.ts.map +1 -0
  300. package/dist/team/lint_bundle.js +35 -0
  301. package/dist/team/lint_bundle.js.map +1 -0
  302. package/dist/team/ref.d.ts +48 -0
  303. package/dist/team/ref.d.ts.map +1 -0
  304. package/dist/team/ref.js +70 -0
  305. package/dist/team/ref.js.map +1 -0
  306. package/dist/team/roles.d.ts +22 -0
  307. package/dist/team/roles.d.ts.map +1 -0
  308. package/dist/team/roles.js +33 -0
  309. package/dist/team/roles.js.map +1 -0
  310. package/dist/team/tree.d.ts +101 -0
  311. package/dist/team/tree.d.ts.map +1 -0
  312. package/dist/team/tree.js +125 -0
  313. package/dist/team/tree.js.map +1 -0
  314. package/dist/team_lint.d.ts +57 -0
  315. package/dist/team_lint.d.ts.map +1 -0
  316. package/dist/team_lint.js +277 -0
  317. package/dist/team_lint.js.map +1 -0
  318. package/dist/telemetry/stream_json_usage.d.ts +39 -0
  319. package/dist/telemetry/stream_json_usage.d.ts.map +1 -0
  320. package/dist/telemetry/stream_json_usage.js +139 -0
  321. package/dist/telemetry/stream_json_usage.js.map +1 -0
  322. package/dist/telemetry/usage.d.ts +288 -0
  323. package/dist/telemetry/usage.d.ts.map +1 -0
  324. package/dist/telemetry/usage.js +421 -0
  325. package/dist/telemetry/usage.js.map +1 -0
  326. package/dist/utils/duration.d.ts +11 -0
  327. package/dist/utils/duration.d.ts.map +1 -0
  328. package/dist/utils/duration.js +22 -0
  329. package/dist/utils/duration.js.map +1 -0
  330. package/dist/utils/redact.d.ts +26 -0
  331. package/dist/utils/redact.d.ts.map +1 -0
  332. package/dist/utils/redact.js +52 -0
  333. package/dist/utils/redact.js.map +1 -0
  334. package/dist/utils/url.d.ts +6 -0
  335. package/dist/utils/url.d.ts.map +1 -0
  336. package/dist/utils/url.js +11 -0
  337. package/dist/utils/url.js.map +1 -0
  338. package/package.json +72 -5
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAKH,OAAO,EACH,gBAAgB,EAChB,aAAa,EACb,OAAO,EACP,WAAW,EACX,QAAQ,EACR,WAAW,EACX,aAAa,GAChB,MAAM,qBAAqB,CAAC;AAM7B,mBAAmB,iCAAiC,CAAC;AACrD,mBAAmB,+BAA+B,CAAC;AACnD,mBAAmB,0BAA0B,CAAC;AAC9C,mBAAmB,2BAA2B,CAAC;AAC/C,mBAAmB,8BAA8B,CAAC;AAClD,mBAAmB,+BAA+B,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChE,YAAY,EACR,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,cAAc,GACjB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,IAAI,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAIpG,OAAO,EACH,SAAS,EACT,aAAa,EACb,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,cAAc,EAC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S,EAAE,aAAa,EAAE,eAAe,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAClI,OAAO,EACH,eAAe,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,mBAAmB,EACpG,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,mBAAmB,GACvG,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClF,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,oBAAoB,EAAE,eAAe,EAAE,mBAAmB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACrJ,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AAQxC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACnE,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAKjE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAK7D,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AAGzC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC5F,cAAc,iBAAiB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,54 @@
1
+ /**
2
+ * @getcliqio/cliq-sdk — SDK for building Cliq pipeline agents.
3
+ *
4
+ * Agents receive an AgentMessage on stdin (JSON) and route to handlers
5
+ * declared in a `handlers` map keyed by capability string. Helper
6
+ * functions handle .cliq/ filesystem protocol: context assembly,
7
+ * handoff writing, signal writing, and task board persistence.
8
+ *
9
+ * Usage:
10
+ *
11
+ * new CliqAgent({
12
+ * name: 'my-agent',
13
+ * handlers: {
14
+ * 'phase:standard': async (msg) => {
15
+ * const ctx = build_phase_context(msg, 'my-agent');
16
+ * ctx.send('reviewer', 'Implementation notes...');
17
+ * finalize_standard_phase(ctx, msg);
18
+ * },
19
+ * },
20
+ * }).run();
21
+ */
22
+ // ---- Re-exports: protocol & transport (daemon architecture) ----
23
+ export { PROTOCOL_VERSION, MESSAGE_TYPES, Message, MessageType, Payloads, NdjsonCodec, NdjsonDecoder, } from './protocol/index.js';
24
+ export { Connection, TcpServer, connect } from './tcp/index.js';
25
+ export { create_agent } from './agent_api.js';
26
+ // ---- Re-exports: agent class hierarchy (HTTP callback model) ----
27
+ export { BaseAgent, StandardAgent, GateAgent, LlmAgent, CliAgent, ConnectorAgent, turn_from_text, turn_from_cli_stdout, build_cli_turn_prompt, extract_question, answers_from_resume, normalize_event_artifacts, artifacts_from_event_payload, is_event_artifact_ref, is_event_artifact_inline, } from './agents/index.js';
28
+ export { is_llm_payload, PAYLOAD_SCHEMAS } from './agent_payloads.js';
29
+ export { DAEMON_SETTING_PREFIXES, DAEMON_SETTING_EXACT_KEYS, is_daemon_setting_key, } from './settings_keys.js';
30
+ // ---- Lifecycle event catalog (Yamazaki — shared with Hub naming) ----
31
+ export { LIFECYCLE_EVENTS, DEFAULT_NOTIFY_EVENTS, AGENT_STREAM_EVENTS, is_lifecycle_event, is_default_notify_event, is_custom_event, } from './events/catalog.js';
32
+ export { HttpDaemonClient, DaemonUnreachableError, DAEMON_ROUTES } from './http_daemon_client.js';
33
+ export { DaemonError, read_daemon_reply, post_daemon } from './daemon_wire.js';
34
+ export { LOG_LEVELS, get_logger, configure_logging, attach_tcp_sink, attach_sink, attach_execution_sink, emit_execution_log, emit_execution_event, emit_execution_artifact, shutdown_logging, } from './logging.js';
35
+ // ---- Telemetry — UsageRecord (Phase 1 observability, common shape) ----
36
+ export { USAGE_RECORD_VERSION, AGENT_KINDS, UNIT_KINDS, OUTCOMES, usage_record_schema, usage_record_partial_schema, usage_to_span_attrs, span_attrs_to_usage, roll_up_usage, rollup_to_span_attrs, synthesize_baseline_usage, merge_usage, report_usage, UsageValidationError, } from './telemetry/usage.js';
37
+ export { extract_usage_from_event, extract_usage_from_events, extract_usage_from_ndjson, } from './telemetry/stream_json_usage.js';
38
+ export { validate_manifest, read_manifest, resolve_entry } from './agent_manifest.js';
39
+ export { MCP_SERVERS_KEY, MCP_SECRET_PREFIX, mcp_placeholders, mcp_secrets_from_settings, mcp_servers_setting, mcp_transport_of, parse_mcp_servers, resolve_mcp_servers, validate_mcp_manifest, validate_mcp_server, } from './mcp.js';
40
+ export { McpClient, McpToolbox, MCP_PROTOCOL_VERSION, mcp_result_text, mcp_servers_for_run, mcp_tool_name, open_mcp_toolbox } from './mcp_client.js';
41
+ export * as CliqPaths from './paths.js';
42
+ // ---- Public types: config ----
43
+ // ---- Core API client ----
44
+ export { CoreApiClient, CoreApiError } from './core_api_client.js';
45
+ // ---- Utilities ----
46
+ export { Redact } from './utils/redact.js';
47
+ export { parse_duration_minutes } from './utils/duration.js';
48
+ // ---- Hugs: asking people (PLAN-hug-requests) ----
49
+ export * from './hug/index.js';
50
+ export * from './builtin_teams/index.js';
51
+ // Team lint — the one check for lines cliq would ignore in a team.yml (CliqHub publish/Builder, cliqd install).
52
+ export { lint_team, PHASE_FIELDS, TEAM_INPUT_FIELDS } from './team_lint.js';
53
+ export * from './team/index.js';
54
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,mEAAmE;AAEnE,OAAO,EACH,gBAAgB,EAChB,aAAa,EACb,OAAO,EACP,WAAW,EACX,QAAQ,EACR,WAAW,EACX,aAAa,GAChB,MAAM,qBAAqB,CAAC;AAa7B,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,OA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,GAC5B,MAAM,kCAAkC,CAAC;AAgB1C,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEtF,OAAO,EACH,eAAe,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,mBAAmB,EACpG,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,mBAAmB,GACvG,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,oBAAoB,EAAE,eAAe,EAAE,mBAAmB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACrJ,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AAGxC,iCAAiC;AAGjC,4BAA4B;AAE5B,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAInE,sBAAsB;AAEtB,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAG7D,oDAAoD;AAEpD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AAEzC,gHAAgH;AAChH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAE5E,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,172 @@
1
+ /**
2
+ * Canonical logging for the cliq protocol — daemon, orchestrator, agents.
3
+ *
4
+ * Built on log4js so each process can mix appenders (file, rolling file,
5
+ * console) freely while a single SDK function gives every log line the
6
+ * same canonical shape (run_id, instance_id, phase, agent, level, ts,
7
+ * message). The shape mirrors the `log` message in the wire protocol so
8
+ * the same record can be emitted to disk and over TCP without reshaping.
9
+ *
10
+ * Public surface:
11
+ * - configure_logging(config) — one-time process setup of file/console.
12
+ * - get_logger(category, base) — returns a CanonicalLogger that stamps
13
+ * every record with run_id/instance_id/agent/phase.
14
+ * - attach_tcp_sink(connection) — every subsequent log call from any
15
+ * CanonicalLogger is also emitted over the connection as a valid
16
+ * `{ type: "log" }` envelope (in addition to log4js appenders).
17
+ * - shutdown_logging() — flush before process exit.
18
+ *
19
+ * Design notes:
20
+ * - log4js handles disk + console; the SDK owns the wire side. This
21
+ * keeps each side debuggable in isolation (config doesn't determine
22
+ * whether TCP works, and vice versa).
23
+ * - Every CanonicalLogger goes through one `emit` path so the TCP and
24
+ * log4js sides see identical records.
25
+ * - The TCP path uses `Connection.send('log', ...)`, which invokes the
26
+ * standard outbound validators — a malformed log can't escape the
27
+ * process.
28
+ */
29
+ import type { Connection } from './tcp/connection.js';
30
+ import type { LogLevel, Log as LogPayload } from './protocol/types/index.js';
31
+ export type { LogLevel, LogPayload };
32
+ /** Protocol log levels, lowest to highest. */
33
+ export declare const LOG_LEVELS: readonly LogLevel[];
34
+ /**
35
+ * Fields that travel with every log line. Subset of the wire `LogPayload`
36
+ * plus the envelope identity fields (`run_id`, `instance_id`) plus the
37
+ * canonical `concern` bucket — one of `'run' | 'system' | 'command' | 'http'`
38
+ * — used by explorers and CLI filters to slice logs by the *reason* the
39
+ * line was emitted (independent of category/level).
40
+ */
41
+ export interface CanonicalFields {
42
+ readonly run_id?: string;
43
+ readonly instance_id?: string;
44
+ readonly phase?: string;
45
+ readonly agent?: string;
46
+ readonly concern?: string;
47
+ }
48
+ /** Extra structured fields attached to one log line. */
49
+ export type LogData = Record<string, unknown>;
50
+ interface InternalRecord {
51
+ readonly level: LogLevel;
52
+ readonly category: string;
53
+ readonly ts: string;
54
+ readonly message: string;
55
+ readonly run_id?: string;
56
+ readonly instance_id?: string;
57
+ readonly phase?: string;
58
+ readonly agent?: string;
59
+ readonly concern?: string;
60
+ readonly data?: LogData;
61
+ }
62
+ type Sink = (record: InternalRecord) => void;
63
+ /**
64
+ * Mirror every canonical log record over a TCP `Connection` as a valid
65
+ * wire `{ type: "log" }` message. Returns a handle to detach.
66
+ *
67
+ * Fixed identity (`run_id`, `instance_id`) can be provided when the
68
+ * caller knows the binding upfront (e.g. an orchestrator forwarding
69
+ * to the daemon for a single run); otherwise the values come from the
70
+ * record's canonical fields.
71
+ */
72
+ export declare function attach_tcp_sink(connection: Connection, binding?: {
73
+ run_id?: string | null;
74
+ instance_id?: string | null;
75
+ }): {
76
+ detach: () => void;
77
+ };
78
+ /**
79
+ * Add a custom sink. Useful for tests and for embedding cliq logs into a
80
+ * host process's existing logging pipeline.
81
+ */
82
+ export declare function attach_sink(sink: Sink): {
83
+ detach: () => void;
84
+ };
85
+ /** Logger from {@link get_logger}: every line carries its category and canonical fields. */
86
+ export interface CanonicalLogger {
87
+ readonly category: string;
88
+ readonly fields: Readonly<CanonicalFields>;
89
+ debug: (message: string, data?: LogData) => void;
90
+ info: (message: string, data?: LogData) => void;
91
+ warn: (message: string, data?: LogData) => void;
92
+ error: (message: string, data?: LogData) => void;
93
+ /** Layered context: returns a new logger with extra canonical fields. */
94
+ with: (fields: CanonicalFields) => CanonicalLogger;
95
+ }
96
+ /**
97
+ * Get a logger for `category`. `base_fields` are stamped onto every
98
+ * record produced by this logger (and any of its `.with(...)` children).
99
+ */
100
+ export declare function get_logger(category: string, base_fields?: CanonicalFields): CanonicalLogger;
101
+ /** Rolling log file settings. */
102
+ export interface FileAppenderConfig {
103
+ readonly path: string;
104
+ /** Bytes before the file rolls. Defaults to 10 MiB. */
105
+ readonly max_size?: number;
106
+ /** Rolled files kept. Defaults to 3. */
107
+ readonly backups?: number;
108
+ /** Gzip rolled files. Defaults to false. */
109
+ readonly compress?: boolean;
110
+ }
111
+ /** Process-wide logging setup: levels and appenders. */
112
+ export interface LoggingConfig {
113
+ /**
114
+ * Default level for unmatched categories. Defaults to `INFO`.
115
+ * `OFF` silences all log4js appenders (useful in tests).
116
+ */
117
+ readonly level?: LogLevel | 'OFF';
118
+ /** Per-category level overrides. */
119
+ readonly category_levels?: Readonly<Record<string, LogLevel | 'OFF'>>;
120
+ /** Console appender. Defaults to true when unset (`console !== false`). */
121
+ readonly console?: boolean;
122
+ /**
123
+ * When true (and console is enabled), stdout uses canonical NDJSON
124
+ * instead of the human pattern layout. Prefer for daemons / containers.
125
+ */
126
+ readonly console_ndjson?: boolean;
127
+ /** Process-level log file (e.g. `daemon.log`, `orchestrator.log`). */
128
+ readonly process_file?: FileAppenderConfig;
129
+ /** Per-pipeline log file — one file per run. */
130
+ readonly pipeline_file?: FileAppenderConfig;
131
+ /** Per-agent log file — one file per agent across runs. */
132
+ readonly agent_file?: FileAppenderConfig;
133
+ }
134
+ /**
135
+ * Configure log4js for this process. Idempotent — safe to call again.
136
+ * Loggers obtained from `get_logger` automatically pick up the new
137
+ * configuration on their next emission.
138
+ */
139
+ export declare function configure_logging(config?: LoggingConfig): void;
140
+ /**
141
+ * Flush and close all log4js appenders. Call before process exit to
142
+ * avoid losing buffered file writes.
143
+ */
144
+ export declare function shutdown_logging(): Promise<void>;
145
+ /** What an execution record carries: an output chunk, a run event, or an artifact. */
146
+ export type ExecutionEntryKind = 'log' | 'event' | 'artifact';
147
+ /**
148
+ * Register a sink that writes `category === 'execution'` records as NDJSON
149
+ * to stdout. Call once at process startup (e.g. daemon boot). Kubernetes
150
+ * log pipelines, Datadog agents, and Fluentd pick up these structured
151
+ * lines automatically.
152
+ */
153
+ export declare function attach_execution_sink(): {
154
+ detach: () => void;
155
+ };
156
+ /** Record a chunk of run output (trailing whitespace trimmed) as an execution `log` entry. */
157
+ export declare function emit_execution_log(run_id: string, chunk: string, fields?: {
158
+ phase?: string;
159
+ agent?: string;
160
+ }): void;
161
+ /** Record a run event (`event_type`, optional payload) as an execution `event` entry. */
162
+ export declare function emit_execution_event(run_id: string, event_type: string, fields?: {
163
+ phase?: string;
164
+ agent?: string;
165
+ }, payload?: unknown): void;
166
+ /** Record that a phase produced an artifact as an execution `artifact` entry. */
167
+ export declare function emit_execution_artifact(run_id: string, phase: string, artifact: {
168
+ name: string;
169
+ kind: string;
170
+ mime_type?: string;
171
+ }): void;
172
+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K,EAAE,MAAM,EACb,MAAM,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAC5C,IAAI,CAEN;AAED,yFAAyF;AACzF,wBAAgB,oBAAoB,CAChC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,EAC3C,OAAO,CAAC,EAAE,OAAO,GAClB,IAAI,CAMN;AAED,iFAAiF;AACjF,wBAAgB,uBAAuB,CACnC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAC7D,IAAI,CAON"}
@@ -0,0 +1,306 @@
1
+ /**
2
+ * Canonical logging for the cliq protocol — daemon, orchestrator, agents.
3
+ *
4
+ * Built on log4js so each process can mix appenders (file, rolling file,
5
+ * console) freely while a single SDK function gives every log line the
6
+ * same canonical shape (run_id, instance_id, phase, agent, level, ts,
7
+ * message). The shape mirrors the `log` message in the wire protocol so
8
+ * the same record can be emitted to disk and over TCP without reshaping.
9
+ *
10
+ * Public surface:
11
+ * - configure_logging(config) — one-time process setup of file/console.
12
+ * - get_logger(category, base) — returns a CanonicalLogger that stamps
13
+ * every record with run_id/instance_id/agent/phase.
14
+ * - attach_tcp_sink(connection) — every subsequent log call from any
15
+ * CanonicalLogger is also emitted over the connection as a valid
16
+ * `{ type: "log" }` envelope (in addition to log4js appenders).
17
+ * - shutdown_logging() — flush before process exit.
18
+ *
19
+ * Design notes:
20
+ * - log4js handles disk + console; the SDK owns the wire side. This
21
+ * keeps each side debuggable in isolation (config doesn't determine
22
+ * whether TCP works, and vice versa).
23
+ * - Every CanonicalLogger goes through one `emit` path so the TCP and
24
+ * log4js sides see identical records.
25
+ * - The TCP path uses `Connection.send('log', ...)`, which invokes the
26
+ * standard outbound validators — a malformed log can't escape the
27
+ * process.
28
+ */
29
+ import log4js from 'log4js';
30
+ /** Protocol log levels, lowest to highest. */
31
+ export const LOG_LEVELS = ['DEBUG', 'INFO', 'WARN', 'ERROR'];
32
+ /**
33
+ * Mapping from canonical (UPPERCASE) protocol level → log4js level method.
34
+ * log4js uses lowercase method names (`logger.info(...)`); the wire payload
35
+ * uses UPPERCASE per the protocol enum convention.
36
+ */
37
+ const LEVEL_TO_LOG4JS = {
38
+ DEBUG: 'debug',
39
+ INFO: 'info',
40
+ WARN: 'warn',
41
+ ERROR: 'error',
42
+ };
43
+ const sinks = new Set();
44
+ function emit(record) {
45
+ for (const sink of sinks) {
46
+ try {
47
+ sink(record);
48
+ }
49
+ catch { /* a sink failure must not break the caller */ }
50
+ }
51
+ }
52
+ function add_sink(sink) {
53
+ sinks.add(sink);
54
+ return { detach: () => { sinks.delete(sink); } };
55
+ }
56
+ // --- log4js sink ---
57
+ function log4js_sink(record) {
58
+ if (record.category === 'execution')
59
+ return;
60
+ const logger = log4js.getLogger(record.category);
61
+ const payload = {
62
+ message: record.message,
63
+ ...(record.run_id !== undefined ? { run_id: record.run_id } : {}),
64
+ ...(record.instance_id !== undefined ? { instance_id: record.instance_id } : {}),
65
+ ...(record.phase !== undefined ? { phase: record.phase } : {}),
66
+ ...(record.agent !== undefined ? { agent: record.agent } : {}),
67
+ ...(record.concern !== undefined ? { concern: record.concern } : {}),
68
+ ...(record.data !== undefined ? { data: record.data } : {}),
69
+ };
70
+ logger[LEVEL_TO_LOG4JS[record.level]](payload);
71
+ }
72
+ sinks.add(log4js_sink);
73
+ // --- TCP sink ---
74
+ /**
75
+ * Mirror every canonical log record over a TCP `Connection` as a valid
76
+ * wire `{ type: "log" }` message. Returns a handle to detach.
77
+ *
78
+ * Fixed identity (`run_id`, `instance_id`) can be provided when the
79
+ * caller knows the binding upfront (e.g. an orchestrator forwarding
80
+ * to the daemon for a single run); otherwise the values come from the
81
+ * record's canonical fields.
82
+ */
83
+ export function attach_tcp_sink(connection, binding = {}) {
84
+ const sink = (record) => {
85
+ if (connection.is_closed)
86
+ return;
87
+ // The internal logger keeps `phase` / `agent` as compact scalar
88
+ // dev-facing fields. The wire LogPayload nests these under
89
+ // `phase: { name }` / `agent: { name }` ref objects, since the
90
+ // dev API only supplies a name (the orchestrator/daemon may
91
+ // later supply the id when assignment is built).
92
+ const payload = {
93
+ level: record.level,
94
+ message: record.message,
95
+ ...(record.phase !== undefined ? { phase: { name: record.phase } } : {}),
96
+ ...(record.agent !== undefined ? { agent: { name: record.agent } } : {}),
97
+ ...(record.data !== undefined ? { data: record.data } : {}),
98
+ };
99
+ const run_id = binding.run_id !== undefined ? binding.run_id : (record.run_id ?? null);
100
+ const instance_id = binding.instance_id !== undefined
101
+ ? binding.instance_id
102
+ : (record.instance_id ?? null);
103
+ try {
104
+ connection.send('log', payload, { run_id, instance_id });
105
+ }
106
+ catch {
107
+ // Connection might have closed mid-call; swallow so logging
108
+ // can never take the caller's process down.
109
+ }
110
+ };
111
+ return add_sink(sink);
112
+ }
113
+ /**
114
+ * Add a custom sink. Useful for tests and for embedding cliq logs into a
115
+ * host process's existing logging pipeline.
116
+ */
117
+ export function attach_sink(sink) {
118
+ return add_sink(sink);
119
+ }
120
+ function build_record(level, category, base, message, data) {
121
+ return {
122
+ level,
123
+ category,
124
+ ts: new Date().toISOString(),
125
+ message,
126
+ ...(base.run_id !== undefined ? { run_id: base.run_id } : {}),
127
+ ...(base.instance_id !== undefined ? { instance_id: base.instance_id } : {}),
128
+ ...(base.phase !== undefined ? { phase: base.phase } : {}),
129
+ ...(base.agent !== undefined ? { agent: base.agent } : {}),
130
+ ...(base.concern !== undefined ? { concern: base.concern } : {}),
131
+ ...(data !== undefined ? { data } : {}),
132
+ };
133
+ }
134
+ function make_logger(category, base) {
135
+ const make_method = (level) => (message, data) => {
136
+ emit(build_record(level, category, base, message, data));
137
+ };
138
+ // The `.debug/.info/.warn/.error` method names follow JS/TS convention
139
+ // (lowercase identifiers); the canonical `level` field on the wire is
140
+ // UPPERCASE per the protocol enum convention.
141
+ return {
142
+ category,
143
+ fields: base,
144
+ debug: make_method('DEBUG'),
145
+ info: make_method('INFO'),
146
+ warn: make_method('WARN'),
147
+ error: make_method('ERROR'),
148
+ with(extra) {
149
+ return make_logger(category, { ...base, ...extra });
150
+ },
151
+ };
152
+ }
153
+ /**
154
+ * Get a logger for `category`. `base_fields` are stamped onto every
155
+ * record produced by this logger (and any of its `.with(...)` children).
156
+ */
157
+ export function get_logger(category, base_fields = {}) {
158
+ return make_logger(category, base_fields);
159
+ }
160
+ // --- log4js layout: canonical NDJSON ---
161
+ log4js.addLayout('cliq_canonical', () => (event) => {
162
+ const data_arg = event.data?.[0];
163
+ const obj = (data_arg && typeof data_arg === 'object' && !Array.isArray(data_arg))
164
+ ? data_arg
165
+ : { message: event.data.map(String).join(' ') };
166
+ return JSON.stringify({
167
+ ts: new Date(event.startTime).toISOString(),
168
+ level: String(event.level.levelStr).toUpperCase(),
169
+ category: event.categoryName,
170
+ ...obj,
171
+ });
172
+ });
173
+ const FILE_DEFAULTS = { max_size: 10 * 1024 * 1024, backups: 3, compress: false };
174
+ const NDJSON_LAYOUT = { type: 'cliq_canonical' };
175
+ const CONSOLE_LAYOUT = {
176
+ type: 'pattern',
177
+ pattern: '%d{ISO8601_WITH_TZ_OFFSET} [%p] %c — %m',
178
+ };
179
+ function file_appender(cfg) {
180
+ return {
181
+ type: 'file',
182
+ filename: cfg.path,
183
+ maxLogSize: cfg.max_size ?? FILE_DEFAULTS.max_size,
184
+ backups: cfg.backups ?? FILE_DEFAULTS.backups,
185
+ compress: cfg.compress ?? FILE_DEFAULTS.compress,
186
+ layout: NDJSON_LAYOUT,
187
+ };
188
+ }
189
+ /**
190
+ * Configure log4js for this process. Idempotent — safe to call again.
191
+ * Loggers obtained from `get_logger` automatically pick up the new
192
+ * configuration on their next emission.
193
+ */
194
+ export function configure_logging(config = {}) {
195
+ const appenders = {};
196
+ const route = [];
197
+ if (config.console !== false) {
198
+ appenders['_console'] = {
199
+ type: 'stdout',
200
+ layout: config.console_ndjson ? NDJSON_LAYOUT : CONSOLE_LAYOUT,
201
+ };
202
+ route.push('_console');
203
+ }
204
+ if (config.process_file) {
205
+ appenders['_process_file'] = file_appender(config.process_file);
206
+ route.push('_process_file');
207
+ }
208
+ if (config.pipeline_file) {
209
+ appenders['_pipeline_file'] = file_appender(config.pipeline_file);
210
+ route.push('_pipeline_file');
211
+ }
212
+ if (config.agent_file) {
213
+ appenders['_agent_file'] = file_appender(config.agent_file);
214
+ route.push('_agent_file');
215
+ }
216
+ if (route.length === 0) {
217
+ // log4js requires at least one appender per category. Use a
218
+ // silent stdout sink so categories still register cleanly.
219
+ appenders['_silent'] = { type: 'stdout', layout: NDJSON_LAYOUT };
220
+ route.push('_silent');
221
+ }
222
+ // log4js accepts level names case-insensitively but conventionally
223
+ // takes them lowercase. Map our UPPERCASE protocol enum down at the
224
+ // boundary (`OFF` → `off` for tests).
225
+ const default_level = config.level ?? 'INFO';
226
+ const categories = {
227
+ default: { appenders: route, level: to_log4js_level(default_level) },
228
+ };
229
+ for (const [name, level] of Object.entries(config.category_levels ?? {})) {
230
+ categories[name] = { appenders: route, level: to_log4js_level(level) };
231
+ }
232
+ log4js.configure({ appenders, categories });
233
+ }
234
+ function to_log4js_level(level) {
235
+ if (level === 'OFF')
236
+ return 'off';
237
+ return LEVEL_TO_LOG4JS[level];
238
+ }
239
+ /**
240
+ * Flush and close all log4js appenders. Call before process exit to
241
+ * avoid losing buffered file writes.
242
+ */
243
+ export function shutdown_logging() {
244
+ return new Promise((resolve) => {
245
+ log4js.shutdown(() => resolve());
246
+ });
247
+ }
248
+ /**
249
+ * Register a sink that writes `category === 'execution'` records as NDJSON
250
+ * to stdout. Call once at process startup (e.g. daemon boot). Kubernetes
251
+ * log pipelines, Datadog agents, and Fluentd pick up these structured
252
+ * lines automatically.
253
+ */
254
+ export function attach_execution_sink() {
255
+ return add_sink((record) => {
256
+ if (record.category !== 'execution')
257
+ return;
258
+ const entry = {
259
+ ts: record.ts,
260
+ level: record.level,
261
+ category: record.category,
262
+ message: record.message,
263
+ };
264
+ if (record.run_id)
265
+ entry.run_id = record.run_id;
266
+ if (record.instance_id)
267
+ entry.instance_id = record.instance_id;
268
+ if (record.phase)
269
+ entry.phase = record.phase;
270
+ if (record.agent)
271
+ entry.agent = record.agent;
272
+ if (record.concern)
273
+ entry.concern = record.concern;
274
+ if (record.data) {
275
+ for (const [k, v] of Object.entries(record.data)) {
276
+ entry[k] = v;
277
+ }
278
+ }
279
+ try {
280
+ process.stdout.write(JSON.stringify(entry) + '\n');
281
+ }
282
+ catch { /* stdout closed — swallow */ }
283
+ });
284
+ }
285
+ /** Record a chunk of run output (trailing whitespace trimmed) as an execution `log` entry. */
286
+ export function emit_execution_log(run_id, chunk, fields) {
287
+ emit(build_record('INFO', 'execution', { run_id, ...fields }, chunk.trimEnd(), { kind: 'log' }));
288
+ }
289
+ /** Record a run event (`event_type`, optional payload) as an execution `event` entry. */
290
+ export function emit_execution_event(run_id, event_type, fields, payload) {
291
+ emit(build_record('INFO', 'execution', { run_id, ...fields }, event_type, {
292
+ kind: 'event',
293
+ event_type,
294
+ ...(payload != null ? { payload } : {}),
295
+ }));
296
+ }
297
+ /** Record that a phase produced an artifact as an execution `artifact` entry. */
298
+ export function emit_execution_artifact(run_id, phase, artifact) {
299
+ emit(build_record('INFO', 'execution', { run_id, phase }, `artifact:${artifact.name}`, {
300
+ kind: 'artifact',
301
+ artifact_name: artifact.name,
302
+ artifact_kind: artifact.kind,
303
+ ...(artifact.mime_type ? { mime_type: artifact.mime_type } : {}),
304
+ }));
305
+ }
306
+ //# sourceMappingURL=logging.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging.js","sourceRoot":"","sources":["../src/logging.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;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